Repository navigation
stage0 surface-ownership: disposition the 10-row required-regen population (1 emitted-not-committed + 9 committed-not-emitted) one row at a time; NOT a roster append - #8544
Conversation
Individually dispositioned each row of the stage0 surface-ownership mismatch (1 emitted-not-committed + 9 committed-not-emitted), rather than bulk-appending to HAND_MAINTAINED_STAGE0_FILES: - v1_compiler_trait_bound_witness.rs: the emitted-not-committed row. The .dag module (v1.compiler.trait_bound_witness) was authored but its emitted .rs was never committed; committing it now, wired through v1_compiler_emit_rust.rs and lib.rs, closes the RC-clone trait-bound gap (E0599 cluster, gunbc dashboard node adhoc-d30225a0-531). - Two dead residue files deleted (gunbc_namespace_reference_derived_closure_admission.rs, gunbc_namespace_reference_derived_closure_contract.rs) with their stage0_rust_source_lifecycle_scaffold.dag residue_row entries removed. - Three structurally-required host-glue registrations added to stage0_crate_layout.dag's seed_retained_intrinsic_registrations, each with its own justification note: bootstrap_stage0_crate_layout_generated (a different-pipeline generated artifact, has_pub_mod: false), cssl_seed_linked_closure_assembly (host-only subprocess/filesystem harness, mod not pub mod), required_regen_host (the required-regen check's own host realization, mod not pub mod). - Three Gate-A flip-lane scaffold registrations (v2_compiler_compile, v2_compiler_program_assembly, v2_compiler_source_authority) completing PR #6812's incomplete landing — their .rs files and dissolution triggers were committed but never registered in crate-layout/lib.rs. - expected_red_roster_join gains an explicit pub-mod crate-layout row (independently confirmed missing on main; already present on this branch, resolving a cross-check raised by session swift-moth-294). Regenerated via `main_wet` (dag/tools/generated_artifact_gate.dag) to sync the two downstream generated artifacts; scope-checked the corpus-wide regen output against the prior committed tree — only the 2 causally-relevant generated files changed, all corpus_wide docs/ workflow/gitignore output re-wrote byte-identical (no unrelated drift bundled into this change).
…cycle-scaffold desync it exposed compiler_tests.rs (hand-authored `#[cfg(test)]` unit-test suite, no corresponding .dag source module) is required-regen's next surfaced committed-not-emitted row. Added as SeedRetainedIntrinsicRegistration in stage0_crate_layout.dag with a dedicated justification note, and regenerated its two derived artifacts (stage0_crate_layout_generated.dag, bootstrap_stage0_crate_layout_generated.rs). That addition made HAND_MAINTAINED_STAGE0_FILES and stage0_emit_plan_generated.dag's generated_stage0_files disagree about compiler_tests.rs (one file "hand-maintained", the other "planned regen output"), which the companion stage0_rust_source_lifecycle_scaffold.dag module already models and asserts disjoint — CI caught it as 3 failing witnesses. Root cause: stage0_emit_plan_generated.dag's claimed generating authority, gunbc.stage0_emit_plan, was deleted by #8406 (the regen root cut); nothing regenerates this file any more, so its compiler_tests.rs row was stale orphaned data, not a real emission plan. Removed that one row from both of its lists with a note explaining the orphaned-authority provenance. Two more independent fixes the same desync exposed: - stage0_rust_source_lifecycle_scaffold.dag: deleted the informal cssl_seed_linked_closure_assembly.rs residue row — that file now has a first-class SeedRetainedIntrinsicRegistration (added in the prior commit), so the old row duplicated its own classification and violated classified_residue_disjoint_holds. - stage0_rust_source_lifecycle_scaffold_witness_test.dag: the overlap test asserted a stale single-element population; the module's own design note already documented bootstrap_stage0_crate_layout_generated.rs as the second dual-pipeline overlap member, and the prior commit's HAND_MAINTAINED_STAGE0_FILES addition made that true for the first time. Verified individually via `gunbc run --claim-run` (all previously-failing witnesses now PASS) and via a fresh required-regen run, which now surfaces extdeps_cargo.rs as the next row to disposition. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…le matches as missing compare_generated_surfaces and tree_digest_from_map looked up the fresh-emit map with the bare basename (e.g. "extdeps_cargo.rs"), but compile_stage0's emit keys carry a "src/" prefix (as the pre-existing comment on generated_basenames_from_edit already documents, and as verify_hand_maintained already correctly handles with the same two-form lookup). Population validation (validate_compared_populations) normalizes to basenames on both sides and passes, so a genuinely committed-and-freshly-emitted file — e.g. extdeps_cargo.rs, sourced from the real dag/extdeps/rust/cargo.dag module — was reaching the per-file lookup, missing due to the key-space mismatch, and refusing required-regen with a spurious "emit missing generated file" error that looked identical to a real committed-not-emitted row. Verified with a temporary debug dump (removed before this commit): the fresh emit for extdeps_cargo.rs is present, keyed "src/extdeps_cargo.rs", and its content matches the committed file's shape. With the fix, required-regen correctly reaches extdeps_cargo.rs's digest/content comparison instead of misreporting it as missing, and surfaces the next real defect in sequence (a genuine v1-compiler Rust-emitter bug on extdeps_cargo_version.rs, tracked separately — not a row-disposition case). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
0eed67f to
3ac2568
Compare
….rs emit output write_emitted_tree iterated the full emitted-file map and called normalize_generated_source (which unconditionally pipes content through rustfmt) on every entry, regardless of extension. The compiler legitimately emits Cargo.toml alongside the .rs sources (valid TOML, not Rust), so rustfmt correctly rejected it with "expected item, found `[`" at <stdin>:1:1 on its `[package]` header — which surfaced identically to a genuine emitter defect. Confirmed via a temporary debug dump (removed before this commit): the exact content rustfmt choked on was the emitted Cargo.toml, not any .rs file — extdeps_cargo.rs and extdeps_cargo_version.rs both emit clean, valid, matching Rust. Fix: only rustfmt-normalize paths ending in .rs; write other emitted files (Cargo.toml) verbatim. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…mit paths Emit map keys are heterogeneous: some carry a "src/" prefix (e.g. "src/extdeps_cargo.rs"), some are bare (e.g. "Cargo.toml") — the same key-space split already documented on generated_basenames_from_emit. write_emitted_tree joined the raw key onto dest_src, which is already ".../src", so every "src/"-prefixed emitted file landed one directory too deep (.../src/src/extdeps_cargo.rs) while verify_candidate_tree checks flat basenames directly under .../src — so it always found zero, refusing with "candidate tree has zero generated files" once the rustfmt-scope bug (previous commit) stopped masking this one. Fix: write each emitted file at its basename under dest_src, matching every other function in this module (committed_generated_basenames, generated_basenames_from_emit, tree_digest_from_map, compare_generated_surfaces, verify_hand_maintained), which all already key on flat basenames — committed_generated_basenames itself proves the real population has no subdirectories. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ed writes into it verify_hand_maintained's scratch comparison (normalize_with_workdir) writes committed.rs/candidate.rs under candidate_dir, but that directory previously came into existence only as a side effect of write_emitted_tree's create_dir_all on its "src" child — which runs several lines later. On a clean tree (no stale target/stage0-regen-candidate from a prior run) this made every hand-maintained file "unverifiable": "write .../committed.rs: No such file or directory". Create candidate_dir up front so the ordering doesn't matter. With this and the two previous fixes, required-regen now runs to completion (elapsed_ms=152230, planned=127, executed=127) and reports real content: 6 generated files with genuine drift (gunbc_stage0_crate_layout_generated.rs, lib.rs, std_measure.rs, std_pareto.rs, std_witness_admission.rs, v1_compiler_infer.rs), to be dispositioned next. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
… port rustfmt fixed-point from #8488 PR #8488 independently rewrote this same file to fix the identical key-space mismatch, but via a different, non-composable convention: normalize compile_stage0's emitted keys to flat basenames AT INSERT TIME, instead of this branch's prefix-then-fallback lookup at every downstream call site. Adopting theirs here deliberately: one normalized key-space is a single authority (DESIGN §3), where a dual-form lookup repeated at every consumer (compare_generated_surfaces, verify_hand_maintained, tree_digest_from_map) is the same fact re-checked N times. All three of those call sites simplify to a plain basename lookup now that the map itself guarantees the invariant. write_emitted_tree's defensive file_name() extraction is dropped for the same reason: compile_stage0 now guarantees bare basenames, so the join-time re-extraction was validation standing where construction already holds. Also ported #8488's rustfmt-fixed-point normalization (attributed): rustfmt is not single-pass idempotent for every input, so a once-formatted candidate compared against a committed file that a second rustfmt pass would reformat further reads as false drift. normalize_generated_source now iterates rustfmt to its own fixed point (bounded at 8 passes, refused if it never converges) instead of trusting a single pass. normalize_with_workdir now creates its own work_dir directly (also from #8488) rather than relying on run_required_regen to have precreated candidate_dir earlier — a more local fix for the same missing-directory bug this branch fixed differently; the earlier, more distal fs::create_dir_all(&candidate_dir) in run_required_regen is removed as redundant now that the function that actually needs the directory creates it itself. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…authorities Five of the six files required-regen reports as drifted are genuine content drift, not rustfmt-idempotence false positives: re-run with the newly-ported 8-pass rustfmt-fixed-point normalization active (ebe986a) and all five still reported drifted, so each committed file is stale relative to its .dag source rather than a single-pass formatting artifact. gunbc_stage0_crate_layout_generated.rs: the live .dag authority (dag/gunbc/stage0_crate_layout_generated.dag) already carries three SeedRetainedScaffoldRegistration rows added for v2_compiler_compile, v2_compiler_program_assembly, v2_compiler_source_authority (per gate_a_flip_lane_seed_retained_note, completing PR #6812's incomplete integration) — the committed .rs simply hadn't been regenerated since. std_measure.rs, std_pareto.rs, std_witness_admission.rs, v1_compiler_infer.rs: same pattern — committed artifact stale against already-updated .dag source, caught by required-regen's byte comparison. lib.rs, the sixth drifted file, is deliberately excluded from this commit: it is independently regenerated by PR #8534 (session swift-moth-294), and carrying it here would collide with that lane's verified fix. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
# Conflicts: # src/v1/stage0/src/v1_compiler_emit_rust.rs # src/v1/stage0/src/v1_compiler_trait_bound_witness.rs
…repayment, not this lane's content required-regen refused after merging main forward through #8513 (Fix refinement wall: base-type mismatch through refined-alias chains composes): that PR changed the .dag authority (00_core.dag, 04_infer.dag — 2 files) but carried zero regenerated projection. This is pre-existing drift on main, not damage from this branch's merges (confirmed independently by smart-ram-730, who screened all recent merges for authority-changed-without-projection and found #8513 the sole offender). v1_std_core.rs: adds expr_is_any_literal, the missing generated fn. v1_compiler_infer.rs: adds the expr_is_any_literal call site plus the peel_where_refinement_base extraction, matching the .dag authority's refactor. Regenerated from the current merged tree and verified drift-free before commit. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…rce_authority disposition — measured, not analogized
Parent's independent measurement (msg_6f205102) found these three basenames
carry ZERO pub-mod lines in src/v1/stage0/src/lib.rs on origin/main (control:
v1_interpreter and the four true v2_compiler_resolve/program_partition/
tokenize/infer siblings each carry exactly 1), with no #[path] wiring
anywhere. The prior gate_a_flip_lane_seed_retained_note claimed they were
"exactly like their already-registered ... siblings" and registered them as
SeedRetainedScaffoldRegistration, which implicitly emits a pub-mod line —
reclassifying them into the generated-with-pub-mod population so the
population-mismatch refusal stopped firing for these three rows, without the
underlying reality (zero wiring, genuinely committed_not_emitted) changing.
That is DESIGN.md S5's absorbing-fallback pattern applied at the disposition
layer, not a completed landing.
Reclassified to SeedRetainedIntrinsicRegistration { has_pub_mod: false },
matching the measured lib.rs state and matching the already-correct sibling
disposition of cssl_seed_linked_closure_assembly / required_regen_host (also
verified this session: 0 pub-mod lines each on origin/main, same profile).
Note rewritten to record the correction rather than silently overwrite the
false claim.
expected_red_roster_join is untouched by this commit and was never touched by
any prior commit on this branch — grep confirms it is unchanged context in
every hunk of this PR's diff; it already carried has_pub_mod: true on
unmodified origin/main. PR #8527 owns that row's terminal shape per parent's
ruling; there is nothing here to drop.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…d fix --required-regen refuses corpus-wide on the pre-existing #8544 population mismatch, so this projection was obtained by invoking compile_stage0 directly (rustfmt applied exactly as write_emitted_tree does), ahead of the population-comparison gate that #8544 blocks on, per an operator ruling sanctioning that narrower path for this fix. Diffed the whole emitted stage0 tree against committed. Six other files differ from committed stage0 for reasons unrelated to this change and are intentionally left untouched: - lib.rs: two missing `pub mod` lines, a direct consequence of #8544's own population gap (three files not yet in the emit population). - v1_compiler_infer.rs, v1_std_core.rs: also #8544's subject (expr_is_any_literal / where-refinement work not yet landed on main). - std_measure.rs, std_pareto.rs, std_witness_admission.rs: unowned regen backlog — stale committed projections of other sessions' .dag authority changes that were never regenerated, unrelated to pattern/Rc/match-arm emission. Discovered as a byproduct of this verification; flagged separately, not carried by this PR. Only v1_compiler_emit_rust.rs is shipped here.
…m's Conj arm is unreachable in emitted Rust — a silent wrong answer, not a warning (#8570) * WIP: RC-aware pattern emission guard (held, pre-sync) * Regenerate stage0: v1_compiler_emit_rust.rs for RC-aware pattern guard fix --required-regen refuses corpus-wide on the pre-existing #8544 population mismatch, so this projection was obtained by invoking compile_stage0 directly (rustfmt applied exactly as write_emitted_tree does), ahead of the population-comparison gate that #8544 blocks on, per an operator ruling sanctioning that narrower path for this fix. Diffed the whole emitted stage0 tree against committed. Six other files differ from committed stage0 for reasons unrelated to this change and are intentionally left untouched: - lib.rs: two missing `pub mod` lines, a direct consequence of #8544's own population gap (three files not yet in the emit population). - v1_compiler_infer.rs, v1_std_core.rs: also #8544's subject (expr_is_any_literal / where-refinement work not yet landed on main). - std_measure.rs, std_pareto.rs, std_witness_admission.rs: unowned regen backlog — stale committed projections of other sessions' .dag authority changes that were never regenerated, unrelated to pattern/Rc/match-arm emission. Discovered as a byproduct of this verification; flagged separately, not carried by this PR. Only v1_compiler_emit_rust.rs is shipped here. --------- Co-authored-by: gunbc-ci-auto-heal <gunbc-ci-auto-heal@users.noreply.github.com>
|
Closing this PR: the population it was scoped to disposition (10-row required-regen: 1 emitted-not-committed + 9 committed-not-emitted) no longer exists on main. Verified with SHA-pinned, content-hashed remote runs at multiple main tips, most recently Checked the 6 non-generated-mirror files in this branch's diff for genuine unlanded authority content before closing (rather than assuming supersession): the two closure Closing rather than merging or force-updating — the 10 generated-mirror files in this diff would otherwise require hand-reconciling against bytes a generator already produces authoritatively on main, which #8618 explicitly notes is no longer single-pass-normalized the way this branch's copy is. |
Headline: self-host fixed point, first time ever
required-regen(claim_executor --required-regen --source-root dag --source-root src/v2) now confirms the emitted stage0 tree is byte-equal to a fresh projection from the current merged.dag/src/v2authority:This is the first time the full committed
src/v1/stage0/srcsurface has been shown to be exactly reproducible from the authority it claims to be generated from. It was re-confirmed three times against a movingmain(see "Live drift catch" below), most recently against merge commit58aec2facaa(main atf44a1254286).Scope: 5 files carrying genuine content-drift against their
.dagauthority were dispositioned —gunbc_stage0_crate_layout_generated.rs,std_measure.rs,std_pareto.rs,std_witness_admission.rs,v1_compiler_infer.rs(initial pass; a second, unrelated drift in the same file surfaced later — see below).lib.rsis out of scope, owned by #8534 (swift-moth-294).Live drift catch: PR #8513 changed
.dagauthority without regenerating its projectionWhile re-verifying this branch against
mainafter several PRs landed concurrently (#8537, #8539, #8513, #8526, #8530, #8531), the required-regen gate refused:Root cause, isolated by diffing the fresh candidate against the committed tree: #8513 ("Fix refinement wall: base-type mismatch through refined-alias chains composes") changed
.dagauthority (00_core.dag,04_infer.dag) but shipped zero regenerated.rsprojection — a defect class ("authority changed without projection") distinct from file-contention, and one the existing pre-merge contention screen cannot see because no file was touched by both sides. Independently confirmed by smart-ram-730, who screened all 8 recently-merged PRs for the same shape and found #8513 the sole offender; two more open PRs (#8542, #8503) carry the same defect and are being handled separately, out of this PR's scope.The two regenerated files in this PR (
v1_compiler_infer.rs,v1_std_core.rs) are #8513's repayment, not this lane's own content — they addexpr_is_any_literal(new fn) and its call sites / thepeel_where_refinement_baseextraction, matching #8513's.dag-side refactor exactly. Regenerated from the merged tree and verified drift-free before commit (final verify above).This refusal is included here as evidence the gate works on real drift, not just as a green-run count — a mechanism that correctly refuses on its first live encounter with drift is stronger evidence than any number of passing runs.
Downstream sequencing
required-regenas a CI gate. It is only meaningful/green-on-arrival because this PR lands first — enrolling the gate against an already-drifted tree would fail for reasons nobody intends.lib.rscorrection) → Enroll required-regen fold as two witness-job steps on CI #8488 last.Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Correction to commit
af0b8b437e6's messageaf0b8b437e6("required-regen: retire orphaned pre-regen-root-cut v1 seed modules") claimed the deletion ofgunbc_namespace_reference_derived_closure_admission.rsandgunbc_namespace_reference_derived_closure_contract.rsincluded removal of their correspondingstage0_rust_source_lifecycle_scaffold.dagresidue rows. That clause is false.Correction: the deletion rationale remains unchanged, but the earlier statement that corresponding
stage0_rust_source_lifecycle_scaffold.dagresidue rows were removed was false. No such rows were ever added or deleted for these identities.This is a positive result from a full-history
git log --all -Ssearch on both filenames againstdag/gunbc/stage0_rust_source_lifecycle_scaffold.dag(zero commits, either direction), not an inconclusive lookup. The underlying deletion (9f0377109d6, confirmed sound) is unaffected.