fix: preserve implementation step boundaries

This commit is contained in:
KOKO\Mimi
2026-08-15 03:57:29 +09:00
parent 869b6ce241
commit 79a3c1c666
15 changed files with 187 additions and 33 deletions
+18 -6
View File
@@ -60,21 +60,29 @@ Execution contract:
later pending Step.
- Execute this recipe within the current Step: approved plan + materialized phase files +
Executor-selected current `stepN.md` -> read prerequisites and previous summaries -> RED ->
OBSERVED FAILURE -> MINIMAL GREEN -> FOCUSED VERIFY -> FULL MSVC BUILD/CTEST -> ARTIFACT CHECK
-> COMPARE -> CLASSIFY -> REPORT -> update only current Step status plus
OBSERVED FAILURE -> MINIMAL GREEN -> the Step's declared FOCUSED/FULL VERIFY acceptance commands
-> update only current Step status plus
`summary`/`error_message`/`blocked_reason` -> stop without starting the next Step.
- A non-final Step is complete when its declared acceptance commands pass. It must not fail merely
because final solver output, reference artifacts, or `reference-comparison.md` are not yet available.
- Only when the approved implementation plan places the Executor-selected current Step after all
prerequisite implementation Steps as the final Implementation-owned verification Step/gate,
continue with `ARTIFACT CHECK -> COMPARE -> CLASSIFY -> REPORT`, require generated `results.h5`,
and complete `docs/<feature-id>/reference-comparison.md`.
- Always work in RED -> GREEN -> VERIFY order.
- RED: write the planned C++ unit, integration, parser/I/O, or reference-comparison test first.
- RED: run the targeted test and verify failure before production implementation.
- GREEN: implement the minimum code needed for the planned task and acceptance criterion.
- VERIFY: resolve commands from `.harness/config.json` first, then Harness project defaults; run the targeted CTest command, then the full MSVC x64 Debug build/test commands in the configured order.
- VERIFY: resolve commands from `.harness/config.json` first, then Harness project defaults; run the
targeted command and any focused/full MSVC x64 Debug build/test commands declared by the current
Step in the configured order.
- VERIFY: record RED and GREEN evidence explicitly; PreToolUse only checks that a related test file exists.
- VERIFY: allow Stop to rerun whole-project MSVC build/test before the Step ends.
- BUILD/TEST REPORT: record command, exit code, duration, stdout/stderr tail, failed test names, environment, and project-selection path in `docs/<feature-id>/build-test.md` with `owner_agent: implementation-agent`.
- BUILD/TEST REPORT: stop after the first decisive failure unless the approved plan requires another diagnostic command.
- ARTIFACT CHECK -> COMPARE -> CLASSIFY -> REPORT: require the exact declared input/CSV paths, generated `results.h5`, HDF5 projection from `docs/<feature-id>/io.md`, source identity/component matching, row uniqueness/finite checks, and approved tolerance.
- FINAL VERIFICATION GATE — ARTIFACT CHECK -> COMPARE -> CLASSIFY -> REPORT: require the exact declared input/CSV paths, generated `results.h5`, HDF5 projection from `docs/<feature-id>/io.md`, source identity/component matching, row uniqueness/finite checks, and approved tolerance.
- COMPARE: reject missing, extra, duplicate, or nonfinite required rows before tolerance; preserve warning-only behavior and never alter tolerance or artifacts to obtain a pass.
- REPORT: write `docs/<feature-id>/implementation-report.md`, `docs/<feature-id>/build-test.md`, and `docs/<feature-id>/reference-comparison.md`.
- FINAL VERIFICATION GATE REPORT: complete `docs/<feature-id>/implementation-report.md`, `docs/<feature-id>/build-test.md`, and `docs/<feature-id>/reference-comparison.md`.
- `.codex/hooks.json` is authoritative: PreToolUse runs `scripts/hooks/pre_tool_use.py` and Stop
runs `scripts/hooks/stop_validation.py` automatically. Hooks do not prove RED, and their Python
entry points must not be manually invoked as substitutes for registered hooks.
@@ -139,7 +147,11 @@ Reference comparison quality gate:
- Do not calculate, invent, or treat a metric as required when the approved feature contract does not make it applicable.
Return contract:
- Return `docs/<feature-id>/implementation-report.md`, `docs/<feature-id>/build-test.md`, and `docs/<feature-id>/reference-comparison.md`, plus status, evidence summary, and blockers, to Coordinator Agent.
- For a non-final Step, return only that Step's owned status/summary and applicable evidence without
requiring final solver output or a completed reference comparison.
- From the final Implementation-owned verification Step/gate, return
`docs/<feature-id>/implementation-report.md`, `docs/<feature-id>/build-test.md`, and
`docs/<feature-id>/reference-comparison.md`, plus status, evidence summary, and blockers, to Coordinator Agent.
- Return `pass-for-physics-evaluation` only when the full build/test and all blocking comparisons pass.
- Return repeated or unclear implementation failures as a Correction Agent request through Coordinator Agent.