modify harness framework
This commit is contained in:
@@ -2,16 +2,17 @@
|
||||
|
||||
이 디렉터리는 Build/Test Executor Agent가 작성하거나 제안하는 기능별 build/test 실행 리포트를 보관하는 위치다.
|
||||
|
||||
Build/Test Executor Agent는 Implementation Agent 이후 독립적으로 C++/MSVC/CMake/CTest 검증을 실행하고, 실패를 분류해 다음 agent로 handoff한다. 이 agent는 source code, tests, CMake files, requirements, formulations, I/O contracts, reference artifacts, tolerance policies를 수정하지 않는다. build artifacts와 test outputs는 `build/` 아래 생성될 수 있다.
|
||||
Build/Test Executor Agent는 Implementation Agent 이후 독립적으로 C++/MSVC/CMake/CTest 검증을 실행하고, 실패를 분류해 다음 agent로 handoff한다. 이 agent는 source code, tests, CMake files, requirements, formulations, I/O contracts, reference artifacts, tolerance policies를 수정하지 않는다. 기본 build artifact는 `.harness/build/` 아래 생성된다.
|
||||
|
||||
기본 문서명은 `docs/build-test-reports/<feature-id>-build-test.md` 형식을 사용한다.
|
||||
|
||||
## Build/Test Executor Agent 역할
|
||||
|
||||
수행한다:
|
||||
- `python scripts/validate_workspace.py`를 기본 검증 명령으로 실행한다.
|
||||
- implementation plan/report에 명시된 경우 harness self-test와 feature-specific CTest를 실행한다.
|
||||
- `HARNESS_VALIDATION_COMMANDS`, `CMakePresets.json`의 `msvc-debug`, 기본 CMake/MSVC x64 Debug 경로 중 어떤 검증 경로가 사용되었는지 기록한다.
|
||||
- `.harness/config.json`과 프로젝트 자동 감지 결과를 확인하고 같은 build/test 경로를 독립 실행한다.
|
||||
- implementation plan/report에 명시된 feature-specific CTest를 전체 검증 전에 실행한다.
|
||||
- Harness Python, Hook, agent config 변경이 포함되면 `uv run --with pytest python -m pytest -v -rs`를 실행한다.
|
||||
- CMake preset, 직접 MSBuild, 기본 CMake/MSVC x64 Debug 중 어떤 검증 경로가 사용되었는지 기록한다.
|
||||
- configure, compile, link, test, reference-comparison, harness, environment, upstream-contract 실패를 구분한다.
|
||||
- command, exit code, duration, stdout/stderr tail, failed test name을 요약한다.
|
||||
- 실패 원인에 따라 Implementation Agent, Correction Agent, Reference Verification Agent, Implementation Planning Agent 중 handoff 대상을 제안한다.
|
||||
@@ -28,29 +29,43 @@ Build/Test Executor Agent는 Implementation Agent 이후 독립적으로 C++/MSV
|
||||
|
||||
## 실행 순서
|
||||
|
||||
기본 순서는 implementation plan/report에 따라 다음 중 필요한 항목만 실행한다.
|
||||
기본 순서는 implementation plan/report에 따라 다음 중 필요한 항목을 실행한다.
|
||||
|
||||
```powershell
|
||||
python -m unittest discover -s scripts -p "test_*.py"
|
||||
ctest -C Debug -R <feature-or-label>
|
||||
python scripts/validate_workspace.py
|
||||
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
|
||||
```
|
||||
|
||||
`scripts/validate_workspace.py`의 command discovery 우선순위는 다음과 같다.
|
||||
Harness Python, Hook, agent config 변경이 검증 범위에 포함되면 다음 명령을 먼저 실행한다.
|
||||
|
||||
1. `HARNESS_VALIDATION_COMMANDS`
|
||||
2. `CMakePresets.json`의 `msvc-debug`
|
||||
3. 기본 CMake/MSVC x64 Debug 명령
|
||||
4. `CMakeLists.txt`가 없고 override도 없으면 안내 메시지와 함께 성공 종료
|
||||
```powershell
|
||||
uv run --with pytest python -m pytest -v -rs
|
||||
```
|
||||
|
||||
프로젝트 선택 우선순위는 다음과 같다.
|
||||
|
||||
1. `.harness/config.json`의 명시적 `projectType`
|
||||
2. 루트의 CMake metadata
|
||||
3. 루트의 단일 `.sln`
|
||||
4. 루트의 단일 `.vcxproj`
|
||||
|
||||
기본 CMake/MSVC x64 Debug 명령은 다음과 같다.
|
||||
|
||||
```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
|
||||
cmake -S . -B .harness/build -A x64
|
||||
cmake --build .harness/build --config Debug
|
||||
ctest --test-dir .harness/build -C Debug --show-only=json-v1
|
||||
ctest --test-dir .harness/build -C Debug --output-on-failure
|
||||
```
|
||||
|
||||
CMake preset을 사용하면 configure/build/test preset과 `binaryDir`를 모두
|
||||
`.harness/config.json`에 지정한다. 직접 MSBuild는 solution/project와
|
||||
`msbuild.testCommand`를 지정한다. C/C++와 build metadata가 모두 없으면 검증 대상이
|
||||
없으므로 통과하지만, C/C++ 파일만 있고 build metadata가 없으면 오류다.
|
||||
|
||||
## 문서 템플릿
|
||||
|
||||
```markdown
|
||||
@@ -69,17 +84,19 @@ ctest --test-dir build/msvc-debug --output-on-failure -C Debug
|
||||
- generator: Visual Studio 17 2022 | <observed generator>
|
||||
- platform: x64 | <observed platform>
|
||||
- config: Debug | <observed config>
|
||||
- build_dir: build/msvc-debug | <observed build dir>
|
||||
- active_override_env_vars: HARNESS_VALIDATION_COMMANDS | HARNESS_CMAKE_GENERATOR | HARNESS_CMAKE_PLATFORM | HARNESS_CMAKE_CONFIG | HARNESS_BUILD_DIR | none
|
||||
- command_discovery_path: HARNESS_VALIDATION_COMMANDS | CMakePresets.json msvc-debug | default CMake/MSVC x64 Debug | no-CMake informational success
|
||||
- build_dir: .harness/build | <configured/observed build dir>
|
||||
- harness_config: .harness/config.json | absent-defaults
|
||||
- project_selection: configured cmake | configured msbuild | auto CMake | auto MSBuild | no C/C++ project
|
||||
- command_discovery_path: CMake preset | direct MSBuild | default CMake/MSVC x64 Debug | no C/C++ project
|
||||
|
||||
## Command Log Summary
|
||||
|
||||
| order | command | exit_code | duration | stdout_stderr_tail |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| 1 | python -m unittest discover -s scripts -p "test_*.py" | <code> | <duration> | <tail summary> |
|
||||
| 2 | ctest -C Debug -R <feature-or-label> | <code> | <duration> | <tail summary> |
|
||||
| 3 | python scripts/validate_workspace.py | <code> | <duration> | <tail summary> |
|
||||
| 1 | uv run --with pytest python -m pytest -v -rs (when applicable) | <code or skipped> | <duration> | <tail summary> |
|
||||
| 2 | <config-resolved configure/build commands> | <code> | <duration> | <tail summary> |
|
||||
| 3 | <feature-specific test command when applicable> | <code or skipped> | <duration> | <tail summary> |
|
||||
| 4 | <config-resolved test discovery/full test commands> | <code> | <duration> | <tail summary> |
|
||||
|
||||
## Validation Results
|
||||
|
||||
@@ -137,7 +154,7 @@ ctest --test-dir build/msvc-debug --output-on-failure -C Debug
|
||||
- 모든 실행 명령과 exit code를 기록해야 한다.
|
||||
- 실패 로그는 전체 원문을 복제하지 않고 마지막 핵심 구간과 실패 원인을 요약한다.
|
||||
- configure, compile, link, test, reference-comparison, harness, environment, upstream-contract 실패를 구분한다.
|
||||
- no-CMake 상황은 `scripts/validate_workspace.py` 정책대로 안내 메시지와 성공 종료로 기록한다.
|
||||
- C/C++와 build metadata가 모두 없는 상황만 `no C/C++ project` 성공으로 기록한다. C/C++ 파일이 있는데 build metadata가 없으면 `environment` 또는 `configure` 실패로 기록한다.
|
||||
- 성공 판정은 build/test 통과까지만 의미한다.
|
||||
- reference tolerance, physics validation, release readiness는 판정하지 않는다.
|
||||
- upstream 계약 문제는 Implementation Agent에 임의 수정으로 넘기지 않고 적절한 upstream agent로 handoff한다.
|
||||
|
||||
Reference in New Issue
Block a user