Skip to content

Refuse non-exhaustive imported coproduct matches - #9676

Merged
gunbai-bot[bot] merged 5 commits into
mainfrom
session/silent-raven-147
Aug 30, 2026
Merged

gunbai-bot[bot] merged 5 commits into
mainfrom
session/silent-raven-147

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Outcome

Restores the compiler-floor guarantee for closed coproduct matches across module and record-projection boundaries, then makes gunbc.discovery_census total over all five RequiredFloorDisposition arms.

Why the four-arm match compiled

Producer: v1.compiler.infer_patterns.check_match_exhaustiveness, authority revision src/v1/04_patterns.dag at base f1f9dd8a077 (generated seed mirror v1_compiler_infer_patterns.rs). For a structurally unresolved scrutinee leaf, it discarded the node's binding identity and called lookup_type_by_name on its spelling. A record field typed as an imported coproduct can retain the imported binding identity while its spelling is not a local declaration key. The lookup miss fell back to the nominal leaf; because that leaf was neither Disj, optional, nor witness, the producer returned zero diagnostics. This was an absent/fail-open exhaustiveness check, not an advisory and not a declared rung drop.

The repair calls the existing identity-aware lookup_type_for. No new language carrier and no hand-authored Rust behavior were added; the Rust mirror is regenerated from src/v1/04_patterns.dag.

Evidence

