Repository navigation
fix(1295-polish): powershell/scala class_start bugs, css/html shown as N/A - #1397
Merged
Merged
Conversation
…ml chart PowerShell has been in _CLASS_START_NAMED_EXTRACTION_LANGS since #1264, but its class_start regex never had a capture group around the name -- every match collapsed into "Anonymous_Class", so class recall/precision both read 0.0% despite the regex correctly matching real classes. This specific gap was never caught because powershell predates epic #1295 (it was already allowlisted, so it never went through #1295's per-language verification pass). Two-part fix, both purely additive (regex still matches identical lines): - language_standards.py: made the name group capturing. - tree_sitter_accuracy_audit.py: powershell's class_start also intentionally matches `enum` (its own comment says "Defines OO boundaries (Classes and Enums)"), but NODE_MAPS["powershell"]["class_node_types"] only had "class_statement" -- added "enum_statement" (same no-name-field shape, resolved via the existing simple_name-child branch in _get_node_name). real_classes/found_classes 5->7, extra_classes 0 throughout -- a perfect match, confirmed via core/packaging.psm1's R2RVerification/PackageManifestResult/ PsPeInfo/BomRecord/LinkInfo classes and MachineOSOverride/ PackageManifestResultStatus enums. Also adds a third scope-note line to the accuracy chart's SVG generator clarifying that css/html's 0% class recall/precision is a documented design decision (epic #1295), not an unfixed gap -- their class_start regexes target selectors/curated tags, not OOP-shaped entities, so named extraction was decided permanently out of scope for them. Chart/history CSV aren't regenerated in this PR (that happens automatically via the tree-sitter-accuracy-history workflow once this merges to main); verified the generator renders without error locally. crucible_check.py both modes clean, full core_engine/extraction suite passes (6585 tests, including 153 powershell-specific tests unaffected), audit_check.py clean. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Contributor
squid-protocol
added a commit
that referenced
this pull request
Aug 13, 2026
Main advanced 4 commits while this branch was open, including #1397 -- an independently-completed duplicate of this branch's own powershell class_start fix (same diff, same message, different session). This branch still carries two things #1397 didn't: the css/html "N/A not 0%" follow-up and the scala private/protected class_start fix -- confirmed via `git branch --contains` that neither had reached main. Conflicts were all in generated/derived artifacts, not real logic collisions: - tests/tools/tree_sitter_accuracy_audit.py: one text conflict in the SVG generator's scope-note string (this branch's "n/a" superseding main's earlier "0%" half-measure) -- kept this branch's version, everything else auto-merged cleanly (NODE_MAPS powershell entry from main + _CLASS_EXTRACTION_OUT_OF_SCOPE from this branch coexist, non-overlapping). - docs/self_scan/tree_sitter_accuracy_history.csv / tree_sitter_accuracy_chart.svg: pure generated artifacts, not hand-merged. Resolved to main's already-published batch as the base, then regenerated fresh via `--history --chart --summary-table` with LANGUAGE_CRUCIBLE_PATH pointed at the sibling language-crucible checkout, so the final snapshot reflects all three fixes (powershell + css N/A + scala) as one correct measurement rather than a stale or hand-spliced one. Confirms the scala fix: class recall 70.6% -> 100% (12/17 -> 17/17). Verified post-merge: --all --ci clean across all 31 baselined languages, audit_check.py clean, powershell/scala/css/html extraction+strict suites (612 tests) pass, crucible_check.py both modes PASS (no output drift on the ~80-repo differential corpus). Co-Authored-By: Claude Sonnet 5 <[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.
Summary
Started as a fix for two things flagged in the tree-sitter accuracy graph (css showing 0%, powershell showing 0%), expanded into a full polish pass over the whole class-extraction system per request.
PowerShell -- real bug, fixed
Been in the extraction allowlist since #1264, but its
class_startregex never had a capture group -- every match collapsed into a nameless placeholder. Also missingenumfrom ground truth despite its own regex matchingclass|enum.real_classes/found_classes5→7, perfect match. 69.1%/92.7%/0.0%/0.0% → 69.1%/92.7%/100.0%/100.0%.Scala -- real bug, found during the polish pass, fixed
Not part of the original ask, but the polish pass caught it: scala's
class_startmodifier list was missingprivate/protected(including the qualifiedprivate[scope]form) -- its ownfunc_startregex right above it already handles this correctly,class_startjust never got the same list.real_classes/found_classes12→17, perfect match. 100.0%/100.0%/70.6%/100.0% → 100.0%/100.0%/100.0%/100.0%. Golden master re-blessed (kafka files' class counts increased as expected).CSS/HTML -- not bugs, now displayed correctly
Their 0% class recall/precision was a documented design decision (epic #1295's "permanently out of scope" call), not a gap -- but showing "0.0%" was misleading (css genuinely has 90 real classes in its ground truth; GitGalaxy just never attempts extraction there by design). Added
_CLASS_EXTRACTION_OUT_OF_SCOPEand now both the chart panels and the markdown summary table show N/A on the class columns for these two specifically -- func_start numbers are untouched (that extraction IS in scope and measured for both).Full-system scan (the "polish" pass)
Ran
--all --ciacross all 31 baselined languages (clean) and spot-checked every remaining non-100%/non-N/A class number againstclass_start_diff.py:classdeffiles in its small corpus sample) are legitimately N/A, confirmed not measurement bugs.Verification
python tests/tools/tree_sitter_accuracy_audit.py --all --ci-- clean across all 31 languagespython tests/tools/class_start_diff.py --lang powershell/--lang scala-- perfect matchespython tests/tools/crucible_check.py-- both modes PASS (after--updatefor scala's expected golden-master drift)python tests/tools/audit_check.py --regenerate-- cleanpython -m pytest tests/core_engine/ tests/extraction/-- 6585 passed, including powershell's and scala's own dedicated test suites (153 tests each)Test plan
class_start_diff.pyperfect match for powershell and scalatree_sitter_accuracy_audit.py --all --ciclean (all 31 languages)crucible_check.pyboth modes cleanaudit_check.pycleancore_engine/extractionsuite passes🤖 Generated with Claude Code