Repository navigation
fix(yacc): route grammar-rule slicing through Mode A; map ctags 'l' kind; validate tri-comparison shape - #2353
Merged
Merged
Conversation
…s 'l' kind
yacc had no ScopeParsingRegistry entry and lexical_family=standard_block, so
detector.py routed it to Mode_B_Braces. A yacc grammar rule only has a {}
brace pair when a production carries a C semantic action, so every action-less
rule (Configuration:, Many_specs:, Opt_list:, ...) was counted in the raw
struct_func_start signal but silently dropped from the named function_data list.
Same bug class as #1899 (abap) / #1975 (jcl, m4) / dockerfile. Fixes #2351.
config.y: function_count 11 -> 20 (raw signal was already 20)
parser.y (gnucobol): 781 -> 1148, now 100% precision
Add "yacc" to the Mode_A_Labels branch: "greedy to the next func_start" is the
correct body boundary for a non-nesting grammar-rule language, exactly like
COBOL's label-only paragraphs. .l/.ll (lex/flex) share the rule set.
Also fix tests/tools/ctags_reader.py: CTAGS_FUNC_KINDS["yacc"] was set() with a
comment claiming ctags "structurally cannot see" grammar rules. It can -- ctags'
YACC parser tags every rule LHS with kind 'l' (label), confirmed via
`ctags --list-kinds-full=YACC`. Map it, same precedent as makefile 't' /
assembly 'l'. This is the cpp 'g' / kotlin 'o' kind-map gap shape. Fixes #2352.
After both fixes GitGalaxy and ctags agree exactly on all 27 corpus rules.
Golden masters re-blessed: semantic diff is 8634 leaves, all in
cobol/gnucobol_internals/parser.y (+367 real rules x ~20 metric fields, list
re-sorted by impact), the yacc/freebsd corpus files, and topological-coordinate
ripple on neighbouring files in the same repos (no structural-signature change
outside .y/.l files).
Surfaced by the tri-comparison-ledger-sweep skill validating
yacc/function/existence/agree[gitgalaxy]_vs[ctags].
Co-Authored-By: Claude Sonnet 5 <[email protected]>
…instance Validates yacc/function/existence/agree[gitgalaxy]_vs[ctags] (18 occ, first seen 2026-08-27). GitGalaxy was correct on all 18; shape resolved by the two fixes in the parent commit (#2351 engine, #2352 harness) and no longer reproduces -- chart cell 18*/0* -> verified 27/27 tie, no asterisk. - tri_comparison_ledger.json: yacc entry -> status=validated, still_reproduces =false, full verdict. credit_tools/debit_tools both empty (shape resolved into genuine agreement, not an uncorroborated single-tool claim). - tri_comparison_chart.svg / points_of_interest.md: regenerated (--all --write, real universal-ctags on PATH); diff scoped to the yacc row + global summary counters (63 -> 64 real comparisons). - why_gitgalaxy_beats_ast_here.md: second confirmed instance of Claim 12 (lexical coverage a generic parser's identifier convention excludes) -- ctags' YACC parser emits no tag for `_`-prefixed rule names (325 in gnucobol/parser.y) or single-char names (`x:`), and tags a rule that is entirely inside a block comment. - docs/language_status/yacc.md: new status doc, §9 tri-comparison capstone. README table row -> written. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Contributor
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.
What
Validates the tri-comparison ledger shape
yacc/function/existence/agree[gitgalaxy]_vs[ctags](18 occurrences, first seen 2026-08-27 once #1926 let the
.ycorpus files intofile_data),via the
tri-comparison-ledger-sweepskill. GitGalaxy was correct on all 18. The shape had twoindependent causes, both fixed here, plus a third finding logged to
why_gitgalaxy_beats_ast_here.md.Cause 1 — engine recall gap (
detector.py) — fixes #2351yacc had no
ScopeParsingRegistryentry andlexical_family="standard_block", so it routed toMode_B_Braces. A yacc grammar rule only has a{}pair when a production carries a C semanticaction, so every action-less rule (
Configuration:,Many_specs:,Opt_list:, …) couldn'tbe brace-sliced and was dropped from
function_data— even though the rawstruct_func_startsignal counted it.
freebsd/config.ygnucobol_internals/parser.ySame bug class as #1899 (abap) / #1975 (jcl, m4) / dockerfile. Fixed by routing yacc through
Mode_A_Labels— "greedy to the next rule head" is the correct body boundary for a non-nestinggrammar-rule language, exactly like COBOL's label-only paragraphs.
.l/.ll(lex/flex) sharethe rule set and are fixed by the same change.
Cause 2 — test-harness kind-map bug (
ctags_reader.py) — fixes #2352CTAGS_FUNC_KINDS["yacc"]wasset(), with a comment claiming ctags "structurally cannot see"grammar rules.
ctags --list-kinds-full=YACCshowsl(label) is the parser's only kind and ittags every rule LHS with it. Mapped
{"l"}— same precedent asmakefilet/assemblyl,same gap shape as the fixed cpp
g/ kotlino/ fortranm,i,S,bentries. After both fixesGitGalaxy and ctags agree exactly on all 27 rules across the gather corpus.
Cause 3 —
why_gitgalaxy_beats_ast_here.mdClaim 12, second instanceOn
gnucobol_internals/parser.y(real 18k-line Bison grammar) GitGalaxy finds 1148/1148 realrules at 100% precision vs ctags' 823. ctags' YACC parser emits no tag for any rule whose
name starts with
_(GnuCOBOL's pervasive optional-nonterminal convention — 325 rules) or for asingle-character name (
x:), and wrongly tags one rule (encryption_clause:) that sits entirelyinside a
/* ... */block comment. Same lexical-coverage mechanism as Claim 12's existing AGCassembly evidence.
Ledger / chart
tri_comparison_ledger.json: yacc entry →validated,still_reproduces=false, full verdict.credit_tools/debit_toolsboth empty (shape resolved into genuine agreement).tri_comparison_chart.svgregenerated with realuniversal-ctagson PATH; diff scoped to theyacc row (
18*/0*→27/27tie) plus the global summary counters (63 → 64 comparisons).docs/language_status/yacc.mdwith the §9 tri-comparison capstone.Differential Scan
Both golden masters re-blessed. Semantic leaf-diff = 8634 changes, entirely in
cobol/gnucobol_internals/parser.y(+367 real rules × ~20 metric fields + list re-sort), theyacc/freebsd/*corpus files, and topological-coordinate ripple on neighbouring files in the samerepos. Zero structural-signature changes outside
.y/.lfiles.Verification
test_yacc.py/test_yacc_strict.py: 68 passed, 1 skippedtests/core_engine/: 558 passedaudit_check.py(ruff / mypy / dead-key / ast-accuracy): all clearcrucible_check.pyfull corpus: drift confined as described above, golden masters re-blessedKnown residual (accepted, documented in yacc.md §5)
Mode A's last matched rule per file greedily absorbs the trailing C epilogue as its "body"
(inflated LOC/complexity on that one function) — identical to every other Mode A language at
end-of-segment. Existence/precision unaffected.
🤖 Generated with Claude Code