Validate cpp tri-comparison ledger; fix ctags/tree-sitter comparison-tooling bugs - #2015
Merged
Merged
Conversation
…tooling bugs
Sweep of all 14 cpp shapes in docs/self_scan/tri_comparison_ledger.json. Root-caused
and fixed three comparison-tooling bugs (not GitGalaxy production code) that were
responsible for the bulk of the false discrepancy volume:
- ctags_reader.py: out-of-class method names weren't re-qualified with their ctags
scope field, and ctags' default pattern-length truncation was silently breaking
that re-qualification on longer signatures (--pattern-length-limit=0 added).
Resolved ~1000 of the two largest shapes' ~2170 combined occurrences.
- ctags_reader.py: CTAGS_CLASS_KINDS["cpp"] was missing union/enum kinds (enum gated
on scoped-vs-unscoped, since C++11's enum class has no ctags-side distinction from
a plain enum). Same gap found and fixed for csharp in the same pass.
- tri_comparison_gatherer.py / tree_sitter_accuracy_audit.py: both tree-sitter walkers
counted a bare forward declaration (`class Foo;`) and an unscoped `enum Foo {}` as
real class definitions -- the existing C-only body-anchor guard was never extended
to cpp, and there was no scoped-enum gate at all.
Six real, currently-open GitGalaxy engine defects were confirmed via direct source
reading and filed (#2009-#2014) rather than patched inline, since each has real
production blast radius and needs the full Differential Scan verification chain.
Also adds docs/language_status/cpp.md (sections 1-8 via the language-status skill,
plus a tri-comparison capstone section) and regenerates the tri-comparison chart and
points-of-interest doc.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
This was referenced Aug 21, 2026
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
Sweep of all 14
cppshapes indocs/self_scan/tri_comparison_ledger.jsonvia thetri-comparison-ledger-sweepskill. All 14 nowstatus: "validated".Comparison-tooling fixes (
tests/tools/, not GitGalaxy production code, nottree-sitter/ctags themselves) accounted for the bulk of the false-discrepancy volume:
ctags_reader.py: out-of-class method names (Class::method) weren't beingre-qualified with ctags' own separate scope field, and ctags' default pattern-length
truncation was silently breaking that re-qualification on longer signatures
(
--pattern-length-limit=0added). Resolved ~1000 of the two largest shapes' ~2170combined occurrences.
ctags_reader.py:CTAGS_CLASS_KINDS["cpp"]was missing ctags' union/enum kinds(enum gated on scoped-vs-unscoped via the tag's own source line, since C++11's
enum classhas no ctags-side distinction from a plainenum). The identical gapwas found and fixed for
csharpin the same incidental-finding pass.tri_comparison_gatherer.py/tree_sitter_accuracy_audit.py: both tree-sitterwalkers counted a bare forward declaration (
class Foo;) and a plain, unscopedenum Foo {}as real class definitions — the existing C-only body-anchor guard wasnever extended to cpp, and there was no scoped-enum gate at all.
Six real GitGalaxy engine defects were confirmed via direct source reading during
the investigation. Five were filed rather than patched inline, since each has real
production blast radius and/or a design question needing its own scoped follow-up:
func_startmisses constructors with a member-initializer-list exceedingthe regex's 500-char cap
func_startmisses conversion operators with a template/generic return typeargscounting bugs (zero-undercount + constructor off-by-one overcount)func_startfalse positive on a lambda in a constructor initializer-listThe sixth, #2011 (
class_startcounting forward declarations as real classdefinitions), was fixed in a follow-up commit in this same PR — the tree-sitter walker
fix above surfaced it as a hard CI regression in
tests/tree_sitter_accuracy_baseline_cpp.json(once the walker stopped agreeing withGitGalaxy's own false positives, the gap became impossible to leave filed-but-open). A
naive copy of C's existing flat lookahead regex is unsafe for cpp — C++ multiple
inheritance (
class Foo : public A, public B {) hits its comma stop-char before thereal
{, confirmed via direct testing — so it's fixed instead with a depth-awarescanner (
_cpp_class_has_body) that correctly walks an inheritance clause's owntop-level commas and template args. Verified via 11 hand-built regression cases, the
full 122-test extraction gauntlet, and
crucible_check.pyagainst the full ~80-repocorpus (zero golden-master diff, confirmed via direct DB query to be because that
report format doesn't expose the named-class list this fix touches — not because the
fix is a no-op).
Also adds
docs/language_status/cpp.md(sections 1–8 via thelanguage-statusskill,plus a tri-comparison capstone §9 built from this sweep's own evidence, updated to
reflect #2011's fix) and regenerates the tri-comparison chart/points-of-interest doc
for all 45 languages (only
cpp/csharp's numbers actually moved).Closes #2011.
Test plan
python tests/ruff_audit.py --ci/mypy_audit.py --ci— no new findingsruff format --checkclean_cpp_class_has_body(forward decl, plaindef, single/multi inheritance, templated bases, type-use-in-declarator-list,
function-parameter-default,
finalspecifier) — all passtests/core_engine/test_detector.py(141 tests) + C's own extraction gauntlet (128 tests, unaffected) — all pass
crucible_check.py(full-precision + zero-dependency) against the full corpus —zero golden-master diff, confirmed legitimate via direct DB inspection
tree_sitter_accuracy_audit.py --lang cpp --ci— passes cleanly against theregenerated baseline (class recall 87.1% → 100.0%)
--all --writechart diff touches onlycpp/csharprows + theexpected summary-badge-count ripple
credit_toolsmisapplication during review (brieflypushed ctags' cpp precision over 100% by double-crediting an already-mutually-
agreeing 2-of-3 pair) before it shipped
🤖 Generated with Claude Code