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
+22 -49
View File
@@ -9,7 +9,7 @@ FESA의 아키텍처 목표는 Abaqus `.inp` subset을 내부 semantic model로
- sparse linear algebra backend isolation
- deterministic verification
- incremental feature addition
- Harness 기반 TDD와 workspace validation
- Harness 기반 TDD
## 디렉토리 구조
```text
@@ -31,6 +31,9 @@ src/
analysis/ # static, modal, dynamic, nonlinear procedure drivers
results/ # recovery, field/history output, diagnostics
validation/ # comparison metrics and tolerance helpers
math/
Vector/ # managing double array including vector operation, vector operation must use BLAS from MKL
Matrix/ # managing double array including matrix operation, matrix operation must use BLAS from MKL
tests/
unit/
integration/
@@ -43,24 +46,29 @@ reference/
<model-id>_reactions.csv
<model-id>_internalforces.csv
<model-id>_stresses.csv
.agents/
skills/ # Harness and review skills
.codex/
hooks/ # Codex hook scripts
skills/ # FESA solver and Harness instructions
hooks.json # PreToolUse/Stop hook registration
agents/ # FESA workflow custom agents
skills/ # FESA solver workflow skills
docs/ # Product, architecture, ADR, workflow artifacts
scripts/
execute.py # Phase step executor
validate_workspace.py # Default validation entry point
test_*.py # Harness self-tests
hooks/ # PreToolUse/Stop hook implementations
msvc_harness/ # MSVC project discovery and validation adapters
phases/ # Optional generated phase plans
```
## Harness Execution Layer
`scripts/execute.py`:
- creates or checks out `codex/<phase-name>`
- refuses to run on a dirty worktree
- requires per-step `allowed_paths`
- stages only explicit allowed paths and runner housekeeping files
- runs Python Harness self-tests and workspace validation before every runner-created commit
Harness는 solver core와 분리된 세 계층의 개발 운영 인프라다.
- 계획 계층: `.agents/skills/harness`가 사용자 승인 전 Step 초안을 만들고, 승인 후 `phases/` 파일을 생성한다.
- 실행 계층: `scripts/execute.py``feat-<phase-name>` 브랜치에서 Step마다 독립 Codex 세션을 실행하고 상태와 커밋을 관리한다.
- 검증 계층: `.codex/hooks.json``scripts/hooks/pre_tool_use.py``scripts/hooks/stop_validation.py`를 연결한다. Stop 검증은 `scripts/msvc_harness/`를 통해 MSVC build와 test를 실행한다.
Runner는 `git add -A`를 사용하므로 clean worktree 또는 별도 Git worktree가 실행 전제다. 전체 동작 계약은 `docs/HARNESS_WORKFLOW.md`, 설치와 `.harness/config.json` 설정은 `docs/HARNESS.md`를 source of truth로 삼는다.
## 모듈 경계
- `core`는 외부 라이브러리에 의존하지 않는다.
@@ -148,6 +156,9 @@ Results
├── ResultFrame
├── FieldOutput
└── HistoryOutput
Vector
Matrix
```
## 상태 관리
@@ -231,41 +242,3 @@ Schema requirements:
- Abaqus reference results는 `reference/<model-id>/` 아래 CSV 파일이다.
- Verification은 documented IDs, components, units, coordinate system, step/frame identity, tolerance 기준으로 FESA HDF5 rows와 Abaqus reference CSV rows를 비교한다.
- FESA HDF5에서 추출한 deterministic CSV view는 optional debugging/review artifact이며 공식 solver output 또는 reference artifact가 아니다.
## Test Architecture
- unit: parser, DOF map, shape functions, material law, sparse assembly, HDF5 schema
- integration: small `.inp` to HDF5 end-to-end
- reference: FESA `results.h5` rows and Abaqus reference CSV rows comparison
- physics: equilibrium, sign, symmetry, rigid body mode, stress sanity
- harness: hooks, phase executor, workspace validation
## Hook 흐름
```text
apply_patch/Edit/Write
-> .codex/hooks/tdd-guard.py
-> C++ production changes require related tests
git commit command
-> .codex/hooks/pre_commit_checks.py
-> Python Harness self-tests
-> scripts/validate_workspace.py
```
## Validation 흐름
```text
HARNESS_VALIDATION_COMMANDS set
-> run exact commands
CMakePresets.json has msvc-debug configure preset
-> cmake --preset msvc-debug
-> cmake --build preset binary dir --config Debug
-> ctest --test-dir preset binary dir -C Debug
CMakeLists.txt exists
-> 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
No CMake project
-> print guidance and exit successfully
```