css tri-comparison: func precision + recall to 100% (audit-reader fixes, no engine change) - #2500
Merged
squid-protocol merged 2 commits intoAug 30, 2026
Merged
Conversation
…s; css func precision+recall to 100% tree_sitter_accuracy_audit.py _get_node_name had two css-only defects (same class as #1313), both making the tri-comparison audit disagree with GitGalaxy where GitGalaxy's own css func_start is correct: - keyframes_statement name branch was dead code: it looked for a child of node type `at_keyword`, but this grammar version names it `@keyframes` / `@-webkit-keyframes`. It always fell through to `return None`, so tree-sitter reported 0 @Keyframes corpus-wide. Fixed: accept the `@keyframes` / `@-webkit-keyframes` child types, fall back to "keyframes". - the `at_rule` branch returned "layer" for the bodyless `@layer a, b, c;` ordering statement, which GitGalaxy deliberately does not match (its func_start counts only block-bearing at-rules, the same body-bearing-definition-only convention that drops C/C++ forward declarations). Fixed: return None when the at_rule node has no `block` child. @container is never bodyless, so only `@layer a, b;` is affected. at_rule / keyframes_statement appear in no other language's NODE_MAPS, so the change is css-only -- verified: the full --all chart regen moves only css cells plus the summary tallies that roll up from them. Ledger shapes validated (verdicts in tri_comparison_ledger.json): - css/function/existence/agree[gitgalaxy]_vs[ctags,tree_sitter] (5 occ, keyframes) -> audit-reader defect; tree-sitter now corroborates all 5. No credit/debit. - css/function/existence/agree[tree_sitter]_vs[ctags,gitgalaxy] (4 occ, @layer) -> GitGalaxy correct; audit no longer counts the bodyless form. No credit/debit. recall_audit.py css: 4 counted misses -> 0. Chart: css Func Found 25*/24*/0* -> 25/25/0; css Func Precision 20/25* & 20/24* -> 25/25 & 25/25, no asterisks. Zero GitGalaxy engine change -- golden masters untouched. Refs #2499. Same bug class as #1313. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lsfg2qxhocsSsiejiP1XqC
Sections 1-8 via the language-status skill (30/48 rule keys wired, 92 dedicated test cases, epic history #577/#737/#841/#955 + cross-language #645). Section 9 is the tri-comparison capstone from this sweep: 3/3 css discrepancy shapes resolved, zero GitGalaxy engine defects, recall 4-miss -> 0, both precision and recall at 100%. Documents the two audit-reader bugs fixed in #2499 and the bodyless-@layer recall-audit bucketing. Refs #2499. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lsfg2qxhocsSsiejiP1XqC
Contributor
This was referenced Aug 30, 2026
squid-protocol
added a commit
that referenced
this pull request
Aug 30, 2026
…dit-reader fix (#2507) (#2509) `tree-sitter-accuracy-audit` was red on main for css with a ground-truth drift (`real_functions: baseline=24 current=25`). Not corpus drift: files_scanned is 21 in both the committed baseline and now -- #2478 already regenerated it against the v1.2.0 pin. The 24->25 is #2500 ("css tri-comparison ... audit-reader fixes, no engine change") landing its own `_get_node_name` changes without re-blessing this JSON: the fixed dead-code `keyframes_statement` branch (was always `return None`, so 0 `@keyframes` corpus-wide) adds keyframes; the `at_rule` branch now returning None for the bodyless `@layer a, b;` form removes those. Net +1. #2500 updated the tri-comparison chart/ledger and docs/language_status/css.md but missed this file -- its commit message records the target state ("css Func Found 25*/24*/0* -> 25/25/0"). Zero GitGalaxy engine change, zero corpus change. Regenerated via `--regenerate` (also refreshes the summary table in language_standards.py: css 83.3%/80.0% -> 100%/100%, matching the tri-comparison). All movement is an improvement or the explained audit-reader correction: found_functions 20->25, extra_functions 5->0, args_exact_match 14->19. Also documents the permanent css at-rule `args_comparable` discrepancy in the SCOPE docstring (GitGalaxy reads a param count off the at-rule prelude; `_get_param_count` has no parameters field for at-rule nodes -> real=0). Not an engine defect -- a CSS at-rule has no formal parameter list, and counting at-rules as functions is a ledger-validated design choice (`css/function/existence/agree[gitgalaxy,tree_sitter]_vs[ctags]`, status validated). The gated `args_exact_match` is unaffected. No golden-master re-bless: no engine/regex change. Claude-Session: https://claude.ai/code/session_01Tpu4YmAESTUeSoPQ5LqLWy Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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
CSS
funcprecision and recall to 100%, by fixing two css-only defects in thetri-comparison audit reader (
tests/tools/tree_sitter_accuracy_audit.py::_get_node_name).Zero GitGalaxy engine change —
detector.py/language_standards.py/prism.pyuntouched,golden masters untouched. Both defects made the audit disagree with GitGalaxy where GitGalaxy's
own
cssfunc_startis correct. Same bug class as the closed #1313.Surfaced by a
tri-comparison-ledger-sweeppass oncss(fixes #2499).Bug 1 —
keyframes_statementname branch was dead code (precision)The branch looped for a child of node type
at_keyword, but the pinnedtree-sitter-cssgrammarnames that child literally
@keyframes/@-webkit-keyframes(only@media/@supportsuse theat_keywordshape). It always fell through toreturn None, so tree-sitter reported 0@keyframescorpus-wide despite the nodes being in its parse tree. GitGalaxy correctly matches@keyframes. Ledger shapecss/function/existence/agree[gitgalaxy]_vs[ctags,tree_sitter], 5 occ(
tailwindcss_atrules/theme.css:443/449/457/463nested in a Tailwind-v4@themeblock;gutenberg_css_modules/button.module.css:237).Fix: accept the
@keyframes/@-webkit-keyframeschild types, fall back to"keyframes".Bug 2 — bodyless
@layer a, b;counted as a function (recall)The
at_rulebranch returned"layer"for both the block form@layer name { … }(whichGitGalaxy matches) and the bodyless cascade-layer ordering statement
@layer a, b, c;(whichGitGalaxy deliberately does not — its
func_startcounts only block-bearing at-rules, the samebody-bearing-definition-only convention that drops C/C++ forward declarations). Ledger shape
css/function/existence/agree[tree_sitter]_vs[ctags,gitgalaxy], 4 occ.Fix:
at_rulebranch returnsNonewhen the node has noblockchild.@containeris neverbodyless, so only
@layer a, b;is affected.Scope
at_rule/keyframes_statementappear in no other language'sNODE_MAPSentry. Verified:the full
--allchart regen moves only css cells plus the summary tallies that roll up from them(diff below).
--all --ci(javascript/typescript/zig baselines) passes unchanged.Verification
recall_audit.py css: 4 counted misses → 025*/24*/0*→25/25/0; css Func Precision20/25*&20/24*→25/25&25/25, asterisk-freepython tests/tools/tri_comparison_chart.py --all --ci→ all OKtest_css.py+test_css_strict.py→ 92 passed;test_html_embedded_ts_funcs.py,test_tri_comparison_{ledger,reconcile}.py→ passruff_audit.py --ci/mypy_audit.py --ci→ no new findingstests/tools/tree_sitter_accuracy_audit.pyis never imported byanything under
gitgalaxy/; GitGalaxy scan output is byte-identical.Also in this PR
status: validatedwith full verdicts (no credit/debit — realcorroboration once the reader is fixed, and a single-tool over-count respectively)
tri_comparison_chart.svg/tri_comparison_ledger.json/tri_comparison_points_of_interest.mddocs/language_status/css.md(§1–8 via thelanguage-statusskill, §9 tri-comparisoncapstone by hand) + README index row
🤖 Generated with Claude Code