Skip to content

Validate cpp tri-comparison ledger; fix ctags/tree-sitter comparison-tooling bugs - #2015

Merged
squid-protocol merged 1 commit into
mainfrom
chore/tri-comparison-sweep-cpp
Aug 21, 2026
Merged

Validate cpp tri-comparison ledger; fix ctags/tree-sitter comparison-tooling bugs#2015
squid-protocol merged 1 commit into
mainfrom
chore/tri-comparison-sweep-cpp

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Aug 21, 2026

Copy link
Copy Markdown
Owner

Summary

Sweep of all 14 cpp shapes in docs/self_scan/tri_comparison_ledger.json via the
tri-comparison-ledger-sweep skill. All 14 now status: "validated".

Comparison-tooling fixes (tests/tools/, not GitGalaxy production code, not
tree-sitter/ctags themselves) accounted for the bulk of the false-discrepancy volume:

  • ctags_reader.py: out-of-class method names (Class::method) weren't being
    re-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=0 added). Resolved ~1000 of the two largest shapes' ~2170
    combined 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 class has no ctags-side distinction from a plain enum). The identical gap
    was found and fixed for csharp in the same incidental-finding pass.
  • tri_comparison_gatherer.py / tree_sitter_accuracy_audit.py: both tree-sitter
    walkers counted a bare forward declaration (class Foo;) and a plain, 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 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:

The sixth, #2011 (class_start counting forward declarations as real class
definitions), 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 with
GitGalaxy'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 the
real {, confirmed via direct testing — so it's fixed instead with a depth-aware
scanner (_cpp_class_has_body) that correctly walks an inheritance clause's own
top-level commas and template args. Verified via 11 hand-built regression cases, the
full 122-test extraction gauntlet, and crucible_check.py against the full ~80-repo
corpus (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 the language-status skill,
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 findings
  • ruff format --check clean
  • 11 hand-built regression cases for _cpp_class_has_body (forward decl, plain
    def, single/multi inheritance, templated bases, type-use-in-declarator-list,
    function-parameter-default, final specifier) — all pass
  • Full cpp extraction gauntlet (122 tests) + tests/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 the
    regenerated baseline (class recall 87.1% → 100.0%)
  • Verified --all --write chart diff touches only cpp/csharp rows + the
    expected summary-badge-count ripple
  • Caught and corrected a credit_tools misapplication during review (briefly
    pushed ctags' cpp precision over 100% by double-crediting an already-mutually-
    agreeing 2-of-3 pair) before it shipped

🤖 Generated with Claude Code

…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>
@squid-protocol
squid-protocol merged commit b5495c9 into main Aug 21, 2026
26 of 27 checks passed
@squid-protocol
squid-protocol deleted the chore/tri-comparison-sweep-cpp branch August 21, 2026 13:32
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cpp class_start counts forward declarations as real class/struct definitions

1 participant