Files
FESADev/phases/cpp-object-oriented-modular-refactoring/step11.md
T

4.3 KiB

Step 11: Source Target Resolver

과거 개발 계획이다. 아래 작업·상태·예시는 현재 실행 지시가 아니다. 현재 구현과 검증 한계는 기능 요약을 따른다.

읽어야 할 파일

  • /AGENTS.md
  • ../../docs/solver-core/README.md
  • ../../docs/solver-core/README.md
  • ../../docs/solver-core/README.md
  • ../../docs/linear-static-3d-euler-beam/README.md
  • ../../docs/linear-static-mitc4-shell/README.md
  • ../../docs/cpp-object-oriented-modular-refactoring/README.md
  • /include/fesa/core/source_identity.h
  • /include/fesa/model/domain.h, /src/fesa/model/domain.cpp
  • /src/fesa/io/abaqus/domain_mapper.cpp
  • /src/fesa/fem/dof_manager.cpp
  • /src/fesa/assembly/load_assembler.cpp
  • /src/fesa/results/result_recovery.cpp
  • matching mapper/DOF/load/recovery tests
  • /src/fesa/CMakeLists.txt, /tests/CMakeLists.txt
  • /phases/cpp-object-oriented-modular-refactoring/index.json
  • /phases/cpp-object-oriented-modular-refactoring/step11.md

작업

Requirement R-DUP-002의 ASCII/source-target owner를 구현한다.

  1. /tests/unit/core/ascii_test.cpp와 /tests/unit/model/source_target_resolver_test.cpp를 먼저 추가한다.
  2. C-DUP-004 tests cover ASCII-only lower/equality, positive source-label parsing, separate node/element set namespaces, instance identity, declaration-order expansion, duplicate/missing/ambiguous/nonpositive rejection and deterministic diagnostic order.
  3. Missing headers/symbols로 RED compile failure를 기록한다.
  4. Create /include/fesa/core/ascii.h, /src/fesa/core/ascii.cpp, /include/fesa/model/source_target_resolver.h, and /src/fesa/model/source_target_resolver.cpp; register both sources and both tests in CMake.
  5. Candidate core functions:
char AsciiLower(char value) noexcept;
bool AsciiCaseInsensitiveEquals(std::string_view lhs,
                                std::string_view rhs) noexcept;
Result<std::int64_t> ParsePositiveSourceLabel(std::string_view text);
  1. Candidate model interface:
enum class SourceEntityKind { kNode, kElement };

struct SourceTargetIndexEntry {
  SourceEntityKind entity_kind;
  std::string instance_name;
  std::string target_name;
  SourceEntityId source_id;
  EntityIndex entity_index;
  std::size_t declaration_order;
};

class SourceTargetIndex {
 public:
  explicit SourceTargetIndex(std::vector<SourceTargetIndexEntry> entries);
  const std::vector<SourceTargetIndexEntry>& Entries() const noexcept;
};

struct SourceTargetQuery {
  SourceEntityKind entity_kind;
  std::string instance_name;
  std::string target_name_or_label;
};

struct ResolvedSourceTarget {
  SourceEntityId source_id;
  EntityIndex entity_index;
};

class SourceTargetResolver {
 public:
  explicit SourceTargetResolver(const SourceTargetIndex& index) noexcept;
  Result<std::vector<ResolvedSourceTarget>> Resolve(
      const SourceTargetQuery& query) const;
};
  1. SourceTargetIndex is an immutable index built from validated candidate or Domain semantic records. It owns its compact entries; the resolver stores a non-owning reference, so the index lifetime must outlive the resolver and Doxygen must state it.
  2. Replace repeated AsciiLower, equal-name, positive-integer, and same-meaning source resolution helpers only. Preserve each owner-specific diagnostic category/source location.

Acceptance Criteria

과거 도구 실행·출력 지시는 정리했으며, 현재 검증 방법은 기능 요약을 따른다.

The helper scan may show only the shared definitions and intentional calls, not repeated local definitions. Full diagnostics and stable order tests must pass.

검증 및 상태 갱신

  • RED, focused resolution cases, duplicate scan and full CTest를 summary에 기록한다.
  • Identity/diagnostic order regression이면 error; missing upstream identity contract이면 blocked로 기록한다.
  • 성공 시 현재 Step만 completed로 갱신한다.
  • timestamp, retry, commit, advancement는 Executor 소유다.

금지사항

  • Unicode case folding이나 locale behavior를 추가하지 마라. 이유: input contract is ASCII.
  • Node와 element set namespace를 합치지 마라.
  • Domain mapper를 responsibility files로 split하지 마라. 이유: Step 21 소유다.
  • 직접 commit하거나 hook script를 수동 실행하지 마라.