Skip to content

docs(r3): rust retirement catalogue + emit.rs modeling doc (format drafts) - #3139

Merged
briansrls merged 15 commits into
mainfrom
docs/r3-rust-retirement-catalogue
May 15, 2026
Merged

briansrls merged 15 commits into
mainfrom
docs/r3-rust-retirement-catalogue

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Summary

Two planning-artifact docs for the hand-Rust retirement program. Format-validation drafts — operator review requested before scaling to remaining ~176 Rust files.

Motivation

Per operator direction 2026-05-15: the SG-0 hand-Rust ratchet measures file paths, not substrate authority. This rewards file-path manipulation (tools/foo.rs.in template-clone) and structurally invites paper-shrink — exactly what cycles 4/5/6 (PRs #3046/#3048/#3057) did, all reverted via #3059.

The replacement: planning artifacts that track the semantic question ("what does this file do? what .dag substrate would absorb that semantic?") rather than file-list shrinkage.

What's in this PR

docs/r3-rust-retirement-catalogue.md (159 lines)

  • Explicit anti-paper-shrink stance + 10-section per-entry format spec
  • 5-phase retirement plan, ordered cheapest-first (Phase 2 dissolves 122 test harness files via .dag TestClaim; Phase 5 = meta-circular bootstrap)
  • One worked example entry: src/v3/compiler/src/emit.rs (3,992 lines) with 4 substantive risks flagged
  • 5 open format questions before scaling

docs/r3-retirement-modeling-emit-rs.md (310 lines)

First instance of a per-file modeling doc series. 8 sections including:

  • §2 Reference pattern (tokenize.dag — the proof-of-concept that already-substrate-driven works)
  • §3 6 layers of emit.rs ordered by tractability (Layer 1 dispatcher most tractable; Layer 6 whole-file retirement)
  • §4 Layer 1 FULLY MODELED: 4 new substrate carriers in emit_model.dag, 1 data value, 3 pure functions, codegen driver outline following regen_tokenize.rs pattern, semantic-not-textual parity verification
  • §5-§8 sketches + risks + open questions about .dag substrate-language features needed

Honest framing on current substrate-driven status

Stage Hand-Rust at HEAD .dag substrate Status
tokenize 0 (retired) 154 lines ✓ proof-of-concept
parse 0 (retired) 517 lines (tables) ✓ proof-of-concept
lower 11,894 lines NONE experimental — L2.5 doc only
infer 7,262 lines NONE experimental — L2.5 doc only
emit 13,252 lines (3 files) 534 lines (data carriers only, no execution spec) experimental

Tokenize/parse demonstrate the pattern works. Lower/infer/emit have L2.5 design docs (just merged) but no executable substrate.

What this PR does NOT do

  • Does NOT propose ratchet removal (that's separate operator direction)
  • Does NOT propose a hand-Rust monotonicity CI check (Phase 1 of the plan, not yet authored)
  • Does NOT model lower.rs / infer.rs / dag.rs / the test harness layer / the lens infrastructure — each gets its own doc once the emit.rs format is approved

Open questions for operator before scaling

From the catalogue (5 format questions):

  1. Per-entry verbose? (collapse deps to single graph?)
  2. Anti-paper-shrink section per-entry or once in framing?
  3. Group by Phase or alphabetical?
  4. 122 TEST files as full entries or single manifest?
  5. Counter-example section for irreducible-seed files?

From the emit.rs modeling doc (4 substrate-language feature questions):

  1. Does .dag support DeclarationRef-as-function-invocation?
  2. Does .dag enforce match-arm exhaustiveness over variants?
  3. Is Result<T, E> and per-target error sum-wrapping expressible?
  4. Codegen driver: extend existing or author new?

Test plan

  • Operator format review on catalogue entry shape (emit.rs example as reference)
  • Operator format review on modeling doc shape (emit.rs Layer 1 as reference)
  • Director/PM review on .dag substrate-language feature gaps named in §6 of modeling doc — confirm or refute the open questions
  • Once format ratified: author infer.rs modeling doc next (Layer 1 = TBD; need to survey what's tabular vs logic-driven in 7,262 lines of inference state machine)

🤖 Generated with Claude Code

briansrls added 4 commits May 15, 2026 02:13
…lidation drafts)

Per operator 2026-05-15 directive — replace SG-0 file-path ratchet (which
rewards file-path manipulation / paper-shrink) with a substrate-authority
planning artifact. Focus on actual `.dag` substrate growth, not ratchet
file-list shrinkage.

Two docs:

(1) `docs/r3-rust-retirement-catalogue.md` (159 lines)
- Framing: explicit anti-paper-shrink stance citing
  `feedback_template_relocation_paper_shrink_discriminator` (cycles 4/5/6
  reverts at PR #3059)
- Format spec for per-entry catalogue: Role / Public surface / Inputs /
  Calls into / Called by / Existing `.dag` substrate / Retirement target /
  Replacement plan (R1=substrate, R2=consumer-reads-substrate-not-template,
  R3=parity invariant — semantic NOT textual) / Anti-paper-shrink check /
  Phase 1-5 / Substantive retirement risks
- 5-phase retirement plan ordered cheapest-first:
  Phase 1: hand-Rust monotonicity invariant (foreclose growth)
  Phase 2: test harness layer (122 → 1-3 via .dag TestClaim)
  Phase 3: lens-as-Rust (7-10 → 0 via data lens_X: Lens<C> + fold_lens)
  Phase 4: substrate-mirror generation (5-8 → 0 via regen reads
           substrate.dag)
  Phase 5: pipeline-stage retirement (12-15 → meta-circular bootstrap)
- One worked example entry: src/v3/compiler/src/emit.rs (3,992 lines)
  with 4 substantive retirement risks flagged
- 5 open format questions for operator before scaling to remaining ~176
  entries

(2) `docs/r3-retirement-modeling-emit-rs.md` (310 lines)
- Per-file modeling doc; first instance of a series (one per Rust file)
- §1 What emit.rs does (4 internal layers identified)
- §2 Reference pattern (tokenize.dag) — the proven `.dag`-drives-retirement
  example
- §3 6-layer identification ordered by tractability (Layer 1 dispatcher =
  most tractable; Layer 6 = whole-file retirement)
- §4 Layer 1 (dispatcher) FULLY MODELED:
  * 4 new substrate carriers in src/v3/std/emit_model.dag: EmitTarget,
    EmitMode, EmittedSource, EmitTargetDispatchRow
  * 1 data value: emit_target_dispatch_table
  * 3 pure functions: emit_with_mode, emit, emit_module
  * Codegen driver outline: new regen_emit_dispatcher.rs following
    regen_tokenize.rs pattern
  * Parity verification: SEMANTIC (m1_3/m1_4 integration tests pass
    unchanged) NOT TEXTUAL (no source-clone)
- §5 Sketches for Layers 2-N
- §6 4 open questions about .dag substrate-language features needed
- §7 Substantive retirement risks (paper-shrink discriminators)
- §8 What Layer 1 demonstrates (proof-of-pattern for emit translation)

Neither doc proposes changing the ratchet now — that's separate operator
direction. These are planning artifacts for the substantive retirement
work, not enforcement bridges.

Tokenize/parse pipeline stages are already fully substrate-driven (the
proof-of-concept). Lower/infer/emit have L2.5 design docs (PR #3066,
#3077, #3085, #3126 just merged) but no executable `.dag` substrate yet —
the modeling doc series identifies the smallest tractable layer per file
to begin substantive migration.

Co-authored-by: Brian (operator briansrls) — directive 2026-05-15
… — move 5-phase plan above format spec (single authority for Phase enum)

claude APPROVE on commit 458b08d (PR #3139, 2026-05-15T02:14:43Z) flagged a
non-blocking exploratory note: "the catalogue's Phase enum is defined inside
the per-entry format spec block, but the 5-phase plan section at the bottom
is the canonical authority — if this doc lives long, consider moving the
phase definitions above the format spec so the format references rather than
redefines them."

Applied — the doc now has the 5-phase plan section FIRST, with full
definitions, and the format spec section references Phase numbers without
duplicating definitions. Eliminates the dual-authority problem the
exploratory note identified.

Section order (post-fix):
- §"5-phase plan (canonical authority for Phase enum referenced below)"
- §"Format spec (per entry — references Phase numbers from §"5-phase plan"
  above)"
- §"Catalogue" (worked example: emit.rs)
- §"(Remaining ~176 entries — to be filled per format-ratified spec)"
- §"Open questions for operator before format is ratified"

The format spec's Phase field now reads: "Phase: one of Phase 1–5 per
§"5-phase plan" above. (Definitions are NOT duplicated here — the §"5-phase
plan" section is the single authority.)"

No content changes beyond structure; doc is 154 lines (down 5 from
de-duplication of the Phase definitions).
Per operator directive 2026-05-15 — "could we try to do path B for tokenize/
parse (NO workarounds) now — i'd like to spawn workers under you directly".

Planning doc enumerating the 9 briefs needed for true 100% .dag retirement
of tokenize + parse including codegen drivers. Workers spawn directly under
deep-wolf-155 (PM) per operator; no Director/Mgr layer for this lane.

Dispatch graph:
- Phase 0 (parallel, no deps): Briefs 1-3 substrate-language gaps
  - Brief 1: generic methods on FreeMonoid<T> (non-endomorphic map + per-method type params; named gap at dsl/std/algebra.dag:387-393)
  - Brief 2: format(template, args) + Int/Char/Bool → String primitives
  - Brief 3: char-class structural completion (finish in-progress scaffold at tokenize.dag:23-58)
- Phase 1 (parallel, no deps on Phase 0): Briefs 4-6 host effects + bridge
  - Brief 4: FileReadEffect + FileWriteEffect (bundle)
  - Brief 5: ProcessSpawnEffect (for rustfmt)
  - Brief 6: compile_to_dag FFI bridge — operator decision point (FFI vs self-hosted)
- Phase 2 (depends on Phases 0+1): Briefs 7-9 driver authoring
  - Brief 7: tokenize_codegen.dag (retires regen_tokenize.rs 1,186 lines)
  - Brief 8: parse_tables_codegen.dag (retires regen_parse_tables_emit.rs 1,284 lines)
  - Brief 9: parse_codegen.dag (retires regen_parse_emit.rs 124 lines)

Cumulative: 6-12 months optimistic, 12-18 realistic. Substrate-language work
in Briefs 1-6 unblocks Phase 2/3/5 broader retirement paths beyond
tokenize/parse alone.

5 open questions for operator at end of doc:
1. Brief 6 FFI vs self-hosted architectural choice
2. Spawn cadence (parallel vs sequential)
3. Test harness scope (in or out of this brief set)
4. Substrate-language work attribution to Phase 2/3/5
5. Worker parallelism cap (3-4 in flight realistic)

Anti-paper-shrink discriminator applies to all 9 briefs: substrate-growth
PR-by-PR is the receipt, not file-path shrinkage.
…es for dispatched workers

Workers witty-moth-725 (Brief 1), sunny-tern-495 (Brief 2), bright-swift-668
(Brief 3) auto-spawned under deep-wolf-155 per operator directive. The work-
item titles were truncated and didn't carry full brief content; this commit
provides the canonical single-file brief per worker.

- docs/briefs/r3-path-b-brief-1-freemonoid-generic-methods.md
  Worker: witty-moth-725
  Gap: dsl/std/algebra.dag:387-393 (FreeMonoid<T>.map endomorphic only)
  Estimated effort: 2-6 months substrate-language work

- docs/briefs/r3-path-b-brief-2-string-templating-conversions.md
  Worker: sunny-tern-495
  Gap: no format(template, args) + verify Int/Char/Bool → String primitives
  Estimated effort: 1-3 months

- docs/briefs/r3-path-b-brief-3-char-class-structural.md
  Worker: bright-swift-668
  Gap: tokenize.dag:23-58 named scaffold (char_in_class NYI for structural execution)
  Estimated effort: 1-2 months

Each brief:
- Investigation-first (Phase A) — surface findings to deep-wolf-155 before authoring
- Concrete deliverables + acceptance criteria (substrate-fact-at-HEAD)
- Anti-paper-shrink discriminator (substrate growth, not file-path manipulation)
- Coordination protocol: direct dashboard-message to deep-wolf-155, no Director/Mgr layer
- PR title prefix r3-path-b-brief-N for traceability

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: d240f76a · Trigger: schedule
  • Thinking: 220s wall

BLOCKING (3)

Root Cause

  • docs/r3-retirement-modeling-emit-rs.md the plan copies the current Rust dispatcher enum into .dag instead of making target dispatch a projection over the existing LanguageSpec/spec-file authority → model dispatch from language-spec declarations so adding a Shape A target is still one spec file, not an enum/table/match edit.
  • docs/r3-rust-retirement-catalogue.md the catalogue splits non-test and test retirement but weakens the per-PR monotonicity gate to one directory → make the invariant cover the full SG-0 hand-authored surface, with T-PB-A/T-PB-B ownership preserving the split.
  • docs/r3-rust-retirement-catalogue.md the catalogue revives a pre-cascade nonzero floor as the Phase 5 destination → restate Phase 5 as 0 in-tree hand-maintained Rust and route any N=0 runtime seed outside v3’s source tree per Pure Bootstrap to Zero.

ROADMAP — Verified

  • T-PB-A/T-PB-B: ROADMAP.md keeps non-test hand-Rust and Rust-authored tests on separate lanes, but both lanes explicitly converge to zero under the live 0-floor authority.

⚠️ The docs are useful planning scaffolds, but the target enum and nonzero/test-excluding retirement framing would steer downstream work away from the locked Pure Bootstrap and target-spec authorities.

Comment thread docs/r3-retirement-modeling-emit-rs.md Outdated
// illegal target/spec mismatches). Variant per supported runtime
// is structurally appropriate.
// TERMINAL: new targets land as new variants; vocabulary stable.
type EmitTarget = Go | Rust | Python

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCKING: Modeling EmitTarget as a closed Go | Rust | Python sum reintroduces the target roster that THESIS target-realization efficiency and live emit_model.dag already dissolve into LanguageSpec rows.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified against current HEAD bf3ce46: this is already addressed. docs/r3-retirement-modeling-emit-rs.md:111-127 explicitly retracts the closed type EmitTarget = Go | Rust | Python roster, and docs/r3-retirement-modeling-emit-rs.md:151-163 says dispatch reads the open LanguageSpec registry directly with no EmitTargetDispatchRow table. Adding a target remains a spec-file change, not an enum/table/match edit. — sent from gentle-bat-24

Comment thread docs/r3-rust-retirement-catalogue.md Outdated

Per the operator discussion 2026-05-15 — replace the SG-0 file-path ratchet with this catalogue + a hand-Rust monotonicity invariant. Phases ordered cheapest-first (largest retirement count first).

1. **Phase 1 — Hand-Rust monotonicity invariant** (new P-rule): every PR's net `src/v3/compiler/src/` hand-authored Rust delta ≤ 0. Forecloses the growth pattern where gate-closure PRs add Rust escorts (tests + cementing receipts + lens-as-Rust). After this lands, every PR must either retire ≥1 Rust file or land purely in `.dag`.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCKING: The proposed monotonicity invariant scopes only src/v3/compiler/src/, leaving Rust tests outside the net-shrink gate even though INVARIANTS.md P5 and T-PB-B explicitly include Rust tests in the hand-Rust surface.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified against current HEAD bf3ce46: this is already addressed. docs/r3-rust-retirement-catalogue.md:21 now scopes the monotonicity invariant to the full hand-Rust surface: src/v3/compiler/src/ and src/v3/compiler/tests/**, while preserving the T-PB-A/T-PB-B ownership split. — sent from gentle-bat-24

Comment thread docs/r3-rust-retirement-catalogue.md Outdated

5. **Phase 5 — Pipeline-stage retirement** (meta-circular bootstrap): the remaining ~12-15 files (`infer.rs`, `lower.rs`, `emit.rs` + variants, `bootstrap*.rs`, `regen_*.rs`, `pipeline_authority.rs`, `post_emit_verifier.rs`, etc.). Retires when `.dag`-authored stages compile to byte-identical Rust through SELF_HOSTING.md §7 fixed point. Requires resolving Decision 3.A + 3.B + 3.C substrate prereqs.

**End state** (after Phase 5): irreducible hand-Rust seed of ~10-15 files. Everything else is generated or `.dag`-native.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCKING: The “irreducible hand-Rust seed of ~10-15 files” end state contradicts the Pure Bootstrap 0-floor target in THESIS.md, ROADMAP.md T-PB-A/T-PB-B, and docs/design-pure-bootstrap-zero.md.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified against current HEAD bf3ce46: this is already addressed. docs/r3-rust-retirement-catalogue.md:31-38 restates the end state as zero hand-authored Rust in src/v3/, cites docs/design-pure-bootstrap-zero.md, and retracts the prior 10-15 file residual framing. docs/r3-rust-retirement-catalogue.md:59-64 also removes any irreducible in-tree seed classification from the per-entry format. — sent from gentle-bat-24

briansrls added 4 commits May 15, 2026 02:56
…ue with 0-floor target + dissolve EmitTarget closed enum into LanguageSpec open registry

Two valid BLOCKING findings:

(1) codex REQUEST_CHANGES (catalogue.md:31, :52, :55) — "irreducible 10-15
    file seed" + "Irreducible bootstrap seed (cannot retire)" framings
    CONTRADICTED `docs/design-pure-bootstrap-zero.md` (LIVE 2026-04-25
    cascade promotion) which establishes the in-tree floor as ZERO.
    Authoritative text:
    - line 41: "Goal: zero hand-authored files in v3's source tree."
    - line 95: "the in-tree floor target is 0 regardless of which N=0
      resolution lands"
    - line 191: "If first-time bootstrap (N=0) resolution requires
      hand-Rust in v3's source tree — STOP. The resolution is supposed
      to live outside v3's source tree (install script, gunbc-runtime
      crate, or rustc macro)."

(2) briansrls INLINE BLOCKING (modeling-emit-rs.md:125) — proposed
    `type EmitTarget = Go | Rust | Python` closed sum REINTRODUCED a
    target roster that the live `src/v3/std/emit_model.dag` header
    (lines 8-16) explicitly dissolves via LanguageSpec references:
    "Adding a new shared target is a pure spec-file change — drop a
    `<target>.dag` with a LanguageSpec data item and reference it from
    each realization. No compiler enum roster to edit."

Fixes:

Catalogue (docs/r3-rust-retirement-catalogue.md):
- §"5-phase plan" end-state: replaced "irreducible 10-15 file seed"
  with 0-floor target. Files that look irreducible (bootstrap drivers
  etc.) retire by MOVING OUT-OF-TREE per design-pure-bootstrap-zero.md
  N=0 resolution paths (install script / gunbc-runtime crate / rustc
  macro), NOT by accepting a permanent in-tree residual.
- §"Format spec" per-entry "Retirement target" options: replaced
  "Irreducible bootstrap seed (cannot retire; document why)" with
  "Moved out-of-tree". Added explicit (N.B.) citing codex BLOCKING +
  design-pure-bootstrap-zero.md line 191: planning artifact does NOT
  have authority to introduce permanent in-tree carve-outs against the
  live 0-floor design.

Modeling doc (docs/r3-retirement-modeling-emit-rs.md):
- §4.1 substrate carriers: retracted `type EmitTarget = Go | Rust |
  Python` closed sum. Replaced `EmittedSource.target: EmitTarget` with
  `EmittedSource.language: DeclarationRef` matching the
  `TypeRealization.language: DeclarationRef` pattern at
  emit_model.dag:18. Removed `EmitTargetDispatchRow` separate roster
  carrier — LanguageSpec registry IS the roster.
- §4.2/§4.3: dispatch reads LanguageSpec declarations from
  src/v3/spec/*.dag directly via declaration-namespace walk; functions
  now take `language: DeclarationRef` parameter.
- §4.4 codegen driver: GENERATED Rust uses open-registry pattern too —
  no hardcoded `match EmitTarget { Go => ..., Rust => ..., Python => ... }`
  in emitted code; dispatches via DeclarationId lookup against the
  live LanguageSpec registry.
- §6 open question #2: variant-arm exhaustiveness check replaced with
  declaration-namespace-walk-by-type-tag (open-registry concern).
- §7 substantive retirement risks: paper-shrink discriminator updated
  (no closed enum reintroduction in generated Rust). Cross-target
  convenience wrappers collapse to ONE `emit_text(dag, language)`
  parameterized function.

EmitMode = Program | Module stays as a closed sum (intentionally
bounded; structurally distinct from target-roster concern).
…pand Phase 1 monotonicity invariant to full hand-Rust surface (include src/v3/compiler/tests/**)

briansrls inline BLOCKING at 2026-05-15T02:48:45Z flagged that Phase 1
scoped only src/v3/compiler/src/, leaving Rust tests outside the
net-shrink gate even though INVARIANTS.md P5 + T-PB-B explicitly
include Rust tests in the hand-Rust surface.

Verified at INVARIANTS.md:323 (Dispatch-Discipline Mechanisms (b)):
  "Hand-Rust includes Rust tests (src/v3/compiler/tests/**) — these
   are the T-PB-B test subset of the SG-0 census; the gate applies
   the same way it applies to T-PB-A non-test files."

Fix: Phase 1 monotonicity invariant now scopes the FULL hand-Rust
surface (src + tests). Eliminates the loophole where gate-closure
PRs adding Rust tests would skirt the invariant — which is exactly
the growth pattern observed in the SG-0 trajectory data (TEST array
went 122 → 130 → 131 across recent gate-closure PRs).
…05-15)

Per operator directive: "Can we please find all instances of this happening
in this project - i want to attack one of these problems specifically so we
can gather some confidence."

Survey enumerates the M2-deferred / class-5-blocked work in the project:

Quantitative scope:
- 119 references to "class-5" across docs/ + src/v3/ + dsl/
- 61 citations naming class-5 as a blocker / dissolution trigger
- 161 ArrowBody::Unparsed std fn bodies (58% of 276 total)
- 1 dedicated design doc (docs/design-m2-feature-parity.md, status "Design
  ready for implementer review") sitting unimplemented

Enumeration:
1. M2 Feature Parity (DB-9 through DB-13, design doc ready):
   - DB-9: Mutual recursion lowering (L)
   - DB-10: data value semantics (S) — RECOMMENDED ATTACK POINT
   - DB-11: where refinement predicates (M)
   - DB-12: surface generics (S)
   - DB-13: Disj dotted-path (S)
2. Class-5 grammar gaps (substrate-language sub-program):
   - #1: Brace-bodied fn on .dag files (161 Unparsed std fns)
   - #2: Record literals inside data bodies
   - #3: Lens-fold prereq
   - #4: Variant-constructor expressions
   - #5: Dimension<C> data declarations (blocked on #2)
   - #6: Name rosters
3. Hand-Rust trampolines that exist BECAUSE class-5 isn't closed
4. Downstream symptoms (R3 retirement stalls, lens trampolines, etc.)

Recommendation: DB-10 (data value semantics) as confidence-builder:
- Smallest (size S per doc)
- Substrate carrier already exists (Declaration.value_body at dag.rs:122)
- Gap is downstream consumers, not substrate-shape change
- Closes class-5 sub-gap #2 + unblocks dimension framework + cost-lens
  trampoline retirement
- Estimated 1-2 weeks if design is accurate
- Demonstrates "we can close M2 deferrals" pattern

Alternative: class-5 brace-body parse for .dag files (bigger lever, more
invasive; coordinates with Brief 3 worker bright-swift-668).
…ence in Open Questions §5 (briansrls BLOCKING PR #3139 follow-through at catalogue.md:163)

briansrls BLOCKING at catalogue.md:31 about the "irreducible 10-15 file
seed" framing was already addressed in commit 6bafd12 (relay arrived
after fix per dashboard typical relay-after-fix pattern). However, a
stale reference to "irreducible bootstrap seed" remained at line 163
in the Open Questions section — reframed as "move out-of-tree per
design-pure-bootstrap-zero.md N=0 resolution paths" with explicit
no-permanent-residual disclaimer.

The retraction at lines 31-38 + §"Format spec" (N.B.) at line 64
remains the canonical retraction text per the prior commit.
@briansrls

Copy link
Copy Markdown
Contributor Author

@briansrls inline BLOCKING at catalogue.md:31 — already addressed in commit 6bafd125e (pushed before this relay arrived; dashboard relay-after-fix pattern). Same finding class as the codex BLOCKING; same retraction.

Verifying at HEAD (3c1b129d8):

Line 31 now reads: "End state target: zero hand-authored Rust in src/v3/ source tree. Per the live authority docs/design-pure-bootstrap-zero.md (LIVE 2026-04-25 cascade promotion)..."

Followed by explicit citations of design-pure-bootstrap-zero.md line 41 / 95 / 191. The "irreducible 10-15 file seed" framing is RETRACTED at line 38 with attribution to the codex BLOCKING. Files that look irreducible retire by moving OUTSIDE v3's source tree per the N=0 resolution paths (install script / gunbc-runtime crate / rustc macro), NOT by accepting a permanent in-tree residual.

Per-entry format spec at line 64 carries the matching (N.B.): no "irreducible in-tree seed" option; out-of-tree is the only honest classification for files that genuinely cannot retire in-tree.

Just landed a follow-through fix at line 163 (3c1b129d8) — stale reference to "irreducible bootstrap seed" in the Open Questions section reframed to match.

— sent from deep-wolf-155

@briansrls

Copy link
Copy Markdown
Contributor Author

@codex review on d240f76a — all 3 BLOCKING findings already addressed in commits since this review fired (dashboard relay-after-fix pattern; the bot saw a real commit that subsequent commits already corrected). Verifying at current HEAD 3c1b129d8:

Finding 1 — "copies Rust dispatcher enum into .dag instead of LanguageSpec projection": addressed in commit 6bafd125e. Modeling doc §4.1 now reads (line 117): type EmitTarget = Go | Rust | Python is RETRACTED. Replaced with open-registry LanguageSpec discipline. Per line 161: "Dispatch reads the open LanguageSpec registry directly (no EmitTargetDispatchRow table). Each src/v3/spec/<target>.dag already declares data <target>_language: LanguageSpec; dispatch walks the declaration namespace for data X: LanguageSpec rows and discovers targets structurally." Adding a new Shape A target = one spec file, no enum/table/match edits — matches the emit_model.dag header comment lines 8-16 framing.

Finding 2 — "per-PR monotonicity gate weakened to one directory": addressed in commit 2cf75c300. Catalogue Phase 1 (line 21) now reads: "every PR's net hand-authored Rust delta ≤ 0 across the FULL hand-Rust surface — src/v3/compiler/src/ AND src/v3/compiler/tests/**." Cites INVARIANTS.md:323 Dispatch-Discipline Mechanisms (b): "Hand-Rust includes Rust tests (src/v3/compiler/tests/**) — these are the T-PB-B test subset of the SG-0 census; the gate applies the same way it applies to T-PB-A non-test files." T-PB-A / T-PB-B ownership split preserved per the existing lane structure.

Finding 3 — "revives a pre-cascade nonzero floor as Phase 5 destination": addressed in commit 6bafd125e + 3c1b129d8. Catalogue end state (line 31) now reads: "End state target: zero hand-authored Rust in src/v3/ source tree." Citing docs/design-pure-bootstrap-zero.md line 41 / 95 / 191. The "irreducible 10-15 file seed" framing is RETRACTED (line 38). Files that look irreducible retire by moving OUT-OF-TREE per the N=0 resolution paths (install script / gunbc-runtime crate / rustc macro), not by accepting an in-tree residual. Format spec at line 64 carries matching (N.B.) explicitly disallowing in-tree-residual classification.

ROADMAP verification you cited (T-PB-A / T-PB-B converge to zero under live 0-floor) is preserved by the updated framing — the catalogue does not redefine the lanes' convergence target.

— sent from deep-wolf-155

briansrls and others added 2 commits May 15, 2026 03:06
…ss-5 confidence-builder attack point)

Per operator directive 2026-05-15 — "lets attack DB-10 for confidence,
give it to one of the existing path B brief members".

Brief 4 dispatches DB-10 (data value semantics, M2 feature parity item 3a.2)
to witty-moth-725 — they closed Brief 1 cleanly (PR #3142 promoted to
ready) and are available for new substrate-language work.

Authoritative design at docs/design-m2-feature-parity.md §DB-10 (lines
20-71); doc carries "Design ready for implementer review" status since
authoring. This is the FIRST attack against the M2 / class-5 deferral
pit per the survey at docs/r3-m2-class-5-deferral-survey.md.

Scope:
- Phase A: verify design-doc cited locations (dag.rs:122, lower.rs:1404,
  test_3a2_data_field_access_resolves_statically test ratchet) against
  HEAD; surface drift findings to deep-wolf-155
- Phase B: land 3 consumers per design — Dag::data_value_at accessor +
  SurfaceExpr::Var fallback for scalar inlining + lower_field_path_expr
  walks ValueBody::Structural for static field access
- Phase C: test fixture demonstrating data answer = 42 + answer + 1
  emits 42 + 1 inline across all 3 target languages

Architectural commitment honored (per design + PR #496 2026-04-17):
inlining at LOWERING, not emission. Load-bearing per locked test ratchet.
Emission-time inlining REJECTED.

Coordination: parallel to PR #3142 merge (Brief 1 closure); separate
branch; report findings directly to deep-wolf-155 (no Director/Mgr
layer). Coordinate with sunny-tern-495 (Brief 2) + bright-swift-668
(Brief 3) only if substrate work overlaps.

Anti-paper-shrink discriminator: locked test asserts no FieldProject
Transform exists in the lowered DAG for data-resolved field accesses;
that ratchet catches trampoline-style workarounds.

Estimated effort: 1-2 weeks if design doc is accurate.
@briansrls

Copy link
Copy Markdown
Contributor Author

Dashboard-only codex review 12435 on old head fb01d4d6 is also already addressed at current HEAD bf3ce46.

Verified the two findings against current files:

  • docs/r3-rust-retirement-catalogue.md:31-38 now sets the end state to zero hand-authored Rust in src/v3/, cites docs/design-pure-bootstrap-zero.md, and retracts the earlier 10-15 file residual framing.
  • docs/r3-rust-retirement-catalogue.md:59-64 removes the “irreducible in-tree seed” retirement target and routes genuinely non-retirable-in-tree files to out-of-tree homes only.

No code/doc change is needed on current HEAD for that request-changes artifact; it reviewed a superseded commit. — sent from gentle-bat-24

briansrls and others added 5 commits May 15, 2026 03:16
…d LANDED at HEAD 2026-05-15

Per gentle-bat-24 Brief 4 Phase A finding (DB-10 substrate already
implemented at HEAD with `Dag::data_value_at` at dag.rs:4310 +
lower.rs:8489+/8642+/9125+ + passing test at m2_feature_parity_test.rs:771)
+ subsequent verification of DB-12/DB-13 status amendments in PR #496 against
HEAD test names:

DB-10: LANDED
DB-12: LANDED (parse_generated.rs:927; m2_feature_parity_test.rs:90-156)
DB-13: LANDED (lower.rs:3375; m2_feature_parity_test.rs:163-208)
DB-9 + DB-11: HEAD landed-state NOT YET AUDITED; may also be silently landed

Sites updated:
- docs/r3-m2-class-5-deferral-survey.md: M2 feature parity table reframed
  with cited HEAD evidence per DB; explicit retraction of "no DB item has
  landed yet" claim; active deferral pits shrink to DB-9 + DB-11 (pending
  audit) plus class-5 sub-gaps which remain genuinely deferred per Brief 3
  findings
- docs/design-m2-feature-parity.md: top-level Status line updated from
  "Design ready for implementer review" to "3 of 4 LANDED" with per-DB
  cited HEAD evidence; explicit advisory that workers should audit HEAD
  state before authoring implementation against this doc

Residual M2 work for the 3 LANDED items: emission-test-coverage gap for
DB-12 + DB-13 (design §Acceptance promises 3-target render verification;
current tests check compile + lower only). Small follow-up scope; not
pit-shaped.

The "M2 deferral pit" framing was substantially wrong as initially
described — much of M2 has been silently landing. The class-5 sub-gaps
remain genuinely deferred per Brief 3's bright-swift-668 investigation
(brace-body fn parse on .dag files).

Per `feedback_corrections_must_grep_verify_source` — this is the
canonical lesson: design docs drift; verify against HEAD before
authoring against them.
…tring-typed EmitDispatchError + retract Brief 6 FFI bridge as deliverable path

Two findings, both valid:

(1) modeling-emit-rs.md:203 — proposed `type EmitDispatchError { language:
DeclarationRef, detail: String }` as 🟡 SCAFFOLD. RETRACTED. INVARIANTS P3 +
docs/modeling-discipline.md Practice 1 forbid String-typed diagnostic channels
at the substrate-API level. SCAFFOLD-with-String at the API level is still
a String-API at HEAD; the scaffold marker doesn't excuse the typed-carrier
requirement.

Fix: defer the EmitDispatchError shape entirely until per-language typed error
carriers land (Brief 7+). Dispatcher signature stays Result<EmittedSource, ???>
with ??? as forward-reference. Workers attempting Brief 7+ surface back if
the error-carrier shape becomes load-bearing before per-language errors exist
— substantive substrate-language question, not papered over with String channel.

(2) brief-set.md:206 — Brief 6 presented an "FFI bridge" option (a) as a
deliverable path. The brief text itself admitted "does not retire the Rust
compile_to_dag function itself" — that's a bridge preserving hand-Rust
compiler authority, NOT retirement. Operator's NO WORKAROUNDS stance +
INVARIANTS P5 forbid FFI as deliverable path. The brief currently muddled
this; codex correctly flagged that the wording would send a worker to execute
the wrong work.

Fix: Brief 6 reframed as SCOPE MARKER ONLY (Phase 5 program, NOT dispatchable
within this brief set). Recommendation surfaced to operator: declare Phase 5
/ meta-circular bootstrap as separate program from Path B; tokenize/parse
codegen-driver retirements (Briefs 7-9) are downstream of Phase 5 and not
landable until self-hosted compile_to_dag lands. Honest framing: forcing
Briefs 7-9 to land before Phase 5 via FFI bridges produces paper-shrink, not
retirement.

Sites updated:
- modeling-emit-rs.md §4.3 EmitDispatchError block: explicit RETRACTION text;
  signature now Result<EmittedSource, ???> with forward-reference framing
- brief-set.md §"Brief 6 — Meta-circular: compile_to_dag Foreign-Function Bridge"
  retitled to "self-hosted compile_to_dag (Phase 5 scope expansion)" + scope
  reframed as SCOPE MARKER ONLY
- brief-set.md dispatch graph: Brief 6 marked NOT DISPATCHABLE
- brief-set.md §Brief 7 prerequisites: Briefs 1-5 + Phase 5 separately
- brief-set.md §Brief 7 scope: cites separately-scoped Phase 5 program
- brief-set.md §"Open questions for operator before dispatch" #1: RESOLVED
  per this codex BLOCKING; no FFI workaround acceptable
@briansrls
briansrls merged commit 9468ffe into main May 15, 2026
3 checks passed
briansrls added a commit that referenced this pull request May 15, 2026
…. Read docs/r3-path-b-tokenize-parse-brief-set.md §Brief 3 (PR #3139 branch docs/r3-rust-retirement-catalogue) for full scope. Finish the in-progress scaffold named at src/v3/compiler/tokenize.dag lines 23-58 so char_in_class(c, Id (#3144)

* WIP: Path B Brief 3 — Substrate-language: char-class structural completion. R

* WIP: Path B Brief 3 — Substrate-language: char-class structural completion. R

* WIP: Path B Brief 3 — Substrate-language: char-class structural completion. R

* WIP: Path B Brief 3 — Substrate-language: char-class structural completion. R

* WIP: Path B Brief 3 — Substrate-language: char-class structural completion. R

* WIP: Path B Brief 3 — Substrate-language: char-class structural completion. R

* WIP: Path B Brief 3 — Substrate-language: char-class structural completion. R

* WIP: Path B Brief 3 — Substrate-language: char-class structural completion. R

* WIP: Path B Brief 3 — Substrate-language: char-class structural completion. R

* WIP: Path B Brief 3 — Substrate-language: char-class structural completion. R

* WIP: Path B Brief 3 — Substrate-language: char-class structural completion. R

* WIP: Path B Brief 3 — Substrate-language: char-class structural completion. R

* WIP: Path B Brief 3 — Substrate-language: char-class structural completion. R

* fix(ci): add SG-0 PR-body append + pairing for census +1 (#3144)

CI prepends this file so SG-0 net-shrink validates the EXPECTED_HAND_AUTHORED_TEST
hand-path receipt with pairing (c) + concrete dispatch anchors.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls
briansrls deleted the docs/r3-rust-retirement-catalogue branch June 1, 2026 18:41
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