fix(cpp): resolve cross-namespace same-tail inheritance bases bridge-held (#1993)#2005
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Tri-review — approve-with-nits (1 blocker being addressed in-PR)Method: per-PR multi-lens review → independent adversarial re-verification → static-analysis alignment (tsc/eslint/prettier, all clean) → cross-stack synthesis + critic gate. Review: PR #2005 — C++ cross-namespace same-tail heritage tie-break (#1993)Verdict: approve-with-nits. The fix is correct on the real runtime path, language-neutral, well-contained, and additive. The one thing I'd want before merge is a worker-path parity test, to match the precedent set by both predecessor lanes in this stack and the DoD's sequential≡worker requirement. What's good
FindingsMajor
Minor
Nits
Nice, surgical fix that stays within the established sidecar bridge rather than flipping the |
…orrect narrative Add the missing parse-worker.ts parity describe for the #1993 cross-namespace same-tail heritage tie-break, mirroring the #1982/#1995 worker siblings (workerThresholdsForTest minFiles:1/minBytes:1, workerPoolSize:2, usedWorkerPool guard, and the same NS1.DA→NS1.A.Inner / NS2.DB→NS2.A.Inner base assertions), and register both worker test names in LEGACY_RESOLVER_PARITY_EXPECTED_FAILURES['cpp'] (registry-primary-only, like the sequential entry). Closes the DoD sequential≡worker gap flagged in the tri-review of PR #2005. Also correct the fixture/test narrative: the pre-fix failure is a CROSS-WIRE (DB's EXTENDS binds NS1::A::Inner via the refuse-on-tie scope-walk fallback), not a silent miss — the empirical pre-fix run shows the edge exists but points at the wrong target. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
✅ Blocker resolved + narrative corrected (review follow-up)Worker-path parity test added ( Narrative correction — the review had this backwards. The synthesis recommended changing the PR body from "cross-wire" to "silent miss". The empirical pre-fix run is a cross-wire, not a silent miss: Re-stacked: #2006/#2007 rebased onto the updated #1993; chain stays linear, all PRs MERGEABLE. |
059e562 to
7d08239
Compare
…held (#1993) PR #1981's bridge fixed within-namespace same-tail heritage (NS::A::Inner vs NS::B::Inner). The residual: a cross-namespace same-tail base (NS1::A::Inner vs NS2::A::Inner) both key the namespace-omitted `A.Inner` in the qualifiedNames index, so resolveQualifiedInheritanceBase couldn't pick a winner and the deriving classes cross-wired (DB's EXTENDS bound to NS1's A::Inner). Fixed bridge-held via the existing `namespacePrefix` sidecar — no qualifiedName invariant flip, no resolution-index re-keying: (1) tagNamespacePrefixes also tags defs declared directly in a namespace (the deriving NS1::DA), composed identically to the class-nested path; (2) resolveQualifiedInheritanceBase breaks a same-tail tie by preferring the candidate whose namespacePrefix matches the deriving class's. Two-phase lookup, UDC, brace-init, file-local linkage untouched (def.qualifiedName + index keys unchanged). New cpp-cross-namespace-same-tail fixture + registry-primary test (in the cpp parity expected-failures). Verified: cpp suite 287/287 primary, 209 + 78 skips legacy — no regression; tsc + prettier clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…orrect narrative Add the missing parse-worker.ts parity describe for the #1993 cross-namespace same-tail heritage tie-break, mirroring the #1982/#1995 worker siblings (workerThresholdsForTest minFiles:1/minBytes:1, workerPoolSize:2, usedWorkerPool guard, and the same NS1.DA→NS1.A.Inner / NS2.DB→NS2.A.Inner base assertions), and register both worker test names in LEGACY_RESOLVER_PARITY_EXPECTED_FAILURES['cpp'] (registry-primary-only, like the sequential entry). Closes the DoD sequential≡worker gap flagged in the tri-review of PR #2005. Also correct the fixture/test narrative: the pre-fix failure is a CROSS-WIRE (DB's EXTENDS binds NS1::A::Inner via the refuse-on-tie scope-walk fallback), not a silent miss — the empirical pre-fix run shows the edge exists but points at the wrong target. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…pp bench baseline (#1993) F4 follow-up to #1993: declare `namespacePrefix?: string` on SymbolDefinition (gitnexus-shared) and drop the six `as { namespacePrefix?: string }` casts in walkers.ts / graph-bridge/ids.ts that #1993 introduced. Pure type-level — the `as` assertions erase at compile time, runtime is byte-identical, and the field stays a sidecar (no graph-node identity; the qualifiedName-keyed index is untouched). Also regenerate the cpp scope-capture bench baseline: rebased onto main (now carrying #1995's cpp fixtures), #1993 adds cpp-cross-namespace-same-tail, growing the cpp-* corpus 272->273 and drifting the fingerprint d63ded6->6d6207ae. Pure fixture-corpus drift — no scope-extractor change. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
355f08d to
017cf27
Compare
CI Report✅ All checks passed Pipeline Status
Test Results
✅ All 11118 tests passed 16 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
…o refactor/942-delete-legacy-resolution Two conflicts resolved: - bench/scope-capture/baselines.json: same regenerate recipe (take main's entry set, re-measure merged tree, re-apply the 6 abhigyanpatwari#942 fixture-scrub fingerprints). Bench --check PASS (14 langs). - test/integration/resolvers/helpers.ts: abhigyanpatwari#2005 added cpp entries to LEGACY_RESOLVER_PARITY_EXPECTED_FAILURES, a ~665-line legacy-parity map that abhigyanpatwari#942 deletes wholesale. Keep abhigyanpatwari#942's deletion (the map is dead once the legacy leg is gone); discard abhigyanpatwari#2005's additions to it. No resolver test references the map (tsc clean). abhigyanpatwari#2005's 67 new cpp.test.ts cases auto-merge and run as plain scope-resolution tests: cpp.test.ts 297 pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Summary
Follow-up to #1981 / #1982. PR #1981 landed a targeted bridge (
tagNamespacePrefixes+ aresolveDefGraphIdnamespace-prefixed retry) that fixes the within-namespace same-tail heritage case (NS::A::InnervsNS::B::Inner, distinguished by the class chain). The residual: a cross-namespace same-tail base (NS1::A::InnervsNS2::A::Inner) — both key the namespace-omittedA.Innerin thequalifiedNamesresolution index, soresolveQualifiedInheritanceBasecould not pick a winner and the deriving classes cross-wired (DB's EXTENDS bound to NS1'sA::Inner).Fixed bridge-held — without flipping the class-chain-only
qualifiedNameinvariant (which would re-bite two-phase lookup / UDC / brace-init) and without re-keying the resolution index.Fix
The
namespacePrefixsidecar (set bytagNamespacePrefixes, deliberately separate fromqualifiedName) already records each namespaced def's enclosing namespace. Two sidecar-only changes:tagNamespacePrefixesnow also tags defs declared directly in a namespace (e.g. the derivingNS1::DA), composed identically to the existing class-nested path. The original loop only reached class-nested defs (A::Inner).resolveQualifiedInheritanceBase, on a same-tail tie at a key, breaks the tie by preferring the candidate whosenamespacePrefixmatches the deriving class's — the base in the same enclosing namespace. It still refuses when the sidecar can't pick a unique.def.qualifiedNameand thequalifiedNamesindex keys are untouched, so two-phase lookup, UDC ranking, brace-init, and file-local linkage are unaffected. The deferred root-cause work (makingqualifiedNamenamespace-inclusive and removing the bridge) is unchanged and out of scope.Tests
New
cpp-cross-namespace-same-tailfixture + test (registry-primary, in the cpp parity expected-failures like the #1982 namespaced tests):NS1.DAEXTENDSNS1.A.InnerandNS2.DBEXTENDSNS2.A.Inner— positive base-identity by the resolved node'squalifiedName, which fails pre-fix (DBcross-wired toNS1.A.Inner).Verification
cppresolver suite: registry-primary 287/287, legacy green — no regression to brace-init, UDC, two-phase lookup, ADL, file-local linkage, or the within-namespace (Qualified nested-type node identity — resolution-side follow-up (Ruby same-tail routed-props/mixins + Rust inherent impls) #1982) namespaced-collision tests.tsc --noEmitclean; prettier clean.Closes #1993.
🤖 Generated with Claude Code