Skip to content

peel_alias_once_for_field_access drops resolve_node diagnostics: type the probe-miss vs refusal split, audit diagnostic-count consumers - #7630

Merged
briansrls merged 10 commits into
mainfrom
session/witty-badger-200
Aug 2, 2026
Merged

briansrls merged 10 commits into
mainfrom
session/witty-badger-200

Conversation

@briansrls

@briansrls briansrls commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

peel_alias_once_for_field_access was a speculative alias-expansion probe, but it projected only NodeResolveResult.resolved. That made a legitimate zero-diagnostic probe miss indistinguishable from a resolver refusal and silently removed diagnostics before inference could carry them.

This change returns and recursively accumulates the existing NodeResolveResult carrier, then appends its diagnostics in both judgment-producing consumers: ExprFieldAccess and record-literal alias field discovery. It mints no parallel outcome vocabulary and does not change resolver policy. Variant-membership probes and emitter shape reads remain metadata-only and explicitly project .resolved.

Impact audit

Two projections dropped these diagnostics before CompileResult.diagnostics: direct field-access expansion and record-literal alias field discovery. All downstream readers of that one carrier therefore undercounted this class:

  • compile-clean hard/advisory predicates and counts (compile_clean_diagnostic_is_hard, compile_clean_diagnostic_is_advisory, and their vector/count consumers);
  • compile-clean diagnostic histogram identity (compile_clean_diagnostic_histogram_key);
  • the substrate-visible diagnostic census (compile_dag_diagnostic_census), at exact (diagnostic_class, subject_name, blocking) identity grain.

Zero finding: the unresolved-method frontier occurrence budget does not consume UnresolvedType identity, so its counts are unaffected.

This is why the namespace N1 census must be rerun after this fix: its previous kernel excluded peel-suppressed diagnostics from both inference consumers by construction. Completing the record-literal path raises the standalone whole-tree advisory count by five (5,880 → 5,885), so the provisional revealed delta was necessarily low and the freeze census must pin the post-merge compiler.

The standalone whole-tree control remains at zero blocking errors because this PR changes propagation, not the type-reference admission policy: unadmitted pool hits are still accepted until the N1 refusal arm in draft PR #7622 lands. The newly observable hard UnresolvedType population therefore appears under the combined peel fix + N1 arm, which is why #7630 must land before that branch reruns and freezes its census.

Test plan

  • CTRL_BUILD_BYPASS_SHIMS=1 cargo test -p v1-compiler peel_alias_fixpoint_termination --lib -- --nocapture — PASS, 2 tests. The carrier controls prove two UnresolvedType refusals survive recursive peel, a legitimate non-alias Int probe stays at zero, and the exact pre-projection identity set is a subset (retired_count == 0). A second test compiles an in-memory module through compile_sources and pins distinct field-access and record-literal alias refusal multiplicities in CompileResult.diagnostics. Detached RED controls remove each append independently: field identity count falls 4→2 and record identity count falls 3→1, so either consumer dropping diagnostics fails the witness.
  • CTRL_BUILD_BYPASS_SHIMS=1 cargo run -p v1-compiler --bin regen_stage0 -- --verify — PASS, regen_divergence_count=0.
  • rebuilt target/debug/gunbc, then ctrl-build --local -- target/debug/gunbc compile --output-dir /tmp/witty-badger-200-record-lit-compile.FYLUMF --source-root dag --source-root src/v2 --target dag — PASS across 1,702 sources: 0 blocking errors, 5,885 advisory diagnostics (five newly reported through record-literal alias inference).
  • cargo fmt --all -- --check / pre-commit and pre-push formatting gates — PASS.

Attestation

  • The title describes the change.
  • The branch contains the dashboard WIP checkpoint and the intentional completion commit; no foreign commits or cherry-picks.
  • No secrets, credentials, or large binaries are included.

CI red is inherited from main — session_dashboard.dag is unenrolled in the extdeps scope rosters (fix pending in #7640/#7633); it is the sole failing check, and all approvals are in.

@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review August 1, 2026 21:29
gunbai-bot Bot pushed a commit that referenced this pull request Aug 1, 2026
…ze).

