From 5b6d0f574aedded751b2b007e1f245e1dd745787 Mon Sep 17 00:00:00 2001 From: squid-protocol Date: Sun, 30 Aug 2026 17:04:39 -0400 Subject: [PATCH] test(tree-sitter-audit): re-bless stale css baseline after #2500's audit-reader fix (#2507) `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. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Tpu4YmAESTUeSoPQ5LqLWy --- gitgalaxy/standards/language_standards.py | 2 +- tests/tools/tree_sitter_accuracy_audit.py | 16 ++++++++++++++++ tests/tree_sitter_accuracy_baseline_css.json | 10 +++++----- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/gitgalaxy/standards/language_standards.py b/gitgalaxy/standards/language_standards.py index c92a2205e..91da7254e 100644 --- a/gitgalaxy/standards/language_standards.py +++ b/gitgalaxy/standards/language_standards.py @@ -38,7 +38,7 @@ | C | 100.0% | 99.5% | 100.0% | 100.0% | | Cpp | 100.0% | 100.0% | 100.0% | 100.0% | | Csharp | 100.0% | 100.0% | 100.0% | 100.0% | -| Css | 83.3% | 80.0% | N/A | N/A | +| Css | 100.0% | 100.0% | N/A | N/A | | Dart | 100.0% | 100.0% | 100.0% | 100.0% | | Fortran | 100.0% | 100.0% | 100.0% | 100.0% | | Go | 100.0% | 100.0% | 100.0% | 100.0% | diff --git a/tests/tools/tree_sitter_accuracy_audit.py b/tests/tools/tree_sitter_accuracy_audit.py index 5f45eb01e..05172a51c 100755 --- a/tests/tools/tree_sitter_accuracy_audit.py +++ b/tests/tools/tree_sitter_accuracy_audit.py @@ -294,6 +294,22 @@ languages' Func Precision badge from ctags to GitGalaxy). Baseline regenerated and reviewed rather than treated as a real regression, same "ground truth can be wrong" precedent as every other entry in this section. + + css's at-rule "functions" (`@media`/`@supports`/`@container`/`@layer`/`@keyframes`) show a + permanent `args_comparable` discrepancy: GitGalaxy assigns them a param count read from the + at-rule prelude tokens (`@media all and (max-width: 600px)` -> got=3; + `@layer wp-ui-components {` -> got=1), while `_get_param_count` here always returns 0 for them + -- an at-rule statement node has no "parameters" field and isn't a `function_definition`, so + none of that function's branches apply. This is not a GitGalaxy defect: a CSS at-rule genuinely + has no formal parameter list, and counting these at-rules as functions at all is a deliberate, + ledger-validated design choice (`tri_comparison_ledger.json`'s + `css/function/existence/agree[gitgalaxy,tree_sitter]_vs[ctags]`, status validated: at-rule + keywords are "the closest function-shaped construct CSS has"). Same "no formal signature to + read at the declaration site" shape as the shell/perl note above (#1518/#1519), minus a + body-scan heuristic to bridge it -- the informational `args_comparable` count simply carries + these as non-exact, and the gated `args_exact_match` is unaffected (an at-rule with a + genuinely 0-token prelude, `@media {`, still matches 0 == 0). Noted here so the css + `args_comparable` gap isn't mistaken for a real args-regex bug on a future baseline review. """ import argparse diff --git a/tests/tree_sitter_accuracy_baseline_css.json b/tests/tree_sitter_accuracy_baseline_css.json index 2bee465ca..95751c0f9 100644 --- a/tests/tree_sitter_accuracy_baseline_css.json +++ b/tests/tree_sitter_accuracy_baseline_css.json @@ -1,12 +1,12 @@ { - "args_comparable": 20, - "args_exact_match": 14, + "args_comparable": 25, + "args_exact_match": 19, "corpus_path": "language-crucible/data/css", "extra_classes": 0, - "extra_functions": 5, + "extra_functions": 0, "files_scanned": 21, "found_classes": 227, - "found_functions": 20, + "found_functions": 25, "real_classes": 227, - "real_functions": 24 + "real_functions": 25 }