Skip to content

html func-precision shows 0.0% once the corpus has a <style> block — decide N/A vs. rule refinement #2421

Closed

Description

@squid-protocol

Summary

html's func_start rule (<(script|style)(?=[ \t\n\r\f/>])) anchors on <style> / <script>
element boundaries — the "one comparable schema across every language" rationale that gives
css/html a func_start rule at all. tree-sitter-html models <style>…</style> as a
style_element wrapping inert raw_text, so it extracts nothing there.

When language-crucible v1.1.0 + #2415 added html/cpython_jinja/layout.html (a Jinja template
with a <style> block), the tree-sitter-accuracy audit went:

html func precision: N/A -> 0.0%   (extra_functions 0 -> 1)

The one extra is a 1-line block GitGalaxy names media (from @media only screen … — line 40).
Not a hallucination (there is a <style> element there), but not a tree-sitter "function"
either.

Decision needed

Either:

  1. Force html func-recall/func-precision to N/A in tree_sitter_accuracy_audit.py, the same
    way _CLASS_EXTRACTION_OUT_OF_SCOPE already forces css/html class metrics to N/A — on the
    grounds that <style>/<script> boundaries aren't the same kind of thing tree-sitter counts
    as a function. (css would need the same treatment for consistency; it currently shows
    100%/100% only because its corpus happens not to exercise the divergence.)
  2. Or narrow html's func_start so a bare <style> without embedded scripting isn't counted.

Context

The 0.0% was accepted (baseline written from measure() output, gate-overridden) in the
"regenerate tree-sitter baselines orphaned by #2415" PR, matching the maintainer-override
precedent in commit 9011de45 (lua class precision 0.0%, same "out of scope, follow-up later"
call).

Activity

  1. added
    core-engine
    on Aug 29, 2026
  2. added 2 commits that reference this issue on Aug 29, 2026
  3. added this to the v2.4.9 milestone on Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    core-engine

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions