ticket: add workspace follow-up items
This commit is contained in:
@@ -0,0 +1,118 @@
|
||||
---
|
||||
title: 'Pod protocol: in-flight LLM response reconnect snapshot should include unfinished blocks'
|
||||
state: 'ready'
|
||||
created_at: '2026-06-21T10:02:01Z'
|
||||
updated_at: '2026-06-21T10:23:54Z'
|
||||
assignee: null
|
||||
readiness: 'implementation_ready'
|
||||
risk_flags: ['protocol', 'session-history', 'persistence', 'tui-reconnect', 'stream-state']
|
||||
---
|
||||
|
||||
## User claims / request snapshot
|
||||
|
||||
- プロトコル実装の問題として、LLM 応答中に接続すると、まだ完了していない block の途中内容が欠落する。
|
||||
- 応答完了後に接続し直すと見える。
|
||||
- 対象 workspace は `yoi`。Panel handoff の orchestrator Pod は `yoi-orchestrator`。
|
||||
|
||||
## Confirmed facts / sources
|
||||
|
||||
- 既存 Ticket 確認:
|
||||
- active duplicate は見当たらない。
|
||||
- `00001KSVP63K8` は in-flight TUI composer injection で、実行中 turn への入力注入の設計 Ticket。今回の「途中出力の late attach / reconnect 表示欠落」とは別件。
|
||||
- `crates/protocol/src/lib.rs`
|
||||
- `Event::Snapshot` は接続開始時に一度送られ、`entries` は subscribe 時点の session-log mirror。
|
||||
- コメント上、Snapshot 後の live 更新は `TextDelta` / `ToolCall*` / `ToolResult` 等で流れ、generic な committed entry broadcast はない。
|
||||
- `crates/pod/src/segment_log_sink.rs`
|
||||
- `SegmentLogSink::subscribe_with_snapshot()` は committed `LogEntry` の prefix と live receiver を gap-free に分ける設計。
|
||||
- `AssistantItem` / `ToolResult` などは mirror には反映されるが live broadcast されず、live 表示は streaming events に依存する。
|
||||
- `crates/pod/src/controller.rs`
|
||||
- text / thinking / tool-call args の途中 delta は `Event::TextDelta` / `ThinkingDelta` / `ToolCallArgsDelta` として direct broadcast される。
|
||||
- `crates/tui/src/app.rs`
|
||||
- Snapshot は `restore_snapshot(&entries, greeting)` で session-log entries から復元される。
|
||||
- live delta は TUI 側で block に追記される。
|
||||
- 以上から、コード上も「接続前に流れたがまだ committed history になっていない途中 delta」を late subscriber が復元する lane が見当たらない。
|
||||
|
||||
## Unverified hypotheses
|
||||
|
||||
- 実際の欠落原因は、未完了 block の accumulator が `Event::Snapshot` に含まれず、live subscriber は subscribe 後の delta しか受け取れないことだと思われる。
|
||||
- 応答完了後に再接続すると見えるのは、finalized assistant/tool history が session log mirror に committed され、Snapshot entries から復元できるためだと思われる。
|
||||
- 修正は、protocol-level に in-flight block state を snapshot へ含める、または bounded replay/sequence 付き live event buffer を導入する形が自然そう。
|
||||
|
||||
## Undecided points / open questions
|
||||
|
||||
- blocking な未決定点はなし。
|
||||
- 実装戦術として、`Event::Snapshot` に structured `in_flight` state を追加するか、sequence 付き replay buffer を使うかは Coder がコード調査して選んでよい。
|
||||
- protocol crate の wire shape 変更なので、既存 serde roundtrip / older snapshot fallback をどこまで持つかは実装時に最小限で判断する。不要な後方互換は作らない。
|
||||
|
||||
## Background
|
||||
|
||||
LLM の応答中に Console / TUI / attach client が接続した場合、ユーザーはその時点までに出ている assistant text、thinking、tool-call args などの unfinished block を見られる必要がある。現在の構造では、接続時 Snapshot は committed session-log entries だけを seed し、途中 delta は live broadcast のみなので、接続前に流れた unfinished delta が見えない可能性がある。
|
||||
|
||||
## Requirements
|
||||
|
||||
- LLM 応答中に新しく接続・再接続した client が、接続時点までに蓄積済みの unfinished block 内容を表示できるようにする。
|
||||
- 対象 block は少なくとも以下を含む:
|
||||
- assistant text streaming block
|
||||
- thinking/reasoning streaming block
|
||||
- tool-call arguments streaming block
|
||||
- Snapshot と Snapshot 後の live events の境界で、欠落も重複も起こさない。
|
||||
- 応答完了後の reconnect では、従来通り finalized session-log から完全な表示を復元できること。
|
||||
- protocol-level の整合性として直す。TUI だけの偶然の workaround にしない。
|
||||
- 未完了 model output を、finalized assistant history として誤って永続化しない。
|
||||
- prompt/history/context に hidden injection しない。
|
||||
|
||||
## Acceptance criteria
|
||||
|
||||
- LLM 応答中に client が接続した場合、接続前に生成済みの unfinished text / thinking / tool-call args が表示される。
|
||||
- 接続後に続く delta は同じ block に継続して追記され、途中内容の欠落・二重表示がない。
|
||||
- Run 完了後に接続し直しても、finalized transcript は従来通り Snapshot entries から復元される。
|
||||
- Snapshot/live 境界の gap-free / duplicate-free 性をテストで確認する。
|
||||
- TUI の `Event::Snapshot` 処理と live delta 処理の regression がない。
|
||||
- focused validation として、少なくとも protocol/pod/TUI の関連 test または unit test が追加・更新される。
|
||||
|
||||
## Binding decisions / invariants
|
||||
|
||||
- 「応答完了後に接続し直せば見える」は workaround であり、正しい完了条件ではない。
|
||||
- Late attach は、実行中 Pod の現在表示可能な stream state を復元できるべき。
|
||||
- Committed session-log の gap-free semantics は壊さない。
|
||||
- Unfinished block は finalized assistant history と混同しない。
|
||||
- Provider stream 自体を巻き戻したり mutate したりしない。
|
||||
- Hidden context/history injection はしない。
|
||||
|
||||
## Implementation latitude
|
||||
|
||||
- `Event::Snapshot` に in-flight block state を追加する案、または bounded/sequence 付き stream replay buffer を導入する案のどちらでもよい。
|
||||
- Controller / Pod 側で text/thinking/tool-call args の current accumulator を保持する設計にしてよい。
|
||||
- TUI 側は Snapshot から unfinished block を seed し、その後の live delta を同一 block に継続適用できればよい。
|
||||
- wire compatibility は必要最小限。長期保守・型安全性を優先する。
|
||||
|
||||
## Readiness
|
||||
|
||||
- readiness: implementation_ready
|
||||
- risk_flags: [protocol, session-history, persistence, tui-reconnect, stream-state]
|
||||
|
||||
## Escalation conditions
|
||||
|
||||
- unfinished output をどの durable history item として永続化するかの設計変更が必要になった場合。
|
||||
- Snapshot に含める in-flight state が大きくなり、boundedness / memory usage / truncation policy が必要になった場合。
|
||||
- protocol public surface として互換方針を決める必要が出た場合。
|
||||
- TUI だけではなく Dashboard / Pod list preview など複数 surface の UX 方針に広がる場合。
|
||||
|
||||
## Validation
|
||||
|
||||
- `cargo test -p protocol` の relevant roundtrip / serialization tests。
|
||||
- `cargo test -p pod` の subscriber/snapshot/live-stream focused tests。
|
||||
- `cargo test -p tui` または targeted app snapshot/live delta tests。
|
||||
- `cargo fmt --check`
|
||||
- 必要なら `cargo check -p pod -p tui -p protocol`
|
||||
|
||||
## Related work
|
||||
|
||||
- Related but not duplicate:
|
||||
- `00001KSVP63K8` — Support immediate in-flight TUI composer injection
|
||||
- Relevant files:
|
||||
- `crates/protocol/src/lib.rs`
|
||||
- `crates/pod/src/segment_log_sink.rs`
|
||||
- `crates/pod/src/controller.rs`
|
||||
- `crates/pod/src/pod.rs`
|
||||
- `crates/tui/src/app.rs`
|
||||
@@ -0,0 +1,105 @@
|
||||
<!-- event: create author: LocalTicketBackend at: 2026-06-21T10:02:01Z -->
|
||||
|
||||
## 作成
|
||||
|
||||
LocalTicketBackend によって作成されました。
|
||||
|
||||
---
|
||||
|
||||
<!-- event: state_changed author: workspace-panel at: 2026-06-21T10:07:42Z from: ready to: planning reason: panel_return_to_planning field: state -->
|
||||
|
||||
## State changed
|
||||
|
||||
Panel returned ready Ticket 00001KVMT2J25 to planning for requirements sync. This is not Queue routing and must not start implementation.
|
||||
|
||||
## User refinement instruction
|
||||
|
||||
今あるフロントSPAをnodeからdenoにしたい。
|
||||
https://hareworks.net/blog/tech/sveltekit-with-deno
|
||||
|
||||
|
||||
---
|
||||
|
||||
<!-- event: comment author: ticket-intake at: 2026-06-21T10:09:52Z -->
|
||||
|
||||
## Comment
|
||||
|
||||
## Intake requirements sync result
|
||||
|
||||
対象 Ticket `00001KVMT2J25` の item/thread/artifacts と関連 Ticket/source を確認した結果、今回の refinement instruction はこの Ticket の既存スコープとは一致しないため、`00001KVMT2J25` を ready に戻したり queue routing したりせず、requirements sync の結果としてここに記録する。
|
||||
|
||||
### User claims / request snapshot
|
||||
|
||||
- ユーザーは「今あるフロントSPAを node から deno にしたい」と述べた。
|
||||
- 参考 URL として `https://hareworks.net/blog/tech/sveltekit-with-deno` が提示された。
|
||||
|
||||
### Confirmed facts / sources
|
||||
|
||||
- `00001KVMT2J25` の item は「Attach mid-stream TUI client without losing in-flight content」で、protocol / pod / TUI reconnect / stream-state の実装 Ticket である。
|
||||
- `00001KVMT2J25` の thread には、Panel が ready から planning に戻した理由として上記 frontend/Deno refinement instruction が記録されている。
|
||||
- 関連する closed Ticket `00001KVMFFYVX` は Workspace web control plane bootstrap で、SvelteKit static SPA skeleton を `web/workspace` に追加した作業である。
|
||||
- `web/workspace/README.md` は現在の package manager を npm とし、`npm install`, `npm run check`, `npm run build` を案内している。
|
||||
- `web/workspace/package.json` は SvelteKit static SPA の scripts / devDependencies を持ち、`package-lock.json` が存在する。
|
||||
- `web/workspace/svelte.config.js` は `@sveltejs/adapter-static` を使い、`build/` に static output を出す設定である。
|
||||
- `package.nix` は `web/workspace/node_modules`, `.svelte-kit`, `build` を source filter から除外している。
|
||||
- `devshell.nix` には `deno` が含まれている。
|
||||
|
||||
### Intake conclusion
|
||||
|
||||
- この refinement は `00001KVMT2J25` の late-attach / stream-state work item とは別目的であり、同一 Ticket の requirements / acceptance criteria に混ぜると work item が破綻する。
|
||||
- 既存の frontend bootstrap Ticket `00001KVMFFYVX` は closed であり、現在の npm 採用は当時の bootstrap decision / implementation detail として記録されている。Deno 移行は closed Ticket の再オープンではなく、別の concrete follow-up Ticket として扱うのが妥当。
|
||||
- 現時点では、ユーザーが「新規 Ticket を作成して」と明示していないため、duplicate/new Ticket は作成しない。
|
||||
|
||||
### Candidate follow-up draft if user approves new Ticket
|
||||
|
||||
Title: Workspace web SPA の frontend tooling を npm/Node から Deno に移行する
|
||||
|
||||
Readiness: implementation_ready
|
||||
Risk flags: [frontend-tooling, packaging, nix-source-filter, validation]
|
||||
|
||||
Requirements:
|
||||
- `web/workspace` の開発・検証・build 手順を npm/Node 前提から Deno 前提へ移行する。
|
||||
- SvelteKit static SPA であること、Rust backend が business/API authority を持つこと、static output が `web/workspace/build/` に出ることは維持する。
|
||||
- `web/workspace/README.md` の package manager / command guidance を Deno 前提に更新する。
|
||||
- lockfile と依存関係管理を Deno 前提で明確にし、古い npm lockfile/source-of-truth が残る場合は理由を明示する。
|
||||
- generated artifacts (`node_modules`, `.svelte-kit`, `build` など) が git/Nix package source に混入しない状態を維持する。
|
||||
|
||||
Acceptance criteria:
|
||||
- `web/workspace` の check/build が Deno command で成功する。
|
||||
- README と project files から、通常の frontend 作業者が Deno で install/check/build できることが分かる。
|
||||
- npm lockfile / npm scripts / Node-only guidance が不要なら削除され、必要なら Deno 移行後も残す理由が code/docs に明確である。
|
||||
- `package.nix` / devshell / repository hygiene が Deno 移行後の generated artifacts と矛盾しない。
|
||||
- 既存の Rust backend static serving assumptions と `.yoi` records as authority の境界を変えない。
|
||||
|
||||
Implementation latitude:
|
||||
- Deno project layout は `deno.json` / `deno.lock` / `deno task` を使う形でよい。
|
||||
- SvelteKit/Vite を Deno の npm compatibility で動かすか、最小限の package metadata を残すかは実装時に選んでよい。ただし source-of-truth と command guidance は曖昧にしない。
|
||||
|
||||
Validation:
|
||||
- `cd web/workspace && deno task check`
|
||||
- `cd web/workspace && deno task build`
|
||||
- `git diff --check`
|
||||
- packaging/source-filter を変更する場合は `nix build .#yoi --no-link` または Orchestrator が妥当と判断する同等確認
|
||||
|
||||
Next routing recommendation:
|
||||
- `00001KVMT2J25` はこの refinement では implementation_ready に戻さない。
|
||||
- ユーザーが Deno 移行の新規 Ticket 作成を承認した場合、上記 draft を別 Ticket として materialize する。
|
||||
- ユーザーがあくまで `00001KVMT2J25` の差し替えを望む場合は、既存 Ticket を repurpose するのではなく、Orchestrator/maintainer に cancel/close/replacement 方針の判断を戻す。
|
||||
|
||||
---
|
||||
|
||||
<!-- event: intake_summary author: ticket-intake at: 2026-06-21T10:23:54Z -->
|
||||
|
||||
## Intake summary
|
||||
|
||||
ユーザーから、Deno 移行 refinement は `00001KVMT2J25` に誤って付いたものであり、`00001KVMT2J25` は ready に戻してよいとの明示指示があった。再確認したところ、`00001KVMT2J25` の body は late attach / in-flight stream snapshot の concrete work item で、readiness は `implementation_ready`、blocking open question はない。Deno 移行は別 Ticket `00001KVMV03QY` として作成済みであり、本 Ticket の要件には混ぜない。
|
||||
|
||||
---
|
||||
|
||||
<!-- event: state_changed author: ticket-intake at: 2026-06-21T10:23:54Z from: planning to: ready reason: requirements_sync_resolved field: state -->
|
||||
|
||||
## State changed
|
||||
|
||||
Deno 移行 refinement は誤付与として分離済み。`00001KVMT2J25` は元の protocol reconnect / unfinished block snapshot Ticket として Orchestrator routing 可能な ready 状態へ戻す。queue routing や implementation start は行わない。
|
||||
|
||||
---
|
||||
Reference in New Issue
Block a user