Repository navigation
Native resolve: a module sees only its own declarations and imports (no ancestor leak) + the imports that relied on it - #13315
Merged
Conversation
symbol_index_lexical_collect drops a candidate whose declaring path is already in the population, so one declaration reached by its own import plus an ancestor's import (or the ancestor that declares it) is one candidate. Distinct declarations under one name still refuse as ambiguous. Controls in v2.test.claim.binding.lexical_candidate_declaration_identity. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…no ancestor leak) SymbolIndex records each module's root (module_roots, written by symbol_index_fill); symbol_index_lexical_collect stops ascending there. Operator ruling 2026-10-04. Controls: v2.test.claim.binding.module_scope_no_ancestor_leak. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…38 modules, 62 names) Derived, not hand-picked: for each module with an ancestor module, every name it uses that it neither declares nor imports and that an ancestor imported or declared gets the import the leak supplied (same source module, so resolution is unchanged). No import cycle introduced. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…t block; doubled comma) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…t-free files Declaring an import turns a file's bare channel off (UnimportedBareProvider); each name here is imported from the provider the floor named. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…field Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… stated condition The arm read 'if [nesting-granted scope] is not [kept], these references become residual and this arm dissolves'. The 2026-10-04 ruling answers that: a module sees only its own declarations and imports. The nesting control now asserts the stripped nested reference is the one residual row. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
… the three symbol_index presence checks Review 76019: symbol_index_is_module_root_at copied the hand-rolled Optional-to-Bool shape of its two siblings. All three now read map_contains_key. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Addressed review 76019's finding in ba25306. I added one map-membership predicate, |
gunbai-bot Bot
pushed a commit
that referenced
this pull request
Oct 5, 2026
After #13315 gave analyze.dag explicit imports, emit-build refused three element binders (no field 'label'/'target' on type 'T') at the List<Edge> walks this PR added via a Cons match and list_map. They now use the fold(.., fn(acc, e)) form every other edge walk in the file uses, prepending and reversing once. fold_analysis 23/27 (4 rostered), compile gate 4/4. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Step 2 of R1 (docs/plans/native-resolve-frontier-root-causes.md). Implements the operator ruling of 2026-10-04: no shadowing, and a module sees only its own declarations and its own imports. Step 1 was the identity dedup in #13205, which has merged.
The wall
v2.std.symbol_indexSymbolIndexgainsmodule_roots: Map<QualifiedName, ModuleRootDeclared>. It is written byv2.compiler.symbol_index_fillsymbol_index_fill_module_declarations(viasymbol_index_mark_module_root) for every module it fills.symbol_index_lexical_collectstops ascending at the referencing module's root. Before this change it continued into ancestor module positions, soextdeps.bmc.accesssaw every import and declaration ofextdeps.bmc.resolve_expected_rename_chain(which passes a declaration path) gets it too.Controls:
v2.test.claim.binding.module_scope_no_ancestor_leakBoth modules are filled through
symbol_index_fill_module_root, the parent's import is bound throughsymbol_index_bind_at, and every claim runs the real walk and the real selection.an_ancestor_modules_import_is_not_in_scope_in_a_contained_modulean_ancestor_modules_declaration_is_not_in_scope_in_a_contained_modulea_modules_own_declaration_is_in_scope_from_inside_ita_modules_own_import_is_in_scope_in_that_modulegunbc run --claim-run). Their outcomes are the same with and without this change. Two files carry 4 failures that are already red without the wall:normalize.operation_requires_edge(2)provenance.loaded_carrier_receipts(2)The dependents land with the wall
This follows calm-boar-904's condition: the dependents are fixed in the same motion, not handed off.
extdeps_external_authority_anchorambiguity between a child module's anchor and its parent's.v2.test.claim.parse.expression_bodied_fn_decl_parse): refusing modules 75 → 75.🤖 Generated with Claude Code