diff --git a/agent-ops/skills/common/prepare-epic-work-items/scripts/run_epic_cycle.py b/agent-ops/skills/common/prepare-epic-work-items/scripts/run_epic_cycle.py index 293caf65..c01b0ff7 100755 --- a/agent-ops/skills/common/prepare-epic-work-items/scripts/run_epic_cycle.py +++ b/agent-ops/skills/common/prepare-epic-work-items/scripts/run_epic_cycle.py @@ -621,7 +621,7 @@ def cycle(args: argparse.Namespace) -> int: emit( "EPIC_BATCH_VALIDATED", identity=identity, - event="EPIC_COMPLETED" if not epic.incomplete_ids else "EPIC_WORK_ITEMS_READY", + terminal="EPIC_COMPLETED" if not epic.incomplete_ids else "EPIC_WORK_ITEMS_READY", plans=len(pairs), ) return 0 diff --git a/agent-ops/skills/common/prepare-epic-work-items/tests/test_run_epic_cycle.py b/agent-ops/skills/common/prepare-epic-work-items/tests/test_run_epic_cycle.py index 5362b45f..f8ae86a1 100644 --- a/agent-ops/skills/common/prepare-epic-work-items/tests/test_run_epic_cycle.py +++ b/agent-ops/skills/common/prepare-epic-work-items/tests/test_run_epic_cycle.py @@ -1,12 +1,15 @@ from __future__ import annotations import importlib.util +import io +import json import os from pathlib import Path import subprocess import sys import tempfile import unittest +from contextlib import redirect_stdout from unittest import mock @@ -287,6 +290,29 @@ class EpicCycleContractTest(unittest.TestCase): state = MODULE.read_state(state_path) self.assertEqual(state["event"], "EPIC_WORK_ITEMS_READY") + validate_output = io.StringIO() + with redirect_stdout(validate_output): + validated = MODULE.main( + [ + "--workspace", + str(workspace), + "--milestone", + str(milestone.relative_to(workspace)), + "--epic", + "sample-epic", + "--execution-catalog", + "/runtime/catalog.json", + "--planner-target", + "planner-primary", + "--validate-only", + ] + ) + self.assertEqual(validated, 0) + validation_event = json.loads(validate_output.getvalue().strip()) + self.assertEqual(validation_event["event"], "EPIC_BATCH_VALIDATED") + self.assertEqual(validation_event["terminal"], "EPIC_WORK_ITEMS_READY") + self.assertEqual(validation_event["plans"], 1) + reused_in_larger_batch = MODULE.main( [ "--workspace", diff --git a/agent-ops/skills/common/prepare-milestone-workspace/scripts/prepare_workspace.py b/agent-ops/skills/common/prepare-milestone-workspace/scripts/prepare_workspace.py index 6736e679..60024578 100755 --- a/agent-ops/skills/common/prepare-milestone-workspace/scripts/prepare_workspace.py +++ b/agent-ops/skills/common/prepare-milestone-workspace/scripts/prepare_workspace.py @@ -679,6 +679,31 @@ def coordinate_batch( } atomic_json(state_path, state) else: + runtime_identity_keys = ( + "execution_catalog", + "planner_target", + "review_target", + ) + stable_identity_keys = ( + "milestone", + "workspace", + "selected_epics", + "batch_task_ids", + ) + missing_runtime_identity = [ + key for key in runtime_identity_keys if key not in state + ] + if missing_runtime_identity and all( + state.get(key) == identity[key] for key in stable_identity_keys + ): + for key in missing_runtime_identity: + state[key] = identity[key] + atomic_json(state_path, state) + emit( + "BATCH_IDENTITY_MIGRATED", + fields=missing_runtime_identity, + milestone=milestone_slug, + ) mismatched = [key for key, expected in identity.items() if state.get(key) != expected] if mismatched and state.get("status") == "completed": state = { diff --git a/agent-ops/skills/common/prepare-milestone-workspace/tests/test_prepare_workspace.py b/agent-ops/skills/common/prepare-milestone-workspace/tests/test_prepare_workspace.py index 1a799f62..8118479e 100644 --- a/agent-ops/skills/common/prepare-milestone-workspace/tests/test_prepare_workspace.py +++ b/agent-ops/skills/common/prepare-milestone-workspace/tests/test_prepare_workspace.py @@ -568,6 +568,68 @@ class PrepareWorkspaceTest(unittest.TestCase): self.assertEqual(result, 3) popen.assert_not_called() + def test_legacy_batch_adopts_missing_runtime_identity_on_resume(self) -> None: + with tempfile.TemporaryDirectory() as raw: + root = Path(raw) + workspace = root / "workspace" + common = root / "git-common" + milestone = workspace / "agent-roadmap/phase/phase-one/milestones/sample.md" + milestone.parent.mkdir(parents=True) + milestone.write_text( + "# Milestone: Sample\n\n## 기능\n\n" + "### Epic: [first] First\n\n- [ ] [first-task] first\n", + encoding="utf-8", + ) + args = MODULE.apply_defaults( + MODULE.parser().parse_args( + [ + "--repo", + str(workspace), + "--milestone", + str(milestone), + "--workspace", + str(workspace), + "--epics", + "1..1", + ] + ) + ) + state_path = common / "milestone-work-preparation" / "sample" / "batch-state.json" + MODULE.atomic_json( + state_path, + { + "milestone": str(milestone), + "workspace": str(workspace), + "selected_epics": ["first"], + "batch_task_ids": ["first-task"], + "status": "dispatching", + "epic_events": {"first": "EPIC_WORK_ITEMS_READY"}, + "dispatcher_pid": os.getpid(), + "dispatcher_process_start_token": MODULE.process_start_token(os.getpid()), + }, + ) + + output = io.StringIO() + with contextlib.redirect_stdout(output), mock.patch.object( + MODULE.subprocess, "Popen" + ) as popen: + result = MODULE.coordinate_batch( + args=args, + workspace=workspace, + milestone=milestone, + milestone_slug="sample", + phase_slug="phase-one", + common=common, + ) + + state = MODULE.read_json(state_path) + self.assertEqual(result, 3) + self.assertEqual(state["execution_catalog"], "/runtime/catalog.json") + self.assertEqual(state["planner_target"], "planner-primary") + self.assertEqual(state["review_target"], "planner-primary") + self.assertIn('"event": "BATCH_IDENTITY_MIGRATED"', output.getvalue()) + popen.assert_not_called() + def test_completed_batch_can_start_a_different_epic_selection(self) -> None: with tempfile.TemporaryDirectory() as raw: root = Path(raw) diff --git a/agent-roadmap/phase/knowledge-tool-optimization-extension/PHASE.md b/agent-roadmap/phase/knowledge-tool-optimization-extension/PHASE.md index 8a053016..02f049fa 100644 --- a/agent-roadmap/phase/knowledge-tool-optimization-extension/PHASE.md +++ b/agent-roadmap/phase/knowledge-tool-optimization-extension/PHASE.md @@ -12,6 +12,7 @@ Ollama serving 경로와 운영 기반이 안정화된 뒤, execution preset, cloud-first route evidence가 충분히 쌓이면 동일한 mode decision contract를 쓰는 RAG 기반 local routing model을 shadow/canary로 검증해 운영 기본 경로로 점진 전환한다. caller-neutral 누적 요청 컨텍스트 최적화, repository 장기 기억 RAG, advisor와 Context Hook은 routing evidence RAG와 서로 다른 후속 기능으로 분리한다. 이 Phase는 특정 Agent Shell에 종속되지 않고 OpenAI-compatible, A2A, IOP native protocol 중 맞는 표면에서 공통 최적화 책임을 제공하는 방향을 다룬다. +단일 요청 Agent 실행의 정식 smoke 이후 비교 검증은 별도 benchmark lane에서 수행하며, 준비 pipeline은 병렬 구축하고 실제 scored 비교는 route-02 완료 뒤 실행한다. ## Milestone 흐름 @@ -52,6 +53,14 @@ Phase를 가로지르는 실제 다음 작업 선택은 [전역 마일스톤 실 - 경로: [[route-02] IOP 단일 요청 Agent 실행](milestones/iop-owned-single-request-agent-execution.md) - 요약: Claude→IOP `/v1/messages` POST를 정확히 1회로 고정하고, Mac IOP Node의 request-scoped workspace/tool executor로 Gemini 3.6 Flash high plan → ornith-fast work → Gemini 3.6 Flash high review/repair를 내부에서 끝낸 뒤 하나의 outer stream과 terminal을 반환한다. +- [계획] [bench-01] Agent 비교 벤치마크 파이프라인 준비 + - 경로: [[bench-01] Agent 비교 벤치마크 파이프라인 준비](milestones/agent-comparison-benchmark-pipeline.md) + - 요약: 모델·caller·prompt·반복 횟수를 manifest로 바꾸고 Claude Code, agy, Codex의 IOP 연결부터 finish/idle, 시간·token·웹 검증·익명 채점·Markdown 보고까지 같은 pipeline으로 재현한다. + +- [계획] [bench-02] IOP 원샷 Agent 모델 비교 벤치마크 + - 경로: [[bench-02] IOP 원샷 Agent 모델 비교 벤치마크](milestones/iop-one-shot-agent-model-comparison.md) + - 요약: route-02 정식 smoke와 benchmark pipeline 준비 뒤 dev `../iop-s2`에서 동일 정적 웹 fixture로 9개 IOP 경유 단독·하이브리드 caller 조합을 각각 한 번 실행해 속도·token·품질을 비교한다. + - [스케치] [output-03] OpenAI-compatible Runtime Output Integrity Filter - 경로: [[output-03] OpenAI-compatible Runtime Output Integrity Filter](milestones/openai-compatible-runtime-output-integrity-filter.md) - 요약: terminal assistant 응답이 content, valid tool call, 명시 허용 structured/error finish 중 하나를 만족해야 한다는 runtime invariant를 정의하고, empty terminal, reasoning-only, incomplete tool-call syntax 같은 deterministic violation을 공통 filter pipeline과 bounded retry 정책으로 묶는다. @@ -99,5 +108,6 @@ Phase를 가로지르는 실제 다음 작업 선택은 [전역 마일스톤 실 - plan-bearing one-shot mode는 IOP Node가 승인된 workspace root 아래 `.iop/job//plan.md`와 `review.md`를 직접 생성·읽기·갱신·정리한다. 내부 model tool call/result는 IOP coordinator가 소비하며 Claude에 후속 tool result 요청을 요구하지 않는다. - 각 stage의 routing, plan, work, review, defect와 repair는 outer stream에 redacted 진행 요약으로만 투영한다. 내부 provider reasoning, control prompt, tool protocol·argument/result, credential과 stage terminal은 공개하지 않고 최종 사용자 결과와 outer terminal만 완결된 응답으로 반환한다. - target agent나 외부 workflow 제품의 process/state를 실행 의존성으로 연결하지 않는다. 범용 interactive shell과 장기 workflow는 제외하지만, execution preset의 request-scoped workspace/tool executor는 IOP가 소유한다. +- benchmark skill/pipeline은 제품 coordinator가 아니라 dev 검증 harness다. 준비 작업은 route-02와 병렬일 수 있지만 실제 scored 비교는 route-02 정식 기능·필수 smoke와 benchmark pipeline 완료 뒤 별도 Milestone에서 수행한다. - cloud model은 초기 semantic judge/teacher 역할을 하고, 충분한 정제 evidence가 쌓인 뒤 RAG local router로 운영 기본을 전환한다. 두 경우 모두 최종 권한은 deterministic hard gate를 적용하는 Edge arbiter에 남는다. - routing evidence RAG는 route 판정 전용이고, repository 장기 기억 RAG·누적 요청 context·advisor·Context Hook과 corpus/index/평가를 공유하지 않는다. diff --git a/agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/agent-comparison-benchmark-pipeline.md b/agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/agent-comparison-benchmark-pipeline.md new file mode 100644 index 00000000..d229841f --- /dev/null +++ b/agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/agent-comparison-benchmark-pipeline.md @@ -0,0 +1,98 @@ +# Milestone: [bench-01] Agent 비교 벤치마크 파이프라인 준비 + +## 위치 + +- Roadmap: [ROADMAP.md](../../../ROADMAP.md) +- Phase: [PHASE.md](../PHASE.md) +- SDD: [SDD.md](../../../sdd/knowledge-tool-optimization-extension/agent-comparison-benchmark-pipeline/SDD.md) + +## 목표 + +IOP를 경유하는 Claude Code, agy, Codex의 단독 모델·하이브리드 원샷 실행을 같은 절차로 반복 비교할 수 있도록 project-local skill과 설정 기반 benchmark pipeline을 만든다. +모델, caller agent, prompt fixture와 반복 횟수는 데이터로 바꾸고, 고정 pipeline은 격리 workspace 준비부터 finish/idle 판정, 시간·token·웹 검증·품질 채점·Markdown 보고까지 재현 가능한 evidence로 남긴다. + +## 상태 + +[계획] + +## 구현 잠금 + +- 상태: 해제 +- SDD: 필요 +- SDD 문서: [Agent 비교 벤치마크 파이프라인 준비 SDD](../../../sdd/knowledge-tool-optimization-extension/agent-comparison-benchmark-pipeline/SDD.md) +- SDD 사유: 외부 CLI의 IOP API 연결, credential/model preflight, 실제 provider 호출, 반복 실행·비용·secret-safe evidence와 실패 분기 계약을 함께 고정해야 한다. +- SDD 상태: 승인됨 +- SDD 잠금: 해제 +- SDD 사용자 리뷰: 없음 +- 잠금 해제 조건: 아래 체크리스트 + - [x] SDD 잠금이 해제되어 있다. + - [x] SDD 사용자 리뷰가 없거나 승인/해결되었다. + - [x] Acceptance Scenario가 Milestone 기능 Task와 연결되어 있다. + - [x] Evidence Map이 완료 시 `complete.log`의 `milestone-task` id별 집계와 최종 검증 evidence로 검증 가능하게 연결되어 있다. +- 결정 필요: 없음 + +## 범위 + +- pipeline은 `preflight → fixture/workspace 격리 → agent 실행 → finish/idle 대기 → evidence 수집 → 웹 검증 → 익명 품질 채점 → Markdown 보고` 순서를 고정한다. +- benchmark manifest는 caller agent, IOP model/preset route, effort, prompt/asset fixture, 반복 횟수, timeout과 output 위치를 선언한다. +- 초기 caller adapter는 Claude Code, agy와 Codex를 지원하고 모든 scored model 실행이 IOP Edge를 경유했음을 검증한다. +- `../iop-s2`는 dev runtime 테스트베드로 사용하며, 비교 결과물은 매 run의 격리된 임시 workspace에 생성해 테스트베드 source를 수정하지 않는다. +- 병렬 준비 단계의 live preflight는 Claude Sonnet 5 최고 effort, Gemini 3.6 Flash high, GPT-5.6 luna xhigh의 IOP direct route와 caller endpoint/auth/stream/finish/idle 호환을 검증한다. generic runner는 execution preset route도 manifest로 받을 수 있게 만들되 아직 구현 중인 Gemini/GPT hybrid preset의 live readiness는 `[bench-02]` 실행 직전 gate에서 검증한다. +- raw run evidence는 `agent-test/runs//` 아래에 격리하고 최종 비교 보고서는 `agent-test/dev/` 아래 Markdown으로 생성할 수 있게 한다. + +## 기능 + +### Epic: [pipeline-contract] 설정 기반 실행 파이프라인 + +모델과 요청이 늘어나도 실행 코드를 복제하지 않는 고정 lifecycle과 가변 manifest를 제공한다. + +- [ ] [benchmark-manifest] caller agent, IOP route/preset, model/effort, prompt·asset fixture, `repetitions`, timeout과 evidence 경로를 선언하고 schema 검증하는 benchmark manifest를 제공한다. +- [ ] [benchmark-skill] `agent-ops/skills/project/iop-agent-comparison-benchmark/` project-local skill이 준비 상태를 확인하고 pipeline의 manifest 검증·실행·재개·보고 명령을 일관되게 안내하되 실제 제품 호출은 deterministic script에 위임한다. +- [ ] [isolated-workspace] `../iop-s2` dev runtime과 분리된 run별 clean workspace와 fresh caller session을 동일 fixture/checksum에서 만들고 비교군 사이 파일·대화 history·resume state·결과 오염을 막으며 공통 setup/cache 정책을 기록한다. +- [ ] [run-lifecycle] 한 번의 사용자 작업 제출 뒤 caller별 event를 수집해 finish/complete 후 idle까지 기다리고 timeout·cancel·process cleanup을 bounded하게 처리한다. +- [ ] [repeat-attempt] 초기 기본값 1과 사용자 지정 반복 횟수를 지원하고, scored failure를 덮어쓰지 않으며 재실행은 새 attempt로 보존한다. + +### Epic: [agent-connectivity] IOP Agent 연결과 route preflight + +각 caller가 IOP를 실제 provider endpoint로 소비하는지 검증하고 설정 문제와 구현 gap을 구분한다. + +- [ ] [claude-iop] Claude Code가 IOP를 통해 Sonnet, Gemini와 GPT direct route를 인증·조회·호출할 수 있는 runner와 redacted preflight를 제공하고 arbitrary preset route를 받을 수 있는 adapter 계약은 fixture로 검증한다. +- [ ] [agy-iop] agy가 IOP를 통해 Gemini direct route를 호출하고 stream·finish/idle을 수신할 수 있는지 검증하며 필요한 client 설정과 generic preset route 입력을 secret-safe fixture로 분리한다. +- [ ] [codex-iop] Codex가 IOP를 통해 GPT direct route를 호출하고 stream·finish/idle을 수신할 수 있는지 검증하며 필요한 client 설정과 generic preset route 입력을 secret-safe fixture로 분리한다. +- [ ] [effort-route] Sonnet 최고 effort, Gemini high와 GPT xhigh가 각 caller→IOP→provider 경계에서 요청·effective model evidence로 확인되고 unsupported 값이나 alias를 임의 치환하지 않는다. +- [ ] [connection-gap] credential/model 누락은 안전한 등록 요청으로, endpoint/auth/protocol/stream 비호환은 별도 구현 Plan 후보로 분류하고 해당 비교군을 우회 성공으로 처리하지 않는다. + +### Epic: [evidence-report] 측정·검증·보고 + +서로 다른 caller의 event를 공통 측정 schema로 정규화하고 원본 evidence와 사람이 읽는 결과를 함께 남긴다. + +- [ ] [timing-usage] prompt 제출, 첫 output, 첫 file write, model 호출별 작업시간, tool 시간, queue와 finish/idle 전체시간 및 호출 횟수·input/output/reasoning/cached/total token을 clock/source와 함께 수집하고 중첩 구간이나 미관측 overhead를 임의 산술 분해하지 않는다. +- [ ] [web-validation] vanilla HTML/CSS/JS 한 페이지 fixture를 build/serve하고 desktop·mobile render, 이미지 2장, console/asset 오류, 반응형·접근성 최소 gate와 screenshot을 자동 검증한다. +- [ ] [blind-score] 비교군 identity를 가린 결과물과 screenshot에 동일 100점 rubric을 적용하고 자동 gate와 Codex의 수동 품질 점수를 분리해 기록한다. +- [ ] [report-output] manifest, 환경·버전, preflight, attempt, 시간·token·품질 표, 실패·미제공 값과 한계를 포함한 Markdown 보고서를 raw evidence 포인터와 함께 생성한다. + +## 완료 리뷰 + +- 상태: 없음 +- 요청일: 없음 +- 완료 근거: 사용자 확정 비교 방향과 파이프라인 경계를 SDD와 기능 Task로 정리했으며 구현 evidence는 아직 없다. +- 검토 항목: 없음 +- 리뷰 코멘트: 없음 + +## 범위 제외 + +- `[route-02]` 정식 기능 구현이나 그 완료 smoke를 대신하는 작업 +- 9개 비교군의 실제 scored 실행과 최종 비교 결론 작성 +- 구현 전 Gemini/GPT hybrid preset을 live success로 요구해 `[route-02]`와의 병렬 준비를 차단하는 검증 +- 특정 model/agent 조합에 맞춘 hard-coded 일회성 script +- Agent-Ops task dispatcher를 IOP 제품 runtime/API 비교 harness로 재사용하는 방식 +- raw API key, IOP token, private endpoint, prompt/tool 원문을 tracked evidence에 기록하는 방식 + +## 작업 컨텍스트 + +- 관련 경로: `agent-ops/skills/project/iop-agent-comparison-benchmark/`, `agent-test/`, `scripts/`, `agent-contract/outer/`, `../iop-s2` +- 표준선: skill은 orchestration과 안전한 사용법을 소유하고, 설정 기반 script가 실제 CLI/IOP entrypoint 호출과 deterministic evidence 생성을 소유한다. +- 표준선: preflight 호출은 scored attempt에서 제외하되 setup evidence와 사용량을 별도로 표시한다. +- 실행 순서와 차단 관계: [전역 마일스톤 실행 순서](../../../priority-queue.md) +- 관련 Milestone: [[route-02] IOP 단일 요청 Agent 실행](iop-owned-single-request-agent-execution.md), [[bench-02] IOP 원샷 Agent 모델 비교 벤치마크](iop-one-shot-agent-model-comparison.md) +- 확인 필요: 없음 diff --git a/agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/iop-one-shot-agent-model-comparison.md b/agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/iop-one-shot-agent-model-comparison.md new file mode 100644 index 00000000..c1da6ff0 --- /dev/null +++ b/agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/iop-one-shot-agent-model-comparison.md @@ -0,0 +1,108 @@ +# Milestone: [bench-02] IOP 원샷 Agent 모델 비교 벤치마크 + +## 위치 + +- Roadmap: [ROADMAP.md](../../../ROADMAP.md) +- Phase: [PHASE.md](../PHASE.md) +- SDD: [SDD.md](../../../sdd/knowledge-tool-optimization-extension/iop-one-shot-agent-model-comparison/SDD.md) + +## 목표 + +`[route-02]`의 정식 기능과 필수 smoke가 완료된 뒤, 동일한 정적 웹페이지 과제를 IOP를 경유하는 3개 단독 모델과 Gemini/GPT 하이브리드 구조의 9개 caller 조합으로 각각 한 번 실행한다. +첫 output·model/tool·전체시간, 호출 횟수와 세부 token, 자동 웹 검증과 익명 100점 품질 평가를 함께 비교하고 재현 가능한 Markdown 보고서를 현재 프로젝트에 남긴다. + +## 상태 + +[계획] + +## 구현 잠금 + +- 상태: 해제 +- SDD: 필요 +- SDD 문서: [IOP 원샷 Agent 모델 비교 벤치마크 SDD](../../../sdd/knowledge-tool-optimization-extension/iop-one-shot-agent-model-comparison/SDD.md) +- SDD 사유: 실제 dev provider/credential과 외부 CLI를 사용하는 field benchmark이며 실행 순서, 비용, 실패·재실행, secret-safe evidence와 비교 공정성을 고정해야 한다. +- SDD 상태: 승인됨 +- SDD 잠금: 해제 +- SDD 사용자 리뷰: 없음 +- 잠금 해제 조건: 아래 체크리스트 + - [x] SDD 잠금이 해제되어 있다. + - [x] SDD 사용자 리뷰가 없거나 승인/해결되었다. + - [x] Acceptance Scenario가 Milestone 기능 Task와 연결되어 있다. + - [x] Evidence Map이 완료 시 `complete.log`의 `milestone-task` id별 집계와 최종 검증 evidence로 검증 가능하게 연결되어 있다. +- 결정 필요: 없음 + +## 범위 + +- 선행 조건은 `[bench-01]` benchmark pipeline 준비 완료와 `[route-02]` 정식 기능·필수 Claude smoke 완료다. +- 모든 scored 실행은 dev 환경의 `../iop-s2` IOP runtime을 경유하고, 동일 checksum의 이미지 2장과 vanilla HTML/CSS/JS 단일 페이지 prompt를 run별 clean workspace와 fresh caller session에 제공한다. +- 원샷은 사용자 작업 제출 1회 뒤 사람의 중간 feedback·수동 수정·재시작 없이 caller가 finish/complete event 후 idle이 될 때까지를 뜻하며 model/tool 호출 횟수는 제한하지 않고 측정한다. +- 초기 benchmark는 아래 9개 비교군을 각각 1회 실행한다. + +| ID | 유형 | Caller | IOP 실행 구성 | +|----|------|--------|---------------| +| C01 | Claude 단독 | Claude Code | Claude Sonnet 5 최고 effort | +| C02 | Gemini 단독 | Claude Code | Gemini 3.6 Flash high | +| C03 | Gemini 단독 | agy | Gemini 3.6 Flash high | +| C04 | GPT 단독 | Claude Code | GPT-5.6 luna xhigh | +| C05 | GPT 단독 | Codex | GPT-5.6 luna xhigh | +| C06 | Gemini 하이브리드 | Claude Code | Gemini plan → ornith-fast work → Gemini review/repair | +| C07 | Gemini 하이브리드 | agy | Gemini plan → ornith-fast work → Gemini review/repair | +| C08 | GPT 하이브리드 | Claude Code | GPT plan → ornith-fast work → GPT review/repair | +| C09 | GPT 하이브리드 | Codex | GPT plan → ornith-fast work → GPT review/repair | + +- provider가 제공하는 input/output/reasoning/cached/total token을 model·stage별로 기록하고, 제공되지 않는 값은 추정 원본과 섞지 않고 `미제공`으로 표시한다. +- 결과물 identity를 가린 뒤 Codex가 동일 rubric으로 품질을 채점하고 자동 검증 결과와 분리해 보고한다. + +## 기능 + +### Epic: [benchmark-readiness] 비교 입력과 실행 준비 고정 + +실행 전에 공정한 fixture와 실제 IOP route/credential 상태를 고정한다. + +- [ ] [fixture-lock] 이미지 2장, 동일 one-page 요구사항, vanilla HTML/CSS/JS 초기 workspace, viewport와 자동 검증·100점 rubric을 checksum/version과 함께 고정한다. +- [ ] [route-readiness] dev `../iop-s2`에서 Claude Code·agy·Codex의 IOP 인증, Sonnet/Gemini/GPT route, Gemini/GPT hybrid preset, effort와 stream/finish/idle이 모두 preflight를 통과했는지 확인한다. +- [ ] [matrix-lock] C01-C09의 caller, IOP route/preset, model/effort, 반복 횟수 1, 실행 순서 seed, fresh-session과 setup/cache 정책 및 timeout을 immutable run manifest로 확정한다. + +### Epic: [comparison-runs] 9개 원샷 실행 + +각 비교군을 clean workspace에서 한 번 실행하고 실패를 포함한 attempt evidence를 보존한다. + +- [ ] [claude-standalone] C01 Claude Code→IOP→Claude Sonnet 5 최고 effort 단독 원샷을 실행한다. +- [ ] [gemini-standalone] C02 Claude Code와 C03 agy가 각각 IOP→Gemini 3.6 Flash high 단독 원샷을 실행한다. +- [ ] [gpt-standalone] C04 Claude Code와 C05 Codex가 각각 IOP→GPT-5.6 luna xhigh 단독 원샷을 실행한다. +- [ ] [gemini-hybrid] C06 Claude Code와 C07 agy가 각각 IOP의 Gemini plan→ornith-fast work→Gemini review/repair 원샷을 실행한다. +- [ ] [gpt-hybrid] C08 Claude Code와 C09 Codex가 각각 IOP의 GPT plan→ornith-fast work→GPT review/repair 원샷을 실행한다. + +### Epic: [comparison-report] 검증·채점·보고서 + +정량 evidence와 익명 품질 평가를 결합하되 원본 수치와 해석을 분리한다. + +- [ ] [objective-validation] 각 결과의 build/serve, desktop·mobile screenshot, 이미지·asset, console 오류, 요구사항·반응형·접근성 gate와 최종 workspace 상태를 자동 검증한다. +- [ ] [quality-scoring] 익명화된 9개 결과에 요구사항 25, 시각 완성도 25, 반응형·접근성 15, 이미지·디테일 10, 안정성 10, 코드 품질 10, 자체 검증 5의 동일 100점 rubric으로 Codex가 점수를 기록한다. +- [ ] [performance-usage] 첫 output·첫 file write·model 호출별·tool·queue·전체 finish/idle 시간, 호출 횟수와 model/stage별 input/output/reasoning/cached/total token을 clock/source·미제공 여부와 함께 비교하고 중첩 구간이나 미관측 overhead를 임의 산술 분해하지 않는다. +- [ ] [benchmark-report] 9개 결과의 속도·품질·token 표, 실행 조건·버전·실패·한계·raw evidence 링크를 포함한 날짜별 Markdown 보고서를 `agent-test/dev/`에 남긴다. + +## 완료 리뷰 + +- 상태: 없음 +- 요청일: 없음 +- 완료 근거: 사용자 확정 9개 비교군과 post-smoke 실행·평가 기준을 SDD와 기능 Task로 정리했으며 실제 비교 evidence는 아직 없다. +- 검토 항목: 없음 +- 리뷰 코멘트: 없음 + +## 범위 제외 + +- `[route-02]` 정식 기능이나 필수 smoke의 완료 여부를 이 비교 점수로 대체하거나 소급 변경하는 작업 +- 첫 보고서에서 비교군별 2회 이상 반복하는 실행 +- React/Vite 등 dependency 설치와 cache가 속도에 섞이는 frontend framework 과제 +- provider가 보고하지 않은 reasoning token을 exact 값처럼 추정하거나 서로 다른 tokenizer 수치를 무보정 단일 합계로 단정하는 방식 +- 실패 attempt를 삭제하고 성공 재실행만 대표값으로 선택하는 방식 + +## 작업 컨텍스트 + +- 관련 경로: `agent-test/dev/`, `agent-test/runs/`, `../iop-s2` +- 표준선: preflight는 scored attempt와 분리하고, scored 실행이 시작된 뒤의 실패는 결과로 보존하며 재실행이 필요하면 새 attempt로 기록한다. +- 표준선: IOP credential/model route가 없으면 안전한 등록을 요청하고, alias/effort를 임의 대체하지 않는다. +- 실행 순서와 차단 관계: [전역 마일스톤 실행 순서](../../../priority-queue.md) +- 관련 Milestone: [[bench-01] Agent 비교 벤치마크 파이프라인 준비](agent-comparison-benchmark-pipeline.md), [[route-02] IOP 단일 요청 Agent 실행](iop-owned-single-request-agent-execution.md) +- 확인 필요: 없음 diff --git a/agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/iop-owned-single-request-agent-execution.md b/agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/iop-owned-single-request-agent-execution.md index 39506f1a..61bc685f 100644 --- a/agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/iop-owned-single-request-agent-execution.md +++ b/agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/iop-owned-single-request-agent-execution.md @@ -114,4 +114,5 @@ Claude가 IOP의 Anthropic-compatible model을 호출할 때 `/v1/messages` POST - 큐 배치: 완료·아카이빙된 `[route-01]` 다음인 route lane의 `[route-02]` 2번이며 현재 active lane head다. - 실행 순서와 차단 관계: [전역 마일스톤 실행 순서](../../../priority-queue.md) - 후속: [Heavy Plan/Review 실행과 검증 MVP](knowledge-tool-validation-optimization.md), [Execution Preset 하이브리드 Mode 라우팅](openai-compatible-hybrid-request-execution-routing.md) +- 추가 비교 검증: 정식 기능과 `[claude-smoke]` 완료 이후 [[bench-02] IOP 원샷 Agent 모델 비교 벤치마크](iop-one-shot-agent-model-comparison.md)에서 수행하며, [[bench-01] Agent 비교 벤치마크 파이프라인 준비](agent-comparison-benchmark-pipeline.md)는 이 Milestone과 병렬로 진행할 수 있다. 이 비교는 현재 Milestone의 완료 Task나 필수 smoke를 대체하지 않는다. - 확인 필요: 없음 diff --git a/agent-roadmap/priority-queue.md b/agent-roadmap/priority-queue.md index 47daa768..62733b56 100644 --- a/agent-roadmap/priority-queue.md +++ b/agent-roadmap/priority-queue.md @@ -19,6 +19,15 @@ cloud-first route evidence가 품질·규모 gate를 통과하면 RAG local router를 shadow/canary로 검증해 운영 기본 경로로 점진 전환한다. - 선행 차단: `[observe-03]`, `[provider-02]` +### bench + +1. [[bench-01] Agent 비교 벤치마크 파이프라인 준비](phase/knowledge-tool-optimization-extension/milestones/agent-comparison-benchmark-pipeline.md) + IOP를 경유하는 Claude Code, agy, Codex 조합을 설정 기반으로 반복 실행하고 시간·token·웹 검증·익명 품질 평가·Markdown 보고를 남기는 project-local skill과 pipeline을 준비한다. + +2. [[bench-02] IOP 원샷 Agent 모델 비교 벤치마크](phase/knowledge-tool-optimization-extension/milestones/iop-one-shot-agent-model-comparison.md) + `[route-02]` 정식 smoke 뒤 동일 정적 웹 fixture로 Sonnet/Gemini/GPT 단독과 Gemini/GPT 하이브리드의 9개 IOP 경유 조합을 각각 한 번 비교한다. + - 선행 차단: `[route-02]` + ### output 1. [[output-01] OpenAI-compatible 출력 검증 필터](phase/knowledge-tool-optimization-extension/milestones/openai-compatible-output-validation-filters.md) diff --git a/agent-roadmap/sdd/knowledge-tool-optimization-extension/agent-comparison-benchmark-pipeline/SDD.md b/agent-roadmap/sdd/knowledge-tool-optimization-extension/agent-comparison-benchmark-pipeline/SDD.md new file mode 100644 index 00000000..507d633c --- /dev/null +++ b/agent-roadmap/sdd/knowledge-tool-optimization-extension/agent-comparison-benchmark-pipeline/SDD.md @@ -0,0 +1,154 @@ +# SDD: [bench-01] Agent 비교 벤치마크 파이프라인 준비 + +## 위치 + +- Milestone: [Agent 비교 벤치마크 파이프라인 준비](../../../phase/knowledge-tool-optimization-extension/milestones/agent-comparison-benchmark-pipeline.md) +- Phase: [PHASE.md](../../../phase/knowledge-tool-optimization-extension/PHASE.md) + +## 상태 + +[승인됨] + +## SDD 잠금 + +- 상태: 해제 +- 사용자 리뷰: 없음 +- 잠금 항목: + - [x] [D01] benchmark 준비는 `[route-02]`와 병렬로 진행하며 direct route live connectivity와 generic preset runner fixture까지만 완료 조건으로 둔다. 실제 Gemini/GPT hybrid preset live readiness와 scored 비교는 `[route-02]` 정식 smoke 뒤의 별도 `[bench-02]`가 소유한다. + - [x] [D02] 모든 scored model 호출은 IOP를 경유하며 Claude Code, agy, Codex 차이는 runner adapter가 흡수한다. + - [x] [D03] pipeline lifecycle은 고정하고 agent/model/preset/effort/prompt/assets/repetitions는 manifest로 바꾼다. + - [x] [D04] 원샷은 사용자 작업 제출 1회부터 finish/complete 후 idle까지이며 내부 model/tool 호출 횟수는 제한하지 않고 측정한다. + - [x] [D05] dev runtime 테스트베드는 `../iop-s2`이고 결과물은 run별 격리 workspace에 생성해 테스트베드 source를 수정하지 않는다. + - [x] [D06] 초기 반복 횟수는 1이지만 pipeline은 양수 `repetitions`를 지원한다. + - [x] [D07] credential/model/effort 누락은 등록·지원 요청으로, agy/Codex endpoint/auth/protocol/stream gap은 별도 구현 Plan 후보로 분류한다. + - [x] [D08] 실제 CLI/IOP entrypoint를 직접 호출하며 Agent-Ops task dispatcher를 제품 runtime이나 benchmark harness로 사용하지 않는다. + - [x] [D09] provider가 보고하지 않은 token은 `unavailable`로 기록하고 추정값을 exact source와 섞지 않는다. + - [x] [D10] 각 cell은 fresh caller session과 clean workspace를 사용하고 공통 setup/cache 정책을 기록하며, timing은 관측 clock/source를 보존하고 중첩 구간을 임의 합산하지 않는다. + +## 문제 / 비목표 + +- 문제: 모델, caller agent, prompt와 반복 횟수를 바꿀 때마다 수동 명령과 임시 측정 방식을 다시 만들면 시간·token·품질 비교가 재현되지 않고, 연결 실패나 scored failure가 선택적으로 누락될 수 있다. 고정 lifecycle, adapter 경계, 공통 evidence schema와 secret-safe report가 필요하다. +- 비목표: + - `[route-02]` 제품 구현 또는 필수 smoke 대체 + - 9개 비교군의 실제 scored 실행과 우열 결론 + - 범용 CI/CD scheduler나 장기 agent orchestration 제품 + - raw credential, private endpoint, prompt/tool 원문을 tracked evidence에 저장하는 기능 + +## Source of Truth + +| 영역 | 기준 | 메모 | +|------|------|------| +| Roadmap | [Milestone 문서](../../../phase/knowledge-tool-optimization-extension/milestones/agent-comparison-benchmark-pipeline.md) | pipeline 기능 Task와 완료 상태 원장 | +| Skill | `agent-ops/skills/project/iop-agent-comparison-benchmark/` | 사용자 요청 해석, preflight와 실행·보고 진입점 | +| Pipeline | project-owned benchmark runner와 manifest schema | lifecycle, adapter, attempt/evidence 생성 구현 원본; exact 경로는 Plan에서 기존 testing 구조에 맞춰 확정 | +| Test Evidence | `agent-test/runs//`, `agent-test/dev/` | raw run evidence와 날짜별 Markdown report | +| Dev Testbed | `../iop-s2` | IOP dev runtime; scored 결과 workspace의 source가 아님 | +| API Contract | [Anthropic-Compatible Messages API](../../../../agent-contract/outer/anthropic-compatible-api.md), [OpenAI-Compatible API](../../../../agent-contract/outer/openai-compatible-api.md) | Claude Code/agy/Codex의 IOP ingress와 terminal/usage 기준 | +| Config Contract | [Edge Config And Runtime Refresh](../../../../agent-contract/inner/edge-config-runtime-refresh.md) | model route, execution preset, protocol profile, credential 경계 | +| User Decision | D01-D10 | 2026-08-06 확정 방향과 공정성 보강, 추가 사용자 결정 없음 | + +## State Machine + +| 상태 | 진입 조건 | 다음 상태 | 근거 | +|------|-----------|-----------|------| +| `defined` | manifest schema와 pipeline version을 load | `preflighting`, `rejected` | validated manifest, fixture checksum | +| `preflighting` | caller binary/config와 IOP dev route를 secret-safe로 점검 | `ready`, `blocked`, `rejected` | CLI version, auth/model/endpoint/effort/stream result | +| `ready` | 모든 선택 cell의 preflight와 isolated workspace 준비 완료 | `running`, `cancelled` | immutable run manifest와 workspace locator | +| `running` | caller에 사용자 작업을 한 번 제출 | `validating`, `failed`, `timed_out`, `cancelled` | normalized event timeline, process exit와 idle marker | +| `validating` | finish/complete 후 idle 또는 terminal failure 확정 | `scoring`, `reported`, `failed` | workspace checksum, build/render/test evidence | +| `scoring` | 익명화된 결과와 screenshot 준비 | `reported`, `failed` | rubric version과 evaluator record | +| `reported` | raw evidence와 Markdown summary 원자적 생성 | 종료 | report path, manifest/evidence digest | +| `blocked` | credential/model 누락 또는 client↔IOP 호환 gap | `preflighting`, 종료 | redacted blocker classification과 후속 Plan 후보 | +| `rejected` | manifest, fixture, path, repetitions 또는 secret policy 위반 | 종료 | validation error | +| `failed` | scored 실행·검증·보고 실패 | 종료 | 보존된 attempt와 failure class | +| `timed_out` | run 전체 timeout 초과 | 종료 | timeout/cancel/cleanup evidence | +| `cancelled` | 사용자 또는 process cancellation | 종료 | child process cleanup evidence | + +State invariant: + +- 하나의 attempt는 immutable manifest cell, repetition index, fixture checksum, clean workspace generation과 fresh caller session identity를 가진다. 이전 conversation/resume state를 재사용하지 않는다. +- preflight는 scored attempt가 아니며 setup time/usage를 별도 evidence로 둔다. +- scored attempt가 시작된 뒤의 실패는 삭제하거나 같은 attempt id로 재실행하지 않는다. +- finish/complete event만으로 성공 판정하지 않고 caller adapter가 idle과 process/output quiescence를 함께 확정한다. +- raw credential과 private endpoint는 manifest, event, log, metric, screenshot, report에 기록하지 않는다. + +## Interface Contract + +- 계약 원문: [Anthropic-Compatible Messages API](../../../../agent-contract/outer/anthropic-compatible-api.md), [OpenAI-Compatible API](../../../../agent-contract/outer/openai-compatible-api.md), [Edge Config And Runtime Refresh](../../../../agent-contract/inner/edge-config-runtime-refresh.md) +- manifest 입력: + - `pipeline_version`, `environment=dev`, `testbed=../iop-s2`: 실행 contract와 테스트베드 선택이다. + - `fixture`: prompt, asset와 initial workspace checksum/version이다. + - `matrix[]`: stable cell id, caller(`claude|agy|codex`), IOP route/preset, expected model/stage binding과 effort다. + - `repetitions`: 1 이상의 실행 횟수이며 초기 비교 manifest는 1이다. + - `session_policy=fresh`, `setup_cache_policy`, `timeout`, `viewports`, `rubric_version`, `output_root`: 격리, 공통 setup/cache와 bounded 실행·검증·보고 옵션이다. +- runner adapter 출력: + - 공통 timeline은 `submitted`, `first_output`, `first_file_write`, model call start/end, tool start/end, finish/complete, idle와 terminal outcome을 monotonic timestamp와 observation source로 표현한다. 구간이 겹치거나 source가 없으면 별도 `overlap|unavailable`로 남기고 `total-model-tool`을 authoritative overhead로 단정하지 않는다. + - usage는 model/stage, input/output/reasoning/cached/total, source(`provider_reported|client_reported|iop_ledger|estimated|unavailable`)와 호출 횟수를 보존한다. + - caller 고유 event는 raw evidence에 bounded/redacted 형태로 남기되 공통 field를 추정해 성공으로 만들지 않는다. +- pipeline 출력: + - attempt manifest, normalized timeline/usage, verification JSON, screenshot, score worksheet와 Markdown report를 run id 아래 연결한다. +- 금지: + - caller가 IOP를 우회한 provider 호출을 scored IOP cell로 인정한다. + - unsupported model alias나 effort를 다른 값으로 조용히 대체한다. + - preflight 성공을 실제 scored 결과로 재사용한다. + - raw secret이나 prompt/tool 원문을 tracked artifact에 포함한다. + +## Acceptance Scenarios + +| ID | Milestone Task | Given | When | Then | +|----|----------------|-------|------|------| +| S01 | `benchmark-manifest` | 새로운 model/agent/prompt/repetition 조합 | manifest validate | schema에 맞는 조합만 canonical ordering으로 확정되고 code 변경 없이 matrix가 늘어난다. | +| S02 | `benchmark-skill` | 사용자가 benchmark 준비·실행·보고를 요청 | skill 진입 | required context와 preflight를 확인하고 deterministic pipeline 명령으로 연결한다. | +| S03 | `isolated-workspace` | 같은 fixture를 쓰는 여러 cell/attempt | workspace 준비 | 동일 checksum의 clean workspace와 fresh caller session이 생성되고 `../iop-s2` source, 이전 history/resume state와 다른 attempt가 변경·재사용되지 않는다. | +| S04 | `run-lifecycle` | caller별 서로 다른 event/exit 형태 | 사용자 작업 1회 제출 | finish/complete와 idle까지 bounded 대기하고 terminal outcome을 공통 timeline으로 만든다. | +| S05 | `repeat-attempt` | `repetitions=1` 또는 더 큰 값과 중간 failure | matrix 실행 | cell별 repetition/attempt id가 안정적으로 생성되고 failure와 재실행이 덮어써지지 않는다. | +| S06 | `claude-iop` | IOP dev direct route와 Claude Code | Sonnet/Gemini/GPT direct preflight와 generic preset fixture 검증 | direct auth/model/stream/terminal과 arbitrary preset route adapter 계약이 확인된다. | +| S07 | `agy-iop` | IOP dev Gemini direct route와 agy | direct preflight와 generic preset fixture 검증 | 지원이면 IOP 경유가 입증되고 아니면 정확한 호환 gap이 기록된다. | +| S08 | `codex-iop` | IOP dev GPT direct route와 Codex | direct preflight와 generic preset fixture 검증 | 지원이면 IOP 경유가 입증되고 아니면 정확한 호환 gap이 기록된다. | +| S09 | `effort-route` | Sonnet 최고/Gemini high/GPT xhigh 요청 | 각 route preflight | requested/effective model·effort가 확인되며 unsupported 값은 fail-closed다. | +| S10 | `connection-gap` | credential/model 또는 endpoint/auth/protocol/stream 실패 | blocker 분류 | 안전한 등록 요청 또는 별도 구현 Plan 후보가 만들어지고 우회 PASS가 없다. | +| S11 | `timing-usage` | caller/model별 event와 provider usage 편차 | evidence normalize | 첫 output·첫 write·model/tool/queue/total 시간의 clock/source와 overlap, 호출 횟수와 token source/미제공이 보존된다. | +| S12 | `web-validation` | 생성된 vanilla web page | build/serve/render 검증 | 두 이미지, desktop/mobile, asset/console, 반응형·접근성 evidence와 screenshot이 생성된다. | +| S13 | `blind-score` | identity가 제거된 결과물과 screenshot | Codex 평가 | 동일 rubric version의 항목별 점수와 근거가 자동 gate와 분리되어 기록된다. | +| S14 | `report-output` | 성공·실패·blocked attempt evidence | 보고 생성 | 조건·버전·시간·token·품질·한계와 raw evidence 포인터가 있는 Markdown이 생성된다. | + +## Evidence Map + +| Scenario | Required Evidence | `agent-task` 연결 | 완료 Evidence 기대 | +|----------|-------------------|------------------|---------------------------| +| S01 | manifest schema/fixture validation과 matrix extension test | `agent-task/m-agent-comparison-benchmark-pipeline/benchmark-manifest/` | `benchmark-manifest` config-driven matrix evidence | +| S02 | project skill validation과 dry command transcript | `agent-task/m-agent-comparison-benchmark-pipeline/benchmark-skill/` | `benchmark-skill` deterministic entrypoint evidence | +| S03 | workspace checksum, containment와 non-mutation test | `agent-task/m-agent-comparison-benchmark-pipeline/isolated-workspace/` | `isolated-workspace` clean isolation evidence | +| S04 | fake/fixture event streams와 real CLI lifecycle probe | `agent-task/m-agent-comparison-benchmark-pipeline/run-lifecycle/` | `run-lifecycle` finish+idle/timeout/cancel evidence | +| S05 | repetition ordering, failure preservation과 resume test | `agent-task/m-agent-comparison-benchmark-pipeline/repeat-attempt/` | `repeat-attempt` immutable attempt evidence | +| S06 | redacted Claude Code→IOP preflight | `agent-task/m-agent-comparison-benchmark-pipeline/claude-iop/` | `claude-iop` route/auth/stream evidence | +| S07 | redacted agy→IOP preflight 또는 exact blocker | `agent-task/m-agent-comparison-benchmark-pipeline/agy-iop/` | `agy-iop` supported/gap evidence | +| S08 | redacted Codex→IOP preflight 또는 exact blocker | `agent-task/m-agent-comparison-benchmark-pipeline/codex-iop/` | `codex-iop` supported/gap evidence | +| S09 | requested/effective route/model/effort matrix | `agent-task/m-agent-comparison-benchmark-pipeline/effort-route/` | `effort-route` no-substitution evidence | +| S10 | blocker classifier와 follow-up routing test | `agent-task/m-agent-comparison-benchmark-pipeline/connection-gap/` | `connection-gap` registration/Plan routing evidence | +| S11 | normalized timeline/usage fixtures와 unavailable handling | `agent-task/m-agent-comparison-benchmark-pipeline/timing-usage/` | `timing-usage` source-aware metric evidence | +| S12 | deterministic web fixture, viewport screenshots와 gate result | `agent-task/m-agent-comparison-benchmark-pipeline/web-validation/` | `web-validation` render/console/accessibility evidence | +| S13 | anonymization mapping 분리와 rubric worksheet | `agent-task/m-agent-comparison-benchmark-pipeline/blind-score/` | `blind-score` unbiased score evidence | +| S14 | success/failure/blocked report golden test | `agent-task/m-agent-comparison-benchmark-pipeline/report-output/` | `report-output` Markdown/raw-link evidence | + +공통 완료 검증은 pipeline unit/integration test에서 실제 provider를 호출하지 않는 fake runner guard, manifest/schema validation, workspace containment·cleanup, secret redaction, report golden test와 `git diff --check`를 포함한다. 실제 외부 CLI 호출은 S06-S10의 명시적인 redacted dev preflight로만 분리한다. + +## Cross-repo Dependencies + +- 없음. `../iop-s2`는 같은 IOP 프로젝트의 dev 테스트베드 workspace이며 별도 프로젝트 Milestone 의존성으로 취급하지 않는다. + +## Drift Check + +- [x] Milestone 기능 Task와 Acceptance Scenario가 일치한다. +- [x] Evidence Map이 code-review/complete.log에서 검증 가능하다. +- [x] agent-contract를 쓰는 경우 SDD에 계약 원문을 복제하지 않았다. +- [x] 사용자 리뷰가 필요한 항목은 없고 확정된 D01-D10을 반영했다. + +## 사용자 리뷰 이력 + +- 2026-08-06: 사용자가 모든 비교군의 IOP 경유, Claude Code와 agy/Codex caller 조합, finish/idle 기준 원샷, 초기 1회·가변 반복 pipeline, dev `../iop-s2` 테스트베드와 post-smoke 실제 비교를 확정했다. + +## 작업 컨텍스트 + +- 표준선: project-local skill은 orchestration을, deterministic pipeline은 실제 CLI/IOP 호출과 evidence lifecycle을 소유한다. Agent-Ops dispatcher와 IOP 제품 runtime 책임을 섞지 않는다. +- 후속 SDD: [IOP 원샷 Agent 모델 비교 벤치마크](../iop-one-shot-agent-model-comparison/SDD.md) diff --git a/agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-one-shot-agent-model-comparison/SDD.md b/agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-one-shot-agent-model-comparison/SDD.md new file mode 100644 index 00000000..0e329567 --- /dev/null +++ b/agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-one-shot-agent-model-comparison/SDD.md @@ -0,0 +1,152 @@ +# SDD: [bench-02] IOP 원샷 Agent 모델 비교 벤치마크 + +## 위치 + +- Milestone: [IOP 원샷 Agent 모델 비교 벤치마크](../../../phase/knowledge-tool-optimization-extension/milestones/iop-one-shot-agent-model-comparison.md) +- Phase: [PHASE.md](../../../phase/knowledge-tool-optimization-extension/PHASE.md) + +## 상태 + +[승인됨] + +## SDD 잠금 + +- 상태: 해제 +- 사용자 리뷰: 없음 +- 잠금 항목: + - [x] [D01] 실제 비교는 `[route-02]` 정식 기능·필수 smoke와 `[bench-01]` pipeline 준비가 끝난 뒤 시작한다. + - [x] [D02] 9개 scored 비교군은 모두 dev `../iop-s2` IOP runtime을 경유한다. + - [x] [D03] 단독군은 Sonnet 5 최고, Gemini 3.6 Flash high, GPT-5.6 luna xhigh이며 Gemini/GPT는 Claude Code와 전용 caller(agy/Codex)를 각각 비교한다. + - [x] [D04] 하이브리드는 Gemini 또는 GPT가 plan/review/repair를, ornith-fast가 work를 담당하고 각각 Claude Code와 전용 caller를 비교한다. + - [x] [D05] 동일 이미지 2장과 vanilla HTML/CSS/JS 한 페이지 fixture를 clean workspace에 제공한다. + - [x] [D06] 초기 repetitions는 cell별 1이며 clean workspace와 fresh caller session에서 사용자 작업 제출 1회부터 finish/complete 후 idle까지 사람 개입 없이 실행한다. + - [x] [D07] 시간은 첫 output, 첫 file write, model/stage별 작업, tool, queue와 전체 finish/idle을 clock/source와 함께 기록하고 중첩 구간이나 미관측 overhead를 임의 산술 분해하지 않는다. + - [x] [D08] token은 input/output/reasoning/cached/total과 source를 model/stage별로 기록하고 미제공 값을 exact로 추정하지 않는다. + - [x] [D09] 결과 identity를 가린 뒤 동일 100점 rubric으로 Codex가 채점하고 자동 검증과 수동 점수를 분리한다. + - [x] [D10] scored failure는 보존하고 재실행은 새 attempt로 기록하며 성공 결과만 골라 대표하지 않는다. + +## 문제 / 비목표 + +- 문제: `[route-02]` 하이브리드 원샷의 실사용 가치와 overhead를 판단하려면 같은 IOP 경계, task fixture와 평가 기준에서 단독 모델·caller agent 조합과 속도·token·품질을 함께 비교해야 한다. 단일 성공 smoke만으로는 모델·agent·coordinator 차이를 설명할 수 없다. +- 비목표: + - `[route-02]` 완료 smoke를 대신하거나 benchmark 점수로 완료 상태를 소급 변경 + - 첫 보고서에서 통계적 다회 반복이나 장기/heavy 작업 평가 + - framework 설치·cache 성능 비교 + - model/provider 가격표를 billing-grade 비용으로 확정 + +## Source of Truth + +| 영역 | 기준 | 메모 | +|------|------|------| +| Roadmap | [Milestone 문서](../../../phase/knowledge-tool-optimization-extension/milestones/iop-one-shot-agent-model-comparison.md) | 9개 비교군과 완료 상태 원장 | +| Pipeline | [bench-01 Milestone](../../../phase/knowledge-tool-optimization-extension/milestones/agent-comparison-benchmark-pipeline.md)의 승인된 manifest/runner/report contract | 실행·측정·보고 구현 원본 | +| Testbed | `../iop-s2` dev IOP runtime | 모든 scored model 호출의 IOP 경유 대상 | +| Fixture | versioned prompt, 이미지 2장과 vanilla workspace checksum | 모든 cell의 동일 입력 기준 | +| Evidence | `agent-test/runs//` | attempt별 timeline, usage, validation, screenshot와 score | +| Report | `agent-test/dev/iop-one-shot-agent-comparison-.md` | 현재 프로젝트의 사람이 읽는 비교 결과 | +| API Contract | [Anthropic-Compatible Messages API](../../../../agent-contract/outer/anthropic-compatible-api.md), [OpenAI-Compatible API](../../../../agent-contract/outer/openai-compatible-api.md) | caller ingress, stream/terminal과 usage 기준 | +| Config Contract | [Edge Config And Runtime Refresh](../../../../agent-contract/inner/edge-config-runtime-refresh.md) | model route, preset, protocol profile과 credential 경계 | +| User Decision | D01-D10 | 2026-08-06 확정 방향, 추가 사용자 결정 없음 | + +## State Machine + +| 상태 | 진입 조건 | 다음 상태 | 근거 | +|------|-----------|-----------|------| +| `blocked` | `[route-02]` smoke 또는 `[bench-01]` 완료 전 | `preflighting`, 종료 | active Milestone 상태와 pipeline evidence | +| `preflighting` | 선행 조건 충족, execution-day caller/route/credential 점검 | `ready`, `blocked` | redacted preflight matrix | +| `ready` | fixture와 C01-C09 immutable manifest 확정 | `running`, `cancelled` | manifest/fixture/rubric digest | +| `running` | seed 순서에 따라 각 cell에 사용자 작업 1회 제출 | `validating`, `failed`, `timed_out`, `cancelled` | cell/attempt event timeline | +| `validating` | cell finish/complete 후 idle 확정 | `scoring`, `failed` | workspace, build/render/test evidence | +| `scoring` | C01-C09 결과 identity 제거 완료 | `analyzing`, `failed` | blind mapping과 rubric worksheet | +| `analyzing` | 자동 gate·시간·usage·score 완비 | `reported`, `failed` | comparison table과 limitation notes | +| `reported` | Markdown과 raw evidence 포인터 생성 | 종료 | report path와 digest | +| `failed` | cell 실행·검증·채점·보고 실패 | `analyzing`, 종료 | 보존된 실패 attempt; 누락 없는 matrix | +| `timed_out` | cell timeout | `analyzing`, 종료 | timeout/cancel/cleanup evidence | +| `cancelled` | 명시 중단 | 종료 | 실행된 cell과 미실행 cell 상태 | + +State invariant: + +- C01-C09는 동일 fixture checksum, viewport, rubric version, fresh caller session, setup/cache policy와 repetitions=1을 사용한다. +- execution order는 고정 seed로 생성해 보고서에 남기고 결과에 따라 재정렬하지 않는다. +- preflight와 setup usage/time은 scored measurement에 합산하지 않지만 별도 기록한다. +- 한 cell의 사용자 작업은 한 번 제출하며 사람의 feedback, manual edit, restart가 없다. +- model/tool 호출 횟수는 제약이 아니라 측정 대상이며 finish event 뒤 idle까지가 wall-clock terminal이다. +- 실패 cell도 report matrix에 남고 재실행 결과는 원래 attempt를 대체하지 않는다. + +## Interface Contract + +- 계약 원문: [Anthropic-Compatible Messages API](../../../../agent-contract/outer/anthropic-compatible-api.md), [OpenAI-Compatible API](../../../../agent-contract/outer/openai-compatible-api.md), [Edge Config And Runtime Refresh](../../../../agent-contract/inner/edge-config-runtime-refresh.md) +- 입력: + - `fixture`: 동일 이미지 2장, one-page 요구사항, vanilla HTML/CSS/JS initial workspace와 checksum이다. + - `cells`: C01-C09의 caller, IOP route/preset, expected model/stage와 effort binding이다. + - `repetitions=1`, `session_policy=fresh`, `setup_cache_policy`: 초기 scored attempt 수, conversation/resume 격리와 공통 setup/cache 기준이다. + - `environment=dev`, `testbed=../iop-s2`: 실제 IOP runtime 선택이다. + - `completion`: caller별 finish/complete event와 idle 판정 규칙이다. +- 측정 출력: + - timestamp: submitted, first output, first file write, model/stage start/end, tool start/end, finish, idle의 monotonic 값과 observation source다. overlap과 unavailable을 명시한다. + - usage: call count, input/output/reasoning/cached/total token과 source다. + - validation: requirement, build/serve, desktop/mobile, asset/console, responsive/accessibility 결과다. + - score: rubric version, 항목별 점수/근거와 총점이며 identity mapping과 분리한다. +- 100점 rubric: + - 요구사항 충족 25, 시각 완성도 25, 반응형·접근성 15, 이미지 활용·디테일 10, 동작 안정성 10, 코드 품질 10, 자체 검증 완결성 5. +- 금지: + - IOP를 우회한 model 호출을 scored cell로 인정한다. + - cell마다 prompt, asset, initial workspace나 viewport를 다르게 사용한다. + - unavailable token을 0으로 기록하거나 estimated 값을 provider-reported와 합친다. + - evaluator가 identity를 본 상태에서 점수를 조정하거나 결과를 수동 수정한다. + +## Acceptance Scenarios + +| ID | Milestone Task | Given | When | Then | +|----|----------------|-------|------|------| +| S01 | `fixture-lock` | 이미지 2장과 one-page benchmark brief | fixture 확정 | prompt/assets/workspace/viewports/rubric의 checksum과 version이 모든 cell에 동일하다. | +| S02 | `route-readiness` | C01-C09 caller와 dev IOP | execution-day preflight | auth, model/preset, effort, stream/finish/idle이 모두 확인되거나 exact blocker로 중단된다. | +| S03 | `matrix-lock` | 선행 gate가 통과한 9개 cell | scored manifest 생성 | repetitions=1, 실행 순서 seed, fresh-session/setup-cache 정책, timeout과 expected binding이 immutable하게 기록된다. | +| S04 | `claude-standalone` | C01 clean workspace | Claude Code 사용자 작업 1회 | IOP→Sonnet 최고 effort 결과와 complete/idle evidence가 생성된다. | +| S05 | `gemini-standalone` | C02-C03 clean workspace | Claude Code와 agy 사용자 작업을 각각 1회 제출 | 두 caller 모두 IOP→Gemini high 결과와 caller별 timing/usage를 남긴다. | +| S06 | `gpt-standalone` | C04-C05 clean workspace | Claude Code와 Codex 사용자 작업을 각각 1회 제출 | 두 caller 모두 IOP→GPT xhigh 결과와 caller별 timing/usage를 남긴다. | +| S07 | `gemini-hybrid` | C06-C07 clean workspace | Claude Code와 agy 사용자 작업을 각각 1회 제출 | IOP Gemini plan→ornith work→Gemini review/repair의 stage evidence와 최종 결과를 남긴다. | +| S08 | `gpt-hybrid` | C08-C09 clean workspace | Claude Code와 Codex 사용자 작업을 각각 1회 제출 | IOP GPT plan→ornith work→GPT review/repair의 stage evidence와 최종 결과를 남긴다. | +| S09 | `objective-validation` | C01-C09 성공·실패 workspace | 자동 웹 검증 | 각 cell의 동일 gate 결과, screenshot과 실패 이유가 누락 없이 생성된다. | +| S10 | `quality-scoring` | identity가 제거된 9개 결과 | Codex rubric 평가 | 항목별 점수/근거와 총점이 자동 gate와 분리되어 기록된다. | +| S11 | `performance-usage` | 모든 attempt timeline/usage | 비교 집계 | 첫 output·첫 write·model/tool/queue/total 시간의 clock/source·overlap, 호출 수와 token/source가 cell·stage별 표가 된다. | +| S12 | `benchmark-report` | S01-S11 evidence | 보고서 생성 | 조건·버전·9개 결과·속도·token·품질·실패·한계와 raw evidence 링크가 Markdown에 남는다. | + +## Evidence Map + +| Scenario | Required Evidence | `agent-task` 연결 | 완료 Evidence 기대 | +|----------|-------------------|------------------|---------------------------| +| S01 | fixture prompt/assets/workspace/rubric digest | `agent-task/m-iop-one-shot-agent-model-comparison/fixture-lock/` | `fixture-lock` identical-input evidence | +| S02 | redacted C01-C09 preflight matrix | `agent-task/m-iop-one-shot-agent-model-comparison/route-readiness/` | `route-readiness` auth/route/effort/terminal evidence | +| S03 | immutable scored manifest와 order seed | `agent-task/m-iop-one-shot-agent-model-comparison/matrix-lock/` | `matrix-lock` 9-cell/repetitions=1 evidence | +| S04 | C01 event/timing/usage/workspace evidence | `agent-task/m-iop-one-shot-agent-model-comparison/claude-standalone/` | `claude-standalone` one-submission/IOP evidence | +| S05 | C02-C03 caller별 event/timing/usage/workspace evidence | `agent-task/m-iop-one-shot-agent-model-comparison/gemini-standalone/` | `gemini-standalone` two-caller evidence | +| S06 | C04-C05 caller별 event/timing/usage/workspace evidence | `agent-task/m-iop-one-shot-agent-model-comparison/gpt-standalone/` | `gpt-standalone` two-caller evidence | +| S07 | C06-C07 Gemini/ornith stage와 terminal evidence | `agent-task/m-iop-one-shot-agent-model-comparison/gemini-hybrid/` | `gemini-hybrid` two-caller stage evidence | +| S08 | C08-C09 GPT/ornith stage와 terminal evidence | `agent-task/m-iop-one-shot-agent-model-comparison/gpt-hybrid/` | `gpt-hybrid` two-caller stage evidence | +| S09 | build/render/viewport/asset/console/accessibility result와 screenshot | `agent-task/m-iop-one-shot-agent-model-comparison/objective-validation/` | `objective-validation` uniform gate evidence | +| S10 | blind mapping 분리와 Codex rubric worksheet | `agent-task/m-iop-one-shot-agent-model-comparison/quality-scoring/` | `quality-scoring` 100-point evidence | +| S11 | cell/stage별 normalized timeline, calls와 token-source table | `agent-task/m-iop-one-shot-agent-model-comparison/performance-usage/` | `performance-usage` speed/token evidence | +| S12 | `agent-test/dev/` Markdown과 raw run links | `agent-task/m-iop-one-shot-agent-model-comparison/benchmark-report/` | `benchmark-report` complete comparison evidence | + +공통 완료 검증은 C01-C09 모두가 success/failure/blocked 중 하나의 terminal evidence를 가지고, 성공 결과의 자동 gate·screenshot·blind score와 모든 attempt의 timing/usage source가 보고서에 연결되는지 확인한다. 필수 credential/model이 없으면 raw secret을 요구하거나 기록하지 않고 운영 절차로 등록을 요청한다. + +## Cross-repo Dependencies + +- 없음. 같은 IOP 프로젝트의 `[route-02]`와 `[bench-01]` 실행 순서는 [전역 마일스톤 실행 순서](../../../priority-queue.md)에서 관리한다. + +## Drift Check + +- [x] Milestone 기능 Task와 Acceptance Scenario가 일치한다. +- [x] Evidence Map이 code-review/complete.log에서 검증 가능하다. +- [x] agent-contract를 쓰는 경우 SDD에 계약 원문을 복제하지 않았다. +- [x] 사용자 리뷰가 필요한 항목은 없고 확정된 D01-D10을 반영했다. + +## 사용자 리뷰 이력 + +- 2026-08-06: 사용자가 Sonnet/Gemini/GPT 단독과 Gemini/GPT 하이브리드의 9개 IOP 경유 비교군, Claude Code·agy·Codex caller, finish/idle 원샷, 초기 1회, dev `../iop-s2`, 동일 정적 웹 fixture와 시간·token·Codex 품질 평가를 확정했다. + +## 작업 컨텍스트 + +- 표준선: 이 비교는 `[route-02]` 완료 이후의 추가 검증이며 정식 smoke의 일부나 대체 evidence가 아니다. +- 후속 SDD: 없음 diff --git a/agent-task/m-iop-owned-single-request-agent-execution/12+05,08,11_internal_tool_loop/CODE_REVIEW-cloud-G10.md b/agent-task/m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop/CODE_REVIEW-cloud-G10.md similarity index 88% rename from agent-task/m-iop-owned-single-request-agent-execution/12+05,08,11_internal_tool_loop/CODE_REVIEW-cloud-G10.md rename to agent-task/m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop/CODE_REVIEW-cloud-G10.md index 79ed48fa..f1317875 100644 --- a/agent-task/m-iop-owned-single-request-agent-execution/12+05,08,11_internal_tool_loop/CODE_REVIEW-cloud-G10.md +++ b/agent-task/m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop/CODE_REVIEW-cloud-G10.md @@ -1,4 +1,4 @@ - + # Code Review Reference - API @@ -15,7 +15,7 @@ ## Overview date=2026-08-06 -task=m-iop-owned-single-request-agent-execution/12+05,08,11_internal_tool_loop, plan=0, tag=API +task=m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop, plan=0, tag=API ## For the Review Agent @@ -26,7 +26,7 @@ Review completion means the following steps are finished: 1. Append verdict and `review_rework_count` / `evidence_integrity_failure` routing signals. 2. Archive `CODE_REVIEW-cloud-G10.md` → `code_review_cloud_G10_0.log` and `PLAN-cloud-G09.md` → `plan_cloud_G09_0.log`. -3. If PASS, write `complete.log` and move active task directory to `agent-task/archive/YYYY/MM/m-iop-owned-single-request-agent-execution/12+05,08,11_internal_tool_loop/`. If WARN/FAIL, fully write the next filesystem state required by the code-review skill. +3. If PASS, write `complete.log` and move active task directory to `agent-task/archive/YYYY/MM/m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop/`. If WARN/FAIL, fully write the next filesystem state required by the code-review skill. 4. If PASS, preserve the first-line `milestone-task=tool-loop` metadata in `complete.log` and report it for runtime aggregation. Roadmap state evaluation belongs to `sync-milestone-workstate`. 5. Check applicable `Review-Only Checklist` items at the final `.log` location before reporting. @@ -69,6 +69,7 @@ _Record implemented decisions._ ## Reviewer Checkpoints - Confirm service-owned schemas do not call route-01 caller codecs. +- Confirm packet 06 completed before this packet changed the shared Anthropic contract and input spec; no streaming implementation was pulled into this packet. - Confirm strict decode/capability checks precede wire effects and tool calls execute in order. - Confirm exact request/stage/tool/generation correlation, budget enforcement, and one continuation delivery. - Confirm cancellation sends Node cancel and no tool event reaches surface progress/terminal. @@ -86,7 +87,15 @@ Paste actual stdout/stderr for every command and record replacements under devia [fill] ``` -### 2. Packet 08 dependency +### 2. Packet 06 dependency + +`test -f agent-task/m-iop-owned-single-request-agent-execution/06+05_stream_terminal/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/06+05_stream_terminal/complete.log' | wc -l)" -eq 1` + +```text +[fill] +``` + +### 3. Packet 08 dependency `test -f agent-task/m-iop-owned-single-request-agent-execution/08+03,07_workspace_admission/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/08+03,07_workspace_admission/complete.log' | wc -l)" -eq 1` @@ -94,7 +103,7 @@ Paste actual stdout/stderr for every command and record replacements under devia [fill] ``` -### 3. Packet 11 dependency +### 4. Packet 11 dependency `test -f agent-task/m-iop-owned-single-request-agent-execution/11+10_workspace_command/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/11+10_workspace_command/complete.log' | wc -l)" -eq 1` @@ -102,7 +111,7 @@ Paste actual stdout/stderr for every command and record replacements under devia [fill] ``` -### 4. Service race tests +### 5. Service race tests `go test -race ./apps/edge/internal/service -run 'Test(InternalWorkspaceTool|SingleRequestInternalToolLoop)' -count=1` @@ -110,7 +119,7 @@ Paste actual stdout/stderr for every command and record replacements under devia [fill] ``` -### 5. HTTP evidence +### 6. HTTP evidence `go test ./apps/edge/internal/openai -run 'TestAnthropicSingleRequest(UsesOnePost|InternalToolsStayPrivate)' -count=1` @@ -118,7 +127,7 @@ Paste actual stdout/stderr for every command and record replacements under devia [fill] ``` -### 6. Package regression +### 7. Package regression `go test ./apps/edge/internal/service ./apps/edge/internal/openai -count=1` @@ -126,7 +135,7 @@ Paste actual stdout/stderr for every command and record replacements under devia [fill] ``` -### 7. Vet +### 8. Vet `go vet ./apps/edge/internal/service ./apps/edge/internal/openai` @@ -134,7 +143,7 @@ Paste actual stdout/stderr for every command and record replacements under devia [fill] ``` -### 8. Contract/spec search +### 9. Contract/spec search `rg --sort path -n 'internal tool|tool_use|second|workspace|defer' agent-contract/outer/anthropic-compatible-api.md agent-spec/input/openai-compatible-surface.md agent-spec/runtime/edge-node-execution.md` @@ -142,7 +151,7 @@ Paste actual stdout/stderr for every command and record replacements under devia [fill] ``` -### 9. Whitespace +### 10. Whitespace `git diff --check` diff --git a/agent-task/m-iop-owned-single-request-agent-execution/12+05,08,11_internal_tool_loop/PLAN-cloud-G09.md b/agent-task/m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop/PLAN-cloud-G09.md similarity index 85% rename from agent-task/m-iop-owned-single-request-agent-execution/12+05,08,11_internal_tool_loop/PLAN-cloud-G09.md rename to agent-task/m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop/PLAN-cloud-G09.md index 73ad27f0..9850f9b8 100644 --- a/agent-task/m-iop-owned-single-request-agent-execution/12+05,08,11_internal_tool_loop/PLAN-cloud-G09.md +++ b/agent-task/m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop/PLAN-cloud-G09.md @@ -1,10 +1,10 @@ - + # Coordinator-owned Internal Workspace Tool Loop ## For the Implementing Agent -Do not start until packets 05, 08, and 11 each have `complete.log`. Implement the coordinator/tool continuation exactly within the listed boundary, run all verification, fill `CODE_REVIEW-cloud-G10.md`, and leave finalization to official review. Do not reuse caller continuation or activate an unplanned production stage driver. +Do not start until packets 05, 06, 08, and 11 each have `complete.log`. Implement the coordinator/tool continuation exactly within the listed boundary, run all verification, fill `CODE_REVIEW-cloud-G10.md`, and leave finalization to official review. Do not reuse caller continuation or activate an unplanned production stage driver. ## Background @@ -25,6 +25,7 @@ The coordinator recognizes an `internal_tool` detour and the Node can execute to - `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-owned-single-request-agent-execution/SDD.md` - `agent-task/m-iop-owned-single-request-agent-execution/03+02_single_request_coordinator/PLAN-local-G07.md` - `agent-task/m-iop-owned-single-request-agent-execution/05+03_single_ingress/PLAN-cloud-G09.md` +- `agent-task/m-iop-owned-single-request-agent-execution/06+05_stream_terminal/PLAN-cloud-G09.md` - `apps/edge/internal/service/service.go` - `apps/edge/internal/openai/server.go` - `apps/edge/internal/openai/anthropic_handler.go` @@ -44,7 +45,7 @@ The coordinator recognizes an `internal_tool` detour and the Node can execute to ### Verification Context -- Packet 03 defines coordinator envelopes and terminal ownership; packet 05 proves one real marked POST; packet 08 supplies immutable workspace admission; packet 11 supplies all canonical Node operations. +- Packet 03 defines coordinator envelopes and terminal ownership; packet 05 proves one real marked POST; packet 06 owns the shared outer-contract/input-spec write boundary; packet 08 supplies immutable workspace admission; packet 11 supplies all canonical Node operations. - These APIs do not exist at starting HEAD, so dependency completion and exact post-implementation interfaces are mandatory preflight. - Service race tests plus packet 05's real HTTP test are the deterministic oracle; no real provider or Mac runner is needed. @@ -68,6 +69,7 @@ The coordinator recognizes an `internal_tool` detour and the Node can execute to ### Split Judgment - The decode/correlate/wire/result/resume invariant is atomic and independently PASS-capable with fake executor plus net-pipe Node. +- Packet 06 is an ordering-only predecessor: it must complete before this packet updates the shared Anthropic contract and input spec, but its streaming implementation is not consumed by this non-stream tool-loop evidence. - Provider-specific plan/work/review prompts and repair policy are excluded and consume this port later. ### Scope Rationale @@ -84,9 +86,10 @@ The coordinator recognizes an `internal_tool` detour and the Node can execute to ## Dependencies and Execution Order 1. Require packet 05 for the marked HTTP branch/evidence. -2. Require packet 08 for immutable workspace identity/capabilities. -3. Require packet 11 for complete file/command/cancel execution. -4. Define schemas and continuation interface, implement the loop, then extend real-POST evidence/docs. +2. Require packet 06 to serialize the shared Anthropic contract and input-spec write set. +3. Require packet 08 for immutable workspace identity/capabilities. +4. Require packet 11 for complete file/command/cancel execution. +5. Define schemas and continuation interface, implement the loop, then extend real-POST evidence/docs. ## Implementation Checklist @@ -218,20 +221,21 @@ Extend the completed packet 05 fixture with packet 12's service tool loop and a | `agent-contract/outer/anthropic-compatible-api.md` | API-3 | | `agent-spec/input/openai-compatible-surface.md` | API-3 | | `agent-spec/runtime/edge-node-execution.md` | API-3 | -| `agent-task/m-iop-owned-single-request-agent-execution/12+05,08,11_internal_tool_loop/CODE_REVIEW-cloud-G10.md` | API-1, API-2, API-3 | +| `agent-task/m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop/CODE_REVIEW-cloud-G10.md` | API-1, API-2, API-3 | ## Final Verification 1. `test -f agent-task/m-iop-owned-single-request-agent-execution/05+03_single_ingress/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/05+03_single_ingress/complete.log' | wc -l)" -eq 1` -2. `test -f agent-task/m-iop-owned-single-request-agent-execution/08+03,07_workspace_admission/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/08+03,07_workspace_admission/complete.log' | wc -l)" -eq 1` -3. `test -f agent-task/m-iop-owned-single-request-agent-execution/11+10_workspace_command/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/11+10_workspace_command/complete.log' | wc -l)" -eq 1` -4. `go test -race ./apps/edge/internal/service -run 'Test(InternalWorkspaceTool|SingleRequestInternalToolLoop)' -count=1` -5. `go test ./apps/edge/internal/openai -run 'TestAnthropicSingleRequest(UsesOnePost|InternalToolsStayPrivate)' -count=1` -6. `go test ./apps/edge/internal/service ./apps/edge/internal/openai -count=1` -7. `go vet ./apps/edge/internal/service ./apps/edge/internal/openai` -8. `rg --sort path -n 'internal tool|tool_use|second|workspace|defer' agent-contract/outer/anthropic-compatible-api.md agent-spec/input/openai-compatible-surface.md agent-spec/runtime/edge-node-execution.md` -9. `git diff --check` +2. `test -f agent-task/m-iop-owned-single-request-agent-execution/06+05_stream_terminal/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/06+05_stream_terminal/complete.log' | wc -l)" -eq 1` +3. `test -f agent-task/m-iop-owned-single-request-agent-execution/08+03,07_workspace_admission/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/08+03,07_workspace_admission/complete.log' | wc -l)" -eq 1` +4. `test -f agent-task/m-iop-owned-single-request-agent-execution/11+10_workspace_command/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/11+10_workspace_command/complete.log' | wc -l)" -eq 1` +5. `go test -race ./apps/edge/internal/service -run 'Test(InternalWorkspaceTool|SingleRequestInternalToolLoop)' -count=1` +6. `go test ./apps/edge/internal/openai -run 'TestAnthropicSingleRequest(UsesOnePost|InternalToolsStayPrivate)' -count=1` +7. `go test ./apps/edge/internal/service ./apps/edge/internal/openai -count=1` +8. `go vet ./apps/edge/internal/service ./apps/edge/internal/openai` +9. `rg --sort path -n 'internal tool|tool_use|second|workspace|defer' agent-contract/outer/anthropic-compatible-api.md agent-spec/input/openai-compatible-surface.md agent-spec/runtime/edge-node-execution.md` +10. `git diff --check` -Expected: all three predecessors are uniquely complete; multi-tool flow stays internal and ordered under race; one real POST yields one private-free terminal; package checks pass. Cached tests are not acceptable. +Expected: all four predecessors are uniquely complete; shared documentation writes are serialized after packet 06; multi-tool flow stays internal and ordered under race; one real POST yields one private-free terminal; package checks pass. Cached tests are not acceptable. **After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`.** diff --git a/agent-task/m-iop-owned-single-request-agent-execution/13+12_workspace_cleanup/CODE_REVIEW-cloud-G10.md b/agent-task/m-iop-owned-single-request-agent-execution/13+12_workspace_cleanup/CODE_REVIEW-cloud-G10.md index 9b75bb2a..5e3f97e5 100644 --- a/agent-task/m-iop-owned-single-request-agent-execution/13+12_workspace_cleanup/CODE_REVIEW-cloud-G10.md +++ b/agent-task/m-iop-owned-single-request-agent-execution/13+12_workspace_cleanup/CODE_REVIEW-cloud-G10.md @@ -85,7 +85,7 @@ Paste actual stdout/stderr for every command; record replacements under deviatio ### 1. Dependency -`test -f agent-task/m-iop-owned-single-request-agent-execution/12+05,08,11_internal_tool_loop/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/12+05,08,11_internal_tool_loop/complete.log' | wc -l)" -eq 1` +`test -f agent-task/m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop/complete.log' | wc -l)" -eq 1` ```text [fill] diff --git a/agent-task/m-iop-owned-single-request-agent-execution/13+12_workspace_cleanup/PLAN-cloud-G09.md b/agent-task/m-iop-owned-single-request-agent-execution/13+12_workspace_cleanup/PLAN-cloud-G09.md index f5334e34..54265ea9 100644 --- a/agent-task/m-iop-owned-single-request-agent-execution/13+12_workspace_cleanup/PLAN-cloud-G09.md +++ b/agent-task/m-iop-owned-single-request-agent-execution/13+12_workspace_cleanup/PLAN-cloud-G09.md @@ -193,7 +193,7 @@ Implement Node cleanup mapping. Add a separate optional `SingleRequestWorkspaceL ## Final Verification -1. `test -f agent-task/m-iop-owned-single-request-agent-execution/12+05,08,11_internal_tool_loop/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/12+05,08,11_internal_tool_loop/complete.log' | wc -l)" -eq 1` +1. `test -f agent-task/m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop/complete.log' | wc -l)" -eq 1` 2. `go test -race ./apps/node/internal/workspace -run 'TestWorkspaceCleanup' -count=1` 3. `go test -race ./apps/node/internal/node ./apps/edge/internal/service -run 'Test(NodeWorkspaceCleanup|SingleRequestCleanup)' -count=1` 4. `go test ./apps/node/internal/workspace ./apps/node/internal/node ./apps/edge/internal/service -count=1` diff --git a/agent-task/m-iop-owned-single-request-agent-execution/14+05,12,13_observation_timing/CODE_REVIEW-cloud-G07.md b/agent-task/m-iop-owned-single-request-agent-execution/14+05,12,13_observation_timing/CODE_REVIEW-cloud-G07.md index acc2c125..dee79e63 100644 --- a/agent-task/m-iop-owned-single-request-agent-execution/14+05,12,13_observation_timing/CODE_REVIEW-cloud-G07.md +++ b/agent-task/m-iop-owned-single-request-agent-execution/14+05,12,13_observation_timing/CODE_REVIEW-cloud-G07.md @@ -84,7 +84,7 @@ Paste actual stdout/stderr for every command; record replacements under deviatio ### 2. Packet 12 dependency -`test -f agent-task/m-iop-owned-single-request-agent-execution/12+05,08,11_internal_tool_loop/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/12+05,08,11_internal_tool_loop/complete.log' | wc -l)" -eq 1` +`test -f agent-task/m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop/complete.log' | wc -l)" -eq 1` ```text [fill] diff --git a/agent-task/m-iop-owned-single-request-agent-execution/14+05,12,13_observation_timing/PLAN-local-G06.md b/agent-task/m-iop-owned-single-request-agent-execution/14+05,12,13_observation_timing/PLAN-local-G06.md index 2f549a0c..8b52c90a 100644 --- a/agent-task/m-iop-owned-single-request-agent-execution/14+05,12,13_observation_timing/PLAN-local-G06.md +++ b/agent-task/m-iop-owned-single-request-agent-execution/14+05,12,13_observation_timing/PLAN-local-G06.md @@ -125,7 +125,7 @@ Add an injectable clock and failure-isolated observer snapshot on `Service`. Acc ## Final Verification 1. `test -f agent-task/m-iop-owned-single-request-agent-execution/05+03_single_ingress/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/05+03_single_ingress/complete.log' | wc -l)" -eq 1` -2. `test -f agent-task/m-iop-owned-single-request-agent-execution/12+05,08,11_internal_tool_loop/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/12+05,08,11_internal_tool_loop/complete.log' | wc -l)" -eq 1` +2. `test -f agent-task/m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop/complete.log' | wc -l)" -eq 1` 3. `test -f agent-task/m-iop-owned-single-request-agent-execution/13+12_workspace_cleanup/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/13+12_workspace_cleanup/complete.log' | wc -l)" -eq 1` 4. `go test -race ./apps/edge/internal/service -run 'TestSingleRequestObservation' -count=1` 5. `go test ./apps/edge/internal/service -count=1`