Skip to content

fix(typescript): add abstract_method_signature to tri-comparison audit's func_node_types - #2303

Merged
squid-protocol merged 2 commits into
mainfrom
fix/typescript-abstract-method-signature-tricomparison
Aug 26, 2026
Merged

fix(typescript): add abstract_method_signature to tri-comparison audit's func_node_types#2303
squid-protocol merged 2 commits into
mainfrom
fix/typescript-abstract-method-signature-tricomparison

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Summary

Fixes the last remaining typescript function tri-comparison discrepancy (found via this repo's tri-comparison-ledger-sweep skill's step 2.5 full-corpus raw diff): GitGalaxy over-detecting 2 functions relative to tree-sitter in vscode/lifecycle.ts (createReferencedObject/destroyReferencedObject, both bodyless protected abstract method declarations).

Root cause

tree-sitter-typescript parses a bodyless abstract method (protected abstract createReferencedObject(key: string, ...args: unknown[]): T;, lifecycle.ts:711-712) as a distinct abstract_method_signature node, separate from method_signature. tests/tools/tree_sitter_accuracy_audit.py's NODE_MAPS["typescript"]["func_node_types"] only listed method_signature, so the audit's own tree-sitter ground truth undercounted by 2 and misreported it as GitGalaxy over-detection. Same ground-truth-tool-gap shape as the existing #1338 class_node_types fix immediately below it in the same file (which added interface_declaration/enum_declaration).

This is a tool-side bug in the audit, not a GitGalaxy defect: the ledger shape typescript/function/existence/agree[gitgalaxy]_vs[ctags,tree_sitter] was already validated with verdict "GitGalaxy correctly extracts abstract methods" and credit_tools: [gitgalaxy] — this PR just fixes the audit tool so it stops disagreeing with an already-confirmed-correct GitGalaxy result.

Fix

Added "abstract_method_signature" to typescript's func_node_types set. _get_node_name's existing generic field-lookup already resolves the name correctly for this node type (confirmed via direct parse) — no special-case needed.

Verification

  • Full-corpus, duplicate-aware (collections.Counter, not a naive set diff — a set diff undercounts same-name duplicates) name diff via tri_comparison_gatherer.gather_language('typescript'):
    • Before: 2 false "extra" in GitGalaxy, 3 pre-existing "missing" (unrelated, already tracked under other filed issues).
    • After: 0 extra, same 3 pre-existing missing untouched.
  • ctags --version confirmed real Universal Ctags before regen.
  • tri_comparison_chart.py --all --write (full 45-language regen).
  • tri_comparison_report.py --write.
  • tests/ruff_audit.py --ci — no new findings.
  • tests/mypy_audit.py --ci — no new findings.
  • Ledger diff scoped to the target shape (still_reproduces auto-flipped truefalse, no manual edit) plus expected downstream ripple in sibling typescript shapes from the reconciler's per-file RANK-based pairing now that tree-sitter's own signal is more complete; one unrelated php entry changed only due to a non-deterministic anonymous-class hash name from ctags, not this change.

Test plan

  • Duplicate-aware full-corpus diff confirms 0 remaining discrepancy for this shape
  • tri_comparison_chart.py --all --write
  • tri_comparison_report.py --write
  • tests/ruff_audit.py --ci
  • tests/mypy_audit.py --ci

🤖 Generated with Claude Code

@squid-protocol
squid-protocol enabled auto-merge (squash) August 26, 2026 22:23
squid-protocol and others added 2 commits August 26, 2026 18:24
…t's func_node_types

tree-sitter-typescript parses a bodyless abstract method (e.g. `protected
abstract createReferencedObject(...): T;`, vscode/lifecycle.ts:711-712) as a
distinct abstract_method_signature node, separate from method_signature.
tree_sitter_accuracy_audit.py's NODE_MAPS only listed method_signature, so the
audit undercounted tree-sitter's own true signal by 2 and misreported it as
GitGalaxy over-detecting -- the exact same ground-truth-tool-gap shape as the
existing #1338 class_node_types fix just above it in the same file. GitGalaxy
was already correct here (ledger shape
typescript/function/existence/agree[gitgalaxy]_vs[ctags,tree_sitter] was
already validated with credit_tools: [gitgalaxy]); this just fixes the
audit tool so it no longer disagrees with a correct GitGalaxy result.

Verified via a full-corpus, duplicate-aware (Counter, not set) name diff:
before, 2 false "extra" occurrences in gitgalaxy vs. 0 missing; after, 0
extra, same 3 pre-existing (already-tracked, unrelated) missing occurrences
untouched. Regenerated the tri-comparison chart/ledger/points-of-interest
(--all --write per this repo's standing rule); the target shape's
still_reproduces flipped to false automatically, no manual ledger edit
needed. ruff/mypy audits clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Rebased onto main after its own auto-update companion workflow
(docs: auto-update tri-comparison data #2299) landed the same generated
artifacts -- the expected false-conflict-from-squash-merge shape this repo's
tri-comparison-ledger-sweep skill documents. Resolved by keeping this
branch's version of the three generated files through the rebase, then
regenerating fresh on the new base (ctags confirmed real Universal Ctags
first) rather than hand-merging. Target shape
(typescript/function/existence/agree[gitgalaxy]_vs[ctags,tree_sitter])
confirmed still still_reproduces: false on the fresh base. ruff/mypy clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@squid-protocol
squid-protocol force-pushed the fix/typescript-abstract-method-signature-tricomparison branch from 9badb58 to f9004de Compare August 26, 2026 22:27
@squid-protocol
squid-protocol merged commit df25fa5 into main Aug 26, 2026
26 of 27 checks passed
@squid-protocol
squid-protocol deleted the fix/typescript-abstract-method-signature-tricomparison branch August 26, 2026 22:28
@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.

1 participant