From 1a2097b10dc97db988b4e043f1a6ce95775c4137 Mon Sep 17 00:00:00 2001 From: Hare Date: Wed, 8 Jul 2026 19:39:25 +0900 Subject: [PATCH] ticket: accept backend resource fetch work --- .../artifacts/orchestration-plan.jsonl | 1 + .yoi/tickets/00001KX0G06VA/item.md | 4 +- .yoi/tickets/00001KX0G06VA/thread.md | 97 +++++++++++++++++++ 3 files changed, 100 insertions(+), 2 deletions(-) diff --git a/.yoi/tickets/00001KX0G06VA/artifacts/orchestration-plan.jsonl b/.yoi/tickets/00001KX0G06VA/artifacts/orchestration-plan.jsonl index 257b80e5..fd55ad9a 100644 --- a/.yoi/tickets/00001KX0G06VA/artifacts/orchestration-plan.jsonl +++ b/.yoi/tickets/00001KX0G06VA/artifacts/orchestration-plan.jsonl @@ -1,2 +1,3 @@ {"id":"orch-plan-20260708-100506-1","ticket_id":"00001KX0G06VA","kind":"before","related_ticket":"00001KWZ5KERY","note":"Ticket body defines this resource fetch REST API as the prerequisite for `00001KWZ5KERY` Decodal ProfileSourceArchive prefetch/verify. Current workspace already has `00001KWZ5KERY` inprogress on branch `work/00001KWZ5KERY-decodal-profile-archive`, with overlapping worker-runtime/workspace-server surfaces and external review pending. Do not parallelize/start this Ticket until the active Decodal branch outcome is known and an integration order is chosen.","author":"orchestrator","at":"2026-07-08T10:05:06Z"} {"id":"orch-plan-20260708-100516-2","ticket_id":"00001KX0G06VA","kind":"waiting_capacity_note","note":"Queue review found this Ticket otherwise implementation-ready, but it is intentionally left queued because `00001KWZ5KERY` is already inprogress/review on the same worker-runtime/workspace-server ProfileSourceArchive surfaces while this Ticket text states it should precede that work. Starting now would create a high-conflict branch and could invalidate the active Decodal review. Re-route/start after the active Decodal branch is approved/blocked or after an explicit integration-order decision.","author":"orchestrator","at":"2026-07-08T10:05:16Z"} +{"id":"orch-plan-20260708-103903-3","ticket_id":"00001KX0G06VA","kind":"accepted_plan","accepted_plan":{"summary":"Decodal ProfileSourceArchive work `00001KWZ5KERY` は完了・merge・closed 済みになったため、前回の waiting reason は解除された。`00001KX0G06VA` を順当に開始し、resource fetch REST API を Decodal implementation 後続として実装する。","branch":"work/00001KX0G06VA-resource-fetch-api","worktree":"/home/hare/Projects/yoi/.worktree/00001KX0G06VA-resource-fetch-api","role_plan":"単一 sibling Coder Pod に implementation worktree を委譲し、Runtime-to-Backend resource handle / broker / direct+HTTP fetch contract / Runtime client-cache / profile_source_archive v0 integration / authority-boundary tests を実装する。完了後、別 sibling Reviewer Pod で Ticket IntentPacket / Decodal integration / redaction・authority invariants に照らして read-only review する。"},"author":"orchestrator","at":"2026-07-08T10:39:03Z"} diff --git a/.yoi/tickets/00001KX0G06VA/item.md b/.yoi/tickets/00001KX0G06VA/item.md index 4c90f33c..fc172db2 100644 --- a/.yoi/tickets/00001KX0G06VA/item.md +++ b/.yoi/tickets/00001KX0G06VA/item.md @@ -1,8 +1,8 @@ --- title: 'Add Runtime-to-Backend resource fetch REST API' -state: 'queued' +state: 'inprogress' created_at: '2026-07-08T09:12:33Z' -updated_at: '2026-07-08T10:05:32Z' +updated_at: '2026-07-08T10:39:16Z' assignee: null queued_by: 'workspace-panel' queued_at: '2026-07-08T10:04:10Z' diff --git a/.yoi/tickets/00001KX0G06VA/thread.md b/.yoi/tickets/00001KX0G06VA/thread.md index 43591513..92452f53 100644 --- a/.yoi/tickets/00001KX0G06VA/thread.md +++ b/.yoi/tickets/00001KX0G06VA/thread.md @@ -62,3 +62,100 @@ Escalate if: - resource-fetch API の public/auth/capability model が Decodal Ticket の recorded invariants を変える必要がある場合。 --- + + + +## Decision + +Routing decision: implementation_ready + +Reason: +- 前回この Ticket を queued のまま保持した理由は、`00001KWZ5KERY` が inprogress/review 中で、同一 worker-runtime / workspace-server / ProfileSourceArchive prefetch surface に触れるためだった。 +- 現在 `00001KWZ5KERY` は closed になり、implementation branch も orchestration branch に merge 済みで、previous blocker は解消している。 +- この Ticket は Runtime -> Backend resource fetch REST API / resource handle / broker / Runtime client/cache / authority-boundary tests の intent と acceptance criteria が具体化されている。 +- typed relation blocker は 0 件。既存 OrchestrationPlan の `before 00001KWZ5KERY` / waiting note は過去の並列停止理由として確認したが、Decodal 側が完了済みのため現在の acceptance blocker ではない。 +- queued notification と今回の user follow-up「ないなら順当に消化して」により、human authorized routing/start の条件を満たす。 + +Evidence checked: +- Ticket body / thread / artifacts。 +- `TicketRelationQuery(00001KX0G06VA)`: 0 件。 +- `TicketOrchestrationPlanQuery(00001KX0G06VA)`: prior `before 00001KWZ5KERY` と waiting note を確認。 +- Orchestrator worktree git status: clean on `orchestration`。 +- queued Ticket 一覧: この Ticket 1件のみ。inprogress は 0 件。 +- `00001KWZ5KERY` は close 済みで、merge commit `0334c572` と close commit `ffc16dea` が orchestration branch にある。 + +IntentPacket: + +Intent: +- Runtime が Workspace filesystem を直接読まずに Backend-owned resource を取得できる Runtime-to-Backend resource fetch REST API を追加する。 +- Backend-issued typed resource handle と Backend resource broker を導入し、v0 resource kind `profile_source_archive` を fetch / verify / cache できるようにする。 +- 既存 Decodal ProfileSourceArchive implementation を、この resource fetch boundary に接続または将来接続しやすい形に整理する。 + +Binding decisions / invariants: +- Browser-facing API に Backend internal endpoint、resource credential、resource handle、raw path、Runtime endpoint/token/socket/session path を出さない。 +- Runtime は Backend-issued resource handle なしに Workspace-derived resource を取得できない。 +- handle には resource kind、workspace/scope id、resource id/digest、operation、expiry/nonce/revision/generation、redaction/max-bytes/content-type、audit correlation id を含める。 +- handle には raw Backend URL、host absolute path、secret value、Browser request 由来 raw filesystem scope を含めない。 +- v0 resource kind は `profile_source_archive`。Memory/Ticket/Objective tool backend 本体は非目標。 +- Runtime-local filesystem discovery を増やさず、Backend authority / redaction / audit / capability 境界を保つ。 +- WebSocket/persistent bidirectional channel は非目標。v0 は request/response REST/direct call。 + +Requirements / acceptance criteria: +- typed request/response schema の Runtime -> Backend resource fetch API がある。 +- embedded Runtime direct call path と remote Runtime HTTP path が同じ resource contract を使う。 +- Backend が resource handle を発行/検証し、`profile_source_archive` bytes を返せる。 +- Runtime が resource handle から archive を fetch / digest verify / cache できる。 +- expired / unauthorized / workspace-runtime-worker mismatch / missing resource / digest mismatch / oversized response は typed diagnostic。 +- Browser-facing response redaction が tests で確認される。 + +Implementation latitude: +- exact endpoint/module/type names、cache layout、handle signing/nonce representation、audit record shape、profile archive integration depth は既存 Runtime/Workspace Server style に合わせてよい。 +- 既存 `ConfigBundle` / `ProfileSourceArchive` machinery は維持しつつ、resource handle fetch boundary を追加する形でよい。 +- v0 で remote Runtime full auth hardening が不足する場合は typed diagnostic と focused tests で境界を示す。 + +Escalate if: +- secret synchronization、Memory/Ticket/Objective tool implementations、persistent channel、Plugin package manager、multi-tenant auth、public Browser handle exposure、or Decodal archive format redesign が必要になる場合。 + +Validation: +- `cargo test -p worker-runtime --features ws-server,fs-store` +- `cargo test -p yoi-workspace-server` +- `cargo check -p yoi` +- `cd web/workspace && deno task check && deno task test` +- `git diff --check` +- `yoi ticket doctor` +- `nix build .#yoi --no-link` + +Current code map: +- Decodal/Profile archive current implementation: `crates/worker-runtime/src/profile_archive.rs`, `config_bundle.rs`, `worker_backend.rs`, `runtime.rs`, `http_server.rs`, `catalog.rs`。 +- Backend/Runtime bridge: `crates/workspace-server/src/hosts.rs`, `server.rs`, `companion.rs`。 +- Protocol/runtime request shapes: `crates/protocol/src/lib.rs`, `crates/worker-runtime` request/response structs。 + +Critical risks / reviewer focus: +- resource handles must not become Browser-visible bearer authorities。 +- endpoint/token/raw path/internal store/runtime details must stay out of Browser-facing surfaces。 +- direct and remote Runtime paths must share contract rather than diverging ad hoc。 +- digest/max-bytes/content-type validation must fail closed。 +- profile archive fetch integration must not reintroduce Runtime workspace filesystem discovery。 + +--- + + + +## State changed + +Queued acceptance recorded after user follow-up 「06VAが進まない理由は何?ないなら順当に消化して」。 + +Checked context: +- Ticket body / thread / artifacts。 +- `TicketRelationQuery(00001KX0G06VA)`: blocking relation 0 件。 +- `TicketOrchestrationPlanQuery(00001KX0G06VA)`: prior waiting note は `00001KWZ5KERY` inprogress/review によるもの。`00001KWZ5KERY` は now closed / merged。 +- Orchestrator worktree git status: clean on `orchestration`。 +- queued Ticket はこの Ticket 1件のみ。inprogress は 0 件。 + +Acceptance basis: +- previous waiting reason は解消済み。 +- concrete missing decision / information は残っていない。 +- Ticket の scope は Runtime-to-Backend resource fetch REST API v0 と `profile_source_archive` kind に閉じており、Memory/Ticket/Objective tool backend 本体、persistent channel、secret sync、plugin package manager は非目標として明確。 +- side effect はこの `queued -> inprogress` acceptance 後に、worktree-workflow に沿って implementation worktree を作成してから開始する。 + +---