fix: require canonical implementation prerequisites

This commit is contained in:
KOKO\Mimi
2026-08-15 03:01:01 +09:00
parent c020b60f99
commit a8efe2b738
2 changed files with 20 additions and 16 deletions
+17 -13
View File
@@ -40,16 +40,20 @@ Hard boundaries:
Input priorities:
1. User-provided implementation request and constraints.
2. docs/<feature-id>/implementation-plan.md.
3. AGENTS.md and docs/SOLVER_AGENT_DESIGN.md.
4. Related docs/<feature-id>/requirements.md when present.
5. Related docs/<feature-id>/research.md when present.
6. Related docs/<feature-id>/formulation.md when present.
7. Related docs/<feature-id>/numerical-review.md when present.
8. Related docs/<feature-id>/reference-model.md when present.
9. Related docs/<feature-id>/io.md when present.
2. AGENTS.md and docs/SOLVER_AGENT_DESIGN.md.
3. `docs/<feature-id>/requirements.md`.
4. `docs/<feature-id>/research.md`.
5. `docs/<feature-id>/formulation.md`.
6. `docs/<feature-id>/numerical-review.md`.
7. `docs/<feature-id>/reference-model.md`.
8. `docs/<feature-id>/io.md`.
9. `docs/<feature-id>/implementation-plan.md`.
10. Existing source, tests, CMake files, harness scripts, and stored reference artifacts when present.
Readiness prerequisites:
- Require all canonical feature documents in items 3-9 before implementation starts.
- If any prerequisite is missing, stale, contradictory, or not ready for implementation, stop with `needs-upstream-decision` and return the missing evidence to Coordinator Agent.
Execution contract:
- Require an approved implementation plan, materialized phase files, and the Executor-selected
current Step (`Executor-selected current Step`). Do not fall back to the broad plan or start a
@@ -68,7 +72,7 @@ Execution contract:
- 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 `io.md`, source identity/component matching, row uniqueness/finite checks, and approved tolerance.
- 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`.
- `.codex/hooks.json` is authoritative: PreToolUse runs `scripts/hooks/pre_tool_use.py` and Stop
@@ -100,7 +104,7 @@ Failure handling:
- If evidence points to requirements, formulation, HDF5 projection, tolerance, declared inputs, or reference artifacts, stop and return an upstream-contract blocker to Coordinator Agent.
- Do not silently reinterpret upstream documents to force implementation through.
Required implementation-report.md sections:
Required `docs/<feature-id>/implementation-report.md` sections:
1. Metadata: feature_id, source_implementation_plan, status, owner_agent, date.
2. Implemented Scope: completed task ids, skipped task ids, and reason.
3. Test Evidence: tests written first, observed RED failure, GREEN pass, and commands.
@@ -110,7 +114,7 @@ Required implementation-report.md sections:
7. Blockers: upstream document mismatch, reference artifact gaps, formulation ambiguity, I/O ambiguity, or repeated failure.
8. Downstream Handoff: Correction Agent or Coordinator Agent.
Required build-test.md sections:
Required `docs/<feature-id>/build-test.md` sections:
1. Metadata: feature_id, source implementation report, status, owner_agent: implementation-agent, date.
2. Execution Environment: OS, generator, platform, config, build dir, Harness config presence, and project selection path.
3. Command Log Summary: command, exit code, duration, stdout/stderr tail.
@@ -121,10 +125,10 @@ Required build-test.md sections:
8. No-Change Assertion for reference artifacts and tolerance policies.
9. Open Issues.
Required reference-comparison.md sections:
Required `docs/<feature-id>/reference-comparison.md` sections:
1. Metadata: feature_id, source docs and reports, status, owner_agent: implementation-agent, date.
2. Artifact Inventory: exact declared input/CSV paths, generated `results.h5`, and optional FESA debug CSV view.
3. Comparison Contract: HDF5 projection from `io.md`, source-ID/component matching, row prechecks, tolerance source, and blocking/warning behavior.
3. Comparison Contract: HDF5 projection from `docs/<feature-id>/io.md`, source-ID/component matching, row prechecks, tolerance source, and blocking/warning behavior.
4. Quantity Results: per-row decisions, row counts, max absolute error, max relative or component-normalized error, RMS error, norm error, worst id/component, and pass/fail or warning for every declared quantity; include each error metric only where the approved feature contract makes it applicable.
5. Failure Classification and Handoff Recommendation through the Coordinator Agent.
6. No-Change Assertion: source, test, CMake, declared inputs, reference artifacts, and tolerance policies were not modified.
+3 -3
View File
@@ -54,7 +54,7 @@ For Harness implementation, also read `.agents/skills/harness/SKILL.md`,
12. Record every build/test command, exit code, duration, stdout/stderr tail, failed test names, environment, and project-selection path. Stop after the first decisive failure unless the implementation plan requires another diagnostic command.
13. For failure triage, classify as `configure | compile | link | test | reference-comparison | harness | environment | upstream-contract`.
14. Run reference comparison in this literal order: `ARTIFACT CHECK -> COMPARE -> CLASSIFY -> REPORT`.
15. ARTIFACT CHECK requires exact declared input/CSV paths, generated `results.h5`, the `io.md` HDF5 projection, source identity/component matching, row uniqueness/finite checks, and approved tolerance.
15. ARTIFACT CHECK requires exact declared input/CSV paths, generated `results.h5`, the `docs/<feature-id>/io.md` HDF5 projection, source identity/component matching, row uniqueness/finite checks, and approved tolerance.
16. COMPARE matches HDF5 and CSV rows by declared source identity and component, never by row order. Reject missing, extra, duplicate, and nonfinite required rows before tolerance; preserve warning-only behavior.
17. Fix implementation-owned failures only and keep changes traceable to the implementation plan.
@@ -68,12 +68,12 @@ Produce the applicable feature-bundled evidence:
- `docs/<feature-id>/reference-comparison.md`
- `docs/<feature-id>/corrections.md`
`implementation-report.md` records RED/GREEN/VERIFY evidence. `build-test.md` uses
`docs/<feature-id>/implementation-report.md` records RED/GREEN/VERIFY evidence. `docs/<feature-id>/build-test.md` uses
`owner_agent: implementation-agent` and records the historical build/test sections: metadata,
execution environment, command-log summary, validation results, failure classification, failed
test inventory, handoff recommendation, no-change assertion, and open issues.
`reference-comparison.md` records the exact input/CSV artifact inventory, `results.h5`, HDF5
`docs/<feature-id>/reference-comparison.md` records the exact input/CSV artifact inventory, `results.h5`, HDF5
projection, source-ID/component matching, row prechecks, approved tolerance, per-quantity
per-row decisions, max absolute error, max relative or component-normalized error, RMS error,
norm error where the approved feature contract makes each metric applicable, classification,