# Step 2: reject-invalid-pressure-input ## 실행 범위와 상태 소유권 이 Step의 단일 책임은 Step 1의 pressure input/model mapping에 deterministic fail-closed negative semantics, duplicate rules, diagnostics and atomic commit behavior를 완결하는 것이다. 동일 Step 안에서 RED부터 full green까지 끝낸다. Implementation Agent는 Executor-selected Step 2만 수행하고 task index의 Step 2 `status`와 한 줄 `summary`/`error_message`/`blocked_reason`만 기록한다. Executor가 timestamps, commits, retry, advancement, top-level status와 output JSON을 소유한다. ## 읽어야 할 파일 - `AGENTS.md` - `docs/ARCHITECTURE.md` - `docs/ADR.md` - `docs/CODINGSTYLE.md` - `docs/HARNESS.md` - `docs/HARNESS_WORKFLOW.md` - `.codex/hooks.json` - `docs/shell-surface-pressure-load/requirements.md` - `docs/shell-surface-pressure-load/formulation.md` - `docs/shell-surface-pressure-load/numerical-review.md` - `docs/shell-surface-pressure-load/io.md` - `docs/shell-surface-pressure-load/implementation-plan.md` - `include/fesa/core/ascii.h` - `include/fesa/core/diagnostic.h` - `include/fesa/model/source_target_resolver.h` - `src/fesa/model/source_target_resolver.cpp` - `include/fesa/io/abaqus/input_syntax.h` - `src/fesa/io/abaqus/input_reader.cpp` - `src/fesa/io/abaqus/domain_mapping_context.h` - `src/fesa/io/abaqus/domain_mapping_context.cpp` - `src/fesa/io/abaqus/surface_definition_mapper.h` - `src/fesa/io/abaqus/surface_definition_mapper.cpp` - `src/fesa/io/abaqus/step_definition_mapper.cpp` - `src/fesa/io/abaqus/domain_builder.cpp` - `tests/unit/io/abaqus/shell_surface_pressure_domain_test.cpp` - `tests/unit/io/abaqus/domain_mapper_test.cpp` - `tests/unit/io/abaqus/domain_mapping_components_test.cpp` Read Step 1's implementation and tests closely. Its required outputs are the Domain-owned immutable surface/facet inventory, Step-owned provenance-rich pressure records, multi-explicit-instance valid support and non-owning AnalysisModel accessors. Do not replace those contracts. ## 소유 파일 - Modify/Test first: `tests/unit/io/abaqus/shell_surface_pressure_domain_test.cpp` - Modify/Test if needed: `tests/unit/io/abaqus/domain_mapper_test.cpp` - Modify/Test if needed: `tests/unit/io/abaqus/domain_mapping_components_test.cpp` - Modify: `src/fesa/io/abaqus/input_reader.cpp` - Modify: `src/fesa/io/abaqus/domain_mapping_context.h` - Modify: `src/fesa/io/abaqus/domain_mapping_context.cpp` - Modify: `src/fesa/io/abaqus/surface_definition_mapper.h` - Modify: `src/fesa/io/abaqus/surface_definition_mapper.cpp` - Modify: `src/fesa/io/abaqus/step_definition_mapper.cpp` - Modify: `src/fesa/io/abaqus/domain_builder.cpp` Do not add another production type or parser framework. ## RED Add these named tests first: - `ShellSurfacePressureInput.RejectsNonAsciiOverlengthOrIllegalContinuationAtStableLocation` - `ShellSurfacePressureInput.RejectsUnsupportedSurfaceParametersTypesSidesAndTargetKinds` - `ShellSurfacePressureInput.RejectsDsloadParametersLabelsDistributionsAndCardinality` - `ShellSurfacePressureInput.RejectsEmptyMissingAmbiguousAndCrossScopeSurfaceTargets` - `ShellSurfacePressureInput.RejectsImplicitInstanceNestedCyclicAndMalformedElsets` - `ShellSurfacePressureInput.NormalizesExactSameSideDuplicatesWithOneStableWarning` - `ShellSurfacePressureInput.RejectsConflictingSidesForOneElement` - `ShellSurfacePressureInput.RejectsNonfiniteDExponentAndLocaleDependentMagnitudes` - `ShellSurfacePressureInput.PreservesAdditiveRepeatedPressureRowsWithoutDeduplication` - `ShellSurfacePressureDomain.MappingFailureCommitsNoPartialSemanticCandidate` - `ShellSurfacePressureInput.EmitsDiagnosticsInStableSourceOrderAcrossRepeatedRuns` Run before production edits: ```powershell cmake --build .harness/build --config Debug --target fesa_unit_tests ctest --test-dir .harness/build -C Debug --output-on-failure -R "^(ShellSurfacePressureInput|ShellSurfacePressureDomain)\." ``` Expected RED: the Step 1 happy-path mapper accepts at least one unsupported form, lacks complete stable diagnostics, or does not distinguish exact same-side normalization from conflicting-side failure. Record command, exit, duration and tail. Unexpected pass is an evidence gap; unrelated failure is regression and must be resolved/classified before GREEN. ## Minimal GREEN - Apply exact allowed parameter/label/cardinality tables from `io.md` §§2–3. Reject unsupported flags, types, labels, distributions, scopes and target kinds without reinterpretation. - Reject non-ASCII/control/overlength physical input, illegal continuation, malformed or nonfinite numeric tokens, `D` exponent and locale-dependent forms at the actual failing source line. - Reject missing, empty, ambiguous, cross-scope, implicit-instance, nested/cyclic and malformed ELSET targets. A single mixed-instance ELSET remains unsupported; multiple separately explicit-instance members in one surface remain valid from Step 1. - Normalize an exact same `(instance, element label, side)` duplicate to one facet and emit exactly one deterministic `duplicate-surface-member-normalized` warning after the first identity. Reject conflicting SPOS/SNEG for the same instance/element and duplicate case-insensitive surface declarations. - Never deduplicate identical DSLOAD rows: each remains a distinct additive `load_ordinal`. - Validate every raw target before semantic commit, sort diagnostics by `(file source order, line, member/load ordinal, code, entity identity)`, and return no Domain on error. Preserve full `entity_identity` fields from `io.md` §9. ## VERIFY and Acceptance Criteria If `.harness/config.json` exists, use its resolved commands first. Otherwise run: ```powershell cmake --build .harness/build --config Debug --target fesa_unit_tests ctest --test-dir .harness/build -C Debug --output-on-failure -R "^(ShellSurfacePressureInput|ShellSurfacePressureDomain)\." ctest --test-dir .harness/build -C Debug --output-on-failure -R "^(InpDomainMapping|DomainMappingComponents|InpSyntax)\." 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 ``` Acceptance requires every named negative test and legacy parser/domain test green, exact diagnostic tuple `(severity,code,file,line,keyword,entity_identity,message)`, repeated-run diagnostic order exact, no partial Domain, nonzero CTest discovery, no new warning and full CTest pass. Let Stop hook run automatically. ## 불변식, 실패 처리와 증거 - Exact duplicate normalization and incompatible duplicate error are distinct. - All missing/extra/ambiguous/cyclic/cross-scope/nonfinite failures occur before tolerance/analysis/HDF5. - Existing inputs without pressure remain unchanged. - Evidence records RED and GREEN commands/exits/durations/tails, expected diagnostic codes/locations/entities, warning count and repeated diagnostic sequence. - Failure classification: `configure | compile | link | test | harness | environment | upstream-contract | regression | evidence-gap`. Trace: `FESA-REQ-SHELL-PRESSURE-002`–`004`, `013`–`017`; `io.md` §§2–6, 9; `formulation.md` §11; `numerical-review.md` §6 invalid-input checks. ## 금지사항 - Do not implement the evaluator/assembler, change tolerance, rewrite artifacts or refactor the general parser. 이유: 이 Step의 negative semantic scope 밖이다. - Do not weaken the valid multi-explicit-instance contract from Step 1. - Do not modify upstream docs, HDF5 writers, source reference files or phase statuses other than Step 2's Executor-selected record. - Do not run Abaqus, create output JSON, invoke `scripts/execute.py`, advance Step 3, commit or push.