Skip to content

Repair the derived stage0 partition: five unrostered modules; retire the extdeps-base tier the chain could not express - #7641

Merged
briansrls merged 6 commits into
mainfrom
fix/stage0-std-core-occurrence-identity
Aug 2, 2026
Merged

briansrls merged 6 commits into
mainfrom
fix/stage0-std-core-occurrence-identity

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

PR body — stage0 derived-partition repair

Title: Repair the derived stage0 partition: five unrostered modules, and the extdeps-base tier the chain could no longer express

What broke

cargo check -p v1-stage0-std-core has been red on main ("6 previous errors") with none of it CI-visible: DagCompileCleanGate is dag-only and the release build is -p v1-compiler (the flat seed crate), which the partition crates are not dependencies of — the same hole class ci_v1_compiler_tests_compile_gate_note documents for v1-compiler-tests. Two distinct defects, one carrier:

1. Membership rot (4 modules, 3 crates). Flat-crate modules gained partitioned consumers without ever being added to a partition roster in src/v2/workflow/rust_crate_partition.dag:

  • std_occurrence_identity — re-exported by v1_std_core since Add shared authored-occurrence identity transport #7352 (220b556) → 3 of the 6 std-core errors
  • extdeps_units_dimensionless / extdeps_units_iec_80000_13 / extdeps_units_iso8601 — re-exported by std_measure → the other 3
  • std_trait_derive_shape — used by extdeps_languages_rust_emit; latent (crate aborts earlier today)
  • v1_compiler_infer_occurrence_binding — used by infer_env/infer_sigs; latent likewise

The latent two were found by a full sweep (every crate::X reference from every partitioned member checked against the partitioned universe), not by iterating compile errors, so this closes the absence class in one pass.

2. A chain-order defect the units trio exposes. The crate chain is strictly linear (runtime ← std_core ← std_surface ← extdeps_base ← …), but std_measure (std-core) consumes extdeps.units.*, which need extdeps_uri/extdeps_external_authority — rostered in stage0_extdeps_base, above std-core. A std surface citing the extdeps rows that ground it is the sanctioned direction (DESIGN §3, layer-DAG deletion 2026-07-24); the hand-drawn chain predates it and cannot express it. No pure roster row fixes this: the units modules must sit at-or-below their consumer and at-or-above their deps, and the chain puts those in the wrong order.

The fix

By each module's actual dependency set, extdeps_uri (needs std_types+runtime) and extdeps_external_authority (needs std_decl_ref/std_roster_frontier/std_types/extdeps_uri) are std-core-tier facts — so the whole grounding cluster (extdeps_uri, extdeps_external_authority, the three units modules) moves into the std-core roster, beside their consumer std_measure. That empties the extdeps_base unit, so its crate row is retired rather than shipped hollow: declared targets move 8→7 physical / 7→6 module-bearing in the same authority (the derived-vs-declared witnesses compare both sides honestly), downstream reexport_packages drop the package, and src/v1/stage0_extdeps_base is deleted. Placements for the other two: std_trait_derive_shape → std_surface (std module, core-only deps, consumed from extdeps-languages above); v1_compiler_infer_occurrence_binding → v1-infer beside its consumers (member pin 6→7 updated in the witness). Six edge-census rows added mirroring the existing style (std_measure→units, rust_emit→trait_derive_shape, infer_env/sigs→occurrence_binding).

Then the derived chain — no generated file hand-edited:

  1. gunbc run --entry dag/tools/generated_artifact_gate.dag --function main_wet → dag/gunbc/stage0_crate_partition_generated.dag
  2. two-generation regen_stage0 (regen → rebuild → regen) → gunbc_stage0_crate_partition_generated.rs, crate roots, workspace members region
  3. regen_stage0 --verify clean at the fixed point

Verification

  • cargo check -p v1-stage0-std-core — the exact main repro flips green
  • cargo check --workspace green (all partition crates, including the two latent instances)
  • cargo fmt --all --check clean; regen_stage0 --verify divergence 0
  • Witnesses green by execution: rust_crate_partition_witness_test.dag (18 fns) + generated_artifact_drift_test.dag (8 fns)

