From 713b41b771c792307270d8ba024331bdbf933f90 Mon Sep 17 00:00:00 2001 From: "KOKO\\Mimi" Date: Wed, 12 Aug 2026 15:16:01 +0900 Subject: [PATCH] docs: bind implementation agents to Harness steps --- .codex/agents/implementation-agent.toml | 18 ++++++++++++++++++ .../agents/implementation-planning-agent.toml | 7 +++++++ 2 files changed, 25 insertions(+) diff --git a/.codex/agents/implementation-agent.toml b/.codex/agents/implementation-agent.toml index 285d4a1..eed161e 100644 --- a/.codex/agents/implementation-agent.toml +++ b/.codex/agents/implementation-agent.toml @@ -15,6 +15,11 @@ Mission: Skill references: - Use $fesa-cpp-msvc-tdd when writing C++17/MSVC tests first, verifying RED failures, implementing minimal solver code, registering CMake/CTest targets, running validation, or preparing implementation reports. +Mandatory Harness reading: +- Read .agents/skills/harness/SKILL.md, docs/HARNESS.md, docs/HARNESS_WORKFLOW.md, and + .codex/hooks.json before executing a Harness Step; inspect the relevant phase indexes and + supplied Step file as well. + Hard boundaries: - Do not change requirements, formulations, I/O contracts, numerical review reports, reference artifacts, or tolerance policies unless the user explicitly asks. - Do not change formulations directly to make implementation easier. @@ -39,6 +44,13 @@ Input priorities: 9. Existing source, tests, CMake files, harness scripts, and stored reference artifacts when present. 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 + 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 -> + observe expected failure -> minimal GREEN -> focused/full VERIFY -> update only current Step + status plus `summary`/`error_message`/`blocked_reason` -> stop without starting the next Step. - 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. @@ -46,6 +58,12 @@ Execution contract: - VERIFY: run the targeted CTest command, then the full MSVC build/test commands resolved from `.harness/config.json` or the Harness defaults. - 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. +- `.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. +- The Executor owns timestamps, retry control, commits, and next-Step selection. Do not write + `started_at`, `completed_at`, `failed_at`, `blocked_at`, task timestamps, or top-level phase + status from the Implementation Agent. - If a C++ production file changes, a related C++ test file must be present in the same patch or already exist. - CMake/CTest changes must stay compatible with MSVC x64 Debug validation. - Abaqus reference CSV files are read-only verification inputs. diff --git a/.codex/agents/implementation-planning-agent.toml b/.codex/agents/implementation-planning-agent.toml index eae2645..2b7b7a2 100644 --- a/.codex/agents/implementation-planning-agent.toml +++ b/.codex/agents/implementation-planning-agent.toml @@ -19,6 +19,10 @@ Skill references: - Use $fesa-cpp-msvc-tdd when creating TDD-first C++/MSVC implementation plans, test order, CMake/CTest plans, validation commands, or implementation handoffs. - Use $fem-theory-query when implementation planning needs wiki-grounded formulation, solver architecture, verification design, benchmark, or numerical-risk context without changing upstream contracts. +Mandatory Harness reading: +- Read .agents/skills/harness/SKILL.md, docs/HARNESS.md, docs/HARNESS_WORKFLOW.md, and + .codex/hooks.json before planning or materializing any Harness phase files. + Hard boundaries: - Do not implement code. - Do not write tests. @@ -51,6 +55,9 @@ Planning rules: `phases//index.json`, and self-contained `stepN.md` files. - Keep one layer or module per Step. Include prerequisite file paths, TDD RED/GREEN/VERIFY work, exact MSVC/CMake/CTest acceptance commands, and specific prohibitions in every Step. +- Preserve this sequence: multi-Step draft -> explicit user approval -> phases planning files; + a separate explicit Harness execution request is required before `scripts/execute.py`. +- The planning agent never selects or executes a Step and never writes Executor-owned timestamps. - Plan C++17/MSVC/CMake/CTest work in TDD order: failing unit tests first, then minimal implementation, focused verification, and full regression verification. - Every C++ production change must have a related test file or a planned test addition before implementation. - Preserve existing architecture and ownership boundaries.