Repository navigation
fix(detector): enforce #1295's css/html class-extraction scope decision (#2798) - #2837
Merged
Merged
Conversation
…on (#2798) Epic #1295 decided permanently that css and html are out of scope for NAMED class extraction: `class_data`'s schema is class_name/inheritance_parents/ method_count/state_entanglement, and a CSS selector has none of those, so every row it produced would carry method_count=0/inheritance_parents=[] forever. The decision was documented but never enforced in the extractor, and so was silently reversed. #1824 -- a css `class_start` REGEX improvement -- added "css" to `_CLASS_START_NAMED_EXTRACTION_LANGS` five days later with no mention of it, and css's crucible `found_classes` went 0 -> 90 in the same commit. Nothing caught it for three weeks precisely BECAUSE of the decision: both tools that reconcile class extraction force css/html's class panels to N/A citing #1295, so the reversal landed in the blind spot the decision itself created. It surfaced from the other end, as `classes_found[css] = 1` on the keyword-rosetta bias chart, where `.rosetta-risk` was being recorded as an extracted class. The decision now lives in one place, `_CLASS_EXTRACTION_OUT_OF_SCOPE_LANGS`, checked before the allowlist AND before the legacy fallback (so it pins the intent rather than relying on the generic regex happening to miss). Both reporting tools import that set instead of each keeping a hand-copy -- three copies of the same two names is what let the extractor drift away from them. The numeric `class_start` SIGNAL is deliberately untouched: the decision says so in as many words ("unaffected by this decision and stays exactly as-is for both languages"). css still counts 1 class_start for `.rosetta-risk {`, and that count still feeds the risk equations. Also scopes the accuracy audit's own regression gate: it was requiring `found_classes` never to fall for a language whose class panels it already refuses to show, which both pulled toward an extraction the reports had disowned and made this fix un-blessable (it reads as 227 -> 0, a "regression" toward exactly the number the decision asks for). Verification: full suite 8009 passed; audit_check all clear; crucible_check.py both modes PASS -- NO golden-master bless owed, because the golden master records the class_start SIGNAL, not class_data, which is also why it never caught #1824; tree_sitter_accuracy_audit --ci --all 30 languages OK; tri_comparison_chart --all --ci 3 languages OK. The css accuracy baseline's found_classes 227 -> 0 is the point of the change, not a regression. Cross-repo: keyword-rosetta owes a follow-up PR AFTER this merges (hard rule 4, no pins) narrowing `container-construct-reads-as-class` by one language -- `classes_found[css]` goes 1 -> 0 = the corpus median, in band. No plant change, no manifest change (css's manifest pins class_start, which does not move), no re-bless; bias-history.yml regenerates the chart on merge. Closes #2798 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Contributor
squid-protocol
deleted the
fix/2798-css-class-extraction-out-of-scope
branch
September 7, 2026 12:05
squid-protocol
added a commit
to squid-protocol/keyword-rosetta
that referenced
this pull request
Sep 7, 2026
…2798) (#87) css read `classes_found` 1 for `.rosetta-risk` and this entry filed it beside cobol/jcl as a container construct -- "a CSS class is literally what the rule names". That was the wrong call, and the F.5 sweep that wrote it (me) made it. `classes_found` is `len(class_data)`, i.e. NAMED class extraction, which gitgalaxy epic #1295 ruled permanently out of scope for css and html: a selector has no methods and no inheritance, so every row it produced carried `method_count=0`/`inheritance_parents=[]`. The decision was documented but never enforced in the extractor, and gitgalaxy#1824 -- a css `class_start` REGEX change five days later -- silently added css to the named-extraction allowlist, taking its crucible found_classes 0 -> 90. Nothing caught it for three weeks because the two tools that reconcile class extraction already force css's class panels to N/A citing that same decision; it surfaced here instead, as a red dot on this chart. gitgalaxy PR #2837 enforces the decision in `detector.py`. Verified against that branch: css reads `classes_found` 0 = the corpus median, in band, no exemption needed. Nothing else in this repo moves -- no plant change, no manifest change (css's manifest pins `class_start`, which does not move), no re-bless. The numeric signal stays out of the narrowing: css still reads `class_start` 1 and remains ledgered by container-construct-reads-as-class-start, because #1295 scoped its decision to named extraction in as many words ("the `class_start` numeric signal ... is unaffected by this decision and stays exactly as-is"). Nothing automated would have caught the stale claim: `ledger_orphan_check` bands per TOKEN, and `classes_found` still explains cobol/dockerfile/jcl/kotlin, so the cross-product would have gone on excusing a css cell nobody looked at -- exactly what the ledger `_doc`'s "scope a collective entry down" rule exists to prevent. Gates (scan-free, against engine main): na_check --ci 0 unreviewed; ledger_orphan_check --ci no new orphan tokens. Cross-repo: opens after squid-protocol/gitgalaxy#2837 merges (AGENTS.md hard rule 4, no pins). bias-history.yml regenerates the chart and bias_data.json against engine main afterwards; no artifacts shipped here. Co-authored-by: Joe Esquibel <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
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.
Closes #2798.
What #2798 assumed, and what turned out to be there
#2798 read
classes_found[css] = 1as a reporting gap: #1295 already ruled css out of scope on the tri-comparison and accuracy charts, the bias chart just never wired it in. Reading the decision itself (how_to_extend_class_start_named_extraction.md, "Decided: not extending css or html") says otherwise:So #1295 covers
classes_found(which islen(class_data)—record_keeper.py:758) and explicitly notclass_start. Those were the two rows the issue wanted marked n/a together.The actual defect: the decision was documented, never enforced, and silently reversed
class_datafor the rosetta css corpus holds exactly what #1295 refused:css is in
_CLASS_START_NAMED_EXTRACTION_LANGS. It was not when the decision was written (2026-08-12,6eb16c05). #1824 (e46bf45d, 2026-08-17) — a cssclass_startregex improvement — added one line,"css",, with no mention of #1295 anywhere in its description, and in the same commit:Nothing caught it for three weeks because of the decision:
tree_sitter_accuracy_audit.pyandtri_comparison_chart.pyeach force css/html's class panels to N/A citing #1295, so the reversal landed in the one blind spot the decision itself created. The golden master could not catch it either — it records theclass_startsignal ("Class/Entity Declarations"), notclass_data. It finally surfaced from the far end of the pipeline, as a red dot on keyword-rosetta's bias chart.The change
detector.py: new_CLASS_EXTRACTION_OUT_OF_SCOPE_LANGS = {"css", "html"}, checked before the allowlist and before the legacy fallback — pinning the intent rather than relying on the genericclass|struct|interface|trait|enumregex happening to miss. css removed from the allowlist._regressions()skips the class metrics for out-of-scope languages. That gate was requiringfound_classesnever to fall for a language whose class panels it already refuses to show — it both pulled toward an extraction the reports had disowned and made this fix un-blessable, reading as227 -> 0, a "regression" toward exactly the number the decision asks for.The numeric
class_startsignal is deliberately untouched. css still counts 1 for.rosetta-risk {, still feeding the risk equations. What it no longer does is claim a selector is a named class.Verification
pytest tests/audit_check.py(ruff/mypy/dead-key/ast-accuracy/format)crucible_check.py(both modes)tree_sitter_accuracy_audit.py --ci --alltri_comparison_chart.py --all --ciDirect effect: css
classes[]/class_startsignal still 1; rosetta corpusclasses_foundcss 1 → 0, html 0.The one baseline edit, css's
found_classes227 → 0, is the point of the change, not a regression — it restores the pre-#1824 number.Two halves of #2798 deliberately declined
class_startfor css — Extend #1264's per-language class_start named-entity extraction to the remaining 13 languages #1295 explicitly exempts the numeric signal. css'sclass_start1 is a correct reading of a real construct and stays ledgered undercontainer-construct-reads-as-class-start. Marking it n/a would misquote the decision.The issue's predicted outcome still lands —
classes_foundloses its css cell — without adding a second, non-mechanical n/a source (a documented scope decision, not rule absence) to the corpus tooling.Cross-repo
Companion: keyword-rosetta owes one follow-up PR, opened after this merges (AGENTS.md hard rule 4, no pins in either direction): narrow
container-construct-reads-as-classby one language, sinceclasses_found[css]1 → 0 is now the corpus median and in band. No plant change, no manifest change (css's manifest pinsclass_start, which does not move), no re-bless owed;bias-history.ymlregenerates the chart andbias_data.jsonafter this lands.🤖 Generated with Claude Code