Deliberately out of scope (operator decisions, not silently taken)

  • CI enrollment: a partition-crate compile gate (the ci_v1_compiler_tests_compile_gate_note fmt-amendment pattern applied here, e.g. cargo check --workspace or per-partition-crate checks) would have caught all of this weeks ago; enrolling it is a CI-cost decision that belongs to the operator. This PR repairs and enrolls nothing.
  • Topology note for the lane owner: the extdeps-base retirement is the minimal honest closure of the straddle inside the interim HandExplicit partition (which PolicyPartition later re-derives anyway). If a different shape is preferred (e.g. re-tiering the chain), that supersedes this interim edit cheaply — the authority is one file.
  • Pre-existing, untouched: src/v1/stage0_core and src/v1/stage0_crates.dag (the earlier split) remain tracked on disk and are not workspace members; noticed during the sweep, left as found.

🤖 Generated with Claude Code

…the extdeps-base tier the chain could not express

v1-stage0-std-core has been red on main (6 E0432/E0433) with no CI
visibility: four flat-crate modules gained partitioned consumers without
roster rows (std_occurrence_identity, the three extdeps_units_* rows,
plus latent std_trait_derive_shape and
v1_compiler_infer_occurrence_binding found by a full reference sweep),
and the units trio exposed a chain-order defect: std_measure (std-core)
consumes extdeps.units.*, whose deps sat in stage0_extdeps_base above
std-core - a sanctioned std-cites-extdeps grounding (DESIGN 3,
2026-07-24) the linear hand chain could not express. The grounding
cluster (extdeps_uri, extdeps_external_authority, three units modules)
moves into std-core by its actual dependency tier; the emptied
extdeps-base crate row retires (declared targets 8->7 / 7->6 in the same
authority); std_trait_derive_shape -> std_surface;
v1_compiler_infer_occurrence_binding -> v1-infer (witness member pin
6->7). Authority edit + main_wet + two-generation regen_stage0; no
generated file hand-edited; regen --verify divergence 0.

cargo check -p v1-stage0-std-core and --workspace green; fmt clean;
partition + drift witnesses 26/26 PASS by execution. CI compile-gate
enrollment for partition crates stays an operator decision - nothing
enrolled here.

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

gunbai-bot Bot commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

CI note: the ci job's single failure is 'extdeps_scope_placement_gate_passes returned Bool(false)' - the repo-wide floor red inherited from the #7571 gate x #7573 unenrolled-file merge race, not this change (build/regen/heal all pass; regen confirms the self-host fixed point). The standalone enrollment repair is #7640 (green, 2 approvals, awaiting operator merge). I will integrate main and refresh CI here once it lands. - sent from clever-ferret-451

gunbc-ci-auto-heal and others added 4 commits August 2, 2026 00:22
Unit-id decls take main's CompilationUnitId casts (#7480 ContentHash
family) minus the retired extdeps_base row; #7480's new
extdeps_container_oci_digest joins the std-core roster beside the moved
grounding cluster (deps: external_authority/uri/content_hash, all
std-core members). Generated partition files pending main_wet
regeneration - blocked on the inherited main red
(extdeps.transports.rest imports ContentHash from std.types; standalone
repair PR #7650), rerun after it lands.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ore emission

main_wet + two-generation regen_stage0 over the merge resolution; no
generated file hand-edited; regen --verify divergence 0. Workspace
check and fmt green.

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

gunbai-bot Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

CI red on this head is the inherited main red, not this diff: the floor's compile-clean refuses dag/test/claim/rest_exchange_replay_test.dag:44 (bare-string input_digest vs the ContentHash coproduct) — the replay layer of the fleet incident, present on main itself. The canonical repair is the frozen vehicle #7648 (currently at bar: 2/2 exact-head approvals, floor running). No fix will be pushed here — that would duplicate the single vehicle. Once #7648 merges, this branch re-integrates main and CI re-runs; the partition repair itself is verified by execution (regen fixed point divergence 0, workspace green, 26/26 partition witnesses). — sent from clever-ferret-451

…dration + #7665 seed mint layer)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@briansrls
briansrls merged commit 703e089 into main Aug 2, 2026
5 checks passed
@briansrls
briansrls deleted the fix/stage0-std-core-occurrence-identity branch August 2, 2026 13:55
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