# Step 6: Shell DOF Scatter

## 담당 역할과 필수 스킬

- 담당 역할: `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 005/025
- `/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`
- `/docs/reference-models/linear-static-mitc4-shell-reference-models.md`
- phase indexes, `step6.md`, Step 0 shell model and Step 5 summary
- `/include/fesa/fem/dof_manager.hpp`, `/src/fesa/fem/dof_manager.cpp`
- `/tests/unit/fem/dof_manager_test.cpp`
- `/tests/unit/constraints/essential_constraints_test.cpp`

## 작업

1. `MITC4-DOF-001..003` tests를 먼저 작성한다.
2. 기존 node DOF order `[ux,uy,uz,urx,ury,urz]`를 유지한다.
3. B33 12-entry scatter를 보존하면서 shell four-node/source-order 24-entry typed
   scatter와 sorted unique sparse pattern을 `DofManager` 단독 소유로 추가한다.
4. Free/constrained numbering과 no/mixed/all constraint, nonzero prescribed value
   round trip을 shell-sized system에서 검증한다.
5. All-constrained `0x0 Kff`가 valid하도록 existing constraint behavior를 보존한다.

## 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 "DofManager|EssentialConstraints" --output-on-failure
```

Current 12-entry-only behavior의 expected RED 뒤 minimal GREEN. 이후:

```powershell
cmake --build .harness/build --config Debug --target fesa_unit_tests
ctest --test-dir .harness/build -C Debug -R "DofManager|EssentialConstraints|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를 기록하고 current Step의 Codex-owned fields만 갱신한다.

## 금지사항

- Node/Element에 equation id를 저장하지 마라.
- Load/constraint ownership이나 sparse reduction을 이동하지 마라.
- 기존 B33 scatter behavior를 제거하지 마라.
- 직접 commit/hook 실행 또는 reference/upstream 변경을 하지 마라.
