Skip to content

fix(perl): strip POD documentation blocks before structural scanning - #2253

Merged
squid-protocol merged 9 commits into
mainfrom
fix/perl-2239-pod-strip
Aug 26, 2026
Merged

squid-protocol merged 9 commits into
mainfrom
fix/perl-2239-pod-strip

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

Fixes #2239. GitGalaxy had zero POD-block awareness for perl -- =head1/=cut-delimited documentation blocks were never stripped from the code stream before func_start ran, so a literal sub name { ... } code example written as prose inside a POD block (e.g. a SYNOPSIS section) was matched as a real function.

This is the false-positive mirror of #1606 (which fixed a POD apostrophe corrupting the brace-shield) -- #1606 explicitly left this symptom as a known, deferred gap; this closes it.

Fix

Blanks POD block content (=pod/=head[1-6]/=item/=over/=back/=cut/=begin/=end/=encoding/=for through the matching =cut, or to EOF if unterminated) using the same blank() helper and marker set the existing "doc" rule already recognizes, inserted before the pre-existing #1437 quote-operator shielding.

Evidence

  • language-crucible/data/perl/mojo/Promise.pm: get_p (a code example inside the SYNOPSIS POD block) no longer matched as a function; all 36 real functions in the file still are (37 -> 36 total, the false positive removed).
  • Corpus-wide: the perl tree-sitter accuracy baseline's extra_functions dropped from 1 to 0 across all 22 files / 941 functions scanned -- confirming get_p was the only false positive.

Verification

  • pytest tests/extraction/languages/test_perl.py -q -- 38 passed (1 new regression test covering the repro, normal subs outside POD, and a sub legitimately using = as an operator)
  • audit_check.py --ci -- clean
  • crucible_check.py --mode both -- drift confined to perl/mojo (function count/magnitude, attributable to the fix) plus expected global coordinate ripple, blessed
  • tree_sitter_accuracy_audit.py --all --ci -- clean
  • tri_comparison_chart.py --all --ci -- clean

🤖 Generated with Gemini (via agy), orchestrated and independently verified by Claude Code.

squid-protocol and others added 3 commits August 26, 2026 09:32
GitGalaxy had zero POD-block awareness for perl -- =head1/=cut-delimited
documentation blocks were never stripped from the code stream before
func_start ran, so a literal `sub name { ... }` example written as prose
inside a POD block (e.g. a SYNOPSIS section) was matched as a real
function. The mirror false-negative symptom (a POD apostrophe corrupting
the brace-shield) was fixed in #1606; this fixes the false-positive
symptom that fix explicitly left as a known, deferred gap.

Blanks POD block content (=pod/=head[1-6]/=item/=over/=back/=cut/
=begin/=end/=encoding/=for through the matching =cut, or to EOF if
unterminated) using the same blank() helper and marker set the existing
"doc" rule already recognizes, before the #1437 quote-operator shielding
runs.

Confirmed on language-crucible's perl/mojo/Promise.pm: `get_p` (a code
example inside the SYNOPSIS POD block) no longer matched as a function;
all 36 real functions in the file still are. Corpus-wide, the perl
tree-sitter accuracy baseline's extra_functions dropped from 1 to 0
across all 22 files / 941 functions scanned -- get_p was the only
false positive.

Closes #2239

Co-Authored-By: Claude Sonnet 5 <[email protected]>
# Conflicts:
#	tests/golden_master_audit.json
#	tests/golden_master_zero_dep_audit.json
Regenerates golden_master_audit.json / golden_master_zero_dep_audit.json
on top of the merged main (which already includes #2238's blessed
baseline) plus this branch's own perl POD-stripping fix, so both are
reflected together.
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol enabled auto-merge (squash) August 26, 2026 13:52
The new test needs LANGUAGE_CRUCIBLE_PATH (reads the real Promise.pm
corpus file) but wasn't marked golden_crucible, so it unconditionally
failed in CI's default full-suite run, which excludes golden_crucible
tests per pyproject.toml's addopts and doesn't set that env var.
# Conflicts:
#	tests/golden_master_audit.json
#	tests/golden_master_zero_dep_audit.json
# Conflicts:
#	tests/golden_master_audit.json
#	tests/golden_master_zero_dep_audit.json
@squid-protocol
squid-protocol merged commit dc6a5d1 into main Aug 26, 2026
28 checks passed
@squid-protocol
squid-protocol deleted the fix/perl-2239-pod-strip branch August 26, 2026 14:10
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.

perl func_start: POD documentation blocks (=head1/=cut) are never stripped, so code examples inside POD are matched as real subroutines

1 participant