Skip to content

Preserve lexical occurrence roles in let initializers - #7382

Merged
briansrls merged 3 commits into
mainfrom
agent/adhoc-66df748f-480-let-role-witness
Jul 28, 2026
Merged

briansrls merged 3 commits into
mainfrom
agent/adhoc-66df748f-480-let-role-witness

Conversation

@briansrls

@briansrls briansrls commented Jul 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Make ExprLet initializer children classify from their own syntax instead of inheriting the generic declaration-head TypeOccurrence role. The explicit type-annotation edge remains TypeOccurrence.

Add a modeled parser witness for let x = y that requires the x declaration and y initializer reference to remain LexicalValueOccurrence while both Int annotations remain TypeOccurrence. Expand the existing generated production serde witness to compile two modules with equal authored names, prove graph-scoped occurrence IDs are disjoint, and round-trip each TypedModule plus the enclosing ResolvedGraph exactly.

This is a bounded follow-up to #7352. It does not add resolver selection, Node-attached identity, ownership, emitter/runtime behavior, or premature stage0 adoption of std.occurrence_binding.

Test plan

  • target/release/claim_batch ... --functions w_pattern_parser_materializes_dedicated_declaration_nodes,...,w_production_frontend_refuses_duplicate_reference_rows — 13/13 PASS.
  • cargo test --manifest-path src/v1/stage0/Cargo.toml pipeline_occurrence_sidecar_serde_round_trip -- --nocapture — PASS; two production modules, standalone TypedModule serde, ResolvedGraph serde, and disjoint IDs.
  • target/release/regen_stage0 --verify — regen_divergence_count=0.
  • cargo fmt --all -- --check — PASS.
  • git diff --check — PASS.

Original parent: 220b556d537e9cce55f419c3ebfbac9c5eb80f72 (#7352).
Current-main synchronization: merge commit 69a44bbd2da82c0b031008c9c2af8107ca9b7c7a includes origin/main a00048fd47; no occurrence-transport conflicts or product edits.

@gunbai-bot gunbai-bot Bot changed the title Exact declaration Nodes + ContainmentPath transport prerequisite Preserve lexical occurrence roles in let initializers Jul 28, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 28, 2026 19:38
@briansrls
briansrls merged commit b172786 into main Jul 28, 2026
5 checks passed
@briansrls
briansrls deleted the agent/adhoc-66df748f-480-let-role-witness branch July 28, 2026 21:33
@gunbai-bot gunbai-bot Bot mentioned this pull request Jul 29, 2026
6 tasks
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