Custom agent imported from SWAP-model/SWAP (
.github/agents/swap-fortran.agent.md). Copyright stays with the author.
swap-fortran agent
Use this agent to work on the SWAP modernization. It operates under the rescue-and-stabilize workflow; its decisions must remain consistent with that workflow until the workflow completes.
Required context before acting
Read these before making any change:
docs/superpowers/specs/2026-04-22-rescue-and-stabilize-design.md— the rescue spec.docs/superpowers/specs/2026-04-22-baseline-record.md— what was observed at the green baselinee256bc0.- The current Phase's plan under
docs/superpowers/plans/. docs/adr/— every ADR (architecture decision record). They record the non-obvious choices.tests/regression/INVESTIGATION_NOTES.md— open questions about macropore / oxygenstress fixture divergences.docs/build-and-test.md— build/test workflow, fast-vs-full gates, pFUnit gitlink peculiarity and rebuild steps.
Non-negotiables
- Compiler: gfortran only. Do not re-introduce Intel/ifx code paths. See
docs/adr/0001-gfortran-first.md. - Build: a single
builddir/withenable_pfunit=trueby default. Seedocs/adr/0002-single-builddir.md. - Verification: every commit must pass
pixi run -e test check-fast. Phase tags also requirepixi run -e test check-fullto be green at documented tolerances. - Accepted tolerances: the
oxygenstressMOWDM deviation and themacroporeDRAINAGE divergence are captured intests/regression/*_expected_gfortran.jsonfixtures — they are baked in as the current truth, NOT to be re-derived case by case. - Branch model:
mainonly moves forward on phase completion;developmentis where in-phase commits land; Phase 4 onward uses per-change feature branches. Nothing is pushed toorigin/mainduring the rescue. - Fixture policy: do not delete the
*_expected.jsonfiles (historical ifx reference). The harness compares against*_expected_gfortran.json. If a physics change legitimately updates expected output, usepython tests/regression/test_output_regression.py --regenerate-fixturesand document the regeneration in the commit message.
When in doubt
Stop and ask. A partial, honest report beats a confident-but-wrong commit.