From f79fe3c76bb6a488141f8ec2806af4b8b8920369 Mon Sep 17 00:00:00 2001 From: toki Date: Mon, 3 Aug 2026 16:46:31 +0900 Subject: [PATCH] =?UTF-8?q?docs(hot-path):=20=ED=94=84=EB=A6=AC=EC=85=8B?= =?UTF-8?q?=20=EC=99=84=EB=A3=8C=EC=99=80=20=EC=9E=91=EC=97=85=20=EA=B7=BC?= =?UTF-8?q?=EA=B1=B0=EB=A5=BC=20=EA=B8=B0=EB=A1=9D=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../iop-hot-path-one-shot-execution.md | 6 +- .../CODE_REVIEW-cloud-G09.md | 80 ++++++++ .../PLAN-cloud-G08.md | 132 ++++++++++++++ .../code_review_cloud_G09_1.log | 105 +++++++++++ .../code_review_cloud_G10_0.log | 108 +++++++++++ .../plan_cloud_G08_1.log | 129 +++++++++++++ .../plan_cloud_G10_0.log | 164 +++++++++++++++++ .../CODE_REVIEW-cloud-G09.md | 76 ++++++++ .../PLAN-cloud-G08.md | 123 +++++++++++++ .../code_review_cloud_G09_0.log | 104 +++++++++++ .../plan_cloud_G08_0.log | 127 +++++++++++++ .../CODE_REVIEW-cloud-G10.md | 75 ++++++++ .../14+13_anthropic_gate/PLAN-cloud-G09.md | 121 +++++++++++++ .../code_review_cloud_G10_0.log | 103 +++++++++++ .../14+13_anthropic_gate/plan_cloud_G09_0.log | 138 ++++++++++++++ .../15+13_chat_gate/CODE_REVIEW-cloud-G10.md | 75 ++++++++ .../15+13_chat_gate/PLAN-cloud-G09.md | 120 ++++++++++++ .../code_review_cloud_G10_0.log | 103 +++++++++++ .../15+13_chat_gate/plan_cloud_G09_0.log | 138 ++++++++++++++ .../CODE_REVIEW-cloud-G10.md | 75 ++++++++ .../PLAN-cloud-G09.md | 130 +++++++++++++ .../code_review_cloud_G10_0.log | 103 +++++++++++ .../code_review_cloud_G10_1.log | 100 ++++++++++ .../plan_cloud_G09_0.log | 149 +++++++++++++++ .../plan_cloud_G09_1.log | 124 +++++++++++++ .../CODE_REVIEW-cloud-G10.md | 75 ++++++++ .../PLAN-cloud-G09.md | 130 +++++++++++++ .../code_review_cloud_G10_0.log | 100 ++++++++++ .../plan_cloud_G09_0.log | 125 +++++++++++++ .../CODE_REVIEW-cloud-G07.md | 75 ++++++++ .../PLAN-local-G06.md | 120 ++++++++++++ .../code_review_cloud_G07_1.log | 100 ++++++++++ .../code_review_cloud_G10_0.log | 103 +++++++++++ .../plan_cloud_G09_0.log | 171 ++++++++++++++++++ .../plan_local_G06_1.log | 119 ++++++++++++ .../CODE_REVIEW-cloud-G09.md | 75 ++++++++ .../PLAN-local-G08.md | 121 +++++++++++++ .../code_review_cloud_G09_0.log | 100 ++++++++++ .../plan_local_G08_0.log | 120 ++++++++++++ .../CODE_REVIEW-cloud-G08.md | 87 +++++++++ .../20+17,19_smoke_harness/PLAN-local-G08.md | 121 +++++++++++++ .../code_review_cloud_G08_0.log | 125 +++++++++++++ .../code_review_cloud_G08_1.log | 106 +++++++++++ .../plan_local_G08_0.log | 160 ++++++++++++++++ .../plan_local_G08_1.log | 119 ++++++++++++ .../CODE_REVIEW-cloud-G07.md | 82 +++++++++ .../21+20_hot_smoke_actual/PLAN-local-G07.md | 130 +++++++++++++ .../code_review_cloud_G07_0.log | 107 +++++++++++ .../plan_local_G07_0.log | 128 +++++++++++++ .../WORK_LOG.md | 7 + 50 files changed, 5411 insertions(+), 3 deletions(-) create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/CODE_REVIEW-cloud-G09.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/PLAN-cloud-G08.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/code_review_cloud_G09_1.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/code_review_cloud_G10_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/plan_cloud_G08_1.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/plan_cloud_G10_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/CODE_REVIEW-cloud-G09.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/PLAN-cloud-G08.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/code_review_cloud_G09_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/plan_cloud_G08_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/CODE_REVIEW-cloud-G10.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/PLAN-cloud-G09.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/code_review_cloud_G10_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/plan_cloud_G09_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/CODE_REVIEW-cloud-G10.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/PLAN-cloud-G09.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/code_review_cloud_G10_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/plan_cloud_G09_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/CODE_REVIEW-cloud-G10.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/PLAN-cloud-G09.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/code_review_cloud_G10_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/code_review_cloud_G10_1.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/plan_cloud_G09_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/plan_cloud_G09_1.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/CODE_REVIEW-cloud-G10.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/PLAN-cloud-G09.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/code_review_cloud_G10_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/plan_cloud_G09_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/CODE_REVIEW-cloud-G07.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/PLAN-local-G06.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/code_review_cloud_G07_1.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/code_review_cloud_G10_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/plan_cloud_G09_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/plan_local_G06_1.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/CODE_REVIEW-cloud-G09.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/PLAN-local-G08.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/code_review_cloud_G09_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/plan_local_G08_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/CODE_REVIEW-cloud-G08.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/PLAN-local-G08.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/code_review_cloud_G08_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/code_review_cloud_G08_1.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/plan_local_G08_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/plan_local_G08_1.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/CODE_REVIEW-cloud-G07.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/PLAN-local-G07.md create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/code_review_cloud_G07_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/plan_local_G07_0.log create mode 100644 agent-task/m-iop-hot-path-one-shot-execution/WORK_LOG.md diff --git a/agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/iop-hot-path-one-shot-execution.md b/agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/iop-hot-path-one-shot-execution.md index 460500e8..cb3b7ecb 100644 --- a/agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/iop-hot-path-one-shot-execution.md +++ b/agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/iop-hot-path-one-shot-execution.md @@ -90,9 +90,9 @@ ### Epic: [preset-surface] Execution Preset 표면 - [x] [preset-model] 외부 model catalog entry가 provider route 또는 virtual execution preset 중 하나에 매핑되고, principal별 stage route 해석·authorization과 성공·오류·model echo의 외부 identity를 유지한다. -- [ ] [preset-schema] preset이 fused selector/planner, 허용 mode, mode별 downstream ordered stage와 stage별 model reference/options를 소유하고 logical request가 immutable config generation을 고정한다. +- [x] [preset-schema] preset이 fused selector/planner, 허용 mode, mode별 downstream ordered stage와 stage별 model reference/options를 소유하고 logical request가 immutable config generation을 고정한다. - [x] [route-selector] fused selector/planner의 structural direct/light output shape를 Edge가 preset allowlist와 deterministic capability/health gate로 검증해 별도 marker·자연어 parsing 없이 최종 mode와 stage binding을 확정한다. -- [ ] [hot-preset] 초기 Hot Path preset이 `direct`와 `light`를 실행하고 등록되지 않았거나 구현되지 않은 `heavy`/추가 mode binding을 시작 시 거부한다. +- [x] [hot-preset] 초기 Hot Path preset이 `direct`와 `light`를 실행하고 등록되지 않았거나 구현되지 않은 `heavy`/추가 mode binding을 시작 시 거부한다. ### Epic: [request-flow] Request Coordinator와 Plan/Review @@ -111,7 +111,7 @@ ### Epic: [quality-ops] 검증과 운영 -- [ ] [preset-validation] model/preset one-of, stage route authorization, mode handler, declarative workspace tool schema·argument·result·containment binding, reserved path와 option 범위를 load/admission에서 fail-closed 검증한다. +- [x] [preset-validation] model/preset one-of, stage route authorization, mode handler, declarative workspace tool schema·argument·result·containment binding, reserved path와 option 범위를 load/admission에서 fail-closed 검증한다. - [ ] [route-observability] request/preset/mode/stage/attempt identity, route 근거, timing과 terminal outcome을 raw prompt·output·credential 없이 관측한다. - [ ] [hot-smoke] Claude Messages와 Pi Chat에서 direct, light pass, defect repair, write unavailable, timeout·cancel과 cleanup을 실제 streaming smoke로 검증한다. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/CODE_REVIEW-cloud-G09.md b/agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/CODE_REVIEW-cloud-G09.md new file mode 100644 index 00000000..35bad96c --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/CODE_REVIEW-cloud-G09.md @@ -0,0 +1,80 @@ + + +# Code Review Reference - API + +> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is the mandatory final step of implementation.** +> Fill all implementation-owned sections, leave active files in place, and report ready for review. On blocker, record exact command/output/resume condition only. Final verdict, log rename, `complete.log`, archive moves, and review-only checklist are review-agent-only. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core, plan=2, tag=API + +## Archive Evidence Snapshot + +- Predecessor 10/11 archived `complete.log` files are PASS evidence cited by the plan. +- Plan/review 1 was superseded before implementation; it contains no implementation verdict/evidence. + +## For the Review Agent + +Compare every item with source and fresh output. Append verdict/routing signals, archive this file to `code_review_cloud_G09_2.log` and the plan to `plan_cloud_G08_2.log`, then follow the code-review skill for PASS/WARN/FAIL. Preserve `milestone-task=terminal-control` on PASS. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Stage gate and HTTP-turn ownership | [ ] | +| API-2 Core evidence | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Add the stage-scoped gate/source contract and one HTTP-turn sequencer with normalized events, public identity, usage, output-cap, and terminal ownership. +- [ ] [API-2] Prove progressive release, terminal hold, provider protocol fragmentation, aggregation, cap, and exactly-once races with deterministic tests. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append exactly one PASS/WARN/FAIL verdict with `review_rework_count` and `evidence_integrity_failure`. +- [ ] Verify findings and dimension assessment match the verdict. +- [ ] Archive active review/plan to suffix `2` logs without overwriting prior logs. +- [ ] Verify the Agent-Ops managed `.gitignore` block. +- [ ] On PASS write standard `complete.log`, preserve milestone metadata, move this child to the dated archive, and remove the active parent only if empty. +- [ ] On WARN/FAIL write the directed next state and no `complete.log`. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Confirm each provider stage owns a separate `streamgate.RequestRuntime`; only the HTTP-turn sequencer spans internal stages. +- Confirm OpenAI adapters are reused, Anthropic provider decoding is common-stage input, and caller endpoint policy is absent. +- Confirm nonterminal deltas release progressively and exactly one outer terminal wins with bounded id/usage/cap state. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(StageRuntime|StageProtocolFragments|OuterTurnOrderingAndAggregation|OuterTurnOutputCap|OuterTurnTerminalRace)'` + +_Paste actual stdout/stderr and exit status._ + +### Common regression + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +## Section Ownership + +Implementation completion/checklist status, deviations, decisions, and verification output belong to the implementing agent. Header, item text/order, checkpoints, and commands are fixed. Review-only checklist and final `Code Review Result` belong only to the review agent. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/PLAN-cloud-G08.md b/agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/PLAN-cloud-G08.md new file mode 100644 index 00000000..83fb680e --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/PLAN-cloud-G08.md @@ -0,0 +1,132 @@ + + +# Hot Path stage gate and HTTP-turn sequencer core + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G09.md`의 구현 담당 섹션을 실제 변경·검증 출력으로 채우고 active 파일을 유지한다. 차단 시 정확한 명령, 출력, 재개 조건만 기록하며 archive/`complete.log` 작성이나 상태 판정은 하지 않는다. + +## Background + +현재 Hot Path는 selector/provider 결과를 끝까지 수집한 뒤 endpoint writer에 넘긴다. `streamgate.RequestRuntime.Run`은 stage terminal을 commit하면 종료하므로 하나의 runtime을 여러 application stage에 재사용할 수 없다. 이 child는 provider stage마다 독립된 gate runtime을 만들고, 그 위에 HTTP 요청 한 턴 동안 유지되는 protocol-neutral sequencer를 두는 정확한 책임 경계를 만든다. + +## Archive Evidence Snapshot + +- `agent-task/archive/2026/08/m-iop-hot-path-one-shot-execution/10+07,09_light_flow/complete.log`: PASS, light stage state machine과 correlation evidence 완료. +- `agent-task/archive/2026/08/m-iop-hot-path-one-shot-execution/11+09,10_cleanup/complete.log`: PASS, cleanup terminal intent와 exactly-once cleanup evidence 완료. +- 이전 active plan/review pair는 구현 전에 source reanalysis로 대체됐다. 구현 evidence와 verdict는 없다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `apps/edge/internal/openai/hot_path_dispatch.go` +- `apps/edge/internal/openai/stream_gate_runtime.go` +- `apps/edge/internal/openai/stream_gate_tunnel_codec.go` +- `packages/go/streamgate/runtime.go` +- `packages/go/streamgate/terminal.go` +- `packages/go/streamgate/stream_release.go` +- `agent-test/local/rules.md` +- `agent-test/local/edge-smoke.md` + +### SDD Criteria + +- 승인 SDD S10: 한 HTTP 턴은 caller-native terminal을 정확히 한 번 내보내며, tool turn은 HTTP terminal 뒤에도 logical request correlation을 유지한다. +- 내부 local completion처럼 agent roundtrip 없이 다음 stage로 이어지는 stage terminal만 hold한다. content/reasoning/tool delta는 완전 수집하지 않는다. +- 한 HTTP 턴의 public block/tool id, usage 합산, caller output cap, response-start/terminal ownership을 한 sequencer가 관리한다. + +### Verification Context + +- local edge profile과 fresh `-race -count=1`을 사용한다. 외부 runtime은 필요 없다. +- stage source, release sink, outer codec은 deterministic fixture로 교체 가능해야 한다. + +### Test Coverage Gaps + +- stage-scoped runtime 종료와 outer-turn 지속성의 분리, fragmented provider event의 즉시 release, terminal hold, usage/id/cap 합산, terminal race를 함께 검증하는 test가 없다. + +### Symbol References + +- public symbol rename/remove는 없다. 새 type은 `apps/edge/internal/openai` 내부 전용이다. +- 기존 `newOpenAIRunEventSource`와 OpenAI tunnel codec primitive를 재사용한다. Anthropic provider stage decode만 공통 stage-source 층에 추가한다. + +### Split Judgment + +- stable contract: provider stage source → stage-scoped `RequestRuntime`/internal release sink → one HTTP-turn sequencer. +- direct/light lifecycle wiring은 child 13, caller-facing Anthropic/Chat codec은 child 14/15에서 처리한다. + +### Scope Rationale + +- endpoint wire formatting, cancellation disposition matrix, observation, external smoke는 제외한다. +- `packages/go/streamgate` 계약은 변경하지 않는다. + +### Final Routing + +- evaluation_mode=isolated-reassessment, finalizer=`finalize-task-policy.sh pair`. +- build scores=2/2/1/1/2, risks=`temporal_state,concurrent_consistency,boundary_contract,structured_interpretation`(4), risk-boundary → `PLAN-cloud-G08.md`. +- review → `CODE_REVIEW-cloud-G09.md`; `large_indivisible_context=false`, recovery=0/false, capability gap 없음. + +## Implementation Checklist + +- [ ] [API-1] Add the stage-scoped gate/source contract and one HTTP-turn sequencer with normalized events, public identity, usage, output-cap, and terminal ownership. +- [ ] [API-2] Prove progressive release, terminal hold, provider protocol fragmentation, aggregation, cap, and exactly-once races with deterministic tests. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Stage gate and HTTP-turn ownership + +**Problem:** complete collectors buffer deltas, while treating one `RequestRuntime` as cross-stage state would conflict with its terminal-commit lifecycle. + +**Solution:** Add `hotPathStageSource` adapters for normalized RunEvent and tunnel frames, reusing the existing OpenAI source/codec primitives and adding an Anthropic Messages provider decoder. Construct one `RequestRuntime` per provider stage with an internal release sink that forwards nonterminal deltas immediately and converts the stage terminal into typed transition evidence. Add a separate mutex-owned `hotPathOuterTurn` that survives stage replacement within one HTTP request, remaps public block/tool ids, aggregates normalized usage, tracks remaining public output budget, suppresses nested starts/terminals, and exposes a compatibility accumulator for later integration. + +**Modified Files and Checklist:** + +- [ ] Add `apps/edge/internal/openai/hot_path_stage_stream.go` with reusable stage event/source adapters and fragmented OpenAI/Anthropic provider decoding. +- [ ] Add `apps/edge/internal/openai/hot_path_terminal_control.go` with the stage-scoped gate release sink, typed stage terminal evidence, HTTP-turn sequencer, normalized usage/id/cap state, compatibility accumulator, and terminal guard. +- [ ] Modify `apps/edge/internal/openai/hot_path_dispatch.go` to expose the stage dispatch metadata/source inputs required by the new core without endpoint encoding. + +**Test Strategy:** use fragment-by-fragment fake RunEvent/tunnel sources and a recording codec; assert release before provider terminal and runtime replacement after held terminal. + +**Verification:** targeted API-2 command exits 0 under race detector. + +### [API-2] Core evidence + +**Problem:** no existing evidence distinguishes stage terminal ownership from endpoint terminal ownership. + +**Solution:** Cover normalized and tunnel fragments, OpenAI and Anthropic provider selection independent of caller endpoint, content/reasoning/tool deltas, duplicate provider ids, usage normalization/deduplication, remaining-cap exhaustion, concurrent cancel/complete, and rejection of post-terminal writes. + +**Modified Files and Checklist:** + +- [ ] Add `apps/edge/internal/openai/hot_path_terminal_control_test.go` with stage-runtime, protocol-fragment, ordering/aggregation, output-cap, and terminal-race cases. +- [ ] Record actual outputs in `agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/CODE_REVIEW-cloud-G09.md`. + +**Test Strategy:** barrier-controlled goroutines and exact event sequences are the oracle; cached output is not accepted. + +**Verification:** run Final Verification; every command exits 0 with no race. + +## Dependencies and Execution Order + +1. Directory dependency `10` is satisfied by its archived PASS `complete.log`. +2. Directory dependency `11` is satisfied by its archived PASS `complete.log`. +3. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/hot_path_stage_stream.go` | API-1 | +| `apps/edge/internal/openai/hot_path_terminal_control.go` | API-1 | +| `apps/edge/internal/openai/hot_path_dispatch.go` | API-1 | +| `apps/edge/internal/openai/hot_path_terminal_control_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/CODE_REVIEW-cloud-G09.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(StageRuntime|StageProtocolFragments|OuterTurnOrderingAndAggregation|OuterTurnOutputCap|OuterTurnTerminalRace)' +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: exit 0, progressive delta release, stage terminal hold, protocol-independent provider decode, deterministic aggregation, exactly one outer terminal, no race, empty diff check. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/code_review_cloud_G09_1.log b/agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/code_review_cloud_G09_1.log new file mode 100644 index 00000000..aa2830c9 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/code_review_cloud_G09_1.log @@ -0,0 +1,105 @@ + + +# 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. +> 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. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core, plan=1, tag=API + +## Archive Evidence Snapshot + +- Archived predecessor 10: PASS. +- Archived predecessor 11: PASS. + +## For the Review Agent + +1. Append verdict and routing signals. +2. Archive `CODE_REVIEW-cloud-G09.md` → `code_review_cloud_G09_1.log` and `PLAN-cloud-G08.md` → `plan_cloud_G08_1.log`. +3. On PASS write `complete.log` and move to `agent-task/archive/YYYY/MM/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/`; otherwise write the directed next state. +4. Preserve/report `milestone-task=terminal-control` on PASS. +5. Complete the review-only checklist at the final location. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Protocol-neutral outer-turn core | [ ] | +| API-2 Core terminal-control evidence | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Reuse Stream Evidence Gate with terminal/provider-error-only subscriptions and introduce the normalized outer-turn core with deterministic id, usage, cap, and terminal state. +- [ ] [API-2] Add Core release/hold, ordering, aggregation, cap, and exactly-once race tests and run the child verification commands. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure`. +- [ ] Verify verdict, dimension assessment, and Required/Suggested/Nit classifications match. +- [ ] Archive `CODE_REVIEW-cloud-G09.md` to `code_review_cloud_G09_1.log`. +- [ ] Archive `PLAN-cloud-G08.md` to `plan_cloud_G08_1.log`. +- [ ] Verify the Agent-Ops managed block in `.gitignore`. +- [ ] If PASS, write `complete.log` from the standard template and leave no active `.md` files. +- [ ] If PASS, move the task directory to the dated archive and update this checklist at the final location. +- [ ] If PASS, preserve/report `milestone-task=terminal-control` without directly editing the roadmap. +- [ ] If PASS, remove the active parent only when no siblings/files remain. +- [ ] If WARN/FAIL, write the next filesystem state and do not write `complete.log`. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Confirm actual `streamgate.RequestRuntime` use and terminal/provider-error-only hold. +- Confirm ordered release, id/usage/cap aggregation, and exactly-one terminal/logical completion under race. +- Confirm endpoint-specific wire policy and direct/light integration remain outside this child. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(TerminalOnlyCoreRelease|OuterTurnOrderingAndAggregation|OuterTurnOutputCap|OuterTurnTerminalRace)'` + +_Paste actual stdout/stderr and exit status._ + +### Core regression + +Command: `go test -race -count=1 ./packages/go/streamgate ./apps/edge/internal/openai` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING]** Fill every implementation-owned section and leave review-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---|---|---| +| Header, Overview, Review Agent Instructions | Fixed | Implementer must not finalize | +| Implementation Item Completion, Implementation Checklist | Implementer checks only | Text/order stays fixed | +| Review-Only Checklist | Review agent | Implementer must not modify | +| Deviations, Key Design Decisions | Implementer | Record actual content | +| Reviewer Checkpoints | Fixed | Reviewer verifies | +| Verification Results | Implementer fills output | Command changes require deviation | +| Code Review Result | Review agent appends | Not included in stub | diff --git a/agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/code_review_cloud_G10_0.log b/agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/code_review_cloud_G10_0.log new file mode 100644 index 00000000..f87b0373 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/code_review_cloud_G10_0.log @@ -0,0 +1,108 @@ + + +# 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. +> 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. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/12+10,11_terminal_control, plan=0, tag=API + +## Archive Evidence Snapshot + +- `agent-task/archive/2026/08/m-iop-hot-path-one-shot-execution/10+07,09_light_flow/complete.log`: PASS. +- `agent-task/archive/2026/08/m-iop-hot-path-one-shot-execution/11+09,10_cleanup/complete.log`: PASS. + +## For the Review Agent + +> **[REVIEW AGENT ONLY]** Compare implementation against the plan and verify the recorded output. Implementers must not execute finalization. + +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 the active task directory to `agent-task/archive/YYYY/MM/m-iop-hot-path-one-shot-execution/12+10,11_terminal_control/`; if WARN/FAIL, write the code-review-directed next state. +4. On PASS preserve `milestone-task=terminal-control` in `complete.log` and report it for milestone aggregation. +5. Check every `Review-Only Checklist` item at the final log location. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Normalized outer-turn sequencer | [ ] | +| API-2 Terminal-control evidence | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Reuse Stream Evidence Gate with terminal/provider-error-only subscriptions, then introduce the normalized outer-turn sequencer with deterministic id, usage, cap, and terminal state. +- [ ] [API-2] Add Core release/hold, ordering, aggregation, cap, compatibility, and exactly-once race tests and run the targeted plus SDD common verification commands. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure`. +- [ ] Verify verdict, dimension assessment, and Required/Suggested/Nit classifications match. +- [ ] Archive `CODE_REVIEW-cloud-G10.md` to `code_review_cloud_G10_0.log`. +- [ ] Archive `PLAN-cloud-G10.md` to `plan_cloud_G10_0.log`. +- [ ] Verify the Agent-Ops managed block in `.gitignore`. +- [ ] If PASS, write `complete.log` from the standard template and leave no active `.md` files. +- [ ] If PASS, move the task directory to the dated archive and update this checklist at the final location. +- [ ] If PASS, preserve/report `milestone-task=terminal-control` without directly editing the roadmap. +- [ ] If PASS, remove the active parent only when no siblings/files remain. +- [ ] If WARN/FAIL, write the next filesystem state and do not write `complete.log`. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Confirm actual `streamgate.RequestRuntime` is used, stage content/reasoning/tool deltas are unsubscribed/live, and only terminal/provider-error is held. +- Confirm response-start/id/usage/output-cap and terminal/logical completion invariants under race. +- Confirm no wire-specific policy leaked into the common sequencer. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathOuterTurn|TestHotPathDirect|TestHotPathLight|TestHotPathCleanup'` + +_Paste actual stdout/stderr and exit status._ + +### SDD common + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING]** Fill every implementation-owned section and leave review-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---|---|---| +| Header, Overview, Review Agent Instructions | Fixed at stub creation | Implementer must not modify or execute finalization | +| Archive Evidence Snapshot | Fixed at stub creation | Read only the cited exact logs if more detail is required | +| Implementation Item Completion, Implementation Checklist | Implementer checks only | Text/order stays fixed | +| Review-Only Checklist | Review agent | Implementer must not modify | +| Deviations, Key Design Decisions | Implementer | Replace placeholders with actual content | +| Reviewer Checkpoints | Fixed at stub creation | Reviewer verifies | +| Verification Results | Implementer fills output | Command changes require a deviation entry | +| Code Review Result | Review agent appends | Not included in stub | diff --git a/agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/plan_cloud_G08_1.log b/agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/plan_cloud_G08_1.log new file mode 100644 index 00000000..ee139c5e --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/plan_cloud_G08_1.log @@ -0,0 +1,129 @@ + + +# Hot Path outer-turn core sequencer + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G09.md`의 구현 담당 섹션에 실제 변경과 검증 출력을 채우고 active 파일을 유지한 채 review ready를 보고한다. 차단 시 정확한 명령·출력·재개 조건만 기록하며 사용자 질문, 상태 판정, archive/`complete.log` 작성은 하지 않는다. + +## Background + +Hot Path는 provider stage를 `normalizedStageOutput`으로 모두 수집한 뒤 응답한다. 이 child는 protocol codec과 endpoint wiring에 앞서 Stream Evidence Gate를 재사용하는 protocol-neutral outer-turn core, deterministic id/usage/cap/terminal state, decoder/codec seam을 만든다. + +## Archive Evidence Snapshot + +- `agent-task/archive/2026/08/m-iop-hot-path-one-shot-execution/10+07,09_light_flow/complete.log`: PASS, stage state machine과 correlation 검증 완료. +- `agent-task/archive/2026/08/m-iop-hot-path-one-shot-execution/11+09,10_cleanup/complete.log`: PASS, cleanup terminal intent와 exactly-once cleanup 검증 완료. +- 위 로그는 선행 dependency evidence이며 구현자는 archive sibling을 추가 탐색하지 않는다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/iop-hot-path-one-shot-execution.md` +- `apps/edge/internal/openai/hot_path_dispatch.go` +- `packages/go/streamgate/runtime.go` +- `packages/go/streamgate/evidence_tail.go` +- `agent-test/local/rules.md` +- `agent-test/local/edge-smoke.md` + +### SDD Criteria + +- 승인 SDD, `milestone-task=terminal-control`, S10. +- 이 child는 cross-stage response-start 억제, public id 재번호, usage/output-cap 합산, delta ordering, terminal/logical completion race의 protocol-neutral evidence에 기여한다. +- S10 production closure는 child 13 및 endpoint child 14/15 evidence와 합산한다. + +### Verification Context + +- local 규칙과 edge-smoke profile을 적용하며 fresh `-race -count=1`만 허용한다. +- 외부 runtime은 필요하지 않다. Core release/hold와 concurrent terminal fixture가 결정적 oracle이다. + +### Test Coverage Gaps + +- 기존 direct/light/cleanup tests는 terminal-only subscription, ordered release, id/usage/cap aggregation, terminal race를 검증하지 않는다. + +### Symbol References + +- 기존 public symbol rename/remove 없음. 새 type은 `apps/edge/internal/openai` 내부에서만 사용한다. + +### Split Judgment + +- stable contract: `streamgate.RequestRuntime` terminal/provider-error-only hold와 protocol-neutral outer-turn sequencer. +- direct/light compatibility wiring은 child 13, endpoint wire codec은 child 14/15로 분리한다. +- predecessor 10/11은 archive evidence로 충족됐다. + +### Scope Rationale + +- direct/light stage transition wiring, Anthropic/OpenAI wire encoding, endpoint error matrix, observability, smoke는 제외한다. +- `packages/go/streamgate` 계약은 변경하지 않는다. + +### Final Routing + +- evaluation_mode=isolated-reassessment, finalizer=`finalize-task-policy.sh pair`. +- build closures 모두 true, scores=2/2/1/1/2, G08, risks=`temporal_state,concurrent_consistency,boundary_contract,structured_interpretation`(4), risk-boundary → `PLAN-cloud-G08.md`. +- review closures 모두 true, scores=2/2/1/2/2, G09, official-review → `CODE_REVIEW-cloud-G09.md`. +- `large_indivisible_context=false`, recovery=0/false, capability gap 없음. + +## Implementation Checklist + +- [ ] [API-1] Reuse Stream Evidence Gate with terminal/provider-error-only subscriptions and introduce the normalized outer-turn core with deterministic id, usage, cap, and terminal state. +- [ ] [API-2] Add Core release/hold, ordering, aggregation, cap, and exactly-once race tests and run the child verification commands. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Protocol-neutral outer-turn core + +**Problem:** completed `normalizedStageOutput` hides content/reasoning/tool deltas until terminal completion. + +**Solution:** Construct `streamgate.RequestRuntime` with blocking registrations subscribed only to terminal/provider-error events. Forward released nonterminal events through a request-scoped, mutex-protected `hotPathOuterTurn`; convert held terminal results into transition evidence. Add `hotPathStageEventDecoder` and `hotPathOuterCodec` seams, a compatibility accumulator, monotonic public ids, usage/output-cap accounting, ordered write ownership, and atomic terminal/logical completion guards. + +**Modified Files and Checklist:** + +- [ ] Add `apps/edge/internal/openai/hot_path_terminal_control.go` with gate assembly, event/codec interfaces, ordered sequencer, compatibility accumulator, id mapping, usage/cap accounting, and terminal guards. +- [ ] Modify `apps/edge/internal/openai/hot_path_dispatch.go` only as needed to normalize stage events into the Core runtime and expose transition decisions for child 13. + +**Test Strategy:** API-2 uses recording release sink/codec and barrier-controlled goroutines. + +**Verification:** `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(TerminalOnlyCoreRelease|OuterTurnOrderingAndAggregation|OuterTurnOutputCap|OuterTurnTerminalRace)'` exits 0. + +### [API-2] Core terminal-control evidence + +**Problem:** no existing test proves terminal-only hold, deterministic aggregation, or exactly-once terminal ownership. + +**Solution:** Cover immediate nonterminal release, terminal/provider-error hold, response-start suppression, fragmented ordering, duplicate provider ids, tool arguments, usage dedupe, cap-to-length conversion, and cancel-vs-complete/duplicate terminal attempts. + +**Modified Files and Checklist:** + +- [ ] Add `apps/edge/internal/openai/hot_path_terminal_control_test.go` with `TestHotPathTerminalOnlyCoreRelease`, `TestHotPathOuterTurnOrderingAndAggregation`, `TestHotPathOuterTurnOutputCap`, and `TestHotPathOuterTurnTerminalRace`. +- [ ] Record actual outputs in `agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/CODE_REVIEW-cloud-G09.md`. + +**Test Strategy:** assert exact event order, public ids, summed usage, one terminal/logical completion, and no post-cancel write. + +**Verification:** run Final Verification; every command exits 0 and race detector reports no race. + +## Dependencies and Execution Order + +1. Archived predecessor 10 is satisfied. +2. Archived predecessor 11 is satisfied. +3. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/hot_path_terminal_control.go` | API-1 | +| `apps/edge/internal/openai/hot_path_dispatch.go` | API-1 | +| `apps/edge/internal/openai/hot_path_terminal_control_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/CODE_REVIEW-cloud-G09.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(TerminalOnlyCoreRelease|OuterTurnOrderingAndAggregation|OuterTurnOutputCap|OuterTurnTerminalRace)' +go test -race -count=1 ./packages/go/streamgate ./apps/edge/internal/openai +git diff --check +``` + +Expected: exit 0, deterministic release/hold and aggregation, one terminal winner, no race, empty diff check. Cached output is not acceptable. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/plan_cloud_G10_0.log b/agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/plan_cloud_G10_0.log new file mode 100644 index 00000000..4b1c0b40 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/plan_cloud_G10_0.log @@ -0,0 +1,164 @@ + + +# Hot Path outer-stream terminal control + +## For the Implementing Agent + +`CODE_REVIEW-cloud-G10.md`의 구현 담당 섹션 작성이 마지막 필수 단계다. 아래 검증을 실제로 실행하고 원문 출력을 기록한 뒤 active 파일을 그대로 두고 review ready를 보고한다. 차단 시 정확한 명령·출력·재개 조건만 기록하며 사용자 질문, 상태 판정, archive/`complete.log` 작성은 하지 않는다. + +## Background + +Hot Path는 현재 provider stage를 `normalizedStageOutput`으로 모두 수집한 뒤 응답하므로 SDD의 terminal-only hold와 cross-stage outer envelope 계약을 충족하지 못한다. 이 작업은 protocol별 wire encoding 앞에 공통 outer-turn sequencer와 codec seam을 두고, 독립 배포 가능한 compatibility codec을 유지한 채 후속 protocol packet이 live delta release를 활성화할 수 있게 한다. + +## Archive Evidence Snapshot + +- `agent-task/archive/2026/08/m-iop-hot-path-one-shot-execution/10+07,09_light_flow/complete.log`: PASS, local/review/repair stage state machine과 stage correlation 검증 완료. +- `agent-task/archive/2026/08/m-iop-hot-path-one-shot-execution/11+09,10_cleanup/complete.log`: PASS, cleanup terminal intent와 exactly-once cleanup 검증 완료. +- 이 두 로그는 본 subtask의 선행 의존성 증거이며 구현자는 archive sibling을 추가 탐색하지 않는다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/iop-hot-path-one-shot-execution.md` +- `apps/edge/internal/openai/hot_path_dispatch.go` +- `apps/edge/internal/openai/hot_path_direct.go` +- `apps/edge/internal/openai/hot_path_light.go` +- `apps/edge/internal/openai/hot_path_cleanup.go` +- `apps/edge/internal/openai/hot_path_direct_test.go` +- `apps/edge/internal/openai/hot_path_light_test.go` +- `apps/edge/internal/openai/hot_path_cleanup_test.go` +- `packages/go/streamgate/runtime.go` +- `packages/go/streamgate/evidence_tail.go` +- `agent-test/local/rules.md` +- `agent-test/local/edge-smoke.md` + +### SDD Criteria + +- SDD: `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md`, 승인 상태, `milestone-task=terminal-control`. +- 대상 S10 및 Evidence Map S10: cross-stage response-start 억제, public block/tool id 재번호, usage/output-cap 합산, delta 순서, HTTP-turn terminal과 logical completion race. +- 본 packet은 protocol-neutral state machine과 codec seam의 evidence를 만들고, S10 production 완료 evidence는 `terminal-control` metadata를 함께 갖는 후속 Anthropic/Chat packet과 합산한다. + +### Verification Context + +- handoff 없음. local 규칙과 edge-smoke profile을 읽었고 repo root는 `/config/workspace/iop-s0`, branch `feature/iop-hot-path-one-shot-execution`, 기준 HEAD `6650e9f70d0104220d8077dd1d469b6a1facb9da`다. +- Go는 `/config/.local/bin/go`의 `go1.26.2 linux/arm64`로 project 기준 1.24보다 높다. fresh `-race -count=1` 결과만 허용한다. +- 외부 runtime은 이 packet의 판정에 필요하지 않다. 결정적 oracle은 event-order/race unit test와 기존 openai/service regression이다. + +### Test Coverage Gaps + +- 기존 direct/light/cleanup tests는 최종 body와 상태 정리를 검증하지만 stage delta의 live release, id remap, usage/output cap, turn/logical terminal 경쟁은 검증하지 않는다. +- `hot_path_terminal_control_test.go`에 ordered writer와 concurrent terminal fixture를 새로 작성한다. + +### Symbol References + +- 기존 public symbol rename/remove 없음. 새 sequencer는 `collectPresetSelectorResult`, `dispatchPresetTurn`, `submitHotPathStage`, `runDirectTurn`, `runHotPathLightStage`에서만 호출한다. + +### Split Judgment + +- stable contract: internal stage별 `streamgate.RequestRuntime` terminal-only release/hold, protocol 독립 outer-turn state machine, event decoder/wire codec interface, 기존 응답과 동등한 compatibility codec. +- predecessor 10은 archived `10+07,09_light_flow/complete.log`, predecessor 11은 archived `11+09,10_cleanup/complete.log`로 충족됐다. +- 후속 13/14가 이 state machine을 endpoint wire codec에 연결해 live release를 활성화한다. 본 packet 단독 PASS는 S10 전체 production 완료를 뜻하지 않는다. + +### Scope Rationale + +- Anthropic/OpenAI wire encoding, endpoint error mapping, observability, 실제 CLI smoke는 각각 후속 packet 13~17로 제외한다. +- `packages/go/streamgate` 계약은 재사용하며 변경하지 않는다. + +### Final Routing + +- evaluation_mode=write, finalizer=`finalize-task-policy.sh pair`. +- build closures(scope/context/verification/evidence/ownership/decision)=모두 true, scores=2/2/2/2/2, G10, grade-boundary → `PLAN-cloud-G10.md`. +- review closures=모두 true, scores=2/2/2/2/2, G10, official-review → `CODE_REVIEW-cloud-G10.md`. +- `large_indivisible_context=false`; risks=`temporal_state,concurrent_consistency,boundary_contract,structured_interpretation,variant_product`(5); recovery signals=0/false; capability gap 없음. + +## Implementation Checklist + +- [ ] [API-1] Reuse Stream Evidence Gate with terminal/provider-error-only subscriptions, then introduce the normalized outer-turn sequencer with deterministic id, usage, cap, and terminal state. +- [ ] [API-2] Add Core release/hold, ordering, aggregation, cap, compatibility, and exactly-once race tests and run the targeted plus SDD common verification commands. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Normalized outer-turn sequencer + +**Problem:** `apps/edge/internal/openai/hot_path_dispatch.go:768` dispatches only a completed `normalizedStageOutput`, while `apps/edge/internal/openai/hot_path_light.go:736` collects a whole internal stage before the next transition. Content/reasoning/tool deltas therefore remain hidden behind terminal completion. + +**Solution:** For each internal stage, construct the existing `streamgate.RequestRuntime` with blocking terminal-gate registrations whose subscribed kinds are only `EventKindTerminal` and `EventKindProviderError`; content/reasoning/tool fragments remain unsubscribed and therefore release immediately. A `streamgate.ReleaseSink` adapter forwards released nonterminal events to a request-scoped, mutex-protected `hotPathOuterTurn`, while Core terminal results become stage-transition evidence instead of being written as nested endpoint terminals. The outer turn suppresses nested response-start, allocates monotonic public block/tool ids, enforces one public output cap, aggregates usage, and commits only `continue-stage`, `finish-turn`, or `finish-logical`. Define `hotPathStageEventDecoder` and `hotPathOuterCodec` seams so normalized RunEvent and tunnel adapters feed the same Core runtime. Preserve provider order with one writer goroutine and reject emissions after terminal. + +Before (`hot_path_dispatch.go:768`): + +```go +func (s *Server) dispatchPresetTurn(..., stage normalizedStageOutput, gate hotPathRouteDecision) error +``` + +After: + +```go +import ( + "context" + "sync" + + "iop/packages/go/streamgate" +) + +type hotPathOuterTurn struct { /* ordered state, usage, cap, terminal commit */ } +func (t *hotPathOuterTurn) Accept(ctx context.Context, event hotPathNormalizedEvent) error +func (t *hotPathOuterTurn) CommitStage(decision hotPathStageDecision) error +``` + +Adapt selector and subsequent stage collection to feed a decoder/codec pair while keeping structural route/tool classification state internal. Install a compatibility codec that reconstructs the current completed response so packet 12 compiles and preserves behavior before either endpoint codec lands. `runDirectTurn` and `runHotPathLightStage` share the same turn object; packets 13/14 replace compatibility encoding with live endpoint release and supply the endpoint output cap. + +**Modified Files and Checklist:** + +- [ ] Add `apps/edge/internal/openai/hot_path_terminal_control.go` with Stream Evidence Gate runtime/release-sink assembly, event/codec interfaces, ordered sequencer, compatibility accumulator, id mapping, usage/cap accounting, and atomic terminal/logical completion guards. +- [ ] Modify `apps/edge/internal/openai/hot_path_dispatch.go` to normalize each stage into the Core runtime, accept the decoder/codec pair, and convert Core terminal results into transition decisions without requiring protocol codecs to exist yet. +- [ ] Modify `apps/edge/internal/openai/hot_path_direct.go` to use the shared turn through the compatibility codec instead of constructing unrelated terminal state. +- [ ] Modify `apps/edge/internal/openai/hot_path_light.go` to retain one outer turn across local→review/repair transitions and stop immediately after cancel/terminal. + +**Test Strategy:** Write tests in API-2; retain existing direct/light/cleanup regressions. + +**Verification:** `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathOuterTurn|TestHotPathDirect|TestHotPathLight'` exits 0. + +### [API-2] Terminal-control evidence + +**Problem:** S10 requires race and combination evidence not present in existing tests. + +**Solution:** Use a recording Core release sink, recording codec, compatibility codec, and barrier-controlled goroutines. First prove content/reasoning/tool events are released before terminal while terminal/provider-error remains held and produces one Core terminal result. Then cover 2+ stage response-start suppression, fragmented ordering, duplicate provider ids, tool arguments, usage dedupe, cap-to-length conversion, internal continuation, public tool/final terminal, cancel-vs-complete and duplicate terminal attempts. Add a compatibility-equivalence row proving pre-integration response bytes/state remain unchanged. + +**Modified Files and Checklist:** + +- [ ] Add `apps/edge/internal/openai/hot_path_terminal_control_test.go` with `TestHotPathTerminalOnlyCoreRelease`, `TestHotPathOuterTurnOrderingAndAggregation`, `TestHotPathOuterTurnCompatibility`, `TestHotPathOuterTurnOutputCap`, and `TestHotPathOuterTurnTerminalRace`. +- [ ] Record actual outputs in `agent-task/m-iop-hot-path-one-shot-execution/12+10,11_terminal_control/CODE_REVIEW-cloud-G10.md`. + +**Test Strategy:** New regression and concurrency tests are mandatory; assert exact event sequence, public ids, summed usage, one terminal, one logical completion, and no post-cancel write. + +**Verification:** run the Final Verification commands; every command exits 0 and race detector reports no race. + +## Dependencies and Execution Order + +1. `10+07,09_light_flow` — satisfied by `agent-task/archive/2026/08/m-iop-hot-path-one-shot-execution/10+07,09_light_flow/complete.log`. +2. `11+09,10_cleanup` — satisfied by `agent-task/archive/2026/08/m-iop-hot-path-one-shot-execution/11+09,10_cleanup/complete.log`. +3. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/hot_path_terminal_control.go` | API-1 | +| `apps/edge/internal/openai/hot_path_dispatch.go` | API-1 | +| `apps/edge/internal/openai/hot_path_direct.go` | API-1 | +| `apps/edge/internal/openai/hot_path_light.go` | API-1 | +| `apps/edge/internal/openai/hot_path_terminal_control_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/12+10,11_terminal_control/CODE_REVIEW-cloud-G10.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathOuterTurn|TestHotPathDirect|TestHotPathLight|TestHotPathCleanup' +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: all tests exit 0, no race or post-terminal emission, and `git diff --check` is empty. Cached test output is not acceptable. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/CODE_REVIEW-cloud-G09.md b/agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/CODE_REVIEW-cloud-G09.md new file mode 100644 index 00000000..830a7967 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/CODE_REVIEW-cloud-G09.md @@ -0,0 +1,76 @@ + + +# Code Review Reference - API + +> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is mandatory.** Fill all implementation-owned sections and stop with active files in place. Final verdict, logs, `complete.log`, archive moves, and review-only checks are review-agent-only. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration, plan=1, tag=API + +## Archive Evidence Snapshot + +- Plan/review 0 was superseded before implementation; it contains no implementation verdict/evidence. + +## For the Review Agent + +Verify source and fresh output. Archive this file to `code_review_cloud_G09_1.log` and the plan to `plan_cloud_G08_1.log`, then follow PASS/WARN/FAIL finalization. Preserve `milestone-task=terminal-control` on PASS. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Lifecycle integration | [ ] | +| API-2 Integration evidence | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Wire the already-dispatched selector result and direct/light follow-up stages through one HTTP-turn sequencer while propagating remaining output budget. +- [ ] [API-2] Add compatibility, transition, response-start/terminal, and no-post-terminal regression evidence. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append verdict and verified routing signals; findings/dimensions agree. +- [ ] Archive review/plan to suffix `1` without overwriting logs and verify `.gitignore` managed block. +- [ ] On PASS write `complete.log`, preserve milestone metadata, archive this child, and remove parent only if empty. +- [ ] On WARN/FAIL write the directed next state and no `complete.log`. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Confirm one outer turn is created per inbound HTTP request and the initial dispatch result is not dispatched twice. +- Confirm local→review/repair keeps the turn, tool HTTP terminal does not retain the writer across agent roundtrip, and remaining cap reaches stage bodies. +- Confirm compatibility output and ordinary direct/light/cleanup behavior are preserved. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(OuterTurnIntegration|OuterTurnCompatibility|Direct|Light|Cleanup)'` + +_Paste actual stdout/stderr and exit status._ + +### Common regression + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +## Section Ownership + +Implementation status, deviations, decisions, and command outputs belong to the implementer. Fixed text/checkpoints stay unchanged. Final result and review-only actions belong to the reviewer. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/PLAN-cloud-G08.md b/agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/PLAN-cloud-G08.md new file mode 100644 index 00000000..0942c4dd --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/PLAN-cloud-G08.md @@ -0,0 +1,123 @@ + + +# Hot Path direct/light outer-turn integration + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G09.md`의 구현 담당 섹션에 실제 변경·검증 출력을 채우고 active 파일을 유지한다. 차단 시 정확한 blocker와 재개 조건만 기록하며 archive/`complete.log` 작성이나 상태 판정은 하지 않는다. + +## Background + +Child 12의 stage-scoped gate와 HTTP-turn sequencer를 selector/direct/light lifecycle에 연결한다. 한 inbound HTTP 요청마다 새 outer turn을 만들고, local→review처럼 agent roundtrip이 없는 내부 전이는 같은 turn에서 이어가되 tool call HTTP terminal 뒤에는 writer를 보존하지 않는다. + +## Archive Evidence Snapshot + +- 이전 active plan/review pair는 구현 전에 source reanalysis로 대체됐다. 구현 evidence와 verdict는 없다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `apps/edge/internal/openai/hot_path_dispatch.go` +- `apps/edge/internal/openai/hot_path_direct.go` +- `apps/edge/internal/openai/hot_path_light.go` +- `apps/edge/internal/openai/hot_path_cleanup.go` +- `apps/edge/internal/openai/hot_path_direct_test.go` +- `apps/edge/internal/openai/hot_path_light_test.go` +- `agent-test/local/rules.md` + +### SDD Criteria + +- 승인 SDD S10: one outer envelope, nested response start/terminal suppression, delta ordering, per-turn usage sum and caller output-cap enforcement. +- direct/tool turn은 endpoint terminal을 commit한다. local completion 뒤 review/repair는 same HTTP turn에서 이어질 수 있다. + +### Verification Context + +- external runtime 없이 fake provider/stage fixture와 fresh race tests로 닫는다. + +### Test Coverage Gaps + +- already-dispatched selector result부터 후속 stage까지 한 turn을 공유하는 경로, remaining cap 전달, compatibility response 동등성 test가 없다. + +### Symbol References + +- public rename/remove 없음. Child 12 내부 contract만 소비한다. + +### Split Judgment + +- stable contract: child 12 core → selector/direct/light lifecycle. Caller protocol encoding은 child 14/15에 남긴다. + +### Scope Rationale + +- endpoint native wire/error matrix, observation, smoke는 제외한다. + +### Final Routing + +- evaluation_mode=isolated-reassessment, finalizer=`finalize-task-policy.sh pair`. +- build scores=2/2/1/1/2, risks=`temporal_state,concurrent_consistency,boundary_contract,variant_product`(4), risk-boundary → `PLAN-cloud-G08.md`. +- review → `CODE_REVIEW-cloud-G09.md`; `large_indivisible_context=false`, recovery=0/false. + +## Implementation Checklist + +- [ ] [API-1] Wire the already-dispatched selector result and direct/light follow-up stages through one HTTP-turn sequencer while propagating remaining output budget. +- [ ] [API-2] Add compatibility, transition, response-start/terminal, and no-post-terminal regression evidence. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Lifecycle integration + +**Problem:** current selector/direct/light collectors complete independently, and stage request builders reuse the original output limit rather than an outer-turn remaining budget. + +**Solution:** Initialize exactly one outer turn per inbound preset HTTP request. Feed the existing initial `ProviderPoolDispatchResult` into its first stage runtime instead of redispatching. Replace each subsequent provider stage with a new stage runtime while retaining the outer sequencer, propagate normalized remaining output budget through `hotPathDispatchSnapshot` and stage body builders, hold only internal transition terminals, and terminate the HTTP turn on direct/tool/error/cap completion. Keep the compatibility accumulator so existing complete-response behavior remains stable until endpoint codecs are connected. + +**Modified Files and Checklist:** + +- [ ] Modify `apps/edge/internal/openai/hot_path_dispatch.go` to run initial/subsequent dispatch results through stage-scoped runtimes and carry remaining budget. +- [ ] Modify `apps/edge/internal/openai/hot_path_direct.go` to consume the shared turn/compatibility result without a second collector. +- [ ] Modify `apps/edge/internal/openai/hot_path_light.go` to retain the same turn across local/review/repair and stop after an outer terminal. + +**Test Strategy:** direct, tool, local-pass, local-review, repair, cap, and terminal-stop rows with exact dispatch counts. + +**Verification:** targeted API-2 command exits 0. + +### [API-2] Integration evidence + +**Problem:** ordinary direct/light tests do not prove stage replacement inside one HTTP turn. + +**Solution:** Extend the core fixture with already-dispatched initial results and multi-stage sequences. Assert no duplicate dispatch, one response-start, ordered deltas, per-stage terminal interception, summed usage, decreasing cap, compatibility output equivalence, and no provider work after outer terminal/cancel. + +**Modified Files and Checklist:** + +- [ ] Extend `apps/edge/internal/openai/hot_path_terminal_control_test.go` with outer-turn integration and compatibility cases. +- [ ] Record actual output in `agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/CODE_REVIEW-cloud-G09.md`. + +**Test Strategy:** preserve existing direct/light/cleanup regressions and compare exact transition trace. + +**Verification:** run Final Verification; all commands exit 0 without race. + +## Dependencies and Execution Order + +1. Directory dependency `12` must produce `agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/complete.log`. +2. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/hot_path_dispatch.go` | API-1 | +| `apps/edge/internal/openai/hot_path_direct.go` | API-1 | +| `apps/edge/internal/openai/hot_path_light.go` | API-1 | +| `apps/edge/internal/openai/hot_path_terminal_control_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/CODE_REVIEW-cloud-G09.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(OuterTurnIntegration|OuterTurnCompatibility|Direct|Light|Cleanup)' +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: exit 0, one sequencer per HTTP request, no redispatch/nested terminal, stable compatibility output, correct remaining cap, no race. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/code_review_cloud_G09_0.log b/agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/code_review_cloud_G09_0.log new file mode 100644 index 00000000..bb590a65 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/code_review_cloud_G09_0.log @@ -0,0 +1,104 @@ + + +# 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. +> 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. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration, plan=0, tag=API + +## Archive Evidence Snapshot + +- Predecessor child 12 must be PASS before implementation. + +## For the Review Agent + +1. Append verdict and routing signals. +2. Archive `CODE_REVIEW-cloud-G09.md` → `code_review_cloud_G09_0.log` and `PLAN-cloud-G08.md` → `plan_cloud_G08_0.log`. +3. On PASS write `complete.log` and move to `agent-task/archive/YYYY/MM/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/`; otherwise write the directed next state. +4. Preserve/report `milestone-task=terminal-control` on PASS. +5. Complete the review-only checklist at the final location. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Direct/light lifecycle integration | [ ] | +| API-2 Compatibility and transition evidence | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Feed selector/direct/light stages through one predecessor outer turn and preserve completed-response behavior through the compatibility codec. +- [ ] [API-2] Add direct/light transition, compatibility, stop-after-terminal, and cleanup regression evidence and run the child verification commands. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure`. +- [ ] Verify verdict, dimension assessment, and Required/Suggested/Nit classifications match. +- [ ] Archive the active review to `code_review_cloud_G09_0.log`. +- [ ] Archive the active plan to `plan_cloud_G08_0.log`. +- [ ] Verify the Agent-Ops managed block in `.gitignore`. +- [ ] If PASS, write `complete.log` from the standard template and leave no active `.md` files. +- [ ] If PASS, move the task directory to the dated archive and update this checklist at the final location. +- [ ] If PASS, preserve/report `milestone-task=terminal-control` without directly editing the roadmap. +- [ ] If PASS, remove the active parent only when no siblings/files remain. +- [ ] If WARN/FAIL, write the next filesystem state and do not write `complete.log`. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Confirm selector/direct/light share one predecessor outer turn and compatibility codec. +- Confirm one response-start, ordered stage transitions, existing response equivalence, and no post-terminal dispatch. +- Confirm endpoint wire policy remains outside this child. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(OuterTurnCompatibility|Direct|Light|Cleanup)'` + +_Paste actual stdout/stderr and exit status._ + +### SDD common + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING]** Fill every implementation-owned section and leave review-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---|---|---| +| Header, Overview, Review Agent Instructions | Fixed | Implementer must not finalize | +| Implementation Item Completion, Implementation Checklist | Implementer checks only | Text/order stays fixed | +| Review-Only Checklist | Review agent | Implementer must not modify | +| Deviations, Key Design Decisions | Implementer | Record actual content | +| Reviewer Checkpoints | Fixed | Reviewer verifies | +| Verification Results | Implementer fills output | Command changes require deviation | +| Code Review Result | Review agent appends | Not included in stub | diff --git a/agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/plan_cloud_G08_0.log b/agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/plan_cloud_G08_0.log new file mode 100644 index 00000000..42aad7f5 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/plan_cloud_G08_0.log @@ -0,0 +1,127 @@ + + +# Hot Path outer-turn direct/light integration + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G09.md`의 구현 담당 섹션에 실제 변경·검증 출력을 채우고 active 파일을 유지한다. 차단 시 정확한 blocker/명령/출력/재개 조건만 기록하고 사용자 질문, archive, `complete.log` 작성은 하지 않는다. + +## Background + +Child 12가 만드는 protocol-neutral outer-turn core를 selector/direct/light stage lifecycle에 연결하고 compatibility codec으로 기존 완료 응답을 보존해야 endpoint child가 live codec을 안전하게 연결할 수 있다. + +## Archive Evidence Snapshot + +- Archived predecessor 10/11은 child 12의 선행 evidence다. +- 이 child는 active predecessor `12+10,11_outer_turn_core/complete.log`가 생성된 뒤 시작한다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `apps/edge/internal/openai/hot_path_dispatch.go` +- `apps/edge/internal/openai/hot_path_direct.go` +- `apps/edge/internal/openai/hot_path_light.go` +- `apps/edge/internal/openai/hot_path_cleanup.go` +- `apps/edge/internal/openai/hot_path_direct_test.go` +- `apps/edge/internal/openai/hot_path_light_test.go` +- `apps/edge/internal/openai/hot_path_cleanup_test.go` +- `agent-test/local/rules.md` + +### SDD Criteria + +- 승인 SDD, `milestone-task=terminal-control`, S10. +- 이 child는 one outer turn across direct/light stage transitions, compatibility response equivalence, terminal stop, and no nested response-start evidence에 기여한다. + +### Verification Context + +- fresh `-race -count=1` unit/integration results are required; external runtime is not required. + +### Test Coverage Gaps + +- core와 기존 direct/light/cleanup 경로가 같은 turn을 공유하고 pre-endpoint bytes/state가 동등한지 검증하는 fixture가 없다. + +### Symbol References + +- existing public symbols are not renamed or removed. + +### Split Judgment + +- stable contract: outer-turn core → selector/direct/light lifecycle through compatibility codec. +- Core construction/race is child 12, Anthropic/Chat wire is child 14/15. + +### Scope Rationale + +- endpoint encoding, endpoint error matrix, observability, actual smoke are excluded. + +### Final Routing + +- evaluation_mode=isolated-reassessment, finalizer=`finalize-task-policy.sh pair`. +- build closures 모두 true, scores=2/2/1/1/2, G08, risks=`temporal_state,concurrent_consistency,boundary_contract,variant_product`(4), risk-boundary → `PLAN-cloud-G08.md`. +- review closures 모두 true, scores=2/2/1/2/2, G09, official-review → `CODE_REVIEW-cloud-G09.md`. +- `large_indivisible_context=false`, recovery=0/false, capability gap 없음. + +## Implementation Checklist + +- [ ] [API-1] Feed selector/direct/light stages through one predecessor outer turn and preserve completed-response behavior through the compatibility codec. +- [ ] [API-2] Add direct/light transition, compatibility, stop-after-terminal, and cleanup regression evidence and run the child verification commands. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Direct/light lifecycle integration + +**Problem:** selector, direct, and light collection currently complete independently and do not share the outer turn. + +**Solution:** Adapt selector and subsequent stage collection to feed the predecessor decoder/codec pair. Keep structural route/tool classification internal, retain one turn across local→review/repair transitions, convert Core terminal results into transition decisions, and stop after cancel/terminal. Use the compatibility codec until endpoint children replace it. + +**Modified Files and Checklist:** + +- [ ] Modify `apps/edge/internal/openai/hot_path_dispatch.go` to feed selector/subsequent stages into one outer turn. +- [ ] Modify `apps/edge/internal/openai/hot_path_direct.go` to use the shared turn through the compatibility codec. +- [ ] Modify `apps/edge/internal/openai/hot_path_light.go` to retain the turn across local/review/repair and stop after terminal. + +**Test Strategy:** API-2 extends existing direct/light/cleanup regressions. + +**Verification:** `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(OuterTurnCompatibility|Direct|Light|Cleanup)'` exits 0. + +### [API-2] Compatibility and transition evidence + +**Problem:** no test proves shared-turn compatibility across direct/light stage transitions. + +**Solution:** Add compatibility-equivalence and multi-stage transition rows proving one response-start, stable state/bytes before endpoint integration, ordered continuation, and no stage work after terminal/cancel. + +**Modified Files and Checklist:** + +- [ ] Extend `apps/edge/internal/openai/hot_path_terminal_control_test.go` with `TestHotPathOuterTurnCompatibility` and direct/light transition fixtures. +- [ ] Record output in `agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/CODE_REVIEW-cloud-G09.md`. + +**Test Strategy:** preserve existing direct/light/cleanup behavior and assert exact transition order. + +**Verification:** run Final Verification; all commands exit 0 without race. + +## Dependencies and Execution Order + +1. `12+10,11_outer_turn_core` must produce `agent-task/m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/complete.log`. +2. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/hot_path_dispatch.go` | API-1 | +| `apps/edge/internal/openai/hot_path_direct.go` | API-1 | +| `apps/edge/internal/openai/hot_path_light.go` | API-1 | +| `apps/edge/internal/openai/hot_path_terminal_control_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/CODE_REVIEW-cloud-G09.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(OuterTurnCompatibility|Direct|Light|Cleanup)' +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: exit 0, compatible direct/light behavior, one outer response lifecycle, no race/post-terminal work, empty diff check. Cached output is not acceptable. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/CODE_REVIEW-cloud-G10.md b/agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/CODE_REVIEW-cloud-G10.md new file mode 100644 index 00000000..45b114c8 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/CODE_REVIEW-cloud-G10.md @@ -0,0 +1,75 @@ + + +# Code Review Reference - API + +> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is mandatory.** Fill implementation-owned evidence and stop with active files. Review finalization is review-agent-only. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/14+13_anthropic_gate, plan=1, tag=API + +## Archive Evidence Snapshot + +- Plan/review 0 was superseded before implementation; it contains no implementation verdict/evidence. + +## For the Review Agent + +Verify source/wire output, archive to `code_review_cloud_G10_1.log` and `plan_cloud_G09_1.log`, then finalize by verdict. Preserve `milestone-task=terminal-control,anthropic-gate` on PASS. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Native Messages outer codec | [ ] | +| API-2 Anthropic wire evidence | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Add a caller-facing Anthropic Messages outer codec and pass the already-dispatched preset result, request identity, stream mode, and `max_tokens` into the shared turn. +- [ ] [API-2] Add native streaming/non-streaming, mixed-provider, fragmentation, tool, cap, and baseline error handler fixtures. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append verdict/routing signals and verify findings/dimensions. +- [ ] Archive review/plan to suffix `1`; verify `.gitignore` managed block. +- [ ] On PASS write `complete.log`, preserve metadata, archive child; on WARN/FAIL write directed state without completion. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Confirm selected-provider decoding stays in the common predecessor; this child only encodes caller-facing Messages output. +- Confirm full request `max_tokens`, already-dispatched initial result, one native envelope, stable tool ids, aggregate usage, and non-stream behavior. +- Confirm committed error emits Anthropic `error` without a trailing `message_stop` in covered baseline cases. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathAnthropic|TestAnthropic(ChatBridge|Native)'` + +_Paste actual stdout/stderr and exit status._ + +### Common regression + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +## Section Ownership + +Implementer owns completion status, deviations, decisions, and outputs. Reviewer alone owns review-only actions and final result. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/PLAN-cloud-G09.md b/agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/PLAN-cloud-G09.md new file mode 100644 index 00000000..627c50ff --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/PLAN-cloud-G09.md @@ -0,0 +1,121 @@ + + +# Anthropic Messages caller codec integration + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G10.md`의 구현 담당 섹션에 실제 변경·검증 출력을 채우고 active 파일을 유지한다. 차단 시 정확한 blocker와 재개 조건만 기록하며 archive/`complete.log` 작성이나 상태 판정은 하지 않는다. + +## Background + +Provider stage protocol은 caller endpoint protocol과 독립적이다. 이 child는 child 13의 normalized outer-turn events만 Anthropic Messages wire로 encode한다. 선택된 provider가 OpenAI여도 Anthropic caller codec은 동일해야 하며, provider decoding을 `anthropic_stream.go`에서 다시 구현하지 않는다. + +## Archive Evidence Snapshot + +- 이전 active plan/review pair는 구현 전에 source reanalysis로 대체됐다. 구현 evidence와 verdict는 없다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `agent-contract/outer/anthropic-compatible-api.md` +- `apps/edge/internal/openai/anthropic_handler.go` +- `apps/edge/internal/openai/anthropic_stream.go` +- `apps/edge/internal/openai/hot_path_dispatch.go` +- `apps/edge/internal/openai/anthropic_bridge_test.go` +- `apps/edge/internal/openai/anthropic_native_test.go` +- `agent-test/local/rules.md` + +### SDD Criteria + +- 승인 SDD S10/S11: one native Messages envelope, fragmented text/thinking/tool deltas, correlated `tool_use`, aggregate usage, caller-native stop/error semantics. +- streaming 성공은 `message_start` → blocks → one `message_delta` → `message_stop`; committed error는 one `error` event 뒤 `message_stop`을 쓰지 않는다. + +### Verification Context + +- deterministic handler/wire fixtures와 fresh race tests로 닫는다. 실제 Claude smoke는 child 21이다. + +### Test Coverage Gaps + +- preset branch가 initial dispatch를 재사용하면서 full request `max_tokens`를 보존하고, normalized events를 Messages stream/non-stream response로 쓰는 evidence가 없다. + +### Symbol References + +- public rename/remove 없음. Child 12/13 provider stage decoder를 caller codec이 재사용하지도 대체하지도 않는다. + +### Split Judgment + +- stable contract: normalized outer events → Anthropic caller wire. Chat caller wire는 sibling 15, complete error matrix는 child 17이다. + +### Scope Rationale + +- provider protocol decoding, common sequencer, cross-endpoint error matrix, observation, smoke는 제외한다. + +### Final Routing + +- evaluation_mode=isolated-reassessment, finalizer=`finalize-task-policy.sh pair`. +- build scores=2/2/2/1/2, risks=`temporal_state,boundary_contract,structured_interpretation,variant_product`(4), grade-boundary → `PLAN-cloud-G09.md`. +- review → `CODE_REVIEW-cloud-G10.md`; `large_indivisible_context=false`, recovery=0/false. + +## Implementation Checklist + +- [ ] [API-1] Add a caller-facing Anthropic Messages outer codec and pass the already-dispatched preset result, request identity, stream mode, and `max_tokens` into the shared turn. +- [ ] [API-2] Add native streaming/non-streaming, mixed-provider, fragmentation, tool, cap, and baseline error handler fixtures. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Native Messages outer codec + +**Problem:** `anthropic_handler.go` currently collects selector output and only then dispatches/writes it; its envelope decode also does not retain the caller output cap. + +**Solution:** Decode/retain the full Messages request fields needed by Hot Path, including required `max_tokens`. On the preset branch, create the Anthropic outer codec before consuming the already-dispatched initial result and pass that result to the shared runner without redispatch. Encode normalized text/thinking/tool events with monotonic public block/tool ids and `input_json_delta`; render aggregate normalized usage at the outer terminal. Support streaming SSE plus the existing non-stream JSON compatibility path. Keep precommit JSON errors and postcommit native error hooks for child 17. + +**Modified Files and Checklist:** + +- [ ] Modify `apps/edge/internal/openai/anthropic_handler.go` to retain `max_tokens`, create the caller codec, and pass the initial dispatch result/correlation into the shared turn. +- [ ] Modify `apps/edge/internal/openai/anthropic_stream.go` only for normalized outer-event encoding and stream/non-stream terminal rendering. + +**Test Strategy:** invoke the preset handler with OpenAI- and Anthropic-backed fake stages; assert identical caller-native structure. + +**Verification:** targeted API-2 command exits 0. + +### [API-2] Anthropic wire evidence + +**Problem:** ordinary bridge/native tests do not cover a multi-stage Hot Path outer turn. + +**Solution:** Add fragmented direct/light/tool fixtures, mixed provider protocols, response-start suppression, stable public ids, input JSON assembly, usage sum, max-token length stop, non-stream regression, and representative pre/post-commit error cases. Leave the exhaustive terminal matrix to child 17. + +**Modified Files and Checklist:** + +- [ ] Add `apps/edge/internal/openai/hot_path_anthropic_gate_test.go` with handler-level native wire fixtures. +- [ ] Record actual output in `agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/CODE_REVIEW-cloud-G10.md`. + +**Test Strategy:** parse emitted SSE/JSON and compare exact event order/fields rather than substring-only checks. + +**Verification:** run Final Verification; all commands exit 0 without race. + +## Dependencies and Execution Order + +1. Directory dependency `13` must produce `agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/complete.log`. +2. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/anthropic_handler.go` | API-1 | +| `apps/edge/internal/openai/anthropic_stream.go` | API-1 | +| `apps/edge/internal/openai/hot_path_anthropic_gate_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/CODE_REVIEW-cloud-G10.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathAnthropic|TestAnthropic(ChatBridge|Native)' +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: exit 0, provider-independent native Messages output, one envelope/terminal, correct cap/usage/tool correlation, non-stream regression preserved. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/code_review_cloud_G10_0.log b/agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/code_review_cloud_G10_0.log new file mode 100644 index 00000000..61bec81c --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/code_review_cloud_G10_0.log @@ -0,0 +1,103 @@ + + +# 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. +> If blocked, record exact blocker, attempted commands/output, and resume condition only. +> Do not ask the user, call user-input tools, classify the next state, archive files, or write `complete.log`. +> Finalization is review-agent-only. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/14+13_anthropic_gate, plan=0, tag=API + +## For the Review Agent + +> **[REVIEW AGENT ONLY]** Compare implementation/output against the plan. Implementers must not finalize. + +1. Append verdict and routing signals. +2. Archive `CODE_REVIEW-cloud-G10.md` → `code_review_cloud_G10_0.log` and `PLAN-cloud-G09.md` → `plan_cloud_G09_0.log`. +3. If PASS, write `complete.log` and move to `agent-task/archive/YYYY/MM/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/`; otherwise write the directed next state. +4. Preserve/report `milestone-task=terminal-control,anthropic-gate` on PASS. +5. Complete the review-only checklist at the final location. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Native Messages codec integration | [ ] | +| API-2 Fragmented Anthropic evidence | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Encode the shared Hot Path outer turn as one native Anthropic Messages stream with correlated tool continuation and standard stop/error semantics. +- [ ] [API-2] Add fragmented direct/light/tool/error handler fixtures and run targeted plus SDD common verification. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append one PASS/WARN/FAIL verdict and verified routing signals. +- [ ] Verify verdict, dimensions, and finding classifications match. +- [ ] Archive `CODE_REVIEW-cloud-G10.md` to `code_review_cloud_G10_0.log`. +- [ ] Archive `PLAN-cloud-G09.md` to `plan_cloud_G09_0.log`. +- [ ] Verify the `.gitignore` managed block. +- [ ] On PASS write standard `complete.log` and leave no active `.md` files. +- [ ] On PASS move the task directory to dated archive and update this checklist there. +- [ ] On PASS preserve/report `milestone-task=terminal-control,anthropic-gate` without editing roadmap directly. +- [ ] Remove active parent only if empty. +- [ ] On WARN/FAIL write the next state and no `complete.log`. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Verify normalized and fragmented tunnel inputs produce one `message_start`/`message_stop`, monotonic block indices and public tool ids. +- Verify `max_tokens` is applied once across the public outer response and usage is aggregated without duplication. +- Verify fragmented `input_json_delta`, model echo, usage, continuation, and pre/post-commit error rules. +- Verify no internal ids/targets/control content in public events. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathAnthropic|TestAnthropicChatBridge|TestAnthropicNative'` + +_Paste actual stdout/stderr and exit status._ + +### SDD common + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING]** Fill every implementation-owned section and leave review-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---|---|---| +| Header, Overview, Review Agent Instructions | Fixed | Implementer must not modify or finalize | +| Implementation Item Completion, Implementation Checklist | Implementer checks only | Text/order stays fixed | +| Review-Only Checklist | Review agent | Implementer must not modify | +| Deviations, Key Design Decisions | Implementer | Record actual content | +| Reviewer Checkpoints | Fixed | Reviewer verifies | +| Verification Results | Implementer fills output | Command changes require deviation | +| Code Review Result | Review agent appends | Not included in stub | diff --git a/agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/plan_cloud_G09_0.log b/agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/plan_cloud_G09_0.log new file mode 100644 index 00000000..e17d61d2 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/plan_cloud_G09_0.log @@ -0,0 +1,138 @@ + + +# Anthropic Messages Hot Path stream gate + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G10.md`의 담당 섹션에 실제 변경·검증 출력을 채우고 active 파일을 유지한 채 review ready를 보고한다. 차단 시 명령·출력·재개 조건만 기록하며 사용자 질문, archive, `complete.log` 작성은 하지 않는다. + +## Background + +Anthropic preset ingress는 현재 completed stage를 기존 응답 writer에 넘긴다. 선행 terminal-control의 normalized outer-turn event를 native Messages SSE 순서로 encode하고 tool continuation correlation을 보존해야 한다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `apps/edge/internal/openai/anthropic_handler.go` +- `apps/edge/internal/openai/anthropic_stream.go` +- `apps/edge/internal/openai/hot_path_dispatch.go` +- `apps/edge/internal/openai/hot_path_direct.go` +- `apps/edge/internal/openai/anthropic_bridge_test.go` +- `apps/edge/internal/openai/anthropic_native_test.go` +- `agent-contract/outer/anthropic-compatible-api.md` +- `agent-test/local/rules.md` +- `agent-test/local/edge-smoke.md` + +### SDD Criteria + +- 승인 SDD, `milestone-task=terminal-control,anthropic-gate`, S10/S11. +- Evidence Map S11은 fragmented SSE, `tool_use`, error fixture와 handler integration을 요구한다. 체크리스트와 검증은 native event ordering, public id, continuation, error-before/after-commit을 직접 판정한다. +- 이 packet의 live codec, usage/output-cap, single-envelope evidence는 S10의 production Anthropic 절반에도 기여한다. + +### Verification Context + +- handoff 없음. local edge profile을 적용하고 fresh race tests를 사용한다. repo/branch/HEAD는 `/config/workspace/iop-s0`, `feature/iop-hot-path-one-shot-execution`, `6650e9f70d0104220d8077dd1d469b6a1facb9da`. +- 외부 Claude 실행은 packet 17 범위이며 이 packet은 deterministic handler fixtures로 닫힌다. + +### Test Coverage Gaps + +- 기존 bridge/native tests는 ordinary tunnel/bridge fragmentation을 검증하지만 preset direct/light의 multi-stage single envelope와 continuation id remap을 검증하지 않는다. + +### Symbol References + +- rename/remove 없음. 새 codec은 preset hot-path 분기에서만 사용한다. + +### Split Judgment + +- stable contract: normalized outer-turn event → Anthropic Messages native wire. +- predecessor 13 (`13+12_outer_turn_integration`)의 active `complete.log`는 현재 missing이며 구현 시작 전 반드시 생성되어야 한다. +- Chat wire는 sibling 14에서 독립 구현한다. + +### Scope Rationale + +- common sequencer 변경, Chat encoding, endpoint error matrix, metrics, actual Claude smoke는 제외한다. + +### Final Routing + +- evaluation_mode=write, finalizer=`finalize-task-policy.sh pair`. +- build closures 모두 true, scores=2/2/2/1/2, G09, grade-boundary → `PLAN-cloud-G09.md`. +- review closures 모두 true, scores=2/2/2/2/2, G10, official-review → `CODE_REVIEW-cloud-G10.md`. +- `large_indivisible_context=false`; risks=`temporal_state,boundary_contract,structured_interpretation,variant_product`(4); recovery=0/false; capability gap 없음. + +## Implementation Checklist + +- [ ] [API-1] Encode the shared Hot Path outer turn as one native Anthropic Messages stream with correlated tool continuation and standard stop/error semantics. +- [ ] [API-2] Add fragmented direct/light/tool/error handler fixtures and run targeted plus SDD common verification. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Native Messages codec integration + +**Problem:** `apps/edge/internal/openai/anthropic_handler.go:29` enters preset handling, but completed stage output is written after collection; `anthropic_stream.go` only owns the ordinary bridge session. + +**Solution:** Implement the predecessor `hotPathStageEventDecoder`/`hotPathOuterCodec` in `anthropic_stream.go` for both normalized RunEvent and fragmented tunnel SSE/JSON. Emit exactly one `message_start`, monotonic `content_block_start/delta/stop` for text/thinking/tool_use, one `message_delta` with outer stop reason and aggregate usage, then `message_stop`. Encode tool input fragments as `input_json_delta`, use remapped public tool ids, and close a tool-use HTTP turn while preserving `request_id` correlation. Pass `anthropicMessageRequest.MaxTokens` as the outer public output cap. Before commit use normal JSON error; after commit emit one Anthropic `error` event and no `message_stop`. + +Before (`anthropic_handler.go:83`): + +```go +stage, gate, collectErr := s.collectPresetSelectorResult(...) +return s.dispatchPresetTurn(..., stage, gate) +``` + +After: + +```go +turn := newAnthropicHotPathTurn(w, flusher, publicModel, requestID) +return s.runPresetOuterTurn(r.Context(), turn, dispatch) +``` + +**Modified Files and Checklist:** + +- [ ] Modify `apps/edge/internal/openai/anthropic_handler.go` to create the codec before preset dispatch, pass request correlation and `max_tokens`, and choose pre/post-commit error handling. +- [ ] Modify `apps/edge/internal/openai/anthropic_stream.go` with normalized/tunnel event decoding, outer-turn encoding, and exact native event ordering. + +**Test Strategy:** API-2 supplies wire-level fixtures; ordinary bridge/native tests remain unchanged. + +**Verification:** `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathAnthropic|TestAnthropicChatBridge|TestAnthropicNative'` exits 0. + +### [API-2] Fragmented Anthropic evidence + +**Problem:** S11 has no preset-native fixture coverage. + +**Solution:** Build fragmented provider frames across JSON/SSE boundaries for direct text+thinking, light local→review, tool_use arguments, provider error before commit, provider error after visible delta, and tool_result continuation. Parse the public SSE and assert the full event-type sequence, unique indices/ids, model echo, aggregate usage, one stop or error, and stable logical request correlation. + +**Modified Files and Checklist:** + +- [ ] Add `apps/edge/internal/openai/hot_path_anthropic_gate_test.go` with `TestHotPathAnthropicFragmentedStream`, `TestHotPathAnthropicToolContinuation`, and `TestHotPathAnthropicErrorShape`. +- [ ] Fill `agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/CODE_REVIEW-cloud-G10.md`. + +**Test Strategy:** New integration tests are mandatory and must fail if nested `message_start`, duplicate block id, raw internal ids, extra terminal, or post-error bytes appear. + +**Verification:** run Final Verification; exact parsed event arrays match and all commands exit 0. + +## Dependencies and Execution Order + +1. `13+12_outer_turn_integration` must produce `agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/complete.log` before implementation. +2. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/anthropic_handler.go` | API-1 | +| `apps/edge/internal/openai/anthropic_stream.go` | API-1 | +| `apps/edge/internal/openai/hot_path_anthropic_gate_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/CODE_REVIEW-cloud-G10.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathAnthropic|TestAnthropicChatBridge|TestAnthropicNative' +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: exit 0, exact native ordering, no race/raw internal id/duplicate terminal, empty diff check. Cached output is not acceptable. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/CODE_REVIEW-cloud-G10.md b/agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/CODE_REVIEW-cloud-G10.md new file mode 100644 index 00000000..cc1b6099 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/CODE_REVIEW-cloud-G10.md @@ -0,0 +1,75 @@ + + +# Code Review Reference - API + +> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is mandatory.** Fill implementation-owned evidence and stop with active files. Review finalization is review-agent-only. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/15+13_chat_gate, plan=1, tag=API + +## Archive Evidence Snapshot + +- Plan/review 0 was superseded before implementation; it contains no implementation verdict/evidence. + +## For the Review Agent + +Verify source/wire output, archive to `code_review_cloud_G10_1.log` and `plan_cloud_G09_1.log`, then finalize by verdict. Preserve `milestone-task=terminal-control,chat-gate` on PASS. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Native Chat outer codec | [ ] | +| API-2 Chat wire evidence | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Add a caller-facing Chat outer codec and pass the already-dispatched preset result, stream mode, model, and caller output cap into the shared turn. +- [ ] [API-2] Add streaming/non-streaming, mixed-provider, fragmentation, tool, cap, usage, and baseline error handler fixtures. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append verdict/routing signals and verify findings/dimensions. +- [ ] Archive review/plan to suffix `1`; verify `.gitignore` managed block. +- [ ] On PASS write `complete.log`, preserve metadata, archive child; on WARN/FAIL write directed state without completion. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Confirm provider decoding stays common and `normalized_sse.go` only owns caller-facing Chat encoding. +- Confirm initial result is not redispatched, output cap resolves from both request fields, one response lifecycle/tool index sequence, aggregate usage, and non-stream compatibility. +- Confirm `/v1/responses` is not added to this SDD scope. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathChat|TestChatStreamSession'` + +_Paste actual stdout/stderr and exit status._ + +### Common regression + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +## Section Ownership + +Implementer owns completion status, deviations, decisions, and outputs. Reviewer alone owns review-only actions and final result. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/PLAN-cloud-G09.md b/agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/PLAN-cloud-G09.md new file mode 100644 index 00000000..efb556fd --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/PLAN-cloud-G09.md @@ -0,0 +1,120 @@ + + +# OpenAI Chat caller codec integration + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G10.md`의 구현 담당 섹션에 실제 변경·검증 출력을 채우고 active 파일을 유지한다. 차단 시 정확한 blocker와 재개 조건만 기록하며 archive/`complete.log` 작성이나 상태 판정은 하지 않는다. + +## Background + +이 child는 child 13의 normalized outer-turn events를 OpenAI Chat Completions caller wire로 encode한다. 선택된 provider protocol decode는 common predecessor 책임이며 `normalized_sse.go`에 provider-specific decoder를 복제하지 않는다. + +## Archive Evidence Snapshot + +- 이전 active plan/review pair는 구현 전에 source reanalysis로 대체됐다. 구현 evidence와 verdict는 없다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `agent-contract/outer/openai-compatible-api.md` +- `apps/edge/internal/openai/chat_handler.go` +- `apps/edge/internal/openai/normalized_sse.go` +- `apps/edge/internal/openai/hot_path_dispatch.go` +- `apps/edge/internal/openai/chat_stream_session_test.go` +- `agent-test/local/rules.md` + +### SDD Criteria + +- 승인 SDD S10/S12: one Chat response/SSE envelope, ordered content/reasoning/tool deltas, stable tool ids/indexes, aggregate usage, native finish/error semantics. +- caller `max_tokens`/`max_completion_tokens` 중 유효한 public cap을 outer turn에 적용한다. + +### Verification Context + +- deterministic handler/wire fixtures와 fresh race tests로 닫는다. 실제 Pi smoke는 child 21이다. + +### Test Coverage Gaps + +- preset branch의 already-dispatched initial result, multi-stage single stream, mixed-provider decode, output-cap/usage aggregation evidence가 없다. + +### Symbol References + +- public rename/remove 없음. 기존 ordinary Chat session behavior를 보존한다. + +### Split Judgment + +- stable contract: normalized outer events → Chat caller wire. Anthropic caller wire는 sibling 14, exhaustive errors는 child 17이다. + +### Scope Rationale + +- provider decoding, common sequencer, `/v1/responses`, observation, actual smoke는 제외한다. + +### Final Routing + +- evaluation_mode=isolated-reassessment, finalizer=`finalize-task-policy.sh pair`. +- build scores=2/2/2/1/2, risks=`temporal_state,boundary_contract,structured_interpretation,variant_product`(4), grade-boundary → `PLAN-cloud-G09.md`. +- review → `CODE_REVIEW-cloud-G10.md`; `large_indivisible_context=false`, recovery=0/false. + +## Implementation Checklist + +- [ ] [API-1] Add a caller-facing Chat outer codec and pass the already-dispatched preset result, stream mode, model, and caller output cap into the shared turn. +- [ ] [API-2] Add streaming/non-streaming, mixed-provider, fragmentation, tool, cap, usage, and baseline error handler fixtures. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Native Chat outer codec + +**Problem:** the preset handler currently completes selector collection before `dispatchPresetTurn`, and direct writers produce a completed response rather than progressive caller chunks. + +**Solution:** Create a Chat outer codec before consuming the existing initial dispatch result and call the shared runner without redispatch. Encode normalized content/reasoning/tool fragments into one Chat response identity with stable choice/tool indexes and one final finish/usage sequence. Resolve the public cap from `max_completion_tokens`/`max_tokens` and pass it to the outer sequencer. Support stream SSE and current non-stream JSON compatibility. Keep common hooks for child 17 pre/post-commit error mapping. + +**Modified Files and Checklist:** + +- [ ] Modify `apps/edge/internal/openai/chat_handler.go` to create the caller codec and pass initial dispatch/correlation/output policy into the shared turn. +- [ ] Modify `apps/edge/internal/openai/normalized_sse.go` only for normalized outer-event Chat encoding and stream/non-stream terminal rendering. + +**Test Strategy:** handler fixtures use OpenAI and Anthropic provider-stage inputs but assert the same Chat caller protocol. + +**Verification:** targeted API-2 command exits 0. + +### [API-2] Chat wire evidence + +**Problem:** ordinary Chat session tests do not cover multi-stage Hot Path composition. + +**Solution:** Add fragmented direct/light/tool rows, mixed provider protocols, one response id/start, monotonic tool indexes, argument assembly, usage sum, length stop on cap, non-stream regression, and representative pre/post-commit errors. Leave the exhaustive terminal matrix to child 17. + +**Modified Files and Checklist:** + +- [ ] Add `apps/edge/internal/openai/hot_path_chat_gate_test.go` with handler-level response/SSE fixtures. +- [ ] Record actual output in `agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/CODE_REVIEW-cloud-G10.md`. + +**Test Strategy:** parse chunks/JSON structurally and compare exact ids, indexes, finish reason, usage, and `[DONE]` placement. + +**Verification:** run Final Verification; all commands exit 0 without race. + +## Dependencies and Execution Order + +1. Directory dependency `13` must produce `agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/complete.log`. +2. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/chat_handler.go` | API-1 | +| `apps/edge/internal/openai/normalized_sse.go` | API-1 | +| `apps/edge/internal/openai/hot_path_chat_gate_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/CODE_REVIEW-cloud-G10.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathChat|TestChatStreamSession' +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: exit 0, provider-independent native Chat output, one response lifecycle, stable tool/cap/usage semantics, non-stream regression preserved. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/code_review_cloud_G10_0.log b/agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/code_review_cloud_G10_0.log new file mode 100644 index 00000000..6f99957e --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/code_review_cloud_G10_0.log @@ -0,0 +1,103 @@ + + +# 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. +> If blocked, record exact blocker, attempted commands/output, and resume condition only. +> Do not ask the user, call user-input tools, classify the next state, archive files, or write `complete.log`. +> Finalization is review-agent-only. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/15+13_chat_gate, plan=0, tag=API + +## For the Review Agent + +> **[REVIEW AGENT ONLY]** Compare implementation/output against the plan. Implementers must not finalize. + +1. Append verdict and routing signals. +2. Archive `CODE_REVIEW-cloud-G10.md` → `code_review_cloud_G10_0.log` and `PLAN-cloud-G09.md` → `plan_cloud_G09_0.log`. +3. If PASS, write `complete.log` and move to `agent-task/archive/YYYY/MM/m-iop-hot-path-one-shot-execution/15+13_chat_gate/`; otherwise write the directed next state. +4. Preserve/report `milestone-task=terminal-control,chat-gate` on PASS. +5. Complete the review-only checklist at the final location. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Pi-compatible Chat codec integration | [ ] | +| API-2 Fragmented Chat evidence | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Encode the shared Hot Path outer turn as one Chat response/SSE stream with stable public tool ids, continuation correlation, finish reason, and `[DONE]`. +- [ ] [API-2] Add fragmented direct/light/tool/error handler fixtures and run targeted plus SDD common verification. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append one PASS/WARN/FAIL verdict and verified routing signals. +- [ ] Verify verdict, dimensions, and finding classifications match. +- [ ] Archive `CODE_REVIEW-cloud-G10.md` to `code_review_cloud_G10_0.log`. +- [ ] Archive `PLAN-cloud-G09.md` to `plan_cloud_G09_0.log`. +- [ ] Verify the `.gitignore` managed block. +- [ ] On PASS write standard `complete.log` and leave no active `.md` files. +- [ ] On PASS move the task directory to dated archive and update this checklist there. +- [ ] On PASS preserve/report `milestone-task=terminal-control,chat-gate` without editing roadmap directly. +- [ ] Remove active parent only if empty. +- [ ] On WARN/FAIL write the next state and no `complete.log`. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Verify normalized and fragmented tunnel inputs produce one role start, ordered reasoning/content/tool fragments, stable public ids/indices. +- Verify effective output cap is applied once across the public response and usage is aggregated without duplication. +- Verify one finish chunk plus one `[DONE]`, model echo, usage, continuation, and error rules. +- Verify no internal response/provider/stage ids leak. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathChat|TestChatCompletionsStream|TestChatStreamSession'` + +_Paste actual stdout/stderr and exit status._ + +### SDD common + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING]** Fill every implementation-owned section and leave review-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---|---|---| +| Header, Overview, Review Agent Instructions | Fixed | Implementer must not modify or finalize | +| Implementation Item Completion, Implementation Checklist | Implementer checks only | Text/order stays fixed | +| Review-Only Checklist | Review agent | Implementer must not modify | +| Deviations, Key Design Decisions | Implementer | Record actual content | +| Reviewer Checkpoints | Fixed | Reviewer verifies | +| Verification Results | Implementer fills output | Command changes require deviation | +| Code Review Result | Review agent appends | Not included in stub | diff --git a/agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/plan_cloud_G09_0.log b/agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/plan_cloud_G09_0.log new file mode 100644 index 00000000..75bca5e8 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/plan_cloud_G09_0.log @@ -0,0 +1,138 @@ + + +# OpenAI Chat Hot Path stream gate + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G10.md` 구현 담당 섹션에 실제 변경·검증 출력을 채우고 active 파일을 유지한다. 차단 시 정확한 blocker/명령/출력/재개 조건만 기록하고 사용자 질문, archive, `complete.log` 작성은 하지 않는다. + +## Background + +Chat preset 경로는 provider stage를 완전히 수집한 뒤 OpenAI response를 만든다. 선행 terminal-control event를 Pi-compatible Chat SSE로 변환해 stage 전이와 tool result continuation을 같은 logical request에 연결해야 한다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `apps/edge/internal/openai/chat_handler.go` +- `apps/edge/internal/openai/normalized_sse.go` +- `apps/edge/internal/openai/hot_path_dispatch.go` +- `apps/edge/internal/openai/hot_path_direct.go` +- `apps/edge/internal/openai/chat_stream_session_test.go` +- `apps/edge/internal/openai/chat_stream_reasoning_test.go` +- `agent-contract/outer/openai-compatible-api.md` +- `agent-test/local/rules.md` +- `agent-test/local/edge-smoke.md` + +### SDD Criteria + +- 승인 SDD, `milestone-task=terminal-control,chat-gate`, S10/S12. +- Evidence Map S12의 fragmented SSE/tool_calls/error fixture와 handler integration을 그대로 test rows로 사용한다. public model, delta ordering, finish_reason, `[DONE]`, continuation correlation이 완료 oracle이다. +- 이 packet의 live codec, usage/output-cap, single-envelope evidence는 S10의 production Chat 절반에도 기여한다. + +### Verification Context + +- handoff 없음. local edge profile과 fresh race tests 적용. repo/branch/HEAD=`/config/workspace/iop-s0`, `feature/iop-hot-path-one-shot-execution`, `6650e9f70d0104220d8077dd1d469b6a1facb9da`. +- 실제 Pi smoke는 packet 17에서 수행하므로 이 packet은 deterministic handler fixtures로 닫힌다. + +### Test Coverage Gaps + +- 기존 Chat tests는 ordinary stream reasoning/tool synthesis를 다루나 preset multi-stage outer chunk, id remap, continuation, pre/post-commit error를 다루지 않는다. + +### Symbol References + +- rename/remove 없음. preset-only codec adapter를 추가한다. + +### Split Judgment + +- stable contract: normalized outer-turn event → OpenAI Chat SSE/JSON wire. +- predecessor 13 (`13+12_outer_turn_integration`) active `complete.log`는 현재 missing이며 구현 전에 필요하다. +- Anthropic wire는 sibling 13과 독립이다. + +### Scope Rationale + +- common sequencer, Anthropic encoding, 전체 error/cancel matrix, metrics, actual Pi 실행은 제외한다. + +### Final Routing + +- evaluation_mode=write, finalizer=`finalize-task-policy.sh pair`. +- build closures 모두 true, scores=2/2/2/1/2, G09, grade-boundary → `PLAN-cloud-G09.md`. +- review closures 모두 true, scores=2/2/2/2/2, G10, official-review → `CODE_REVIEW-cloud-G10.md`. +- `large_indivisible_context=false`; risks=`temporal_state,boundary_contract,structured_interpretation,variant_product`(4); recovery=0/false; capability gap 없음. + +## Implementation Checklist + +- [ ] [API-1] Encode the shared Hot Path outer turn as one Chat response/SSE stream with stable public tool ids, continuation correlation, finish reason, and `[DONE]`. +- [ ] [API-2] Add fragmented direct/light/tool/error handler fixtures and run targeted plus SDD common verification. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Pi-compatible Chat codec integration + +**Problem:** `apps/edge/internal/openai/chat_handler.go:371` calls `collectPresetSelectorResult` and only later dispatches a completed stage; `normalized_sse.go:16` handles ordinary `RunResult`, not Hot Path outer events. + +**Solution:** Implement the predecessor `hotPathStageEventDecoder`/`hotPathOuterCodec` in `normalized_sse.go` for normalized RunEvent and fragmented OpenAI tunnel SSE/JSON. Emit one assistant role chunk, ordered reasoning/content deltas, `delta.tool_calls` fragments with remapped index/id/name/arguments, then exactly one chunk with outer `finish_reason` and aggregate usage followed by `[DONE]`. The handler creates it before preset dispatch, preserves caller model id/request correlation, derives the public output cap from effective `max_tokens`/`max_completion_tokens`, and maps pre-commit errors to JSON versus post-commit errors to the established SSE error shape without a success terminal. + +Before (`chat_handler.go:371`): + +```go +stage, gate, collectErr := s.collectPresetSelectorResult(...) +return s.dispatchPresetTurn(..., stage, gate) +``` + +After: + +```go +turn := newOpenAIHotPathTurn(w, flusher, req.Model, requestID) +return s.runPresetOuterTurn(r.Context(), turn, dispatch) +``` + +**Modified Files and Checklist:** + +- [ ] Modify `apps/edge/internal/openai/chat_handler.go` to instantiate the codec, pass correlation/effective public output cap/output policy, and select pre/post-commit error handling. +- [ ] Modify `apps/edge/internal/openai/normalized_sse.go` to decode normalized/tunnel events and encode Hot Path outer events plus one terminal/`[DONE]` pair. + +**Test Strategy:** API-2 adds wire integration coverage; retain ordinary Chat stream tests. + +**Verification:** `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathChat|TestChatCompletionsStream|TestChatStreamSession'` exits 0. + +### [API-2] Fragmented Chat evidence + +**Problem:** No S12 preset fixture checks fragmented tool arguments or multi-stage SSE. + +**Solution:** Feed fragmented normalized and tunnel provider frames for direct reasoning/content, light local→review, tool_calls plus next-request tool result, error before commit, and error after visible delta. Decode each public `data:` record and assert exact chunk order, stable public tool id/index, public model id, aggregate usage, one finish reason, one `[DONE]`, and no bytes after terminal. + +**Modified Files and Checklist:** + +- [ ] Add `apps/edge/internal/openai/hot_path_chat_gate_test.go` with `TestHotPathChatFragmentedStream`, `TestHotPathChatToolContinuation`, and `TestHotPathChatErrorShape`. +- [ ] Fill `agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/CODE_REVIEW-cloud-G10.md`. + +**Test Strategy:** New integration tests mandatory; fail on nested role/response id, raw provider tool id, duplicate finish/`[DONE]`, or post-error success terminal. + +**Verification:** run Final Verification; parsed chunk arrays match and all commands exit 0. + +## Dependencies and Execution Order + +1. `13+12_outer_turn_integration` must produce `agent-task/m-iop-hot-path-one-shot-execution/13+12_outer_turn_integration/complete.log` before implementation. +2. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/chat_handler.go` | API-1 | +| `apps/edge/internal/openai/normalized_sse.go` | API-1 | +| `apps/edge/internal/openai/hot_path_chat_gate_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/CODE_REVIEW-cloud-G10.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathChat|TestChatCompletionsStream|TestChatStreamSession' +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: exit 0, exact Pi-compatible order, no race/raw internal id/duplicate terminal, empty diff check. Cached output is not acceptable. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/CODE_REVIEW-cloud-G10.md b/agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/CODE_REVIEW-cloud-G10.md new file mode 100644 index 00000000..e54ac3ee --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/CODE_REVIEW-cloud-G10.md @@ -0,0 +1,75 @@ + + +# Code Review Reference - API + +> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is mandatory.** Fill implementation-owned evidence and stop with active files. Review finalization is review-agent-only. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition, plan=2, tag=API + +## Archive Evidence Snapshot + +- Plan/review 1 was superseded before implementation; it contains no implementation verdict/evidence. + +## For the Review Agent + +Verify source and race evidence, archive to `code_review_cloud_G10_2.log` and `plan_cloud_G09_2.log`, then finalize by verdict. Preserve `milestone-task=error-cancel` on PASS. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Disposition and cancellation ownership | [ ] | +| API-2 Terminal race evidence | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Normalize terminal dispositions and wire one exact active-stage cancellation/cleanup handoff across direct/light transitions. +- [ ] [API-2] Add cancel/timeout/error/length/tool/success race and exact-target regression evidence. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append verdict/routing signals and verify findings/dimensions. +- [ ] Archive review/plan to suffix `2`; verify `.gitignore` managed block. +- [ ] On PASS write `complete.log`, preserve metadata, archive child; on WARN/FAIL write directed state without completion. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Confirm closed dispositions and exactly one winner under cancel/complete/error/cap races. +- Confirm cancellation targets only the exact current stage once and stale stage handles/callbacks are ignored. +- Confirm caller cancel is wire-silent and cleanup/orphan receives one typed terminal responsibility. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(TerminalDisposition|ActiveStageCancel|CancelCompleteRace|Cleanup)'` + +_Paste actual stdout/stderr and exit status._ + +### Common regression + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +## Section Ownership + +Implementer owns completion status, deviations, decisions, and outputs. Reviewer alone owns review-only actions and final result. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/PLAN-cloud-G09.md b/agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/PLAN-cloud-G09.md new file mode 100644 index 00000000..30c93996 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/PLAN-cloud-G09.md @@ -0,0 +1,130 @@ + + +# Hot Path terminal disposition and active-stage cancellation + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G10.md`의 구현 담당 섹션에 실제 변경·검증 출력을 채우고 active 파일을 유지한다. 차단 시 정확한 blocker와 재개 조건만 기록하며 archive/`complete.log` 작성이나 상태 판정은 하지 않는다. + +## Background + +Child 12는 stage runtime/source control을, child 14/15는 caller codec을 제공한다. 이 child는 공통 terminal disposition을 닫고 cancellation이 현재 active provider run 하나에만 정확히 전달되도록 lifecycle과 cleanup 책임을 연결한다. + +## Archive Evidence Snapshot + +- 이전 active plan/review pair는 구현 전에 source reanalysis로 대체됐다. 구현 evidence와 verdict는 없다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `apps/edge/internal/openai/hot_path_dispatch.go` +- `apps/edge/internal/openai/hot_path_direct.go` +- `apps/edge/internal/openai/hot_path_light.go` +- `apps/edge/internal/openai/hot_path_cleanup.go` +- `packages/go/streamgate/runtime.go` +- `packages/go/streamgate/terminal.go` +- `agent-contract/inner/edge-node-runtime-wire.md` +- `agent-test/local/rules.md` + +### SDD Criteria + +- 승인 SDD S10/S13: success/tool_turn/length/provider_error/validation_error/timeout/caller_cancel의 typed ownership, one winner, exact active `CancelRun`, silent caller-cancel wire, cleanup/orphan continuation. + +### Verification Context + +- fake active-stage controller, barriers, canceled contexts, fresh race tests로 닫는다. + +### Test Coverage Gaps + +- active handle 교체와 cancel target 정확성, cancel-vs-terminal race, disposition→cleanup handoff를 한 lifecycle에서 검증하지 않는다. + +### Symbol References + +- public rename/remove 없음. Predecessor core의 internal stage controller/terminal evidence를 확장한다. + +### Split Judgment + +- stable contract: stage outcomes/context → one typed outer disposition + exact active cancellation. Endpoint-specific bytes/status mapping은 child 17이다. + +### Scope Rationale + +- endpoint error body matrix, observation schema, external smoke는 제외한다. + +### Final Routing + +- evaluation_mode=isolated-reassessment, finalizer=`finalize-task-policy.sh pair`. +- build scores=2/2/2/1/2, risks=`temporal_state,concurrent_consistency,boundary_contract,variant_product`(4), grade-boundary → `PLAN-cloud-G09.md`. +- review → `CODE_REVIEW-cloud-G10.md`; `large_indivisible_context=false`, recovery=0/false. + +## Implementation Checklist + +- [ ] [API-1] Normalize terminal dispositions and wire one exact active-stage cancellation/cleanup handoff across direct/light transitions. +- [ ] [API-2] Add cancel/timeout/error/length/tool/success race and exact-target regression evidence. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Disposition and cancellation ownership + +**Problem:** current provider handles are collector-local, caller cancellation disconnects the request but does not reliably target the exact active run, and stage/outer terminals can race. + +**Solution:** Define a closed internal disposition set (`success`, `tool_turn`, `length`, `provider_error`, `validation_error`, `timeout`, `caller_cancel`) with cause/source/stage ownership. Extend the outer turn with an atomic active-stage controller registration that replaces only after prior-stage closure. On timeout/caller cancel, win the terminal guard once, invoke `CancelRun(CANCEL_RUN)` on the exact active controller once, suppress caller-cancel endpoint bytes, and pass typed terminal intent to existing cleanup/orphan handling. Ignore stale stage callbacks and duplicate terminal attempts. + +**Modified Files and Checklist:** + +- [ ] Modify `apps/edge/internal/openai/hot_path_terminal_control.go` with closed dispositions, winner election, active-stage controller registration, and stale-generation guards. +- [ ] Modify `apps/edge/internal/openai/hot_path_stage_stream.go` to expose exact cancel control and terminal cause without owning endpoint policy. +- [ ] Modify `apps/edge/internal/openai/hot_path_dispatch.go` to register/unregister stage controllers and translate dispatch/validation failure. +- [ ] Modify `apps/edge/internal/openai/hot_path_light.go` to replace active control safely across local/review/repair. +- [ ] Modify `apps/edge/internal/openai/hot_path_cleanup.go` to consume typed terminal intent for cleanup/orphan responsibility. + +**Test Strategy:** barrier-controlled two-stage fake runs expose stale handles and cancel/complete races. + +**Verification:** targeted API-2 command exits 0. + +### [API-2] Terminal race evidence + +**Problem:** no exact oracle proves one disposition winner and one active provider cancellation. + +**Solution:** Add every disposition, pre/post-stage replacement cancellation, timeout, cancel-vs-complete, provider-error-vs-cap, duplicate callback, stale handle, cleanup failure, and orphan handoff rows. Assert exact cancellation target/count, no post-terminal stage/write, and one cleanup owner. + +**Modified Files and Checklist:** + +- [ ] Extend `apps/edge/internal/openai/hot_path_terminal_control_test.go` with disposition, active-controller, and race cases. +- [ ] Extend `apps/edge/internal/openai/hot_path_cleanup_test.go` with typed terminal cleanup/orphan cases. +- [ ] Record actual output in `agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/CODE_REVIEW-cloud-G10.md`. + +**Test Strategy:** exact trace and invocation counts are the oracle; run under race detector. + +**Verification:** run Final Verification; all commands exit 0 without race. + +## Dependencies and Execution Order + +1. Directory dependency `14` must produce `agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/complete.log`. +2. Directory dependency `15` must produce `agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/complete.log`. +3. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/hot_path_terminal_control.go` | API-1 | +| `apps/edge/internal/openai/hot_path_stage_stream.go` | API-1 | +| `apps/edge/internal/openai/hot_path_dispatch.go` | API-1 | +| `apps/edge/internal/openai/hot_path_light.go` | API-1 | +| `apps/edge/internal/openai/hot_path_cleanup.go` | API-1 | +| `apps/edge/internal/openai/hot_path_terminal_control_test.go` | API-2 | +| `apps/edge/internal/openai/hot_path_cleanup_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/CODE_REVIEW-cloud-G10.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(TerminalDisposition|ActiveStageCancel|CancelCompleteRace|Cleanup)' +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: exit 0, one typed disposition winner, one exact active `CancelRun`, silent caller cancel, deterministic cleanup/orphan ownership, no race. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/code_review_cloud_G10_0.log b/agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/code_review_cloud_G10_0.log new file mode 100644 index 00000000..e6c8713c --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/code_review_cloud_G10_0.log @@ -0,0 +1,103 @@ + + +# 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. +> If blocked, record exact blocker, attempted commands/output, and resume condition only. +> Do not ask the user, call user-input tools, classify the next state, archive files, or write `complete.log`. +> Finalization is review-agent-only. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/15+13,14_error_cancel, plan=0, tag=API + +## For the Review Agent + +> **[REVIEW AGENT ONLY]** Compare implementation/output against the plan. Implementers must not finalize. + +1. Append verdict and routing signals. +2. Archive `CODE_REVIEW-cloud-G10.md` → `code_review_cloud_G10_0.log` and `PLAN-cloud-G09.md` → `plan_cloud_G09_0.log`. +3. If PASS, write `complete.log` and move to `agent-task/archive/YYYY/MM/m-iop-hot-path-one-shot-execution/15+13,14_error_cancel/`; otherwise write the directed next state. +4. Preserve/report `milestone-task=error-cancel` on PASS. +5. Complete the review-only checklist at the final location. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Standard terminal disposition | [ ] | +| API-2 Endpoint outcome matrix | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Centralize Hot Path terminal disposition so provider/config/context/timeout/cancel/output-cap outcomes stop hidden work and map to each endpoint's standard pre/post-commit shape exactly once. +- [ ] [API-2] Add the endpoint-by-outcome table and concurrent cancel/complete regressions, then run targeted plus SDD common verification. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append one PASS/WARN/FAIL verdict and verified routing signals. +- [ ] Verify verdict, dimensions, and finding classifications match. +- [ ] Archive `CODE_REVIEW-cloud-G10.md` to `code_review_cloud_G10_0.log`. +- [ ] Archive `PLAN-cloud-G09.md` to `plan_cloud_G09_0.log`. +- [ ] Verify the `.gitignore` managed block. +- [ ] On PASS write standard `complete.log` and leave no active `.md` files. +- [ ] On PASS move the task directory to dated archive and update this checklist there. +- [ ] On PASS preserve/report `milestone-task=error-cancel` without editing roadmap directly. +- [ ] Remove active parent only if empty. +- [ ] On WARN/FAIL write the next state and no `complete.log`. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Verify endpoint×commit-state×failure-source matrix uses only standard error/cancel/length meanings. +- Verify primary-error precedence, exactly-one terminal, CancelRun cardinality, and no hidden work after abort. +- Verify the exact active stage dispatch/cancel handle reaches the arbiter and endpoint codecs own post-commit error bytes. +- Verify output cap is native length terminal and no partial-success status exists. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(EndpointTerminalMatrix|CancelCompleteRace|Cleanup)|Test(ChatCompletion|Responses|StreamChatCompletion).*(Cancel|Timeout)'` + +_Paste actual stdout/stderr and exit status._ + +### SDD common + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING]** Fill every implementation-owned section and leave review-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---|---|---| +| Header, Overview, Review Agent Instructions | Fixed | Implementer must not modify or finalize | +| Implementation Item Completion, Implementation Checklist | Implementer checks only | Text/order stays fixed | +| Review-Only Checklist | Review agent | Implementer must not modify | +| Deviations, Key Design Decisions | Implementer | Record actual content | +| Reviewer Checkpoints | Fixed | Reviewer verifies | +| Verification Results | Implementer fills output | Command changes require deviation | +| Code Review Result | Review agent appends | Not included in stub | diff --git a/agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/code_review_cloud_G10_1.log b/agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/code_review_cloud_G10_1.log new file mode 100644 index 00000000..a29e40bb --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/code_review_cloud_G10_1.log @@ -0,0 +1,100 @@ + + +# 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. +> 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. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition, plan=1, tag=API + +## For the Review Agent + +1. Append verdict and routing signals. +2. Archive `CODE_REVIEW-cloud-G10.md` → `code_review_cloud_G10_1.log` and `PLAN-cloud-G09.md` → `plan_cloud_G09_1.log`. +3. On PASS write `complete.log` and move to `agent-task/archive/YYYY/MM/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/`; otherwise write the directed next state. +4. Preserve/report `milestone-task=error-cancel` on PASS. +5. Complete the review-only checklist at the final location. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Typed disposition and terminal arbiter | [ ] | +| API-2 Common terminal evidence | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Centralize typed Hot Path terminal disposition and exactly-once ownership so current work is canceled precisely and no hidden stage runs after terminal. +- [ ] [API-2] Add common disposition, cleanup precedence, and concurrent cancel/complete regressions and run the child verification commands. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure`. +- [ ] Verify verdict, dimension assessment, and Required/Suggested/Nit classifications match. +- [ ] Archive the active review to `code_review_cloud_G10_1.log`. +- [ ] Archive the active plan to `plan_cloud_G09_1.log`. +- [ ] Verify the Agent-Ops managed block in `.gitignore`. +- [ ] If PASS, write `complete.log` from the standard template and leave no active `.md` files. +- [ ] If PASS, move the task directory to the dated archive and update this checklist at the final location. +- [ ] If PASS, preserve/report `milestone-task=error-cancel` without directly editing the roadmap. +- [ ] If PASS, remove the active parent only when no siblings/files remain. +- [ ] If WARN/FAIL, write the next filesystem state and do not write `complete.log`. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Verify the disposition enum, exact active-stage handle, terminal CAS, and cleanup primary-error precedence. +- Verify one `CancelRun`, no post-terminal event, and no repair/cleanup dispatch after terminal ownership is lost. +- Verify endpoint wire mapping remains outside this child. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(CancelCompleteRace|Cleanup|TerminalDisposition)'` + +_Paste actual stdout/stderr and exit status._ + +### SDD common + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING]** Fill every implementation-owned section and leave review-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---|---|---| +| Header, Overview, Review Agent Instructions | Fixed | Implementer must not finalize | +| Implementation Item Completion, Implementation Checklist | Implementer checks only | Text/order stays fixed | +| Review-Only Checklist | Review agent | Implementer must not modify | +| Deviations, Key Design Decisions | Implementer | Record actual content | +| Reviewer Checkpoints | Fixed | Reviewer verifies | +| Verification Results | Implementer fills output | Command changes require deviation | +| Code Review Result | Review agent appends | Not included in stub | diff --git a/agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/plan_cloud_G09_0.log b/agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/plan_cloud_G09_0.log new file mode 100644 index 00000000..8c87f132 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/plan_cloud_G09_0.log @@ -0,0 +1,149 @@ + + +# Hot Path endpoint error, cancel, and length semantics + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G10.md`의 구현 담당 섹션과 실제 출력까지 채우고 active 파일을 유지한다. 차단 시 blocker/명령/출력/재개 조건만 기록하며 사용자 질문, 상태 판정, archive, `complete.log` 작성은 금지한다. + +## Background + +Cleanup은 primary error precedence와 caller cancellation을 갖지만 새 outer stream 및 양 endpoint codec 전체의 error/cancel/length 조합은 아직 하나의 표준 의미로 닫히지 않는다. 이 packet은 custom partial-success 없이 pre/post-commit endpoint 결과와 hidden work 중단을 일치시킨다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `apps/edge/internal/openai/hot_path_cleanup.go` +- `apps/edge/internal/openai/hot_path_dispatch.go` +- `apps/edge/internal/openai/hot_path_light.go` +- `apps/edge/internal/openai/anthropic_handler.go` +- `apps/edge/internal/openai/anthropic_stream.go` +- `apps/edge/internal/openai/chat_handler.go` +- `apps/edge/internal/openai/normalized_sse.go` +- `apps/edge/internal/openai/server.go` +- `apps/edge/internal/openai/hot_path_cleanup_test.go` +- `apps/edge/internal/openai/cancellation_routes_test.go` +- `apps/edge/internal/openai/chat_stream_session_test.go` +- `agent-contract/outer/openai-compatible-api.md` +- `agent-contract/outer/anthropic-compatible-api.md` +- `agent-test/local/rules.md` +- `agent-test/local/edge-smoke.md` + +### SDD Criteria + +- 승인 SDD, `milestone-task=error-cancel`, S13. +- Evidence Map S13의 endpoint별 error/cancel/length table을 구현 단위로 사용한다. primary error 보존, cleanup best effort, abort 후 no hidden call, length terminal과 no partial-success가 oracle이다. + +### Verification Context + +- handoff 없음. local edge profile, fresh race tests. repo/branch/HEAD=`/config/workspace/iop-s0`, `feature/iop-hot-path-one-shot-execution`, `6650e9f70d0104220d8077dd1d469b6a1facb9da`. +- fault fixtures로 모든 경로를 결정적으로 재현하므로 외부 runtime은 필요 없다. + +### Test Coverage Gaps + +- cleanup tests는 primary error/concurrency를 검증하지만 endpoint×commit-state×failure-source matrix, output-cap length terminal, 양 protocol wire terminal은 빠져 있다. + +### Symbol References + +- rename/remove 없음. predecessor codec의 error/terminal hook을 확장한다. + +### Split Judgment + +- stable contract: common terminal disposition → endpoint-standard pre/post-commit result. +- predecessors 13과 14의 active `complete.log`는 현재 missing이며 둘 다 구현 전에 필요하다. + +### Scope Rationale + +- 새 status/type을 만들지 않는다. observability field와 live agent smoke는 16/17로 제외한다. + +### Final Routing + +- evaluation_mode=write, finalizer=`finalize-task-policy.sh pair`. +- build closures 모두 true, scores=2/2/2/1/2, G09, grade-boundary → `PLAN-cloud-G09.md`. +- review closures 모두 true, scores=2/2/2/2/2, G10, official-review → `CODE_REVIEW-cloud-G10.md`. +- `large_indivisible_context=false`; risks=`temporal_state,concurrent_consistency,boundary_contract,structured_interpretation,variant_product`(5); recovery=0/false; capability gap 없음. + +## Implementation Checklist + +- [ ] [API-1] Centralize Hot Path terminal disposition so provider/config/context/timeout/cancel/output-cap outcomes stop hidden work and map to each endpoint's standard pre/post-commit shape exactly once. +- [ ] [API-2] Add the endpoint-by-outcome table and concurrent cancel/complete regressions, then run targeted plus SDD common verification. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Standard terminal disposition + +**Problem:** `hot_path_cleanup.go:267` writes a completed terminal intent, while handler collection errors call endpoint writers separately. With progressive release, commit state determines the legal wire error and cancellation must prevent later repair/cleanup dispatch. + +**Solution:** Add a typed internal disposition (`success`, `tool_turn`, `length`, `provider_error`, `validation_error`, `timeout`, `caller_cancel`) consumed by the common outer turn and endpoint codecs. Propagate the active stage dispatch/cancel function from `submitHotPathStage` through local/review execution so the terminal arbiter can atomically win once, cancel the exact in-flight stage, and call `CancelRun` only for dispatched active work. Caller cancel writes no further bytes and detaches state; timeout/provider/context error preserve primary error through permissible cleanup; output cap commits native length semantics, not an error or partial success. Endpoint codecs, rather than handlers alone, own the post-commit wire error. + +Before (`hot_path_cleanup.go:267`): + +```go +func (s *Server) writeHotPathTerminal(..., terminal hotPathTerminalIntent) error +``` + +After: + +```go +func (s *Server) finishHotPathTurn(ctx context.Context, turn *hotPathOuterTurn, disposition hotPathDisposition) error +``` + +**Modified Files and Checklist:** + +- [ ] Modify `apps/edge/internal/openai/hot_path_cleanup.go` to produce typed dispositions and preserve primary-error/cleanup ordering. +- [ ] Modify `apps/edge/internal/openai/hot_path_terminal_control.go` to atomically arbitrate terminal, cancel current stage, and reject post-terminal events. +- [ ] Modify `apps/edge/internal/openai/hot_path_dispatch.go` and `apps/edge/internal/openai/hot_path_light.go` to retain the exact active dispatch/cancel handle and stop subsequent stage/repair/cleanup work after terminal ownership is lost. +- [ ] Modify `apps/edge/internal/openai/anthropic_handler.go`, `anthropic_stream.go`, `chat_handler.go`, and `normalized_sse.go` so all preset terminal outcomes delegate to the common disposition and each codec owns its standard post-commit shape. + +**Test Strategy:** API-2 supplies the cross-product; retain cleanup and ordinary cancellation tests. + +**Verification:** `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(EndpointTerminalMatrix|CancelCompleteRace|Cleanup)'` exits 0. + +### [API-2] Endpoint outcome matrix + +**Problem:** No single test proves S13 across both endpoints and response commit states. + +**Solution:** Table over endpoint `{anthropic,openai}`, response `{uncommitted,committed}`, source `{write-unavailable,provider-error,context-error,timeout,cancel,output-cap}`, stage `{selector,local,review,cleanup}`. Assert exact HTTP/SSE event type/finish reason, primary error precedence, zero custom partial status, one CancelRun when warranted, no hidden follow-up after abort, and one terminal winner under barriers. + +**Modified Files and Checklist:** + +- [ ] Add `apps/edge/internal/openai/hot_path_error_cancel_test.go` with `TestHotPathEndpointTerminalMatrix` and `TestHotPathCancelCompleteRace`. +- [ ] Fill `agent-task/m-iop-hot-path-one-shot-execution/15+13,14_error_cancel/CODE_REVIEW-cloud-G10.md`. + +**Test Strategy:** New table/race tests mandatory. Exact wire assertions must use existing contract status/type names; forbid `partial_success`, `review_unavailable`, or `repair_limit`. + +**Verification:** run Final Verification; all rows and race detector pass. + +## Dependencies and Execution Order + +1. `13+12_anthropic_gate` must produce its active `complete.log`. +2. `14+12_chat_gate` must produce its active `complete.log`. +3. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/hot_path_cleanup.go` | API-1 | +| `apps/edge/internal/openai/hot_path_terminal_control.go` | API-1 | +| `apps/edge/internal/openai/hot_path_dispatch.go` | API-1 | +| `apps/edge/internal/openai/hot_path_light.go` | API-1 | +| `apps/edge/internal/openai/anthropic_handler.go` | API-1 | +| `apps/edge/internal/openai/anthropic_stream.go` | API-1 | +| `apps/edge/internal/openai/chat_handler.go` | API-1 | +| `apps/edge/internal/openai/normalized_sse.go` | API-1 | +| `apps/edge/internal/openai/hot_path_error_cancel_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/15+13,14_error_cancel/CODE_REVIEW-cloud-G10.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(EndpointTerminalMatrix|CancelCompleteRace|Cleanup)|Test(ChatCompletion|Responses|StreamChatCompletion).*(Cancel|Timeout)' +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: exit 0, no race/custom partial status/post-cancel dispatch, exactly one native terminal, empty diff check. Cached output is not acceptable. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/plan_cloud_G09_1.log b/agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/plan_cloud_G09_1.log new file mode 100644 index 00000000..08e73f2f --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/plan_cloud_G09_1.log @@ -0,0 +1,124 @@ + + +# Hot Path common terminal disposition + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G10.md`의 구현 담당 섹션과 실제 출력을 채우고 active 파일을 유지한다. 차단 시 blocker/명령/출력/재개 조건만 기록하며 사용자 질문, archive, `complete.log` 작성은 금지한다. + +## Background + +Outer stream은 cleanup primary-error precedence와 endpoint codec을 함께 사용하지만 terminal/cancel/length outcome을 결정하는 공통 ownership과 active-stage cancellation이 아직 닫히지 않았다. 이 child는 wire mapping과 분리된 typed disposition과 exactly-once arbiter를 만든다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `apps/edge/internal/openai/hot_path_cleanup.go` +- `apps/edge/internal/openai/hot_path_terminal_control.go` +- `apps/edge/internal/openai/hot_path_dispatch.go` +- `apps/edge/internal/openai/hot_path_light.go` +- `apps/edge/internal/openai/hot_path_cleanup_test.go` +- `apps/edge/internal/openai/cancellation_routes_test.go` +- `agent-test/local/rules.md` + +### SDD Criteria + +- 승인 SDD, `milestone-task=error-cancel`, S13. +- primary error 보존, cleanup best effort, abort 후 no hidden call, output-cap length disposition, exactly-one terminal owner가 이 child의 oracle이다. + +### Verification Context + +- fault fixtures와 fresh race tests로 닫으며 외부 runtime은 필요하지 않다. + +### Test Coverage Gaps + +- exact active stage cancel handle, concurrent cancel/complete winner, post-terminal dispatch suppression을 함께 검증하는 common fixture가 없다. + +### Symbol References + +- public rename/remove 없음. internal disposition과 arbiter만 추가한다. + +### Split Judgment + +- stable contract: failure/cancel/output-cap source → common typed disposition and terminal ownership. +- endpoint pre/post-commit wire matrix는 child 17로 분리한다. +- endpoint codec predecessors 14/15가 모두 필요하다. + +### Scope Rationale + +- endpoint-specific bytes/status table, observability, smoke는 제외한다. + +### Final Routing + +- evaluation_mode=isolated-reassessment, finalizer=`finalize-task-policy.sh pair`. +- build closures 모두 true, scores=2/2/2/1/2, G09, grade-boundary → `PLAN-cloud-G09.md`. +- review closures 모두 true, scores=2/2/2/2/2, G10, official-review → `CODE_REVIEW-cloud-G10.md`. +- risks=`temporal_state,concurrent_consistency,boundary_contract,variant_product`(4), `large_indivisible_context=false`, recovery=0/false, capability gap 없음. + +## Implementation Checklist + +- [ ] [API-1] Centralize typed Hot Path terminal disposition and exactly-once ownership so current work is canceled precisely and no hidden stage runs after terminal. +- [ ] [API-2] Add common disposition, cleanup precedence, and concurrent cancel/complete regressions and run the child verification commands. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Typed disposition and terminal arbiter + +**Problem:** cleanup returns terminal intent while handler errors and progressive streams can independently race to finish or cancel. + +**Solution:** Introduce internal dispositions `success`, `tool_turn`, `length`, `provider_error`, `validation_error`, `timeout`, and `caller_cancel`. Propagate the exact active dispatch/cancel handle from `submitHotPathStage`; atomically select one terminal owner, cancel only active dispatched work, preserve primary error through cleanup, reject post-terminal events, and stop later review/repair/cleanup dispatch after ownership is lost. + +**Modified Files and Checklist:** + +- [ ] Modify `apps/edge/internal/openai/hot_path_cleanup.go` to produce typed dispositions and preserve primary-error/cleanup ordering. +- [ ] Modify `apps/edge/internal/openai/hot_path_terminal_control.go` to arbitrate terminal ownership and current-stage cancellation. +- [ ] Modify `apps/edge/internal/openai/hot_path_dispatch.go` and `apps/edge/internal/openai/hot_path_light.go` to retain exact active handles and stop hidden follow-up work. + +**Test Strategy:** API-2 covers disposition and race behavior independent of endpoint wire bytes. + +**Verification:** `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(CancelCompleteRace|Cleanup|TerminalDisposition)'` exits 0. + +### [API-2] Common terminal evidence + +**Problem:** existing cleanup tests do not prove the common terminal winner and cancellation cardinality. + +**Solution:** Use barrier-controlled cancellation/completion and failure-source rows. Assert primary error precedence, one `CancelRun` when warranted, no post-terminal emission or follow-up stage, cleanup best effort, and native length disposition without wire-specific assertions. + +**Modified Files and Checklist:** + +- [ ] Add `apps/edge/internal/openai/hot_path_error_cancel_test.go` with `TestHotPathTerminalDisposition` and `TestHotPathCancelCompleteRace`. +- [ ] Fill `agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/CODE_REVIEW-cloud-G10.md`. + +**Test Strategy:** new race rows plus existing cleanup/cancellation regressions are mandatory. + +**Verification:** run Final Verification; all commands exit 0 and race detector passes. + +## Dependencies and Execution Order + +1. `14+13_anthropic_gate` must produce its active `complete.log`. +2. `15+13_chat_gate` must produce its active `complete.log`. +3. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/hot_path_cleanup.go` | API-1 | +| `apps/edge/internal/openai/hot_path_terminal_control.go` | API-1 | +| `apps/edge/internal/openai/hot_path_dispatch.go` | API-1 | +| `apps/edge/internal/openai/hot_path_light.go` | API-1 | +| `apps/edge/internal/openai/hot_path_error_cancel_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/CODE_REVIEW-cloud-G10.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(CancelCompleteRace|Cleanup|TerminalDisposition)' +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: exit 0, exactly one terminal owner, precise active-work cancellation, no hidden follow-up, no race, empty diff check. Cached output is not acceptable. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/CODE_REVIEW-cloud-G10.md b/agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/CODE_REVIEW-cloud-G10.md new file mode 100644 index 00000000..ccb3e69b --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/CODE_REVIEW-cloud-G10.md @@ -0,0 +1,75 @@ + + +# Code Review Reference - API + +> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is mandatory.** Fill implementation-owned evidence and leave active files in place. Verdict/finalization is review-agent-only. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix, plan=1, tag=API + +## Archive Evidence Snapshot + +- Plan/review 0 was superseded before implementation; it contains no implementation verdict/evidence. + +## For the Review Agent + +Verify the complete scoped matrix, archive to `code_review_cloud_G10_1.log` and `plan_cloud_G09_1.log`, then finalize by verdict. Preserve `milestone-task=error-cancel` on PASS. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Endpoint policy closure | [ ] | +| API-2 Matrix evidence | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Map every common disposition to exact precommit/committed Anthropic Messages and Chat behavior, including native output-cap and silent caller cancel. +- [ ] [API-2] Add a complete two-endpoint terminal/error/cancel race matrix and ordinary endpoint regressions. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append verdict/routing signals and verify findings/dimensions. +- [ ] Archive review/plan to suffix `1`; verify `.gitignore` managed block. +- [ ] On PASS write `complete.log`, preserve metadata, archive child; on WARN/FAIL write directed state without completion. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Confirm the matrix covers only Anthropic Messages and Chat Hot Path endpoints; `/v1/responses` is excluded. +- Confirm endpoint × commit × disposition × active-stage behavior, native length stop, silent caller cancel, and exact active cancellation. +- Confirm Anthropic committed error has no trailing `message_stop`, Chat error follows existing `[DONE]` policy, and no post-terminal write occurs. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(EndpointTerminalMatrix|CancelCompleteRace)|Test(ChatStreamSession|AnthropicNative|StreamChatCompletion)'` + +_Paste actual stdout/stderr and exit status._ + +### Common regression + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +## Section Ownership + +Implementer owns completion status, deviations, decisions, and outputs. Reviewer alone owns review-only actions and final result. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/PLAN-cloud-G09.md b/agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/PLAN-cloud-G09.md new file mode 100644 index 00000000..908510a9 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/PLAN-cloud-G09.md @@ -0,0 +1,130 @@ + + +# Anthropic/Chat endpoint terminal and error matrix + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G10.md`의 구현 담당 섹션에 실제 변경·검증 출력을 채우고 active 파일을 유지한다. 차단 시 정확한 blocker와 재개 조건만 기록하며 archive/`complete.log` 작성이나 상태 판정은 하지 않는다. + +## Background + +Child 16의 공통 disposition을 caller protocol별 wire/status/commit policy로 완전히 닫는다. 이번 SDD의 Hot Path endpoint는 Anthropic Messages와 OpenAI Chat Completions이며 `/v1/responses`는 이 matrix 범위가 아니다. + +## Archive Evidence Snapshot + +- 이전 active plan/review pair는 구현 전에 source reanalysis로 대체됐다. 구현 evidence와 verdict는 없다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `agent-contract/outer/anthropic-compatible-api.md` +- `agent-contract/outer/openai-compatible-api.md` +- `agent-contract/inner/edge-node-runtime-wire.md` +- `apps/edge/internal/openai/anthropic_handler.go` +- `apps/edge/internal/openai/anthropic_stream.go` +- `apps/edge/internal/openai/chat_handler.go` +- `apps/edge/internal/openai/normalized_sse.go` +- `apps/edge/internal/openai/cancellation_routes_test.go` +- `apps/edge/internal/openai/chat_stream_session_test.go` +- `agent-test/local/rules.md` + +### SDD Criteria + +- 승인 SDD S13: endpoint × commit state × disposition source × active stage matrix, native output-limit stop, silent caller cancel, one terminal and no post-terminal write. +- Chat committed ordinary error는 protocol-compatible error chunk와 `[DONE]`; Anthropic committed error는 standard `error` event이며 `message_stop`을 뒤따르지 않는다. + +### Verification Context + +- handler-level recorder, disconnecting writer, barrier fixture, fresh race tests로 닫는다. + +### Test Coverage Gaps + +- preset Hot Path에 대해 precommit/committed provider error, validation, timeout, caller cancel, cap, tool/success terminal을 두 endpoint 모두 교차하는 table test가 없다. + +### Symbol References + +- public rename/remove 없음. Child 16 disposition만 endpoint policy 입력으로 사용한다. + +### Split Judgment + +- stable contract: common disposition → caller-native terminal/error behavior. Common lifecycle 변경은 child 16에서 완료되어야 한다. + +### Scope Rationale + +- `/v1/responses`, provider-stage decode, observation schema, actual CLI smoke는 제외한다. Ordinary non-Hot-Path regressions는 영향 확인용으로만 실행한다. + +### Final Routing + +- evaluation_mode=isolated-reassessment, finalizer=`finalize-task-policy.sh pair`. +- build scores=2/2/2/1/2, risks=`temporal_state,concurrent_consistency,boundary_contract,structured_interpretation,variant_product`(5), grade-boundary → `PLAN-cloud-G09.md`. +- review → `CODE_REVIEW-cloud-G10.md`; `large_indivisible_context=false`, recovery=0/false. + +## Implementation Checklist + +- [ ] [API-1] Map every common disposition to exact precommit/committed Anthropic Messages and Chat behavior, including native output-cap and silent caller cancel. +- [ ] [API-2] Add a complete two-endpoint terminal/error/cancel race matrix and ordinary endpoint regressions. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Endpoint policy closure + +**Problem:** baseline endpoint codecs do not by themselves prove correct behavior for every terminal source before and after response commit. + +**Solution:** Define explicit endpoint mapping tables over disposition and commit state. Before commit, use the endpoint's normal JSON error/status contract. After commit, emit exactly one native stream error/terminal sequence: Anthropic `error` without `message_stop`; Chat error chunk then `[DONE]` where the existing contract requires it. Map public-cap exhaustion to native length stop, close tool turns normally, suppress all wire output for caller cancellation, and reject later callbacks/writes. + +**Modified Files and Checklist:** + +- [ ] Modify `apps/edge/internal/openai/anthropic_handler.go` for Anthropic precommit disposition/status mapping. +- [ ] Modify `apps/edge/internal/openai/anthropic_stream.go` for committed Anthropic terminal/error mapping. +- [ ] Modify `apps/edge/internal/openai/chat_handler.go` for Chat precommit disposition/status mapping. +- [ ] Modify `apps/edge/internal/openai/normalized_sse.go` for committed Chat terminal/error mapping. + +**Test Strategy:** table-driven endpoint × commit × disposition × stage fixtures assert status, bytes, flush count, terminal count, and post-terminal rejection. + +**Verification:** targeted API-2 command exits 0. + +### [API-2] Matrix evidence + +**Problem:** existing cancellation/stream-session tests cover ordinary endpoint sessions but not preset multi-stage ownership. + +**Solution:** Extend it with direct/local/review/repair active-stage rows for success, tool_turn, length, provider_error, validation_error, timeout, and caller_cancel. Include cancel-vs-complete and disconnect-during-write races, exact active `CancelRun` count, Anthropic no-`message_stop` after error, Chat `[DONE]` policy, and no post-terminal bytes. + +**Modified Files and Checklist:** + +- [ ] Modify `apps/edge/internal/openai/cancellation_routes_test.go` with the Hot Path endpoint matrix and race fixtures. +- [ ] Record actual output in `agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/CODE_REVIEW-cloud-G10.md`. + +**Test Strategy:** structural decode of emitted JSON/SSE plus exact status/flush/cancel trace. + +**Verification:** run Final Verification; all commands exit 0 without race. + +## Dependencies and Execution Order + +1. Directory dependency `14` must produce `agent-task/m-iop-hot-path-one-shot-execution/14+13_anthropic_gate/complete.log`. +2. Directory dependency `15` must produce `agent-task/m-iop-hot-path-one-shot-execution/15+13_chat_gate/complete.log`. +3. Directory dependency `16` must produce `agent-task/m-iop-hot-path-one-shot-execution/16+14,15_terminal_disposition/complete.log`. +4. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/anthropic_handler.go` | API-1 | +| `apps/edge/internal/openai/anthropic_stream.go` | API-1 | +| `apps/edge/internal/openai/chat_handler.go` | API-1 | +| `apps/edge/internal/openai/normalized_sse.go` | API-1 | +| `apps/edge/internal/openai/cancellation_routes_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/CODE_REVIEW-cloud-G10.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(EndpointTerminalMatrix|CancelCompleteRace)|Test(ChatStreamSession|AnthropicNative|StreamChatCompletion)' +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: exit 0, exact native terminal/error behavior for both scoped endpoints, silent caller cancel, one active cancellation/terminal, no post-terminal bytes or race. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/code_review_cloud_G10_0.log b/agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/code_review_cloud_G10_0.log new file mode 100644 index 00000000..1830ac5d --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/code_review_cloud_G10_0.log @@ -0,0 +1,100 @@ + + +# 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. +> 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. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix, plan=0, tag=API + +## For the Review Agent + +1. Append verdict and routing signals. +2. Archive `CODE_REVIEW-cloud-G10.md` → `code_review_cloud_G10_0.log` and `PLAN-cloud-G09.md` → `plan_cloud_G09_0.log`. +3. On PASS write `complete.log` and move to `agent-task/archive/YYYY/MM/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/`; otherwise write the directed next state. +4. Preserve/report `milestone-task=error-cancel` on PASS. +5. Complete the review-only checklist at the final location. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Endpoint disposition mapping | [ ] | +| API-2 Endpoint outcome matrix | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Map each predecessor disposition to Anthropic/OpenAI standard pre/post-commit terminal bytes exactly once, including native length and caller-cancel behavior. +- [ ] [API-2] Add the endpoint-by-outcome table and wire regressions, then run the child verification commands. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure`. +- [ ] Verify verdict, dimension assessment, and Required/Suggested/Nit classifications match. +- [ ] Archive the active review to `code_review_cloud_G10_0.log`. +- [ ] Archive the active plan to `plan_cloud_G09_0.log`. +- [ ] Verify the Agent-Ops managed block in `.gitignore`. +- [ ] If PASS, write `complete.log` from the standard template and leave no active `.md` files. +- [ ] If PASS, move the task directory to the dated archive and update this checklist at the final location. +- [ ] If PASS, preserve/report `milestone-task=error-cancel` without directly editing the roadmap. +- [ ] If PASS, remove the active parent only when no siblings/files remain. +- [ ] If WARN/FAIL, write the next filesystem state and do not write `complete.log`. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Verify both endpoint codecs consume the common disposition and own post-commit bytes. +- Verify exact status/type/finish reason, native length, silent caller cancel, and one terminal. +- Verify no custom partial-success status or hidden work regression. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathEndpointTerminalMatrix|Test(ChatCompletion|Responses|StreamChatCompletion).*(Cancel|Timeout)'` + +_Paste actual stdout/stderr and exit status._ + +### SDD common + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING]** Fill every implementation-owned section and leave review-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---|---|---| +| Header, Overview, Review Agent Instructions | Fixed | Implementer must not finalize | +| Implementation Item Completion, Implementation Checklist | Implementer checks only | Text/order stays fixed | +| Review-Only Checklist | Review agent | Implementer must not modify | +| Deviations, Key Design Decisions | Implementer | Record actual content | +| Reviewer Checkpoints | Fixed | Reviewer verifies | +| Verification Results | Implementer fills output | Command changes require deviation | +| Code Review Result | Review agent appends | Not included in stub | diff --git a/agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/plan_cloud_G09_0.log b/agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/plan_cloud_G09_0.log new file mode 100644 index 00000000..17b49f04 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/plan_cloud_G09_0.log @@ -0,0 +1,125 @@ + + +# Hot Path endpoint error and length matrix + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G10.md`의 구현 담당 섹션과 실제 출력을 채우고 active 파일을 유지한다. 차단 시 blocker/명령/출력/재개 조건만 기록하며 사용자 질문, archive, `complete.log` 작성은 금지한다. + +## Background + +Child 16의 common disposition을 Anthropic/OpenAI endpoint의 standard pre/post-commit error, cancel, and length shapes로 exactly once 변환해야 S13을 닫을 수 있다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `apps/edge/internal/openai/anthropic_handler.go` +- `apps/edge/internal/openai/anthropic_stream.go` +- `apps/edge/internal/openai/chat_handler.go` +- `apps/edge/internal/openai/normalized_sse.go` +- `apps/edge/internal/openai/server.go` +- `apps/edge/internal/openai/chat_stream_session_test.go` +- `agent-contract/outer/openai-compatible-api.md` +- `agent-contract/outer/anthropic-compatible-api.md` +- `agent-test/local/rules.md` + +### SDD Criteria + +- 승인 SDD, `milestone-task=error-cancel`, S13. +- endpoint×commit-state×failure-source table, standard status/type/finish reason, no custom partial-success, and native length terminal이 pass oracle이다. + +### Verification Context + +- deterministic handler fault fixtures and fresh race tests are sufficient; no external runtime is required. + +### Test Coverage Gaps + +- both endpoint codecs lack one cross-product fixture proving exact pre/post-commit semantics from common dispositions. + +### Symbol References + +- no public rename/remove; predecessor codec error/terminal hooks are extended. + +### Split Judgment + +- stable contract: common terminal disposition → endpoint-standard wire result. +- common ownership/cancellation is child 16; observation/smoke are later children. + +### Scope Rationale + +- new custom status/type, observation fields, or live agent smoke are excluded. + +### Final Routing + +- evaluation_mode=isolated-reassessment, finalizer=`finalize-task-policy.sh pair`. +- build closures 모두 true, scores=2/2/2/1/2, G09, grade-boundary → `PLAN-cloud-G09.md`. +- review closures 모두 true, scores=2/2/2/2/2, G10, official-review → `CODE_REVIEW-cloud-G10.md`. +- risks=`temporal_state,concurrent_consistency,boundary_contract,structured_interpretation,variant_product`(5), `large_indivisible_context=false`, recovery=0/false, capability gap 없음. + +## Implementation Checklist + +- [ ] [API-1] Map each predecessor disposition to Anthropic/OpenAI standard pre/post-commit terminal bytes exactly once, including native length and caller-cancel behavior. +- [ ] [API-2] Add the endpoint-by-outcome table and wire regressions, then run the child verification commands. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Endpoint disposition mapping + +**Problem:** handlers and codecs can independently write errors, while response commit state determines the only legal endpoint result. + +**Solution:** Delegate every preset terminal outcome to the common disposition from child 16. Keep pre-commit JSON/HTTP errors in handlers, post-commit terminal error bytes in codecs, caller cancellation silent after disconnect, and output cap as native length terminal. Preserve exact contract status/type names and forbid custom partial-success meanings. + +**Modified Files and Checklist:** + +- [ ] Modify `apps/edge/internal/openai/anthropic_handler.go` and `anthropic_stream.go` for standard Anthropic pre/post-commit shapes. +- [ ] Modify `apps/edge/internal/openai/chat_handler.go` and `normalized_sse.go` for standard OpenAI pre/post-commit shapes. + +**Test Strategy:** API-2 supplies the full endpoint table and retains ordinary cancellation tests. + +**Verification:** `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathEndpointTerminalMatrix|Test(ChatCompletion|Responses|StreamChatCompletion).*(Cancel|Timeout)'` exits 0. + +### [API-2] Endpoint outcome matrix + +**Problem:** no single test proves endpoint, commit state, failure source, and stage combinations. + +**Solution:** Extend the predecessor error fixture over endpoint `{anthropic,openai}`, response `{uncommitted,committed}`, source `{write-unavailable,provider-error,context-error,timeout,cancel,output-cap}`, and stage `{selector,local,review,cleanup}`. Assert exact wire type/finish reason, no custom partial status, and one legal terminal. + +**Modified Files and Checklist:** + +- [ ] Extend `apps/edge/internal/openai/hot_path_error_cancel_test.go` with `TestHotPathEndpointTerminalMatrix`. +- [ ] Fill `agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/CODE_REVIEW-cloud-G10.md`. + +**Test Strategy:** exact contract status/type names; forbid `partial_success`, `review_unavailable`, and `repair_limit`. + +**Verification:** run Final Verification; every matrix row passes. + +## Dependencies and Execution Order + +1. `14+13_anthropic_gate` must produce its active `complete.log`. +2. `15+13_chat_gate` must produce its active `complete.log`. +3. `16+14,15_terminal_disposition` must produce its active `complete.log`. +4. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/anthropic_handler.go` | API-1 | +| `apps/edge/internal/openai/anthropic_stream.go` | API-1 | +| `apps/edge/internal/openai/chat_handler.go` | API-1 | +| `apps/edge/internal/openai/normalized_sse.go` | API-1 | +| `apps/edge/internal/openai/hot_path_error_cancel_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/CODE_REVIEW-cloud-G10.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathEndpointTerminalMatrix|Test(ChatCompletion|Responses|StreamChatCompletion).*(Cancel|Timeout)' +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: exit 0, endpoint-standard pre/post-commit and length semantics, one terminal, no custom partial status, empty diff check. Cached output is not acceptable. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/CODE_REVIEW-cloud-G07.md b/agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/CODE_REVIEW-cloud-G07.md new file mode 100644 index 00000000..aaf456bc --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/CODE_REVIEW-cloud-G07.md @@ -0,0 +1,75 @@ + + +# Code Review Reference - API + +> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is mandatory.** Fill implementation-owned evidence and leave active files in place. Verdict/finalization is review-agent-only. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/18+17_observation_schema, plan=2, tag=API + +## Archive Evidence Snapshot + +- Plan/review 1 was superseded before implementation; it contains no implementation verdict/evidence. + +## For the Review Agent + +Verify exact projections and failure isolation, archive to `code_review_cloud_G07_2.log` and `plan_local_G06_2.log`, then finalize by verdict. Preserve `milestone-task=route-observability` on PASS. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Observation contract and projections | [ ] | +| API-2 Schema safety evidence | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Define a closed internal Hot Path observation contract, bounded log/metric projections, safe default observer, and failure isolation without altering Stream Gate observation ownership. +- [ ] [API-2] Add exact schema, cardinality, raw/secret rejection, and observer failure tests. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append verdict/routing signals and verify findings/dimensions. +- [ ] Archive review/plan to suffix `2`; verify `.gitignore` managed block. +- [ ] On PASS write `complete.log`, preserve metadata, archive child; on WARN/FAIL write directed state without completion. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Confirm `Server.obsSink` remains the existing Stream Gate contract and the Hot Path observer is a distinct internal field/seam. +- Confirm metric labels are closed enum/bucket values and exclude request/stage/attempt/run/provider raw ids and all raw content/error/credential strings. +- Confirm correlation ids are log-only and observer failures cannot alter request behavior. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(ObservationSchema|ObservationRejectsRawValues|MetricLabels|ObserverFailureIsolation)'` + +_Paste actual stdout/stderr and exit status._ + +### Common regression + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +## Section Ownership + +Implementer owns completion status, deviations, decisions, and outputs. Reviewer alone owns review-only actions and final result. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/PLAN-local-G06.md b/agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/PLAN-local-G06.md new file mode 100644 index 00000000..ecb0daf4 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/PLAN-local-G06.md @@ -0,0 +1,120 @@ + + +# Bounded raw-free Hot Path observation schema + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G07.md`의 구현 담당 섹션에 실제 변경·검증 출력을 채우고 active 파일을 유지한다. 차단 시 정확한 blocker와 재개 조건만 기록하며 archive/`complete.log` 작성이나 상태 판정은 하지 않는다. + +## Background + +Hot Path lifecycle 관측을 연결하기 전에 log field와 metric label의 허용 집합을 닫아야 한다. 이 child는 기존 `Server.obsSink` Stream Gate contract를 변경하지 않고 별도 internal observer를 초기화하며, 고카디널리티 correlation은 log-only로 제한한다. + +## Archive Evidence Snapshot + +- 이전 active plan/review pair는 구현 전에 source reanalysis로 대체됐다. 구현 evidence와 verdict는 없다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `apps/edge/internal/openai/server.go` +- `apps/edge/internal/openai/usage_metrics.go` +- `apps/edge/internal/openai/filter_observation_sink.go` +- `apps/edge/internal/openai/hot_path_dispatch.go` +- `agent-test/local/rules.md` + +### SDD Criteria + +- 승인 SDD S15: request/preset/mode/stage/attempt/route/terminal/cleanup/orphan을 상호연결하되 raw prompt/output/tool/header/credential/error와 unbounded metric label을 내보내지 않는다. + +### Verification Context + +- in-memory observer/collector와 seeded secret/raw sentinels로 deterministic하게 닫는다. 외부 telemetry backend는 필요 없다. + +### Test Coverage Gaps + +- Hot Path 전용 closed enums, log projection allowlist, metric label allowlist/cardinality budget, observer failure isolation을 검증하는 schema test가 없다. + +### Symbol References + +- public rename/remove 없음. 기존 `Server.obsSink` 타입/역할은 보존하고 새 field는 Hot Path internal observer만 담당한다. + +### Split Judgment + +- stable contract: typed lifecycle observation → bounded log/metric projection. 실제 lifecycle emit wiring은 child 19다. + +### Scope Rationale + +- dispatch/light/cleanup emit callsites, dashboard, backend, payload hashing/retention은 제외한다. + +### Final Routing + +- evaluation_mode=isolated-reassessment, finalizer=`finalize-task-policy.sh pair`. +- build scores=1/1/1/1/2, risks=`boundary_contract,variant_product`(2), local-fit → `PLAN-local-G06.md`. +- review → `CODE_REVIEW-cloud-G07.md`; `large_indivisible_context=false`, recovery=0/false. + +## Implementation Checklist + +- [ ] [API-1] Define a closed internal Hot Path observation contract, bounded log/metric projections, safe default observer, and failure isolation without altering Stream Gate observation ownership. +- [ ] [API-2] Add exact schema, cardinality, raw/secret rejection, and observer failure tests. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Observation contract and projections + +**Problem:** generic observation helpers do not express Hot Path stage/terminal/cleanup lifecycle or prevent accidental high-cardinality metric labels. + +**Solution:** Add closed internal enums/types for event class, mode, stage, attempt bucket, route reason, disposition, cleanup/orphan outcome, and duration/usage buckets. Define separate projection functions: logs may include bounded keys plus correlation ids; metrics may include only closed enum/bucket labels and must exclude request/stage/attempt/run/provider raw ids, content, headers, error strings, and credentials. Add an internal observer interface with no-op/default bounded implementation and test injection. Store it on `Server` under a distinct field while preserving `obsSink` unchanged; observer failures never affect request results. + +**Modified Files and Checklist:** + +- [ ] Add `apps/edge/internal/openai/hot_path_observation.go` with closed event types, log projection, observer interface, and no-op/bounded implementation. +- [ ] Add `apps/edge/internal/openai/hot_path_metrics.go` with metric projection, fixed label sets, and bounded collectors. +- [ ] Modify `apps/edge/internal/openai/server.go` to initialize/store the distinct Hot Path observer and expose an internal test seam without changing `Server.obsSink`. + +**Test Strategy:** enumerate every enum/projection and compare exact keys/labels; inject panicking/erroring observers behind safe calls. + +**Verification:** targeted API-2 command exits 0. + +### [API-2] Schema safety evidence + +**Problem:** conventions alone cannot guarantee raw-free fields or bounded labels. + +**Solution:** Add exact allowlist tests, unknown-value normalization, fixed label cardinality, log-only correlation, seeded prompt/output/tool/header/token/error exclusion, and observer failure isolation. Verify metric labels never carry high-cardinality ids. + +**Modified Files and Checklist:** + +- [ ] Add `apps/edge/internal/openai/hot_path_observation_test.go` with schema/projection/failure tests. +- [ ] Record actual output in `agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/CODE_REVIEW-cloud-G07.md`. + +**Test Strategy:** inspect projected maps/labels directly and fail on any non-allowlisted key/value. + +**Verification:** run Final Verification; all commands exit 0. + +## Dependencies and Execution Order + +1. Directory dependency `17` must produce `agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/complete.log`. +2. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/hot_path_observation.go` | API-1 | +| `apps/edge/internal/openai/hot_path_metrics.go` | API-1 | +| `apps/edge/internal/openai/server.go` | API-1 | +| `apps/edge/internal/openai/hot_path_observation_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/CODE_REVIEW-cloud-G07.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(ObservationSchema|ObservationRejectsRawValues|MetricLabels|ObserverFailureIsolation)' +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: exit 0, exact bounded projections, correlation ids only in logs, no raw/secret/high-cardinality metric labels, observer failure isolation. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/code_review_cloud_G07_1.log b/agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/code_review_cloud_G07_1.log new file mode 100644 index 00000000..3b6b9c50 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/code_review_cloud_G07_1.log @@ -0,0 +1,100 @@ + + +# 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. +> 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. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/18+17_observation_schema, plan=1, tag=API + +## For the Review Agent + +1. Append verdict and routing signals. +2. Archive `CODE_REVIEW-cloud-G07.md` → `code_review_cloud_G07_1.log` and `PLAN-local-G06.md` → `plan_local_G06_1.log`. +3. On PASS write `complete.log` and move to `agent-task/archive/YYYY/MM/m-iop-hot-path-one-shot-execution/18+17_observation_schema/`; otherwise write the directed next state. +4. Preserve/report `milestone-task=route-observability` on PASS. +5. Complete the review-only checklist at the final location. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Closed observation and metric schema | [ ] | +| API-2 Schema allowlist evidence | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Add closed Hot Path observation enums and separate raw-free log/low-cardinality metric projections without arbitrary payload maps or strings. +- [ ] [API-2] Add exact log-field and metric-label allowlist plus redaction guard tests and run the child verification commands. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure`. +- [ ] Verify verdict, dimension assessment, and Required/Suggested/Nit classifications match. +- [ ] Archive the active review to `code_review_cloud_G07_1.log`. +- [ ] Archive the active plan to `plan_local_G06_1.log`. +- [ ] Verify the Agent-Ops managed block in `.gitignore`. +- [ ] If PASS, write `complete.log` from the standard template and leave no active `.md` files. +- [ ] If PASS, move the task directory to the dated archive and update this checklist at the final location. +- [ ] If PASS, preserve/report `milestone-task=route-observability` without directly editing the roadmap. +- [ ] If PASS, remove the active parent only when no siblings/files remain. +- [ ] If WARN/FAIL, write the next filesystem state and do not write `complete.log`. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Compare exact log field and metric label allowlists separately. +- Verify request/stage/attempt/provider/run ids are log-only. +- Verify arbitrary maps/raw payload/error strings cannot enter the typed schema. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(ObservationFieldAllowlist|MetricLabelAllowlist|ObservationRejectsRawValues)'` + +_Paste actual stdout/stderr and exit status._ + +### Package regression + +Command: `go test -race -count=1 ./apps/edge/internal/openai` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING]** Fill every implementation-owned section and leave review-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---|---|---| +| Header, Overview, Review Agent Instructions | Fixed | Implementer must not finalize | +| Implementation Item Completion, Implementation Checklist | Implementer checks only | Text/order stays fixed | +| Review-Only Checklist | Review agent | Implementer must not modify | +| Deviations, Key Design Decisions | Implementer | Record actual content | +| Reviewer Checkpoints | Fixed | Reviewer verifies | +| Verification Results | Implementer fills output | Command changes require deviation | +| Code Review Result | Review agent appends | Not included in stub | diff --git a/agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/code_review_cloud_G10_0.log b/agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/code_review_cloud_G10_0.log new file mode 100644 index 00000000..5b283052 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/code_review_cloud_G10_0.log @@ -0,0 +1,103 @@ + + +# 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. +> If blocked, record exact blocker, attempted commands/output, and resume condition only. +> Do not ask the user, call user-input tools, classify the next state, archive files, or write `complete.log`. +> Finalization is review-agent-only. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/16+15_route_observability, plan=0, tag=API + +## For the Review Agent + +> **[REVIEW AGENT ONLY]** Compare implementation/output against the plan. Implementers must not finalize. + +1. Append verdict and routing signals. +2. Archive `CODE_REVIEW-cloud-G10.md` → `code_review_cloud_G10_0.log` and `PLAN-cloud-G09.md` → `plan_cloud_G09_0.log`. +3. If PASS, write `complete.log` and move to `agent-task/archive/YYYY/MM/m-iop-hot-path-one-shot-execution/16+15_route_observability/`; otherwise write the directed next state. +4. Preserve/report `milestone-task=route-observability` on PASS. +5. Complete the review-only checklist at the final location. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Lifecycle observation schema | [ ] | +| API-2 Raw-free evidence | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Emit one allowlisted Hot Path lifecycle as request-correlated logs plus low-cardinality metrics across admission, stage attempts/transitions, terminal, cleanup, and orphan responsibility without raw or secret fields. +- [ ] [API-2] Add exact log/metric allowlist, cardinality, redaction, and lifecycle tests and run targeted plus SDD common verification. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append one PASS/WARN/FAIL verdict and verified routing signals. +- [ ] Verify verdict, dimensions, and finding classifications match. +- [ ] Archive `CODE_REVIEW-cloud-G10.md` to `code_review_cloud_G10_0.log`. +- [ ] Archive `PLAN-cloud-G09.md` to `plan_cloud_G09_0.log`. +- [ ] Verify the `.gitignore` managed block. +- [ ] On PASS write standard `complete.log` and leave no active `.md` files. +- [ ] On PASS move the task directory to dated archive and update this checklist there. +- [ ] On PASS preserve/report `milestone-task=route-observability` without editing roadmap directly. +- [ ] Remove active parent only if empty. +- [ ] On WARN/FAIL write the next state and no `complete.log`. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Compare serialized log fields and metric label names to their separate exact allowlists. +- Verify request/stage/attempt/provider/run ids are log-only and absent from every metric label. +- Verify sentinel prompt/output/tool/header/credential/error values are absent. +- Verify stage attempts, terminal, cleanup/orphan outcomes join by request without arbitrary maps. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathObservation|TestHotPathMetric|TestHotPath(EndpointTerminalMatrix|CancelCompleteRace|Cleanup)'` + +_Paste actual stdout/stderr and exit status._ + +### SDD common + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING]** Fill every implementation-owned section and leave review-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---|---|---| +| Header, Overview, Review Agent Instructions | Fixed | Implementer must not modify or finalize | +| Implementation Item Completion, Implementation Checklist | Implementer checks only | Text/order stays fixed | +| Review-Only Checklist | Review agent | Implementer must not modify | +| Deviations, Key Design Decisions | Implementer | Record actual content | +| Reviewer Checkpoints | Fixed | Reviewer verifies | +| Verification Results | Implementer fills output | Command changes require deviation | +| Code Review Result | Review agent appends | Not included in stub | diff --git a/agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/plan_cloud_G09_0.log b/agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/plan_cloud_G09_0.log new file mode 100644 index 00000000..87f08225 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/plan_cloud_G09_0.log @@ -0,0 +1,171 @@ + + +# Raw-free Hot Path route observability + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G10.md`의 구현 담당 섹션에 실제 notes/output을 채우고 active 파일을 유지한다. 차단 시 정확한 blocker/시도/출력/재개 조건만 기록하며 사용자 질문, archive, `complete.log` 작성은 하지 않는다. + +## Background + +현재 dispatch logging은 run/provider 필드를 기록하지만 Hot Path logical request의 preset/mode/stage/attempt/terminal을 한 lifecycle로 연결하지 않는다. 관측 payload가 prompt/output/tool argument/credential을 포함하지 않도록 단일 allowlist event를 추가한다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `apps/edge/internal/openai/server.go` +- `apps/edge/internal/openai/chat_handler.go` +- `apps/edge/internal/openai/hot_path_dispatch.go` +- `apps/edge/internal/openai/hot_path_light.go` +- `apps/edge/internal/openai/hot_path_cleanup.go` +- `apps/edge/internal/openai/hot_path_cleanup_test.go` +- `apps/edge/internal/openai/filter_observation_sink.go` +- `apps/edge/internal/openai/usage_metrics.go` +- `packages/go/streamgate/filter_observation.go` +- `agent-spec/runtime/stream-evidence-gate.md` +- `agent-test/local/rules.md` +- `agent-test/local/edge-smoke.md` + +### SDD Criteria + +- 승인 SDD, `milestone-task=route-observability`, S15. +- Evidence Map S15의 raw-free log/metric field allowlist를 직접 구현·검증한다. request/preset/mode/stage/attempt, route reason, timing, terminal outcome 연결과 secret/raw absence가 pass 조건이다. + +### Verification Context + +- handoff 없음. local edge profile과 in-memory observation sink/log observer를 사용한다. repo/branch/HEAD=`/config/workspace/iop-s0`, `feature/iop-hot-path-one-shot-execution`, `6650e9f70d0104220d8077dd1d469b6a1facb9da`. +- 외부 metrics backend 없이 deterministic unit/integration evidence로 닫는다. + +### Test Coverage Gaps + +- 기존 tests는 typed `streamgate.FilterObservation`과 usage 일부를 확인하지만 Hot Path lifecycle field allowlist, cardinality, raw/secret 금지, orphan responsibility outcome을 확인하지 않는다. 기존 `streamgate.ObservationSink`는 `FilterObservation` 전용이므로 Hot Path 임의 event sink로 재사용할 수 없다. + +### Symbol References + +- rename/remove 없음. 기존 `Server.logger`와 Prometheus registry 관례를 사용하고 `Server.obsSink`/`streamgate.FilterObservation` 계약은 변경하지 않는다. + +### Split Judgment + +- stable contract: Hot Path lifecycle → low-cardinality raw-free observation allowlist. +- predecessor 15 (`15+13,14_error_cancel`) active `complete.log`는 현재 missing이며 terminal outcomes 확정 후 구현한다. + +### Scope Rationale + +- backend/dashboard/alert와 new durable store는 제외한다. raw payload hashing도 유출/고카디널리티 위험 때문에 추가하지 않는다. request/stage/attempt id는 log correlation에만 두고 metric label에서는 제외한다. + +### Final Routing + +- evaluation_mode=write, finalizer=`finalize-task-policy.sh pair`. +- build closures 모두 true, scores=2/2/2/1/2, G09, grade-boundary → `PLAN-cloud-G09.md`. +- review closures 모두 true, scores=2/2/2/2/2, G10, official-review → `CODE_REVIEW-cloud-G10.md`. +- `large_indivisible_context=false`; risks=`temporal_state,boundary_contract,variant_product`(3); recovery=0/false; capability gap 없음. + +## Implementation Checklist + +- [ ] [API-1] Emit one allowlisted Hot Path lifecycle as request-correlated logs plus low-cardinality metrics across admission, stage attempts/transitions, terminal, cleanup, and orphan responsibility without raw or secret fields. +- [ ] [API-2] Add exact log/metric allowlist, cardinality, redaction, and lifecycle tests and run targeted plus SDD common verification. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Lifecycle observation schema + +**Problem:** `chat_handler.go:244` logs generic dispatch fields, but no Hot Path event links logical request and stage transitions; ad-hoc logging risks raw payload leakage. + +**Solution:** Add `hotPathObservation` with a closed log field set: edge_id, request_id, preset_id/generation, mode, endpoint, stage role/id, attempt ordinal, provider/run ids, route reason, elapsed bucket, outcome, cleanup/orphan responsibility. Emit through `Server.logger` at admission, dispatch start/end, transition, terminal, cleanup result, and TTL/orphan handoff. Add dedicated counters/histograms in `hot_path_metrics.go` whose bounded labels are only edge_id, preset_id, mode, endpoint, stage_role, route_reason, outcome, and cleanup responsibility; request/stage/attempt/provider/run ids remain log-only. Never accept arbitrary maps or payload strings; omit prompt/content/reasoning/tool arguments, headers, credential refs and raw errors. Normalize outcome/reason to enums and isolate metric/log failures from request behavior. + +New source imports are explicit: + +```go +// hot_path_observation.go +import ( + "context" + "time" + + "go.uber.org/zap" +) + +// hot_path_metrics.go +import ( + "github.com/prometheus/client_golang/prometheus" + "github.com/prometheus/client_golang/prometheus/promauto" +) +``` + +Before (`server.go:61`): + +```go +obsSink streamgate.ObservationSink // FilterObservation only +``` + +After: + +```go +func (s *Server) observeHotPath(event hotPathObservation) +func recordHotPathMetric(event hotPathObservation) +``` + +**Modified Files and Checklist:** + +- [ ] Add `apps/edge/internal/openai/hot_path_observation.go` with closed event/enum types and sink/log projection. +- [ ] Add `apps/edge/internal/openai/hot_path_metrics.go` with bounded-label counters/histograms; do not include request/stage/attempt/provider/run ids in labels. +- [ ] Modify `apps/edge/internal/openai/hot_path_dispatch.go`, `hot_path_light.go`, and `hot_path_cleanup.go` at lifecycle boundaries. + +**Test Strategy:** API-2 provides exact allowlist and lifecycle tests. + +**Verification:** `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathObservation'` exits 0. + +### [API-2] Raw-free evidence + +**Problem:** S15 requires positive field coverage and negative raw-data proof. + +**Solution:** Capture zap observer fields and Prometheus families for direct success, light pass, repair, provider error, cancel, cleanup failure/orphan. Seed sentinel prompt/output/tool args/auth header/credential/error text and assert no log/metric key or value contains them. Assert exact log key set, exact metric label names, absence of high-cardinality ids from metrics, enum values, attempt ordering, request-stage joins, bounded timing bucket, and exactly-once counter increments. + +New test-only imports: + +```go +import ( + "testing" + + "github.com/prometheus/client_golang/prometheus/testutil" + "go.uber.org/zap/zaptest/observer" +) +``` + +**Modified Files and Checklist:** + +- [ ] Add `apps/edge/internal/openai/hot_path_observation_test.go` with `TestHotPathObservationFieldAllowlist`, `TestHotPathMetricLabelAllowlist`, `TestHotPathObservationRejectsRawValues`, and `TestHotPathObservationLifecycle`. +- [ ] Fill `agent-task/m-iop-hot-path-one-shot-execution/16+15_route_observability/CODE_REVIEW-cloud-G10.md`. + +**Test Strategy:** New tests mandatory; compare sorted exact keys and sentinel absence in serialized observation/log fields. + +**Verification:** run Final Verification; allowlist and all lifecycle rows pass. + +## Dependencies and Execution Order + +1. `15+13,14_error_cancel` must produce `agent-task/m-iop-hot-path-one-shot-execution/15+13,14_error_cancel/complete.log` before implementation. +2. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/hot_path_observation.go` | API-1 | +| `apps/edge/internal/openai/hot_path_metrics.go` | API-1 | +| `apps/edge/internal/openai/hot_path_dispatch.go` | API-1 | +| `apps/edge/internal/openai/hot_path_light.go` | API-1 | +| `apps/edge/internal/openai/hot_path_cleanup.go` | API-1 | +| `apps/edge/internal/openai/hot_path_observation_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/16+15_route_observability/CODE_REVIEW-cloud-G10.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathObservation|TestHotPathMetric|TestHotPath(EndpointTerminalMatrix|CancelCompleteRace|Cleanup)' +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: exit 0, exact log/metric allowlists, no high-cardinality metric ids or sentinel/raw/credential data, joined lifecycle and terminal outcome, empty diff check. Cached output is not acceptable. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/plan_local_G06_1.log b/agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/plan_local_G06_1.log new file mode 100644 index 00000000..5b620c86 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/plan_local_G06_1.log @@ -0,0 +1,119 @@ + + +# Raw-free Hot Path observation schema + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G07.md`의 구현 담당 섹션에 실제 notes/output을 채우고 active 파일을 유지한다. 차단 시 정확한 blocker/시도/출력/재개 조건만 기록하며 사용자 질문, archive, `complete.log` 작성은 하지 않는다. + +## Background + +Hot Path lifecycle에는 request-correlated log와 low-cardinality metric을 위한 닫힌 schema가 없다. 이 child는 lifecycle wiring에 앞서 raw/secret을 받을 수 없는 typed event, enum, log projection, metric label surface를 정의한다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `apps/edge/internal/openai/server.go` +- `apps/edge/internal/openai/filter_observation_sink.go` +- `apps/edge/internal/openai/usage_metrics.go` +- `packages/go/streamgate/filter_observation.go` +- `agent-spec/runtime/stream-evidence-gate.md` +- `agent-test/local/rules.md` + +### SDD Criteria + +- 승인 SDD, `milestone-task=route-observability`, S15. +- exact log field allowlist, bounded metric labels, enum normalization, raw/secret absence가 이 child의 oracle이다. + +### Verification Context + +- zap observer와 isolated Prometheus collector를 사용하는 deterministic tests로 닫는다. + +### Test Coverage Gaps + +- Hot Path typed observation schema와 metric label allowlist 자체를 검증하는 tests가 없다. + +### Symbol References + +- existing `Server.obsSink`/`streamgate.FilterObservation` contract is not changed. + +### Split Judgment + +- stable contract: closed Hot Path observation event → log/metric allowlist projections. +- stage lifecycle wiring and correlation are child 19. +- endpoint terminal outcomes must be fixed by predecessor 17. + +### Scope Rationale + +- dispatch/light/cleanup emission points, backend/dashboard/alert, durable store, raw hashing are excluded. + +### Final Routing + +- evaluation_mode=isolated-reassessment, finalizer=`finalize-task-policy.sh pair`. +- build closures 모두 true, scores=1/1/1/1/2, G06, local-fit → `PLAN-local-G06.md`. +- review closures 모두 true, scores=1/1/1/2/2, G07, official-review → `CODE_REVIEW-cloud-G07.md`. +- risks=`boundary_contract,variant_product`(2), `large_indivisible_context=false`, recovery=0/false, capability gap 없음. + +## Implementation Checklist + +- [ ] [API-1] Add closed Hot Path observation enums and separate raw-free log/low-cardinality metric projections without arbitrary payload maps or strings. +- [ ] [API-2] Add exact log-field and metric-label allowlist plus redaction guard tests and run the child verification commands. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Closed observation and metric schema + +**Problem:** ad-hoc logging can leak payloads and metrics can accidentally acquire high-cardinality identifiers. + +**Solution:** Add `hotPathObservation` with closed enum fields for preset/mode/endpoint/stage/route/outcome/cleanup responsibility plus explicit log-only correlation identifiers. Add typed log projection and dedicated counter/histogram collectors whose bounded labels exclude request/stage/attempt/provider/run ids. Reject arbitrary maps and raw prompt/output/tool/header/credential/error strings. + +**Modified Files and Checklist:** + +- [ ] Add `apps/edge/internal/openai/hot_path_observation.go` with closed event/enum types and log projection. +- [ ] Add `apps/edge/internal/openai/hot_path_metrics.go` with bounded-label counters/histograms. + +**Test Strategy:** API-2 compares exact sorted field/label sets and sentinel absence. + +**Verification:** `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(ObservationFieldAllowlist|MetricLabelAllowlist|ObservationRejectsRawValues)'` exits 0. + +### [API-2] Schema allowlist evidence + +**Problem:** S15 needs positive allowlist and negative raw-data evidence before lifecycle emission is wired. + +**Solution:** Capture projected zap fields and Prometheus descriptors. Assert exact key/label names, log-only high-cardinality ids, enum normalization, and absence of seeded prompt/output/tool/header/credential/error sentinel values. + +**Modified Files and Checklist:** + +- [ ] Add `apps/edge/internal/openai/hot_path_observation_test.go` with field allowlist, metric label allowlist, and raw-value rejection tests. +- [ ] Fill `agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/CODE_REVIEW-cloud-G07.md`. + +**Test Strategy:** use isolated observers/collectors; no external metrics backend. + +**Verification:** run Final Verification; all exact allowlist assertions pass. + +## Dependencies and Execution Order + +1. `17+14,15,16_endpoint_error_matrix` must produce its active `complete.log`. +2. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/hot_path_observation.go` | API-1 | +| `apps/edge/internal/openai/hot_path_metrics.go` | API-1 | +| `apps/edge/internal/openai/hot_path_observation_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/CODE_REVIEW-cloud-G07.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(ObservationFieldAllowlist|MetricLabelAllowlist|ObservationRejectsRawValues)' +go test -race -count=1 ./apps/edge/internal/openai +git diff --check +``` + +Expected: exit 0, exact allowlists, no high-cardinality metric labels or raw/secret sentinels, empty diff check. Cached output is not acceptable. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/CODE_REVIEW-cloud-G09.md b/agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/CODE_REVIEW-cloud-G09.md new file mode 100644 index 00000000..198090be --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/CODE_REVIEW-cloud-G09.md @@ -0,0 +1,75 @@ + + +# Code Review Reference - API + +> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is mandatory.** Fill implementation-owned evidence and leave active files in place. Verdict/finalization is review-agent-only. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle, plan=1, tag=API + +## Archive Evidence Snapshot + +- Plan/review 0 was superseded before implementation; it contains no implementation verdict/evidence. + +## For the Review Agent + +Verify actual-path lifecycle evidence, archive to `code_review_cloud_G09_1.log` and `plan_local_G08_1.log`, then finalize by verdict. Preserve `milestone-task=route-observability` on PASS. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Lifecycle emission | [ ] | +| API-2 Actual-path evidence | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Emit the predecessor observation contract across admission, dispatch, stage transition, terminal, cleanup, and orphan boundaries with exactly-once responsibility and failure isolation. +- [ ] [API-2] Add joined lifecycle, ordering/cardinality, raw/secret absence, and failure-isolation regressions on actual paths. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append verdict/routing signals and verify findings/dimensions. +- [ ] Archive review/plan to suffix `1`; verify `.gitignore` managed block. +- [ ] On PASS write `complete.log`, preserve metadata, archive child; on WARN/FAIL write directed state without completion. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Confirm admission, each dispatch/transition, one terminal, cleanup, and orphan/TTL responsibility form a joined ordered lifecycle. +- Confirm one terminal/cleanup counter owner and no behavior change on observer error/panic. +- Confirm actual-path seeded prompt/output/tool/header/credential/provider-error sentinels never reach logs or metric labels. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(ObservationLifecycle|ObservationRejectsRawValues|MetricLabels|ObserverFailureIsolation|EndpointTerminalMatrix|Cleanup)'` + +_Paste actual stdout/stderr and exit status._ + +### Common regression + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +## Section Ownership + +Implementer owns completion status, deviations, decisions, and outputs. Reviewer alone owns review-only actions and final result. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/PLAN-local-G08.md b/agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/PLAN-local-G08.md new file mode 100644 index 00000000..b0feae30 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/PLAN-local-G08.md @@ -0,0 +1,121 @@ + + +# Raw-free Hot Path observation lifecycle wiring + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G09.md`의 구현 담당 섹션에 실제 변경·검증 출력을 채우고 active 파일을 유지한다. 차단 시 정확한 blocker와 재개 조건만 기록하며 archive/`complete.log` 작성이나 상태 판정은 하지 않는다. + +## Background + +Child 18의 closed observation schema를 admission, dispatch attempts, transitions, outer terminal, cleanup, orphan responsibility에 연결한다. 모든 emit은 best effort이며 Hot Path의 response/cancellation/cleanup 의미를 바꾸지 않는다. + +## Archive Evidence Snapshot + +- 이전 active plan/review pair는 구현 전에 source reanalysis로 대체됐다. 구현 evidence와 verdict는 없다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `apps/edge/internal/openai/hot_path_dispatch.go` +- `apps/edge/internal/openai/hot_path_light.go` +- `apps/edge/internal/openai/hot_path_cleanup.go` +- `apps/edge/internal/openai/hot_path_cleanup_test.go` +- `agent-test/local/rules.md` + +### SDD Criteria + +- 승인 SDD S15: one logical request를 route/stage/attempt/terminal/cleanup/orphan across time으로 join하고, actual path에서도 raw/secret absence와 bounded metric cardinality를 증명한다. + +### Verification Context + +- child 18 in-memory observer/collector와 deterministic fake stages를 사용한다. 외부 backend는 필요 없다. + +### Test Coverage Gaps + +- schema projection test만으로는 lifecycle callsite 누락, ordering, exactly-once counters, cleanup/orphan ownership, observer failure isolation을 증명할 수 없다. + +### Symbol References + +- public rename/remove 없음. Child 18 observer contract만 소비한다. + +### Split Judgment + +- stable contract: actual Hot Path lifecycle boundaries → closed observation schema. Schema construction은 child 18에 유지한다. + +### Scope Rationale + +- 새 sink contract, dashboard/backend, raw payload storage/hash, external smoke는 제외한다. + +### Final Routing + +- evaluation_mode=isolated-reassessment, finalizer=`finalize-task-policy.sh pair`. +- build scores=2/2/1/1/2, risks=`temporal_state,boundary_contract,variant_product`(3), local-fit → `PLAN-local-G08.md`. +- review → `CODE_REVIEW-cloud-G09.md`; `large_indivisible_context=false`, recovery=0/false. + +## Implementation Checklist + +- [ ] [API-1] Emit the predecessor observation contract across admission, dispatch, stage transition, terminal, cleanup, and orphan boundaries with exactly-once responsibility and failure isolation. +- [ ] [API-2] Add joined lifecycle, ordering/cardinality, raw/secret absence, and failure-isolation regressions on actual paths. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Lifecycle emission + +**Problem:** current logs do not join a Hot Path request across route, stage transitions, terminal choice, and deferred cleanup/orphan responsibility. + +**Solution:** Emit typed observations at admission/route selection, every dispatch start/end, local/review/repair transition, one outer disposition, cleanup attempt/result, and orphan/TTL handoff. Reuse request correlation only in log projection; metric labels stay enum/bucket-only. Assign terminal and cleanup counters to their single winning callsites, normalize causes before projection, and wrap every observer call so failure/panic cannot affect response or cleanup. + +**Modified Files and Checklist:** + +- [ ] Modify `apps/edge/internal/openai/hot_path_dispatch.go` at admission, route, dispatch attempt/result, and outer terminal boundaries. +- [ ] Modify `apps/edge/internal/openai/hot_path_light.go` at local/review/repair transition and attempt boundaries. +- [ ] Modify `apps/edge/internal/openai/hot_path_cleanup.go` at cleanup result and orphan/TTL responsibility boundaries. + +**Test Strategy:** direct, light-pass, light-repair, provider error, timeout/cancel, cleanup failure, and orphan rows produce exact lifecycle traces. + +**Verification:** targeted API-2 command exits 0. + +### [API-2] Actual-path evidence + +**Problem:** callsite coverage and absence of raw values need positive and negative evidence from real lifecycle paths. + +**Solution:** Capture ordered log/metric projections for all scenario rows. Assert join keys, monotonic attempt order, one terminal, one cleanup owner, bounded labels/buckets, observer failure isolation, and absence of seeded prompt/output/tool/header/credential/provider-error sentinels. + +**Modified Files and Checklist:** + +- [ ] Extend `apps/edge/internal/openai/hot_path_observation_test.go` with actual lifecycle, redaction/cardinality, and observer-failure rows. +- [ ] Record actual output in `agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/CODE_REVIEW-cloud-G09.md`. + +**Test Strategy:** exact ordered event classes and projected allowlists are the oracle. + +**Verification:** run Final Verification; all commands exit 0. + +## Dependencies and Execution Order + +1. Directory dependency `17` must produce `agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/complete.log`. +2. Directory dependency `18` must produce `agent-task/m-iop-hot-path-one-shot-execution/18+17_observation_schema/complete.log`. +3. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/hot_path_dispatch.go` | API-1 | +| `apps/edge/internal/openai/hot_path_light.go` | API-1 | +| `apps/edge/internal/openai/hot_path_cleanup.go` | API-1 | +| `apps/edge/internal/openai/hot_path_observation_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/CODE_REVIEW-cloud-G09.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(ObservationLifecycle|ObservationRejectsRawValues|MetricLabels|ObserverFailureIsolation|EndpointTerminalMatrix|Cleanup)' +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: exit 0, complete joined lifecycle, bounded raw-free projections, one terminal/cleanup owner, observation failure isolation, no race. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/code_review_cloud_G09_0.log b/agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/code_review_cloud_G09_0.log new file mode 100644 index 00000000..5a28d184 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/code_review_cloud_G09_0.log @@ -0,0 +1,100 @@ + + +# 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. +> 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. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle, plan=0, tag=API + +## For the Review Agent + +1. Append verdict and routing signals. +2. Archive `CODE_REVIEW-cloud-G09.md` → `code_review_cloud_G09_0.log` and `PLAN-local-G08.md` → `plan_local_G08_0.log`. +3. On PASS write `complete.log` and move to `agent-task/archive/YYYY/MM/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/`; otherwise write the directed next state. +4. Preserve/report `milestone-task=route-observability` on PASS. +5. Complete the review-only checklist at the final location. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| API-1 Lifecycle emission wiring | [ ] | +| API-2 Lifecycle and raw-free evidence | [ ] | + +## Implementation Checklist + +- [ ] [API-1] Wire the predecessor observation schema across admission, stage attempts/transitions, terminal, cleanup, and orphan responsibility while isolating observation failure from request behavior. +- [ ] [API-2] Add lifecycle joins, ordering, cardinality, exactly-once, and seeded raw/secret absence regressions and run the child verification commands. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure`. +- [ ] Verify verdict, dimension assessment, and Required/Suggested/Nit classifications match. +- [ ] Archive the active review to `code_review_cloud_G09_0.log`. +- [ ] Archive the active plan to `plan_local_G08_0.log`. +- [ ] Verify the Agent-Ops managed block in `.gitignore`. +- [ ] If PASS, write `complete.log` from the standard template and leave no active `.md` files. +- [ ] If PASS, move the task directory to the dated archive and update this checklist at the final location. +- [ ] If PASS, preserve/report `milestone-task=route-observability` without directly editing the roadmap. +- [ ] If PASS, remove the active parent only when no siblings/files remain. +- [ ] If WARN/FAIL, write the next filesystem state and do not write `complete.log`. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Verify every intended lifecycle boundary emits one typed event with joined request/stage/attempt state. +- Verify high-cardinality ids remain log-only and exact metric labels remain bounded. +- Verify raw/secret sentinel absence and observation failure isolation. + +## Verification Results + +### Targeted + +Command: `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathObservation|TestHotPathMetric|TestHotPath(EndpointTerminalMatrix|CancelCompleteRace|Cleanup)'` + +_Paste actual stdout/stderr and exit status._ + +### SDD common + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING]** Fill every implementation-owned section and leave review-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---|---|---| +| Header, Overview, Review Agent Instructions | Fixed | Implementer must not finalize | +| Implementation Item Completion, Implementation Checklist | Implementer checks only | Text/order stays fixed | +| Review-Only Checklist | Review agent | Implementer must not modify | +| Deviations, Key Design Decisions | Implementer | Record actual content | +| Reviewer Checkpoints | Fixed | Reviewer verifies | +| Verification Results | Implementer fills output | Command changes require deviation | +| Code Review Result | Review agent appends | Not included in stub | diff --git a/agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/plan_local_G08_0.log b/agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/plan_local_G08_0.log new file mode 100644 index 00000000..03a650be --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/plan_local_G08_0.log @@ -0,0 +1,120 @@ + + +# Raw-free Hot Path lifecycle wiring + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G09.md`의 구현 담당 섹션에 실제 notes/output을 채우고 active 파일을 유지한다. 차단 시 정확한 blocker/시도/출력/재개 조건만 기록하며 사용자 질문, archive, `complete.log` 작성은 하지 않는다. + +## Background + +Child 18의 closed schema를 admission, stage attempts/transitions, terminal, cleanup, orphan responsibility에 연결해 one logical request lifecycle을 만들고 raw-free cardinality guarantees를 실제 경로에서 검증한다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `apps/edge/internal/openai/hot_path_dispatch.go` +- `apps/edge/internal/openai/hot_path_light.go` +- `apps/edge/internal/openai/hot_path_cleanup.go` +- `apps/edge/internal/openai/hot_path_cleanup_test.go` +- `agent-test/local/rules.md` + +### SDD Criteria + +- 승인 SDD, `milestone-task=route-observability`, S15. +- request/preset/mode/stage/attempt, route reason, timing, terminal, cleanup/orphan lifecycle correlation과 actual-path raw/secret absence가 oracle이다. + +### Verification Context + +- in-memory zap observer and Prometheus collector provide deterministic evidence; no backend is required. + +### Test Coverage Gaps + +- schema projection tests alone do not prove every lifecycle boundary, join order, exactly-once counter, or failure isolation. + +### Symbol References + +- no rename/remove; use predecessor typed schema only. + +### Split Judgment + +- stable contract: Hot Path lifecycle boundaries → child 18 observation schema. +- schema construction is predecessor 18; dashboard/backend/smoke are excluded. + +### Scope Rationale + +- no durable store, new observation sink contract, raw payload hashing, dashboard, or alert. + +### Final Routing + +- evaluation_mode=isolated-reassessment, finalizer=`finalize-task-policy.sh pair`. +- build closures 모두 true, scores=2/2/1/1/2, G08, local-fit → `PLAN-local-G08.md`. +- review closures 모두 true, scores=2/2/1/2/2, G09, official-review → `CODE_REVIEW-cloud-G09.md`. +- risks=`temporal_state,boundary_contract,variant_product`(3), `large_indivisible_context=false`, recovery=0/false, capability gap 없음. + +## Implementation Checklist + +- [ ] [API-1] Wire the predecessor observation schema across admission, stage attempts/transitions, terminal, cleanup, and orphan responsibility while isolating observation failure from request behavior. +- [ ] [API-2] Add lifecycle joins, ordering, cardinality, exactly-once, and seeded raw/secret absence regressions and run the child verification commands. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [API-1] Lifecycle emission wiring + +**Problem:** generic dispatch logs do not join one Hot Path request across route, stage, terminal, and cleanup boundaries. + +**Solution:** Emit the predecessor typed event at admission, dispatch start/end, transition, terminal, cleanup result, and TTL/orphan handoff. Normalize timing/outcome/reason, keep high-cardinality ids log-only, and isolate log/metric failures from request semantics. + +**Modified Files and Checklist:** + +- [ ] Modify `apps/edge/internal/openai/hot_path_dispatch.go` at admission/dispatch/transition boundaries. +- [ ] Modify `apps/edge/internal/openai/hot_path_light.go` at review/repair attempt transitions. +- [ ] Modify `apps/edge/internal/openai/hot_path_cleanup.go` at terminal/cleanup/orphan boundaries. + +**Test Strategy:** API-2 exercises direct success, light pass/repair, provider error, cancel, cleanup failure, and orphan responsibility. + +**Verification:** `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(ObservationLifecycle|ObservationRejectsRawValues|Metric)'` exits 0. + +### [API-2] Lifecycle and raw-free evidence + +**Problem:** S15 needs actual-path positive lifecycle evidence and negative sentinel evidence. + +**Solution:** Capture all emitted records/metrics for the scenario rows. Assert attempt ordering, request-stage joins, bounded timing bucket, terminal/cleanup responsibility, exactly-once counters, failure isolation, and absence of seeded prompt/output/tool/header/credential/error values. + +**Modified Files and Checklist:** + +- [ ] Extend `apps/edge/internal/openai/hot_path_observation_test.go` with `TestHotPathObservationLifecycle` and actual-path redaction/cardinality rows. +- [ ] Fill `agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/CODE_REVIEW-cloud-G09.md`. + +**Test Strategy:** compare ordered event classes and exact projected keys/labels; use no external backend. + +**Verification:** run Final Verification; all lifecycle rows pass. + +## Dependencies and Execution Order + +1. `17+14,15,16_endpoint_error_matrix` must produce its active `complete.log`. +2. `18+17_observation_schema` must produce its active `complete.log`. +3. Implement API-1, then API-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `apps/edge/internal/openai/hot_path_dispatch.go` | API-1 | +| `apps/edge/internal/openai/hot_path_light.go` | API-1 | +| `apps/edge/internal/openai/hot_path_cleanup.go` | API-1 | +| `apps/edge/internal/openai/hot_path_observation_test.go` | API-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/CODE_REVIEW-cloud-G09.md` | API-2 | + +## Final Verification + +```bash +go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPathObservation|TestHotPathMetric|TestHotPath(EndpointTerminalMatrix|CancelCompleteRace|Cleanup)' +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: exit 0, joined raw-free lifecycle, bounded metrics, no sentinel/credential value, empty diff check. Cached output is not acceptable. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/CODE_REVIEW-cloud-G08.md b/agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/CODE_REVIEW-cloud-G08.md new file mode 100644 index 00000000..9b1a383c --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/CODE_REVIEW-cloud-G08.md @@ -0,0 +1,87 @@ + + +# Code Review Reference - TEST + +> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is mandatory.** Fill implementation-owned self-test evidence and leave active files in place. Do not run actual credentials in this child. Verdict/finalization is review-agent-only. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness, plan=2, tag=TEST + +## Archive Evidence Snapshot + +- Plan/review 1 was superseded before implementation; it contains no implementation verdict/evidence. + +## For the Review Agent + +Verify harness/schema safety and deterministic self-test, archive to `code_review_cloud_G08_2.log` and `plan_local_G08_2.log`, then finalize by verdict. Preserve `milestone-task=hot-smoke` on PASS. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| TEST-1 Harness and schema | [ ] | +| TEST-2 Credential-free harness evidence | [ ] | + +## Implementation Checklist + +- [ ] [TEST-1] Add a secret-safe Claude/Pi harness and explicit JSON manifest schema for the fixed 10-row matrix, source/runtime identity, observation, workspace, terminal, cleanup, and redaction evidence. +- [ ] [TEST-2] Add credential-free fake-agent/runtime self-tests for success, expected failure, cancellation, schema rejection, identity mismatch, redaction, and cleanup. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append verdict/routing signals and verify findings/dimensions. +- [ ] Archive review/plan to suffix `2`; verify `.gitignore` managed block. +- [ ] On PASS write `complete.log`, preserve metadata, archive child; on WARN/FAIL write directed state without completion. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Confirm exact Claude/Pi argv, fixed 2×5 rows, JSON schema, source/runtime fingerprint validation, disposable workspace, and child-only cancellation. +- Confirm missing/mismatched inputs exit 69 before provider invocation and no secret/raw value is echoed or serialized. +- Confirm self-test uses only fake agents/runtime and this child does not modify Makefile or perform actual external calls. + +## Verification Results + +### Syntax + +Command: `bash -n scripts/e2e-hot-path-agents.sh` + +_Paste actual stdout/stderr and exit status._ + +### Schema + +Command: `jq -e '.type == "object" and (.required | index("cases")) and (.properties.cases.minItems == 10) and (.properties.cases.maxItems == 10)' scripts/fixtures/hot-path-agent-smoke-manifest.schema.json` + +_Paste actual stdout/stderr and exit status._ + +### Self-test + +Command: `./scripts/e2e-hot-path-agents.sh --self-test` + +_Paste actual stdout/stderr and exit status._ + +### Common regression + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +## Section Ownership + +Implementer owns completion status, deviations, decisions, and outputs. Reviewer alone owns review-only actions and final result. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/PLAN-local-G08.md b/agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/PLAN-local-G08.md new file mode 100644 index 00000000..d123df18 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/PLAN-local-G08.md @@ -0,0 +1,121 @@ + + +# Claude/Pi Hot Path smoke harness and manifest contract + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G08.md`의 구현 담당 섹션에 실제 syntax/self-test 출력을 채우고 active 파일을 유지한다. 차단 시 정확한 blocker와 재개 조건만 기록하며 archive/`complete.log` 작성이나 상태 판정은 하지 않는다. + +## Background + +실제 Claude/Pi 검증 전에 secret-safe invocation, fixed 10-row scenario matrix, runtime/source identity, observation/workspace evidence, child-only cancellation, manifest schema를 credential-free self-test로 닫는다. 외부 credential/runtime 사용과 Make integration은 child 21이다. + +## Archive Evidence Snapshot + +- 이전 active plan/review pair는 구현 전에 source reanalysis로 대체됐다. 구현 evidence와 verdict는 없다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `scripts/e2e-openai-cli-workspace.sh` +- `agent-test/local/rules.md` +- `agent-test/local/edge-smoke.md` +- `agent-test/dev/edge-smoke.md` +- `agent-test/inventory-agent.yaml` + +### SDD Criteria + +- 승인 SDD S16: Claude/Pi 각각 direct, light-pass, light-repair, write-unavailable, timeout-cancel의 5개 row; native visible stream/terminal, workspace before/after, observation, cleanup/orphan, zero secret match. + +### Verification Context + +- 현재 binary help 기준 Claude는 `--print --output-format stream-json --include-partial-messages --no-session-persistence --bare`를, Pi는 `--provider --model --mode json --print --no-session`을 지원한다. +- 이 child의 oracle은 fake agent/runtime/observation을 쓰는 credential-free self-test다. 실제 외부 호출은 금지한다. + +### Test Coverage Gaps + +- CLI별 exact flags, malformed runtime evidence, source mismatch, schema validation, disposable workspace, write failure, timeout child cancellation, redaction을 한 harness에서 검증하지 않는다. + +### Symbol References + +- none. + +### Split Judgment + +- stable contract: validated inputs/agent adapters → schema-validated secret-free evidence manifest. Actual external execution/Make targets은 child 21이다. + +### Scope Rationale + +- Makefile, credential provisioning, actual provider calls, shared process/config mutation, deployment, tracked output은 제외한다. + +### Final Routing + +- evaluation_mode=isolated-reassessment, finalizer=`finalize-task-policy.sh pair`. +- build scores=2/1/1/2/2, risks=`boundary_contract,structured_interpretation,variant_product`(3), local-fit → `PLAN-local-G08.md`. +- review → `CODE_REVIEW-cloud-G08.md`; `large_indivisible_context=false`, recovery=0/false. + +## Implementation Checklist + +- [ ] [TEST-1] Add a secret-safe Claude/Pi harness and explicit JSON manifest schema for the fixed 10-row matrix, source/runtime identity, observation, workspace, terminal, cleanup, and redaction evidence. +- [ ] [TEST-2] Add credential-free fake-agent/runtime self-tests for success, expected failure, cancellation, schema rejection, identity mismatch, redaction, and cleanup. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [TEST-1] Harness and schema + +**Problem:** the existing synthetic CLI workspace smoke does not invoke Claude/Pi adapters or produce reviewable Hot Path lifecycle evidence. + +**Solution:** Add `scripts/e2e-hot-path-agents.sh` with `--self-test`, `--preflight-only`, and actual modes. Validate non-secret inputs without printing their values, require a runtime evidence fingerprint matching source/config/binary/fixture identity, and define four deterministic aliases (direct/pass/repair/slow). Execute the fixed Claude/Pi × five-scenario matrix in `mktemp` disposable workspaces; model write-unavailable by permissions/workspace fixture, signal timeout only to the spawned child, parse visible protocol/terminal/observation/cleanup evidence, and write atomically to a caller-supplied output. Add a tracked JSON schema that fixes required fields/enums while prohibiting secret/raw content fields. + +**Modified Files and Checklist:** + +- [ ] Add executable `scripts/e2e-hot-path-agents.sh` with strict input handling, CLI-specific adapters, isolated traps, fixed scenario matrix, evidence parsing, and atomic manifest output. +- [ ] Add `scripts/fixtures/hot-path-agent-smoke-manifest.schema.json` with the reviewable manifest contract and closed scenario/agent/verdict enums. + +**Test Strategy:** TEST-2 supplies fake binaries/runtime evidence/logs; no network or credentials. + +**Verification:** syntax, schema, and self-test commands exit 0. + +### [TEST-2] Credential-free harness evidence + +**Problem:** harness safety and parsing must be proven before any external identity is available. + +**Solution:** Self-test exact Claude/Pi argv without logging secret env, 10-row success/expected-failure manifests, malformed/missing input exit 69 before agent invocation, source/runtime mismatch, schema rejection, seeded secret/raw redaction, child-only timeout signaling, workspace cleanup, and observation/cleanup/orphan joins. Validate output structurally with `jq` against schema-required fields. + +**Modified Files and Checklist:** + +- [ ] Implement fake fixtures and assertions inside `scripts/e2e-hot-path-agents.sh` self-test mode. +- [ ] Record actual output in `agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/CODE_REVIEW-cloud-G08.md`. + +**Test Strategy:** self-test creates/removes all fixtures below a temporary directory and asserts no parent/shared process mutation. + +**Verification:** run Final Verification; all commands exit 0. + +## Dependencies and Execution Order + +1. Directory dependency `17` must produce `agent-task/m-iop-hot-path-one-shot-execution/17+14,15,16_endpoint_error_matrix/complete.log`. +2. Directory dependency `19` must produce `agent-task/m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle/complete.log`. +3. Implement TEST-1, then TEST-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `scripts/e2e-hot-path-agents.sh` | TEST-1, TEST-2 | +| `scripts/fixtures/hot-path-agent-smoke-manifest.schema.json` | TEST-1 | +| `agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/CODE_REVIEW-cloud-G08.md` | TEST-2 | + +## Final Verification + +```bash +bash -n scripts/e2e-hot-path-agents.sh +jq -e '.type == "object" and (.required | index("cases")) and (.properties.cases.minItems == 10) and (.properties.cases.maxItems == 10)' scripts/fixtures/hot-path-agent-smoke-manifest.schema.json +./scripts/e2e-hot-path-agents.sh --self-test +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: exit 0, exact safe argv/matrix/schema behavior, deterministic failure/cancel/redaction/cleanup fixtures, no credential or network dependency. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/code_review_cloud_G08_0.log b/agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/code_review_cloud_G08_0.log new file mode 100644 index 00000000..7719728c --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/code_review_cloud_G08_0.log @@ -0,0 +1,125 @@ + + +# 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. +> If blocked, record exact preflight output and resume condition only. +> Do not ask the user, call user-input tools, classify the next state, archive files, or write `complete.log`. +> Finalization is review-agent-only. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/17+15,16_hot_smoke, plan=0, tag=TEST + +## For the Review Agent + +> **[REVIEW AGENT ONLY]** Compare implementation/output against the plan. Exit 69 or absent actual Claude/Pi evidence cannot PASS S16. Implementers must not finalize. + +1. Append verdict and routing signals. +2. Archive `CODE_REVIEW-cloud-G08.md` → `code_review_cloud_G08_0.log` and `PLAN-local-G08.md` → `plan_local_G08_0.log`. +3. If PASS, write `complete.log` and move to `agent-task/archive/YYYY/MM/m-iop-hot-path-one-shot-execution/17+15,16_hot_smoke/`; otherwise write the directed next state. +4. Preserve/report `milestone-task=hot-smoke` on PASS. +5. Complete the review-only checklist at the final location. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| TEST-1 Agent smoke harness | [ ] | +| TEST-2 Make integration and actual evidence | [ ] | + +## Implementation Checklist + +- [ ] [TEST-1] Add a secret-safe Claude/Pi Hot Path harness with deterministic preflight, scenario matrix, raw-free manifest, workspace before/after, and credential-free self-test. +- [ ] [TEST-2] Add separate self-test, external-preflight, and actual Make targets; run local/common verification, then run the actual two-protocol smoke or record the exact external blocker and resume command. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append one PASS/WARN/FAIL verdict and verified routing signals. +- [ ] Verify verdict, dimensions, and finding classifications match. +- [ ] Archive `CODE_REVIEW-cloud-G08.md` to `code_review_cloud_G08_0.log`. +- [ ] Archive `PLAN-local-G08.md` to `plan_local_G08_0.log`. +- [ ] Verify the `.gitignore` managed block. +- [ ] On PASS write standard `complete.log` and leave no active `.md` files. +- [ ] On PASS move the task directory to dated archive and update this checklist there. +- [ ] On PASS preserve/report `milestone-task=hot-smoke` without editing roadmap directly. +- [ ] Remove active parent only if empty. +- [ ] On WARN/FAIL write the next state and no `complete.log`. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Verify self-test cannot substitute for the required actual Claude/Pi 10-case run. +- Verify runtime/model/CLI/workspace preflight, child-only cancellation, workspace before/after and artifact cleanup/orphan evidence. +- Verify matching source fingerprint, runtime binary/config/fixture evidence, four deterministic scenario aliases, and request-correlated observation log input. +- Inspect manifest/logs for native visible events and zero raw secret matches; verify no shared process/config was mutated. + +## Verification Results + +### Local syntax/self-test/preflight + +Commands: + +```bash +bash -n scripts/e2e-hot-path-agents.sh +./scripts/e2e-hot-path-agents.sh --self-test +make test-hot-path-agent-smoke-self-test +``` + +_Paste actual stdout/stderr and exit status for each._ + +### SDD common + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### External actual smoke + +Commands: + +```bash +test -n "${IOP_HOT_SMOKE_BASE_URL:-}" && test -n "${IOP_HOT_SMOKE_DIRECT_MODEL:-}" && test -n "${IOP_HOT_SMOKE_PASS_MODEL:-}" && test -n "${IOP_HOT_SMOKE_REPAIR_MODEL:-}" && test -n "${IOP_HOT_SMOKE_SLOW_MODEL:-}" && test -n "${IOP_HOT_SMOKE_PI_PROVIDER:-}" && test -n "${PI_CODING_AGENT_DIR:-}" && test -n "${ANTHROPIC_API_KEY:-}" && test -n "${IOP_HOT_SMOKE_RUNTIME_EVIDENCE:-}" && test -n "${IOP_HOT_SMOKE_OBSERVATION_FILE:-}" && test -n "${IOP_HOT_SMOKE_WORKSPACE_PARENT:-}" && test -n "${IOP_HOT_SMOKE_OUTPUT:-}" +IOP_HOT_SMOKE_SOURCE_FINGERPRINT="$(git ls-files --cached --others --exclude-standard -- apps/edge packages/go/streamgate packages/go/config go.mod go.sum | LC_ALL=C sort | while IFS= read -r path; do printf '%s\0%s\n' "$path" "$(git hash-object --no-filters "$path")"; done | git hash-object --stdin)" +export IOP_HOT_SMOKE_SOURCE_FINGERPRINT +jq -e --arg fingerprint "$IOP_HOT_SMOKE_SOURCE_FINGERPRINT" '.source_fingerprint == $fingerprint and (.binary_sha256 | type == "string" and length > 0) and (.config_sha256 | type == "string" and length > 0) and (.fixture_revision | type == "string" and length > 0)' "${IOP_HOT_SMOKE_RUNTIME_EVIDENCE}" +make test-hot-path-agent-smoke-preflight +make test-hot-path-agent-smoke +jq -e '.schema_version == 1 and (.cases | length == 10) and all(.cases[]; .verdict == "pass") and (.redaction.secret_matches == 0)' "${IOP_HOT_SMOKE_OUTPUT}" +``` + +_Paste actual output and manifest path. Exit 69 is blocker evidence, not PASS._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING]** Fill every implementation-owned section and leave review-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---|---|---| +| Header, Overview, Review Agent Instructions | Fixed | Implementer must not modify or finalize | +| Implementation Item Completion, Implementation Checklist | Implementer checks only | Text/order stays fixed | +| Review-Only Checklist | Review agent | Implementer must not modify | +| Deviations, Key Design Decisions | Implementer | Record actual content | +| Reviewer Checkpoints | Fixed | Reviewer verifies | +| Verification Results | Implementer fills output | Command changes require deviation | +| Code Review Result | Review agent appends | Not included in stub | diff --git a/agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/code_review_cloud_G08_1.log b/agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/code_review_cloud_G08_1.log new file mode 100644 index 00000000..720dd0eb --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/code_review_cloud_G08_1.log @@ -0,0 +1,106 @@ + + +# 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. +> 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. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness, plan=1, tag=TEST + +## For the Review Agent + +1. Append verdict and routing signals. +2. Archive `CODE_REVIEW-cloud-G08.md` → `code_review_cloud_G08_1.log` and `PLAN-local-G08.md` → `plan_local_G08_1.log`. +3. On PASS write `complete.log` and move to `agent-task/archive/YYYY/MM/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/`; otherwise write the directed next state. +4. Preserve/report `milestone-task=hot-smoke` on PASS. This child alone does not complete S16 actual smoke. +5. Complete the review-only checklist at the final location. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| TEST-1 Agent smoke harness core | [ ] | +| TEST-2 Credential-free harness evidence | [ ] | + +## Implementation Checklist + +- [ ] [TEST-1] Add a secret-safe Claude/Pi Hot Path harness with deterministic input validation, scenario matrix, raw-free manifest, workspace/artifact before/after, and child-only cancellation. +- [ ] [TEST-2] Add credential-free fake-agent/fake-runtime self-tests for success, expected failure, cancel, redaction, malformed evidence, and cleanup, then run the child verification commands. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure`. +- [ ] Verify verdict, dimension assessment, and Required/Suggested/Nit classifications match. +- [ ] Archive the active review to `code_review_cloud_G08_1.log`. +- [ ] Archive the active plan to `plan_local_G08_1.log`. +- [ ] Verify the Agent-Ops managed block in `.gitignore`. +- [ ] If PASS, write `complete.log` from the standard template and leave no active `.md` files. +- [ ] If PASS, move the task directory to the dated archive and update this checklist at the final location. +- [ ] If PASS, preserve/report `milestone-task=hot-smoke` without directly editing the roadmap. +- [ ] Verify self-test is not represented as S16 actual external completion. +- [ ] If PASS, remove the active parent only when no siblings/files remain. +- [ ] If WARN/FAIL, write the next filesystem state and do not write `complete.log`. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Verify strict non-secret input validation, fixed manifest schema, source/runtime evidence checks, child-only cancel, and isolated workspace cleanup. +- Verify fake Claude/Pi/runtime rows cover success/failure/cancel/redaction/malformed evidence. +- Verify no shared process/config mutation and no claim of actual external completion. + +## Verification Results + +### Syntax and self-test + +Commands: + +```bash +bash -n scripts/e2e-hot-path-agents.sh +./scripts/e2e-hot-path-agents.sh --self-test +``` + +_Paste actual stdout/stderr and exit status for each._ + +### SDD common + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING]** Fill every implementation-owned section and leave review-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---|---|---| +| Header, Overview, Review Agent Instructions | Fixed | Implementer must not finalize | +| Implementation Item Completion, Implementation Checklist | Implementer checks only | Text/order stays fixed | +| Review-Only Checklist | Review agent | Implementer must not modify | +| Deviations, Key Design Decisions | Implementer | Record actual content | +| Reviewer Checkpoints | Fixed | Reviewer verifies | +| Verification Results | Implementer fills output | Command changes require deviation | +| Code Review Result | Review agent appends | Not included in stub | diff --git a/agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/plan_local_G08_0.log b/agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/plan_local_G08_0.log new file mode 100644 index 00000000..4fcfa6f6 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/plan_local_G08_0.log @@ -0,0 +1,160 @@ + + +# Claude/Pi Hot Path streaming smoke harness + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G08.md`의 구현 담당 섹션에 self-test와 실제 external run의 원문 출력을 채우고 active 파일을 유지한다. 외부 환경이 없으면 정확한 preflight blocker와 재개 조건만 기록하며 사용자 질문, 상태 판정, archive, `complete.log` 작성은 하지 않는다. + +## Background + +단위·handler fixture만으로는 실제 Claude Messages와 Pi Chat agent가 tool loop, visible stage output, artifact lifecycle, terminal을 소비하는지 증명할 수 없다. secret을 출력하지 않는 공통 harness와 재현 가능한 manifest를 만들고 두 agent×핵심 시나리오를 외부 runtime에서 실행한다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `Makefile` +- `scripts/e2e-openai-cli-workspace.sh` +- `agent-test/local/rules.md` +- `agent-test/local/edge-smoke.md` +- `agent-test/dev/edge-smoke.md` +- `agent-test/inventory-agent.yaml` + +### SDD Criteria + +- 승인 SDD, `milestone-task=hot-smoke`, S16. +- Evidence Map S16은 actual Claude/Pi streaming log와 workspace before/after를 요구한다. direct, light pass, defect repair, write unavailable, timeout/cancel 및 cleanup을 protocol별 manifest rows로 고정한다. + +### Verification Context + +- handoff 없음. local이 기본 환경이며 현재 checkout은 `/config/workspace/iop-s0`, branch `feature/iop-hot-path-one-shot-execution`, HEAD `6650e9f70d0104220d8077dd1d469b6a1facb9da`; 계획 작성 시작 시 worktree clean이었다. +- OS/arch=`Linux 6.10.14-linuxkit aarch64`; Go=`/config/.local/bin/go`, `go1.26.2`; `curl`, `jq`, `timeout` 사용 가능하고 `ss`는 없다. +- `claude`=`/config/.npm-global/bin/claude`, version `2.1.220`; `claude --help`에서 `--print --output-format stream-json --include-partial-messages --no-session-persistence` 확인. +- `pi`=`/config/.npm-global/bin/pi`, version `0.81.1`; `pi --help`에서 `--provider --model --mode json --print --no-session` 확인. inventory의 기록 버전 0.80.3과 drift가 있으므로 actual manifest에 관측 버전을 기록한다. +- 현재 local에는 확인된 preset-backed Edge/Node listener나 runtime identity가 없고 여러 공유 Claude/Pi process가 실행 중이므로 건드리지 않는다. dev inventory에서 Pi는 configured, Claude는 not_configured이며 dev base 후보는 `http://toki-labs.com:18083/v1`이나 실제 S16 runner로 확정하지 않는다. + +#### External Verification Preflight + +- runner owner: credential과 writable disposable workspace를 가진 operator/review runner. +- preflight는 repo root/branch/HEAD/dirty, CLI absolute path/version/help capability, supplied config/profile path, non-secret runtime identity, runtime evidence manifest의 source HEAD/source fingerprint/binary/config/edge id/fixture revision, `/healthz`·`/v1/models`, deterministic direct/pass/repair/slow scenario aliases, readable Hot Path observation log, workspace writability와 before snapshot을 manifest에 기록한다. +- secret은 environment/config에서만 읽고 값·header·command expansion을 출력하지 않는다. missing runtime/model/auth/workspace는 provider 호출 전에 exit 69와 exact resume condition을 남긴다. +- current blocker: active test-only preset Edge, Claude auth, Pi config, deterministic direct/pass/repair/slow virtual model aliases, runtime evidence manifest, readable observation log, disposable workspace parent, output path가 공급되지 않았다. harness self-test 구현은 가능하지만 S16 PASS는 external run까지 보류된다. + +### Test Coverage Gaps + +- 실제 Claude/Pi direct/light/repair/failure/cancel 및 workspace cleanup을 한 형식으로 수집하는 repo script가 없다. +- harness parser/preflight 자체는 credential-free self-test가 필요하다. + +### Symbol References + +- none. + +### Split Judgment + +- stable contract: external agent invocation + raw-free JSON manifest + workspace before/after oracle. +- predecessors 15와 16의 active `complete.log`는 현재 missing이며 둘 다 실제 smoke 전에 필요하다. + +### Scope Rationale + +- Claude/Pi binary/config patch, secret provisioning, shared process 종료, dev deployment 변경, tracked smoke output은 제외한다. +- harness는 runtime을 소유하지 않고 supplied endpoint/profile을 검증·호출만 한다. + +### Final Routing + +- evaluation_mode=write, finalizer=`finalize-task-policy.sh pair`. +- build closures 모두 true(외부 소유권/재개 조건 포함), scores=2/1/1/2/2, G08, local-fit → `PLAN-local-G08.md`. +- review closures 모두 true, scores=2/1/1/2/2, G08, official-review → `CODE_REVIEW-cloud-G08.md`. +- `large_indivisible_context=false`; risks=`boundary_contract,structured_interpretation,variant_product`(3); recovery=0/false; capability gap 없음. External execution unavailability is an explicit verification blocker, not an implementation capability gap. + +## Implementation Checklist + +- [ ] [TEST-1] Add a secret-safe Claude/Pi Hot Path harness with deterministic preflight, scenario matrix, raw-free manifest, workspace before/after, and credential-free self-test. +- [ ] [TEST-2] Add separate self-test, external-preflight, and actual Make targets; run local/common verification, then run the actual two-protocol smoke or record the exact external blocker and resume command. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [TEST-1] Agent smoke harness + +**Problem:** `scripts/e2e-openai-cli-workspace.sh:132` verifies a synthetic CLI `/v1/responses` flow only; it neither invokes Claude/Pi nor validates preset stage/cleanup evidence. + +**Solution:** Add `scripts/e2e-hot-path-agents.sh` with `--preflight-only`, `--self-test`, and actual run modes. Require non-empty environment values for base URL, direct/pass/repair/slow model aliases, Pi provider/config dir, runtime evidence manifest, readable observation log, disposable workspace parent, and output manifest without echoing secrets; require `ANTHROPIC_API_KEY` only by presence and never serialize it. Compute a deterministic fingerprint over the current tracked Edge/streamgate/config sources and require the runtime evidence `source_fingerprint` to match, in addition to recording HEAD, binary/config hashes, edge id and deterministic fixture revision. Require `/v1/models` to expose four scenario aliases whose test-only provider fixture guarantees direct, light-pass, light-defect→repair, and delayed/cancel behavior; do not depend on natural-language route/review luck. Create isolated per-agent/per-scenario git workspaces under `mktemp -d`, capture before/after `git status --porcelain=v1`, agent stream output, request-correlated observation log slices, and `.iop/job` lifecycle. Run matrix `{claude,pi} × {direct,light-pass,repair,write-unavailable,timeout-cancel}`; verify visible stage markers, native terminal, expected failure class, cleanup/orphan responsibility, and no raw credential in output. Signal cancel with `timeout --signal=INT` to the child only and never kill shared processes. + +Before (`Makefile:1`): + +```make +.PHONY: ... test-iop-agent-logged-smoke-preflight ... +``` + +After: + +```make +.PHONY: ... test-hot-path-agent-smoke-self-test test-hot-path-agent-smoke-preflight test-hot-path-agent-smoke ... +``` + +Manifest contains fixed schema/version, runner/checkout/CLI/runtime non-secret facts, scenario model/fixture identity, one row per matrix case, ordered visible event classes, terminal/outcome, workspace before/after hashes/status, reserved artifact created/removed/orphan classification, correlated observation event classes, and log paths. Redact environment names matching token/key/auth/credential and fail if sentinel secret appears. + +**Modified Files and Checklist:** + +- [ ] Add executable `scripts/e2e-hot-path-agents.sh` with strict argument/env validation, isolated cleanup trap, manifest validation, and fake-agent/fake-runtime `--self-test`. + +**Test Strategy:** `--self-test` creates temporary fake `claude`, `pi`, and HTTP/runtime evidence, exercises success, expected failure, cancel, redaction, malformed manifest, and cleanup without network credentials. + +**Verification:** `bash -n scripts/e2e-hot-path-agents.sh && ./scripts/e2e-hot-path-agents.sh --self-test` exits 0. + +### [TEST-2] Make integration and actual evidence + +**Problem:** There is no stable entry point or exact external resume command for S16, and one target cannot simultaneously be a credential-free local check and a strict external preflight that exits 69 when inputs are missing. + +**Solution:** Add three Make targets. `test-hot-path-agent-smoke-self-test` runs syntax plus credential-free fixtures and must exit 0 locally. `test-hot-path-agent-smoke-preflight` performs only non-mutating external checks and returns 69 before provider invocation when inputs are absent. `test-hot-path-agent-smoke` calls the harness once and runs both agents/matrix cases into the supplied output file. Do not add credentialed targets to `test-e2e`. + +**Modified Files and Checklist:** + +- [ ] Modify `Makefile` with `test-hot-path-agent-smoke-self-test`, `test-hot-path-agent-smoke-preflight`, and `test-hot-path-agent-smoke`, passing required environment without printing values. +- [ ] Fill `agent-task/m-iop-hot-path-one-shot-execution/17+15,16_hot_smoke/CODE_REVIEW-cloud-G08.md` with self-test output, external preflight, actual manifest summary, and saved raw output paths; if blocked, record exit 69 output and exact resume conditions. + +**Test Strategy:** Make preflight/self-test is mandatory locally. S16 completion additionally requires actual run with both installed binaries, an active preset runtime, and disposable workspace. + +**Verification:** run the local and external commands below. Actual manifest must contain 10 passing/expected-failure rows and no secret sentinel. + +## Dependencies and Execution Order + +1. `15+13,14_error_cancel` must produce its active `complete.log`. +2. `16+15_route_observability` must produce its active `complete.log`. +3. Implement/test harness, then run external preflight and actual smoke. + +## Modified Files Summary + +| File | Item | +|---|---| +| `scripts/e2e-hot-path-agents.sh` | TEST-1 | +| `Makefile` | TEST-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/17+15,16_hot_smoke/CODE_REVIEW-cloud-G08.md` | TEST-2 | + +## Final Verification + +Local deterministic verification: + +```bash +bash -n scripts/e2e-hot-path-agents.sh +./scripts/e2e-hot-path-agents.sh --self-test +make test-hot-path-agent-smoke-self-test +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +External preflight and actual run after the required environment is supplied out-of-band: + +```bash +test -n "${IOP_HOT_SMOKE_BASE_URL:-}" && test -n "${IOP_HOT_SMOKE_DIRECT_MODEL:-}" && test -n "${IOP_HOT_SMOKE_PASS_MODEL:-}" && test -n "${IOP_HOT_SMOKE_REPAIR_MODEL:-}" && test -n "${IOP_HOT_SMOKE_SLOW_MODEL:-}" && test -n "${IOP_HOT_SMOKE_PI_PROVIDER:-}" && test -n "${PI_CODING_AGENT_DIR:-}" && test -n "${ANTHROPIC_API_KEY:-}" && test -n "${IOP_HOT_SMOKE_RUNTIME_EVIDENCE:-}" && test -n "${IOP_HOT_SMOKE_OBSERVATION_FILE:-}" && test -n "${IOP_HOT_SMOKE_WORKSPACE_PARENT:-}" && test -n "${IOP_HOT_SMOKE_OUTPUT:-}" +IOP_HOT_SMOKE_SOURCE_FINGERPRINT="$(git ls-files --cached --others --exclude-standard -- apps/edge packages/go/streamgate packages/go/config go.mod go.sum | LC_ALL=C sort | while IFS= read -r path; do printf '%s\0%s\n' "$path" "$(git hash-object --no-filters "$path")"; done | git hash-object --stdin)" +export IOP_HOT_SMOKE_SOURCE_FINGERPRINT +jq -e --arg fingerprint "$IOP_HOT_SMOKE_SOURCE_FINGERPRINT" '.source_fingerprint == $fingerprint and (.binary_sha256 | type == "string" and length > 0) and (.config_sha256 | type == "string" and length > 0) and (.fixture_revision | type == "string" and length > 0)' "${IOP_HOT_SMOKE_RUNTIME_EVIDENCE}" +make test-hot-path-agent-smoke-preflight +make test-hot-path-agent-smoke +jq -e '.schema_version == 1 and (.cases | length == 10) and all(.cases[]; .verdict == "pass") and (.redaction.secret_matches == 0)' "${IOP_HOT_SMOKE_OUTPUT}" +``` + +Expected: local self-test commands exit 0; external preflight proves matching source fingerprint plus runtime binary/config/fixture identity, four deterministic scenario aliases, CLIs, observation source and workspace without secret output; actual manifest has 10 pass rows, visible stream events, correlated lifecycle evidence, expected native terminals, correct artifact before/after, and zero secret matches. Fingerprint mismatch requires rebuilding/redeploying Edge/Node from the current worktree with `make build-edge build-node`, regenerating the runtime evidence manifest and rerunning preflight. Exit 69 is BLOCKED evidence, not PASS. Cached Go output is not acceptable. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/plan_local_G08_1.log b/agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/plan_local_G08_1.log new file mode 100644 index 00000000..ca46e9b3 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/plan_local_G08_1.log @@ -0,0 +1,119 @@ + + +# Claude/Pi Hot Path smoke harness + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G08.md`의 구현 담당 섹션에 syntax/self-test 원문 출력을 채우고 active 파일을 유지한다. 차단 시 정확한 blocker와 재개 조건만 기록하며 사용자 질문, 상태 판정, archive, `complete.log` 작성은 하지 않는다. + +## Background + +실제 Claude/Pi smoke를 secret-safe하고 deterministic하게 실행할 공통 harness와 parser/preflight self-test가 없다. 이 child는 외부 credential/runtime 없이 구현·검증 가능한 harness core를 만든다. Make integration과 actual external evidence는 child 21에서 닫는다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `scripts/e2e-openai-cli-workspace.sh` +- `agent-test/local/rules.md` +- `agent-test/local/edge-smoke.md` +- `agent-test/dev/edge-smoke.md` +- `agent-test/inventory-agent.yaml` + +### SDD Criteria + +- 승인 SDD, `milestone-task=hot-smoke`, S16. +- 이 child는 secret-safe invocation, deterministic scenario manifest, isolated workspace before/after, child-only cancel, cleanup/orphan parsing의 harness evidence를 제공한다. +- S16 PASS는 child 21의 actual Claude/Pi 10-case run까지 필요하다. + +### Verification Context + +- current checkout/CLI facts and external preflight requirements are inherited from the parent plan. +- credential-free fake-agent/fake-runtime self-test is the deterministic oracle for this child. + +### Test Coverage Gaps + +- Claude/Pi invocation, raw-free manifest, workspace/artifact lifecycle, cancel, and malformed input paths을 한 script로 검증하는 self-test가 없다. + +### Symbol References + +- none. + +### Split Judgment + +- stable contract: external agent/runtime inputs → secret-safe manifest and workspace oracle. +- Make targets and actual external evidence are closure child 21. +- terminal/observation semantics are supplied by predecessors 17 and 19. + +### Scope Rationale + +- Makefile changes, actual provider calls, secret provisioning, shared process/config mutation, deployment, tracked smoke output are excluded. + +### Final Routing + +- evaluation_mode=isolated-reassessment, finalizer=`finalize-task-policy.sh pair`. +- build closures 모두 true, scores=2/1/1/2/2, G08, local-fit → `PLAN-local-G08.md`. +- review closures 모두 true, scores=2/1/1/2/2, G08, official-review → `CODE_REVIEW-cloud-G08.md`. +- risks=`boundary_contract,structured_interpretation,variant_product`(3), `large_indivisible_context=false`, recovery=0/false, capability gap 없음. + +## Implementation Checklist + +- [ ] [TEST-1] Add a secret-safe Claude/Pi Hot Path harness with deterministic input validation, scenario matrix, raw-free manifest, workspace/artifact before/after, and child-only cancellation. +- [ ] [TEST-2] Add credential-free fake-agent/fake-runtime self-tests for success, expected failure, cancel, redaction, malformed evidence, and cleanup, then run the child verification commands. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [TEST-1] Agent smoke harness core + +**Problem:** existing synthetic CLI workspace smoke neither invokes Claude/Pi nor validates preset stage/cleanup evidence. + +**Solution:** Add `scripts/e2e-hot-path-agents.sh` with `--preflight-only`, `--self-test`, and actual run modes. Validate required non-secret runtime/model/workspace/evidence inputs without echoing secrets; require fingerprinted runtime evidence and four deterministic model aliases. Create isolated per-agent/scenario workspaces, collect visible stream/terminal/observation/artifact evidence, run the two-agent five-scenario matrix, redact sensitive names/values, and signal cancellation only to the child. + +**Modified Files and Checklist:** + +- [ ] Add executable `scripts/e2e-hot-path-agents.sh` with strict validation, isolated cleanup trap, fixed manifest schema, and fake fixtures. + +**Test Strategy:** TEST-2 exercises every parser/preflight/cleanup branch without credentials. + +**Verification:** `bash -n scripts/e2e-hot-path-agents.sh && ./scripts/e2e-hot-path-agents.sh --self-test` exits 0. + +### [TEST-2] Credential-free harness evidence + +**Problem:** harness correctness must be reviewable before external runtime/credentials exist. + +**Solution:** Fake `claude`, `pi`, HTTP/runtime evidence, observation logs, and disposable workspaces. Exercise success, expected write failure, timeout/cancel, redaction sentinel, malformed runtime evidence, source mismatch, and cleanup/orphan rows. Assert no network credential or shared process is required. + +**Modified Files and Checklist:** + +- [ ] Implement the self-test mode inside `scripts/e2e-hot-path-agents.sh`. +- [ ] Fill `agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/CODE_REVIEW-cloud-G08.md` with syntax and self-test output. + +**Test Strategy:** the self-test creates and removes all temporary fixtures itself. + +**Verification:** run Final Verification; syntax/self-test and common Go regressions exit 0. + +## Dependencies and Execution Order + +1. `17+14,15,16_endpoint_error_matrix` must produce its active `complete.log`. +2. `19+17,18_observation_lifecycle` must produce its active `complete.log`. +3. Implement TEST-1, then TEST-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `scripts/e2e-hot-path-agents.sh` | TEST-1, TEST-2 | +| `agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/CODE_REVIEW-cloud-G08.md` | TEST-2 | + +## Final Verification + +```bash +bash -n scripts/e2e-hot-path-agents.sh +./scripts/e2e-hot-path-agents.sh --self-test +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +Expected: exit 0, credential-free fixtures cover success/failure/cancel/redaction/malformed evidence/cleanup, no shared process mutation, empty diff check. Cached Go output is not acceptable. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/CODE_REVIEW-cloud-G07.md b/agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/CODE_REVIEW-cloud-G07.md new file mode 100644 index 00000000..311e5f93 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/CODE_REVIEW-cloud-G07.md @@ -0,0 +1,82 @@ + + +# Code Review Reference - TEST + +> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is mandatory.** Fill actual output or exact exit-69 blocker evidence and leave active files in place. A blocker is not PASS. Verdict/finalization is review-agent-only. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual, plan=1, tag=TEST + +## Archive Evidence Snapshot + +- Plan/review 0 was superseded before implementation; it contains no implementation verdict/evidence. +- Current dev inventory records Claude as `not_configured`; actual PASS requires out-of-band auth/profile plus matching Hot Path runtime evidence. + +## For the Review Agent + +Verify local output and require actual 10-row evidence for PASS. Archive to `code_review_cloud_G07_1.log` and `plan_local_G07_1.log`, then finalize by verdict. Preserve `milestone-task=hot-smoke` on PASS. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| TEST-1 Make integration | [ ] | +| TEST-2 Actual S16 evidence or exact blocker | [ ] | + +## Implementation Checklist + +- [ ] [TEST-1] Add separate harness self-test, external preflight, and actual smoke Make targets without exposing secrets or joining credentialed execution to `test-e2e`. +- [ ] [TEST-2] Run local/common checks and the actual Claude/Pi 10-case smoke; if current external requirements remain missing, record exit 69 and exact safe resume inputs/command without claiming PASS. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append verdict/routing signals and verify findings/dimensions; blocker evidence cannot receive PASS. +- [ ] Archive review/plan to suffix `1`; verify `.gitignore` managed block. +- [ ] On PASS write `complete.log`, preserve metadata, archive child; on WARN/FAIL/BLOCKED routing write directed state without completion. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Confirm three Make targets are separate, credentialed targets stay out of `test-e2e`, and no secret defaults/output were added. +- Confirm runtime/source identity, schema-valid 10 rows, native visible terminal, observation/workspace/cleanup evidence, and zero secret matches before PASS. +- If external inputs remain absent, confirm exit 69 occurred before provider invocation and the exact non-secret resume conditions are recorded without a PASS claim. + +## Verification Results + +### Make self-test + +Command: `make test-hot-path-agent-smoke-self-test` + +_Paste actual stdout/stderr and exit status._ + +### Common regression + +Command: `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` + +_Paste actual stdout/stderr and exit status._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +### External preflight and actual smoke + +Commands: scoped fingerprint check, `make test-hot-path-agent-smoke-preflight`, `make test-hot-path-agent-smoke`, and final `jq` validation exactly as listed in the plan. + +_Paste redacted stdout/stderr, exit statuses, and manifest path/summary; or exact exit-69 blocker and resume condition._ + +## Section Ownership + +Implementer owns completion status, deviations, decisions, and outputs. Reviewer alone owns review-only actions and final result. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/PLAN-local-G07.md b/agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/PLAN-local-G07.md new file mode 100644 index 00000000..8afc1158 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/PLAN-local-G07.md @@ -0,0 +1,130 @@ + + +# Claude/Pi Hot Path actual smoke closure + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G07.md`의 구현 담당 섹션에 실제 Make/preflight/external 출력과 manifest 경로를 채우고 active 파일을 유지한다. 외부 환경이 없으면 exit 69의 정확한 blocker와 재개 조건만 기록하며 PASS를 주장하거나 archive/`complete.log`를 작성하지 않는다. + +## Background + +Child 20 harness를 stable Make targets에 연결하고 matching source/runtime에서 Claude/Pi 10-case evidence를 생성해야 S16이 닫힌다. 현재 dev inventory는 Pi profile만 configured이고 Claude는 `not_configured`이므로, 현 상태의 actual PASS는 외부 Claude auth/profile과 matching Hot Path runtime evidence가 공급될 때까지 차단되어 있다. + +## Archive Evidence Snapshot + +- 이전 active plan/review pair는 구현 전에 source reanalysis로 대체됐다. 구현 evidence와 verdict는 없다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `Makefile` +- `agent-test/local/rules.md` +- `agent-test/local/edge-smoke.md` +- `agent-test/dev/edge-smoke.md` +- `agent-test/inventory-agent.yaml` + +### SDD Criteria + +- 승인 SDD S16: actual Claude/Pi streaming, five scenarios each, workspace/artifact before/after, correlated observation and cleanup/orphan evidence, matching runtime/source identity, zero secret matches. + +### Verification Context + +- `/config/.npm-global/bin/claude`와 `/config/.npm-global/bin/pi`는 존재한다. Dev inventory상 Claude status=`not_configured`; Pi provider `iop`은 configured다. +- Claude는 `--bare` actual mode에서 out-of-band `ANTHROPIC_API_KEY` 또는 equivalent approved auth가 필요하며 값은 출력/manifest에 포함하면 안 된다. +- matching active runtime, four aliases, runtime evidence, observation log, disposable workspace parent, output path가 모두 필요하다. + +### Test Coverage Gaps + +- stable Make entry points와 actual two-agent 10-row manifest가 없다. + +### Symbol References + +- none. + +### Split Judgment + +- stable contract: child 20 harness → Make integration + actual S16 evidence. Harness implementation은 predecessor에 유지한다. + +### Scope Rationale + +- CLI/config patching, credential 생성/저장, shared runtime 배포/종료, tracked smoke output은 제외한다. 실제 credentialed target은 `test-e2e`에 넣지 않는다. + +### Final Routing + +- evaluation_mode=isolated-reassessment, finalizer=`finalize-task-policy.sh pair`. +- build scores=1/1/1/2/2, risks=`boundary_contract,variant_product`(2), local-fit → `PLAN-local-G07.md`. +- review → `CODE_REVIEW-cloud-G07.md`; `large_indivisible_context=false`, recovery=0/false. 현재 외부 미구성은 exact resume condition을 가진 verification blocker다. + +## Implementation Checklist + +- [ ] [TEST-1] Add separate harness self-test, external preflight, and actual smoke Make targets without exposing secrets or joining credentialed execution to `test-e2e`. +- [ ] [TEST-2] Run local/common checks and the actual Claude/Pi 10-case smoke; if current external requirements remain missing, record exit 69 and exact safe resume inputs/command without claiming PASS. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [TEST-1] Make integration + +**Problem:** no stable entry point separates credential-free harness validation from external preflight and actual execution. + +**Solution:** Add `test-hot-path-agent-smoke-self-test`, `test-hot-path-agent-smoke-preflight`, and `test-hot-path-agent-smoke`. Forward caller-supplied variables without echoing values, preserve harness exit codes, and keep external targets out of aggregate local/e2e targets. + +**Modified Files and Checklist:** + +- [ ] Modify `Makefile` with the three child-20 harness targets and no credential literals/defaults. + +**Test Strategy:** self-test exits 0; missing external inputs produce exit 69 before agent invocation. + +**Verification:** `make test-hot-path-agent-smoke-self-test` exits 0. + +### [TEST-2] Actual S16 evidence or exact blocker + +**Problem:** fake fixtures cannot prove Claude/Pi consume the real Hot Path stream or that real workspace/observation/cleanup behavior matches S16. + +**Solution:** Compute the scoped source fingerprint, verify it against runtime binary/config/fixture evidence, run preflight, then run the 10-row matrix against a disposable workspace. Validate schema, all expected verdicts, native visible events/terminal, observation correlation, workspace/artifact before/after, cleanup/orphan result, and zero secret matches. If Claude auth/profile or matching runtime inputs are still unavailable, record the exact non-secret missing names and exit 69 output plus a resume command; do not mark actual smoke complete. + +**Modified Files and Checklist:** + +- [ ] Record Make output, scoped fingerprint check, preflight, actual manifest summary/path, or exact blocker evidence in `agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/CODE_REVIEW-cloud-G07.md`. + +**Test Strategy:** actual external run is mandatory for PASS; preflight blocker is valid BLOCKED evidence only. + +**Verification:** run Final Verification and validate the output manifest with child 20 schema. + +## Dependencies and Execution Order + +1. Directory dependency `20` must produce `agent-task/m-iop-hot-path-one-shot-execution/20+17,19_smoke_harness/complete.log`. +2. Implement TEST-1, then TEST-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `Makefile` | TEST-1 | +| `agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/CODE_REVIEW-cloud-G07.md` | TEST-2 | + +## Final Verification + +Local: + +```bash +make test-hot-path-agent-smoke-self-test +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +External after all required inputs are supplied out-of-band: + +```bash +test -n "${IOP_HOT_SMOKE_BASE_URL:-}" && test -n "${IOP_HOT_SMOKE_DIRECT_MODEL:-}" && test -n "${IOP_HOT_SMOKE_PASS_MODEL:-}" && test -n "${IOP_HOT_SMOKE_REPAIR_MODEL:-}" && test -n "${IOP_HOT_SMOKE_SLOW_MODEL:-}" && test -n "${IOP_HOT_SMOKE_PI_PROVIDER:-}" && test -n "${PI_CODING_AGENT_DIR:-}" && test -n "${ANTHROPIC_API_KEY:-}" && test -n "${IOP_HOT_SMOKE_RUNTIME_EVIDENCE:-}" && test -n "${IOP_HOT_SMOKE_OBSERVATION_FILE:-}" && test -n "${IOP_HOT_SMOKE_WORKSPACE_PARENT:-}" && test -n "${IOP_HOT_SMOKE_OUTPUT:-}" +IOP_HOT_SMOKE_SOURCE_FINGERPRINT="$(git ls-files --cached --others --exclude-standard -- apps/edge packages/go/streamgate packages/go/config go.mod go.sum | LC_ALL=C sort | while IFS= read -r path; do printf '%s\0%s\n' "$path" "$(git hash-object --no-filters "$path")"; done | git hash-object --stdin)" +export IOP_HOT_SMOKE_SOURCE_FINGERPRINT +jq -e --arg fingerprint "$IOP_HOT_SMOKE_SOURCE_FINGERPRINT" '.source_fingerprint == $fingerprint and (.binary_sha256 | type == "string" and length > 0) and (.config_sha256 | type == "string" and length > 0) and (.fixture_revision | type == "string" and length > 0)' "$IOP_HOT_SMOKE_RUNTIME_EVIDENCE" +make test-hot-path-agent-smoke-preflight +make test-hot-path-agent-smoke +jq -e '.schema_version == 1 and (.cases | length == 10) and all(.cases[]; .verdict == "pass") and (.redaction.secret_matches == 0)' "$IOP_HOT_SMOKE_OUTPUT" +``` + +Expected: local commands exit 0. External PASS requires matching runtime identity and 10 valid rows with zero secret matches. Exit 69 or current Claude `not_configured` state is BLOCKED evidence, never PASS. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/code_review_cloud_G07_0.log b/agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/code_review_cloud_G07_0.log new file mode 100644 index 00000000..de3c26f3 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/code_review_cloud_G07_0.log @@ -0,0 +1,107 @@ + + +# 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. +> 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. + +## Overview + +date=2026-08-03 +task=m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual, plan=0, tag=TEST + +## For the Review Agent + +1. Append verdict and routing signals. Exit 69 or absent actual Claude/Pi evidence cannot PASS S16. +2. Archive `CODE_REVIEW-cloud-G07.md` → `code_review_cloud_G07_0.log` and `PLAN-local-G07.md` → `plan_local_G07_0.log`. +3. On PASS write `complete.log` and move to `agent-task/archive/YYYY/MM/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/`; otherwise write the directed next state. +4. Preserve/report `milestone-task=hot-smoke` on PASS. +5. Complete the review-only checklist at the final location. + +## Implementation Item Completion + +| Item | Status | +|---|---| +| TEST-1 Make integration | [ ] | +| TEST-2 Actual S16 evidence | [ ] | + +## Implementation Checklist + +- [ ] [TEST-1] Add separate harness self-test, external-preflight, and actual smoke Make targets without printing secret values or adding credentialed targets to `test-e2e`. +- [ ] [TEST-2] Run Make/local/common verification and the actual Claude/Pi 10-case smoke, or record exit 69 plus exact external resume conditions and command. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +## Review-Only Checklist + +- [ ] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure`. +- [ ] Verify verdict, dimension assessment, and Required/Suggested/Nit classifications match. +- [ ] Archive the active review to `code_review_cloud_G07_0.log`. +- [ ] Archive the active plan to `plan_local_G07_0.log`. +- [ ] Verify the Agent-Ops managed block in `.gitignore`. +- [ ] If PASS, write `complete.log` from the standard template and leave no active `.md` files. +- [ ] If PASS, move the task directory to the dated archive and update this checklist at the final location. +- [ ] If PASS, preserve/report `milestone-task=hot-smoke` without directly editing the roadmap. +- [ ] Verify matching source/runtime/fixture evidence and an actual 10-case Claude/Pi manifest; self-test alone cannot PASS. +- [ ] If PASS, remove the active parent only when no siblings/files remain. +- [ ] If WARN/FAIL, write the next filesystem state and do not write `complete.log`. + +## Deviations from Plan + +_Implementer records actual deviations or `none`._ + +## Key Design Decisions + +_Implementer records actual decisions._ + +## Reviewer Checkpoints + +- Verify separate self-test/preflight/actual Make targets and no secret value printing. +- Verify source fingerprint, runtime binary/config/fixture evidence, four deterministic aliases, CLIs, observation source, and disposable workspace. +- Inspect actual 10-case manifest/logs for native visible events, terminal/outcome, cleanup/orphan evidence, and zero secret matches. +- Verify exit 69 or missing actual evidence is treated as blocker, not PASS. + +## Verification Results + +### Local Make and common regression + +Commands: + +```bash +make test-hot-path-agent-smoke-self-test +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +``` + +_Paste actual stdout/stderr and exit status for each._ + +### External actual smoke + +Commands: use the exact external verification block from `PLAN-local-G07.md`. + +_Paste actual preflight/output and manifest path. Exit 69 is blocker evidence, not PASS._ + +### Diff + +Command: `git diff --check` + +_Paste actual stdout/stderr and exit status._ + +--- + +> **[IMPLEMENTING AGENT — BEFORE SAVING]** Fill every implementation-owned section and leave review-only sections unchanged. + +## Section Ownership + +| Section | Owner | Note | +|---|---|---| +| Header, Overview, Review Agent Instructions | Fixed | Implementer must not finalize | +| Implementation Item Completion, Implementation Checklist | Implementer checks only | Text/order stays fixed | +| Review-Only Checklist | Review agent | Implementer must not modify | +| Deviations, Key Design Decisions | Implementer | Record actual content | +| Reviewer Checkpoints | Fixed | Reviewer verifies | +| Verification Results | Implementer fills output | Command changes require deviation | +| Code Review Result | Review agent appends | Not included in stub | diff --git a/agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/plan_local_G07_0.log b/agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/plan_local_G07_0.log new file mode 100644 index 00000000..4577a276 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/plan_local_G07_0.log @@ -0,0 +1,128 @@ + + +# Claude/Pi Hot Path actual smoke closure + +## For the Implementing Agent + +구현 후 `CODE_REVIEW-cloud-G07.md`의 구현 담당 섹션에 Make self-test/preflight와 실제 external run의 원문 출력을 채우고 active 파일을 유지한다. 외부 환경이 없으면 정확한 preflight blocker와 재개 조건만 기록하며 사용자 질문, archive, `complete.log` 작성은 하지 않는다. + +## Background + +Child 20 harness를 stable Make entry points로 연결하고, matching source/runtime evidence를 가진 actual Claude/Pi environment에서 10-case stream/workspace/cleanup manifest를 생성해야 S16을 닫을 수 있다. + +## Analysis + +### Files Read + +- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md` +- `Makefile` +- `agent-test/local/rules.md` +- `agent-test/local/edge-smoke.md` +- `agent-test/dev/edge-smoke.md` +- `agent-test/inventory-agent.yaml` + +### SDD Criteria + +- 승인 SDD, `milestone-task=hot-smoke`, S16. +- actual Claude/Pi streaming logs, direct/light-pass/repair/write-unavailable/timeout-cancel rows, workspace before/after, observation and cleanup/orphan evidence, zero secret match are required. + +### Verification Context + +- external owner must supply the active preset runtime, Claude auth, Pi profile, four deterministic model aliases, runtime evidence manifest, readable observation log, disposable workspace parent, and output path. +- missing input must fail preflight with exit 69 before provider invocation. + +### Test Coverage Gaps + +- no Make entry points or actual two-protocol manifest evidence exist yet. + +### Symbol References + +- none. + +### Split Judgment + +- stable contract: child 20 harness → Make entry points and actual external S16 evidence. +- harness/parser implementation remains in child 20. + +### Scope Rationale + +- CLI binary/config patching, secret provisioning, shared process termination, deployment changes, and tracked smoke output are excluded. + +### Final Routing + +- evaluation_mode=isolated-reassessment, finalizer=`finalize-task-policy.sh pair`. +- build closures 모두 true, scores=1/1/1/2/2, G07, local-fit → `PLAN-local-G07.md`. +- review closures 모두 true, scores=1/1/1/2/2, G07, official-review → `CODE_REVIEW-cloud-G07.md`. +- risks=`boundary_contract,variant_product`(2), `large_indivisible_context=false`, recovery=0/false, capability gap 없음. External unavailability is a verification blocker with an exact resume condition, not a build capability gap. + +## Implementation Checklist + +- [ ] [TEST-1] Add separate harness self-test, external-preflight, and actual smoke Make targets without printing secret values or adding credentialed targets to `test-e2e`. +- [ ] [TEST-2] Run Make/local/common verification and the actual Claude/Pi 10-case smoke, or record exit 69 plus exact external resume conditions and command. +- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output. + +### [TEST-1] Make integration + +**Problem:** no stable entry point separates credential-free harness validation from strict external preflight and actual execution. + +**Solution:** Add `test-hot-path-agent-smoke-self-test`, `test-hot-path-agent-smoke-preflight`, and `test-hot-path-agent-smoke`. Pass required environment without printing values; keep credentialed targets out of `test-e2e`. + +**Modified Files and Checklist:** + +- [ ] Modify `Makefile` with the three child-20 harness targets. + +**Test Strategy:** self-test exits 0 locally; preflight exits 69 before provider calls when inputs are missing. + +**Verification:** `make test-hot-path-agent-smoke-self-test` exits 0. + +### [TEST-2] Actual S16 evidence + +**Problem:** self-test cannot prove native Claude/Pi consumption of real Hot Path streams and artifact lifecycle. + +**Solution:** Verify current source fingerprint against runtime binary/config/fixture evidence, then run preflight and the actual two-agent five-scenario matrix. Validate 10 passing/expected-failure rows, native visible events/terminal, correlated observation classes, workspace/artifact before/after, and zero secret matches. If unavailable, record exact missing inputs, exit 69 output, and resume command without claiming PASS. + +**Modified Files and Checklist:** + +- [ ] Fill `agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/CODE_REVIEW-cloud-G07.md` with Make output, preflight, actual manifest summary/path, or exact blocker evidence. + +**Test Strategy:** actual external run is mandatory for PASS; self-test is not a substitute. + +**Verification:** run Final Verification and validate the output manifest with `jq`. + +## Dependencies and Execution Order + +1. `20+17,19_smoke_harness` must produce its active `complete.log`. +2. Implement TEST-1, then run TEST-2. + +## Modified Files Summary + +| File | Item | +|---|---| +| `Makefile` | TEST-1 | +| `agent-task/m-iop-hot-path-one-shot-execution/21+20_hot_smoke_actual/CODE_REVIEW-cloud-G07.md` | TEST-2 | + +## Final Verification + +Local: + +```bash +make test-hot-path-agent-smoke-self-test +go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service +git diff --check +``` + +External after required environment is supplied out-of-band: + +```bash +test -n "${IOP_HOT_SMOKE_BASE_URL:-}" && test -n "${IOP_HOT_SMOKE_DIRECT_MODEL:-}" && test -n "${IOP_HOT_SMOKE_PASS_MODEL:-}" && test -n "${IOP_HOT_SMOKE_REPAIR_MODEL:-}" && test -n "${IOP_HOT_SMOKE_SLOW_MODEL:-}" && test -n "${IOP_HOT_SMOKE_PI_PROVIDER:-}" && test -n "${PI_CODING_AGENT_DIR:-}" && test -n "${ANTHROPIC_API_KEY:-}" && test -n "${IOP_HOT_SMOKE_RUNTIME_EVIDENCE:-}" && test -n "${IOP_HOT_SMOKE_OBSERVATION_FILE:-}" && test -n "${IOP_HOT_SMOKE_WORKSPACE_PARENT:-}" && test -n "${IOP_HOT_SMOKE_OUTPUT:-}" +IOP_HOT_SMOKE_SOURCE_FINGERPRINT="$(git ls-files --cached --others --exclude-standard -- apps/edge packages/go/streamgate packages/go/config go.mod go.sum | LC_ALL=C sort | while IFS= read -r path; do printf '%s\0%s\n' "$path" "$(git hash-object --no-filters "$path")"; done | git hash-object --stdin)" +export IOP_HOT_SMOKE_SOURCE_FINGERPRINT +jq -e --arg fingerprint "$IOP_HOT_SMOKE_SOURCE_FINGERPRINT" '.source_fingerprint == $fingerprint and (.binary_sha256 | type == "string" and length > 0) and (.config_sha256 | type == "string" and length > 0) and (.fixture_revision | type == "string" and length > 0)' "${IOP_HOT_SMOKE_RUNTIME_EVIDENCE}" +make test-hot-path-agent-smoke-preflight +make test-hot-path-agent-smoke +jq -e '.schema_version == 1 and (.cases | length == 10) and all(.cases[]; .verdict == "pass") and (.redaction.secret_matches == 0)' "${IOP_HOT_SMOKE_OUTPUT}" +``` + +Expected: local commands exit 0; external preflight proves matching source/runtime/fixture identity; actual manifest has 10 pass rows and zero secret matches. Exit 69 is BLOCKED evidence, not PASS. Cached Go output is not acceptable. + +After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`. diff --git a/agent-task/m-iop-hot-path-one-shot-execution/WORK_LOG.md b/agent-task/m-iop-hot-path-one-shot-execution/WORK_LOG.md new file mode 100644 index 00000000..ec53fac2 --- /dev/null +++ b/agent-task/m-iop-hot-path-one-shot-execution/WORK_LOG.md @@ -0,0 +1,7 @@ +# Milestone Work Log + +> Dispatcher-owned execution timeline. Workers and reviewers do not edit this file. + +| seq | time | event | task | loop | role | attempt | model | result | locator | +|---:|---|---|---|---:|---|---:|---|---|---| +| 1 | 26-08-03 16:46:10 | START | m-iop-hot-path-one-shot-execution/12+10,11_outer_turn_core/PLAN-cloud-G08.md | 2 | worker | 0 | claude/claude-opus-4-8 xhigh | running | /config/workspace/iop-s0/.git/agent-task-dispatcher/runs/20260803T074610Z__m-iop-hot-path-one-shot-execution__12__10__11_outer_turn_core__p2__worker__a00/locator.json |