From 06e43f2aba7f42acb407cecb9761f30cbcc1df3c Mon Sep 17 00:00:00 2001 From: toki Date: Fri, 7 Aug 2026 08:43:16 +0900 Subject: [PATCH] =?UTF-8?q?chore(epic):=20plan-work-review=20=EC=A4=80?= =?UTF-8?q?=EB=B9=84=20=EA=B2=B0=EA=B3=BC=EB=A5=BC=20=EA=B2=80=EC=A6=9D?= =?UTF-8?q?=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PLAN-cloud-G09.md | 9 +- .../18+17_plan_stage/CODE_REVIEW-cloud-G06.md | 2 +- .../18+17_plan_stage/PLAN-local-G06.md | 8 +- .../19+18_work_stage/CODE_REVIEW-cloud-G08.md | 2 +- .../19+18_work_stage/PLAN-cloud-G08.md | 8 +- .../CODE_REVIEW-cloud-G07.md | 154 ++++++++++++++++++ .../20+19_review_repair/PLAN-cloud-G07.md | 150 +++++++++++++++++ .../code_review_cloud_G09_0.log | 0 .../code_review_cloud_G09_1.log} | 0 .../plan_cloud_G09_0.log | 0 .../plan_cloud_G09_1.log} | 0 .../CODE_REVIEW-cloud-G08.md | 140 ++++++++++++++++ .../PLAN-local-G08.md | 121 ++++++++++++++ .../CODE_REVIEW-cloud-G07.md | 141 ++++++++++++++++ .../PLAN-local-G07.md | 125 ++++++++++++++ 15 files changed, 847 insertions(+), 13 deletions(-) create mode 100644 agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/CODE_REVIEW-cloud-G07.md create mode 100644 agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/PLAN-cloud-G07.md rename agent-task/m-iop-owned-single-request-agent-execution/{20+19_review_stage => 20+19_review_repair}/code_review_cloud_G09_0.log (100%) rename agent-task/m-iop-owned-single-request-agent-execution/{20+19_review_stage/CODE_REVIEW-cloud-G09.md => 20+19_review_repair/code_review_cloud_G09_1.log} (100%) rename agent-task/m-iop-owned-single-request-agent-execution/{20+19_review_stage => 20+19_review_repair}/plan_cloud_G09_0.log (100%) rename agent-task/m-iop-owned-single-request-agent-execution/{20+19_review_stage/PLAN-cloud-G09.md => 20+19_review_repair/plan_cloud_G09_1.log} (100%) create mode 100644 agent-task/m-iop-owned-single-request-agent-execution/21+20_single_request_executor/CODE_REVIEW-cloud-G08.md create mode 100644 agent-task/m-iop-owned-single-request-agent-execution/21+20_single_request_executor/PLAN-local-G08.md create mode 100644 agent-task/m-iop-owned-single-request-agent-execution/22+21_executor_activation/CODE_REVIEW-cloud-G07.md create mode 100644 agent-task/m-iop-owned-single-request-agent-execution/22+21_executor_activation/PLAN-local-G07.md diff --git a/agent-task/m-iop-owned-single-request-agent-execution/17_internal_artifact_wire/PLAN-cloud-G09.md b/agent-task/m-iop-owned-single-request-agent-execution/17_internal_artifact_wire/PLAN-cloud-G09.md index cf92d82a..c1670645 100644 --- a/agent-task/m-iop-owned-single-request-agent-execution/17_internal_artifact_wire/PLAN-cloud-G09.md +++ b/agent-task/m-iop-owned-single-request-agent-execution/17_internal_artifact_wire/PLAN-cloud-G09.md @@ -66,8 +66,9 @@ The coordinator can create request-owned Node workspace state only as a side eff ### Verification Context - No verification handoff was supplied. Repository-native sources were `agent-test/local/rules.md`, `client-smoke.md`, `edge-smoke.md`, `node-smoke.md`, and `platform-common-smoke.md` plus the Makefile `proto`/`proto-dart` targets. -- Preflight: branch `feature/iop-owned-single-request-agent-execution`, HEAD `3bb4a24ad750a9ce5b7754a70db24545554ba238`, clean worktree; Go `1.26.2 linux/arm64`, protoc `29.3`, `protoc-gen-go`, `protoc-gen-dart`, and Flutter `3.41.5` are available. -- Baseline command passed: `go test ./apps/edge/internal/service ./apps/edge/internal/openai ./apps/edge/internal/input ./apps/edge/internal/transport ./apps/node/internal/workspace ./apps/node/internal/node ./apps/node/internal/transport ./packages/go/workspaceprotocol -count=1`. +- Original plan preflight at HEAD `3bb4a24ad750a9ce5b7754a70db24545554ba238` found a clean worktree; Go `1.26.2 linux/arm64`, protoc `29.3`, `protoc-gen-go`, `protoc-gen-dart`, and Flutter `3.41.5` were available. +- The original baseline command passed at that preflight: `go test ./apps/edge/internal/service ./apps/edge/internal/openai ./apps/edge/internal/input ./apps/edge/internal/transport ./apps/node/internal/workspace ./apps/node/internal/node ./apps/node/internal/transport ./packages/go/workspaceprotocol -count=1`. +- Fresh Epic preparation review used branch `feature/iop-owned-single-request-agent-execution` at checkpoint `f4dad6ba88ae442e08ab67f49a5b1a65dd4719e9`; production source matches that checkpoint and only active task-artifact refinement changes are present. Implementation and fresh final verification remain unstarted. - Constraints: local deterministic tests use ephemeral connections and temporary directories; no provider endpoint or credential is required. Actual Claude/Mac qualification is owned by SDD S12 `claude-smoke` and is not completion evidence for this packet. - Confidence: high. Current source already owns secure artifact creation and exact cleanup inventory; the missing pieces are a bounded read primitive, a closed wire family, and coordinator lifecycle integration. @@ -87,7 +88,9 @@ No symbol is renamed or removed. `SingleRequestController` at `apps/edge/interna - `17_internal_artifact_wire`: stable contract is a closed `PLAN`/`REVIEW` artifact read/write wire plus coordinator-owned open/cleanup; PASS is proto regeneration and cross-Edge/Node lifecycle tests. No new sibling predecessor is required. - `18+17_plan_stage`: consumes this contract to write the plan artifact. - `19+18_work_stage`: consumes the completed plan runner and artifact read. -- `20+19_review_stage`: consumes Work to persist review evidence and activate the composite executor. +- `20+19_review_repair`: consumes Work to implement and persist Review/repair evidence. +- `21+20_single_request_executor`: consumes the completed stages to compose the private executor without production activation. +- `22+21_executor_activation`: installs the proven executor and synchronizes the active contract/spec. - Indices 01-16 are occupied by archived siblings under the same task group; only directory basenames were inspected for collision-free allocation, not archive contents. ### Scope Rationale diff --git a/agent-task/m-iop-owned-single-request-agent-execution/18+17_plan_stage/CODE_REVIEW-cloud-G06.md b/agent-task/m-iop-owned-single-request-agent-execution/18+17_plan_stage/CODE_REVIEW-cloud-G06.md index e1c33f3d..dcc82712 100644 --- a/agent-task/m-iop-owned-single-request-agent-execution/18+17_plan_stage/CODE_REVIEW-cloud-G06.md +++ b/agent-task/m-iop-owned-single-request-agent-execution/18+17_plan_stage/CODE_REVIEW-cloud-G06.md @@ -105,7 +105,7 @@ _Paste actual output here._ ### 5. No incomplete production activation -`rg --sort path -n 'SetSingleRequestExecutor|NewSingleRequestExecutor' apps/edge --glob '*.go'` +`test ! -e apps/edge/internal/openai/single_request_executor.go && bash -c 'set -euo pipefail; if rg --sort path -n "NewSingleRequestExecutor|SetSingleRequestExecutor" apps/edge/internal/input/manager.go; then exit 1; else test $? -eq 1; fi'` ```text _Paste actual output here._ diff --git a/agent-task/m-iop-owned-single-request-agent-execution/18+17_plan_stage/PLAN-local-G06.md b/agent-task/m-iop-owned-single-request-agent-execution/18+17_plan_stage/PLAN-local-G06.md index a1ae4962..4d589c9b 100644 --- a/agent-task/m-iop-owned-single-request-agent-execution/18+17_plan_stage/PLAN-local-G06.md +++ b/agent-task/m-iop-owned-single-request-agent-execution/18+17_plan_stage/PLAN-local-G06.md @@ -8,7 +8,7 @@ Filling the implementation-owned sections of `CODE_REVIEW-cloud-G06.md` is the m ## Background -Marked single-request admission freezes canonical Plan/Work/Review model names and options, but it does not preserve the managed route facts needed to dispatch a provider stage. No provider-specific runner currently converts the immutable Anthropic task into a bounded Gemini Plan request or persists its result. This packet adds a reusable non-streaming managed-stage codec and the S08 Plan runner, while leaving production executor installation to the Review packet. +Marked single-request admission freezes canonical Plan/Work/Review model names and options, but it does not preserve the managed route facts needed to dispatch a provider stage. No provider-specific runner currently converts the immutable Anthropic task into a bounded Gemini Plan request or persists its result. This packet adds a reusable non-streaming managed-stage codec and the S08 Plan runner, while leaving Review, composite construction, and production installation to dependent packets. ## Archive Evidence Snapshot @@ -49,7 +49,7 @@ Marked single-request admission freezes canonical Plan/Work/Review model names a ### Verification Context - No verification handoff was supplied. The local test rule and existing service/OpenAI tests are the repository-native oracle. -- Checkout preflight: branch `feature/iop-owned-single-request-agent-execution`, HEAD `3bb4a24ad750a9ce5b7754a70db24545554ba238`; only active Epic task artifacts differ, with no direct production code/test/document delta from that base. +- Checkout preflight: branch `feature/iop-owned-single-request-agent-execution`, HEAD `f4dad6ba88ae442e08ab67f49a5b1a65dd4719e9`; only active Epic task-artifact refinement changes differ, with no direct production code/test/spec/contract delta from that checkpoint. - Deterministic provider frames and candidate selection are sufficient for this packet; no remote provider, credential, or runner is required. - Actual Claude/Mac qualification remains S12 `claude-smoke` after composite activation. @@ -85,7 +85,7 @@ Exclude Work tool calls, Review verdict/repair, composite installation, public r 1. Before implementation or review, run the exact dependency command in Final Verification. It must print exactly one predecessor evidence path from active or archive storage and exit zero; missing or ambiguous evidence is a blocker. 2. Read only that resolved `complete.log`, then inspect predecessor 17's completed artifact API in source. If it contradicts this plan, record the blocker instead of recreating or replacing its boundary. -3. Implement this packet without installing it through `SetSingleRequestExecutor`; task 20 owns production composition after all stages exist. +3. Implement this packet without constructing or installing a composite executor; task 21 owns composition after Review exists and task 22 owns production installation. ## Implementation Checklist @@ -208,7 +208,7 @@ Fresh output is required; Go tests use `-count=1` and cached output is not accep 2. `go test ./apps/edge/internal/service ./apps/edge/internal/openai -run 'TestSingleRequest(Binding|PresetBinding|ProviderStage|PlanStage)' -count=1` — admission, codec, and S08 fixtures pass freshly. 3. `go vet ./apps/edge/internal/service ./apps/edge/internal/openai` — changed packages vet cleanly. 4. `go test ./apps/edge/... -count=1` — broader Edge regression passes. -5. `rg --sort path -n 'SetSingleRequestExecutor|NewSingleRequestExecutor' apps/edge --glob '*.go'` — no incomplete composite is production-installed. +5. `test ! -e apps/edge/internal/openai/single_request_executor.go && bash -c 'set -euo pipefail; if rg --sort path -n "NewSingleRequestExecutor|SetSingleRequestExecutor" apps/edge/internal/input/manager.go; then exit 1; else test $? -eq 1; fi'` — exits zero with no output only when neither an incomplete composite nor production installation exists. 6. `rg --sort path -n 'Plan stage|plan\.md|not installed|deferred' agent-spec/runtime/edge-node-execution.md` — spec distinguishes implemented Plan from deferred stages/activation. 7. `git diff --check` — no whitespace errors. diff --git a/agent-task/m-iop-owned-single-request-agent-execution/19+18_work_stage/CODE_REVIEW-cloud-G08.md b/agent-task/m-iop-owned-single-request-agent-execution/19+18_work_stage/CODE_REVIEW-cloud-G08.md index 14eb1324..03918eff 100644 --- a/agent-task/m-iop-owned-single-request-agent-execution/19+18_work_stage/CODE_REVIEW-cloud-G08.md +++ b/agent-task/m-iop-owned-single-request-agent-execution/19+18_work_stage/CODE_REVIEW-cloud-G08.md @@ -113,7 +113,7 @@ _Paste actual output here._ ### 6. No incomplete production activation -`rg --sort path -n 'SetSingleRequestExecutor|NewSingleRequestExecutor' apps/edge --glob '*.go'` +`test ! -e apps/edge/internal/openai/single_request_executor.go && bash -c 'set -euo pipefail; if rg --sort path -n "NewSingleRequestExecutor|SetSingleRequestExecutor" apps/edge/internal/input/manager.go; then exit 1; else test $? -eq 1; fi'` ```text _Paste actual output here._ diff --git a/agent-task/m-iop-owned-single-request-agent-execution/19+18_work_stage/PLAN-cloud-G08.md b/agent-task/m-iop-owned-single-request-agent-execution/19+18_work_stage/PLAN-cloud-G08.md index 2567e9a4..90750a61 100644 --- a/agent-task/m-iop-owned-single-request-agent-execution/19+18_work_stage/PLAN-cloud-G08.md +++ b/agent-task/m-iop-owned-single-request-agent-execution/19+18_work_stage/PLAN-cloud-G08.md @@ -49,7 +49,7 @@ The Plan packet yields private `plan.md` content and a managed provider-stage co ### Verification Context - No verification handoff was supplied. Existing service/OpenAI tool-loop tests plus local test rules are the oracle. -- Checkout preflight: branch `feature/iop-owned-single-request-agent-execution`, starting HEAD `3bb4a24ad750a9ce5b7754a70db24545554ba238`; only active Epic artifacts differ, with no direct production code/test/document delta from that base. +- Checkout preflight: branch `feature/iop-owned-single-request-agent-execution`, starting HEAD `f4dad6ba88ae442e08ab67f49a5b1a65dd4719e9`; only active Epic task-artifact refinement changes differ, with no direct production code/test/spec/contract delta from that checkpoint. - Deterministic provider frames and existing typed Node-wire doubles require no external provider, endpoint, or credential. - Actual Claude/Mac full-cycle evidence remains S12 `claude-smoke` after Review activation. @@ -61,7 +61,7 @@ The Plan packet yields private `plan.md` content and a managed provider-stage co ### Symbol References -- `SingleRequestToolContinuation` is currently implemented only by test executors; the new bridge becomes the first production-capable implementation but remains uninstalled until task 20. +- `SingleRequestToolContinuation` is currently implemented only by test executors; the new bridge becomes the first production-capable implementation but remains uninstalled in this packet. Task 21 composes it after task 20 completes Review, and task 22 installs the composite. - Existing `SingleRequestController` and tool-loop envelopes are the state and budget authority. No existing state transition or public symbol is renamed. ### Split Judgment @@ -85,7 +85,7 @@ Exclude Review verdict/repair, final user response, composite installation, publ 1. Before implementation or review, run the exact dependency command in Final Verification. It must print exactly one task-18 completion path from active or archive storage and exit zero; missing or ambiguous evidence is a blocker. 2. Read only that resolved `complete.log`, then inspect the completed provider-stage and artifact APIs in source. If they contradict this plan, record a blocker instead of recreating their types or reopening ownership. -3. Implement Work only after the proof succeeds; keep the runner uninstalled because task 20 owns final composition. +3. Implement Work only after the proof succeeds; keep the runner uninstalled because task 20 owns Review, task 21 owns final composition, and task 22 owns production installation. ## Implementation Checklist @@ -206,7 +206,7 @@ Fresh output is required; Go tests use `-count=1` and cached output is not accep 3. `go test ./apps/edge/internal/service -run 'TestSingleRequest(InternalToolLoop|Cleanup)' -count=1` — coordinator/tool/cleanup invariants pass freshly. 4. `go vet ./apps/edge/internal/openai && go test ./apps/edge/... -count=1` — OpenAI vets cleanly and broader Edge regression passes. 5. `rg --sort path -n 'reasoning_effort' apps/edge/internal/openai/single_request_work_stage.go apps/edge/internal/openai/single_request_work_stage_test.go` — code shows rejection/omission logic and tests prove no effective Work request field. -6. `rg --sort path -n 'SetSingleRequestExecutor|NewSingleRequestExecutor' apps/edge --glob '*.go'` — no production composite is installed yet. +6. `test ! -e apps/edge/internal/openai/single_request_executor.go && bash -c 'set -euo pipefail; if rg --sort path -n "NewSingleRequestExecutor|SetSingleRequestExecutor" apps/edge/internal/input/manager.go; then exit 1; else test $? -eq 1; fi'` — exits zero with no output only when neither a production composite nor its installation exists. 7. `rg --sort path -n 'ornith-fast|Work stage|Review|not installed|deferred' agent-spec/runtime/edge-node-execution.md` — spec records Work and the remaining deferrals accurately. 8. `git diff --check` — no whitespace errors. diff --git a/agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/CODE_REVIEW-cloud-G07.md b/agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/CODE_REVIEW-cloud-G07.md new file mode 100644 index 00000000..9a7d15b8 --- /dev/null +++ b/agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/CODE_REVIEW-cloud-G07.md @@ -0,0 +1,154 @@ + + +# Code Review Reference - API + +> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is the mandatory final step of implementation.** +> Complete the fixed checklists and evidence fields, leave both active files in place, and report ready for review. Only the official review agent may append a verdict, archive files, write `complete.log`, or classify the next state. If blocked, record the blocker, attempted commands/output, and resume condition here; do not change owner or scope. + +## Overview + +date=2026-08-07 +task=m-iop-owned-single-request-agent-execution/20+19_review_repair, plan=2, tag=API + +## For the Review Agent + +Compare every item with source and freshly rerun recorded verification. Then append the official verdict and routing signals. On PASS, archive this file as `code_review_cloud_G07_2.log`, archive the plan as `plan_cloud_G07_2.log`, write `complete.log` preserving `milestone-task=review-stage`, and move the task directory to the dated archive. On WARN/FAIL, write only the next state prescribed by the code-review skill. The implementing agent must not perform these steps. + +## Archive Evidence Snapshot + +- Original parent plan: `agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/plan_cloud_G09_1.log`. +- Original parent review stub: `agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/code_review_cloud_G09_1.log`. +- Earlier self-review snapshots remain `plan_cloud_G09_0.log` and `code_review_cloud_G09_0.log`; neither archived pair contains implementation evidence or an official verdict. +- The parent was split once into Review/repair, composite executor, and production activation children without changing its implementation or verification scope. + +## Implementation Item Completion + +| Item | Status | +|------|---------| +| API-1 Implement strict Review, inspection, and persisted pass evidence | [ ] | +| API-2 Drive bounded repair and re-review without a false state edge | [ ] | + +## Implementation Checklist + +- [ ] Implement Gemini high-reasoning Review with strict pass, direct non-mutating inspection, REVIEW persistence before finalization, and fail-closed bounded results. +- [ ] Implement one-tool-at-a-time repair with `repairing -> internal_tool(saved repairing) -> repairing`, re-review dispatch while state remains repairing, and no invalid `repairing -> reviewing` transition. +- [ ] Add pass, inspection, repair, correlation, limits, cancellation, failure, artifact-ordering, and waiter-cleanup fixtures under `-race`. +- [ ] Run dependency, focused race, service compatibility, OpenAI vet/regression, deterministic state search, unchanged-transition, and diff checks. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +> **[REVIEW AGENT ONLY]** Implementing agents must not modify this section. + +- [ ] Append one `PASS`, `WARN`, or `FAIL` verdict with verified `review_rework_count` and `evidence_integrity_failure`. +- [ ] Verify verdict, dimension assessment, and Required/Suggested/Nit classifications agree. +- [ ] Archive this file to `code_review_cloud_G07_2.log` and the plan to `plan_cloud_G07_2.log`. +- [ ] Verify `.gitignore` unignores task Markdown/log files and ignores `agent-roadmap/current.md`. +- [ ] On PASS, write template-compliant `complete.log`, preserve/report `milestone-task=review-stage`, move the task directory to the dated archive, and remove the active parent only if empty. +- [ ] On WARN/FAIL, write the exact next filesystem state and do not write `complete.log`. + +## Deviations from Plan + +_Record deviations and rationale here._ + +## Key Design Decisions + +_Record implementation decisions here._ + +## Reviewer Checkpoints + +- Verify direct inspection records `reviewing -> internal_tool(saved reviewing) -> reviewing`; mutation records `reviewing -> repairing -> internal_tool(saved repairing) -> repairing`. +- Verify re-review provider dispatch occurs while state remains `repairing`; no implementation/test expects or enables `repairing -> reviewing`. +- Verify every Review/re-review request uses frozen Gemini routing and effective high reasoning, and every tool is admitted, correlated, bounded, and serialized one at a time. +- Verify REVIEW is durable before finalizing and only reviewer-approved bytes leave this stage. + +## Verification Results + +Paste actual stdout/stderr for every command. Any replacement requires a matching `Deviations from Plan` entry. + +### 1. Dependency evidence + +`bash -c 'set -euo pipefail; shopt -s nullglob; candidates=(agent-task/m-iop-owned-single-request-agent-execution/19_*/complete.log agent-task/m-iop-owned-single-request-agent-execution/19+*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/19_*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/19+*/complete.log); printf "%s\n" "${candidates[@]}"; ((${#candidates[@]} == 1))'` + +Expected: exactly one predecessor completion path and exit zero. + +```text +_Paste actual output here._ +``` + +### 2. Focused Review race tests + +`go test -race ./apps/edge/internal/openai -run 'TestSingleRequestReviewStage' -count=1` + +```text +_Paste actual output here._ +``` + +### 3. Service state and cleanup compatibility + +`go test ./apps/edge/internal/service -run 'TestSingleRequest(InternalToolLoop|Cleanup|EnvelopeOrdering)' -count=1` + +```text +_Paste actual output here._ +``` + +### 4. OpenAI vet and regression + +`go vet ./apps/edge/internal/openai && go test ./apps/edge/internal/openai -count=1` + +```text +_Paste actual output here._ +``` + +### 5. Review state-order evidence + +`rg --sort path -n 'reasoning_effort|SingleRequestArtifactReview|finalizing|repairing|reviewing' apps/edge/internal/openai/single_request_review_stage.go apps/edge/internal/openai/single_request_review_stage_test.go` + +Expected: high Review, legal repair, durable REVIEW, and finalization ordering are explicit; no `repairing -> reviewing` behavior is introduced. + +```text +_Paste actual output here._ +``` + +### 6. Composite and activation remain deferred + +`test ! -e apps/edge/internal/openai/single_request_executor.go && bash -c 'set -euo pipefail; if rg --sort path -n "NewSingleRequestExecutor|SetSingleRequestExecutor" apps/edge/internal/input/manager.go; then exit 1; else test $? -eq 1; fi'` + +```text +_Paste actual output here._ +``` + +### 7. Canonical service transition table remains unchanged + +`git diff --exit-code HEAD -- apps/edge/internal/service/single_request.go` + +```text +_Paste actual output here._ +``` + +### 8. Diff hygiene + +`git diff --check` + +```text +_Paste actual output here._ +``` + +External qualification remains S12 `claude-smoke`. + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING] Have you filled in every implementation-owned section?** +> Leave review-agent-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---------|-------|------| +| Header, Overview, Review Agent Instructions | Fixed at stub creation | Implementing agent must not change finalization metadata | +| Archive Evidence Snapshot | Fixed at stub creation | Read only cited prior evidence when needed | +| Implementation Item Completion and Checklist text/order | Fixed at stub creation | Implementing agent changes only `[ ]` to `[x]` | +| Review-Only Checklist | Review agent | Implementing agent must not modify it | +| Deviations, Key Design Decisions | Implementing agent | Replace placeholders with actual evidence | +| Reviewer Checkpoints and verification commands | Fixed at stub creation | Implementing agent fills output only; command changes require a deviation | +| Code Review Result | Review agent appends | Not present in this stub | diff --git a/agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/PLAN-cloud-G07.md b/agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/PLAN-cloud-G07.md new file mode 100644 index 00000000..c5e186e1 --- /dev/null +++ b/agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/PLAN-cloud-G07.md @@ -0,0 +1,150 @@ + + +# Review and bounded repair stage + +## For the Implementing Agent + +Filling the implementation-owned sections of `CODE_REVIEW-cloud-G07.md` is the mandatory last implementation step. Run every verification command, paste actual output, keep both active files in place, and report ready for review; only the official code-review skill may append a verdict, archive files, write `complete.log`, or classify the next state. If blocked, record the exact blocker, attempted commands/output, and resume condition only in the review evidence fields; do not ask the user, call a user-input tool, create a control-plane stop file, or change the owner or scope. + +## Background + +The artifact, Plan, and Work packets establish service-owned lifecycle and private provider/tool primitives without installing a production executor. This child implements the Gemini Review stage itself: strict pass, direct inspection, bounded repair/re-review, durable REVIEW evidence, and reviewer-approved output. Composite construction and production installation remain in dependent children. + +## Archive Evidence Snapshot + +- Original parent plan: `agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/plan_cloud_G09_1.log`. +- Original parent review stub: `agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/code_review_cloud_G09_1.log`. +- Earlier self-review snapshots remain `plan_cloud_G09_0.log` and `code_review_cloud_G09_0.log`; neither archived pair contains implementation evidence or an official verdict. +- The parent was split once into Review/repair, composite executor, and production activation children without changing its implementation or verification scope. + +## Analysis + +### Files Read + +- The original parent PLAN/CODE_REVIEW pair and its recorded source, test, contract, and SDD findings. +- No source, test, archived log body, or verification output was reread for this refinement. + +### SDD Criteria + +- This child contributes `review-stage`. +- S10 requires Gemini high-reasoning Review, strict pass, permitted reviewer inspection, one IOP-owned repair call at a time, legal saved-stage restoration, re-review after repair, REVIEW persistence, and only then finalization. +- The lifecycle permits `reviewing -> internal_tool|repairing|finalizing` and `repairing -> internal_tool|finalizing`; it does not permit `repairing -> reviewing`. + +### Verification Context + +- Deterministic provider and workspace-tool fixtures prove the Review stage without remote credentials or an external runner. +- Actual Claude/Mac full-cycle qualification remains the separate S12 `claude-smoke` task. + +### Test Coverage Gaps + +- No provider runner currently proves direct reviewer inspection or repair/re-review semantics. +- No test proves that re-review dispatch occurs while controller state remains `repairing`, or that reviewer-approved output is returned only after durable REVIEW evidence. + +### Symbol References + +- `isValidTransition` in `apps/edge/internal/service/single_request.go` remains the lifecycle oracle and is not modified. +- The predecessor's provider-stage codec, controller artifact API, and request-safe continuation bridge are reused. + +### Split Judgment + +- This child owns the cohesive Review/inspection/repair state machine in one production file and its deterministic tests. +- `21+20_single_request_executor` consumes its approved output contract to compose Plan, Work, and Review. +- `22+21_executor_activation` installs the proven composite and synchronizes current documentation. +- The children created in this refinement are not recursively split. + +### Scope Rationale + +Include only Review prompt/result decoding, direct inspection, repair/re-review, durable REVIEW write, finalization ordering, bounded correlation, and their tests. Exclude composite construction, production installation, public schema changes, generic error/cancel quality work, and external qualification. + +### Final Routing + +- `evaluation_mode=isolated-reassessment`; all build/review closures are true; no capability gap. +- Build scores `1/2/1/1/2` => G07, base `local-fit`; loop risks `temporal_state`, `concurrent_consistency`, `boundary_contract`, `structured_interpretation` (4) select `risk-boundary`, `worker/cloud/G07`, `PLAN-cloud-G07.md`. +- Review scores `1/2/1/1/2` => G07, `official-review`, `review/cloud/G07`, `CODE_REVIEW-cloud-G07.md`. +- `large_indivisible_context=false`; `review_rework_count=0`; `evidence_integrity_failure=false`; finalizer `finalize-task-policy.sh`, mode `pair`. + +## Dependencies and Execution Order + +1. Before implementation or review, run the exact dependency command in Final Verification. It must print exactly one task-19 completion path from active or archive storage and exit zero. +2. Read only that resolved `complete.log`, then consume the completed Work result and continuation bridge contracts without reopening predecessor ownership. +3. Prove strict pass, direct inspection, and repair/re-review before reporting this child ready for review. + +## Implementation Checklist + +- [ ] Implement Gemini high-reasoning Review with strict pass, direct non-mutating inspection, REVIEW persistence before finalization, and fail-closed bounded results. +- [ ] Implement one-tool-at-a-time repair with `repairing -> internal_tool(saved repairing) -> repairing`, re-review dispatch while state remains repairing, and no invalid `repairing -> reviewing` transition. +- [ ] Add pass, inspection, repair, correlation, limits, cancellation, failure, artifact-ordering, and waiter-cleanup fixtures under `-race`. +- [ ] Run dependency, focused race, service compatibility, OpenAI vet/regression, deterministic state search, unchanged-transition, and diff checks. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Implement strict Review, inspection, and persisted pass evidence + +**Problem** + +Work returns only a private completion candidate and verification evidence. Returning it directly would skip independent Review, while reviewer inspection must use the existing saved-stage tool path rather than a caller continuation. + +**Solution** + +Add `single_request_review_stage.go`. Read PLAN, accept bounded Work evidence, submit `reviewing`, and dispatch a fixed Gemini high request. Decode only strict pass, one admitted non-mutating inspection call, or one admitted repair call. Inspection records `reviewing -> internal_tool(saved reviewing) -> reviewing`; pass writes `SingleRequestArtifactReview` before `finalizing` and returns only approved output. + +**Modified Files and Checklist** + +- [ ] Add prompt, high-option dispatch, closed result decoding, inspection loop, write-before-finalize ordering, and bounded DTOs in `apps/edge/internal/openai/single_request_review_stage.go`. +- [ ] Add pass, direct inspection, exact request body, malformed/mixed/multiple/provider error, artifact failure, bounds, and cancellation tests in `apps/edge/internal/openai/single_request_review_stage_test.go`. + +**Test Strategy** + +Use deterministic provider/tool fakes and a recording controller. Assert the saved-stage inspection sequence, high reasoning on every Review request, durable REVIEW before finalizing, exact correlation, and no private candidate/error leakage. + +**Verification** + +Run the focused ReviewStage race test in Final Verification. + +### [API-2] Drive bounded repair and re-review without a false state edge + +**Problem** + +The service restores `repairing` after every repair tool result and rejects `repairing -> reviewing`. Re-review must therefore dispatch while lifecycle state remains `repairing`. + +**Solution** + +On a mutating defect call, submit `repairing`, execute one admitted tool through `internal_tool` with saved `repairing`, restore `repairing`, append a bounded sanitized exchange, and redispatch Gemini Review without changing state to `reviewing`. Only a later strict pass may persist REVIEW and submit `finalizing`. + +**Modified Files and Checklist** + +- [ ] Add repair/re-review behavior to `apps/edge/internal/openai/single_request_review_stage.go` using the predecessor bridge and controller API. +- [ ] Add pass-after-repair, repeated bounded tool, correlation, failure, stale/duplicate result, cancellation, and waiter-cleanup fixtures in `apps/edge/internal/openai/single_request_review_stage_test.go`. +- [ ] Assert re-review dispatch occurs while recorded lifecycle state is `repairing` and no code or test attempts `repairing -> reviewing`. + +**Test Strategy** + +Record states separately from provider dispatches and prove finalization occurs only after strict pass plus durable REVIEW. + +**Verification** + +Run focused Review race tests and the deterministic state-order search; keep the canonical service transition file unchanged. + +## Modified Files Summary + +| File | Items | +|------|-------| +| `apps/edge/internal/openai/single_request_review_stage.go` | API-1, API-2 | +| `apps/edge/internal/openai/single_request_review_stage_test.go` | API-1, API-2 | +| `agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/CODE_REVIEW-cloud-G07.md` | API-1, API-2 | + +## Final Verification + +Fresh output is required; Go tests use `-count=1` and cached output is not acceptable. + +1. `bash -c 'set -euo pipefail; shopt -s nullglob; candidates=(agent-task/m-iop-owned-single-request-agent-execution/19_*/complete.log agent-task/m-iop-owned-single-request-agent-execution/19+*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/19_*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/19+*/complete.log); printf "%s\n" "${candidates[@]}"; ((${#candidates[@]} == 1))'` — prints exactly one predecessor completion path and exits zero. +2. `go test -race ./apps/edge/internal/openai -run 'TestSingleRequestReviewStage' -count=1` — pass, direct inspection, repair/re-review, correlation, cancellation, and failure fixtures pass without races. +3. `go test ./apps/edge/internal/service -run 'TestSingleRequest(InternalToolLoop|Cleanup|EnvelopeOrdering)' -count=1` — unchanged coordinator state and cleanup invariants pass freshly. +4. `go vet ./apps/edge/internal/openai && go test ./apps/edge/internal/openai -count=1` — the changed package vets cleanly and its regressions pass. +5. `rg --sort path -n 'reasoning_effort|SingleRequestArtifactReview|finalizing|repairing|reviewing' apps/edge/internal/openai/single_request_review_stage.go apps/edge/internal/openai/single_request_review_stage_test.go` — high Review, legal repair, durable REVIEW, and finalization ordering are explicit; no `repairing -> reviewing` behavior is introduced. +6. `test ! -e apps/edge/internal/openai/single_request_executor.go && bash -c 'set -euo pipefail; if rg --sort path -n "NewSingleRequestExecutor|SetSingleRequestExecutor" apps/edge/internal/input/manager.go; then exit 1; else test $? -eq 1; fi'` — exits zero with no output only when composite construction and production installation remain deferred. +7. `git diff --exit-code HEAD -- apps/edge/internal/service/single_request.go` — the canonical service transition table remains unchanged. +8. `git diff --check` — no whitespace errors. + +Actual provider/Claude full-cycle evidence remains owned by S12 `claude-smoke`. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-owned-single-request-agent-execution/20+19_review_stage/code_review_cloud_G09_0.log b/agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/code_review_cloud_G09_0.log similarity index 100% rename from agent-task/m-iop-owned-single-request-agent-execution/20+19_review_stage/code_review_cloud_G09_0.log rename to agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/code_review_cloud_G09_0.log diff --git a/agent-task/m-iop-owned-single-request-agent-execution/20+19_review_stage/CODE_REVIEW-cloud-G09.md b/agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/code_review_cloud_G09_1.log similarity index 100% rename from agent-task/m-iop-owned-single-request-agent-execution/20+19_review_stage/CODE_REVIEW-cloud-G09.md rename to agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/code_review_cloud_G09_1.log diff --git a/agent-task/m-iop-owned-single-request-agent-execution/20+19_review_stage/plan_cloud_G09_0.log b/agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/plan_cloud_G09_0.log similarity index 100% rename from agent-task/m-iop-owned-single-request-agent-execution/20+19_review_stage/plan_cloud_G09_0.log rename to agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/plan_cloud_G09_0.log diff --git a/agent-task/m-iop-owned-single-request-agent-execution/20+19_review_stage/PLAN-cloud-G09.md b/agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/plan_cloud_G09_1.log similarity index 100% rename from agent-task/m-iop-owned-single-request-agent-execution/20+19_review_stage/PLAN-cloud-G09.md rename to agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/plan_cloud_G09_1.log diff --git a/agent-task/m-iop-owned-single-request-agent-execution/21+20_single_request_executor/CODE_REVIEW-cloud-G08.md b/agent-task/m-iop-owned-single-request-agent-execution/21+20_single_request_executor/CODE_REVIEW-cloud-G08.md new file mode 100644 index 00000000..1268b286 --- /dev/null +++ b/agent-task/m-iop-owned-single-request-agent-execution/21+20_single_request_executor/CODE_REVIEW-cloud-G08.md @@ -0,0 +1,140 @@ + + +# Code Review Reference - API + +> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is the mandatory final step of implementation.** +> Complete the fixed checklists and evidence fields, leave both active files in place, and report ready for review. Only the official review agent may append a verdict, archive files, write `complete.log`, or classify the next state. If blocked, record the blocker, attempted commands/output, and resume condition here; do not change owner or scope. + +## Overview + +date=2026-08-07 +task=m-iop-owned-single-request-agent-execution/21+20_single_request_executor, plan=0, tag=API + +## For the Review Agent + +Compare every item with source and freshly rerun recorded verification. Then append the official verdict and routing signals. On PASS, archive this file as `code_review_cloud_G08_0.log`, archive the plan as `plan_local_G08_0.log`, write `complete.log` preserving `milestone-task=review-stage`, and move the task directory to the dated archive. On WARN/FAIL, write only the next state prescribed by the code-review skill. The implementing agent must not perform these steps. + +## Archive Evidence Snapshot + +- Pre-refine parent plan: checkpoint `f4dad6ba88ae442e08ab67f49a5b1a65dd4719e9`, `agent-task/m-iop-owned-single-request-agent-execution/20+19_review_stage/PLAN-cloud-G09.md`. +- Pre-refine parent review: checkpoint `f4dad6ba88ae442e08ab67f49a5b1a65dd4719e9`, `agent-task/m-iop-owned-single-request-agent-execution/20+19_review_stage/CODE_REVIEW-cloud-G09.md`. +- The checkpoint pair contains no implementation evidence or official verdict; refinement split it once into three scope-preserving children. No active-log path is required after predecessor archival. + +## Implementation Item Completion + +| Item | Status | +|------|---------| +| API-1 Compose the three private stages | [ ] | + +## Implementation Checklist + +- [ ] Add a concurrent request-safe composite executor that drives Plan → Work → Review through one controller, reuses the completed continuation bridge, and returns only reviewer-approved output. +- [ ] Add pass, inspection, repair, concurrent isolation, cancellation, stage failure, final-output provenance, and waiter-cleanup fixtures under `-race`. +- [ ] Run dependency, focused race, service compatibility, OpenAI vet/regression, constructor search, and diff checks without production activation. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +> **[REVIEW AGENT ONLY]** Implementing agents must not modify this section. + +- [ ] Append one `PASS`, `WARN`, or `FAIL` verdict with verified `review_rework_count` and `evidence_integrity_failure`. +- [ ] Verify verdict, dimension assessment, and Required/Suggested/Nit classifications agree. +- [ ] Archive this file to `code_review_cloud_G08_0.log` and the plan to `plan_local_G08_0.log`. +- [ ] Verify `.gitignore` unignores task Markdown/log files and ignores `agent-roadmap/current.md`. +- [ ] On PASS, write template-compliant `complete.log`, preserve/report `milestone-task=review-stage`, move the task directory to the dated archive, and remove the active parent only if empty. +- [ ] On WARN/FAIL, write the exact next filesystem state and do not write `complete.log`. + +## Deviations from Plan + +_Record deviations and rationale here._ + +## Key Design Decisions + +_Record implementation decisions here._ + +## Reviewer Checkpoints + +- Verify one controller and immutable binding span Plan, Work, and Review, and no Work candidate bypasses Review. +- Verify continuation results are delegated through the request-safe bridge with exact identity and no retained waiter on success, failure, timeout, or cancellation. +- Verify only reviewer-approved output is returned, concurrent requests remain isolated, and production installation is still absent from this child. + +## Verification Results + +Paste actual stdout/stderr for every command. Any replacement requires a matching `Deviations from Plan` entry. + +### 1. Dependency evidence + +`bash -c 'set -euo pipefail; shopt -s nullglob; candidates=(agent-task/m-iop-owned-single-request-agent-execution/20_*/complete.log agent-task/m-iop-owned-single-request-agent-execution/20+*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/20_*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/20+*/complete.log); printf "%s\n" "${candidates[@]}"; ((${#candidates[@]} == 1))'` + +Expected: exactly one predecessor completion path and exit zero. + +```text +_Paste actual output here._ +``` + +### 2. Focused composite race tests + +`go test -race ./apps/edge/internal/openai -run 'TestSingleRequestExecutor' -count=1` + +```text +_Paste actual output here._ +``` + +### 3. Service state and cleanup compatibility + +`go test ./apps/edge/internal/service -run 'TestSingleRequest(InternalToolLoop|Cleanup|EnvelopeOrdering)' -count=1` + +```text +_Paste actual output here._ +``` + +### 4. Changed-path vet and regression + +`go vet ./apps/edge/internal/openai && go test ./apps/edge/internal/service ./apps/edge/internal/openai -count=1` + +```text +_Paste actual output here._ +``` + +### 5. Constructor and ownership evidence + +`rg --sort path -n 'NewSingleRequestExecutor|SingleRequestExecutor|SingleRequestToolContinuation' apps/edge/internal/openai/single_request_executor.go apps/edge/internal/openai/single_request_executor_test.go` + +```text +_Paste actual output here._ +``` + +### 6. Production activation remains deferred + +`bash -c 'set -euo pipefail; if rg --sort path -n "NewSingleRequestExecutor|SetSingleRequestExecutor" apps/edge/internal/input/manager.go; then exit 1; else test $? -eq 1; fi'` + +```text +_Paste actual output here._ +``` + +### 7. Diff hygiene + +`git diff --check` + +```text +_Paste actual output here._ +``` + +External qualification remains S12 `claude-smoke`. + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING] Have you filled in every implementation-owned section?** +> Leave review-agent-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---------|-------|------| +| Header, Overview, Review Agent Instructions | Fixed at stub creation | Implementing agent must not change finalization metadata | +| Archive Evidence Snapshot | Fixed at stub creation | Read only cited prior evidence when needed | +| Implementation Item Completion and Checklist text/order | Fixed at stub creation | Implementing agent changes only `[ ]` to `[x]` | +| Review-Only Checklist | Review agent | Implementing agent must not modify it | +| Deviations, Key Design Decisions | Implementing agent | Replace placeholders with actual evidence | +| Reviewer Checkpoints and verification commands | Fixed at stub creation | Implementing agent fills output only; command changes require a deviation | +| Code Review Result | Review agent appends | Not present in this stub | diff --git a/agent-task/m-iop-owned-single-request-agent-execution/21+20_single_request_executor/PLAN-local-G08.md b/agent-task/m-iop-owned-single-request-agent-execution/21+20_single_request_executor/PLAN-local-G08.md new file mode 100644 index 00000000..89a041a9 --- /dev/null +++ b/agent-task/m-iop-owned-single-request-agent-execution/21+20_single_request_executor/PLAN-local-G08.md @@ -0,0 +1,121 @@ + + +# Plan, Work, Review composite executor + +## For the Implementing Agent + +Filling the implementation-owned sections of `CODE_REVIEW-cloud-G08.md` is the mandatory last implementation step. Run every verification command, paste actual output, keep both active files in place, and report ready for review; only the official code-review skill may append a verdict, archive files, write `complete.log`, or classify the next state. If blocked, record the exact blocker, attempted commands/output, and resume condition only in the review evidence fields; do not ask the user, call a user-input tool, create a control-plane stop file, or change the owner or scope. + +## Background + +The predecessor children provide private Plan, Work, and Review stage runners plus a request-safe continuation bridge. This child composes them behind the existing service executor/continuation contracts so one controller owns the full lifecycle and only reviewer-approved output can become terminal. Production installation remains deferred to the next child. + +## Archive Evidence Snapshot + +- Pre-refine parent plan: checkpoint `f4dad6ba88ae442e08ab67f49a5b1a65dd4719e9`, `agent-task/m-iop-owned-single-request-agent-execution/20+19_review_stage/PLAN-cloud-G09.md`. +- Pre-refine parent review: checkpoint `f4dad6ba88ae442e08ab67f49a5b1a65dd4719e9`, `agent-task/m-iop-owned-single-request-agent-execution/20+19_review_stage/CODE_REVIEW-cloud-G09.md`. +- The checkpoint pair contains no implementation evidence or official verdict; refinement split it once into three scope-preserving children. No active-log path is required after predecessor archival. + +## Analysis + +### Files Read + +- The original parent PLAN/CODE_REVIEW pair and its recorded source, test, contract, and SDD findings. +- No source, test, archived log body, or verification output was reread for this refinement. + +### SDD Criteria + +- This child contributes `review-stage` by ensuring the reviewer is the sole final-output authority in the complete Plan → Work → Review lifecycle. +- One immutable binding and controller must span all stages, and request-local continuation state must be removed on every terminal path. + +### Verification Context + +- Deterministic full-lifecycle fixtures can prove composition, concurrency isolation, cancellation, cleanup, and final-output provenance without external providers. +- Production reachability and current contract/spec claims remain deferred to `22+21_executor_activation`. + +### Test Coverage Gaps + +- No production composite currently proves that Plan, Work, and Review share one controller and lifecycle. +- No composite test proves concurrent request isolation, cancellation, stage failure cleanup, or reviewer-only terminal provenance. + +### Symbol References + +- `SingleRequestExecutor`, `SingleRequestToolContinuation`, the predecessor stage runners, and the predecessor request-safe bridge are the existing composition boundaries. +- The public Anthropic request/event types and Edge input construction remain unchanged in this child. + +### Split Judgment + +- This child owns only composite construction and deterministic lifecycle proof. +- It depends on completed Review/repair and produces the stable constructor consumed by the activation child. +- The child is not recursively split in this refinement pass. + +### Scope Rationale + +Include the executor implementation, production constructor, request-safe continuation delegation, full-lifecycle tests, and cleanup/provenance evidence. Exclude input-manager installation, contract/spec synchronization, public schema changes, generic error/cancel quality work, and external qualification. + +### Final Routing + +- `evaluation_mode=isolated-reassessment`; all build/review closures are true; no capability gap. +- Build scores `2/2/1/1/2` => G08, base/route `local-fit`, `worker/local/G08`, `PLAN-local-G08.md`. +- Review scores `2/2/1/1/2` => G08, `official-review`, `review/cloud/G08`, `CODE_REVIEW-cloud-G08.md`. +- `large_indivisible_context=false`; loop risks `temporal_state`, `concurrent_consistency`, `boundary_contract` (3); `review_rework_count=0`; `evidence_integrity_failure=false`; finalizer `finalize-task-policy.sh`, mode `pair`. + +## Dependencies and Execution Order + +1. Before implementation or review, run the exact dependency command in Final Verification. It must print exactly one task-20 completion path from active or archive storage and exit zero. +2. Read only that resolved `complete.log`, then consume the completed Plan, Work, Review, artifact, and continuation APIs without reopening their ownership. +3. Prove deterministic full-lifecycle behavior and cleanup before reporting this child ready for review; do not install it in the input manager. + +## Implementation Checklist + +- [ ] Add a concurrent request-safe composite executor that drives Plan → Work → Review through one controller, reuses the completed continuation bridge, and returns only reviewer-approved output. +- [ ] Add pass, inspection, repair, concurrent isolation, cancellation, stage failure, final-output provenance, and waiter-cleanup fixtures under `-race`. +- [ ] Run dependency, focused race, service compatibility, OpenAI vet/regression, constructor search, and diff checks without production activation. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Compose the three private stages + +**Problem** + +Installing stage runners independently would split lifecycle ownership, let a Work candidate become terminal, and leave continuation without a stable concurrent executor instance. + +**Solution** + +Add `single_request_executor.go` implementing existing service executor and continuation interfaces. Per request, run Plan, Work, and Review against one controller and immutable binding. Delegate tool results to the request-safe bridge, preserve cancellation and generic errors, return only Review-approved output, and remove every keyed bridge entry on terminal paths. + +**Modified Files and Checklist** + +- [ ] Add the composite and exported production constructor in `apps/edge/internal/openai/single_request_executor.go`. +- [ ] Add pass, inspection, repair, concurrent isolation, cancellation, stage failure, final-output provenance, and waiter-cleanup tests in `apps/edge/internal/openai/single_request_executor_test.go`. + +**Test Strategy** + +Drive deterministic full lifecycles through the real service controller with Work tools and Review inspection/repair variants. Assert legal monotonic envelopes, artifact order, reviewer-only terminal output, concurrent identity isolation under `-race`, and cleanup after injected failures. + +**Verification** + +Run focused executor race tests and unchanged service cleanup/tool-loop tests. + +## Modified Files Summary + +| File | Items | +|------|-------| +| `apps/edge/internal/openai/single_request_executor.go` | API-1 | +| `apps/edge/internal/openai/single_request_executor_test.go` | API-1 | +| `agent-task/m-iop-owned-single-request-agent-execution/21+20_single_request_executor/CODE_REVIEW-cloud-G08.md` | API-1 | + +## Final Verification + +Fresh output is required; Go tests use `-count=1` and cached output is not acceptable. + +1. `bash -c 'set -euo pipefail; shopt -s nullglob; candidates=(agent-task/m-iop-owned-single-request-agent-execution/20_*/complete.log agent-task/m-iop-owned-single-request-agent-execution/20+*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/20_*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/20+*/complete.log); printf "%s\n" "${candidates[@]}"; ((${#candidates[@]} == 1))'` — prints exactly one predecessor completion path and exits zero. +2. `go test -race ./apps/edge/internal/openai -run 'TestSingleRequestExecutor' -count=1` — pass, inspection, repair, concurrency, cancellation, failure, and cleanup fixtures pass without races. +3. `go test ./apps/edge/internal/service -run 'TestSingleRequest(InternalToolLoop|Cleanup|EnvelopeOrdering)' -count=1` — unchanged coordinator tool-loop, cleanup, and envelope-ordering invariants pass freshly. +4. `go vet ./apps/edge/internal/openai && go test ./apps/edge/internal/service ./apps/edge/internal/openai -count=1` — changed-path packages vet/regress cleanly. +5. `rg --sort path -n 'NewSingleRequestExecutor|SingleRequestExecutor|SingleRequestToolContinuation' apps/edge/internal/openai/single_request_executor.go apps/edge/internal/openai/single_request_executor_test.go` — constructor, executor ownership, and continuation delegation are explicit and test-covered. +6. `bash -c 'set -euo pipefail; if rg --sort path -n "NewSingleRequestExecutor|SetSingleRequestExecutor" apps/edge/internal/input/manager.go; then exit 1; else test $? -eq 1; fi'` — exits zero with no output only when production installation remains deferred to task 22. +7. `git diff --check` — no whitespace errors. + +Actual provider/Claude full-cycle evidence remains owned by S12 `claude-smoke`. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-owned-single-request-agent-execution/22+21_executor_activation/CODE_REVIEW-cloud-G07.md b/agent-task/m-iop-owned-single-request-agent-execution/22+21_executor_activation/CODE_REVIEW-cloud-G07.md new file mode 100644 index 00000000..484ac767 --- /dev/null +++ b/agent-task/m-iop-owned-single-request-agent-execution/22+21_executor_activation/CODE_REVIEW-cloud-G07.md @@ -0,0 +1,141 @@ + + +# Code Review Reference - API + +> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is the mandatory final step of implementation.** +> Complete the fixed checklists and evidence fields, leave both active files in place, and report ready for review. Only the official review agent may append a verdict, archive files, write `complete.log`, or classify the next state. If blocked, record the blocker, attempted commands/output, and resume condition here; do not change owner or scope. + +## Overview + +date=2026-08-07 +task=m-iop-owned-single-request-agent-execution/22+21_executor_activation, plan=0, tag=API + +## For the Review Agent + +Compare every item with source and freshly rerun recorded verification. Then append the official verdict and routing signals. On PASS, archive this file as `code_review_cloud_G07_0.log`, archive the plan as `plan_local_G07_0.log`, write `complete.log` preserving `milestone-task=review-stage`, and move the task directory to the dated archive. On WARN/FAIL, write only the next state prescribed by the code-review skill. The implementing agent must not perform these steps. + +## Archive Evidence Snapshot + +- Pre-refine parent plan: checkpoint `f4dad6ba88ae442e08ab67f49a5b1a65dd4719e9`, `agent-task/m-iop-owned-single-request-agent-execution/20+19_review_stage/PLAN-cloud-G09.md`. +- Pre-refine parent review: checkpoint `f4dad6ba88ae442e08ab67f49a5b1a65dd4719e9`, `agent-task/m-iop-owned-single-request-agent-execution/20+19_review_stage/CODE_REVIEW-cloud-G09.md`. +- The checkpoint pair contains no implementation evidence or official verdict; refinement split it once into three scope-preserving children. No active-log path is required after predecessor archival. + +## Implementation Item Completion + +| Item | Status | +|------|---------| +| API-1 Install and synchronize the active contract | [ ] | + +## Implementation Checklist + +- [ ] Install the completed composite at Edge input startup through the existing setter and prove production construction no longer leaves the executor unset. +- [ ] Add installation/unavailable-regression coverage without adding a public getter or changing the Anthropic request/event schema. +- [ ] Update the current outer contract and implementation spec with active stage order, private provider outcomes, generic failure behavior, local evidence, and explicit S12 deferral. +- [ ] Run dependency, installation, changed-path regression, vet, broader Edge, deterministic constructor/document search, and diff checks. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +> **[REVIEW AGENT ONLY]** Implementing agents must not modify this section. + +- [ ] Append one `PASS`, `WARN`, or `FAIL` verdict with verified `review_rework_count` and `evidence_integrity_failure`. +- [ ] Verify verdict, dimension assessment, and Required/Suggested/Nit classifications agree. +- [ ] Archive this file to `code_review_cloud_G07_0.log` and the plan to `plan_local_G07_0.log`. +- [ ] Verify `.gitignore` unignores task Markdown/log files and ignores `agent-roadmap/current.md`. +- [ ] On PASS, write template-compliant `complete.log`, preserve/report `milestone-task=review-stage`, move the task directory to the dated archive, and remove the active parent only if empty. +- [ ] On WARN/FAIL, write the exact next filesystem state and do not write `complete.log`. + +## Deviations from Plan + +_Record deviations and rationale here._ + +## Key Design Decisions + +_Record implementation decisions here._ + +## Reviewer Checkpoints + +- Verify production construction uses the completed executor constructor and existing setter without new public accessors or schema changes. +- Verify installation happens only after dependencies exist and the regression fixture distinguishes installed behavior from the prior unavailable path. +- Verify the outer contract/spec claim only deterministic local activation and explicitly defer actual Claude/provider qualification to S12. + +## Verification Results + +Paste actual stdout/stderr for every command. Any replacement requires a matching `Deviations from Plan` entry. + +### 1. Dependency evidence + +`bash -c 'set -euo pipefail; shopt -s nullglob; candidates=(agent-task/m-iop-owned-single-request-agent-execution/21_*/complete.log agent-task/m-iop-owned-single-request-agent-execution/21+*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/21_*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/21+*/complete.log); printf "%s\n" "${candidates[@]}"; ((${#candidates[@]} == 1))'` + +Expected: exactly one predecessor completion path and exit zero. + +```text +_Paste actual output here._ +``` + +### 2. Production installation + +`go test ./apps/edge/internal/input -run 'TestManager.*SingleRequestExecutor' -count=1` + +```text +_Paste actual output here._ +``` + +### 3. Changed-path regression + +`go test ./apps/edge/internal/service ./apps/edge/internal/openai ./apps/edge/internal/input -count=1` + +```text +_Paste actual output here._ +``` + +### 4. Vet and Edge regression + +`go vet ./apps/edge/internal/service ./apps/edge/internal/openai ./apps/edge/internal/input && go test ./apps/edge/... -count=1` + +```text +_Paste actual output here._ +``` + +### 5. Production constructor evidence + +`rg --sort path -n 'NewSingleRequestExecutor|SetSingleRequestExecutor' apps/edge/internal/openai apps/edge/internal/input --glob '*.go'` + +```text +_Paste actual output here._ +``` + +### 6. Contract/spec synchronization + +`rg --sort path -n 'Plan|Work|Review|repair|active|claude-smoke|S12|deferred' agent-contract/outer/anthropic-compatible-api.md agent-spec/runtime/edge-node-execution.md` + +```text +_Paste actual output here._ +``` + +### 7. Diff hygiene + +`git diff --check` + +```text +_Paste actual output here._ +``` + +External qualification remains S12 `claude-smoke`. + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING] Have you filled in every implementation-owned section?** +> Leave review-agent-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---------|-------|------| +| Header, Overview, Review Agent Instructions | Fixed at stub creation | Implementing agent must not change finalization metadata | +| Archive Evidence Snapshot | Fixed at stub creation | Read only cited prior evidence when needed | +| Implementation Item Completion and Checklist text/order | Fixed at stub creation | Implementing agent changes only `[ ]` to `[x]` | +| Review-Only Checklist | Review agent | Implementing agent must not modify it | +| Deviations, Key Design Decisions | Implementing agent | Replace placeholders with actual evidence | +| Reviewer Checkpoints and verification commands | Fixed at stub creation | Implementing agent fills output only; command changes require a deviation | +| Code Review Result | Review agent appends | Not present in this stub | diff --git a/agent-task/m-iop-owned-single-request-agent-execution/22+21_executor_activation/PLAN-local-G07.md b/agent-task/m-iop-owned-single-request-agent-execution/22+21_executor_activation/PLAN-local-G07.md new file mode 100644 index 00000000..98bb7947 --- /dev/null +++ b/agent-task/m-iop-owned-single-request-agent-execution/22+21_executor_activation/PLAN-local-G07.md @@ -0,0 +1,125 @@ + + +# Activate the single-request executor + +## For the Implementing Agent + +Filling the implementation-owned sections of `CODE_REVIEW-cloud-G07.md` is the mandatory last implementation step. Run every verification command, paste actual output, keep both active files in place, and report ready for review; only the official code-review skill may append a verdict, archive files, write `complete.log`, or classify the next state. If blocked, record the exact blocker, attempted commands/output, and resume condition only in the review evidence fields; do not ask the user, call a user-input tool, create a control-plane stop file, or change the owner or scope. + +## Background + +The predecessor supplies a deterministic, request-safe Plan → Work → Review executor but leaves it unreachable from production construction. This closure child installs that executor at Edge startup, proves the production construction seam, and updates the current outer contract and implementation spec while leaving external S12 qualification deferred. + +## Archive Evidence Snapshot + +- Pre-refine parent plan: checkpoint `f4dad6ba88ae442e08ab67f49a5b1a65dd4719e9`, `agent-task/m-iop-owned-single-request-agent-execution/20+19_review_stage/PLAN-cloud-G09.md`. +- Pre-refine parent review: checkpoint `f4dad6ba88ae442e08ab67f49a5b1a65dd4719e9`, `agent-task/m-iop-owned-single-request-agent-execution/20+19_review_stage/CODE_REVIEW-cloud-G09.md`. +- The checkpoint pair contains no implementation evidence or official verdict; refinement split it once into three scope-preserving children. No active-log path is required after predecessor archival. + +## Analysis + +### Files Read + +- The original parent PLAN/CODE_REVIEW pair and its recorded source, test, contract, and SDD findings. +- No source, test, archived log body, or verification output was reread for this refinement. + +### SDD Criteria + +- This child contributes `review-stage` by making the completed private stage pipeline reachable through the existing single-request executor boundary. +- Provider-stage data remains private; only reviewer-approved output becomes public, and local deterministic evidence must not be presented as S12 external qualification. + +### Verification Context + +- The existing input construction seam and deterministic dependencies prove production installation. +- Changed-path regressions, broader Edge verification, and current-document searches close the activation boundary without a remote provider run. + +### Test Coverage Gaps + +- Production construction currently leaves the completed executor unset. +- Current contract/spec text cannot describe the pipeline as active until installation and its regression fixture pass. + +### Symbol References + +- `openai.NewSingleRequestExecutor(...)`, `Service.SetSingleRequestExecutor`, and `apps/edge/internal/input/manager.go` are the installation boundary. +- No public getter or Anthropic request/event schema change is needed. + +### Split Judgment + +- This child is the closure consumer of the proven composite and owns installation plus current-document synchronization. +- Review/repair and composite behavior stay in their predecessor children; external qualification stays in S12. +- The child is not recursively split in this refinement pass. + +### Scope Rationale + +Include input-manager construction, installation regression coverage, outer contract/spec activation wording, and existing Edge regressions. Exclude stage implementation, new public schemas, config changes, generic error/cancel quality work, and actual provider/Claude smoke. + +### Final Routing + +- `evaluation_mode=isolated-reassessment`; all build/review closures are true; no capability gap. +- Build scores `1/1/2/1/2` => G07, base/route `local-fit`, `worker/local/G07`, `PLAN-local-G07.md`. +- Review scores `1/1/2/1/2` => G07, `official-review`, `review/cloud/G07`, `CODE_REVIEW-cloud-G07.md`. +- `large_indivisible_context=false`; loop risk `boundary_contract` (1); `review_rework_count=0`; `evidence_integrity_failure=false`; finalizer `finalize-task-policy.sh`, mode `pair`. + +## Dependencies and Execution Order + +1. Before implementation or review, run the exact dependency command in Final Verification. It must print exactly one task-21 completion path from active or archive storage and exit zero. +2. Read only that resolved `complete.log`, then consume the completed production constructor without recreating stage or bridge ownership. +3. Prove installation before updating the current contract/spec, and leave S12 external evidence explicitly deferred. + +## Implementation Checklist + +- [ ] Install the completed composite at Edge input startup through the existing setter and prove production construction no longer leaves the executor unset. +- [ ] Add installation/unavailable-regression coverage without adding a public getter or changing the Anthropic request/event schema. +- [ ] Update the current outer contract and implementation spec with active stage order, private provider outcomes, generic failure behavior, local evidence, and explicit S12 deferral. +- [ ] Run dependency, installation, changed-path regression, vet, broader Edge, deterministic constructor/document search, and diff checks. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Install and synchronize the active contract + +**Problem** + +A complete composite remains unreachable until Edge startup installs it. Once installed, current docs must stop claiming managed single-request execution is unavailable while distinguishing deterministic local evidence from S12 qualification. + +**Solution** + +Construct and install the executor in `apps/edge/internal/input/manager.go` after its dependencies exist. Add an input fixture proving production construction no longer leaves the executor unset. Update the outer contract and current spec with stage order, private outcomes, generic failure behavior, local evidence, and explicit S12 deferral. + +**Modified Files and Checklist** + +- [ ] Install `openai.NewSingleRequestExecutor(...)` through the existing setter in `apps/edge/internal/input/manager.go`. +- [ ] Add installation/unavailable-regression coverage in `apps/edge/internal/input/manager_test.go`. +- [ ] Update `agent-contract/outer/anthropic-compatible-api.md` and `agent-spec/runtime/edge-node-execution.md` without claiming external qualification. + +**Test Strategy** + +Use the existing input construction seam and deterministic dependencies to prove installation, then run unchanged public handler/stream and broader Edge regressions. + +**Verification** + +Run input installation, changed-package regression/vet, constructor searches, current-document searches, and diff checks. + +## Modified Files Summary + +| File | Items | +|------|-------| +| `apps/edge/internal/input/manager.go` | API-1 | +| `apps/edge/internal/input/manager_test.go` | API-1 | +| `agent-contract/outer/anthropic-compatible-api.md` | API-1 | +| `agent-spec/runtime/edge-node-execution.md` | API-1 | +| `agent-task/m-iop-owned-single-request-agent-execution/22+21_executor_activation/CODE_REVIEW-cloud-G07.md` | API-1 | + +## Final Verification + +Fresh output is required; Go tests use `-count=1` and cached output is not acceptable. + +1. `bash -c 'set -euo pipefail; shopt -s nullglob; candidates=(agent-task/m-iop-owned-single-request-agent-execution/21_*/complete.log agent-task/m-iop-owned-single-request-agent-execution/21+*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/21_*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/21+*/complete.log); printf "%s\n" "${candidates[@]}"; ((${#candidates[@]} == 1))'` — prints exactly one predecessor completion path and exits zero. +2. `go test ./apps/edge/internal/input -run 'TestManager.*SingleRequestExecutor' -count=1` — production construction installs the executor. +3. `go test ./apps/edge/internal/service ./apps/edge/internal/openai ./apps/edge/internal/input -count=1` — changed-path regressions pass freshly. +4. `go vet ./apps/edge/internal/service ./apps/edge/internal/openai ./apps/edge/internal/input && go test ./apps/edge/... -count=1` — changed packages vet cleanly and broader Edge regression passes. +5. `rg --sort path -n 'NewSingleRequestExecutor|SetSingleRequestExecutor' apps/edge/internal/openai apps/edge/internal/input --glob '*.go'` — production construction and setter installation are explicit and test-covered. +6. `rg --sort path -n 'Plan|Work|Review|repair|active|claude-smoke|S12|deferred' agent-contract/outer/anthropic-compatible-api.md agent-spec/runtime/edge-node-execution.md` — docs describe active local behavior and leave external qualification deferred. +7. `git diff --check` — no whitespace errors. + +Actual provider/Claude full-cycle evidence remains owned by S12 `claude-smoke`. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`.