Repository navigation
Description
What
Found while regenerating fortran's tree_sitter_accuracy_audit.py baseline after #1526's
per-occurrence line-based pairing (which requires function_data.start_line to be accurate to
correctly identify which occurrence of a repeated name a row corresponds to).
language-crucible/data/fortran/wrf/module_initialize_real.F has exactly one real definition of
wrf_message:
5580: subroutine wrf_message(level,message)
5581: character(len=*), intent(in) :: message
5582: integer, intent(in) :: level
5583: print *,trim(message)
5584: end subroutine wrf_messagetree-sitter-fortran correctly resolves this at line 5580 with 2 real params. GitGalaxy's own
function_data row for wrf_message in this file reports start_line=5208 — not close to any
CALL wrf_message(...) site either (the nearest is a wrf_error_fatal call at line 5157, ~50
lines further off, and no wrf_message reference sits anywhere near 5208). Also measured
args=1 against the real 2. A second case in the same file, const_module_initialize, shows a
smaller but still real discrepancy (GitGalaxy start_line=4645 vs. the real SUBROUTINE const_module_initialize at line 4951, a ~306-line gap; args similarly wrong, 1 vs. the real 6).
Why this matters beyond just being "a line number"
This isn't just cosmetic: since args is also wrong in both cases, this reads like func_start's
window for these two subroutines is anchoring somewhere other than the real declaration -- the
same kind of "regex found the name but grabbed the wrong span" shape as some of the C-family
func_start/args bugs fixed under epic #813, not a mere line-count arithmetic slip. Given
WRF is heavily CPP-preprocessed and already flagged in tests/tools/tree_sitter_accuracy_audit.py
(NODE_MAPS["fortran"]'s own comment) as a corpus where tree-sitter-fortran itself falls back to
ERROR node recovery, it's plausible GitGalaxy's fortran-mode extraction has a related fragility
on this same preprocessor-heavy style, but that's a hypothesis, not confirmed -- needs real
detector.py fortran-path debugging to root-cause, not further guessing from the corpus alone.
Scope
Deliberately not chased further in #1526/#1527's PR -- that PR's scope is the audit tool's
occurrence-pairing methodology (which persists start_line and uses it, but doesn't generate it);
this is a detector.py fortran-extraction correctness question, a different kind of fix with its
own blast radius (would need the Differential Scan protocol per CLAUDE.md if it turns out to be
a real func_start bug, not just line-counting).
Activity
fix(tests): pair same-named function occurrences by line instead of c…
fix(fortran): func_start could phantom-match across a subroutine's ow…
docs(skill): record pool-of-5 round-3 gotchas -- watch-exit vs merge-…