Cross-module compile_dag_multi_module_fixture controls (provider Trio, importing consumer, record-field projection):

  • provider A/B/C + consumer A/B: one blocking NonExhaustiveMatch (the compiler diagnostic's missing roster is derived from the provider and therefore names C)
  • provider A/B/C + consumer A/B/C: clean
  • provider A/B/C + consumer A/_: clean
  • provider widened to A/B/C/D without changing the complete consumer: one blocking NonExhaustiveMatch (names D)
  • unresolved scrutinee type: blocking UnresolvedType, never a clean “not a coproduct” result

Command (regenerated local seed):

./target/release/claim_batch --source-root dag --source-root src/v2 --entry dag/test/claim/match_exhaustiveness_coproduct_witness_test.dag --functions w_cross_module_missing_c_reports_one_non_exhaustive,w_cross_module_complete_match_is_clean,w_cross_module_catch_all_is_permitted,w_cross_module_provider_growth_reports_one_non_exhaustive,w_unresolved_scrutinee_refuses_instead_of_becoming_not_a_coproduct

Result: 5/5 PASS.

Census repair:

  • DeclinedOutsideRequiredGate is a distinct declined partition arm and count field.
  • The mixed fixture inhabits all five dispositions.
  • A two-row population control proves one planned and one outside-gate identity partition exactly once, with union cardinality equal to the census.
  • Disposition receives the qualified module.function identity required by the cost-debt authority; the Bazel label remains the census/duplicate key.

Interlock

Draft until XL-0 merges. Then this branch will integrate the resulting main, regenerate/reverify the seed, and run the requested #9664 installed-diff / closure-emission / emitted-crate convergence controls before marking ready.

Post-XL-0A regression receipt (680cc49)

Integrated main at ecdeb49. On srv1, a full release workspace build produced gunbc e3aea038937a8fb0 from installed tree 0551f3433211e0fa. One required-regen round planned/executed 139 files, cmp found zero changed regen-population files, and the final canonical installed-tree digest remained 0551f3433211e0fa. BuildBuddy invocation d695d9fc-73bb-4edb-8fbf-7624726c0703 independently completed the same round with an empty generated-file status.

The emitted closure retained the exact 175-member identity population: 174 Rust sources plus Cargo.toml. rustc reached and completed type checking. Its 2,779 diagnostic class table is code-for-code identical to XL-0A: E0308 2671; E0277 34; E0599 16; E0618 12; E0369 12; E0282 9; E0004 9; E0061 6; E0310 2; E0271 2; E0631/E0560/E0533/E0223 1 each. Every XL-0A pre-typecheck class remains closed: E0425/E0603/E0121/E0107/E0391/E0728 all zero.

Identity relation comparison normalized each rendered diagnostic to file x line x column x rustc code x message, sorted uniquely. XL-0A baseline and this head each contain 2,777 unique identities; removed=0 and added=0. The coarser file x line x code relation is also 0/0. Therefore ExhaustivenessRepairExposedLatent=0, RepairLocalRegression=0, UnrelatedBaselineMovement=0, and Unclassified=0. Emitted-tree diff is exactly one of 174 Rust files, v2_std_live_tree.rs, whose only difference is a prose annotation string; Cargo.toml and every diagnostic locus are unchanged.

On the same installed tree, cargo test --release -p v1-compiler --lib reports 552 passed, 0 failed, 140 ignored. The required floor separately executes the cross-module missing/complete/catch-all/provider-growth/unresolved controls. Full srv1 outputs: /tmp/sr147.log, /tmp/sr147-check.txt, emitted crate /tmp/sr147emit.

gunbai-bot Bot pushed a commit that referenced this pull request Aug 29, 2026
…d false by execution

- DiscoveryProducer.source_revision is std.types CommitSha and it gains
  source_tree: v2.workflow.floor_discovery FloorDiscoveryTreeId, built from
  the tree of the measured revision (f1f9dd8 -> d806b7d). A String
  revision is a spelling any later tree can wear; the tree is what the floor
  keys a discovery on, so after #9676 the population reads as an
  observation of an OLDER tree until it is rebound -- a visible typed edit
  rather than a stale string.
- consumer_census_live_gate_refuses_even_with_every_successor_realized:
  v1_bankruptcy_transaction_admitted over the live population is FALSE,
  including with every claimed successor handed to the gate as realized.

22 witnesses PASS (claim_batch on BuildBuddy).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U7GG6M9N2p7dmqHn4tFtii
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review August 30, 2026 02:12
@gunbai-bot
gunbai-bot Bot merged commit a1a40a0 into main Aug 30, 2026
4 checks passed
@gunbai-bot
gunbai-bot Bot deleted the session/silent-raven-147 branch August 30, 2026 02:21
gunbai-bot Bot pushed a commit that referenced this pull request Aug 30, 2026
…r projection eliminates the two new floor standings

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U7GG6M9N2p7dmqHn4tFtii
gunbai-bot Bot added a commit that referenced this pull request Aug 30, 2026
…e exact cut's vocabulary (#9675)

* XL-5 model-work: the v1 consumer census and the claim conservation wall, on the exact cut's own vocabulary

Two carriers, both refusing today by construction, with fixtures that make every
refusal executable now rather than at release:

- gunbc.v1_consumer_census: consumer x consumed-authority relations in
  gunbc.replacement_cut BoundaryConsumer / ConsumerDisposition (no minted
  disposition vocabulary), each row carrying its medium, subject, and the
  producer + command + revision that found it. Population is honestly
  PopulationMeasuredLowerBound; the admission gate reads completeness, so the
  bankruptcy transaction refuses. Four hand-Rust shim consumers the exact
  vocabulary cannot cite are carried as the projection's own refusal shape,
  never as fabricated DeclarationRefs.
- gunbc.v1_witness_census: one disposition per pre-cutover claim identity
  (Retired / ReplacedByStronger with an executed red / StillRequired), with
  floor standing as a SEPARATE axis (v2.workflow.required_floor
  RequiredFloorDisposition) per ruling, projecting onto EvidenceDisposition.
  Five-direction identity-join conservation wall; live roster declared
  Unmeasured until a floor run supplies it.

19 witnesses PASS by execution (claim_batch, remote build at f1f9dd8).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U7GG6M9N2p7dmqHn4tFtii

* The four shim consumers become citable by construction: the tooling namespace row, derived citability, and the join on DeclarationRef

- gunbc.rust_item_host_observation: the four hand-Rust source prefixes move
  here from the stage0 scaffold (importing them there would have closed the
  cycle scaffold -> seed_growth_admission -> this module), and the tooling
  tree gets its namespace row: `v1_compiled.`, the package the shim crates
  assemble into -- a crate-named root outside the .dag index like
  `v1_compiler`, deliberately NOT `tools.` because the citation gate treats a
  .dag-declared root as in-index. The projection now takes its table as a
  parameter (`_in` forms); the bare forms pass the live rows.
- gunbc.v1_consumer_census: shim citability is DERIVED by running
  item_declaration_ref_in over the four items against a supplied table.
  Under the live table all four are BoundaryConsumer rows and the uncitable
  list is empty by construction; with the tooling row removed all four
  return to V1UncitableConsumer -- executed as the falsifier. Population
  stays LowerBound for its three other named holes.
- gunbc.v1_witness_census: the roster joins on DeclarationRef via
  declaration_ref_eq, not on a rendered module::decl string (XL-1's
  hollow-alias finding).
- fixtures: every planted DeclarationRef is now a self-citation of a real
  declaration -- the required floor's declarations phase refused the first
  push with CITED-MODULE-ABSENT on invented fixture modules; a plant may be
  absent from a roster, never from the tree.
- list_snoc_item / list_append called with their declared labels.

Executed (claim_batch on BuildBuddy): 11 + 10 census witnesses, 6
rust_item_host_observation witnesses including the new tooling projection,
46 stage0_rust_source_lifecycle_scaffold, 7 stage0_rust_product_reachability.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U7GG6M9N2p7dmqHn4tFtii

* Adjudicate the prefix relocation: six TargetChanged transition-admission rows, blast radius 0

The witness floor was green on the previous push (planned=executed=2829,
failed=0); the namespace-wave-admission phase refused 6 unadjudicated
binding deltas -- every spelling of the four rust_source_prefix_* constants
now binds to gunbc.rust_item_host_observation instead of the scaffold. The
rows name each exact (module, enclosing declaration, leaf) and go stale by
the trigger the roster already carries: the moment #9675 merges.

cargo test -p v1-compiler --test namespace_wave_admission: 33 passed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U7GG6M9N2p7dmqHn4tFtii

* The producer names the tree it observed, and the live gate is asserted false by execution

- DiscoveryProducer.source_revision is std.types CommitSha and it gains
  source_tree: v2.workflow.floor_discovery FloorDiscoveryTreeId, built from
  the tree of the measured revision (f1f9dd8 -> d806b7d). A String
  revision is a spelling any later tree can wear; the tree is what the floor
  keys a discovery on, so after #9676 the population reads as an
  observation of an OLDER tree until it is rebound -- a visible typed edit
  rather than a stale string.
- consumer_census_live_gate_refuses_even_with_every_successor_realized:
  v1_bankruptcy_transaction_admitted over the live population is FALSE,
  including with every claimed successor handed to the gate as realized.

22 witnesses PASS (claim_batch on BuildBuddy).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U7GG6M9N2p7dmqHn4tFtii

* Rebind the live measurement to the post-#9676 tree; the fixture-member projection eliminates the two new floor standings

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U7GG6M9N2p7dmqHn4tFtii

* Rebind the live measurement to the tree that includes the Symbol authority (24fc4a3); the seven producers agree with the prior measurement

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U7GG6M9N2p7dmqHn4tFtii

* The census witnesses enroll in the required gate: renamed under the self_host_ seed prefix, and the tooling-tree projection witness moves out of the main-owned module

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U7GG6M9N2p7dmqHn4tFtii

---------

Co-authored-by: gunbc-ci-auto-heal <gunbc-ci-auto-heal@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.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.

0 participants