Skip to content

chore: regenerate tree-sitter-accuracy baselines orphaned by #2415 - #2422

Merged
squid-protocol merged 1 commit into
mainfrom
chore/tree-sitter-baselines-after-2415
Aug 29, 2026
Merged

chore: regenerate tree-sitter-accuracy baselines orphaned by #2415#2422
squid-protocol merged 1 commit into
mainfrom
chore/tree-sitter-baselines-after-2415

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Why

tree_sitter_accuracy_audit.py --all --ci has been red on main since #2415 (aperture
infra_path_pattern fix) merged. #2415 newly included ~20 real source files across the corpus,
but tree-sitter-accuracy-audit.yml doesn't trigger on aperture.py, so the affected baselines
were never regenerated. The first detector.py-touching PR to run the audit (#2420) catches it.

This PR regenerates the drifted baselines. No engine code changes — every number is
measure()'s own output.

Changes

lang change note
shell 31.6→99.1% recall, 68.3→97.0% precision #2401/#2406 shell Mode-D fixes finally in the baseline (found 140→449, extra 65→14)
powershell recall/precision unchanged (100/100) +3 files; args_exact_match 234→252 of 257
c 99.0→99.7% recall +1 file
lua 78.2→78.7% recall +1 file
tcl 98.6→100.0% recall +1 file
ruby args_exact_match 115→121 +1 file
html N/A→0.0% func precision see below

c/lua/tcl/ruby already passed --ci ("improved on …"); locked in here so the summary table
stays honest.

html 0.0%

cpython_jinja/layout.html (a Jinja template, new via #2415) has a <style> block. html's
func_start intentionally anchors on <style>/<script> element boundaries — tree-sitter-html
models <style>…</style> as inert raw_text, so it shows as extra_functions: 0 → 1 (a 1-line
block GG names media from @media only screen). Baseline written from measure() output with
the regression gate overridden — same maintainer-override shape as commit 9011de45 (lua class
precision 0.0%). Whether html func-precision should be forced N/A like css/html class
precision already is: filed as #2421.

Verification

tree_sitter_accuracy_audit.py --all --ciall OK (31 languages). Summary table in
language_standards.py's docstring regenerated to match. ruff / mypy clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_019Zm1uVBpVEZJ9SB7bWFR8S

#2415 (aperture infra_path_pattern left-boundary fix) newly included ~20
real source files across the corpus, but tree-sitter-accuracy-audit.yml
does not trigger on aperture.py, so it merged without regenerating the
affected baselines. `tree_sitter_accuracy_audit.py --all --ci` has been
red on main for every detector.py/prism.py/language_standards.py PR since.

Every number here is `measure()`'s own output, not hand-edited. No engine
code changes.

- shell: 31.6% -> 99.1% func recall, 68.3% -> 97.0% precision. This is
  #2401 / #2406's shell Mode-D fixes finally reflected in the baseline
  (found_functions 140 -> 449, extra 65 -> 14); the +6 files / +10 real
  functions from #2415 are a small part of it.
- powershell: func recall/precision unchanged (100%/100%); +3 files,
  args_exact_match 234 -> 252 of 257.
- c 99.0 -> 99.7% · lua 78.2 -> 78.7% · tcl 98.6 -> 100.0% · ruby
  args_exact_match 115 -> 121 -- all `found_functions` improvements from
  the +1 file each, already passing --ci ("improved on ..."), locked in
  here so the summary table stays honest.
- html: N/A -> 0.0% func precision. `cpython_jinja/layout.html` (a Jinja
  template, new via #2415) has a `<style>` block; html's func_start
  intentionally anchors on `<style>`/`<script>` element boundaries, which
  tree-sitter-html models as inert raw_text, so it shows as
  extra_functions 0 -> 1. Baseline written from measure() output with the
  regression gate overridden -- same maintainer-override shape as commit
  9011de4 (lua class precision 0.0%). Whether html func-precision should
  be forced N/A like css/html class-precision already is: filed as #2421.

Summary table in language_standards.py's docstring regenerated to match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019Zm1uVBpVEZJ9SB7bWFR8S
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol merged commit cfbaeaf into main Aug 29, 2026
30 checks passed
@squid-protocol
squid-protocol deleted the chore/tree-sitter-baselines-after-2415 branch August 29, 2026 14:13
squid-protocol added a commit that referenced this pull request Aug 29, 2026
…injected grammar (#2434)

`tree_sitter_accuracy_audit.py` compared html's `func_node_types`
(`script_element` / `style_element`) at the TAG level, but `_get_node_name`
has no branch for those node types, so tree-sitter's side always yielded
NOTHING for them. GitGalaxy, meanwhile, does a polyglot descent -- it
parses the CSS/JS inside a `<style>`/`<script>` and names the block after
what it finds (`layout.html`'s `<style>` -> `media`, from the real
`@media only screen { ... }` rule). That turned a correct GitGalaxy find
into a permanent `extra_functions: 1` / `0.0%` precision artifact once the
v1.1.0 corpus gained an html file with a real `<style>` block.

Not a GitGalaxy defect (its `func_start` = "the recurring code-bearing
unit", same as jcl EXEC steps / dockerfile RUN / css @media) and not a
tree-sitter defect (tree-sitter-html models `<style>` content as opaque
`raw_text` by design) -- a granularity mismatch in the audit.

Fix: `_html_embedded_ts_funcs()` parses a `<script>`/`<style>`'s inline
body with the embedded grammar (javascript / css) and feeds THOSE
functions -- via the same `func_node_types` / `_get_node_name` /
`_get_param_count` those languages are scored with directly -- into
`real_funcs`, exactly the descent GitGalaxy already does. `<script src=>`
(external, no inline code) and empty bodies contribute nothing.

Result: html goes from `func recall N/A / precision 0.0%` to
`100.0% / 100.0%` -- GitGalaxy's `media` now pairs with the injected
tree-sitter-css `media_statement`. css and every other language
unchanged (the descent is `lang == "html"`-gated); `--all --ci` green.
Closes the follow-up from PR #2422's shell/html baseline regen.


Claude-Session: https://claude.ai/code/session_019Zm1uVBpVEZJ9SB7bWFR8S

Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant