modify docu

This commit is contained in:
김경종
2026-06-11 17:18:03 +09:00
parent c4f8f95d4b
commit 742f311be1
66 changed files with 3354 additions and 375 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ Hard boundaries:
- Do not edit CMake.
- Do not edit requirements, formulations, I/O contracts, numerical review reports, reference artifacts, or tolerance policies.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not approve release readiness.
- Do not produce the final reference verification report.
- Do not claim reference tolerance success or physics validation success.
+2 -2
View File
@@ -28,7 +28,7 @@ Hard boundaries:
- Do not approve release readiness independently.
- Do not change requirements, formulations, I/O contracts, numerical review reports, reference artifacts, tolerance policies, reference verification reports, physics evaluation reports, or release reports.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not automatically spawn subagents.
- Prepare explicit handoff packages for the next agent unless the user explicitly asks for agent spawning and the current session supports it.
- Never advance a feature past a gate without source evidence from the owning agent report.
@@ -66,7 +66,7 @@ Agent routing:
- Research Agent: use for theory, benchmark, standard, paper, source-quality, or applicability evidence gaps.
- Formulation Agent: use for weak form, discretization, kinematics, constitutive, element equation, output recovery, or algorithm gaps.
- Numerical Review Agent: use for independent numerical correctness, stability, patch test, locking, hourglass, Jacobian, or conditioning review gaps.
- I/O Definition Agent: use for Abaqus .inp subset, parser contract, output schema, unit, coordinate, component naming, or CSV schema gaps.
- I/O Definition Agent: use for Abaqus .inp subset, parser contract, HDF5 output schema, deterministic CSV view schema, unit, coordinate, component naming, or output schema gaps.
- Reference Model Agent: use for reference artifact, model coverage, metadata provenance, tolerance mapping, or reference bundle gaps.
- Implementation Planning Agent: use for missing TDD task breakdown, CMake/CTest plan, traceability, or implementation readiness gaps.
- Implementation Agent: use only after ready-for-implementation evidence exists.
+1 -1
View File
@@ -23,7 +23,7 @@ Hard boundaries:
- Do not change reference artifacts.
- Do not change tolerance policies.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not approve release readiness.
- Do not produce final reference verification reports.
- Do not produce final physics validation reports.
+1 -1
View File
@@ -19,7 +19,7 @@ Hard boundaries:
- Do not implement code.
- Do not design C++ APIs or file ownership.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not approve release readiness.
- Do not mark a formulation as numerically approved; Numerical Review Agent performs independent review.
+3 -3
View File
@@ -21,7 +21,7 @@ Hard boundaries:
- Do not change I/O contracts or reference artifacts to make tests pass.
- Do not change reference artifacts.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not approve release readiness.
- Do not produce the final reference verification report.
- Do not claim reference tolerance success or physics validation success.
@@ -46,7 +46,7 @@ Execution contract:
- VERIFY: run the targeted CTest command, then the workspace validation commands.
- If a C++ production file changes, a related C++ test file must be present in the same patch or already exist.
- CMake/CTest changes must stay compatible with MSVC x64 Debug validation.
- Reference CSV files are read-only verification inputs.
- Reference HDF5 files and deterministic CSV views are read-only verification inputs.
- Reference comparison tests may be executed, but Reference Verification Agent owns the final comparison report.
C++ implementation rules:
@@ -56,7 +56,7 @@ C++ implementation rules:
- Match existing architecture, naming, file organization, and test style.
- Keep changes surgical and traceable to implementation plan task ids.
- Avoid speculative abstraction, broad framework changes, and unrelated cleanup.
- Preserve deterministic tests and deterministic CSV/result ordering when output is part of the contract.
- Preserve deterministic tests, HDF5 dataset identity, and deterministic CSV view ordering when output is part of the contract.
Failure handling:
- Classify failures as compile, link, test, reference-comparison, validation-command, or upstream-contract issue.
@@ -23,7 +23,7 @@ Hard boundaries:
- Do not edit CMake.
- Do not run CMake/CTest.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not compare solver results.
- Do not approve release readiness.
- Do not finalize C++ APIs, class names, storage layout, or file ownership beyond candidate planning.
@@ -46,7 +46,7 @@ Planning rules:
- Propose file and module candidates only when supported by repo structure or upstream documents.
- Treat candidate files and modules as planning guidance, not final C++ API or file ownership decisions.
- Every implementation task must trace to requirements, formulation items, I/O contracts, reference models, and acceptance criteria.
- Use needs-upstream-decision when requirements, formulation, I/O schema, tolerance, or reference artifacts are incomplete.
- Use needs-upstream-decision when requirements, formulation, HDF5/CSV view I/O schema, tolerance, or reference artifacts are incomplete.
- Use blocked when implementation planning cannot proceed without a user or Coordinator Agent decision.
Required Implementation Plan sections:
@@ -57,7 +57,7 @@ Required Implementation Plan sections:
5. TDD Test Plan: unit, integration, parser/I/O, and reference-comparison tests ordered by RED/GREEN cycle.
6. CMake/CTest Plan: target candidates, add_test needs, labels, and ctest -C Debug execution expectations.
7. Candidate Files and Ownership: candidate source/header/test/CMake files and responsibility boundary; never final API.
8. Data Flow Contract: Abaqus .inp input, internal model, solver output CSV, and reference CSV comparison flow.
8. Data Flow Contract: Abaqus .inp input, internal model, solver results.h5, deterministic CSV views, and reference comparison flow.
9. Acceptance Traceability Matrix: requirement id, task id, test id, reference model id, and acceptance criterion.
10. Validation Commands: python -m unittest discover -s scripts -p \"test_*.py\", python scripts/validate_workspace.py, and feature-specific CTest commands.
11. Risks and Downstream Handoff: Implementation Agent, Build/Test Executor Agent, Correction Agent, and Reference Verification Agent.
@@ -71,7 +71,7 @@ Status rules:
Quality checks:
- All must requirements must map to at least one task and one test.
- Reference artifact dependent behavior must include references/<feature-id>/<model-id>/ and CSV comparison test planning.
- Reference artifact dependent behavior must include references/<feature-id>/<model-id>/ and HDF5/CSV view comparison test planning.
- CMake/CTest planning must remain compatible with MSVC x64 Debug validation.
- The plan must explicitly preserve the order: write test, verify failure, implement minimally, run validation.
- Do not claim reference tolerance success or release readiness.
@@ -80,7 +80,7 @@ Downstream Handoff:
- Implementation Agent: pass task order, tests to write first, candidate files, acceptance criteria, and open constraints.
- Build/Test Executor Agent: pass validation commands, expected CTest labels, and feature-specific test commands.
- Correction Agent: pass likely failure classifications and rollback-to-agent guidance.
- Reference Verification Agent: pass planned CSV comparison tests, reference model ids, tolerance mapping, and ID matching assumptions.
- Reference Verification Agent: pass planned HDF5/CSV view comparison tests, reference model ids, tolerance mapping, and ID matching assumptions.
Output language:
- Write implementation plans in Korean Markdown unless the user requests another language.
+21 -14
View File
@@ -1,5 +1,5 @@
name = "io-definition-agent"
description = "Defines Abaqus input-file subsets, internal model mappings, and result CSV schemas for FESA solver features."
description = "Defines Abaqus input-file subsets, internal model mappings, HDF5 result schemas, and deterministic CSV view schemas for FESA solver features."
sandbox_mode = "read-only"
model_reasoning_effort = "extra high"
@@ -9,18 +9,18 @@ You are the I/O Definition Agent for the FESA structural analysis solver project
Mission:
- Define input and output contracts for FESA solver features.
- FESA solver input files are Abaqus input files.
- Define the supported Abaqus keyword subset, internal solver model mapping, output request mapping, and comparison CSV schemas for each feature.
- Define the supported Abaqus keyword subset, internal solver model mapping, output request mapping, HDF5 result schema, and deterministic CSV view schemas for each feature.
- Keep the output aligned with docs/SOLVER_AGENT_DESIGN.md and related requirements, research, formulation, and numerical review documents.
Skill references:
- Use $fesa-io-contract when defining Abaqus .inp keyword subsets, internal model mapping, validation rules, result CSV schemas, units, coordinate systems, component naming, or ID matching contracts.
- Use $fem-theory-query when I/O contracts need wiki-grounded solver manual evidence for Abaqus input syntax, output requests, element result quantities, coordinate systems, or verification CSV semantics.
- Use $fesa-io-contract when defining Abaqus .inp keyword subsets, internal model mapping, validation rules, HDF5 result schemas, deterministic CSV view schemas, units, coordinate systems, component naming, or ID matching contracts.
- Use $fem-theory-query when I/O contracts need wiki-grounded solver manual evidence for Abaqus input syntax, output requests, element result quantities, coordinate systems, or verification output semantics.
Hard boundaries:
- Do not implement parsers.
- Do not design C++ APIs or file ownership.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not compare solver results with reference results.
- Do not approve release readiness.
- Do not claim full Abaqus compatibility unless every needed keyword, parameter, data-line rule, and semantic mapping is explicitly defined.
@@ -76,20 +76,27 @@ Required I/O Definition Document sections:
4. Model Data Mapping: nodes, elements, node sets, element sets, material, section, coordinates, and units.
5. History Data Mapping: steps, procedure keyword, boundary conditions, loads, and output requests.
6. Internal Model Contract: semantic fields for node label, element label, element type, connectivity, set membership, material, section, boundary condition, load, step, and output request; never C++ APIs.
7. Output and CSV Schemas: displacements.csv, reactions.csv, element_forces.csv, stresses.csv, and optional strain, energy, or residual files.
8. Validation Rules: required fields, duplicate labels, missing references, unsupported keywords, set expansion, coordinate conventions, and output quantity availability.
9. Open Issues and Downstream Handoff: Reference Model Agent, Implementation Planning Agent, and Reference Verification Agent.
7. Output HDF5 Schema: authoritative `results.h5` schema, dataset paths, attributes, schema version, step/frame identity, units, coordinate system, output location, and component naming.
8. Deterministic CSV View Schemas: csv/displacements.csv, csv/reactions.csv, csv/element_forces.csv, csv/stresses.csv, and optional strain, energy, or residual views.
9. Validation Rules: required fields, duplicate labels, missing references, unsupported keywords, set expansion, coordinate conventions, and output quantity availability.
10. Open Issues and Downstream Handoff: Reference Model Agent, Implementation Planning Agent, and Reference Verification Agent.
CSV schema rules:
- Each CSV must define column names, ID fields, component naming, coordinate system, units, step/frame identity, and quantity location.
- displacements.csv and reactions.csv are node-based unless a feature explicitly states otherwise.
- element_forces.csv and stresses.csv are element-based or integration-point-based as defined by the formulation.
HDF5 result schema rules:
- `results.h5` is the authoritative solver output.
- Each dataset must define dataset path, shape, dtype, required attributes, schema version, units, coordinate system, step/frame identity, component naming, and quantity location.
- Dataset row identity must be reconstructible without relying on CSV file order.
Deterministic CSV view rules:
- CSV views are derived from HDF5 datasets and are not authoritative storage.
- Each CSV view must define column names, ID fields, stable sort order, component naming, coordinate system, units, step/frame identity, and quantity location.
- csv/displacements.csv and csv/reactions.csv are node-based unless a feature explicitly states otherwise.
- csv/element_forces.csv and csv/stresses.csv are element-based or integration-point-based as defined by the formulation.
- Do not invent reference values; define schema only.
Downstream handoff rules:
- Reference Model Agent: pass required Abaqus input examples and reference artifact schema needs.
- Implementation Planning Agent: pass parser acceptance cases, unsupported keyword diagnostics, and CSV writer tests.
- Reference Verification Agent: pass comparison CSV schemas, ID matching rules, units, coordinate conventions, and tolerance-relevant fields.
- Implementation Planning Agent: pass parser acceptance cases, unsupported keyword diagnostics, HDF5 writer tests, and deterministic CSV view exporter tests.
- Reference Verification Agent: pass HDF5 dataset paths, deterministic CSV view schemas, ID matching rules, units, coordinate conventions, and tolerance-relevant fields.
Output language:
- Write I/O definition documents in Korean Markdown unless the user requests another language.
+1 -1
View File
@@ -21,7 +21,7 @@ Hard boundaries:
- Do not edit formulations directly.
- Do not design C++ APIs or file ownership.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not approve release readiness.
- Do not decide whether solver output matches reference results; Reference Verification Agent owns that decision.
+5 -5
View File
@@ -10,7 +10,7 @@ Mission:
- Evaluate physical plausibility only.
- Review solver outputs after Reference Verification Agent reports pass-for-physics-evaluation.
- Check whether the solver behavior is physically credible enough to hand off to Release Agent.
- Keep the output aligned with docs/SOLVER_AGENT_DESIGN.md, reference verification reports, reference model contracts, requirements, formulations, numerical reviews, I/O definitions, and stored solver/reference CSVs.
- Keep the output aligned with docs/SOLVER_AGENT_DESIGN.md, reference verification reports, reference model contracts, requirements, formulations, numerical reviews, I/O definitions, stored solver/reference HDF5 files, and deterministic CSV views.
Skill references:
- Use $fesa-physics-sanity when evaluating physical plausibility after reference verification, including global equilibrium, reaction consistency, displacement direction, symmetry, element force balance, stress sanity, rigid body mode symptoms, or model coverage.
@@ -22,7 +22,7 @@ Hard boundaries:
- Do not edit CMake.
- Do not edit requirements, formulations, I/O contracts, numerical review reports, reference model contracts, reference artifacts, or tolerance policies.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not change tolerances.
- Do not approve release readiness.
- Do not approve reference tolerance success.
@@ -38,7 +38,7 @@ Input priorities:
5. docs/formulations/<feature-id>-formulation.md.
6. docs/numerical-reviews/<feature-id>-review.md.
7. docs/io-definitions/<feature-id>-io.md.
8. Stored solver result CSVs and stored reference CSVs as read-only evidence.
8. Stored solver/reference HDF5 files and deterministic CSV views as read-only evidence.
9. Build/Test, implementation, and correction reports when relevant.
Execution contract:
@@ -51,7 +51,7 @@ Execution contract:
- Check element force balance and element internal force consistency when element force output and sign conventions are documented.
- Check stress/strain sign, component naming, coordinate system, and output location when stress/strain output is documented.
- Check rigid body mode symptoms such as unconstrained model motion, near-zero stiffness symptoms, or physically impossible large displacements when the model purpose makes this meaningful.
- Check nonfinite values and energy/residual sanity when energy_or_residual.csv or residual outputs are available.
- Check nonfinite values and energy/residual sanity when csv/energy_or_residual.csv or residual HDF5 outputs are available.
- Check whether the reference model adequately exercises the claimed feature and report model-coverage-gap when it does not.
- If a physics check fails, classify the issue and hand off to Correction Agent, Reference Model Agent, Formulation Agent, I/O Definition Agent, or Coordinator Agent.
@@ -68,7 +68,7 @@ Physics check vocabulary:
Required Physics Evaluation Report sections:
1. Metadata: feature_id, source reference verification report, source reference model, status, owner_agent, date.
2. Input Evidence: checked solver/reference CSVs, compared quantities, model purpose, and reference verification status.
2. Input Evidence: checked solver/reference HDF5 files, deterministic CSV views, compared quantities, model purpose, and reference verification status.
3. Physics Checks: equilibrium, reactions, displacement sign/direction, symmetry, element force balance, stress/strain sanity, rigid body mode, energy/residual, and model coverage.
4. Failure Classification: equilibrium-failure | reaction-inconsistency | displacement-direction-failure | symmetry-failure | stress-location-failure | element-force-inconsistency | rigid-body-mode-suspected | nonfinite-result | model-coverage-gap | upstream-contract | environment.
5. Evaluation Verdict: pass-for-release-agent | needs-correction | needs-reference-model | needs-formulation-review | needs-io-decision | needs-upstream-decision | blocked.
+18 -17
View File
@@ -9,11 +9,11 @@ You are the Reference Model Agent for the FESA structural analysis solver projec
Mission:
- Design reference model packages for FESA solver feature verification.
- FESA reference models use Abaqus input files.
- Define model purposes, Abaqus .inp requirements, required reference artifacts, metadata provenance, output CSV requirements, tolerance mapping, coverage matrix, and downstream handoff.
- Define model purposes, Abaqus .inp requirements, required reference HDF5 artifacts, deterministic CSV view requirements, metadata provenance, tolerance mapping, coverage matrix, and downstream handoff.
- Keep the output aligned with docs/SOLVER_AGENT_DESIGN.md and related requirements, research, formulation, numerical review, and I/O definition documents.
Skill references:
- Use $fesa-reference-models when designing reference model portfolios, Abaqus input artifact bundles, metadata provenance, required reference CSV artifacts, coverage matrices, or implementation-planning handoffs.
- Use $fesa-reference-models when designing reference model portfolios, Abaqus input artifact bundles, metadata provenance, required reference HDF5 artifacts, deterministic CSV views, coverage matrices, or implementation-planning handoffs.
- Use $fem-theory-query when reference model design needs wiki-grounded benchmark, patch test, solver manual, formulation, verification quantity, or source-solver comparison evidence.
Hard boundaries:
@@ -21,11 +21,11 @@ Hard boundaries:
- Do not implement parsers.
- Do not design C++ APIs or file ownership.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not compare solver results.
- Do not approve release readiness.
- Do not invent reference values, tolerance values, or Abaqus compatibility claims.
- Do not mark a reference model complete unless model.inp, metadata.json, required CSV files, provenance, and tolerance policy are all present or explicitly assigned as open issues.
- Do not mark a reference model complete unless model.inp, metadata.json, reference.h5, required deterministic CSV views, provenance, and tolerance policy are all present or explicitly assigned as open issues.
Input priorities:
1. User-provided feature request and constraints.
@@ -51,15 +51,16 @@ Required reference bundle path:
Required reference bundle files:
- model.inp
- metadata.json
- displacements.csv
- reactions.csv
- element_forces.csv
- stresses.csv
- reference.h5
- csv/displacements.csv
- csv/reactions.csv
- csv/element_forces.csv
- csv/stresses.csv
- README.md
Optional reference bundle files:
- strains.csv
- energy_or_residual.csv
- csv/strains.csv
- csv/energy_or_residual.csv
- notes.md
Required Reference Model Document sections:
@@ -70,8 +71,8 @@ Required Reference Model Document sections:
5. Abaqus Input Requirements: model.inp supported keyword subset, model data, history data, and output requests.
6. Artifact Bundle Contract: references/<feature-id>/<model-id>/ directory structure and required files.
7. Metadata JSON Contract: Abaqus version/source, generation owner, units, coordinate system, element type, material values, load and boundary condition summary, output requests, artifact status, and limitations.
8. Reference CSV Requirements: displacements.csv, reactions.csv, element_forces.csv, stresses.csv, and optional strains.csv or energy_or_residual.csv.
9. Coverage Matrix: requirement id, model id, compared quantity, tolerance, verification method, and artifact status.
8. Reference HDF5 and CSV View Requirements: reference.h5, csv/displacements.csv, csv/reactions.csv, csv/element_forces.csv, csv/stresses.csv, and optional csv/strains.csv or csv/energy_or_residual.csv.
9. Coverage Matrix: requirement id, model id, compared quantity, authoritative HDF5 dataset, CSV view file, tolerance, verification method, and artifact status.
10. Artifact Acceptance Checklist: conditions for considering the reference bundle ready for implementation planning.
11. Open Issues and Downstream Handoff: I/O Definition Agent, Implementation Planning Agent, Reference Verification Agent, and Physics Evaluation Agent.
@@ -79,19 +80,19 @@ Abaqus input rules to preserve in model planning:
- FESA input uses Abaqus .inp files but supports only the feature-specific keyword subset defined by I/O Definition Agent.
- model.inp must stay inside the supported keyword subset unless unsupported keywords are explicitly tracked as open issues.
- Separate model data from history data conceptually.
- Output requests must be sufficient to populate required reference CSV files.
- Node and element labels, set names, coordinate system, units, step/frame identity, and output locations must be traceable into CSV schemas.
- Output requests must be sufficient to populate required reference HDF5 datasets and deterministic CSV views.
- Node and element labels, set names, coordinate system, units, step/frame identity, and output locations must be traceable into HDF5 datasets and CSV view schemas.
Artifact readiness rules:
- status must be draft, needs-user-decision, needs-reference-artifacts, ready-for-implementation-planning, or blocked.
- Use needs-reference-artifacts when any required CSV or metadata provenance is missing.
- Use needs-reference-artifacts when reference.h5, required deterministic CSV views, or metadata provenance are missing.
- Use needs-user-decision for unknown tolerance, units, model source, or unsupported keyword policy.
- Do not claim ready-for-implementation-planning unless required artifacts, provenance, tolerance, and coverage matrix are complete.
Downstream handoff rules:
- I/O Definition Agent: request supported keyword changes, output request clarifications, and CSV schema clarifications.
- I/O Definition Agent: request supported keyword changes, output request clarifications, HDF5 schema clarifications, and CSV view schema clarifications.
- Implementation Planning Agent: pass tests that should fail before implementation, model order, and acceptance criteria.
- Reference Verification Agent: pass CSV schema, ID matching rules, units, coordinate conventions, output locations, and tolerance mapping.
- Reference Verification Agent: pass HDF5 dataset paths, CSV view schemas, ID matching rules, units, coordinate conventions, output locations, and tolerance mapping.
- Physics Evaluation Agent: pass equilibrium, symmetry, displacement direction, stress location, rigid body mode, and load path sanity checks.
Output language:
+18 -15
View File
@@ -1,5 +1,5 @@
name = "reference-verification-agent"
description = "Compares FESA solver result CSVs against stored Abaqus reference CSV artifacts and reports tolerance-based verification outcomes."
description = "Compares FESA solver HDF5 results against stored reference HDF5 artifacts and deterministic CSV views, then reports tolerance-based verification outcomes."
sandbox_mode = "workspace-write"
model_reasoning_effort = "extra high"
@@ -8,13 +8,14 @@ You are the Reference Verification Agent for the FESA structural analysis solver
Mission:
- Run reference verification only.
- Compare generated FESA solver result CSVs against stored Abaqus reference CSV artifacts.
- Compare generated FESA solver `results.h5` against stored `reference.h5` artifacts.
- Use deterministic CSV views under `csv/` only as stable comparison/review views derived from the HDF5 schema.
- Report tolerance-based verification outcomes for displacements, reactions, element forces, stresses, and approved optional quantities.
- Keep the output aligned with docs/SOLVER_AGENT_DESIGN.md, reference model contracts, I/O definitions, build/test reports, implementation reports, generated solver result CSVs, and stored references/<feature-id>/<model-id>/ artifacts.
- Keep the output aligned with docs/SOLVER_AGENT_DESIGN.md, reference model contracts, I/O definitions, build/test reports, implementation reports, generated solver HDF5 outputs, deterministic CSV views, and stored references/<feature-id>/<model-id>/ artifacts.
Skill references:
- Use $fesa-reference-comparison when comparing generated solver result CSVs with stored reference CSV artifacts, checking schema, units, ID matching, tolerance metrics, or reference verification status.
- Use $fesa-io-contract when comparison is blocked by Abaqus input scope, output CSV schema, units, coordinate system, output location, component naming, or ID matching ambiguity.
- Use $fesa-reference-comparison when comparing generated solver HDF5 results with stored reference HDF5 artifacts or deterministic CSV views, checking schema, units, ID matching, tolerance metrics, or reference verification status.
- Use $fesa-io-contract when comparison is blocked by Abaqus input scope, HDF5 schema, deterministic CSV view schema, units, coordinate system, output location, component naming, or ID matching ambiguity.
Hard boundaries:
- Do not edit source code.
@@ -23,8 +24,8 @@ Hard boundaries:
- Do not edit requirements, formulations, I/O contracts, numerical review reports, reference model contracts, reference artifacts, or tolerance policies.
- Do not change tolerance policies.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not modify model.inp, metadata.json, displacements.csv, reactions.csv, element_forces.csv, stresses.csv, or any stored reference artifact.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not modify model.inp, metadata.json, reference.h5, csv/displacements.csv, csv/reactions.csv, csv/element_forces.csv, csv/stresses.csv, or any stored reference artifact.
- Do not approve release readiness.
- Do not approve physics validation success.
- Do not produce the final release checklist.
@@ -36,17 +37,18 @@ Input priorities:
3. docs/reference-models/<feature-id>-reference-models.md.
4. docs/io-definitions/<feature-id>-io.md.
5. Implementation Agent report and docs/implementation-plans/<feature-id>-implementation-plan.md.
6. Generated solver result CSVs from the implemented solver or feature-specific comparison command.
6. Generated solver result HDF5, normally `results.h5`, from the implemented solver or feature-specific comparison command.
7. Stored references/<feature-id>/<model-id>/ artifacts.
8. Related requirements, formulations, numerical review reports, and research docs as read-only contracts.
Execution contract:
- Always work in ARTIFACT CHECK -> COMPARE -> CLASSIFY -> REPORT order.
- ARTIFACT CHECK: verify metadata.json, required reference CSVs, generated solver result CSVs, schema version, units, coordinate system, step/frame identity, node/element IDs, output location, and tolerance.
- ARTIFACT CHECK: verify metadata.json, required reference.h5, generated solver results.h5, deterministic CSV views, HDF5 schema version, CSV view schema version, units, coordinate system, step/frame identity, node/element IDs, output location, and tolerance.
- ARTIFACT CHECK: if solver output path or comparison command is missing, stop with needs-solver-results.
- ARTIFACT CHECK: if required reference artifacts or provenance are missing, stop with needs-reference-artifacts.
- ARTIFACT CHECK: if tolerance, schema, units, coordinate system, output location, ID matching rule, or zero-reference relative scale policy is missing, stop with needs-upstream-decision.
- COMPARE: compare displacements.csv, reactions.csv, element_forces.csv, stresses.csv, and optional strains.csv or energy_or_residual.csv only when upstream contracts require them.
- COMPARE: compare authoritative HDF5 datasets first, including displacement, reaction, element force, stress, and approved optional quantities only when upstream contracts require them.
- COMPARE: use csv/displacements.csv, csv/reactions.csv, csv/element_forces.csv, csv/stresses.csv, and optional csv/strains.csv or csv/energy_or_residual.csv only as deterministic views of those HDF5 datasets.
- COMPARE: use upstream tolerance policies exactly as specified. Do not adjust tolerances to force a pass.
- COMPARE: report max absolute error, max relative error, RMS error, norm error when applicable, worst node, worst element, worst component, row counts, missing rows, extra rows, and pass/fail per quantity.
- CLASSIFY: classify failures as missing-reference-artifact, missing-solver-output, schema-mismatch, id-mismatch, unit-or-coordinate-mismatch, tolerance-failure, nonfinite-result, upstream-contract, or environment.
@@ -56,14 +58,15 @@ Comparison rules:
- Nodal displacements and reactions can be compared only when node id, DOF/component, coordinate system, units, and step/frame identity match.
- Element forces can be compared only when element id, output location, component naming, units, and step/frame identity match.
- Stresses and strains can be compared only when element id, integration point or recovery location, component naming, coordinate system, units, and step/frame identity match.
- Solver result CSVs are comparison inputs only. Do not postprocess or normalize them beyond contract-defined matching and metrics.
- Reference CSVs are read-only ground truth artifacts created outside this agent.
- Solver `results.h5` and stored `reference.h5` are authoritative comparison inputs.
- Deterministic CSV views are derived comparison inputs only. Do not postprocess or normalize them beyond contract-defined matching and metrics.
- Reference HDF5 files and CSV views are read-only ground truth artifacts created outside this agent.
- A pass means reference tolerance success only; Physics Evaluation Agent owns physical sanity checks, and Release Agent owns release readiness.
Required Reference Verification Report sections:
1. Metadata: feature_id, source docs and reports, status, owner_agent, date.
2. Artifact Inventory: reference bundle path, solver output path, required CSV readiness, optional CSV readiness, metadata provenance.
3. Comparison Contract: schema version, ID matching rules, units, coordinate system, output location, component naming, tolerance source.
2. Artifact Inventory: reference bundle path, solver results.h5 path, reference.h5 path, required CSV view readiness, optional CSV view readiness, metadata provenance.
3. Comparison Contract: HDF5 schema version, CSV view schema version, ID matching rules, units, coordinate system, output location, component naming, tolerance source.
4. Quantity Results: displacement, reaction, element force, stress, and optional quantity row counts, max absolute error, max relative error, RMS error, norm error, worst id/component, pass/fail.
5. Failure Classification: missing-reference-artifact | missing-solver-output | schema-mismatch | id-mismatch | unit-or-coordinate-mismatch | tolerance-failure | nonfinite-result | upstream-contract | environment.
6. Handoff Recommendation: Correction Agent, Reference Model Agent, I/O Definition Agent, Physics Evaluation Agent, or Coordinator Agent.
@@ -74,7 +77,7 @@ Status rules:
- pass-for-physics-evaluation: all required reference comparisons pass and Physics Evaluation Agent is next.
- needs-correction: implementation-owned solver result mismatch or nonfinite result needs Correction Agent.
- needs-reference-artifacts: required stored reference artifact or provenance is missing.
- needs-solver-results: generated solver result CSV or feature-specific comparison command is missing.
- needs-solver-results: generated solver results.h5 or feature-specific comparison command is missing.
- needs-upstream-decision: schema, tolerance, units, coordinate system, output location, or ID matching policy is missing or contradictory.
- blocked: no safe progress is possible without user or Coordinator Agent decision.
+1 -1
View File
@@ -28,7 +28,7 @@ Hard boundaries:
- Do not change reference artifacts.
- Do not change tolerance policies.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not override failed or missing upstream gates.
- Do not publish, deploy, package, tag, commit, or externally release anything unless the user explicitly asks.
+2 -2
View File
@@ -19,7 +19,7 @@ Hard boundaries:
- Do not write finite element formulations.
- Do not design C++ APIs or file ownership.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not create reference CSV outputs.
- Do not create reference HDF5 outputs or deterministic CSV views.
- Do not mark a feature complete.
Source priorities:
@@ -46,7 +46,7 @@ Required Feature Requirement Specification sections:
7. Output requirements.
8. Verification quantities: nodal displacement, reaction, element internal force, stress, and any required strain, energy, or residual quantity.
9. Tolerance policy: absolute, relative, and norm-based tolerance applicability.
10. Reference artifact requirements: model.inp, metadata.json, displacements.csv, reactions.csv, element_forces.csv, stresses.csv, or an explicit N/A reason.
10. Reference artifact requirements: model.inp, metadata.json, reference.h5, csv/displacements.csv, csv/reactions.csv, csv/element_forces.csv, csv/stresses.csv, or an explicit N/A reason.
11. Requirement Verification Matrix.
12. Open questions.
13. Downstream handoff.
+1 -1
View File
@@ -20,7 +20,7 @@ Hard boundaries:
- Do not finalize FEM formulations.
- Do not design C++ APIs or file ownership.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not mark a feature complete.
Source priorities:
+1 -1
View File
@@ -65,7 +65,7 @@ ctest --test-dir build/msvc-debug --output-on-failure -C Debug
- Do not change reference artifacts.
- Do not change tolerance policies.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not approve release readiness.
## Quality Gate
+1 -1
View File
@@ -54,7 +54,7 @@ Produce or revise `docs/formulations/<feature-id>-formulation.md` with:
- Do not design C++ APIs.
- Do not implement parsers.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not approve release readiness.
## Quality Gate
+11 -8
View File
@@ -1,6 +1,6 @@
---
name: fesa-io-contract
description: Use when defining FESA solver I/O contracts, Abaqus .inp keyword subsets, internal model mapping, validation rules, and CSV schemas for solver outputs or reference comparison.
description: Use when defining FESA solver I/O contracts, Abaqus .inp keyword subsets, internal model mapping, validation rules, HDF5 result schemas, and deterministic CSV view schemas for reference comparison.
---
# FESA I/O Contract
@@ -25,9 +25,10 @@ Read these first:
3. Separate Model Data Mapping from History Data Mapping.
4. Define supported keywords such as `*NODE`, `*ELEMENT`, `*MATERIAL`, `*ELASTIC`, `*BOUNDARY`, `*CLOAD`, `*STEP`, `*OUTPUT`, `*NODE OUTPUT`, and `*ELEMENT OUTPUT` only when required.
5. Define Internal Model Contract at a semantic level without C++ APIs.
6. Define Output and CSV Schemas for `displacements.csv`, `reactions.csv`, `element_forces.csv`, `stresses.csv`, and optional result files.
7. Define units, coordinate system, component naming, output location, step/frame identity, and ID matching rules.
8. Define validation rules and open issues.
6. Define Output HDF5 Schema for authoritative solver output `results.h5`.
7. Define Deterministic CSV View Schemas for `csv/displacements.csv`, `csv/reactions.csv`, `csv/element_forces.csv`, `csv/stresses.csv`, and optional view files.
8. Define units, coordinate system, component naming, output location, step/frame identity, and ID matching rules.
9. Define validation rules and open issues.
## Output Contract
@@ -38,7 +39,8 @@ Produce or revise `docs/io-definitions/<feature-id>-io.md` with:
- Model Data Mapping
- History Data Mapping
- Internal Model Contract
- Output and CSV Schemas
- Output HDF5 Schema
- Deterministic CSV View Schemas
- Validation Rules
- Downstream Handoff
@@ -48,16 +50,17 @@ Produce or revise `docs/io-definitions/<feature-id>-io.md` with:
- Do not design C++ APIs.
- Do not claim full Abaqus compatibility.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not approve release readiness.
## Quality Gate
- Every supported keyword has a documented purpose, required data, and unsupported-case behavior.
- CSV schemas carry units, coordinate system, component naming, output location, and ID matching rules.
- HDF5 schema is the authoritative solver output contract and must carry schema version, step/frame identity, units, coordinate system, output location, and component naming.
- Deterministic CSV view schemas are comparison views derived from HDF5 datasets and must define stable row ordering, ID fields, and component ordering.
- Unsupported Abaqus input is explicit: unsupported, ignored-with-warning, or requires user decision.
- The I/O contract is compatible with requirements, formulation, and reference comparison needs.
## Handoff
Send keyword and schema contracts to Reference Model Agent and Implementation Planning Agent. Send comparison schema, ID matching, and tolerance-source constraints to Reference Verification Agent.
Send keyword and schema contracts to Reference Model Agent and Implementation Planning Agent. Send HDF5 dataset paths, deterministic CSV view schemas, ID matching, and tolerance-source constraints to Reference Verification Agent.
@@ -1,4 +1,4 @@
interface:
display_name: "FESA I/O Contract"
short_description: "Define solver I/O contracts"
default_prompt: "Use $fesa-io-contract to define Abaqus input and result CSV contracts."
default_prompt: "Use $fesa-io-contract to define Abaqus input, HDF5 result, and deterministic CSV view contracts."
+1 -1
View File
@@ -48,7 +48,7 @@ Produce or revise `docs/numerical-reviews/<feature-id>-review.md` with:
- Do not edit formulations directly.
- Do not design C++ APIs or file ownership.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not approve release readiness.
- Do not decide reference comparison success.
+2 -2
View File
@@ -17,7 +17,7 @@ Read these first:
- Reference Verification report with `pass-for-physics-evaluation`
- `docs/reference-models/<feature-id>-reference-models.md`
- Requirements, formulation, numerical review, and I/O definition documents
- Stored solver and reference CSVs as read-only evidence
- Stored solver/reference HDF5 files and deterministic CSV views as read-only evidence
## Workflow
@@ -52,7 +52,7 @@ Produce or revise `docs/physics-evaluations/<feature-id>-physics-evaluation.md`
- Do not edit CMake files.
- Do not edit requirements, formulations, I/O contracts, reference model contracts, reference artifacts, or tolerance policies.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not approve release readiness.
- Do not approve reference tolerance success.
@@ -1,6 +1,6 @@
---
name: fesa-reference-comparison
description: Use when running FESA solver reference CSV comparison, checking stored artifacts, schema, units, ID matching, tolerance metrics, and reference verification status.
description: Use when running FESA solver HDF5 reference comparison with deterministic CSV view checks, checking stored artifacts, schema, units, ID matching, tolerance metrics, and reference verification status.
---
# FESA Reference Comparison
@@ -17,15 +17,16 @@ Read these first:
- Build/Test report with `pass-for-reference-verification`
- `docs/reference-models/<feature-id>-reference-models.md`
- `docs/io-definitions/<feature-id>-io.md`
- Generated solver result CSVs
- Generated solver result HDF5, normally `results.h5`
- Deterministic solver CSV views when a comparison command materializes them
- Stored `references/<feature-id>/<model-id>/` artifacts
## Workflow
1. Follow `ARTIFACT CHECK -> COMPARE -> CLASSIFY -> REPORT`.
2. ARTIFACT CHECK: verify `metadata.json`, required reference CSV files, generated solver result CSV files, schema version, units, coordinate system, step/frame identity, ID matching, output location, component naming, and tolerance source.
2. ARTIFACT CHECK: verify `metadata.json`, required `reference.h5`, generated solver `results.h5`, deterministic CSV view files, schema version, units, coordinate system, step/frame identity, ID matching, output location, component naming, and tolerance source.
3. Stop with `needs-reference-artifacts`, `needs-solver-results`, or `needs-upstream-decision` when required comparison inputs are missing.
4. COMPARE only required quantities: `displacements.csv`, `reactions.csv`, `element_forces.csv`, `stresses.csv`, and optional `strains.csv` or `energy_or_residual.csv`.
4. COMPARE authoritative HDF5 datasets first, using deterministic CSV view files such as `csv/displacements.csv`, `csv/reactions.csv`, `csv/element_forces.csv`, `csv/stresses.csv`, and optional `csv/strains.csv` or `csv/energy_or_residual.csv` only as stable review/comparison views.
5. Apply upstream tolerance exactly. Do not loosen or reinterpret tolerance.
6. Report max absolute error, max relative error, RMS error, norm error, worst id, worst component, missing rows, extra rows, and pass/fail.
7. CLASSIFY failures as missing-reference-artifact, missing-solver-output, schema-mismatch, id-mismatch, unit-or-coordinate-mismatch, tolerance-failure, nonfinite-result, upstream-contract, or environment.
@@ -51,7 +52,7 @@ Produce or revise `docs/reference-verifications/<feature-id>-reference-verificat
- Do not change requirements, formulations, I/O contracts, reference artifacts, or tolerance policies.
- Do not change tolerance policies.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not approve physics validation or release readiness.
## Quality Gate
@@ -60,8 +61,9 @@ Produce or revise `docs/reference-verifications/<feature-id>-reference-verificat
- Missing rows and extra rows are reported, not ignored.
- Nonfinite values are reported explicitly.
- `pass-for-physics-evaluation` means reference tolerance success only.
- Solver output CSVs are comparison inputs only; do not normalize them beyond documented matching and metrics.
- Solver `results.h5` and `reference.h5` are authoritative comparison inputs.
- Deterministic CSV view files are derived views only; do not normalize them beyond documented matching and metrics.
## Handoff
Send passing reports to Physics Evaluation Agent. Send implementation-owned mismatches to Correction Agent. Send missing artifacts to Reference Model Agent and schema conflicts to I/O Definition Agent.
Send passing reports to Physics Evaluation Agent. Send implementation-owned mismatches to Correction Agent. Send missing artifacts to Reference Model Agent and HDF5/CSV view schema conflicts to I/O Definition Agent.
@@ -1,4 +1,4 @@
interface:
display_name: "FESA Reference Comparison"
short_description: "Compare solver CSV results"
default_prompt: "Use $fesa-reference-comparison to compare FESA solver CSVs against reference CSVs."
short_description: "Compare HDF5 results"
default_prompt: "Use $fesa-reference-comparison to compare FESA solver results.h5 against reference.h5 and deterministic CSV views."
+11 -10
View File
@@ -1,6 +1,6 @@
---
name: fesa-reference-models
description: Use when designing FESA reference model portfolios, Abaqus input artifact bundles, metadata provenance, required reference CSV artifacts, coverage matrices, and implementation-planning handoffs.
description: Use when designing FESA reference model portfolios, Abaqus input artifact bundles, metadata provenance, required reference HDF5 artifacts, deterministic CSV views, coverage matrices, and implementation-planning handoffs.
---
# FESA Reference Models
@@ -26,10 +26,11 @@ Read these first:
2. Build a model inventory: smoke, analytical, patch test, benchmark, regression, and negative/invalid-input models.
3. For each model, record `model_id`, purpose, verified requirements, analysis type, element type, material, boundary conditions, loads, expected quantities, tolerance, source, and status.
4. Define `references/<feature-id>/<model-id>/` artifact bundle requirements.
5. Require `model.inp`, `metadata.json`, `displacements.csv`, `reactions.csv`, `element_forces.csv`, `stresses.csv`, and `README.md` unless explicitly not applicable.
6. Define optional `strains.csv` and `energy_or_residual.csv` only when upstream acceptance criteria require them.
7. Define metadata provenance, units, coordinate system, output requests, artifact status, and limitations.
8. Build a Coverage Matrix mapping requirement id, model id, compared quantity, artifact file, tolerance, verification method, and status.
5. Require `model.inp`, `metadata.json`, `reference.h5`, deterministic CSV views under `csv/`, and `README.md` unless explicitly not applicable.
6. Define required CSV views `csv/displacements.csv`, `csv/reactions.csv`, `csv/element_forces.csv`, and `csv/stresses.csv` only as deterministic views of `reference.h5`.
7. Define optional `csv/strains.csv` and `csv/energy_or_residual.csv` only when upstream acceptance criteria require them.
8. Define metadata provenance, units, coordinate system, output requests, artifact status, and limitations.
9. Build a Coverage Matrix mapping requirement id, model id, compared quantity, authoritative HDF5 dataset, CSV view file, tolerance, verification method, and status.
## Output Contract
@@ -42,7 +43,7 @@ Produce or revise `docs/reference-models/<feature-id>-reference-models.md` with:
- Abaqus Input Requirements
- Artifact Bundle Contract
- Metadata JSON Contract
- Reference CSV Requirements
- Reference HDF5 and CSV View Requirements
- Coverage Matrix
- Artifact Acceptance Checklist
- Open Issues and Downstream Handoff
@@ -53,7 +54,7 @@ Produce or revise `docs/reference-models/<feature-id>-reference-models.md` with:
- Do not implement parsers.
- Do not design C++ APIs or file ownership.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not compare solver results.
- Do not approve release readiness.
@@ -61,9 +62,9 @@ Produce or revise `docs/reference-models/<feature-id>-reference-models.md` with:
- Every `must` requirement maps to at least one model and compared quantity.
- `model.inp` stays within the supported Abaqus keyword subset or records an open issue.
- `metadata.json` includes provenance, Abaqus version/source, units, coordinate system, tolerance, and CSV schema version.
- Missing required CSVs keep the model at `needs-reference-artifacts`.
- `metadata.json` includes provenance, Abaqus version/source, units, coordinate system, tolerance, HDF5 schema version, and CSV view schema version.
- Missing `reference.h5` or required deterministic CSV views keep the model at `needs-reference-artifacts`.
## Handoff
Send model order and tests that should fail first to Implementation Planning Agent. Send schema, matching, output location, and tolerance mapping to Reference Verification Agent. Send physical expectations to Physics Evaluation Agent.
Send model order and tests that should fail first to Implementation Planning Agent. Send HDF5 dataset paths, deterministic CSV view schemas, matching, output location, and tolerance mapping to Reference Verification Agent. Send physical expectations to Physics Evaluation Agent.
@@ -50,7 +50,7 @@ Produce or revise `docs/releases/<feature-id>-release.md` with:
- Do not implement code.
- Do not edit source code, tests, CMake files, requirements, formulations, I/O contracts, reference artifacts, or tolerance policies.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not override failed or missing gates.
- Do not publish, deploy, package, tag, commit, or externally release anything unless the user explicitly asks.
@@ -47,7 +47,7 @@ Produce or revise `docs/requirements/<feature-id>.md` with:
- Do not write finite element formulations.
- Do not design C++ APIs or file ownership.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not approve release readiness.
## Quality Gate
@@ -46,7 +46,7 @@ Produce or revise `docs/research/<feature-id>-research.md` with:
- Do not finalize FEM formulations.
- Do not design C++ APIs or file ownership.
- Do not run Abaqus, Nastran, or any reference solver.
- Do not generate reference CSVs.
- Do not generate reference HDF5 files or deterministic CSV views.
- Do not approve release readiness.
## Quality Gate
+5 -4
View File
@@ -50,9 +50,9 @@ Create `phases/{task-name}/index.json`:
"project": "FESA Harness",
"phase": "<task-name>",
"steps": [
{ "step": 0, "name": "project-setup", "status": "pending" },
{ "step": 1, "name": "core-types", "status": "pending" },
{ "step": 2, "name": "validation-path", "status": "pending" }
{ "step": 0, "name": "project-setup", "status": "pending", "allowed_paths": ["CMakeLists.txt", "tests/"] },
{ "step": 1, "name": "core-types", "status": "pending", "allowed_paths": ["src/fesa/core/", "tests/unit/"] },
{ "step": 2, "name": "validation-path", "status": "pending", "allowed_paths": ["scripts/", "docs/"] }
]
}
```
@@ -63,6 +63,7 @@ Rules:
- `phase` matches the task directory name.
- `steps[].step` starts at `0`.
- Initial status is always `pending`.
- Each step must declare non-empty `allowed_paths` using repository-relative paths, directory prefixes, or glob patterns.
- Do not add timestamps when creating files. `scripts/execute.py` records `created_at`, `started_at`, `completed_at`, `failed_at`, and `blocked_at`.
## Step Template
@@ -124,6 +125,6 @@ python scripts/execute.py {task-name}
python scripts/execute.py {task-name} --push
```
`scripts/execute.py` creates or checks out `feat-{task-name}`, injects `AGENTS.md` and `docs/*.md` into each prompt, carries completed step summaries forward, retries failed steps up to three times, separates code and metadata commits, and records timestamps.
`scripts/execute.py` creates or checks out `codex/{task-name}`, refuses dirty worktrees, requires per-step `allowed_paths`, stages only explicit allowed paths and runner housekeeping files, validates before every runner-created commit, injects `AGENTS.md` and `docs/*.md` into each prompt, carries completed step summaries forward, retries failed steps up to three times, and records timestamps.
If a step is `error`, set it back to `pending` and remove `error_message` after fixing the cause. If a step is `blocked`, resolve `blocked_reason`, set it back to `pending`, remove `blocked_reason`, and rerun.
+53 -5
View File
@@ -1,28 +1,76 @@
# Project: FESA Harness
# Project: FESA Structural Solver
## 기술 스택
- C++17 이상
- MSVC on Windows
- CMake + CTest
- Harness scripts in Python 3
- Python 3 Harness scripts
- Intel oneAPI MKL, Intel oneAPI TBB
- HDF5 result storage
- Abaqus `.inp` keyword subset input
## 프로젝트 정체성
- FESA는 유한요소법 기반 구조해석 솔버 개발 프로젝트이다.
- Harness는 솔버 자체가 아니라 요구조건, TDD, phase 실행, 검증을 통제하는 개발 운영 인프라이다.
- 문서와 구현은 full Abaqus compatibility를 주장하지 않는다. 기능별로 승인된 Abaqus keyword subset만 지원한다.
- 공식 solver output은 HDF5이다. CSV는 reference comparison을 위한 deterministic view 또는 보조 artifact로만 둔다.
## 아키텍처 규칙
- CRITICAL: 기본 검증 경로는 `python scripts/validate_workspace.py`이다.
- CRITICAL: C++ 빌드는 CMake/MSVC/x64/Debug 기준으로 검증한다.
- CRITICAL: 새 기능 또는 동작 변경은 테스트를 먼저 작성하고 실패를 확인한 뒤 구현한다.
- CRITICAL: Abaqus reference artifact나 solver 코드 복원은 명시적으로 요청된 phase에서만 수행한다.
- CRITICAL: C++ production file을 바꿀 때는 관련 C++ test file이 있어야 한다.
- CRITICAL: Abaqus reference artifact 생성, 수정, 복원은 명시적으로 요청된 phase에서만 수행한다.
- CRITICAL: `harness-workflow` 스킬은 사용자가 명시적으로 허용하기 전까지 사용하지 않는다.
- Domain은 입력 파일에서 생성된 전체 모델 정의를 소유하고, 파싱 이후 가능한 한 불변으로 취급한다.
- AnalysisModel은 현재 step에서 활성화된 elements, loads, boundary conditions, properties/materials의 view를 제공하며 Domain을 복사하지 않는다.
- DofManager는 node별 자유도 정의, constrained/free mapping, equation numbering, sparse pattern ownership을 전담한다. Node 또는 Element 내부에 equation id를 분산 저장하지 않는다.
- AnalysisState는 displacement, velocity, acceleration, temperature, external/internal force, residual, time/increment/iteration, element state를 소유한다.
- MKL, TBB, HDF5 API는 solver core에 직접 노출하지 않는다. `LinearSolver`, `ParallelFor`, `ResultsWriter`, `Vector`, `Matrix`, `SparseMatrix` adapter 경계 뒤에 둔다.
- Codex custom agent의 `model_reasoning_effort` 기본값은 `extra high`로 둔다.
- Harness runner는 `scripts/execute.py`에 둔다.
- `scripts/execute.py``codex/<phase-name>` branch prefix만 사용한다.
- `scripts/execute.py` 실행 전 worktree는 clean 상태여야 한다.
- 각 phase step은 non-empty `allowed_paths`를 선언해야 한다.
- runner는 explicit allowed path와 runner housekeeping file만 stage하며 broad staging을 사용하지 않는다.
- runner가 만드는 모든 commit 전에는 Harness Python self-test와 `python scripts/validate_workspace.py`가 통과해야 한다.
- Codex hook 정책은 `.codex/hooks/`에 둔다.
- Harness planning/review instructions are stored in `.codex/skills/`.
- Generated phase execution outputs remain ignored under `phases/**/step*-output.json`.
## 개발 프로세스
- TDD를 기본으로 한다. C++ production file을 바꿀 때는 관련 C++ test file이 있어야 한다.
- TDD를 기본으로 한다. 구현은 `RED -> GREEN -> VERIFY` 순서를 따른다.
- 기능 개발은 다음 gate를 순서대로 통과해야 한다.
1. 요구조건 분석
2. 연구자료 조사
3. 유한요소 정식화
4. 수치 검토
5. I/O 계약 정의
6. reference model 계약 준비
7. C++ 구현
8. build/test 검증
9. reference comparison
10. physics sanity
11. release readiness
- 커밋 전 hook은 Harness Python self-test와 workspace validation을 실행해야 한다.
- 커밋 메시지는 conventional commits 형식을 따른다: `feat:`, `fix:`, `docs:`, `refactor:`, `test:`.
- 계획이 필요한 장기 작업은 Harness phase로 나누고, 각 step은 독립 실행 가능해야 한다.
## Agent/Skill Workflow
| 개발 과정 | Agent | Skill | 산출물 |
| --- | --- | --- | --- |
| 요구조건 분석 | `requirement-agent` | `fesa-requirements-baseline` | `docs/requirements/<feature-id>.md` |
| 연구자료 조사 | `research-agent` | `fesa-research-evidence`, `fem-theory-query` | `docs/research/<feature-id>-research.md` |
| 유한요소 정식화 | `formulation-agent` | `fesa-formulation-spec` | `docs/formulations/<feature-id>-formulation.md` |
| 수치 검토 | `numerical-review-agent` | `fesa-numerical-review` | `docs/numerical-reviews/<feature-id>-review.md` |
| I/O 정의 | `io-definition-agent` | `fesa-io-contract` | `docs/io-definitions/<feature-id>-io.md` |
| reference model | `reference-model-agent` | `fesa-reference-models` | `docs/reference-models/<feature-id>-reference-models.md` |
| 구현 계획/구현 | `implementation-planning-agent`, `implementation-agent` | `fesa-cpp-msvc-tdd` | tests, source, implementation report |
| build/test | `build-test-executor-agent` | `fesa-cpp-msvc-tdd` | `docs/build-test-reports/<feature-id>.md` |
| correction | `correction-agent` | `fesa-cpp-msvc-tdd` | `docs/corrections/<feature-id>.md` |
| reference 비교 | `reference-verification-agent` | `fesa-reference-comparison` | `docs/reference-verifications/<feature-id>-reference-verification.md` |
| 물리 검토 | `physics-evaluation-agent` | `fesa-physics-sanity` | `docs/physics-evaluations/<feature-id>-physics-evaluation.md` |
| 배포 준비 | `release-agent` | `fesa-release-readiness` | `docs/releases/<feature-id>-release.md` |
## 명령어
```bash
python -m unittest discover -s scripts -p "test_*.py"
+68 -19
View File
@@ -1,34 +1,83 @@
# Architecture Decision Records
## 철학
Harness는 현재 프로젝트의 실제 기술 스택을 반영해야 한다. C++/MSVC 프로젝트에서 npm, Next.js, TypeScript test naming을 기본값으로 두면 agent prompt와 hook policy가 잘못된 구현을 유도한다.
FESA의 architecture decision은 solver correctness, verification traceability, implementation testability를 우선한다. Harness는 제품이 아니라 C++/MSVC 기반 FEM 구조해석 솔버 개발을 통제하는 운영 인프라이다.
---
### ADR-001: C++ 전용 Harness
**결정**: Harness scaffold는 C++/MSVC 전용으로 운영한다. JavaScript/TypeScript fallback은 유지하지 않는다.
### ADR-001: FESA는 구조해석 솔버 프로젝트이고 Harness는 운영 인프라로 둔다
**결정**: 저장소의 주 목적은 유한요소법 기반 구조해석 솔버 개발이다. Harness scaffold는 phase execution, TDD guard, commit validation, workspace validation을 제공하는 보조 계층으로 유지한다.
**이유**: FESA 개발 환경은 MSVC 기반 C++이다. 언어별 fallback을 남기면 validation, TDD guard, acceptance criteria가 흐려진다.
**이유**: 기존 문서가 Harness 중심이면 agent가 solver architecture, FEM verification, Abaqus/HDF5 계약보다 운영 스크립트에 과도하게 맞춰 행동한다.
**트레이드오프**: 같은 Harness scaffold를 JS/TS 프로젝트에 재사용할 수 없다. 필요하면 별도 template이나 language registry를 새 ADR로 설계한다.
**트레이드오프**: Harness 문서의 비중은 낮아지지만, 검증 명령과 hook 정책은 계속 필수 운영 규칙으로 유지한다.
### ADR-002: CMake/MSVC/x64/Debug 기본 검증
**결정**: 기본 workspace validation은 CMake, Visual Studio 17 2022 generator, x64 platform, Debug config, CTest로 수행한다.
### ADR-002: C++17/MSVC/CMake/CTest를 기본 구현 환경으로 둔다
**결정**: 기본 solver 구현과 validation은 C++17 이상, Visual Studio 17 2022 generator, x64 platform, Debug config, CMake, CTest로 수행한다.
**이유**: MSVC 환경에서 CMake/CTest는 source tree가 복원되거나 새 C++ project가 추가될 때 가장 일관된 build/test entry point다.
**이유**: FESA의 목표 환경은 Windows/MSVC 기반 C++이다. CMake/CTest는 solver source tree가 추가되거나 확장될 때 가장 일관된 build/test entry point다.
**트레이드오프**: Visual Studio solution-only project는 기본 지원하지 않는다. 명시적으로 필요하면 `HARNESS_VALIDATION_COMMANDS`로 override한다.
**트레이드오프**: Visual Studio solution-only workflow는 기본 지원하지 않는다. 필요하면 `HARNESS_VALIDATION_COMMANDS`로 override한다.
### ADR-003: 엄격한 C++ TDD Guard
**결정**: C++ production file 변경은 관련 C++ test file이 없으면 차단한다.
### ADR-003: Abaqus `.inp` full compatibility가 아니라 기능별 keyword subset을 지원한다
**결정**: FESA parser는 Abaqus keyword/data/comment line 규칙을 따르되, 기능별로 승인된 keyword subset만 지원한다. 미지원 keyword는 명확한 diagnostic을 남긴다.
**이유**: Harness의 핵심 목적은 agent가 검증 없는 C++ 변경을 만들지 않도록 하는 것이다. Header 중심 C++ 구조에서도 module 또는 basename 기반 테스트 존재를 확인한다.
**이유**: full Abaqus compatibility는 초기 solver 범위와 검증 비용을 과도하게 키운다. 기능별 subset은 요구조건, I/O contract, reference validation을 추적 가능하게 만든다.
**트레이드오프**: 사용자는 기존 Abaqus input file을 그대로 사용할 수 없을 수 있다. 대신 지원 범위와 실패 원인이 명확해진다.
### ADR-004: Domain, AnalysisModel, DofManager, AnalysisState를 분리한다
**결정**: `Domain`은 입력 모델 정의를 소유하고, `AnalysisModel`은 현재 step의 실행 view를 제공하며, `DofManager`는 equation numbering과 constrained/free mapping을 전담하고, `AnalysisState`는 해석 중 변하는 물리량을 소유한다.
**이유**: 모델 정의, step activation, equation system, transient/nonlinear state가 섞이면 parser, assembler, solver, result writer가 강하게 결합된다. 분리된 상태 모델은 선형 정적 해석에서 시작해 비선형, 동적, thermal coupling으로 확장하기 쉽다.
**트레이드오프**: 초기 class 수가 늘어난다. Phase 1에서는 interface를 얇게 유지하고 displacement 중심 state부터 구현한다.
### ADR-005: 공식 결과 파일은 HDF5로 하고 CSV는 비교 view로 제한한다
**결정**: FESA solver의 authoritative result output은 HDF5이다. CSV는 reference comparison을 위한 deterministic view 또는 임시 검증 artifact로만 사용한다.
**이유**: 구조해석 결과는 step/frame, field/history, node/element/integration point location, units, coordinate system, schema version을 함께 가져야 한다. HDF5는 이 계층 구조와 metadata를 안정적으로 표현한다.
**트레이드오프**: reference comparison은 HDF5 dataset identity와 deterministic CSV view identity를 모두 관리해야 한다. CSV-only bundle은 transition artifact로만 허용하고, 기본 ready 상태는 `results.h5`/`reference.h5``csv/` view 계약을 모두 만족해야 한다.
### ADR-006: 해석 알고리즘과 수치 backend는 Strategy와 Adapter 경계 뒤에 둔다
**결정**: `Analysis`, `LinearSolver`, `TimeIntegrator`, `ConvergenceCriteria`는 Strategy로 구성하고, MKL, TBB, HDF5 API는 adapter 계층 뒤에 둔다.
**이유**: 선형 정적, 비선형 정적, 동적, frequency, heat transfer 해석은 공통 흐름을 공유하지만 알고리즘과 backend가 다르다. 외부 API를 core에 노출하면 테스트 double, backend 교체, dependency review가 어려워진다.
**트레이드오프**: 단일 기능만 구현할 때는 adapter가 다소 장황해 보일 수 있다. 하지만 solver backend와 result writer는 장기적으로 교체 가능해야 한다.
### ADR-007: Analysis 실행 흐름은 Template Method로 고정한다
**결정**: `Analysis::run()``initialize -> buildAnalysisModel -> buildDofMap -> buildSparsePattern -> assemble -> applyBoundaryConditions -> solve -> updateState -> writeResults` 흐름을 고정한다.
**이유**: 해석 procedure가 늘어나도 공통 실행 순서가 유지되어야 검증, logging, result writing, failure classification이 일관된다.
**트레이드오프**: 특수 해석 절차가 공통 흐름에 맞지 않는 경우 hook point가 필요하다. 초기에는 선형 정적 해석을 기준으로 최소 hook만 둔다.
### ADR-008: Sparse assembly는 deterministic COO-to-CSR 경로로 시작한다
**결정**: 초기 assembly는 element-local contribution을 COO triplet으로 수집한 뒤 CSR로 finalize한다. MKL PARDISO backend는 CSR input contract를 받는다.
**이유**: CSR은 MKL PARDISO와 잘 맞고, COO-to-CSR 경로는 구현과 테스트가 명확하다. deterministic reduction은 reference comparison의 재현성을 지킨다.
**트레이드오프**: 대규모 모델에서는 메모리와 변환 비용이 생길 수 있다. 성능 문제가 실제로 확인되면 typed batch assembly 또는 kernel 분리를 추가한다.
### ADR-009: TBB 병렬화는 element-local computation부터 적용한다
**결정**: 첫 oneTBB 적용 지점은 element-local matrix/residual 계산이다. 전역 sparse write는 thread-local buffer 또는 deterministic reduction으로 제한한다.
**이유**: element-local 계산은 독립성이 높고 병렬화 효과가 명확하다. 전역 sparse matrix에 직접 병렬 write하면 재현성, race, ordering 문제가 생긴다.
**트레이드오프**: 초기 병렬화 범위가 제한된다. MKL 내부 thread와 TBB task arena의 oversubscription 정책을 별도로 문서화해야 한다.
### ADR-010: Abaqus reference artifact는 사람이 생성하거나 명시 승인된 절차로만 갱신한다
**결정**: Agent는 Abaqus, Nastran 또는 reference solver를 직접 실행하지 않는다. reference artifact 생성, 수정, 복원은 명시 승인된 phase에서만 수행하고 provenance를 `metadata.json`에 기록한다.
**이유**: reference 결과는 solver correctness의 기준이다. 생성 절차가 불명확하면 구현 결함과 reference artifact 오류를 구분할 수 없다.
**트레이드오프**: reference 준비가 느려질 수 있다. 대신 검증 기준의 신뢰도와 감사 가능성이 높아진다.
### ADR-011: C++ production 변경은 TDD guard와 workspace validation을 통과해야 한다
**결정**: C++ production file 변경은 관련 C++ test file이 없으면 차단한다. 기본 검증은 `python -m unittest discover -s scripts -p "test_*.py"``python scripts/validate_workspace.py`를 사용한다.
**이유**: FEM solver 결함은 작은 부호, DOF ordering, integration rule 오류에서도 발생한다. 테스트 없는 변경을 막아야 reference validation 이전 단계에서 회귀를 줄일 수 있다.
**트레이드오프**: 초기 scaffolding 작업에서 guard가 엄격하게 느껴질 수 있다. 문서, CMake 설정, Harness metadata는 guard 대상에서 제외한다.
### ADR-004: Harness 자체 테스트 우선
**결정**: commit hook은 먼저 Python Harness self-test를 실행한 뒤 workspace validation을 실행한다.
**이유**: 현재 저장소에는 C++ source tree가 없을 수 있다. Harness가 스스로 검증 가능해야 이후 phase generation과 source restoration을 안전하게 진행할 수 있다.
**트레이드오프**: commit 시간이 조금 늘어난다. 대신 hook/validation regressions를 빠르게 잡는다.
+225 -14
View File
@@ -1,31 +1,242 @@
# 아키텍처
## 목표
이 저장소의 현재 책임은 C++/MSVC 프로젝트를 위한 Codex Harness scaffold를 제공하는 것이다. Harness는 phase execution, edit guard, commit validation, workspace validation을 분리해서 관리한다.
FESA의 아키텍처 목표는 Abaqus `.inp` subset을 내부 semantic model로 변환하고, 유한요소 equation system을 구성해 구조해석 결과를 HDF5로 저장하며, reference comparison과 physics sanity가 가능한 C++17/MSVC 솔버 구조를 제공하는 것이다.
핵심 품질 속성:
- FEM formulation traceability
- explicit I/O contracts
- sparse linear algebra backend isolation
- deterministic verification
- incremental feature addition
- Harness 기반 TDD와 workspace validation
## 디렉토리 구조
```text
src/
fesa/
core/ # ids, status, diagnostics, units, small value types
io/
abaqus/ # .inp lexer/parser, keyword subset, include policy
hdf5/ # HDF5 result writer/reader, schema versioning
model/ # semantic model: nodes, elements, sets, materials, sections, steps
fem/ # DOF space, equation numbering, quadrature, shape functions
elements/ # truss/bar, beam, plane, solid, shell element routines
materials/ # elastic/plastic material contracts and state variables
assembly/ # local-to-global mapping, sparse pattern, COO/CSR assembly
constraints/ # essential BC, MPC, penalty or elimination policies
solvers/
linear/ # MKL PARDISO backend, iterative backend boundary
nonlinear/ # Newton control, residual/tangent norms, increments
analysis/ # static, modal, dynamic, nonlinear procedure drivers
results/ # recovery, field/history output, diagnostics
validation/ # comparison metrics and tolerance helpers
tests/
unit/
integration/
reference/
references/
<feature-id>/
<model-id>/
model.inp
metadata.json
reference.h5
csv/
deterministic comparison views
.codex/
├── hooks/ # Codex hook scripts
└── skills/ # Harness planning/review instructions
docs/ # Project and Harness guidance
hooks/ # Codex hook scripts
skills/ # FESA solver and Harness instructions
docs/ # Product, architecture, ADR, workflow artifacts
scripts/
├── execute.py # Phase step executor
├── validate_workspace.py
└── test_*.py # Harness self-tests
phases/ # Optional generated phase plans
execute.py # Phase step executor
validate_workspace.py # Default validation entry point
test_*.py # Harness self-tests
phases/ # Optional generated phase plans
```
## Harness Execution Layer
`scripts/execute.py`:
- creates or checks out `codex/<phase-name>`
- refuses to run on a dirty worktree
- requires per-step `allowed_paths`
- stages only explicit allowed paths and runner housekeeping files
- runs Python Harness self-tests and workspace validation before every runner-created commit
## 모듈 경계
- `core`는 외부 라이브러리에 의존하지 않는다.
- `io/abaqus`는 syntax와 semantic mapping만 담당하고 해석 알고리즘을 알지 않는다.
- `model`은 Abaqus keyword 문자열이 아니라 solver semantic model을 가진다.
- `fem`은 DOF, interpolation, quadrature, local/global mapping을 제공하되 특정 analysis procedure에 종속되지 않는다.
- `elements``materials`는 local residual/tangent/stress recovery 계약을 제공한다.
- `assembly`는 sparse pattern 생성과 local contribution 조립을 담당한다.
- `constraints`는 essential BC, MPC, penalty/elimination 정책을 분리한다.
- `solvers`는 MKL/TBB 세부 구현을 감추는 backend boundary를 가진다.
- `analysis`는 step/history data를 받아 procedure를 실행하고 solver backend와 result writer를 조율한다.
- `results`는 HDF5 schema를 통해 nodal, element, integration-point, diagnostic output을 분리한다.
- test helper는 production parser/solver 내부 상태를 우회하지 않는다.
## 핵심 객체 모델
```text
Domain
├── Node
├── Element
├── Material
├── Property
├── NodeSet
├── ElementSet
├── BoundaryCondition
├── Load
└── StepDefinition
AnalysisModel
├── active elements
├── active loads
├── active boundary conditions
├── active properties/materials
└── equation system view
AnalysisState
├── displacement U
├── velocity V
├── acceleration A
├── temperature T
├── external force Fext
├── internal force Fint
├── residual R
├── current time / increment / iteration
└── element state / integration point state
DofManager
├── node dof definitions
├── constrained/free dof mapping
├── equation numbering
├── sparse matrix pattern ownership
└── full/reduced vector reconstruction
Analysis
├── LinearStaticAnalysis
├── NonlinearStaticAnalysis
├── DynamicAnalysis
├── FrequencyAnalysis
└── HeatTransferAnalysis
Element
├── Element1D
│ ├── Truss
│ └── Beam
├── Element2D
│ ├── MITC3
│ └── MITC4
└── Element3D
├── Hexahedral
├── Tetrahedral
├── Wedge
└── Pyramid
BoundaryCondition
├── Fix
├── RBE2
└── RBE3
Load
├── NodalLoad
├── PressureLoad
└── BodyForce
Results
├── ResultStep
├── ResultFrame
├── FieldOutput
└── HistoryOutput
```
## 상태 관리
- `Domain`은 입력 파일에서 만들어진 전체 모델 정의를 소유한다. 파싱 이후에는 가능한 한 불변으로 취급한다.
- `AnalysisModel`은 현재 step에서 활성화되는 해석 객체들의 실행 view이다. `Domain`을 복사하지 않고 참조 또는 id 기반 view로 구성한다.
- `DofManager`는 자유도와 방정식 번호를 전담한다. `Node` 또는 `Element` 내부에 equation id를 분산 저장하지 않는다.
- `AnalysisState`는 해석 중 변하는 물리량과 반복 상태를 소유한다. Phase 1에서는 displacement 중심으로 최소 구현하되, 기하비선형과 thermal-stress coupling을 위해 element/internal state 확장 지점을 유지한다.
- 결과는 `ResultStep` -> `ResultFrame` -> `FieldOutput`/`HistoryOutput` 구조로 관리한다.
## 데이터 흐름
```text
User-approved task
-> Harness phase files under phases/
-> scripts/execute.py injects AGENTS.md and docs/*.md
-> Codex executes one step at a time
-> step updates phases/{phase}/index.json
-> validation runs through scripts/validate_workspace.py
Abaqus input file
-> InputParser
-> Domain 생성
-> StepDefinition 루프
-> AnalysisModel 생성
-> DofManager로 자유도/방정식 번호 생성
-> sparse pattern 생성
-> Analysis 실행
-> Assembler로 전역 행렬/벡터 조립
-> BoundaryCondition 적용
-> LinearSolver 또는 nonlinear/time integration loop
-> AnalysisState 갱신
-> ResultsWriter로 step/frame/history 저장
-> 다음 step 진행
```
## 해석 실행 흐름
`Analysis::run()`은 Template Method로 다음 큰 흐름을 고정한다. 해석 종류별 class는 필요한 단계만 재정의한다.
```text
initialize
buildAnalysisModel
buildDofMap
buildSparsePattern
assemble
applyBoundaryConditions
solve
updateState
writeResults
```
비선형 정적해석은 이 흐름을 Newton-Raphson 반복 루프 안에서 사용하고, 동적해석은 time step/frame 루프 안에서 사용한다.
## 설계 패턴
- Strategy Pattern: `Analysis`, `LinearSolver`, `TimeIntegrator`, `ConvergenceCriteria`를 교체 가능한 전략으로 둔다.
- Template Method Pattern: `Analysis::run()`은 공통 실행 흐름을 고정하고 세부 단계는 procedure별로 재정의한다.
- Factory + Registry Pattern: Abaqus keyword와 내부 객체 생성을 분리한다. 예: `*Element, type=S4` -> `MITC4ElementFactory`.
- Adapter Pattern: MKL, TBB, HDF5 API는 solver core에 직접 노출하지 않는다.
- Runtime Polymorphism: 요소, 재료, 하중, 경계조건은 base interface를 통해 다룬다. 대규모 모델 성능 최적화가 필요하면 assembly 내부에서 타입별 batch 처리 또는 kernel 분리를 추가한다.
- RAII: MKL handle, HDF5 file/dataset, temporary solver workspace의 수명과 오류 처리를 wrapper에 묶는다.
## Sparse Matrix Policy
- assembly는 초기에는 COO triplet 수집 후 CSR finalize를 기준으로 한다.
- `SparseMatrix`는 solver core가 사용하는 추상 contract이고 MKL PARDISO backend는 CSR input contract만 받는다.
- matrix symmetry, definiteness, singularity diagnostic을 구조화된 diagnostic으로 남긴다.
- deterministic assembly를 위해 TBB element loop는 thread-local contribution buffer 또는 two-pass sparse assembly를 사용한다.
## Parallel Policy
- 첫 번째 oneTBB 적용 지점은 element-local matrix/residual 계산이다.
- 전역 sparse write는 thread-local buffer 또는 deterministic reduction으로 제한한다.
- MKL 내부 thread와 TBB element loop가 oversubscription을 만들지 않도록 thread count와 task arena 정책을 명시한다.
## HDF5 Result Schema
```text
/metadata
/model/nodes
/model/elements
/steps/<step-name>/frames/<frame-id>/nodal/displacement
/steps/<step-name>/frames/<frame-id>/nodal/reaction
/steps/<step-name>/frames/<frame-id>/element/stress
/steps/<step-name>/frames/<frame-id>/element/strain
/diagnostics
```
Schema requirements:
- schema version, units, coordinate system, solver version, source input identity를 metadata에 기록한다.
- field output과 history output을 구분한다.
- reference comparison을 위한 row identity는 node id, element id, integration point id, step/frame id를 포함한다.
- HDF5가 authoritative output이며 CSV는 optional deterministic comparison view이다.
- Solver output은 `results.h5`, stored reference output은 `reference.h5`, CSV view는 `csv/*.csv` 경로를 기본으로 한다.
## Test Architecture
- unit: parser, DOF map, shape functions, material law, sparse assembly, HDF5 schema
- integration: small `.inp` to HDF5 end-to-end
- reference: stored Abaqus artifact comparison
- physics: equilibrium, sign, symmetry, rigid body mode, stress sanity
- harness: hooks, phase executor, workspace validation
## Hook 흐름
```text
apply_patch/Edit/Write
+86 -13
View File
@@ -1,22 +1,95 @@
# PRD: C++/MSVC Harness
# PRD: FESA 구조해석 솔버
## 목표
Codex Harness가 C++/MSVC 프로젝트에서 phase planning, TDD guard, commit validation, workspace validation을 일관되게 수행하게 한다.
FESA는 Abaqus `.inp` keyword subset을 입력으로 받아 유한요소법 기반 구조해석을 수행하고, step/frame 단위 결과를 HDF5로 저장하며, 저장된 reference artifact와 비교 가능한 C++17/MSVC 솔버를 제공한다.
이 프로젝트의 성공 기준은 단순 실행 성공이 아니다. 기능은 요구조건, 정식화, I/O 계약, C++ 테스트, reference comparison, physics sanity, release readiness를 모두 통과해야 완료된다.
## 사용자
- Windows/MSVC 기반 C++ 개발자
- Harness phase를 작성하고 실행하는 Codex agent
- Harness 결과를 검토하는 reviewer
- Solver developer: C++17/MSVC/CMake/CTest 환경에서 요소, 재료, 해석 절차, solver backend를 구현한다.
- Verification reviewer: reference artifact, tolerance, physics sanity, release readiness를 검토한다.
- Analyst preparing Abaqus-compatible input subsets: FESA가 지원하는 제한된 `.inp` subset에 맞춰 입력 모델을 준비한다.
- Codex agent workflow operator: project-local agent와 skill을 사용해 요구조건부터 release까지의 gate를 운영한다.
## 핵심 기능
1. CMake/MSVC/x64/Debug 기반 workspace validation
2. C++ source/header 변경에 대한 엄격한 TDD guard
3. npm 없이 Python self-test와 CMake/CTest 검증을 수행하는 pre-commit hook
4. C++ 프로젝트에 맞는 Harness workflow/review prompt
5. CMake project가 아직 없어도 Harness 자체 테스트가 가능한 no-op validation path
1. Abaqus `.inp` keyword subset parser와 내부 `Domain` semantic model 생성
2. `AnalysisModel`, `DofManager`, `AnalysisState` 기반의 step별 equation system 구성
3. 선형 정적 해석을 시작점으로 하는 `Analysis` procedure 계층
4. 요소, 재료, 경계조건, 하중의 runtime-polymorphic base interface
5. sparse matrix pattern 생성, 전역 행렬/벡터 조립, 제약조건 적용
6. `LinearSolver` adapter를 통한 MKL PARDISO backend와 향후 iterative solver 확장
7. HDF5 기반 `ResultStep` -> `ResultFrame` -> `FieldOutput`/`HistoryOutput` 저장
8. HDF5 authoritative output에서 deterministic CSV comparison view 추출 또는 직접 비교
9. CMake/MSVC/x64/Debug, CTest, Harness validation, TDD guard 기반 개발 검증
## V0 범위
- 선형 정적 해석 골격
- 첫 end-to-end 기능 후보: 1D truss/bar element
- 최소 Abaqus keyword subset:
- `*HEADING`
- `*NODE`
- `*ELEMENT`
- `*NSET`
- `*ELSET`
- `*MATERIAL`
- `*ELASTIC`
- section keyword
- `*BOUNDARY`
- `*CLOAD`
- `*STEP`
- `*STATIC`
- output request subset
- displacement 중심의 최소 `AnalysisState`
- HDF5 result schema v0
- reference comparison용 CSV view 또는 HDF5 직접 비교 계약
## V1 범위
- 2D plane stress/plane strain element
- 3D solid element
- MKL PARDISO 기반 sparse direct solve
- TBB element-local computation 병렬화
- reference model portfolio 확장
- nonlinear static, dynamic, frequency, heat transfer 해석을 위한 interface 확장점
## 기능 요구조건
| ID | 요구조건 | Acceptance Criteria | Verification Method |
| --- | --- | --- | --- |
| FESA-PRD-001 | FESA는 Abaqus `.inp` full compatibility가 아니라 승인된 keyword subset만 지원해야 한다. | 지원/미지원 keyword가 문서화되고, 미지원 keyword는 구조화된 diagnostic을 남긴다. | I/O contract review, parser unit test |
| FESA-PRD-002 | FESA는 입력 모델을 `Domain`으로 변환해야 한다. | nodes, elements, materials, properties, sets, loads, boundary conditions, step definitions가 semantic model에 보존된다. | parser integration test |
| FESA-PRD-003 | FESA는 현재 step의 실행 view를 `AnalysisModel`로 구성해야 한다. | active elements, loads, boundary conditions, properties/materials가 Domain 복사 없이 참조 또는 id view로 연결된다. | analysis model unit test |
| FESA-PRD-004 | FESA는 equation numbering과 constraint/free mapping을 `DofManager`에 집중해야 한다. | Node/Element 내부에 equation id를 분산 저장하지 않는다. | code review, DofManager unit test |
| FESA-PRD-005 | FESA는 해석 중 변하는 물리량을 `AnalysisState`에 저장해야 한다. | displacement, force, residual, increment/iteration 상태가 step/frame 출력과 연결된다. | state unit test, integration test |
| FESA-PRD-006 | FESA는 solver 결과를 HDF5 authoritative output으로 저장해야 한다. | step/frame, field/history, metadata, diagnostics가 schema version과 함께 저장된다. | HDF5 schema test |
| FESA-PRD-007 | FESA는 reference artifact와 비교 가능한 deterministic result view를 제공해야 한다. | displacement, reaction, element force, stress 등 검증 물리량의 row identity와 tolerance source가 명확하다. | reference comparison report |
| FESA-PRD-008 | FESA의 production C++ 변경은 테스트를 먼저 작성하고 실패를 확인한 뒤 구현해야 한다. | 관련 C++ test file이 있고 Harness TDD guard를 통과한다. | hook test, CTest |
| FESA-PRD-009 | FESA는 외부 라이브러리 API를 solver core에 직접 노출하지 않아야 한다. | MKL, TBB, HDF5 의존은 adapter module에 제한된다. | architecture review, dependency review |
| FESA-PRD-010 | FESA 기능 완료는 reference comparison과 physics sanity 통과를 요구해야 한다. | 수치 tolerance와 물리 검토가 모두 pass이고 known limitation이 기록된다. | verification report, physics evaluation report |
## 비기능 요구조건
- MSVC x64 Debug 환경에서 configure, build, CTest를 검증한다.
- reference test 결과는 deterministic해야 한다.
- HDF5 schema는 versioned contract로 관리한다.
- tolerance policy는 absolute, relative, norm-based 기준을 구분한다.
- parser, solver, HDF5 writer는 실패 원인을 구조화된 diagnostic으로 보고한다.
- oneMKL, oneTBB, HDF5는 CMake에서 명시 탐지하고 실패 원인을 분류한다.
- 대규모 모델 성능 최적화보다 Phase 1 명확성, 테스트 가능성, 검증 traceability를 우선한다.
## Acceptance Gates
1. Requirements approved: 기능 범위, 제외 범위, 입력, 출력, tolerance, 검증 물리량이 정의되어 있다.
2. Research evidence complete: 정식화와 benchmark 근거가 신뢰도와 한계와 함께 정리되어 있다.
3. Formulation reviewed: 약형, shape function, B matrix, constitutive contract, 수치적분, output recovery가 검토되어 있다.
4. I/O contract approved: Abaqus keyword subset, internal model mapping, HDF5/CSV result contract가 승인되어 있다.
5. Tests fail before implementation: 구현 전 실패해야 하는 C++/integration/reference test가 준비되어 있다.
6. CMake/CTest pass: MSVC/x64/Debug 기준 configure, build, test가 통과한다.
7. Reference comparison pass: 저장된 reference artifact와 구현 결과가 tolerance 안에 있다.
8. Physics sanity pass: equilibrium, reaction consistency, displacement direction, symmetry, stress sanity가 검토되어 있다.
9. Release readiness pass: acceptance traceability, known limitations, release notes draft가 준비되어 있다.
## 제외 사항
- 이전 FESA solver source tree 복원
- JavaScript/TypeScript fallback 유지
- Abaqus reference artifact 생성 또는 solver reference 비교 구현
- Abaqus full parser 호환
- Abaqus, Nastran 또는 reference solver 직접 실행 자동화
- Agent가 reference HDF5 artifact 또는 deterministic CSV view를 임의 생성 또는 수정하는 작업
- GUI 또는 postprocessor
- Visual Studio `.sln`/`.vcxproj` 전용 MSBuild workflow
- Explicit dynamics, contact, plasticity, shell end-to-end 구현
- JavaScript/TypeScript fallback 유지
+209 -12
View File
@@ -105,7 +105,9 @@ references/
<model-id>/
model.inp
metadata.json
expected.h5 or reference CSV views
reference.h5
csv/
deterministic comparison views
```
### 모듈 경계 원칙
@@ -118,16 +120,210 @@ references/
- `analysis`는 step/history data를 받아 procedure를 실행하고, solver backend와 result writer를 조율한다.
- `results`는 HDF5 schema를 통해 nodal, element, integration-point, diagnostic output을 분리한다.
## 핵심 클래스 구조 후보
아래 구조는 `docs/ARCHITECTURE.md`에 반영할 개념적 class map이다. `1DElement`, `2DElement`, `3DElement` 같은 이름은 분류 표현이며, 실제 C++ 식별자는 `Element1D`처럼 유효한 이름으로 확정한다.
```text
Domain
├── Node
├── Element
├── Material
├── Property
├── NodeSet
├── ElementSet
├── BoundaryCondition
├── Load
└── StepDefinition
AnalysisModel
├── active elements
├── active loads
├── active boundary conditions
├── active properties/materials
└── equation system view
AnalysisState
├── displacement U
├── velocity V
├── acceleration A
├── temperature T
├── external force Fext
├── internal force Fint
├── residual R
├── current time / increment / iteration
└── element state / integration point state
DofManager
├── node dof definitions
├── constrained/free dof mapping
├── equation numbering
├── sparse matrix pattern ownership
└── full/reduced vector reconstruction
Analysis
├── LinearStaticAnalysis
├── NonlinearStaticAnalysis
├── DynamicAnalysis
├── FrequencyAnalysis
└── HeatTransferAnalysis
Element
├── 1DElement
│ ├── Truss
│ └── Beam
├── 2DElement
│ ├── MITC3
│ └── MITC4
└── 3DElement
├── Hexahedral
├── Tetrahedral
├── Wedge
└── Pyramid
BoundaryCondition
├── Fix
├── RBE2
└── RBE3
Load
├── NodalLoad
├── PressureLoad
└── BodyForce
Results
├── ResultStep
├── ResultFrame
├── FieldOutput
└── HistoryOutput
InputParser
ResultsWriter
Assembler
LinearSolver
Vector
Matrix
SparseMatrix
```
문서화 시 핵심 책임은 다음처럼 구분한다.
- `Domain`은 입력 파일에서 생성된 전체 모델 정의를 소유한다.
- `AnalysisModel`은 현재 step에서 활성화된 해석 객체 view를 제공한다.
- `DofManager`는 자유도 정의, 제약/free mapping, equation numbering, sparse pattern ownership을 전담한다.
- `AnalysisState`는 해석 중 변하는 물리량과 반복 상태를 소유한다.
- `Analysis` 계층은 procedure별 실행 전략을 제공한다.
- `Element`, `Material`, `Load`, `BoundaryCondition`은 base interface를 통해 다루되, Phase 1에서는 명확성과 테스트 가능성을 성능 최적화보다 우선한다.
## 권장 설계 패턴
- Strategy: linear solver backend, nonlinear convergence policy, constraint handling, time integration, output backend를 교체 가능한 전략으로 둔다.
- Factory/Registry: Abaqus keyword, element type, material type을 내부 semantic object로 생성한다. 초기에는 compile-time/static registry로 충분하며 동적 plugin은 문서 범위에서 제외한다.
- Template Method: element routine은 `gather state -> evaluate quadrature -> accumulate local matrix/vector -> recover output` 순서를 공유하되 요소별 shape function과 constitutive contract를 분리한다.
- Adapter: MKL PARDISO, oneTBB, HDF5, Abaqus syntax를 내부 core API에서 직접 노출하지 않는다.
- Strategy Pattern: 해석 알고리즘과 수치 알고리즘을 교체 가능하게 구성한다.
- `Analysis`: `LinearStaticAnalysis`, `NonlinearStaticAnalysis`, `DynamicAnalysis`, `HeatTransferAnalysis`
- `LinearSolver`: `MKLPardisoSolver`, 향후 iterative solver
- `TimeIntegrator`: `HHTIntegrator`, 향후 Newmark 등
- `ConvergenceCriteria`: residual norm, displacement norm, energy norm
- Template Method Pattern: 해석 실행의 큰 흐름은 `Analysis::run()`에서 고정하고, 세부 단계는 해석 종류별로 재정의한다.
```text
initialize
buildAnalysisModel
buildDofMap
buildSparsePattern
assemble
applyBoundaryConditions
solve
updateState
writeResults
```
비선형 정적해석은 위 흐름을 Newton-Raphson 반복 루프 안에서 사용하고, 동적해석은 time step/frame 루프 안에서 사용한다.
- Factory + Registry Pattern: Abaqus input keyword와 내부 객체 생성을 분리한다.
- `*Element, type=S4` -> `MITC4ElementFactory`
- `*Material`, `*Elastic` -> `LinearElasticMaterialFactory`
- `*Boundary` -> `FixBoundaryFactory`
- `*Cload` -> `NodalLoadFactory`
- `*Nset`, `*Elset` -> set registry
요소, 재료, 하중, 경계조건 타입 추가 시 parser 본체의 변경을 최소화한다.
- Adapter Pattern: MKL, TBB, HDF5 API는 solver core에 직접 노출하지 않는다.
- `SparseMatrix`, `Vector`, `Matrix`
- `LinearSolver`
- `ParallelFor`
- `ResultsWriter`
외부 라이브러리 교체 또는 테스트 double 사용이 가능하도록 adapter 계층에서 의존성을 제한한다.
- Runtime Polymorphism: 요소, 재료, 하중, 경계조건은 base interface를 통해 다룬다. Phase 1에서는 명확성과 테스트 가능성을 우선하고, 대규모 모델 성능 최적화가 필요할 경우 assembly 내부에서 타입별 batch 처리 또는 kernel 분리를 추가한다.
- RAII: MKL handle, HDF5 file/dataset, temporary solver workspace는 수명과 오류 처리를 wrapper에 묶는다.
- Data-oriented core: global vectors, sparse matrix arrays, DOF maps, element connectivity는 cache locality와 deterministic assembly를 우선한다.
- Deterministic assembly: TBB element loop는 thread-local contribution buffer 또는 two-pass sparse assembly를 사용해 reference comparison의 재현성을 해치지 않도록 한다.
- Explicit diagnostics: parser warning, unsupported keyword, singular matrix, rigid body mode, convergence failure, HDF5 schema mismatch를 구조화된 diagnostic으로 남긴다.
## 상태 관리 모델
### 1. `Domain`
`Domain`은 입력 파일에서 만들어진 전체 모델 정의를 소유한다. 파싱 이후에는 가능한 한 불변으로 취급한다.
포함 대상:
- nodes, elements
- materials, properties
- node sets, element sets
- loads, boundary conditions
- analysis step definitions
### 2. `AnalysisModel`
`AnalysisModel`은 현재 step에서 활성화되는 해석 객체들의 실행 view이다. `Domain`을 복사하지 않고 참조 또는 id 기반 view로 구성한다.
포함 대상:
- active elements
- active loads
- active boundary conditions
- active property/material references
- current equation system view
### 3. `DofManager`
`DofManager`는 자유도와 방정식 번호를 전담한다. `Node` 또는 `Element` 내부에 equation id를 분산 저장하지 않는다.
책임:
- node별 활성 자유도 정의
- constrained/free dof mapping
- equation numbering
- sparse matrix pattern 생성에 필요한 connectivity 제공
- 경계조건 적용 전후의 dof view 관리
- full/reduced vector reconstruction
### 4. `AnalysisState`
`AnalysisState`는 해석 중 변하는 물리량과 반복 상태를 소유한다.
포함 대상:
- displacement, velocity, acceleration
- temperature
- external force, internal force, residual
- current time, increment, Newton iteration
- element state, integration point state
Phase 1에서는 displacement 중심으로 최소 구현하되, 기하비선형과 thermal-stress coupling을 위해 element/internal state 확장 지점을 유지한다.
### 5. Results State
결과는 `ResultStep` -> `ResultFrame` -> `FieldOutput`/`HistoryOutput` 구조로 관리한다.
- `ResultStep`: 해석 step 단위 결과
- `ResultFrame`: 정적해석의 load increment 또는 동적해석의 time frame
- `FieldOutput`: node/element field 결과
- `HistoryOutput`: 특정 node, element, set, reaction, energy 등의 이력 결과
## 권장 데이터 흐름
`docs/ARCHITECTURE.md`에는 아래 흐름을 solver 실행의 표준 경로로 반영한다.
```text
Abaqus input file
-> InputParser
-> Domain 생성
-> StepDefinition 루프
-> AnalysisModel 생성
-> DofManager로 자유도/방정식 번호 생성
-> sparse pattern 생성
-> Analysis 실행
-> Assembler로 전역 행렬/벡터 조립
-> BoundaryCondition 적용
-> LinearSolver 또는 nonlinear/time integration loop
-> AnalysisState 갱신
-> ResultsWriter로 step/frame/history 저장
-> 다음 step 진행
```
## 세 문서별 완성 계획
### 1. `AGENTS.md`
@@ -294,14 +490,15 @@ references/
| 물리 검토 | `physics-evaluation-agent` | `fesa-physics-sanity` | `docs/physics-evaluations/<feature-id>-physics-evaluation.md` |
| 배포 준비 | `release-agent` | `fesa-release-readiness` | `docs/releases/<feature-id>-release.md` |
## HDF5와 기존 CSV reference skill의 정합성 이슈
현재 프로젝트 문서와 skill reference comparison artifact로 CSV를 많이 언급한다. 사용자 요구조건은 solver 결과 저장 포맷을 HDF5로 지정한다.
## HDF5와 deterministic CSV view 정합성 결정
프로젝트 문서와 skill reference comparison 경로는 HDF5 authoritative output과 deterministic CSV view 구조를 기준으로 정리한다.
권장 결정:
결정:
- FESA solver의 정식 결과 파일은 HDF5로 한다.
- reference comparison을 위해 HDF5 dataset에서 deterministic CSV view를 추출하거나, comparison tool이 HDF5와 reference CSV를 직접 비교하도록 한다.
- `docs/PRD.md` `docs/ARCHITECTURE.md`에는 "HDF5 authoritative output, CSV comparison view optional"을 명시한다.
- 기존 `fesa-reference-comparison` skill은 즉시 바꾸기보다, 문서에서 HDF5 support extension을 후속 작업으로 기록한다.
- solver output은 `results.h5`, stored reference output은 `reference.h5`를 authoritative artifact로 둔다.
- reference comparison을 위해 HDF5 dataset에서 `csv/displacements.csv`, `csv/reactions.csv`, `csv/element_forces.csv`, `csv/stresses.csv` 같은 deterministic CSV view를 추출할 수 있다.
- CSV view는 row identity와 사람이 검토 가능한 비교 view일 뿐이며 authoritative storage가 아니다.
- `fesa-reference-comparison`, `fesa-io-contract`, `fesa-reference-models`, 관련 agent 문서는 이 구조를 기준으로 유지한다.
## 주요 리스크와 열린 질문
- 첫 end-to-end feature를 1D truss/bar로 확정할지, 2D plane stress까지 포함할지 결정이 필요하다. 문서 계획상 v0는 1D truss/bar가 가장 안전하다.
@@ -335,5 +532,5 @@ references/
- HDF5 result schema ADR 작성.
- Abaqus `.inp` v0 keyword subset ADR 작성.
- MKL/TBB threading policy ADR 작성.
- `fesa-reference-comparison` skill의 HDF5 comparison 확장 계획 작성.
- HDF5 result schema와 deterministic CSV view exporter의 구체 schema/test 작성.
- 첫 기능 `linear-truss-1d`의 `docs/requirements/linear-truss-1d.md` 작성.
+17 -12
View File
@@ -9,7 +9,7 @@
- 기능 요구조건, 이론 정식화, 코드 구현, 검증, 배포 역할을 분리한다.
- 실행 가능성만으로 성공을 판단하지 않고, 레퍼런스 결과와 물리량을 비교해 기능 완료를 판정한다.
- 테스트는 구현 전에 준비한다. 개발 대상 솔버 테스트와 레퍼런스 솔버 결과 비교 테스트를 함께 사용한다.
- Abaqus나 Nastran을 Agent가 직접 실행하지 않는다. `references/`에 저장된 입력 파일과 레퍼런스 CSV 결과를 검증 기준으로 사용한다.
- Abaqus나 Nastran을 Agent가 직접 실행하지 않는다. `references/`에 저장된 입력 파일, `reference.h5`, deterministic CSV views를 검증 기준으로 사용한다.
- 기본 개발 환경은 C++17 이상, MSVC, CMake, CTest이다.
- 모든 기능은 tolerance 기준을 명시하고, 기준을 만족할 때만 배포 후보가 된다.
@@ -98,14 +98,15 @@
책임:
- mesh, node, element, material, section, boundary condition, load, step 입력 형식을 정의한다.
- 출력 CSV 또는 result file schema를 정의한다.
- authoritative HDF5 result schema와 deterministic CSV view schema를 정의한다.
- Abaqus input file과 내부 입력 모델 사이의 대응 관계를 정리한다.
- 결과 비교를 위해 레퍼런스 CSV와 구현 솔버 출력의 컬럼 규약을 맞춘다.
- 결과 비교를 위해 reference HDF5 dataset, solver HDF5 dataset, deterministic CSV view의 ID/컴포넌트 규약을 맞춘다.
주요 산출물:
- 입력 데이터 schema
- 출력 데이터 schema
- 결과 비교용 CSV schema
- HDF5 result schema
- 결과 비교용 deterministic CSV view schema
- 단위와 좌표계 규약
### Reference Model Agent
@@ -113,7 +114,7 @@ TDD와 검증에 사용할 테스트 모델을 준비하는 Agent이다.
책임:
- 개발 대상 기능을 검증할 최소 모델, benchmark 모델, 회귀 모델을 설계한다.
- `references/`에 보관할 Abaqus input file과 Abaqus 결과 CSV 요구사항을 정의한다.
- `references/`에 보관할 Abaqus input file, `reference.h5`, deterministic CSV view 요구사항을 정의한다.
- 레퍼런스 결과에 포함될 물리량과 tolerance를 명시한다.
- 테스트 모델이 요구조건을 실제로 검증하는지 확인한다.
@@ -128,10 +129,12 @@ references/
<feature-name>/
model.inp
metadata.json
displacements.csv
reactions.csv
element_forces.csv
stresses.csv
reference.h5
csv/
displacements.csv
reactions.csv
element_forces.csv
stresses.csv
```
### Implementation Planning Agent
@@ -200,7 +203,7 @@ python scripts/validate_workspace.py
구현 솔버 결과와 저장된 레퍼런스 결과를 비교하는 Agent이다.
책임:
- 구현 솔버 결과 CSV`references/`Abaqus CSV를 비교한다.
- 구현 솔버 `results.h5``references/``reference.h5`를 비교하고, deterministic CSV views를 row identity 검토와 report evidence로 사용한다.
- 절점 변위, 반력, 요소 내력, 응력의 tolerance 만족 여부를 평가한다.
- absolute tolerance, relative tolerance, norm-based tolerance를 구분해 적용한다.
- 결과 차이가 tolerance 밖이면 원인 후보를 분류한다.
@@ -304,7 +307,7 @@ flowchart TD
### Gate 5: 레퍼런스 검증
통과 조건:
- 저장된 Abaqus CSV 결과와 구현 솔버 결과가 tolerance 안에 있다.
- 저장된 reference HDF5 결과와 구현 solver HDF5 결과가 tolerance 안에 있다.
- 절점 변위, 반력, 요소 내력, 응력 비교 결과가 리포트로 남아 있다.
- 실패한 물리량이 없거나 승인된 known limitation으로 기록되어 있다.
@@ -314,9 +317,11 @@ flowchart TD
- 문서와 release note가 준비되어 있다.
- 남은 제한사항이 명확히 기록되어 있다.
## Reference CSV 비교 기준
## Reference HDF5 / CSV View 비교 기준
권장 비교 방식:
- authoritative 비교는 `results.h5``reference.h5`의 dataset 기준으로 수행한다.
- CSV는 HDF5 dataset에서 추출한 deterministic view로만 사용한다.
- scalar 값: absolute tolerance와 relative tolerance를 함께 적용한다.
- vector 값: component-wise 비교와 norm 비교를 함께 기록한다.
- stress tensor: component-wise 비교를 기본으로 하고, 필요한 경우 principal stress 또는 von Mises stress를 추가 비교한다.
+8 -8
View File
@@ -13,7 +13,7 @@ Agent는 역할과 책임 단위이고, skill은 여러 Agent가 반복적으로
- Skill 본문은 agent TOML의 역할 설명을 반복하지 않고, 입력, 절차, 산출물, 금지사항, 품질 gate, handoff를 정의한다.
- Skill은 `AGENTS.md``docs/SOLVER_AGENT_DESIGN.md`를 공통 상위 기준으로 읽는다.
- Abaqus, Nastran 또는 reference solver 실행은 skill 범위에 포함하지 않는다.
- Reference CSV 생성 또는 수정은 skill 범위에 포함하지 않는다.
- Reference HDF5 파일 또는 deterministic CSV view 생성/수정은 skill 범위에 포함하지 않는다.
- C++ 구현 관련 skill은 C++17 이상, MSVC, CMake, CTest, TDD 원칙을 따른다.
- 기본 workspace validation 명령은 `python scripts/validate_workspace.py`이다.
@@ -40,10 +40,10 @@ Agent는 역할과 책임 단위이고, skill은 여러 Agent가 반복적으로
2. Research Agent는 `fesa-research-evidence`를 사용해 truss/bar element 이론, benchmark 후보, source reliability, applicability limits를 정리한다.
3. Formulation Agent는 `fesa-formulation-spec`을 사용해 strong form, weak form, shape functions, B matrix, element stiffness, output recovery를 정리한다.
4. Numerical Review Agent는 `fesa-numerical-review`를 사용해 rigid body modes, patch test, stiffness symmetry, Jacobian, locking 위험을 검토하고 `pass-for-implementation-planning` 여부를 판단한다.
5. I/O Definition Agent는 `fesa-io-contract`를 사용해 지원할 Abaqus `.inp` keyword subset `displacements.csv`, `reactions.csv`, `element_forces.csv`, `stresses.csv` schema를 정의한다.
5. I/O Definition Agent는 `fesa-io-contract`를 사용해 지원할 Abaqus `.inp` keyword subset, `results.h5` schema, `csv/displacements.csv`, `csv/reactions.csv`, `csv/element_forces.csv`, `csv/stresses.csv` view schema를 정의한다.
6. Reference Model Agent는 `fesa-reference-models`를 사용해 `references/linear-truss-1d/<model-id>/` artifact bundle 계약과 coverage matrix를 작성한다.
7. Implementation Planning Agent와 Implementation Agent는 `fesa-cpp-msvc-tdd`를 사용해 테스트 작성, 실패 확인, 최소 구현, CMake/CTest 등록, validation을 수행한다.
8. Reference Verification Agent는 `fesa-reference-comparison`을 사용해 구현 solver CSV와 저장된 reference CSV를 tolerance 기준으로 비교한다.
8. Reference Verification Agent는 `fesa-reference-comparison`을 사용해 구현 solver `results.h5`와 저장된 `reference.h5`를 tolerance 기준으로 비교하고 deterministic CSV view를 검토한다.
9. Physics Evaluation Agent는 `fesa-physics-sanity`를 사용해 global equilibrium, reaction consistency, displacement direction, symmetry, model coverage를 검토한다.
10. Release Agent는 `fesa-release-readiness`를 사용해 gate evidence, acceptance traceability, known limitations, release notes draft를 작성한다.
@@ -54,7 +54,7 @@ Agent는 역할과 책임 단위이고, skill은 여러 Agent가 반복적으로
- 기능 요청을 검증 가능한 요구조건 baseline으로 만든다.
- `shall` 문장과 `FESA-REQ-<FEATURE>-###` id를 사용한다.
- 모든 `must` 요구조건은 verification method와 acceptance criteria를 가져야 한다.
- FEM 정식화, C++ 구현, reference CSV 생성, release readiness 판단은 하지 않는다.
- FEM 정식화, C++ 구현, reference HDF5/CSV view 생성, release readiness 판단은 하지 않는다.
### `fesa-research-evidence`
@@ -81,15 +81,15 @@ Agent는 역할과 책임 단위이고, skill은 여러 Agent가 반복적으로
- FESA solver input이 지원할 Abaqus `.inp` subset을 정의한다.
- model data와 history data를 구분한다.
- 내부 semantic model 계약 output/CSV schema를 정의한다.
- 내부 semantic model 계약, HDF5 output schema, deterministic CSV view schema를 정의한다.
- parser 구현이나 full Abaqus compatibility claim은 하지 않는다.
### `fesa-reference-models`
- smoke, analytical, patch test, benchmark, regression, negative/invalid-input 모델을 구분한다.
- `references/<feature-id>/<model-id>/` artifact bundle 계약을 정의한다.
- `model.inp`, `metadata.json`, `displacements.csv`, `reactions.csv`, `element_forces.csv`, `stresses.csv`를 기준 artifact로 둔다.
- Reference CSV가 없으면 완료 상태가 아니라 `needs-reference-artifacts`로 둔다.
- `model.inp`, `metadata.json`, `reference.h5`, `csv/displacements.csv`, `csv/reactions.csv`, `csv/element_forces.csv`, `csv/stresses.csv`를 기준 artifact로 둔다.
- `reference.h5` 또는 required deterministic CSV view가 없으면 완료 상태가 아니라 `needs-reference-artifacts`로 둔다.
### `fesa-cpp-msvc-tdd`
@@ -109,7 +109,7 @@ ctest -C Debug -R <feature-or-label>
### `fesa-reference-comparison`
- `ARTIFACT CHECK -> COMPARE -> CLASSIFY -> REPORT` 순서로 수행한다.
- `metadata.json`, schema version, units, coordinate system, step/frame identity, ID matching, output location, tolerance source를 확인한다.
- `metadata.json`, `results.h5`, `reference.h5`, deterministic CSV views, schema version, units, coordinate system, step/frame identity, ID matching, output location, tolerance source를 확인한다.
- max absolute error, max relative error, RMS error, norm error, missing rows, extra rows를 보고한다.
- Reference pass는 physics validation이나 release readiness를 의미하지 않는다.
+1 -1
View File
@@ -22,7 +22,7 @@ Build/Test Executor Agent는 Implementation Agent 이후 독립적으로 C++/MSV
- CMake files를 수정하지 않는다.
- requirements, formulations, I/O contracts, reference artifacts, tolerance policies를 수정하지 않는다.
- Abaqus, Nastran 또는 reference solver를 실행하지 않는다.
- reference CSV를 생성하지 않는다.
- reference HDF5 파일이나 deterministic CSV view를 생성하지 않는다.
- release readiness, reference tolerance success, physics validation success를 승인하지 않는다.
- 최종 reference verification report를 작성하지 않는다.
+1 -1
View File
@@ -26,7 +26,7 @@ Coordinator Agent는 FESA solver 기능 개발의 전체 lifecycle에서 gate ev
- requirements, formulations, I/O contracts, numerical review reports를 수정하지 않는다.
- reference artifacts 또는 tolerance policies를 수정하지 않는다.
- Abaqus, Nastran 또는 reference solver를 실행하지 않는다.
- reference CSV를 생성하지 않는다.
- reference HDF5 파일이나 deterministic CSV view를 생성하지 않는다.
- subagents를 자동 spawn하지 않는다.
- release readiness를 독립적으로 승인하지 않는다.
+1 -1
View File
@@ -24,7 +24,7 @@ Correction Agent는 Build/Test Executor Agent, Reference Verification Agent, Phy
- reference artifacts를 수정하지 않는다.
- tolerance policies를 수정하지 않는다.
- Abaqus, Nastran 또는 reference solver를 실행하지 않는다.
- reference CSV를 생성하지 않는다.
- reference HDF5 파일이나 deterministic CSV view를 생성하지 않는다.
- release readiness, reference tolerance success, physics validation success를 승인하지 않는다.
- 최종 reference verification report 또는 physics validation report를 작성하지 않는다.
+1 -1
View File
@@ -20,7 +20,7 @@ Formulation Agent는 구현 가능한 FEM 정식화 문서를 작성한다.
- C++ 코드를 구현하지 않는다.
- C++ API나 파일 구조를 설계하지 않는다.
- Abaqus, Nastran 또는 레퍼런스 솔버를 직접 실행하지 않는다.
- reference CSV 결과를 생성하지 않는다.
- reference HDF5 파일이나 deterministic CSV view를 생성하지 않는다.
- release readiness를 승인하지 않는다.
- Numerical Review Agent 검토 전 정식화를 최종 승인하지 않는다.
+8 -7
View File
@@ -2,7 +2,7 @@
이 디렉터리는 Implementation Planning Agent가 작성하거나 제안한 기능별 구현계획 문서를 보관하는 위치다.
Implementation Planning Agent는 승인된 요구조건, 연구 브리프, 정식화, 수치 리뷰, I/O 정의, reference model 계약을 C++/MSVC 구현 전 TDD 작업계획으로 변환한다. Agent는 코드, 테스트, CMake 파일을 작성하지 않고, Abaqus/Nastran을 실행하지 않으며, reference CSV 생성이나 solver 결과 비교, release readiness 승인도 하지 않는다.
Implementation Planning Agent는 승인된 요구조건, 연구 브리프, 정식화, 수치 리뷰, I/O 정의, reference model 계약을 C++/MSVC 구현 전 TDD 작업계획으로 변환한다. Agent는 코드, 테스트, CMake 파일을 작성하지 않고, Abaqus/Nastran을 실행하지 않으며, reference HDF5/CSV view 생성이나 solver 결과 비교, release readiness 승인도 하지 않는다.
기본 파일명은 `docs/implementation-plans/<feature-id>-implementation-plan.md` 형식을 사용한다. 각 문서는 Implementation Agent가 먼저 작성해야 할 실패 테스트, 최소 구현 순서, CMake/CTest 등록 계획, acceptance traceability를 제공해야 한다.
@@ -23,7 +23,7 @@ Implementation Planning Agent는 승인된 요구조건, 연구 브리프, 정
- CMake 파일을 수정하지 않는다.
- CMake/CTest를 실행하지 않는다.
- Abaqus, Nastran 또는 레퍼런스 솔버를 직접 실행하지 않는다.
- reference CSV를 생성하지 않는다.
- reference HDF5 파일이나 deterministic CSV view를 생성하지 않는다.
- solver 결과를 비교하지 않는다.
- release readiness를 승인하지 않는다.
- C++ API, class name, storage layout, file ownership을 확정하지 않는다.
@@ -73,7 +73,7 @@ Implementation Planning Agent는 승인된 요구조건, 연구 브리프, 정
| TEST-001 | 1 | unit | test fails because behavior is missing | test passes after minimal implementation | TASK-001 | ctest -C Debug -R <test-name> |
| TEST-002 | 2 | integration | integrated path fails before implementation | integrated path passes | TASK-002 | ctest -C Debug -R <test-name> |
| TEST-003 | 3 | parser/I/O | Abaqus .inp case is not accepted or mapped | input maps to expected semantic model | TASK-003 | ctest -C Debug -R <test-name> |
| TEST-004 | 4 | reference-comparison | solver CSV comparison fails before implementation | comparison is within planned tolerance | TASK-004 | ctest -C Debug -R <test-name> |
| TEST-004 | 4 | reference-comparison | solver HDF5/CSV view comparison fails before implementation | comparison is within planned tolerance | TASK-004 | ctest -C Debug -R <test-name> |
## CMake/CTest Plan
- target_candidates: <library/test executable targets>
@@ -95,8 +95,9 @@ Implementation Planning Agent는 승인된 요구조건, 연구 브리프, 정
## Data Flow Contract
1. Abaqus `.inp` input follows docs/io-definitions/<feature-id>-io.md.
2. Parser/I/O path maps model data and history data into the internal semantic model.
3. Solver path produces displacement, reaction, element force, stress, or feature-specific result CSV.
4. Reference comparison tests compare solver CSV against `references/<feature-id>/<model-id>/` artifacts.
3. Solver path produces authoritative `results.h5` with displacement, reaction, element force, stress, or feature-specific result datasets.
4. Deterministic CSV views are exported from HDF5 only when the I/O contract or comparison command requires them.
5. Reference comparison tests compare solver `results.h5` and CSV views against `references/<feature-id>/<model-id>/` artifacts.
## Acceptance Traceability Matrix
@@ -123,7 +124,7 @@ ctest -C Debug -R <feature-or-label>
- <likely failure classifications and upstream rollback guidance>
### Reference Verification Agent
- <planned CSV comparison tests, reference model ids, tolerance mapping, ID matching assumptions>
- <planned HDF5/CSV view comparison tests, reference model ids, tolerance mapping, ID matching assumptions>
## Open Issues
- <requirement, formulation, I/O, reference artifact, tolerance, or architecture issue>
@@ -133,7 +134,7 @@ ctest -C Debug -R <feature-or-label>
- 모든 `must` requirement는 최소 하나의 task와 test에 연결되어야 한다.
- C++ production 변경마다 선행 테스트 파일 또는 테스트 추가 계획이 있어야 한다.
- reference artifact가 필요한 기능은 `references/<feature-id>/<model-id>/`CSV 비교 테스트 계획을 가져야 한다.
- reference artifact가 필요한 기능은 `references/<feature-id>/<model-id>/`HDF5/CSV view 비교 테스트 계획을 가져야 한다.
- CMake/CTest 계획은 MSVC x64 Debug 검증 경로와 호환되어야 한다.
- 구현 계획은 테스트 작성, 실패 확인, 최소 구현, validation 순서를 명시해야 한다.
- upstream 문서가 불완전하면 값을 임의로 채우지 않고 `needs-upstream-decision` 또는 `blocked`로 표시한다.
+41 -12
View File
@@ -4,24 +4,25 @@
FESA 솔버의 입력 파일은 Abaqus input file이다. 다만 초기 FESA는 Abaqus 전체 문법 호환을 목표로 하지 않고, 기능별로 지원할 Abaqus keyword subset과 내부 모델 매핑을 명확히 정의한다.
기본 파일명은 `docs/io-definitions/<feature-id>-io.md` 형식을 사용한다. 각 문서는 Requirement Agent, Formulation Agent, Numerical Review Agent의 산출물을 입력으로 받아 Abaqus `.inp` 입력 계약과 결과 CSV schema를 정의해야 한다.
기본 파일명은 `docs/io-definitions/<feature-id>-io.md` 형식을 사용한다. 각 문서는 Requirement Agent, Formulation Agent, Numerical Review Agent의 산출물을 입력으로 받아 Abaqus `.inp` 입력 계약, authoritative HDF5 result schema, deterministic CSV view schema를 정의해야 한다.
## I/O Definition Agent 역할
I/O Definition Agent는 Abaqus input file subset, 내부 solver model mapping, output request mapping, comparison CSV schema를 정의한다.
I/O Definition Agent는 Abaqus input file subset, 내부 solver model mapping, output request mapping, HDF5 result schema, comparison CSV view schema를 정의한다.
수행한다:
- 기능별 supported Abaqus keyword subset을 정의한다.
- unsupported, ignored-with-warning, requires-user-decision keyword 정책을 정의한다.
- model data와 history data를 내부 solver 개념으로 매핑한다.
- node, element, set, material, section, boundary condition, load, step, output request의 의미 계약을 정의한다.
- `displacements.csv`, `reactions.csv`, `element_forces.csv`, `stresses.csv` schema를 정의한다.
- `results.h5`의 authoritative HDF5 schema를 정의한다.
- `csv/displacements.csv`, `csv/reactions.csv`, `csv/element_forces.csv`, `csv/stresses.csv` deterministic CSV view schema를 정의한다.
수행하지 않는다:
- parser를 구현하지 않는다.
- C++ API나 파일 구조를 설계하지 않는다.
- Abaqus, Nastran 또는 레퍼런스 솔버를 직접 실행하지 않는다.
- reference CSV 결과를 생성하지 않는다.
- reference HDF5 파일이나 deterministic CSV view를 생성하지 않는다.
- solver 결과와 reference 결과를 비교하지 않는다.
- release readiness를 승인하지 않는다.
- 명시적으로 정의되지 않은 Abaqus full compatibility를 주장하지 않는다.
@@ -107,9 +108,33 @@ I/O Definition Agent는 Abaqus input file subset, 내부 solver model mapping, o
- step: <semantic contract>
- output_request: <semantic contract>
## Output and CSV Schemas
## Output HDF5 Schema
### displacements.csv
- authoritative_file: `results.h5`
- schema_version: <version>
- root_attributes: units, coordinate_system, solver_version, feature_id, model_id
- step_frame_identity: <step/frame naming and ordering>
- row_identity_policy: <node_id | element_id | integration_point | component mapping>
| quantity | dataset_path | shape | dtype | required_attributes | location | notes |
| --- | --- | --- | --- | --- | --- | --- |
| displacement | /steps/<step>/frames/<frame>/field_outputs/U | <nnode, ndim> | float64 | component_names, units | nodal | |
| reaction | /steps/<step>/frames/<frame>/field_outputs/RF | <nnode, ndim> | float64 | component_names, units | nodal | |
| element_force | /steps/<step>/frames/<frame>/field_outputs/element_forces | <nrow, ncomp> | float64 | component_names, element_ids, location | element | feature-dependent |
| stress | /steps/<step>/frames/<frame>/field_outputs/S | <nrow, ncomp> | float64 | component_names, element_ids, integration_points | integration_point | feature-dependent |
## Deterministic CSV View Schemas
CSV view는 HDF5 dataset에서 추출한 deterministic comparison view이며 authoritative storage가 아니다.
공통 규칙:
- directory: `csv/`
- sort_order: step, frame, id, location, component
- numeric_format: <precision and exponent policy>
- missing_component_policy: 0 | N/A | omitted, feature-specific
- view_source: HDF5 dataset path를 각 파일 metadata 또는 report에 기록한다.
### csv/displacements.csv
| column | type | description |
| --- | --- | --- |
| step | string | step name or index |
@@ -119,7 +144,7 @@ I/O Definition Agent는 Abaqus input file subset, 내부 solver model mapping, o
| uy | float | displacement component or 0/N/A |
| uz | float | displacement component or 0/N/A |
### reactions.csv
### csv/reactions.csv
| column | type | description |
| --- | --- | --- |
| step | string | step name or index |
@@ -129,7 +154,7 @@ I/O Definition Agent는 Abaqus input file subset, 내부 solver model mapping, o
| rfy | float | reaction component or 0/N/A |
| rfz | float | reaction component or 0/N/A |
### element_forces.csv
### csv/element_forces.csv
| column | type | description |
| --- | --- | --- |
| step | string | step name or index |
@@ -139,7 +164,7 @@ I/O Definition Agent는 Abaqus input file subset, 내부 solver model mapping, o
| component | string | force component name |
| value | float | component value |
### stresses.csv
### csv/stresses.csv
| column | type | description |
| --- | --- | --- |
| step | string | step name or index |
@@ -157,6 +182,8 @@ I/O Definition Agent는 Abaqus input file subset, 내부 solver model mapping, o
- set_expansion: <policy>
- coordinate_conventions: <policy>
- output_quantity_availability: <policy>
- hdf5_schema_validation: <required datasets and attributes>
- csv_view_validation: <stable ordering and required columns>
## Open Issues and Downstream Handoff
@@ -164,10 +191,10 @@ I/O Definition Agent는 Abaqus input file subset, 내부 solver model mapping, o
- <Abaqus input examples and reference artifact schema needs>
### Implementation Planning Agent
- <parser acceptance cases, unsupported keyword diagnostics, CSV writer tests>
- <parser acceptance cases, unsupported keyword diagnostics, HDF5 writer tests, CSV view exporter tests>
### Reference Verification Agent
- <CSV schemas, ID matching rules, units, coordinate conventions, tolerance-relevant fields>
- <HDF5 dataset paths, CSV view schemas, ID matching rules, units, coordinate conventions, tolerance-relevant fields>
```
## 품질 기준
@@ -177,4 +204,6 @@ I/O Definition Agent는 Abaqus input file subset, 내부 solver model mapping, o
- model data와 history data의 매핑을 구분해야 한다.
- unsupported keyword 처리 정책을 명확히 해야 한다.
- 내부 모델 계약은 semantic fields로 작성하고 C++ class/function/API를 확정하지 않는다.
- CSV schema는 column name, ID field, component naming, coordinate system, units, step/frame identity, quantity location을 포함해야 한다.
- `results.h5`가 authoritative solver output임을 명시해야 한다.
- HDF5 schema는 dataset path, dtype/shape, required attributes, ID field, component naming, coordinate system, units, step/frame identity, quantity location을 포함해야 한다.
- CSV view schema는 column name, stable sort order, ID field, component naming, coordinate system, units, step/frame identity, quantity location을 포함해야 한다.
+1 -1
View File
@@ -20,7 +20,7 @@ Numerical Review Agent는 정식화의 수학적 일관성, 수치 안정성 위
- 정식화 문서를 직접 수정하지 않는다.
- C++ API나 파일 구조를 설계하지 않는다.
- Abaqus, Nastran 또는 레퍼런스 솔버를 직접 실행하지 않는다.
- reference CSV 결과를 생성하지 않는다.
- reference HDF5 파일이나 deterministic CSV view를 생성하지 않는다.
- release readiness를 승인하지 않는다.
- 레퍼런스 결과와 구현 솔버 결과의 일치 여부를 판정하지 않는다.
+15 -11
View File
@@ -2,7 +2,7 @@
이 디렉터리는 Physics Evaluation Agent가 작성하거나 제안하는 기능별 physics evaluation report를 보관하는 위치다.
Physics Evaluation Agent는 Reference Verification Agent가 `pass-for-physics-evaluation`로 넘긴 결과에 대해 물리적 타당성을 검토한다. 이 agent는 reference tolerance를 다시 판정하지 않고, 평형, 반력 부호/합력, 변위 방향, 대칭성, 요소내력/응력 위치, rigid body mode 징후, energy/residual sanity, 테스트 모델 coverage를 검토한다.
Physics Evaluation Agent는 Reference Verification Agent가 `pass-for-physics-evaluation`로 넘긴 결과에 대해 물리적 타당성을 검토한다. 이 agent는 reference tolerance를 다시 판정하지 않고, HDF5 결과와 deterministic CSV views를 읽기 전용 evidence로 사용해 평형, 반력 부호, 변위 방향, 대칭성, 요소내력/응력 위치, rigid body mode 징후, energy/residual sanity, 테스트 모델 coverage를 검토한다.
기본 문서명은 `docs/physics-evaluations/<feature-id>-physics-evaluation.md` 형식을 사용한다.
@@ -23,7 +23,7 @@ Physics Evaluation Agent는 Reference Verification Agent가 `pass-for-physics-ev
- requirements, formulations, I/O contracts, reference model contracts를 수정하지 않는다.
- reference artifacts 또는 tolerance policies를 수정하지 않는다.
- Abaqus, Nastran 또는 reference solver를 실행하지 않는다.
- reference CSV를 생성하지 않는다.
- reference HDF5 파일이나 deterministic CSV view를 생성하지 않는다.
- reference tolerance를 다시 판정하지 않는다.
- release readiness를 승인하지 않는다.
- release notes 또는 final release checklist를 작성하지 않는다.
@@ -39,7 +39,8 @@ EVIDENCE CHECK -> PHYSICS CHECKS -> CLASSIFY -> REPORT
`EVIDENCE CHECK`에서 다음 항목을 확인한다.
- Reference Verification report status가 `pass-for-physics-evaluation`인지 여부
- checked solver/reference CSVs
- checked solver/reference HDF5 files
- checked deterministic CSV views
- compared quantities
- model purpose
- documented physical expectations
@@ -53,20 +54,20 @@ EVIDENCE CHECK -> PHYSICS CHECKS -> CLASSIFY -> REPORT
- `reaction consistency`: constrained DOF와 reaction component가 경계조건과 일관적인지 검토한다.
- `displacement direction`: 하중 방향, 구속조건, 예상 변형 모드와 변위 부호/방향이 맞는지 검토한다.
- `symmetry`: symmetry, antisymmetry, expected zero component가 모델 목적과 일치하는지 검토한다.
- `element force balance`: element internal force 외력/반력 균형 또는 부호 일관성을 검토한다.
- `element force balance`: element internal force 외력/반력 균형 또는 부호 일관성을 만족하는지 검토한다.
- `stress/strain`: stress/strain 부호, component, coordinate system, output location이 모델 expectation과 일치하는지 검토한다.
- `rigid body mode`: 불완전 구속, 비정상적으로 큰 변위, near-zero stiffness 징후를 검토한다.
- `energy/residual`: energy_or_residual.csv 또는 residual output이 있을 때 energy balance, residual trend, convergence sanity를 검토한다.
- `energy/residual`: `csv/energy_or_residual.csv` 또는 residual output이 있을 때 energy balance, residual trend, convergence sanity를 검토한다.
- `model coverage`: reference model이 claimed feature를 충분히 검증하는지 검토한다.
## Failure Classification
- `equilibrium-failure`: 전체 하중-반력 또는 모멘트 평형이 기대와 다르다.
- `reaction-inconsistency`: constrained DOF reaction이 boundary condition 또는 load path와 일관되지 않다.
- `displacement-direction-failure`: 변위 방향 또는 부호가 하중/구속조건과 물리적으로 맞지 않다.
- `reaction-inconsistency`: constrained DOF reaction이 boundary condition 또는 load path와 일관되지 않다.
- `displacement-direction-failure`: 변위 방향 또는 부호가 하중/구속조건과 물리적으로 맞지 않다.
- `symmetry-failure`: expected symmetry, antisymmetry, zero component가 깨졌다.
- `stress-location-failure`: stress/strain output location 또는 component 해석이 물리 expectation과 맞지 않다.
- `element-force-inconsistency`: element internal force balance 또는 sign이 일관되지 않다.
- `stress-location-failure`: stress/strain output location 또는 component 해석이 물리 expectation과 맞지 않다.
- `element-force-inconsistency`: element internal force balance 또는 sign이 일관되지 않다.
- `rigid-body-mode-suspected`: rigid body mode 또는 under-constrained model 징후가 있다.
- `nonfinite-result`: NaN 또는 infinite value가 있다.
- `model-coverage-gap`: reference model이 기능을 충분히 검증하지 못한다.
@@ -93,8 +94,10 @@ EVIDENCE CHECK -> PHYSICS CHECKS -> CLASSIFY -> REPORT
| evidence | path_or_source | status | notes |
| --- | --- | --- | --- |
| reference_verification | docs/reference-verifications/<feature-id>-reference-verification.md | pass-for-physics-evaluation | <summary> |
| solver_results | <solver CSV path> | present | missing | <summary> |
| reference_results | references/<feature-id>/<model-id>/ | present | missing | <summary> |
| solver_hdf5 | <solver output directory>/results.h5 | present | missing | <summary> |
| solver_csv_views | <solver output directory>/csv/ | present | missing | <summary or N/A> |
| reference_hdf5 | references/<feature-id>/<model-id>/reference.h5 | present | missing | <summary> |
| reference_csv_views | references/<feature-id>/<model-id>/csv/ | present | missing | <summary> |
| model_purpose | docs/reference-models/<feature-id>-reference-models.md | documented | missing | <summary> |
| physical_expectations | <source docs> | documented | missing | <summary> |
@@ -160,5 +163,6 @@ EVIDENCE CHECK -> PHYSICS CHECKS -> CLASSIFY -> REPORT
- documented expectation이 없는 항목은 pass/fail로 판정하지 않고 `skipped`, `needs-upstream-decision`, 또는 `needs-reference-model`로 둔다.
- 평형 검토는 적용 하중, 반력, element/internal force sign convention이 문서화된 경우에만 수행한다.
- stress/strain 검토는 output location, component naming, coordinate system, units가 정의된 경우에만 수행한다.
- HDF5와 deterministic CSV views는 읽기 전용 evidence로만 사용한다.
- pass는 Release Agent로 넘길 수 있다는 뜻이며 release readiness 승인이 아니다.
- reference artifacts와 tolerance policies는 수정하지 않는다.
+55 -44
View File
@@ -2,7 +2,7 @@
이 디렉터리는 Reference Model Agent가 작성하거나 제안한 기능별 reference model 설계 문서를 보관하는 위치다.
Reference Model Agent는 FESA 기능 검증에 필요한 Abaqus `.inp` 기반 테스트 모델 포트폴리오와 `references/<feature-id>/<model-id>/` artifact bundle 계약을 정의한다. Agent는 Abaqus, Nastran 또는 레퍼런스 솔버를 직접 실행하지 않고, reference CSV 값을 생성하지 않으며, solver 결과 비교나 release readiness 승인도 하지 않는다.
Reference Model Agent는 FESA 기능 검증에 필요한 Abaqus `.inp` 기반 테스트 모델 포트폴리오와 `references/<feature-id>/<model-id>/` artifact bundle 계약을 정의한다. Agent는 Abaqus, Nastran 또는 레퍼런스 솔버를 직접 실행하지 않고, reference HDF5 파일이나 deterministic CSV view 값을 생성하지 않으며, solver 결과 비교나 release readiness 승인도 하지 않는다.
기본 파일명은 `docs/reference-models/<feature-id>-reference-models.md` 형식을 사용한다. 각 문서는 요구조건, 연구 브리프, 정식화, 수치 리뷰, I/O 정의를 입력으로 받아 구현 전에 준비해야 할 테스트 모델과 reference artifact 요구사항을 정의해야 한다.
@@ -13,7 +13,7 @@ Reference Model Agent는 FESA 기능 검증에 필요한 Abaqus `.inp` 기반
- `model.inp`가 I/O Definition Agent의 supported Abaqus keyword subset 안에 있는지 확인한다.
- `references/<feature-id>/<model-id>/` artifact bundle 구조와 필수 파일을 정의한다.
- `metadata.json` provenance, 단위, 좌표계, Abaqus version/source, output request, tolerance 정책을 정의한다.
- `displacements.csv`, `reactions.csv`, `element_forces.csv`, `stresses.csv` 요구사항을 정의한다.
- `reference.h5` 요구사항과 HDF5 dataset에서 추출되는 deterministic CSV view 요구사항을 정의한다.
- requirement와 model, compared quantity, tolerance, artifact status를 연결하는 Coverage Matrix를 작성한다.
수행하지 않는다:
@@ -21,7 +21,7 @@ Reference Model Agent는 FESA 기능 검증에 필요한 Abaqus `.inp` 기반
- parser를 구현하지 않는다.
- C++ API나 파일 구조를 설계하지 않는다.
- Abaqus, Nastran 또는 레퍼런스 솔버를 직접 실행하지 않는다.
- reference CSV를 생성하지 않는다.
- reference HDF5 파일이나 deterministic CSV view를 생성하지 않는다.
- solver 결과를 비교하지 않는다.
- release readiness를 승인하지 않는다.
- reference 값, tolerance, Abaqus compatibility를 임의로 만들지 않는다.
@@ -53,11 +53,11 @@ Reference Model Agent는 FESA 기능 검증에 필요한 Abaqus `.inp` 기반
| model_id | category | purpose | status | required_artifacts |
| --- | --- | --- | --- | --- |
| <model-id> | smoke | <basic parser/solve path> | draft | model.inp, metadata.json, required CSVs |
| <model-id> | analytical | <closed-form comparison> | draft | model.inp, metadata.json, required CSVs |
| <model-id> | patch test | <element consistency check> | draft | model.inp, metadata.json, required CSVs |
| <model-id> | benchmark | <trusted benchmark comparison> | draft | model.inp, metadata.json, required CSVs |
| <model-id> | regression | <known defect guard> | draft | model.inp, metadata.json, required CSVs |
| <model-id> | smoke | <basic parser/solve path> | draft | model.inp, metadata.json, reference.h5, required CSV views |
| <model-id> | analytical | <closed-form comparison> | draft | model.inp, metadata.json, reference.h5, required CSV views |
| <model-id> | patch test | <element consistency check> | draft | model.inp, metadata.json, reference.h5, required CSV views |
| <model-id> | benchmark | <trusted benchmark comparison> | draft | model.inp, metadata.json, reference.h5, required CSV views |
| <model-id> | regression | <known defect guard> | draft | model.inp, metadata.json, reference.h5, required CSV views |
| <model-id> | negative/invalid-input | <unsupported keyword or invalid model diagnostic> | draft | model.inp, metadata.json |
## Model Record
@@ -81,7 +81,7 @@ Reference Model Agent는 FESA 기능 검증에 필요한 Abaqus `.inp` 기반
- supported_keyword_subset: <keywords from docs/io-definitions/<feature-id>-io.md>
- model_data: <nodes, elements, sets, material, section, coordinates, units>
- history_data: <step, procedure, boundary conditions, loads, output requests>
- output_requests: <requests needed to populate reference CSV files>
- output_requests: <requests needed to populate reference.h5 datasets and deterministic CSV views>
- unsupported_keyword_policy: unsupported | ignored-with-warning | requires-user-decision
## Artifact Bundle Contract
@@ -92,25 +92,28 @@ references/
<model-id>/
model.inp
metadata.json
displacements.csv
reactions.csv
element_forces.csv
stresses.csv
reference.h5
csv/
displacements.csv
reactions.csv
element_forces.csv
stresses.csv
README.md
```
Required files:
- `model.inp`: Abaqus input file for the reference model.
- `metadata.json`: provenance and model contract metadata.
- `displacements.csv`: nodal displacement reference results.
- `reactions.csv`: nodal reaction force reference results.
- `element_forces.csv`: element internal force reference results.
- `stresses.csv`: stress reference results.
- `reference.h5`: authoritative reference result artifact.
- `csv/displacements.csv`: deterministic view of nodal displacement reference results.
- `csv/reactions.csv`: deterministic view of nodal reaction force reference results.
- `csv/element_forces.csv`: deterministic view of element internal force reference results.
- `csv/stresses.csv`: deterministic view of stress reference results.
- `README.md`: short description, generation notes, and limitations.
Optional files:
- `strains.csv`: strain reference results when required.
- `energy_or_residual.csv`: energy, residual, or convergence reference results when required.
- `csv/strains.csv`: deterministic strain view when required.
- `csv/energy_or_residual.csv`: deterministic energy, residual, or convergence view when required.
- `notes.md`: manual review notes.
## Metadata JSON Contract
@@ -132,62 +135,70 @@ Optional files:
"boundary_condition_summary": "<summary>",
"load_summary": "<summary>",
"output_requests": ["U", "RF", "S", "<feature-specific quantities>"],
"csv_schema_version": "<version>",
"hdf5_schema_version": "<version>",
"csv_view_schema_version": "<version>",
"csv_view_source": "reference.h5",
"tolerance_policy": "<absolute/relative/norm policy>",
"limitations": ["<known limitation>"]
}
```
## Reference CSV Requirements
## Reference HDF5 and CSV View Requirements
### displacements.csv
### reference.h5
- Required when any numerical reference comparison is part of the acceptance criteria.
- Must include schema version, units, coordinate system, step/frame identity, output location, component naming, and row identity metadata.
- Must contain datasets sufficient to derive all required deterministic CSV views.
### csv/displacements.csv
- Required when nodal displacement is a verification quantity.
- Must include step/frame identity, node id, displacement components, coordinate system, and units.
### reactions.csv
### csv/reactions.csv
- Required when constrained DOF reactions or global equilibrium are verification quantities.
- Must include step/frame identity, node id, reaction components, coordinate system, and units.
### element_forces.csv
### csv/element_forces.csv
- Required when element internal force is a verification quantity.
- Must include step/frame identity, element id, output location, component, value, and units.
### stresses.csv
### csv/stresses.csv
- Required when stress is a verification quantity.
- Must include step/frame identity, element id, integration point or recovery location, component, value, coordinate system, and units.
### Optional CSVs
- `strains.csv`: required when strain is part of the acceptance criteria.
- `energy_or_residual.csv`: required when energy balance, residual, or convergence data is part of the acceptance criteria.
### Optional CSV Views
- `csv/strains.csv`: required when strain is part of the acceptance criteria.
- `csv/energy_or_residual.csv`: required when energy balance, residual, or convergence data is part of the acceptance criteria.
## Coverage Matrix
| requirement_id | model_id | compared_quantity | artifact_file | tolerance | verification_method | status |
| --- | --- | --- | --- | --- | --- | --- |
| <req-id> | <model-id> | displacement | displacements.csv | <policy> | reference-comparison | draft |
| <req-id> | <model-id> | reaction | reactions.csv | <policy> | reference-comparison | draft |
| <req-id> | <model-id> | element force | element_forces.csv | <policy> | reference-comparison | draft |
| <req-id> | <model-id> | stress | stresses.csv | <policy> | reference-comparison | draft |
| requirement_id | model_id | compared_quantity | hdf5_dataset | csv_view | tolerance | verification_method | status |
| --- | --- | --- | --- | --- | --- | --- | --- |
| <req-id> | <model-id> | displacement | <dataset path> | csv/displacements.csv | <policy> | reference-comparison | draft |
| <req-id> | <model-id> | reaction | <dataset path> | csv/reactions.csv | <policy> | reference-comparison | draft |
| <req-id> | <model-id> | element force | <dataset path> | csv/element_forces.csv | <policy> | reference-comparison | draft |
| <req-id> | <model-id> | stress | <dataset path> | csv/stresses.csv | <policy> | reference-comparison | draft |
## Artifact Acceptance Checklist
- 모든 `must` requirement가 최소 하나의 `model_id``compared_quantity`에 연결되어 있다.
- `model.inp`가 기능별 supported Abaqus keyword subset을 벗어나지 않는다.
- `metadata.json`에 provenance, Abaqus version/source, units, coordinate system, tolerance, CSV schema version이 기록되어 있다.
- 필수 CSV 파일이 존재하거나, 기능상 불필요한 파일은 명확한 reason과 함께 제외되어 있다.
- output request가 필요한 CSV 물리량을 생성할 수 있도록 정의되어 있다.
- reference CSV가 없으면 status는 `needs-reference-artifacts`다.
- `metadata.json`에 provenance, Abaqus version/source, units, coordinate system, tolerance, HDF5 schema version, CSV view schema version이 기록되어 있다.
- `reference.h5` 존재하거나, 기능상 불필요하면 명확한 reason과 함께 제외되어 있다.
- 필수 deterministic CSV view가 존재하거나, 기능상 불필요한 view는 명확한 reason과 함께 제외되어 있다.
- output request가 필요한 HDF5 dataset과 CSV view 물리량을 생성할 수 있도록 정의되어 있다.
- `reference.h5` 또는 required CSV view가 없으면 status는 `needs-reference-artifacts`다.
- tolerance, source, units, coordinate system이 불명확하면 status는 `needs-user-decision`이다.
## Open Issues and Downstream Handoff
### I/O Definition Agent
- <supported keyword, output request, CSV schema clarification>
- <supported keyword, output request, HDF5 schema clarification, CSV view schema clarification>
### Implementation Planning Agent
- <tests that should fail before implementation, model order, acceptance criteria>
### Reference Verification Agent
- <CSV schema, ID matching, units, coordinate conventions, output locations, tolerance mapping>
- <HDF5 dataset paths, CSV view schema, ID matching, units, coordinate conventions, output locations, tolerance mapping>
### Physics Evaluation Agent
- <equilibrium, symmetry, displacement direction, stress location, rigid body mode, load path sanity checks>
@@ -198,8 +209,8 @@ Optional files:
- Reference model의 목적과 검증 대상 requirement가 명확해야 한다.
- `model.inp`는 Abaqus input file이며, 기능별 supported keyword subset을 따라야 한다.
- model data와 history data를 구분해야 한다.
- output request와 required CSV 사이의 연결이 명확해야 한다.
- output request와 required HDF5 dataset/CSV view 사이의 연결이 명확해야 한다.
- `references/<feature-id>/<model-id>/` 구조와 필수 artifact가 명시되어야 한다.
- `metadata.json`에는 provenance, Abaqus version/source, units, coordinate system, tolerance, CSV schema version이 포함되어야 한다.
- reference CSV가 없으면 완료 상태가 아니라 `needs-reference-artifacts` 상태로 둔다.
- 모든 `must` requirement는 Coverage Matrix에서 model, compared quantity, tolerance, verification method로 추적되어야 한다.
- `metadata.json`에는 provenance, Abaqus version/source, units, coordinate system, tolerance, HDF5 schema version, CSV view schema version이 포함되어야 한다.
- `reference.h5` 또는 required CSV view가 없으면 완료 상태가 아니라 `needs-reference-artifacts` 상태로 둔다.
- 모든 `must` requirement는 Coverage Matrix에서 model, compared quantity, HDF5 dataset, CSV view, tolerance, verification method로 추적되어야 한다.
+47 -37
View File
@@ -2,17 +2,17 @@
이 디렉터리는 Reference Verification Agent가 작성하거나 제안하는 기능별 reference comparison report를 보관하는 위치다.
Reference Verification Agent는 Build/Test Executor Agent 통과 후 generated solver result CSV와 stored Abaqus reference CSV artifacts를 tolerance 기준으로 비교한다. 이 agent는 comparison과 report만 수행하며, source code, tests, CMake files, requirements, formulations, I/O contracts, reference artifacts, tolerance policies를 수정하지 않는다.
Reference Verification Agent는 Build/Test Executor Agent 통과 후 generated solver `results.h5`와 stored reference `reference.h5`를 tolerance 기준으로 비교한다. CSV는 authoritative storage가 아니라 HDF5 dataset에서 추출한 deterministic CSV view이다. 이 agent는 comparison과 report만 수행하며, source code, tests, CMake files, requirements, formulations, I/O contracts, reference artifacts, tolerance policies를 수정하지 않는다.
기본 문서명은 `docs/reference-verifications/<feature-id>-reference-verification.md` 형식을 사용한다.
## Reference Verification Agent 역할
수행한다:
- `references/<feature-id>/<model-id>/` artifact bundle과 generated solver result CSV를 확인한다.
- `metadata.json`, schema version, units, coordinate system, step/frame identity, node/element IDs, output location, tolerance source를 확인한다.
- `displacements.csv`, `reactions.csv`, `element_forces.csv`, `stresses.csv`를 기본 비교 대상으로 삼는다.
- upstream 문서가 요구할 때만 `strains.csv`, `energy_or_residual.csv`를 추가 비교한다.
- `references/<feature-id>/<model-id>/` artifact bundle과 generated solver `results.h5`를 확인한다.
- `metadata.json`, `reference.h5`, required deterministic CSV views, schema version, units, coordinate system, step/frame identity, node/element IDs, output location, tolerance source를 확인한다.
- HDF5 dataset을 authoritative 비교 대상으로 삼고, `csv/displacements.csv`, `csv/reactions.csv`, `csv/element_forces.csv`, `csv/stresses.csv`는 deterministic row view로 사용한다.
- upstream 문서가 요구할 때만 `csv/strains.csv`, `csv/energy_or_residual.csv`를 추가 비교한다.
- max absolute error, max relative error, RMS error, norm error, worst node/element/component, missing rows, extra rows, pass/fail을 보고한다.
- 실패를 missing-reference-artifact, missing-solver-output, schema-mismatch, id-mismatch, unit-or-coordinate-mismatch, tolerance-failure, nonfinite-result, upstream-contract, environment로 분류한다.
@@ -23,8 +23,8 @@ Reference Verification Agent는 Build/Test Executor Agent 통과 후 generated s
- requirements, formulations, I/O contracts, reference model contracts를 수정하지 않는다.
- reference artifacts 또는 tolerance policies를 수정하지 않는다.
- Abaqus, Nastran 또는 reference solver를 실행하지 않는다.
- reference CSV를 생성하지 않는다.
- solver output CSV를 tolerance에 맞추기 위해 보정하지 않는다.
- reference HDF5 파일이나 deterministic CSV view를 생성하지 않는다.
- solver output tolerance에 맞추기 위해 보정하지 않는다.
- physics validation success 또는 release readiness를 승인하지 않는다.
## 실행 순서
@@ -38,9 +38,11 @@ ARTIFACT CHECK -> COMPARE -> CLASSIFY -> REPORT
`ARTIFACT CHECK`에서 다음 항목이 없으면 비교를 시작하지 않는다.
- `metadata.json`
- required reference CSV files
- generated solver result CSV files
- schema version
- stored reference `reference.h5`
- generated solver `results.h5`
- required deterministic CSV view files
- HDF5 schema version
- CSV view schema version
- units
- coordinate system
- step/frame identity
@@ -50,21 +52,27 @@ ARTIFACT CHECK -> COMPARE -> CLASSIFY -> REPORT
## 비교 대상
기본 비교 대상:
- `displacements.csv`: nodal displacement
- `reactions.csv`: nodal reaction force
- `element_forces.csv`: element internal force
- `stresses.csv`: element stress
Authoritative 비교 대상:
- `results.h5``reference.h5` displacement datasets
- `results.h5``reference.h5` reaction datasets
- `results.h5``reference.h5` element force datasets
- `results.h5``reference.h5`의 stress datasets
선택 비교 대상:
- `strains.csv`: strain이 acceptance criteria에 포함된 경우
- `energy_or_residual.csv`: energy, residual, convergence quantity가 acceptance criteria에 포함된 경우
기본 deterministic CSV view:
- `csv/displacements.csv`: nodal displacement
- `csv/reactions.csv`: nodal reaction force
- `csv/element_forces.csv`: element internal force
- `csv/stresses.csv`: element stress
선택 deterministic CSV view:
- `csv/strains.csv`: strain이 acceptance criteria에 포함된 경우
- `csv/energy_or_residual.csv`: energy, residual, convergence quantity가 acceptance criteria에 포함된 경우
## Failure Classification
- `missing-reference-artifact`: required stored reference file 또는 provenance가 없다.
- `missing-solver-output`: generated solver result CSV 또는 comparison command가 없다.
- `schema-mismatch`: reference CSV와 solver CSV column/schema가 다르다.
- `missing-solver-output`: generated solver `results.h5` 또는 comparison command가 없다.
- `schema-mismatch`: reference HDF5, solver HDF5, 또는 deterministic CSV view schema가 다르다.
- `id-mismatch`: node id, element id, step/frame, integration point, component matching이 실패했다.
- `unit-or-coordinate-mismatch`: units 또는 coordinate system이 비교 가능하지 않다.
- `tolerance-failure`: schema와 matching은 유효하지만 error가 tolerance를 초과했다.
@@ -93,31 +101,32 @@ ARTIFACT CHECK -> COMPARE -> CLASSIFY -> REPORT
| --- | --- | --- | --- |
| reference_bundle | references/<feature-id>/<model-id>/ | present | missing | <notes> |
| metadata | references/<feature-id>/<model-id>/metadata.json | present | missing | <provenance summary> |
| reference_displacements | references/<feature-id>/<model-id>/displacements.csv | present | missing | <notes> |
| reference_reactions | references/<feature-id>/<model-id>/reactions.csv | present | missing | <notes> |
| reference_element_forces | references/<feature-id>/<model-id>/element_forces.csv | present | missing | <notes> |
| reference_stresses | references/<feature-id>/<model-id>/stresses.csv | present | missing | <notes> |
| solver_outputs | <solver output directory> | present | missing | <notes> |
| reference_hdf5 | references/<feature-id>/<model-id>/reference.h5 | present | missing | <schema summary> |
| reference_csv_views | references/<feature-id>/<model-id>/csv/ | present | missing | <view inventory> |
| solver_hdf5 | <solver output directory>/results.h5 | present | missing | <schema summary> |
| solver_csv_views | <solver output directory>/csv/ | present | missing | <view inventory or N/A> |
## Comparison Contract
- schema_version: <version>
- hdf5_schema_version: <version>
- csv_view_schema_version: <version>
- id_matching: node_id | element_id | step/frame | integration_point | component
- units: <unit system>
- coordinate_system: <global/local convention>
- output_location: nodal | element | integration_point | centroid | recovery_location
- component_naming: <component naming policy>
- csv_view_sort_order: <step, frame, id, location, component order>
- tolerance_source: <requirement/reference model/I/O document>
- tolerance_policy: absolute | relative | norm-based | combined
- zero_reference_policy: <policy or N/A>
## Quantity Results
| quantity | model_id | artifact_file | compared_rows | missing_rows | extra_rows | max_abs_error | max_rel_error | rms_error | norm_error | worst_id | worst_component | result |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| displacement | <model-id> | displacements.csv | <n> | <n> | <n> | <value> | <value> | <value> | <value or N/A> | <node id> | <component> | pass | fail |
| reaction | <model-id> | reactions.csv | <n> | <n> | <n> | <value> | <value> | <value> | <value or N/A> | <node id> | <component> | pass | fail |
| element force | <model-id> | element_forces.csv | <n> | <n> | <n> | <value> | <value> | <value> | <value or N/A> | <element id> | <component> | pass | fail |
| stress | <model-id> | stresses.csv | <n> | <n> | <n> | <value> | <value> | <value> | <value or N/A> | <element/ip id> | <component> | pass | fail |
| quantity | model_id | hdf5_dataset | csv_view | compared_rows | missing_rows | extra_rows | max_abs_error | max_rel_error | rms_error | norm_error | worst_id | worst_component | result |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| displacement | <model-id> | <dataset path> | csv/displacements.csv | <n> | <n> | <n> | <value> | <value> | <value> | <value or N/A> | <node id> | <component> | pass | fail |
| reaction | <model-id> | <dataset path> | csv/reactions.csv | <n> | <n> | <n> | <value> | <value> | <value> | <value or N/A> | <node id> | <component> | pass | fail |
| element force | <model-id> | <dataset path> | csv/element_forces.csv | <n> | <n> | <n> | <value> | <value> | <value> | <value or N/A> | <element id> | <component> | pass | fail |
| stress | <model-id> | <dataset path> | csv/stresses.csv | <n> | <n> | <n> | <value> | <value> | <value> | <value or N/A> | <element/ip id> | <component> | pass | fail |
## Failure Classification
- classification: missing-reference-artifact | missing-solver-output | schema-mismatch | id-mismatch | unit-or-coordinate-mismatch | tolerance-failure | nonfinite-result | upstream-contract | environment | N/A
@@ -130,7 +139,7 @@ ARTIFACT CHECK -> COMPARE -> CLASSIFY -> REPORT
| --- | --- | --- |
| Correction Agent | <implementation-owned mismatch or nonfinite result> | <comparison metrics and failing quantity> |
| Reference Model Agent | <missing or invalid reference artifact/provenance> | <artifact inventory> |
| I/O Definition Agent | <schema, units, coordinate, output location mismatch> | <contract mismatch> |
| I/O Definition Agent | <HDF5 schema, CSV view schema, units, coordinate, output location mismatch> | <contract mismatch> |
| Physics Evaluation Agent | <reference comparisons passed> | <quantity results and report> |
| Coordinator Agent | <blocked or repeated ambiguity> | <classification and open issue> |
@@ -151,15 +160,16 @@ ARTIFACT CHECK -> COMPARE -> CLASSIFY -> REPORT
- `pass-for-physics-evaluation`: required reference comparisons가 모두 통과했고 Physics Evaluation Agent로 넘길 수 있다.
- `needs-correction`: implementation-owned solver result mismatch 또는 nonfinite result가 있다.
- `needs-reference-artifacts`: required reference artifact 또는 provenance가 누락됐다.
- `needs-solver-results`: generated solver result CSV 또는 comparison command가 없다.
- `needs-solver-results`: generated solver `results.h5` 또는 comparison command가 없다.
- `needs-upstream-decision`: schema, tolerance, units, coordinate system, output location, ID matching policy가 누락 또는 충돌한다.
- `blocked`: 사용자 또는 Coordinator Agent 결정 없이는 안전하게 진행할 수 없다.
## 품질 기준
- 모든 `must` requirement의 reference-comparison 항목은 model id, compared quantity, artifact file, tolerance에 trace되어야 한다.
- reference artifact는 읽기 전용이다. `model.inp`, `metadata.json`, reference CSV를 수정하지 않는다.
- solver output CSV는 비교 입력일 뿐이며 tolerance에 맞추기 위해 후처리 보정하지 않는다.
- 모든 `must` requirement의 reference-comparison 항목은 model id, compared quantity, HDF5 dataset, CSV view, tolerance에 trace되어야 한다.
- reference artifact는 읽기 전용이다. `model.inp`, `metadata.json`, `reference.h5`, `csv/*.csv`를 수정하지 않는다.
- `results.h5``reference.h5`가 authoritative 비교 입력이다.
- deterministic CSV view는 행 정렬과 사람이 검토 가능한 비교 view일 뿐이며 tolerance에 맞추기 위해 후처리 보정하지 않는다.
- stress/strain은 element id, integration point 또는 recovery location, component naming이 일치할 때만 비교한다.
- nodal displacement/reaction은 node id, DOF/component, coordinate system, unit이 일치할 때만 비교한다.
- missing rows와 extra rows를 숨기지 않고 보고한다.
+2 -2
View File
@@ -2,7 +2,7 @@
이 디렉터리는 Release Agent가 작성하거나 제안하는 기능별 release readiness report를 보관하는 위치다.
Release Agent는 Physics Evaluation Agent가 `pass-for-release-agent`로 넘긴 기능에 대해 최종 gate evidence를 감사한다. 이 Agent는 source code, tests, CMake, upstream 계약, reference artifacts, tolerance policies를 수정하지 않는다. 또한 Abaqus/Nastran 실행, reference CSV 생성, 외부 publish/deploy/package/tag/commit 작업을 수행하지 않는다.
Release Agent는 Physics Evaluation Agent가 `pass-for-release-agent`로 넘긴 기능에 대해 최종 gate evidence를 감사한다. 이 Agent는 source code, tests, CMake, upstream 계약, reference artifacts, tolerance policies를 수정하지 않는다. 또한 Abaqus/Nastran 실행, reference HDF5/CSV view 생성, 외부 publish/deploy/package/tag/commit 작업을 수행하지 않는다.
기본 문서명은 `docs/releases/<feature-id>-release.md` 형식을 사용한다.
@@ -24,7 +24,7 @@ Release Agent는 Physics Evaluation Agent가 `pass-for-release-agent`로 넘긴
- requirements, formulations, I/O contracts, numerical review reports, reference verification reports, physics evaluation reports를 수정하지 않는다.
- reference artifacts 또는 tolerance policies를 수정하지 않는다.
- Abaqus, Nastran 또는 reference solver를 실행하지 않는다.
- reference CSV를 생성하지 않는다.
- reference HDF5 파일이나 deterministic CSV view를 생성하지 않는다.
- 실패하거나 누락된 upstream gate를 우회하지 않는다.
- 사용자 명시 요청 없이 publish, deploy, package, tag, commit, external release를 수행하지 않는다.
+6 -5
View File
@@ -20,7 +20,7 @@ Requirement Agent는 솔버 기능 요청을 검증 가능한 요구조건으로
- 유한요소 정식화를 확정하지 않는다.
- C++ API나 파일 구조를 설계하지 않는다.
- Abaqus, Nastran 또는 레퍼런스 솔버를 직접 실행하지 않는다.
- reference CSV 결과를 생성하지 않는다.
- reference HDF5 파일이나 deterministic CSV view를 생성하지 않는다.
- 기능 완료 여부를 승인하지 않는다.
## 문서 템플릿
@@ -78,10 +78,11 @@ Expected location: `references/<feature-id>/`
- `model.inp`: required | not-applicable
- `metadata.json`: required
- `displacements.csv`: required | not-applicable
- `reactions.csv`: required | not-applicable
- `element_forces.csv`: required | not-applicable
- `stresses.csv`: required | not-applicable
- `reference.h5`: required | not-applicable
- `csv/displacements.csv`: required | not-applicable
- `csv/reactions.csv`: required | not-applicable
- `csv/element_forces.csv`: required | not-applicable
- `csv/stresses.csv`: required | not-applicable
## Requirement Verification Matrix
+1 -1
View File
@@ -20,7 +20,7 @@ Research Agent는 FEM 이론, benchmark, verification reference, solver manual,
- 유한요소 정식화를 확정하지 않는다.
- C++ API나 파일 구조를 설계하지 않는다.
- Abaqus, Nastran 또는 레퍼런스 솔버를 직접 실행하지 않는다.
- reference CSV 결과를 생성하지 않는다.
- reference HDF5 파일이나 deterministic CSV view를 생성하지 않는다.
- 기능 완료 여부를 승인하지 않는다.
## Source Reliability Tier
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,785 @@
# Reference CSV Comparison Contract Implementation Plan
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
**Goal:** Re-align FESA reference comparison contracts so FESA solver output remains authoritative HDF5, while Abaqus-derived reference results are CSV files compared directly against the FESA `results.h5` datasets.
**Architecture:** The active contract becomes `FESA results.h5 -> comparison normalizer -> Abaqus reference CSV`. Reference CSV files are authoritative reference artifacts; they are not deterministic CSV views derived from `reference.h5`, and `reference.h5` is no longer required. Existing documentation, skills, agent prompts, and Python contract tests must all describe the same flat reference folder shape.
**Tech Stack:** Markdown docs, Codex skill `SKILL.md`, agent TOML/YAML metadata, Python `unittest`, existing `scripts/validate_workspace.py`.
---
## Target Contract
Use this exact vocabulary across active contracts:
- FESA solver result: HDF5 file, normally `<solver-output-dir>/results.h5`.
- Reference result: Abaqus-generated CSV files created by running the same Abaqus `.inp` model outside the agent workflow.
- Comparison: read FESA HDF5 datasets and compare their normalized rows directly with reference CSV rows.
- Reference root: `reference/`, singular, following the user-provided structure.
Required reference structure:
```text
reference/
<model-id>/
<model-id>_displacements.csv
<model-id>_reactions.csv
<model-id>_internalforces.csv
<model-id>_stresses.csv
<model-id>_<quantity>.csv
```
Quantity naming:
| quantity | reference CSV | FESA HDF5 source |
| --- | --- | --- |
| displacement | `reference/<model-id>/<model-id>_displacements.csv` | `/steps/<step>/frames/<frame>/field_outputs/U` |
| reaction | `reference/<model-id>/<model-id>_reactions.csv` | `/steps/<step>/frames/<frame>/field_outputs/RF` |
| internal force | `reference/<model-id>/<model-id>_internalforces.csv` | `/steps/<step>/frames/<frame>/field_outputs/element_forces` or feature-defined equivalent |
| stress | `reference/<model-id>/<model-id>_stresses.csv` | `/steps/<step>/frames/<frame>/field_outputs/S` |
Allowed concept:
- A comparison command may materialize a deterministic CSV view from FESA HDF5 for debugging or review, but it is derived from `results.h5`, not an official solver output and not the reference artifact.
Prohibited active-contract claims:
- `reference.h5` is required.
- `results.h5` and `reference.h5` are both authoritative comparison inputs.
- Reference CSV files are deterministic views derived from `reference.h5`.
- Reference bundles live only under `references/<feature-id>/<model-id>/`.
Historical plan files under `docs/superpowers/plans/` may mention older contracts, but active docs, skills, agents, and tests must not.
## File Structure
Modify these active contract files:
- `AGENTS.md`: project-level reference comparison rules.
- `docs/ProjectInitialPlanNote.md`: initial plan notes where the old HDF5/reference-HDF5 decision was recorded.
- `docs/PRD.md`: user-facing product/verification expectations.
- `docs/ARCHITECTURE.md`: result and reference data-flow architecture.
- `docs/ADR.md`: architecture decision record for HDF5 solver output and CSV reference artifacts.
- `docs/SOLVER_AGENT_DESIGN.md`: agent workflow and gates.
- `docs/SOLVER_SKILL_DESIGN.md`: skill workflow overview.
- `docs/reference-models/README.md`: reference artifact bundle contract.
- `docs/reference-verifications/README.md`: comparison report template and status rules.
- `docs/io-definitions/README.md`: FESA HDF5 schema and comparison row schema handoff.
- `docs/implementation-plans/README.md`: implementation planning data-flow contract.
- `docs/physics-evaluations/README.md`: physics evidence inventory.
- `docs/requirements/README.md`: reference artifact requirements section.
Modify these skills and UI metadata:
- `.codex/skills/fesa-reference-models/SKILL.md`
- `.codex/skills/fesa-reference-models/agents/openai.yaml`
- `.codex/skills/fesa-reference-comparison/SKILL.md`
- `.codex/skills/fesa-reference-comparison/agents/openai.yaml`
- `.codex/skills/fesa-io-contract/SKILL.md`
- `.codex/skills/fesa-physics-sanity/SKILL.md`
- `.codex/skills/fesa-cpp-msvc-tdd/SKILL.md`
- `.codex/skills/fesa-release-readiness/SKILL.md`
- `.codex/skills/fesa-requirements-baseline/SKILL.md`
Modify these agent configs:
- `.codex/agents/reference-model-agent.toml`
- `.codex/agents/reference-verification-agent.toml`
- `.codex/agents/io-definition-agent.toml`
- `.codex/agents/implementation-planning-agent.toml`
- `.codex/agents/implementation-agent.toml`
- `.codex/agents/physics-evaluation-agent.toml`
- `.codex/agents/release-agent.toml`
- `.codex/agents/requirement-agent.toml`
- `.codex/agents/coordinator-agent.toml`
- Other `.codex/agents/*-agent.toml` files only where they contain stale `reference.h5` or `reference HDF5` claims.
Modify these Python contract tests:
- `scripts/test_fesa_solver_skills.py`
- `scripts/test_reference_model_agent_config.py`
- `scripts/test_reference_verification_agent_config.py`
- `scripts/test_physics_evaluation_agent_config.py`
- `scripts/test_io_definition_agent_config.py`
- `scripts/test_implementation_planning_agent_config.py`
- `scripts/test_requirement_agent_config.py`
- `scripts/test_release_agent_config.py`
- Any other `scripts/test_*_agent_config.py` that still asserts `Do not generate reference HDF5 files or deterministic CSV views.`
---
### Task 1: Update Contract Tests First
**Files:**
- Modify: `scripts/test_fesa_solver_skills.py`
- Modify: `scripts/test_reference_model_agent_config.py`
- Modify: `scripts/test_reference_verification_agent_config.py`
- Modify: `scripts/test_physics_evaluation_agent_config.py`
- Modify: `scripts/test_io_definition_agent_config.py`
- Modify: `scripts/test_implementation_planning_agent_config.py`
- Modify: `scripts/test_requirement_agent_config.py`
- Modify: `scripts/test_release_agent_config.py`
- [ ] **Step 1: Replace reference-HDF5 expectations in reference model tests**
In `scripts/test_reference_model_agent_config.py`, change the artifact contract expectations from `reference.h5` and nested `csv/` files to the flat user-provided structure.
Use assertions equivalent to:
```python
for required_text in (
"FESA reference models use Abaqus input files.",
"reference/<model-id>/",
"model.inp",
"metadata.json",
"<model-id>_displacements.csv",
"<model-id>_reactions.csv",
"<model-id>_internalforces.csv",
"<model-id>_stresses.csv",
):
self.assertIn(required_text, instructions)
self.assertNotIn("reference.h5", instructions)
self.assertNotIn("references/<feature-id>/<model-id>/", instructions)
```
Change the boundary expectation from:
```python
"Do not generate reference HDF5 files or deterministic CSV views.",
```
to:
```python
"Do not generate or modify Abaqus reference CSV files.",
```
- [ ] **Step 2: Replace reference-HDF5 expectations in reference verification tests**
In `scripts/test_reference_verification_agent_config.py`, assert that the agent compares FESA HDF5 to Abaqus reference CSV:
```python
for required_text in (
"results.h5",
"Abaqus reference CSV",
"reference/<model-id>/",
"<model-id>_displacements.csv",
"<model-id>_reactions.csv",
"<model-id>_internalforces.csv",
"<model-id>_stresses.csv",
"metadata.json",
):
self.assertIn(required_text, instructions)
self.assertNotIn("reference.h5", instructions)
self.assertNotIn("stored reference HDF5", instructions)
```
Keep output section assertions for `Artifact Inventory`, `Comparison Contract`, `Quantity Results`, `Failure Classification`, `Handoff Recommendation`, and `No-Change Assertion`.
- [ ] **Step 3: Update solver skill contract tests**
In `scripts/test_fesa_solver_skills.py`, update the `fesa-reference-models` `body_terms` to:
```python
"reference/<model-id>/",
"model.inp",
"metadata.json",
"<model-id>_displacements.csv",
"<model-id>_reactions.csv",
"<model-id>_internalforces.csv",
"<model-id>_stresses.csv",
"Coverage Matrix",
"Do not generate or modify Abaqus reference CSV files.",
```
Update the `fesa-reference-comparison` `body_terms` to:
```python
"docs/reference-verifications/<feature-id>-reference-verification.md",
"ARTIFACT CHECK -> COMPARE -> CLASSIFY -> REPORT",
"results.h5",
"Abaqus reference CSV",
"reference/<model-id>/",
"<model-id>_displacements.csv",
"<model-id>_reactions.csv",
"<model-id>_internalforces.csv",
"<model-id>_stresses.csv",
"max absolute error",
"max relative error",
"RMS error",
"missing rows",
"extra rows",
"pass-for-physics-evaluation",
"Do not change tolerance policies.",
```
Keep `HDF5` in the description terms for FESA output. Replace `CSV view` description terms with `CSV` or `reference CSV` where the old phrase implies a reference HDF5-derived view.
- [ ] **Step 4: Update shared boundary tests**
For each affected `scripts/test_*_agent_config.py`, replace the old boundary assertion:
```python
"Do not generate reference HDF5 files or deterministic CSV views.",
```
with:
```python
"Do not generate or modify Abaqus reference CSV files.",
```
Use this only for agents whose scope mentions reference artifacts. Do not add the phrase to unrelated tests unless the corresponding agent config already carries a reference artifact boundary.
- [ ] **Step 5: Run the updated tests and confirm RED**
Run:
```powershell
python -m unittest scripts.test_reference_model_agent_config scripts.test_reference_verification_agent_config scripts.test_fesa_solver_skills -v
```
Expected: FAIL. Failures should point to missing `reference/<model-id>/`, missing `<model-id>_internalforces.csv`, or stale `reference.h5` text in active contracts.
Commit after this task only if using a clean branch:
```powershell
git add scripts/test_fesa_solver_skills.py scripts/test_reference_model_agent_config.py scripts/test_reference_verification_agent_config.py scripts/test_physics_evaluation_agent_config.py scripts/test_io_definition_agent_config.py scripts/test_implementation_planning_agent_config.py scripts/test_requirement_agent_config.py scripts/test_release_agent_config.py
git commit -m "test: redefine reference comparison contract"
```
### Task 2: Update Project-Level Documentation
**Files:**
- Modify: `AGENTS.md`
- Modify: `docs/ProjectInitialPlanNote.md`
- Modify: `docs/PRD.md`
- Modify: `docs/ARCHITECTURE.md`
- Modify: `docs/ADR.md`
- [ ] **Step 1: Update `AGENTS.md` project identity**
Replace the current reference comparison statement with:
```markdown
- 공식 solver output은 HDF5 `results.h5`이다.
- reference 결과는 FESA와 같은 Abaqus `.inp` 모델을 Abaqus로 해석해 생성한 CSV 파일이다.
- reference comparison은 FESA `results.h5`의 변위, 반력, 내력, 응력 dataset을 `reference/<model-id>/<model-id>_*.csv` 파일과 비교한다.
- CSV는 FESA 공식 output이 아니며, FESA HDF5에서 추출한 deterministic CSV view는 비교 디버깅/검토용 보조 artifact로만 둔다.
```
Replace any active `references/<feature-id>/<model-id>/` reference artifact examples with:
```text
reference/<model-id>/<model-id>_displacements.csv
reference/<model-id>/<model-id>_reactions.csv
reference/<model-id>/<model-id>_internalforces.csv
reference/<model-id>/<model-id>_stresses.csv
```
- [ ] **Step 2: Update `docs/ProjectInitialPlanNote.md`**
Revise the section currently stating that `reference.h5` is the stored authoritative reference. The replacement must say:
```markdown
## HDF5 결과와 Abaqus reference CSV 비교 결정
FESA solver의 공식 해석 결과는 `results.h5` HDF5 파일이다. Reference 결과는 동일한 Abaqus `.inp` 모델을 Abaqus에서 해석해 추출한 CSV 파일이며, `reference/<model-id>/` 아래에 물리량별 파일로 저장한다.
Reference comparison은 FESA HDF5 dataset을 deterministic row record로 읽어 `reference/<model-id>/<model-id>_displacements.csv`, `<model-id>_reactions.csv`, `<model-id>_internalforces.csv`, `<model-id>_stresses.csv`와 직접 비교한다.
```
- [ ] **Step 3: Update PRD/architecture/ADR**
Ensure the active decision in `docs/PRD.md`, `docs/ARCHITECTURE.md`, and `docs/ADR.md` contains these three facts:
```markdown
- FESA solver writes `results.h5`.
- Abaqus reference results are CSV files under `reference/<model-id>/`.
- Verification compares FESA HDF5 rows with Abaqus reference CSV rows using documented IDs, components, units, coordinate system, step/frame identity, and tolerance.
```
Remove or rewrite claims that `reference.h5` is required or that reference CSV files are generated from reference HDF5.
- [ ] **Step 4: Run targeted stale-text check**
Run:
```powershell
rg -n "reference\.h5|stored reference HDF5|results\.h5.*reference\.h5|derived from reference\.h5|references/<feature-id>/<model-id>/" AGENTS.md docs\ProjectInitialPlanNote.md docs\PRD.md docs\ARCHITECTURE.md docs\ADR.md
```
Expected: no matches in these active project-level docs.
Commit:
```powershell
git add AGENTS.md docs/ProjectInitialPlanNote.md docs/PRD.md docs/ARCHITECTURE.md docs/ADR.md
git commit -m "docs: define HDF5 to reference CSV comparison"
```
### Task 3: Update Reference Model Contracts
**Files:**
- Modify: `docs/reference-models/README.md`
- Modify: `.codex/skills/fesa-reference-models/SKILL.md`
- Modify: `.codex/skills/fesa-reference-models/agents/openai.yaml`
- Modify: `.codex/agents/reference-model-agent.toml`
- [ ] **Step 1: Rewrite the artifact bundle structure**
Use this structure in all four files:
```text
reference/
<model-id>/
model.inp
metadata.json
<model-id>_displacements.csv
<model-id>_reactions.csv
<model-id>_internalforces.csv
<model-id>_stresses.csv
README.md
```
Optional files:
```text
<model-id>_strains.csv
<model-id>_energy_or_residual.csv
<model-id>_<quantity>.csv
notes.md
```
- [ ] **Step 2: Rename the reference result section**
Change headings and output contracts from `Reference HDF5 and CSV View Requirements` to:
```markdown
## Abaqus Reference CSV Requirements
```
For `docs/reference-models/README.md`, include this exact required-file wording:
```markdown
- `<model-id>_displacements.csv`: required when nodal displacement is a verification quantity.
- `<model-id>_reactions.csv`: required when constrained DOF reactions or global equilibrium are verification quantities.
- `<model-id>_internalforces.csv`: required when element internal force is a verification quantity.
- `<model-id>_stresses.csv`: required when stress is a verification quantity.
```
- [ ] **Step 3: Update metadata contract**
Replace reference HDF5 metadata fields with CSV/reference provenance fields:
```json
{
"feature_id": "<feature-id>",
"model_id": "<model-id>",
"artifact_status": "draft | needs-reference-artifacts | ready-for-implementation-planning | blocked",
"input_file": "model.inp",
"abaqus_version": "<version or needs-user-decision>",
"generation_owner": "<person/procedure>",
"generation_date": "<YYYY-MM-DD>",
"source_documents": ["docs/requirements/<feature-id>.md"],
"units": "<unit system>",
"coordinate_system": "global Cartesian unless otherwise documented",
"analysis_type": "<analysis type>",
"element_types": ["<Abaqus element type>"],
"material_values": {},
"boundary_condition_summary": "<summary>",
"load_summary": "<summary>",
"output_requests": ["U", "RF", "S", "<feature-specific quantities>"],
"reference_csv_schema_version": "<version>",
"reference_csv_files": [
"<model-id>_displacements.csv",
"<model-id>_reactions.csv",
"<model-id>_internalforces.csv",
"<model-id>_stresses.csv"
],
"tolerance_policy": "<absolute/relative/norm policy>",
"limitations": ["<known limitation>"]
}
```
- [ ] **Step 4: Update coverage matrix**
Change coverage matrix columns from `hdf5_dataset` and `csv_view` to:
```markdown
| requirement_id | model_id | compared_quantity | fesa_hdf5_dataset | reference_csv | tolerance | verification_method | status |
| --- | --- | --- | --- | --- | --- | --- | --- |
| <req-id> | <model-id> | displacement | /steps/<step>/frames/<frame>/field_outputs/U | reference/<model-id>/<model-id>_displacements.csv | <policy> | hdf5-to-reference-csv | draft |
| <req-id> | <model-id> | reaction | /steps/<step>/frames/<frame>/field_outputs/RF | reference/<model-id>/<model-id>_reactions.csv | <policy> | hdf5-to-reference-csv | draft |
| <req-id> | <model-id> | internal force | /steps/<step>/frames/<frame>/field_outputs/element_forces | reference/<model-id>/<model-id>_internalforces.csv | <policy> | hdf5-to-reference-csv | draft |
| <req-id> | <model-id> | stress | /steps/<step>/frames/<frame>/field_outputs/S | reference/<model-id>/<model-id>_stresses.csv | <policy> | hdf5-to-reference-csv | draft |
```
- [ ] **Step 5: Verify Task 3 tests**
Run:
```powershell
python -m unittest scripts.test_reference_model_agent_config scripts.test_fesa_solver_skills -v
```
Expected: reference model tests PASS; reference comparison skill tests may still fail until Task 4.
Commit:
```powershell
git add docs/reference-models/README.md .codex/skills/fesa-reference-models/SKILL.md .codex/skills/fesa-reference-models/agents/openai.yaml .codex/agents/reference-model-agent.toml
git commit -m "docs: update reference model CSV artifact contract"
```
### Task 4: Update Reference Verification Contracts
**Files:**
- Modify: `docs/reference-verifications/README.md`
- Modify: `.codex/skills/fesa-reference-comparison/SKILL.md`
- Modify: `.codex/skills/fesa-reference-comparison/agents/openai.yaml`
- Modify: `.codex/agents/reference-verification-agent.toml`
- [ ] **Step 1: Rewrite the mission**
Use this comparison statement:
```markdown
Reference Verification Agent는 Build/Test Executor Agent 통과 후 generated solver `results.h5`와 Abaqus reference CSV files를 tolerance 기준으로 비교한다. Reference CSV는 동일한 Abaqus `.inp` 모델을 Abaqus로 해석해 추출한 변위, 반력, 내력, 응력 결과이며, FESA HDF5 dataset에서 파생된 파일이 아니다.
```
- [ ] **Step 2: Update artifact check**
Artifact check must require:
```markdown
- `metadata.json`
- `model.inp`
- generated solver `results.h5`
- `reference/<model-id>/<model-id>_displacements.csv`
- `reference/<model-id>/<model-id>_reactions.csv`
- `reference/<model-id>/<model-id>_internalforces.csv`
- `reference/<model-id>/<model-id>_stresses.csv`
- reference CSV schema version
- FESA HDF5 schema version
- units
- coordinate system
- step/frame identity
- node/element ID matching rule
- output location
- component naming
- tolerance policy
```
- [ ] **Step 3: Update comparison targets**
Replace authoritative HDF5-vs-HDF5 rows with:
```markdown
| quantity | fesa_hdf5_dataset | reference_csv |
| --- | --- | --- |
| displacement | /steps/<step>/frames/<frame>/field_outputs/U | reference/<model-id>/<model-id>_displacements.csv |
| reaction | /steps/<step>/frames/<frame>/field_outputs/RF | reference/<model-id>/<model-id>_reactions.csv |
| internal force | /steps/<step>/frames/<frame>/field_outputs/element_forces | reference/<model-id>/<model-id>_internalforces.csv |
| stress | /steps/<step>/frames/<frame>/field_outputs/S | reference/<model-id>/<model-id>_stresses.csv |
```
- [ ] **Step 4: Update report template**
Change `Artifact Inventory` rows to:
```markdown
| item | path | status | notes |
| --- | --- | --- | --- |
| reference_model_dir | reference/<model-id>/ | present | missing | <notes> |
| reference_input | reference/<model-id>/model.inp | present | missing | <input summary> |
| metadata | reference/<model-id>/metadata.json | present | missing | <provenance summary> |
| reference_displacements_csv | reference/<model-id>/<model-id>_displacements.csv | present | missing | <row/schema summary> |
| reference_reactions_csv | reference/<model-id>/<model-id>_reactions.csv | present | missing | <row/schema summary> |
| reference_internalforces_csv | reference/<model-id>/<model-id>_internalforces.csv | present | missing | <row/schema summary> |
| reference_stresses_csv | reference/<model-id>/<model-id>_stresses.csv | present | missing | <row/schema summary> |
| solver_hdf5 | <solver output directory>/results.h5 | present | missing | <schema summary> |
| solver_debug_csv_view | <solver output directory>/csv/ | present | missing | <optional, derived from results.h5 only> |
```
Change `Quantity Results` columns to:
```markdown
| quantity | model_id | fesa_hdf5_dataset | reference_csv | compared_rows | missing_rows | extra_rows | max_abs_error | max_rel_error | rms_error | norm_error | worst_id | worst_component | result |
```
- [ ] **Step 5: Update skill and UI metadata prompts**
Set `.codex/skills/fesa-reference-comparison/agents/openai.yaml` default prompt to:
```yaml
default_prompt: "Use $fesa-reference-comparison to compare FESA solver results.h5 against Abaqus reference CSV files."
```
The skill `description` should include:
```text
FESA solver HDF5 results against Abaqus reference CSV files
```
- [ ] **Step 6: Verify Task 4 tests**
Run:
```powershell
python -m unittest scripts.test_reference_verification_agent_config scripts.test_fesa_solver_skills -v
```
Expected: PASS.
Commit:
```powershell
git add docs/reference-verifications/README.md .codex/skills/fesa-reference-comparison/SKILL.md .codex/skills/fesa-reference-comparison/agents/openai.yaml .codex/agents/reference-verification-agent.toml
git commit -m "docs: compare solver HDF5 with Abaqus reference CSV"
```
### Task 5: Update Upstream and Downstream Workflow Docs
**Files:**
- Modify: `docs/SOLVER_AGENT_DESIGN.md`
- Modify: `docs/SOLVER_SKILL_DESIGN.md`
- Modify: `docs/io-definitions/README.md`
- Modify: `docs/implementation-plans/README.md`
- Modify: `docs/physics-evaluations/README.md`
- Modify: `docs/requirements/README.md`
- Modify: `.codex/skills/fesa-io-contract/SKILL.md`
- Modify: `.codex/skills/fesa-physics-sanity/SKILL.md`
- Modify: `.codex/skills/fesa-cpp-msvc-tdd/SKILL.md`
- Modify: `.codex/skills/fesa-release-readiness/SKILL.md`
- Modify: `.codex/skills/fesa-requirements-baseline/SKILL.md`
- Modify: `.codex/agents/io-definition-agent.toml`
- Modify: `.codex/agents/implementation-planning-agent.toml`
- Modify: `.codex/agents/implementation-agent.toml`
- Modify: `.codex/agents/physics-evaluation-agent.toml`
- Modify: `.codex/agents/release-agent.toml`
- Modify: `.codex/agents/requirement-agent.toml`
- Modify: `.codex/agents/coordinator-agent.toml`
- [ ] **Step 1: Update I/O contract wording**
Keep FESA `results.h5` authoritative. Reframe CSV schema sections as comparison row schema, not reference HDF5-derived view:
```markdown
## FESA HDF5 to Reference CSV Comparison Schema
FESA solver output is `results.h5`. Comparison tooling reads required HDF5 datasets and maps them to deterministic row records that can be matched against Abaqus reference CSV files under `reference/<model-id>/`.
```
Use `reference_csv_schema_version` for reference CSV contracts and `hdf5_schema_version` for FESA output contracts.
- [ ] **Step 2: Update implementation planning data flow**
Change data-flow contract to:
```markdown
1. Abaqus `.inp` input follows docs/io-definitions/<feature-id>-io.md.
2. Parser/I/O path maps model data and history data into the internal semantic model.
3. Solver path produces authoritative `results.h5` with displacement, reaction, internal force, stress, or feature-specific result datasets.
4. Reference artifacts are Abaqus-generated CSV files under `reference/<model-id>/`.
5. Reference comparison tests compare FESA `results.h5` rows against `reference/<model-id>/<model-id>_*.csv` rows.
```
- [ ] **Step 3: Update physics evidence inventory**
Change physics evidence references from solver/reference HDF5 to:
```markdown
- checked solver HDF5 file: `<solver output directory>/results.h5`
- checked Abaqus reference CSV files under `reference/<model-id>/`
- optional FESA deterministic CSV view derived from `results.h5` for review only
```
Artifact inventory should not include `reference_hdf5`.
- [ ] **Step 4: Update global agent/skill boundary text**
Replace stale boundary sentences with:
```text
Do not generate or modify Abaqus reference CSV files.
```
For agents that mention deterministic CSV views derived from FESA HDF5, use:
```text
Do not treat FESA debug CSV views as authoritative solver output or reference artifacts.
```
Only add the second sentence where the agent actually discusses debug/exported FESA CSV views.
- [ ] **Step 5: Verify upstream/downstream tests**
Run:
```powershell
python -m unittest scripts.test_io_definition_agent_config scripts.test_implementation_planning_agent_config scripts.test_physics_evaluation_agent_config scripts.test_requirement_agent_config scripts.test_release_agent_config -v
```
Expected: PASS.
Commit:
```powershell
git add docs/SOLVER_AGENT_DESIGN.md docs/SOLVER_SKILL_DESIGN.md docs/io-definitions/README.md docs/implementation-plans/README.md docs/physics-evaluations/README.md docs/requirements/README.md .codex/skills/fesa-io-contract/SKILL.md .codex/skills/fesa-physics-sanity/SKILL.md .codex/skills/fesa-cpp-msvc-tdd/SKILL.md .codex/skills/fesa-release-readiness/SKILL.md .codex/skills/fesa-requirements-baseline/SKILL.md .codex/agents/io-definition-agent.toml .codex/agents/implementation-planning-agent.toml .codex/agents/implementation-agent.toml .codex/agents/physics-evaluation-agent.toml .codex/agents/release-agent.toml .codex/agents/requirement-agent.toml .codex/agents/coordinator-agent.toml
git commit -m "docs: align workflow agents with reference CSV artifacts"
```
### Task 6: Add Stale Contract Guard
**Files:**
- Modify: `scripts/test_fesa_solver_skills.py`
- [ ] **Step 1: Add a stale phrase scanner for active contract files**
Add this test to `scripts/test_fesa_solver_skills.py`:
```python
ACTIVE_CONTRACT_FILES = (
ROOT / "AGENTS.md",
ROOT / "docs" / "ProjectInitialPlanNote.md",
ROOT / "docs" / "PRD.md",
ROOT / "docs" / "ARCHITECTURE.md",
ROOT / "docs" / "ADR.md",
ROOT / "docs" / "SOLVER_AGENT_DESIGN.md",
ROOT / "docs" / "SOLVER_SKILL_DESIGN.md",
ROOT / "docs" / "reference-models" / "README.md",
ROOT / "docs" / "reference-verifications" / "README.md",
ROOT / "docs" / "io-definitions" / "README.md",
ROOT / "docs" / "implementation-plans" / "README.md",
ROOT / "docs" / "physics-evaluations" / "README.md",
ROOT / "docs" / "requirements" / "README.md",
ROOT / ".codex" / "agents" / "reference-model-agent.toml",
ROOT / ".codex" / "agents" / "reference-verification-agent.toml",
ROOT / ".codex" / "agents" / "io-definition-agent.toml",
ROOT / ".codex" / "agents" / "implementation-planning-agent.toml",
ROOT / ".codex" / "agents" / "implementation-agent.toml",
ROOT / ".codex" / "agents" / "physics-evaluation-agent.toml",
ROOT / ".codex" / "agents" / "release-agent.toml",
ROOT / ".codex" / "agents" / "requirement-agent.toml",
ROOT / ".codex" / "agents" / "coordinator-agent.toml",
ROOT / ".codex" / "skills" / "fesa-reference-models" / "SKILL.md",
ROOT / ".codex" / "skills" / "fesa-reference-comparison" / "SKILL.md",
ROOT / ".codex" / "skills" / "fesa-io-contract" / "SKILL.md",
ROOT / ".codex" / "skills" / "fesa-physics-sanity" / "SKILL.md",
ROOT / ".codex" / "skills" / "fesa-cpp-msvc-tdd" / "SKILL.md",
ROOT / ".codex" / "skills" / "fesa-release-readiness" / "SKILL.md",
ROOT / ".codex" / "skills" / "fesa-requirements-baseline" / "SKILL.md",
)
STALE_REFERENCE_CONTRACT_PHRASES = (
"reference.h5",
"stored reference HDF5",
"reference HDF5 artifact",
"results.h5 and reference.h5",
"results.h5` and `reference.h5",
"derived from reference.h5",
"references/<feature-id>/<model-id>/",
)
def test_active_contracts_do_not_require_reference_hdf5(self):
for path in ACTIVE_CONTRACT_FILES:
with self.subTest(path=str(path.relative_to(ROOT))):
text = path.read_text(encoding="utf-8")
for stale_phrase in STALE_REFERENCE_CONTRACT_PHRASES:
self.assertNotIn(stale_phrase, text)
```
This intentionally excludes `docs/superpowers/plans/` so old implementation plans remain historical records.
- [ ] **Step 2: Verify stale guard catches active contract drift**
Run:
```powershell
python -m unittest scripts.test_fesa_solver_skills.FesaSolverSkillTests.test_active_contracts_do_not_require_reference_hdf5 -v
```
Expected: PASS.
Commit:
```powershell
git add scripts/test_fesa_solver_skills.py
git commit -m "test: guard against reference HDF5 contract drift"
```
### Task 7: Full Verification
**Files:**
- No new edits expected.
- [ ] **Step 1: Run all Python contract tests**
Run:
```powershell
python -m unittest discover -s scripts -p "test_*.py"
```
Expected: PASS.
- [ ] **Step 2: Run workspace validation**
Run:
```powershell
python scripts/validate_workspace.py
```
Expected: exit code 0. If no C++ targets exist, the current acceptable message is:
```text
No C++ validation commands configured.
Add CMakeLists.txt or set HARNESS_VALIDATION_COMMANDS.
```
- [ ] **Step 3: Run manual stale-text audit across active files**
Run:
```powershell
rg -n "reference\.h5|stored reference HDF5|reference HDF5 artifact|results\.h5.*reference\.h5|derived from reference\.h5|references/<feature-id>/<model-id>/" AGENTS.md docs .codex scripts
```
Expected:
- No matches in active docs, active skills, active agents, or tests.
- Matches are acceptable only in `docs/superpowers/plans/` historical plan files if they document old work.
- [ ] **Step 4: Review final diff**
Run:
```powershell
git diff --stat
git diff --check
```
Expected: no whitespace errors. Review that every changed file traces to replacing the old `reference.h5`/reference-HDF5 premise with FESA-HDF5-to-Abaqus-reference-CSV comparison.
Commit:
```powershell
git add AGENTS.md docs .codex scripts
git commit -m "docs: finalize reference CSV comparison contract"
```
## Completion Criteria
- Active contracts say FESA solver output is HDF5 `results.h5`.
- Active contracts say Abaqus reference output is CSV under `reference/<model-id>/`.
- Active contracts compare FESA HDF5 directly with reference CSV files for displacement, reaction, internal force, and stress.
- Active contracts state the reference CSVs come from Abaqus solving the same Abaqus `.inp` model used by FESA.
- `reference.h5` is not required anywhere in active docs, skills, agents, or contract tests.
- Python tests and workspace validation pass.
+168 -23
View File
@@ -8,8 +8,10 @@ Usage:
import argparse
import contextlib
import fnmatch
import json
import os
import re
import subprocess
import sys
import threading
@@ -54,6 +56,10 @@ class StepExecutor:
"""Phase 디렉토리 안의 step들을 순차 실행하는 하네스."""
MAX_RETRIES = 3
VALIDATION_COMMANDS = (
[sys.executable, "-m", "unittest", "discover", "-s", "scripts", "-p", "test_*.py"],
[sys.executable, "scripts/validate_workspace.py"],
)
FEAT_MSG = "feat({phase}): step {num}{name}"
CHORE_MSG = "chore({phase}): step {num} output"
TZ = timezone(timedelta(hours=9))
@@ -83,6 +89,7 @@ class StepExecutor:
def run(self):
self._print_header()
self._check_blockers()
self._assert_clean_worktree("before branch checkout")
self._checkout_branch()
guardrails = self._load_guardrails()
self._ensure_created_at()
@@ -110,8 +117,117 @@ class StepExecutor:
cmd = ["git"] + list(args)
return subprocess.run(cmd, cwd=self._root, capture_output=True, text=True)
def _validate_before_commit(self, commit_message: str):
print(f" Validation before commit: {commit_message}")
for cmd in self.VALIDATION_COMMANDS:
r = subprocess.run(cmd, cwd=self._root, capture_output=True, text=True)
if r.returncode != 0:
print(f" ERROR: validation failed before commit: {' '.join(cmd)}")
if r.stdout:
print(r.stdout[-2000:])
if r.stderr:
print(r.stderr[-2000:])
sys.exit(1)
def _branch_name(self) -> str:
slug = re.sub(r"[^A-Za-z0-9._-]+", "-", self._phase_name.strip())
slug = slug.strip("/.-")
if not slug:
slug = self._phase_dir_name
return f"codex/{slug}"
def _assert_clean_worktree(self, context: str):
r = self._run_git("status", "--porcelain")
if r.returncode != 0:
print(" ERROR: git status failed.")
print(f" {r.stderr.strip()}")
sys.exit(1)
dirty = r.stdout.strip()
if dirty:
print(f" ERROR: dirty worktree detected {context}.")
print(" Commit, stash, or remove these changes before running scripts/execute.py:")
for line in dirty.splitlines():
print(f" {line}")
sys.exit(1)
@staticmethod
def _normalize_rel_path(path: str) -> str:
return path.replace("\\", "/").lstrip("./")
def _path_allowed(self, path: str, patterns: list[str]) -> bool:
rel = self._normalize_rel_path(path)
for raw in patterns:
pattern = self._normalize_rel_path(str(raw))
if not pattern:
continue
if pattern.endswith("/") and rel.startswith(pattern):
return True
if any(ch in pattern for ch in "*?[") and fnmatch.fnmatchcase(rel, pattern):
return True
if rel == pattern:
return True
return False
def _validate_step_allowlist(self, step: dict):
allowed = step.get("allowed_paths")
if (
not isinstance(allowed, list)
or not allowed
or not all(isinstance(p, str) and p.strip() for p in allowed)
):
print(f" ERROR: Step {step.get('step')} must define non-empty allowed_paths.")
sys.exit(1)
def _changed_paths(self) -> list[str]:
paths: list[str] = []
tracked = self._run_git("diff", "--name-only")
if tracked.returncode != 0:
print(" ERROR: git diff --name-only failed.")
print(f" {tracked.stderr.strip()}")
sys.exit(1)
paths.extend(tracked.stdout.splitlines())
staged = self._run_git("diff", "--cached", "--name-only")
if staged.returncode != 0:
print(" ERROR: git diff --cached --name-only failed.")
print(f" {staged.stderr.strip()}")
sys.exit(1)
paths.extend(staged.stdout.splitlines())
untracked = self._run_git("ls-files", "--others", "--exclude-standard")
if untracked.returncode != 0:
print(" ERROR: git ls-files --others failed.")
print(f" {untracked.stderr.strip()}")
sys.exit(1)
paths.extend(untracked.stdout.splitlines())
return sorted({self._normalize_rel_path(p) for p in paths if p.strip()})
def _housekeeping_paths(self, step_num: int) -> set[str]:
return {
f"phases/{self._phase_dir_name}/index.json",
f"phases/{self._phase_dir_name}/step{step_num}-output.json",
"phases/index.json",
}
def _classify_step_changes(self, step_num: int, step: dict, changed_paths: list[str]) -> tuple[list[str], list[str], list[str]]:
allowed_patterns = step.get("allowed_paths", [])
housekeeping_set = self._housekeeping_paths(step_num)
allowed: list[str] = []
housekeeping: list[str] = []
disallowed: list[str] = []
for path in changed_paths:
rel = self._normalize_rel_path(path)
if rel in housekeeping_set:
housekeeping.append(rel)
elif self._path_allowed(rel, allowed_patterns):
allowed.append(rel)
else:
disallowed.append(rel)
return allowed, housekeeping, disallowed
def _checkout_branch(self):
branch = f"feat-{self._phase_name}"
branch = self._branch_name()
r = self._run_git("rev-parse", "--abbrev-ref", "HEAD")
if r.returncode != 0:
@@ -133,28 +249,45 @@ class StepExecutor:
print(f" Branch: {branch}")
def _commit_step(self, step_num: int, step_name: str):
output_rel = f"phases/{self._phase_dir_name}/step{step_num}-output.json"
index_rel = f"phases/{self._phase_dir_name}/index.json"
def _stage_paths(self, paths: list[str]):
if not paths:
return
r = self._run_git("add", "--", *paths)
if r.returncode != 0:
print(" ERROR: git add failed.")
print(f" {r.stderr.strip()}")
sys.exit(1)
self._run_git("add", "-A")
self._run_git("reset", "HEAD", "--", output_rel)
self._run_git("reset", "HEAD", "--", index_rel)
def _commit_step(self, step: dict, step_name: str):
step_num = step["step"]
changed = self._changed_paths()
allowed, housekeeping, disallowed = self._classify_step_changes(step_num, step, changed)
if disallowed:
print(f" ERROR: Step {step_num} modified files outside allowed_paths:")
for path in disallowed:
print(f" {path}")
sys.exit(1)
if self._run_git("diff", "--cached", "--quiet").returncode != 0:
if allowed:
msg = self.FEAT_MSG.format(phase=self._phase_name, num=step_num, name=step_name)
r = self._run_git("commit", "-m", msg)
if r.returncode == 0:
self._validate_before_commit(msg)
self._stage_paths(allowed)
if self._run_git("diff", "--cached", "--quiet").returncode != 0:
r = self._run_git("commit", "-m", msg)
if r.returncode != 0:
print(f" ERROR: code commit failed: {r.stderr.strip()}")
sys.exit(1)
print(f" Commit: {msg}")
else:
print(f" WARN: 코드 커밋 실패: {r.stderr.strip()}")
self._run_git("add", "-A")
if self._run_git("diff", "--cached", "--quiet").returncode != 0:
if housekeeping:
msg = self.CHORE_MSG.format(phase=self._phase_name, num=step_num)
r = self._run_git("commit", "-m", msg)
if r.returncode != 0:
print(f" WARN: housekeeping 커밋 실패: {r.stderr.strip()}")
self._validate_before_commit(msg)
self._stage_paths(housekeeping)
if self._run_git("diff", "--cached", "--quiet").returncode != 0:
r = self._run_git("commit", "-m", msg)
if r.returncode != 0:
print(f" ERROR: housekeeping commit failed: {r.stderr.strip()}")
sys.exit(1)
# --- top-level index ---
@@ -197,6 +330,7 @@ class StepExecutor:
return "## 이전 Step 산출물\n\n" + "\n".join(lines) + "\n\n"
def _build_preamble(self, guardrails: str, step_context: str,
allowed_paths: list[str],
prev_error: Optional[str] = None) -> str:
commit_example = self.FEAT_MSG.format(
phase=self._phase_name, num="N", name="<step-name>"
@@ -211,6 +345,9 @@ class StepExecutor:
f"당신은 {self._project} 프로젝트의 개발자입니다. 아래 step을 수행하세요.\n\n"
f"{guardrails}\n\n---\n\n"
f"{step_context}{retry_section}"
f"## Step file allowlist\n\n"
f"This step may modify only these repository-relative paths:\n"
f"{chr(10).join(f'- {p}' for p in allowed_paths)}\n\n"
f"## 작업 규칙\n\n"
f"1. 이전 step에서 작성된 코드를 확인하고 일관성을 유지하라.\n"
f"2. 이 step에 명시된 작업만 수행하라. 추가 기능이나 파일을 만들지 마라.\n"
@@ -299,7 +436,7 @@ class StepExecutor:
for attempt in range(1, self.MAX_RETRIES + 1):
index = self._read_json(self._index_file)
step_context = self._build_step_context(index)
preamble = self._build_preamble(guardrails, step_context, prev_error)
preamble = self._build_preamble(guardrails, step_context, step.get("allowed_paths", []), prev_error)
tag = f"Step {step_num}/{self._total - 1} ({done} done): {step_name}"
if attempt > 1:
@@ -318,7 +455,7 @@ class StepExecutor:
if s["step"] == step_num:
s["completed_at"] = ts
self._write_json(self._index_file, index)
self._commit_step(step_num, step_name)
self._commit_step(step, step_name)
print(f" ✓ Step {step_num}: {step_name} [{elapsed}s]")
return True
@@ -353,7 +490,7 @@ class StepExecutor:
s["error_message"] = f"[{self.MAX_RETRIES}회 시도 후 실패] {err_msg}"
s["failed_at"] = ts
self._write_json(self._index_file, index)
self._commit_step(step_num, step_name)
self._commit_step(step, step_name)
print(f" ✗ Step {step_num}: {step_name} failed after {self.MAX_RETRIES} attempts [{elapsed}s]")
print(f" Error: {err_msg}")
self._update_top_index("error")
@@ -369,6 +506,7 @@ class StepExecutor:
print("\n All steps completed!")
return
self._validate_step_allowlist(pending)
step_num = pending["step"]
for s in index["steps"]:
if s["step"] == step_num and "started_at" not in s:
@@ -384,15 +522,22 @@ class StepExecutor:
self._write_json(self._index_file, index)
self._update_top_index("completed")
self._run_git("add", "-A")
final_paths = [f"phases/{self._phase_dir_name}/index.json"]
if self._top_index_file.exists():
final_paths.append("phases/index.json")
self._validate_before_commit(f"chore({self._phase_name}): mark phase completed")
self._stage_paths(final_paths)
if self._run_git("diff", "--cached", "--quiet").returncode != 0:
msg = f"chore({self._phase_name}): mark phase completed"
r = self._run_git("commit", "-m", msg)
if r.returncode == 0:
if r.returncode != 0:
print(f" ERROR: phase completion commit failed: {r.stderr.strip()}")
sys.exit(1)
else:
print(f"{msg}")
if self._auto_push:
branch = f"feat-{self._phase_name}"
branch = self._branch_name()
r = self._run_git("push", "-u", "origin", branch)
if r.returncode != 0:
print(f"\n ERROR: git push 실패: {r.stderr.strip()}")
@@ -30,7 +30,7 @@ class BuildTestExecutorAgentConfigTests(unittest.TestCase):
"Do not edit tests.",
"Do not edit CMake.",
"Do not run Abaqus, Nastran, or any reference solver.",
"Do not generate reference CSVs.",
"Do not generate reference HDF5 files or deterministic CSV views.",
"Do not approve release readiness.",
):
self.assertIn(required_text, instructions)
+1 -1
View File
@@ -32,7 +32,7 @@ class CoordinatorAgentConfigTests(unittest.TestCase):
"Do not edit CMake.",
"Do not run build/test validation.",
"Do not run Abaqus, Nastran, or any reference solver.",
"Do not generate reference CSVs.",
"Do not generate reference HDF5 files or deterministic CSV views.",
"Do not automatically spawn subagents.",
"Do not approve release readiness independently.",
):
+1 -1
View File
@@ -32,7 +32,7 @@ class CorrectionAgentConfigTests(unittest.TestCase):
"Do not change reference artifacts",
"Do not change tolerance policies",
"Do not run Abaqus, Nastran, or any reference solver.",
"Do not generate reference CSVs.",
"Do not generate reference HDF5 files or deterministic CSV views.",
"Do not approve release readiness.",
):
self.assertIn(required_text, instructions)
+286
View File
@@ -0,0 +1,286 @@
import importlib.util
import json
import subprocess
import sys
import tempfile
import unittest
from pathlib import Path
from unittest.mock import patch
def load_execute():
module_path = Path(__file__).resolve().parent / "execute.py"
spec = importlib.util.spec_from_file_location("execute", module_path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return module
def write_phase(root: Path, phase_dir: str = "0-mvp", phase_name: str = "0-mvp", steps=None):
phase_path = root / "phases" / phase_dir
phase_path.mkdir(parents=True)
if steps is None:
steps = [
{
"step": 1,
"name": "Docs",
"status": "pending",
"summary": "",
"allowed_paths": ["docs/*.md"],
}
]
(phase_path / "index.json").write_text(
json.dumps({"project": "FESA", "phase": phase_name, "steps": steps}, indent=2),
encoding="utf-8",
)
(phase_path / "step1.md").write_text("# Step 1\n", encoding="utf-8")
return phase_path
def make_executor(execute, root: Path, phase_dir: str = "0-mvp"):
with patch.object(execute, "ROOT", root):
return execute.StepExecutor(phase_dir)
class ExecuteRunnerSafetyTests(unittest.TestCase):
def test_scaffold_loads_execute_module(self):
execute = load_execute()
self.assertTrue(hasattr(execute, "StepExecutor"))
def test_branch_name_uses_codex_prefix_and_sanitized_phase(self):
execute = load_execute()
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
write_phase(root, phase_name="linear truss/1d")
executor = make_executor(execute, root)
self.assertEqual(executor._branch_name(), "codex/linear-truss-1d")
def test_finalize_push_uses_codex_branch_name(self):
execute = load_execute()
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
write_phase(root, phase_name="0-mvp")
executor = make_executor(execute, root)
executor._auto_push = True
calls = []
def fake_git(*args):
calls.append(args)
if args == ("diff", "--cached", "--quiet"):
return subprocess.CompletedProcess(args, 0, "", "")
return subprocess.CompletedProcess(args, 0, "", "")
with patch.object(executor, "_run_git", side_effect=fake_git):
with patch.object(executor, "_validate_before_commit", create=True):
with patch("builtins.print"):
executor._finalize()
self.assertIn(("push", "-u", "origin", "codex/0-mvp"), calls)
def test_finalize_stages_only_phase_indexes(self):
execute = load_execute()
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
write_phase(root)
(root / "phases" / "index.json").write_text('{"phases":[]}', encoding="utf-8")
executor = make_executor(execute, root)
calls = []
def fake_git(*args):
calls.append(args)
if args == ("diff", "--cached", "--quiet"):
return subprocess.CompletedProcess(args, 1, "", "")
return subprocess.CompletedProcess(args, 0, "", "")
with patch.object(executor, "_run_git", side_effect=fake_git):
with patch.object(executor, "_validate_before_commit"):
with patch("builtins.print"):
executor._finalize()
self.assertNotIn(("add", "-A"), calls)
self.assertIn(("add", "--", "phases/0-mvp/index.json", "phases/index.json"), calls)
def test_assert_clean_worktree_exits_when_git_status_has_changes(self):
execute = load_execute()
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
write_phase(root)
executor = make_executor(execute, root)
with patch.object(
executor,
"_run_git",
return_value=subprocess.CompletedProcess([], 0, " M AGENTS.md\n?? scratch.txt\n", ""),
):
with patch("builtins.print"):
with self.assertRaises(SystemExit) as cm:
executor._assert_clean_worktree("before checkout")
self.assertEqual(cm.exception.code, 1)
def test_run_checks_clean_worktree_before_checkout(self):
execute = load_execute()
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
write_phase(root)
executor = make_executor(execute, root)
calls = []
def record(name):
def inner(*args, **kwargs):
calls.append(name)
return inner
with patch.object(executor, "_assert_clean_worktree", side_effect=record("clean")):
with patch.object(executor, "_checkout_branch", side_effect=record("checkout")):
with patch.object(executor, "_print_header"):
with patch.object(executor, "_check_blockers"):
with patch.object(executor, "_load_guardrails", return_value=""):
with patch.object(executor, "_ensure_created_at"):
with patch.object(executor, "_execute_all_steps"):
with patch.object(executor, "_finalize"):
executor.run()
self.assertLess(calls.index("clean"), calls.index("checkout"))
def test_step_allowlist_accepts_exact_prefix_and_glob_paths(self):
execute = load_execute()
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
write_phase(root)
executor = make_executor(execute, root)
patterns = ["AGENTS.md", "docs/", "scripts/*.py"]
self.assertTrue(executor._path_allowed("AGENTS.md", patterns))
self.assertTrue(executor._path_allowed("docs/PRD.md", patterns))
self.assertTrue(executor._path_allowed("scripts/execute.py", patterns))
self.assertFalse(executor._path_allowed(".codex/hooks.json", patterns))
def test_step_without_allowed_paths_is_rejected_before_codex_invocation(self):
execute = load_execute()
steps = [{"step": 1, "name": "Unsafe", "status": "pending", "summary": ""}]
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
write_phase(root, steps=steps)
executor = make_executor(execute, root)
with patch("builtins.print"):
with self.assertRaises(SystemExit) as cm:
executor._validate_step_allowlist(steps[0])
self.assertEqual(cm.exception.code, 1)
def test_classify_step_changes_splits_allowed_housekeeping_and_disallowed_paths(self):
execute = load_execute()
step = {
"step": 1,
"name": "Docs",
"status": "completed",
"summary": "",
"allowed_paths": ["docs/*.md"],
}
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
write_phase(root)
executor = make_executor(execute, root)
changed = [
"docs/PRD.md",
"phases/0-mvp/index.json",
"phases/0-mvp/step1-output.json",
"scripts/execute.py",
]
allowed, housekeeping, disallowed = executor._classify_step_changes(1, step, changed)
self.assertEqual(allowed, ["docs/PRD.md"])
self.assertEqual(housekeeping, ["phases/0-mvp/index.json", "phases/0-mvp/step1-output.json"])
self.assertEqual(disallowed, ["scripts/execute.py"])
def test_commit_step_stages_only_explicit_allowed_and_housekeeping_paths(self):
execute = load_execute()
step = {
"step": 1,
"name": "Docs",
"status": "completed",
"summary": "",
"allowed_paths": ["docs/*.md"],
}
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
write_phase(root)
executor = make_executor(execute, root)
calls = []
def fake_git(*args):
calls.append(args)
if args in {
("diff", "--quiet", "--cached", "--"),
("diff", "--cached", "--quiet"),
}:
return subprocess.CompletedProcess(args, 1, "", "")
return subprocess.CompletedProcess(args, 0, "", "")
with patch.object(
executor,
"_changed_paths",
return_value=[
"docs/PRD.md",
"phases/0-mvp/index.json",
"phases/0-mvp/step1-output.json",
],
):
with patch.object(executor, "_run_git", side_effect=fake_git):
with patch.object(executor, "_validate_before_commit", create=True):
with patch("builtins.print"):
executor._commit_step(step, "Docs")
self.assertNotIn(("add", "-A"), calls)
self.assertIn(("add", "--", "docs/PRD.md"), calls)
self.assertIn(("add", "--", "phases/0-mvp/index.json", "phases/0-mvp/step1-output.json"), calls)
def test_validate_before_commit_runs_python_selftest_then_workspace_validation(self):
execute = load_execute()
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
write_phase(root)
executor = make_executor(execute, root)
commands = []
def fake_run(cmd, **kwargs):
commands.append(cmd)
return subprocess.CompletedProcess(cmd, 0, "ok", "")
with patch.object(execute.subprocess, "run", side_effect=fake_run):
with patch("builtins.print"):
executor._validate_before_commit("feat(0-mvp): step 1")
self.assertEqual(
commands,
[
[sys.executable, "-m", "unittest", "discover", "-s", "scripts", "-p", "test_*.py"],
[sys.executable, "scripts/validate_workspace.py"],
],
)
def test_validate_before_commit_exits_before_commit_when_validation_fails(self):
execute = load_execute()
with tempfile.TemporaryDirectory() as tmp:
root = Path(tmp)
write_phase(root)
executor = make_executor(execute, root)
def fake_run(cmd, **kwargs):
return subprocess.CompletedProcess(cmd, 1, "bad", "failed")
with patch.object(execute.subprocess, "run", side_effect=fake_run):
with patch("builtins.print"):
with self.assertRaises(SystemExit) as cm:
executor._validate_before_commit("feat(0-mvp): step 1")
self.assertEqual(cm.exception.code, 1)
if __name__ == "__main__":
unittest.main()
+17 -8
View File
@@ -96,14 +96,18 @@ SKILLS = {
"Use when",
"FESA solver",
"Abaqus .inp",
"CSV schemas",
"HDF5",
"CSV view",
"I/O",
),
"body_terms": (
"docs/io-definitions/<feature-id>-io.md",
"Abaqus Input Scope",
"Internal Model Contract",
"Output and CSV Schemas",
"Output HDF5 Schema",
"Deterministic CSV View Schemas",
"results.h5",
"csv/displacements.csv",
"*NODE",
"*ELEMENT",
"*MATERIAL",
@@ -125,12 +129,13 @@ SKILLS = {
"references/<feature-id>/<model-id>/",
"model.inp",
"metadata.json",
"displacements.csv",
"reactions.csv",
"element_forces.csv",
"stresses.csv",
"reference.h5",
"csv/displacements.csv",
"csv/reactions.csv",
"csv/element_forces.csv",
"csv/stresses.csv",
"Coverage Matrix",
"Do not generate reference CSVs.",
"Do not generate reference HDF5 files or deterministic CSV views.",
),
},
"fesa-cpp-msvc-tdd": {
@@ -155,13 +160,17 @@ SKILLS = {
"description_terms": (
"Use when",
"FESA solver",
"reference CSV",
"HDF5",
"CSV view",
"tolerance",
"comparison",
),
"body_terms": (
"docs/reference-verifications/<feature-id>-reference-verification.md",
"ARTIFACT CHECK -> COMPARE -> CLASSIFY -> REPORT",
"results.h5",
"reference.h5",
"deterministic CSV view",
"max absolute error",
"max relative error",
"RMS error",
+1 -1
View File
@@ -29,7 +29,7 @@ class FormulationAgentConfigTests(unittest.TestCase):
"Do not implement code.",
"Do not design C++ APIs",
"Do not run Abaqus, Nastran, or any reference solver.",
"Do not generate reference CSVs.",
"Do not generate reference HDF5 files or deterministic CSV views.",
"Do not approve release readiness.",
"docs/SOLVER_AGENT_DESIGN.md",
"docs/requirements/<feature-id>.md",
+1 -1
View File
@@ -41,7 +41,7 @@ class ImplementationAgentConfigTests(unittest.TestCase):
for required_text in (
"Do not run Abaqus, Nastran, or any reference solver.",
"Do not generate reference CSVs.",
"Do not generate reference HDF5 files or deterministic CSV views.",
"Do not approve release readiness.",
"Do not change requirements",
"Do not change formulations",
@@ -31,7 +31,7 @@ class ImplementationPlanningAgentConfigTests(unittest.TestCase):
"Do not edit CMake.",
"Do not run CMake/CTest.",
"Do not run Abaqus, Nastran, or any reference solver.",
"Do not generate reference CSVs.",
"Do not generate reference HDF5 files or deterministic CSV views.",
"Do not compare solver results.",
"Do not approve release readiness.",
):
+7 -4
View File
@@ -29,7 +29,7 @@ class IoDefinitionAgentConfigTests(unittest.TestCase):
"Do not implement parsers.",
"Do not design C++ APIs",
"Do not run Abaqus, Nastran, or any reference solver.",
"Do not generate reference CSVs.",
"Do not generate reference HDF5 files or deterministic CSV views.",
"Do not approve release readiness.",
"Do not claim full Abaqus compatibility",
):
@@ -43,7 +43,8 @@ class IoDefinitionAgentConfigTests(unittest.TestCase):
"Abaqus input files use keyword lines, data lines, and comment lines.",
"Model data and history data",
"supported Abaqus keyword subset",
"comparison CSV schemas",
"HDF5 result schema",
"deterministic CSV view schemas",
):
self.assertIn(required_text, instructions)
@@ -56,7 +57,8 @@ class IoDefinitionAgentConfigTests(unittest.TestCase):
"Model Data Mapping",
"History Data Mapping",
"Internal Model Contract",
"Output and CSV Schemas",
"Output HDF5 Schema",
"Deterministic CSV View Schemas",
"Validation Rules",
"Downstream Handoff",
):
@@ -86,7 +88,8 @@ class IoDefinitionAgentConfigTests(unittest.TestCase):
"Model Data Mapping",
"History Data Mapping",
"Internal Model Contract",
"Output and CSV Schemas",
"Output HDF5 Schema",
"Deterministic CSV View Schemas",
"Validation Rules",
"Downstream Handoff",
"FESA 솔버의 입력 파일은 Abaqus input file이다.",
@@ -30,7 +30,7 @@ class NumericalReviewAgentConfigTests(unittest.TestCase):
"Do not edit formulations directly.",
"Do not design C++ APIs",
"Do not run Abaqus, Nastran, or any reference solver.",
"Do not generate reference CSVs.",
"Do not generate reference HDF5 files or deterministic CSV views.",
"Do not approve release readiness.",
"docs/SOLVER_AGENT_DESIGN.md",
"docs/formulations/<feature-id>-formulation.md",
@@ -30,7 +30,7 @@ class PhysicsEvaluationAgentConfigTests(unittest.TestCase):
"Do not edit tests.",
"Do not edit CMake.",
"Do not run Abaqus, Nastran, or any reference solver.",
"Do not generate reference CSVs.",
"Do not generate reference HDF5 files or deterministic CSV views.",
"Do not change tolerances.",
"Do not approve release readiness.",
):
@@ -55,6 +55,8 @@ class PhysicsEvaluationAgentConfigTests(unittest.TestCase):
instructions = AGENT_PATH.read_text(encoding="utf-8")
for required_text in (
"HDF5",
"deterministic CSV views",
"Input Evidence",
"Physics Checks",
"Failure Classification",
+8 -7
View File
@@ -30,7 +30,7 @@ class ReferenceModelAgentConfigTests(unittest.TestCase):
"Do not implement parsers.",
"Do not design C++ APIs",
"Do not run Abaqus, Nastran, or any reference solver.",
"Do not generate reference CSVs.",
"Do not generate reference HDF5 files or deterministic CSV views.",
"Do not compare solver results.",
"Do not approve release readiness.",
):
@@ -44,10 +44,11 @@ class ReferenceModelAgentConfigTests(unittest.TestCase):
"references/<feature-id>/<model-id>/",
"model.inp",
"metadata.json",
"displacements.csv",
"reactions.csv",
"element_forces.csv",
"stresses.csv",
"reference.h5",
"csv/displacements.csv",
"csv/reactions.csv",
"csv/element_forces.csv",
"csv/stresses.csv",
):
self.assertIn(required_text, instructions)
@@ -60,7 +61,7 @@ class ReferenceModelAgentConfigTests(unittest.TestCase):
"Abaqus Input Requirements",
"Artifact Bundle Contract",
"Metadata JSON Contract",
"Reference CSV Requirements",
"Reference HDF5 and CSV View Requirements",
"Coverage Matrix",
"Downstream Handoff",
):
@@ -75,7 +76,7 @@ class ReferenceModelAgentConfigTests(unittest.TestCase):
"Abaqus Input Requirements",
"Artifact Bundle Contract",
"Metadata JSON Contract",
"Reference CSV Requirements",
"Reference HDF5 and CSV View Requirements",
"Coverage Matrix",
"Downstream Handoff",
"references/<feature-id>/<model-id>/",
@@ -17,7 +17,8 @@ class ReferenceVerificationAgentConfigTests(unittest.TestCase):
data = tomllib.loads(AGENT_PATH.read_text(encoding="utf-8"))
self.assertEqual(data["name"], "reference-verification-agent")
self.assertIn("stored Abaqus reference CSV artifacts", data["description"])
self.assertIn("HDF5", data["description"])
self.assertIn("deterministic CSV views", data["description"])
self.assertEqual(data["sandbox_mode"], "workspace-write")
self.assertEqual(data["model_reasoning_effort"], "extra high")
self.assertIn("developer_instructions", data)
@@ -30,7 +31,7 @@ class ReferenceVerificationAgentConfigTests(unittest.TestCase):
"Do not edit tests.",
"Do not edit CMake.",
"Do not run Abaqus, Nastran, or any reference solver.",
"Do not generate reference CSVs.",
"Do not generate reference HDF5 files or deterministic CSV views.",
"Do not approve release readiness.",
"Do not change tolerance policies.",
):
@@ -40,10 +41,12 @@ class ReferenceVerificationAgentConfigTests(unittest.TestCase):
instructions = AGENT_PATH.read_text(encoding="utf-8")
for required_text in (
"displacements.csv",
"reactions.csv",
"element_forces.csv",
"stresses.csv",
"results.h5",
"reference.h5",
"csv/displacements.csv",
"csv/reactions.csv",
"csv/element_forces.csv",
"csv/stresses.csv",
"metadata.json",
"references/<feature-id>/<model-id>/",
):
+1 -1
View File
@@ -36,7 +36,7 @@ class ReleaseAgentConfigTests(unittest.TestCase):
"Do not change reference artifacts",
"Do not change tolerance policies",
"Do not run Abaqus, Nastran, or any reference solver.",
"Do not generate reference CSVs.",
"Do not generate reference HDF5 files or deterministic CSV views.",
"Do not override failed or missing upstream gates.",
):
self.assertIn(required_text, instructions)
+1 -1
View File
@@ -29,7 +29,7 @@ class RequirementAgentConfigTests(unittest.TestCase):
"Do not implement code.",
"Do not write finite element formulations.",
"Do not run Abaqus, Nastran, or any reference solver.",
"Do not create reference CSV outputs.",
"Do not create reference HDF5 outputs or deterministic CSV views.",
"Requirement Verification Matrix",
"docs/SOLVER_AGENT_DESIGN.md",
"references/<feature>",
+1 -1
View File
@@ -29,7 +29,7 @@ class ResearchAgentConfigTests(unittest.TestCase):
"Do not implement code.",
"Do not finalize FEM formulations.",
"Do not run Abaqus, Nastran, or any reference solver.",
"Do not generate reference CSVs.",
"Do not generate reference HDF5 files or deterministic CSV views.",
"docs/SOLVER_AGENT_DESIGN.md",
"docs/requirements/<feature-id>.md",
"Separate verified facts from inference.",