Files
2026-08-16 02:49:35 +09:00

4.2 KiB

Step 23: HDF5 Writer Modules

담당 역할과 필수 스킬

  • 담당 역할: implementation-agent
  • 필수 스킬: harness, fesa-cpp-msvc-tdd
  • 이 Step만 RED -> observed failure -> minimal GREEN -> focused/full VERIFY로 수행한다.

읽어야 할 파일

  • /AGENTS.md
  • /docs/CODINGSTYLE.md
  • /docs/ARCHITECTURE.md
  • /docs/ADR.md
  • /docs/linear-static-3d-euler-beam/io.md
  • /docs/linear-static-mitc4-shell/io.md
  • /docs/cpp-object-oriented-modular-refactoring/implementation-plan.md
  • Step 22 recovery candidate/result records
  • /include/fesa/io/hdf5/hdf5_results_writer.h
  • /src/fesa/io/hdf5/hdf5_results_writer.cpp
  • /include/fesa/results/results_writer.h
  • /tests/unit/io/hdf5/hdf5_results_writer_test.cpp
  • /src/fesa/CMakeLists.txt, /tests/CMakeLists.txt
  • /phases/cpp-object-oriented-modular-refactoring/index.json
  • /phases/cpp-object-oriented-modular-refactoring/step23.md

작업

Requirement R-MODULE-001의 HDF5 split을 구현한다.

  1. /tests/unit/io/hdf5/hdf5_writer_components_test.cpp를 먼저 추가한다. C-MODULE-003 tests backend-neutral dataset plans, finite inventory validation, self-check failure and atomic final-file preservation through private component seams.
  2. Missing component headers/symbols provides RED.
  3. Keep Hdf5ResultsWriter as the only public facade and keep all HDF5 ids/types private. Candidate modules:
hdf5_raii.h                    move-only private HDF5 handle wrappers
hdf5_primitives.h/.cpp         scalar/string/array/group/attribute operations
hdf5_model_writer.h/.cpp       exact model/source identity datasets
hdf5_result_writer.h/.cpp      exact mandatory beam/shell/global result datasets
hdf5_self_check.h/.cpp         reopen, shape, attribute and finite inventory checks
hdf5_atomic_file.h/.cpp        candidate path, preservation and final replacement
  1. Testable backend-neutral plan records may be private to src/fesa/io/hdf5; tests may receive a PRIVATE include directory. Do not expose hid_t, HDF5 headers or storage handles in /include/fesa/.
  2. Preserve every schema-v0 path, shape, attribute, units, row order, mandatory-output behavior, warning dataset, reopen self-check and existing-final preservation.
  3. Reduce hdf5_results_writer.cpp to facade orchestration.

Acceptance Criteria

cmake --build .harness/build --config Debug --target fesa_unit_tests
ctest --test-dir .harness/build -C Debug `
  -R "Hdf5ResultsWriter|Hdf5WriterComponents|ResultsWriter" --output-on-failure
$componentFiles = @(
  "src/fesa/io/hdf5/hdf5_raii.h",
  "src/fesa/io/hdf5/hdf5_primitives.cpp",
  "src/fesa/io/hdf5/hdf5_model_writer.cpp",
  "src/fesa/io/hdf5/hdf5_result_writer.cpp",
  "src/fesa/io/hdf5/hdf5_self_check.cpp",
  "src/fesa/io/hdf5/hdf5_atomic_file.cpp"
)
foreach ($componentFile in $componentFiles) {
  if (-not (Test-Path -LiteralPath $componentFile -PathType Leaf)) {
    throw "Missing HDF5 component: $componentFile"
  }
}
rg -n "WriteModel|WriteResults|SelfCheck|Atomic" `
  src/fesa/io/hdf5/hdf5_results_writer.cpp
$vendorLeaks = @(rg -n "hid_t|hdf5\.h|H5[A-Z]" include/fesa)
if ($vendorLeaks.Count -ne 0) { $vendorLeaks; throw "HDF5 type leaked into public headers" }
& "C:/Program Files/LLVM/bin/clang-format.exe" --dry-run --Werror `
  (rg --files src/fesa/io/hdf5 -g "*.h" -g "*.cpp") `
  tests/unit/io/hdf5/hdf5_results_writer_test.cpp `
  tests/unit/io/hdf5/hdf5_writer_components_test.cpp
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 missing components, schema/atomicity focused suite, facade/vendor scans and full CTest를 summary에 기록한다.
  • Schema, required output or preservation regression is error; never edit I/O docs to pass.
  • 성공 시 현재 Step만 completed로 갱신한다.
  • timestamp, retry, commit, advancement는 Executor 소유다.

금지사항

  • HDF5 schema version, dataset paths/shapes/attributes를 변경하지 마라.
  • HDF5 types/lifetime을 public solver core에 노출하지 마라.
  • Invalid candidate로 existing final file을 replace하지 마라.
  • 직접 commit하거나 hook script를 수동 실행하지 마라.