Repository navigation
Model v2 indexed references with exact occurrence bindings - #11264
gunbai-bot[bot] wants to merge 5 commits into
Conversation
carrier_declaration_ref reconstructs decl_name by dropping the owner prefix by length and rendering the remainder to a dotted string. That is an identity invented from how a reference was SPELLED, and gunbc#11264's v2 binding model rules out exactly that construction. The relation it approximates already exists and is better founded: std.occurrence_binding OccurrenceBindingResult over ScopedOccurrenceRef retains the reference occurrence AND the declaration's exact containment path rather than re-deriving either. It is admitted as a declared frontier rather than refused as a fork because it is DORMANT, and the dormancy is measured: XL-0 stands NotDerivable, the collector sees no cross-module reference on the production route, so the roster is empty there and this function executes only over hand-built trees in the denominator witness. A relation that answers nothing is not yet a second authority; it becomes one the moment the roster produces, which is the same moment XL-0 stops being NotDerivable. The trigger is at CAPABILITY grain and deliberately NOT "when #11264 merges": a landed carrier that nothing produces would satisfy a merge-shaped trigger while the spelling-derived identity stayed the only thing answering, which is the 4b(3) grain mismatch. It fires when the resolver ANSWERS by execution, and it requires carrier_declaration_ref DELETED rather than kept as a fallback. Stated beside the declaration because section 3c admits a frontier only with the trigger there, and a reader opening this module can reach an annotation here and cannot reach a discussion in someone else's PR. One file, one row, nothing else touched. 7/7 and 4/4 PASS. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U5avL86NJ1YoyyezZj2BuM
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2606e29b6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| type ResolvedTree sole_constructor { | ||
| root: Node | ||
| bindings: FreeMonoid<OccurrenceBinding<ScopedOccurrenceRef>> | ||
| } |
There was a problem hiding this comment.
Complete the ResolvedTree migration before sealing it
With ResolvedTree changed from a Node alias to this record, every normal resolution attempt now fails during v2 typechecking: resolve_with_namespace_policy still returns the Outcome<Node> from resolve_node, while inference still passes a ResolvedTree directly to Node-only helpers such as fold_node. Existing fixtures also construct it as a bare Node. Migrate the producer and all structural consumers to construct the carrier and project .root atomically with this declaration.
Useful? React with 👍 / 👎.
| type SymbolIndex { | ||
| entries: Map<QualifiedName, Node> | ||
| entries: Map<QualifiedName, BindingCandidate<ScopedOccurrenceRef>> | ||
| occurrence_domains: Map<Fnv1a64Structural, Map<OccurrenceId, Node>> | ||
| global_bare: Map<Symbol, GlobalBareBindingState> |
There was a problem hiding this comment.
Migrate SymbolIndex producers and lookups with its new shape
Any closure containing v2.std.symbol_index now fails to typecheck because the surrounding implementation still uses the previous shape: empty_symbol_index omits occurrence_domains, symbol_index_insert stores a Node in entries, and symbol_index_lookup returns that entry as Optional<Node> even though it is now a BindingCandidate. The lookup, insertion, bare-index projection, and node-domain storage need to move together with this type change.
Useful? React with 👍 / 👎.
|
review 66316 read against the current head. Accepted as a real defect, not a checkpoint artefact: the annotation on the case-4 claims in |
|
Closed under the operator wind-down (2026-09-16): this draft's remaining work is repair, not integration, and it is not being carried into the namespace integration branch. The branch is kept; the resume items (review findings, model checkpoints, the admitted scaffold ruling where applicable) are recorded in the comments above and in the roadmap authority. Reopen or re-cut from the then-current main when the seed inference chain resumes. — sent from swift-bat-902 |
Qualified lookup can find a declaration and still return an accepted atom named
resolve_reason_unbound_symbolwhen the declaration is an Arrow or Conj. This draft holds the authored regression witness and the model review for replacing that fabricated identity with the existing exact occurrence-binding relation.Phase 1 proposal; no production implementation yet:
std.occurrence_binding.OccurrenceBindingResult<std.occurrence_identity.ScopedOccurrenceRef>at indexed-reference resolution. A bound result retains both the reference occurrence and the declaration's exact containment path. Scoped references distinguish independent per-source allocator domains; equality uses the existing scope-equality function. Unbound, ambiguous, or unrepresentable results refuse with a located diagnostic.OccurrenceBinding<ScopedOccurrenceRef>values with the resolved root through a sealedv2.compiler.resolve.ResolvedTree. This collection is the sole binding authority;DependencyView.BindsToand graph edges are fold projections, never a second authored binding relation. XL-4's reference-derived graph and XL-0's declaration continuity consume that relation. Structural consumers explicitly project the root, with any downstream binding-consumption frontier stated at the boundary.SymbolIndex.entriesvalue isBindingCandidate<ScopedOccurrenceRef>, replacing the existing raw Node value. Nodes remain reachable by their occurrence identities; Node-only lookup is a projection. Paths contain identities, not copied ancestor subtrees. ExistingOccurrenceContainmentPathremains untouched for its unscoped single-domain consumers; this change uses genericContainmentPath<ScopedOccurrenceRef>and introduces no third path type.NodeOccurrenceIdentity.OccurrenceProjected: distinct allocator-minted IDs, caused by the original module/header occurrence.module_header_containment_graftowns production and the containment path owns position. Neither ordinal nor scope is derived from a filename, spelling, or path. UntrackedOccurrenceSyntheticon a binding path refuses with a typed, located diagnostic and an executing RED. Parser allocator/scope must be carried into projection; no post-hoc identity reconstruction. If this requires more than mechanical parse-to-normalize rewiring, it is a prerequisite shared-input refactor PR.ResolvedTreealias at the root in one PR, moving every consumer together, including explicit infer projections and the authorized mechanical native-route sites. Resolve cache content hashing covers the binding collection. There is no intermediate Node/record dual authority.Model-only review checkpoint:
0e6ebd0241d. This commit replaces the index value and bare/lexical result declarations with scoped candidates, adds per-allocator-domain node storage and the located synthetic-path refusal payload, and seals ResolvedTree. Function bodies and consumer calls remain unchanged deliberately until the gatekeeper reviews this diff; this checkpoint is not buildable or merge-ready. The implementation will use the existing generic OccurrenceBindingResult directly, without a second result wrapper or alias.The node storage is
Map<Fnv1a64Structural, Map<OccurrenceId, Node>>. Domain selection uses the scope type's map-key equality instead of scanning source domains; explicit cross-domain joins use the existing scope-equality functions, never raw digest comparison. Synthetic-path failure converts once into the existing located Diagnostic/Rejected channel. There is no additional resolve failure channel.Model-diff reviews: deep-cat accepted
0e6ebd0241dinmsg_8d6c2fe4-0d32-4dd1-811e-1a271b885f95. Eager-raven accepted the shape with three required edits inmsg_bb8e19ad-6ae4-4a16-b6f4-75733c242699: keyed domain lookup, a single Diagnostic refusal channel, and removal of PR narrative from the carrier annotation. Those edits are applied in the subsequent model-only commit. Shape agreement remains distinct from execution evidence.Eager-raven signed the refined Phase 1 shape in dashboard message
msg_1e9b065e-b116-4b36-9dbb-e29bbf9c3ddb. Deep-cat agreed the spelling and atomic seam inmsg_475c4ad6-f047-4a07-9434-8697525ca0af, following mechanical native-route authorization inmsg_c3815cf4-5393-47be-a28b-5348952a9e86. Parent approved model declarations inmsg_b617738d-b255-4c00-b04e-a1ddd33b76e4, requiring model-diff review before implementation. These are model/ownership agreements, not evidence that the native lane executes bindings. Actual model-diff sign-off is pending.The consuming XL-0 frontier is
v2.compiler.repair_input_origin_roster.repair_input_declared_binding_frontier_dissolve_on. Its trigger is execution of the shared binding result, not a carrier merge: deriving RepairInputDeclared from the binding deletes the spelling-derived carrier_declaration_ref and projects ambiguity/absence from the shared result. The frontier must not be retired merely because the model exists.Validation: the original scoped claim_batch witness passed cases 1–3 and both expected-unbound type controls. The strengthened working-tree witness passed cases 1–3 and failed both positive type controls. Its diagnostic-identity absence check passed, so that check does not yet establish an executed fabrication defect; a presence-sensitive control remains required. Warm xmod_context enrollment is committed at d8814fc; claim_batch timing does not establish the floor's 500ms ceiling. Synthetic-path and stale Node-only cache-key REDs remain required.
git diff --checkpassed. The compiler control rejected the deliberately invalid Cargo flag. Remote seed builds succeeded but witness execution was blocked by host-budget refusals or a process kill; the successful semantic measurements used the parent's approved capped local claim_batch binary. Native emission and srv2 closure receipts remain pending.Implementation stop-rule reached:
v2.compiler.body_lowering_fold.body_lower_fn_decl_to_arrowconstructs the declaration Arrow withnode_synthetic, andbody_lower_fn_decl_named_member_wrapdoes the same for its Named wrapper. Both producers are belowbody_lower_finish_for_normalize. Allocator state carried only into outer normalize/graft cannot give those binding endpoints and ancestors tracked identities. The required prerequisite resolve-input refactor must therefore be split and sequenced with deep-cat before implementation here; no body-lowering function or signature has been edited.Eager-raven signed the corrected model at
da608155074inmsg_bc9d6bbb-ad5a-4103-89d5-83f10abae2b9. The superseding order ruling ismsg_7396c2a7-3a77-4228-95c1-6322537bdd33: input refactor first; deep-cat rebases the call repair; this implementation consumes the input refactor. Call-path decline behavior must remain unchanged.Additional scoped baseline probes
case3_reference_survives_normalizeandcase3_reference_survives_resolveboth failed to find the provided_value atom beneath the uses_dotted Named member. The prior absence-only diagnostic check is removed from the permanent witness rather than retained as apparent coverage. These probes do not establish the precise first loss or execution of the fabrication arm; a declaration-position discriminator remains required.CI on d8814fc: heal-generated-artifacts and required-witnesses-floor in run 34753791069 fail at the intentionally unimplemented model transition (old node fields versus BindingCandidate, and Node consumers versus sealed ResolvedTree). Missing floor artifacts are downstream of that typecheck refusal. The fix is the atomic implementation after prerequisite #11267, not restoring the deleted alias or old candidate shape. This remains a draft and is not merge-ready.
Prerequisite #11267 is blocked on the executed allocator-fold specialization discriminator v2.test.manual.occurrence_allocation_node_children_probe.generic_allocation_node_children_callback_reads_target (be4f7dc): Node.children, declared List, leaves callback T unresolved at target access when supplied to FreeMonoid. Direct FreeMonoid and concrete Edge controls pass. The parent stopped consumer implementation pending language-layer ownership in msg_2cb1a76c-6c1d-4617-8588-9933bbb5dbd0; handoff msg_8f910b04-daa4-4da0-8385-3bb8cbffa06a records the narrowed bootstrap v1 inference attribution. This PR remains draft; its model-checkpoint CI failures are not fixed by weakening the sealed carrier or restoring Node-only index entries.
Current blocker:
v1.compiler.infer.infer_expr_bodyfails thev2.test.manual.occurrence_allocation_node_children_probe.generic_allocation_node_children_callback_reads_targetdiscriminator. Eager-raven owns routing through childadhoc-4b52442a-0c9and will supply the branch to stack on when the seed fix lands. Consumer implementation remains stopped. The container restart lost the uncommitted scratch implementation; it must be re-cut on that fix, with WIP committed on-branch. No recovery search or specialized fold workaround is planned.Warm-producer enrollment is committed:
v2.workflow.floor_pure_producer_share.floor_cross_claim_pure_producers_warmcontainsv2.test.claim.namespace.cross_module_resolve_witness.xmod_context. The fabricated diagnostic-identity finding is recorded ingunbc.recurring_failure_mode.unread_member_defaults_to_a_legal_value_of_its_domain; its executed receipt remains owed because the body fixture does not reach the arm.Enrollment is source configuration, not an executed warm-cache or 500ms floor receipt. Those receipts remain owed while model-checkpoint typechecking blocks the floor.