# Step 9: Shell Analysis State

## 담당 역할과 필수 스킬

- 담당 역할: `implementation-agent`
- 필수 스킬: `harness`, `fesa-cpp-msvc-tdd`

## 읽어야 할 파일

- `/.agents/skills/harness/SKILL.md`, `/.codex/skills/fesa-cpp-msvc-tdd/SKILL.md`
- `/AGENTS.md`, `/docs/PRD.md`, `/docs/ARCHITECTURE.md`, `/docs/ADR.md`
- `/docs/HARNESS.md`, `/docs/HARNESS_WORKFLOW.md`, `/.codex/hooks.json`
- `/docs/linear-static-mitc4-shell/implementation-plan.md`
- `/docs/linear-static-mitc4-shell/requirements.md` Requirements 026/041-046/048
- `/docs/linear-static-mitc4-shell/research.md`
- `/docs/linear-static-mitc4-shell/formulation.md`
- `/docs/linear-static-mitc4-shell/numerical-review.md`
- `/docs/linear-static-mitc4-shell/io.md` Sections 6.3-6.5
- `/docs/linear-static-mitc4-shell/reference-model.md`
- phase indexes, `step9.md`, Step 5 recovery types and Step 8 summary
- `/include/fesa/results/result_records.hpp`
- `/include/fesa/analysis/analysis_state.hpp`
- `/src/fesa/analysis/analysis_state.cpp`
- `/tests/unit/results/result_records_test.cpp`

## 작업

1. `MITC4-STATE-001..003`을 먼저 작성한다.
2. Additive shell record types를 정의한다: stable element, GP1..GP4 natural location,
   local 3x3 frame, eight generalized strain/resultant, three section positions의
   `[S11,S22,S12]`.
3. AnalysisState에 shell rows, physical strain energy, six equilibrium components,
   three normalized verification metrics를 candidate-owned storage로 추가한다.
4. Validated candidate가 완성된 뒤에만 state로 commit하며 invalid/nonfinite/
   inventory mismatch가 기존 state를 바꾸지 않게 한다.
5. Nonlinear director history, iteration, velocity, acceleration을 할당하지 않는다.

## Acceptance Criteria

```powershell
$requiredBuildPaths=@("C:/git/googletest","C:/Program Files (x86)/Intel/oneAPI/mkl/2026.1/lib/cmake/mkl","C:/Program Files (x86)/Intel/oneAPI/tbb/2023.1/lib/cmake/tbb","C:/Program Files/HDF_Group/HDF5/2.1.1/cmake")
foreach($p in $requiredBuildPaths){if(-not(Test-Path -LiteralPath $p)){throw "Missing $p"}}
cmake --fresh -S . -B .harness/build -G "Visual Studio 18 2026" -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"
cmake --build .harness/build --config Debug --target fesa_unit_tests
ctest --test-dir .harness/build -C Debug -R "AnalysisState" --output-on-failure
```

Missing shell state/rollback RED 뒤 minimal GREEN. 이후:

```powershell
cmake --build .harness/build --config Debug --target fesa_unit_tests
ctest --test-dir .harness/build -C Debug -R "AnalysisState|DomainModel" --output-on-failure
cmake --build .harness/build --config Debug
ctest --test-dir .harness/build -C Debug --show-only=json-v1
ctest --test-dir .harness/build -C Debug --output-on-failure
```

## 검증 및 상태 갱신

RED/VERIFY evidence를 기록하고 현재 Step 상태 payload만 갱신한다.

## 금지사항

- Element calculation, ResultRecovery orchestration, HDF5를 구현하지 마라.
- Nonlinear/dynamic state나 drilling-specific row를 추가하지 마라.
- 직접 commit/hook 실행 또는 reference/upstream 변경을 하지 마라.
