diff --git a/docs/mitc4-shell-feast-eigen/ADR.md b/docs/mitc4-shell-feast-eigen/ADR.md index 10c45d2..ed9fa93 100644 --- a/docs/mitc4-shell-feast-eigen/ADR.md +++ b/docs/mitc4-shell-feast-eigen/ADR.md @@ -101,3 +101,11 @@ - 결정: [입력 I1~I6](io-input.md)의 constant density·단일 frequency·입력 N·부수 옵션 subset을 적용한다. [O1~O5](io-schema.md)의 eigen procedure discriminant와 source step identity, 공개 N개 scalar/vector 및 전체 c 검증·FEAST call evidence를 저장한다. - 이유·영향: 기존 static schema0/1의 의미와 mandatory inventory는 유지한다. 새 eigen은 `(schema_version=0, eigen_schema_version=1, analysis_procedure=linear-frequency)`와 Feature ID로 구분한다. Raw negative lambda와 unavailable real frequency를 명시적으로 분리하며 기존 non-Newton log lifecycle은 보존한다. - 근거·경계: [M1~M5](io-mapping.md)의 책임·candidate replace 후 no-fail swap·원본 TXT full grammar 및 27개 요구 mapping을 따른다. 외부 projection은 공개 modes의 Value만 사용하고 10개 singleton family의 공통 판정을 유지한다. 영속 N개 vector는 내부 재현용이며 외부 mode-shape gate를 추가하지 않는다. 실제 parser/HDF5/FEAST/comparator 성공은 아직 미실행이다. + +## MFE-ADR-011 — 유한 실행 준비와 검증 단위 + +- 상태: r2 Planning owner의 실행 계약 및 정적 gate 확인; 실제 실행은 미완료. +- 결정 owner: implementation-planning-agent; 사용자 실행 권한 해석: Root; 기록 owner: coordinator-agent. +- 결정: [계획](implementation-plan.md)의 별도 prep 1개 step 뒤 새 invocation으로 main 8개 step을 실행한다. 결합된 API/data 단위를 통합해 불필요한 full VERIFY 반복을 줄이고 각 step의 TDD·focused/full VERIFY·등록 Stop은 유지한다. +- 운영 근거: 기존 전체 검증의 약27.9분 합산 추정과 여러 1800초 deadline, nonlinear helper의 매번 solve 및 이미 로드된 Executor/Stop의 activation 경계를 [환경 E2/E3](implementation-environment.md)에 대조했다. 준비에서는 단일 유한 class timeout만 지정 후 실제 Executor main을 호출하며 runtime default의 최소 변경과 대응 Harness tests를 수행한다. +- 경계: Bootstrap은 기존 CLI option이나 sandbox 확대가 아니다. 정확한 값/명령은 Planning 문서의 원본을 따르고 Hook state·reentry·실행 메서드·retry·ownership guard를 override하지 않는다. Root/Coordinator도 active invocation 동안 non-owned 편집·커밋을 멈춘다. 보고 시점의 manual evidence와 Executor 종료 뒤 registered Stop/actual exit 사후 확인을 구분하며 성공 전 main activation을 하지 않는다. diff --git a/docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md b/docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md index fe93ab1..f8628c3 100644 --- a/docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md +++ b/docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md @@ -52,5 +52,21 @@ Reference artifact와 공통 정책은 수정하지 않는다. 외부 solver 실 | [io-input.md](io-input.md) | io-definition-agent | r2 | density/frequency exact subset·source N·warning/진단 및 공식 syntax 근거 | | [io-schema.md](io-schema.md) | io-definition-agent | r2 | 기존 static 보존·eigen discriminant·N vectors/all-c evidence·self-check | | [io-mapping.md](io-mapping.md) | io-definition-agent | r2 | 책임·candidate 보존·TXT Value-only·27개 요구/11개 I/O 검증 obligation | +| [implementation-plan.md](implementation-plan.md) | implementation-planning-agent | r2 | Prep 1/main 8개 step 및 실행 계획 gate pass | +| [implementation-environment.md](implementation-environment.md) | implementation-planning-agent | r2 | 실제 backend·유한 deadline·bootstrap/activation·Git/사후 evidence 경계 | +| [implementation-interfaces.md](implementation-interfaces.md) | implementation-planning-agent | r2 | 기존 확장점·API/source-test·vendor/state/transaction 책임 | +| [implementation-verification.md](implementation-verification.md) | implementation-planning-agent | r2 | 요구27/NR27/I/O11·신규 test40·독립 oracle·fresh evidence·실제 validator | +| [phases/index.json](../../phases/index.json) | implementation-planning-agent(정의), Executor(진행) | r2 | 기존5개 entry/history 보존 및 이번2개 pending entry 등록 | +| [prep index](../../phases/mitc4-shell-feast-eigen-execution-prep/index.json) | implementation-planning-agent(정의), Executor(진행) | r2 | Step0 pending; exact owned paths 검증 | +| [prep step0](../../phases/mitc4-shell-feast-eigen-execution-prep/step0.md) | implementation-planning-agent | r2 | Timeout-only 운영 준비/TDD/full VERIFY; 실행 미완료 | +| [main index](../../phases/mitc4-shell-feast-eigen/index.json) | implementation-planning-agent(정의), Executor(진행) | r2 | Step0~7 pending; exact owned paths 검증 | +| [main step0](../../phases/mitc4-shell-feast-eigen/step0.md) | implementation-planning-agent | r2 | Frequency model/parser | +| [main step1](../../phases/mitc4-shell-feast-eigen/step1.md) | implementation-planning-agent | r2 | 공변 stabilization/static 회귀 | +| [main step2](../../phases/mitc4-shell-feast-eigen/step2.md) | implementation-planning-agent | r2 | Consistent/lumped/assembly | +| [main step3](../../phases/mitc4-shell-feast-eigen/step3.md) | implementation-planning-agent | r2 | Actual BC/null/whitening | +| [main step4](../../phases/mitc4-shell-feast-eigen/step4.md) | implementation-planning-agent | r2 | FEAST call/search | +| [main step5](../../phases/mitc4-shell-feast-eigen/step5.md) | implementation-planning-agent | r2 | All-c validation/frequency procedure | +| [main step6](../../phases/mitc4-shell-feast-eigen/step6.md) | implementation-planning-agent | r2 | HDF5/CLI transaction | +| [main step7](../../phases/mitc4-shell-feast-eigen/step7.md) | implementation-planning-agent | r2 | Comparator/fresh eigen/static/구현 evidence | 아직 작성되지 않은 specialist 보고서는 목록에 승인 산출물로 등록하지 않는다. diff --git a/docs/mitc4-shell-feast-eigen/PRD.md b/docs/mitc4-shell-feast-eigen/PRD.md index dd0d1c6..b5f04dc 100644 --- a/docs/mitc4-shell-feast-eigen/PRD.md +++ b/docs/mitc4-shell-feast-eigen/PRD.md @@ -3,7 +3,7 @@ - Feature ID: `mitc4-shell-feast-eigen` - Owner: `coordinator-agent` - Input contract revision: `r2` -- 검토 상태: r2 requirements/research/formulation/numerical-review/io-definition gate pass; implementation-planning 진입. 구현·실제 reference 비교는 아직 미실행. +- 검토 상태: r2 requirements부터 implementation-planning까지 6개 gate pass; implementation의 execution-prep 진입. 구현·실제 reference 비교는 아직 미실행. 기준: [프로젝트 지침](../../AGENTS.md), [프로젝트 PRD](../PRD.md), [프로젝트 ADR](../ADR.md). 지역 지침과 문서 목록은 [FEATURED_AGENTS.md](FEATURED_AGENTS.md), 상태 원본은 [coordination.md](coordination.md)를 따른다. @@ -47,6 +47,7 @@ Primary-source 근거와 적용 한계는 [research](research.md), 상세 근거 구현용 수학 계약과 상세 문서의 연결은 [formulation](formulation.md), 고정된 내부 수치 기준은 [NR controls](numerical-review-controls.md), 필수 검증은 [27개 cases](numerical-review-cases.md)에 있다. [Reference artifact·logical readiness](reference-model.md)와 독립 수학/controls evidence를 함께 확인하여 r2 NR gate를 통과했다. [I/O 계약](io.md)은 [exact 입력 subset](io-input.md), [additive HDF5와 내부 modal evidence](io-schema.md), [책임·failure·Value projection](io-mapping.md)을 정의했다. Source Step-2와 canonical storage Step-1, 입력 요청 N과 전체 검증 c를 구분하며 기존 static 계약은 보존한다. 구현 계획은 27개 요구와 I/O 검증 obligation을 실제 TDD·full VERIFY·fresh reference 경로에 연결해야 한다. +[실행 계획](implementation-plan.md)은 운영 준비 1개와 main 8개 step으로 구체화했고 [verification mapping](implementation-verification.md)에 요구27/NR27/I/O11 및 필수 test40개를 연결했다. 정확한 owned paths·actual backend·유한 실행시간·fresh solve·등록 Stop 사후 확인은 [환경 계약](implementation-environment.md)과 각 phase step을 따른다. 실제 실행 성공과 독립 physics/release gate는 아직 남아 있다. r1의 [NR-MFE-001 실패 이력](numerical-review-evidence.md)은 기존 `002/008`의 stabilized pencil 보존과 `014`의 eigen coordinate-invariance evidence 관계였다. Requirement owner는 알려진 partial-BC 반례를 단순 clarification으로 제외할 수 없다고 판단했다. [MFE-OQ-003 대안·영향](requirements-evidence.md#nr-mfe-001-requirements-intent-검토) 중 좌표 공변적인 stabilization 개선과 영향받는 정적/eigen 재검증 범위 추가가 사용자에게 승인되었다. 단순 한계 수용 및 acceptance 축소안은 선택되지 않았다. diff --git a/docs/mitc4-shell-feast-eigen/coordination.md b/docs/mitc4-shell-feast-eigen/coordination.md index 851e1eb..fb769cc 100644 --- a/docs/mitc4-shell-feast-eigen/coordination.md +++ b/docs/mitc4-shell-feast-eigen/coordination.md @@ -3,15 +3,15 @@ - Feature ID: `mitc4-shell-feast-eigen` - Owner: `coordinator-agent` - Contract revision: `r2` (사용자 승인 stabilization 개선·영향받는 정적/eigen 재검증 범위) -- Stage: `implementation-planning` -- Outcome: `pass` (r2 io-definition 입력·schema·mapping evidence 확인) -- Next owner: `implementation-planning-agent` +- Stage: `implementation` +- Outcome: `pass` (r2 implementation-planning 실행 계약·정적 evidence 확인) +- Next owner: `implementation-agent` (Executor-selected execution-prep Step0) - Attempt: `0` (r2 구현·수치 실패 관찰 없음; r1 이력 별도 보존) - Completion: 미완료 - Failure classification: `null` - Retry key: `null` - Escalation class: `null` -- Blocker: `null` (Planning 및 후속 기술 gate는 아직 미완료) +- Blocker: `null` (실제 execution-prep/main 및 후속 기술 gate는 아직 미완료) 기준: [프로젝트 지침](../../AGENTS.md), [프로젝트 PRD](../PRD.md), [프로젝트 ADR](../ADR.md), [SOLVER_AGENT_DESIGN](../SOLVER_AGENT_DESIGN.md), [FEATURE_DOCUMENTATION](../FEATURE_DOCUMENTATION.md). @@ -33,6 +33,7 @@ | formulation r2 | [main](formulation.md), [mass](formulation-mass.md), [eigen](formulation-eigen.md), [verification](formulation-verification.md), [stabilization](formulation-stabilization.md) | pass; 5개 문서/27개 coverage/57개 상대 경로 및 단일 scale·수학 적용 경계 확인; 독립 판정은 NR 소유 | | numerical-review r2 | [verdict](numerical-review.md), [독립 evidence](numerical-review-evidence.md), [controls](numerical-review-controls.md), [cases](numerical-review-cases.md), [reference-model](reference-model.md) | pass; NR-MFE-001 수학적 해소, 내부 수치 기준/27개 case/27개 requirement 및 logical reference readiness 모두 확인 | | io-definition r2 | [main](io.md), [input](io-input.md), [schema](io-schema.md), [mapping](io-mapping.md) | pass; 4개 owner/r2 문서·27개 requirement·66개 상대 링크 및 원본 grammar/identity·additive schema·failure 보존 확인 | +| implementation-planning r2 | [main](implementation-plan.md), [environment](implementation-environment.md), [interfaces](implementation-interfaces.md), [verification](implementation-verification.md), [prep](../../phases/mitc4-shell-feast-eigen-execution-prep/index.json), [main phase](../../phases/mitc4-shell-feast-eigen/index.json) | pass; 실제 read-only StepExecutor validator·16산출물·1+8 steps·owned128회/고유110·요구27/NR27/I/O11·신규test40·links575/anchor0 확인 | 공통 문서 및 reference 파일 목록의 read-only 조사 명령은 exit code `0`으로 완료했다. 확인된 reference 파일은 `shellNL-eigen-meshfine.inp`, `shellNL-eigen-meshfine eigenvalues.txt`이며 실제 의미와 readiness는 담당 owner가 검토한다. @@ -41,11 +42,25 @@ Root의 시작 Git 조사에서 worktree clean을 확인했다. 구현·build/te ## 현재 bounded dispatch +Planning owner의 r2 `pass` envelope와 계획 main/detail 4개 및 phase 제어문서 12개를 감사하여 implementation으로 전이한다. Source 변경·C++/FEAST/reference 성공을 뜻하지 않는다. +초기 14개 main 단위를 결합된 API/data 경계 기준으로 8개로 통합했고 각 step의 behavior별 RED/GREEN·focused/full VERIFY·등록 Stop은 유지한다. 운영 prep 1개는 다섯 deadline default와 관련 Harness tests만 소유하며 physics·schema·sandbox·retry·ownership을 바꾸지 않는다. +Owner는 첫 감사에서 Step2 대응 test owned 누락과 anchor 두 곳을 찾아 index/Markdown·정확한 링크를 수정했다. Actual `StepExecutor` read-only schema/owned validator와 최종 정적 감사는 exit `0`이다. Coordinator도 [V7의 실제 command](implementation-verification.md#v7-계획-정적-감사)를 읽은 뒤 재실행해 같은 결과와 16개 bundle SHA-256 `a28b78ad52a7e9606d026100934fea3ff324218be4210aa772e89cbaae42b413`를 확인했다. +결과는 prep1/main8, owned paths128회/고유110, Step별 upstream22 필수입력, 요구27/NR27/I/O11, 신규 필수 test40, local links575/anchor warning0, 기존 top index5개 entry/history 보존, `git diff --check` exit `0`이다. `fesa_tests` aggregate가 unit/integration/reference targets 모두를 의존한다는 실제 graph와 각 필수 새 test의 discovery 확인도 계획에 명시되어 있다. +Root의 최초 `git diff --cached --check`는 새 plan/verification/prep index의 EOF blank 3개를 검출해 exit `1`이었다. Planning owner가 해당 3개만 수정하고 V7에 unstaged diff의 신규파일 검사 한계 및 EOF 검사를 보완했다. Coordinator의 V7 재실행은 전체 EOF 검사·동일 coverage·위 갱신 hash를 확인하며 exit `0`이다. Phase JSON 의미·metadata·계약은 변하지 않았고 구현 correction/revision 변경으로 취급하지 않는다. Root의 재staging/checkpoint 완료 전 실행하지 않는다. +실행 dispatch는 `feature_id=mitc4-shell-feast-eigen`, `stage=implementation`, `outcome=pass`(Planning gate), `next_owner=implementation-agent`, `contract_revision=r2`, `attempt=0`, failure/retry/escalation/blocker=`null`을 적용한다. 필수 evidence inputs는 Feature 폴더/관리3개·승인 upstream22개·Planning4개 및 assigned prep index/step0이며 정확한 경로는 [prep Step0](../../phases/mitc4-shell-feast-eigen-execution-prep/step0.md)에 포함된다. +Root의 정확 경로 checkpoint와 clean/active process/sandbox preflight 후 [E3의 one-time module invocation](implementation-environment.md#e3-one-time-bootstrap와-새-process-activation)으로 execution-prep Step0를 할당한다. Implementation은 그 Step의 exact code/tests/evidence paths와 terminal result만 소유하고 Executor가 branch/attempt/commit/phase 진행을 소유한다. 이 invocation 동안 Root/Coordinator는 관리문서를 포함한 non-owned 편집·커밋을 동결한다. +종료 뒤 actual manual evidence·raw Executor result·등록 Stop/actual exit·정확 source/control commits/clean을 감사한 다음에만 새 main invocation을 할당한다. 실패 시 상태/로그를 보존하고 실제 분류로 반환하며 pending reset/즉시 재실행을 하지 않는다. 실제 구현/전체 검증/reference 및 physics/release gate는 아직 미완료다. + +### Implementation Planning r2 이력 + I/O owner의 r2 `pass` envelope와 실제 기본 1개/상세 3개 문서를 감사하여 implementation-planning으로 전이한다. Constant density와 frequency options/data의 exact subset, 공식 공개 syntax 근거와 source warning, 별도 eigen procedure, 기존 static을 보존하는 additive schema 및 candidate/state 보존을 확인했다. Source Step-2/canonical Step-1과 공개 N/all-c 검증을 분리하고 raw lambda·frequency validity·실제 lumped mass/backend를 보존한다. Owner의 `python -B -` 정적 audit은 owned 4개 metadata, relative links 66개/anchors 13개, requirement 27행, 원본 N10/data fields6 및 TXT full grammar 10행/hash 일치, exit `0`이었다. Owned paths의 `git diff --check`와 별도 untracked whitespace/table 검사도 exit `0`이다. 잘못된 초기 directory/glob 검색과 해소는 owner evidence에 기록되어 있다. Coordinator는 전체 22문서의 local-link 누락 0, I/O 4개 owner/r2 metadata·반환 SHA-256 일치 및 coverage 27행을 확인했다(`python -B -`, exit `0`). External Value-only/10 singleton/common tolerance 및 기존 static U/UR·reaction 역할은 유지한다. Planning은 모든 승인 문서와 27개 NR cases/11개 I/O obligations를 실행 가능한 정확한 owned paths, RED/GREEN/focused/full VERIFY와 fresh reference evidence에 연결한다. 실제 MSVC/x64/Debug backend, dependency cache, Executor/Stop의 1800초 경계 및 Git·sandbox·retry 소유권은 아래 준비 evidence와 현재 Harness 구현을 대조한다. 아직 C++/FEAST/eigen reference 비교는 미실행이다. +Root는 I/O r2 exact 8개 경로 checkpoint를 `1d4f5ac` (`docs: define MITC4 eigen input and result contracts`)로 커밋했고 staged path set/diff/commit exit `0`, 이후 clean을 확인했다. +Planning owner에게 `implementation-plan.md`와 필요한 같은 폴더 상세, `phases/index.json`의 신규 entry 및 `phases/mitc4-shell-feast-eigen/`의 index/연속 step 문서를 할당했다. 운영 준비를 별도 invocation으로 완료해야 한다고 판단하는 경우에만 `phases/mitc4-shell-feast-eigen-execution-prep/`의 index/step과 entry도 할당했다. 기존 phase 이력과 모든 runtime/source/test/config는 read-only이며 실행은 아직 할당하지 않았다. +이미 로드된 Executor는 자기 source 수정 후에도 최초 timeout 값을 유지할 수 있으므로 계획에서 새 process activation 경계를 명시해야 한다. 이 관찰은 timeout·sandbox·Hook 정책의 임의 우회 승인이 아니다. ### I/O r2 이력 @@ -294,6 +309,10 @@ Root의 후속 read-only 조사(실제 adapter 구성 import `python -B -`, exit Planning은 기존 지원 설정 유무와 실제 full/fresh VERIFY를 대조해 최소 실행 방식을 구체화해야 한다. 기존 knob가 없다면 Root가 확인한 사용자 실행 승인 범위 안의 필요한 가역적 운영 개선으로, 대응 Harness tests를 갖춘 bounded timeout 설정/수정을 검토할 수 있다. 정확한 변경·owned paths·검증은 계획이 확정하며 현재 어떤 runtime/config/source도 수정하지 않았다. Sandbox, transport retry 횟수·증거, ownership, full VERIFY 및 Hook 검증 의미는 유지한다. Cached reference를 새 실행으로 주장하거나 unobserved process로 deadline을 피하지 않는다. Runtime 변경 자체로 새 사용자 승인 gate를 만들지 않되 별도의 명시 critical boundary가 생기면 그 규칙을 따른다. +Planning의 실제 helper 대조에서 nonlinear `RunFesaApplicationOnCopiedInput()`은 매번 FESA application을 호출하므로 pressure 일부 helper의 cache로 전체 prep VERIFY가 빨라진다고 가정할 수 없음이 확인되었다. 또한 `process.execute_plan`의 default shared fallback과 prep Codex launch 당시 등록된 Stop outer cap의 수명도 대조해야 한다. +Root는 사용자 승인된 가역적 운영준비 범위 안에서, 실제 repository `StepExecutor`/`main`을 호출하기 직전 **단 하나의 유한 `CODEX_TIMEOUT_SECONDS` 값만 지정하는 one-time Python module invocation**을 계획에 명시할 수 있다고 판단했다. 이는 기존 CLI timeout option이 아니며 아직 실행하지 않았다. 정확한 값·명령·activation 경계는 Planning owner가 고정한다. +해당 준비 실행도 기본 `workspace-write`, native failure 뒤 별도 승인이 필요한 확대 경계, exact ownership, Executor branch/commit, full VERIFY, registered Stop, terminal result와 retry budget을 유지한다. Hook state/reentry flag, 실행 메서드, tests 또는 다른 guard를 override하지 않는다. Prep process가 이전 Stop outer 1800초를 유지할 가능성을 기록하고 실제 성공 evidence 없이 활성화를 주장하지 않는다. Active Executor 동안 Root/Coordinator의 관리문서 편집·커밋도 중지한다. + ## Retry 기록 Correction 및 implementation rerun 사용 이력 없음. Transport attempt와 별도로 관리한다. diff --git a/docs/mitc4-shell-feast-eigen/implementation-environment.md b/docs/mitc4-shell-feast-eigen/implementation-environment.md new file mode 100644 index 0000000..6dcb042 --- /dev/null +++ b/docs/mitc4-shell-feast-eigen/implementation-environment.md @@ -0,0 +1,140 @@ +# 구현 환경·실행시간·evidence 운영 계획 + +- Feature ID: `mitc4-shell-feast-eigen` +- Owner: `implementation-planning-agent` +- Input contract revision: `r2` +- 기본 보고서: [implementation-plan](implementation-plan.md) + +## E1. 실제 backend와 preflight + +[현재 환경 evidence](coordination.md#후속-실행-준비-관찰)를 적용한다. 이 계획 단계에서는 +Harness, CMake/CTest, C++ 또는 FEAST를 실행하지 않는다. Root의 과거 관찰은 신규 gate 성공이 아니다. + +| 선택 | 실제 값 | +| --- | --- | +| Repository | linked worktree, `C:/Users/baram/orca/workspaces/FESADev/Eigen`; Git top-level과 Harness ROOT 동일 | +| Baseline | I/O checkpoint `1d4f5ac`; 사용자 branch `Eigen`에서 계획 작성 | +| Harness config | `.harness/config.json` 없음; autodetect CMake | +| Build | Visual Studio 18 2026 / MSVC / x64 / Debug / `.harness/build` | +| GoogleTest | `C:/git/googletest` | +| MKL_DIR | `C:/Program Files (x86)/Intel/oneAPI/mkl/2026.1/lib/cmake/mkl` | +| TBB_DIR | `C:/Program Files (x86)/Intel/oneAPI/tbb/2023.1/lib/cmake/tbb` | +| HDF5_DIR | `C:/Program Files/HDF_Group/HDF5/2.1.1/cmake` | +| Observed MKL configuration | 2026.1 / dynamic / intel_ilp64 / intel_thread; 실제 FEAST 실행에서 version/ABI를 다시 기록 | +| Python / CLI | Python3.11.15; python/uv/cmake/ctest/codex resolved. Codex transport/login은 아직 실행 검증 전 | +| Executor role | `.codex/agents/implementation-agent.toml`, gpt-5.6-terra / xhigh / workspace-write | + +개인 설치 경로를 C++/CMake source에 고정하지 않는다. 아래는 이 workstation의 local cache +구성 명령이며 이미 Root가 exit0으로 확인했다. 실제 실행 전 cache의 경로/compilers/platform을 +다시 읽고 stale/missing이면 동일 환경 준비 명령을 실행한다. + +```powershell +cmake -S . -B .harness/build -A x64 "-DFESA_GTEST_SOURCE_DIR=C:/git/googletest" "-DMKL_DIR=C:/Program Files (x86)/Intel/oneAPI/mkl/2026.1/lib/cmake/mkl" "-DTBB_DIR=C:/Program Files (x86)/Intel/oneAPI/tbb/2023.1/lib/cmake/tbb" "-DHDF5_DIR=C:/Program Files/HDF_Group/HDF5/2.1.1/cmake" +``` + +다음부터는 Step의 unadorned configure/build/CTest 명령을 사용한다. Preset은 dependency +환경변수4개를 참조하므로 현재 미설정된 부모 환경에서 preset을 호출하는 계획은 선택하지 않는다. +VS generator는 CMake가 MSVC를 선택하고 `--config Debug`/`-C Debug`로 검증한다. +필수는 CMake/MSVC/x64/Debug이며 Ninja 예시 자체가 필수는 아니다. Hook도 같은 absent-config +autodetect를 사용한다. Subprocess 환경을 부모 Stop에 전파했다고 가정하지 않는다. + +## E2. 최소 deadline 변경과 근거 + +Actual code의 다음 모두가 유한 제한을 적용한다. 지원되는 CLI/config timeout option은 없다. + +| 경계 | 현재 | prep 후 | +| --- | ---: | ---: | +| StepExecutor Codex wrapper | 1800 | 14400 | +| 등록 Stop outer | 1800 | 7500 | +| Stop discovery/configure/build/discovery/CTest shared | 1800 | 7200 | +| CommandSpec default per-command | 1800 | 7200 | +| execute_plan의 명시 deadline 없는 default shared | 1800 | 7200 | + +전체 regression duration의 기존 합산 추정은1672.67초(약27.9분)다. 이는 여러 run의 값이며 +단일 full suite wall time/pass가 아니다. 추가 eigensolver tests와 fresh reference 비용은 +미측정이다. 7200초는 기존 약28분 검증에 초기 실행/신규 numerical tests 여유를 두되 유한하게 +중단하는 운영 상한이다. Registered7500은 shared7200 종료/진단을 위한300초 여유, +wrapper14400은 coding·RED/GREEN·focused·수동 full VERIFY와 등록 Stop을 함께 감싼다. +상한을 더한 값을 실제 소요 시간이라고 보고하지 않는다. + +Main은8개 Step이다. 각 Step은 하나의 완결된 API/data boundary를 담당하고 동일 session에서 +작은 behavior별 RED/GREEN을 반복한다. 통상 coding/focused 약2시간 안, 수동 full과 Stop 각 +약30~45분을 고려한 분해다. 이는 실행 예산 설계이며 소요 보장이나 시험 결과가 아니다. +예상보다 늦거나 failure이면 terminal evidence를 남기고 Coordinator가 원인을 분류한다. +Timeout을 무한대로 만들거나 test/Hook를 생략하지 않는다. + +14개 초기 소단위를8개로 합쳐 불필요한 전체 검증 반복6회를 줄였다. Model+parser는 같은 +frequency/density 정의, consistent+lumped+assembly는 같은 moment snapshot, call+search는 +하나의 FEAST result/history, validation+procedure는 한 candidate, writer+CLI는 한 transaction, +comparator+fresh execution은 한 source matching 결과를 완성한다. Stabilization과 reduction은 +각각 기존 static 영향과 analytic positive/null 경계라 독립 Step으로 유지한다. + +## E3. One-time bootstrap와 새 process activation + +일반1800초 invocation은 prep 중 source self-edit로 이미 시작된 wrapper의 timeout을 늘리지 +못한다. Pressure 일부는 same-binary HDF5 cache를 사용하지만 +`RunFesaApplicationOnCopiedInput()`은 nonlinear reference solver를 매번 직접 호출한다. +따라서 full VERIFY+registered Stop을 모두 cached/빠르다고 가정하지 않는다. + +Root와 Coordinator가 사용자 승인된 가역적 운영 준비로 해석한 **one-time module invocation**을 +prep에만 사용한다. 기존 CLI option이 아니다. 실제 module을 import하고 한 유한 class timeout만 +설정한 뒤 unchanged `main()`을 호출하므로 기존 argparse/preflight/branch/ownership/sandbox/ +terminal result/transport retry/commit/finalization 경로를 그대로 실행한다. + +```powershell +python -B -c "from scripts import execute; execute.StepExecutor.CODEX_TIMEOUT_SECONDS = 14400; execute.main()" mitc4-shell-feast-eigen-execution-prep +``` + +Bootstrap은 Hook state/reentry flag/execution method를 override하지 않는다. Prep에서 +`.codex/hooks.json`을 수정해도 이미 launch된 Codex의 registered Stop outer1800이 유지될 +수 있다. 그 세션에 새7500이 반영됐다고 단정하지 않는다. Prep의 actual manual full/registered +Stop/Codex exit와 source/control commits를 확인해야 한다. Stop이 실제 cap을 넘거나 실패하면 +원시 log와 terminal 상태를 보존한 채 환경 분류로 반환한다. 성공으로 덮어쓰기/즉시 재실행하지 않는다. + +Prep Executor가 **정상 종료하고 Step0 completed·Codex exit0·등록 Stop 성공·정확 경로 commits· +clean 및 Coordinator의 사후 감사 완료**를 확인한 뒤 새 process에서 정상 main invocation을 실행한다. + +```powershell +python scripts/execute.py mitc4-shell-feast-eigen +``` + +새 Executor는 source14400을 새로 읽고 새 Codex session은 변경된 등록7500/Stop7200/command7200 +구성으로 시작한다. Source상 cap과 실제 검증 evidence를 함께 기록한다. Prep/main은 +`feat-mitc4-shell-feast-eigen-execution-prep`와 `feat-mitc4-shell-feast-eigen` branch를 +Executor가 차례로 소유한다. Main branch는 prep 완료 HEAD를 포함해야 한다. + +## E4. Git와 활성 실행의 경계 + +1. Coordinator가 계획 gate를 감사한 뒤 Root가 완료 Feature 문서/계획 및 두 phase 제어 파일의 + 정확 목록을 checkpoint한다. 두 phase를 만들었으므로 선택되지 않은 phase files까지 미리 + commit해 selected-phase allowlist 밖 dirty 파일이 없게 한다. 기존 unrelated pending beam + phase/history는 보존하며 invocation 대상으로 삼지 않는다. +2. 실행 직전 `git rev-parse --show-toplevel`, `git status --porcelain=v1 --untracked-files=all`, + actual role/config를 읽는다. Linked worktree와 Harness ROOT 동일성을 확인한다. +3. Active Executor 동안 Root/Coordinator/다른 specialist는 non-owned edits/commits를 멈춘다. + Implementation은 선택 Step paths와 해당 Step result fields만 수정한다. Commit/branch/ + timestamp/attempt_history/phase 진전은 Executor 소유다. +4. Terminal failure는 raw payload·history·logs를 보존한다. Coordinator의 assigned recovery가 + 없으면 pending reset/재시작하지 않는다. Correction budget과 transport retry는 별개다. +5. Default workspace-write를 사용한다. Danger-full-access는 같은 native command의 실제 실패, + 해당 실행 직전 사용자 명시 승인, clean linked worktree, 승인 flag를 모두 요구한다. + 이번 timeout 준비는 sandbox 확대 권한이 아니다. Remote push/tag/publish/deploy/package는 없다. + +## E5. 실제 실행 evidence 보존 + +각 Step raw evidence root는 ignored `.harness/build/mitc4-eigen-evidence/stepN/`, prep은 +`.../prep/`다. `New-Item -ItemType Directory -Force`와 `Copy-Item -LiteralPath`는 해당 +resolved workspace 하위 generated 경로만 대상으로 한다. Recursive delete/move는 계획하지 않는다. +긴 command는 managed process/session으로 실제 exit까지 관찰하며 약60초마다 Coordinator에 +의미 있는 진행을 보낸다. Detached/unobserved execution으로 deadline을 피하지 않는다. + +RED/focused/full command stdout/stderr·actual exit·wall time·CTest discovery JSON·LastTest.log를 +각각 고유 이름으로 보존한다. Tee/pipeline 사용 시 `$LASTEXITCODE`를 즉시 보존한다. +CTest observer shell exit0을 CTest exit0으로 기록하지 않는다. Hook state를 조작하거나 +수동 hook 실행으로 evidence를 만들지 않는다. 등록 Stop 이후의 실제 실패는 manual full pass로 +덮어쓰지 않는다. Implementation 보고 시점의 실제 manual evidence와 마지막 Stop/exit 확인 대기를 구분하며 미래 성공을 보고서에 쓰지 않는다. Executor 종료 뒤 Coordinator가 raw output·등록 Hook evidence·actual exit를 management 문서에서 감사한다. Coordinator는 specialist 보고서 본문을 대신 수정하지 않는다. Prep→main activation은 이 사후 감사까지 완료된 뒤에만 가능하다. + +C++ source 변경 없는 prep의 same-binary 회귀와 새 binary의 fresh eigen/static 비교는 다른 +evidence다. Final Step7는 직접 solver invocation·unique generated directory·원본 bytes/hash· +binary/lib hash·result/log mtime/hash·call count를 남겨 freshness를 증명한다. 기존 helper가 +파일 존재/mtime로 cache를 사용한 사실만으로 fresh라고 주장하지 않는다. diff --git a/docs/mitc4-shell-feast-eigen/implementation-interfaces.md b/docs/mitc4-shell-feast-eigen/implementation-interfaces.md new file mode 100644 index 0000000..a3b479d --- /dev/null +++ b/docs/mitc4-shell-feast-eigen/implementation-interfaces.md @@ -0,0 +1,110 @@ +# 구현 경계와 source/test 대응 + +- Feature ID: `mitc4-shell-feast-eigen` +- Owner: `implementation-planning-agent` +- Input contract revision: `r2` +- 기본 보고서: [implementation-plan](implementation-plan.md) + +## 실제 repository 확장점 + +기존 `DomainMappingContext::Impl`이 syntax·material/property·sole step candidate를 소유하고 +thin mapper들이 finalize를 호출한다. 이 범위를 확장하며 parallel parser/새 registry를 만들지 +않는다. `KeywordBlock`에는 physical_lines가 있지만 `DataLine`에는 fields/location만 있어 +I/O의 raw count/density data를 보존하려면 `original_line`이 필요하다. + +`Domain::Steps()`와 `AnalysisModel::Step()`은 기존 static API다. 별도 frequency 정의를 +추가하고 active boundary/location view로 DofManager를 연결한다. StaticStep의 미사용 time/load +fields에 frequency 의미를 끼워 넣지 않는다. FrequencyStep은 boundaries/source options/N을 +소유하고 density는 material identity에 연결된 Domain composition record다. Concrete material +base를 optional capability로 늘리지 않는다. + +현재 `ElementFactory::CreateShell`은 private이고 `unique_ptr`를 반환한다. 승인 +shell-only procedure에 필요한 typed `CreateMitc4Shell` 생성 seam을 추가하되 기존 generic +Create도 같은 checked construction을 사용한다. Consumer의 downcast/type-switch 없이 +typed mass contribution과 기존 ElementView stiffness contribution을 같은 layout/scatter에 준다. +Global equation/index/pattern은 끝까지 DofManager 소유다. + +`Mitc4Shell::Stiffness`는 현재 min rotary diagonal을 사용하고 +`NonlinearMitc4Shell::Create`는 그 초기 kd를 저장한다. 새 private trace helper로 앞 경계만 +바꾸면 nonlinear은 기존 frozen path를 재사용한다. Tests는 formula 값 변경뿐 아니라 +완전한 geometry/frame 재생성·partial BC·반력·objective tangent를 검증한다. + +`hdf5_internal::WriteModel`은 model datasets와 static metadata를 함께 쓴다. Model-only seam을 +분리하고 기존 WriteModel이 같은 static metadata와 datasets를 호출하도록 유지한다. Eigen은 +그 model-only 함수와 eigen-only metadata/schema를 사용한다. 기존 static reader inventory는 +그대로 두며 eigen discriminant 없이 새 파일을 static으로 읽지 않게 테스트한다. + +## Step별 API와 책임 + +| Step | 완성되는 경계 | 소유 데이터와 호출 규칙 | +| --- | --- | --- | +| 0 | FrequencyStep, Domain::FrequencySteps/Densities, active view, exact mapping | Raw syntax→validated immutable records; density/t/source resolution; static API/순서 보존 | +| 1 | ComputeDrillingScale→Mitc4Shell::Stiffness | 초기 physical20만 입력, eight diagonals scaled mean; nonlinear 초기 저장 경로 재사용 | +| 2 | ConsistentMass→DeriveLumpedMass→ShellMassAssembler | Original24/C0..2 snapshot 보존, nodal6 blocks, stable COO/reduction; same source scatter | +| 3 | ReduceEigenSystem/RestoreEigenvector, DofManager finite layout | Original free K/ML 별도 보존, node P/Z/L/rcond와 finite pattern, sparse block whitening | +| 4 | FeastBackend/InitialSpace/Search→EigenSolver::SolveLowest | Vendor-private actual calls, neutral scalar/vector/history output; actual N/n/c/m0 각각 구분 | +| 5 | ValidateEigenpairs→LinearFrequencyProcedureExecutor::Execute | All-c 검증 후 paired N candidate, 전체 c metrics/history, Domain/view 수명, 아직 accepted commit 아님 | +| 6 | EigenResultsWriter/WriteEigenSchema/SelfCheckEigen→prepared CLI finalization | Log close, candidate close/readback, final replacement 뒤 nofail state swap | +| 7 | EigenReferenceComparison와 fresh-run portfolio | Source-key Value-only join/common policy, raw/new-binary evidence, canonical3 보고서 | + +Private helper names는 Step에 지정한 책임·signature 역할을 지킨다. Parameter type의 상세 배치와 +작은 private structs는 Implementation이 routine 선택할 수 있지만 승인 owned files 밖 확장, +physics/schema/tolerance 변경은 Coordinator에 반환한다. Public header는 standard/FESA value +type만 노출하고 MKL_INT, HDF5 hid_t, Win32 handle/header는 private source에 둔다. + +## TDD file boundary + +각 Step index는 tests/build/reports를 포함한 정확한 path 목록을 가진다. 현재 +`scripts/msvc_harness/tdd_policy.py`는 production basename에 대응하는 test basename을 +찾으므로 새 C++ header/source의 test를 반드시 먼저 생성한다. 아래는 새 경계별 대응이며 +기존 production은 해당 existing test와 추가 feature suite를 함께 사용한다. + +| Production basename | Related test path | +| --- | --- | +| frequency_step | `tests/unit/model/frequency_step_test.cpp` | +| domain_mapping_context | `tests/unit/io/abaqus/domain_mapping_context_test.cpp` | +| mitc4_drilling_scale | `tests/unit/elements/mitc4_drilling_scale_test.cpp` | +| mitc4_shell_mass | `tests/unit/elements/mitc4_shell_mass_test.cpp` | +| shell_mass_assembler | `tests/unit/assembly/shell_mass_assembler_test.cpp` | +| eigen_reduction | `tests/unit/analysis/eigen_reduction_test.cpp` | +| feast_backend | `tests/unit/solvers/eigen/feast_backend_test.cpp` | +| feast_initial_space | `tests/unit/solvers/eigen/feast_initial_space_test.cpp` | +| feast_search | `tests/unit/solvers/eigen/feast_search_test.cpp` | +| eigen_solver | `tests/unit/solvers/eigen/eigen_solver_test.cpp` | +| mkl_feast_eigen_solver | `tests/unit/solvers/eigen/mkl_feast_eigen_solver_test.cpp` | +| eigen_analysis_state | `tests/unit/analysis/eigen_analysis_state_test.cpp` | +| eigen_validation | `tests/unit/analysis/eigen_validation_test.cpp` | +| linear_frequency_procedure | `tests/integration/analysis/linear_frequency_procedure_test.cpp` | +| eigen_results_writer | `tests/unit/results/eigen_results_writer_test.cpp` | +| eigen_hdf5_results_writer | `tests/unit/io/hdf5/eigen_hdf5_results_writer_test.cpp` | +| eigen_hdf5_schema | `tests/unit/io/hdf5/eigen_hdf5_schema_test.cpp` | +| hdf5_model_writer | `tests/unit/io/hdf5/hdf5_model_writer_test.cpp` | +| prepared_analysis | `tests/unit/analysis/prepared_analysis_test.cpp` | + +Existing stem의 `model_types/domain/analysis_model/dof_manager/input_syntax/input_reader/ +mitc4_shell/element_factory/fesa_application`은 현재 대응 tests가 있고 각 Step의 관련 test와 +함께 검증한다. 새 test registration은 `tests/CMakeLists.txt`, 새 library cpp는 +`src/fesa/CMakeLists.txt`만 소유한다. Root CMake/dependency/preset 변경은 필요하지 않다. +Vendor link/runtime는 기존 Fesa::MKL/HDF5/TBB target closure로 실제 API를 실행해 확인한다. +명백한 missing runtime가 발견되면 임의 PATH 우회나 scope 확대 대신 exact evidence를 반환한다. + +현재 `tests/CMakeLists.txt`의 `fesa_tests`는 세 executable `fesa_unit_tests`, +`fesa_integration_tests`, `fesa_reference_tests`에 의존하는 aggregate target이다. +따라서 Step의 `--target fesa_tests`는 reference까지 빌드한다. 새 `tests/unit/` 파일은 +unit executable, `tests/integration/` 파일은 integration executable, `tests/reference/` +파일은 reference executable에 등록한다. 각 executable의 기존 runtime staging과 +`gtest_discover_tests`를 유지한다. Focused inventory에서 새 이름 모두가 존재해야 한다. + +## Candidate commit과 테스트 주입 + +별도 `EigenAnalysisState`는 N vectors와 raw scalars/source, all-c checks/history만 소유한다. +Working reduction/solver scratch는 procedure 실행 동안 유지되고 accepted state에 global dense +matrix나 미래 dynamics state를 남기지 않는다. `Swap`은 `noexcept`이고 소유 vector/record +교환만 수행한다. Execute 반환 candidate를 accepted state라고 보고하지 않는다. + +Prepared/static 기존 overload는 보존하고 frequency executor/result/writer가 있는 overload를 +추가하여 procedure 선택을 한 경계에 둔다. Output finalization은 candidate를 완성/검증/close하고 +final replacement 성공 뒤 state swap을 수행한다. 이 순서에 fallible callback/allocation을 +남기지 않는다. Failure injection은 EigenSolver/EigenResultsWriter 및 private backend/schema +seam에 제한한다. 새로운 public CLI failure flags는 없다. Raw HDF5 mutation은 test-local +generated file에서만 하고 저장 reference input/TXT/CSV는 read-only다. diff --git a/docs/mitc4-shell-feast-eigen/implementation-plan.md b/docs/mitc4-shell-feast-eigen/implementation-plan.md new file mode 100644 index 0000000..6547dc6 --- /dev/null +++ b/docs/mitc4-shell-feast-eigen/implementation-plan.md @@ -0,0 +1,58 @@ +# MITC4 질량·FEAST 구현 계획 + +- Feature ID: `mitc4-shell-feast-eigen` +- Owner: `implementation-planning-agent` +- Input contract revision: `r2` +- 요청 outcome: `pass`; 다음 owner: `implementation-agent` +- 의미: 실행 가능한 계획의 Coordinator gate 검토 요청이다. 구현/검증 완료 판정이 아니다. + +[FEATURED_AGENTS](FEATURED_AGENTS.md), [PRD](PRD.md), [ADR](ADR.md)와 +[coordination](coordination.md), 승인된 [requirements](requirements.md), [research](research.md), +[formulation](formulation.md), [NR](numerical-review.md), [I/O](io.md) 및 각 상세 r2를 적용한다. +공통 [architecture](../ARCHITECTURE.md), [tolerance](../TOLERANCE.md), +[agent 계약](../SOLVER_AGENT_DESIGN.md), [문서 관리](../FEATURE_DOCUMENTATION.md), +[harness](../../.agents/skills/harness/SKILL.md), +[fem-implementation-tdd](../../.codex/skills/fem-implementation-tdd/SKILL.md)가 실행 기준이다. + +## 실행 구성 + +별도 execution-prep1 Step을 마친 뒤 새 invocation에서 main8 Steps를 수행한다. +각 Step은 behavior별 RED→observed failure→minimal GREEN→focused VERIFY를 끝내고 +전체 MSVC/x64/Debug CMake/CTest와 등록 Stop을 통과한다. 새 compiler warning은0이다. + +| 순서 | 완결되는 범위 | 실행 artifact | +| --- | --- | --- | +| Prep0 | 다섯 유한 deadline 설정·Harness regression·activation | [prep Step0](../../phases/mitc4-shell-feast-eigen-execution-prep/step0.md) | +| 0 | Frequency semantic model과 exact 입력 subset | [Step0](../../phases/mitc4-shell-feast-eigen/step0.md) | +| 1 | 공변 drilling scale과 정적 회귀 | [Step1](../../phases/mitc4-shell-feast-eigen/step1.md) | +| 2 | Consistent→lumped 질량과 deterministic 조립 | [Step2](../../phases/mitc4-shell-feast-eigen/step2.md) | +| 3 | 실제 제약의 null 공간과 sparse whitening | [Step3](../../phases/mitc4-shell-feast-eigen/step3.md) | +| 4 | MKL FEAST adapter와 bounded lowest-N 검색 | [Step4](../../phases/mitc4-shell-feast-eigen/step4.md) | +| 5 | 전체 c 검증과 별도 frequency procedure | [Step5](../../phases/mitc4-shell-feast-eigen/step5.md) | +| 6 | Additive HDF5와 CLI candidate transaction | [Step6](../../phases/mitc4-shell-feast-eigen/step6.md) | +| 7 | Value-only comparator·fresh reference·구현 evidence | [Step7](../../phases/mitc4-shell-feast-eigen/step7.md) | + +[실행 환경](implementation-environment.md)은 actual autodetect VS18/x64/Debug cache/dependencies, +one-time prep module invocation과 새 main activation, 유한 timeout·Git ownership을 고정한다. +8개로 합친 이유와 시간 추정의 한계도 명시했다. [API/source-test 경계](implementation-interfaces.md)는 +기존 확장점과 vendor 격리·별도 state/procedure·candidate commit을 정한다. +[Verification mapping](implementation-verification.md)은 must27/NR27/I/O11 및 formulation/schema +items를 독립 oracle·mutation·실제 test discovery/full evidence에 연결한다. + +## 계약과 handoff + +계산은 `consistent -> moment-derived lumped -> actual MKL FEAST`이며 all-c residual/Gram도 +같은 ML을 사용한다. 입력 N은 원본 FREQUENCY의10, 공개 N과 검증 c를 구분한다. +공변 trace stabilization과 영향 static 재검증을 포함한다. 새 eigen external comparison은 원본 +TXT의 Value10개와10singleton common families이며 기존 static U/UR/reaction 역할은 유지한다. + +모든 exact implementation/test/build/report paths는 [main index](../../phases/mitc4-shell-feast-eigen/index.json)와 +[prep index](../../phases/mitc4-shell-feast-eigen-execution-prep/index.json)에 있다. +미래 보고서를 미리 생성하지 않았다. Planning 소유는 이 main/detail4문서와 할당된 phase files뿐이다. +실제 구현·full build/test·FEAST·reference comparison은 미실행이며 후속 Implementation이 수행한다. +계획 정적 감사 명령/exit/coverage는 [V7](implementation-verification.md#v7-계획-정적-감사)에 기록한다. + +현재 upstream physics/schema/tolerance 미결정은 없다. Native Codex sandbox/runtime와 실제 +FEAST count/condition/메모리/외부 오차는 실행 전 성공을 보장할 수 없다. Actual failure는 계약된 +owner/환경 경로로 반환하고 수치 기준을 바꾸지 않는다. Workflow 전이·독립 Physics/Release와 +closure는 Coordinator/각 owner 소유이며 push/tag/publish/deploy/package 권한은 없다. diff --git a/docs/mitc4-shell-feast-eigen/implementation-verification.md b/docs/mitc4-shell-feast-eigen/implementation-verification.md new file mode 100644 index 0000000..063d7ea --- /dev/null +++ b/docs/mitc4-shell-feast-eigen/implementation-verification.md @@ -0,0 +1,285 @@ +# 구현 검증과 계약 traceability + +- Feature ID: `mitc4-shell-feast-eigen` +- Owner: `implementation-planning-agent` +- Input contract revision: `r2` +- 기본 보고서: [implementation-plan](implementation-plan.md) +- 권위: [requirements](requirements.md), [NR cases](numerical-review-cases.md), + [NR controls](numerical-review-controls.md), [I/O obligations](io-mapping.md#m5-구현test-obligations와-requirement-연결). +- 아래 테스트는 계획 이름이다. 실제 discovery/실행 전 통과 또는 구현 완료를 뜻하지 않는다. + +## V1. 의미 있는 RED와 전체 suite + +각 Step은 소단위별 test-first RED/expected failure 기록→최소 GREEN→focused VERIFY 뒤 +full CMake/MSVC/x64/Debug CTest 및 Python regression을 완료한다. 기존 회귀가 이미 통과한 +사실은 새 RED가 아니다. 부재 API로 인한 정확한 compile/link error는 RED로 기록할 수 있으나 +환경/import/dependency failure와 구분한다. Mutations는 test-local data/fixture/injected +backend에서 수행하며 stored reference나 production을 임시로 오염시키지 않는다. + +아래 mandatory test names는 해당 Step이 완성될 때 CTest discovery inventory에 **각각 존재**해야 +한다. 같은 combined regex가 기존 tests 몇 개만 선택했다고 성공시키지 않는다. New production +basename의 대응 test 파일과 등록된 해당 behavior assertion도 함께 대조한다. 실제 test를 +parameterized tests로 쪼갠 경우 원 named obligation→실제 discovered names의 일대일/일대다 +대응을 step evidence에 기록한다. Case를 test 이름만 등록하고 assertions를 비워 두지 않는다. + +## V2. NR cases의 구체 실행 대응 + +Threshold와 전체 fixture inventory는 NR 원문이다. 표의 요약을 이유로 그 inventory를 축소하지 않는다. +각 row의 primary test 외 관련 단계의 preprocessing/injection/schema tests를 함께 수행한다. + +| Case ID | Steps | Mandatory primary test / file | 독립 oracle·오류 검출 | +| --- | --- | --- | --- | +| MFE-C01 | 2 | `Mitc4ShellMass.MfeC01FlatMomentOracle`
`tests/unit/elements/mitc4_shell_mass_test.cpp` | 4x2, rho3,t1/2의 exact C0/C1/C2; node m3,j1/16; direct energy/physical20 Cholesky/null; rho4/t2 powers. Wrong shear factor/rotary scaling을 검출. | +| MFE-C02 | 2 | `Mitc4ShellMass.MfeC02CurvedParticleOracle`
`tests/unit/elements/mitc4_shell_mass_test.cpp` | NR rational X/d의 independent polynomial 또는 고차 direct particle integral. C1 zero/2-point/flat C2 mutation의 error가 기준을 넘는지 확인. | +| MFE-C03 | 2 | `Mitc4ShellMass.MfeC03DerivedSnapshotAndJensen`
`tests/unit/elements/mitc4_shell_mass_test.cpp` | C1/C2 symmetric perturbation→moment snapshot/consistent/derived block을 각각 대조. Independent nodal integral, central variance, spatial first moment, four velocity families의 Jensen work. | +| MFE-C04 | 2 | `ShellMassAssembler.MfeC04RefinementEnergy`
`tests/unit/assembly/shell_mass_assembler_test.cpp` | m1/2/4 square mesh, velocity(x,0,0); direct MC work4/3, ML-MC8/(3m²), constant velocity total4. Spectrum convergence 주장은 하지 않음. | +| MFE-C05 | 2 | `Mitc4ShellMass.MfeC05RotatedMassAndCentroid`
`tests/unit/elements/mitc4_shell_mass_test.cpp` | NR rational proper Q+shift(7,-3,5), geometry/directors 새 생성; two mass congruence/centroid/null. d=(1,1,1)/sqrt3에서 global scalar-row lump mutation 검출. | +| MFE-C06 | 0, 2, 5 | `ShellMassAssembler.MfeC06SourceAndParallelOrder`
`tests/unit/assembly/shell_mass_assembler_test.cpp` | Shared nodes와 두 rho/t, 선언/label permutation, independent source/scatter mapping. Fixed input sequential/TBB 재실행의 CSR/reduction exact order와 source-renumbered 대응 결과를 구분. | +| MFE-C07 | 0, 2 | `FrequencyDomain.MfeC07DensityFailures`
`tests/unit/io/abaqus/frequency_domain_test.cpp` | Density scope/arity/duplicate/unresolved/missing/zero/negative/NaN/Inf/temperature/dependencies. Kernel 27-point invalid·geometry/t/material 거부는 Mitc4ShellMass에서 별도; density 없는 static 유지. | +| MFE-C08 | 1, 3, 5 | `Mitc4Covariance.MfeC08PartialBcCovariance`
`tests/integration/analysis/mitc4_covariance_test.cpp` | NR001 rectangle/Z45에서 새 K/kd와 two mass, actual BC URZ-only. kd19/4800,Kff10369/7500,Mff3/50; Step5 actual FEAST lambda10369/450/full residual. Old min mutation 실패. | +| MFE-C09 | 1, 7 | `Mitc4Covariance.MfeC09StaticReactionCovariance`
`tests/integration/analysis/mitc4_covariance_test.cpp` | Admissible physical moment (5/3)b, thetaZ7500/10369. Fresh geometry/load 재생성 후 full Kq-F의 모든 reaction component와 physical projection 기준 확인. | +| MFE-C10 | 1 | `Mitc4DrillingScale.MfeC10TraceInventory`
`tests/unit/elements/mitc4_drilling_scale_test.cpp` | [0,0,2,4,0,6,0,4]→kref2, zero/negative/nonfinite/large/subnormal; node별 독립 tangent rotation angles. Positive-only mean/min/floor mutation 검출. | +| MFE-C11 | 1, 2, 3, 5 | `LinearFrequencyProcedure.MfeC11SixPhysicalRigidModes`
`tests/integration/analysis/linear_frequency_procedure_test.cpp` | Free element/patch six tangent-projected rigid fields vs four massless drills. PhysicalK20 rank14/MC20PD/K24rank18, finite20·six near-zero actual modes와 mass Gram; preprocessing tests도 포함. | +| MFE-C12 | 1, 7 | `NonlinearMitc4Tangent.MfeC12FrozenCovariantScale`
`tests/unit/elements/nonlinear_mitc4_shell_tangent_test.cpp` | Initial S1 scale의 trial/commit/rollback 불변, existing gamma의 full FD schedule/index3/tangent/objectivity/physical linear limit/recovery. 기존 tests는 회귀이며 새 RED로 가장하지 않음. | +| MFE-C13 | 0, 3, 5 | `EigenReduction.MfeC13ExactBoundaryNullIntersection`
`tests/unit/analysis/eigen_reduction_test.cpp` | NR 세 director와 supported mask 조합, drill-only는 axis-aligned URZ만; per-node rank0를 global failure로 오인하지 않음. Global n0/N>n, source constraint exact0. | +| MFE-C14 | 3, 5 | `EigenReduction.MfeC14NearNullConditioning`
`tests/unit/analysis/eigen_reduction_test.cpp` | p1/2000 analytic5 pass, p1e-8 analytic5 conditioning/Cholesky fail, p0 null1. rcond2^-32 equality/nextafter tests; tiny positive를 삭제하면 failure. | +| MFE-C15 | 3 | `EigenReduction.MfeC15RejectsInvalidDecoupling`
`tests/unit/analysis/eigen_reduction_test.cpp` | Test-local K[[6,2],[2,4]],Mdiag2,0 finite2.5/z=-p/2. Production Kpz nonzero/Kzz nonpositive injected rejection; 삭제3 또는 general Schur fallback 금지. | +| MFE-C16 | 3, 5 | `EigenValidation.MfeC16OriginalMassAndPairing`
`tests/unit/analysis/eigen_validation_test.cpp` | M[[2,1],[1,2]],K[[6,4],[4,6]]→2,10/3; triangular whitening/restoration. Wrong M/lambda/vector/null/constraint corruption을 full original-space 검사로 탐지. | +| MFE-C17 | 4, 5 | `MklFeastEigenSolver.MfeC17KnownLowestSpectra`
`tests/unit/solvers/eigen/mkl_feast_eigen_solver_test.cpp` | Actual API+production search: n1; [0,0,0,2,5,9] N1/4/6; [1,2,4,8] N1/2/4; allzero n4 N1/4. Matrix-derived enclosure/count history와 independent ordered spectrum. | +| MFE-C18 | 4, 5 | `MklFeastEigenSolver.MfeC18RepeatedAndTightClusters`
`tests/unit/solvers/eigen/mkl_feast_eigen_solver_test.cpp` | Actual n64 fortyfold1+2..25 N1/41; tight[1,1+2^-28,1+2^-27,8] N2; fixed Givens dense CSR. c>N/all-c Gram와 gap/8, repeated projector 기준. 개별 repeated vector equality 아님. | +| MFE-C19 | 4, 5, 6 | `EigenValidation.MfeC19RawSignedEigenvalues`
`tests/unit/analysis/eigen_validation_test.cpp` | Actual [-2,0,3],[-1e-12,0,1] backend raw; procedure significant negative failure. ±tauzero 및 nextafter, frequency ID subset/finite/underflow. Small positive도 N에 포함. | +| MFE-C20 | 2, 3, 5 | `LinearFrequencyProcedure.MfeC20DensityAndUnits`
`tests/integration/analysis/linear_frequency_procedure_test.cpp` | TwoM×4,lambda/4,amplitude1/2; repeated projector; length1024/rho1024^-3/E1024^-1/t1024의 lambda invariance. Baseline s와 동일 물리 BC. | +| MFE-C21 | 4, 5, 6 | `FeastSearch.MfeC21StatusAndHistoryFailures`
`tests/unit/solvers/eigen/feast_search_test.cpp` | C21 전체 raw status inventory, endpoint/zero count/nonmonotonicity/total!=n/m!=c, invalidCSR/fpm/SPD/QR/pair/residual. c>N의 뒤 column 손상과 false-lowest success를 검출; 허용 retry 외 즉시 실패. | +| MFE-C22 | 4, 6 | `FeastSearch.MfeC22FiniteBudgetsAndCapacity`
`tests/unit/solvers/eigen/feast_search_test.cpp` | 512count/3solve inclusive와 초과,384 optimization+128reserve, certified fallback. n²/n*m0/nnz+1/byte overflow 및 allocation injected failure; 큰 allocation 실제 고갈을 유발하지 않음. | +| MFE-C23 | 0, 5, 6, 7 | `FrequencyDomain.MfeC23ExactReferenceSubset`
`tests/unit/io/abaqus/frequency_domain_test.cpp` | 원본729/676/Step-2/N10, density/t/S4R/warnings/source records. N invalid·fields2~7 nonempty0/eighth empty·unsupported enum/procedure/load/acoustic/mixed/nonzero BC; I1~I6 전 inventory. | +| MFE-C24 | 5, 6, 7 | `EigenHdf5Schema.MfeC24RoundTripAndRejection`
`tests/unit/io/hdf5/eigen_hdf5_schema_test.cpp` | O1~O5 independent reader/mutation, N/c/source/units/backend/ML/flags/types/ranks. FrequencyApplication failure matrix는 이전 final/state hash와 최초final부재를 각각 확인. | +| MFE-C25 | 7 | `EigenReferenceCases.MfeC25FreshTenValueFamilies`
`tests/reference/eigen_reference_cases_test.cpp` | 원본TXT full grammar+source join/10singleton 실제fresh eigen 비교. EigenReferenceComparison 음성/1%RMS·5%row·near-zero·S0 boundaries, Freq mutation 판정불변. | +| MFE-C26 | 1, 6, 7 | `Mitc4EigenStaticRegression.MfeC26FreshApprovedPortfolio`
`tests/reference/mitc4_eigen_static_regression_test.cpp` | shell/shellNL/shellNL-meshfine와 linear-limit 역할. 원본copy→actualrun→기존 Ublocking/URwarning/localreactionreview+factor1 internalbalance. Existing meshfine-02 post-closure·pressure fullsuite 유지. | +| MFE-C27 | 0, 1, 2, 3, 4, 5, 6, 7 | `EigenReferenceCases.MfeC27FreshAndRepeatedEvidence`
`tests/reference/eigen_reference_cases_test.cpp` | 모든 Step RED/GREEN/full 실제exits/warnings/identity; 같은 binary/runtime/thread/input3회 CSR/row/diagnostic exact와 scalar/projector. Fresh binary/source/result evidence·canonical reports, 독립Physics/Release는 후속gate. | + +C07은 추가 `Mitc4ShellMass.MfeC07InvalidMassGeometry`, C08은 +`LinearFrequencyProcedure.MfeC08PartialBcEigenvalue`, C24는 +`FrequencyApplication.MfeC24PreservesFinalAndState`, comparator 음성/경계는 +`EigenReferenceComparison.MfeC25PrechecksAndToleranceBoundaries`를 mandatory로 둔다. +각 companion은 해당 Step의 discovery에서 확인하고 record한다. + +## V3. 전체 must requirement 대응 + +전27개 requirement의 NR case mapping을 그대로 옮겨 실행 Step에 연결했다. Requirement025의 +Implementation evidence는 여기서 준비하되 독립 Physics/Release gate는 후속 owner가 수행한다. + +| Requirement ID | Required NR cases | Implementation steps | +| --- | --- | --- | +| FEM-REQ-MITC4-EIGEN-001 | MFE-C23, MFE-C25 | [0](../../phases/mitc4-shell-feast-eigen/step0.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md), [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-002 | MFE-C01, MFE-C08, MFE-C12, MFE-C23, MFE-C26 | [0](../../phases/mitc4-shell-feast-eigen/step0.md), [1](../../phases/mitc4-shell-feast-eigen/step1.md), [2](../../phases/mitc4-shell-feast-eigen/step2.md), [3](../../phases/mitc4-shell-feast-eigen/step3.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md), [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-003 | MFE-C06, MFE-C07, MFE-C23 | [0](../../phases/mitc4-shell-feast-eigen/step0.md), [2](../../phases/mitc4-shell-feast-eigen/step2.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md), [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-004 | MFE-C01, MFE-C02, MFE-C07 | [0](../../phases/mitc4-shell-feast-eigen/step0.md), [2](../../phases/mitc4-shell-feast-eigen/step2.md) | +| FEM-REQ-MITC4-EIGEN-005 | MFE-C01, MFE-C02, MFE-C03 | [2](../../phases/mitc4-shell-feast-eigen/step2.md) | +| FEM-REQ-MITC4-EIGEN-006 | MFE-C01, MFE-C03, MFE-C11, MFE-C13 | [0](../../phases/mitc4-shell-feast-eigen/step0.md), [1](../../phases/mitc4-shell-feast-eigen/step1.md), [2](../../phases/mitc4-shell-feast-eigen/step2.md), [3](../../phases/mitc4-shell-feast-eigen/step3.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md) | +| FEM-REQ-MITC4-EIGEN-007 | MFE-C06, MFE-C13, MFE-C27 | [0](../../phases/mitc4-shell-feast-eigen/step0.md), [1](../../phases/mitc4-shell-feast-eigen/step1.md), [2](../../phases/mitc4-shell-feast-eigen/step2.md), [3](../../phases/mitc4-shell-feast-eigen/step3.md), [4](../../phases/mitc4-shell-feast-eigen/step4.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md), [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-008 | MFE-C08, MFE-C13, MFE-C14, MFE-C15, MFE-C16 | [0](../../phases/mitc4-shell-feast-eigen/step0.md), [1](../../phases/mitc4-shell-feast-eigen/step1.md), [3](../../phases/mitc4-shell-feast-eigen/step3.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md) | +| FEM-REQ-MITC4-EIGEN-009 | MFE-C13, MFE-C17, MFE-C18, MFE-C19, MFE-C22, MFE-C23 | [0](../../phases/mitc4-shell-feast-eigen/step0.md), [3](../../phases/mitc4-shell-feast-eigen/step3.md), [4](../../phases/mitc4-shell-feast-eigen/step4.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md), [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-010 | MFE-C17, MFE-C18, MFE-C25, MFE-C27 | [0](../../phases/mitc4-shell-feast-eigen/step0.md), [1](../../phases/mitc4-shell-feast-eigen/step1.md), [2](../../phases/mitc4-shell-feast-eigen/step2.md), [3](../../phases/mitc4-shell-feast-eigen/step3.md), [4](../../phases/mitc4-shell-feast-eigen/step4.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md), [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-011 | MFE-C03, MFE-C16, MFE-C17, MFE-C23, MFE-C25 | [0](../../phases/mitc4-shell-feast-eigen/step0.md), [2](../../phases/mitc4-shell-feast-eigen/step2.md), [3](../../phases/mitc4-shell-feast-eigen/step3.md), [4](../../phases/mitc4-shell-feast-eigen/step4.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md), [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-012 | MFE-C14, MFE-C19, MFE-C21, MFE-C22, MFE-C24 | [3](../../phases/mitc4-shell-feast-eigen/step3.md), [4](../../phases/mitc4-shell-feast-eigen/step4.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md), [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-013 | MFE-C11, MFE-C16, MFE-C17, MFE-C18, MFE-C21 | [1](../../phases/mitc4-shell-feast-eigen/step1.md), [2](../../phases/mitc4-shell-feast-eigen/step2.md), [3](../../phases/mitc4-shell-feast-eigen/step3.md), [4](../../phases/mitc4-shell-feast-eigen/step4.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md) | +| FEM-REQ-MITC4-EIGEN-014 | MFE-C01, MFE-C02, MFE-C03, MFE-C04, MFE-C05, MFE-C08, MFE-C11, MFE-C20 | [1](../../phases/mitc4-shell-feast-eigen/step1.md), [2](../../phases/mitc4-shell-feast-eigen/step2.md), [3](../../phases/mitc4-shell-feast-eigen/step3.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md) | +| FEM-REQ-MITC4-EIGEN-015 | MFE-C23, MFE-C25 | [0](../../phases/mitc4-shell-feast-eigen/step0.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md), [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-016 | MFE-C07, MFE-C21, MFE-C23 | [0](../../phases/mitc4-shell-feast-eigen/step0.md), [2](../../phases/mitc4-shell-feast-eigen/step2.md), [4](../../phases/mitc4-shell-feast-eigen/step4.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md), [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-017 | MFE-C24, MFE-C25 | [5](../../phases/mitc4-shell-feast-eigen/step5.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md), [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-018 | MFE-C06, MFE-C13, MFE-C16, MFE-C24, MFE-C25 | [0](../../phases/mitc4-shell-feast-eigen/step0.md), [2](../../phases/mitc4-shell-feast-eigen/step2.md), [3](../../phases/mitc4-shell-feast-eigen/step3.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md), [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-019 | MFE-C21, MFE-C22, MFE-C24 | [4](../../phases/mitc4-shell-feast-eigen/step4.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md), [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-020 | MFE-C25, MFE-C26 | [1](../../phases/mitc4-shell-feast-eigen/step1.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md), [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-021 | MFE-C25 | [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-022 | MFE-C25 | [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-023 | MFE-C27 | [0](../../phases/mitc4-shell-feast-eigen/step0.md), [1](../../phases/mitc4-shell-feast-eigen/step1.md), [2](../../phases/mitc4-shell-feast-eigen/step2.md), [3](../../phases/mitc4-shell-feast-eigen/step3.md), [4](../../phases/mitc4-shell-feast-eigen/step4.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md), [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-024 | MFE-C09, MFE-C12, MFE-C26, MFE-C27 | [0](../../phases/mitc4-shell-feast-eigen/step0.md), [1](../../phases/mitc4-shell-feast-eigen/step1.md), [2](../../phases/mitc4-shell-feast-eigen/step2.md), [3](../../phases/mitc4-shell-feast-eigen/step3.md), [4](../../phases/mitc4-shell-feast-eigen/step4.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md), [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-025 | MFE-C27 | [0](../../phases/mitc4-shell-feast-eigen/step0.md), [1](../../phases/mitc4-shell-feast-eigen/step1.md), [2](../../phases/mitc4-shell-feast-eigen/step2.md), [3](../../phases/mitc4-shell-feast-eigen/step3.md), [4](../../phases/mitc4-shell-feast-eigen/step4.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md), [7](../../phases/mitc4-shell-feast-eigen/step7.md) | +| FEM-REQ-MITC4-EIGEN-026 | MFE-C01, MFE-C02, MFE-C03, MFE-C04, MFE-C05 | [2](../../phases/mitc4-shell-feast-eigen/step2.md) | +| FEM-REQ-MITC4-EIGEN-027 | MFE-C08, MFE-C09, MFE-C10, MFE-C11, MFE-C12, MFE-C26 | [1](../../phases/mitc4-shell-feast-eigen/step1.md), [2](../../phases/mitc4-shell-feast-eigen/step2.md), [3](../../phases/mitc4-shell-feast-eigen/step3.md), [5](../../phases/mitc4-shell-feast-eigen/step5.md), [6](../../phases/mitc4-shell-feast-eigen/step6.md), [7](../../phases/mitc4-shell-feast-eigen/step7.md) | + +## V4. I/O obligation 대응 + +| Obligation ID | Steps | Positive/negative evidence | +| --- | --- | --- | +| IO-T01 | 0, 5, 6, 7 | C23; 원본 unchanged semantic snapshot/source warnings→actual backend→HDF5. | +| IO-T02 | 0, 2 | C01/02/06/07; material/section/rho/t 관계와 semantic/kernel negative inventory. | +| IO-T03 | 0, 6 | C07/13/23; exact parameter/slot/count/procedure/BC 실패와 exit category. | +| IO-T04 | 0, 2, 3, 5 | C06/13/14/24; source renumbering/ambiguity와 actual BC의 rank/복원. | +| IO-T05 | 3, 5, 6, 7 | C16/19/24; O1~O5/Nvectors/all-c raw metrics, source identity와 sameML replay. | +| IO-T06 | 4, 5, 6 | C17/18/19/21/22; actual API와 injected failure/budget/availability history. | +| IO-T07 | 5, 6 | C24; solve/validation/log/lease/write/flush/close/reopen/selfcheck/replace 전 failure matrix. | +| IO-T08 | 7 | C25; all-row parser/schema/identity finite prechecks, Freq structure-only mutation. | +| IO-T09 | 7 | C25; existing policy inclusive boundaries/near-zero/S0·singleton RMS independently checked. | +| IO-T10 | 0, 1, 6, 7 | C26/27; density없는static/parser/schema 보존·fresh portfolio·mode-shape reference 미요구. | +| IO-T11 | 0, 1, 2, 3, 4, 5, 6, 7 | C27; step별 meaningfulRED/실제fullcounts/새warning0/3repeat·freshhash. | + +## V5. 수학·backend·schema의 누락 방지 + +| Upstream item | Implementation / independent evidence | +| --- | --- | +| Mass M1~M10 | Step2 C01~07; sign S=-[d]x, exact quadrature order, original moments, two matrix energy/centroid/Jensen, no artificial drill | +| Stabilization S1~S8 | Step1 C08~12, Step3/5 partial-BC original pencil, Step7 static fresh portfolio; old formula만 대체 | +| Eigen E1~E5 | Step3 C13~16; D,C,P,Z,L과 DOF pattern owner, exact ranks/rcond/zero branches/original residual 보존 | +| Eigen E6/E7 + C5/C6 | Step4 actual FEAST·all count/status history, per-call fpm128·seed/QR·thread restore·index/allocation/capacity·유한 budgets | +| V1~V5 + C1~C4 | Step5 all-c original ML residual/Gram/energy/rhoB/rigid/scale/projector; Step7 N persistent replay | +| Eigen E8 + IO-M2 | Step5 candidate, Step6 final replacement 후 noexcept swap, all failure matrix/oldfinal hash; zero-byte log 독립 | +| I1~I6 | Step0 grammar/source/semantic positives+negatives, Step6 actual CLI exits/stable warnings; sourceN와 internalc 분리 | +| O1/O2 | Step6 discriminant/types/mandatory metadata/model identities/source_records/densities; Step7 input-byte identity | +| O3 | Step5 raw paired N/cluster/classification/frequency subset/sign, Step6 N×nn×6 persistence/units/constraint0 | +| O4/O5 | Step4/5 all-c evidence source, Step6 exact schema/fpm128/available flags/readback/relations/self-check | +| IO-M3/M4 + common tolerance | Step7 full-row TXT/source join10singleton/Value only; external Freq/vector gate 없음; static roles 보존 | + +원 full K/M 및 independent particle/polynomial 기대값은 solve의 reduced A나 serializer 자기 +복사에서 생성하지 않는다. Self-check는 저장 일관성 검사이며 independent physics를 대신하지 않는다. +FEAST의 documented count는 무조건 completeness theorem이 아니다. Count/empty-prefix/guard/ +solve-count/전체 c residual·Gram 및 known spectra를 함께 확보한다. + +## V6. Fresh reference 실행과 보고서 + +새 eigen 원본은 [reference-model](reference-model.md)의 input/TXT를 그대로 사용한다. +Step7의 unique generated execution directories 아래 bytes를 복사하고 FesaApplication을 실제 +호출한다. Reference 전후 SHA-256/byte size/mtime, copied input exact bytes, actual binary/lib +SHA-256, start/end/exit, final h5/log hash를 기록한다. Metadata source path는 실제 copied lexical +input path와 맞아야 하며 원본과는 byte identity를 따로 확인한다. + +Fresh eigen 세 run은 같은 input bytes/runtime/thread/settings를 사용한다. 각 run10modes, +nf3750/nz625/n3125와 all-c checks/call histories, N persistent vectors의 sameML 원 residual을 +확인한다. Same-input deterministic replay는 각 run을 같은 lexical input path에서 직접 solver로 +재실행한 뒤 run별 결과를 고유 evidence directory로 복사해 비교할 수 있다. 복사본 schema의 +source path는 원 실행 path 그대로 보존한다. 모드 벡터 외부 reference는 요구하지 않는다. + +Count x의3125²×8=78,125,000bytes는 한 scratch allocation 크기다. 실제 reference test process의 +peak working set/private memory를 관찰해 peak 측정 범위와 PID/command를 기록한다. +이 수를 전체 peak나 sparse shifted fill로 대체하지 않는다. Process 전체 peak는 solver-only +allocation peak의 upper bound임을 구분한다. 관찰은 managed test process의 actual exit까지 +연결하고 unobserved detached 실행은 하지 않는다. + +Static portfolio는 [기존 요구](requirements-evidence.md#필수-회귀-포트폴리오와-identity)의 +8개 required/review-only artifacts와 같은 input/source identity를 사용한다. Existing comparator의 +artifact disposition을 적용하여 제외 stress/RM3를 새 mandatory로 만들지 않는다. +`shell-s4`/`shell-s4-linear-limit`는 같은 fresh solve를 두 역할에 쓸 수 있으나 보고서는 +분리한다. Nonlinear final factor1 accepted-state/U blocking/UR warning/RF1..3와 spatial RM1..2 +review-only, internal force/moment balance blocking은 보존한다. Registered +`shellnl-meshfine-02-s4-final`는 별도 post-closure 역할이며 pressure를 포함한 기존 full suite도 +실행한다. 기존 reports는 수정하지 않고 현재 r2 새 evidence를 남긴다. + +Future outputs는 Step7의 `implementation-report.md`, `build-test.md`, +`reference-comparison.md`, `reference-comparison-detail.md`다. Step별 +`implementation-stepN-evidence.md`와 prep evidence는 실제 실행 때만 생성한다. +Final canonical3 보고서는 같은 r2의 실제 command/exit/count/수치·원본보존·실제 미실행 내역·전체 +requirement trace를 연결한다. 마지막 registered Stop/actual exit가 아직 미관찰이면 확인 대기로 +구분하며 Executor 종료 뒤 Coordinator의 management 사후 감사를 받는다. Physics/Release +판정과 외부 release 권한을 대신하지 않는다. + +## V7. 계획 정적 감사 + +정적 감사에서 actual `StepExecutor`의 read/validation methods만 호출했다. Executor 실행, +CMake/CTest/Python tests, 실제 FEAST 또는 reference solve는 호출하지 않았다. +첫 감사는 Step2의 `mitc4_shell.h`에 대응하는 기존 C++ test의 owned 목록 누락을 찾아 exit1이었다. +`mitc4_shell_test.cpp`를 같은 Step index/Markdown에 추가한 뒤 전체 audit exit0을 확인했다. +Local link target 검사에서 발견한 I/O M1 anchor 두 곳도 실제 heading으로 수정했다. + +최종 read-only command의 actual exit0 결과: prep1/main8, 계획 산출물16, owned path128회 +(고유110), 모든 Step의 upstream22 입력, must27/NR27/I/O11, 필수 신규 test 이름40개, +local Markdown links575개, 누락/anchor warning0. 기존 top index의5개 entry/status/history는 +HEAD와 deep equality다. 모든 새 Step은 pending이며 JSON/Markdown owned 목록이 동일하다. +최초 `git diff --check` exit0은 unstaged diff만 검사하여 당시 untracked 신규 파일을 +포함하지 않았다. 별도 line trailing whitespace 검사도 여분 EOF blank를 검출하지 못했다. +Root의 checkpoint staged 검사에서 EOF blank3개를 발견하여 지정된3파일만 정리했다. +아래 전체 산출물 검사는 EOF newline/여분 blank 검사까지 보완한 뒤 actual exit0을 확인했다. +Root의 재staging과 staged 검사는 별도 소유 작업이며 여기서 그 성공을 선기록하지 않는다. +Hash는 아래 command가 산출한 SHA-256을 handoff에 기록한다. Bundle digest는 sorted path, +NUL, raw bytes를 이어 hash하며 자기 digest를 이 문서에 삽입하지 않는다. + +아래는 workspace root에서 수행한 정확한 read-only 감사 command다. Test 이름 검사는 +**계획 inventory/regex/등록 target의 정적 일관성**이며 아직 존재하지 않는 C++ test의 실제 +discovery/실행 성공을 주장하지 않는다. 해당 실제 검증은 각 Implementation Step의 AC다. + +```powershell +@' +import hashlib,json,re,subprocess +from pathlib import Path +from urllib.parse import unquote +from scripts.execute import StepExecutor +root=Path.cwd(); feature="mitc4-shell-feast-eigen"; doc=root/"docs"/feature +phases=[feature+"-execution-prep",feature] +artifacts=[doc/n for n in ("implementation-plan.md","implementation-environment.md","implementation-interfaces.md","implementation-verification.md")] +artifacts += [root/"phases"/"index.json"] +counts=[]; owners=[]; names=[]; steps=[] +required=["FEATURED_AGENTS.md","PRD.md","ADR.md","coordination.md","requirements.md","requirements-evidence.md","research.md","research-evidence.md","formulation.md","formulation-mass.md","formulation-eigen.md","formulation-verification.md","formulation-stabilization.md","numerical-review.md","numerical-review-evidence.md","numerical-review-controls.md","numerical-review-cases.md","reference-model.md","io.md","io-input.md","io-schema.md","io-mapping.md"] +assert all((doc/n).is_file() for n in required) +for phase in phases: + ex=StepExecutor(phase); ex._read_top_index(); data=ex._read_phase_index() + assert all(s["status"]=="pending" for s in data["steps"]) + artifacts.append(root/"phases"/phase/"index.json"); counts.append(len(data["steps"])) + for step in data["steps"]: + path=root/"phases"/phase/f'step{step["step"]}.md' + artifacts.append(path); steps.append((phase,step,path)) + body=path.read_text(encoding="utf-8"); owned=ex._step_owned_paths(step) + for p in owned: ex._validate_owned_file(p) + assert list(owned)==json.loads(re.search(r"\x60{3}json\n(.*?)\n\x60{3}",body,re.S)[1]),path + assert all(f"docs/{feature}/{p}" in body for p in required),path + assert all(x in body for x in ("Input contract revision:","implementation-interfaces.md","RED","GREEN","Full VERIFY","error_message","blocked_reason","actual exit","사후 감사")),path + assert len(owned)>0 + owners.extend(owned) + if phase==feature: + inv=body.split("### 필수 신규 test discovery inventory\n",1)[1].split("## Full VERIFY",1)[0] + planned=re.findall(r"^- \x60([^\x60]+)\x60",inv,re.M) + regex=re.search(r"-R '([^']+)'",body)[1] + assert planned and all(re.search(regex,n) for n in planned),(path,planned,regex) + names.extend(planned); assert "--target fesa_tests" in body + for p in owned: + if p.startswith(("src/fesa/","include/fesa/")) and Path(p).suffix in (".cpp",".h"): + stem=Path(p).stem+"_test.cpp" + assert any(Path(t).name==stem and t.startswith("tests/") for t in owned),(path,p) +base=json.loads(subprocess.check_output(["git","show","HEAD:phases/index.json"],text=True)) +top=json.loads((root/"phases/index.json").read_text(encoding="utf-8")) +assert top["phases"][:-2]==base["phases"] +assert [p["dir"] for p in top["phases"][-2:]]==phases +assert counts==[1,8] and len(artifacts)==16 +v=(doc/"implementation-verification.md").read_text(encoding="utf-8") +nr=(doc/"numerical-review-cases.md").read_text(encoding="utf-8") +reqmap={m[0]:re.findall(r"MFE-C\d{2}",m[1]) for m in re.findall(r"^\| (\d{3}) \| ([^|]+) \|",nr,re.M)} +planmap={m[0]:re.findall(r"MFE-C\d{2}",m[1]) for m in re.findall(r"^\| FEM-REQ-MITC4-EIGEN-(\d{3}) \| ([^|]+) \|",v,re.M)} +assert reqmap==planmap and len(planmap)==27 +assert len(re.findall(r"^\| MFE-C\d{2} \|",v,re.M))==27 +assert len(re.findall(r"^\| IO-T\d{2} \|",v,re.M))==11 +primary=re.findall(r"^\| MFE-C\d{2} \| [^|]+\| \x60([^\x60]+)\x60",v,re.M) +assert len(primary)==27 and set(primary)<=set(names) +links=0; anchor_warnings=[] +def slug(s): + s=s.replace(chr(96),"").strip().lower() + s=re.sub(r"[^\w\- ]","",s) + return s.replace(" ","-") +for p in artifacts: + body=p.read_text(encoding="utf-8") + assert body.endswith("\n") and not body.endswith("\n\n"),p + assert not any(line.rstrip()!=line for line in body.splitlines()),p + if p.suffix!=".md": continue + for target in re.findall(r"\[[^\]]+\]\(([^)]+)\)",body): + if re.match(r"^[a-z]+://",target): continue + pathpart,_,anchor=unquote(target.strip("<>")).partition("#") + linked=(p.parent/pathpart).resolve() if pathpart else p + assert linked.is_file(),(p,target) + links+=1 + if anchor and linked.suffix==".md": + headings=[slug(h) for h in re.findall(r"^#+ (.+)$",linked.read_text(encoding="utf-8"),re.M)] + if anchor not in headings: anchor_warnings.append((p.relative_to(root).as_posix(),target)) +for p in ("implementation-report.md","build-test.md","reference-comparison.md","physics-evaluation.md","release.md"): + assert not (doc/p).exists(),p +cm=(root/"tests/CMakeLists.txt").read_text(encoding="utf-8") +assert re.search(r"add_custom_target\(\s*fesa_tests\s+DEPENDS\s+fesa_unit_tests\s+fesa_integration_tests\s+fesa_reference_tests",cm) +diff=subprocess.run(["git","diff","--check","--"]+[p.relative_to(root).as_posix() for p in artifacts],capture_output=True,text=True) +assert diff.returncode==0,diff.stdout+diff.stderr +digest=hashlib.sha256() +for p in sorted(artifacts): + digest.update(p.relative_to(root).as_posix().encode());digest.update(b"\0");digest.update(p.read_bytes()) +print(json.dumps({"phase_steps":counts,"artifacts":len(artifacts),"owned_path_occurrences":len(owners),"unique_owned_paths":len(set(owners)),"required_inputs":len(required),"requirement_rows":len(planmap),"nr_cases":len(primary),"io_obligations":11,"mandatory_test_names":len(names),"local_links":links,"anchor_warnings":anchor_warnings,"git_diff_check":diff.returncode,"bundle_sha256":digest.hexdigest()},ensure_ascii=False)) +for p in artifacts[:4]: print(p.name,hashlib.sha256(p.read_bytes()).hexdigest()) +'@ | python -B - +``` + +관리 문서 `coordination.md`의 동시 owner 변경은 이 계획 patch에 포함하지 않았다. +현재 실행 준비 완료는 계획 materialization을 뜻한다. Native transport, prep 실제 full VERIFY/ +등록 Stop 및 새 main invocation의 구현·FEAST/reference 성공은 후속 execution evidence가 필요하다. diff --git a/phases/index.json b/phases/index.json index c6a8d52..91e4353 100644 --- a/phases/index.json +++ b/phases/index.json @@ -23,6 +23,14 @@ "dir": "shell-surface-pressure-load", "status": "completed", "completed_at": "2026-09-01T17:43:57+0900" + }, + { + "dir": "mitc4-shell-feast-eigen-execution-prep", + "status": "pending" + }, + { + "dir": "mitc4-shell-feast-eigen", + "status": "pending" } ] -} \ No newline at end of file +} diff --git a/phases/mitc4-shell-feast-eigen-execution-prep/index.json b/phases/mitc4-shell-feast-eigen-execution-prep/index.json new file mode 100644 index 0000000..e19e627 --- /dev/null +++ b/phases/mitc4-shell-feast-eigen-execution-prep/index.json @@ -0,0 +1,22 @@ +{ + "project": "FESA Structural Solver", + "phase": "mitc4-shell-feast-eigen-execution-prep", + "steps": [ + { + "step": 0, + "name": "bounded-execution-deadlines", + "status": "pending", + "owned_paths": [ + "scripts/execute.py", + ".codex/hooks.json", + "scripts/hooks/stop_validation.py", + "scripts/msvc_harness/models.py", + "scripts/msvc_harness/process.py", + "tests/test_execute.py", + "tests/test_harness_timeouts.py", + "docs/HARNESS_WORKFLOW.md", + "docs/mitc4-shell-feast-eigen/implementation-prep-evidence.md" + ] + } + ] +} diff --git a/phases/mitc4-shell-feast-eigen-execution-prep/step0.md b/phases/mitc4-shell-feast-eigen-execution-prep/step0.md new file mode 100644 index 0000000..172f307 --- /dev/null +++ b/phases/mitc4-shell-feast-eigen-execution-prep/step0.md @@ -0,0 +1,142 @@ +# Step 0: 유한 실행시간 조정과 정상 검증 경로 보존 + +- Feature ID: `mitc4-shell-feast-eigen` +- Plan owner: `implementation-planning-agent` +- Execution owner: `implementation-agent` +- Input contract revision: `r2` +- Phase: `mitc4-shell-feast-eigen-execution-prep` +- Requirement: `FEM-REQ-MITC4-EIGEN-023/025`; `MFE-C27`, `IO-T11` +- 이 Step은 운영준비이고 solver physics/C++ 기능 변경이 아니다. + +## 필수 입력 + +Feature 폴더 `docs/mitc4-shell-feast-eigen/`와 다음 management/approved bundle을 읽는다. + +- [AGENTS.md](../../AGENTS.md) +- [docs/SOLVER_AGENT_DESIGN.md](../../docs/SOLVER_AGENT_DESIGN.md) +- [docs/FEATURE_DOCUMENTATION.md](../../docs/FEATURE_DOCUMENTATION.md) +- [docs/PRD.md](../../docs/PRD.md) +- [docs/ARCHITECTURE.md](../../docs/ARCHITECTURE.md) +- [docs/ADR.md](../../docs/ADR.md) +- [docs/CODINGSTYLE.md](../../docs/CODINGSTYLE.md) +- [docs/TOLERANCE.md](../../docs/TOLERANCE.md) +- [.codex/skills/fem-implementation-tdd/SKILL.md](../../.codex/skills/fem-implementation-tdd/SKILL.md) +- [.agents/skills/harness/SKILL.md](../../.agents/skills/harness/SKILL.md) +- [.codex/agents/implementation-agent.toml](../../.codex/agents/implementation-agent.toml) +- [docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md](../../docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md) +- [docs/mitc4-shell-feast-eigen/PRD.md](../../docs/mitc4-shell-feast-eigen/PRD.md) +- [docs/mitc4-shell-feast-eigen/ADR.md](../../docs/mitc4-shell-feast-eigen/ADR.md) +- [docs/mitc4-shell-feast-eigen/coordination.md](../../docs/mitc4-shell-feast-eigen/coordination.md) +- [docs/mitc4-shell-feast-eigen/requirements.md](../../docs/mitc4-shell-feast-eigen/requirements.md) +- [docs/mitc4-shell-feast-eigen/requirements-evidence.md](../../docs/mitc4-shell-feast-eigen/requirements-evidence.md) +- [docs/mitc4-shell-feast-eigen/research.md](../../docs/mitc4-shell-feast-eigen/research.md) +- [docs/mitc4-shell-feast-eigen/research-evidence.md](../../docs/mitc4-shell-feast-eigen/research-evidence.md) +- [docs/mitc4-shell-feast-eigen/formulation.md](../../docs/mitc4-shell-feast-eigen/formulation.md) +- [docs/mitc4-shell-feast-eigen/formulation-mass.md](../../docs/mitc4-shell-feast-eigen/formulation-mass.md) +- [docs/mitc4-shell-feast-eigen/formulation-eigen.md](../../docs/mitc4-shell-feast-eigen/formulation-eigen.md) +- [docs/mitc4-shell-feast-eigen/formulation-verification.md](../../docs/mitc4-shell-feast-eigen/formulation-verification.md) +- [docs/mitc4-shell-feast-eigen/formulation-stabilization.md](../../docs/mitc4-shell-feast-eigen/formulation-stabilization.md) +- [docs/mitc4-shell-feast-eigen/numerical-review.md](../../docs/mitc4-shell-feast-eigen/numerical-review.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-evidence.md](../../docs/mitc4-shell-feast-eigen/numerical-review-evidence.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-controls.md](../../docs/mitc4-shell-feast-eigen/numerical-review-controls.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-cases.md](../../docs/mitc4-shell-feast-eigen/numerical-review-cases.md) +- [docs/mitc4-shell-feast-eigen/reference-model.md](../../docs/mitc4-shell-feast-eigen/reference-model.md) +- [docs/mitc4-shell-feast-eigen/io.md](../../docs/mitc4-shell-feast-eigen/io.md) +- [docs/mitc4-shell-feast-eigen/io-input.md](../../docs/mitc4-shell-feast-eigen/io-input.md) +- [docs/mitc4-shell-feast-eigen/io-schema.md](../../docs/mitc4-shell-feast-eigen/io-schema.md) +- [docs/mitc4-shell-feast-eigen/io-mapping.md](../../docs/mitc4-shell-feast-eigen/io-mapping.md) +- [docs/mitc4-shell-feast-eigen/implementation-plan.md](../../docs/mitc4-shell-feast-eigen/implementation-plan.md) +- [docs/mitc4-shell-feast-eigen/implementation-environment.md](../../docs/mitc4-shell-feast-eigen/implementation-environment.md) +- [docs/mitc4-shell-feast-eigen/implementation-interfaces.md](../../docs/mitc4-shell-feast-eigen/implementation-interfaces.md) +- [docs/mitc4-shell-feast-eigen/implementation-verification.md](../../docs/mitc4-shell-feast-eigen/implementation-verification.md) + +추가 필수: [현재 Executor](../../scripts/execute.py), [등록 hooks](../../.codex/hooks.json), +[Stop](../../scripts/hooks/stop_validation.py), [CommandSpec](../../scripts/msvc_harness/models.py), +[process](../../scripts/msvc_harness/process.py), [config](../../scripts/msvc_harness/config.py), +[CMake adapter](../../scripts/msvc_harness/adapters/cmake.py), [HARNESS](../../docs/HARNESS.md), +[WORKFLOW](../../docs/HARNESS_WORKFLOW.md), [환경·activation 상세](../../docs/mitc4-shell-feast-eigen/implementation-environment.md). +현재 config schema에는 timeout option이 없다. 이번에 새 config field를 만들지 않는다. + +## Owned paths + +```json +[ + "scripts/execute.py", + ".codex/hooks.json", + "scripts/hooks/stop_validation.py", + "scripts/msvc_harness/models.py", + "scripts/msvc_harness/process.py", + "tests/test_execute.py", + "tests/test_harness_timeouts.py", + "docs/HARNESS_WORKFLOW.md", + "docs/mitc4-shell-feast-eigen/implementation-prep-evidence.md" +] +``` + +타 owner 변경을 보존한다. `docs/HARNESS_WORKFLOW.md`는 실제 deadline 값의 설명 문단만 수정하고 workflow/approval/Git/Hook 계약을 바꾸지 않는다. + +## RED + +먼저 `tests/test_harness_timeouts.py`를 작성한다. 실제 hook를 수동 실행하지 않고 기존 Python tests 방식으로 clock/subprocess/adapter를 주입한다. + +1. `StepExecutor._invoke_codex`가 기본14400초를 전달함과 실제 TimeoutExpired가 terminal result 없을 때만 최대2번 재시도되는 것을 검사한다. 기존 `tests/test_execute.py`의1800 message 기대값은 승인 default14400으로 갱신하되 explicit injected1800 exception의 actual timeout message는 그대로 구분한다. +2. `stop_validation.run_validations`에서 새 shared deadline7200이 discovery/toolchain/execute_plan까지 같은 deadline으로 전달되는지 검사한다. Hook entry/reentry/doc-only 정책은 기존 tests로 보존한다. +3. `CommandSpec` default7200 및 `execute_plan` 자체 default7200을 검사한다. Fake elapsed2000 뒤 다음 command cap이 remaining5200이고 explicit cap5이면5를 유지하는지, deadline 만료·nonzero subprocess가 계속 failure인지 확인한다. 실제 대기는 하지 않는다. +4. 등록 Stop timeout7500이 shared7200보다 크며 command/matcher/PreToolUse timeout30이 그대로인지 검사한다. Executor14400>registered7500 관계와 finite positive 값을 확인한다. +5. One-time module invocation은 딱 `StepExecutor.CODEX_TIMEOUT_SECONDS`만 유한14400으로 지정하고 unchanged `execute.main()`을 호출한다는 계약을 mock entry로 검사한다. Sandbox modes/default, MAX_TRANSPORT_ATTEMPTS, ownership/preflight/branch/commit/terminal result는 기존 tests를 유지한다. + +```powershell +uv run --with pytest python -B -m pytest -v -rs tests/test_harness_timeouts.py +``` + +Actual nonzero exit와 기존1800 기본값 때문에 실패한 assertions를 기록한다. Import/setup/인증 오류는 RED가 아니다. + +## Minimal GREEN + +변경은 아래 다섯 runtime 설정의 literal default와 필요한 설명에 한정한다. + +| 파일 / symbol | 기존 | 새 값 | +| --- | ---: | ---: | +| scripts/execute.py / StepExecutor.CODEX_TIMEOUT_SECONDS | 1800 | 14400 | +| .codex/hooks.json / Stop command timeout | 1800 | 7500 | +| scripts/hooks/stop_validation.py / TOTAL_TIMEOUT_SECONDS | 1800 | 7200 | +| scripts/msvc_harness/models.py / CommandSpec.timeout_seconds | 1800 | 7200 | +| scripts/msvc_harness/process.py / execute_plan total_timeout_seconds default | 1800 | 7200 | + +`min(command cap, shared remaining)` 알고리즘은 그대로 둔다. 다른 함수·sandbox·transport/Coordinator retry·Hook scope/active flags·ownership/Git/API를 변경하지 않는다. `docs/HARNESS_WORKFLOW.md`의 이전1800 설명은 위 유한 deadline/새 process activation을 정확히 반영한다. Config field/환경변수/새 public CLI timeout option은 만들지 않는다. + +## Focused VERIFY + +```powershell +uv run --with pytest python -B -m pytest -v -rs tests/test_harness_timeouts.py tests/test_execute.py tests/test_execute_ownership.py tests/test_hook_validation_scope.py tests/test_harness_preset_contract.py +``` + +Exit0, failures0, 현재 sandbox/terminal/ownership regressions 보존을 확인한다. PreToolUse/Stop unit tests는 mock 테스트이고 실제 등록 Stop 통과 evidence가 아니다. + +## Full VERIFY + +```powershell +cmake -S . -B .harness/build -A x64 +if ($LASTEXITCODE -ne 0) { throw 'configure failed' } +cmake --build .harness/build --config Debug +if ($LASTEXITCODE -ne 0) { throw 'build failed' } +ctest --test-dir .harness/build -C Debug --show-only=json-v1 +if ($LASTEXITCODE -ne 0) { throw 'discovery failed' } +ctest --test-dir .harness/build -C Debug --output-on-failure +if ($LASTEXITCODE -ne 0) { throw 'full CTest failed' } +uv run --with pytest python -B -m pytest -v -rs +if ($LASTEXITCODE -ne 0) { throw 'full pytest failed' } +``` + +C++는 수정하지 않는다. 기존 same-binary cache를 쓰는 helper와 항상 fresh solver를 호출하는 nonlinear helper를 구별한다. 모든 full CTest를 실제 실행하고 완결 count/exit/duration을 기록한다. Cached outputs를 이번 eigen 신규 검증이라고 부르지 않는다. 등록 Stop도 정상 수행하며 full VERIFY를 생략/분할 성공으로 대체하지 않는다. + +현재 prep Executor와 Codex의 activation 경계는 [environment](../../docs/mitc4-shell-feast-eigen/implementation-environment.md)대로다. 이미 실행 중인 Executor timeout self-edit는 활성화되지 않으며 launch-time Stop outer1800이 유지될 수 있다. 성공을 가정하지 말고 actual registered Stop·Codex exit0을 gate로 확인한다. 등록 Stop 초과/실패 시 정상 terminal evidence와 원시 로그를 보존해 Coordinator에 반환한다. Hook 직접 실행, 재진입 flag/state 조작, 거짓 Markdown-only skip으로 우회하지 않는다. + +## Evidence / result + +`docs/mitc4-shell-feast-eigen/implementation-prep-evidence.md`에 feature/owner/r2, 각 RED/GREEN command/exit/duration, 전체 pytest/CTest counts, cap before/after, 실제 code diff 범위, current loaded wrapper14400과 등록 Stop launch1800 가능성, 그 시점에 관찰된 Stop/Codex exit 또는 아직 확인 대기인 항목을 기록한다. Raw logs는 ignored `.harness/build/mitc4-eigen-evidence/prep/`다. CTest log는 즉시 복사 보존한다. + + +보고서 작성 시점에는 마지막 registered Stop/Codex exit가 아직 발생하지 않을 수 있다. Implementation은 실제 완료된 manual 검증과 미관찰 Stop을 구분하고 미래 성공을 선기록하지 않는다. `completed` payload는 그 자체로 Stop 성공 증거가 아니다. Executor 종료 뒤 Coordinator가 raw output·등록 Hook evidence·actual exit를 management 문서에서 사후 감사한다. Specialist 보고서 본문은 Coordinator가 대신 수정하지 않는다. + +이 Step의 manual AC가 통과하면 현재 phase index Step0의 `completed/summary`만 기록한다. 실패는 `error/error_message` 또는 `blocked/blocked_reason`이며 attempt_history/timestamps/다른Step/top index는 건드리지 않는다. 최종 phase commit/branch/checkpoint는 Executor가 수행한다. 마지막 응답은 common envelope다. Main invocation은 prep Executor의 실제 종료·completed·registered Stop 성공·actual Codex exit0·code/control commit·clean 및 Coordinator 사후 감사 완료 후 Coordinator가 새 process로 시작한다. diff --git a/phases/mitc4-shell-feast-eigen/index.json b/phases/mitc4-shell-feast-eigen/index.json new file mode 100644 index 0000000..274316a --- /dev/null +++ b/phases/mitc4-shell-feast-eigen/index.json @@ -0,0 +1,181 @@ +{ + "project": "FESA Structural Solver", + "phase": "mitc4-shell-feast-eigen", + "steps": [ + { + "step": 0, + "name": "frequency-model-and-input", + "status": "pending", + "owned_paths": [ + "include/fesa/model/model_types.h", + "include/fesa/model/frequency_step.h", + "src/fesa/model/frequency_step.cpp", + "include/fesa/model/domain.h", + "src/fesa/model/domain.cpp", + "include/fesa/analysis/analysis_model.h", + "src/fesa/analysis/analysis_model.cpp", + "src/fesa/fem/dof_manager.cpp", + "tests/unit/model/model_types_test.cpp", + "tests/unit/model/frequency_step_test.cpp", + "tests/unit/model/domain_test.cpp", + "tests/unit/analysis/analysis_model_test.cpp", + "tests/unit/fem/dof_manager_test.cpp", + "src/fesa/CMakeLists.txt", + "tests/CMakeLists.txt", + "include/fesa/io/abaqus/input_syntax.h", + "src/fesa/io/abaqus/input_reader.cpp", + "src/fesa/io/abaqus/domain_mapping_context.h", + "src/fesa/io/abaqus/domain_mapping_context.cpp", + "tests/unit/io/abaqus/input_syntax_test.cpp", + "tests/unit/io/abaqus/input_reader_test.cpp", + "tests/unit/io/abaqus/domain_mapping_context_test.cpp", + "tests/unit/io/abaqus/frequency_domain_test.cpp", + "docs/mitc4-shell-feast-eigen/implementation-step0-evidence.md" + ] + }, + { + "step": 1, + "name": "covariant-drilling-stabilization", + "status": "pending", + "owned_paths": [ + "src/fesa/elements/mitc4_drilling_scale.h", + "src/fesa/elements/mitc4_drilling_scale.cpp", + "src/fesa/elements/mitc4_shell.cpp", + "tests/unit/elements/mitc4_drilling_scale_test.cpp", + "tests/unit/elements/mitc4_shell_test.cpp", + "tests/unit/elements/nonlinear_mitc4_shell_test.cpp", + "tests/unit/elements/nonlinear_mitc4_shell_tangent_test.cpp", + "tests/integration/analysis/mitc4_covariance_test.cpp", + "src/fesa/CMakeLists.txt", + "tests/CMakeLists.txt", + "docs/mitc4-shell-feast-eigen/implementation-step1-evidence.md" + ] + }, + { + "step": 2, + "name": "consistent-and-lumped-mass", + "status": "pending", + "owned_paths": [ + "include/fesa/elements/mitc4_shell.h", + "src/fesa/elements/mitc4_shell_mass.cpp", + "tests/unit/elements/mitc4_shell_test.cpp", + "tests/unit/elements/mitc4_shell_mass_test.cpp", + "src/fesa/CMakeLists.txt", + "tests/CMakeLists.txt", + "include/fesa/elements/element_factory.h", + "src/fesa/elements/element_factory.cpp", + "include/fesa/assembly/shell_mass_assembler.h", + "src/fesa/assembly/shell_mass_assembler.cpp", + "tests/unit/elements/element_factory_test.cpp", + "tests/unit/assembly/shell_mass_assembler_test.cpp", + "docs/mitc4-shell-feast-eigen/implementation-step2-evidence.md" + ] + }, + { + "step": 3, + "name": "constrained-mass-reduction", + "status": "pending", + "owned_paths": [ + "include/fesa/fem/dof_manager.h", + "src/fesa/fem/dof_manager.cpp", + "src/fesa/analysis/eigen_reduction.h", + "src/fesa/analysis/eigen_reduction.cpp", + "tests/unit/fem/dof_manager_test.cpp", + "tests/unit/analysis/eigen_reduction_test.cpp", + "src/fesa/CMakeLists.txt", + "tests/CMakeLists.txt", + "docs/mitc4-shell-feast-eigen/implementation-step3-evidence.md" + ] + }, + { + "step": 4, + "name": "feast-lowest-mode-solver", + "status": "pending", + "owned_paths": [ + "src/fesa/solvers/eigen/feast_backend.h", + "src/fesa/solvers/eigen/feast_backend.cpp", + "src/fesa/solvers/eigen/feast_initial_space.h", + "src/fesa/solvers/eigen/feast_initial_space.cpp", + "tests/unit/solvers/eigen/feast_backend_test.cpp", + "tests/unit/solvers/eigen/feast_initial_space_test.cpp", + "src/fesa/CMakeLists.txt", + "tests/CMakeLists.txt", + "include/fesa/solvers/eigen/eigen_solver.h", + "include/fesa/solvers/eigen/mkl_feast_eigen_solver.h", + "src/fesa/solvers/eigen/mkl_feast_eigen_solver.cpp", + "src/fesa/solvers/eigen/feast_search.h", + "src/fesa/solvers/eigen/feast_search.cpp", + "tests/unit/solvers/eigen/eigen_solver_test.cpp", + "tests/unit/solvers/eigen/mkl_feast_eigen_solver_test.cpp", + "tests/unit/solvers/eigen/feast_search_test.cpp", + "docs/mitc4-shell-feast-eigen/implementation-step4-evidence.md" + ] + }, + { + "step": 5, + "name": "validated-frequency-procedure", + "status": "pending", + "owned_paths": [ + "include/fesa/analysis/eigen_analysis_state.h", + "src/fesa/analysis/eigen_analysis_state.cpp", + "src/fesa/analysis/eigen_validation.h", + "src/fesa/analysis/eigen_validation.cpp", + "tests/unit/analysis/eigen_analysis_state_test.cpp", + "tests/unit/analysis/eigen_validation_test.cpp", + "src/fesa/CMakeLists.txt", + "tests/CMakeLists.txt", + "include/fesa/analysis/linear_frequency_procedure.h", + "src/fesa/analysis/linear_frequency_procedure.cpp", + "tests/integration/analysis/linear_frequency_procedure_test.cpp", + "docs/mitc4-shell-feast-eigen/implementation-step5-evidence.md" + ] + }, + { + "step": 6, + "name": "eigen-output-transaction", + "status": "pending", + "owned_paths": [ + "include/fesa/results/eigen_results_writer.h", + "include/fesa/io/hdf5/eigen_hdf5_results_writer.h", + "src/fesa/io/hdf5/eigen_hdf5_results_writer.cpp", + "src/fesa/io/hdf5/eigen_hdf5_schema.h", + "src/fesa/io/hdf5/eigen_hdf5_schema.cpp", + "src/fesa/io/hdf5/hdf5_model_writer.h", + "src/fesa/io/hdf5/hdf5_model_writer.cpp", + "tests/unit/results/eigen_results_writer_test.cpp", + "tests/unit/io/hdf5/eigen_hdf5_results_writer_test.cpp", + "tests/unit/io/hdf5/eigen_hdf5_schema_test.cpp", + "tests/unit/io/hdf5/hdf5_model_writer_test.cpp", + "src/fesa/CMakeLists.txt", + "tests/CMakeLists.txt", + "include/fesa/analysis/prepared_analysis.h", + "src/fesa/analysis/prepared_analysis.cpp", + "src/fesa/app/fesa_application.cpp", + "tests/unit/analysis/prepared_analysis_test.cpp", + "tests/integration/app/fesa_application_test.cpp", + "tests/integration/app/frequency_application_test.cpp", + "tests/integration/analysis/linear_frequency_procedure_test.cpp", + "docs/mitc4-shell-feast-eigen/implementation-step6-evidence.md" + ] + }, + { + "step": 7, + "name": "fresh-reference-and-evidence", + "status": "pending", + "owned_paths": [ + "tests/reference/eigen_reference_comparison.h", + "tests/reference/eigen_reference_comparison.cpp", + "tests/reference/eigen_reference_comparison_test.cpp", + "tests/CMakeLists.txt", + "tests/reference/eigen_reference_cases_test.cpp", + "tests/reference/mitc4_eigen_static_regression_test.cpp", + "tests/integration/analysis/linear_frequency_procedure_test.cpp", + "docs/mitc4-shell-feast-eigen/implementation-report.md", + "docs/mitc4-shell-feast-eigen/build-test.md", + "docs/mitc4-shell-feast-eigen/reference-comparison.md", + "docs/mitc4-shell-feast-eigen/reference-comparison-detail.md", + "docs/mitc4-shell-feast-eigen/implementation-step7-evidence.md" + ] + } + ] +} diff --git a/phases/mitc4-shell-feast-eigen/step0.md b/phases/mitc4-shell-feast-eigen/step0.md new file mode 100644 index 0000000..56c796f --- /dev/null +++ b/phases/mitc4-shell-feast-eigen/step0.md @@ -0,0 +1,169 @@ +# Step 0: Frequency semantic model과 exact 입력 subset + +- Feature ID: `mitc4-shell-feast-eigen` +- Plan owner: `implementation-planning-agent` +- Execution owner: `implementation-agent` +- Input contract revision: `r2` +- Phase: `mitc4-shell-feast-eigen` +- Dependency: execution-prep의 실제 completed·registered Stop 성공 및 새 main invocation +- Requirement IDs: `FEM-REQ-MITC4-EIGEN-001`, `FEM-REQ-MITC4-EIGEN-002`, `FEM-REQ-MITC4-EIGEN-003`, `FEM-REQ-MITC4-EIGEN-004`, `FEM-REQ-MITC4-EIGEN-007`, `FEM-REQ-MITC4-EIGEN-009`, `FEM-REQ-MITC4-EIGEN-015`, `FEM-REQ-MITC4-EIGEN-016`, `FEM-REQ-MITC4-EIGEN-018`, `FEM-REQ-MITC4-EIGEN-024` +- Logical cases: `MFE-C06`, `MFE-C07`, `MFE-C13`, `MFE-C23`, `MFE-C26` +- I/O obligations: `IO-T01`, `IO-T02`, `IO-T03`, `IO-T04`, `IO-T10` + +## 필수 입력과 계약 + +Feature 폴더는 `docs/mitc4-shell-feast-eigen/`다. 아래 current r2 입력을 읽고 기존 완료 Step 코드와 evidence를 대조한다. 연결된 upstream contract는 read-only다. + +- [AGENTS.md](../../AGENTS.md) +- [docs/SOLVER_AGENT_DESIGN.md](../../docs/SOLVER_AGENT_DESIGN.md) +- [docs/FEATURE_DOCUMENTATION.md](../../docs/FEATURE_DOCUMENTATION.md) +- [docs/PRD.md](../../docs/PRD.md) +- [docs/ARCHITECTURE.md](../../docs/ARCHITECTURE.md) +- [docs/ADR.md](../../docs/ADR.md) +- [docs/CODINGSTYLE.md](../../docs/CODINGSTYLE.md) +- [docs/TOLERANCE.md](../../docs/TOLERANCE.md) +- [.codex/skills/fem-implementation-tdd/SKILL.md](../../.codex/skills/fem-implementation-tdd/SKILL.md) +- [.agents/skills/harness/SKILL.md](../../.agents/skills/harness/SKILL.md) +- [.codex/agents/implementation-agent.toml](../../.codex/agents/implementation-agent.toml) +- [docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md](../../docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md) +- [docs/mitc4-shell-feast-eigen/PRD.md](../../docs/mitc4-shell-feast-eigen/PRD.md) +- [docs/mitc4-shell-feast-eigen/ADR.md](../../docs/mitc4-shell-feast-eigen/ADR.md) +- [docs/mitc4-shell-feast-eigen/coordination.md](../../docs/mitc4-shell-feast-eigen/coordination.md) +- [docs/mitc4-shell-feast-eigen/requirements.md](../../docs/mitc4-shell-feast-eigen/requirements.md) +- [docs/mitc4-shell-feast-eigen/requirements-evidence.md](../../docs/mitc4-shell-feast-eigen/requirements-evidence.md) +- [docs/mitc4-shell-feast-eigen/research.md](../../docs/mitc4-shell-feast-eigen/research.md) +- [docs/mitc4-shell-feast-eigen/research-evidence.md](../../docs/mitc4-shell-feast-eigen/research-evidence.md) +- [docs/mitc4-shell-feast-eigen/formulation.md](../../docs/mitc4-shell-feast-eigen/formulation.md) +- [docs/mitc4-shell-feast-eigen/formulation-mass.md](../../docs/mitc4-shell-feast-eigen/formulation-mass.md) +- [docs/mitc4-shell-feast-eigen/formulation-eigen.md](../../docs/mitc4-shell-feast-eigen/formulation-eigen.md) +- [docs/mitc4-shell-feast-eigen/formulation-verification.md](../../docs/mitc4-shell-feast-eigen/formulation-verification.md) +- [docs/mitc4-shell-feast-eigen/formulation-stabilization.md](../../docs/mitc4-shell-feast-eigen/formulation-stabilization.md) +- [docs/mitc4-shell-feast-eigen/numerical-review.md](../../docs/mitc4-shell-feast-eigen/numerical-review.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-evidence.md](../../docs/mitc4-shell-feast-eigen/numerical-review-evidence.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-controls.md](../../docs/mitc4-shell-feast-eigen/numerical-review-controls.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-cases.md](../../docs/mitc4-shell-feast-eigen/numerical-review-cases.md) +- [docs/mitc4-shell-feast-eigen/reference-model.md](../../docs/mitc4-shell-feast-eigen/reference-model.md) +- [docs/mitc4-shell-feast-eigen/io.md](../../docs/mitc4-shell-feast-eigen/io.md) +- [docs/mitc4-shell-feast-eigen/io-input.md](../../docs/mitc4-shell-feast-eigen/io-input.md) +- [docs/mitc4-shell-feast-eigen/io-schema.md](../../docs/mitc4-shell-feast-eigen/io-schema.md) +- [docs/mitc4-shell-feast-eigen/io-mapping.md](../../docs/mitc4-shell-feast-eigen/io-mapping.md) +- [docs/mitc4-shell-feast-eigen/implementation-plan.md](../../docs/mitc4-shell-feast-eigen/implementation-plan.md) +- [docs/mitc4-shell-feast-eigen/implementation-environment.md](../../docs/mitc4-shell-feast-eigen/implementation-environment.md) +- [docs/mitc4-shell-feast-eigen/implementation-interfaces.md](../../docs/mitc4-shell-feast-eigen/implementation-interfaces.md) +- [docs/mitc4-shell-feast-eigen/implementation-verification.md](../../docs/mitc4-shell-feast-eigen/implementation-verification.md) + +이 Step의 직접 계약: [io-input.md#i3-density-material-mapping](../../docs/mitc4-shell-feast-eigen/io-input.md#i3-density-material-mapping), [io-mapping.md#m1-input에서-equationresult까지](../../docs/mitc4-shell-feast-eigen/io-mapping.md#m1-input에서-equationresult까지), [formulation-eigen.md#e1-조립-단위-scaling과-실제-global-제약](../../docs/mitc4-shell-feast-eigen/formulation-eigen.md#e1-조립-단위-scaling과-실제-global-제약), [io-input.md](../../docs/mitc4-shell-feast-eigen/io-input.md), [io-schema.md#o2-metadata-모델과-source-요청](../../docs/mitc4-shell-feast-eigen/io-schema.md#o2-metadata-모델과-source-요청), [io-mapping.md#m5-구현test-obligations와-requirement-연결](../../docs/mitc4-shell-feast-eigen/io-mapping.md#m5-구현test-obligations와-requirement-연결). +논리 case의 전체 parameter/threshold/음성 inventory는 NR 원문과 [verification mapping](../../docs/mitc4-shell-feast-eigen/implementation-verification.md)을 함께 적용한다. + +## Owned paths + +다음 목록은 phase index `owned_paths`와 exact equality를 유지한다. 목록 밖 파일이 필요하면 보존하고 Coordinator에 반환한다. 다른 agent도 같은 worktree를 사용하므로 타인 변경을 되돌리지 않는다. + +```json +[ + "include/fesa/model/model_types.h", + "include/fesa/model/frequency_step.h", + "src/fesa/model/frequency_step.cpp", + "include/fesa/model/domain.h", + "src/fesa/model/domain.cpp", + "include/fesa/analysis/analysis_model.h", + "src/fesa/analysis/analysis_model.cpp", + "src/fesa/fem/dof_manager.cpp", + "tests/unit/model/model_types_test.cpp", + "tests/unit/model/frequency_step_test.cpp", + "tests/unit/model/domain_test.cpp", + "tests/unit/analysis/analysis_model_test.cpp", + "tests/unit/fem/dof_manager_test.cpp", + "src/fesa/CMakeLists.txt", + "tests/CMakeLists.txt", + "include/fesa/io/abaqus/input_syntax.h", + "src/fesa/io/abaqus/input_reader.cpp", + "src/fesa/io/abaqus/domain_mapping_context.h", + "src/fesa/io/abaqus/domain_mapping_context.cpp", + "tests/unit/io/abaqus/input_syntax_test.cpp", + "tests/unit/io/abaqus/input_reader_test.cpp", + "tests/unit/io/abaqus/domain_mapping_context_test.cpp", + "tests/unit/io/abaqus/frequency_domain_test.cpp", + "docs/mitc4-shell-feast-eigen/implementation-step0-evidence.md" +] +``` + +## 같은 session의 behavior별 TDD + +각 소단위는 아래 순서로 RED→observed failure→minimal GREEN→focused VERIFY를 완료한다. 마지막 소단위 뒤 full VERIFY를 한 번 수행하고 등록 Stop의 정상 전체검증도 받는다. Missing API의 정확한 compile/link failure는 RED일 수 있으나 configure/dependency 오류는 RED가 아니다. 이미 통과한 test를 새 RED라고 보고하지 않는다. + +### 1. Density 정의, frequency step과 non-owning 실행 view + +Symbols: `DensityDefinition, FrequencyStepDefinition, FrequencyStep; Domain::FrequencySteps/Densities; AnalysisModel::IsFrequency/GetFrequencyStep/BoundaryConditions/StepLocation; DofManager::Build/Create`. + +**RED:** ModelTypes/Domain/AnalysisModel/DofManager tests에 두 material의 서로 다른 rho·t와 frequency-only ModelDefinition을 만든다. FrequencyStep에 요청 N/source options/BC를 보존하고 view의 주소가 Domain storage와 같은지 검사한다. 현재 타입/API 부재의 compile failure 또는 exactly-one-static-step 거부를 관찰한다. Missing/zero/negative/nonfinite active density, multiple/static+frequency step, ambiguous source BC를 각각 거부하고 기존 density 없는 static fixture는 유지한다. + +**Minimal GREEN:** Density는 material identity에 연결된 Domain-owned composition record로 저장한다. Material base에 가짜 기본 density/no-op capability를 추가하지 않는다. 기존 StaticStepDefinition/StepDefinition API를 유지하면서 별도 FrequencyStep을 소유한다. AnalysisModel은 sole active procedure에 대한 boundary/location view를 제공하고 DofManager의 Step() 직접 접근만 해당 공통 view로 바꾼다. Static legacy constructors/loads/0x0 Kff 의미는 유지한다. Parser·solver·writer는 다음 단계이며 아직 CLI frequency 지원을 주장하지 않는다. + +**Focused VERIFY:** 아래 regex 중 해당 suite를 먼저 discovery하여 tests>0을 확인하고 같은 test를 재실행한다. Exact exit와 실패 이유를 behavior별로 기록한다. + +### 2. Density/FREQUENCY exact parser와 원문 보존 + +Symbols: `DataLine::original_line; AbaqusInputReader::Read; DomainMappingContext::Impl/ParseSyntax/FinalizeMaterialProperties/FinalizeStep/Commit`. + +**RED:** 기존 InputSyntax/InputReader에 spaces·빈 slot·CRLF를 포함한 원 data line 보존 기대값을 먼저 추가한다. FrequencyDomain tests는 원본 input 그대로 729/676/104 nodes/elements/boundary, Step-2/N10, rho2700/t0.5와 exact warnings/source records를 검사하여 현재 FREQUENCY/DENSITY 거부를 관찰한다. 테스트 fixture 안에서만 S4R 변경, density/step/option/field/BC/no-op scope별 양성·음성 입력을 만든다. + +**Minimal GREEN:** I1~I6의 exact allowlist를 기존 private context의 parse/finalize 책임에 통합한다. 물리 data line 원문을 보존하고 numeric label/lexical identity는 재사용한다. Density의 rho 또는 rho, 한 row만 허용; N은 1~7 fields 첫 양의 checked int64, 나머지 blank. Explicit SIM/acoustic와 source Lanczos의 stable warning을 보존한다. Active density 검사와 source location/category를 연결한다. Static Density subset은 확대하지 않는다. + +**Focused VERIFY:** 아래 regex 중 해당 suite를 먼저 discovery하여 tests>0을 확인하고 같은 test를 재실행한다. Exact exit와 실패 이유를 behavior별로 기록한다. + +## Focused 명령 + +Workspace root의 PowerShell에서 실행한다. 초기 missing API RED라면 build의 expected failure를 기록하고 production 구현 후 같은 명령을 다시 실행한다. + +```powershell +cmake -S . -B .harness/build -A x64 +cmake --build .harness/build --config Debug --target fesa_tests +ctest --test-dir .harness/build -C Debug -R '^(ModelTypes|FrequencyStep|Domain|AnalysisModel|DofManager|InputSyntax|InputReader|DomainMappingContext|FrequencyDomain|DomainMapper|ShellSurfacePressureDomain)\.' --show-only=json-v1 +ctest --test-dir .harness/build -C Debug -R '^(ModelTypes|FrequencyStep|Domain|AnalysisModel|DofManager|InputSyntax|InputReader|DomainMappingContext|FrequencyDomain|DomainMapper|ShellSurfacePressureDomain)\.' --output-on-failure +``` + +Configure exit는 항상0이어야 한다. GREEN에서는 위 모든 exit0, discovered selected tests>0, failures0이어야 한다. 각 호출의 `$LASTEXITCODE`를 즉시 기록하고 실패 뒤 후속 명령으로 덮어쓰지 않는다. + + +### 필수 신규 test discovery inventory + +- `FrequencyStep.MfeC23SemanticOwnership` +- `FrequencyDomain.MfeC07DensityFailures` +- `FrequencyDomain.MfeC23ExactReferenceSubset` + +위 이름 모두를 focused 및 full discovery JSON의 `tests[].name`에서 확인한다. Parameterized 전개가 필요하면 원 obligation→실제 discovered 이름을 evidence에 명시하고 모든 전개 case를 실행한다. 단지 selected count>0이거나 기존 suite만 존재하는 것은 실패다. V2의 해당 독립 oracle/mutation과 이 Step의 behavior assertions를 실제 구현해 각 결과를 기록한다. + +## Full VERIFY + +현재 실제 backend는 config absent→CMake/Visual Studio 18 2026/x64/`.harness/build`/Debug다. Dependency cache 준비는 [environment](../../docs/mitc4-shell-feast-eigen/implementation-environment.md)의 정확한 명령과 preflight를 따른다. Generator 변경이나 preset fallback을 임의로 하지 않는다. + +```powershell +cmake -S . -B .harness/build -A x64 +if ($LASTEXITCODE -ne 0) { throw 'configure failed' } +cmake --build .harness/build --config Debug +if ($LASTEXITCODE -ne 0) { throw 'build failed' } +ctest --test-dir .harness/build -C Debug --show-only=json-v1 +if ($LASTEXITCODE -ne 0) { throw 'discovery failed' } +ctest --test-dir .harness/build -C Debug --output-on-failure +if ($LASTEXITCODE -ne 0) { throw 'full CTest failed' } +uv run --with pytest python -B -m pytest -v -rs +if ($LASTEXITCODE -ne 0) { throw 'full pytest failed' } +``` + +전체 discovery의 test count와 실제 실행 count를 대조하고 skipped/missing/unobserved를 성공으로 합치지 않는다. 기존 target의 `/W4 /WX`를 유지하고 새 compiler/link warning0을 확인한다. 등록 Stop의 전체 검증은 그대로 수행되며 수동 hook 실행·state/reentry 조작으로 대체하지 않는다. Step 0에서 영향받는 C++ binary가 바뀌면 기존 reference helper의 cache 재사용 여부와 실제 solve 호출을 구분한다. 최종 fresh portfolio의 권위는 Step 7이다. + +## Evidence와 종료 + +- `docs/mitc4-shell-feast-eigen/implementation-step0-evidence.md` + +이 Step의 evidence에는 Feature/owner/r2, exact owned changed paths, RED→GREEN 명령·actual exits·기간·핵심 수치, focused/full counts, MSVC/x64/Debug/dependency/runtime selection, warning 수, upstream case/requirement 연결, 미실행 및 residual risk를 기록한다. Raw logs는 Git ignored `.harness/build/mitc4-eigen-evidence/step0/`에 보존한다. 각 CTest 호출 직후 해당 `Testing/Temporary/LastTest.log`를 고유 RED/focused/full 이름으로 복사하여 이후 Stop 로그와 섞지 않는다. Binary/reference/result hash와 run freshness는 적용되는 경우 기록한다. + + +보고서 작성 시점에는 마지막 registered Stop/Codex exit가 아직 발생하지 않을 수 있다. Implementation은 실제 완료된 manual 검증과 미관찰 Stop을 구분하고 미래 성공을 선기록하지 않는다. `completed` payload는 그 자체로 Stop 성공 증거가 아니다. Executor 종료 뒤 Coordinator가 raw output·등록 Hook evidence·actual exit를 management 문서에서 사후 감사한다. Specialist 보고서 본문은 Coordinator가 대신 수정하지 않는다. + +Manual AC가 성공하면 Executor가 허용한 `phases/mitc4-shell-feast-eigen/index.json`의 **현재 Step 0만** `status=completed`와 비어 있지 않은 `summary`를 기록한다. 구현/검증 실패는 `error/error_message`, 환경·필수 준비 차단은 `blocked/blocked_reason`이다. `owned_paths`, 이름/번호, 다른 Step/top index, timestamp, attempt_history는 수정하지 않는다. `step0-output.json`은 Executor 생성 기록이며 ignored 상태를 유지한다. 마지막 응답은 공통 handoff envelope다. Phase 전체 또는 workflow gate의 자기 승인은 하지 않는다. + +## 제외와 중단 조건 + +Physics/formulation/I/O/tolerance/원본 reference·기존 feature 보고서 변경, 외부 solver, spectrum fitting, eigen 외부 vector/frequency/stress gate, sparse rank cutoff, sandbox 확대, retry-budget 변경, Git branch/commit/push/tag/release는 소유 범위 밖이다. 명백한 구현 결함은 이 exact scope 안에서 최소 수정한다. 계약 결함은 정확한 owner로 `return-upstream`, 실행 환경 실패는 actual command/exit와 함께 Coordinator로 반환한다. 동일 실패를 transport timeout으로 가장하거나 evidence를 지우고 재실행하지 않는다. diff --git a/phases/mitc4-shell-feast-eigen/step1.md b/phases/mitc4-shell-feast-eigen/step1.md new file mode 100644 index 0000000..17caaab --- /dev/null +++ b/phases/mitc4-shell-feast-eigen/step1.md @@ -0,0 +1,147 @@ +# Step 1: 공변 drilling scale과 정적 회귀 + +- Feature ID: `mitc4-shell-feast-eigen` +- Plan owner: `implementation-planning-agent` +- Execution owner: `implementation-agent` +- Input contract revision: `r2` +- Phase: `mitc4-shell-feast-eigen` +- Dependency: 동일 phase의 Step 0 completed +- Requirement IDs: `FEM-REQ-MITC4-EIGEN-002`, `FEM-REQ-MITC4-EIGEN-014`, `FEM-REQ-MITC4-EIGEN-023`, `FEM-REQ-MITC4-EIGEN-024`, `FEM-REQ-MITC4-EIGEN-027` +- Logical cases: `MFE-C08`, `MFE-C09`, `MFE-C10`, `MFE-C11`, `MFE-C12`, `MFE-C26` +- I/O obligations: `IO-T10` + +## 필수 입력과 계약 + +Feature 폴더는 `docs/mitc4-shell-feast-eigen/`다. 아래 current r2 입력을 읽고 기존 완료 Step 코드와 evidence를 대조한다. 연결된 upstream contract는 read-only다. + +- [AGENTS.md](../../AGENTS.md) +- [docs/SOLVER_AGENT_DESIGN.md](../../docs/SOLVER_AGENT_DESIGN.md) +- [docs/FEATURE_DOCUMENTATION.md](../../docs/FEATURE_DOCUMENTATION.md) +- [docs/PRD.md](../../docs/PRD.md) +- [docs/ARCHITECTURE.md](../../docs/ARCHITECTURE.md) +- [docs/ADR.md](../../docs/ADR.md) +- [docs/CODINGSTYLE.md](../../docs/CODINGSTYLE.md) +- [docs/TOLERANCE.md](../../docs/TOLERANCE.md) +- [.codex/skills/fem-implementation-tdd/SKILL.md](../../.codex/skills/fem-implementation-tdd/SKILL.md) +- [.agents/skills/harness/SKILL.md](../../.agents/skills/harness/SKILL.md) +- [.codex/agents/implementation-agent.toml](../../.codex/agents/implementation-agent.toml) +- [docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md](../../docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md) +- [docs/mitc4-shell-feast-eigen/PRD.md](../../docs/mitc4-shell-feast-eigen/PRD.md) +- [docs/mitc4-shell-feast-eigen/ADR.md](../../docs/mitc4-shell-feast-eigen/ADR.md) +- [docs/mitc4-shell-feast-eigen/coordination.md](../../docs/mitc4-shell-feast-eigen/coordination.md) +- [docs/mitc4-shell-feast-eigen/requirements.md](../../docs/mitc4-shell-feast-eigen/requirements.md) +- [docs/mitc4-shell-feast-eigen/requirements-evidence.md](../../docs/mitc4-shell-feast-eigen/requirements-evidence.md) +- [docs/mitc4-shell-feast-eigen/research.md](../../docs/mitc4-shell-feast-eigen/research.md) +- [docs/mitc4-shell-feast-eigen/research-evidence.md](../../docs/mitc4-shell-feast-eigen/research-evidence.md) +- [docs/mitc4-shell-feast-eigen/formulation.md](../../docs/mitc4-shell-feast-eigen/formulation.md) +- [docs/mitc4-shell-feast-eigen/formulation-mass.md](../../docs/mitc4-shell-feast-eigen/formulation-mass.md) +- [docs/mitc4-shell-feast-eigen/formulation-eigen.md](../../docs/mitc4-shell-feast-eigen/formulation-eigen.md) +- [docs/mitc4-shell-feast-eigen/formulation-verification.md](../../docs/mitc4-shell-feast-eigen/formulation-verification.md) +- [docs/mitc4-shell-feast-eigen/formulation-stabilization.md](../../docs/mitc4-shell-feast-eigen/formulation-stabilization.md) +- [docs/mitc4-shell-feast-eigen/numerical-review.md](../../docs/mitc4-shell-feast-eigen/numerical-review.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-evidence.md](../../docs/mitc4-shell-feast-eigen/numerical-review-evidence.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-controls.md](../../docs/mitc4-shell-feast-eigen/numerical-review-controls.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-cases.md](../../docs/mitc4-shell-feast-eigen/numerical-review-cases.md) +- [docs/mitc4-shell-feast-eigen/reference-model.md](../../docs/mitc4-shell-feast-eigen/reference-model.md) +- [docs/mitc4-shell-feast-eigen/io.md](../../docs/mitc4-shell-feast-eigen/io.md) +- [docs/mitc4-shell-feast-eigen/io-input.md](../../docs/mitc4-shell-feast-eigen/io-input.md) +- [docs/mitc4-shell-feast-eigen/io-schema.md](../../docs/mitc4-shell-feast-eigen/io-schema.md) +- [docs/mitc4-shell-feast-eigen/io-mapping.md](../../docs/mitc4-shell-feast-eigen/io-mapping.md) +- [docs/mitc4-shell-feast-eigen/implementation-plan.md](../../docs/mitc4-shell-feast-eigen/implementation-plan.md) +- [docs/mitc4-shell-feast-eigen/implementation-environment.md](../../docs/mitc4-shell-feast-eigen/implementation-environment.md) +- [docs/mitc4-shell-feast-eigen/implementation-interfaces.md](../../docs/mitc4-shell-feast-eigen/implementation-interfaces.md) +- [docs/mitc4-shell-feast-eigen/implementation-verification.md](../../docs/mitc4-shell-feast-eigen/implementation-verification.md) + +이 Step의 직접 계약: [formulation-stabilization.md](../../docs/mitc4-shell-feast-eigen/formulation-stabilization.md), [numerical-review-evidence.md#nr-mfe-001-직접-계산-반례](../../docs/mitc4-shell-feast-eigen/numerical-review-evidence.md#nr-mfe-001-직접-계산-반례), [numerical-review-controls.md#c7-승인된-정적-회귀-기준](../../docs/mitc4-shell-feast-eigen/numerical-review-controls.md#c7-승인된-정적-회귀-기준). +논리 case의 전체 parameter/threshold/음성 inventory는 NR 원문과 [verification mapping](../../docs/mitc4-shell-feast-eigen/implementation-verification.md)을 함께 적용한다. + +## Owned paths + +다음 목록은 phase index `owned_paths`와 exact equality를 유지한다. 목록 밖 파일이 필요하면 보존하고 Coordinator에 반환한다. 다른 agent도 같은 worktree를 사용하므로 타인 변경을 되돌리지 않는다. + +```json +[ + "src/fesa/elements/mitc4_drilling_scale.h", + "src/fesa/elements/mitc4_drilling_scale.cpp", + "src/fesa/elements/mitc4_shell.cpp", + "tests/unit/elements/mitc4_drilling_scale_test.cpp", + "tests/unit/elements/mitc4_shell_test.cpp", + "tests/unit/elements/nonlinear_mitc4_shell_test.cpp", + "tests/unit/elements/nonlinear_mitc4_shell_tangent_test.cpp", + "tests/integration/analysis/mitc4_covariance_test.cpp", + "src/fesa/CMakeLists.txt", + "tests/CMakeLists.txt", + "docs/mitc4-shell-feast-eigen/implementation-step1-evidence.md" +] +``` + +## 같은 session의 behavior별 TDD + +각 소단위는 아래 순서로 RED→observed failure→minimal GREEN→focused VERIFY를 완료한다. 마지막 소단위 뒤 full VERIFY를 한 번 수행하고 등록 Stop의 정상 전체검증도 받는다. Missing API의 정확한 compile/link failure는 RED일 수 있으나 configure/dependency 오류는 RED가 아니다. 이미 통과한 test를 새 RED라고 보고하지 않는다. + +### 1. 공변적인 초기 rotary trace scale과 기존 정적 회귀 + +Symbols: `mitc4_internal::ComputeDrillingScale; Mitc4Shell::Stiffness; existing NonlinearMitc4Shell::Create/Evaluate`. + +**RED:** NR-MFE-001 원 rectangle와 Z45 회전에서 complete K를 각각 재계산해 kd=19/4800, Kff=10369/7500, static thetaZ=7500/10369 및 full reaction covariance를 기대한다. 현재 min(R+)는 실패해야 한다. Inventory [0,0,2,4,0,6,0,4]→kref2, allzero/negative/NaN/Inf/DBL_MAX/subnormal cases를 별도 test로 고정한다. C12에서는 기존 nonlinear gamma의 directional schedule/objectivity와 초기 kd 고정을 검사한다. + +**Minimal GREEN:** S1/S2의 여덟 rotary 대각 전체를 fixed order로 scaled mean하고 1e-3을 곱하는 private helper를 도입하여 기존 min 계산만 교체한다. 기존 test의 old min/old kd literal 기대 부분만 승인된 trace oracle로 바꾼다. Physical K, Tphys/Tdrill, geometry, recovery는 변경하지 않는다. Nonlinear source는 이미 초기 linear kd를 저장하므로 read-only 재사용하고 tests로 frozen lifecycle과 derivatives를 확인한다. Physical admissible moment m=(5/3)b를 사용한다. + +**Focused VERIFY:** 아래 regex 중 해당 suite를 먼저 discovery하여 tests>0을 확인하고 같은 test를 재실행한다. Exact exit와 실패 이유를 behavior별로 기록한다. + +## Focused 명령 + +Workspace root의 PowerShell에서 실행한다. 초기 missing API RED라면 build의 expected failure를 기록하고 production 구현 후 같은 명령을 다시 실행한다. + +```powershell +cmake -S . -B .harness/build -A x64 +cmake --build .harness/build --config Debug --target fesa_tests +ctest --test-dir .harness/build -C Debug -R '^(Mitc4DrillingScale|Mitc4Shell[^.]*|Mitc4Covariance|NonlinearMitc4[^.]*|NonlinearStaticProcedure|LinearStaticAnalysis)\.' --show-only=json-v1 +ctest --test-dir .harness/build -C Debug -R '^(Mitc4DrillingScale|Mitc4Shell[^.]*|Mitc4Covariance|NonlinearMitc4[^.]*|NonlinearStaticProcedure|LinearStaticAnalysis)\.' --output-on-failure +``` + +Configure exit는 항상0이어야 한다. GREEN에서는 위 모든 exit0, discovered selected tests>0, failures0이어야 한다. 각 호출의 `$LASTEXITCODE`를 즉시 기록하고 실패 뒤 후속 명령으로 덮어쓰지 않는다. + + +### 필수 신규 test discovery inventory + +- `Mitc4Covariance.MfeC08PartialBcCovariance` +- `Mitc4Covariance.MfeC09StaticReactionCovariance` +- `Mitc4DrillingScale.MfeC10TraceInventory` +- `NonlinearMitc4Tangent.MfeC12FrozenCovariantScale` + +위 이름 모두를 focused 및 full discovery JSON의 `tests[].name`에서 확인한다. Parameterized 전개가 필요하면 원 obligation→실제 discovered 이름을 evidence에 명시하고 모든 전개 case를 실행한다. 단지 selected count>0이거나 기존 suite만 존재하는 것은 실패다. V2의 해당 독립 oracle/mutation과 이 Step의 behavior assertions를 실제 구현해 각 결과를 기록한다. + +## Full VERIFY + +현재 실제 backend는 config absent→CMake/Visual Studio 18 2026/x64/`.harness/build`/Debug다. Dependency cache 준비는 [environment](../../docs/mitc4-shell-feast-eigen/implementation-environment.md)의 정확한 명령과 preflight를 따른다. Generator 변경이나 preset fallback을 임의로 하지 않는다. + +```powershell +cmake -S . -B .harness/build -A x64 +if ($LASTEXITCODE -ne 0) { throw 'configure failed' } +cmake --build .harness/build --config Debug +if ($LASTEXITCODE -ne 0) { throw 'build failed' } +ctest --test-dir .harness/build -C Debug --show-only=json-v1 +if ($LASTEXITCODE -ne 0) { throw 'discovery failed' } +ctest --test-dir .harness/build -C Debug --output-on-failure +if ($LASTEXITCODE -ne 0) { throw 'full CTest failed' } +uv run --with pytest python -B -m pytest -v -rs +if ($LASTEXITCODE -ne 0) { throw 'full pytest failed' } +``` + +전체 discovery의 test count와 실제 실행 count를 대조하고 skipped/missing/unobserved를 성공으로 합치지 않는다. 기존 target의 `/W4 /WX`를 유지하고 새 compiler/link warning0을 확인한다. 등록 Stop의 전체 검증은 그대로 수행되며 수동 hook 실행·state/reentry 조작으로 대체하지 않는다. Step 1에서 영향받는 C++ binary가 바뀌면 기존 reference helper의 cache 재사용 여부와 실제 solve 호출을 구분한다. 최종 fresh portfolio의 권위는 Step 7이다. + +## Evidence와 종료 + +- `docs/mitc4-shell-feast-eigen/implementation-step1-evidence.md` + +이 Step의 evidence에는 Feature/owner/r2, exact owned changed paths, RED→GREEN 명령·actual exits·기간·핵심 수치, focused/full counts, MSVC/x64/Debug/dependency/runtime selection, warning 수, upstream case/requirement 연결, 미실행 및 residual risk를 기록한다. Raw logs는 Git ignored `.harness/build/mitc4-eigen-evidence/step1/`에 보존한다. 각 CTest 호출 직후 해당 `Testing/Temporary/LastTest.log`를 고유 RED/focused/full 이름으로 복사하여 이후 Stop 로그와 섞지 않는다. Binary/reference/result hash와 run freshness는 적용되는 경우 기록한다. + + +보고서 작성 시점에는 마지막 registered Stop/Codex exit가 아직 발생하지 않을 수 있다. Implementation은 실제 완료된 manual 검증과 미관찰 Stop을 구분하고 미래 성공을 선기록하지 않는다. `completed` payload는 그 자체로 Stop 성공 증거가 아니다. Executor 종료 뒤 Coordinator가 raw output·등록 Hook evidence·actual exit를 management 문서에서 사후 감사한다. Specialist 보고서 본문은 Coordinator가 대신 수정하지 않는다. + +Manual AC가 성공하면 Executor가 허용한 `phases/mitc4-shell-feast-eigen/index.json`의 **현재 Step 1만** `status=completed`와 비어 있지 않은 `summary`를 기록한다. 구현/검증 실패는 `error/error_message`, 환경·필수 준비 차단은 `blocked/blocked_reason`이다. `owned_paths`, 이름/번호, 다른 Step/top index, timestamp, attempt_history는 수정하지 않는다. `step1-output.json`은 Executor 생성 기록이며 ignored 상태를 유지한다. 마지막 응답은 공통 handoff envelope다. Phase 전체 또는 workflow gate의 자기 승인은 하지 않는다. + +## 제외와 중단 조건 + +Physics/formulation/I/O/tolerance/원본 reference·기존 feature 보고서 변경, 외부 solver, spectrum fitting, eigen 외부 vector/frequency/stress gate, sparse rank cutoff, sandbox 확대, retry-budget 변경, Git branch/commit/push/tag/release는 소유 범위 밖이다. 명백한 구현 결함은 이 exact scope 안에서 최소 수정한다. 계약 결함은 정확한 owner로 `return-upstream`, 실행 환경 실패는 actual command/exit와 함께 Coordinator로 반환한다. 동일 실패를 transport timeout으로 가장하거나 evidence를 지우고 재실행하지 않는다. diff --git a/phases/mitc4-shell-feast-eigen/step2.md b/phases/mitc4-shell-feast-eigen/step2.md new file mode 100644 index 0000000..5573db8 --- /dev/null +++ b/phases/mitc4-shell-feast-eigen/step2.md @@ -0,0 +1,162 @@ +# Step 2: Consistent→lumped 질량과 deterministic 조립 + +- Feature ID: `mitc4-shell-feast-eigen` +- Plan owner: `implementation-planning-agent` +- Execution owner: `implementation-agent` +- Input contract revision: `r2` +- Phase: `mitc4-shell-feast-eigen` +- Dependency: 동일 phase의 Step 1 completed +- Requirement IDs: `FEM-REQ-MITC4-EIGEN-003`, `FEM-REQ-MITC4-EIGEN-004`, `FEM-REQ-MITC4-EIGEN-005`, `FEM-REQ-MITC4-EIGEN-006`, `FEM-REQ-MITC4-EIGEN-007`, `FEM-REQ-MITC4-EIGEN-011`, `FEM-REQ-MITC4-EIGEN-014`, `FEM-REQ-MITC4-EIGEN-018`, `FEM-REQ-MITC4-EIGEN-026` +- Logical cases: `MFE-C01`, `MFE-C02`, `MFE-C03`, `MFE-C04`, `MFE-C05`, `MFE-C06`, `MFE-C07`, `MFE-C11`, `MFE-C20` +- I/O obligations: `IO-T02`, `IO-T04`, `IO-T11` + +## 필수 입력과 계약 + +Feature 폴더는 `docs/mitc4-shell-feast-eigen/`다. 아래 current r2 입력을 읽고 기존 완료 Step 코드와 evidence를 대조한다. 연결된 upstream contract는 read-only다. + +- [AGENTS.md](../../AGENTS.md) +- [docs/SOLVER_AGENT_DESIGN.md](../../docs/SOLVER_AGENT_DESIGN.md) +- [docs/FEATURE_DOCUMENTATION.md](../../docs/FEATURE_DOCUMENTATION.md) +- [docs/PRD.md](../../docs/PRD.md) +- [docs/ARCHITECTURE.md](../../docs/ARCHITECTURE.md) +- [docs/ADR.md](../../docs/ADR.md) +- [docs/CODINGSTYLE.md](../../docs/CODINGSTYLE.md) +- [docs/TOLERANCE.md](../../docs/TOLERANCE.md) +- [.codex/skills/fem-implementation-tdd/SKILL.md](../../.codex/skills/fem-implementation-tdd/SKILL.md) +- [.agents/skills/harness/SKILL.md](../../.agents/skills/harness/SKILL.md) +- [.codex/agents/implementation-agent.toml](../../.codex/agents/implementation-agent.toml) +- [docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md](../../docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md) +- [docs/mitc4-shell-feast-eigen/PRD.md](../../docs/mitc4-shell-feast-eigen/PRD.md) +- [docs/mitc4-shell-feast-eigen/ADR.md](../../docs/mitc4-shell-feast-eigen/ADR.md) +- [docs/mitc4-shell-feast-eigen/coordination.md](../../docs/mitc4-shell-feast-eigen/coordination.md) +- [docs/mitc4-shell-feast-eigen/requirements.md](../../docs/mitc4-shell-feast-eigen/requirements.md) +- [docs/mitc4-shell-feast-eigen/requirements-evidence.md](../../docs/mitc4-shell-feast-eigen/requirements-evidence.md) +- [docs/mitc4-shell-feast-eigen/research.md](../../docs/mitc4-shell-feast-eigen/research.md) +- [docs/mitc4-shell-feast-eigen/research-evidence.md](../../docs/mitc4-shell-feast-eigen/research-evidence.md) +- [docs/mitc4-shell-feast-eigen/formulation.md](../../docs/mitc4-shell-feast-eigen/formulation.md) +- [docs/mitc4-shell-feast-eigen/formulation-mass.md](../../docs/mitc4-shell-feast-eigen/formulation-mass.md) +- [docs/mitc4-shell-feast-eigen/formulation-eigen.md](../../docs/mitc4-shell-feast-eigen/formulation-eigen.md) +- [docs/mitc4-shell-feast-eigen/formulation-verification.md](../../docs/mitc4-shell-feast-eigen/formulation-verification.md) +- [docs/mitc4-shell-feast-eigen/formulation-stabilization.md](../../docs/mitc4-shell-feast-eigen/formulation-stabilization.md) +- [docs/mitc4-shell-feast-eigen/numerical-review.md](../../docs/mitc4-shell-feast-eigen/numerical-review.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-evidence.md](../../docs/mitc4-shell-feast-eigen/numerical-review-evidence.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-controls.md](../../docs/mitc4-shell-feast-eigen/numerical-review-controls.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-cases.md](../../docs/mitc4-shell-feast-eigen/numerical-review-cases.md) +- [docs/mitc4-shell-feast-eigen/reference-model.md](../../docs/mitc4-shell-feast-eigen/reference-model.md) +- [docs/mitc4-shell-feast-eigen/io.md](../../docs/mitc4-shell-feast-eigen/io.md) +- [docs/mitc4-shell-feast-eigen/io-input.md](../../docs/mitc4-shell-feast-eigen/io-input.md) +- [docs/mitc4-shell-feast-eigen/io-schema.md](../../docs/mitc4-shell-feast-eigen/io-schema.md) +- [docs/mitc4-shell-feast-eigen/io-mapping.md](../../docs/mitc4-shell-feast-eigen/io-mapping.md) +- [docs/mitc4-shell-feast-eigen/implementation-plan.md](../../docs/mitc4-shell-feast-eigen/implementation-plan.md) +- [docs/mitc4-shell-feast-eigen/implementation-environment.md](../../docs/mitc4-shell-feast-eigen/implementation-environment.md) +- [docs/mitc4-shell-feast-eigen/implementation-interfaces.md](../../docs/mitc4-shell-feast-eigen/implementation-interfaces.md) +- [docs/mitc4-shell-feast-eigen/implementation-verification.md](../../docs/mitc4-shell-feast-eigen/implementation-verification.md) + +이 Step의 직접 계약: [formulation-mass.md](../../docs/mitc4-shell-feast-eigen/formulation-mass.md), [numerical-review-evidence.md#독립-mass-oracle](../../docs/mitc4-shell-feast-eigen/numerical-review-evidence.md#독립-mass-oracle), [numerical-review-controls.md#c2-matrix-mass-stabilization와-reduction](../../docs/mitc4-shell-feast-eigen/numerical-review-controls.md#c2-matrix-mass-stabilization와-reduction), [formulation-mass.md#m4-계산된-consistent-moment에서-nodal-block-유도](../../docs/mitc4-shell-feast-eigen/formulation-mass.md#m4-계산된-consistent-moment에서-nodal-block-유도), [formulation-mass.md#m5-보존되는-양과-근사되는-양](../../docs/mitc4-shell-feast-eigen/formulation-mass.md#m5-보존되는-양과-근사되는-양), [formulation-eigen.md#e1-조립-단위-scaling과-실제-global-제약](../../docs/mitc4-shell-feast-eigen/formulation-eigen.md#e1-조립-단위-scaling과-실제-global-제약). +논리 case의 전체 parameter/threshold/음성 inventory는 NR 원문과 [verification mapping](../../docs/mitc4-shell-feast-eigen/implementation-verification.md)을 함께 적용한다. + +## Owned paths + +다음 목록은 phase index `owned_paths`와 exact equality를 유지한다. 목록 밖 파일이 필요하면 보존하고 Coordinator에 반환한다. 다른 agent도 같은 worktree를 사용하므로 타인 변경을 되돌리지 않는다. + +```json +[ + "include/fesa/elements/mitc4_shell.h", + "src/fesa/elements/mitc4_shell_mass.cpp", + "tests/unit/elements/mitc4_shell_test.cpp", + "tests/unit/elements/mitc4_shell_mass_test.cpp", + "src/fesa/CMakeLists.txt", + "tests/CMakeLists.txt", + "include/fesa/elements/element_factory.h", + "src/fesa/elements/element_factory.cpp", + "include/fesa/assembly/shell_mass_assembler.h", + "src/fesa/assembly/shell_mass_assembler.cpp", + "tests/unit/elements/element_factory_test.cpp", + "tests/unit/assembly/shell_mass_assembler_test.cpp", + "docs/mitc4-shell-feast-eigen/implementation-step2-evidence.md" +] +``` + +## 같은 session의 behavior별 TDD + +각 소단위는 아래 순서로 RED→observed failure→minimal GREEN→focused VERIFY를 완료한다. 마지막 소단위 뒤 full VERIFY를 한 번 수행하고 등록 Stop의 정상 전체검증도 받는다. Missing API의 정확한 compile/link failure는 RED일 수 있으나 configure/dependency 오류는 RED가 아니다. 이미 통과한 test를 새 RED라고 보고하지 않는다. + +### 1. 27점 consistent scalar moments와 물리 관성 + +Symbols: `Mitc4ConsistentMass; Mitc4Shell::ConsistentMass(double density); fixed 3x3x3 mass quadrature`. + +**RED:** Flat4x2 rho3 t1/2의 exact C0/C1/C2, 24-matrix energy 및 physical20 positive rank/null을 검사해 API 부재 failure를 관찰한다. Rational warped/director-varying fixture는 NR의 exact coefficient/row oracle를 test-local 독립 polynomial integration 또는 5-point direct particle integration으로 구성한다. Production ShapeFunctions/EvaluateGeometry 재호출 oracle는 금지한다. 강제 C1=0/2-point/flat C2 mutation은 오류를 검출해야 한다. + +**Minimal GREEN:** Mitc4Shell의 기존 geometry evaluator를 같은 sign/원형상으로 27점에 적용하는 member 구현을 새 cpp에 둔다. M5의 C0/C1/C2 snapshot과 consistent24를 먼저 완성·검증해 반환한다. Quadrature loop 순서/finite/positive geometry와 rho 검사는 계약대로 한다. 5/6을 mass에 곱하거나 곡면 odd coupling을 생략하지 않는다. Lumped/FEAST/global dense MC는 이 단계에 넣지 않는다. + +**Focused VERIFY:** 아래 regex 중 해당 suite를 먼저 discovery하여 tests>0을 확인하고 같은 test를 재실행한다. Exact exit와 실패 이유를 behavior별로 기록한다. + +### 2. Moment 유도 lumping과 deterministic nodal 조립 + +Symbols: `Mitc4LumpedMass; DeriveLumpedMass(consistent snapshot, directors); ElementFactory::CreateMitc4Shell; ShellMassAssembler::Assemble`. + +**RED:** C1/C2 symmetric perturbation을 consistent snapshot에 주어 derived block도 독립 integral대로 변하는지 먼저 실패시킨다. m/h/j positivity·central variance·rank5·drill null·spatial centroid와 Jensen work를 검사한다. m=1,2,4 grid의 velocity(x,0,0)에서 MC work4/3, difference8/(3m²)를 독립 기대값으로 사용한다. Two-rho/t patch의 source/scatter 및 parallel scheduling permutations를 검사한다. + +**Minimal GREEN:** M6/M7의 scalar moment row-sum으로 nodal6 blocks를 만든다. 원 snapshot을 덮어쓰지 않는다. Typed factory 생성 경계에서 generic Element 생성과 동일 검증·runtime layout을 재사용하고 solver consumer의 downcast/type switch를 추가하지 않는다. Mass assembler는 DOF owner의 scatter로 index-owned contributions를 stable source order로 reduce한다. K는 기존 SparseAssembler/ElementView 경로를 재사용한다. Source/section/material별 rho·t 및 nodal incident kd 합을 보존한다. + +**Focused VERIFY:** 아래 regex 중 해당 suite를 먼저 discovery하여 tests>0을 확인하고 같은 test를 재실행한다. Exact exit와 실패 이유를 behavior별로 기록한다. + +## Focused 명령 + +Workspace root의 PowerShell에서 실행한다. 초기 missing API RED라면 build의 expected failure를 기록하고 production 구현 후 같은 명령을 다시 실행한다. + +```powershell +cmake -S . -B .harness/build -A x64 +cmake --build .harness/build --config Debug --target fesa_tests +ctest --test-dir .harness/build -C Debug -R '^(Mitc4ShellMass|Mitc4ShellKinematics|Mitc4ShellKernel|ElementFactory|ShellMassAssembler|SparseAssembler)\.' --show-only=json-v1 +ctest --test-dir .harness/build -C Debug -R '^(Mitc4ShellMass|Mitc4ShellKinematics|Mitc4ShellKernel|ElementFactory|ShellMassAssembler|SparseAssembler)\.' --output-on-failure +``` + +Configure exit는 항상0이어야 한다. GREEN에서는 위 모든 exit0, discovered selected tests>0, failures0이어야 한다. 각 호출의 `$LASTEXITCODE`를 즉시 기록하고 실패 뒤 후속 명령으로 덮어쓰지 않는다. + + +### 필수 신규 test discovery inventory + +- `Mitc4ShellMass.MfeC01FlatMomentOracle` +- `Mitc4ShellMass.MfeC02CurvedParticleOracle` +- `Mitc4ShellMass.MfeC03DerivedSnapshotAndJensen` +- `ShellMassAssembler.MfeC04RefinementEnergy` +- `Mitc4ShellMass.MfeC05RotatedMassAndCentroid` +- `ShellMassAssembler.MfeC06SourceAndParallelOrder` +- `Mitc4ShellMass.MfeC07InvalidMassGeometry` + +위 이름 모두를 focused 및 full discovery JSON의 `tests[].name`에서 확인한다. Parameterized 전개가 필요하면 원 obligation→실제 discovered 이름을 evidence에 명시하고 모든 전개 case를 실행한다. 단지 selected count>0이거나 기존 suite만 존재하는 것은 실패다. V2의 해당 독립 oracle/mutation과 이 Step의 behavior assertions를 실제 구현해 각 결과를 기록한다. + +## Full VERIFY + +현재 실제 backend는 config absent→CMake/Visual Studio 18 2026/x64/`.harness/build`/Debug다. Dependency cache 준비는 [environment](../../docs/mitc4-shell-feast-eigen/implementation-environment.md)의 정확한 명령과 preflight를 따른다. Generator 변경이나 preset fallback을 임의로 하지 않는다. + +```powershell +cmake -S . -B .harness/build -A x64 +if ($LASTEXITCODE -ne 0) { throw 'configure failed' } +cmake --build .harness/build --config Debug +if ($LASTEXITCODE -ne 0) { throw 'build failed' } +ctest --test-dir .harness/build -C Debug --show-only=json-v1 +if ($LASTEXITCODE -ne 0) { throw 'discovery failed' } +ctest --test-dir .harness/build -C Debug --output-on-failure +if ($LASTEXITCODE -ne 0) { throw 'full CTest failed' } +uv run --with pytest python -B -m pytest -v -rs +if ($LASTEXITCODE -ne 0) { throw 'full pytest failed' } +``` + +전체 discovery의 test count와 실제 실행 count를 대조하고 skipped/missing/unobserved를 성공으로 합치지 않는다. 기존 target의 `/W4 /WX`를 유지하고 새 compiler/link warning0을 확인한다. 등록 Stop의 전체 검증은 그대로 수행되며 수동 hook 실행·state/reentry 조작으로 대체하지 않는다. Step 2에서 영향받는 C++ binary가 바뀌면 기존 reference helper의 cache 재사용 여부와 실제 solve 호출을 구분한다. 최종 fresh portfolio의 권위는 Step 7이다. + +## Evidence와 종료 + +- `docs/mitc4-shell-feast-eigen/implementation-step2-evidence.md` + +이 Step의 evidence에는 Feature/owner/r2, exact owned changed paths, RED→GREEN 명령·actual exits·기간·핵심 수치, focused/full counts, MSVC/x64/Debug/dependency/runtime selection, warning 수, upstream case/requirement 연결, 미실행 및 residual risk를 기록한다. Raw logs는 Git ignored `.harness/build/mitc4-eigen-evidence/step2/`에 보존한다. 각 CTest 호출 직후 해당 `Testing/Temporary/LastTest.log`를 고유 RED/focused/full 이름으로 복사하여 이후 Stop 로그와 섞지 않는다. Binary/reference/result hash와 run freshness는 적용되는 경우 기록한다. + + +보고서 작성 시점에는 마지막 registered Stop/Codex exit가 아직 발생하지 않을 수 있다. Implementation은 실제 완료된 manual 검증과 미관찰 Stop을 구분하고 미래 성공을 선기록하지 않는다. `completed` payload는 그 자체로 Stop 성공 증거가 아니다. Executor 종료 뒤 Coordinator가 raw output·등록 Hook evidence·actual exit를 management 문서에서 사후 감사한다. Specialist 보고서 본문은 Coordinator가 대신 수정하지 않는다. + +Manual AC가 성공하면 Executor가 허용한 `phases/mitc4-shell-feast-eigen/index.json`의 **현재 Step 2만** `status=completed`와 비어 있지 않은 `summary`를 기록한다. 구현/검증 실패는 `error/error_message`, 환경·필수 준비 차단은 `blocked/blocked_reason`이다. `owned_paths`, 이름/번호, 다른 Step/top index, timestamp, attempt_history는 수정하지 않는다. `step2-output.json`은 Executor 생성 기록이며 ignored 상태를 유지한다. 마지막 응답은 공통 handoff envelope다. Phase 전체 또는 workflow gate의 자기 승인은 하지 않는다. + +## 제외와 중단 조건 + +Physics/formulation/I/O/tolerance/원본 reference·기존 feature 보고서 변경, 외부 solver, spectrum fitting, eigen 외부 vector/frequency/stress gate, sparse rank cutoff, sandbox 확대, retry-budget 변경, Git branch/commit/push/tag/release는 소유 범위 밖이다. 명백한 구현 결함은 이 exact scope 안에서 최소 수정한다. 계약 결함은 정확한 owner로 `return-upstream`, 실행 환경 실패는 actual command/exit와 함께 Coordinator로 반환한다. 동일 실패를 transport timeout으로 가장하거나 evidence를 지우고 재실행하지 않는다. diff --git a/phases/mitc4-shell-feast-eigen/step3.md b/phases/mitc4-shell-feast-eigen/step3.md new file mode 100644 index 0000000..0d6dd63 --- /dev/null +++ b/phases/mitc4-shell-feast-eigen/step3.md @@ -0,0 +1,145 @@ +# Step 3: 실제 제약의 null 공간과 sparse whitening + +- Feature ID: `mitc4-shell-feast-eigen` +- Plan owner: `implementation-planning-agent` +- Execution owner: `implementation-agent` +- Input contract revision: `r2` +- Phase: `mitc4-shell-feast-eigen` +- Dependency: 동일 phase의 Step 2 completed +- Requirement IDs: `FEM-REQ-MITC4-EIGEN-006`, `FEM-REQ-MITC4-EIGEN-007`, `FEM-REQ-MITC4-EIGEN-008`, `FEM-REQ-MITC4-EIGEN-009`, `FEM-REQ-MITC4-EIGEN-012`, `FEM-REQ-MITC4-EIGEN-013`, `FEM-REQ-MITC4-EIGEN-014`, `FEM-REQ-MITC4-EIGEN-018` +- Logical cases: `MFE-C08`, `MFE-C11`, `MFE-C13`, `MFE-C14`, `MFE-C15`, `MFE-C16`, `MFE-C20` +- I/O obligations: `IO-T04`, `IO-T05` + +## 필수 입력과 계약 + +Feature 폴더는 `docs/mitc4-shell-feast-eigen/`다. 아래 current r2 입력을 읽고 기존 완료 Step 코드와 evidence를 대조한다. 연결된 upstream contract는 read-only다. + +- [AGENTS.md](../../AGENTS.md) +- [docs/SOLVER_AGENT_DESIGN.md](../../docs/SOLVER_AGENT_DESIGN.md) +- [docs/FEATURE_DOCUMENTATION.md](../../docs/FEATURE_DOCUMENTATION.md) +- [docs/PRD.md](../../docs/PRD.md) +- [docs/ARCHITECTURE.md](../../docs/ARCHITECTURE.md) +- [docs/ADR.md](../../docs/ADR.md) +- [docs/CODINGSTYLE.md](../../docs/CODINGSTYLE.md) +- [docs/TOLERANCE.md](../../docs/TOLERANCE.md) +- [.codex/skills/fem-implementation-tdd/SKILL.md](../../.codex/skills/fem-implementation-tdd/SKILL.md) +- [.agents/skills/harness/SKILL.md](../../.agents/skills/harness/SKILL.md) +- [.codex/agents/implementation-agent.toml](../../.codex/agents/implementation-agent.toml) +- [docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md](../../docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md) +- [docs/mitc4-shell-feast-eigen/PRD.md](../../docs/mitc4-shell-feast-eigen/PRD.md) +- [docs/mitc4-shell-feast-eigen/ADR.md](../../docs/mitc4-shell-feast-eigen/ADR.md) +- [docs/mitc4-shell-feast-eigen/coordination.md](../../docs/mitc4-shell-feast-eigen/coordination.md) +- [docs/mitc4-shell-feast-eigen/requirements.md](../../docs/mitc4-shell-feast-eigen/requirements.md) +- [docs/mitc4-shell-feast-eigen/requirements-evidence.md](../../docs/mitc4-shell-feast-eigen/requirements-evidence.md) +- [docs/mitc4-shell-feast-eigen/research.md](../../docs/mitc4-shell-feast-eigen/research.md) +- [docs/mitc4-shell-feast-eigen/research-evidence.md](../../docs/mitc4-shell-feast-eigen/research-evidence.md) +- [docs/mitc4-shell-feast-eigen/formulation.md](../../docs/mitc4-shell-feast-eigen/formulation.md) +- [docs/mitc4-shell-feast-eigen/formulation-mass.md](../../docs/mitc4-shell-feast-eigen/formulation-mass.md) +- [docs/mitc4-shell-feast-eigen/formulation-eigen.md](../../docs/mitc4-shell-feast-eigen/formulation-eigen.md) +- [docs/mitc4-shell-feast-eigen/formulation-verification.md](../../docs/mitc4-shell-feast-eigen/formulation-verification.md) +- [docs/mitc4-shell-feast-eigen/formulation-stabilization.md](../../docs/mitc4-shell-feast-eigen/formulation-stabilization.md) +- [docs/mitc4-shell-feast-eigen/numerical-review.md](../../docs/mitc4-shell-feast-eigen/numerical-review.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-evidence.md](../../docs/mitc4-shell-feast-eigen/numerical-review-evidence.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-controls.md](../../docs/mitc4-shell-feast-eigen/numerical-review-controls.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-cases.md](../../docs/mitc4-shell-feast-eigen/numerical-review-cases.md) +- [docs/mitc4-shell-feast-eigen/reference-model.md](../../docs/mitc4-shell-feast-eigen/reference-model.md) +- [docs/mitc4-shell-feast-eigen/io.md](../../docs/mitc4-shell-feast-eigen/io.md) +- [docs/mitc4-shell-feast-eigen/io-input.md](../../docs/mitc4-shell-feast-eigen/io-input.md) +- [docs/mitc4-shell-feast-eigen/io-schema.md](../../docs/mitc4-shell-feast-eigen/io-schema.md) +- [docs/mitc4-shell-feast-eigen/io-mapping.md](../../docs/mitc4-shell-feast-eigen/io-mapping.md) +- [docs/mitc4-shell-feast-eigen/implementation-plan.md](../../docs/mitc4-shell-feast-eigen/implementation-plan.md) +- [docs/mitc4-shell-feast-eigen/implementation-environment.md](../../docs/mitc4-shell-feast-eigen/implementation-environment.md) +- [docs/mitc4-shell-feast-eigen/implementation-interfaces.md](../../docs/mitc4-shell-feast-eigen/implementation-interfaces.md) +- [docs/mitc4-shell-feast-eigen/implementation-verification.md](../../docs/mitc4-shell-feast-eigen/implementation-verification.md) + +이 Step의 직접 계약: [formulation-eigen.md#e1-조립-단위-scaling과-실제-global-제약](../../docs/mitc4-shell-feast-eigen/formulation-eigen.md#e1-조립-단위-scaling과-실제-global-제약), [formulation-eigen.md#e2-nullpositive-basis를-node마다-결정](../../docs/mitc4-shell-feast-eigen/formulation-eigen.md#e2-nullpositive-basis를-node마다-결정), [formulation-eigen.md#e5-spd-whitening-복원과-sparsity](../../docs/mitc4-shell-feast-eigen/formulation-eigen.md#e5-spd-whitening-복원과-sparsity), [numerical-review-controls.md#c2-matrix-mass-stabilization와-reduction](../../docs/mitc4-shell-feast-eigen/numerical-review-controls.md#c2-matrix-mass-stabilization와-reduction). +논리 case의 전체 parameter/threshold/음성 inventory는 NR 원문과 [verification mapping](../../docs/mitc4-shell-feast-eigen/implementation-verification.md)을 함께 적용한다. + +## Owned paths + +다음 목록은 phase index `owned_paths`와 exact equality를 유지한다. 목록 밖 파일이 필요하면 보존하고 Coordinator에 반환한다. 다른 agent도 같은 worktree를 사용하므로 타인 변경을 되돌리지 않는다. + +```json +[ + "include/fesa/fem/dof_manager.h", + "src/fesa/fem/dof_manager.cpp", + "src/fesa/analysis/eigen_reduction.h", + "src/fesa/analysis/eigen_reduction.cpp", + "tests/unit/fem/dof_manager_test.cpp", + "tests/unit/analysis/eigen_reduction_test.cpp", + "src/fesa/CMakeLists.txt", + "tests/CMakeLists.txt", + "docs/mitc4-shell-feast-eigen/implementation-step3-evidence.md" +] +``` + +## 같은 session의 behavior별 TDD + +각 소단위는 아래 순서로 RED→observed failure→minimal GREEN→focused VERIFY를 완료한다. 마지막 소단위 뒤 full VERIFY를 한 번 수행하고 등록 Stop의 정상 전체검증도 받는다. Missing API의 정확한 compile/link failure는 RED일 수 있으나 configure/dependency 오류는 RED가 아니다. 이미 통과한 test를 새 RED라고 보고하지 않는다. + +### 1. 실제 BC의 analytic null, nodal Cholesky와 sparse whitening + +Symbols: `DofManager::BuildEigenLayout/EigenSparsePattern; eigen_internal::ReduceEigenSystem/RestoreEigenvector; EigenReduction`. + +**RED:** C13의 supported director/component-mask inventory로 exact n/nz/P/Z와 global n0/N>n 실패를 고정한다. C14 p=1/2000 positive5 pass, p=1e-8 analytic5 conditioning fail, p=0 null1을 검사한다. C15의 일반 singular pencil exact2.5 vs 삭제3을 test-local oracle로 보존하고 production에 nonzero Kpz/nonpositive Kzz를 주입해 거부시킨다. C16 SPD pencil의2,10/3 및 full original residual 복원을 검사한다. + +**Minimal GREEN:** E1~E5와 C2의 analytic BC/director intersection만 rank로 사용한다. Nodal≤6 P/Z/L과 rcond>=2^-32, MZ/KZ/PZ/Kzz checks 및 global scale ell을 계산한다. Positive counts는 DOF owner로 넘겨 stable finite offsets/pattern을 받고 block triangular congruence로 sparse A를 구성한다. 원 free K/ML은 residual용으로 보존한다. Global inverse/dense Schur/artificial mass/cutoff/local URZ 삭제는 금지한다. + +**Focused VERIFY:** 아래 regex 중 해당 suite를 먼저 discovery하여 tests>0을 확인하고 같은 test를 재실행한다. Exact exit와 실패 이유를 behavior별로 기록한다. + +## Focused 명령 + +Workspace root의 PowerShell에서 실행한다. 초기 missing API RED라면 build의 expected failure를 기록하고 production 구현 후 같은 명령을 다시 실행한다. + +```powershell +cmake -S . -B .harness/build -A x64 +cmake --build .harness/build --config Debug --target fesa_tests +ctest --test-dir .harness/build -C Debug -R '^(EigenReduction|DofManager|ShellMassAssembler|Mitc4Covariance)\.' --show-only=json-v1 +ctest --test-dir .harness/build -C Debug -R '^(EigenReduction|DofManager|ShellMassAssembler|Mitc4Covariance)\.' --output-on-failure +``` + +Configure exit는 항상0이어야 한다. GREEN에서는 위 모든 exit0, discovered selected tests>0, failures0이어야 한다. 각 호출의 `$LASTEXITCODE`를 즉시 기록하고 실패 뒤 후속 명령으로 덮어쓰지 않는다. + + +### 필수 신규 test discovery inventory + +- `EigenReduction.MfeC13ExactBoundaryNullIntersection` +- `EigenReduction.MfeC14NearNullConditioning` +- `EigenReduction.MfeC15RejectsInvalidDecoupling` +- `EigenReduction.MfeC16NodalWhitening` + +위 이름 모두를 focused 및 full discovery JSON의 `tests[].name`에서 확인한다. Parameterized 전개가 필요하면 원 obligation→실제 discovered 이름을 evidence에 명시하고 모든 전개 case를 실행한다. 단지 selected count>0이거나 기존 suite만 존재하는 것은 실패다. V2의 해당 독립 oracle/mutation과 이 Step의 behavior assertions를 실제 구현해 각 결과를 기록한다. + +## Full VERIFY + +현재 실제 backend는 config absent→CMake/Visual Studio 18 2026/x64/`.harness/build`/Debug다. Dependency cache 준비는 [environment](../../docs/mitc4-shell-feast-eigen/implementation-environment.md)의 정확한 명령과 preflight를 따른다. Generator 변경이나 preset fallback을 임의로 하지 않는다. + +```powershell +cmake -S . -B .harness/build -A x64 +if ($LASTEXITCODE -ne 0) { throw 'configure failed' } +cmake --build .harness/build --config Debug +if ($LASTEXITCODE -ne 0) { throw 'build failed' } +ctest --test-dir .harness/build -C Debug --show-only=json-v1 +if ($LASTEXITCODE -ne 0) { throw 'discovery failed' } +ctest --test-dir .harness/build -C Debug --output-on-failure +if ($LASTEXITCODE -ne 0) { throw 'full CTest failed' } +uv run --with pytest python -B -m pytest -v -rs +if ($LASTEXITCODE -ne 0) { throw 'full pytest failed' } +``` + +전체 discovery의 test count와 실제 실행 count를 대조하고 skipped/missing/unobserved를 성공으로 합치지 않는다. 기존 target의 `/W4 /WX`를 유지하고 새 compiler/link warning0을 확인한다. 등록 Stop의 전체 검증은 그대로 수행되며 수동 hook 실행·state/reentry 조작으로 대체하지 않는다. Step 3에서 영향받는 C++ binary가 바뀌면 기존 reference helper의 cache 재사용 여부와 실제 solve 호출을 구분한다. 최종 fresh portfolio의 권위는 Step 7이다. + +## Evidence와 종료 + +- `docs/mitc4-shell-feast-eigen/implementation-step3-evidence.md` + +이 Step의 evidence에는 Feature/owner/r2, exact owned changed paths, RED→GREEN 명령·actual exits·기간·핵심 수치, focused/full counts, MSVC/x64/Debug/dependency/runtime selection, warning 수, upstream case/requirement 연결, 미실행 및 residual risk를 기록한다. Raw logs는 Git ignored `.harness/build/mitc4-eigen-evidence/step3/`에 보존한다. 각 CTest 호출 직후 해당 `Testing/Temporary/LastTest.log`를 고유 RED/focused/full 이름으로 복사하여 이후 Stop 로그와 섞지 않는다. Binary/reference/result hash와 run freshness는 적용되는 경우 기록한다. + + +보고서 작성 시점에는 마지막 registered Stop/Codex exit가 아직 발생하지 않을 수 있다. Implementation은 실제 완료된 manual 검증과 미관찰 Stop을 구분하고 미래 성공을 선기록하지 않는다. `completed` payload는 그 자체로 Stop 성공 증거가 아니다. Executor 종료 뒤 Coordinator가 raw output·등록 Hook evidence·actual exit를 management 문서에서 사후 감사한다. Specialist 보고서 본문은 Coordinator가 대신 수정하지 않는다. + +Manual AC가 성공하면 Executor가 허용한 `phases/mitc4-shell-feast-eigen/index.json`의 **현재 Step 3만** `status=completed`와 비어 있지 않은 `summary`를 기록한다. 구현/검증 실패는 `error/error_message`, 환경·필수 준비 차단은 `blocked/blocked_reason`이다. `owned_paths`, 이름/번호, 다른 Step/top index, timestamp, attempt_history는 수정하지 않는다. `step3-output.json`은 Executor 생성 기록이며 ignored 상태를 유지한다. 마지막 응답은 공통 handoff envelope다. Phase 전체 또는 workflow gate의 자기 승인은 하지 않는다. + +## 제외와 중단 조건 + +Physics/formulation/I/O/tolerance/원본 reference·기존 feature 보고서 변경, 외부 solver, spectrum fitting, eigen 외부 vector/frequency/stress gate, sparse rank cutoff, sandbox 확대, retry-budget 변경, Git branch/commit/push/tag/release는 소유 범위 밖이다. 명백한 구현 결함은 이 exact scope 안에서 최소 수정한다. 계약 결함은 정확한 owner로 `return-upstream`, 실행 환경 실패는 actual command/exit와 함께 Coordinator로 반환한다. 동일 실패를 transport timeout으로 가장하거나 evidence를 지우고 재실행하지 않는다. diff --git a/phases/mitc4-shell-feast-eigen/step4.md b/phases/mitc4-shell-feast-eigen/step4.md new file mode 100644 index 0000000..48f3c95 --- /dev/null +++ b/phases/mitc4-shell-feast-eigen/step4.md @@ -0,0 +1,165 @@ +# Step 4: MKL FEAST adapter와 bounded lowest-N 검색 + +- Feature ID: `mitc4-shell-feast-eigen` +- Plan owner: `implementation-planning-agent` +- Execution owner: `implementation-agent` +- Input contract revision: `r2` +- Phase: `mitc4-shell-feast-eigen` +- Dependency: 동일 phase의 Step 3 completed +- Requirement IDs: `FEM-REQ-MITC4-EIGEN-009`, `FEM-REQ-MITC4-EIGEN-010`, `FEM-REQ-MITC4-EIGEN-011`, `FEM-REQ-MITC4-EIGEN-012`, `FEM-REQ-MITC4-EIGEN-013`, `FEM-REQ-MITC4-EIGEN-023` +- Logical cases: `MFE-C17`, `MFE-C18`, `MFE-C19`, `MFE-C21`, `MFE-C22` +- I/O obligations: `IO-T06` + +## 필수 입력과 계약 + +Feature 폴더는 `docs/mitc4-shell-feast-eigen/`다. 아래 current r2 입력을 읽고 기존 완료 Step 코드와 evidence를 대조한다. 연결된 upstream contract는 read-only다. + +- [AGENTS.md](../../AGENTS.md) +- [docs/SOLVER_AGENT_DESIGN.md](../../docs/SOLVER_AGENT_DESIGN.md) +- [docs/FEATURE_DOCUMENTATION.md](../../docs/FEATURE_DOCUMENTATION.md) +- [docs/PRD.md](../../docs/PRD.md) +- [docs/ARCHITECTURE.md](../../docs/ARCHITECTURE.md) +- [docs/ADR.md](../../docs/ADR.md) +- [docs/CODINGSTYLE.md](../../docs/CODINGSTYLE.md) +- [docs/TOLERANCE.md](../../docs/TOLERANCE.md) +- [.codex/skills/fem-implementation-tdd/SKILL.md](../../.codex/skills/fem-implementation-tdd/SKILL.md) +- [.agents/skills/harness/SKILL.md](../../.agents/skills/harness/SKILL.md) +- [.codex/agents/implementation-agent.toml](../../.codex/agents/implementation-agent.toml) +- [docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md](../../docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md) +- [docs/mitc4-shell-feast-eigen/PRD.md](../../docs/mitc4-shell-feast-eigen/PRD.md) +- [docs/mitc4-shell-feast-eigen/ADR.md](../../docs/mitc4-shell-feast-eigen/ADR.md) +- [docs/mitc4-shell-feast-eigen/coordination.md](../../docs/mitc4-shell-feast-eigen/coordination.md) +- [docs/mitc4-shell-feast-eigen/requirements.md](../../docs/mitc4-shell-feast-eigen/requirements.md) +- [docs/mitc4-shell-feast-eigen/requirements-evidence.md](../../docs/mitc4-shell-feast-eigen/requirements-evidence.md) +- [docs/mitc4-shell-feast-eigen/research.md](../../docs/mitc4-shell-feast-eigen/research.md) +- [docs/mitc4-shell-feast-eigen/research-evidence.md](../../docs/mitc4-shell-feast-eigen/research-evidence.md) +- [docs/mitc4-shell-feast-eigen/formulation.md](../../docs/mitc4-shell-feast-eigen/formulation.md) +- [docs/mitc4-shell-feast-eigen/formulation-mass.md](../../docs/mitc4-shell-feast-eigen/formulation-mass.md) +- [docs/mitc4-shell-feast-eigen/formulation-eigen.md](../../docs/mitc4-shell-feast-eigen/formulation-eigen.md) +- [docs/mitc4-shell-feast-eigen/formulation-verification.md](../../docs/mitc4-shell-feast-eigen/formulation-verification.md) +- [docs/mitc4-shell-feast-eigen/formulation-stabilization.md](../../docs/mitc4-shell-feast-eigen/formulation-stabilization.md) +- [docs/mitc4-shell-feast-eigen/numerical-review.md](../../docs/mitc4-shell-feast-eigen/numerical-review.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-evidence.md](../../docs/mitc4-shell-feast-eigen/numerical-review-evidence.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-controls.md](../../docs/mitc4-shell-feast-eigen/numerical-review-controls.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-cases.md](../../docs/mitc4-shell-feast-eigen/numerical-review-cases.md) +- [docs/mitc4-shell-feast-eigen/reference-model.md](../../docs/mitc4-shell-feast-eigen/reference-model.md) +- [docs/mitc4-shell-feast-eigen/io.md](../../docs/mitc4-shell-feast-eigen/io.md) +- [docs/mitc4-shell-feast-eigen/io-input.md](../../docs/mitc4-shell-feast-eigen/io-input.md) +- [docs/mitc4-shell-feast-eigen/io-schema.md](../../docs/mitc4-shell-feast-eigen/io-schema.md) +- [docs/mitc4-shell-feast-eigen/io-mapping.md](../../docs/mitc4-shell-feast-eigen/io-mapping.md) +- [docs/mitc4-shell-feast-eigen/implementation-plan.md](../../docs/mitc4-shell-feast-eigen/implementation-plan.md) +- [docs/mitc4-shell-feast-eigen/implementation-environment.md](../../docs/mitc4-shell-feast-eigen/implementation-environment.md) +- [docs/mitc4-shell-feast-eigen/implementation-interfaces.md](../../docs/mitc4-shell-feast-eigen/implementation-interfaces.md) +- [docs/mitc4-shell-feast-eigen/implementation-verification.md](../../docs/mitc4-shell-feast-eigen/implementation-verification.md) + +이 Step의 직접 계약: [formulation-eigen.md#e7-feast-경계와-deterministic-실행](../../docs/mitc4-shell-feast-eigen/formulation-eigen.md#e7-feast-경계와-deterministic-실행), [numerical-review-controls.md#c5-feast-controls와-bounded-interval-정책](../../docs/mitc4-shell-feast-eigen/numerical-review-controls.md#c5-feast-controls와-bounded-interval-정책), [numerical-review-controls.md#c6-initial-subspace-thread와-storage](../../docs/mitc4-shell-feast-eigen/numerical-review-controls.md#c6-initial-subspace-thread와-storage), [io-mapping.md#m2-backend와-failure-lifecycle](../../docs/mitc4-shell-feast-eigen/io-mapping.md#m2-backend와-failure-lifecycle), [formulation-eigen.md#e6-유한-search-interval과-요청-개수](../../docs/mitc4-shell-feast-eigen/formulation-eigen.md#e6-유한-search-interval과-요청-개수), [io-schema.md#o4-backend와-검증-evidence](../../docs/mitc4-shell-feast-eigen/io-schema.md#o4-backend와-검증-evidence). +논리 case의 전체 parameter/threshold/음성 inventory는 NR 원문과 [verification mapping](../../docs/mitc4-shell-feast-eigen/implementation-verification.md)을 함께 적용한다. + +## Owned paths + +다음 목록은 phase index `owned_paths`와 exact equality를 유지한다. 목록 밖 파일이 필요하면 보존하고 Coordinator에 반환한다. 다른 agent도 같은 worktree를 사용하므로 타인 변경을 되돌리지 않는다. + +```json +[ + "src/fesa/solvers/eigen/feast_backend.h", + "src/fesa/solvers/eigen/feast_backend.cpp", + "src/fesa/solvers/eigen/feast_initial_space.h", + "src/fesa/solvers/eigen/feast_initial_space.cpp", + "tests/unit/solvers/eigen/feast_backend_test.cpp", + "tests/unit/solvers/eigen/feast_initial_space_test.cpp", + "src/fesa/CMakeLists.txt", + "tests/CMakeLists.txt", + "include/fesa/solvers/eigen/eigen_solver.h", + "include/fesa/solvers/eigen/mkl_feast_eigen_solver.h", + "src/fesa/solvers/eigen/mkl_feast_eigen_solver.cpp", + "src/fesa/solvers/eigen/feast_search.h", + "src/fesa/solvers/eigen/feast_search.cpp", + "tests/unit/solvers/eigen/eigen_solver_test.cpp", + "tests/unit/solvers/eigen/mkl_feast_eigen_solver_test.cpp", + "tests/unit/solvers/eigen/feast_search_test.cpp", + "docs/mitc4-shell-feast-eigen/implementation-step4-evidence.md" +] +``` + +## 같은 session의 behavior별 TDD + +각 소단위는 아래 순서로 RED→observed failure→minimal GREEN→focused VERIFY를 완료한다. 마지막 소단위 뒤 full VERIFY를 한 번 수행하고 등록 Stop의 정상 전체검증도 받는다. Missing API의 정확한 compile/link failure는 RED일 수 있으나 configure/dependency 오류는 RED가 아니다. 이미 통과한 test를 새 RED라고 보고하지 않는다. + +### 1. 실제 MKL FEAST call, CSR/자원/initial-space 계약 + +Symbols: `eigen_internal::FeastBackend/FeastCallRequest/FeastCallResult; BuildFeastInitialSpace; actual feastinit/dfeast_scsrgv private calls`. + +**RED:** Private request tests에 malformed/missing/duplicate/nonfinite/0-based/out-of-range CSR, n²/n*m0/nnz+1 representation overflow와 allocation injection을 추가한다. Fixed uint64 sequence와 QR orthogonality/rank-failure, thread-local restore on every exit를 검사한다. 실제 linked MKL의 full-enclosure count/solve smoke test를 추가해 부재를 관찰한다. Mock call 성공을 real backend evidence로 대신하지 않는다. + +**Minimal GREEN:** C5/C6의 one-based upper CSR/identity B, fpm snapshots, count scratch n×n, m0 overwritten count와 solve m 구분을 구현한다. Neutral std integer records 밖 vendor MKL_INT를 노출하지 않는다. Per-call feastinit, fixed seed/nonpivoted QR, local thread guard, checked allocation RAII, raw status/history를 보존한다. API smoke의 enclosure는 matrix-derived로 만들고 known values로 fitting하지 않는다. Lowest-N search/completeness gate는 Step4에서 완성한다. + +**Focused VERIFY:** 아래 regex 중 해당 suite를 먼저 discovery하여 tests>0을 확인하고 같은 test를 재실행한다. Exact exit와 실패 이유를 behavior별로 기록한다. + +### 2. Prefix/guard/count 기반 lowest-N FEAST 탐색 + +Symbols: `EigenSolver::SolveLowest; MklFeastEigenSolver::SolveLowest; eigen_internal::SearchFeastSpectrum; EigenSolveResult/FeastCallEvidence`. + +**RED:** Actual C17 zero/N=n/simple spectra 및 C18 fortyfold cluster>N/tight distinct/dense-pattern spectra를 production search로 풀고 independent known ordered values/count history와 대조한다. Injected false count/low-mode omission이 residual·Gram만 통과해도 search는 실패해야 한다. C21 statuses/endpoint/nonmonotone/total!=n/m!=c와 C22 count512/solve3 경계 및 certified fallback을 먼저 실패시킨다. + +**Minimal GREEN:** A의 stable inf scale와 outward Gershgorin, C5 delta/guard/prefix/32+32 search/384+128 budget/ordered collision offsets를 구현한다. Safe c>=N bracket 및 m0 formula, admissible retry3·금지 retry, final prefix0/actual interval count 및 all-c columns를 반환한다. Count source는 실제 backend, zero count는 info0만 인정한다. Public request N은 불변이며 scale0의 model-derived fallback은 caller가 전달한다. Actual raw negative 값을 backend에서 clamp하지 않는다. C3의 full original-space validation은 Step5 소유다. + +**Focused VERIFY:** 아래 regex 중 해당 suite를 먼저 discovery하여 tests>0을 확인하고 같은 test를 재실행한다. Exact exit와 실패 이유를 behavior별로 기록한다. + +## Focused 명령 + +Workspace root의 PowerShell에서 실행한다. 초기 missing API RED라면 build의 expected failure를 기록하고 production 구현 후 같은 명령을 다시 실행한다. + +```powershell +cmake -S . -B .harness/build -A x64 +cmake --build .harness/build --config Debug --target fesa_tests +ctest --test-dir .harness/build -C Debug -R '^(FeastBackend|FeastInitialSpace|MklPardisoSolver|EigenSolver|MklFeastEigenSolver|FeastSearch)\.' --show-only=json-v1 +ctest --test-dir .harness/build -C Debug -R '^(FeastBackend|FeastInitialSpace|MklPardisoSolver|EigenSolver|MklFeastEigenSolver|FeastSearch)\.' --output-on-failure +``` + +Configure exit는 항상0이어야 한다. GREEN에서는 위 모든 exit0, discovered selected tests>0, failures0이어야 한다. 각 호출의 `$LASTEXITCODE`를 즉시 기록하고 실패 뒤 후속 명령으로 덮어쓰지 않는다. + + +### 필수 신규 test discovery inventory + +- `MklFeastEigenSolver.MfeC17KnownLowestSpectra` +- `MklFeastEigenSolver.MfeC18RepeatedAndTightClusters` +- `FeastBackend.MfeC19RawSignedSpectra` +- `FeastSearch.MfeC21StatusAndHistoryFailures` +- `FeastSearch.MfeC22FiniteBudgetsAndCapacity` +- `FeastInitialSpace.MfeC22SeedQrAndRepresentation` + +위 이름 모두를 focused 및 full discovery JSON의 `tests[].name`에서 확인한다. Parameterized 전개가 필요하면 원 obligation→실제 discovered 이름을 evidence에 명시하고 모든 전개 case를 실행한다. 단지 selected count>0이거나 기존 suite만 존재하는 것은 실패다. V2의 해당 독립 oracle/mutation과 이 Step의 behavior assertions를 실제 구현해 각 결과를 기록한다. + +## Full VERIFY + +현재 실제 backend는 config absent→CMake/Visual Studio 18 2026/x64/`.harness/build`/Debug다. Dependency cache 준비는 [environment](../../docs/mitc4-shell-feast-eigen/implementation-environment.md)의 정확한 명령과 preflight를 따른다. Generator 변경이나 preset fallback을 임의로 하지 않는다. + +```powershell +cmake -S . -B .harness/build -A x64 +if ($LASTEXITCODE -ne 0) { throw 'configure failed' } +cmake --build .harness/build --config Debug +if ($LASTEXITCODE -ne 0) { throw 'build failed' } +ctest --test-dir .harness/build -C Debug --show-only=json-v1 +if ($LASTEXITCODE -ne 0) { throw 'discovery failed' } +ctest --test-dir .harness/build -C Debug --output-on-failure +if ($LASTEXITCODE -ne 0) { throw 'full CTest failed' } +uv run --with pytest python -B -m pytest -v -rs +if ($LASTEXITCODE -ne 0) { throw 'full pytest failed' } +``` + +전체 discovery의 test count와 실제 실행 count를 대조하고 skipped/missing/unobserved를 성공으로 합치지 않는다. 기존 target의 `/W4 /WX`를 유지하고 새 compiler/link warning0을 확인한다. 등록 Stop의 전체 검증은 그대로 수행되며 수동 hook 실행·state/reentry 조작으로 대체하지 않는다. Step 4에서 영향받는 C++ binary가 바뀌면 기존 reference helper의 cache 재사용 여부와 실제 solve 호출을 구분한다. 최종 fresh portfolio의 권위는 Step 7이다. + +## Evidence와 종료 + +- `docs/mitc4-shell-feast-eigen/implementation-step4-evidence.md` + +이 Step의 evidence에는 Feature/owner/r2, exact owned changed paths, RED→GREEN 명령·actual exits·기간·핵심 수치, focused/full counts, MSVC/x64/Debug/dependency/runtime selection, warning 수, upstream case/requirement 연결, 미실행 및 residual risk를 기록한다. Raw logs는 Git ignored `.harness/build/mitc4-eigen-evidence/step4/`에 보존한다. 각 CTest 호출 직후 해당 `Testing/Temporary/LastTest.log`를 고유 RED/focused/full 이름으로 복사하여 이후 Stop 로그와 섞지 않는다. Binary/reference/result hash와 run freshness는 적용되는 경우 기록한다. + + +보고서 작성 시점에는 마지막 registered Stop/Codex exit가 아직 발생하지 않을 수 있다. Implementation은 실제 완료된 manual 검증과 미관찰 Stop을 구분하고 미래 성공을 선기록하지 않는다. `completed` payload는 그 자체로 Stop 성공 증거가 아니다. Executor 종료 뒤 Coordinator가 raw output·등록 Hook evidence·actual exit를 management 문서에서 사후 감사한다. Specialist 보고서 본문은 Coordinator가 대신 수정하지 않는다. + +Manual AC가 성공하면 Executor가 허용한 `phases/mitc4-shell-feast-eigen/index.json`의 **현재 Step 4만** `status=completed`와 비어 있지 않은 `summary`를 기록한다. 구현/검증 실패는 `error/error_message`, 환경·필수 준비 차단은 `blocked/blocked_reason`이다. `owned_paths`, 이름/번호, 다른 Step/top index, timestamp, attempt_history는 수정하지 않는다. `step4-output.json`은 Executor 생성 기록이며 ignored 상태를 유지한다. 마지막 응답은 공통 handoff envelope다. Phase 전체 또는 workflow gate의 자기 승인은 하지 않는다. + +## 제외와 중단 조건 + +Physics/formulation/I/O/tolerance/원본 reference·기존 feature 보고서 변경, 외부 solver, spectrum fitting, eigen 외부 vector/frequency/stress gate, sparse rank cutoff, sandbox 확대, retry-budget 변경, Git branch/commit/push/tag/release는 소유 범위 밖이다. 명백한 구현 결함은 이 exact scope 안에서 최소 수정한다. 계약 결함은 정확한 owner로 `return-upstream`, 실행 환경 실패는 actual command/exit와 함께 Coordinator로 반환한다. 동일 실패를 transport timeout으로 가장하거나 evidence를 지우고 재실행하지 않는다. diff --git a/phases/mitc4-shell-feast-eigen/step5.md b/phases/mitc4-shell-feast-eigen/step5.md new file mode 100644 index 0000000..7f33f0e --- /dev/null +++ b/phases/mitc4-shell-feast-eigen/step5.md @@ -0,0 +1,161 @@ +# Step 5: 전체 c 검증과 별도 frequency procedure + +- Feature ID: `mitc4-shell-feast-eigen` +- Plan owner: `implementation-planning-agent` +- Execution owner: `implementation-agent` +- Input contract revision: `r2` +- Phase: `mitc4-shell-feast-eigen` +- Dependency: 동일 phase의 Step 4 completed +- Requirement IDs: `FEM-REQ-MITC4-EIGEN-001`, `FEM-REQ-MITC4-EIGEN-002`, `FEM-REQ-MITC4-EIGEN-003`, `FEM-REQ-MITC4-EIGEN-007`, `FEM-REQ-MITC4-EIGEN-008`, `FEM-REQ-MITC4-EIGEN-009`, `FEM-REQ-MITC4-EIGEN-010`, `FEM-REQ-MITC4-EIGEN-011`, `FEM-REQ-MITC4-EIGEN-012`, `FEM-REQ-MITC4-EIGEN-013`, `FEM-REQ-MITC4-EIGEN-014`, `FEM-REQ-MITC4-EIGEN-017`, `FEM-REQ-MITC4-EIGEN-018`, `FEM-REQ-MITC4-EIGEN-019` +- Logical cases: `MFE-C06`, `MFE-C08`, `MFE-C11`, `MFE-C13`, `MFE-C14`, `MFE-C16`, `MFE-C17`, `MFE-C18`, `MFE-C19`, `MFE-C20`, `MFE-C21`, `MFE-C23`, `MFE-C24`, `MFE-C27` +- I/O obligations: `IO-T01`, `IO-T02`, `IO-T04`, `IO-T05`, `IO-T06`, `IO-T07`, `IO-T11` + +## 필수 입력과 계약 + +Feature 폴더는 `docs/mitc4-shell-feast-eigen/`다. 아래 current r2 입력을 읽고 기존 완료 Step 코드와 evidence를 대조한다. 연결된 upstream contract는 read-only다. + +- [AGENTS.md](../../AGENTS.md) +- [docs/SOLVER_AGENT_DESIGN.md](../../docs/SOLVER_AGENT_DESIGN.md) +- [docs/FEATURE_DOCUMENTATION.md](../../docs/FEATURE_DOCUMENTATION.md) +- [docs/PRD.md](../../docs/PRD.md) +- [docs/ARCHITECTURE.md](../../docs/ARCHITECTURE.md) +- [docs/ADR.md](../../docs/ADR.md) +- [docs/CODINGSTYLE.md](../../docs/CODINGSTYLE.md) +- [docs/TOLERANCE.md](../../docs/TOLERANCE.md) +- [.codex/skills/fem-implementation-tdd/SKILL.md](../../.codex/skills/fem-implementation-tdd/SKILL.md) +- [.agents/skills/harness/SKILL.md](../../.agents/skills/harness/SKILL.md) +- [.codex/agents/implementation-agent.toml](../../.codex/agents/implementation-agent.toml) +- [docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md](../../docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md) +- [docs/mitc4-shell-feast-eigen/PRD.md](../../docs/mitc4-shell-feast-eigen/PRD.md) +- [docs/mitc4-shell-feast-eigen/ADR.md](../../docs/mitc4-shell-feast-eigen/ADR.md) +- [docs/mitc4-shell-feast-eigen/coordination.md](../../docs/mitc4-shell-feast-eigen/coordination.md) +- [docs/mitc4-shell-feast-eigen/requirements.md](../../docs/mitc4-shell-feast-eigen/requirements.md) +- [docs/mitc4-shell-feast-eigen/requirements-evidence.md](../../docs/mitc4-shell-feast-eigen/requirements-evidence.md) +- [docs/mitc4-shell-feast-eigen/research.md](../../docs/mitc4-shell-feast-eigen/research.md) +- [docs/mitc4-shell-feast-eigen/research-evidence.md](../../docs/mitc4-shell-feast-eigen/research-evidence.md) +- [docs/mitc4-shell-feast-eigen/formulation.md](../../docs/mitc4-shell-feast-eigen/formulation.md) +- [docs/mitc4-shell-feast-eigen/formulation-mass.md](../../docs/mitc4-shell-feast-eigen/formulation-mass.md) +- [docs/mitc4-shell-feast-eigen/formulation-eigen.md](../../docs/mitc4-shell-feast-eigen/formulation-eigen.md) +- [docs/mitc4-shell-feast-eigen/formulation-verification.md](../../docs/mitc4-shell-feast-eigen/formulation-verification.md) +- [docs/mitc4-shell-feast-eigen/formulation-stabilization.md](../../docs/mitc4-shell-feast-eigen/formulation-stabilization.md) +- [docs/mitc4-shell-feast-eigen/numerical-review.md](../../docs/mitc4-shell-feast-eigen/numerical-review.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-evidence.md](../../docs/mitc4-shell-feast-eigen/numerical-review-evidence.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-controls.md](../../docs/mitc4-shell-feast-eigen/numerical-review-controls.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-cases.md](../../docs/mitc4-shell-feast-eigen/numerical-review-cases.md) +- [docs/mitc4-shell-feast-eigen/reference-model.md](../../docs/mitc4-shell-feast-eigen/reference-model.md) +- [docs/mitc4-shell-feast-eigen/io.md](../../docs/mitc4-shell-feast-eigen/io.md) +- [docs/mitc4-shell-feast-eigen/io-input.md](../../docs/mitc4-shell-feast-eigen/io-input.md) +- [docs/mitc4-shell-feast-eigen/io-schema.md](../../docs/mitc4-shell-feast-eigen/io-schema.md) +- [docs/mitc4-shell-feast-eigen/io-mapping.md](../../docs/mitc4-shell-feast-eigen/io-mapping.md) +- [docs/mitc4-shell-feast-eigen/implementation-plan.md](../../docs/mitc4-shell-feast-eigen/implementation-plan.md) +- [docs/mitc4-shell-feast-eigen/implementation-environment.md](../../docs/mitc4-shell-feast-eigen/implementation-environment.md) +- [docs/mitc4-shell-feast-eigen/implementation-interfaces.md](../../docs/mitc4-shell-feast-eigen/implementation-interfaces.md) +- [docs/mitc4-shell-feast-eigen/implementation-verification.md](../../docs/mitc4-shell-feast-eigen/implementation-verification.md) + +이 Step의 직접 계약: [formulation-verification.md](../../docs/mitc4-shell-feast-eigen/formulation-verification.md), [numerical-review-controls.md#c3-eigenpair-및-물리-내부-판정](../../docs/mitc4-shell-feast-eigen/numerical-review-controls.md#c3-eigenpair-및-물리-내부-판정), [numerical-review-controls.md#c4-repeated-subspace와-결정론](../../docs/mitc4-shell-feast-eigen/numerical-review-controls.md#c4-repeated-subspace와-결정론), [io-schema.md#o3-고유치와-modal-vectors](../../docs/mitc4-shell-feast-eigen/io-schema.md#o3-고유치와-modal-vectors), [io-schema.md#o4-backend와-검증-evidence](../../docs/mitc4-shell-feast-eigen/io-schema.md#o4-backend와-검증-evidence), [io-mapping.md#m1-input에서-equationresult까지](../../docs/mitc4-shell-feast-eigen/io-mapping.md#m1-input에서-equationresult까지), [io-mapping.md#m2-backend와-failure-lifecycle](../../docs/mitc4-shell-feast-eigen/io-mapping.md#m2-backend와-failure-lifecycle), [formulation-eigen.md](../../docs/mitc4-shell-feast-eigen/formulation-eigen.md), [formulation-stabilization.md#s6-nr-mfe-001의-새-algebraic-target과-정적-대응](../../docs/mitc4-shell-feast-eigen/formulation-stabilization.md#s6-nr-mfe-001의-새-algebraic-target과-정적-대응). +논리 case의 전체 parameter/threshold/음성 inventory는 NR 원문과 [verification mapping](../../docs/mitc4-shell-feast-eigen/implementation-verification.md)을 함께 적용한다. + +## Owned paths + +다음 목록은 phase index `owned_paths`와 exact equality를 유지한다. 목록 밖 파일이 필요하면 보존하고 Coordinator에 반환한다. 다른 agent도 같은 worktree를 사용하므로 타인 변경을 되돌리지 않는다. + +```json +[ + "include/fesa/analysis/eigen_analysis_state.h", + "src/fesa/analysis/eigen_analysis_state.cpp", + "src/fesa/analysis/eigen_validation.h", + "src/fesa/analysis/eigen_validation.cpp", + "tests/unit/analysis/eigen_analysis_state_test.cpp", + "tests/unit/analysis/eigen_validation_test.cpp", + "src/fesa/CMakeLists.txt", + "tests/CMakeLists.txt", + "include/fesa/analysis/linear_frequency_procedure.h", + "src/fesa/analysis/linear_frequency_procedure.cpp", + "tests/integration/analysis/linear_frequency_procedure_test.cpp", + "docs/mitc4-shell-feast-eigen/implementation-step5-evidence.md" +] +``` + +## 같은 session의 behavior별 TDD + +각 소단위는 아래 순서로 RED→observed failure→minimal GREEN→focused VERIFY를 완료한다. 마지막 소단위 뒤 full VERIFY를 한 번 수행하고 등록 Stop의 정상 전체검증도 받는다. Missing API의 정확한 compile/link failure는 RED일 수 있으나 configure/dependency 오류는 RED가 아니다. 이미 통과한 test를 새 RED라고 보고하지 않는다. + +### 1. 전체 c 검증, raw mode 분류와 N개 candidate state + +Symbols: `EigenAnalysisState::Swap; eigen_internal::ValidateEigenpairs; EigenMode/EigenpairCheck/EigenVerificationEvidence`. + +**RED:** C16 wrong mass/lambda/pairing/constraint/null coordinate 및 c>N의 버려질 column만 손상한 결과를 주입해 실패시킨다. eta_r/eta_w/rho_B/Gram/norm/energy 각각 boundary와 zero branch를 검사한다. Actual C18 solver 결과에 all-c metrics를 적용하고 repeated projector3회, C19 ±tau/nextafter·smallnegative frequency omission·positive underflow/overflow를 검사한다. + +**Minimal GREEN:** V1~V5/C1~C4의 같은 실제 ML로 복원·mass normalize·full original free residual·operator residual·전체 c Gram/energy를 계산한다. 실패한 column을 truncation으로 숨기지 않는다. Stable paired sort/sign/connected diagnostic cluster 뒤 처음 N만 state에 저장하고 전체 c scalar checks/call history는 보존한다. O3/O4 raw negative/classification/frequency subset와 validity flags를 정확히 구현한다. Prepared state의 Swap은 allocation/validation 없이 noexcept이어야 한다. + +**Focused VERIFY:** 아래 regex 중 해당 suite를 먼저 discovery하여 tests>0을 확인하고 같은 test를 재실행한다. Exact exit와 실패 이유를 behavior별로 기록한다. + +### 2. 별도 frequency lifecycle의 domain-to-mode 통합 + +Symbols: `LinearFrequencyProcedureExecutor::Execute; LinearFrequencyExecutionResult`. + +**RED:** Small input→Domain→actual FEAST→candidate의 typed integration을 먼저 추가한다. C08 lambda10369/450와 rotated same BC, free6 rigid modes, n0/N>n/mixed-node-rank0, source renumbering, density4/unit1024와 원 constraints를 검증한다. Spy static/nonlinear executor를 전혀 호출하지 않음, 실패 시 기존 accepted state 미변경을 검사한다. + +**Minimal GREEN:** Executor는 typed factory/kernel→consistent snapshot→lumped→deterministic K/ML→DofManager→ReduceEigenSystem→SolveLowest→ValidateEigenpairs 순서를 소유한다. Model validation 완료 후 source location을 backend diagnostics에 연결한다. Domain/view/workspace lifetime을 유지하고 candidate를 반환한다. LinearStaticAnalysis::Run은 변경하지 않는다. Output path/log/final replacement는 Step6에서 연결하며 이 단계는 저장 성공을 주장하지 않는다. + +**Focused VERIFY:** 아래 regex 중 해당 suite를 먼저 discovery하여 tests>0을 확인하고 같은 test를 재실행한다. Exact exit와 실패 이유를 behavior별로 기록한다. + +## Focused 명령 + +Workspace root의 PowerShell에서 실행한다. 초기 missing API RED라면 build의 expected failure를 기록하고 production 구현 후 같은 명령을 다시 실행한다. + +```powershell +cmake -S . -B .harness/build -A x64 +cmake --build .harness/build --config Debug --target fesa_tests +ctest --test-dir .harness/build -C Debug -R '^(EigenAnalysisState|EigenValidation|MklFeastEigenSolver|EigenReduction|LinearFrequencyProcedure|FrequencyDomain|Mitc4Covariance)\.' --show-only=json-v1 +ctest --test-dir .harness/build -C Debug -R '^(EigenAnalysisState|EigenValidation|MklFeastEigenSolver|EigenReduction|LinearFrequencyProcedure|FrequencyDomain|Mitc4Covariance)\.' --output-on-failure +``` + +Configure exit는 항상0이어야 한다. GREEN에서는 위 모든 exit0, discovered selected tests>0, failures0이어야 한다. 각 호출의 `$LASTEXITCODE`를 즉시 기록하고 실패 뒤 후속 명령으로 덮어쓰지 않는다. + + +### 필수 신규 test discovery inventory + +- `EigenValidation.MfeC16OriginalMassAndPairing` +- `EigenValidation.MfeC19RawSignedEigenvalues` +- `LinearFrequencyProcedure.MfeC11SixPhysicalRigidModes` +- `LinearFrequencyProcedure.MfeC20DensityAndUnits` +- `LinearFrequencyProcedure.MfeC08PartialBcEigenvalue` +- `EigenValidation.MfeC21RejectsUnselectedColumnCorruption` +- `EigenAnalysisState.MfeC24NoFailSwap` + +위 이름 모두를 focused 및 full discovery JSON의 `tests[].name`에서 확인한다. Parameterized 전개가 필요하면 원 obligation→실제 discovered 이름을 evidence에 명시하고 모든 전개 case를 실행한다. 단지 selected count>0이거나 기존 suite만 존재하는 것은 실패다. V2의 해당 독립 oracle/mutation과 이 Step의 behavior assertions를 실제 구현해 각 결과를 기록한다. + +## Full VERIFY + +현재 실제 backend는 config absent→CMake/Visual Studio 18 2026/x64/`.harness/build`/Debug다. Dependency cache 준비는 [environment](../../docs/mitc4-shell-feast-eigen/implementation-environment.md)의 정확한 명령과 preflight를 따른다. Generator 변경이나 preset fallback을 임의로 하지 않는다. + +```powershell +cmake -S . -B .harness/build -A x64 +if ($LASTEXITCODE -ne 0) { throw 'configure failed' } +cmake --build .harness/build --config Debug +if ($LASTEXITCODE -ne 0) { throw 'build failed' } +ctest --test-dir .harness/build -C Debug --show-only=json-v1 +if ($LASTEXITCODE -ne 0) { throw 'discovery failed' } +ctest --test-dir .harness/build -C Debug --output-on-failure +if ($LASTEXITCODE -ne 0) { throw 'full CTest failed' } +uv run --with pytest python -B -m pytest -v -rs +if ($LASTEXITCODE -ne 0) { throw 'full pytest failed' } +``` + +전체 discovery의 test count와 실제 실행 count를 대조하고 skipped/missing/unobserved를 성공으로 합치지 않는다. 기존 target의 `/W4 /WX`를 유지하고 새 compiler/link warning0을 확인한다. 등록 Stop의 전체 검증은 그대로 수행되며 수동 hook 실행·state/reentry 조작으로 대체하지 않는다. Step 5에서 영향받는 C++ binary가 바뀌면 기존 reference helper의 cache 재사용 여부와 실제 solve 호출을 구분한다. 최종 fresh portfolio의 권위는 Step 7이다. + +## Evidence와 종료 + +- `docs/mitc4-shell-feast-eigen/implementation-step5-evidence.md` + +이 Step의 evidence에는 Feature/owner/r2, exact owned changed paths, RED→GREEN 명령·actual exits·기간·핵심 수치, focused/full counts, MSVC/x64/Debug/dependency/runtime selection, warning 수, upstream case/requirement 연결, 미실행 및 residual risk를 기록한다. Raw logs는 Git ignored `.harness/build/mitc4-eigen-evidence/step5/`에 보존한다. 각 CTest 호출 직후 해당 `Testing/Temporary/LastTest.log`를 고유 RED/focused/full 이름으로 복사하여 이후 Stop 로그와 섞지 않는다. Binary/reference/result hash와 run freshness는 적용되는 경우 기록한다. + + +보고서 작성 시점에는 마지막 registered Stop/Codex exit가 아직 발생하지 않을 수 있다. Implementation은 실제 완료된 manual 검증과 미관찰 Stop을 구분하고 미래 성공을 선기록하지 않는다. `completed` payload는 그 자체로 Stop 성공 증거가 아니다. Executor 종료 뒤 Coordinator가 raw output·등록 Hook evidence·actual exit를 management 문서에서 사후 감사한다. Specialist 보고서 본문은 Coordinator가 대신 수정하지 않는다. + +Manual AC가 성공하면 Executor가 허용한 `phases/mitc4-shell-feast-eigen/index.json`의 **현재 Step 5만** `status=completed`와 비어 있지 않은 `summary`를 기록한다. 구현/검증 실패는 `error/error_message`, 환경·필수 준비 차단은 `blocked/blocked_reason`이다. `owned_paths`, 이름/번호, 다른 Step/top index, timestamp, attempt_history는 수정하지 않는다. `step5-output.json`은 Executor 생성 기록이며 ignored 상태를 유지한다. 마지막 응답은 공통 handoff envelope다. Phase 전체 또는 workflow gate의 자기 승인은 하지 않는다. + +## 제외와 중단 조건 + +Physics/formulation/I/O/tolerance/원본 reference·기존 feature 보고서 변경, 외부 solver, spectrum fitting, eigen 외부 vector/frequency/stress gate, sparse rank cutoff, sandbox 확대, retry-budget 변경, Git branch/commit/push/tag/release는 소유 범위 밖이다. 명백한 구현 결함은 이 exact scope 안에서 최소 수정한다. 계약 결함은 정확한 owner로 `return-upstream`, 실행 환경 실패는 actual command/exit와 함께 Coordinator로 반환한다. 동일 실패를 transport timeout으로 가장하거나 evidence를 지우고 재실행하지 않는다. diff --git a/phases/mitc4-shell-feast-eigen/step6.md b/phases/mitc4-shell-feast-eigen/step6.md new file mode 100644 index 0000000..0a1e703 --- /dev/null +++ b/phases/mitc4-shell-feast-eigen/step6.md @@ -0,0 +1,168 @@ +# Step 6: Additive HDF5와 CLI candidate transaction + +- Feature ID: `mitc4-shell-feast-eigen` +- Plan owner: `implementation-planning-agent` +- Execution owner: `implementation-agent` +- Input contract revision: `r2` +- Phase: `mitc4-shell-feast-eigen` +- Dependency: 동일 phase의 Step 5 completed +- Requirement IDs: `FEM-REQ-MITC4-EIGEN-001`, `FEM-REQ-MITC4-EIGEN-015`, `FEM-REQ-MITC4-EIGEN-016`, `FEM-REQ-MITC4-EIGEN-017`, `FEM-REQ-MITC4-EIGEN-018`, `FEM-REQ-MITC4-EIGEN-019`, `FEM-REQ-MITC4-EIGEN-021`, `FEM-REQ-MITC4-EIGEN-024` +- Logical cases: `MFE-C19`, `MFE-C23`, `MFE-C24`, `MFE-C26` +- I/O obligations: `IO-T01`, `IO-T03`, `IO-T05`, `IO-T07`, `IO-T08`, `IO-T10` + +## 필수 입력과 계약 + +Feature 폴더는 `docs/mitc4-shell-feast-eigen/`다. 아래 current r2 입력을 읽고 기존 완료 Step 코드와 evidence를 대조한다. 연결된 upstream contract는 read-only다. + +- [AGENTS.md](../../AGENTS.md) +- [docs/SOLVER_AGENT_DESIGN.md](../../docs/SOLVER_AGENT_DESIGN.md) +- [docs/FEATURE_DOCUMENTATION.md](../../docs/FEATURE_DOCUMENTATION.md) +- [docs/PRD.md](../../docs/PRD.md) +- [docs/ARCHITECTURE.md](../../docs/ARCHITECTURE.md) +- [docs/ADR.md](../../docs/ADR.md) +- [docs/CODINGSTYLE.md](../../docs/CODINGSTYLE.md) +- [docs/TOLERANCE.md](../../docs/TOLERANCE.md) +- [.codex/skills/fem-implementation-tdd/SKILL.md](../../.codex/skills/fem-implementation-tdd/SKILL.md) +- [.agents/skills/harness/SKILL.md](../../.agents/skills/harness/SKILL.md) +- [.codex/agents/implementation-agent.toml](../../.codex/agents/implementation-agent.toml) +- [docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md](../../docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md) +- [docs/mitc4-shell-feast-eigen/PRD.md](../../docs/mitc4-shell-feast-eigen/PRD.md) +- [docs/mitc4-shell-feast-eigen/ADR.md](../../docs/mitc4-shell-feast-eigen/ADR.md) +- [docs/mitc4-shell-feast-eigen/coordination.md](../../docs/mitc4-shell-feast-eigen/coordination.md) +- [docs/mitc4-shell-feast-eigen/requirements.md](../../docs/mitc4-shell-feast-eigen/requirements.md) +- [docs/mitc4-shell-feast-eigen/requirements-evidence.md](../../docs/mitc4-shell-feast-eigen/requirements-evidence.md) +- [docs/mitc4-shell-feast-eigen/research.md](../../docs/mitc4-shell-feast-eigen/research.md) +- [docs/mitc4-shell-feast-eigen/research-evidence.md](../../docs/mitc4-shell-feast-eigen/research-evidence.md) +- [docs/mitc4-shell-feast-eigen/formulation.md](../../docs/mitc4-shell-feast-eigen/formulation.md) +- [docs/mitc4-shell-feast-eigen/formulation-mass.md](../../docs/mitc4-shell-feast-eigen/formulation-mass.md) +- [docs/mitc4-shell-feast-eigen/formulation-eigen.md](../../docs/mitc4-shell-feast-eigen/formulation-eigen.md) +- [docs/mitc4-shell-feast-eigen/formulation-verification.md](../../docs/mitc4-shell-feast-eigen/formulation-verification.md) +- [docs/mitc4-shell-feast-eigen/formulation-stabilization.md](../../docs/mitc4-shell-feast-eigen/formulation-stabilization.md) +- [docs/mitc4-shell-feast-eigen/numerical-review.md](../../docs/mitc4-shell-feast-eigen/numerical-review.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-evidence.md](../../docs/mitc4-shell-feast-eigen/numerical-review-evidence.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-controls.md](../../docs/mitc4-shell-feast-eigen/numerical-review-controls.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-cases.md](../../docs/mitc4-shell-feast-eigen/numerical-review-cases.md) +- [docs/mitc4-shell-feast-eigen/reference-model.md](../../docs/mitc4-shell-feast-eigen/reference-model.md) +- [docs/mitc4-shell-feast-eigen/io.md](../../docs/mitc4-shell-feast-eigen/io.md) +- [docs/mitc4-shell-feast-eigen/io-input.md](../../docs/mitc4-shell-feast-eigen/io-input.md) +- [docs/mitc4-shell-feast-eigen/io-schema.md](../../docs/mitc4-shell-feast-eigen/io-schema.md) +- [docs/mitc4-shell-feast-eigen/io-mapping.md](../../docs/mitc4-shell-feast-eigen/io-mapping.md) +- [docs/mitc4-shell-feast-eigen/implementation-plan.md](../../docs/mitc4-shell-feast-eigen/implementation-plan.md) +- [docs/mitc4-shell-feast-eigen/implementation-environment.md](../../docs/mitc4-shell-feast-eigen/implementation-environment.md) +- [docs/mitc4-shell-feast-eigen/implementation-interfaces.md](../../docs/mitc4-shell-feast-eigen/implementation-interfaces.md) +- [docs/mitc4-shell-feast-eigen/implementation-verification.md](../../docs/mitc4-shell-feast-eigen/implementation-verification.md) + +이 Step의 직접 계약: [io-schema.md](../../docs/mitc4-shell-feast-eigen/io-schema.md), [io-mapping.md#m2-backend와-failure-lifecycle](../../docs/mitc4-shell-feast-eigen/io-mapping.md#m2-backend와-failure-lifecycle), [io-input.md#i6-fail-closed-validation과-diagnostics](../../docs/mitc4-shell-feast-eigen/io-input.md#i6-fail-closed-validation과-diagnostics), [formulation-eigen.md#e8-mode-identity-normalization과-상태](../../docs/mitc4-shell-feast-eigen/formulation-eigen.md#e8-mode-identity-normalization과-상태). +논리 case의 전체 parameter/threshold/음성 inventory는 NR 원문과 [verification mapping](../../docs/mitc4-shell-feast-eigen/implementation-verification.md)을 함께 적용한다. + +## Owned paths + +다음 목록은 phase index `owned_paths`와 exact equality를 유지한다. 목록 밖 파일이 필요하면 보존하고 Coordinator에 반환한다. 다른 agent도 같은 worktree를 사용하므로 타인 변경을 되돌리지 않는다. + +```json +[ + "include/fesa/results/eigen_results_writer.h", + "include/fesa/io/hdf5/eigen_hdf5_results_writer.h", + "src/fesa/io/hdf5/eigen_hdf5_results_writer.cpp", + "src/fesa/io/hdf5/eigen_hdf5_schema.h", + "src/fesa/io/hdf5/eigen_hdf5_schema.cpp", + "src/fesa/io/hdf5/hdf5_model_writer.h", + "src/fesa/io/hdf5/hdf5_model_writer.cpp", + "tests/unit/results/eigen_results_writer_test.cpp", + "tests/unit/io/hdf5/eigen_hdf5_results_writer_test.cpp", + "tests/unit/io/hdf5/eigen_hdf5_schema_test.cpp", + "tests/unit/io/hdf5/hdf5_model_writer_test.cpp", + "src/fesa/CMakeLists.txt", + "tests/CMakeLists.txt", + "include/fesa/analysis/prepared_analysis.h", + "src/fesa/analysis/prepared_analysis.cpp", + "src/fesa/app/fesa_application.cpp", + "tests/unit/analysis/prepared_analysis_test.cpp", + "tests/integration/app/fesa_application_test.cpp", + "tests/integration/app/frequency_application_test.cpp", + "tests/integration/analysis/linear_frequency_procedure_test.cpp", + "docs/mitc4-shell-feast-eigen/implementation-step6-evidence.md" +] +``` + +## 같은 session의 behavior별 TDD + +각 소단위는 아래 순서로 RED→observed failure→minimal GREEN→focused VERIFY를 완료한다. 마지막 소단위 뒤 full VERIFY를 한 번 수행하고 등록 Stop의 정상 전체검증도 받는다. Missing API의 정확한 compile/link failure는 RED일 수 있으나 configure/dependency 오류는 RED가 아니다. 이미 통과한 test를 새 RED라고 보고하지 않는다. + +### 1. Additive eigen HDF5 write/self-check + +Symbols: `EigenResultsWriter::Write; EigenHdf5ResultsWriter::Write; hdf5_internal::WriteEigenSchema/SelfCheckEigen; model-only WriteModelData`. + +**RED:** 독립 HDF5 C API reader test에서 O1~O5 inventory의 exact types/compound fields/shapes/attributes를 기대해 missing writer/schema failure를 관찰한다. N/c/request/source Step-2 vs group Step-1, negative/zero/positive frequencies, flags/units/source records/128 fpm를 검증한다. Missing/duplicate/extra mode/nonfinite/wrong procedure/mass/backend/dimension 및 reopen/self-check failure를 각각 주입한다. 기존 static schema0/1 reader test도 실행한다. + +**Minimal GREEN:** 새 eigen serializer/self-check를 별도 private module로 구현한다. 기존 model writer에서 metadata-free model dataset 작성 seam만 분리해 공유하며 static WriteModel의 output은 보존한다. N persistent vectors, all-c scalar metrics/call history와 exact source identity를 쓴다. Candidate write/flush/close/reopen/self-check 후 기존 AtomicFinalizeValidatedCandidate를 사용한다. HDF5/Win32 types는 private이고 official final path 계약은 그대로다. Static result/reaction/accepted_frames를 eigen에 만들지 않는다. + +**Focused VERIFY:** 아래 regex 중 해당 suite를 먼저 discovery하여 tests>0을 확인하고 같은 test를 재실행한다. Exact exit와 실패 이유를 behavior별로 기록한다. + +### 2. CLI dispatch, log/lock와 final-state transaction + +Symbols: `PreparedAnalysisOutcome frequency variant; ExecutePreparedAnalysis/FinalizePreparedAnalysisResult frequency overload; FesaApplication::Run`. + +**RED:** FesaApplication의 유일 CLI 입력으로 small frequency file을 실행해 lexical sibling h5/log와 exit0를 기대한다. 원본 no-op provenance와 stable source diagnostics, input/model/solver/output exit3/4/5/6를 검사한다. 기존 final/state hash를 준비하고 solve, validation, log open/close, lease, write/flush/close/reopen/self-check/replace failure를 각각 주입한다. First-run failure는 final 부재를 검사한다. + +**Minimal GREEN:** Prepared boundary에 별도 frequency executor/result/writer를 선택하는 overload를 추가하며 static 호출부 호환성을 유지한다. 기존 exclusive lease→log open/truncate→prepare/execute→log close→candidate finalization 순서에 연결한다. Eigen 정상 log는0bytes. Final replacement 성공 뒤 이미 준비된 EigenAnalysisState의 noexcept swap만 수행한다. 실패 state/final 보존을 generic 성공 bool로 숨기지 않는다. 테스트 주입 seam은 기존 private/injected interfaces 안에 두며 public CLI 옵션은 추가하지 않는다. + +**Focused VERIFY:** 아래 regex 중 해당 suite를 먼저 discovery하여 tests>0을 확인하고 같은 test를 재실행한다. Exact exit와 실패 이유를 behavior별로 기록한다. + +## Focused 명령 + +Workspace root의 PowerShell에서 실행한다. 초기 missing API RED라면 build의 expected failure를 기록하고 production 구현 후 같은 명령을 다시 실행한다. + +```powershell +cmake -S . -B .harness/build -A x64 +cmake --build .harness/build --config Debug --target fesa_tests +ctest --test-dir .harness/build -C Debug -R '^(EigenResultsWriter|EigenHdf5ResultsWriter|EigenHdf5Schema|Hdf5ModelWriter|Hdf5ResultsWriter|NonlinearHdf5ResultsWriter|Hdf5WriterComponents|PreparedAnalysis|FrequencyApplication|FesaApplication|LinearFrequencyProcedure|ShellSurfacePressureApplication)\.' --show-only=json-v1 +ctest --test-dir .harness/build -C Debug -R '^(EigenResultsWriter|EigenHdf5ResultsWriter|EigenHdf5Schema|Hdf5ModelWriter|Hdf5ResultsWriter|NonlinearHdf5ResultsWriter|Hdf5WriterComponents|PreparedAnalysis|FrequencyApplication|FesaApplication|LinearFrequencyProcedure|ShellSurfacePressureApplication)\.' --output-on-failure +``` + +Configure exit는 항상0이어야 한다. GREEN에서는 위 모든 exit0, discovered selected tests>0, failures0이어야 한다. 각 호출의 `$LASTEXITCODE`를 즉시 기록하고 실패 뒤 후속 명령으로 덮어쓰지 않는다. + + +### 필수 신규 test discovery inventory + +- `EigenHdf5Schema.MfeC24RoundTripAndRejection` +- `FrequencyApplication.MfeC24PreservesFinalAndState` +- `EigenHdf5ResultsWriter.MfeC24AtomicCandidateFailures` +- `PreparedAnalysis.MfeC23DispatchesFrequency` +- `Hdf5ModelWriter.MfeC26StaticInventoryPreserved` + +위 이름 모두를 focused 및 full discovery JSON의 `tests[].name`에서 확인한다. Parameterized 전개가 필요하면 원 obligation→실제 discovered 이름을 evidence에 명시하고 모든 전개 case를 실행한다. 단지 selected count>0이거나 기존 suite만 존재하는 것은 실패다. V2의 해당 독립 oracle/mutation과 이 Step의 behavior assertions를 실제 구현해 각 결과를 기록한다. + +## Full VERIFY + +현재 실제 backend는 config absent→CMake/Visual Studio 18 2026/x64/`.harness/build`/Debug다. Dependency cache 준비는 [environment](../../docs/mitc4-shell-feast-eigen/implementation-environment.md)의 정확한 명령과 preflight를 따른다. Generator 변경이나 preset fallback을 임의로 하지 않는다. + +```powershell +cmake -S . -B .harness/build -A x64 +if ($LASTEXITCODE -ne 0) { throw 'configure failed' } +cmake --build .harness/build --config Debug +if ($LASTEXITCODE -ne 0) { throw 'build failed' } +ctest --test-dir .harness/build -C Debug --show-only=json-v1 +if ($LASTEXITCODE -ne 0) { throw 'discovery failed' } +ctest --test-dir .harness/build -C Debug --output-on-failure +if ($LASTEXITCODE -ne 0) { throw 'full CTest failed' } +uv run --with pytest python -B -m pytest -v -rs +if ($LASTEXITCODE -ne 0) { throw 'full pytest failed' } +``` + +전체 discovery의 test count와 실제 실행 count를 대조하고 skipped/missing/unobserved를 성공으로 합치지 않는다. 기존 target의 `/W4 /WX`를 유지하고 새 compiler/link warning0을 확인한다. 등록 Stop의 전체 검증은 그대로 수행되며 수동 hook 실행·state/reentry 조작으로 대체하지 않는다. Step 6에서 영향받는 C++ binary가 바뀌면 기존 reference helper의 cache 재사용 여부와 실제 solve 호출을 구분한다. 최종 fresh portfolio의 권위는 Step 7이다. + +## Evidence와 종료 + +- `docs/mitc4-shell-feast-eigen/implementation-step6-evidence.md` + +이 Step의 evidence에는 Feature/owner/r2, exact owned changed paths, RED→GREEN 명령·actual exits·기간·핵심 수치, focused/full counts, MSVC/x64/Debug/dependency/runtime selection, warning 수, upstream case/requirement 연결, 미실행 및 residual risk를 기록한다. Raw logs는 Git ignored `.harness/build/mitc4-eigen-evidence/step6/`에 보존한다. 각 CTest 호출 직후 해당 `Testing/Temporary/LastTest.log`를 고유 RED/focused/full 이름으로 복사하여 이후 Stop 로그와 섞지 않는다. Binary/reference/result hash와 run freshness는 적용되는 경우 기록한다. + + +보고서 작성 시점에는 마지막 registered Stop/Codex exit가 아직 발생하지 않을 수 있다. Implementation은 실제 완료된 manual 검증과 미관찰 Stop을 구분하고 미래 성공을 선기록하지 않는다. `completed` payload는 그 자체로 Stop 성공 증거가 아니다. Executor 종료 뒤 Coordinator가 raw output·등록 Hook evidence·actual exit를 management 문서에서 사후 감사한다. Specialist 보고서 본문은 Coordinator가 대신 수정하지 않는다. + +Manual AC가 성공하면 Executor가 허용한 `phases/mitc4-shell-feast-eigen/index.json`의 **현재 Step 6만** `status=completed`와 비어 있지 않은 `summary`를 기록한다. 구현/검증 실패는 `error/error_message`, 환경·필수 준비 차단은 `blocked/blocked_reason`이다. `owned_paths`, 이름/번호, 다른 Step/top index, timestamp, attempt_history는 수정하지 않는다. `step6-output.json`은 Executor 생성 기록이며 ignored 상태를 유지한다. 마지막 응답은 공통 handoff envelope다. Phase 전체 또는 workflow gate의 자기 승인은 하지 않는다. + +## 제외와 중단 조건 + +Physics/formulation/I/O/tolerance/원본 reference·기존 feature 보고서 변경, 외부 solver, spectrum fitting, eigen 외부 vector/frequency/stress gate, sparse rank cutoff, sandbox 확대, retry-budget 변경, Git branch/commit/push/tag/release는 소유 범위 밖이다. 명백한 구현 결함은 이 exact scope 안에서 최소 수정한다. 계약 결함은 정확한 owner로 `return-upstream`, 실행 환경 실패는 actual command/exit와 함께 Coordinator로 반환한다. 동일 실패를 transport timeout으로 가장하거나 evidence를 지우고 재실행하지 않는다. diff --git a/phases/mitc4-shell-feast-eigen/step7.md b/phases/mitc4-shell-feast-eigen/step7.md new file mode 100644 index 0000000..6bb9c1e --- /dev/null +++ b/phases/mitc4-shell-feast-eigen/step7.md @@ -0,0 +1,167 @@ +# Step 7: Value-only comparator·fresh reference·구현 evidence + +- Feature ID: `mitc4-shell-feast-eigen` +- Plan owner: `implementation-planning-agent` +- Execution owner: `implementation-agent` +- Input contract revision: `r2` +- Phase: `mitc4-shell-feast-eigen` +- Dependency: 동일 phase의 Step 6 completed +- Requirement IDs: `FEM-REQ-MITC4-EIGEN-001`, `FEM-REQ-MITC4-EIGEN-002`, `FEM-REQ-MITC4-EIGEN-003`, `FEM-REQ-MITC4-EIGEN-004`, `FEM-REQ-MITC4-EIGEN-005`, `FEM-REQ-MITC4-EIGEN-006`, `FEM-REQ-MITC4-EIGEN-007`, `FEM-REQ-MITC4-EIGEN-008`, `FEM-REQ-MITC4-EIGEN-009`, `FEM-REQ-MITC4-EIGEN-010`, `FEM-REQ-MITC4-EIGEN-011`, `FEM-REQ-MITC4-EIGEN-012`, `FEM-REQ-MITC4-EIGEN-013`, `FEM-REQ-MITC4-EIGEN-014`, `FEM-REQ-MITC4-EIGEN-015`, `FEM-REQ-MITC4-EIGEN-016`, `FEM-REQ-MITC4-EIGEN-017`, `FEM-REQ-MITC4-EIGEN-018`, `FEM-REQ-MITC4-EIGEN-019`, `FEM-REQ-MITC4-EIGEN-020`, `FEM-REQ-MITC4-EIGEN-021`, `FEM-REQ-MITC4-EIGEN-022`, `FEM-REQ-MITC4-EIGEN-023`, `FEM-REQ-MITC4-EIGEN-024`, `FEM-REQ-MITC4-EIGEN-025`, `FEM-REQ-MITC4-EIGEN-026`, `FEM-REQ-MITC4-EIGEN-027` +- Logical cases: `MFE-C06`, `MFE-C08`, `MFE-C09`, `MFE-C11`, `MFE-C12`, `MFE-C17`, `MFE-C18`, `MFE-C20`, `MFE-C23`, `MFE-C24`, `MFE-C25`, `MFE-C26`, `MFE-C27` +- I/O obligations: `IO-T01`, `IO-T04`, `IO-T05`, `IO-T07`, `IO-T08`, `IO-T09`, `IO-T10`, `IO-T11` + +## 필수 입력과 계약 + +Feature 폴더는 `docs/mitc4-shell-feast-eigen/`다. 아래 current r2 입력을 읽고 기존 완료 Step 코드와 evidence를 대조한다. 연결된 upstream contract는 read-only다. + +- [AGENTS.md](../../AGENTS.md) +- [docs/SOLVER_AGENT_DESIGN.md](../../docs/SOLVER_AGENT_DESIGN.md) +- [docs/FEATURE_DOCUMENTATION.md](../../docs/FEATURE_DOCUMENTATION.md) +- [docs/PRD.md](../../docs/PRD.md) +- [docs/ARCHITECTURE.md](../../docs/ARCHITECTURE.md) +- [docs/ADR.md](../../docs/ADR.md) +- [docs/CODINGSTYLE.md](../../docs/CODINGSTYLE.md) +- [docs/TOLERANCE.md](../../docs/TOLERANCE.md) +- [.codex/skills/fem-implementation-tdd/SKILL.md](../../.codex/skills/fem-implementation-tdd/SKILL.md) +- [.agents/skills/harness/SKILL.md](../../.agents/skills/harness/SKILL.md) +- [.codex/agents/implementation-agent.toml](../../.codex/agents/implementation-agent.toml) +- [docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md](../../docs/mitc4-shell-feast-eigen/FEATURED_AGENTS.md) +- [docs/mitc4-shell-feast-eigen/PRD.md](../../docs/mitc4-shell-feast-eigen/PRD.md) +- [docs/mitc4-shell-feast-eigen/ADR.md](../../docs/mitc4-shell-feast-eigen/ADR.md) +- [docs/mitc4-shell-feast-eigen/coordination.md](../../docs/mitc4-shell-feast-eigen/coordination.md) +- [docs/mitc4-shell-feast-eigen/requirements.md](../../docs/mitc4-shell-feast-eigen/requirements.md) +- [docs/mitc4-shell-feast-eigen/requirements-evidence.md](../../docs/mitc4-shell-feast-eigen/requirements-evidence.md) +- [docs/mitc4-shell-feast-eigen/research.md](../../docs/mitc4-shell-feast-eigen/research.md) +- [docs/mitc4-shell-feast-eigen/research-evidence.md](../../docs/mitc4-shell-feast-eigen/research-evidence.md) +- [docs/mitc4-shell-feast-eigen/formulation.md](../../docs/mitc4-shell-feast-eigen/formulation.md) +- [docs/mitc4-shell-feast-eigen/formulation-mass.md](../../docs/mitc4-shell-feast-eigen/formulation-mass.md) +- [docs/mitc4-shell-feast-eigen/formulation-eigen.md](../../docs/mitc4-shell-feast-eigen/formulation-eigen.md) +- [docs/mitc4-shell-feast-eigen/formulation-verification.md](../../docs/mitc4-shell-feast-eigen/formulation-verification.md) +- [docs/mitc4-shell-feast-eigen/formulation-stabilization.md](../../docs/mitc4-shell-feast-eigen/formulation-stabilization.md) +- [docs/mitc4-shell-feast-eigen/numerical-review.md](../../docs/mitc4-shell-feast-eigen/numerical-review.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-evidence.md](../../docs/mitc4-shell-feast-eigen/numerical-review-evidence.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-controls.md](../../docs/mitc4-shell-feast-eigen/numerical-review-controls.md) +- [docs/mitc4-shell-feast-eigen/numerical-review-cases.md](../../docs/mitc4-shell-feast-eigen/numerical-review-cases.md) +- [docs/mitc4-shell-feast-eigen/reference-model.md](../../docs/mitc4-shell-feast-eigen/reference-model.md) +- [docs/mitc4-shell-feast-eigen/io.md](../../docs/mitc4-shell-feast-eigen/io.md) +- [docs/mitc4-shell-feast-eigen/io-input.md](../../docs/mitc4-shell-feast-eigen/io-input.md) +- [docs/mitc4-shell-feast-eigen/io-schema.md](../../docs/mitc4-shell-feast-eigen/io-schema.md) +- [docs/mitc4-shell-feast-eigen/io-mapping.md](../../docs/mitc4-shell-feast-eigen/io-mapping.md) +- [docs/mitc4-shell-feast-eigen/implementation-plan.md](../../docs/mitc4-shell-feast-eigen/implementation-plan.md) +- [docs/mitc4-shell-feast-eigen/implementation-environment.md](../../docs/mitc4-shell-feast-eigen/implementation-environment.md) +- [docs/mitc4-shell-feast-eigen/implementation-interfaces.md](../../docs/mitc4-shell-feast-eigen/implementation-interfaces.md) +- [docs/mitc4-shell-feast-eigen/implementation-verification.md](../../docs/mitc4-shell-feast-eigen/implementation-verification.md) + +이 Step의 직접 계약: [io-mapping.md#m3-원본-txt-grammar와-deterministic-value-projection](../../docs/mitc4-shell-feast-eigen/io-mapping.md#m3-원본-txt-grammar와-deterministic-value-projection), [io-mapping.md#m4-판정보고와-기존-static의-역할](../../docs/mitc4-shell-feast-eigen/io-mapping.md#m4-판정보고와-기존-static의-역할), [reference-model.md](../../docs/mitc4-shell-feast-eigen/reference-model.md), [../TOLERANCE.md](../../docs/mitc4-shell-feast-eigen/../TOLERANCE.md), [requirements-evidence.md#필수-회귀-포트폴리오와-identity](../../docs/mitc4-shell-feast-eigen/requirements-evidence.md#필수-회귀-포트폴리오와-identity), [numerical-review-cases.md#p4-ioreference운영-closure](../../docs/mitc4-shell-feast-eigen/numerical-review-cases.md#p4-ioreference운영-closure). +논리 case의 전체 parameter/threshold/음성 inventory는 NR 원문과 [verification mapping](../../docs/mitc4-shell-feast-eigen/implementation-verification.md)을 함께 적용한다. + +## Owned paths + +다음 목록은 phase index `owned_paths`와 exact equality를 유지한다. 목록 밖 파일이 필요하면 보존하고 Coordinator에 반환한다. 다른 agent도 같은 worktree를 사용하므로 타인 변경을 되돌리지 않는다. + +```json +[ + "tests/reference/eigen_reference_comparison.h", + "tests/reference/eigen_reference_comparison.cpp", + "tests/reference/eigen_reference_comparison_test.cpp", + "tests/CMakeLists.txt", + "tests/reference/eigen_reference_cases_test.cpp", + "tests/reference/mitc4_eigen_static_regression_test.cpp", + "tests/integration/analysis/linear_frequency_procedure_test.cpp", + "docs/mitc4-shell-feast-eigen/implementation-report.md", + "docs/mitc4-shell-feast-eigen/build-test.md", + "docs/mitc4-shell-feast-eigen/reference-comparison.md", + "docs/mitc4-shell-feast-eigen/reference-comparison-detail.md", + "docs/mitc4-shell-feast-eigen/implementation-step7-evidence.md" +] +``` + +## 같은 session의 behavior별 TDD + +각 소단위는 아래 순서로 RED→observed failure→minimal GREEN→focused VERIFY를 완료한다. 마지막 소단위 뒤 full VERIFY를 한 번 수행하고 등록 Stop의 정상 전체검증도 받는다. Missing API의 정확한 compile/link failure는 RED일 수 있으나 configure/dependency 오류는 RED가 아니다. 이미 통과한 test를 새 RED라고 보고하지 않는다. + +### 1. 원본 TXT Value-only deterministic comparator + +Symbols: `EigenReferenceComparison::Compare/WriteDeterministicJson; exact TXT parser and source-key projection`. + +**RED:** Test-local synthetic TXT/HDF5 fixture로 reordered rows/equalValue distinct IDs와 Freq token 변경을 허용하고 missing/extra/duplicate/malformed/BOM/NaN/Inf/wronglabel/step/quantity/unit/mass/backend/schema를 tolerance 이전 실패시킨다. 양수 singleton 1% RMS 경계/nextafter·5% row 경계/nextafter, rowpass-RMSfail, generic near-zero B 경계 및 S0 cases를 먼저 고정한다. + +**Minimal GREEN:** IO-M3 full-match grammar의 모든 nonempty TXT rows를 읽고 입력 sole source step/N을 authority로 연결한다. Official modes.eigenvalue만 추출하고 source content identity/path를 확인한다. Existing ReferenceTolerancePolicy::Evaluate를 10singleton family에 적용하며 policy source는 수정하지 않는다. Deterministic report는 raw r/f/e, source keys/family/S/branch/RMS/prechecks를 모두 기록한다. Diagnostic all-c, frequencies/vectors는 비교량이나 fallback이 아니다. + +**Focused VERIFY:** 아래 regex 중 해당 suite를 먼저 discovery하여 tests>0을 확인하고 같은 test를 재실행한다. Exact exit와 실패 이유를 behavior별로 기록한다. + +### 2. Fresh 10모드·static portfolio·반복 실행 및 최종 구현 evidence + +Symbols: `EigenReferenceCases.FreshInputUsesTenBlockingValueFamilies; EigenReferenceCases.ReplaysPersistentModesAndRepeatsDeterministically; Mitc4EigenStaticRegression.FreshApprovedPortfolio`. + +**RED:** 새 fresh-run harness에 invocation counter/identity corruption fixture를 먼저 추가해 stale HDF5 또는 다른 binary/source content의 결과를 거부하는 failure를 관찰한다. 이미 구현된 eigenvalue가 reference와 통과할 수 있다는 이유로 의도적인 물리 failure를 만들지 않는다. Tests는 고유 execution directory에 원본 bytes 복사→직접 FesaApplication 호출→HDF5 읽기를 요구하고 cache-only path는 failure로 만든다. 이후 실제 지정 reference 및 기존 static portfolio를 실행한다. + +**Minimal GREEN:** Reference 실행 wrapper와 evidence projection만 보완한다. 원본 SHA-256/bytes/mtime 전후 동일, copied input byte equality, actual run exit/duration, binary/library hash와 result/log timestamp/hash를 기록한다. 새 eigen은 같은binary/runtime/thread/input3runs에서 N10/n3125/nz625와 raw Value10singleton 비교·N벡터 residual 재현·C4 결정론을 검증한다. Static shell/shellNL/shellNL-meshfine fresh solve와 source-key Ublocking/URwarning/reactionreview 및 factor1 equilibrium을 기존 comparators로 평가한다. Canonical3 reports와 detail에 전 requirements 연결 및 full counts/exits/누락0를 기록하고 Physics/Release 판단은 남긴다. + +**Focused VERIFY:** 아래 regex 중 해당 suite를 먼저 discovery하여 tests>0을 확인하고 같은 test를 재실행한다. Exact exit와 실패 이유를 behavior별로 기록한다. + +## Focused 명령 + +현재 `tests/CMakeLists.txt`에서 `fesa_tests`는 unit/integration/reference 세 executable을 +모두 의존하는 aggregate다. 이 Step의 새 `tests/reference/` 파일은 +`fesa_reference_tests`에 등록하며 아래 build는 이를 포함한다. Registration 누락은 +필수 신규 이름별 discovery 검사에서 실패로 처리하고 full build로 RED를 대체하지 않는다. + +Workspace root의 PowerShell에서 실행한다. 초기 missing API RED라면 build의 expected failure를 기록하고 production 구현 후 같은 명령을 다시 실행한다. + +```powershell +cmake -S . -B .harness/build -A x64 +cmake --build .harness/build --config Debug --target fesa_tests +ctest --test-dir .harness/build -C Debug -R '^(EigenReferenceComparison|ReferenceTolerancePolicy|EigenReferenceCases|Mitc4EigenStaticRegression|Mitc4S4Reference|NonlinearStaticReference|ShellSurfacePressureReference)\.' --show-only=json-v1 +ctest --test-dir .harness/build -C Debug -R '^(EigenReferenceComparison|ReferenceTolerancePolicy|EigenReferenceCases|Mitc4EigenStaticRegression|Mitc4S4Reference|NonlinearStaticReference|ShellSurfacePressureReference)\.' --output-on-failure +``` + +Configure exit는 항상0이어야 한다. GREEN에서는 위 모든 exit0, discovered selected tests>0, failures0이어야 한다. 각 호출의 `$LASTEXITCODE`를 즉시 기록하고 실패 뒤 후속 명령으로 덮어쓰지 않는다. + + +### 필수 신규 test discovery inventory + +- `EigenReferenceCases.MfeC25FreshTenValueFamilies` +- `EigenReferenceCases.MfeC27FreshAndRepeatedEvidence` +- `Mitc4EigenStaticRegression.MfeC26FreshApprovedPortfolio` +- `EigenReferenceComparison.MfeC25PrechecksAndToleranceBoundaries` + +위 이름 모두를 focused 및 full discovery JSON의 `tests[].name`에서 확인한다. Parameterized 전개가 필요하면 원 obligation→실제 discovered 이름을 evidence에 명시하고 모든 전개 case를 실행한다. 단지 selected count>0이거나 기존 suite만 존재하는 것은 실패다. V2의 해당 독립 oracle/mutation과 이 Step의 behavior assertions를 실제 구현해 각 결과를 기록한다. + +## Full VERIFY + +현재 실제 backend는 config absent→CMake/Visual Studio 18 2026/x64/`.harness/build`/Debug다. Dependency cache 준비는 [environment](../../docs/mitc4-shell-feast-eigen/implementation-environment.md)의 정확한 명령과 preflight를 따른다. Generator 변경이나 preset fallback을 임의로 하지 않는다. + +```powershell +cmake -S . -B .harness/build -A x64 +if ($LASTEXITCODE -ne 0) { throw 'configure failed' } +cmake --build .harness/build --config Debug +if ($LASTEXITCODE -ne 0) { throw 'build failed' } +ctest --test-dir .harness/build -C Debug --show-only=json-v1 +if ($LASTEXITCODE -ne 0) { throw 'discovery failed' } +ctest --test-dir .harness/build -C Debug --output-on-failure +if ($LASTEXITCODE -ne 0) { throw 'full CTest failed' } +uv run --with pytest python -B -m pytest -v -rs +if ($LASTEXITCODE -ne 0) { throw 'full pytest failed' } +``` + +전체 discovery의 test count와 실제 실행 count를 대조하고 skipped/missing/unobserved를 성공으로 합치지 않는다. 기존 target의 `/W4 /WX`를 유지하고 새 compiler/link warning0을 확인한다. 등록 Stop의 전체 검증은 그대로 수행되며 수동 hook 실행·state/reentry 조작으로 대체하지 않는다. Step 7에서 영향받는 C++ binary가 바뀌면 기존 reference helper의 cache 재사용 여부와 실제 solve 호출을 구분한다. 이 Step에서 최종 fresh portfolio를 완료한다. + +## Evidence와 종료 + +- `docs/mitc4-shell-feast-eigen/implementation-report.md` +- `docs/mitc4-shell-feast-eigen/build-test.md` +- `docs/mitc4-shell-feast-eigen/reference-comparison.md` +- `docs/mitc4-shell-feast-eigen/reference-comparison-detail.md` +- `docs/mitc4-shell-feast-eigen/implementation-step7-evidence.md` + +이 Step의 evidence에는 Feature/owner/r2, exact owned changed paths, RED→GREEN 명령·actual exits·기간·핵심 수치, focused/full counts, MSVC/x64/Debug/dependency/runtime selection, warning 수, upstream case/requirement 연결, 미실행 및 residual risk를 기록한다. Raw logs는 Git ignored `.harness/build/mitc4-eigen-evidence/step7/`에 보존한다. 각 CTest 호출 직후 해당 `Testing/Temporary/LastTest.log`를 고유 RED/focused/full 이름으로 복사하여 이후 Stop 로그와 섞지 않는다. Binary/reference/result hash와 run freshness는 적용되는 경우 기록한다. + + +보고서 작성 시점에는 마지막 registered Stop/Codex exit가 아직 발생하지 않을 수 있다. Implementation은 실제 완료된 manual 검증과 미관찰 Stop을 구분하고 미래 성공을 선기록하지 않는다. `completed` payload는 그 자체로 Stop 성공 증거가 아니다. Executor 종료 뒤 Coordinator가 raw output·등록 Hook evidence·actual exit를 management 문서에서 사후 감사한다. Specialist 보고서 본문은 Coordinator가 대신 수정하지 않는다. + +Manual AC가 성공하면 Executor가 허용한 `phases/mitc4-shell-feast-eigen/index.json`의 **현재 Step 7만** `status=completed`와 비어 있지 않은 `summary`를 기록한다. 구현/검증 실패는 `error/error_message`, 환경·필수 준비 차단은 `blocked/blocked_reason`이다. `owned_paths`, 이름/번호, 다른 Step/top index, timestamp, attempt_history는 수정하지 않는다. `step7-output.json`은 Executor 생성 기록이며 ignored 상태를 유지한다. 마지막 응답은 공통 handoff envelope다. Phase 전체 또는 workflow gate의 자기 승인은 하지 않는다. + +## 제외와 중단 조건 + +Physics/formulation/I/O/tolerance/원본 reference·기존 feature 보고서 변경, 외부 solver, spectrum fitting, eigen 외부 vector/frequency/stress gate, sparse rank cutoff, sandbox 확대, retry-budget 변경, Git branch/commit/push/tag/release는 소유 범위 밖이다. 명백한 구현 결함은 이 exact scope 안에서 최소 수정한다. 계약 결함은 정확한 owner로 `return-upstream`, 실행 환경 실패는 actual command/exit와 함께 Coordinator로 반환한다. 동일 실패를 transport timeout으로 가장하거나 evidence를 지우고 재실행하지 않는다.