test(csharp): companion fixture for #1066 frozen-bucket regression#1085
Merged
magyargergo merged 1 commit intoApr 27, 2026
Merged
Conversation
…t regression The csharp-large-cache-miss-resolution fixture added in abhigyanpatwari#1082 reproduces the freeze contract failure via tree-sitter cache-miss reparse on >32 KB files. This adds a complementary trigger for the same root cause that does not depend on file size: a small-file pair where the importer locally declares a class with the same simple name as a sibling reached through `using`. Pre-abhigyanpatwari#1082 path: scope-extractor pre-populates (and freezes) `User` in the importer's Module bindings, then populateCsharpNamespaceSiblings' namespace-import loop calls push() on the frozen array and throws "Cannot add property N, object is not extensible", aborting the whole scopeResolution phase. Post-abhigyanpatwari#1082 the augmentation channel keeps both bindings visible; the local `Collision.App.User` shadows the namespace-imported one per origin precedence, so `Program.Run -> new User()` resolves to the local class. Three assertions: - scopeResolution completes (no throw on the colliding bucket). - both `User` declarations are detected across the two namespaces. - `Program.Run -> User` constructor edge points at App/Program.cs (not Models/User.cs), verifying origin:local shadows origin:namespace. Verified: full csharp.test.ts suite green (207/207). tsc --noEmit clean. Refs: abhigyanpatwari#1066, abhigyanpatwari#1082, abhigyanpatwari#1083 (closed as superseded).
|
@mann1x is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
CI Report✅ All checks passed Pipeline Status
Test Results
✅ All 7472 tests passed 97 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
Merged
5 tasks
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
Adds a small-file companion fixture for the freeze-contract regression fixed in #1082. The merged
csharp-large-cache-miss-resolutionfixture reproduces the failure via the >32 KB tree-sitter cache-miss reparse path; this fixture trips the sameObject.freezecontract inpopulateCsharpNamespaceSiblingsthrough a different trigger that doesn't depend on file size:Pre-#1082 the populator pushed onto the frozen array →
TypeError: Cannot add property N, object is not extensible→ the wholescopeResolutionphase aborted for the repo. Post-#1082 the augmentation channel keeps both bindings visible to readers; the localCollision.App.Usershadows the namespace-imported one per origin precedence.This is the trigger we originally hit on the PersistentWindows real-world WinForms repo and used to reproduce the bug in the (now-closed) #1083 — adding it here as resolver coverage so the freeze contract is locked-in on both reproduction paths.
Fixture
test/fixtures/lang-resolution/csharp-frozen-binding-collision/:Models/User.cs—namespace Collision.Models { public class User { ... } }App/Program.cs—using Collision.Models;+namespace Collision.App { public class User { ... } public class Program { ... } }Tiny by design — the bug is shape-driven, not size-driven, so the fixture stays small and fast (567 ms for the new describe vs ~25 s for the cache-miss fixture in the same suite).
Tests
New describe block in
test/integration/resolvers/csharp.test.ts, sibling to the merged'C# large-file + frozen-bucket regression (issue #1066)'block:completes scopeResolution without throwing on the colliding bucket— the freeze regression itself.detects both User declarations across the two namespaces— pins augmentation visibility.resolves Program.Run -> local Collision.App.User constructor (origin:local shadows namespace)— pins the precedence contract that makes the augmentation channel architecturally correct (not just non-throwing).Crossreference:
test/integration/resolvers/csharp.test.ts:2454(cache-miss-reparse trigger) ↔ new block (collision-via-using-import trigger). Both anchor on the samebindingAugmentationsmachinery added in #1082; either one reverting reproduces #1066.Validation
npx vitest run test/integration/resolvers/csharp.test.ts→ 207 passed / 0 failed (was 204; +3 new).npx tsc --noEmit→ clean.upstream/main(fix(ingestion): two-channel binding lifecycle (closes #1066) + scope-resolution I8 hardening #1082 merged): 0 freeze errors, 1113 nodes / 2987 edges / 39 clusters / 97 flows vs 1025 / 1715 / 28 / 25 with the closed fix(csharp): copy-on-read frozen binding arrays in namespace-siblings #1083 workaround. The augmentation channel reaches ~74 % more cross-file edges than copy-on-read could.Test plan
npx vitest run test/integration/resolvers/csharp.test.ts(full file)npx tsc --noEmitingitnexus/indexes.bindings) — same shape as the merged Analysis failed: Phase 'scopeResolution' failed: Cannot add property 2, object is not extensible #1066 fixture's bidirectional revert verification