Skip to content

Fix record-lit field authority for v2.std.algebra literals (P0 field-wall follow-up) - #6705

Closed
gunbai-bot[bot] wants to merge 1 commit into
mainfrom
session/infer-record-lit-field-authority
Closed

gunbai-bot[bot] wants to merge 1 commit into
mainfrom
session/infer-record-lit-field-authority

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Unblocks claim_executor plan resolve after main #6663 P0 field wall landed.

When typechecking annotated record literals like Monoid<Diagnostics> = Monoid { semigroup: ... }, presence checking fell through to lookup_type_by_name("Monoid") and picked std.algebra's flat Monoid (expects op) instead of the imported v2.std.algebra decl (expects semigroup). This caused false MissingField reds across v2.std.{diagnostic,logic,nat,integer}.

  • record_lit_instantiated_fields: use type_node_label + decl.children
  • record_lit_expanded_from_expected: type_node_label for applied types
  • infer_record_lit presence fallback: try record_lit_fields_from_expected before bare-name lookup

Split from #6694 per review scope feedback.

Test plan

  • CI floor green (claim_executor plan resolve for ci_floor_plan.dag)
  • cargo fmt --all --check

Made with Cursor

P0 field wall (#6663) exposed false Monoid/BooleanAlgebra MissingField
reds: presence checking used global lookup_type_by_name (std.algebra flat
Monoid) instead of the instantiated decl from the type annotation. Use
type_node_label for applied-type matching, decl.children for template
fields, and record_lit_fields_from_expected before bare-name fallback.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Verified @claude/claude-opus-4-7 APPROVE against HEAD 6724ab63c:

  • record_lit_expanded_from_expected / record_lit_instantiated_fields use type_node_label (structural) instead of authored_name_at (position-based) for applied-type matching
  • Instantiated template fields come from decl.children directly, not record_lit_expected_fields re-lookup
  • infer_record_lit presence fallback tries record_lit_fields_from_expected before bare lookup_type_by_name
  • .dag and v1_compiler_infer.rs edits mirror one-for-one

No code change required on this branch.

— sent from warm-carp-214

@gunbai-bot

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Verified @cursor/composer-2.5 APPROVE (38593) against HEAD 6724ab63c:

  • presence_fields now walks record_lit_fields_from_expected before bare lookup_type_by_name — aligned with struct_fields ladder (04_infer.dag:2984-2994)
  • type_node_label replaces authored_name_at in record_lit_expanded_from_expected / record_lit_instantiated_fields for applied/synthetic expected types
  • decl.children used directly when decl is in hand (no redundant record_lit_expected_fields re-lookup)
  • .dag / v1_compiler_infer.rs mirror one-for-one

No code change required on this branch from warm-carp-214. CI red on this PR is the same main-inherited #6663 field-wall regression; standing down per operator escalation to main-fix lane.

— sent from warm-carp-214

briansrls added a commit that referenced this pull request Jul 16, 2026
Reverts src/v1/04_infer.dag and v1_compiler_infer.rs to origin/main
(#6701/#6696). The cherry-picked #6705 delta was redundant after rebase
and caused generated-artifact / regen drift.

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request Jul 16, 2026
Reverts src/v1/04_infer.dag and v1_compiler_infer.rs to origin/main
(#6701/#6696). The cherry-picked #6705 delta was redundant after rebase
and caused generated-artifact / regen drift.

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request Jul 16, 2026
Reverts src/v1/04_infer.dag and v1_compiler_infer.rs to origin/main
(#6701/#6696). The cherry-picked #6705 delta was redundant after rebase
and caused generated-artifact / regen drift.

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request Jul 16, 2026
Reverts src/v1/04_infer.dag and v1_compiler_infer.rs to origin/main
(#6701/#6696). The cherry-picked #6705 delta was redundant after rebase
and caused generated-artifact / regen drift.

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request Jul 16, 2026
…ia the existing value-expression path, prove behavioral equivalence to v1 seed (hermetic per-PR + wet oracle), flip frontier row SeedRetained->SelfEmitted. Copy the use_site_verdict pilot template (#6675). v2-only leaf, shim-free. (#6704)

* WIP: Wave 2 Band A self-emit: discovery_enumeration — self-emit its Rust via

* WIP: Wave 2 Band A self-emit: discovery_enumeration — self-emit its Rust via

* Fix record-lit field authority for v2.std.algebra annotated literals.

P0 field wall (#6663) exposed false Monoid/BooleanAlgebra MissingField
reds: presence checking used global lookup_type_by_name (std.algebra flat
Monoid) instead of the instantiated decl from the type annotation. Use
type_node_label for applied-type matching, decl.children for template
fields, and record_lit_fields_from_expected before bare-name fallback.

Co-authored-by: Cursor <cursoragent@cursor.com>

* WIP: Wave 2 Band A self-emit: discovery_enumeration — self-emit its Rust via

* WIP: Wave 2 Band A self-emit: discovery_enumeration — self-emit its Rust via

* Fix compile-clean parse error in stage0 crate layout witness.

Keep the self-emitted count comparison on one line; a newline before ==
broke DAG parsing (expected expression, found EqEq).

Co-authored-by: Cursor <cursoragent@cursor.com>

* Drop redundant infer cherry-pick; main already has record-lit fix.

Reverts src/v1/04_infer.dag and v1_compiler_infer.rs to origin/main
(#6701/#6696). The cherry-picked #6705 delta was redundant after rebase
and caused generated-artifact / regen drift.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Align infer with main after rebase (drop surviving cherry-pick hunk).

Keeps src/v1/04_infer.dag and v1_compiler_infer.rs identical to origin/main
so regen_verify and generated-artifact drift gates stay clean.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Regen bootstrap_stage0_crate_layout_generated.rs (trailing-comma drift).

main_wet byte-compare caught a hand-merge comma in the last filename
entry; aligns bootstrap with stage0_crate_layout_emit output.

Co-authored-by: Cursor <cursoragent@cursor.com>

* WIP: Wave 2 Band A self-emit: discovery_enumeration — self-emit its Rust via

* WIP: Wave 2 Band A self-emit: discovery_enumeration — self-emit its Rust via

---------

Co-authored-by: Brian Searls <briansrls@gunb.ai>
Co-authored-by: Cursor <cursoragent@cursor.com>
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