Skip to content

Fortran tri-comparison sweep: fix prism.py column-7 bug + ctags kind gaps - #2078

Merged
squid-protocol merged 1 commit into
mainfrom
tri-comparison-sweep-fortran-20260821
Aug 21, 2026
Merged

squid-protocol merged 1 commit into
mainfrom
tri-comparison-sweep-fortran-20260821

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

  • tri-comparison-ledger-sweep pass against fortran's WRF corpus (docs/self_scan/tri_comparison_ledger.json) — all 5 open discrepancy shapes investigated and validated.
  • Real GitGalaxy engine bug, fixed: prism.py's _strip_positional_comments applied COBOL's column-7 comment-indicator convention to Fortran too. Real fixed-form Fortran 77 has no column-7 comment marker (only column 1) — a 3-space-indented FUNCTION foo(...) puts the C of FUNCTION on column 7, silently erasing the whole declaration line as a bogus comment before func_start ever ran. Dropped in_use_for_config (module_configure.F:353) and first_loc_integer (module_domain.F:1693). Fixed by gating the column-7 check to cobol_mode only.
  • Two real test-tooling bugs, fixed: tests/tools/ctags_reader.py's fortran CTAGS_CLASS_KINDS was missing m/i/S/b (module/interface/submodule/blockData — ctags class recall on this corpus was 3/11, now 11/11) and CTAGS_FUNC_KINDS was missing p/e (program/entry) — both the same bug shape as the already-documented cpp/csharp kind-map gaps in that file.
  • One real GitGalaxy defect, filed not fixed: fortran args regex undercounts when a CPP-guarded parameter's #if expression contains ')' before the real signature closes #2077 — the args regex has no paren-depth awareness and undercounts a parameter list when an embedded CPP #if (...) guard's own closing paren appears before the real signature close (confirmed on a genuine 677-parameter WRF subroutine). Needs a depth-aware paren scanner, out of scope for a same-pass fix.
  • Added docs/language_status/fortran.md (sections 1-8 via the language-status skill, §9 tri-comparison written by hand) and a new evidence citation on Claim 7 in docs/why_gitgalaxy_beats_ast_here.md.
  • Both golden masters re-blessed (update_golden_master.py --yes, both modes) after a full crucible_check.py pass against the ~80-repo corpus — 134 diffs, 100% traced to fortran/wrf's recovered functions and their expected downstream ripple (global aggregates, topological coordinates, one cobol file's relative-risk percentage shifting 0.01pp from a corpus-wide denominator).

Test plan

  • tests/extraction/languages/test_fortran.py + test_fortran_strict.py + test_cobol.py + test_cobol_strict.py — 280 passed
  • tests/core_engine/test_prism.py + test_detector.py — 182 passed
  • python tests/ruff_audit.py --ci — no new findings
  • python tests/mypy_audit.py --ci — no new findings
  • python tests/tools/crucible_check.py — clean (0 diffs) after re-blessing both golden masters
  • python tests/tools/tri_comparison_chart.py --all --write — diff scoped to fortran's row + expected global-summary ripple only

🤖 Generated with Claude Code

tri-comparison-ledger-sweep pass against fortran's WRF corpus, all 5 open
ledger shapes validated:

- prism.py's _strip_positional_comments applied COBOL's column-7 indicator
  check to Fortran too. Real fixed-form Fortran 77 has no column-7 comment
  convention (only column 1), so a 3-space-indented `   FUNCTION foo(...)`
  had its whole declaration line erased as a bogus comment (the 'C' in
  FUNCTION lands on column 7). Silently dropped in_use_for_config
  (module_configure.F:353) and first_loc_integer (module_domain.F:1693).
  Gated the check to cobol_mode only.
- ctags_reader.py's CTAGS_CLASS_KINDS['fortran'] was missing 'm'/'i'/'S'/'b'
  (module/interface/submodule/blockData), same bug shape as the already-
  documented cpp/csharp gaps -- ctags class recall on this corpus jumped
  from 3/11 to 11/11.
- ctags_reader.py's CTAGS_FUNC_KINDS['fortran'] was missing 'p'/'e'
  (program/entry), matching GitGalaxy's own func_start scope.

Filed #2077 for a separate, still-open args-counting defect (the args regex
undercounts a parameter list when an embedded CPP #if guard's own ')'
appears before the real signature close) -- needs a depth-aware paren
scanner, left for its own follow-up.

Both golden masters re-blessed after a full crucible_check.py pass against
the ~80-repo corpus (134 diffs, all traced to fortran/wrf's recovered
functions plus expected downstream ripple). Added docs/language_status/
fortran.md and a new Claim 7 citation in why_gitgalaxy_beats_ast_here.md.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@squid-protocol
squid-protocol merged commit 3c19f55 into main Aug 21, 2026
26 of 27 checks passed
@squid-protocol
squid-protocol deleted the tri-comparison-sweep-fortran-20260821 branch August 21, 2026 23:41
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant