modify harness framework
This commit is contained in:
@@ -26,10 +26,12 @@ Read these first:
|
||||
3. RED: write the planned unit, integration, parser/I/O, or reference-comparison test first.
|
||||
4. RED: run the targeted test and verify the expected failure before production code.
|
||||
5. GREEN: implement the minimum C++17/MSVC-compatible code needed for the task.
|
||||
6. VERIFY: run the targeted command, then `python scripts/validate_workspace.py`.
|
||||
6. VERIFY: run the targeted command, then the full MSVC build/test commands resolved from `.harness/config.json` or the Harness defaults.
|
||||
7. For C++ production changes, require a related C++ test file in the same patch or already present.
|
||||
8. For failure triage, classify as `configure | compile | link | test | reference-comparison | harness | environment | upstream-contract`.
|
||||
9. Fix implementation-owned failures only and keep changes traceable to the implementation plan.
|
||||
8. Treat PreToolUse as a test-file-existence guardrail, not proof that RED was observed. Record the RED and GREEN commands and results in the implementation report.
|
||||
9. Let Stop perform the final whole-project MSVC build/test before the Step ends.
|
||||
10. For failure triage, classify as `configure | compile | link | test | reference-comparison | harness | environment | upstream-contract`.
|
||||
11. Fix implementation-owned failures only and keep changes traceable to the implementation plan.
|
||||
|
||||
## Output Contract
|
||||
|
||||
@@ -43,17 +45,19 @@ Produce one of these, depending on role:
|
||||
Required validation commands:
|
||||
|
||||
```powershell
|
||||
python -m unittest discover -s scripts -p "test_*.py"
|
||||
python scripts/validate_workspace.py
|
||||
ctest -C Debug -R <feature-or-label>
|
||||
cmake -S . -B .harness/build -A x64
|
||||
cmake --build .harness/build --config Debug
|
||||
ctest --test-dir .harness/build -C Debug -R <feature-or-label> --output-on-failure
|
||||
ctest --test-dir .harness/build -C Debug --show-only=json-v1
|
||||
ctest --test-dir .harness/build -C Debug --output-on-failure
|
||||
```
|
||||
|
||||
Default MSVC path:
|
||||
Use configured CMake presets or direct MSBuild commands instead when
|
||||
`.harness/config.json` selects them. For Harness Python, Hook, or agent-config
|
||||
changes, also run:
|
||||
|
||||
```powershell
|
||||
cmake -S . -B build/msvc-debug -G "Visual Studio 17 2022" -A x64
|
||||
cmake --build build/msvc-debug --config Debug
|
||||
ctest --test-dir build/msvc-debug --output-on-failure -C Debug
|
||||
uv run --with pytest python -m pytest -v -rs
|
||||
```
|
||||
|
||||
## Boundaries
|
||||
@@ -73,6 +77,7 @@ ctest --test-dir build/msvc-debug --output-on-failure -C Debug
|
||||
- Every `must` requirement maps to at least one task and one test.
|
||||
- Each test has a clear RED condition, GREEN condition, linked task, and command.
|
||||
- CMake/CTest plans remain compatible with MSVC x64 Debug validation.
|
||||
- Stop validation is green for the whole discovered C/C++ project; a no-project pass is valid only when no C/C++ files and no build metadata exist.
|
||||
- Build/test reports record command, exit code, duration, stdout/stderr tail, and failure classification.
|
||||
- Correction attempts stop when repeated failure indicates upstream contract ambiguity.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user