20 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:
- Dashboard Queue により routing 許可済み。
- 本 Ticket は後続 adapter / Companion 実行 Ticket の前段となる execution backend boundary であり、具体的な
workercrate adapter 実装は Non-goal として分離されている。 - Outgoing blocking relation はなく、current
inprogressは 0。orchestration worktree is clean。 - Downstream queued Tickets (
00001KW55B33B,00001KW55B33H) は本 Ticket 完了まで待機させる。
Evidence checked:
- Ticket body: execution backend boundary、input rejection/dispatch、protocol event publish hook、Worker model invariant、Browser-facing non-leak、Non-goals、acceptance criteria。
- Relations: incoming/downstream dependency chain is present via queued Tickets; this Ticket itself has no unresolved outgoing blocker。
- Orchestration plan: accepted plan
orch-plan-20260627-190733-1recorded。 - Code context: current
worker-runtime::Runtime/catalog/workspace-server::hostshave Runtime/Worker model and projection foundation but no concrete execution backend boundary yet。 - Workspace state: queued 3 / inprogress 0、orchestration clean。
IntentPacket:
Intent:
worker-runtimeに Worker execution backend 境界を追加し、Runtime が input-capable Worker と backend-unconnected placeholder を混同しないようにする。
Binding decisions / invariants:
- Execution backend 未接続 Worker への user input は accepted にしない。
- Runtime 自身が fake / providerless assistant response を生成しない。
- Worker transcript / observation は正規 contract とし、
can_stream_events/can_read_bounded_transcriptを public capability として復活させない。 - Execution backend handle / socket path / credential / session path / raw worker handle は Browser-facing API に出さない。
- 既存
workercrate への具体 adapter 接続、Workspace Companion real LLM execution、Web Console UX redesign は実装しない。
Requirements / acceptance criteria:
worker-runtimeに execution backend trait / handle / enum / lifecycle contract がある。- backend connected Worker の input dispatch 境界と run state/busy/rejected/errored typed result がある。
- stop/cancel unsupported は typed rejection。
- protocol event を Runtime observation bus へ publish する hook がある。
- Focused tests が backend 未接続 input rejection、connected backend input dispatch boundary、observation publish hook を確認する。
cargo test -p worker-runtime --features ws-server,cargo test -p yoi-workspace-server,cargo check -p yoi,git diff --check,nix build .#yoi --no-linkが通る。
Implementation latitude:
- Backend boundary の具体型名、trait sync/asyncの形、test backend/fake backend の実装、Runtime state/projectionの最小変更は Coder が既存
worker-runtimedesign に合わせて選べる。 workspace-serverprojection に必要な最小 diagnostic/state 表現は追加してよい。- 既存
workercrate adapter に必要そうな shape は見越してよいが、実 adapter 実装はしない。
Escalate if:
workercrate に大きく手を入れないと boundary 自体が定義できない。- Browser-facing API に raw execution handle/path/credential を出す必要が出る。
- public capability として
can_stream_events/can_read_bounded_transcriptを戻さないと UI/API が成立しない。 - fake/providerless response を再導入しないと tests/UX が通らない。
Validation:
cargo fmt --allcargo test -p worker-runtime --features ws-servercargo test -p yoi-workspace-servercargo check -p yoigit diff --check- 可能なら
nix build .#yoi --no-link
Critical risks / reviewer focus:
- backend 未接続 Worker が input accepted になる regression。
- Runtime-generated fake/providerless assistant response の再導入。
- Browser-facing projection に execution backend internals/path/credential/session が漏れること。
- Worker transcript/observation を optional display capability として扱うこと。
- 後続 adapter Ticket の scope を先取りしすぎること。
State changed
Routing decision: implementation_ready。
Ticket body / relation / workspace state / accepted plan を確認し、Worker execution backend boundary slice は unblocked と判断した。Downstream queued Tickets は本 Ticket の completion を待つ。accepted plan と IntentPacket は thread / orchestration plan に記録済み。
これ以降、worktree creation / coder Worker routing などの implementation side effect に進める。
Implementation report
Implementation kickoff:
- Worktree created:
/home/hare/Projects/yoi/.worktree/00001KW55B32Y-worker-runtime-execution-backend - Branch:
work/00001KW55B32Y-worker-runtime-execution-backend - Coder Worker spawned:
yoi-coder-00001KW55B32Y-exec-backend
Scope notes:
- Coder has read access to the implementation worktree and non-recursive workspace root identity path needed by runtime startup.
- Coder write scope is limited to
crates/worker-runtime/**,crates/workspace-server/**, rootCargo.toml,Cargo.lock, andpackage.nixif dependency/package changes are needed. - Coder is instructed not to modify Ticket records and not to operate in root/orchestration worktrees.
Queued dependency notes:
00001KW55B33Bremains queued while this execution backend boundary is inprogress.00001KW55B33Hremains queued behind00001KW55B33B.
Implementation report
Implementation report:
実装完了。マージ / close / cleanup は未実施。
Commit:
2d5971738478f832ba9a135601ea11dda60c565d feat: add worker execution backend boundary
変更概要:
worker-runtime
追加/変更:
crates/worker-runtime/src/execution.rsを追加。WorkerExecutionBackendtraitWorkerExecutionHandleWorkerExecutionContextWorkerExecutionStatusWorkerExecutionRunStateWorkerExecutionResultWorkerExecutionOperationWorkerExecutionOutcomeWorkerExecutionSpawnRequestWorkerExecutionSpawnResult
Runtime::with_execution_backend(...)を追加。Runtime::with_fs_store_and_execution_backend(...)を追加。WorkerSummary/WorkerDetailにexecutionstatus を追加。Runtime::create_worker(...)- backend 接続時は spawn/initialize 境界を呼ぶ。
- backend 未接続時は
execution.backend = unconnected。
Runtime::send_input(...)- backend 未接続 Worker への input を
WorkerExecutionUnavailableで拒否。 - backend dispatch が
Busy/Rejected/Errored/Unsupportedを返した場合、typedWorkerExecutionRejectedとして拒否。 - dispatch accept 後のみ transcript / event / observation を通常 Worker contract として記録。
- backend 未接続 Worker への input を
Runtime::stop_worker(...)/cancel_worker(...)- active かつ connected handle ありの場合は backend lifecycle 境界を呼ぶ。
- default backend implementation は unsupported typed rejection。
- backend から Runtime observation bus へ
protocol::Eventを publish できる hook を追加。 - HTTP API error mapping に execution unavailable/rejected を追加。
workspace-server
- Embedded Worker input unavailable diagnostic を LLM 固有表現から execution backend 境界表現へ変更。
embedded_worker_execution_unavailable
- RuntimeRegistry / Backend projection のテストで、Browser-facing JSON に以下が出ないことを確認。
can_stream_eventscan_read_bounded_transcript- raw URL/path/socket/session/credential/provider 系の既存禁止項目。
Validation:
cargo fmt --all: successcargo test -p worker-runtime --features ws-server: successcargo test -p yoi-workspace-server: successcargo check -p yoi: successgit diff --check: successnix build .#yoi --no-link: success
Residual risks / review focus:
- concrete
workercrate adapter は意図通り未実装。下流 Ticket00001KW55B33B側で今回のWorkerExecutionBackendtrait に接続する想定。 - Embedded Runtime は現時点では backend-unconnected placeholder のままなので、workspace-server 側では input unavailable diagnostic を返す。
- backend trait は sync 境界として実装。実 adapter 実装時に async/process lifecycle、busy state、cancel semantics のレビューが必要。
WorkerSummary/WorkerDetailの public JSON にexecutionが増えるが、handle/path/socket/credential/session/manifest など raw internals は含めていない。
Implementation report
Review kickoff:
Reviewer Worker spawned for 00001KW55B32Y implementation.
- Reviewer Worker:
yoi-reviewer-00001KW55B32Y-exec-backend - Review target commit:
2d5971738478f832ba9a135601ea11dda60c565d feat: add worker execution backend boundary - Review mode: read-only implementation worktree review
Review focus:
- backend-unconnected input rejection and no transcript/event acceptance
- connected fake backend input dispatch boundary
- protocol event publish hook correctness
- stop/cancel unsupported typed rejection
- no fake/providerless assistant response
- no
can_stream_events/can_read_bounded_transcriptpublic capability regression - no raw execution handle/path/socket/session/credential leakage
- no scope creep into concrete
workercrate adapter or Companion real LLM execution
Review: request changes
request_changes
ブロッカー:
worker-runtimeの既存 feature 組み合わせws-server + fs-storeがコンパイル不能。今回追加された observation bus 用フィールドがRuntimeState::from_persistedで初期化されていない。- 実行:
CARGO_TARGET_DIR=/tmp/yoi-review-target-00001KW55B32Y cargo check -p worker-runtime --features "ws-server fs-store" - 失敗:
crates/worker-runtime/src/runtime.rs:925 - エラー: missing fields
next_observation_sequence,observation_events,observation_txin initializer ofRuntimeState - 既存の fs-store runtime path と ws observation path の組み合わせを壊す regression なので修正が必要。
- 実行:
確認した範囲では、Ticket の主眼自体は概ね実装されている:
- unconnected Worker input は typed
WorkerExecutionUnavailableで拒否され、user transcript / observation event は追加されない。 - connected fake backend による input dispatch test がある。
protocol::Eventを observation bus に publish する hook と test がある。- stop/cancel unsupported は typed rejection になる。
- fake/providerless/canned assistant response 生成は見当たらない。
can_stream_events/can_read_bounded_transcriptの public capability 復活は見当たらない。- Browser-facing projection で raw backend handle/socket/session/credential/path を漏らす変更は見当たらない。
- concrete
workercrate adapter / Companion real LLM execution への scope creep は見当たらない。
追加検証:
git diff --check HEAD~1..HEAD: pass- 作業ツリーは review 後も clean。
Implementation report
Change-response implementation report:
Reviewer blocker を修正済み。マージ / close / cleanup は未実施。
Fix commit:
761b60c85750d03c119733a088fb5073f9b37e9a fix: initialize restored worker observations
修正内容:
RuntimeState::from_persisted の fs-store restore path で、ws-server feature 有効時の observation bus 状態を初期化するようにした。
追加初期化:
next_observation_sequence: 1observation_events: VecDeque::new()observation_tx: broadcast::channel(256).0
また、fs_store_restores_workers_events_and_transcripts に ws-server 有効時の focused assertion を追加し、restore 後の Runtime でも observe_worker_event / read_worker_observation_events が動くことを確認した。
Validation:
CARGO_TARGET_DIR=/tmp/yoi-review-target-00001KW55B32Y cargo check -p worker-runtime --features "ws-server fs-store": successcargo fmt --all: successcargo test -p worker-runtime --features ws-server: successcargo test -p worker-runtime --features "ws-server fs-store": successcargo test -p yoi-workspace-server: successcargo check -p yoi: successgit diff --check: successnix build .#yoi --no-link: success
Residual risk / review focus:
- observation events 自体は fs-store 永続化対象ではないため、restore 後の observation backlog は空から開始する。これは既存の observation bus/backlog の揮発的性質に沿った修正。
- 今回は compile blocker の修正に限定し、backend adapter や永続 observation replay の設計拡張は行っていない。
Review: approve
approve
確認結果:
- 先回ブロッカーだった
ws-server + fs-storeのRuntimeState::from_persisted初期化漏れは修正済み。next_observation_sequenceobservation_eventsobservation_txが restore path で初期化されていることを確認。
- 追加 test で restored Runtime の
observe_worker_event/read_worker_observation_eventsが検証されていることを確認。 - 手元検証:
CARGO_TARGET_DIR=/tmp/yoi-review-target-00001KW55B32Y cargo check -p worker-runtime --features "ws-server fs-store": passCARGO_TARGET_DIR=/tmp/yoi-review-target-00001KW55B32Y cargo test -p worker-runtime --features "ws-server fs-store": pass
- original Ticket invariants について、前回確認済みの内容から regression は見当たらない。
- backend-unconnected input rejection / transcript 非追加
- fake/providerless assistant response なし
- fake backend dispatch boundary
- protocol event publish hook
- stop/cancel unsupported typed rejection
can_stream_events/can_read_bounded_transcriptpublic capability 復活なし- Browser-facing projection で raw backend internals/path/credential leak なし
- concrete
workercrate adapter / Companion real LLM execution への scope creep なし
作業ツリーも clean のまま。
Implementation report
Merge / validation report:
Implementation branch was integrated into the orchestration branch after reviewer approval.
Integrated commits:
2d5971738478f832ba9a135601ea11dda60c565d feat: add worker execution backend boundary761b60c85750d03c119733a088fb5073f9b37e9a fix: initialize restored worker observations
Merge commit:
0753e155 merge: worker runtime execution backend
Validation in orchestration worktree:
cargo fmt --all --check: successcargo test -p worker-runtime --features ws-server: successcargo test -p worker-runtime --features "ws-server fs-store": successcargo test -p yoi-workspace-server: successcargo check -p yoi: successgit diff --check: successnix build .#yoi --no-link: success
Outcome:
worker-runtimenow has an explicit Worker execution backend boundary.- Backend-unconnected Workers reject input rather than accepting it or producing fake/providerless assistant responses.
- Connected backend dispatch and observation publish hooks are covered by focused tests.
ws-server + fs-storerestore path initializes observation bus state and is validated.- Browser-facing projections continue not to expose raw backend handle/path/socket/session/credential internals or legacy public
can_stream_events/can_read_bounded_transcriptcapabilities.
State changed
Reviewer approval後に implementation branch を orchestration branch へ merge し、要求された validation が成功したため done に遷移する。
Validation:
cargo fmt --all --check: successcargo test -p worker-runtime --features ws-server: successcargo test -p worker-runtime --features "ws-server fs-store": successcargo test -p yoi-workspace-server: successcargo check -p yoi: successgit diff --check: successnix build .#yoi --no-link: success
State changed
Ticket を closed にしました。
完了
worker-runtime に Worker execution backend 境界を追加し、reviewer approval 後に orchestration branch へ merge した。
実装内容:
WorkerExecutionBackendtrait / handle / context / status / result / operation / outcome を追加。- backend 未接続 Worker への input を typed
WorkerExecutionUnavailableとして拒否。 - backend dispatch の busy / rejected / errored / unsupported を typed rejection として扱う。
- backend から Runtime observation bus へ
protocol::Eventを publish する hook を追加。 - stop / cancel unsupported の typed rejection を追加。
WorkerSummary/WorkerDetailに raw handle/path/credential を含まない execution status projection を追加。- Runtime が fake/providerless assistant response を生成しない境界を維持。
can_stream_events/can_read_bounded_transcriptpublic capability は復活させていない。ws-server + fs-storerestore path で observation bus state を正しく初期化。
Integrated commits:
2d5971738478f832ba9a135601ea11dda60c565d feat: add worker execution backend boundary761b60c85750d03c119733a088fb5073f9b37e9a fix: initialize restored worker observations- merge:
0753e155 merge: worker runtime execution backend
Validation:
cargo fmt --all --check: successcargo test -p worker-runtime --features ws-server: successcargo test -p worker-runtime --features "ws-server fs-store": successcargo test -p yoi-workspace-server: successcargo check -p yoi: successgit diff --check: successnix build .#yoi --no-link: success
Cleanup は child implementation worktree / branch と related role Pods のみを対象に実施する。