Summary
tests/tools/tree_sitter_accuracy_audit.py already injects the css/javascript grammar when it
hits an HTML <style> / <script> element (_html_embedded_ts_funcs, added in #2421), so its
tree-sitter side sees the real CSS/JS constructs inside. tests/tools/tri_comparison_gatherer.py
has its OWN simpler tree-sitter walk (_walk_tree_sitter) that did NOT do this — for HTML it
matched style_element / script_element against func_node_types, _get_node_name returned
None, and the tree-sitter side yielded nothing.
Consequence: cpython_jinja/layout.html:40's @media only screen { ... } inside a <style>
block — which GitGalaxy's polyglot detector correctly reports as a function media — showed up
as html/function/existence/agree[gitgalaxy]_vs[ctags,tree_sitter] (GitGalaxy alone), i.e. a
correct polyglot find looking like an over-detection.
Fix
Added the same tsaa._HTML_EMBEDDED_LANG / tsaa._html_embedded_ts_funcs branch to
_walk_tree_sitter, mirroring measure()'s own walk. media is now in GitGalaxy+tree-sitter
consensus. ctags-html still can't see it (no CSS parser — a separate documented limitation).
Found by
tri-comparison-ledger-sweep (remaining-shapes pass), 2026-08-29. Fixed in the same PR.
Summary
tests/tools/tree_sitter_accuracy_audit.pyalready injects the css/javascript grammar when ithits an HTML
<style>/<script>element (_html_embedded_ts_funcs, added in #2421), so itstree-sitter side sees the real CSS/JS constructs inside.
tests/tools/tri_comparison_gatherer.pyhas its OWN simpler tree-sitter walk (
_walk_tree_sitter) that did NOT do this — for HTML itmatched
style_element/script_elementagainstfunc_node_types,_get_node_namereturnedNone, and the tree-sitter side yielded nothing.Consequence:
cpython_jinja/layout.html:40's@media only screen { ... }inside a<style>block — which GitGalaxy's polyglot detector correctly reports as a function
media— showed upas
html/function/existence/agree[gitgalaxy]_vs[ctags,tree_sitter](GitGalaxy alone), i.e. acorrect polyglot find looking like an over-detection.
Fix
Added the same
tsaa._HTML_EMBEDDED_LANG/tsaa._html_embedded_ts_funcsbranch to_walk_tree_sitter, mirroringmeasure()'s own walk.mediais now in GitGalaxy+tree-sitterconsensus. ctags-html still can't see it (no CSS parser — a separate documented limitation).
Found by
tri-comparison-ledger-sweep(remaining-shapes pass), 2026-08-29. Fixed in the same PR.