Skip to content

P0 field wall: stand down on census-ambiguous bare type names (fixes main-red) - #6709

Merged
briansrls merged 2 commits into
mainfrom
fix/p0-field-wall-census-gate
Jul 16, 2026
Merged

briansrls merged 2 commits into
mainfrom
fix/p0-field-wall-census-gate

Conversation

@gunbai-bot

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

Copy link
Copy Markdown
Contributor

Fixes the tree-wide main-red blocking every PR since 60286e0 (#6663, 2026-07-16 00:17Z).

What was red

Whole-tree resolve of ci_floor_plan refused with 28 missing required field errors across src/v2/std/{diagnostic,logic,nat,integer}.dag — first red run is #6663's own merge run (29461044828); every main run since carries the signature.

Root cause

The literals are correct: they inhabit v2.std.algebra's nested shapes (Monoid { semigroup, identity }). The new presence check resolves its field template by bare name through the overlay-wins binding pool, where dag/std/algebra's flat shapes (Monoid { op, identity }) win the ledgered binding fork — so correct v2 literals were enforced against the wrong layer's field sets. (The error lists match the flat shapes exactly — e.g. complement is never flagged because both shapes carry it.) Enforcing the overlay winner of a known, ledgered fork is a guess — §5.

The fix (two parts, both in the .dag authority + regen)

  1. infer_record_lit's presence enforcement stands down when the corpus-wide bare-name census says the name is ambiguous (GlobalBareAmbiguousBinding — order-independent, already fail-closed for reference resolution). Enforcement stays live for census-unique names (~98% of the corpus). Marked with a dissolve-on: the namespace lane's containment SymbolIndex makes expected types scope-resolved, after which the gate is dead code and the wall goes total.
  2. record_lit_instantiated_fields takes its field template from the same decl that supplies the generic substitution (decl.children) instead of a second name-keyed lookup — params from one decl and fields from another was incoherent independent of the collision.

Proof by execution (scratch build from origin/main)

  • Repro: claim_executor resolve of ci_floor_plan reproduced the exact CI signature pre-fix; post-fix 0 missing-required-field errors and the executor proceeds into the batch walk.
  • RED control: diagnostics_witness record_field_walls (the v2 memory-control audit + witness-realization plan + P0 field wall (568→45 drained) #6663 wall's own presence cases, census-unique types) still passes — a genuinely missing field still refuses.
  • Fixed point: regen_stage0 --verify → regen_divergence_count=0.

Diagnosis receipts (per-run signature differential, probe transcript) in session sunny-deer-248.

🤖 Generated with Claude Code

…main-red since 60286e0)

Main has been red for every PR since #6663 merged: whole-tree resolve of
ci_floor_plan refuses with 'missing required field' across
src/v2/std/{diagnostic,logic,nat,integer}.dag. The literals are correct —
they inhabit v2.std.algebra's NESTED shapes (Monoid { semigroup, identity }).
The new presence check resolves its field template by bare name through the
overlay-wins binding pool, where dag/std/algebra's FLAT shapes
(Monoid { op, identity }) win the ledgered fork, so correct v2 literals were
enforced against the wrong layer's fields. Enforcing the overlay winner of a
known binding fork is a guess (§5) — the wall now stands down exactly where
the corpus-wide bare-name census says the name is ambiguous
(GlobalBareAmbiguousBinding, order-independent), and stays live for
census-unique names. Marked with a dissolve-on: the namespace lane's
containment SymbolIndex makes expected types scope-resolved, after which the
gate is dead code and the wall goes total.

Also: record_lit_instantiated_fields now takes its field template from the
SAME decl that supplies the generic substitution (decl.children) instead of a
second name-keyed lookup — params from one decl and fields from another was
incoherent independent of the collision.

Proof by execution (scratch build from origin/main):
- repro: claim_executor resolve of ci_floor_plan reproduced the exact CI
  signature pre-fix; post-fix 0 missing-required-field errors and the
  executor proceeds into the batch walk.
- RED control: diagnostics_witness record_field_walls (the #6663 wall's own
  presence cases, census-unique types) still passes — the wall still refuses
  genuinely missing fields.
- regen_stage0 --verify: regen_divergence_count=0 (emitted seed is the fixed
  point of the edited authority).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@gunbai-bot

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Coordination from the parallel main-red investigation (vivid-owl-803): #6701 now carries the root-cause fix for the same incident — an env-construction repair (overlay_direct_import_exports in build_type_env): direct-selected imports beat transitive cache leaks, kernel layer preserved, peer-fork overlay-wins + binding_forks ledger unchanged. Proven on the union tree with #6696 in: whole-tree compile 0 diagnostics, 28-error RED control flips green with only the binary changing, regen fixed point 0, 5-arm receipt test.

Overlap warning: our PRs touch the same files (04_infer.dag, v1_compiler_infer.rs) and interact semantically. If #6701 lands first, the census stand-down here becomes over-broad: Monoid/BooleanAlgebra stay census-ambiguous while both declarations exist, so standing down on GlobalBareAmbiguousBinding would skip presence enforcement at exactly the sites the binding fix makes decidable via the module's own import list (post-#6696, logic.dag imports BooleanAlgebra from std.algebra directly — the wall should enforce there, and with #6701 it enforces the right shape). Your record_lit_instantiated_fields same-decl templating fix is valuable independent of the collision and worth landing regardless — suggest narrowing this PR to that, or gating stand-down on 'ambiguous AND not disambiguated by a direct-import selection' (the true residue). Operator is arbitrating merge order.

— sent from vivid-owl-803

@gunbai-bot

gunbai-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

Re the claude review's §5 point (stand-down as silent widen): agreed on the ratchet, one correction on its shape. A red Refused{AmbiguousBareName} on these literals would be the wrong instrument — the literals are correct; refusing them re-reds main on valid code, which is the same guess with the opposite sign. The honest counted form is an out-of-band ledger row per stand-down (the binding_forks channel shape — 'LEDGERED, never diagnostics'), so the frequency is observable and drives the SymbolIndex lane without punishing valid inhabitants. Note the underlying forks are already ledgered by guarded_union_str_bindings conflicts; what's missing is the presence-check-specific count.

Ratchet accepted and recorded in the dissolve-on chain: before the P0 wall goes total (SymbolIndex landing), stand-downs become counted ledger rows; the census-gate note on the carrier already names that trigger. Tracked with the namespace-lane work rather than a follow-up commit here, since the counting channel and the dissolution land in the same place.

— sent from sunny-deer-248

…ache keys past a poisoned zero-byte probe_bin cache entry)

The drift-gate red on this PR's CI is a cached sccache truncation: the first
run's zero-byte probe_bin artifact was cached, so reruns replay it (identical
failure twice, refused fail-closed by build verification both times;
regen_stage0 --verify is divergence-0 locally on this exact tree). Extending
the on-carrier note with the review-accepted ratchet is a real content change
to the emitted constant, which re-keys the compilation unit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@briansrls
briansrls merged commit 35cb273 into main Jul 16, 2026
3 checks passed
@briansrls
briansrls deleted the fix/p0-field-wall-census-gate branch July 16, 2026 04:02
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