9.3 KiB
作成
LocalTicketBackend によって作成されました。
Intake summary
Marked ready by yoi ticket state.
State changed
Marked ready by yoi ticket state.
State changed
Ticket を workspace-panel が queued にしました。
Decision
Routing decision: implementation_ready
Reason:
- Ticket body has concrete requirements for protocol DTO feature-splitting, generated TypeScript types, generated-output drift check, and Workspace web integration stance。
- No blocking relations / orchestration plan records exist。
- Current queued Ticket is this Ticket only。
- Orchestrator worktree is clean on
orchestrationat615c0250; target worktree / branch is not present。 - Existing code map confirms
crates/protocolcurrently hastokiodependency andstream.rsenabled unconditionally, while frontend has local hand-written types for Workspace entities but no generated protocol types yet。
IntentPacket:
Intent:
- Make
crates/protocolthe Rust authority for Pod wire DTOs and generate Workspace web TypeScript types from those DTOs instead of hand-writing protocol mirror types。
Binding decisions / invariants:
- DTO authority remains Rust
crates/protocol; do not create a separate web-only protocol authority。 - Browser must not connect directly to Pod Unix sockets。
- Backend proxy may be design-recorded or minimally scaffolded, but must preserve Worker identity resolution and method allow/block boundary; do not implement broad Worker operation UI in this Ticket。
stream.rs/ JSONL tokio transport should be optional behind a defaultstreamfeature; DTO-only crate should compile without tokio for wasm/no-default-features。- Generated TypeScript must reflect serde wire shape for tagged enums / rename conventions as closely as practical。
- Generated artifacts should be committed only if they are intended import artifacts and have a drift check。
- Avoid broad protocol redesign or permission-model invention。
Requirements / acceptance criteria:
cargo check -p protocol --target wasm32-unknown-unknown --no-default-featurespasses, or if target installation is unavailable in environment, the code is structured correctly and validation limitation is documented。- Protocol root types at least include
Method,Event,Segment, and related DTOs needed by Worker operation UI / stream display。 - Workspace web can import generated protocol TypeScript types from a generated directory/file。
- Generated-output drift check exists, e.g. cargo test/generator check that fails if committed generated TS is stale。
cargo test -p protocolpasses。- Deno check/build passes。
git diff --checkandnix build .#yoi --no-linkpass if dependencies/package hash changed。- Backend proxy stance is represented in implementation or design notes without direct browser-to-Pod socket exposure。
Implementation latitude:
- Use
ts-rsif it fits; otherwise choose a small generator that preserves serde-tagged shape and is reviewable。 - Put generated types under
web/workspace/src/lib/generated/protocol.tsor similarly clear generated path。 - Generator can be a test in
protocol, a small binary/example, or another deterministic Cargo path; keep it simple and reproducible。 - If adding
ts-rsfeature annotations is invasive, cover a useful initial subset and document unsupported types clearly, but keepMethod,Event, andSegmentincluded。 - For
uuid::Uuid,PathBuf,serde_json::Value, choose clear TS representations (string,unknown/JSON value, etc.) and document/test them。
Escalate if:
ts-rscannot represent current serde-tagged enums without unacceptable manual mirrors。- Making protocol DTOs wasm/no-default-features compatible requires broad type redesign beyond optional
streamfeature。 - Generated file would include secret/project-local content or nondeterministic ordering。
- Backend proxy implementation scope expands into full Worker operation UI/session WebSocket implementation。
Validation plan:
cargo fmt --checkcargo test -p protocolcargo check -p protocol --target wasm32-unknown-unknown --no-default-features- Type generation drift check command/test。
cd web/workspace && deno task check && deno task buildgit diff --checkcargo run -p yoi -- ticket doctornix build .#yoi --no-linkif Cargo.lock/package.nix/source behavior changes。
State changed
Human authorized queue routing from Workspace Dashboard. Ticket has concrete acceptance criteria and no recorded blockers, so Orchestrator accepts implementation.
Implementation report
Implementation start report:
- Created child implementation worktree:
/home/hare/Projects/yoi/.worktree/00001KVSEBF56-protocol-typescript-types
- Created branch:
impl/00001KVSEBF56-protocol-typescript-types
- Base commit:
746c51c7 ticket: accept protocol ts generation
- Confirmed tracked Ticket project records are visible in the child worktree。
- Confirmed
.yoi/memoryhas no tracked/untracked entries in the child worktree check。 - Spawned sibling Coder Pod:
yoi-coder-00001KVSEBF56
- Coder scope:
- read:
/home/hare/Projects/yoi - write:
/home/hare/Projects/yoi/.worktree/00001KVSEBF56-protocol-typescript-types
- read:
Next action:
- Wait for Coder implementation report, then spawn Reviewer read-only for the implementation diff。
Implementation report
Coder implementation report received from yoi-coder-00001KVSEBF56.
Implementation commit:
a13fb693 protocol: generate workspace TypeScript types
Changed areas:
crates/protocol- Made
streamoptional behind default featurestream。 - Added optional
typescriptfeature usingts-rs。 - Added
cfg_attr(feature = "typescript", derive(ts_rs::TS))to protocol DTOs。 - Added deterministic generator module and example:
crates/protocol/src/typescript.rscrates/protocol/examples/generate_typescript.rs
- Added drift check:
cargo test -p protocol --features typescript generated_protocol_types_are_current
- Made
web/workspace- Added generated TypeScript artifact:
web/workspace/src/lib/generated/protocol.ts
- Re-exported generated root protocol types from workspace sidebar types:
PodProtocolMethodPodProtocolEventPodProtocolSegment
- Added generated TypeScript artifact:
crates/workspace-server- Updated extension-point notes to explicitly preserve no direct browser-to-Pod socket exposure and require future Workspace-server proxy enforcement of Worker identity / method allow-block boundaries。
- Packaging/dependencies:
- Updated
Cargo.lock。 - Updated
package.nixcargoHash。
- Updated
Coder validation reported:
cargo fmt --check: passedcargo test -p protocol: passedcargo test -p protocol --features typescript generated_protocol_types_are_current: passedcargo test -p protocol --features typescript: passedcargo check -p protocol --target wasm32-unknown-unknown --no-default-features: passedcd web/workspace && deno task check && deno task build: passedcargo run -p yoi -- ticket doctor: passedgit diff --check: passednix build .#yoi --no-link: passed
Generated artifact cleanup:
- Only intended generated TypeScript import artifact is tracked。
- Orchestrator removed ignored
web/workspace/node_modules/before Reviewer routing; no ignored frontend artifacts remain underweb/workspace。
Orchestrator evidence checked:
- Worktree clean on
impl/00001KVSEBF56-protocol-typescript-typesata13fb693。 - Diff
746c51c7..HEADtouches expected protocol/frontend/workspace-server/package files only。 git diff --check 746c51c7..HEAD: passed。
Next action:
- Route to read-only Reviewer Pod for acceptance review。
Comment
Review routing:
Spawned read-only Reviewer Pod:
yoi-reviewer-00001KVSEBF56-r1
Review target:
- Worktree:
/home/hare/Projects/yoi/.worktree/00001KVSEBF56-protocol-typescript-types - Branch:
impl/00001KVSEBF56-protocol-typescript-types - Baseline:
746c51c7 - Implementation commit:
a13fb693 protocol: generate workspace TypeScript types - Diff:
746c51c7..a13fb693
Reviewer scope:
- read-only
/home/hare/Projects/yoi
Reviewer focus:
- Generated TS shape vs serde wire shape。
Method/Event/Segmentcoverage。- Deterministic drift check。
streamfeature gating and wasm/no-default protocol compile。- No direct browser-to-Pod socket implication。
- Package/Nix updates。
Orchestrator will wait for reviewer verdict before integration。