Skip to content

Repair the derived stage0 partition: three unrostered modules and one inverted crate tier - #9243

Merged
briansrls merged 6 commits into
mainfrom
session/neat-pike-374
Aug 26, 2026
Merged

briansrls merged 6 commits into
mainfrom
session/neat-pike-374

Conversation

@gunbai-bot

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

Copy link
Copy Markdown
Contributor

cargo build --release at the workspace root — the first item under DESIGN's own Building & checks bullet — fails on main. This repairs it, verified by execution.

The class

Two module rosters stand over one file set. src/v1/stage0/src/lib.rs (the monolith, 160 pub mod) is complete; the seven partition-crate lib.rs files share those same sources through #[path] includes and carry their own rosters. Nothing decides that the two agree, so a module added to the monolith is invisible to the split crates until someone runs a build no required lane runs.

This is DESIGN's parallel-representation failure, and its decision-continuity twin one layer out: an artifact derived from a roster, whose derivation stopped running, while consumers kept trusting the artifact.

It is three modules, not one — and a tier inversion

The reported specimen was one module. That was a prefix, not a total: cargo stops at the first failing crate, so the printed count is where the compiler happened to stop. A per-crate visibility scan (own pub mod plus the transitive pub use <pkg>::* chain, against every included file's crate::X references) finds three:

crate missing
stage0_extdeps_languages extdeps_languages_rust_capabilities
stage0_v1_infer v1_compiler_coercion, v1_compiler_type_head_exposure

The second half is not two more roster lines. v1_compiler_infer_emit_info imports crate::v1_compiler_artifact, owned by stage0_v1_artifact — which depended on stage0_v1_infer. v1_compiler_coercion reaches artifact too, so neither could join infer while artifact sat above it. Measured deps show the edge pointed the wrong way: v1_compiler_artifact needs only {std_types, v1_rt, v1_std_core}, and v1_compiler_languages needs no infer module at all.

So the tiers are swapped — artifact below infer — in the authority rows, the generated mirror, the manifests, the pub use chains and the workspace member order, and the four real import edges the module DAG was missing are added.

Why nothing caught it

claim_executor is a bin of the monolith, whose roster is complete, so every required phase builds a crate that compiles. The partition crates are workspace members nothing in CI builds; the Rust suite left CI 2026-07-11 and clippy 2026-07-08 by operator ruling.

What this does NOT fix

The producer exists and has no caller. v1.compiler.stage0_crates renders both the partition lib.rs (render_stage0_layered_core_lib / _foundation_lib / _emit_core_lib_outcome) and its Cargo.toml (emit_stage0_crate_manifest) from the authority rows — and stage0_crate_boundary_emit_outcome is named by nothing outside its own module, its emitted mirror, and workspace_members. --required-regen does not cover these crates. Modeled derivation, zero executed route.

So this repairs the instance and leaves the class: the same omission lands again with the next module. That is stated rather than hedged, because this class has regressed once already (#7641, same crate, three weeks ago).

Rung — unchanged, and low

  • previous: mitigatable · current: mitigatable
  • bounded residue: the three modules and the one tier edge repaired here. No mechanism refuses a fourth omission.
  • next-rung trigger: give the producer a live entry point and a required phase that fails (not warns, not reports) on a partition crate that does not compile — landed together. A producer with no route is the defect this PR diagnoses, so producing without routing relocates it rather than closes it. Follow-up PR, agreed with the requesting lane.
  • Deriving the assignment itself — a new module rostered with no human edit — is blocked on the declared stage0_module_dag_interface_grounding debt (resolve_partition_outcome answers PolicyResolverUnimplemented; the cross-unit import edges are themselves a hand roster), dissolving on v2.compiler.source_authority ModuleStorageIndex. That is the class's own trigger, not effort withheld.

Evidence

  • RED — cargo build --release, remote, main efc880aef43: E0433/E0432 on extdeps_languages_rust_capabilities; the E0282 beside it is downstream of the resolution failure, not a fourth defect.
  • Intermediate, discriminating — with only that first fix applied: E0433/E0432 on v1_compiler_artifact, v1_compiler_coercion, v1_compiler_type_head_exposure. Predicted by the scan before the run, then confirmed by it.
  • GREEN — Finished \release` profile [optimized] target(s) in 6m 01s`, exit 0, one remote dispatch.

🤖 Generated with Claude Code

https://claude.ai/code/session_012WJNiTYqhzCcWJM6o5L5fQ

… inverted crate tier

`cargo build --release` at the workspace root -- the first item under
DESIGN's own Building & checks bullet -- fails on main. Two module rosters
stand over one file set: `src/v1/stage0/src/lib.rs` (complete, 160 mods) and
the seven partition-crate `lib.rs` files, which share those same sources
through `#[path]` includes. Nothing decides that the two agree, so a module
added to the monolith is invisible to the split crates until someone runs a
build the required lanes never run.

MEASURED, not inferred. The reported specimen was one module; cargo stopped
at the first failing crate and never reached the one above it. A per-crate
visibility scan (own `pub mod` plus the transitive `pub use <pkg>::*` chain,
against every included file's `crate::X` references) finds three:

  stage0_extdeps_languages   extdeps_languages_rust_capabilities
  stage0_v1_infer            v1_compiler_coercion, v1_compiler_type_head_exposure

The prediction was confirmed by execution before this change was written: a
build carrying only the first fix failed on exactly the second crate.

The second half is not two more roster lines. `v1_compiler_infer_emit_info`
imports `crate::v1_compiler_artifact`, owned by `stage0_v1_artifact` -- which
DEPENDED ON `stage0_v1_infer`. `v1_compiler_coercion` reaches artifact too, so
it could not join infer while artifact sat above it. Measured deps show the
edge pointed the wrong way: `v1_compiler_artifact` needs only
{std_types, v1_rt, v1_std_core} and `v1_compiler_languages` needs no infer
module at all. The tiers are swapped -- artifact BELOW infer -- in the
authority rows, the generated mirror, the manifests, the `pub use` chains and
the workspace member order, and the four real import edges the module DAG was
missing are added.

WHY NOTHING CAUGHT IT. `claim_executor` is a bin of the monolith, whose roster
is complete, so every required phase builds a crate that compiles. The
partition crates are workspace members nothing in CI builds; the Rust suite
and clippy left CI by operator ruling in July.

WHAT THIS DOES NOT FIX, stated so it is not mistaken for closed. The producer
exists and has no caller: `v1.compiler.stage0_crates` renders both the
partition `lib.rs` and its `Cargo.toml` from the authority rows, and
`stage0_crate_boundary_emit_outcome` is named by nothing outside its own
module, its mirror, and `workspace_members`. `--required-regen` does not cover
these crates. So this repairs the instance and leaves the class: the same
omission lands again with the next module.

RUNG: unchanged, and low. The rosters stay hand-authored and no mechanism
refuses a fourth omission -- previous rung mitigatable, current rung
mitigatable, bounded residue the three modules and one tier edge repaired
here. NEXT-RUNG TRIGGER: give the producer a live entry point AND a required
phase that FAILS on a partition crate that does not compile, landed together
-- a producer with no route is the defect this commit diagnoses, so producing
without routing would relocate it rather than close it. Deriving the
assignment itself (a new module rostered with no human edit) is blocked on
the declared `stage0_module_dag_interface_grounding` debt, dissolving on
`v2.compiler.source_authority` `ModuleStorageIndex`; that is this class's
own next trigger, not effort withheld.

EVIDENCE. RED: `cargo build --release`, remote, main efc880a --
E0433/E0432 on `extdeps_languages_rust_capabilities`. Intermediate, with only
that fix: E0433/E0432 on `v1_compiler_artifact`, `v1_compiler_coercion`,
`v1_compiler_type_head_exposure`, as predicted. GREEN: `Finished release
profile in 6m 01s`, exit 0, one remote dispatch.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012WJNiTYqhzCcWJM6o5L5fQ
@gunbai-bot gunbai-bot Bot mentioned this pull request Aug 25, 2026
6 tasks
@gunbai-bot

gunbai-bot Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

Status on the reds, and one of them is real. Three runs exist on e139f32; they are not the same failure and only one is mine.

Two are killed steps, not failures. Jobs 97986688558 (build) and 97989292128 (floor) both show every step success up to the lane step, and the lane step itself carries a null conclusion — no step failed, the runner died mid-step. The rollup renders that as an ordinary red. Nothing in the diff caused it and there is nothing to fix in it.

One is a genuine failure, and it is a real gap in this PR:

required-regen: elapsed_ms=576801 first_generation_equal=false planned=135 executed=135 declared_divergent=1
required-ci: regen FAIL generated surface drift: gunbc_stage0_crate_partition_generated.rs

This PR edits dag/gunbc/stage0_crate_partition_generated.dag and does not carry the regenerated emitted Rust mirror of it. So the branch introduces a disagreement between a generated authority and its own mirror. That is worse than the state it inherited: on main the two agree while both being stale, here they disagree.

How it was found, because the route matters more than the fix. Not from this red — from the follow-up work. I built the producer entry point for the partition boundary files and ran it read-only: 14 files, 9 byte-for-byte matches, 5 drifted, the 5 being exactly the files this PR hand-edits. The 9 matches are the positive control: they establish the producer is faithful, so the 5 are a finding rather than a broken renderer. Running it with --write then reverted this PR's own repair, because the binary's embedded rows come from the stale mirror.

Two independent instruments then agreed on the same file by name — that local run, and this CI lane. That agreement is the result; had they disagreed, that would have outranked both.

Fix in progress: install the regenerated mirror from a --required-regen candidate tree, here rather than in a follow-up, since a half-regenerated authority on main is worse than either coherent state.

— sent from neat-pike-374

gunbc-ci-auto-heal and others added 5 commits August 25, 2026 22:52
`--required-regen` refuses this branch:

  required-regen: first_generation_equal=false planned=135 executed=135 declared_divergent=1
  required-ci: regen FAIL generated surface drift: gunbc_stage0_crate_partition_generated.rs

The parent commit edits `dag/gunbc/stage0_crate_partition_generated.dag` and did
not carry that file's own emitted Rust mirror. So the branch INTRODUCED a
disagreement between a generated authority and its projection, which is worse
than the state it inherited: on main the two agree while both being stale, here
they disagreed. This installs the mirror the emitter produces, from a
`--required-regen` candidate tree rather than by hand -- hand-editing a
generated file is the sin that produced this whole class.

The diff is 26 lines and every one is this branch's own authority change
projected: `extdeps_languages_rust_capabilities` into the extdeps roster, the
`v1-stage0-v1-artifact` and `v1-stage0-v1-infer` rows swapped, the two new
modules into infer, and the reexport chains flipped. No unrelated drift rides
along, which is what made it safe to install.

HOW IT WAS FOUND, because the route matters more than the fix. Not from the red
-- from the follow-up work. The partition-boundary producer entry point was run
read-only against the tree: 14 files, 9 BYTE-FOR-BYTE MATCHES, 5 drifted, the 5
being exactly the files the parent commit hand-edits. The 9 matches are the
positive control: they establish the producer is faithful, so the 5 are a
finding rather than a broken renderer. Running it with `--write` then REVERTED
the parent commit's repair -- because the binary's embedded rows come from the
stale mirror. Two independent instruments then named the same file: that local
run, and this branch's CI build lane twenty minutes later. Had they disagreed,
that would have been the larger finding.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012WJNiTYqhzCcWJM6o5L5fQ
The tier swap in this branch's first commit reordered `stage0_module_bearing_crate_rows`.
The emit-shell crate's path dependencies are rendered by iterating those rows IN
ORDER, so the authority now derives `v1-stage0-v1-artifact` before
`v1-stage0-v1-infer` while the committed manifest still carried the old order.
One line, and cargo does not care -- dependency order is cosmetic to it -- but
the derived file disagreed with the authority it is derived from.

WHY IT IS HERE AND NOT IN THE FOLLOW-UP. This branch changes the authority, so
it owes every projection of that authority. Landing the projection separately
would leave main holding exactly the authority-versus-mirror disagreement this
branch's second commit exists to remove, which is the state this whole change
argues is worse than either coherent one.

WHY IT WAS INVISIBLE UNTIL NOW, which is the part worth recording. The
pre-mirror-fix run of the producer reported this file as MATCHING, because the
binary was rendering from the STALE mirror and therefore reproduced the old row
order on both sides. The staleness was masking its own downstream consequence.
It became visible only once the regenerated mirror was in the tree being
measured -- so this file is a consequence of the previous commit's fix, not an
omission it should have caught.

AND IT COMPLETES A SYMMETRY THE FOLLOW-UP DEPENDS ON. The defect that opened
this branch had drift ZERO across four projection links and a crate that did
not compile: a drift check cannot see a stale authority. This file is the
mirror image -- real drift, and a compile that passes: a compile cannot see a
drifted projection. Neither check subsumes the other, and there is now an
executed specimen of each failing where the other succeeds.

Bytes installed from the producer's own `--write` output, diffed before
committing: the two path dependencies swap position and nothing else moves.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012WJNiTYqhzCcWJM6o5L5fQ
`witness_v1_infer_unit_members_holds` asserts `(unit.members |> count) == 7`.
This branch takes `stage0_v1_infer` to nine members -- `v1_compiler_coercion`
and `v1_compiler_type_head_exposure` -- so the witness goes red BY
CONSTRUCTION on this head. One number, not a witness rewrite.

AUDITED RATHER THAN ASSUMED, because a count assertion is rarely alone. Every
other pin in that file is unaffected and each for a stated reason:
`witness_runtime_unit_members_holds` (== 1) and
`witness_v1_artifact_unit_members_holds` (== 2) pin units this change does not
resize -- artifact keeps both members THROUGH the tier swap, since the swap
moves the row's position and not its contents.
`witness_resolve_partition_explicit_returns_assignment_holds` compares a count
to another measured count, so it is self-relative and cannot pin a size.
`witness_partition_physical_crate_count_holds` and
`..._module_bearing_unit_count_holds` pin CRATE and UNIT totals, which are
unchanged: no crate is added or removed here. No assertion in the file is
order-sensitive, which was the other thing worth checking given the swap
touches authority rows, manifests, `pub use` chains and workspace member order.

NOT RE-DERIVED BY CI, DELIBERATELY. This was decidable by reading, the fleet
has been saturated, and spending a runner to confirm an assertion whose subject
is a literal in the diff would measure nothing the source does not already say.

WHAT THIS DOES NOT CHANGE: the residue this branch already declares. The
producer still has no caller, `--required-regen` still does not reach the
partition crates, and this repairs the INSTANCE while leaving the CLASS -- which
regressed once already in this same crate three weeks ago. The follow-up carries
the phase; this commit only stops a stale literal from failing a correct change.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012WJNiTYqhzCcWJM6o5L5fQ
    stage0_module_dag_edge(from: "v1_compiler_artifact", to: "v1_compiler_languages")

asserts the reverse of the source. `partition_unit_dep_from_edge_fold`
(`v2.std.compilers.compilation_unit`) reads an edge as: if `edge.from` is in the
unit and `edge.to` is outside it, the unit depends on `edge.to`'s unit -- so
FROM IS THE CONSUMER AND TO IS THE DEPENDENCY. The row therefore claimed
artifact depends on languages.

The source says the opposite, and the two files are unambiguous:
`v1.compiler.languages` opens with `import v1.compiler.artifact { RenderTarget }`,
while `v1.compiler.artifact` imports `v1.std.core` alone and names languages
nowhere. Direction verified by reading the fold rather than inferred from the
field names, because `from`/`to` do not say which way dependency runs.

INERT TODAY, AND THAT IS THE ARGUMENT FOR FIXING IT HERE RATHER THAN AGAINST.
Both modules sit in one crate, so no build can observe the lie -- the same shape
as the emit-shell manifest earlier in this branch, where cargo does not care and
the authority is wrong anyway. A branch whose subject is repairing this
authority should not leave a false edge in it for a later derived partition to
trust. The four edges this branch ADDS were checked by the same rule and all
point consumer to dependency: infer_emit_info -> {infer_items, artifact,
coercion}, infer_env -> type_head_exposure, coercion -> artifact, each matching
its module's own imports.

A NARROWER STATEMENT OF WHAT THE TIER SWAP ESTABLISHES, which is the accurate
one: the CURRENT SOURCE DEPENDENCY GRAPH requires the artifact partition to
precede the infer partition. That is not a claim that artifact semantics belong
permanently below inference. Extracting `RenderTarget` into a smaller
target-vocabulary authority, so inference need not acquire the whole
artifact/languages package, remains open as a partition-GRANULARITY question --
and the strong phrasing would have foreclosed it rhetorically while adding
nothing this branch needs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012WJNiTYqhzCcWJM6o5L5fQ
@briansrls
briansrls merged commit 87ded17 into main Aug 26, 2026
4 of 6 checks passed
@briansrls
briansrls deleted the session/neat-pike-374 branch August 26, 2026 01:14
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