feat(epic): quality-gate 작업을 준비한다
This commit is contained in:
parent
06e43f2aba
commit
b31163396d
10 changed files with 2477 additions and 0 deletions
|
|
@ -0,0 +1,221 @@
|
|||
<!-- task=m-iop-owned-single-request-agent-execution/23+22_error_cancel plan=1 tag=API milestone-task=error-cancel -->
|
||||
|
||||
# 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 |
|
||||
|
|
@ -0,0 +1,327 @@
|
|||
<!-- task=m-iop-owned-single-request-agent-execution/23+22_error_cancel plan=1 tag=API milestone-task=error-cancel -->
|
||||
|
||||
# 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`.
|
||||
|
|
@ -0,0 +1,226 @@
|
|||
<!-- task=m-iop-owned-single-request-agent-execution/23+22_error_cancel plan=0 tag=API milestone-task=error-cancel -->
|
||||
|
||||
# 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=0, tag=API
|
||||
|
||||
## 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_0.log` and `PLAN-cloud-G10.md` → `plan_cloud_G10_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/23+22_error_cancel/`. If WARN/FAIL, fully write the next filesystem state required by the code-review skill.
|
||||
4. If PASS, preserve first-line `milestone-task=error-cancel` 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 |
|
||||
|------|---------|
|
||||
| API-1 Carry one closed terminal disposition | [ ] |
|
||||
| API-2 Classify every S11 stage outcome without fallback | [ ] |
|
||||
| API-3 Emit one standard Anthropic terminal | [ ] |
|
||||
| API-4 Synchronize the terminal contract | [ ] |
|
||||
|
||||
## 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, 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, execution runtime contract, and current implementation spec 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_0.log`.
|
||||
- [ ] Archive active `PLAN-*-G??.md` to `plan_cloud_G10_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/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` 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
|
||||
|
||||
- [ ] API-1 exposes only closed/copy-safe terminal values, normalizes legacy success, and preserves first-winner/cleanup/acknowledgement semantics.
|
||||
- [ ] API-2 stops at the first timeout/budget/repetition/malformed/context/output/cancel outcome with no later provider/tool dispatch, fallback, or waiter leak.
|
||||
- [ ] API-3 gives buffered and SSE responses the same mapping, ingress delta one, terminal count one, private-data exclusion, and disconnect silence under race.
|
||||
- [ ] API-4 matches executable behavior, keeps the Edge-Node wire unchanged, and leaves S12 external qualification pending.
|
||||
- [ ] Every path in `Modified Files Summary` is within the implementation/reviewer write boundary; unrelated predecessor ownership was not reopened.
|
||||
|
||||
## Verification Results
|
||||
|
||||
Paste actual stdout/stderr for every command. If a command changes, record the replacement and reason in `Deviations from Plan` first. Fresh `-count=1` and race output is required.
|
||||
|
||||
### API-1 intermediate
|
||||
|
||||
Command:
|
||||
|
||||
```sh
|
||||
go test -race ./apps/edge/internal/service -run 'TestSingleRequestTerminalDisposition' -count=1
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
_Paste actual stdout/stderr and exit status._
|
||||
|
||||
### API-2 intermediate
|
||||
|
||||
Command:
|
||||
|
||||
```sh
|
||||
go test -race ./apps/edge/internal/openai -run 'TestSingleRequestQualityGate' -count=1
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
_Paste actual stdout/stderr and exit status._
|
||||
|
||||
### API-3 intermediate
|
||||
|
||||
Command:
|
||||
|
||||
```sh
|
||||
go test -race ./apps/edge/internal/openai -run 'Test(AnthropicSingleRequestErrorCancelMatrix|SingleRequestAnthropicStreamTerminalDisposition)' -count=1
|
||||
```
|
||||
|
||||
Output:
|
||||
|
||||
_Paste actual stdout/stderr and exit status._
|
||||
|
||||
### API-4 intermediate
|
||||
|
||||
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-contract/inner/execution-runtime.md agent-spec/runtime/edge-node-execution.md
|
||||
```
|
||||
|
||||
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 — S11 matrix
|
||||
|
||||
```sh
|
||||
go test -race ./apps/edge/internal/service ./apps/edge/internal/openai -run 'Test(SingleRequestTerminalDisposition|SingleRequestQualityGate|AnthropicSingleRequestErrorCancelMatrix|SingleRequestAnthropicStreamTerminalDisposition)' -count=1
|
||||
```
|
||||
|
||||
Output: _Paste actual stdout/stderr and exit status._
|
||||
|
||||
### Final 3 — coordinator compatibility
|
||||
|
||||
```sh
|
||||
go test -race ./apps/edge/internal/service -run 'TestSingleRequest(InternalToolLoop|Cleanup|EnvelopeOrdering|StageBudget)' -count=1
|
||||
```
|
||||
|
||||
Output: _Paste actual stdout/stderr and exit status._
|
||||
|
||||
### Final 4 — Edge vet/regression
|
||||
|
||||
```sh
|
||||
go vet ./apps/edge/internal/service ./apps/edge/internal/openai && go test ./apps/edge/... -count=1
|
||||
```
|
||||
|
||||
Output: _Paste actual stdout/stderr and exit status._
|
||||
|
||||
### Final 5 — common SDD suite
|
||||
|
||||
```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: _Paste actual stdout/stderr and exit status._
|
||||
|
||||
### Final 6 — proto reproducibility
|
||||
|
||||
```sh
|
||||
make proto && git diff --exit-code -- proto/gen/iop
|
||||
```
|
||||
|
||||
Output: _Paste actual stdout/stderr and exit status._
|
||||
|
||||
### Final 7 — document policy
|
||||
|
||||
```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-contract/inner/execution-runtime.md agent-spec/runtime/edge-node-execution.md
|
||||
```
|
||||
|
||||
Output: _Paste actual stdout/stderr and exit status._
|
||||
|
||||
### Final 8 — symbol coverage
|
||||
|
||||
```sh
|
||||
rg --sort path -n 'SingleRequestTerminal|SingleRequestResult|singleRequestAnthropic.*Policy' apps/edge/internal/service apps/edge/internal/openai --glob '*.go'
|
||||
```
|
||||
|
||||
Output: _Paste actual stdout/stderr and exit status._
|
||||
|
||||
### Final 9 — 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 |
|
||||
|
|
@ -0,0 +1,330 @@
|
|||
<!-- task=m-iop-owned-single-request-agent-execution/23+22_error_cancel plan=0 tag=API milestone-task=error-cancel -->
|
||||
|
||||
# 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.
|
||||
|
||||
## 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/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/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-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/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`
|
||||
|
||||
### 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, the existing service coordinator/tool-loop tests, the Anthropic buffered/SSE tests, the approved SDD, and the outer/runtime contracts.
|
||||
- Starting checkout is branch `feature/iop-owned-single-request-agent-execution`, HEAD `06e43f2aba7f42acb407cecb9761f30cbcc1df3c`, initially clean. Go tests must use `-count=1`; race tests and `git diff --check` are mandatory. No external provider is needed for S11 because deterministic stage/provider/tool fixtures exercise the real coordinator and HTTP projectors.
|
||||
- Task 22 is active and has no `complete.log`. Implementation must wait for it, resolve exactly one completion path, read that exact log, then read every completed task-18 through task-22 source file before editing. Any mismatch between those completed symbols and this plan is recorded as a blocker/deviation instead of guessed around.
|
||||
- The common SDD suite includes config, streamgate, Edge OpenAI/service, Node runtime/transport/workspace, `make proto`, and diff checks. Fresh execution is required.
|
||||
|
||||
### Test Coverage Gaps
|
||||
|
||||
- Existing service tests cover tool iteration/output/deadline, request cancellation, cleanup races, and generic error classes, but no caller-safe terminal disposition survives from the executor through both Anthropic projectors.
|
||||
- Existing provider-stage plans cover malformed response rejection and per-stage cancellation separately, but do not prove repetition/no-progress or one closed cross-stage failure policy.
|
||||
- Existing buffered/SSE tests cover one success or generic error terminal and disconnect silence, but not a table of timeout, budget, malformed, context, output-length, and no-second-ingress outcomes.
|
||||
|
||||
### Symbol References
|
||||
|
||||
- `SingleRequestResult` is constructed and cloned in `apps/edge/internal/service/single_request.go` and consumed by the Anthropic buffered/stream projectors plus current tests. Extend it compatibly; update every repository composite literal found by the final symbol search.
|
||||
- `singleRequestAnthropicTerminalKind`, `singleRequestAnthropicError`, `writeAnthropicSingleRequestTerminal`, and `pumpSingleRequestAnthropicStream` are the caller projection sites. No public HTTP request field or Edge-Node wire symbol is renamed.
|
||||
- The predecessor-created `singleRequestProviderStage`, Plan/Work/Review runners, and `single_request_executor.go` are explicit future call sites. Their exact completed definitions must be reread after task 22 completes.
|
||||
|
||||
### Split Judgment
|
||||
|
||||
- This packet is the indivisible S11 correctness boundary: stage classification, service terminal ownership, and buffered/SSE projection must agree atomically or exactly-once behavior can regress. Splitting those layers would permit a typed internal outcome with a generic or duplicate public terminal.
|
||||
- `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 currently missing; no archive candidate was read.
|
||||
- S12 harness construction is independent after task 22 and lives in task 24. Actual qualification waits for both this packet and task 24 in task 25.
|
||||
|
||||
### Scope Rationale
|
||||
|
||||
Include only the closed terminal vocabulary, stage failure/no-progress classification, one controller terminal winner, Anthropic buffered/SSE mapping, S11 matrix, and current contract/spec synchronization. Exclude retry/reselection, dynamic modes, Edge-Node protobuf changes, new metrics labels, actual Claude execution, runtime deployment, and roadmap state mutation.
|
||||
|
||||
### Final Routing
|
||||
|
||||
- `evaluation_mode=first-pass`; build/review closures are all true, with no capability gap.
|
||||
- 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 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 exactly one sibling-22 `complete.log` with Final Verification command 1, read only that log, then read the completed provider-stage, Plan/Work/Review, composite executor, activation, service, and projector files before implementation.
|
||||
2. Define and test the closed service terminal contract before threading stage outcomes through the composite.
|
||||
3. Project the same disposition through buffered and streaming Anthropic responses, then synchronize contracts/spec 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, 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, execution runtime contract, and current implementation spec 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. The endpoint therefore cannot distinguish length, timeout, malformed/context failure, and caller cancel without inspecting raw errors.
|
||||
|
||||
**Solution**
|
||||
|
||||
Add a closed exported terminal DTO with validated kind and safe error class, carry it on finalizing results or 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 SingleRequestTerminalKind string
|
||||
type SingleRequestTerminalErrorClass string
|
||||
|
||||
const (
|
||||
SingleRequestTerminalEndTurn SingleRequestTerminalKind = "end_turn"
|
||||
SingleRequestTerminalLength SingleRequestTerminalKind = "length"
|
||||
SingleRequestTerminalError SingleRequestTerminalKind = "error"
|
||||
SingleRequestTerminalCancelled SingleRequestTerminalKind = "cancelled"
|
||||
)
|
||||
|
||||
type SingleRequestTerminalDisposition struct {
|
||||
Kind SingleRequestTerminalKind
|
||||
ErrorClass SingleRequestTerminalErrorClass
|
||||
}
|
||||
|
||||
type SingleRequestResult struct {
|
||||
Output string
|
||||
Terminal SingleRequestTerminalDisposition
|
||||
}
|
||||
```
|
||||
|
||||
Keep the exact error-class vocabulary closed and raw-free; zero-value legacy result literals normalize to `end_turn` only at validation.
|
||||
|
||||
**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*` table/race fixtures in `apps/edge/internal/service/single_request_test.go`; assert copy safety, zero-value compatibility, first-winner stability, cleanup-before-terminal, and no raw error text.
|
||||
|
||||
**Verification**
|
||||
|
||||
Run `go test -race ./apps/edge/internal/service -run 'TestSingleRequestTerminalDisposition' -count=1`; every disposition and terminal race passes once.
|
||||
|
||||
### [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 calls, context/output exhaustion, and context errors. Passing generic errors from the composite would collapse length into failure and allow repetition/no-progress to consume budgets without a deterministic stop.
|
||||
|
||||
**Solution**
|
||||
|
||||
Add a request-local quality guard that fingerprints bounded stage actions/results, rejects the first proven no-progress cycle, normalizes provider finish/HTTP/context outcomes, and returns only closed service dispositions. Thread it through the completed shared provider codec, Work/Review loops, and composite; do not redispatch another stage/model after a 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 converts each stage outcome exactly once through the
|
||||
// request-local quality guard, submits no later provider call, and returns the
|
||||
// closed service terminal disposition to the existing controller.
|
||||
```
|
||||
|
||||
**Modified Files and Checklist**
|
||||
|
||||
- [ ] Add closed outcome normalization and bounded fingerprints in `apps/edge/internal/openai/single_request_quality_gate.go`.
|
||||
- [ ] Thread the guard 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 resolving task 22.
|
||||
- [ ] Add deterministic provider/tool timeout, budgets, repeat/no-progress, malformed, context/output, cancel, waiter-cleanup, and no-later-dispatch fixtures in `apps/edge/internal/openai/single_request_quality_gate_test.go`.
|
||||
|
||||
**Test Strategy**
|
||||
|
||||
Write `TestSingleRequestQualityGate*` under `-race`. Record provider dispatch count, tool call count, controller envelopes, terminal disposition, pending waiter count, and safe output. Each failing row must stop at the first terminal condition with zero fallback dispatches.
|
||||
|
||||
**Verification**
|
||||
|
||||
Run `go test -race ./apps/edge/internal/openai -run 'TestSingleRequestQualityGate' -count=1`; the complete stage matrix passes without races or extra dispatches.
|
||||
|
||||
### [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 has only success, failure, and cancelled branches.
|
||||
|
||||
**Solution**
|
||||
|
||||
Map the closed service disposition through one Anthropic 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. A length outcome never exposes private partial stage content, and no error path 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 projection in `apps/edge/internal/openai/anthropic_handler.go`.
|
||||
- [ ] Apply the same policy and serialized terminal ownership in `apps/edge/internal/openai/single_request_anthropic_stream.go`.
|
||||
- [ ] Add buffered real-POST 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, stop reason/error type, terminal count one, ingress delta one, no `tool_use`, no private values, no success after error, and no wire bytes after disconnect.
|
||||
|
||||
**Verification**
|
||||
|
||||
Run `go test -race ./apps/edge/internal/openai -run 'Test(AnthropicSingleRequestErrorCancelMatrix|SingleRequestAnthropicStreamTerminalDisposition)' -count=1`; all matrix rows pass freshly.
|
||||
|
||||
### [API-4] Synchronize the terminal contract
|
||||
|
||||
**Problem**
|
||||
|
||||
The current outer contract describes generic failure/cancel and `end_turn`-only marked success, while the implementation spec defers S11. After API-1 through API-3, those statements would be stale.
|
||||
|
||||
**Solution**
|
||||
|
||||
Document the closed mapping table, exactly-once/no-fallback/no-second-ingress invariant, cancellation silence, length privacy, deterministic S11 evidence, and the unchanged Edge-Node wire. Update only current contract/spec documents.
|
||||
|
||||
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; every non-disconnect terminal is exclusive, and disconnect
|
||||
is a silent internal cancel with no later ingress or wire output.
|
||||
```
|
||||
|
||||
**Modified Files and Checklist**
|
||||
|
||||
- [ ] Update `agent-contract/outer/anthropic-compatible-api.md` with the exact endpoint mapping.
|
||||
- [ ] Update `agent-contract/inner/execution-runtime.md` with the internal disposition/ownership contract.
|
||||
- [ ] Update `agent-spec/runtime/edge-node-execution.md` with S11 implementation and evidence, leaving S12 pending.
|
||||
|
||||
**Test Strategy**
|
||||
|
||||
No document-only test is added; executable API-1 through API-3 fixtures back every statement, and deterministic search verifies the current text.
|
||||
|
||||
**Verification**
|
||||
|
||||
Run the document search in Final Verification; every terminal kind and S11/no-second-request statement must be present.
|
||||
|
||||
## 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-contract/inner/execution-runtime.md` | API-4 |
|
||||
| `agent-spec/runtime/edge-node-execution.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; Go tests use `-count=1` and cached output is not acceptable.
|
||||
|
||||
1. `bash -c 'set -euo pipefail; shopt -s nullglob; candidates=(agent-task/m-iop-owned-single-request-agent-execution/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. `go test -race ./apps/edge/internal/service ./apps/edge/internal/openai -run 'Test(SingleRequestTerminalDisposition|SingleRequestQualityGate|AnthropicSingleRequestErrorCancelMatrix|SingleRequestAnthropicStreamTerminalDisposition)' -count=1` — the complete S11 disposition and HTTP/SSE matrix passes without races.
|
||||
3. `go test -race ./apps/edge/internal/service -run 'TestSingleRequest(InternalToolLoop|Cleanup|EnvelopeOrdering|StageBudget)' -count=1` — unchanged coordinator budgets, cleanup, and terminal ordering pass freshly.
|
||||
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` — the approved SDD common suite passes freshly.
|
||||
6. `make proto && git diff --exit-code -- proto/gen/iop` — protobuf generation is reproducible and this packet introduces 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-contract/inner/execution-runtime.md agent-spec/runtime/edge-node-execution.md` — current documents contain the closed policy and S11 evidence.
|
||||
8. `rg --sort path -n 'SingleRequestTerminal|SingleRequestResult|singleRequestAnthropic.*Policy' apps/edge/internal/service apps/edge/internal/openai --glob '*.go'` — every result/terminal construction and projection call site is visible for review.
|
||||
9. `git diff --check` — no whitespace errors.
|
||||
|
||||
After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`.
|
||||
|
|
@ -0,0 +1,184 @@
|
|||
<!-- task=m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness plan=0 tag=TEST milestone-task=claude-smoke -->
|
||||
|
||||
# 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 |
|
||||
|
|
@ -0,0 +1,244 @@
|
|||
<!-- task=m-iop-owned-single-request-agent-execution/24+22_claude_smoke_harness plan=0 tag=TEST milestone-task=claude-smoke -->
|
||||
|
||||
# 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`.
|
||||
|
|
@ -0,0 +1,221 @@
|
|||
<!-- task=m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification plan=1 tag=TEST milestone-task=error-cancel,claude-smoke -->
|
||||
|
||||
# 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 |
|
||||
|
|
@ -0,0 +1,269 @@
|
|||
<!-- task=m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification plan=1 tag=TEST milestone-task=error-cancel,claude-smoke -->
|
||||
|
||||
# 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`.
|
||||
|
|
@ -0,0 +1,201 @@
|
|||
<!-- task=m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification plan=0 tag=TEST milestone-task=claude-smoke -->
|
||||
|
||||
# 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, declared execution target, authorization state, 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=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-G08.md` → `code_review_cloud_G08_0.log` and `PLAN-cloud-G08.md` → `plan_cloud_G08_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/25+23,24_claude_smoke_qualification/`. If WARN/FAIL or external execution is unavailable, 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 Preflight one authorized runtime identity | [ ] |
|
||||
| TEST-2 Capture one actual Claude/Mac run | [ ] |
|
||||
| TEST-3 Record qualification without overstating scope | [ ] |
|
||||
|
||||
## 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 produce the deterministic redacted `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 current implementation spec from S12 deferred to qualified with the exact evidence path and 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`, or apply the official `external-execution` gate when required evidence cannot run.
|
||||
- [ ] Verify that verdict, `Dimension Assessment`, and Required/Suggested/Nit classifications match.
|
||||
- [ ] Archive active `CODE_REVIEW-*-G??.md` to `code_review_cloud_G08_0.log`.
|
||||
- [ ] Archive active `PLAN-*-G??.md` to `plan_cloud_G08_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/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=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 or external-execution, write the next filesystem state matching the code-review verdict/gate and do not write `complete.log`.
|
||||
|
||||
## Deviations from Plan
|
||||
|
||||
_Record any deviations, external blocker facts, authorization state, attempted commands/output, and the exact resume condition here._
|
||||
|
||||
## Key Design Decisions
|
||||
|
||||
_Record key design decisions here._
|
||||
|
||||
## Reviewer Checkpoints
|
||||
|
||||
- [ ] TEST-1 resolved one task-23 and one task-24 completion, then proved authorized runner/Mac Node/source/binary/config/runtime/port/provider/log/metric/workspace/CLI/secret-name identity before invocation.
|
||||
- [ ] TEST-2 contains one schema-valid actual run, not fake/manual/stale evidence, with ingress delta one, ordered Plan/Work/Review timing, terminal one, and verified workspace result.
|
||||
- [ ] TEST-2 retained no raw prompt/output/provider payload, endpoint/model/path/config value, header, credential, or secret in tracked files and performed no automatic retry.
|
||||
- [ ] TEST-3 updated current docs only after evidence validation and limits every claim to the recorded runtime/single run.
|
||||
- [ ] If external execution was unavailable, the official reviewer—not the implementer—classified the external-execution state from exact evidence.
|
||||
|
||||
## Verification Results
|
||||
|
||||
Paste actual stdout/stderr for every attempted command. If a command changes, record the replacement and reason in `Deviations from Plan` first. Never paste secret/raw values; if external execution is unavailable, preserve the exact sanitized blocker and resume condition.
|
||||
|
||||
### TEST-1 intermediate
|
||||
|
||||
```sh
|
||||
make test-single-request-claude-smoke-self-test
|
||||
```
|
||||
|
||||
Then run Final Verification command 3 on the authorized runner controlling the Mac Node.
|
||||
|
||||
Output: _Paste actual sanitized stdout/stderr and exit status._
|
||||
|
||||
### TEST-2 intermediate
|
||||
|
||||
Run Final Verification commands 4 and 5 exactly once for the run identity.
|
||||
|
||||
Output: _Paste actual sanitized stdout/stderr and exit status._
|
||||
|
||||
### TEST-3 intermediate
|
||||
|
||||
```sh
|
||||
rg --sort path -n '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-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/claude-smoke-evidence.json
|
||||
```
|
||||
|
||||
Output: _Paste actual stdout/stderr and exit status._
|
||||
|
||||
### Final 1 — dependencies
|
||||
|
||||
```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: _Paste actual stdout/stderr and exit status._
|
||||
|
||||
### Final 2 — harness self-test
|
||||
|
||||
```sh
|
||||
make test-single-request-claude-smoke-self-test
|
||||
```
|
||||
|
||||
Output: _Paste actual stdout/stderr and exit status._
|
||||
|
||||
### Final 3 — external preflight
|
||||
|
||||
```sh
|
||||
IOP_SINGLE_REQUEST_SMOKE_OUTPUT='agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/claude-smoke-evidence.json' make test-single-request-claude-smoke-preflight
|
||||
```
|
||||
|
||||
Output: _Paste actual sanitized stdout/stderr and exit status._
|
||||
|
||||
### Final 4 — one actual invocation
|
||||
|
||||
```sh
|
||||
IOP_SINGLE_REQUEST_SMOKE_OUTPUT='agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/claude-smoke-evidence.json' make test-single-request-claude-smoke
|
||||
```
|
||||
|
||||
Output: _Paste actual sanitized stdout/stderr and exit status; do not auto-retry._
|
||||
|
||||
### Final 5 — manifest validation
|
||||
|
||||
```sh
|
||||
./scripts/e2e-single-request-claude.sh --validate-manifest agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/claude-smoke-evidence.json
|
||||
```
|
||||
|
||||
Output: _Paste actual stdout/stderr and exit status._
|
||||
|
||||
### Final 6 — common SDD suite
|
||||
|
||||
```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: _Paste actual stdout/stderr and exit status._
|
||||
|
||||
### Final 7 — proto reproducibility
|
||||
|
||||
```sh
|
||||
make proto && git diff --exit-code -- proto/gen/iop
|
||||
```
|
||||
|
||||
Output: _Paste actual stdout/stderr and exit status._
|
||||
|
||||
### Final 8 — bounded qualification claims
|
||||
|
||||
```sh
|
||||
rg --sort path -n '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-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/claude-smoke-evidence.json
|
||||
```
|
||||
|
||||
Output: _Paste actual stdout/stderr and exit status._
|
||||
|
||||
### Final 9 — 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 |
|
||||
|
|
@ -0,0 +1,254 @@
|
|||
<!-- task=m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification plan=0 tag=TEST milestone-task=claude-smoke -->
|
||||
|
||||
# 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 own 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 external qualification, its deterministic redacted evidence artifact, and the post-PASS contract/spec synchronization; it contains no fallback to fake evidence.
|
||||
|
||||
## 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/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` (Mac/external preflight shape only; not selected)
|
||||
- `agent-test/dev-corp/node-smoke.md` (Mac Node assumptions only; not selected)
|
||||
- `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/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` (external preflight/invocation/evidence sections)
|
||||
- `scripts/fixtures/hot-path-agent-smoke-manifest.schema.json` (identity/redaction sections)
|
||||
- `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`; `milestone-task=claude-smoke` maps to S12.
|
||||
- S12 requires an actual Claude request in a writable Mac test workspace, observed Gemini → ornith-fast → Gemini stage order, stage-pure/total timing, final file and verification, Edge ingress delta one, and terminal one.
|
||||
- Evidence Map row S12 requires actual Claude, ingress counter, Edge/Node/provider stage+total logs, and workspace before/after. Those exact fields must be present in `claude-smoke-evidence.json`; a local fake or manual prose summary cannot satisfy the row.
|
||||
|
||||
### Verification Context
|
||||
|
||||
- No external handoff was supplied. Repository-native inputs are the approved SDD, local test profiles, the current closed observations/ingress metric, and the task-24 harness contract.
|
||||
- Current preflight: branch `feature/iop-owned-single-request-agent-execution`, HEAD `06e43f2aba7f42acb407cecb9761f30cbcc1df3c`, initially clean; 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, but the required authorized runner/Mac workspace Node runtime, synchronized checkout/binary, Edge config, live log/metrics, workspace binding, ports/processes, and credential environment were not supplied.
|
||||
- `dev-corp` is not a fallback: its rule explicitly requires the user to select that environment. This plan therefore names no private host, endpoint, model alias, config, workspace, or secret. The task-24 preflight accepts those caller-owned inputs and hashes them into evidence without serializing raw values.
|
||||
- Confidence is high for the deterministic oracle and low for current executability. If external inputs remain unavailable, the implementer records the exact preflight command/output and resume condition in the review stub and stops; official code review owns the `external-execution` gate.
|
||||
|
||||
#### External Verification Preflight
|
||||
|
||||
- Runner/workdir: an explicitly authorized runner at its synchronized repository checkout, controlling the declared Mac IOP Node; verify `pwd`, `uname -s`, `uname -m`, branch, HEAD, status, tree/worktree fingerprint, and source sync. Runner OS is recorded, while the workspace owner is independently required to be Darwin.
|
||||
- Binaries/artifacts: completed task-23 runtime source, task-24 harness/schema, selected Edge/Node binaries and config, and Claude binary must match runtime-evidence digests; capture only hashes and closed version facts.
|
||||
- Commands: `claude --version`, Edge `--help`/config check, task-24 `--preflight-only`, and manifest validator must succeed. The harness proves listening Messages/metrics ports, append-only observation log identity, configured immutable Plan/Work/Review/workspace binding, and writable disposable workspace before invocation.
|
||||
- External hosts/OS: workspace execution must reach the declared Mac IOP Node; Plan/Review provider and ornith-fast Work endpoints must be healthy through the selected Edge runtime. No host is assumed until authorized inputs identify it.
|
||||
- Setup/resume: synchronize the runner to the reviewed task-23/task-24 source, rebuild/restart the selected Edge/Node runtime, supply the live config/log/metrics/workspace and named secret env, then rerun preflight. Dirty/divergent source, stale binary/config, non-Darwin workspace owner, closed port, missing CLI/account/provider, or mismatched identity is a hard pre-invocation blocker.
|
||||
|
||||
### Test Coverage Gaps
|
||||
|
||||
- Repository tests and task-24 self-test cannot prove the installed Claude CLI made one real request or that real Gemini/ornith-fast/Mac workspace execution produced the observed durations/files.
|
||||
- Until tasks 23 and 24 complete, the exact terminal policy and manifest validator are unavailable. This task must not start with only their plans present.
|
||||
- The current contract/spec explicitly defer actual Claude/Mac evidence and must change only after a schema-valid real manifest exists.
|
||||
|
||||
### Symbol References
|
||||
|
||||
- No production symbol is renamed. Task 25 consumes the completed Make targets, harness modes, schema, ingress metric, lifecycle log, and terminal policy without modifying their ownership.
|
||||
|
||||
### Split Judgment
|
||||
|
||||
- Task 25 is an evidence-and-document closure packet, independent from repository-owned harness implementation. Its PASS oracle is one schema-valid actual manifest plus unchanged common regressions and current document claims.
|
||||
- Directory dependencies are sibling 23 and 24. Both new active task directories currently lack `complete.log`; no archive candidate was read. Implementation/review must resolve exactly one completion path for each and read only those logs before proceeding.
|
||||
- The external run cannot be decomposed further: source/runtime preflight, one invocation, fresh metric/log offsets, workspace mutation, and atomic manifest belong to the same run identity.
|
||||
|
||||
### Scope Rationale
|
||||
|
||||
Include only external preflight, one actual harness run, deterministic tracked redacted evidence, validation, and post-PASS outer-contract/spec wording. Exclude runtime code changes, deployment policy, credential storage, default endpoints/models/workspaces, dev-corp selection, multiple prompts, benchmark comparisons, roadmap mutation, and any evidence reconstructed from prose or stale logs.
|
||||
|
||||
### Final Routing
|
||||
|
||||
- `evaluation_mode=first-pass`; build/review closures are all true because the harness defines a deterministic oracle and external ownership/blocker path; no cloud-resolvable capability gap is claimed.
|
||||
- Build scores `2/1/1/2/2` => G08, base `local-fit`; four loop risks select `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 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. Final Verification command 1 must resolve exactly one task-23 and one task-24 `complete.log`. Read only those logs, then read the completed harness/schema/Make targets and runtime terminal/observation code.
|
||||
2. Run credential-free self-test, synchronize/rebuild the selected external runtime, and pass external preflight before any Claude invocation.
|
||||
3. Run exactly one credentialed smoke and validate the atomically written manifest. Do not retry automatically; any failure needs a new explicit run identity after its precondition is repaired.
|
||||
4. Update current contract/spec only after the real manifest validates; leave roadmap completion to runtime aggregation.
|
||||
|
||||
## 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 produce the deterministic redacted `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 current implementation spec from S12 deferred to qualified with the exact evidence path and 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**
|
||||
|
||||
The current host is Linux and has no supplied Mac/runtime handoff. Running Claude against an arbitrary reachable endpoint or stale binary would create plausible but invalid S12 evidence and could mutate an unintended workspace.
|
||||
|
||||
**Solution**
|
||||
|
||||
Consume the completed task-24 preflight on an explicitly authorized runner controlling the declared Mac Node. Require synchronized source/worktree identity, reviewed binary/config/schema hashes, Darwin workspace ownership, configured fixed-light binding, healthy runtime ports/providers, fresh append-only log, metrics, writable disposable workspace, Claude version, and named secret presence before invocation.
|
||||
|
||||
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 every source, binary, config,
|
||||
Mac workspace, log, metric, provider, CLI, and credential-name fact matches the
|
||||
caller-supplied runtime-evidence digest set.
|
||||
```
|
||||
|
||||
**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`.
|
||||
- [ ] Do not create the evidence artifact or modify current docs when preflight fails.
|
||||
|
||||
**Test Strategy**
|
||||
|
||||
No new code test is written. Run the completed task-24 self-test first, then its real `preflight` target. The preflight exit status and output are the deterministic gate.
|
||||
|
||||
**Verification**
|
||||
|
||||
Run `make test-single-request-claude-smoke-self-test` followed by the exact preflight command in Final Verification on the authorized runner; both must exit zero before invocation.
|
||||
|
||||
### [TEST-2] Capture one actual Claude/Mac run
|
||||
|
||||
**Problem**
|
||||
|
||||
S12 cannot be satisfied by in-process fakes, one logical request ID, or manually collected logs. One run identity must join the actual CLI child, Edge ingress counter, fresh stage/terminal observations, and workspace result.
|
||||
|
||||
**Solution**
|
||||
|
||||
Run the completed harness once with the deterministic output path below. Require metric delta one, stage roles exactly `plan,work,review`, configured binding digests for Gemini/ornith-fast/Gemini, non-negative stage-pure and total timing, one `end_turn` terminal, expected final file digest, verification exit zero, and zero forbidden matches. Do not retain raw Claude output, prompts, provider payloads, endpoints, models, paths, or secret values in the repository.
|
||||
|
||||
Before (new evidence file; absence is expected until a real PASS run):
|
||||
|
||||
```sh
|
||||
test ! -e agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/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-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/claude-smoke-evidence.json` atomically through the completed harness.
|
||||
- [ ] Record the actual one-run and validation command/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 artifact through `--validate-manifest`; reject missing, duplicate, stale, mismatched, or secret-bearing evidence. There is no automatic retry.
|
||||
|
||||
**Verification**
|
||||
|
||||
Run the credentialed target once and validate the exact manifest with Final Verification commands 3 and 4.
|
||||
|
||||
### [TEST-3] Record qualification without overstating scope
|
||||
|
||||
**Problem**
|
||||
|
||||
The current outer contract and implementation spec say S12 is deferred. After a valid real manifest, leaving that text stale hides qualification; claiming more than the single tested runtime/run would overstate evidence.
|
||||
|
||||
**Solution**
|
||||
|
||||
Change only the current outer contract and implementation spec. Cite the deterministic task evidence path, the single-run/runtime scope, stage/ingress/terminal/workspace criteria, and privacy limits. Do not generalize to other modes, protocols, models, workspaces, or ongoing availability.
|
||||
|
||||
Before (`agent-contract/outer/anthropic-compatible-api.md:131-143`):
|
||||
|
||||
```text
|
||||
The contract defines one marked stream and generic deterministic behavior; actual
|
||||
Claude/Mac qualification remains outside the current evidence.
|
||||
```
|
||||
|
||||
After:
|
||||
|
||||
```text
|
||||
SDD S12 is qualified for the recorded runtime/run in the task evidence manifest:
|
||||
one ingress, Plan/Work/Review, one terminal, verified workspace result, and
|
||||
redacted stage/total timing. This is not a blanket availability or benchmark claim.
|
||||
```
|
||||
|
||||
**Modified Files and Checklist**
|
||||
|
||||
- [ ] Update `agent-contract/outer/anthropic-compatible-api.md` only after manifest validation.
|
||||
- [ ] Update `agent-spec/runtime/edge-node-execution.md` source evidence, feature/verification/limitation/history text only after manifest validation.
|
||||
|
||||
**Test Strategy**
|
||||
|
||||
No document-only test is added. The validated manifest backs the claims; deterministic search ensures `deferred` is removed only for S12 and the single-run limitation remains explicit.
|
||||
|
||||
**Verification**
|
||||
|
||||
Run the document/evidence searches in Final Verification after the real artifact validates.
|
||||
|
||||
## Modified Files Summary
|
||||
|
||||
| File | Items |
|
||||
|------|-------|
|
||||
| `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/claude-smoke-evidence.json` | TEST-2 |
|
||||
| `agent-contract/outer/anthropic-compatible-api.md` | TEST-3 |
|
||||
| `agent-spec/runtime/edge-node-execution.md` | TEST-1, 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 test output and reconstructed external evidence are not acceptable.
|
||||
|
||||
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'` — prints exactly one task-23 and one task-24 completion path and exits zero before implementation or review.
|
||||
2. `make test-single-request-claude-smoke-self-test` — the completed credential-free harness suite passes on the synchronized source.
|
||||
3. `IOP_SINGLE_REQUEST_SMOKE_OUTPUT='agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/claude-smoke-evidence.json' make test-single-request-claude-smoke-preflight` — on the authorized runner controlling the Mac Node, source/binary/config/runtime/ports/providers/log/metrics/workspace/CLI/secret-name checks pass before invocation.
|
||||
4. `IOP_SINGLE_REQUEST_SMOKE_OUTPUT='agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/claude-smoke-evidence.json' make test-single-request-claude-smoke` — invokes actual Claude exactly once and atomically writes one redacted manifest; do not rerun automatically on failure.
|
||||
5. `./scripts/e2e-single-request-claude.sh --validate-manifest agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/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 SDD common regressions pass freshly on the qualification source.
|
||||
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 '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-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/claude-smoke-evidence.json` — documents and evidence state the exact bounded qualification.
|
||||
9. `git diff --check` — no whitespace errors.
|
||||
|
||||
After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`.
|
||||
Loading…
Reference in a new issue