ticket: accept panel mouse and rewind routing

This commit is contained in:
2026-06-13 19:57:19 +09:00
parent 68f1631672
commit 20daae0c59
9 changed files with 197 additions and 5 deletions
+78
View File
@@ -108,4 +108,82 @@ LocalTicketBackend によって作成されました。
Ticket を `workspace-panel` が queued にしました。
---
<!-- event: decision author: orchestrator at: 2026-06-13T10:56:29Z -->
## Decision
Routing decision: implementation_ready
Reason:
- Ticket は `queued` で、症状、既知の関連実装、受け入れ条件、調査範囲、実装 latitude、escalation conditions が具体化されている。
- `TicketRelationQuery``TicketOrchestrationPlanQuery` で blocker / ordering / conflict 記録は見つからなかった。
- 関連の closed Ticket `00001KSKBPBX0` は rewind picker / RewindTo flow の既存実装背景として確認済みで、本 Ticket はその follow-up bugfix として独立に扱える。
- risk flags は `tui-state` / `rewind` / `stream-sync` だが、Ticket は rewind 成功時に live 表示を snapshot/remaining session に同期する invariant と、generation id / reload を含む実装 latitude を明記しており、実装前に不足する設計判断はない。
- 現 Orchestrator worktree は clean。root/original workspace では git/read/write/validate せず、実装は専用 child worktree に隔離する。
- 主な変更面は single-Pod rewind / app state / Pod RewindTo response path で、Panel mouse selection Ticket `00001KV072V89` の panel row hit-test surface とは分離できるため並列開始候補にする。
Evidence checked:
- Ticket body / thread / artifactsartifacts なし)。
- relation records: なし。
- orchestration plan records: なし。
- related Ticket `00001KSKBPBX0` の intent / prior rewind picker scope。
- code map: `crates/tui/src/single_pod.rs` の rewind picker/UI flow、`crates/tui/src/app.rs` の app state / event handling、`crates/pod/src/**``RewindTo` / `RewindApplied` path、`crates/protocol` の response type 周辺。
- workspace/Pod state: Orchestrator worktree clean、visible live implementation Pods なし。
IntentPacket:
Intent:
- rewind picker で Enter により RewindTo が成功した後、TUI live 表示が巻き戻し後の session tail / snapshot 状態へ確実に同期されるようにする。
Binding decisions / invariants:
- RewindTo の成功通知だけを見て cosmetic reload するのではなく、表示 state と Pod/session state の整合を保つ。
- rewind は破壊的 state operation なので、古い generation / stale stream / stale pending reload が live 表示を再汚染しないこと。
- TUI-local state fix を優先し、Pod の永続 session model / history authority を不必要に変更しない。
- 未完了 run や stream 中の rewind を勝手に許可しない。既存 idle/control constraints を尊重する。
Requirements / acceptance criteria:
- rewind picker Enter 後、成功した rewind target より後の old output / live tail が残らない。
- 成功後の composer/status/actionbar が既存 UX と矛盾しない。
- no-op / cancelled / failed rewind では表示を誤って消さない。
- stale stream/update が rewind 後の表示を復活させない。
- focused tests で rewind success / failure / stale update などを確認する。
Implementation latitude:
- Pod response に既存情報で足りるなら TUI 側 reload/generation 管理で直す。
- 既存 protocol が足りない場合は最小の typed response 拡張を検討してよいが、protocol/API の互換境界を変える必要がある場合は escalation する。
- UI reload のタイミング、generation id、snapshot再取得、buffer clear のどれを使うかは bounded investigation に委ねる。
Escalate if:
- protocol/API の public contract を大きく変える必要がある。
- rewind の history authority / persisted session semantics を変更しないと直せない。
- stream中 rewind許可や concurrent run semantics の設計判断が必要になる。
- fix が broad TUI event-loop rewrite を要求する。
Validation:
- focused TUI/app rewind tests、必要なら Pod protocol/unit tests。
- `cargo fmt --check`
- `git diff --check`
- 変更範囲に応じて `cargo test -p tui` / `cargo test -p pod` / `cargo check --workspace --all-targets`
Current code map:
- `crates/tui/src/single_pod.rs`: rewind picker input/display flow。
- `crates/tui/src/app.rs`: session item/live state、pending reload、generation/stream handling の候補。
- `crates/pod/src/**` and `crates/protocol/**`: `RewindTo` / `RewindApplied` response path and typed metadata。
Critical risks / reviewer focus:
- 成功 rewind 後に old assistant output / live tail が残らないこと。
- failed/cancelled rewind の no-op semantics。
- stale stream/reload ordering。
- persisted history authority を TUI 側都合で歪めていないこと。
---
<!-- event: state_changed author: orchestrator at: 2026-06-13T10:56:45Z from: queued to: inprogress reason: orchestrator_acceptance field: state -->
## State changed
Ticket evidence、relations、orchestration plan、関連 closed Ticket、bounded code map、Orchestrator worktree clean state を確認した。blocking relation はなく、rewind live refresh の要件・invariants・escalation conditions は実装可能な粒度で記録済み。実装 side effect の前に routing decision / IntentPacket / accepted plan を記録したため、専用 child worktree と Coder delegation に進む。
---