# Step 12: Shell Linear Static Flow

## 담당 역할과 필수 스킬

- 담당 역할: `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/implementation-plans/linear-static-mitc4-shell-implementation-plan.md`
- `/docs/requirements/linear-static-mitc4-shell.md` Requirements 024-030/051/057
- `/docs/research/linear-static-mitc4-shell-research.md`
- `/docs/formulations/mitc4-shell-formulation.md`
- `/docs/numerical-reviews/linear-static-mitc4-shell-review.md`
- `/docs/io-definitions/linear-static-mitc4-shell-io.md` CLI/diagnostic contract
- `/docs/reference-models/linear-static-mitc4-shell-reference-models.md`
- phase indexes, `step12.md`, completed Steps 7-11 paths and summaries
- `/include/fesa/analysis/linear_static_analysis.hpp`
- `/src/fesa/analysis/linear_static_analysis.cpp`
- `/tests/integration/analysis/linear_static_analysis_test.cpp`
- `/tests/integration/app/fesa_application_test.cpp`
- `/include/fesa/app/fesa_application.hpp`와 implementation은 dispatch 확인용

## 작업

1. `MITC4-FLOW-001..004` integration tests를 먼저 작성한다.
2. Shell Domain을 existing eight-hook `Analysis::run()` lifecycle에 연결한다.
3. Stiffness assemble/partition, `Kff` factorize, load/effective RHS, substitute,
   full displacement reconstruct, full residual/physical recovery, validated state/output
   commit 순서를 유지하고 factorization은 exactly once다.
4. Nonzero prescribed displacement의 `Ff-Kfc*dc`, singular support failure,
   all-constrained `0x0 Kff` success를 검증한다.
5. CLI syntax와 exit 0/2/3/4/5/6 semantics를 유지하며 shell input도 같은
   `fesa.exe <model.inp> --output <results.h5>` route를 사용한다.

## 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_integration_tests
ctest --test-dir .harness/build -C Debug -R "LinearStaticCli|Mitc4ShellCli" --output-on-failure
```

Shell pipeline RED를 확인하고 minimal GREEN. 이후:

```powershell
cmake --build .harness/build --config Debug --target fesa_integration_tests
ctest --test-dir .harness/build -C Debug -R "LinearStaticCli|Mitc4ShellCli" --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/lifecycle/focused/full evidence를 기록하고 current Step 상태 payload만 갱신한다.

## 금지사항

- Analysis lifecycle을 재정렬하거나 0x0 Kff를 singular로 바꾸지 마라.
- Nonlinear procedure, distributed load, mixed beam-shell execution을 추가하지 마라.
- Candidate validation 전 state/output을 commit하지 마라.
- 직접 commit/hook 실행 또는 reference/upstream 변경을 하지 마라.
