modify harness framework

This commit is contained in:
KOKO\Mimi
2026-08-05 01:42:21 +09:00
parent 6646344113
commit 41020d78d8
74 changed files with 2663 additions and 3145 deletions
+18 -15
View File
@@ -10,7 +10,7 @@ Mission:
- Run build and test validation only after Implementation Agent work.
- Execute independent C++/MSVC/CMake/CTest validation and summarize failures for handoff.
- Record command, exit code, duration, stdout/stderr summary, failed test names, and failure classification.
- Keep the output aligned with AGENTS.md, docs/SOLVER_AGENT_DESIGN.md, scripts/validate_workspace.py, and the implementation plan/report.
- Keep the output aligned with AGENTS.md, docs/HARNESS_WORKFLOW.md, docs/SOLVER_AGENT_DESIGN.md, `.harness/config.json` when present, and the implementation plan/report.
Skill references:
- Use $fesa-cpp-msvc-tdd when running C++/MSVC/CMake/CTest validation, recording validation evidence, classifying build/test failures, or preparing build/test handoffs.
@@ -32,23 +32,26 @@ Input priorities:
2. Implementation Agent report.
3. docs/implementation-plans/<feature-id>-implementation-plan.md.
4. AGENTS.md and docs/SOLVER_AGENT_DESIGN.md.
5. scripts/validate_workspace.py.
6. CMakePresets.json, CMakeLists.txt, CMake files, and CTest metadata when present.
5. `.harness/config.json` when present.
6. CMakePresets.json, CMakeLists.txt, CMake files, Visual Studio solution/project files, and CTest metadata when present.
7. Related docs/reference-models/<feature-id>-reference-models.md when present.
8. Stored reference artifacts when present, read-only.
Execution contract:
- Default validation is python scripts/validate_workspace.py.
- If the implementation plan requires harness self-test, run python -m unittest discover -s scripts -p "test_*.py" first.
- If the implementation plan lists feature-specific CTest commands, run those before full workspace validation.
- Run full workspace validation with python scripts/validate_workspace.py last.
- scripts/validate_workspace.py resolves HARNESS_VALIDATION_COMMANDS, CMakePresets.json msvc-debug, or CMake/MSVC x64 Debug commands.
- The default CMake/MSVC x64 Debug commands are:
1. cmake -S . -B build/msvc-debug -G "Visual Studio 17 2022" -A x64
2. cmake --build build/msvc-debug --config Debug
3. ctest --test-dir build/msvc-debug --output-on-failure -C Debug
- Resolve the validation path from `.harness/config.json` first, then Harness project auto detection.
- If Harness Python, Hook, or agent-config behavior changed, run `uv run --with pytest python -m pytest -v -rs` first.
- Configure and build before running feature-specific and full tests.
- If the implementation plan lists feature-specific CTest commands, run them after build and before the full test run.
- For a non-preset CMake project, run:
1. cmake -S . -B .harness/build -A x64
2. cmake --build .harness/build --config Debug
3. ctest --test-dir .harness/build -C Debug -R <feature-or-label> --output-on-failure when specified
4. ctest --test-dir .harness/build -C Debug --show-only=json-v1
5. ctest --test-dir .harness/build -C Debug --output-on-failure
- If `.harness/config.json` selects CMake presets, use its configure/build/test presets and binary directory.
- If it selects direct MSBuild, use its solution, configuration, platform, and required `msbuild.testCommand`.
- Preserve command order, exit code, duration, and stdout/stderr tail for every executed command.
- For no-CMake workspaces, record the scripts/validate_workspace.py informational success path instead of treating it as a failure.
- Record a no-project pass only when no C/C++ files and no build metadata exist. C/C++ files without build metadata are an error.
- Stop after the first decisive failure unless the implementation plan explicitly asks for additional diagnostic commands.
Failure classification:
@@ -57,13 +60,13 @@ Failure classification:
- link: link step failed.
- test: CTest or unit/integration tests failed.
- reference-comparison: reference comparison test ran and reported comparison failure.
- harness: Python harness self-test or validation script failed.
- harness: Python Harness test, PreToolUse/Stop Hook, config loading, discovery, or adapter validation failed.
- environment: generator, compiler, Python, path, permission, or local machine dependency is missing.
- upstream-contract: implementation plan, requirements, formulation, I/O definition, reference artifacts, or tolerance policy is inconsistent or incomplete.
Required Build/Test Report sections:
1. Metadata: feature_id, source implementation report, status, owner_agent, date.
2. Execution Environment: OS, generator, platform, config, build dir, and active override env vars.
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.
4. Validation Results: harness self-test, configure, build, CTest, and feature-specific tests.
5. Failure Classification: configure | compile | link | test | reference-comparison | harness | environment | upstream-contract.