Scratch recipe: N1 arm @ df4c428 + cherry-pick b7dfcef (peel #7630).
Identity-grain revealed delta 229, all preclassified incidental. Freeze pin
still waits for peel on main.

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

cursor Bot commented Aug 1, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@gunbai-bot

gunbai-bot Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Addressed review 46723 on current head 3745446277:

  • Added the DESIGN §7 seed-retention receipt beside the host-thread/timeout witness. It names the concrete v1-test-migration prerequisite and the ROADMAP zero-hand-written-Rust row as its dissolution trigger.
  • Kept the .resolved projection in record_lit_alias_struct_fields intentionally. That helper (and field_in_any_variant_named) is a metadata-only shape probe used to choose a declaration-field view; it does not own a diagnostic ledger or admit an executable artifact. Making that speculative lookup emit would convert a probe into a new record-literal refusal path—the false-red direction this change is required to exclude. The judgment-producing ExprFieldAccess path is the consumer that now carries the complete NodeResolveResult diagnostics into InferResult. The .dag authority note now states this caller split explicitly.

Focused witness remains green (quiet=0, refusal=2, retired=0) and regen_stage0 --verify reports zero divergence.

— sent from witty-badger-200

@gunbai-bot

gunbai-bot Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Review 46744 (and the first finding in review 46723) is addressed at 5d8b74895b.

record_lit_alias_struct_expansion now returns the existing NodeResolveResult; infer_record_lit takes fields from .resolved and appends .diagnostics to the final InferResult. Refused expansion can no longer silently supply record-literal field expectations. The branch preserves the prior short-circuit evaluation order, so unused later probes are not evaluated eagerly.

The rebuilt whole-tree compile is clean across 1,702 sources with 0 blocking and 5,885 advisory diagnostics. That is five additional diagnostics over the field-access-only head, confirming record-literal alias inference was a second undercount source. The PR impact statement now records this and the requirement that the freeze census pin the post-merge compiler.

The hand-Rust receipt requested by review 46723 remains present and names v1-test-migration plus the zero-hand-written-Rust ROADMAP row. Focused witness and fixed-point verification are green.

— sent from witty-badger-200

@gunbai-bot

gunbai-bot Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Review 46772 is addressed at 85db3ba9fc with a production-ledger witness.

The new test compiles an in-memory .dag module through compile_sources, exercising both changed inference consumers and asserting their distinct refusal identities in CompileResult.diagnostics. It passes with the fix (FieldAlias=4, RecordAlias=3). Detached RED controls removed each append independently: the field-access count fell 4→2, and the record-literal count fell 3→1; each removal fails its own assertion. The existing direct carrier test still covers quiet probe miss, reveal, and retirement independently.

cargo fmt --all -- --check and both focused tests pass. The PR body records the compile-ledger witness and both RED measurements.

— sent from witty-badger-200

@briansrls
briansrls merged commit b951e72 into main Aug 2, 2026
8 of 10 checks passed
@briansrls
briansrls deleted the session/witty-badger-200 branch August 2, 2026 04:07
gunbai-bot Bot pushed a commit that referenced this pull request Aug 2, 2026
Post-#7630 freeze pin: Frozen state, half-1 pure fold in roster_pure_regen,
and incidental roster closed at 2849 after heal fold of measure.dag Temperature.

Co-authored-by: Cursor <cursoragent@cursor.com>
gunbai-bot Bot pushed a commit that referenced this pull request Aug 2, 2026
…ze).

Scratch recipe: N1 arm @ df4c428 + cherry-pick b7dfcef (peel #7630).
Identity-grain revealed delta 229, all preclassified incidental. Freeze pin
still waits for peel on main.

Co-authored-by: Cursor <cursoragent@cursor.com>
gunbai-bot Bot pushed a commit that referenced this pull request Aug 2, 2026
Post-#7630 freeze pin: Frozen state, half-1 pure fold in roster_pure_regen,
and incidental roster closed at 2849 after heal fold of measure.dag Temperature.

Co-authored-by: Cursor <cursoragent@cursor.com>
gunbai-bot Bot pushed a commit that referenced this pull request Aug 2, 2026
…ze).

Scratch recipe: N1 arm @ df4c428 + cherry-pick b7dfcef (peel #7630).
Identity-grain revealed delta 229, all preclassified incidental. Freeze pin
still waits for peel on main.

Co-authored-by: Cursor <cursoragent@cursor.com>
gunbai-bot Bot pushed a commit that referenced this pull request Aug 2, 2026
Post-#7630 freeze pin: Frozen state, half-1 pure fold in roster_pure_regen,
and incidental roster closed at 2849 after heal fold of measure.dag Temperature.

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