From 22a8b81201e89d75c1e6c92342a8081472e8e436 Mon Sep 17 00:00:00 2001 From: toki Date: Fri, 7 Aug 2026 09:54:33 +0900 Subject: [PATCH] =?UTF-8?q?chore(epic):=20quality-gate=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 --- .../CODE_REVIEW-cloud-G10.md | 20 +- .../23+22_error_cancel/PLAN-cloud-G10.md | 32 +- .../code_review_cloud_G10_1.log | 221 ++++++++++++ .../23+22_error_cancel/plan_cloud_G10_1.log | 327 ++++++++++++++++++ .../CODE_REVIEW-cloud-G07.md | 23 +- .../PLAN-cloud-G07.md | 31 +- .../code_review_cloud_G07_0.log | 184 ++++++++++ .../plan_cloud_G07_0.log | 244 +++++++++++++ .../CODE_REVIEW-cloud-G08.md | 28 +- .../PLAN-cloud-G08.md | 45 ++- .../code_review_cloud_G08_1.log | 221 ++++++++++++ .../plan_cloud_G08_1.log | 269 ++++++++++++++ 12 files changed, 1571 insertions(+), 74 deletions(-) create mode 100644 agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/code_review_cloud_G10_1.log create mode 100644 agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/plan_cloud_G10_1.log create mode 100644 agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/code_review_cloud_G07_0.log create mode 100644 agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/plan_cloud_G07_0.log create mode 100644 agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/code_review_cloud_G08_1.log create mode 100644 agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/plan_cloud_G08_1.log diff --git a/agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/CODE_REVIEW-cloud-G10.md b/agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/CODE_REVIEW-cloud-G10.md index 0e6e1d5c..1acfa227 100644 --- a/agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/CODE_REVIEW-cloud-G10.md +++ b/agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/CODE_REVIEW-cloud-G10.md @@ -1,4 +1,4 @@ - + # Code Review Reference - API @@ -15,13 +15,13 @@ ## Overview date=2026-08-07 -task=m-iop-owned-single-request-agent-execution/23+22_error_cancel, plan=1, tag=API +task=m-iop-owned-single-request-agent-execution/23+22_error_cancel, plan=2, tag=API ## Archive Evidence Snapshot -- Prior plan: `agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/plan_cloud_G10_0.log`; prior pristine review stub: `agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/code_review_cloud_G10_0.log`. -- No implementation evidence or official verdict existed. Self-review found two semantic plan defects: Edge HTTP terminal ownership was incorrectly assigned to the host-neutral execution-runtime contract, and the current `/v1/messages` input-surface spec was omitted. -- This replan preserves the production/test boundary and S11 matrix, removes `agent-contract/inner/execution-runtime.md` from the write set, and adds `agent-spec/input/openai-compatible-surface.md`. +- Immediate prior plan: `agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/plan_cloud_G10_1.log`; immediate prior pristine review stub: `agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/code_review_cloud_G10_1.log`. The earlier semantic snapshot remains in the matching `_0.log` files. +- No implementation evidence or official verdict existed. Fresh source review found that the prior result-only DTO could not carry classified failure/cancel semantics because current failed/cancelled progress has no result. +- This replan preserves the corrected write boundary and S11 matrix, and requires one validated raw-free terminal candidate on envelope/result/progress for all terminal paths. ## For the Review Agent @@ -31,7 +31,7 @@ Compare implementation of each item against source files and verify that output Review completion means the following steps are finished: 1. Append verdict and `review_rework_count` / `evidence_integrity_failure` routing signals. -2. Archive `CODE_REVIEW-cloud-G10.md` → `code_review_cloud_G10_1.log` and `PLAN-cloud-G10.md` → `plan_cloud_G10_1.log`. +2. Archive `CODE_REVIEW-cloud-G10.md` → `code_review_cloud_G10_2.log` and `PLAN-cloud-G10.md` → `plan_cloud_G10_2.log`. 3. If PASS, write `complete.log` and move active task directory to `agent-task/archive/YYYY/MM/m-iop-owned-single-request-agent-execution/23+22_error_cancel/`. If WARN/FAIL, fully write the next filesystem state required by the code-review skill. 4. If PASS, preserve the first-line `milestone-task=error-cancel` metadata in `complete.log` and report it for runtime aggregation. Roadmap evaluation belongs to `sync-milestone-workstate`. 5. Check applicable `Review-Only Checklist` items at the final `.log` location before reporting. @@ -49,7 +49,7 @@ Review completion means the following steps are finished: ## Implementation Checklist -- [ ] Add a closed, copy-safe single-request terminal disposition that distinguishes `end_turn`, `length`, sanitized error classes, and caller cancellation while preserving exactly-once cleanup/acknowledgement. +- [ ] Add a closed, copy-safe single-request terminal disposition on envelope/result/progress that distinguishes `end_turn`, `length`, sanitized error classes, and caller cancellation while preserving exactly-once cleanup/acknowledgement. - [ ] Classify provider/tool timeout, stage/request budgets, repetition/no-progress, malformed calls, context/output limits, and disconnect in the completed stage/composite path without retry, fallback, partial-success, generic StreamGate admission, or retained waiters. - [ ] Project the closed disposition consistently through buffered and SSE Anthropic responses and add the complete S11 one-ingress/one-terminal race matrix. - [ ] Synchronize the Anthropic outer contract and both matching current implementation specs with the implemented error/cancel/length policy. @@ -63,8 +63,8 @@ Review completion means the following steps are finished: - [ ] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure` to `Code Review Result`. - [ ] Verify that verdict, `Dimension Assessment`, and Required/Suggested/Nit classifications match. -- [ ] Archive active `CODE_REVIEW-*-G??.md` to `code_review_cloud_G10_1.log`. -- [ ] Archive active `PLAN-*-G??.md` to `plan_cloud_G10_1.log`. +- [ ] Archive active `CODE_REVIEW-*-G??.md` to `code_review_cloud_G10_2.log`. +- [ ] Archive active `PLAN-*-G??.md` to `plan_cloud_G10_2.log`. - [ ] Verify that the Agent-Ops managed block in `.gitignore` unignores `agent-task/**/*.md` and `agent-task/**/*.log` and ignores `agent-roadmap/current.md`. - [ ] If PASS, write `complete.log` based on `agent-ops/skills/common/code-review/templates/complete-log-template.md` and leave no active `.md` files. - [ ] If PASS, move active task directory `agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/` to `agent-task/archive/YYYY/MM/m-iop-owned-single-request-agent-execution/23+22_error_cancel/` and update this checklist at the final archive path. @@ -83,7 +83,7 @@ _Record key design decisions here._ ## Reviewer Checkpoints - Confirm task-22 has exactly one completion log and completed symbols were reread before edits. -- Confirm the closed terminal disposition is copy-safe/raw-free and the first winner survives cleanup and write acknowledgement races. +- Confirm the closed terminal disposition reaches finalizing, failed, and cancelled progress, is copy-safe/raw-free, allows only cleanup conversion before freeze, and survives post-freeze/write-acknowledgement races. - Confirm timeout/budget/repetition/malformed/context/output/cancel rows cause no fallback, partial result, generic StreamGate admission, second ingress, later provider dispatch, or retained waiter. - Confirm buffered and SSE mappings are identical and disconnect remains silent. - Confirm `agent-contract/inner/execution-runtime.md` and Edge-Node wire/proto remain unchanged, while outer Anthropic contract and both current specs match the implementation. diff --git a/agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/PLAN-cloud-G10.md b/agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/PLAN-cloud-G10.md index 4ba1f698..059bf9c6 100644 --- a/agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/PLAN-cloud-G10.md +++ b/agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/PLAN-cloud-G10.md @@ -1,4 +1,4 @@ - + # Closed single-request error, cancel, and length terminals @@ -12,14 +12,15 @@ The activated single-request executor will preserve one controller and one outer ## Archive Evidence Snapshot -- Prior plan: `agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/plan_cloud_G10_0.log`; prior pristine review stub: `agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/code_review_cloud_G10_0.log`. -- No implementation evidence or official verdict existed. Self-review found two semantic plan defects: Edge HTTP terminal ownership was incorrectly assigned to the host-neutral execution-runtime contract, and the current `/v1/messages` input-surface spec was omitted. -- This replan preserves the production/test boundary and S11 matrix, removes `agent-contract/inner/execution-runtime.md` from the write set, and adds `agent-spec/input/openai-compatible-surface.md`. +- Immediate prior plan: `agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/plan_cloud_G10_1.log`; immediate prior pristine review stub: `agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/code_review_cloud_G10_1.log`. The earlier semantic snapshot remains in the matching `_0.log` files. +- No implementation evidence or official verdict existed. Fresh source review found that the prior plan added a disposition only to `SingleRequestResult`, while current failed/cancelled progress carries no result; that design could not deliver the classified failure/cancel reason to either Anthropic projector. +- This replan preserves the corrected owner/write boundary and S11 matrix, and explicitly carries one validated, raw-free terminal candidate through envelope/result/progress so finalizing, failed, and cancelled paths are all projectable. ## Analysis ### Files Read +- Plan 2 freshly reread the milestone/SDD, immediate prior pair/log, current service coordinator and terminal observation code, buffered/SSE projectors and their full tests, current contract/spec owners, and predecessor/consumer plans. The unchanged entries below preserve the analyzed base recorded by the prior pair; no prior test output is promoted as fresh verification. - `AGENTS.md` - `agent-ops/rules/project/rules.md` - `agent-ops/rules/common/rules-roadmap.md` @@ -30,6 +31,7 @@ The activated single-request executor will preserve one controller and one outer - `agent-ops/rules/project/domain/testing/rules.md` - `agent-ops/skills/common/router.md` - `agent-ops/skills/common/plan/SKILL.md` +- `agent-ops/skills/common/refine-plans/SKILL.md` - `agent-ops/skills/common/code-review/SKILL.md` - `agent-ops/skills/common/finalize-task-routing/SKILL.md` - `agent-ops/skills/common/sync-milestone-workstate/SKILL.md` @@ -81,19 +83,19 @@ The activated single-request executor will preserve one controller and one outer ### Verification Context - No handoff was supplied. Repository-native evidence is the local test rules, service coordinator/tool-loop/cleanup/observation tests, Anthropic buffered/SSE tests, approved SDD, outer contract, and two matching current specs. -- Starting checkout is branch `feature/iop-owned-single-request-agent-execution`, HEAD `06e43f2aba7f42acb407cecb9761f30cbcc1df3c`. Go tests use `-count=1`; race tests, protobuf reproducibility, deterministic searches, and `git diff --check` are mandatory. S11 itself uses deterministic stage/provider/tool fixtures; task 25 supplies the later actual Claude full-cycle evidence. +- Preparation checkpoint is branch `feature/iop-owned-single-request-agent-execution`, HEAD `b31163396d0e6556b5eaa759f9c7f1149fbc81c9`. Go tests use `-count=1`; race tests, protobuf reproducibility, deterministic searches, and `git diff --check` are mandatory. S11 itself uses deterministic stage/provider/tool fixtures; task 25 is only the later S12 Claude qualification. - Task 22 is active and has no `complete.log`. Implementation must wait for it, resolve exactly one completion path, read that exact log, then reread completed task-18 through task-22 sources before editing. A completed-symbol mismatch is a recorded blocker/deviation, never a guessed owner expansion. - The common SDD suite includes config, streamgate, Edge OpenAI/service, Node runtime/transport/workspace, `make proto`, and diff checks. Fresh output is required. ### Test Coverage Gaps -- Existing service tests cover budgets, cancellation, cleanup, races, and generic observation classes, but no caller-safe terminal disposition survives from executor through both Anthropic projectors. +- Existing service tests cover budgets, cancellation, cleanup, races, and generic observation classes, but no caller-safe terminal disposition exists on `SingleRequestEnvelope`/`SingleRequestProgress`; failed and cancelled terminal progress therefore loses all closed classification before either Anthropic projector. - Existing stage plans do not prove repetition/no-progress or one closed cross-stage failure policy. - Existing buffered/SSE tests do not cover the full timeout, budget, malformed, context, output-length, cancellation, and no-second-ingress matrix. ### Symbol References -- `SingleRequestResult` is constructed and cloned in `apps/edge/internal/service/single_request.go` and consumed by buffered/stream projectors and tests. Extend it compatibly and update every repository composite literal found by the final search. +- `SingleRequestEnvelope`, `SingleRequestResult`, and `SingleRequestProgress` are validated, stored, cloned, and emitted in `apps/edge/internal/service/single_request.go`. Extend the terminal-bearing DTOs compatibly and update every repository composite literal found by the final search. - `singleRequestAnthropicTerminalKind`, `singleRequestAnthropicError`, `writeAnthropicSingleRequestTerminal`, and `pumpSingleRequestAnthropicStream` are the current projection sites. No public request field or Edge-Node wire symbol is renamed. - Future task-18 through task-22 stage/composite symbols are explicit call sites and must be reread after task 22 completes. @@ -102,6 +104,7 @@ The activated single-request executor will preserve one controller and one outer - This is the indivisible S11 boundary: stage classification, service terminal ownership, and buffered/SSE projection must agree atomically. - `23+22_error_cancel` depends on sibling 22. `agent-task/m-iop-owned-single-request-agent-execution/22+21_executor_activation/` is active and its `complete.log` is missing; no archive candidate was read. - Task 25 consumes this packet and task 24 for actual Claude qualification. +- The replacement was evaluated once with `refine-plans`. A service-only child would not independently close S11, while a projector child must consume that exact contract; inserting such a child between fixed index 23 and log-anchored consumer 25 would also collide with task 24. Keep this packet unchanged. ### Scope Rationale @@ -121,7 +124,7 @@ Include only the closed terminal vocabulary, request-local stage failure/no-prog ## Implementation Checklist -- [ ] Add a closed, copy-safe single-request terminal disposition that distinguishes `end_turn`, `length`, sanitized error classes, and caller cancellation while preserving exactly-once cleanup/acknowledgement. +- [ ] Add a closed, copy-safe single-request terminal disposition on envelope/result/progress that distinguishes `end_turn`, `length`, sanitized error classes, and caller cancellation while preserving exactly-once cleanup/acknowledgement. - [ ] Classify provider/tool timeout, stage/request budgets, repetition/no-progress, malformed calls, context/output limits, and disconnect in the completed stage/composite path without retry, fallback, partial-success, generic StreamGate admission, or retained waiters. - [ ] Project the closed disposition consistently through buffered and SSE Anthropic responses and add the complete S11 one-ingress/one-terminal race matrix. - [ ] Synchronize the Anthropic outer contract and both matching current implementation specs with the implemented error/cancel/length policy. @@ -136,7 +139,7 @@ Include only the closed terminal vocabulary, request-local stage failure/no-prog **Solution** -Add a closed exported terminal DTO with validated kind and safe error class, carry it on results/terminal progress, deep-copy it, and make the first terminal winner authoritative across cleanup and endpoint acknowledgement. +Add a closed exported terminal DTO with validated kind and safe error class. Carry a candidate on executor envelopes/results and copy the frozen value onto every `finalizing`, `failed`, or `cancelled` progress item. Legacy final results normalize to `end_turn`; plain executor errors normalize to a safe provider class; typed stage failures retain only their closed disposition. Cleanup may replace a success/length candidate with one cleanup failure before terminal progress is emitted, after which the disposition is immutable. Endpoint acknowledgement failure changes only the internal completion outcome and can never emit a second public terminal. Before (`apps/edge/internal/service/single_request.go:46-48`): @@ -158,18 +161,23 @@ type SingleRequestResult struct { Output string Terminal SingleRequestTerminalDisposition } + +type SingleRequestProgress struct { + // Existing request, stage, message, result, and error fields remain. + Terminal *SingleRequestTerminalDisposition +} ``` -Zero-value legacy result literals normalize to `end_turn` only during validation; raw error text is never stored. +`SingleRequestEnvelope` gains the same optional terminal candidate for classified failure/cancel handoff. Zero-value legacy result literals normalize to `end_turn` only during validation; raw error text is never stored or projected. **Modified Files and Checklist** -- [ ] Extend validation, cloning, terminal progress, cleanup join, and acknowledgement in `apps/edge/internal/service/single_request.go`. +- [ ] Extend envelope/result/progress validation, cloning, terminal progress, cleanup conversion, and acknowledgement in `apps/edge/internal/service/single_request.go`. - [ ] Add normal, invalid, length, error, cancel, cleanup-race, and terminal-winner coverage in `apps/edge/internal/service/single_request_test.go`. **Test Strategy** -Write `TestSingleRequestTerminalDisposition*` in `apps/edge/internal/service/single_request_test.go`; assert copy safety, compatibility, first-winner stability, cleanup-before-terminal, and raw-free values. +Write `TestSingleRequestTerminalDisposition*` in `apps/edge/internal/service/single_request_test.go`; assert finalizing/failed/cancelled propagation, copy safety, legacy compatibility, cleanup-before-freeze, post-freeze winner stability, and raw-free values. **Verification** diff --git a/agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/code_review_cloud_G10_1.log b/agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/code_review_cloud_G10_1.log new file mode 100644 index 00000000..0e6e1d5c --- /dev/null +++ b/agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/code_review_cloud_G10_1.log @@ -0,0 +1,221 @@ + + +# Code Review Reference - API + +> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is the mandatory final step of implementation.** +> The task is NOT complete until every implementation-owned section below is filled in. +> Complete the `Implementation Checklist`; the final checklist item is mandatory before saving. +> Fill implementation-owned sections, then stop with active files in place and report ready for review. +> Execute the plan's selected root cause, scope, files, and dependency decisions as written. Do not choose another owner, narrow/expand the write boundary, or replace a fix with another verification attempt. +> If implementation is blocked, record the exact blocker, attempted commands/output, and resume condition only in implementation-owned evidence fields. +> Do not ask the user directly, present choices, call user-input tools, create control-plane stop files, or classify the next state. +> Finalization (`Code Review Result`, log rename, `complete.log`, archive moves, `Review-Only Checklist`) is review-agent-only, even after compaction/resume. +> Follow the ownership table at the bottom of this file for which sections you own. + +## Overview + +date=2026-08-07 +task=m-iop-owned-single-request-agent-execution/23+22_error_cancel, plan=1, tag=API + +## Archive Evidence Snapshot + +- Prior plan: `agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/plan_cloud_G10_0.log`; prior pristine review stub: `agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/code_review_cloud_G10_0.log`. +- No implementation evidence or official verdict existed. Self-review found two semantic plan defects: Edge HTTP terminal ownership was incorrectly assigned to the host-neutral execution-runtime contract, and the current `/v1/messages` input-surface spec was omitted. +- This replan preserves the production/test boundary and S11 matrix, removes `agent-contract/inner/execution-runtime.md` from the write set, and adds `agent-spec/input/openai-compatible-surface.md`. + +## For the Review Agent + +> **[REVIEW AGENT ONLY]** The finalization steps below are review-agent only. Implementing agents must not execute this section. + +Compare implementation of each item against source files and verify that output in `Verification Results` matches code. +Review completion means the following steps are finished: + +1. Append verdict and `review_rework_count` / `evidence_integrity_failure` routing signals. +2. Archive `CODE_REVIEW-cloud-G10.md` → `code_review_cloud_G10_1.log` and `PLAN-cloud-G10.md` → `plan_cloud_G10_1.log`. +3. If PASS, write `complete.log` and move active task directory to `agent-task/archive/YYYY/MM/m-iop-owned-single-request-agent-execution/23+22_error_cancel/`. If WARN/FAIL, fully write the next filesystem state required by the code-review skill. +4. If PASS, preserve the first-line `milestone-task=error-cancel` metadata in `complete.log` and report it for runtime aggregation. Roadmap evaluation belongs to `sync-milestone-workstate`. +5. Check applicable `Review-Only Checklist` items at the final `.log` location before reporting. + +--- + +## Implementation Item Completion + +| Item | Status | +|------|---------| +| API-1 | [ ] | +| API-2 | [ ] | +| API-3 | [ ] | +| API-4 | [ ] | + +## Implementation Checklist + +- [ ] Add a closed, copy-safe single-request terminal disposition that distinguishes `end_turn`, `length`, sanitized error classes, and caller cancellation while preserving exactly-once cleanup/acknowledgement. +- [ ] Classify provider/tool timeout, stage/request budgets, repetition/no-progress, malformed calls, context/output limits, and disconnect in the completed stage/composite path without retry, fallback, partial-success, generic StreamGate admission, or retained waiters. +- [ ] Project the closed disposition consistently through buffered and SSE Anthropic responses and add the complete S11 one-ingress/one-terminal race matrix. +- [ ] Synchronize the Anthropic outer contract and both matching current implementation specs with the implemented error/cancel/length policy. +- [ ] Run dependency, focused race, compatibility, full SDD, proto, deterministic symbol/document, and diff verification freshly. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +> **[REVIEW AGENT ONLY]** This checklist is used only by the review agent. +> Implementing agents must not modify or check this section. + +- [ ] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure` to `Code Review Result`. +- [ ] Verify that verdict, `Dimension Assessment`, and Required/Suggested/Nit classifications match. +- [ ] Archive active `CODE_REVIEW-*-G??.md` to `code_review_cloud_G10_1.log`. +- [ ] Archive active `PLAN-*-G??.md` to `plan_cloud_G10_1.log`. +- [ ] Verify that the Agent-Ops managed block in `.gitignore` unignores `agent-task/**/*.md` and `agent-task/**/*.log` and ignores `agent-roadmap/current.md`. +- [ ] If PASS, write `complete.log` based on `agent-ops/skills/common/code-review/templates/complete-log-template.md` and leave no active `.md` files. +- [ ] If PASS, move active task directory `agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/` to `agent-task/archive/YYYY/MM/m-iop-owned-single-request-agent-execution/23+22_error_cancel/` and update this checklist at the final archive path. +- [ ] If PASS, preserve and report `milestone-task=error-cancel` for runtime aggregation, without modifying roadmap or directly calling `update-roadmap`. +- [ ] If PASS for split work, remove empty active parent only if no siblings/files remain. +- [ ] If WARN/FAIL, write the next filesystem state matching code-review verdict and do not write `complete.log`. + +## Deviations from Plan + +_Record any deviations from the plan and the rationale here._ + +## Key Design Decisions + +_Record key design decisions here._ + +## Reviewer Checkpoints + +- Confirm task-22 has exactly one completion log and completed symbols were reread before edits. +- Confirm the closed terminal disposition is copy-safe/raw-free and the first winner survives cleanup and write acknowledgement races. +- Confirm timeout/budget/repetition/malformed/context/output/cancel rows cause no fallback, partial result, generic StreamGate admission, second ingress, later provider dispatch, or retained waiter. +- Confirm buffered and SSE mappings are identical and disconnect remains silent. +- Confirm `agent-contract/inner/execution-runtime.md` and Edge-Node wire/proto remain unchanged, while outer Anthropic contract and both current specs match the implementation. + +## Verification Results + +Paste actual stdout/stderr for every command. If output is too long, record the exact command and saved output path; summaries are insufficient. + +### 1. Dependency gate + +Command: + +```sh +bash -c 'set -euo pipefail; shopt -s nullglob; candidates=(agent-task/m-iop-owned-single-request-agent-execution/22_*/complete.log agent-task/m-iop-owned-single-request-agent-execution/22+*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/22_*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/22+*/complete.log); printf "%s\n" "${candidates[@]}"; ((${#candidates[@]} == 1))' +``` + +Output: + +_Fill with actual output._ + +### 2. S11 focused race matrix + +Command: + +```sh +go test -race ./apps/edge/internal/service ./apps/edge/internal/openai -run 'Test(SingleRequestTerminalDisposition|SingleRequestQualityGate|AnthropicSingleRequestErrorCancelMatrix|SingleRequestAnthropicStreamTerminalDisposition)' -count=1 +``` + +Output: + +_Fill with actual output._ + +### 3. Service compatibility race tests + +Command: + +```sh +go test -race ./apps/edge/internal/service -run 'TestSingleRequest(InternalToolLoop|Cleanup|Observation|EnvelopeOrdering|StageBudget)' -count=1 +``` + +Output: + +_Fill with actual output._ + +### 4. Edge vet and package regressions + +Command: + +```sh +go vet ./apps/edge/internal/service ./apps/edge/internal/openai && go test ./apps/edge/... -count=1 +``` + +Output: + +_Fill with actual output._ + +### 5. Approved SDD common suite + +Command: + +```sh +go test -race -count=1 ./packages/go/config ./packages/go/streamgate ./apps/edge/internal/openai ./apps/edge/internal/service ./apps/node/internal/node ./apps/node/internal/transport ./apps/node/internal/workspace +``` + +Output: + +_Fill with actual output._ + +### 6. Protobuf reproducibility + +Command: + +```sh +make proto && git diff --exit-code -- proto/gen/iop +``` + +Output: + +_Fill with actual output._ + +### 7. Contract/spec policy search + +Command: + +```sh +rg --sort path -n 'end_turn|max_tokens|invalid_request_error|api_error|disconnect|no second|second request|S11|error-cancel' agent-contract/outer/anthropic-compatible-api.md agent-spec/runtime/edge-node-execution.md agent-spec/input/openai-compatible-surface.md +``` + +Output: + +_Fill with actual output._ + +### 8. Terminal symbol search + +Command: + +```sh +rg --sort path -n 'SingleRequestTerminal|SingleRequestResult|singleRequestAnthropic.*Policy' apps/edge/internal/service apps/edge/internal/openai --glob '*.go' +``` + +Output: + +_Fill with actual output._ + +### 9. Diff hygiene + +Command: + +```sh +git diff --check +``` + +Output: + +_Fill with actual output._ + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING] Have you filled in every implementation-owned section?** +> If anything is blank, go back and fill it in before saving this file. +> Leave review-agent-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---------|-------|------| +| Header comment, Overview, Review Agent Instructions | Fixed at stub creation | Implementing agent must not modify or execute these (archive, complete.log, and task-directory archive move are review-agent only) | +| Archive Evidence Snapshot | Fixed at stub creation from plan when present | Implementing agent uses it as prior-loop context; read only the cited archive files when more detail is required | +| Implementation Item Completion (item names) | Fixed at stub creation | Implementing agent checks `[ ]` → `[x]` only | +| Implementation Checklist (item text/order) | Fixed at stub creation from plan | Implementing agent checks `[ ]` → `[x]` only | +| Review-Only Checklist | Review agent only | Implementing agent must not modify or check this section | +| Deviations from Plan, Key Design Decisions | Implementing agent | Replace placeholder text with actual content | +| Reviewer Checkpoints | Fixed at stub creation | Pre-filled from plan | +| Verification Results (section headings + commands) | Fixed at stub creation | Implementing agent fills command output only; command changes require a `Deviations from Plan` entry | +| Code Review Result | Review agent appends | Not included in stub | diff --git a/agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/plan_cloud_G10_1.log b/agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/plan_cloud_G10_1.log new file mode 100644 index 00000000..4ba1f698 --- /dev/null +++ b/agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/plan_cloud_G10_1.log @@ -0,0 +1,327 @@ + + +# Closed single-request error, cancel, and length terminals + +## For the Implementing Agent + +Filling the implementation-owned sections of `CODE_REVIEW-cloud-G10.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 activated single-request executor will preserve one controller and one outer Anthropic request, but the current service and projector expose only a generic failure/cancel distinction and always finalize success as `end_turn`. SDD S11 requires every provider/tool timeout, budget exhaustion, repetition/no-progress, malformed call, context/output limit, and disconnect to converge through one closed terminal policy without fallback, partial success, or a second Claude request. + +## Archive Evidence Snapshot + +- Prior plan: `agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/plan_cloud_G10_0.log`; prior pristine review stub: `agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/code_review_cloud_G10_0.log`. +- No implementation evidence or official verdict existed. Self-review found two semantic plan defects: Edge HTTP terminal ownership was incorrectly assigned to the host-neutral execution-runtime contract, and the current `/v1/messages` input-surface spec was omitted. +- This replan preserves the production/test boundary and S11 matrix, removes `agent-contract/inner/execution-runtime.md` from the write set, and adds `agent-spec/input/openai-compatible-surface.md`. + +## Analysis + +### Files Read + +- `AGENTS.md` +- `agent-ops/rules/project/rules.md` +- `agent-ops/rules/common/rules-roadmap.md` +- `agent-ops/rules/common/rules-agent-spec.md` +- `agent-ops/rules/project/domain/edge/rules.md` +- `agent-ops/rules/project/domain/node/rules.md` +- `agent-ops/rules/project/domain/platform-common/rules.md` +- `agent-ops/rules/project/domain/testing/rules.md` +- `agent-ops/skills/common/router.md` +- `agent-ops/skills/common/plan/SKILL.md` +- `agent-ops/skills/common/code-review/SKILL.md` +- `agent-ops/skills/common/finalize-task-routing/SKILL.md` +- `agent-ops/skills/common/sync-milestone-workstate/SKILL.md` +- `agent-test/local/rules.md` +- `agent-test/local/edge-smoke.md` +- `agent-test/local/node-smoke.md` +- `agent-test/local/platform-common-smoke.md` +- `agent-test/local/testing-smoke.md` +- `agent-roadmap/current.md` +- `agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/iop-owned-single-request-agent-execution.md` +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-owned-single-request-agent-execution/SDD.md` +- `agent-spec/index.md` +- `agent-spec/runtime/edge-node-execution.md` +- `agent-spec/runtime/stream-evidence-gate.md` +- `agent-spec/input/openai-compatible-surface.md` +- `agent-contract/index.md` +- `agent-contract/outer/anthropic-compatible-api.md` +- `agent-contract/inner/execution-runtime.md` +- `agent-contract/inner/edge-node-runtime-wire.md` +- `apps/edge/internal/service/single_request.go` +- `apps/edge/internal/service/single_request_types.go` +- `apps/edge/internal/service/single_request_tool_loop.go` +- `apps/edge/internal/service/single_request_tool_types.go` +- `apps/edge/internal/service/single_request_observation.go` +- `apps/edge/internal/service/single_request_metrics.go` +- `apps/edge/internal/service/single_request_test.go` +- `apps/edge/internal/service/single_request_tool_loop_test.go` +- `apps/edge/internal/service/single_request_cleanup_test.go` +- `apps/edge/internal/service/single_request_observation_test.go` +- `apps/edge/internal/service/single_request_metrics_test.go` +- `apps/edge/internal/openai/anthropic_handler.go` +- `apps/edge/internal/openai/single_request_anthropic_stream.go` +- `apps/edge/internal/openai/single_request_handler_test.go` +- `apps/edge/internal/openai/single_request_anthropic_stream_test.go` +- `agent-task/m-iop-owned-single-request-agent-execution/18+17_plan_stage/PLAN-local-G06.md` +- `agent-task/m-iop-owned-single-request-agent-execution/19+18_work_stage/PLAN-cloud-G08.md` +- `agent-task/m-iop-owned-single-request-agent-execution/20+19_review_repair/PLAN-cloud-G07.md` +- `agent-task/m-iop-owned-single-request-agent-execution/21+20_single_request_executor/PLAN-local-G08.md` +- `agent-task/m-iop-owned-single-request-agent-execution/22+21_executor_activation/PLAN-local-G07.md` +- `agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/PLAN-cloud-G07.md` +- `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/plan_cloud_G08_0.log` + +### SDD Criteria + +- Approved, unlocked SDD: `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-owned-single-request-agent-execution/SDD.md`; `milestone-task=error-cancel` maps to S11. +- S11 requires a matrix covering stage/request exhaustion, repetition/no-progress, malformed calls, provider/tool timeout, output/context limits, and disconnect. Every row must prove no retry/fallback/partial-success/second ingress and exactly one standard error, cancel, or length outcome. +- Evidence Map row S11 requires the budget/error/cancel/length/repetition terminal matrix. That row drives API-1 through API-4 and the focused race matrix in Final Verification. + +### Verification Context + +- No handoff was supplied. Repository-native evidence is the local test rules, service coordinator/tool-loop/cleanup/observation tests, Anthropic buffered/SSE tests, approved SDD, outer contract, and two matching current specs. +- Starting checkout is branch `feature/iop-owned-single-request-agent-execution`, HEAD `06e43f2aba7f42acb407cecb9761f30cbcc1df3c`. Go tests use `-count=1`; race tests, protobuf reproducibility, deterministic searches, and `git diff --check` are mandatory. S11 itself uses deterministic stage/provider/tool fixtures; task 25 supplies the later actual Claude full-cycle evidence. +- Task 22 is active and has no `complete.log`. Implementation must wait for it, resolve exactly one completion path, read that exact log, then reread completed task-18 through task-22 sources before editing. A completed-symbol mismatch is a recorded blocker/deviation, never a guessed owner expansion. +- The common SDD suite includes config, streamgate, Edge OpenAI/service, Node runtime/transport/workspace, `make proto`, and diff checks. Fresh output is required. + +### Test Coverage Gaps + +- Existing service tests cover budgets, cancellation, cleanup, races, and generic observation classes, but no caller-safe terminal disposition survives from executor through both Anthropic projectors. +- Existing stage plans do not prove repetition/no-progress or one closed cross-stage failure policy. +- Existing buffered/SSE tests do not cover the full timeout, budget, malformed, context, output-length, cancellation, and no-second-ingress matrix. + +### Symbol References + +- `SingleRequestResult` is constructed and cloned in `apps/edge/internal/service/single_request.go` and consumed by buffered/stream projectors and tests. Extend it compatibly and update every repository composite literal found by the final search. +- `singleRequestAnthropicTerminalKind`, `singleRequestAnthropicError`, `writeAnthropicSingleRequestTerminal`, and `pumpSingleRequestAnthropicStream` are the current projection sites. No public request field or Edge-Node wire symbol is renamed. +- Future task-18 through task-22 stage/composite symbols are explicit call sites and must be reread after task 22 completes. + +### Split Judgment + +- This is the indivisible S11 boundary: stage classification, service terminal ownership, and buffered/SSE projection must agree atomically. +- `23+22_error_cancel` depends on sibling 22. `agent-task/m-iop-owned-single-request-agent-execution/22+21_executor_activation/` is active and its `complete.log` is missing; no archive candidate was read. +- Task 25 consumes this packet and task 24 for actual Claude qualification. + +### Scope Rationale + +Include only the closed terminal vocabulary, request-local stage failure/no-progress classification, one controller winner, Anthropic buffered/SSE mapping, S11 tests, outer contract, and matching current specs. Exclude retry/reselection, dynamic modes, Edge-Node protobuf changes, new metric labels, actual Claude execution, deployment, roadmap mutation, the generic StreamGate lifecycle, and `agent-contract/inner/execution-runtime.md`; that inner contract owns host-neutral provider execution rather than Edge `/v1/messages` projection. + +### Final Routing + +- `evaluation_mode=isolated-reassessment`; build and review closures (`scope`, `context`, `verification`, `evidence`, `ownership`, `decision`) are all true; capability gap is absent. +- Finalizer `finalize-task-policy.sh`, mode `pair`. Build scores `2/2/2/2/2` => G10, base/final `grade-boundary`, `worker/cloud/G10`, `PLAN-cloud-G10.md`. Review scores `2/2/2/2/2` => G10, `official-review`, `review/cloud/G10`, `CODE_REVIEW-cloud-G10.md`. +- `large_indivisible_context=false`; positive risks are `temporal_state`, `concurrent_consistency`, `boundary_contract`, and `structured_interpretation` (4); `review_rework_count=0`; `evidence_integrity_failure=false`; recovery boundary is false. + +## Dependencies and Execution Order + +1. Resolve exactly one sibling-22 `complete.log` with Final Verification command 1, read only it, then reread completed provider-stage, Plan/Work/Review, composite executor, activation, service, and projector files. +2. Define and test the closed service terminal contract, then thread stage outcomes through the composite. +3. Project the same disposition through buffered/SSE Anthropic responses, synchronize the outer contract and both current specs, and run the full SDD suite. + +## Implementation Checklist + +- [ ] Add a closed, copy-safe single-request terminal disposition that distinguishes `end_turn`, `length`, sanitized error classes, and caller cancellation while preserving exactly-once cleanup/acknowledgement. +- [ ] Classify provider/tool timeout, stage/request budgets, repetition/no-progress, malformed calls, context/output limits, and disconnect in the completed stage/composite path without retry, fallback, partial-success, generic StreamGate admission, or retained waiters. +- [ ] Project the closed disposition consistently through buffered and SSE Anthropic responses and add the complete S11 one-ingress/one-terminal race matrix. +- [ ] Synchronize the Anthropic outer contract and both matching current implementation specs with the implemented error/cancel/length policy. +- [ ] Run dependency, focused race, compatibility, full SDD, proto, deterministic symbol/document, and diff verification freshly. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Carry one closed terminal disposition + +**Problem** + +`apps/edge/internal/service/single_request.go:46-48` carries only output, while failed/cancelled progress at lines 304-317 loses the safe terminal reason before the endpoint sees it. + +**Solution** + +Add a closed exported terminal DTO with validated kind and safe error class, carry it on results/terminal progress, deep-copy it, and make the first terminal winner authoritative across cleanup and endpoint acknowledgement. + +Before (`apps/edge/internal/service/single_request.go:46-48`): + +```go +type SingleRequestResult struct { + Output string +} +``` + +After: + +```go +type SingleRequestTerminalDisposition struct { + Kind SingleRequestTerminalKind + ErrorClass SingleRequestTerminalErrorClass +} + +type SingleRequestResult struct { + Output string + Terminal SingleRequestTerminalDisposition +} +``` + +Zero-value legacy result literals normalize to `end_turn` only during validation; raw error text is never stored. + +**Modified Files and Checklist** + +- [ ] Extend validation, cloning, terminal progress, cleanup join, and acknowledgement in `apps/edge/internal/service/single_request.go`. +- [ ] Add normal, invalid, length, error, cancel, cleanup-race, and terminal-winner coverage in `apps/edge/internal/service/single_request_test.go`. + +**Test Strategy** + +Write `TestSingleRequestTerminalDisposition*` in `apps/edge/internal/service/single_request_test.go`; assert copy safety, compatibility, first-winner stability, cleanup-before-terminal, and raw-free values. + +**Verification** + +Run `go test -race ./apps/edge/internal/service -run 'TestSingleRequestTerminalDisposition' -count=1`; all disposition/race rows pass. + +### [API-2] Classify every S11 stage outcome without fallback + +**Problem** + +The completed provider codec and stage loops will return heterogeneous provider finishes, decoder failures, repeated actions/results, context/output exhaustion, and context errors. Generic propagation would collapse length into failure and permit deterministic no-progress to consume later budgets. + +**Solution** + +Add a request-local quality guard that reuses existing bounded canonicalization/fingerprint helpers where applicable, rejects the first proven action/result no-progress cycle, and returns only closed service dispositions. It must not enter the generic StreamGate admission/recovery lifecycle, duplicate request lifecycle/budget ownership, retry, or dispatch a later stage/model after terminal classification. + +Before (`agent-task/m-iop-owned-single-request-agent-execution/21+20_single_request_executor/PLAN-local-G08.md:84`): + +```go +// The predecessor composite preserves cancellation and generic errors. +``` + +After: + +```go +// The composite classifies each stage outcome once, submits no later provider +// call after a terminal, and returns one closed service disposition. +``` + +**Modified Files and Checklist** + +- [ ] Add closed outcome normalization and bounded fingerprints in `apps/edge/internal/openai/single_request_quality_gate.go`. +- [ ] Thread it through `apps/edge/internal/openai/single_request_provider_stage.go`, `apps/edge/internal/openai/single_request_work_stage.go`, `apps/edge/internal/openai/single_request_review_stage.go`, and `apps/edge/internal/openai/single_request_executor.go` after task 22. +- [ ] Add the complete deterministic matrix in `apps/edge/internal/openai/single_request_quality_gate_test.go`. + +**Test Strategy** + +Write `TestSingleRequestQualityGate*` under `-race`; assert dispatch/tool/envelope/terminal/waiter counts and safe output for timeout, budgets, repeat/no-progress, malformed, context/output, and cancel rows. + +**Verification** + +Run `go test -race ./apps/edge/internal/openai -run 'TestSingleRequestQualityGate' -count=1`; every row stops on its first terminal with no extra dispatch. + +### [API-3] Emit one standard Anthropic terminal + +**Problem** + +`apps/edge/internal/openai/anthropic_handler.go:280-303` maps every failure to generic `api_error`, while lines 316-330 always emit `stop_reason=end_turn`. `apps/edge/internal/openai/single_request_anthropic_stream.go:368-397` likewise lacks length/error-class projection. + +**Solution** + +Use one policy shared by buffered and SSE projectors: success=`end_turn`, output limit=`max_tokens`, validation/context=`invalid_request_error`, provider/timeout/budget/repetition/malformed=`api_error`, caller disconnect=silent internal cancel. Length never exposes private partial stage content, and no error writes a later success terminal. + +Before (`apps/edge/internal/openai/anthropic_handler.go:316-325`): + +```go +stopReason := "end_turn" +response := anthropicMessageResponse{StopReason: &stopReason} +``` + +After: + +```go +policy := anthropicSingleRequestPolicy(result.Terminal) +response := anthropicMessageResponse{StopReason: &policy.stopReason} +``` + +**Modified Files and Checklist** + +- [ ] Centralize safe status/error/stop-reason mapping in `apps/edge/internal/openai/anthropic_handler.go`. +- [ ] Apply the same serialized policy in `apps/edge/internal/openai/single_request_anthropic_stream.go`. +- [ ] Add buffered matrix coverage in `apps/edge/internal/openai/single_request_handler_test.go`. +- [ ] Add SSE ordering/race/length/error/disconnect coverage in `apps/edge/internal/openai/single_request_anthropic_stream_test.go`. + +**Test Strategy** + +Write `TestAnthropicSingleRequestErrorCancelMatrix` and `TestSingleRequestAnthropicStreamTerminalDisposition*`; assert HTTP/SSE shape, terminal count one, ingress delta one, no private values, no success after error, and silence after disconnect. + +**Verification** + +Run `go test -race ./apps/edge/internal/openai -run 'Test(AnthropicSingleRequestErrorCancelMatrix|SingleRequestAnthropicStreamTerminalDisposition)' -count=1`; all rows pass. + +### [API-4] Synchronize the Edge terminal contract and current specs + +**Problem** + +`agent-contract/outer/anthropic-compatible-api.md:131-134` describes generic marked-request failure/cancel behavior, while both matching living specs defer S11. The host-neutral `agent-contract/inner/execution-runtime.md` owns provider `RunRequest` lifecycle rather than Edge HTTP projection and must remain unchanged. + +**Solution** + +Document the exact endpoint mapping, one-ingress/one-terminal/no-fallback invariant, silent disconnect, length privacy, unchanged Edge-Node wire, and deterministic S11 evidence in the outer Anthropic contract plus the runtime and input-surface specs. + +Before (`agent-contract/outer/anthropic-compatible-api.md:131-134`): + +```text +A coordinator failure or non-disconnect cancellation writes one sanitized +error event. Caller disconnect cancels execution and suppresses further output. +``` + +After: + +```text +The marked projector applies one closed error/cancel/length policy to buffered +and SSE responses; disconnect is silent and cannot produce later ingress/output. +``` + +**Modified Files and Checklist** + +- [ ] Update `agent-contract/outer/anthropic-compatible-api.md` with the endpoint mapping. +- [ ] Update `agent-spec/runtime/edge-node-execution.md` with S11 implementation/evidence, leaving S12 pending. +- [ ] Update `agent-spec/input/openai-compatible-surface.md` with the same current `/v1/messages` terminal behavior and evidence. + +**Test Strategy** + +No document-only test is added; API-1 through API-3 fixtures back the statements and deterministic search checks both specs. + +**Verification** + +Run Final Verification command 7; every terminal kind and S11/no-second-request statement appears in the outer contract and both specs. + +## Modified Files Summary + +| File | Items | +|------|-------| +| `apps/edge/internal/service/single_request.go` | API-1 | +| `apps/edge/internal/service/single_request_test.go` | API-1 | +| `apps/edge/internal/openai/single_request_quality_gate.go` | API-2 | +| `apps/edge/internal/openai/single_request_quality_gate_test.go` | API-2 | +| `apps/edge/internal/openai/single_request_provider_stage.go` | API-2 | +| `apps/edge/internal/openai/single_request_work_stage.go` | API-2 | +| `apps/edge/internal/openai/single_request_review_stage.go` | API-2 | +| `apps/edge/internal/openai/single_request_executor.go` | API-2 | +| `apps/edge/internal/openai/anthropic_handler.go` | API-3 | +| `apps/edge/internal/openai/single_request_anthropic_stream.go` | API-3 | +| `apps/edge/internal/openai/single_request_handler_test.go` | API-3 | +| `apps/edge/internal/openai/single_request_anthropic_stream_test.go` | API-3 | +| `agent-contract/outer/anthropic-compatible-api.md` | API-4 | +| `agent-spec/runtime/edge-node-execution.md` | API-4 | +| `agent-spec/input/openai-compatible-surface.md` | API-4 | +| `agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/CODE_REVIEW-cloud-G10.md` | API-1, API-2, API-3, API-4 | + +## Final Verification + +Fresh output is required; cached Go test output is not acceptable. + +1. `bash -c 'set -euo pipefail; shopt -s nullglob; candidates=(agent-task/m-iop-owned-single-request-agent-execution/22_*/complete.log agent-task/m-iop-owned-single-request-agent-execution/22+*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/22_*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/22+*/complete.log); printf "%s\n" "${candidates[@]}"; ((${#candidates[@]} == 1))'` — exactly one task-22 completion path exists before implementation/review. +2. `go test -race ./apps/edge/internal/service ./apps/edge/internal/openai -run 'Test(SingleRequestTerminalDisposition|SingleRequestQualityGate|AnthropicSingleRequestErrorCancelMatrix|SingleRequestAnthropicStreamTerminalDisposition)' -count=1` — the S11 terminal matrix passes without races. +3. `go test -race ./apps/edge/internal/service -run 'TestSingleRequest(InternalToolLoop|Cleanup|Observation|EnvelopeOrdering|StageBudget)' -count=1` — coordinator budgets, cleanup, observation, and ordering remain compatible. +4. `go vet ./apps/edge/internal/service ./apps/edge/internal/openai && go test ./apps/edge/... -count=1` — changed Edge packages vet and regress cleanly. +5. `go test -race -count=1 ./packages/go/config ./packages/go/streamgate ./apps/edge/internal/openai ./apps/edge/internal/service ./apps/node/internal/node ./apps/node/internal/transport ./apps/node/internal/workspace` — approved SDD common suite passes freshly. +6. `make proto && git diff --exit-code -- proto/gen/iop` — protobuf generation is reproducible with no wire delta. +7. `rg --sort path -n 'end_turn|max_tokens|invalid_request_error|api_error|disconnect|no second|second request|S11|error-cancel' agent-contract/outer/anthropic-compatible-api.md agent-spec/runtime/edge-node-execution.md agent-spec/input/openai-compatible-surface.md` — outer contract and both current specs contain the closed policy/evidence. +8. `rg --sort path -n 'SingleRequestTerminal|SingleRequestResult|singleRequestAnthropic.*Policy' apps/edge/internal/service apps/edge/internal/openai --glob '*.go'` — every construction/projection call site is visible. +9. `git diff --check` — no whitespace errors. + +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/24+22_claude_smoke_harness/CODE_REVIEW-cloud-G07.md b/agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/CODE_REVIEW-cloud-G07.md index 3038fa39..5816cfdb 100644 --- a/agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/CODE_REVIEW-cloud-G07.md +++ b/agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/CODE_REVIEW-cloud-G07.md @@ -1,4 +1,4 @@ - + # Code Review Reference - TEST @@ -15,7 +15,13 @@ ## Overview date=2026-08-07 -task=m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness, plan=0, tag=TEST +task=m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness, plan=1, tag=TEST + +## Archive Evidence Snapshot + +- Prior plan: `agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/plan_cloud_G07_0.log`; prior pristine review stub: `agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/code_review_cloud_G07_0.log`. +- No implementation evidence or official verdict existed. Fresh SDD review found that role names plus opaque model digests did not prove the required actual `Gemini → ornith-fast → Gemini` binding order. +- This replan preserves the write set and external-execution boundary while adding closed engine-family facts, immutable binding joins, and negative engine-order fixtures. ## For the Review Agent @@ -25,7 +31,7 @@ Compare implementation of each item against source files and verify that output Review completion means the following steps are finished: 1. Append verdict and `review_rework_count` / `evidence_integrity_failure` routing signals. -2. Archive `CODE_REVIEW-cloud-G07.md` → `code_review_cloud_G07_0.log` and `PLAN-cloud-G07.md` → `plan_cloud_G07_0.log`. +2. Archive `CODE_REVIEW-cloud-G07.md` → `code_review_cloud_G07_1.log` and `PLAN-cloud-G07.md` → `plan_cloud_G07_1.log`. 3. If PASS, write `complete.log` and move active task directory to `agent-task/archive/YYYY/MM/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/`. If WARN/FAIL, fully write the next filesystem state required by the code-review skill. 4. If PASS, preserve first-line `milestone-task=claude-smoke` metadata in `complete.log` and report it for runtime aggregation. Roadmap state evaluation belongs to `sync-milestone-workstate`. 5. Check applicable `Review-Only Checklist` items at the final `.log` location before reporting. @@ -42,7 +48,7 @@ Review completion means the following steps are finished: ## Implementation Checklist -- [ ] Add a closed redacted S12 manifest schema covering source/runtime identity, one ingress, ordered Plan/Work/Review timing, one terminal, workspace before/after, verification, and zero forbidden matches. +- [ ] Add a closed redacted S12 manifest schema covering source/runtime identity, one ingress, ordered Plan/Work/Review with `Gemini → ornith-fast → Gemini` engine-family facts and timing, one terminal, workspace before/after, verification, and zero forbidden matches. - [ ] Add a credential-free self-testing harness with `--self-test`, `--preflight-only`, `--run`, and `--validate-manifest` modes that rejects stale/mismatched/external inputs before invoking Claude. - [ ] Add isolated Make targets for self-test, preflight, validation, and credentialed run without adding the external run to aggregate local tests. - [ ] Run dependency, shell syntax, credential-free behavioral, schema/redaction, Make target, and diff verification freshly; do not claim S12 qualification. @@ -55,8 +61,8 @@ Review completion means the following steps are finished: - [ ] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure` to `Code Review Result`. - [ ] Verify that verdict, `Dimension Assessment`, and Required/Suggested/Nit classifications match. -- [ ] Archive active `CODE_REVIEW-*-G??.md` to `code_review_cloud_G07_0.log`. -- [ ] Archive active `PLAN-*-G??.md` to `plan_cloud_G07_0.log`. +- [ ] Archive active `CODE_REVIEW-*-G??.md` to `code_review_cloud_G07_1.log`. +- [ ] Archive active `PLAN-*-G??.md` to `plan_cloud_G07_1.log`. - [ ] Verify that the Agent-Ops managed block in `.gitignore` unignores `agent-task/**/*.md` and `agent-task/**/*.log` and ignores `agent-roadmap/current.md`. - [ ] If PASS, write `complete.log` based on `agent-ops/skills/common/code-review/templates/complete-log-template.md` and leave no active `.md` files. - [ ] If PASS, move active task directory `agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/` to `agent-task/archive/YYYY/MM/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/` and update this checklist at the final archive path. @@ -74,8 +80,8 @@ _Record key design decisions here._ ## Reviewer Checkpoints -- [ ] TEST-1 schema is closed at every object, fixes ingress/stage/terminal constants, accepts only digest/closed evidence, and forbids sensitive/raw fields. -- [ ] TEST-2 validates all source/runtime/Mac/log/metric/workspace/secret-name facts before one Claude child and writes the manifest atomically without raw values. +- [ ] TEST-1 schema is closed at every object, fixes ingress/stage/engine-family/terminal constants, binds `gemini/ornith-fast/gemini` to immutable config digests, accepts only digest/closed evidence, and forbids sensitive/raw fields. +- [ ] TEST-2 validates all source/runtime/Mac/log/metric/workspace/secret-name and stage-binding facts before one Claude child and writes the manifest atomically without raw values. - [ ] TEST-2 self-test uses only temporary fakes, records one valid invocation, rejects every contradiction, and never contacts network or installed CLI/Edge. - [ ] TEST-3 targets are isolated from aggregate tests and forward no default endpoint/model/config/secret value. - [ ] The packet makes no S12 external qualification claim and changes no production runtime or test-rule document. @@ -175,6 +181,7 @@ Output: _Paste actual stdout/stderr and exit status._ | Section | Owner | Note | |---------|-------|------| | Header comment, Overview, Review Agent Instructions | Fixed at stub creation | Implementing agent must not modify or execute these (archive, complete.log, and task-directory archive move are review-agent only) | +| Archive Evidence Snapshot | Fixed at stub creation from plan when present | Implementing agent uses it as prior-loop context; read only the cited archive files when more detail is required | | Implementation Item Completion (item names) | Fixed at stub creation | Implementing agent checks `[ ]` → `[x]` only | | Implementation Checklist (item text/order) | Fixed at stub creation from plan | Implementing agent checks `[ ]` → `[x]` only | | Review-Only Checklist | Review agent only | Implementing agent must not modify or check this section | diff --git a/agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/PLAN-cloud-G07.md b/agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/PLAN-cloud-G07.md index 77ff6cf9..d07cf1ef 100644 --- a/agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/PLAN-cloud-G07.md +++ b/agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/PLAN-cloud-G07.md @@ -1,4 +1,4 @@ - + # Credential-free Claude single-request smoke harness @@ -10,10 +10,17 @@ Filling the implementation-owned sections of `CODE_REVIEW-cloud-G07.md` is the m SDD S12 requires an actual Claude/Mac run, but external credentials and a writable Mac runtime must not be needed to validate the evidence collector itself. This packet builds a dedicated self-testing/preflight/run harness and closed manifest schema; it does not claim external qualification, which remains task 25. +## Archive Evidence Snapshot + +- Prior plan: `agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/plan_cloud_G07_0.log`; prior pristine review stub: `agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/code_review_cloud_G07_0.log`. +- No implementation evidence or official verdict existed. Fresh SDD review found that the prior schema proved only `plan/work/review` roles plus opaque model digests, which cannot independently demonstrate the required actual `Gemini → ornith-fast → Gemini` binding order. +- This replan keeps the script/schema/Make write set and external-execution separation, and adds closed engine-family facts bound to immutable config digests plus negative fixtures for wrong engine order. + ## Analysis ### Files Read +- Plan 1 freshly reread the milestone/SDD, immediate prior pair/log, current observation/ingress surfaces and tests, current Makefile, and the repository's existing smoke-harness patterns. The unchanged entries below preserve the prior pair's recorded analysis base; no external execution evidence is inferred from it. - `AGENTS.md` - `agent-ops/rules/project/rules.md` - `agent-ops/rules/common/rules-roadmap.md` @@ -23,6 +30,7 @@ SDD S12 requires an actual Claude/Mac run, but external credentials and a writab - `agent-ops/rules/project/domain/testing/rules.md` - `agent-ops/skills/common/router.md` - `agent-ops/skills/common/plan/SKILL.md` +- `agent-ops/skills/common/refine-plans/SKILL.md` - `agent-ops/skills/common/finalize-task-routing/SKILL.md` - `agent-test/local/rules.md` - `agent-test/local/edge-smoke.md` @@ -44,13 +52,13 @@ SDD S12 requires an actual Claude/Mac run, but external credentials and a writab ### SDD Criteria - Approved, unlocked SDD: `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-owned-single-request-agent-execution/SDD.md`; `milestone-task=claude-smoke` maps to S12. -- S12 requires one actual Claude invocation against a writable Mac test workspace, Plan → Work → Review order, stage-pure and total timing, final file/verification, ingress POST count one, and terminal one. +- S12 requires one actual Claude invocation against a writable Mac test workspace, Plan/Work/Review using `Gemini → ornith-fast → Gemini`, stage-pure and total timing, final file/verification, ingress POST count one, and terminal one. - Evidence Map row S12 requires actual Claude, ingress counter, Edge/Node/provider stage+total logs, and workspace before/after. This packet encodes those as a closed schema and proves collection/rejection behavior without external execution. ### Verification Context - No handoff was supplied. Local rules and the existing credential-free `e2e-hot-path-agents.sh --self-test` pattern are repository-native fallback evidence. -- Current preflight: branch `feature/iop-owned-single-request-agent-execution`, HEAD `06e43f2aba7f42acb407cecb9761f30cbcc1df3c`, initially clean; host is Linux `aarch64` with Go `1.26.2`, while the required workspace Node runtime is macOS. `/config/.npm-global/bin/claude` exists and reports `2.1.223`; its help exposes `--print`, `--output-format`, `--include-partial-messages`, `--no-session-persistence`, and `--bare`. No authorized runner controlling a Mac workspace Node, synchronized external checkout, Edge binary/config, live observation log, metrics endpoint, writable test workspace, or secret env name was supplied. +- Preparation checkpoint: branch `feature/iop-owned-single-request-agent-execution`, HEAD `b31163396d0e6556b5eaa759f9c7f1149fbc81c9`, initially clean; host is Linux `aarch64` with Go `1.26.2`, while the required workspace Node runtime is macOS. `/config/.npm-global/bin/claude` exists and reports `2.1.223`; its help exposes `--print`, `--output-format`, `--include-partial-messages`, `--no-session-persistence`, and `--bare`. No authorized runner controlling a Mac workspace Node, synchronized external checkout, Edge binary/config, live observation log, metrics endpoint, writable test workspace, or secret env name was supplied. - `agent-test/dev-corp/**` was inspected only to check for a repository-declared Mac path, but that environment explicitly requires user selection and therefore is not selected or encoded as a default. The harness accepts caller-supplied runtime inputs and fails before invocation on any missing/mismatched fact. - Task 22 is active and has no `complete.log`. Implementation waits for exactly one task-22 completion, then rereads the activated observation and ingress surfaces. @@ -66,7 +74,7 @@ SDD S12 requires an actual Claude/Mac run, but external credentials and a writab - Existing real-POST tests prove one ingress and raw-free lifecycle observations with fakes, but not the installed Claude CLI, external runtime identity, fresh-log offset, workspace before/after, or a tracked redacted manifest. - Existing hot-path harness proves analogous two-agent scenarios, but its schema/stages do not represent the single-request Plan/Work/Review coordinator and cannot be reused as S12 evidence. -- No current test rejects stale/rotated observation logs, counter delta other than one, wrong stage order, duplicate/no terminal, workspace mismatch, or forbidden evidence fields for this Epic. +- No current test rejects stale/rotated observation logs, counter delta other than one, wrong stage or engine-family order, duplicate/no terminal, workspace mismatch, or forbidden evidence fields for this Epic. ### Symbol References @@ -77,6 +85,7 @@ SDD S12 requires an actual Claude/Mac run, but external credentials and a writab - Task 24 owns the stable harness contract: credential-free self-test plus deterministic preflight/run/manifest validation. Its independent PASS is `make test-single-request-claude-smoke-self-test` with no network or installed CLI invocation. - `24+22_claude_smoke_harness` depends on sibling 22. The active `22+21_executor_activation` has no `complete.log`; no archive body was read. - Task 25 consumes this harness and task 23's completed terminal policy for actual external qualification. Keeping credentialed execution separate prevents an unavailable runner from blocking repository-owned harness correctness. +- The replacement was evaluated once with `refine-plans`. Schema/collector/Make entry points form one validator contract, and log-anchored task 25 fixes the next consumer index, so no dependency-safe strict-subset child insertion is available. Keep this packet unchanged. ### Scope Rationale @@ -84,7 +93,7 @@ Include only the dedicated script, closed JSON schema, isolated Make targets, fa ### Final Routing -- `evaluation_mode=first-pass`; build/review closures are all true, with no capability gap. +- `evaluation_mode=isolated-reassessment`; build/review closures are all true, with no capability gap. - Build scores `1/1/1/2/2` => G07, base `local-fit`; four loop risks select `risk-boundary`, `worker/cloud/G07`, `PLAN-cloud-G07.md`. - Review scores `1/1/1/2/2` => G07, `official-review`, `review/cloud/G07`, `CODE_REVIEW-cloud-G07.md`. - `large_indivisible_context=false`; positive loop risks are `temporal_state`, `concurrent_consistency`, `boundary_contract`, and `structured_interpretation` (4). `review_rework_count=0`; `evidence_integrity_failure=false`; finalizer `finalize-task-policy.sh`, mode `pair`. @@ -97,7 +106,7 @@ Include only the dedicated script, closed JSON schema, isolated Make targets, fa ## Implementation Checklist -- [ ] Add a closed redacted S12 manifest schema covering source/runtime identity, one ingress, ordered Plan/Work/Review timing, one terminal, workspace before/after, verification, and zero forbidden matches. +- [ ] Add a closed redacted S12 manifest schema covering source/runtime identity, one ingress, ordered Plan/Work/Review with `Gemini → ornith-fast → Gemini` engine-family facts and timing, one terminal, workspace before/after, verification, and zero forbidden matches. - [ ] Add a credential-free self-testing harness with `--self-test`, `--preflight-only`, `--run`, and `--validate-manifest` modes that rejects stale/mismatched/external inputs before invoking Claude. - [ ] Add isolated Make targets for self-test, preflight, validation, and credentialed run without adding the external run to aggregate local tests. - [ ] Run dependency, shell syntax, credential-free behavioral, schema/redaction, Make target, and diff verification freshly; do not claim S12 qualification. @@ -111,7 +120,7 @@ Include only the dedicated script, closed JSON schema, isolated Make targets, fa **Solution** -Create a JSON Schema with `additionalProperties:false` at every object. Require digest-only source/runtime/model/config identity, `ingress_delta=1`, ordered `plan/work/review` closed stage records with non-negative `duration_ms`, total duration, exactly one `end_turn` terminal, workspace before/after digests, verification exit zero, and a fixed redaction proof. Forbid raw prompt/output, endpoint, model, path, header, credential, token, and provider payload keys. +Create a JSON Schema with `additionalProperties:false` at every object. Require digest-only source/runtime/config identity, closed `gemini`/`ornith-fast` engine-family enums bound to the immutable stage-binding digest, `ingress_delta=1`, ordered `plan/work/review` records fixed to `gemini/ornith-fast/gemini` with non-negative stage-pure `duration_ms`, total duration, exactly one `end_turn` terminal, workspace before/after digests, verification exit zero, and a fixed redaction proof. Forbid arbitrary model strings and raw prompt/output, endpoint, path, header, credential, token, and provider payload keys. Before (new file; absence is the source fact): @@ -135,7 +144,7 @@ After: **Test Strategy** -The harness self-test generates one valid manifest and mutations for ingress 0/2, wrong stage order, stale/rotated log, missing/duplicate terminal, bad workspace verification, raw fields, secret sentinels, and runtime/source mismatch. Every mutation must fail validation. +The harness self-test generates one valid manifest and mutations for ingress 0/2, wrong stage order, wrong engine-family order/digest binding, stale/rotated log, missing/duplicate terminal, bad workspace verification, raw fields, secret sentinels, and runtime/source mismatch. Every mutation must fail validation. **Verification** @@ -149,7 +158,7 @@ Run `./scripts/e2e-single-request-claude.sh --self-test`; schema-positive and ev **Solution** -Add a dedicated shell harness modeled on the repository's existing external-smoke safety boundary. Pin Claude argv to one non-interactive invocation, bind base/model through environment, record metric/log offsets before launch, validate the closed stage/terminal sequence and Mac Node workspace result after exit, then atomically write only schema-approved digests/counts/enums/durations. Preflight validates all facts before invoking any child; self-test substitutes fake Claude/Edge/metrics/log/workspace and records an invocation marker. +Add a dedicated shell harness modeled on the repository's existing external-smoke safety boundary. Pin Claude argv to one non-interactive invocation, bind base/model through environment, and preflight the immutable Plan/Work/Review stage configuration as `gemini/ornith-fast/gemini` plus its digest. Record metric/log offsets before launch, join fresh stage observations to that binding, validate the closed stage/terminal sequence and Mac Node workspace result after exit, then atomically write only schema-approved digests/counts/enums/durations. Preflight validates all facts before invoking any child; self-test substitutes fake Claude/Edge/metrics/log/workspace and records an invocation marker. Before (new file; absence is the source fact): @@ -172,7 +181,7 @@ esac - [ ] Add strict modes/input parsing, source/worktree/runtime hashes, Mac workspace-owner/log/metric/port preflight, and fail-before-invocation behavior in `scripts/e2e-single-request-claude.sh`. - [ ] Pin one Claude `--print --output-format stream-json --no-session-persistence --bare` child in the workspace; pass base/model/secret only through environment and never echo or serialize values. -- [ ] Parse only freshly appended correlated `edge_single_request_observation` records, require stage order/timing and one terminal, compare ingress metric delta exactly one, verify the fixed file task, and atomically write the closed manifest. +- [ ] Parse only freshly appended correlated `edge_single_request_observation` records, require stage order/timing joined to the immutable `gemini/ornith-fast/gemini` binding and one terminal, compare ingress metric delta exactly one, verify the fixed file task, and atomically write the closed manifest. - [ ] Add fake CLI/runtime/log/metrics fixtures and all positive/negative assertions inside `--self-test`; ensure the installed Claude/Edge and network are never used. **Test Strategy** @@ -233,7 +242,7 @@ Fresh output is required; cached output is not acceptable. 1. `bash -c 'set -euo pipefail; shopt -s nullglob; candidates=(agent-task/m-iop-owned-single-request-agent-execution/22_*/complete.log agent-task/m-iop-owned-single-request-agent-execution/22+*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/22_*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/22+*/complete.log); printf "%s\n" "${candidates[@]}"; ((${#candidates[@]} == 1))'` — prints exactly one task-22 completion path and exits zero before implementation or review. 2. `bash -n scripts/e2e-single-request-claude.sh` — the harness has valid shell syntax. -3. `./scripts/e2e-single-request-claude.sh --self-test` — valid collection passes and every stale, mismatched, duplicate, count, ordering, workspace, and redaction contradiction is rejected without network or installed binaries. +3. `./scripts/e2e-single-request-claude.sh --self-test` — valid collection passes and every stale, mismatched, duplicate, count, stage/engine ordering, workspace, and redaction contradiction is rejected without network or installed binaries. 4. `make test-single-request-claude-smoke-self-test` — the repository entry point runs the same credential-free suite successfully. 5. `rg --sort path -n 'test-single-request-claude-smoke|IOP_SINGLE_REQUEST_SMOKE_' Makefile` — isolated targets and caller-supplied inputs are explicit. 6. `bash -c 'set -euo pipefail; if rg --sort path -n "test-single-request-claude-smoke([^:]*):.*test-single-request-claude-smoke$" Makefile; then exit 1; else test $? -eq 1; fi'` — exits zero only when no aggregate target includes the credentialed run. diff --git a/agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/code_review_cloud_G07_0.log b/agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/code_review_cloud_G07_0.log new file mode 100644 index 00000000..3038fa39 --- /dev/null +++ b/agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/code_review_cloud_G07_0.log @@ -0,0 +1,184 @@ + + +# Code Review Reference - TEST + +> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is the mandatory final step of implementation.** +> The task is NOT complete until every implementation-owned section below is filled in. +> Complete the `Implementation Checklist`; the final checklist item is mandatory before saving. +> Fill implementation-owned sections, then stop with active files in place and report ready for review. +> Execute the plan's selected root cause, scope, files, and dependency decisions as written. Do not choose another owner, narrow/expand the write boundary, or replace a fix with another verification attempt. +> If implementation is blocked, record the exact blocker, attempted commands/output, and resume condition only in implementation-owned evidence fields. +> Do not ask the user directly, present choices, call user-input tools, create control-plane stop files, or classify the next state. +> Finalization (`Code Review Result`, log rename, `complete.log`, archive moves, `Review-Only Checklist`) is review-agent-only, even after compaction/resume. +> Follow the ownership table at the bottom of this file for which sections you own. + +## Overview + +date=2026-08-07 +task=m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness, plan=0, tag=TEST + +## For the Review Agent + +> **[REVIEW AGENT ONLY]** The finalization steps below are review-agent only. Implementing agents must not execute this section. + +Compare implementation of each item against source files and verify that output in `Verification Results` matches code. +Review completion means the following steps are finished: + +1. Append verdict and `review_rework_count` / `evidence_integrity_failure` routing signals. +2. Archive `CODE_REVIEW-cloud-G07.md` → `code_review_cloud_G07_0.log` and `PLAN-cloud-G07.md` → `plan_cloud_G07_0.log`. +3. If PASS, write `complete.log` and move active task directory to `agent-task/archive/YYYY/MM/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/`. If WARN/FAIL, fully write the next filesystem state required by the code-review skill. +4. If PASS, preserve first-line `milestone-task=claude-smoke` metadata in `complete.log` and report it for runtime aggregation. Roadmap state evaluation belongs to `sync-milestone-workstate`. +5. Check applicable `Review-Only Checklist` items at the final `.log` location before reporting. + +--- + +## Implementation Item Completion + +| Item | Status | +|------|---------| +| TEST-1 Freeze the S12 evidence schema | [ ] | +| TEST-2 Collect fresh, redacted, one-invocation evidence | [ ] | +| TEST-3 Expose isolated Make entry points | [ ] | + +## Implementation Checklist + +- [ ] Add a closed redacted S12 manifest schema covering source/runtime identity, one ingress, ordered Plan/Work/Review timing, one terminal, workspace before/after, verification, and zero forbidden matches. +- [ ] Add a credential-free self-testing harness with `--self-test`, `--preflight-only`, `--run`, and `--validate-manifest` modes that rejects stale/mismatched/external inputs before invoking Claude. +- [ ] Add isolated Make targets for self-test, preflight, validation, and credentialed run without adding the external run to aggregate local tests. +- [ ] Run dependency, shell syntax, credential-free behavioral, schema/redaction, Make target, and diff verification freshly; do not claim S12 qualification. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +> **[REVIEW AGENT ONLY]** This checklist is used only by the review agent. +> Implementing agents must not modify or check this section. + +- [ ] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure` to `Code Review Result`. +- [ ] Verify that verdict, `Dimension Assessment`, and Required/Suggested/Nit classifications match. +- [ ] Archive active `CODE_REVIEW-*-G??.md` to `code_review_cloud_G07_0.log`. +- [ ] Archive active `PLAN-*-G??.md` to `plan_cloud_G07_0.log`. +- [ ] Verify that the Agent-Ops managed block in `.gitignore` unignores `agent-task/**/*.md` and `agent-task/**/*.log` and ignores `agent-roadmap/current.md`. +- [ ] If PASS, write `complete.log` based on `agent-ops/skills/common/code-review/templates/complete-log-template.md` and leave no active `.md` files. +- [ ] If PASS, move active task directory `agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/` to `agent-task/archive/YYYY/MM/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/` and update this checklist at the final archive path. +- [ ] If PASS, preserve and report `milestone-task=claude-smoke` metadata for runtime aggregation, without modifying roadmap or directly calling `update-roadmap`. +- [ ] If PASS for split work, remove empty active parent `agent-task/m-iop-owned-single-request-agent-execution/` or verify it was kept due to remaining siblings/files. +- [ ] If WARN/FAIL, write the next filesystem state matching code-review verdict and do not write `complete.log`. + +## Deviations from Plan + +_Record any deviations from the plan and the rationale here._ + +## Key Design Decisions + +_Record key design decisions here._ + +## Reviewer Checkpoints + +- [ ] TEST-1 schema is closed at every object, fixes ingress/stage/terminal constants, accepts only digest/closed evidence, and forbids sensitive/raw fields. +- [ ] TEST-2 validates all source/runtime/Mac/log/metric/workspace/secret-name facts before one Claude child and writes the manifest atomically without raw values. +- [ ] TEST-2 self-test uses only temporary fakes, records one valid invocation, rejects every contradiction, and never contacts network or installed CLI/Edge. +- [ ] TEST-3 targets are isolated from aggregate tests and forward no default endpoint/model/config/secret value. +- [ ] The packet makes no S12 external qualification claim and changes no production runtime or test-rule document. + +## Verification Results + +Paste actual stdout/stderr for every command. If a command changes, record the replacement and reason in `Deviations from Plan` first. External invocation is not part of this packet. + +### TEST-1 intermediate + +```sh +./scripts/e2e-single-request-claude.sh --self-test +``` + +Output: _Paste actual stdout/stderr and exit status._ + +### TEST-2 intermediate + +```sh +bash -n scripts/e2e-single-request-claude.sh && ./scripts/e2e-single-request-claude.sh --self-test +``` + +Output: _Paste actual stdout/stderr and exit status._ + +### TEST-3 intermediate + +```sh +make test-single-request-claude-smoke-self-test +``` + +Output: _Paste actual stdout/stderr and exit status._ + +### Final 1 — dependency + +```sh +bash -c 'set -euo pipefail; shopt -s nullglob; candidates=(agent-task/m-iop-owned-single-request-agent-execution/22_*/complete.log agent-task/m-iop-owned-single-request-agent-execution/22+*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/22_*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/22+*/complete.log); printf "%s\n" "${candidates[@]}"; ((${#candidates[@]} == 1))' +``` + +Output: _Paste actual stdout/stderr and exit status._ + +### Final 2 — shell syntax + +```sh +bash -n scripts/e2e-single-request-claude.sh +``` + +Output: _Paste actual stdout/stderr and exit status._ + +### Final 3 — credential-free behavior + +```sh +./scripts/e2e-single-request-claude.sh --self-test +``` + +Output: _Paste actual stdout/stderr and exit status._ + +### Final 4 — Make entry point + +```sh +make test-single-request-claude-smoke-self-test +``` + +Output: _Paste actual stdout/stderr and exit status._ + +### Final 5 — target/input inventory + +```sh +rg --sort path -n 'test-single-request-claude-smoke|IOP_SINGLE_REQUEST_SMOKE_' Makefile +``` + +Output: _Paste actual stdout/stderr and exit status._ + +### Final 6 — aggregate isolation + +```sh +bash -c 'set -euo pipefail; if rg --sort path -n "test-single-request-claude-smoke([^:]*):.*test-single-request-claude-smoke$" Makefile; then exit 1; else test $? -eq 1; fi' +``` + +Output: _Paste actual stdout/stderr and exit status._ + +### Final 7 — diff + +```sh +git diff --check +``` + +Output: _Paste actual stdout/stderr and exit status._ + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING] Have you filled in every implementation-owned section?** +> If anything is blank, go back and fill it in before saving this file. +> Leave review-agent-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---------|-------|------| +| Header comment, Overview, Review Agent Instructions | Fixed at stub creation | Implementing agent must not modify or execute these (archive, complete.log, and task-directory archive move are review-agent only) | +| Implementation Item Completion (item names) | Fixed at stub creation | Implementing agent checks `[ ]` → `[x]` only | +| Implementation Checklist (item text/order) | Fixed at stub creation from plan | Implementing agent checks `[ ]` → `[x]` only | +| Review-Only Checklist | Review agent only | Implementing agent must not modify or check this section | +| Deviations from Plan, Key Design Decisions | Implementing agent | Replace placeholder text with actual content | +| Reviewer Checkpoints | Fixed at stub creation | Pre-filled from plan | +| Verification Results (section headings + commands) | Fixed at stub creation | Implementing agent fills in command output only; command changes require a `Deviations from Plan` entry | +| Code Review Result | Review agent appends | Not included in stub | diff --git a/agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/plan_cloud_G07_0.log b/agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/plan_cloud_G07_0.log new file mode 100644 index 00000000..77ff6cf9 --- /dev/null +++ b/agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/plan_cloud_G07_0.log @@ -0,0 +1,244 @@ + + +# Credential-free Claude single-request smoke harness + +## 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 + +SDD S12 requires an actual Claude/Mac run, but external credentials and a writable Mac runtime must not be needed to validate the evidence collector itself. This packet builds a dedicated self-testing/preflight/run harness and closed manifest schema; it does not claim external qualification, which remains task 25. + +## Analysis + +### Files Read + +- `AGENTS.md` +- `agent-ops/rules/project/rules.md` +- `agent-ops/rules/common/rules-roadmap.md` +- `agent-ops/rules/common/rules-agent-spec.md` +- `agent-ops/rules/project/domain/edge/rules.md` +- `agent-ops/rules/project/domain/node/rules.md` +- `agent-ops/rules/project/domain/testing/rules.md` +- `agent-ops/skills/common/router.md` +- `agent-ops/skills/common/plan/SKILL.md` +- `agent-ops/skills/common/finalize-task-routing/SKILL.md` +- `agent-test/local/rules.md` +- `agent-test/local/edge-smoke.md` +- `agent-test/local/node-smoke.md` +- `agent-test/local/testing-smoke.md` +- `agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/iop-owned-single-request-agent-execution.md` +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-owned-single-request-agent-execution/SDD.md` +- `agent-spec/runtime/edge-node-execution.md` +- `agent-contract/outer/anthropic-compatible-api.md` +- `apps/edge/internal/service/single_request_observation.go` +- `apps/edge/internal/service/single_request_metrics.go` +- `apps/edge/internal/openai/single_request_handler_test.go` +- `scripts/e2e-openai-cli-workspace.sh` +- `Makefile` +- `scripts/e2e-hot-path-agents.sh` (usage, source/runtime identity, Claude invocation, observation projection, manifest validation, and self-test sections) +- `scripts/fixtures/hot-path-agent-smoke-manifest.schema.json` (closed manifest structure and redaction sections) +- `agent-task/m-iop-owned-single-request-agent-execution/22+21_executor_activation/PLAN-local-G07.md` + +### SDD Criteria + +- Approved, unlocked SDD: `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-owned-single-request-agent-execution/SDD.md`; `milestone-task=claude-smoke` maps to S12. +- S12 requires one actual Claude invocation against a writable Mac test workspace, Plan → Work → Review order, stage-pure and total timing, final file/verification, ingress POST count one, and terminal one. +- Evidence Map row S12 requires actual Claude, ingress counter, Edge/Node/provider stage+total logs, and workspace before/after. This packet encodes those as a closed schema and proves collection/rejection behavior without external execution. + +### Verification Context + +- No handoff was supplied. Local rules and the existing credential-free `e2e-hot-path-agents.sh --self-test` pattern are repository-native fallback evidence. +- Current preflight: branch `feature/iop-owned-single-request-agent-execution`, HEAD `06e43f2aba7f42acb407cecb9761f30cbcc1df3c`, initially clean; host is Linux `aarch64` with Go `1.26.2`, while the required workspace Node runtime is macOS. `/config/.npm-global/bin/claude` exists and reports `2.1.223`; its help exposes `--print`, `--output-format`, `--include-partial-messages`, `--no-session-persistence`, and `--bare`. No authorized runner controlling a Mac workspace Node, synchronized external checkout, Edge binary/config, live observation log, metrics endpoint, writable test workspace, or secret env name was supplied. +- `agent-test/dev-corp/**` was inspected only to check for a repository-declared Mac path, but that environment explicitly requires user selection and therefore is not selected or encoded as a default. The harness accepts caller-supplied runtime inputs and fails before invocation on any missing/mismatched fact. +- Task 22 is active and has no `complete.log`. Implementation waits for exactly one task-22 completion, then rereads the activated observation and ingress surfaces. + +#### External Verification Preflight + +- Runner/workdir: caller-authorized runner and synchronized checkout controlling the declared Mac IOP Node; no default remote host or repo path is invented. Record runner OS/arch without requiring it to equal the workspace Node OS. +- Source: branch, HEAD, clean/dirty status, tree hash, and a deterministic pre-output worktree fingerprint must match caller-supplied runtime evidence. +- Binaries/config: Claude and Edge executable hashes/version/help, Edge config hash/check, harness/schema hashes, runtime identity, and the declared workspace binding are validated before invocation. +- Runtime: the admitted workspace owner must report Darwin OS/arch; a writable disposable workspace, live append-only Edge observation log, metrics URL, listening Edge Messages/metrics ports, and one named non-empty secret environment variable are required. Values for endpoint, model, credential, workspace path, prompt, and raw output are never printed or serialized. +- Current mismatch/resume condition: the present Linux host lacks the authorized Mac/runtime inputs. Task 24 still closes locally through self-test; task 25 performs the external run after those inputs are supplied. + +### Test Coverage Gaps + +- Existing real-POST tests prove one ingress and raw-free lifecycle observations with fakes, but not the installed Claude CLI, external runtime identity, fresh-log offset, workspace before/after, or a tracked redacted manifest. +- Existing hot-path harness proves analogous two-agent scenarios, but its schema/stages do not represent the single-request Plan/Work/Review coordinator and cannot be reused as S12 evidence. +- No current test rejects stale/rotated observation logs, counter delta other than one, wrong stage order, duplicate/no terminal, workspace mismatch, or forbidden evidence fields for this Epic. + +### Symbol References + +- No production symbol is renamed. New Make targets and script modes are additive and intentionally excluded from aggregate `test`/`test-e2e` because the credentialed run is external. + +### Split Judgment + +- Task 24 owns the stable harness contract: credential-free self-test plus deterministic preflight/run/manifest validation. Its independent PASS is `make test-single-request-claude-smoke-self-test` with no network or installed CLI invocation. +- `24+22_claude_smoke_harness` depends on sibling 22. The active `22+21_executor_activation` has no `complete.log`; no archive body was read. +- Task 25 consumes this harness and task 23's completed terminal policy for actual external qualification. Keeping credentialed execution separate prevents an unavailable runner from blocking repository-owned harness correctness. + +### Scope Rationale + +Include only the dedicated script, closed JSON schema, isolated Make targets, fake runtime/CLI self-test, external preflight, atomic manifest output, and redaction checks. Exclude production runtime changes, deployment, credentials, tracked endpoints/models/prompts/raw outputs, dev-corp selection, the actual Claude run, and contract/spec qualification claims. + +### Final Routing + +- `evaluation_mode=first-pass`; build/review closures are all true, with no capability gap. +- Build scores `1/1/1/2/2` => G07, base `local-fit`; four loop risks select `risk-boundary`, `worker/cloud/G07`, `PLAN-cloud-G07.md`. +- Review scores `1/1/1/2/2` => G07, `official-review`, `review/cloud/G07`, `CODE_REVIEW-cloud-G07.md`. +- `large_indivisible_context=false`; positive loop risks are `temporal_state`, `concurrent_consistency`, `boundary_contract`, and `structured_interpretation` (4). `review_rework_count=0`; `evidence_integrity_failure=false`; finalizer `finalize-task-policy.sh`, mode `pair`. + +## Dependencies and Execution Order + +1. Resolve and read exactly one task-22 `complete.log`, then reread the completed ingress/observation/runtime source before writing the schema. +2. Freeze the schema and validator first; build collection and rejection logic against it. +3. Add isolated Make targets last and prove self-test without network, real binaries, credentials, or external mutation. + +## Implementation Checklist + +- [ ] Add a closed redacted S12 manifest schema covering source/runtime identity, one ingress, ordered Plan/Work/Review timing, one terminal, workspace before/after, verification, and zero forbidden matches. +- [ ] Add a credential-free self-testing harness with `--self-test`, `--preflight-only`, `--run`, and `--validate-manifest` modes that rejects stale/mismatched/external inputs before invoking Claude. +- [ ] Add isolated Make targets for self-test, preflight, validation, and credentialed run without adding the external run to aggregate local tests. +- [ ] Run dependency, shell syntax, credential-free behavioral, schema/redaction, Make target, and diff verification freshly; do not claim S12 qualification. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [TEST-1] Freeze the S12 evidence schema + +**Problem** + +`apps/edge/internal/service/single_request_observation.go:17-60` exposes closed lifecycle fields and `single_request_metrics.go:13-17` exposes fixed metrics, but no schema joins them with CLI/runtime/workspace evidence. Free-form logs could leak secrets or accept a request count/stage order that does not satisfy S12. + +**Solution** + +Create a JSON Schema with `additionalProperties:false` at every object. Require digest-only source/runtime/model/config identity, `ingress_delta=1`, ordered `plan/work/review` closed stage records with non-negative `duration_ms`, total duration, exactly one `end_turn` terminal, workspace before/after digests, verification exit zero, and a fixed redaction proof. Forbid raw prompt/output, endpoint, model, path, header, credential, token, and provider payload keys. + +Before (new file; absence is the source fact): + +```sh +test ! -e scripts/fixtures/single-request-claude-smoke-manifest.schema.json +``` + +After: + +```json +{ + "type": "object", + "additionalProperties": false, + "required": ["source", "runtime", "ingress", "stages", "terminal", "workspace", "redaction"] +} +``` + +**Modified Files and Checklist** + +- [ ] Add exact keys, enums, bounds, digest formats, ordered stages, ingress/terminal constants, and forbidden key patterns in `scripts/fixtures/single-request-claude-smoke-manifest.schema.json`. + +**Test Strategy** + +The harness self-test generates one valid manifest and mutations for ingress 0/2, wrong stage order, stale/rotated log, missing/duplicate terminal, bad workspace verification, raw fields, secret sentinels, and runtime/source mismatch. Every mutation must fail validation. + +**Verification** + +Run `./scripts/e2e-single-request-claude.sh --self-test`; schema-positive and every contradiction case pass without external access. + +### [TEST-2] Collect fresh, redacted, one-invocation evidence + +**Problem** + +`apps/edge/internal/openai/single_request_handler_test.go` proves one POST only with in-process fakes. A real CLI smoke needs source/runtime pinning, a before/after ingress counter, fresh correlated observation records, one Claude child, a disposable workspace task, and atomic evidence without serializing sensitive inputs. + +**Solution** + +Add a dedicated shell harness modeled on the repository's existing external-smoke safety boundary. Pin Claude argv to one non-interactive invocation, bind base/model through environment, record metric/log offsets before launch, validate the closed stage/terminal sequence and Mac Node workspace result after exit, then atomically write only schema-approved digests/counts/enums/durations. Preflight validates all facts before invoking any child; self-test substitutes fake Claude/Edge/metrics/log/workspace and records an invocation marker. + +Before (new file; absence is the source fact): + +```sh +test ! -e scripts/e2e-single-request-claude.sh +``` + +After: + +```bash +case "$mode" in + self-test) self_test ;; + preflight-only) preflight ;; + run) preflight && run_once && write_manifest_atomically ;; + validate-manifest) validate_manifest "$manifest" ;; +esac +``` + +**Modified Files and Checklist** + +- [ ] Add strict modes/input parsing, source/worktree/runtime hashes, Mac workspace-owner/log/metric/port preflight, and fail-before-invocation behavior in `scripts/e2e-single-request-claude.sh`. +- [ ] Pin one Claude `--print --output-format stream-json --no-session-persistence --bare` child in the workspace; pass base/model/secret only through environment and never echo or serialize values. +- [ ] Parse only freshly appended correlated `edge_single_request_observation` records, require stage order/timing and one terminal, compare ingress metric delta exactly one, verify the fixed file task, and atomically write the closed manifest. +- [ ] Add fake CLI/runtime/log/metrics fixtures and all positive/negative assertions inside `--self-test`; ensure the installed Claude/Edge and network are never used. + +**Test Strategy** + +The self-test creates temporary fake binaries and workspace outside the repository, asserts exactly one fake Claude invocation for the valid run, and proves every preflight/evidence contradiction fails without secret/raw-value output. Shell syntax is checked separately. + +**Verification** + +Run `bash -n scripts/e2e-single-request-claude.sh && ./scripts/e2e-single-request-claude.sh --self-test`; both exit zero and leave no repository artifact. + +### [TEST-3] Expose isolated Make entry points + +**Problem** + +`Makefile:106-190` separates credential-free self-test, external preflight, and credentialed run for the existing Hot Path harness. S12 needs the same separation so `make test` cannot accidentally contact a provider or mutate an external workspace. + +**Solution** + +Add four explicit targets and documented caller-supplied variables. Self-test takes no variables. Preflight/run forward values without defaults; validation accepts only the deterministic manifest path. Keep all four out of `test`, `test-e2e`, and other aggregates. + +Before (`Makefile:1`): + +```make +.PHONY: all build build-local ... test-hot-path-agent-smoke +``` + +After: + +```make +.PHONY: ... test-single-request-claude-smoke-self-test test-single-request-claude-smoke-preflight test-single-request-claude-smoke-validate test-single-request-claude-smoke +``` + +**Modified Files and Checklist** + +- [ ] Add isolated targets and non-secret input documentation in `Makefile`. +- [ ] Keep the credentialed target out of aggregate local targets and forward no default endpoint/model/config/secret values. + +**Test Strategy** + +Invoke the self-test target directly and use deterministic Makefile search to prove no aggregate depends on the credentialed target. + +**Verification** + +Run `make test-single-request-claude-smoke-self-test`; it exits zero without network or installed CLI invocation. + +## Modified Files Summary + +| File | Items | +|------|-------| +| `scripts/fixtures/single-request-claude-smoke-manifest.schema.json` | TEST-1 | +| `scripts/e2e-single-request-claude.sh` | TEST-1, TEST-2 | +| `Makefile` | TEST-3 | +| `agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/CODE_REVIEW-cloud-G07.md` | TEST-1, TEST-2, TEST-3 | + +## Final Verification + +Fresh output is required; cached output is not acceptable. + +1. `bash -c 'set -euo pipefail; shopt -s nullglob; candidates=(agent-task/m-iop-owned-single-request-agent-execution/22_*/complete.log agent-task/m-iop-owned-single-request-agent-execution/22+*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/22_*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/22+*/complete.log); printf "%s\n" "${candidates[@]}"; ((${#candidates[@]} == 1))'` — prints exactly one task-22 completion path and exits zero before implementation or review. +2. `bash -n scripts/e2e-single-request-claude.sh` — the harness has valid shell syntax. +3. `./scripts/e2e-single-request-claude.sh --self-test` — valid collection passes and every stale, mismatched, duplicate, count, ordering, workspace, and redaction contradiction is rejected without network or installed binaries. +4. `make test-single-request-claude-smoke-self-test` — the repository entry point runs the same credential-free suite successfully. +5. `rg --sort path -n 'test-single-request-claude-smoke|IOP_SINGLE_REQUEST_SMOKE_' Makefile` — isolated targets and caller-supplied inputs are explicit. +6. `bash -c 'set -euo pipefail; if rg --sort path -n "test-single-request-claude-smoke([^:]*):.*test-single-request-claude-smoke$" Makefile; then exit 1; else test $? -eq 1; fi'` — exits zero only when no aggregate target includes the credentialed run. +7. `git diff --check` — no whitespace errors. + +Actual Claude/Mac execution and the tracked S12 manifest remain exclusively owned by task 25. + +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/25+23,24_claude_smoke_qualification/CODE_REVIEW-cloud-G08.md b/agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/CODE_REVIEW-cloud-G08.md index a4601665..5ccc27a3 100644 --- a/agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/CODE_REVIEW-cloud-G08.md +++ b/agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/CODE_REVIEW-cloud-G08.md @@ -1,4 +1,4 @@ - + # Code Review Reference - TEST @@ -15,13 +15,13 @@ ## Overview date=2026-08-07 -task=m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification, plan=1, tag=TEST +task=m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification, plan=2, tag=TEST ## Archive Evidence Snapshot -- Prior plan: `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/plan_cloud_G08_0.log`; prior pristine review stub: `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/code_review_cloud_G08_0.log`. -- No implementation evidence or official verdict existed. Self-review found that the prior evidence path lived inside the active task directory and would break every contract/spec citation when a PASS archived that directory; it also omitted the matching input-surface spec. -- This replan writes the manifest to `agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json`, adds `agent-spec/input/openai-compatible-surface.md`, and declares `error-cancel,claude-smoke` evidence contribution so task 23's production change is not treated as full-cycle qualified before this external run. Task 23 remains the sole deterministic S11 error matrix owner. +- Immediate prior plan: `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/plan_cloud_G08_1.log`; immediate prior pristine review stub: `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/code_review_cloud_G08_1.log`. The earlier semantic snapshot remains in the matching `_0.log` files. +- No implementation evidence or official verdict existed. Fresh milestone/SDD review found that this success smoke incorrectly declared `error-cancel` contribution and did not require closed engine-family facts proving actual `Gemini → ornith-fast → Gemini` execution. +- This replan preserves the stable evidence path/current-owner write set, narrows metadata to `claude-smoke`, and binds closed engine-family facts to immutable config digests and fresh observations. ## For the Review Agent @@ -31,9 +31,9 @@ Compare implementation of each item against source files and verify that output Review completion means the following steps are finished: 1. Append verdict and `review_rework_count` / `evidence_integrity_failure` routing signals. -2. Archive `CODE_REVIEW-cloud-G08.md` → `code_review_cloud_G08_1.log` and `PLAN-cloud-G08.md` → `plan_cloud_G08_1.log`. +2. Archive `CODE_REVIEW-cloud-G08.md` → `code_review_cloud_G08_2.log` and `PLAN-cloud-G08.md` → `plan_cloud_G08_2.log`. 3. If PASS, write `complete.log` and move active task directory to `agent-task/archive/YYYY/MM/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/`. If WARN/FAIL, fully write the next filesystem state required by the code-review skill. -4. If PASS, preserve `milestone-task=error-cancel,claude-smoke` in `complete.log` and report it for runtime aggregation. Roadmap evaluation belongs to `sync-milestone-workstate`. +4. If PASS, preserve `milestone-task=claude-smoke` in `complete.log` and report it for runtime aggregation. Roadmap evaluation belongs to `sync-milestone-workstate`. 5. Check applicable `Review-Only Checklist` items at the final `.log` location before reporting. --- @@ -49,7 +49,7 @@ Review completion means the following steps are finished: ## Implementation Checklist - [ ] Resolve completed task-23/task-24 dependencies, run the harness self-test, and record a full authorized runner/Mac Node/source/binary/config/runtime/port/workspace/credential-name preflight before invocation. -- [ ] Invoke actual Claude exactly once through the harness and atomically produce `agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json` proving ingress one, Plan/Work/Review order and timing, terminal one, and final workspace verification. +- [ ] Invoke actual Claude exactly once through the harness and atomically produce `agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json` proving ingress one, Plan/Work/Review with `Gemini → ornith-fast → Gemini`, stage-pure/total timing, terminal one, and final workspace verification. - [ ] Validate the manifest and redaction contract, preserve all raw/secret material outside tracked artifacts, and do not auto-retry or substitute fake/stale evidence. - [ ] After evidence PASS only, update the Anthropic outer contract and both matching current implementation specs from deferred to qualified with the stable exact evidence path and bounded limits. - [ ] Run common SDD, proto, document/evidence, and diff verification freshly; if external execution is unavailable, record blocker evidence and stop for official review classification. @@ -62,12 +62,12 @@ Review completion means the following steps are finished: - [ ] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure` to `Code Review Result`. - [ ] Verify that verdict, `Dimension Assessment`, and Required/Suggested/Nit classifications match. -- [ ] Archive active `CODE_REVIEW-*-G??.md` to `code_review_cloud_G08_1.log`. -- [ ] Archive active `PLAN-*-G??.md` to `plan_cloud_G08_1.log`. +- [ ] Archive active `CODE_REVIEW-*-G??.md` to `code_review_cloud_G08_2.log`. +- [ ] Archive active `PLAN-*-G??.md` to `plan_cloud_G08_2.log`. - [ ] Verify that the Agent-Ops managed block in `.gitignore` unignores `agent-task/**/*.md` and `agent-task/**/*.log` and ignores `agent-roadmap/current.md`. - [ ] If PASS, write `complete.log` based on `agent-ops/skills/common/code-review/templates/complete-log-template.md` and leave no active `.md` files. - [ ] If PASS, move active task directory `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/` to `agent-task/archive/YYYY/MM/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/` and update this checklist at the final archive path. -- [ ] If PASS, preserve and report `milestone-task=error-cancel,claude-smoke` for runtime aggregation, without modifying roadmap or directly calling `update-roadmap`. +- [ ] If PASS, preserve and report `milestone-task=claude-smoke` for runtime aggregation, without modifying roadmap or directly calling `update-roadmap`. - [ ] If PASS for split work, remove empty active parent only if no siblings/files remain. - [ ] If WARN/FAIL, write the next filesystem state matching code-review verdict and do not write `complete.log`. @@ -84,9 +84,9 @@ _Record key design decisions here._ - Confirm tasks 23 and 24 each have exactly one PASS completion log and the actual runtime/harness match those reviewed sources. - Confirm preflight proves authorized source/binary/config/runtime/provider/log/metrics/Mac workspace/CLI/secret-name identity before invocation. - Confirm the harness invoked actual Claude once, never auto-retried, and atomically wrote the exact stable manifest. -- Confirm ingress=1, ordered Plan/Work/Review, timing, terminal=1, workspace verification, runtime identity, and zero forbidden matches validate without raw/secret material. +- Confirm ingress=1, ordered Plan/Work/Review with `Gemini → ornith-fast → Gemini`, timing, terminal=1, workspace verification, runtime identity, and zero forbidden matches validate without raw/secret material. - Confirm all three living owners cite the stable evidence path and limit claims to the recorded run; confirm task archive movement cannot invalidate the citation. -- Confirm task 23 remains the deterministic S11 matrix owner and this packet supplies only its full-cycle integration contribution plus S12 qualification. +- Confirm task 23 remains the sole deterministic S11/error-cancel owner and this packet contributes only S12 `claude-smoke` qualification. ## Verification Results @@ -181,7 +181,7 @@ _Fill with actual output._ Command: ```sh -rg --sort path -n 'agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json|S11|S12|claude-smoke|ingress|Plan|Work|Review|stage|total|terminal|workspace|single run|single-run|qualified' agent-contract/outer/anthropic-compatible-api.md agent-spec/runtime/edge-node-execution.md agent-spec/input/openai-compatible-surface.md agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json +rg --sort path -n 'agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json|S12|claude-smoke|ingress|Gemini|gemini|ornith-fast|Plan|Work|Review|stage|total|terminal|workspace|single run|single-run|qualified' agent-contract/outer/anthropic-compatible-api.md agent-spec/runtime/edge-node-execution.md agent-spec/input/openai-compatible-surface.md agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json ``` Output: diff --git a/agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/PLAN-cloud-G08.md b/agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/PLAN-cloud-G08.md index fdd0f474..77acfc49 100644 --- a/agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/PLAN-cloud-G08.md +++ b/agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/PLAN-cloud-G08.md @@ -1,4 +1,4 @@ - + # Actual Claude and Mac single-request qualification @@ -8,18 +8,19 @@ Filling the implementation-owned sections of `CODE_REVIEW-cloud-G08.md` is the m ## Background -The repository-owned harness can prove its collection and rejection logic without credentials, but SDD S12 is complete only after one actual Claude invocation reaches the activated Edge and writable Mac Node. This packet owns that full-cycle qualification, a deterministic redacted evidence artifact at a path stable across task archival, and post-PASS contract/spec synchronization; it contains no fallback to fake evidence. +The repository-owned harness can prove its collection and rejection logic without credentials, but SDD S12 is complete only after one actual Claude invocation reaches the activated Edge and writable Mac Node. This packet owns only that `claude-smoke` full-cycle qualification, a deterministic redacted evidence artifact at a path stable across task archival, and post-PASS contract/spec synchronization; it contains no fallback to fake evidence. Task 23 remains a prerequisite and the sole `error-cancel`/S11 owner. ## Archive Evidence Snapshot -- Prior plan: `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/plan_cloud_G08_0.log`; prior pristine review stub: `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/code_review_cloud_G08_0.log`. -- No implementation evidence or official verdict existed. Self-review found that the prior evidence path lived inside the active task directory and would break every contract/spec citation when a PASS archived that directory; it also omitted the matching input-surface spec. -- This replan writes the manifest to `agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json`, adds `agent-spec/input/openai-compatible-surface.md`, and declares `error-cancel,claude-smoke` evidence contribution so task 23's production change is not treated as full-cycle qualified before this external run. Task 23 remains the sole deterministic S11 error matrix owner. +- Immediate prior plan: `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/plan_cloud_G08_1.log`; immediate prior pristine review stub: `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/code_review_cloud_G08_1.log`. The earlier semantic snapshot remains in the matching `_0.log` files. +- No implementation evidence or official verdict existed. Fresh milestone/SDD review found two defects: this success qualification incorrectly declared `error-cancel`/S11 contribution, and role names plus opaque binding digests did not independently prove actual `Gemini → ornith-fast → Gemini` execution. +- This replan keeps the stable evidence path and matching three current owners, narrows first-line metadata to `claude-smoke`, and requires closed engine-family facts joined to immutable runtime/config digests and fresh stage observations. ## Analysis ### Files Read +- Plan 2 freshly reread the milestone/SDD, immediate prior pair/log, current observation/projector tests, current contract/spec owners, and both prerequisite plans. The unchanged entries below preserve the prior pair's recorded preparation base; none is treated as actual S12 execution evidence. - `AGENTS.md` - `agent-ops/rules/project/rules.md` - `agent-ops/rules/common/rules-roadmap.md` @@ -30,6 +31,7 @@ The repository-owned harness can prove its collection and rejection logic withou - `agent-ops/rules/project/domain/testing/rules.md` - `agent-ops/skills/common/router.md` - `agent-ops/skills/common/plan/SKILL.md` +- `agent-ops/skills/common/refine-plans/SKILL.md` - `agent-ops/skills/common/code-review/SKILL.md` - `agent-ops/skills/common/finalize-task-routing/SKILL.md` - `agent-ops/skills/common/sync-milestone-workstate/SKILL.md` @@ -67,22 +69,22 @@ The repository-owned harness can prove its collection and rejection logic withou ### SDD Criteria -- Approved, unlocked SDD: `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-owned-single-request-agent-execution/SDD.md`; first-line `milestone-task=error-cancel,claude-smoke` contributes to S11 and S12. -- S11 is implemented/evidenced by task 23's deterministic budget/error/cancel/length/repetition matrix. This packet does not replace that matrix; its actual one-request run supplies the required full-cycle integration evidence for those production changes. +- Approved, unlocked SDD: `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-owned-single-request-agent-execution/SDD.md`; first-line `milestone-task=claude-smoke` maps only to S12. +- S11 is implemented/evidenced exclusively by task 23's deterministic budget/error/cancel/length/repetition matrix. Task 23 is a runtime prerequisite here, but this successful smoke neither exercises nor contributes completion evidence to S11. - S12 requires actual Claude in a writable Mac workspace, observed Gemini → ornith-fast → Gemini order, stage-pure/total timing, final file verification, ingress delta one, and terminal one. -- Evidence Map S11/S12 rows drive the dependency gate, one-run identity, exact manifest fields, post-PASS documentation, and common regression commands. Fake/manual/stale evidence cannot satisfy either contribution. +- Evidence Map row S12 drives the dependency gate, one-run identity, exact manifest fields, post-PASS documentation, and common regression commands. Fake/manual/stale evidence cannot satisfy this contribution. ### Verification Context - No external handoff was supplied. Repository-native inputs are the approved SDD, local test profiles, current ingress/lifecycle observations, and task-24 harness contract. -- Preparation checkout is branch `feature/iop-owned-single-request-agent-execution`, HEAD `06e43f2aba7f42acb407cecb9761f30cbcc1df3c` plus active task packets. Current host is Linux `aarch64` with Go `1.26.2`; Claude exists at `/config/.npm-global/bin/claude`, reports `2.1.223`, and exposes the planned non-interactive flags. The required authorized runner/Mac Node, synchronized binary/config, live logs/metrics, workspace binding, ports/processes, and credential environment were not supplied. +- Preparation checkpoint is branch `feature/iop-owned-single-request-agent-execution`, HEAD `b31163396d0e6556b5eaa759f9c7f1149fbc81c9` plus the semantic replan logs. Current host is Linux `aarch64` with Go `1.26.2`; Claude exists at `/config/.npm-global/bin/claude`, reports `2.1.223`, and exposes the planned non-interactive flags. The required authorized runner/Mac Node, synchronized binary/config, live logs/metrics, workspace binding, ports/processes, and credential environment were not supplied. - `dev-corp` is not selected and is not a fallback. No private host, endpoint, alias, config, workspace, or secret is assumed. Task-24 preflight accepts caller-owned values and stores hashes/closed facts only. - Confidence is high for the deterministic oracle and low for current external executability. If inputs remain unavailable, record exact preflight output/resume condition and stop; official review owns the `external-execution` gate. #### External Verification Preflight - Runner/workdir: explicitly authorized synchronized checkout controlling the declared Mac IOP Node; capture `pwd`, OS/arch, branch, HEAD, status, tree/worktree fingerprint, and source sync. Runner OS and Darwin workspace ownership are independent facts. -- Binaries/artifacts: reviewed task-23 runtime, task-24 harness/schema/Make targets, selected Edge/Node binary/config, and Claude binary must match runtime-evidence digests; record only hashes and closed version facts. +- Binaries/artifacts: reviewed task-23 runtime, task-24 harness/schema/Make targets, selected Edge/Node binary/config, and Claude binary must match runtime-evidence digests; record only hashes, closed version facts, and the SDD-approved `gemini/ornith-fast/gemini` engine-family sequence. - Commands: `claude --version`, Edge help/config check, harness `--preflight-only`, and manifest validator must succeed. Prove listening Messages/metrics ports, append-only observation-log identity, immutable Plan/Work/Review/workspace binding, provider health, and writable disposable workspace. - Setup/resume: synchronize to reviewed task-23/task-24 source, rebuild/restart selected runtimes, provide live config/log/metrics/workspace and named secret env, create the stable evidence parent, then rerun preflight. Divergence, stale runtime/config, non-Darwin workspace owner, closed port, missing account/provider, or mismatched identity is a hard pre-invocation blocker. @@ -101,10 +103,11 @@ No production symbol is renamed. Task 25 consumes completed Make targets, harnes - Task 25 is one evidence/document closure packet: its oracle is a schema-valid actual manifest plus common regressions and bounded current-document claims. - Directory dependencies are siblings 23 and 24. Both currently lack `complete.log`; no archive candidate was read. Implementation/review resolves exactly one completion path for each and reads only those logs. - Source/runtime preflight, one invocation, fresh offsets, workspace mutation, and atomic manifest are one indivisible run identity. +- The replacement was evaluated once with `refine-plans`. Preflight, the sole invocation, joined observations/workspace mutation, atomic manifest, and post-validation documentation share one external run identity and cannot yield independent child PASS states. Keep this packet unchanged. ### Scope Rationale -Include only external preflight, one actual harness run, one stable tracked redacted manifest, validation, and post-PASS outer-contract/two-spec wording. Exclude runtime code, deployment policy, credential storage, default endpoints/models/workspaces, environment selection, multiple prompts/retries, benchmarks, roadmap mutation, raw CLI/provider/log/tool/workspace content, and evidence reconstructed from prose or stale logs. +Include only external preflight, one actual harness run, one stable tracked redacted manifest, validation, and post-PASS outer-contract/two-spec wording. The three document paths intentionally overlap task 23's write set and are serialized by task 25's dependency: task 25 rereads completed owners and adds only bounded S12 qualification. Exclude runtime code, deployment policy, credential storage, default endpoints/models/workspaces, environment selection, multiple prompts/retries, benchmarks, roadmap mutation, raw CLI/provider/log/tool/workspace content, and evidence reconstructed from prose or stale logs. ### Final Routing @@ -122,7 +125,7 @@ Include only external preflight, one actual harness run, one stable tracked reda ## Implementation Checklist - [ ] Resolve completed task-23/task-24 dependencies, run the harness self-test, and record a full authorized runner/Mac Node/source/binary/config/runtime/port/workspace/credential-name preflight before invocation. -- [ ] Invoke actual Claude exactly once through the harness and atomically produce `agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json` proving ingress one, Plan/Work/Review order and timing, terminal one, and final workspace verification. +- [ ] Invoke actual Claude exactly once through the harness and atomically produce `agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json` proving ingress one, Plan/Work/Review with `Gemini → ornith-fast → Gemini`, stage-pure/total timing, terminal one, and final workspace verification. - [ ] Validate the manifest and redaction contract, preserve all raw/secret material outside tracked artifacts, and do not auto-retry or substitute fake/stale evidence. - [ ] After evidence PASS only, update the Anthropic outer contract and both matching current implementation specs from deferred to qualified with the stable exact evidence path and bounded limits. - [ ] Run common SDD, proto, document/evidence, and diff verification freshly; if external execution is unavailable, record blocker evidence and stop for official review classification. @@ -136,7 +139,7 @@ Include only external preflight, one actual harness run, one stable tracked reda **Solution** -Consume task-24 preflight on an authorized runner controlling the declared Mac Node. Require synchronized source/worktree identity, reviewed binary/config/schema hashes, Darwin workspace ownership, fixed-light binding, healthy ports/providers, fresh append-only log/metrics, writable disposable workspace, Claude version, and named-secret presence. +Consume task-24 preflight on an authorized runner controlling the declared Mac Node. Require synchronized source/worktree identity, reviewed binary/config/schema hashes, Darwin workspace ownership, an immutable Plan/Work/Review binding fixed to `gemini/ornith-fast/gemini`, healthy ports/providers, fresh append-only log/metrics, writable disposable workspace, Claude version, and named-secret presence. Before (`agent-spec/runtime/edge-node-execution.md:170`): @@ -172,7 +175,7 @@ S12 cannot be satisfied by fakes, one logical ID, or manual log assembly. The fo **Solution** -Use `agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json`, which is outside the task archive lifecycle. One run identity joins the actual CLI child, ingress counter, fresh stage/terminal observations, and workspace result. Require ingress delta one; roles `plan,work,review`; configured Gemini/ornith-fast/Gemini binding digests; non-negative stage-pure/total time; one `end_turn`; expected file digest; verification exit zero; zero forbidden matches. Store no raw prompts, CLI/provider payloads, endpoints, models, paths, tool data, or secrets. +Use `agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json`, which is outside the task archive lifecycle. One run identity joins the actual CLI child, ingress counter, immutable config/binding digest, fresh stage/terminal observations, and workspace result. Require ingress delta one; roles `plan,work,review`; closed engine-family values `gemini,ornith-fast,gemini` joined to that binding digest; non-negative stage-pure/total time; one `end_turn`; expected file digest; verification exit zero; zero forbidden matches. Store no arbitrary model strings, raw prompts, CLI/provider payloads, endpoints, paths, tool data, or secrets. Before (absence expected until actual PASS): @@ -185,7 +188,11 @@ After: ```json { "ingress": {"delta": 1}, - "stages": [{"role": "plan"}, {"role": "work"}, {"role": "review"}], + "stages": [ + {"role": "plan", "engine_family": "gemini"}, + {"role": "work", "engine_family": "ornith-fast"}, + {"role": "review", "engine_family": "gemini"} + ], "terminal": {"count": 1, "kind": "end_turn"}, "redaction": {"matches": 0} } @@ -212,7 +219,7 @@ The current outer contract and both matching specs defer S12. Leaving them stale **Solution** -After validation only, cite the stable exact manifest in the outer Anthropic contract, runtime spec, and `/v1/messages` input-surface spec. State one ingress, Plan/Work/Review, one terminal, verified workspace result, redacted timing, tested runtime/run identity, and non-benchmark/non-availability limits. +After validation only, cite the stable exact manifest in the outer Anthropic contract, runtime spec, and `/v1/messages` input-surface spec. State one ingress, Plan/Work/Review with `Gemini → ornith-fast → Gemini`, one terminal, verified workspace result, redacted timing, tested runtime/run identity, and non-benchmark/non-availability limits. Before (`agent-contract/outer/anthropic-compatible-api.md:131-143`): @@ -224,7 +231,7 @@ After: ```text SDD S12 is qualified only for the runtime/run recorded at the stable manifest: -one ingress, Plan/Work/Review, one terminal, verified workspace result, and +one ingress, Gemini/ornith-fast/Gemini Plan/Work/Review, one terminal, verified workspace result, and redacted timing; this is not a blanket availability or benchmark claim. ``` @@ -260,10 +267,10 @@ Fresh output is required; cached tests and reconstructed external evidence are u 2. `make test-single-request-claude-smoke-self-test` — completed credential-free harness suite passes. 3. `mkdir -p agent-test/evidence/iop-owned-single-request-agent-execution && IOP_SINGLE_REQUEST_SMOKE_OUTPUT='agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json' make test-single-request-claude-smoke-preflight` — authorized runner/Mac Node/source/binary/config/runtime/provider/log/metrics/workspace/CLI/secret-name checks pass before invocation. 4. `IOP_SINGLE_REQUEST_SMOKE_OUTPUT='agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json' make test-single-request-claude-smoke` — invokes actual Claude exactly once and atomically writes one redacted manifest; never auto-rerun on failure. -5. `./scripts/e2e-single-request-claude.sh --validate-manifest agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json` — schema, runtime identity, ingress=1, ordered stages/timing, terminal=1, workspace verification, and zero forbidden matches validate. +5. `./scripts/e2e-single-request-claude.sh --validate-manifest agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json` — schema, runtime identity, ingress=1, ordered `gemini/ornith-fast/gemini` stages/timing, terminal=1, workspace verification, and zero forbidden matches validate. 6. `go test -race -count=1 ./packages/go/config ./packages/go/streamgate ./apps/edge/internal/openai ./apps/edge/internal/service ./apps/node/internal/node ./apps/node/internal/transport ./apps/node/internal/workspace` — approved common SDD regressions pass. 7. `make proto && git diff --exit-code -- proto/gen/iop` — protobuf generation is reproducible and qualification adds no wire delta. -8. `rg --sort path -n 'agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json|S11|S12|claude-smoke|ingress|Plan|Work|Review|stage|total|terminal|workspace|single run|single-run|qualified' agent-contract/outer/anthropic-compatible-api.md agent-spec/runtime/edge-node-execution.md agent-spec/input/openai-compatible-surface.md agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json` — documents and evidence state the same stable bounded qualification. +8. `rg --sort path -n 'agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json|S12|claude-smoke|ingress|Gemini|gemini|ornith-fast|Plan|Work|Review|stage|total|terminal|workspace|single run|single-run|qualified' agent-contract/outer/anthropic-compatible-api.md agent-spec/runtime/edge-node-execution.md agent-spec/input/openai-compatible-surface.md agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json` — documents and evidence state the same stable bounded S12 qualification. 9. `git diff --check` — no whitespace errors. 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/25+23,24_claude_smoke_qualification/code_review_cloud_G08_1.log b/agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/code_review_cloud_G08_1.log new file mode 100644 index 00000000..a4601665 --- /dev/null +++ b/agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/code_review_cloud_G08_1.log @@ -0,0 +1,221 @@ + + +# Code Review Reference - TEST + +> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is the mandatory final step of implementation.** +> The task is NOT complete until every implementation-owned section below is filled in. +> Complete the `Implementation Checklist`; the final checklist item is mandatory before saving. +> Fill implementation-owned sections, then stop with active files in place and report ready for review. +> Execute the plan's selected root cause, scope, files, and dependency decisions as written. Do not choose another owner, narrow/expand the write boundary, or replace a fix with another verification attempt. +> If implementation is blocked, record the exact blocker, attempted commands/output, and resume condition only in implementation-owned evidence fields. +> Do not ask the user directly, present choices, call user-input tools, create control-plane stop files, or classify the next state. +> Finalization (`Code Review Result`, log rename, `complete.log`, archive moves, `Review-Only Checklist`) is review-agent-only, even after compaction/resume. +> Follow the ownership table at the bottom of this file for which sections you own. + +## Overview + +date=2026-08-07 +task=m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification, plan=1, tag=TEST + +## Archive Evidence Snapshot + +- Prior plan: `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/plan_cloud_G08_0.log`; prior pristine review stub: `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/code_review_cloud_G08_0.log`. +- No implementation evidence or official verdict existed. Self-review found that the prior evidence path lived inside the active task directory and would break every contract/spec citation when a PASS archived that directory; it also omitted the matching input-surface spec. +- This replan writes the manifest to `agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json`, adds `agent-spec/input/openai-compatible-surface.md`, and declares `error-cancel,claude-smoke` evidence contribution so task 23's production change is not treated as full-cycle qualified before this external run. Task 23 remains the sole deterministic S11 error matrix owner. + +## For the Review Agent + +> **[REVIEW AGENT ONLY]** The finalization steps below are review-agent only. Implementing agents must not execute this section. + +Compare implementation of each item against source files and verify that output in `Verification Results` matches code. +Review completion means the following steps are finished: + +1. Append verdict and `review_rework_count` / `evidence_integrity_failure` routing signals. +2. Archive `CODE_REVIEW-cloud-G08.md` → `code_review_cloud_G08_1.log` and `PLAN-cloud-G08.md` → `plan_cloud_G08_1.log`. +3. If PASS, write `complete.log` and move active task directory to `agent-task/archive/YYYY/MM/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/`. If WARN/FAIL, fully write the next filesystem state required by the code-review skill. +4. If PASS, preserve `milestone-task=error-cancel,claude-smoke` in `complete.log` and report it for runtime aggregation. Roadmap evaluation belongs to `sync-milestone-workstate`. +5. Check applicable `Review-Only Checklist` items at the final `.log` location before reporting. + +--- + +## Implementation Item Completion + +| Item | Status | +|------|---------| +| TEST-1 | [ ] | +| TEST-2 | [ ] | +| TEST-3 | [ ] | + +## Implementation Checklist + +- [ ] Resolve completed task-23/task-24 dependencies, run the harness self-test, and record a full authorized runner/Mac Node/source/binary/config/runtime/port/workspace/credential-name preflight before invocation. +- [ ] Invoke actual Claude exactly once through the harness and atomically produce `agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json` proving ingress one, Plan/Work/Review order and timing, terminal one, and final workspace verification. +- [ ] Validate the manifest and redaction contract, preserve all raw/secret material outside tracked artifacts, and do not auto-retry or substitute fake/stale evidence. +- [ ] After evidence PASS only, update the Anthropic outer contract and both matching current implementation specs from deferred to qualified with the stable exact evidence path and bounded limits. +- [ ] Run common SDD, proto, document/evidence, and diff verification freshly; if external execution is unavailable, record blocker evidence and stop for official review classification. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +> **[REVIEW AGENT ONLY]** This checklist is used only by the review agent. +> Implementing agents must not modify or check this section. + +- [ ] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure` to `Code Review Result`. +- [ ] Verify that verdict, `Dimension Assessment`, and Required/Suggested/Nit classifications match. +- [ ] Archive active `CODE_REVIEW-*-G??.md` to `code_review_cloud_G08_1.log`. +- [ ] Archive active `PLAN-*-G??.md` to `plan_cloud_G08_1.log`. +- [ ] Verify that the Agent-Ops managed block in `.gitignore` unignores `agent-task/**/*.md` and `agent-task/**/*.log` and ignores `agent-roadmap/current.md`. +- [ ] If PASS, write `complete.log` based on `agent-ops/skills/common/code-review/templates/complete-log-template.md` and leave no active `.md` files. +- [ ] If PASS, move active task directory `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/` to `agent-task/archive/YYYY/MM/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/` and update this checklist at the final archive path. +- [ ] If PASS, preserve and report `milestone-task=error-cancel,claude-smoke` for runtime aggregation, without modifying roadmap or directly calling `update-roadmap`. +- [ ] If PASS for split work, remove empty active parent only if no siblings/files remain. +- [ ] If WARN/FAIL, write the next filesystem state matching code-review verdict and do not write `complete.log`. + +## Deviations from Plan + +_Record any deviations from the plan and the rationale here._ + +## Key Design Decisions + +_Record key design decisions here._ + +## Reviewer Checkpoints + +- Confirm tasks 23 and 24 each have exactly one PASS completion log and the actual runtime/harness match those reviewed sources. +- Confirm preflight proves authorized source/binary/config/runtime/provider/log/metrics/Mac workspace/CLI/secret-name identity before invocation. +- Confirm the harness invoked actual Claude once, never auto-retried, and atomically wrote the exact stable manifest. +- Confirm ingress=1, ordered Plan/Work/Review, timing, terminal=1, workspace verification, runtime identity, and zero forbidden matches validate without raw/secret material. +- Confirm all three living owners cite the stable evidence path and limit claims to the recorded run; confirm task archive movement cannot invalidate the citation. +- Confirm task 23 remains the deterministic S11 matrix owner and this packet supplies only its full-cycle integration contribution plus S12 qualification. + +## Verification Results + +Paste actual stdout/stderr for every command. If output is too long, record the exact command and saved output path; summaries are insufficient. + +### 1. Dependency gate + +Command: + +```sh +bash -c 'set -euo pipefail; shopt -s nullglob; for index in 23 24; do candidates=(agent-task/m-iop-owned-single-request-agent-execution/${index}_*/complete.log agent-task/m-iop-owned-single-request-agent-execution/${index}+*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/${index}_*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/${index}+*/complete.log); printf "%s\n" "${candidates[@]}"; ((${#candidates[@]} == 1)); done' +``` + +Output: + +_Fill with actual output._ + +### 2. Credential-free harness self-test + +Command: + +```sh +make test-single-request-claude-smoke-self-test +``` + +Output: + +_Fill with actual output._ + +### 3. Authorized external preflight + +Command: + +```sh +mkdir -p agent-test/evidence/iop-owned-single-request-agent-execution && IOP_SINGLE_REQUEST_SMOKE_OUTPUT='agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json' make test-single-request-claude-smoke-preflight +``` + +Output: + +_Fill with actual output._ + +### 4. One actual Claude invocation + +Command: + +```sh +IOP_SINGLE_REQUEST_SMOKE_OUTPUT='agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json' make test-single-request-claude-smoke +``` + +Output: + +_Fill with actual output._ + +### 5. Stable manifest validation + +Command: + +```sh +./scripts/e2e-single-request-claude.sh --validate-manifest agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json +``` + +Output: + +_Fill with actual output._ + +### 6. Approved SDD common suite + +Command: + +```sh +go test -race -count=1 ./packages/go/config ./packages/go/streamgate ./apps/edge/internal/openai ./apps/edge/internal/service ./apps/node/internal/node ./apps/node/internal/transport ./apps/node/internal/workspace +``` + +Output: + +_Fill with actual output._ + +### 7. Protobuf reproducibility + +Command: + +```sh +make proto && git diff --exit-code -- proto/gen/iop +``` + +Output: + +_Fill with actual output._ + +### 8. Stable bounded qualification search + +Command: + +```sh +rg --sort path -n 'agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json|S11|S12|claude-smoke|ingress|Plan|Work|Review|stage|total|terminal|workspace|single run|single-run|qualified' agent-contract/outer/anthropic-compatible-api.md agent-spec/runtime/edge-node-execution.md agent-spec/input/openai-compatible-surface.md agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json +``` + +Output: + +_Fill with actual output._ + +### 9. Diff hygiene + +Command: + +```sh +git diff --check +``` + +Output: + +_Fill with actual output._ + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING] Have you filled in every implementation-owned section?** +> If anything is blank, go back and fill it in before saving this file. +> Leave review-agent-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---------|-------|------| +| Header comment, Overview, Review Agent Instructions | Fixed at stub creation | Implementing agent must not modify or execute these (archive, complete.log, and task-directory archive move are review-agent only) | +| Archive Evidence Snapshot | Fixed at stub creation from plan when present | Implementing agent uses it as prior-loop context; read only the cited archive files when more detail is required | +| Implementation Item Completion (item names) | Fixed at stub creation | Implementing agent checks `[ ]` → `[x]` only | +| Implementation Checklist (item text/order) | Fixed at stub creation from plan | Implementing agent checks `[ ]` → `[x]` only | +| Review-Only Checklist | Review agent only | Implementing agent must not modify or check this section | +| Deviations from Plan, Key Design Decisions | Implementing agent | Replace placeholder text with actual content | +| Reviewer Checkpoints | Fixed at stub creation | Pre-filled from plan | +| Verification Results (section headings + commands) | Fixed at stub creation | Implementing agent fills command output only; command changes require a `Deviations from Plan` entry | +| Code Review Result | Review agent appends | Not included in stub | diff --git a/agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/plan_cloud_G08_1.log b/agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/plan_cloud_G08_1.log new file mode 100644 index 00000000..fdd0f474 --- /dev/null +++ b/agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/plan_cloud_G08_1.log @@ -0,0 +1,269 @@ + + +# Actual Claude and Mac single-request qualification + +## 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, declared execution target, authorization state, 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. Required external execution that remains unavailable is classified only by the official review skill. + +## Background + +The repository-owned harness can prove its collection and rejection logic without credentials, but SDD S12 is complete only after one actual Claude invocation reaches the activated Edge and writable Mac Node. This packet owns that full-cycle qualification, a deterministic redacted evidence artifact at a path stable across task archival, and post-PASS contract/spec synchronization; it contains no fallback to fake evidence. + +## Archive Evidence Snapshot + +- Prior plan: `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/plan_cloud_G08_0.log`; prior pristine review stub: `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/code_review_cloud_G08_0.log`. +- No implementation evidence or official verdict existed. Self-review found that the prior evidence path lived inside the active task directory and would break every contract/spec citation when a PASS archived that directory; it also omitted the matching input-surface spec. +- This replan writes the manifest to `agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json`, adds `agent-spec/input/openai-compatible-surface.md`, and declares `error-cancel,claude-smoke` evidence contribution so task 23's production change is not treated as full-cycle qualified before this external run. Task 23 remains the sole deterministic S11 error matrix owner. + +## Analysis + +### Files Read + +- `AGENTS.md` +- `agent-ops/rules/project/rules.md` +- `agent-ops/rules/common/rules-roadmap.md` +- `agent-ops/rules/common/rules-agent-spec.md` +- `agent-ops/rules/project/domain/edge/rules.md` +- `agent-ops/rules/project/domain/node/rules.md` +- `agent-ops/rules/project/domain/platform-common/rules.md` +- `agent-ops/rules/project/domain/testing/rules.md` +- `agent-ops/skills/common/router.md` +- `agent-ops/skills/common/plan/SKILL.md` +- `agent-ops/skills/common/code-review/SKILL.md` +- `agent-ops/skills/common/finalize-task-routing/SKILL.md` +- `agent-ops/skills/common/sync-milestone-workstate/SKILL.md` +- `agent-test/local/rules.md` +- `agent-test/local/edge-smoke.md` +- `agent-test/local/node-smoke.md` +- `agent-test/local/platform-common-smoke.md` +- `agent-test/local/testing-smoke.md` +- `agent-test/dev-corp/rules.md` (environment-selection gate only; not selected) +- `agent-test/dev-corp/edge-smoke.md` (external preflight shape only; not selected) +- `agent-test/dev-corp/node-smoke.md` (Mac Node assumptions only; not selected) +- `agent-roadmap/current.md` +- `agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/iop-owned-single-request-agent-execution.md` +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-owned-single-request-agent-execution/SDD.md` +- `agent-spec/index.md` +- `agent-spec/runtime/edge-node-execution.md` +- `agent-spec/input/openai-compatible-surface.md` +- `agent-contract/index.md` +- `agent-contract/outer/anthropic-compatible-api.md` +- `apps/edge/internal/service/single_request_observation.go` +- `apps/edge/internal/service/single_request_metrics.go` +- `apps/edge/internal/service/single_request_observation_test.go` +- `apps/edge/internal/service/single_request_metrics_test.go` +- `apps/edge/internal/openai/anthropic_handler.go` +- `apps/edge/internal/openai/single_request_anthropic_stream.go` +- `apps/edge/internal/openai/single_request_handler_test.go` +- `apps/edge/internal/openai/single_request_anthropic_stream_test.go` +- `Makefile` +- `scripts/e2e-openai-cli-workspace.sh` +- `scripts/e2e-hot-path-agents.sh` +- `scripts/fixtures/hot-path-agent-smoke-manifest.schema.json` +- `agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/plan_cloud_G10_0.log` +- `agent-task/m-iop-owned-single-request-agent-execution/23+22_error_cancel/PLAN-cloud-G10.md` +- `agent-task/m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness/PLAN-cloud-G07.md` + +### SDD Criteria + +- Approved, unlocked SDD: `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-owned-single-request-agent-execution/SDD.md`; first-line `milestone-task=error-cancel,claude-smoke` contributes to S11 and S12. +- S11 is implemented/evidenced by task 23's deterministic budget/error/cancel/length/repetition matrix. This packet does not replace that matrix; its actual one-request run supplies the required full-cycle integration evidence for those production changes. +- S12 requires actual Claude in a writable Mac workspace, observed Gemini → ornith-fast → Gemini order, stage-pure/total timing, final file verification, ingress delta one, and terminal one. +- Evidence Map S11/S12 rows drive the dependency gate, one-run identity, exact manifest fields, post-PASS documentation, and common regression commands. Fake/manual/stale evidence cannot satisfy either contribution. + +### Verification Context + +- No external handoff was supplied. Repository-native inputs are the approved SDD, local test profiles, current ingress/lifecycle observations, and task-24 harness contract. +- Preparation checkout is branch `feature/iop-owned-single-request-agent-execution`, HEAD `06e43f2aba7f42acb407cecb9761f30cbcc1df3c` plus active task packets. Current host is Linux `aarch64` with Go `1.26.2`; Claude exists at `/config/.npm-global/bin/claude`, reports `2.1.223`, and exposes the planned non-interactive flags. The required authorized runner/Mac Node, synchronized binary/config, live logs/metrics, workspace binding, ports/processes, and credential environment were not supplied. +- `dev-corp` is not selected and is not a fallback. No private host, endpoint, alias, config, workspace, or secret is assumed. Task-24 preflight accepts caller-owned values and stores hashes/closed facts only. +- Confidence is high for the deterministic oracle and low for current external executability. If inputs remain unavailable, record exact preflight output/resume condition and stop; official review owns the `external-execution` gate. + +#### External Verification Preflight + +- Runner/workdir: explicitly authorized synchronized checkout controlling the declared Mac IOP Node; capture `pwd`, OS/arch, branch, HEAD, status, tree/worktree fingerprint, and source sync. Runner OS and Darwin workspace ownership are independent facts. +- Binaries/artifacts: reviewed task-23 runtime, task-24 harness/schema/Make targets, selected Edge/Node binary/config, and Claude binary must match runtime-evidence digests; record only hashes and closed version facts. +- Commands: `claude --version`, Edge help/config check, harness `--preflight-only`, and manifest validator must succeed. Prove listening Messages/metrics ports, append-only observation-log identity, immutable Plan/Work/Review/workspace binding, provider health, and writable disposable workspace. +- Setup/resume: synchronize to reviewed task-23/task-24 source, rebuild/restart selected runtimes, provide live config/log/metrics/workspace and named secret env, create the stable evidence parent, then rerun preflight. Divergence, stale runtime/config, non-Darwin workspace owner, closed port, missing account/provider, or mismatched identity is a hard pre-invocation blocker. + +### Test Coverage Gaps + +- Repository tests/task-24 self-test cannot prove the installed Claude CLI made one actual request or that real Gemini/ornith-fast/Mac execution produced the timings/file. +- Tasks 23 and 24 are incomplete; this task must not start with only their plans. +- Current outer contract and both living specs defer actual Claude/Mac evidence and change only after a schema-valid real manifest exists. + +### Symbol References + +No production symbol is renamed. Task 25 consumes completed Make targets, harness modes, schema, ingress metric, lifecycle log, and terminal policy without modifying their owners. + +### Split Judgment + +- Task 25 is one evidence/document closure packet: its oracle is a schema-valid actual manifest plus common regressions and bounded current-document claims. +- Directory dependencies are siblings 23 and 24. Both currently lack `complete.log`; no archive candidate was read. Implementation/review resolves exactly one completion path for each and reads only those logs. +- Source/runtime preflight, one invocation, fresh offsets, workspace mutation, and atomic manifest are one indivisible run identity. + +### Scope Rationale + +Include only external preflight, one actual harness run, one stable tracked redacted manifest, validation, and post-PASS outer-contract/two-spec wording. Exclude runtime code, deployment policy, credential storage, default endpoints/models/workspaces, environment selection, multiple prompts/retries, benchmarks, roadmap mutation, raw CLI/provider/log/tool/workspace content, and evidence reconstructed from prose or stale logs. + +### Final Routing + +- `evaluation_mode=isolated-reassessment`; build/review closures (`scope`, `context`, `verification`, `evidence`, `ownership`, `decision`) are all true because the harness defines a deterministic oracle and explicit external blocker path; capability gap is absent. +- Finalizer `finalize-task-policy.sh`, mode `pair`. Build scores `2/1/1/2/2` => G08, base `local-fit`, final `risk-boundary`, `worker/cloud/G08`, `PLAN-cloud-G08.md`. Review scores `2/1/1/2/2` => G08, `official-review`, `review/cloud/G08`, `CODE_REVIEW-cloud-G08.md`. +- `large_indivisible_context=false`; positive risks are `temporal_state`, `concurrent_consistency`, `boundary_contract`, and `structured_interpretation` (4); `review_rework_count=0`; `evidence_integrity_failure=false`; recovery boundary is false. + +## Dependencies and Execution Order + +1. Final Verification command 1 must resolve exactly one task-23 and task-24 `complete.log`. Read only them, then reread completed harness/schema/Make targets and terminal/observation runtime. +2. Run credential-free self-test, synchronize/rebuild the selected runtime, create the stable evidence parent, and pass preflight before Claude invocation. +3. Run exactly one credentialed smoke and validate the atomic manifest. No automatic retry; a failed attempt requires an explicit new run identity after repair. +4. Update current contract/specs only after validation; runtime aggregation owns roadmap completion. + +## Implementation Checklist + +- [ ] Resolve completed task-23/task-24 dependencies, run the harness self-test, and record a full authorized runner/Mac Node/source/binary/config/runtime/port/workspace/credential-name preflight before invocation. +- [ ] Invoke actual Claude exactly once through the harness and atomically produce `agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json` proving ingress one, Plan/Work/Review order and timing, terminal one, and final workspace verification. +- [ ] Validate the manifest and redaction contract, preserve all raw/secret material outside tracked artifacts, and do not auto-retry or substitute fake/stale evidence. +- [ ] After evidence PASS only, update the Anthropic outer contract and both matching current implementation specs from deferred to qualified with the stable exact evidence path and bounded limits. +- [ ] Run common SDD, proto, document/evidence, and diff verification freshly; if external execution is unavailable, record blocker evidence and stop for official review classification. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [TEST-1] Preflight one authorized runtime identity + +**Problem** + +`agent-spec/runtime/edge-node-execution.md:170` defers actual Claude/Mac evidence. Running against an arbitrary endpoint or stale binary could create plausible but invalid S12 evidence and mutate the wrong workspace. + +**Solution** + +Consume task-24 preflight on an authorized runner controlling the declared Mac Node. Require synchronized source/worktree identity, reviewed binary/config/schema hashes, Darwin workspace ownership, fixed-light binding, healthy ports/providers, fresh append-only log/metrics, writable disposable workspace, Claude version, and named-secret presence. + +Before (`agent-spec/runtime/edge-node-execution.md:170`): + +```text +Actual Claude/Mac timing evidence is explicitly deferred to `claude-smoke` (SDD S12). +``` + +After preflight, before documentation changes: + +```text +The runtime is eligible for one S12 run only when source, binary, config, Mac +workspace, log, metric, provider, CLI, and credential-name facts match. +``` + +**Modified Files and Checklist** + +- [ ] Record actual preflight command/output in `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/CODE_REVIEW-cloud-G08.md`. +- [ ] Create only the parent of the stable evidence path; do not create a manifest or change docs when preflight fails. + +**Test Strategy** + +No new code test. Run completed task-24 self-test and real preflight; both exit zero before invocation. + +**Verification** + +Run Final Verification commands 2 and 3 on the authorized runner. + +### [TEST-2] Capture one actual Claude/Mac run at a stable path + +**Problem** + +S12 cannot be satisfied by fakes, one logical ID, or manual log assembly. The former task-local evidence path would be moved by official PASS archival, immediately invalidating living contract/spec citations. + +**Solution** + +Use `agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json`, which is outside the task archive lifecycle. One run identity joins the actual CLI child, ingress counter, fresh stage/terminal observations, and workspace result. Require ingress delta one; roles `plan,work,review`; configured Gemini/ornith-fast/Gemini binding digests; non-negative stage-pure/total time; one `end_turn`; expected file digest; verification exit zero; zero forbidden matches. Store no raw prompts, CLI/provider payloads, endpoints, models, paths, tool data, or secrets. + +Before (absence expected until actual PASS): + +```sh +test ! -e agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json +``` + +After: + +```json +{ + "ingress": {"delta": 1}, + "stages": [{"role": "plan"}, {"role": "work"}, {"role": "review"}], + "terminal": {"count": 1, "kind": "end_turn"}, + "redaction": {"matches": 0} +} +``` + +**Modified Files and Checklist** + +- [ ] Generate `agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json` atomically through the completed harness. +- [ ] Record actual one-run and validation output in `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/CODE_REVIEW-cloud-G08.md`. + +**Test Strategy** + +The actual harness run is the integration test. Validate the exact manifest with `--validate-manifest`; reject missing, duplicate, stale, mismatched, or secret-bearing evidence. Never auto-retry. + +**Verification** + +Run Final Verification commands 4 and 5 exactly once/once respectively. + +### [TEST-3] Record bounded qualification in every current owner + +**Problem** + +The current outer contract and both matching specs defer S12. Leaving them stale hides valid evidence; citing a task-local path or claiming more than one recorded run overstates it. + +**Solution** + +After validation only, cite the stable exact manifest in the outer Anthropic contract, runtime spec, and `/v1/messages` input-surface spec. State one ingress, Plan/Work/Review, one terminal, verified workspace result, redacted timing, tested runtime/run identity, and non-benchmark/non-availability limits. + +Before (`agent-contract/outer/anthropic-compatible-api.md:131-143`): + +```text +Actual Claude/Mac qualification remains outside the current evidence. +``` + +After: + +```text +SDD S12 is qualified only for the runtime/run recorded at the stable manifest: +one ingress, Plan/Work/Review, one terminal, verified workspace result, and +redacted timing; this is not a blanket availability or benchmark claim. +``` + +**Modified Files and Checklist** + +- [ ] Update `agent-contract/outer/anthropic-compatible-api.md` after validation. +- [ ] Update `agent-spec/runtime/edge-node-execution.md` after validation. +- [ ] Update `agent-spec/input/openai-compatible-surface.md` after validation. + +**Test Strategy** + +No document-only test. The validated manifest backs the bounded claims; deterministic search requires the stable path in all three documents. + +**Verification** + +Run Final Verification command 8 after manifest validation. + +## Modified Files Summary + +| File | Items | +|------|-------| +| `agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json` | TEST-2 | +| `agent-contract/outer/anthropic-compatible-api.md` | TEST-3 | +| `agent-spec/runtime/edge-node-execution.md` | TEST-3 | +| `agent-spec/input/openai-compatible-surface.md` | TEST-3 | +| `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/CODE_REVIEW-cloud-G08.md` | TEST-1, TEST-2, TEST-3 | + +## Final Verification + +Fresh output is required; cached tests and reconstructed external evidence are unacceptable. + +1. `bash -c 'set -euo pipefail; shopt -s nullglob; for index in 23 24; do candidates=(agent-task/m-iop-owned-single-request-agent-execution/${index}_*/complete.log agent-task/m-iop-owned-single-request-agent-execution/${index}+*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/${index}_*/complete.log agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/${index}+*/complete.log); printf "%s\n" "${candidates[@]}"; ((${#candidates[@]} == 1)); done'` — exactly one completion path for tasks 23 and 24 exists before implementation/review. +2. `make test-single-request-claude-smoke-self-test` — completed credential-free harness suite passes. +3. `mkdir -p agent-test/evidence/iop-owned-single-request-agent-execution && IOP_SINGLE_REQUEST_SMOKE_OUTPUT='agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json' make test-single-request-claude-smoke-preflight` — authorized runner/Mac Node/source/binary/config/runtime/provider/log/metrics/workspace/CLI/secret-name checks pass before invocation. +4. `IOP_SINGLE_REQUEST_SMOKE_OUTPUT='agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json' make test-single-request-claude-smoke` — invokes actual Claude exactly once and atomically writes one redacted manifest; never auto-rerun on failure. +5. `./scripts/e2e-single-request-claude.sh --validate-manifest agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json` — schema, runtime identity, ingress=1, ordered stages/timing, terminal=1, workspace verification, and zero forbidden matches validate. +6. `go test -race -count=1 ./packages/go/config ./packages/go/streamgate ./apps/edge/internal/openai ./apps/edge/internal/service ./apps/node/internal/node ./apps/node/internal/transport ./apps/node/internal/workspace` — approved common SDD regressions pass. +7. `make proto && git diff --exit-code -- proto/gen/iop` — protobuf generation is reproducible and qualification adds no wire delta. +8. `rg --sort path -n 'agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json|S11|S12|claude-smoke|ingress|Plan|Work|Review|stage|total|terminal|workspace|single run|single-run|qualified' agent-contract/outer/anthropic-compatible-api.md agent-spec/runtime/edge-node-execution.md agent-spec/input/openai-compatible-surface.md agent-test/evidence/iop-owned-single-request-agent-execution/claude-smoke-evidence.json` — documents and evidence state the same stable bounded qualification. +9. `git diff --check` — no whitespace errors. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`.