Repository navigation
fix(perl): strip POD documentation blocks before structural scanning - #2253
Merged
Merged
Conversation
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.
Contributor
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #2239. GitGalaxy had zero POD-block awareness for perl --
=head1/=cut-delimited documentation blocks were never stripped from the code stream beforefunc_startran, so a literalsub 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/=forthrough the matching=cut, or to EOF if unterminated) using the sameblank()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).extra_functionsdropped from 1 to 0 across all 22 files / 941 functions scanned -- confirmingget_pwas 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-- cleancrucible_check.py --mode both-- drift confined to perl/mojo (function count/magnitude, attributable to the fix) plus expected global coordinate ripple, blessedtree_sitter_accuracy_audit.py --all --ci-- cleantri_comparison_chart.py --all --ci-- clean🤖 Generated with Gemini (via
agy), orchestrated and independently verified by Claude Code.