ticket: route deno and inflight snapshot work

This commit is contained in:
2026-06-21 19:58:49 +09:00
parent b4786b407a
commit 155e039e66
6 changed files with 161 additions and 4 deletions
@@ -0,0 +1 @@
{"id":"orch-plan-20260621-105843-1","ticket_id":"00001KVMT2J25","kind":"accepted_plan","accepted_plan":{"summary":"Implement protocol/pod/TUI support for connect-time snapshot of in-flight assistant text, thinking, and tool-call args so late attach/reconnect displays unfinished blocks and continues live deltas without gaps or duplicates.","branch":"impl/00001KVMT2J25-inflight-snapshot","worktree":"/home/hare/Projects/yoi/.worktree/00001KVMT2J25-inflight-snapshot","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/pod/TUI tests, records closure, and cleans only the child worktree/branch."},"author":"yoi-orchestrator","at":"2026-06-21T10:58:43Z"}
+2 -2
View File
@@ -1,8 +1,8 @@
---
title: 'Pod protocol: in-flight LLM response reconnect snapshot should include unfinished blocks'
state: 'queued'
state: 'inprogress'
created_at: '2026-06-21T10:02:01Z'
updated_at: '2026-06-21T10:56:32Z'
updated_at: '2026-06-21T10:58:43Z'
assignee: null
readiness: 'implementation_ready'
risk_flags: ['protocol', 'session-history', 'persistence', 'tui-reconnect', 'stream-state']
+78
View File
@@ -111,4 +111,82 @@ Deno 移行 refinement は誤付与として分離済み。`00001KVMT2J25` は
Ticket を `workspace-panel` が queued にしました。
---
<!-- event: decision author: yoi-orchestrator at: 2026-06-21T10:58:27Z -->
## Decision
Routing decision: `implementation_ready`
Reason:
- Ticket body は in-flight LLM response reconnect snapshot の問題、affected blocks、protocol/pod/TUI relevant files、acceptance criteria、validation が具体化されている。
- `readiness: implementation_ready` で、relations / orchestration plan に blocker はない。
- Requirements sync で Deno refinement は誤付与として分離済みで、この Ticket は original protocol reconnect scope に戻されている。
- 同時 queued の `00001KVMV03QY` は frontend Deno tooling migration であり、この Ticket の protocol/pod/TUI stream-state work と主対象が異なるため並列実装可能と判断する。
- Orchestrator worktree は clean on `orchestration` at `b4786b40` で、対象 Ticket 用 worktree / branch は未作成。
Evidence checked:
- Ticket body / thread / artifacts via `TicketShow` and direct `item.md` read。
- `TicketRelationQuery(00001KVMT2J25)`: no relations / blockers。
- `TicketOrchestrationPlanQuery(00001KVMT2J25)`: no records。
- Orchestrator git state / worktree list / branch list checked from `/home/hare/Projects/yoi/.worktree/orchestration` only。
- Bounded code map:
- `crates/protocol/src/lib.rs`: `Event::Snapshot`, `TextDelta`, `ThinkingDelta`, `ToolCallArgsDelta`, serialization tests。
- `crates/pod/src/segment_log_sink.rs`: committed `LogEntry` snapshot / live entry receiver。
- `crates/pod/src/controller.rs`: direct broadcast of streaming deltas and current controller comments around stream reconstruction。
- `crates/pod/src/ipc/server.rs`: connect-time snapshot event construction。
- `crates/tui/src/app.rs`: `restore_snapshot` and live delta handling for text/thinking/tool-call args。
IntentPacket:
Intent:
- Ensure late attach / reconnect during an in-flight LLM response can display already-generated unfinished text/thinking/tool-call args, then continue live deltas without gaps or duplicates。
Binding decisions / invariants:
- Fix at protocol/pod state level, not TUI-only workaround。
- Do not persist unfinished model output as finalized assistant history。
- Do not mutate/replay provider stream itself。
- Preserve committed session-log gap-free semantics。
- Preserve post-run reconnect behavior from finalized Snapshot entries。
- No hidden context/history injection。
- Keep in-flight snapshot bounded and typed; if large/unbounded policy is required, escalate。
Requirements / acceptance criteria:
- New client connecting during response sees unfinished assistant text, thinking/reasoning, and tool-call args generated before connect。
- Live deltas after connect append to same logical block without missing or duplicated content。
- Completed run reconnect still restores finalized transcript from normal Snapshot entries。
- Snapshot/live boundary gap-free / duplicate-free behavior is tested。
- TUI Snapshot restore + live delta handling has regression coverage。
- Focused validation covers protocol/pod/TUI relevant paths。
Implementation latitude:
- Add structured `in_flight` state to `Event::Snapshot`, or implement bounded/sequence replay buffer if cleaner。
- Controller/Pod may keep current accumulators for text/thinking/tool-call args。
- TUI may seed unfinished blocks from Snapshot and continue applying live deltas to the same block。
- Wire compatibility should be minimal; prioritize type safety and maintainability。
Escalate if:
- Design requires persisting unfinished output as durable history item。
- In-flight snapshot state becomes large enough to need truncation/bounding policy beyond a straightforward current-turn accumulator。
- Public protocol compatibility policy becomes a product decision。
- Scope spreads to Dashboard/Pod list preview or broader UX surfaces beyond TUI/console attach。
Validation plan:
- `cargo fmt --check`
- Focused `cargo test -p protocol` roundtrip/serialization tests for snapshot in-flight state。
- Focused `cargo test -p pod` tests for connect-time snapshot/live boundary and accumulator behavior。
- Focused `cargo test -p tui` tests for snapshot seeding plus live delta continuation。
- `cargo check -p protocol -p pod -p tui`
- `git diff --check`
- `yoi ticket doctor`
---
<!-- event: state_changed author: yoi-orchestrator at: 2026-06-21T10:58:33Z from: queued to: inprogress reason: human_authorized_unblocked_protocol_stream_state_implementation field: state -->
## State changed
Human authorized queue routing from Workspace Dashboard. Ticket has concrete acceptance criteria, no recorded blockers, and is semantically separate from the frontend Deno tooling Ticket, so Orchestrator accepts implementation.
---