From 746c51c7011a37fb7ff5cbf91601639dc51fb122 Mon Sep 17 00:00:00 2001 From: Hare Date: Tue, 23 Jun 2026 14:41:34 +0900 Subject: [PATCH] ticket: accept protocol ts generation --- .../artifacts/orchestration-plan.jsonl | 1 + .yoi/tickets/00001KVSEBF56/item.md | 4 +- .yoi/tickets/00001KVSEBF56/thread.md | 70 +++++++++++++++++++ 3 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 .yoi/tickets/00001KVSEBF56/artifacts/orchestration-plan.jsonl diff --git a/.yoi/tickets/00001KVSEBF56/artifacts/orchestration-plan.jsonl b/.yoi/tickets/00001KVSEBF56/artifacts/orchestration-plan.jsonl new file mode 100644 index 00000000..f72a5bdc --- /dev/null +++ b/.yoi/tickets/00001KVSEBF56/artifacts/orchestration-plan.jsonl @@ -0,0 +1 @@ +{"id":"orch-plan-20260623-054125-1","ticket_id":"00001KVSEBF56","kind":"accepted_plan","accepted_plan":{"summary":"Feature-split `crates/protocol` so tokio JSONL stream is optional, generate Workspace web TypeScript types from protocol wire DTOs with drift checking, import generated types from frontend, and record minimal backend proxy stance without implementing full Worker operation UI.","branch":"impl/00001KVSEBF56-protocol-typescript-types","worktree":"/home/hare/Projects/yoi/.worktree/00001KVSEBF56-protocol-typescript-types","role_plan":"Orchestrator creates a dedicated child worktree and spawns a narrow-scope Coder. Reviewer will be spawned read-only after Coder reports implementation commit(s). After approval, Orchestrator integrates into `orchestration`, validates protocol/frontend/Nix, records closure, and cleans only the child worktree/branch."},"author":"yoi-orchestrator","at":"2026-06-23T05:41:25Z"} diff --git a/.yoi/tickets/00001KVSEBF56/item.md b/.yoi/tickets/00001KVSEBF56/item.md index ccf52ab7..be87f3ed 100644 --- a/.yoi/tickets/00001KVSEBF56/item.md +++ b/.yoi/tickets/00001KVSEBF56/item.md @@ -1,8 +1,8 @@ --- title: 'Generate Workspace web TypeScript types from protocol crate' -state: 'queued' +state: 'inprogress' created_at: '2026-06-23T05:13:22Z' -updated_at: '2026-06-23T05:40:01Z' +updated_at: '2026-06-23T05:41:25Z' assignee: null queued_by: 'workspace-panel' queued_at: '2026-06-23T05:40:01Z' diff --git a/.yoi/tickets/00001KVSEBF56/thread.md b/.yoi/tickets/00001KVSEBF56/thread.md index 14ce4793..7efc7a18 100644 --- a/.yoi/tickets/00001KVSEBF56/thread.md +++ b/.yoi/tickets/00001KVSEBF56/thread.md @@ -30,4 +30,74 @@ Marked ready by `yoi ticket state`. 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 `orchestration` at `615c0250`; target worktree / branch is not present。 +- Existing code map confirms `crates/protocol` currently has `tokio` dependency and `stream.rs` enabled unconditionally, while frontend has local hand-written types for Workspace entities but no generated protocol types yet。 + +IntentPacket: + +Intent: +- Make `crates/protocol` the 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 default `stream` feature; 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-features` passes, 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 protocol` passes。 +- Deno check/build passes。 +- `git diff --check` and `nix build .#yoi --no-link` pass 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-rs` if 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.ts` or 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-rs` feature annotations is invasive, cover a useful initial subset and document unsupported types clearly, but keep `Method`, `Event`, and `Segment` included。 +- For `uuid::Uuid`, `PathBuf`, `serde_json::Value`, choose clear TS representations (`string`, `unknown`/JSON value, etc.) and document/test them。 + +Escalate if: +- `ts-rs` cannot represent current serde-tagged enums without unacceptable manual mirrors。 +- Making protocol DTOs wasm/no-default-features compatible requires broad type redesign beyond optional `stream` feature。 +- 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 --check` +- `cargo test -p protocol` +- `cargo check -p protocol --target wasm32-unknown-unknown --no-default-features` +- Type generation drift check command/test。 +- `cd web/workspace && deno task check && deno task build` +- `git diff --check` +- `cargo run -p yoi -- ticket doctor` +- `nix build .#yoi --no-link` if 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. + ---