Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
7c89510
integration: slice-2 (length->count) + marker derives
briansrls Jun 20, 2026
ad440de
integration: + bright-badger Measure (04_infer+05_emit) + eager-boar …
briansrls Jun 20, 2026
8b8fbb9
emit(import-completeness): authored imports for emitter-rendered symb…
briansrls Jun 20, 2026
c840cc6
integration: bring #5325 regen_stage0.rs languages_consumer_census mo…
briansrls Jun 20, 2026
d6b4c39
emit(List seed carrier): render List nominal as host Vec in seed bran…
briansrls Jun 20, 2026
239ff28
emit(Int generic-arg seed carrier): apply rust_seed_host_numeric_alia…
briansrls Jun 20, 2026
36348c8
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 21, 2026
a33c5ae
Merge origin/main into emitter/seed-green-integration (resolve emitte…
briansrls Jun 21, 2026
8c1dd84
Merge origin/main (#5476) into emitter/seed-green-integration
briansrls Jun 21, 2026
0a069ec
Re-ignore machine_width emit test: committed seed not yet regenerated
briansrls Jun 21, 2026
2018cd8
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 21, 2026
9cf103f
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 21, 2026
cb921c1
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 21, 2026
eeec49e
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 21, 2026
65e1f83
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 21, 2026
c0f35e0
Add lexer-layer host builtins to v2 interpreter (chars/chars_to_strin…
briansrls Jun 21, 2026
4a8afdd
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 21, 2026
63eba0e
Interpreter spike: additive record-form-map + list_push method dispatch
briansrls Jun 21, 2026
5f9d24c
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 21, 2026
6a9e5db
Merge remote-tracking branch 'origin/main' into emitter/seed-green-in…
briansrls Jun 21, 2026
6f0c583
Merge remote-tracking branch 'origin/main' into emitter/seed-green-in…
briansrls Jun 21, 2026
dd81e67
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 22, 2026
2d0df5e
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 22, 2026
be52559
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 22, 2026
23015bb
Route-A class 1/6: correct splice dissolution pointer to adhoc-1bdd02…
briansrls Jun 22, 2026
ffb12b4
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 22, 2026
fc5a9ec
Route-A: rustfmt the fixture-lever mirror splice (CI fmt gate)
briansrls Jun 22, 2026
8961054
Merge remote-tracking branch 'origin/main' into emitter/seed-green-in…
briansrls Jun 22, 2026
751dfa9
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 22, 2026
f5bef4a
WIP class-3 computation layer: corpus_repr single authority (inert, .…
briansrls Jun 22, 2026
aeb61f6
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 22, 2026
e5b0ca0
Revert "WIP: Section 5 self-host execution manager: Lane A drive the …
briansrls Jun 22, 2026
6cf05a7
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 22, 2026
dee71b3
Revert "WIP: Section 5 self-host execution manager: Lane A drive the …
briansrls Jun 22, 2026
8f95dc3
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 22, 2026
86f71b0
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 22, 2026
675046c
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 22, 2026
bedc415
Section 5 self-host: thread corpus-global RustCorpusRepr selector thr…
briansrls Jun 22, 2026
ca4d06e
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 22, 2026
c725862
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 22, 2026
6525026
Restore known-good stage0 seed (revert premature regen); keep .dag cl…
briansrls Jun 22, 2026
ad010f6
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jun 22, 2026
9757de2
Restore known-good stage0 seed (auto-committed local regen reverted a…
briansrls Jun 22, 2026
6d37177
Merge remote-tracking branch 'origin/main' into emitter/seed-green-in…
briansrls Jun 22, 2026
e6d38e6
class-3 review fix: correct §6 dissolution-direction comment (src/v1 …
briansrls Jun 22, 2026
588bcc6
Merge remote-tracking branch 'origin/main' into emitter/seed-green-in…
Jun 22, 2026
3b28498
PATH A — land class-3-embodying cargo-green seed via overlay-3-committed
Jun 22, 2026
1ca2ab8
PATH A carrier-mark: append quick-seal's representation-invariance ca…
Jun 22, 2026
56f4a87
Merge remote-tracking branch 'origin/main' into emitter/seed-green-in…
briansrls Jun 22, 2026
85c7600
Merge remote-tracking branch 'origin/main' into emitter/seed-green-in…
briansrls Jun 22, 2026
2932af7
Merge origin/main into emitter/seed-green-integration
briansrls Jul 1, 2026
a1b9334
fix(seed-green): restore main serialize/record_emit after stale merge…
briansrls Jul 1, 2026
c3c683a
Merge origin/main into emitter/seed-green-integration
briansrls Jul 1, 2026
8f6c9b0
test(route-a): add emit-fresh cargo-green execution witness
briansrls Jul 1, 2026
b1cbe38
fix(ci): align zero-budget spawn width with execution-corpus cap witness
briansrls Jul 1, 2026
9a4ea9d
Merge remote-tracking branch 'origin/main' into emitter/seed-green-in…
briansrls Jul 1, 2026
fdae76f
Merge remote-tracking branch 'origin/main' into emitter/seed-green-in…
briansrls Jul 1, 2026
a329dff
Merge remote-tracking branch 'origin/main' into emitter/seed-green-in…
briansrls Jul 1, 2026
b57cdf0
Merge remote-tracking branch 'origin/main' into emitter/seed-green-in…
briansrls Jul 1, 2026
100df65
Merge emitter/seed-green-integration into session/cool-ant-875
briansrls Jul 1, 2026
abaca59
docs(self-host): mark Route-A cargo-green landed (#5777/#5873)
briansrls Jul 1, 2026
2088a27
fix(docs): regen v2-self-hosting.md from plan authority
briansrls Jul 1, 2026
94a7c4e
fix(docs): finish v2-self-hosting plan sync for #5873 wiring
briansrls Jul 1, 2026
c2d5318
feat(plans): land TypeScript gap census as generated Plan (Lane C ste…
briansrls Jul 1, 2026
0ff1955
WIP: Section 5 self-host execution manager: Lane A drive the emitted …
briansrls Jul 1, 2026
6efaf21
fix(docs): name .dag authority in typescript gap census plan
briansrls Jul 1, 2026
750149c
fix(docs): bind typescript-gap-census into doc graph
briansrls Jul 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ fresh_artifact_path() {
docs/plans/ci-floor-fractal-gantt.md*) return 0 ;;
docs/plans/representation-minimization.md*) return 0 ;;
docs/plans/reference-grounding-migration.md*) return 0 ;;
docs/plans/typescript-gap-census.md*) return 0 ;;
dsl/**) return 0 ;;
src/v2/**) return 0 ;;
esac
Expand Down
75 changes: 75 additions & 0 deletions docs/plans/typescript-gap-census.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# TypeScript first-class gap census — discriminating construct audit (Lane C / Track T)

**Status:** audit-first discriminating census · **approved 2026-07-01** (loyal-bee-794) · linked from `ROADMAP.md` `5-ts-first-class` · companion to `v2-self-hosting.md` Track T. **`dsl/gunbc/plans/typescript_gap_census.dag` is the authority** (DESIGN §6); `docs/plans/typescript-gap-census.md` is its generated projection (PlanArtifact).

**Method:** enumerate construct families `src/v2` actually uses (compiler substrate behaviors in `src/v2/compiler/*` + TargetModel emit surfaces in `src/v2/extdeps/languages/typescript.dag`). For each family report three independent bars: (a) grammar-inverse row enrolled on the committed TargetModel node, (b) VEP / pipeline emits the expected **TypeScript source string** (witness PASS), (c) **`tsc` / emit_host accepts the output** (consumer green-by-execution). Every FAIL names a witness or authority site — not a stub count.

> **Two-bar clarification (parent reframe 2026-07-01).** The GREEN column below is **bar (b) only** — VEP produces the expected TS source string. Bar (c) — `tsc` actually compiles the emitted output — is **UNMET even for `add`**: `typescript_descriptor_node_ts_node_run_add_holds` (`src/v2/test/claim/manual/typescript_descriptor_node_run_test.dag`) and `emit_host_gate_passes` (`dsl/tools/emit_host_gate.dag`) both **FAIL wet** in execution. A construct is not genuinely first-class until bar (c) is green. **Do not stack breadth on a red tsc foundation.**

---

## 1. Baseline (merged on main, not stub PRs)

- #5695 — Char atom-realization + green typed-fn emit
- #5701 — FieldAccess + RecordConstruct + `tsc --noEmit` oracle (source-string witnesses; bar (c) still red — see #19)
- #5704 — operators by inhabitance (test-catalog only, not default TargetModel)
- #5938 — collection-method grammar rows
- ~55 `typescript_*` / `ts_*` test fns under `src/v2/test/claim/` (manual + execution trees)

## 2. Census table

### VEP source-string GREEN (bar (b) witness PASS)

1. **#1 fn add** — grammar-inverse row + full infer→emit pipeline. Witness: `add_body_ts_emit_add_fn_accepts_holds`, `typescript_add_emit_add_fn_accepts_holds` (`add_body_emit_typescript_test.dag`, `typescript_add_emit_translate_test.dag`).
2. **#2 field access** — VEP. Witness: `ts_field_access_emit_source_holds` → `"o.x"` (`typescript_field_access_emit_test.dag`).
3. **#3 record construct** — VEP. Witness: `ts_record_construct_emit_source_holds` (`typescript_record_construct_emit_test.dag`).
4. **#4 bind let IIFE** — VEP. Witness: `ts_bind_let_iife_emit_exact_holds` (`typescript_bind_let_iife_emit_test.dag`).
5. **#5 closure (value-producing)** — VEP. Witness: `ts_closure_emit_by_execution_exact_holds` (`typescript_closure_emit_by_execution_test.dag`).
6. **#6 enum / disj union** — VEP. Witness: `ts_enum_union_emit_by_execution_exact_holds` (`typescript_enum_union_emit_by_execution_test.dag`).
7. **#7 module import** — VEP. Witness: `ts_import_emit_by_execution_exact_holds` (`typescript_import_emit_by_execution_test.dag`).
8. **#8 effect apply** — VEP. Witness: `ts_effect_io_emit_holds` (`typescript_effect_io_emit_test.dag`).
9. **#9 fold_call body via translate** — VEP. Witness: `fold_call_closure_emit_keystone_holds` (`fold_call_closure_emit_test.dag`).
10. **#10 operators (arith/cmp)** — VEP with **ad-hoc test catalog only** (`add_body_ts_emit_catalog_minus_discriminates`, `add_body_ts_emit_missing_catalog_rejects`). Default `ts_operator_realizations_catalog_node()` enrolls **OpAdd only** (`typescript.dag:640`) — see #16.

### FAIL-CLOSED (emit explicitly Rejected — named)

1. **#11 loop in statement-sequenced block mode** — `ts_loop_statement_sequenced_fails_closed_holds` (`typescript_bind_let_iife_emit_test.dag`; also `typescript_closure_emit_by_execution_test.dag`). `.dag` loop emits; TS `StatementSequenced` mode rejects.
2. **#12 closure in statement-sequenced block mode** — `ts_closure_statement_sequenced_fails_closed_holds` (same files).

### FAIL-OPEN (compiler-scale; no green bar (b)+(c) on default model today)

1. **#13 match / coproduct dispatch** — `match_form.match_token = ^ts_token_unwired_match` (`typescript.dag:623`); no TS match witness; compiler uses `Match` heavily (`05_eval.dag`).
2. **#14 bind-in scoping** — `let_form.in_token = ^ts_token_unwired_bind_in` (`typescript.dag:606`).
3. **#15 loop form wiring** — `loop_form.loop_token = ^ts_token_unwired_loop` (`typescript.dag:609`).
4. **#16 default operator catalog** — `ts_operator_realizations_catalog_node()` rows = `[ts_add_operator_realization_row()]` only (`typescript.dag:640–641`). Algebra ops miss on default model (`add_body_ts_emit_missing_catalog_rejects`).
5. **#17 grammar-inverse rows beyond add** — committed `ts_mvp1_translation_rules_node()` has **1** child (`fn_add`); witness bundle `ts_mvp1_translation_rules_witness()` expects **3** (add + type_alias + pr3) (`typescript.dag:1381–1414`).
6. **#18 branch dispatch** — compiler uses `Branch` (`04_infer` / `05_eval`); zero TS emit witnesses.
7. **#19 tsc-green / emit_host oracle** — §5 spec-without-execution crack. Sole consumer path: `ts_host_transport_mvp1_descriptor` + `emit_host_gate.dag`. **`typescript_descriptor_node_ts_node_run_add_holds` FAIL** (wet `claim_batch`); **`emit_host_gate_passes` FAIL** (wet). Bar (c) red even for add.
8. **#20 whole `src/v2` → TS** — no module; Route-A tsc analogue not started (terminal slice E).

## 3. Discriminating counts

- **VEP source-string GREEN families:** 9 (#1–#9; #10 green only with ad-hoc catalog)
- **FAIL-CLOSED:** 2 (#11–#12)
- **FAIL-OPEN compiler-scale gaps:** 8 (#13–#20)
- **tsc-green (bar c):** 0/N wet — add fixture attempted, red in execution (#19)
- **Grammar-inverse rows:** 1 committed / 3 in witness bundle / ~15 wave2a productions defined

## 4. Size call

**LARGE multi-slice** — not a single row PR. Cheap tranche = grammar-row extensions (#17) + operator catalog derivation onto default TargetModel if row-only (#16). Load-bearing tranche = Match (#13) + loop/bind forms (#14–#15) + Branch (#18) — **HOLD for parent sign** before authoring TargetModel surfaces. Whole-tree tsc (#20) is terminal after per-construct gaps close.

## 5. Sequencing (revised 2026-07-01)

1. **A. Land this census** (this plan) — audit-first record, generated md.
2. **A2. tsc-green oracle REAL on existing VEP-green slices (#19 pulled forward)** — per-construct `tsc` acceptance on #1–#9 before stacking breadth. Converts string-green families into compile-green. Highest-value foundation work.
3. **B. Cheap row extensions (#17)** — enroll type_alias + pr3 rows into committed `ts_mvp1_translation_rules_node`; rows only, no new TargetModel surface.
4. **C. Operator catalog (#16)** — proceed **only** if genuinely row-derivation onto the default model; if it needs a new TargetModel surface → load-bearing → sign first.
5. **D. HOLD for parent sign:** Match (#13) + loop/bind (#14–#15) + Branch (#18) — compiler-scale TargetModel surfaces.
6. **E. Whole-tree Route-A tsc (#20)** — terminal.

**Priority note:** Lane C is language-breadth; operator retains burn-down sequencing call. Proceed A → A2 → B meanwhile; HOLD D for both parent sign and operator priority.

## Dissolution trigger (DESIGN §6)

Delete this census once every FAIL-OPEN row (#13–#20) is closed with execution-grounded witnesses and bar (c) tsc-green holds on the default TargetModel — the audit record is superseded by the substrate facts it enumerated.
16 changes: 8 additions & 8 deletions docs/plans/v2-self-hosting.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ The state-of-play below was verified 2026-06-21. What moved in the two days sinc
- **IMPROVED — the gap now has an owner and a construction-first fix.** The reconciliation endgame is **bright-stag-owned**: a model-first *single-authority* kill — **derive** the hand-maintained copy-lists FROM the emitted-module authority so the emitted↔hand drift becomes **unwritable** (the `invert-hand-maintained` move), with crisp-carp's `regen-verify` floor gate as the weaker post-hoc backstop layered on top. roadmap **`5-regen-verify` pulled forward**. cool-carp owns the *immediate* reconcile (fix the copy-lists + re-seed the 4 + verify clean) ahead of the construction fix.
- **IMPROVED — sequencing crystallized (emitter-first).** Order is now fixed: emitter-correctness settles (jolly-cat's Route-A lane; the corpus-emit surface measured at **~12,600 `E0308`**) → **single regen cutover** (bright-stag reconciliation) → `regen-verify` green → §7 fixpoint provable. Cutting over mid-emitter-churn re-drifts immediately, so the cutover is the *closing* step, not concurrent. This refines *Forced precondition order* step 3 below (it now has an owner + an ordering).
- **DECIDED — open question #1 (reopen direction).** Resolved to **(a)**: finish the Route-A green bootstrap (continue `emitter/seed-green-integration`, do **not** restart into a pure-`.dag` coherence reset). Anchored; do not re-litigate.
- **UNTOUCHED (still the wall, unchanged since 2026-06-21):** the Route-A last mile — the emitted crate still does **not** `cargo build` green (the `dsl_compile_clean` gate still only proves *well-typed*, not *built*). Track B / Stage C is still fail-closed (no real-digest match; comparison substrate still operator-pending, merry-crab-687). Track T (TypeScript) is still proven only on the `add` slice. The 590s+ whole-tree resolve is still the practical wall. None of these moved.
- **LANDED — Route-A last mile (2026-06-25..28, #5777/#5873; re-verified cool-ant-875 2026-07-01).** `regen_stage0 --emit-fresh` → faithful assembled crate → `cargo build` debug+release is **0 errors** (`route_a_emit_fresh_cargo_green_test` witness). `dsl_compile_clean` still only proves well-typed emit (not built); the execution witness is the receipt. **Still open:** Track B / Stage C (no real-digest match; comparison substrate operator-pending, merry-crab-687). Track T (TypeScript) proven only on the `add` slice. The 590s+ whole-tree resolve is still the practical wall.
- **Tracked elsewhere (not a self-host milestone):** the CI-fleet resource problem (session over-allocation, CI-floor under-sharding, resolve-cache) → `compute-envelope-model.md`; the std fork census → `dsl-v2-defork-audit.md`. The session-spawn cap *was* fixed operationally 2026-06-23 (per-session RAM reservation 31g→4g, ~30 sessions/host) — an infra fix, orthogonal to this track.

## 0. State of play (what's done, what's open)

- **Front-end — DONE, proven at scale.** `src/v2/` is 100% `.dag` (698 modules, 0 `.rs`; all Rust is the `src/v1` seed, ~154k lines). Full pipeline present: `01_tokenize → 02_parse → 03_resolve/name_resolve/ingest → 04_infer → 05_emit/eval → 06_translate → 07_target_carriers`. The historical blockers are fixed and merged: parse-perf (#5093 ParseTable memo, #3661), resolve/infer cost (#5258 the O(2^depth) double-resolve fix, #5266, #5146), cross-file names (#5271 Route C Phase B, #5154 filepath→QualifiedName). gap-4 (let-stmt in match arm) merged #5369; whole-tree parse-regression scanner added #5406. *Nuance:* per-file parse is fast, but a **combined `dsl`+`src/v2` whole-tree resolve is still heavy (590s+)** — "no perf wall" means the fixed blockers, not an instant full-tree resolve.
- **Emit / Route A — runs whole-tree, but the emitted crate doesn't build yet.** `gunbc compile --source-root … --target rust` exists and the CI `dsl_compile_clean` gate runs it over `[src/v2, dsl]`, gating all of batch-2. **But the gate only proves the tree is well-typed** (emit runs to completion, writes `$OUT`, then `rm -rf $OUT`). It does **not** `cargo build` the emitted whole-tree crate. Only the emit-host MVP smokes compile tiny fixtures. **The green build of the emitted crate is the open Route-A last mile.**
- **Emit / Route A — whole-tree emit + faithful `--emit-fresh` crate builds green (#5777/#5873).** `gunbc compile --source-root … --target rust` exists and the CI `dsl_compile_clean` gate runs it over `[src/v2, dsl]`, gating batch-2 (well-typed emit only — writes `$OUT`, then `rm -rf $OUT`). The **cargo-green** receipt is `regen_stage0 --emit-fresh <dir>` → `cargo build` (debug+release), proven by `route_a_emit_fresh_cargo_green_test`.
- **Fixed-point proof — fail-closed (not achieved).** `self_host.dag`'s `self_host_fixed_point_validate` **unconditionally returns `Rejected`** (`self_host_runner_not_realized`) — the honest contract until Stage C. `self_host_fixed_point_digests_match` (`==` over `content_hash`) is realized but de-risked only on fixture stages. The whole-compiler fixed point over real digests does not yet run.
- **Emitter — genuinely multi-target.** One `fold_node` catamorphism in `06_translate.dag`; emit selects a target's `target_model_edge_translation_rules` and walks the same rows **backward** (`grammar_relation_row_reverse_parse_selection`). 14 targets in `src/v2/extdeps/languages/` (rust, python, go, bash, dag, cpp, typescript, kotlin, swift, java, lean, ptx, verilog, …), 5 in `dsl`. A new target is **data rows, never a new emitter**.

Expand All @@ -33,11 +33,11 @@ The state-of-play below was verified 2026-06-21. What moved in the two days sinc
Get the v2-emitted Rust compiler to build and reproduce itself.

1. Emit whole tree `--target rust` — **done** (well-typed under CI gate).
2. `cargo build` the emitted crate green — **open** (the last mile).
2. `cargo build` the emitted crate green — **done** (#5777/#5873; `regen_stage0 --emit-fresh` witness).
3. `regen_stage0` from the emitted crate; replace the hand-Rust seed.
4. Flip the lockstep / fixed-point gate from fail-closed to asserting the real `content_hash` digest match (Stage C).

Unmerged work: branch `emitter/seed-green-integration @ 239ff284d5` (**not in main**) carries 6 commits toward a green regen — import-completeness (E0425), List→host-`Vec`, Int-as-generic-arg→`i64`, `regen_stage0` patch, + 2 integration commits. PR **#5325 is CLOSED, not merged.** Recent emitter slices on main: #5413 (length→count, phantom-marker derives, Measure-alias E0560 peel, E0308 Box-deref cluster); MachineWidth is **#5397** (E0107), a separate PR.
**Route-A cargo-green landed on main** (#5777 emitter fixes → 0 rustc errors; #5873 two-generation regen cutover + `regen --verify` CI gate). Branch `emitter/seed-green-integration` content is absorbed — the branch is stale vs `main` and can be retired. PR **#5325** remains closed (superseded by #5873).

### Purity: no stage0 hand-edits (the requirement, and the enforcement gap)

Expand All @@ -46,10 +46,10 @@ Unmerged work: branch `emitter/seed-green-integration @ 239ff284d5` (**not in ma
The requirement — **v2 emits its own seed; no human stage0 patches** — is *modeled, currently unmet, and un-enforced.* `src/v2/workflow/bootstrap.dag` is the authority and states it exactly ("seed→stage0→stage1→stage2, fixpt stage1==stage2 … seed used once; v2 is never in the loop again", DESIGN §7), including the trust machinery to retire the seed (`SeedHonestyDischarge`, `DiverseCompilationAgreement`/`IndependentCompilerPair` = Diverse Double-Compiling, the Thompson trusting-trust defense). But:

- **The seed is hand-maintained today.** `regen_stage0.rs` carries `HAND_MAINTAINED_STAGE0_FILES` + `patch_*` (e.g. `patch_bootstrap_dag_collect`) that compensate for emitter gaps — each a "stage0 hand-edit standing in for a thing v2 should emit itself," honestly marked with a dissolve-on pointing at the emitter fix. (Gotcha: regen has pre-existing codegen drift, so focused PRs hand-edit the `.rs` seed mirror rather than commit a full regen — itself a symptom of the gap.)
- **The no-drift gate is real but not wired.** `regen_stage0 --verify` (`verify_stage0_matches` — "committed stage0 matches fresh self-compile") exists, but a grep of the CI floor (`src/v2/workflow`, `dsl/tools`, `dsl/gunbc`, `dsl/test`) finds it nowhere. The `Stage0LockstepGate` that would wire it in is the content of **closed/unmerged #5325**. So hand-drift goes silently uncaught — erosion by one more honest-looking `patch_*` at a time.
- **The no-drift gate is wired (#5873).** `regen_stage0 --verify` runs in the CI floor via `RegenVerifyGate` → `regen_verify_gate_passes` (`src/v2/workflow/ci_floor_plan.dag`). It enforces no drift on **generated** `GENERATED_STAGE0_FILES`; `HAND_MAINTAINED_STAGE0_FILES` are copied through by design. Closed #5325's `Stage0LockstepGate` was superseded by #5873. **Still open:** dissolve `patch_*` / hand-maintained copies so the emitter owns the whole seed (roadmap `5-dissolve-patches`).
- **bootstrap.dag is 🟡 scaffold** — structural wiring only, placeholder hashes (dissolve-on T-15/T-20 `content_hash` supplying real per-stage merkle digests), so it does not yet *prove* convergence.

**This gate is the keystone for both the purity requirement and a trustworthy cutover.** It is what makes "no stage0 hand-edits" enforceable; without it the requirement can only erode.
**The regen-verify gate is the keystone for a trustworthy cutover** — it now runs in CI (#5873), but hand-maintained seed copies and `patch_*` remain until `5-dissolve-patches` lands.

### Track B — the fixed-point proof (Stage C)

Expand All @@ -69,9 +69,9 @@ So "delete stage0" decomposes — `src/v1` also provides the **CLI bins** (`clai

**Forced precondition order (each gates the next):**

1. Whole-tree emit → `cargo build` green (Track A last mile).
1. Whole-tree emit → `cargo build` green — **done** (#5777/#5873; `regen_stage0 --emit-fresh` witness).
2. Real fixed point: `self_host_fixed_point_digests_match` over real `content_hash` (Track B / Stage C; dissolve the placeholder hashes, T-15/T-20).
3. `regen_stage0 --verify` green **and wired into CI** (the `Stage0LockstepGate`, closed #5325) + all `patch_*` / `HAND_MAINTAINED_STAGE0_FILES` dissolved so the emitter emits the whole seed. **This is the step that actually retires "stage0 hand-edits"** and makes the cutover trustworthy. *(Owner + ordering, per #5639: the single regen **cutover** is bright-stag-owned — derive the copy-lists from the emitted-module authority so the drift is unwritable — and lands **after** the emitter largely settles (jolly-cat's emitter-correctness lane), since each emitter fix shifts what a regen produces. crisp-carp's `regen-verify` floor gate is the backstop. roadmap `5-regen-verify` pulled forward.)*
3. `regen_stage0 --verify` wired into CI — **done** (#5873 `RegenVerifyGate`) + all `patch_*` / `HAND_MAINTAINED_STAGE0_FILES` dissolved (**open**, roadmap `5-dissolve-patches`) so the emitter emits the whole seed. **This is the step that actually retires "stage0 hand-edits"** and makes the cutover trustworthy. *(Owner + ordering, per #5639: the single regen **cutover** is bright-stag-owned — derive the copy-lists from the emitted-module authority so the drift is unwritable — and lands **after** the emitter largely settles, since each emitter fix shifts what a regen produces.)*
4. Seed-honesty discharge (ideally via Diverse Double-Compiling).
5. Then collapse `src/v1` to the pinned reproducible seed and delete its compiler logic **incrementally** — verify by execution, not assumption.

Expand Down
Loading
Loading