Repository navigation
Fix/powershell css class recall graph - #1401
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]>
…ing 0% Follow-up to this PR's own scope-note addition: an annotation explaining "0% is by design" was a half-measure. css genuinely has real_classes=90 (ground truth works correctly) but GitGalaxy never attempts extraction there by design (epic #1295's "Decided: not extending css or html") -- displaying that as "0.0%" reads as "tried and missed everything", which is wrong. N/A is the accurate signal: not measured, not attempted. Added _CLASS_EXTRACTION_OUT_OF_SCOPE = frozenset({"css", "html"}) and used it in both generate_summary_table() (the language_standards.py docstring table) and generate_chart_svg() (the class_recall/class_precision panels specifically -- func_recall/func_precision are untouched, that extraction IS in scope and genuinely measured for both languages). Updated the scope-note text added earlier in this PR to match ("n/a" not "0%"). Verified: `--all --ci` passes clean across all 31 baselined languages (no other regressions), summary table regenerated correctly (Css/Html now show N/A/N/A on the class columns, func columns unchanged), chart generator smoke-tested locally. crucible_check.py both modes clean, full core_engine/extraction suite passes (6585 tests), audit_check.py clean. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Polish pass while investigating the css/powershell chart issue: scanned the full accuracy table for other unexplained non-100%/non-N/A class numbers. scala's class_start regex modifier alternation was missing private/protected (with optional scala's qualified-scope form, private[foo]/protected[foo]) -- its own func_start regex right above it already handles this exact case correctly, class_start just never got the same list. Confirmed via kafka's `private class LogRecoveryThreadFactory`, `private[kafka] abstract class Acceptor`, `private[network] case class DelayedCloseSocket`, `private[kafka] class Processor` -- all real classes GitGalaxy was silently missing. real_classes/found_classes 12->17, extra_classes stays 0 -- a perfect match (100%/100%/100%/100% across the board now for scala). Golden master updated (both modes) -- kafka/ReplicaManager.scala and kafka/SocketServer.scala's class counts increased (2->3, 5->9) as expected, downstream spatial-fingerprint drift is the normal consequence of a genuine class-count increase, not a bug. Spot-checked cpp and csharp for the same "unaudited pre-#1295" pattern. csharp's non-100% numbers match the already-documented #1264 enum precedent exactly (no new issue). cpp has some real-looking gaps (union/scoped-enum/ template-specialization naming) that weren't chased here -- template name synthesis is genuinely complex, deserves its own dedicated investigation rather than a quick fold-in. crucible_check.py both modes clean, full core_engine/extraction suite passes (6585 tests, incl. scala's own 153 tests), audit_check.py clean. Co-Authored-By: Claude Sonnet 5 <[email protected]>
…es live Committing the actual regenerated chart.svg/history.csv in this PR rather than leaving it for the post-merge automated workflow -- the code fix alone (the N/A override committed earlier) doesn't change what's already rendered into the committed SVG file, so css was still visibly showing "0/90" until the file itself was regenerated. Confirmed now: css's Class Recall/Class Precision panels render "n/a", not a fraction; powershell and scala both show their fixed 100%/100% numbers. Co-Authored-By: Claude Sonnet 5 <[email protected]>
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]>
Contributor
3 tasks done
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
Type of change
gitgalaxy/core/detector.py,language_standards.py,prism.py, or a per-language rule)CI checklist
Check only what applies to your change — CI enforces the rest, but running it locally first saves a review round-trip.
python tests/tools/audit_check.pypasses (bundles the ruff/mypy/dead-key baseline-gated audits +ruff format --check)python -m pytest tests/passes, or the specific test file(s) for this change (list them below)python tests/tools/crucible_check.pypasses — this is the Differential Scan against the ~80-repo calibrated baseline (seeCONTRIBUTING.md)Differential Scan target
Verification