From cf164c72f0cdb3fbb29c15a286bde1eb9a3216e4 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 00:42:05 -0400 Subject: [PATCH 01/20] docs(roadmap): record CharClass phase-1 closure + add Class 5 Gap 3 ledger row (post-#693 escalation) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Director-authored amendment following the 2026-04-24 escalation from PR #693 (sub-child sharp-bear-829 under Surface Manager). Two edits: 1. New "Class 5 Gap 3 — port-carried field values in data bodies" row in the 2026-04-21 post-merge-debt section. The substrate gap was documented in src/v3/DOWNSTREAM_REQUIREMENTS.md:239 but had no ROADMAP ledger row for cross-lane visibility. PR #693's execution surfaced it as the blocker on sub_charclass_in_std_unicode phase-2. 2. Retract the "ready-to-dispatch (no substrate capability gap)" claim on the Character-level row, annotate phase-1 landed via PR #693 (CharClass vocabulary + Rust-mirror structural scanner path), and point phase-2 at the new Class 5 Gap 3 row. Codifies the audit pattern: "this consumption gap has no substrate capability gap" claims must be verified by attempting the retype before the claim lands. Co-Authored-By: Claude Opus 4.7 (1M context) --- ROADMAP.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ROADMAP.md b/ROADMAP.md index 5f7f712997e..bf50de09158 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -311,6 +311,7 @@ Per-row tagging is a scheduled follow-up sweep — **trigger:** post-merge of th ### Post-merge debt (2026-04-21 receipt-closure wave) - **Class 5 Gap 1 — `Bool` inhabits `BooleanAlgebra` grounding not wired**: surfaced during #610's closing. Current `OperatorKind::Logical(_)` dispatch in the three emitters is hardcoded (`if let OperatorKind::Logical(_)` branches bypass the algebra-field resolution that arithmetic operators use). The substrate already models `BooleanAlgebra` with `meet/join/complement` per `dsl/std/algebra.dag:230-236`, and comments there state *"Bool inhabits BooleanAlgebra"* — but the `inhabits` edge isn't structurally landed. Dissolution: wire `Bool inhabits BooleanAlgebra` + extend `resolve_operator_arrow` for `OperatorKind::Logical(_)` + delete the hardcoded emitter branches. Owner: 1e-2b lane (Path A). +- **Class 5 Gap 3 — port-carried field values in `data` bodies (substrate capability gap)**: authoritative enumeration at `src/v3/DOWNSTREAM_REQUIREMENTS.md:239` (gap partially closed at M1(2.8) for literal-only fields via `ValueBody::Structural` / `SurfaceExpr::Record` / `lower_record_to_structural`; remaining open half is port-carried field values — nested records, list literals, declaration references, `Var` references, sum-variant literals). `compile_to_dag` rejects these shapes inside `data` bodies today. **Consumer impact surfaced 2026-04-24** by PR #693 escalation (sub-child `sharp-bear-829` under Surface Manager): blocks `sub_charclass_in_std_unicode` phase-2 — specifically the `tokenize.dag` retype of `StringEscapeSpec.suffix`, `LocalPunctSpec.pattern`, `OperatorSpec.symbol`, `dag_keyword_set` keys, etc. to `Char` / `List` + `CharClass` sum-variant literals. Adjacent future retype-to-structured-carrier lanes (syntax.dag keyword sets, other opaque-string fields) will hit the same wall. Dissolution: extend `compile_to_dag` to parse port-carried field values in data bodies. Alternative design call (out of scope here): shift the authority shape for these configs from `data` bodies to extractor-over-unparsed-source. Owner: unassigned; substrate-capability scope — routes through a self-hosting / substrate-capability lane, not through the consuming lanes. **Audit pattern:** future "this consumption gap has no substrate capability gap" claims should be verified by attempting the retype before the claim lands — the 2026-04-23 authoring of the Character-level row (this file, `:354`) made this claim and was factually wrong; retracted 2026-04-24. - **`emit_rust_module` gap: SurfaceLiteral → LiteralBits rename**: substrate declares `LitInt/LitBool/LitString` in `LiteralBits`; Rust enum is `Int/Bool/String`; no rename facility in `emit_rust_module` causes connective-producing slices (per #612's staging choice notes) to fail on this. Dissolution: add per-variant name mapping in spec or rename-facility in emit. Owner: unassigned; blocks deeper SG-3g slices. - **`emit_rust_module` gap: `render_variant_constructor` fails on external tuple variants**: `src/v3/compiler/src/emit/rust_target.rs:4296` unconditionally emits `Variant { _0: value }` which is wrong for external tuple variants. Dissolution: spec-driven variant-constructor template per source kind. Owner: unassigned; blocks deeper SG-3g slices. - **File-preference rank is a ratified-parallel-authority scaffold**: `Dag::declaration_name_preference_rank` (`src/v3/compiler/src/dag.rs:1985-2015`) and its mirror in `collect_symbols` (`src/v3/compiler/src/lower.rs:1258-1278`) resolve same-named declarations by preferring `src/v3/` over `dsl/`. This is a P2 Boundary Discipline violation — a stable lookup rule that *normalizes* duplicate authority instead of dissolving it. Held as a scaffold rather than deleted because the duplicates carry v3-only substrate content (`v3.std.substrate` imports, `ElementRef` / `PortId` references, partitioned `EffectShape`, diagnostic-assertion surface) that cannot yet live under `dsl/std/` — v2 CI recursively ingests `dsl/` and cannot parse v3 grammar. Dissolution trigger: when every module currently duplicated between `dsl/std/` and `src/v3/std/` (or `src/v3/spec/`) has converged to a single canonical home, delete the rank function + mirror policy and remove the duplicate-authority preference rule entirely. After convergence, `declaration_by_name` must resolve against the single surviving authority or fail closed on multiple matches; no rank-based bridge remains. Convergence checklist: (1) `module std.effects` — `dsl/std/effects.dag` ↔ `src/v3/std/effects.dag` (v3 copy imports `v3.std.substrate`, partitions `EffectShape`, uses `ElementRef`); (2) `module std.verification` — `dsl/std/verification.dag` ↔ `src/v3/std/verification.dag` (surfaces are disjoint today: v2 `AssertKind/TestClaim/TestCase` vs v3 `DiagnosticKind / DiagnosticReference / PortStateExpectation`; convergence requires a design call on which surface wins); (3) embedded `http_path` mirror inside `src/v3/std/effects.dag:118-260` (resolves via either staging `http_path.dag` in v3 or rewiring imports to consume `std.http_path` directly once v3-substrate staging lands). Owner: unblocked by v3.std.substrate staging lane + v3-grammar CI convergence. @@ -350,7 +351,7 @@ Tracked debt not dispatched with the 2026-04-21 lane wave (Lane 1e P3.0, SG-2c-4 - **`extdeps/browser.dag` typed-carrier service-boundary collapse**: `dsl/extdeps/browser.dag:21-32` declares typed carriers (`BrowserConfig`, opaque `BrowserContext` / `Page` / `Element` handles, imports `Url`), but service ops use raw `String`: `Launch.input.headless: String = "false"`, `output.context_id: String`; `Goto.input.url: String`, `wait_until: String`, `output.final_url: String`; selector/query/evaluate outputs all remain `String` (`:42-47,56-60,75-103`). Same class as the LLM service flattening and the GitHub auth model bypass (both tracked separately). P1 Modeling Faithfulness / M8 "dispatch structural, not string extraction". **Dissolution trigger**: when the transport layer (REST/shell/file) can consume typed carriers end-to-end rather than stringly — this requires transport-level capability support that currently forces the String fallback. The Lane H brief (PR #658) pilots the pattern on browser.dag specifically; if that lands cleanly, LLM + GitHub dissolutions can consume the same pattern. Until then, the transport-capability gap is the upstream blocker. Surfaced by 2026-04-22 exploratory analysis. Owner: unassigned (pilot in-flight on Lane H #658); M per service family, contingent on transport capability. -- **Character-level under-consumption in tokenize + syntax authorities (consumption gap, not substrate gap)**: `src/v3/compiler/tokenize.dag` and `dsl/extdeps/languages/dag/syntax.dag` both slice the ASCII/Unicode codepoint space in two parallel non-canonical forms. **Reserved individual codepoints as opaque strings**: `StringEscapeSpec.suffix`, `output_codepoint: Int`, `LocalPunctSpec.pattern`, `string_literal_delimiter`, `line_comment_prefix`, `OperatorSpec.symbol`, `dag_keyword_set` keys — all encode specific codepoints as byte strings. **Reserved codepoint classes as hidden Rust predicates**: `is_ascii_whitespace` / `is_ascii_digit` / `is_ascii_alphabetic` / `is_ascii_alphanumeric` plus a bare `byte == b'_'` `push_str`'d into `regen_tokenize.rs:700,727,750,752`. Not mentioned in `.dag` at all. **The character-level concepts already exist in `dsl/std/`** and are imported cross-tree today (e.g., `src/v3/compiler/regen.dag:3` imports `std.types`): `std.types::Char = Int` (Unicode scalar, U+0000–U+10FFFF), `std.string_type::String = FreeMonoid`, `std.unicode` (`DisplayWidth`, `UnicodeBlock`, block/width classification), `std.encoding` (`ASCII | UTF8 | Latin1 | Text | Binary | Unknown` lattice with `ASCII <: UTF8 <: Text` — literally the ASCII→Unicode causal chain), `std.bit::Byte`. **Framing**: this is a consumption gap — the modeling is done, the tokenizer and syntax authorities just aren't using it. Only one substrate delta is needed. **Dissolution (follow-up lane)**: (1) add `CharClass = Whitespace | Digit | IdentStart | IdentContinue` (or superset) to `std.unicode` as a sibling to `DisplayWidth`, plus classification predicates as data/functions; (2) retype the opaque-string fields in `tokenize.dag` (`suffix: Char`, `output_codepoint: Char`, `pattern: List`, `string_literal_delimiter: Char`, `line_comment_prefix: List`) and the parallel fields in `syntax.dag` (`OperatorSpec.symbol: List`, keyword-set keys as `List`); (3) rewire `regen_tokenize` to read the class-predicate list structurally rather than hardcoding host-stdlib method names. Scaffold note lives in the `tokenize.dag` header. Owner: unassigned; migration-gate: **ready-to-dispatch** (no substrate capability gap). If the `tokenize.dag → std/tokenize.dag` consolidation migration (from the compiler–std consolidation program above) is dispatched first, the rewrite piggybacks on it so the structurally-labeled borrow lands in its final home. +- **Character-level under-consumption in tokenize + syntax authorities (consumption gap, not substrate gap)**: `src/v3/compiler/tokenize.dag` and `dsl/extdeps/languages/dag/syntax.dag` both slice the ASCII/Unicode codepoint space in two parallel non-canonical forms. **Reserved individual codepoints as opaque strings**: `StringEscapeSpec.suffix`, `output_codepoint: Int`, `LocalPunctSpec.pattern`, `string_literal_delimiter`, `line_comment_prefix`, `OperatorSpec.symbol`, `dag_keyword_set` keys — all encode specific codepoints as byte strings. **Reserved codepoint classes as hidden Rust predicates**: `is_ascii_whitespace` / `is_ascii_digit` / `is_ascii_alphabetic` / `is_ascii_alphanumeric` plus a bare `byte == b'_'` `push_str`'d into `regen_tokenize.rs:700,727,750,752`. Not mentioned in `.dag` at all. **The character-level concepts already exist in `dsl/std/`** and are imported cross-tree today (e.g., `src/v3/compiler/regen.dag:3` imports `std.types`): `std.types::Char = Int` (Unicode scalar, U+0000–U+10FFFF), `std.string_type::String = FreeMonoid`, `std.unicode` (`DisplayWidth`, `UnicodeBlock`, block/width classification), `std.encoding` (`ASCII | UTF8 | Latin1 | Text | Binary | Unknown` lattice with `ASCII <: UTF8 <: Text` — literally the ASCII→Unicode causal chain), `std.bit::Byte`. **Framing**: this is a consumption gap — the modeling is done, the tokenizer and syntax authorities just aren't using it. Only one substrate delta is needed. **Dissolution (follow-up lane)**: (1) add `CharClass = Whitespace | Digit | IdentStart | IdentContinue` (or superset) to `std.unicode` as a sibling to `DisplayWidth`, plus classification predicates as data/functions; (2) retype the opaque-string fields in `tokenize.dag` (`suffix: Char`, `output_codepoint: Char`, `pattern: List`, `string_literal_delimiter: Char`, `line_comment_prefix: List`) and the parallel fields in `syntax.dag` (`OperatorSpec.symbol: List`, keyword-set keys as `List`); (3) rewire `regen_tokenize` to read the class-predicate list structurally rather than hardcoding host-stdlib method names. Scaffold note lives in the `tokenize.dag` header. **Status (2026-04-24, post-PR #693):** phase-1 landed — step (1) done (`CharClass` + `char_in_class` in `dsl/std/unicode.dag`, ASCII-aligned); step (3) partially done via a `tokenize_char_class.rs` Rust mirror (gate-locked 0..=127 against Rust ASCII helpers per `sub_charclass_in_std_unicode_gate`), so generated tokenizer carries no `is_ascii_*` calls. Phase-2 (step 2 — the `.dag`-native retype to `Char` / `List` / `CharClass` variants inside `data` bodies) is **blocked on Class 5 Gap 3** (port-carried field values in `data` bodies per `src/v3/DOWNSTREAM_REQUIREMENTS.md:239`); see that row above for the substrate-capability dissolution. **The 2026-04-23 authoring of this row claimed "no substrate capability gap"; retracted — PR #693's execution found the gap.** Owner: phase-1 landed (PR #693); phase-2 unassigned, blocked on Class 5 Gap 3. If the `tokenize.dag → std/tokenize.dag` consolidation migration (from the compiler–std consolidation program above) is dispatched before Class 5 Gap 3 closes, the phase-1 Rust mirror piggybacks on it; the full structural `.dag`-native path lands only when Class 5 Gap 3 closes. ### Post-merge debt (2026-04-23 thesis-doc surface — PR #672) From 6dcceb8a68f25741b2f0fb13304fa9658db77a64 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 00:47:20 -0400 Subject: [PATCH 02/20] =?UTF-8?q?resolve=20merge=20conflict=20on=20ROADMAP?= =?UTF-8?q?.md=20character-level=20row=20=E2=80=94=20keep=20phase-1=20stat?= =?UTF-8?q?us=20edits=20+=20char=5Fin=5Fclass=20interpreter-parity=20sibli?= =?UTF-8?q?ng=20row=20from=20main?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ROADMAP.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 0dbec61e0bd..e3deb800af0 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -351,12 +351,8 @@ Tracked debt not dispatched with the 2026-04-21 lane wave (Lane 1e P3.0, SG-2c-4 - **`extdeps/browser.dag` typed-carrier service-boundary collapse**: `dsl/extdeps/browser.dag:21-32` declares typed carriers (`BrowserConfig`, opaque `BrowserContext` / `Page` / `Element` handles, imports `Url`), but service ops use raw `String`: `Launch.input.headless: String = "false"`, `output.context_id: String`; `Goto.input.url: String`, `wait_until: String`, `output.final_url: String`; selector/query/evaluate outputs all remain `String` (`:42-47,56-60,75-103`). Same class as the LLM service flattening and the GitHub auth model bypass (both tracked separately). P1 Modeling Faithfulness / M8 "dispatch structural, not string extraction". **Dissolution trigger**: when the transport layer (REST/shell/file) can consume typed carriers end-to-end rather than stringly — this requires transport-level capability support that currently forces the String fallback. The Lane H brief (PR #658) pilots the pattern on browser.dag specifically; if that lands cleanly, LLM + GitHub dissolutions can consume the same pattern. Until then, the transport-capability gap is the upstream blocker. Surfaced by 2026-04-22 exploratory analysis. Owner: unassigned (pilot in-flight on Lane H #658); M per service family, contingent on transport capability. -<<<<<<< HEAD -- **Character-level under-consumption in tokenize + syntax authorities (consumption gap, not substrate gap)**: `src/v3/compiler/tokenize.dag` and `dsl/extdeps/languages/dag/syntax.dag` both slice the ASCII/Unicode codepoint space in two parallel non-canonical forms. **Reserved individual codepoints as opaque strings**: `StringEscapeSpec.suffix`, `output_codepoint: Int`, `LocalPunctSpec.pattern`, `string_literal_delimiter`, `line_comment_prefix`, `OperatorSpec.symbol`, `dag_keyword_set` keys — all encode specific codepoints as byte strings. **Reserved codepoint classes as hidden Rust predicates**: `is_ascii_whitespace` / `is_ascii_digit` / `is_ascii_alphabetic` / `is_ascii_alphanumeric` plus a bare `byte == b'_'` `push_str`'d into `regen_tokenize.rs:700,727,750,752`. Not mentioned in `.dag` at all. **The character-level concepts already exist in `dsl/std/`** and are imported cross-tree today (e.g., `src/v3/compiler/regen.dag:3` imports `std.types`): `std.types::Char = Int` (Unicode scalar, U+0000–U+10FFFF), `std.string_type::String = FreeMonoid`, `std.unicode` (`DisplayWidth`, `UnicodeBlock`, block/width classification), `std.encoding` (`ASCII | UTF8 | Latin1 | Text | Binary | Unknown` lattice with `ASCII <: UTF8 <: Text` — literally the ASCII→Unicode causal chain), `std.bit::Byte`. **Framing**: this is a consumption gap — the modeling is done, the tokenizer and syntax authorities just aren't using it. Only one substrate delta is needed. **Dissolution (follow-up lane)**: (1) add `CharClass = Whitespace | Digit | IdentStart | IdentContinue` (or superset) to `std.unicode` as a sibling to `DisplayWidth`, plus classification predicates as data/functions; (2) retype the opaque-string fields in `tokenize.dag` (`suffix: Char`, `output_codepoint: Char`, `pattern: List`, `string_literal_delimiter: Char`, `line_comment_prefix: List`) and the parallel fields in `syntax.dag` (`OperatorSpec.symbol: List`, keyword-set keys as `List`); (3) rewire `regen_tokenize` to read the class-predicate list structurally rather than hardcoding host-stdlib method names. Scaffold note lives in the `tokenize.dag` header. **Status (2026-04-24, post-PR #693):** phase-1 landed — step (1) done (`CharClass` + `char_in_class` in `dsl/std/unicode.dag`, ASCII-aligned); step (3) partially done via a `tokenize_char_class.rs` Rust mirror (gate-locked 0..=127 against Rust ASCII helpers per `sub_charclass_in_std_unicode_gate`), so generated tokenizer carries no `is_ascii_*` calls. Phase-2 (step 2 — the `.dag`-native retype to `Char` / `List` / `CharClass` variants inside `data` bodies) is **blocked on Class 5 Gap 3** (port-carried field values in `data` bodies per `src/v3/DOWNSTREAM_REQUIREMENTS.md:239`); see that row above for the substrate-capability dissolution. **The 2026-04-23 authoring of this row claimed "no substrate capability gap"; retracted — PR #693's execution found the gap.** Owner: phase-1 landed (PR #693); phase-2 unassigned, blocked on Class 5 Gap 3. If the `tokenize.dag → std/tokenize.dag` consolidation migration (from the compiler–std consolidation program above) is dispatched before Class 5 Gap 3 closes, the phase-1 Rust mirror piggybacks on it; the full structural `.dag`-native path lands only when Class 5 Gap 3 closes. -======= -- **Character-level under-consumption in tokenize + syntax authorities (consumption gap, not substrate gap)**: `src/v3/compiler/tokenize.dag` and `dsl/extdeps/languages/dag/syntax.dag` both slice the ASCII/Unicode codepoint space in two parallel non-canonical forms. **Reserved individual codepoints as opaque strings**: `StringEscapeSpec.suffix`, `output_codepoint: Int`, `LocalPunctSpec.pattern`, `string_literal_delimiter`, `line_comment_prefix`, `OperatorSpec.symbol`, `dag_keyword_set` keys — all encode specific codepoints as byte strings. **Reserved codepoint classes as hidden Rust predicates**: `is_ascii_whitespace` / `is_ascii_digit` / `is_ascii_alphabetic` / `is_ascii_alphanumeric` plus a bare `byte == b'_'` `push_str`'d into `regen_tokenize.rs:700,727,750,752`. Not mentioned in `.dag` at all. **The character-level concepts already exist in `dsl/std/`** and are imported cross-tree today (e.g., `src/v3/compiler/regen.dag:3` imports `std.types`): `std.types::Char = Int` (Unicode scalar, U+0000–U+10FFFF), `std.string_type::String = FreeMonoid`, `std.unicode` (`DisplayWidth`, `UnicodeBlock`, block/width classification), `std.encoding` (`ASCII | UTF8 | Latin1 | Text | Binary | Unknown` lattice with `ASCII <: UTF8 <: Text` — literally the ASCII→Unicode causal chain), `std.bit::Byte`. **Framing**: this is a consumption gap — the modeling is done, the tokenizer and syntax authorities just aren't using it. Only one substrate delta is needed. **Dissolution (follow-up lane)**: (1) add `CharClass = Whitespace | Digit | IdentStart | IdentContinue` (or superset) to `std.unicode` as a sibling to `DisplayWidth`, plus classification predicates as data/functions; (2) retype the opaque-string fields in `tokenize.dag` (`suffix: Char`, `output_codepoint: Char`, `pattern: List`, `string_literal_delimiter: Char`, `line_comment_prefix: List`) and the parallel fields in `syntax.dag` (`OperatorSpec.symbol: List`, keyword-set keys as `List`); (3) rewire `regen_tokenize` to read the class-predicate list structurally rather than hardcoding host-stdlib method names. Scaffold note lives in the `tokenize.dag` header. Owner: unassigned; migration-gate: **ready-to-dispatch** (no substrate capability gap). If the `tokenize.dag → std/tokenize.dag` consolidation migration (from the compiler–std consolidation program above) is dispatched first, the rewrite piggybacks on it so the structurally-labeled borrow lands in its final home. +- **Character-level under-consumption in tokenize + syntax authorities (consumption gap, not substrate gap)**: `src/v3/compiler/tokenize.dag` and `dsl/extdeps/languages/dag/syntax.dag` both slice the ASCII/Unicode codepoint space in two parallel non-canonical forms. **Reserved individual codepoints as opaque strings**: `StringEscapeSpec.suffix`, `output_codepoint: Int`, `LocalPunctSpec.pattern`, `string_literal_delimiter`, `line_comment_prefix`, `OperatorSpec.symbol`, `dag_keyword_set` keys — all encode specific codepoints as byte strings. **Reserved codepoint classes as hidden Rust predicates**: `is_ascii_whitespace` / `is_ascii_digit` / `is_ascii_alphabetic` / `is_ascii_alphanumeric` plus a bare `byte == b'_'` `push_str`'d into `regen_tokenize.rs:700,727,750,752`. Not mentioned in `.dag` at all. **The character-level concepts already exist in `dsl/std/`** and are imported cross-tree today (e.g., `src/v3/compiler/regen.dag:3` imports `std.types`): `std.types::Char = Int` (Unicode scalar, U+0000–U+10FFFF), `std.string_type::String = FreeMonoid`, `std.unicode` (`DisplayWidth`, `UnicodeBlock`, block/width classification), `std.encoding` (`ASCII | UTF8 | Latin1 | Text | Binary | Unknown` lattice with `ASCII <: UTF8 <: Text` — literally the ASCII→Unicode causal chain), `std.bit::Byte`. **Framing**: this is a consumption gap — the modeling is done, the tokenizer and syntax authorities just aren't using it. Only one substrate delta is needed. **Dissolution (follow-up lane)**: (1) add `CharClass = Whitespace | Digit | IdentStart | IdentContinue` (or superset) to `std.unicode` as a sibling to `DisplayWidth`, plus classification predicates as data/functions; (2) retype the opaque-string fields in `tokenize.dag` (`suffix: Char`, `output_codepoint: Char`, `pattern: List`, `string_literal_delimiter: Char`, `line_comment_prefix: List`) and the parallel fields in `syntax.dag` (`OperatorSpec.symbol: List`, keyword-set keys as `List`); (3) rewire `regen_tokenize` to read the class-predicate list structurally rather than hardcoding host-stdlib method names. Scaffold note lives in the `tokenize.dag` header. **Status (2026-04-24, post-PR #693):** phase-1 landed — step (1) done (`CharClass` + `char_in_class` in `dsl/std/unicode.dag`, ASCII-aligned); step (3) partially done via a `tokenize_char_class.rs` Rust mirror (gate-locked 0..=127 against Rust ASCII helpers per `sub_charclass_in_std_unicode_gate`), so generated tokenizer carries no `is_ascii_*` calls. Phase-2 (step 2 — the `.dag`-native retype to `Char` / `List` / `CharClass` variants inside `data` bodies) is **blocked on Class 5 Gap 3** (port-carried field values in `data` bodies per `src/v3/DOWNSTREAM_REQUIREMENTS.md:239`); see that row above for the substrate-capability dissolution. **The 2026-04-23 authoring of this row claimed "no substrate capability gap"; retracted — PR #693's execution found the gap.** See the `char_in_class` interpreter-parity follow-up row below for the bridge-finish step (retiring the host-stdlib-only ratchet on `tokenize_char_class.rs`). Owner: phase-1 landed (PR #693); phase-2 unassigned, blocked on Class 5 Gap 3. If the `tokenize.dag → std/tokenize.dag` consolidation migration (from the compiler–std consolidation program above) is dispatched before Class 5 Gap 3 closes, the phase-1 Rust mirror piggybacks on it; the full structural `.dag`-native path lands only when Class 5 Gap 3 closes. - **`char_in_class` interpreter parity (tokenizer bridge finish, PR #693):** `dsl/std/unicode.dag::char_in_class` is canonical; `src/v3/compiler/src/tokenize_char_class.rs` stays hand-synced until M1(2.8) class-5 gap #3 allows structural scanner rows. Today unit tests ratchet against `u8::is_ascii_*` only. **Next step:** once `char_in_class` is evaluable from the v3 compiler test harness, assert code-point parity on `0..=127` against `byte_matches` and retire the host-stdlib-only ratchet / duplicate sync prose. Same migration gate as deleting `tokenize_char_class.rs` when `regen_tokenize` reads classes from lowered `tokenize.dag`. ->>>>>>> origin/main ### Post-merge debt (2026-04-23 thesis-doc surface — PR #672) From 5a9d79710ca1547c569ca48d8dee90c51e98714d Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 00:48:56 -0400 Subject: [PATCH 03/20] docs(roadmap): name retraction mechanism explicitly in Class 5 Gap 3 audit note (PM review) --- ROADMAP.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ROADMAP.md b/ROADMAP.md index e3deb800af0..c43438fc513 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -311,7 +311,7 @@ Per-row tagging is a scheduled follow-up sweep — **trigger:** post-merge of th ### Post-merge debt (2026-04-21 receipt-closure wave) - **Class 5 Gap 1 — `Bool` inhabits `BooleanAlgebra` grounding not wired**: surfaced during #610's closing. Current `OperatorKind::Logical(_)` dispatch in the three emitters is hardcoded (`if let OperatorKind::Logical(_)` branches bypass the algebra-field resolution that arithmetic operators use). The substrate already models `BooleanAlgebra` with `meet/join/complement` per `dsl/std/algebra.dag:230-236`, and comments there state *"Bool inhabits BooleanAlgebra"* — but the `inhabits` edge isn't structurally landed. Dissolution: wire `Bool inhabits BooleanAlgebra` + extend `resolve_operator_arrow` for `OperatorKind::Logical(_)` + delete the hardcoded emitter branches. Owner: 1e-2b lane (Path A). -- **Class 5 Gap 3 — port-carried field values in `data` bodies (substrate capability gap)**: authoritative enumeration at `src/v3/DOWNSTREAM_REQUIREMENTS.md:239` (gap partially closed at M1(2.8) for literal-only fields via `ValueBody::Structural` / `SurfaceExpr::Record` / `lower_record_to_structural`; remaining open half is port-carried field values — nested records, list literals, declaration references, `Var` references, sum-variant literals). `compile_to_dag` rejects these shapes inside `data` bodies today. **Consumer impact surfaced 2026-04-24** by PR #693 escalation (sub-child `sharp-bear-829` under Surface Manager): blocks `sub_charclass_in_std_unicode` phase-2 — specifically the `tokenize.dag` retype of `StringEscapeSpec.suffix`, `LocalPunctSpec.pattern`, `OperatorSpec.symbol`, `dag_keyword_set` keys, etc. to `Char` / `List` + `CharClass` sum-variant literals. Adjacent future retype-to-structured-carrier lanes (syntax.dag keyword sets, other opaque-string fields) will hit the same wall. Dissolution: extend `compile_to_dag` to parse port-carried field values in data bodies. Alternative design call (out of scope here): shift the authority shape for these configs from `data` bodies to extractor-over-unparsed-source. Owner: unassigned; substrate-capability scope — routes through a self-hosting / substrate-capability lane, not through the consuming lanes. **Audit pattern:** future "this consumption gap has no substrate capability gap" claims should be verified by attempting the retype before the claim lands — the 2026-04-23 authoring of the Character-level row (this file, `:354`) made this claim and was factually wrong; retracted 2026-04-24. +- **Class 5 Gap 3 — port-carried field values in `data` bodies (substrate capability gap)**: authoritative enumeration at `src/v3/DOWNSTREAM_REQUIREMENTS.md:239` (gap partially closed at M1(2.8) for literal-only fields via `ValueBody::Structural` / `SurfaceExpr::Record` / `lower_record_to_structural`; remaining open half is port-carried field values — nested records, list literals, declaration references, `Var` references, sum-variant literals). `compile_to_dag` rejects these shapes inside `data` bodies today. **Consumer impact surfaced 2026-04-24** by PR #693 escalation (sub-child `sharp-bear-829` under Surface Manager): blocks `sub_charclass_in_std_unicode` phase-2 — specifically the `tokenize.dag` retype of `StringEscapeSpec.suffix`, `LocalPunctSpec.pattern`, `OperatorSpec.symbol`, `dag_keyword_set` keys, etc. to `Char` / `List` + `CharClass` sum-variant literals. Adjacent future retype-to-structured-carrier lanes (syntax.dag keyword sets, other opaque-string fields) will hit the same wall. Dissolution: extend `compile_to_dag` to parse port-carried field values in data bodies. Alternative design call (out of scope here): shift the authority shape for these configs from `data` bodies to extractor-over-unparsed-source. Owner: unassigned; substrate-capability scope — routes through a self-hosting / substrate-capability lane, not through the consuming lanes. **Audit pattern:** future "this consumption gap has no substrate capability gap" claims should be verified by attempting the retype before the claim lands — the 2026-04-23 authoring of the Character-level row (this file, `:354`) made this claim and was factually wrong; retracted 2026-04-24 by the update to that row in this PR (see the `:354` Status block). - **`emit_rust_module` gap: SurfaceLiteral → LiteralBits rename**: substrate declares `LitInt/LitBool/LitString` in `LiteralBits`; Rust enum is `Int/Bool/String`; no rename facility in `emit_rust_module` causes connective-producing slices (per #612's staging choice notes) to fail on this. Dissolution: add per-variant name mapping in spec or rename-facility in emit. Owner: unassigned; blocks deeper SG-3g slices. - **`emit_rust_module` gap: `render_variant_constructor` fails on external tuple variants**: `src/v3/compiler/src/emit/rust_target.rs:4296` unconditionally emits `Variant { _0: value }` which is wrong for external tuple variants. Dissolution: spec-driven variant-constructor template per source kind. Owner: unassigned; blocks deeper SG-3g slices. - **File-preference rank is a ratified-parallel-authority scaffold**: `Dag::declaration_name_preference_rank` (`src/v3/compiler/src/dag.rs:1985-2015`) and its mirror in `collect_symbols` (`src/v3/compiler/src/lower.rs:1258-1278`) resolve same-named declarations by preferring `src/v3/` over `dsl/`. This is a P2 Boundary Discipline violation — a stable lookup rule that *normalizes* duplicate authority instead of dissolving it. Held as a scaffold rather than deleted because the duplicates carry v3-only substrate content (`v3.std.substrate` imports, `ElementRef` / `PortId` references, partitioned `EffectShape`, diagnostic-assertion surface) that cannot yet live under `dsl/std/` — v2 CI recursively ingests `dsl/` and cannot parse v3 grammar. Dissolution trigger: when every module currently duplicated between `dsl/std/` and `src/v3/std/` (or `src/v3/spec/`) has converged to a single canonical home, delete the rank function + mirror policy and remove the duplicate-authority preference rule entirely. After convergence, `declaration_by_name` must resolve against the single surviving authority or fail closed on multiple matches; no rank-based bridge remains. Convergence checklist: (1) `module std.effects` — `dsl/std/effects.dag` ↔ `src/v3/std/effects.dag` (v3 copy imports `v3.std.substrate`, partitions `EffectShape`, uses `ElementRef`); (2) `module std.verification` — `dsl/std/verification.dag` ↔ `src/v3/std/verification.dag` (surfaces are disjoint today: v2 `AssertKind/TestClaim/TestCase` vs v3 `DiagnosticKind / DiagnosticReference / PortStateExpectation`; convergence requires a design call on which surface wins); (3) embedded `http_path` mirror inside `src/v3/std/effects.dag:118-260` (resolves via either staging `http_path.dag` in v3 or rewiring imports to consume `std.http_path` directly once v3-substrate staging lands). Owner: unblocked by v3.std.substrate staging lane + v3-grammar CI convergence. From 559773ca361c12aec42686518bf69f1e79df1a0f Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 00:50:00 -0400 Subject: [PATCH 04/20] docs(roadmap): reconcile Character-level row title with body (per gpt-5.4 review) Row title still said 'consumption gap, not substrate gap' while the body block retracted that claim and cited Class 5 Gap 3 as a substrate dependency for phase-2. Title now matches body: mixed classification, consumption for steps 1+3, substrate for step 2. --- ROADMAP.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ROADMAP.md b/ROADMAP.md index c43438fc513..2fe5ea36213 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -351,7 +351,7 @@ Tracked debt not dispatched with the 2026-04-21 lane wave (Lane 1e P3.0, SG-2c-4 - **`extdeps/browser.dag` typed-carrier service-boundary collapse**: `dsl/extdeps/browser.dag:21-32` declares typed carriers (`BrowserConfig`, opaque `BrowserContext` / `Page` / `Element` handles, imports `Url`), but service ops use raw `String`: `Launch.input.headless: String = "false"`, `output.context_id: String`; `Goto.input.url: String`, `wait_until: String`, `output.final_url: String`; selector/query/evaluate outputs all remain `String` (`:42-47,56-60,75-103`). Same class as the LLM service flattening and the GitHub auth model bypass (both tracked separately). P1 Modeling Faithfulness / M8 "dispatch structural, not string extraction". **Dissolution trigger**: when the transport layer (REST/shell/file) can consume typed carriers end-to-end rather than stringly — this requires transport-level capability support that currently forces the String fallback. The Lane H brief (PR #658) pilots the pattern on browser.dag specifically; if that lands cleanly, LLM + GitHub dissolutions can consume the same pattern. Until then, the transport-capability gap is the upstream blocker. Surfaced by 2026-04-22 exploratory analysis. Owner: unassigned (pilot in-flight on Lane H #658); M per service family, contingent on transport capability. -- **Character-level under-consumption in tokenize + syntax authorities (consumption gap, not substrate gap)**: `src/v3/compiler/tokenize.dag` and `dsl/extdeps/languages/dag/syntax.dag` both slice the ASCII/Unicode codepoint space in two parallel non-canonical forms. **Reserved individual codepoints as opaque strings**: `StringEscapeSpec.suffix`, `output_codepoint: Int`, `LocalPunctSpec.pattern`, `string_literal_delimiter`, `line_comment_prefix`, `OperatorSpec.symbol`, `dag_keyword_set` keys — all encode specific codepoints as byte strings. **Reserved codepoint classes as hidden Rust predicates**: `is_ascii_whitespace` / `is_ascii_digit` / `is_ascii_alphabetic` / `is_ascii_alphanumeric` plus a bare `byte == b'_'` `push_str`'d into `regen_tokenize.rs:700,727,750,752`. Not mentioned in `.dag` at all. **The character-level concepts already exist in `dsl/std/`** and are imported cross-tree today (e.g., `src/v3/compiler/regen.dag:3` imports `std.types`): `std.types::Char = Int` (Unicode scalar, U+0000–U+10FFFF), `std.string_type::String = FreeMonoid`, `std.unicode` (`DisplayWidth`, `UnicodeBlock`, block/width classification), `std.encoding` (`ASCII | UTF8 | Latin1 | Text | Binary | Unknown` lattice with `ASCII <: UTF8 <: Text` — literally the ASCII→Unicode causal chain), `std.bit::Byte`. **Framing**: this is a consumption gap — the modeling is done, the tokenizer and syntax authorities just aren't using it. Only one substrate delta is needed. **Dissolution (follow-up lane)**: (1) add `CharClass = Whitespace | Digit | IdentStart | IdentContinue` (or superset) to `std.unicode` as a sibling to `DisplayWidth`, plus classification predicates as data/functions; (2) retype the opaque-string fields in `tokenize.dag` (`suffix: Char`, `output_codepoint: Char`, `pattern: List`, `string_literal_delimiter: Char`, `line_comment_prefix: List`) and the parallel fields in `syntax.dag` (`OperatorSpec.symbol: List`, keyword-set keys as `List`); (3) rewire `regen_tokenize` to read the class-predicate list structurally rather than hardcoding host-stdlib method names. Scaffold note lives in the `tokenize.dag` header. **Status (2026-04-24, post-PR #693):** phase-1 landed — step (1) done (`CharClass` + `char_in_class` in `dsl/std/unicode.dag`, ASCII-aligned); step (3) partially done via a `tokenize_char_class.rs` Rust mirror (gate-locked 0..=127 against Rust ASCII helpers per `sub_charclass_in_std_unicode_gate`), so generated tokenizer carries no `is_ascii_*` calls. Phase-2 (step 2 — the `.dag`-native retype to `Char` / `List` / `CharClass` variants inside `data` bodies) is **blocked on Class 5 Gap 3** (port-carried field values in `data` bodies per `src/v3/DOWNSTREAM_REQUIREMENTS.md:239`); see that row above for the substrate-capability dissolution. **The 2026-04-23 authoring of this row claimed "no substrate capability gap"; retracted — PR #693's execution found the gap.** See the `char_in_class` interpreter-parity follow-up row below for the bridge-finish step (retiring the host-stdlib-only ratchet on `tokenize_char_class.rs`). Owner: phase-1 landed (PR #693); phase-2 unassigned, blocked on Class 5 Gap 3. If the `tokenize.dag → std/tokenize.dag` consolidation migration (from the compiler–std consolidation program above) is dispatched before Class 5 Gap 3 closes, the phase-1 Rust mirror piggybacks on it; the full structural `.dag`-native path lands only when Class 5 Gap 3 closes. +- **Character-level under-consumption in tokenize + syntax authorities (mixed: consumption gap for steps 1+3, substrate gap for step 2 — see Status block below)**: `src/v3/compiler/tokenize.dag` and `dsl/extdeps/languages/dag/syntax.dag` both slice the ASCII/Unicode codepoint space in two parallel non-canonical forms. **Reserved individual codepoints as opaque strings**: `StringEscapeSpec.suffix`, `output_codepoint: Int`, `LocalPunctSpec.pattern`, `string_literal_delimiter`, `line_comment_prefix`, `OperatorSpec.symbol`, `dag_keyword_set` keys — all encode specific codepoints as byte strings. **Reserved codepoint classes as hidden Rust predicates**: `is_ascii_whitespace` / `is_ascii_digit` / `is_ascii_alphabetic` / `is_ascii_alphanumeric` plus a bare `byte == b'_'` `push_str`'d into `regen_tokenize.rs:700,727,750,752`. Not mentioned in `.dag` at all. **The character-level concepts already exist in `dsl/std/`** and are imported cross-tree today (e.g., `src/v3/compiler/regen.dag:3` imports `std.types`): `std.types::Char = Int` (Unicode scalar, U+0000–U+10FFFF), `std.string_type::String = FreeMonoid`, `std.unicode` (`DisplayWidth`, `UnicodeBlock`, block/width classification), `std.encoding` (`ASCII | UTF8 | Latin1 | Text | Binary | Unknown` lattice with `ASCII <: UTF8 <: Text` — literally the ASCII→Unicode causal chain), `std.bit::Byte`. **Framing**: this is a consumption gap — the modeling is done, the tokenizer and syntax authorities just aren't using it. Only one substrate delta is needed. **Dissolution (follow-up lane)**: (1) add `CharClass = Whitespace | Digit | IdentStart | IdentContinue` (or superset) to `std.unicode` as a sibling to `DisplayWidth`, plus classification predicates as data/functions; (2) retype the opaque-string fields in `tokenize.dag` (`suffix: Char`, `output_codepoint: Char`, `pattern: List`, `string_literal_delimiter: Char`, `line_comment_prefix: List`) and the parallel fields in `syntax.dag` (`OperatorSpec.symbol: List`, keyword-set keys as `List`); (3) rewire `regen_tokenize` to read the class-predicate list structurally rather than hardcoding host-stdlib method names. Scaffold note lives in the `tokenize.dag` header. **Status (2026-04-24, post-PR #693):** phase-1 landed — step (1) done (`CharClass` + `char_in_class` in `dsl/std/unicode.dag`, ASCII-aligned); step (3) partially done via a `tokenize_char_class.rs` Rust mirror (gate-locked 0..=127 against Rust ASCII helpers per `sub_charclass_in_std_unicode_gate`), so generated tokenizer carries no `is_ascii_*` calls. Phase-2 (step 2 — the `.dag`-native retype to `Char` / `List` / `CharClass` variants inside `data` bodies) is **blocked on Class 5 Gap 3** (port-carried field values in `data` bodies per `src/v3/DOWNSTREAM_REQUIREMENTS.md:239`); see that row above for the substrate-capability dissolution. **The 2026-04-23 authoring of this row claimed "no substrate capability gap"; retracted — PR #693's execution found the gap.** See the `char_in_class` interpreter-parity follow-up row below for the bridge-finish step (retiring the host-stdlib-only ratchet on `tokenize_char_class.rs`). Owner: phase-1 landed (PR #693); phase-2 unassigned, blocked on Class 5 Gap 3. If the `tokenize.dag → std/tokenize.dag` consolidation migration (from the compiler–std consolidation program above) is dispatched before Class 5 Gap 3 closes, the phase-1 Rust mirror piggybacks on it; the full structural `.dag`-native path lands only when Class 5 Gap 3 closes. - **`char_in_class` interpreter parity (tokenizer bridge finish, PR #693):** `dsl/std/unicode.dag::char_in_class` is canonical; `src/v3/compiler/src/tokenize_char_class.rs` stays hand-synced until M1(2.8) class-5 gap #3 allows structural scanner rows. Today unit tests ratchet against `u8::is_ascii_*` only. **Next step:** once `char_in_class` is evaluable from the v3 compiler test harness, assert code-point parity on `0..=127` against `byte_matches` and retire the host-stdlib-only ratchet / duplicate sync prose. Same migration gate as deleting `tokenize_char_class.rs` when `regen_tokenize` reads classes from lowered `tokenize.dag`. ### Post-merge debt (2026-04-23 thesis-doc surface — PR #672) From b7bb38e56fb8a13876781f9d6b7dcf9b365d8425 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 01:42:45 -0400 Subject: [PATCH 05/20] docs(roadmap): correct Class 5 Gap 3 shape description + soften CharClass phase-2 blocker classification (per gpt-5.4 audit) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gpt-5.4's review on 706 @ 71f46afe caught that the row's "remaining gap" description was wrong: field-level shapes (nested records, list literals, declaration refs, Var refs, sum-variant literals) are supported today via FieldValue variants + lower_structural_field_value (dag.rs:328-353, lower.rs:2616+). The actual remaining gap is the top-level ValueBody boundary (non-scalar, non-record top-level bodies). The authority I cited — DOWNSTREAM_REQUIREMENTS.md:239 — is itself stale: it describes the pre-PR-B-unwind shape where FieldValue was LiteralBits-only. PR-B's unwind extended FieldValue to carry Reference / Record / List / Variant, moving the gap to ValueBody. Two fixes: 1. Rewrite the Class 5 Gap 3 row to describe the actual ValueBody boundary, point at code paths (dag.rs, lower.rs) as live authority, flag DOWNSTREAM entry as itself stale, and soften phase-2 CharClass blocker classification to "provisional pending reproduction." 2. Update the Character-level row's phase-2 block to name that the specific shape of the CharClass failure needs concrete reproduction from the escalating sub-child before the blocker is finalized. Recursive audit-pattern instance: the row I wrote to codify "verify live state before claiming substrate gap" itself failed to verify live state. Both incidents (2026-04-23 original row + 2026-04-24 my retraction row) are now cited in the audit-pattern sub-note as examples of the same discipline. Co-Authored-By: Claude Opus 4.7 (1M context) --- ROADMAP.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 2fe5ea36213..89acf40cf6e 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -311,7 +311,7 @@ Per-row tagging is a scheduled follow-up sweep — **trigger:** post-merge of th ### Post-merge debt (2026-04-21 receipt-closure wave) - **Class 5 Gap 1 — `Bool` inhabits `BooleanAlgebra` grounding not wired**: surfaced during #610's closing. Current `OperatorKind::Logical(_)` dispatch in the three emitters is hardcoded (`if let OperatorKind::Logical(_)` branches bypass the algebra-field resolution that arithmetic operators use). The substrate already models `BooleanAlgebra` with `meet/join/complement` per `dsl/std/algebra.dag:230-236`, and comments there state *"Bool inhabits BooleanAlgebra"* — but the `inhabits` edge isn't structurally landed. Dissolution: wire `Bool inhabits BooleanAlgebra` + extend `resolve_operator_arrow` for `OperatorKind::Logical(_)` + delete the hardcoded emitter branches. Owner: 1e-2b lane (Path A). -- **Class 5 Gap 3 — port-carried field values in `data` bodies (substrate capability gap)**: authoritative enumeration at `src/v3/DOWNSTREAM_REQUIREMENTS.md:239` (gap partially closed at M1(2.8) for literal-only fields via `ValueBody::Structural` / `SurfaceExpr::Record` / `lower_record_to_structural`; remaining open half is port-carried field values — nested records, list literals, declaration references, `Var` references, sum-variant literals). `compile_to_dag` rejects these shapes inside `data` bodies today. **Consumer impact surfaced 2026-04-24** by PR #693 escalation (sub-child `sharp-bear-829` under Surface Manager): blocks `sub_charclass_in_std_unicode` phase-2 — specifically the `tokenize.dag` retype of `StringEscapeSpec.suffix`, `LocalPunctSpec.pattern`, `OperatorSpec.symbol`, `dag_keyword_set` keys, etc. to `Char` / `List` + `CharClass` sum-variant literals. Adjacent future retype-to-structured-carrier lanes (syntax.dag keyword sets, other opaque-string fields) will hit the same wall. Dissolution: extend `compile_to_dag` to parse port-carried field values in data bodies. Alternative design call (out of scope here): shift the authority shape for these configs from `data` bodies to extractor-over-unparsed-source. Owner: unassigned; substrate-capability scope — routes through a self-hosting / substrate-capability lane, not through the consuming lanes. **Audit pattern:** future "this consumption gap has no substrate capability gap" claims should be verified by attempting the retype before the claim lands — the 2026-04-23 authoring of the Character-level row (this file, `:354`) made this claim and was factually wrong; retracted 2026-04-24 by the update to that row in this PR (see the `:354` Status block). +- **Class 5 Gap 3 — `data` body shape boundary (substrate capability gap; precise shape requires live-state audit)**: `ValueBody` in `src/v3/compiler/src/dag.rs:259-287` carries three variants — `Unparsed(SourceSpan)`, `Structural { fields: Vec<(String, FieldValue)> }`, `Scalar(LiteralBits)`. **Field-level** shapes inside `Structural` are FULL per `FieldValue` at `src/v3/compiler/src/dag.rs:328-353` (`Literal`, `Reference`, `Record`, `List`, `Variant { constructor, payload }`) — nested records, list literals, declaration references, `Var` references, sum-variant literals all lower today via `lower_structural_field_value` at `src/v3/compiler/src/lower.rs:2616+`. **Remaining gap is at the top-level `ValueBody` boundary**: `data foo: List = [...]`, `data foo: SumType = SomeVariant`, and `data foo: T = other_decl_ref` cannot parse as top-level bodies today — only scalar literals (→ `ValueBody::Scalar`) and record-structural bodies (→ `ValueBody::Structural`) are accepted; anything else falls to `ValueBody::Unparsed`. The comment at `dag.rs:269-287` is explicit: growing `Scalar` to swallow `Reference` / `List` / `Variant` is rejected; extension is via new `ValueBody` variants. **Authority caveat:** `src/v3/DOWNSTREAM_REQUIREMENTS.md:239` describes the *pre-PR-B-unwind* shape (where `FieldValue` was `LiteralBits`-only and "port-carried field values" were the gap); the code has since extended `FieldValue` with the four additional variants, so the DOWNSTREAM entry's "remaining gap" framing is itself stale against the live code. Read `dag.rs` / `lower.rs` for the current boundary. **Consumer impact surfaced 2026-04-24** by PR #693 escalation (sub-child `sharp-bear-829` under Surface Manager): `sub_charclass_in_std_unicode` phase-2 (`tokenize.dag` retype to `Char` / `List` / `CharClass`) failed during execution; the specific shape of the failure (top-level `ValueBody` boundary vs. something narrower) needs concrete reproduction from the escalating sub-child before the dissolution direction is finalized — phase-2 "blocked on Class 5 Gap 3" is a provisional classification pending that reproduction. Dissolution direction: extend `ValueBody` with the additional top-level variants needed by downstream consumers, informed by concrete reproduction. Alternative design call: shift authority shape for config declarations from `data` bodies to extractor-over-unparsed-source. Owner: unassigned; substrate-capability scope — routes through a self-hosting / substrate-capability lane, not through the consuming lanes. **Audit pattern — recursive application.** The 2026-04-23 Character-level row (this file, `:354`) claimed "no substrate capability gap" and was factually wrong; retracted 2026-04-24 by the update to that row in this PR (see the `:354` Status block). The 2026-04-24 initial authoring of *this* row then described the remaining gap incorrectly (claimed field-level shapes were blocked when they were actually supported, citing the stale DOWNSTREAM entry as authority); corrected later the same day after gpt-5.4's independent audit caught the drift. Both incidents instantiate the rule: **claims about substrate capability must be verified against live `ValueBody` / `FieldValue` / `lower_*` code paths before the claim lands — reading a summary authority (ROADMAP row, DOWNSTREAM entry) is necessary but not sufficient, because authority text itself drifts.** - **`emit_rust_module` gap: SurfaceLiteral → LiteralBits rename**: substrate declares `LitInt/LitBool/LitString` in `LiteralBits`; Rust enum is `Int/Bool/String`; no rename facility in `emit_rust_module` causes connective-producing slices (per #612's staging choice notes) to fail on this. Dissolution: add per-variant name mapping in spec or rename-facility in emit. Owner: unassigned; blocks deeper SG-3g slices. - **`emit_rust_module` gap: `render_variant_constructor` fails on external tuple variants**: `src/v3/compiler/src/emit/rust_target.rs:4296` unconditionally emits `Variant { _0: value }` which is wrong for external tuple variants. Dissolution: spec-driven variant-constructor template per source kind. Owner: unassigned; blocks deeper SG-3g slices. - **File-preference rank is a ratified-parallel-authority scaffold**: `Dag::declaration_name_preference_rank` (`src/v3/compiler/src/dag.rs:1985-2015`) and its mirror in `collect_symbols` (`src/v3/compiler/src/lower.rs:1258-1278`) resolve same-named declarations by preferring `src/v3/` over `dsl/`. This is a P2 Boundary Discipline violation — a stable lookup rule that *normalizes* duplicate authority instead of dissolving it. Held as a scaffold rather than deleted because the duplicates carry v3-only substrate content (`v3.std.substrate` imports, `ElementRef` / `PortId` references, partitioned `EffectShape`, diagnostic-assertion surface) that cannot yet live under `dsl/std/` — v2 CI recursively ingests `dsl/` and cannot parse v3 grammar. Dissolution trigger: when every module currently duplicated between `dsl/std/` and `src/v3/std/` (or `src/v3/spec/`) has converged to a single canonical home, delete the rank function + mirror policy and remove the duplicate-authority preference rule entirely. After convergence, `declaration_by_name` must resolve against the single surviving authority or fail closed on multiple matches; no rank-based bridge remains. Convergence checklist: (1) `module std.effects` — `dsl/std/effects.dag` ↔ `src/v3/std/effects.dag` (v3 copy imports `v3.std.substrate`, partitions `EffectShape`, uses `ElementRef`); (2) `module std.verification` — `dsl/std/verification.dag` ↔ `src/v3/std/verification.dag` (surfaces are disjoint today: v2 `AssertKind/TestClaim/TestCase` vs v3 `DiagnosticKind / DiagnosticReference / PortStateExpectation`; convergence requires a design call on which surface wins); (3) embedded `http_path` mirror inside `src/v3/std/effects.dag:118-260` (resolves via either staging `http_path.dag` in v3 or rewiring imports to consume `std.http_path` directly once v3-substrate staging lands). Owner: unblocked by v3.std.substrate staging lane + v3-grammar CI convergence. @@ -351,7 +351,7 @@ Tracked debt not dispatched with the 2026-04-21 lane wave (Lane 1e P3.0, SG-2c-4 - **`extdeps/browser.dag` typed-carrier service-boundary collapse**: `dsl/extdeps/browser.dag:21-32` declares typed carriers (`BrowserConfig`, opaque `BrowserContext` / `Page` / `Element` handles, imports `Url`), but service ops use raw `String`: `Launch.input.headless: String = "false"`, `output.context_id: String`; `Goto.input.url: String`, `wait_until: String`, `output.final_url: String`; selector/query/evaluate outputs all remain `String` (`:42-47,56-60,75-103`). Same class as the LLM service flattening and the GitHub auth model bypass (both tracked separately). P1 Modeling Faithfulness / M8 "dispatch structural, not string extraction". **Dissolution trigger**: when the transport layer (REST/shell/file) can consume typed carriers end-to-end rather than stringly — this requires transport-level capability support that currently forces the String fallback. The Lane H brief (PR #658) pilots the pattern on browser.dag specifically; if that lands cleanly, LLM + GitHub dissolutions can consume the same pattern. Until then, the transport-capability gap is the upstream blocker. Surfaced by 2026-04-22 exploratory analysis. Owner: unassigned (pilot in-flight on Lane H #658); M per service family, contingent on transport capability. -- **Character-level under-consumption in tokenize + syntax authorities (mixed: consumption gap for steps 1+3, substrate gap for step 2 — see Status block below)**: `src/v3/compiler/tokenize.dag` and `dsl/extdeps/languages/dag/syntax.dag` both slice the ASCII/Unicode codepoint space in two parallel non-canonical forms. **Reserved individual codepoints as opaque strings**: `StringEscapeSpec.suffix`, `output_codepoint: Int`, `LocalPunctSpec.pattern`, `string_literal_delimiter`, `line_comment_prefix`, `OperatorSpec.symbol`, `dag_keyword_set` keys — all encode specific codepoints as byte strings. **Reserved codepoint classes as hidden Rust predicates**: `is_ascii_whitespace` / `is_ascii_digit` / `is_ascii_alphabetic` / `is_ascii_alphanumeric` plus a bare `byte == b'_'` `push_str`'d into `regen_tokenize.rs:700,727,750,752`. Not mentioned in `.dag` at all. **The character-level concepts already exist in `dsl/std/`** and are imported cross-tree today (e.g., `src/v3/compiler/regen.dag:3` imports `std.types`): `std.types::Char = Int` (Unicode scalar, U+0000–U+10FFFF), `std.string_type::String = FreeMonoid`, `std.unicode` (`DisplayWidth`, `UnicodeBlock`, block/width classification), `std.encoding` (`ASCII | UTF8 | Latin1 | Text | Binary | Unknown` lattice with `ASCII <: UTF8 <: Text` — literally the ASCII→Unicode causal chain), `std.bit::Byte`. **Framing**: this is a consumption gap — the modeling is done, the tokenizer and syntax authorities just aren't using it. Only one substrate delta is needed. **Dissolution (follow-up lane)**: (1) add `CharClass = Whitespace | Digit | IdentStart | IdentContinue` (or superset) to `std.unicode` as a sibling to `DisplayWidth`, plus classification predicates as data/functions; (2) retype the opaque-string fields in `tokenize.dag` (`suffix: Char`, `output_codepoint: Char`, `pattern: List`, `string_literal_delimiter: Char`, `line_comment_prefix: List`) and the parallel fields in `syntax.dag` (`OperatorSpec.symbol: List`, keyword-set keys as `List`); (3) rewire `regen_tokenize` to read the class-predicate list structurally rather than hardcoding host-stdlib method names. Scaffold note lives in the `tokenize.dag` header. **Status (2026-04-24, post-PR #693):** phase-1 landed — step (1) done (`CharClass` + `char_in_class` in `dsl/std/unicode.dag`, ASCII-aligned); step (3) partially done via a `tokenize_char_class.rs` Rust mirror (gate-locked 0..=127 against Rust ASCII helpers per `sub_charclass_in_std_unicode_gate`), so generated tokenizer carries no `is_ascii_*` calls. Phase-2 (step 2 — the `.dag`-native retype to `Char` / `List` / `CharClass` variants inside `data` bodies) is **blocked on Class 5 Gap 3** (port-carried field values in `data` bodies per `src/v3/DOWNSTREAM_REQUIREMENTS.md:239`); see that row above for the substrate-capability dissolution. **The 2026-04-23 authoring of this row claimed "no substrate capability gap"; retracted — PR #693's execution found the gap.** See the `char_in_class` interpreter-parity follow-up row below for the bridge-finish step (retiring the host-stdlib-only ratchet on `tokenize_char_class.rs`). Owner: phase-1 landed (PR #693); phase-2 unassigned, blocked on Class 5 Gap 3. If the `tokenize.dag → std/tokenize.dag` consolidation migration (from the compiler–std consolidation program above) is dispatched before Class 5 Gap 3 closes, the phase-1 Rust mirror piggybacks on it; the full structural `.dag`-native path lands only when Class 5 Gap 3 closes. +- **Character-level under-consumption in tokenize + syntax authorities (mixed: consumption gap for steps 1+3, substrate gap for step 2 — see Status block below)**: `src/v3/compiler/tokenize.dag` and `dsl/extdeps/languages/dag/syntax.dag` both slice the ASCII/Unicode codepoint space in two parallel non-canonical forms. **Reserved individual codepoints as opaque strings**: `StringEscapeSpec.suffix`, `output_codepoint: Int`, `LocalPunctSpec.pattern`, `string_literal_delimiter`, `line_comment_prefix`, `OperatorSpec.symbol`, `dag_keyword_set` keys — all encode specific codepoints as byte strings. **Reserved codepoint classes as hidden Rust predicates**: `is_ascii_whitespace` / `is_ascii_digit` / `is_ascii_alphabetic` / `is_ascii_alphanumeric` plus a bare `byte == b'_'` `push_str`'d into `regen_tokenize.rs:700,727,750,752`. Not mentioned in `.dag` at all. **The character-level concepts already exist in `dsl/std/`** and are imported cross-tree today (e.g., `src/v3/compiler/regen.dag:3` imports `std.types`): `std.types::Char = Int` (Unicode scalar, U+0000–U+10FFFF), `std.string_type::String = FreeMonoid`, `std.unicode` (`DisplayWidth`, `UnicodeBlock`, block/width classification), `std.encoding` (`ASCII | UTF8 | Latin1 | Text | Binary | Unknown` lattice with `ASCII <: UTF8 <: Text` — literally the ASCII→Unicode causal chain), `std.bit::Byte`. **Framing**: this is a consumption gap — the modeling is done, the tokenizer and syntax authorities just aren't using it. Only one substrate delta is needed. **Dissolution (follow-up lane)**: (1) add `CharClass = Whitespace | Digit | IdentStart | IdentContinue` (or superset) to `std.unicode` as a sibling to `DisplayWidth`, plus classification predicates as data/functions; (2) retype the opaque-string fields in `tokenize.dag` (`suffix: Char`, `output_codepoint: Char`, `pattern: List`, `string_literal_delimiter: Char`, `line_comment_prefix: List`) and the parallel fields in `syntax.dag` (`OperatorSpec.symbol: List`, keyword-set keys as `List`); (3) rewire `regen_tokenize` to read the class-predicate list structurally rather than hardcoding host-stdlib method names. Scaffold note lives in the `tokenize.dag` header. **Status (2026-04-24, post-PR #693):** phase-1 landed — step (1) done (`CharClass` + `char_in_class` in `dsl/std/unicode.dag`, ASCII-aligned); step (3) partially done via a `tokenize_char_class.rs` Rust mirror (gate-locked 0..=127 against Rust ASCII helpers per `sub_charclass_in_std_unicode_gate`), so generated tokenizer carries no `is_ascii_*` calls. Phase-2 (step 2 — the `.dag`-native retype to `Char` / `List` / `CharClass` variants inside `data` bodies) failed at execution time and the sub-child classified the blocker as Class 5 Gap 3; the row above now correctly describes that gap as a top-level `ValueBody` boundary (top-level non-scalar, non-record bodies — field-level shapes inside `Structural` already work). **The specific shape of the CharClass phase-2 failure — whether it hits the top-level `ValueBody` boundary or a narrower limitation — needs concrete reproduction from PR #693's sub-child before the blocker classification is finalized.** See the Class 5 Gap 3 row above for the substrate-capability dissolution direction and authority pointers. **The 2026-04-23 authoring of this row claimed "no substrate capability gap"; retracted — PR #693's execution found the gap.** See the `char_in_class` interpreter-parity follow-up row below for the bridge-finish step (retiring the host-stdlib-only ratchet on `tokenize_char_class.rs`). Owner: phase-1 landed (PR #693); phase-2 unassigned, blocked on Class 5 Gap 3. If the `tokenize.dag → std/tokenize.dag` consolidation migration (from the compiler–std consolidation program above) is dispatched before Class 5 Gap 3 closes, the phase-1 Rust mirror piggybacks on it; the full structural `.dag`-native path lands only when Class 5 Gap 3 closes. - **`char_in_class` interpreter parity (tokenizer bridge finish, PR #693):** `dsl/std/unicode.dag::char_in_class` is canonical; `src/v3/compiler/src/tokenize_char_class.rs` stays hand-synced until M1(2.8) class-5 gap #3 allows structural scanner rows. Today unit tests ratchet against `u8::is_ascii_*` only. **Next step:** once `char_in_class` is evaluable from the v3 compiler test harness, assert code-point parity on `0..=127` against `byte_matches` and retire the host-stdlib-only ratchet / duplicate sync prose. Same migration gate as deleting `tokenize_char_class.rs` when `regen_tokenize` reads classes from lowered `tokenize.dag`. ### Post-merge debt (2026-04-23 thesis-doc surface — PR #672) From af451620ec27ada3f05d8a4a887e52eb4ef7a6e0 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 12:15:07 -0400 Subject: [PATCH 06/20] WIP: gunbc Director --- docs/briefs/r1-selfhosting-manager.md | 8 ++++++ docs/briefs/r1-surface-manager.md | 41 +++++++++++++++++++++++---- docs/briefs/r1-testgen-manager.md | 14 ++++++--- 3 files changed, 54 insertions(+), 9 deletions(-) diff --git a/docs/briefs/r1-selfhosting-manager.md b/docs/briefs/r1-selfhosting-manager.md index 83a34292016..d00b57d0253 100644 --- a/docs/briefs/r1-selfhosting-manager.md +++ b/docs/briefs/r1-selfhosting-manager.md @@ -137,6 +137,14 @@ Lane-owner dispatch status (update as sub-deliverables close): Decisions log (append as they happen): +- 2026-04-24: **T-PB-A reduction wave active.** Non-test hand-Rust shims + retired today: lens_idempotency wrapper (#699), lens_parallelism wrapper + (#715), lens_parallelism compatibility alias (#724), lower pass-through + scaffold + `regen_lower.rs` + non-authoritative `lower_generated.rs` + (#729), infer payload span shim (#730), plus T-PB-A-E (#731) and + T-PB-A-F (#732). SG-0 census + SG-6 ratchets shrunk accordingly. Live + floor read from `src/v3/compiler/tests/integration/sg0_census_test.rs`; + the ≤5 irreducible-shim target not yet reached. - 2026-04-24: **T-PB-B-1** — landed `src/v3/compiler/tests/dag/*.dag` (`data` `TestClaim` / `TestSuite` per `std.verification`) + `t_pb_b_1_tests_dag_smoke_test`; Rust tests not deleted; Testgen runner / `pb_*` coordination still open (`docs/briefs/t-pb-b-1.md`). diff --git a/docs/briefs/r1-surface-manager.md b/docs/briefs/r1-surface-manager.md index 81c9200e9fd..cff145573ad 100644 --- a/docs/briefs/r1-surface-manager.md +++ b/docs/briefs/r1-surface-manager.md @@ -134,20 +134,51 @@ Lane-owner dispatch status (update as sub-deliverables close): - [x] `no_profile_sentinel` audit completed (brief: `p0-bug-no-profile-sentinel.md`) **T-Sub:** -- [ ] `sub_match_over_user_sum` gate compiles + passes (Day-1) +- [x] `sub_match_over_user_sum` gate compiles + passes (Day-1) + (PR #702, merged 2026-04-24 — `TestClaim` + suite in + `src/v3/compiler/tests/fixtures/r1_gates.dag` run through + `TestRunner`; #690 prior receipt confirmed structural match) - [ ] `sub_type_alias_where_lowers` gate compiles + passes - (DB-11 alias-RHS path) + (DB-11 parse + lower substrate landed in PR #703, 2026-04-24 — + `SurfaceItem::TypeAlias` carries `refinement`; `.dag` gate still + to be authored once [ext] predicate path is named) - [ ] `sub_charclass_in_std_unicode` gate compiles + passes + (phase-1 tokenizer half landed in PR #693 + ROADMAP row #706, + 2026-04-24 — `CharClass` + `char_in_class` in `std.unicode`, + tokenizer calls `tokenize_char_class::byte_matches`; follow-ups + open: `syntax.dag` / `std.syntax` consumer wiring and structural + `CharClass` consumption from lowered `tokenize.dag` — blocked by + M1(2.8) class-5 gap #3) **T-Emit:** -- [ ] Rust harden — `emit_rust_fixtures_rustc_green` passes +- [x] Rust harden — `emit_rust_fixtures_rustc_green` gate test landed + (PR #694, merged 2026-04-24 — `#[ignore]`d named gate sweeps + 9 program fixtures + 5 reflected-module fixtures through the + batched rustc roundtrip; baseline `rustc_roundtrip_*` tests all + green) - [ ] PR #650 generic-bound fidelity — `emit_generic_bounds_survive` - passes + passes (PR #676 in review — session `vivid-cat-794`) - [ ] Python/Go reconcile — `emit_omni_demo_fixtures_green` passes - across all three targets + across all three targets (cross-target progress 2026-04-24: + `Behavior::Loop` emission for Python + Go in #692; Python + operator-realization parity for `*` / `!=` / int comparisons + in #691; omni gate still pending) Decisions log (append as they happen): +- `2026-04-24` — T-Sub wave landed. `sub_match_over_user_sum` Day-1 gate + closed via #702 (with #690 prior receipt). DB-11 parse+lower substrate + landed via #703 (type-alias RHS `where`); the `.dag` gate itself awaits + the [ext] predicate path. `sub_charclass_in_std_unicode` phase-1 closure + via #693 + ROADMAP row #706 — tokenizer authority + mirror; syntax + consumer wiring and structural `.dag` read remain (blocked on M1(2.8) + class-5 gap #3). +- `2026-04-24` — T-Emit partial progress. `emit_rust_fixtures_rustc_green` + named gate test landed in #694 (ignored baseline sweep; non-ignored + roundtrips green). Python/Go cross-target progress via #691 (Python + operator-realization parity) and #692 (`Behavior::Loop` emission for + Python + Go). `emit_generic_bounds_survive` (#676) still in review; + `emit_omni_demo_fixtures_green` pending. - `2026-04-23` — T-P0 reclassified from dispatchable R1 work to already-landed closure on current ancestry after direct source audit (`dsl/std/render.dag`, `src/v2/tests/src/effects.rs`, diff --git a/docs/briefs/r1-testgen-manager.md b/docs/briefs/r1-testgen-manager.md index 71fe68c5edf..81518d727a6 100644 --- a/docs/briefs/r1-testgen-manager.md +++ b/docs/briefs/r1-testgen-manager.md @@ -145,10 +145,12 @@ Lane-owner dispatch status (update as sub-deliverables close): **T-LensAPI:** - [x] `user_authored_lens_compiles` gate (Day-1) passes (PR #679, merged 2026-04-24) -- [ ] `AlgebraicLaw` predicate (schema extension, shared with - lens_composition_associative) — predicate declared in #678; - runner evaluation not yet wired -- [ ] `lens_composition_associative` gate compiles + evaluates +- [x] `AlgebraicLaw` predicate runner evaluation wired + (PR #728, merged 2026-04-24 — `Associativity` resolves `lens_ref`, + compiles the claim program, and checks the canonical structural + witness) +- [x] `lens_composition_associative` gate compiles + evaluates + (PR #728, merged 2026-04-24 — witness + `r1_gates.dag` suite) - [ ] `lens_output_is_queryable_data` gate compiles + evaluates (PR #717 in review — adds runner seam dispatch for `LensOutputEquals` → NYI(String); gate stays [ ] until runner executes lens functions) @@ -163,6 +165,10 @@ Lane-owner dispatch status (update as sub-deliverables close): Decisions log (append as they happen): +- 2026-04-24: **T-LensAPI `lens_composition_associative` closed** via + PR #728. Runner dispatch of `AlgebraicLaw { law: Associativity }`, + witness DAG, and `r1_gates.dag` suite landed together. Remaining + T-LensAPI work: `lens_output_is_queryable_data` (PR #717 in review). - 2026-04-24: T-PB-B / Testgen **pre–Rust-deletion** coordination checklist consolidated in this brief (Hand-off → Self-hosting); `docs/briefs/t-pb-b-1.md` now points here instead of duplicating From ec4d4c3e8b359b231221e978538acadde88572bc Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 12:19:37 -0400 Subject: [PATCH 07/20] WIP: gunbc Director --- docs/briefs/r1-surface-manager.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/briefs/r1-surface-manager.md b/docs/briefs/r1-surface-manager.md index cff145573ad..5691bf63a0f 100644 --- a/docs/briefs/r1-surface-manager.md +++ b/docs/briefs/r1-surface-manager.md @@ -191,6 +191,12 @@ Open questions for director: Cross-manager notifications queued: -- _(none yet — coordinate with Self-hosting when T-Sub first gate - lands; coordinate with Testgen when T-Emit `emit_omni_demo_fixtures_green` - predicate shape needs defining)_ +- **Self-hosting Manager**: first T-Sub gate landed — `sub_match_over_user_sum` + Day-1 via #702 (merged 2026-04-24). `match` lowering is live for + consumer self-hosting surfaces; T-PB-A match-emit-dependent clusters + (`regen-emits-match`, variant-constructor templates) can now plan + consumption. ⬅ **SEND** +- **Testgen Manager**: T-Emit `emit_omni_demo_fixtures_green` still + pending — predicate shape coordination not yet triggered. Cross- + target progress continues in #691 / #692 but does not change the + predicate shape ask. From 44ba264704c3e6d76b233dd33b971a2c297a7e72 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 18:59:18 -0400 Subject: [PATCH 08/20] WIP: gunbc Director --- docs/briefs/grounding-manager.md | 107 ++++++--- docs/briefs/r1-director-brief.md | 37 +++ docs/briefs/r2-structural-close-manager.md | 259 +++++++++++++++++++++ 3 files changed, 365 insertions(+), 38 deletions(-) create mode 100644 docs/briefs/r2-structural-close-manager.md diff --git a/docs/briefs/grounding-manager.md b/docs/briefs/grounding-manager.md index 288c38525e4..44714827804 100644 --- a/docs/briefs/grounding-manager.md +++ b/docs/briefs/grounding-manager.md @@ -1,27 +1,45 @@ -# Grounding Manager Brief — Post-R1 Grounding Completeness Program +# R2 Grounding Manager Brief + +**Status:** `PROPOSAL` — pending R2 proposal +([`docs/r2-structure.md`](../r2-structure.md), PR #754) merge + +R1 all-gates-green closure. Until then, this brief is the R2 +Grounding Manager's scope-in-preparation; it does not dispatch +work. On R2 promotion, the `PROPOSAL` banner lifts and this brief +becomes the live dispatch authority for the lane. ## Orient before reading +- **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md) + (in PROPOSAL mode at PR #754). Names this manager as one of + two R2 standing managers (alongside R2 Structural Close + Manager) and locates the T-Ground lane within the R2 program. + On promotion, the authoritative section becomes + `ROADMAP.md §"Release R2 Program"`. - **Program scope authority:** [`ROADMAP.md`](../../ROADMAP.md) - §"Post-R1 Program — Grounding Completeness" — lane list, - acceptance gates, dependencies. -- **Thesis claim tracked:** `THESIS.md` §"Thesis claims — - complete list" → Tier 1 → "Grounding completeness." This - program is the ROADMAP counterpart of that thesis claim. + §"Post-R1 Program — Grounding Completeness" (`:149`+) — lane + list, acceptance gates, dependencies. Promotes into R2 lane + `T-Ground` on R2 proposal merge; the pre-promotion section + remains the scope reference until then. +- **Thesis claim tracked:** [`THESIS.md`](../../THESIS.md) + §"Thesis claims — complete list" → Tier 1 → "Grounding + completeness." This program is the ROADMAP counterpart of that + thesis claim. - **Architectural authority:** [`docs/single-emitter-design.md`](../single-emitter-design.md) (coercion = emission; algebra-homomorphism-not-lookup; - `TypeCheckpoint` / `InhabitantDecl` dissolve). This - manager operationalizes that architectural design. + `TypeCheckpoint` / `InhabitantDecl` dissolve). This manager + operationalizes that architectural design. - **Work breakdown + worked examples:** the target-grounding proposal — [PR #695](https://github.com/gunb-ai/gunbc/pull/695), landing at `docs/thesis/target-grounding-proposal.md` on merge. The proposal doc is in PROPOSAL mode; promotion to committed - happens when #695 and this amendment ([PR #721](https://github.com/gunb-ai/gunbc/pull/721)) + happens when #695 and [PR #721](https://github.com/gunb-ai/gunbc/pull/721) both merge and this program formally dispatches. -- **Coordination context:** [R1 Director Brief](r1-director-brief.md) - for the manager-escalation model. This manager operates under - the same governance — scope changes route to director; manager - owns lane-level dispatch inside scope. +- **Coordination context:** on R2 promotion, this brief's + coordination context becomes the R2 Director Brief (refactored + from [R1 Director Brief](r1-director-brief.md)'s Staffing + section). This manager operates under the same governance — + scope changes route to director; manager owns lane-level + dispatch inside scope. ## Slice @@ -150,32 +168,45 @@ table-driven scaffolding in a single Track 13 PR. ## Hand-off points -- **Sideways to Surface Manager.** Surface Manager (R1 T-Emit - lane) owns emit-pipeline template validation, operator - carrier templates, etc. Grounding's engine work touches the - same emit pipeline boundary. Coordinate on whether engine - changes require emit-pipeline changes (likely yes, since - the engine replaces the declared-carrier read path). -- **Sideways to Testgen Manager.** Testgen Manager (R1 - T-TestGen lane) owns the `TestClaim` runner. Grounding's - T-Ground-Tests lane lands new `TestClaim` variants - (routing-stability, L4 witness-based certification). These - need Testgen runner capabilities that may require further - schema extensions beyond what R1 ships. -- **Up to director.** Substrate-capability claims this - program relies on (DB-11 closure, cardinality-substrate, - optionally DB-18) — if any of those lanes shift schedule, - flag to director. Grounding's timeline is substantially - determined by theirs. +R2 manager structure is **2 standing managers + Director** per +[`docs/r2-structure.md`](../r2-structure.md). R1's Surface / +Testgen / Substrate / Self-hosting / Release managers archive on +R1 close; their emit-pipeline, testgen-runner, and substrate- +capability responsibilities fold into R2 Structural Close +Manager or Director ad-hoc dispatch. + +- **Sideways to R2 Structural Close Manager.** Owns T-EFamilyClose, + T-ShimFloor, T-Modeling, T-Substrate (substrate prereq sub-lanes), + T-LensMigration, T-ImpossibleBugs. The emit-pipeline boundary + Grounding's engine touches is Structural Close territory post-R1 + (formerly Surface Manager T-Emit). Coordinate on: + - Emit-pipeline changes that Grounding's engine requires + (replacing the declared-carrier read path). + - Substrate-capability sub-lanes Grounding blocks on — each is + scoped in R2 T-Substrate to unblock a paired T-Modeling item, + not full substrate-capability close (see R2 proposal Goal 5). + Grounding's T-Ground-Rust / -Python / -Go block similarly on + cardinality-substrate + DB-11 closure; schedule-shift flags + route through Structural Close Manager. +- **Sideways to Director.** The `TestClaim` runner Grounding's + T-Ground-Tests lane depends on is no longer a standing-manager + authority in R2 (R1 Testgen Manager archives on R1 close). New + `TestClaim` variants (routing-stability, L4 witness-based + certification) that require predicate schema extensions route + to Director for ad-hoc dispatch; Director picks worker capacity + per R2 transition mechanics. +- **Up to director.** Substrate-capability claims this program + relies on (DB-11 closure, cardinality-substrate, optionally the + parametric-algebra-attachment in R2 T-Substrate). Schedule- + shift or scope-change flags route via director. - **Up to director.** If pilot surfaces a class of problems - that suggests the proposal's architecture needs amendment - (e.g., the minimum-satisfier discipline produces ambiguous - choices faster than expected), escalate to director for - design amendment rather than patch-in-lane. -- **Up to director.** Any proposal to amend the - grounding-completeness claim in THESIS.md (e.g., scoping - fewer targets, adjusting the Track 13 dissolution trigger) - is a scope change. + suggesting the proposal's architecture needs amendment (e.g., + minimum-satisfier discipline produces ambiguous choices faster + than expected), escalate for design amendment rather than + patch-in-lane. +- **Up to director.** Any proposal to amend the grounding- + completeness claim in THESIS.md (e.g., scoping fewer targets, + adjusting the Track 13 dissolution trigger) is a scope change. ## Pilot-gate acceptance diff --git a/docs/briefs/r1-director-brief.md b/docs/briefs/r1-director-brief.md index 1d96b31a747..64237ceefd9 100644 --- a/docs/briefs/r1-director-brief.md +++ b/docs/briefs/r1-director-brief.md @@ -152,6 +152,43 @@ authoritative. Manager briefs provide the *why*, the sequencing, and the cross-manager coordination surface above what `ROADMAP.md` already names. +## Staffing set + +The minimum orientation set for a new session, by role. + +**Staffing a manager session** (Surface / Substrate / Testgen / +Self-hosting / Release): + +1. [`CLAUDE.md`](../../CLAUDE.md) — repo-root agent discipline + pointers: `INVARIANTS.md`, `ROADMAP.md`, `MODELING.md`, + `CODING.md`, `TESTING.md`, `src/v2/DESIGN.md`. +2. This brief — coordination context (manager composition, + escalation path, framing questions). +3. The manager's own brief, naming its slice of R1: + - Surface: [`r1-surface-manager.md`](r1-surface-manager.md) + - Substrate: [`r1-substrate-manager.md`](r1-substrate-manager.md) + - Testgen: [`r1-testgen-manager.md`](r1-testgen-manager.md) + - Self-hosting: [`r1-selfhosting-manager.md`](r1-selfhosting-manager.md) + - Release: [`r1-release-manager.md`](r1-release-manager.md) +4. [`ROADMAP.md`](../../ROADMAP.md) §"Release R1 Program" + (`:15-147`) for the authoritative lane / gate list. + +**Staffing a director session:** everything above, with all five +manager briefs read in parallel (not just one), plus +[`docs/r2-structure.md`](../r2-structure.md) for the forward view +after R1 closes. + +**R1 → R2 transition.** When R1 closes per all-gates-green +criterion and `docs/r2-structure.md` promotes to a `## Release R2 +Program` section in `ROADMAP.md`, this Staffing set section +refactors into an R2 Director brief. The five R1 manager briefs +archive with closure banners; their files remain in-tree as +historical references but are no longer read as staffing +authority. The R2 staffing targets become the Structural Close +Manager brief (to be authored on promotion) and the refreshed +Grounding Manager brief at +[`docs/briefs/grounding-manager.md`](grounding-manager.md). + ## Notes and open items - **Two story-surfaced gaps now have ledger rows** at diff --git a/docs/briefs/r2-structural-close-manager.md b/docs/briefs/r2-structural-close-manager.md new file mode 100644 index 00000000000..38ec1e29c08 --- /dev/null +++ b/docs/briefs/r2-structural-close-manager.md @@ -0,0 +1,259 @@ +# R2 Structural Close Manager Brief + +**Status:** `PROPOSAL` — pending R2 proposal +([`docs/r2-structure.md`](../r2-structure.md), PR #754) merge + +R1 all-gates-green closure. Until then, this brief is the R2 +Structural Close Manager's scope-in-preparation; it does not +dispatch work. On R2 promotion, the `PROPOSAL` banner lifts and +this brief becomes the live dispatch authority for the manager. + +**Naming rationale.** The scope below covers six lanes spanning +substrate carrier close, substrate prereqs, modeling-faithfulness, +shim floor, lens migration, and impossible-bug class closure. +"Self-hosting" is only accurate for two of those; "Structural +Close" names the actual thesis-level activity — closing the +remaining structural work so every Tier-1 / Tier-2 / Tier-3 claim +has named structural backing rather than convention or scaffolding. + +## Orient before reading + +- **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md) + (in PROPOSAL mode at PR #754). Names this manager as one of two + R2 standing managers (alongside R2 Grounding Manager) and + locates the six lanes listed below within the R2 program. On + promotion, the authoritative section becomes + `ROADMAP.md §"Release R2 Program"`. +- **Thesis claims tracked:** [`THESIS.md`](../../THESIS.md) + §"Thesis claims — complete list" — multiple claims across + Tier 1 / Tier 2 / Tier 3 and the Epistemic-stacking / + Substrate-shape meta-claims. The specific claim → lane + mapping lives in the pre-promotion thesis-claim coverage + audit (R2 proposal Open Call 2); on promotion the audit + table is linked here. +- **Design authorities this manager operationalizes:** + - [`docs/design-substrate-carrier-port-program.md`](../design-substrate-carrier-port-program.md) + — E-family carrier port program; §6a per-method-metadata + call deferred from R1 decides in R2. + - [`docs/design-pure-bootstrap.md`](../design-pure-bootstrap.md) + — ≤5 irreducible-shim floor; SG-0 census partition. + - [`docs/v3-lens-capability-register.md`](../v3-lens-capability-register.md) + — per-lens capability tracking; T-LensMigration gate reads + `lens_producer_files_remaining → 0` from this register. +- **R1 precedents:** on R2 promotion, R1 Substrate / + Self-hosting / Testgen / Surface Managers archive with + closure banners. Their briefs remain in-tree as historical + references. E-family work, T-PB-A / T-PB-B work, and the + testgen predicate tail fold here. R1 Surface's emit-pipeline + boundary responsibilities fold here for the parts R2 touches. +- **Coordination context:** on R2 promotion, this brief's + coordination context becomes the R2 Director Brief + (refactored from [R1 Director Brief](r1-director-brief.md)'s + Staffing section). Scope changes route to director; manager + owns lane-level dispatch inside scope. + +## Slice + +This manager owns six R2 lanes. The seventh R2 lane (T-Ground) is +owned by the R2 Grounding Manager; the eighth (cross-lane demo +discipline) is Director ad-hoc. + +| Lane | Size | R2 Goal | Covers | +|---|---|---|---| +| **T-EFamilyClose** | M | 7 | E-I finish (if still in flight at R2 open) → E-P → E-M → §6a per-method-metadata call per `docs/design-substrate-carrier-port-program.md`. Scope reduces to §6a alone if E-I / E-P / E-M close as part of R1. | +| **T-ShimFloor** | M | 3 | T-PB-A non-lens-producer hand-Rust reduction toward ≤5 irreducible-shim floor; T-PB-B outside-residual-zero (`TESTING.md §Post-R2 shape` carve-out preserved); compiler–`std/` consolidation ratchet → 0. | +| **T-LensMigration** | L | 2 | Every lens producer `.rs` file → `.dag`-authored. Per-file parallel fill queue. Gate: `lens_producer_files_remaining → 0` (introduced via PR #752). Closes the "lens purity by construction" co-anchor claim. | +| **T-Modeling** | M | 4 | Three modeling-faithfulness dissolutions: surface int-literal magnitude at concept layer (PR #745 analysis); `Secret` nominal-opaque graduation; `Dimension` phantom-parameter unit-mismatch enforcement. Each blocks on its paired T-Substrate sub-lane. | +| **T-Substrate** | M | 5 | Three scoped-subset substrate sub-lanes, each sufficient to unblock its paired T-Modeling item (not full substrate-capability close): (a) cardinality-substrate subset for int-literal magnitude; (b) nominal-opaque substrate subset for `Secret`; (c) parametric-algebra-attachment subset for `Dimension`. Full-capability substrate work outside these subsets stays outside R2 scope unless other R2 items demand it. | +| **T-ImpossibleBugs** | S | 6 | Three remaining `[R2+]` impossible-bug classes tagged at `ROADMAP.md:72` (THESIS §"Enumerable impossible-bug classes" is the authority on scheduling tags): nested-optional flatten; unhandled diagnostic paths; unenumerated effects. Sparse lane — fills when other fill queues are saturated. | + +## Framing question this manager answers + +**Does every remaining Tier 1 / Tier 2 / Tier 3 thesis claim not +closed by R1 reach structural closure — carrier-port complete, +shim floor reached, lens producers all `.dag`-authored, modeling- +faithfulness gaps dissolved, substrate prereqs met for those +dissolutions, and the three remaining impossible-bug classes +proven impossible by construction?** + +Today (pre-R2-promotion state): +- E-family carrier port is most of the way through R1 (E-T / E-C + landed; E-I in flight; E-P / E-M work staged). Whether E-P / E-M + close in R1 or inherit as R2 work depends on R1 closure + criterion application; this brief scopes T-EFamilyClose to + cover whatever remains at R2 open. +- T-PB-A reduction wave is active in R1; SG-0 non-test census is + tracked live in `src/v3/compiler/tests/integration/sg0_census_test.rs` + with the ≤5 floor as target. +- `lens_producer_files_remaining` gate is named but pre-zero; the + set of lens producers still in `.rs` is enumerated in the R1 + self-hosting manager's T-PB-A reduction wave. +- The three modeling-faithfulness items (int-lit, `Secret`, + Dimensions) have named dissolution directions in R1 ledger rows + but no compile-time enforcement yet. +- The three `[R2+]` impossible-bug classes are tagged but not yet + dispatched; they wait on Tier 2 substrate that closes in R2. + +The ask: close all six lanes. When this manager's scope closes +alongside R2 Grounding, the thesis-claim release ledger has no +open thesis-level items; post-R2 work is external (adoption, +documentation, community). + +## Sequence + dispatch + +**Critical path** is T-EFamilyClose. The other five lanes are +fill queues operating in parallel with the critical path; any +available worker picks top-priority unblocked work. + +- **Day 1 (R2 open).** T-EFamilyClose dispatches. Whatever E-family + work is still open at R2 open lands first. §6a per-method- + metadata option pick happens here; the four options in + `docs/design-substrate-carrier-port-program.md:169-197` are + evaluated against E-I/E-P evidence gathered in R1. +- **Day 1.** T-LensMigration dispatches as per-file-parallel fill + queue. Per-file retirements land as separate PRs; SG-0 ratchet + + `lens_producer_files_remaining` gate observe progress. No + cross-lane blocker. +- **Day 1.** T-ShimFloor dispatches as per-file-parallel fill + queue for the non-lens-producer subset of T-PB-A. T-PB-B work + (outside-residual-zero) runs in the same fill queue. +- **Day 1.** T-Substrate dispatches three sub-lanes in parallel. + Each sub-lane's close criterion is its paired T-Modeling + unblock, not general substrate-capability completion. The + DB-18 ↔ ROADMAP label mismatch flagged in the R2 proposal + (cross-ref at `docs/r2-structure.md §"Cross-refs"`) is + resolved pre-dispatch: either the ROADMAP row relabels to + match db-history's DB-18 scope, or a new DB number issues for + the R2 parametric-algebra-attachment subset. +- **Gated on T-Substrate sub-lanes.** T-Modeling's three items + dispatch in parallel, each unblocked by its paired T-Substrate + sub-lane. Int-lit blocks on cardinality-substrate subset; + `Secret` blocks on nominal-opaque substrate subset; + Dimensions blocks on parametric-algebra-attachment subset. +- **Gated on Tier 2 substrate reaching usable state.** + T-ImpossibleBugs's three classes dispatch as fill. Nested- + optional flatten and unhandled-diagnostic-paths depend on Tier 2 + runtime-safety proof infrastructure (reaches usable state as + T-Modeling's int-lit + Dimensions work closes the proof + surface); unenumerated-effects depends on effect-system surface + closure (inherited from R1). + +Lane ordering is a **fill-queue model**, not strict sequential. +T-EFamilyClose is the sole critical path. Cross-lane dispatch +failures surface as blocked workers on specific sub-lanes; +manager reassigns to unblocked queues. + +## Hand-off points + +R2 manager structure is **2 standing managers + Director** per +[`docs/r2-structure.md`](../r2-structure.md). + +- **Sideways to R2 Grounding Manager.** Grounding's engine work + (T-Ground-Engine) replaces the declared-carrier read path + through the emit pipeline; Structural Close owns the emit- + pipeline boundary in R2. Coordinate on: + - Emit-pipeline changes Grounding's engine requires — + Structural Close authors or reviews. + - Substrate-capability overlap: Grounding's T-Ground-Rust / + -Python / -Go lanes block on cardinality-substrate + DB-11 + closure. Structural Close's T-Substrate sub-lanes are + scoped to R2 T-Modeling unblocks specifically; if Grounding + needs broader cardinality-substrate work, flag upward + rather than silently expanding T-Substrate scope. + - `TestClaim` variants Grounding introduces (routing- + stability, L4 witness-based): if these require new testgen + predicate extensions, route to Director for ad-hoc + dispatch (no standing Testgen manager in R2). +- **Sideways to Director.** The following route through Director + as ad-hoc dispatches rather than standing-manager authority: + - New testgen predicate schema extensions beyond what R1 + shipped (`ExecuteCommand`, `ForAllTargets`, `LensOutputEquals`, + `DifferentialEquals`, `AlgebraicLaw`, `MockBackedInvariant`). + - Release-demo artifacts per R2 proposal's Demo discipline — + each lane closure PR ships a "here it runs" artifact; + Director surfaces to user. + - Cross-manager dependency surfacing when critical paths + block. +- **Up to director.** Substrate scope-creep flags: if a + T-Substrate sub-lane surfaces work broader than its scoped + acceptance criterion, escalate rather than absorb. The R2 + proposal explicitly commits T-Substrate to "subset sufficient + to unblock T-Modeling," not full-capability close — scope + drift would re-open a design question the proposal already + resolved. +- **Up to director.** §6a per-method-metadata option pick is + a design call informed by E-I/E-P/E-M evidence. Before + committing the option, surface the evidence summary to + director for review (matches the R1 precedent for E-P + attachment-shape design call). +- **Up to director.** Any proposal to amend thesis-claim + closure criteria for a lane (e.g., T-LensMigration shipping + with `lens_producer_files_remaining = N > 0` as "close + enough") is a scope change. + +## Working state + +Lane-owner dispatch status (update as sub-deliverables close). +This section populates on R2 promotion; entries below are +scaffolding. + +**T-EFamilyClose:** +- [ ] E-I landed (may close in R1; if so, strike through) +- [ ] E-P landed (may close in R1; if so, strike through) +- [ ] E-M landed (may close in R1; if so, strike through) +- [ ] §6a per-method-metadata option picked + applied + (Option 0 lens-local / Option 1 type-decl annotations / + Option 2 per-algebra metadata carrier / Option 3 unified + `MethodContract` — per `docs/design-substrate-carrier-port-program.md:169-197`) + +**T-ShimFloor:** +- [ ] Non-lens-producer T-PB-A reductions to ≤5 irreducible-shim floor + (live baseline: `src/v3/compiler/tests/integration/sg0_census_test.rs` + `EXPECTED_HAND_AUTHORED_NON_TEST`) +- [ ] T-PB-B outside-residual-zero per `TESTING.md §Post-R2 shape` +- [ ] Compiler–`std/` consolidation ratchet → 0 +- [ ] `pb_hand_rust_at_shim_floor` predicate evaluates true +- [ ] `pb_rust_tests_outside_residual_zero` predicate evaluates true +- [ ] `pb_self_compile_fixed_point` predicate evaluates true +- [ ] `pb_compiler_std_ratchet_zero` predicate evaluates true + +**T-LensMigration:** +- [ ] Lens-producer enumeration table (snapshot at R2 open) +- [ ] Per-file `.rs` → `.dag` migrations (per-file parallel fill) +- [ ] `lens_producer_files_remaining → 0` gate evaluates true + +**T-Modeling:** +- [ ] Int-literal magnitude at concept layer — lowered + enforced + (blocks on T-Substrate cardinality-subset) +- [ ] `Secret` nominal-opaque graduation — construction- + restriction compile-time enforced + (blocks on T-Substrate nominal-opaque-subset) +- [ ] `Dimension` phantom-parameter arithmetic — + unit-mismatch compile-time enforced + (blocks on T-Substrate parametric-algebra-attachment-subset) + +**T-Substrate:** +- [ ] Cardinality-substrate subset sufficient to close int-literal + magnitude refinement +- [ ] Nominal-opaque substrate subset sufficient to graduate `Secret` +- [ ] Parametric-algebra-attachment subset sufficient to inhabit + `Dimension` in an abelian group algebra +- [ ] DB label reconciliation (ROADMAP ↔ db-history DB-18 scope + mismatch resolved pre-dispatch) + +**T-ImpossibleBugs:** +- [ ] Nested-optional flatten impossible-by-construction +- [ ] Unhandled diagnostic paths impossible-by-construction +- [ ] Unenumerated effects impossible-by-construction + +Decisions log (append as they happen): + +- _(none yet — brief is pre-dispatch)_ + +Open questions for director: + +- _(none yet — brief is pre-dispatch)_ + +Cross-manager notifications queued: + +- _(none yet — awaits R2 open + Grounding Manager dispatch + signals)_ From ddf3595d52eebc332d86dda18ee721a74822b037 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 19:03:48 -0400 Subject: [PATCH 09/20] WIP: gunbc Director --- docs/briefs/grounding-manager.md | 79 ++++--- docs/briefs/r1-director-brief.md | 12 +- docs/briefs/r2-structural-close-manager.md | 259 --------------------- 3 files changed, 53 insertions(+), 297 deletions(-) delete mode 100644 docs/briefs/r2-structural-close-manager.md diff --git a/docs/briefs/grounding-manager.md b/docs/briefs/grounding-manager.md index 44714827804..4686fe34138 100644 --- a/docs/briefs/grounding-manager.md +++ b/docs/briefs/grounding-manager.md @@ -10,11 +10,16 @@ becomes the live dispatch authority for the lane. ## Orient before reading - **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md) - (in PROPOSAL mode at PR #754). Names this manager as one of - two R2 standing managers (alongside R2 Structural Close - Manager) and locates the T-Ground lane within the R2 program. - On promotion, the authoritative section becomes - `ROADMAP.md §"Release R2 Program"`. + (currently committed to main via PR #754 + amendments via + PR #758, still in PROPOSAL mode until R1 closes and it + promotes to ROADMAP). Names this manager as **R2's single + standing manager alongside Director**. Director dispatches + T-Modeling / T-Substrate / T-ImpossibleBugs / + T-PerMethodMetadata ad-hoc; no second standing manager. + T-LensMigration / T-ShimFloor / T-EFamilyClose are **R1 gates, + not R2 lanes** per the r2-structure.md "Lanes deliberately + absent" section. On promotion, the authoritative section + becomes `ROADMAP.md §"Release R2 Program"`. - **Program scope authority:** [`ROADMAP.md`](../../ROADMAP.md) §"Post-R1 Program — Grounding Completeness" (`:149`+) — lane list, acceptance gates, dependencies. Promotes into R2 lane @@ -168,37 +173,43 @@ table-driven scaffolding in a single Track 13 PR. ## Hand-off points -R2 manager structure is **2 standing managers + Director** per +R2 manager structure is **1 standing manager + Director** per [`docs/r2-structure.md`](../r2-structure.md). R1's Surface / Testgen / Substrate / Self-hosting / Release managers archive on -R1 close; their emit-pipeline, testgen-runner, and substrate- -capability responsibilities fold into R2 Structural Close -Manager or Director ad-hoc dispatch. - -- **Sideways to R2 Structural Close Manager.** Owns T-EFamilyClose, - T-ShimFloor, T-Modeling, T-Substrate (substrate prereq sub-lanes), - T-LensMigration, T-ImpossibleBugs. The emit-pipeline boundary - Grounding's engine touches is Structural Close territory post-R1 - (formerly Surface Manager T-Emit). Coordinate on: - - Emit-pipeline changes that Grounding's engine requires - (replacing the declared-carrier read path). - - Substrate-capability sub-lanes Grounding blocks on — each is - scoped in R2 T-Substrate to unblock a paired T-Modeling item, - not full substrate-capability close (see R2 proposal Goal 5). - Grounding's T-Ground-Rust / -Python / -Go block similarly on - cardinality-substrate + DB-11 closure; schedule-shift flags - route through Structural Close Manager. -- **Sideways to Director.** The `TestClaim` runner Grounding's - T-Ground-Tests lane depends on is no longer a standing-manager - authority in R2 (R1 Testgen Manager archives on R1 close). New - `TestClaim` variants (routing-stability, L4 witness-based - certification) that require predicate schema extensions route - to Director for ad-hoc dispatch; Director picks worker capacity - per R2 transition mechanics. -- **Up to director.** Substrate-capability claims this program - relies on (DB-11 closure, cardinality-substrate, optionally the - parametric-algebra-attachment in R2 T-Substrate). Schedule- - shift or scope-change flags route via director. +R1 close; T-LensMigration / T-ShimFloor / T-EFamilyClose carrier +work closes in R1, not R2. Director dispatches R2's remaining +work (T-Modeling, T-Substrate, T-ImpossibleBugs, §6a +per-method-metadata residual) ad-hoc rather than through a second +standing manager. Grounding's cross-manager handoffs therefore +route exclusively to Director. + +- **Sideways / up to Director — emit-pipeline boundary.** + Grounding's engine work (T-Ground-Engine) replaces the + declared-carrier read path through the emit pipeline. The + emit-pipeline surface itself is closed by R1 T-Emit; any + engine-driven change that requires emit-pipeline amendment + after R1 close routes via Director for ad-hoc dispatch. Flag + early rather than absorbing emit-pipeline work into + T-Ground-Engine. +- **Sideways / up to Director — substrate-capability overlap.** + Grounding's T-Ground-Rust / -Python / -Go lanes depend on + cardinality-substrate + DB-11 closure for full-reference + coverage. R2's T-Substrate sub-lanes (dispatched by Director + ad-hoc) are **scoped to T-Modeling unblocks only**, not full + substrate-capability completion. If Grounding needs broader + substrate work than T-Substrate's scoped acceptance covers, + surface that as a substrate scope-creep flag to Director + rather than silently expanding T-Substrate scope. +- **Sideways / up to Director — testgen predicate extensions.** + The `TestClaim` runner Grounding's T-Ground-Tests lane depends + on is no longer a standing-manager authority in R2 (R1 Testgen + Manager archives on R1 close). New `TestClaim` variants + (routing-stability, L4 witness-based certification) that + require predicate schema extensions beyond R1's shipped set + route to Director for ad-hoc dispatch. +- **Up to director.** Substrate-capability schedule-shift flags + (DB-11, cardinality-substrate, parametric-algebra-attachment + subset). Grounding's timeline is partly determined by theirs. - **Up to director.** If pilot surfaces a class of problems suggesting the proposal's architecture needs amendment (e.g., minimum-satisfier discipline produces ambiguous choices faster diff --git a/docs/briefs/r1-director-brief.md b/docs/briefs/r1-director-brief.md index 64237ceefd9..d0309ee531a 100644 --- a/docs/briefs/r1-director-brief.md +++ b/docs/briefs/r1-director-brief.md @@ -184,10 +184,14 @@ Program` section in `ROADMAP.md`, this Staffing set section refactors into an R2 Director brief. The five R1 manager briefs archive with closure banners; their files remain in-tree as historical references but are no longer read as staffing -authority. The R2 staffing targets become the Structural Close -Manager brief (to be authored on promotion) and the refreshed -Grounding Manager brief at -[`docs/briefs/grounding-manager.md`](grounding-manager.md). +authority. Per `docs/r2-structure.md`, R2 has **one** standing +manager (Grounding) plus Director; no Structural Close Manager +is authored. The R2 staffing target is the refreshed Grounding +Manager brief at +[`docs/briefs/grounding-manager.md`](grounding-manager.md); +T-Modeling / T-Substrate / T-ImpossibleBugs / +T-PerMethodMetadata dispatch directly from Director per +r2-structure.md transition mechanics. ## Notes and open items diff --git a/docs/briefs/r2-structural-close-manager.md b/docs/briefs/r2-structural-close-manager.md deleted file mode 100644 index 38ec1e29c08..00000000000 --- a/docs/briefs/r2-structural-close-manager.md +++ /dev/null @@ -1,259 +0,0 @@ -# R2 Structural Close Manager Brief - -**Status:** `PROPOSAL` — pending R2 proposal -([`docs/r2-structure.md`](../r2-structure.md), PR #754) merge + -R1 all-gates-green closure. Until then, this brief is the R2 -Structural Close Manager's scope-in-preparation; it does not -dispatch work. On R2 promotion, the `PROPOSAL` banner lifts and -this brief becomes the live dispatch authority for the manager. - -**Naming rationale.** The scope below covers six lanes spanning -substrate carrier close, substrate prereqs, modeling-faithfulness, -shim floor, lens migration, and impossible-bug class closure. -"Self-hosting" is only accurate for two of those; "Structural -Close" names the actual thesis-level activity — closing the -remaining structural work so every Tier-1 / Tier-2 / Tier-3 claim -has named structural backing rather than convention or scaffolding. - -## Orient before reading - -- **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md) - (in PROPOSAL mode at PR #754). Names this manager as one of two - R2 standing managers (alongside R2 Grounding Manager) and - locates the six lanes listed below within the R2 program. On - promotion, the authoritative section becomes - `ROADMAP.md §"Release R2 Program"`. -- **Thesis claims tracked:** [`THESIS.md`](../../THESIS.md) - §"Thesis claims — complete list" — multiple claims across - Tier 1 / Tier 2 / Tier 3 and the Epistemic-stacking / - Substrate-shape meta-claims. The specific claim → lane - mapping lives in the pre-promotion thesis-claim coverage - audit (R2 proposal Open Call 2); on promotion the audit - table is linked here. -- **Design authorities this manager operationalizes:** - - [`docs/design-substrate-carrier-port-program.md`](../design-substrate-carrier-port-program.md) - — E-family carrier port program; §6a per-method-metadata - call deferred from R1 decides in R2. - - [`docs/design-pure-bootstrap.md`](../design-pure-bootstrap.md) - — ≤5 irreducible-shim floor; SG-0 census partition. - - [`docs/v3-lens-capability-register.md`](../v3-lens-capability-register.md) - — per-lens capability tracking; T-LensMigration gate reads - `lens_producer_files_remaining → 0` from this register. -- **R1 precedents:** on R2 promotion, R1 Substrate / - Self-hosting / Testgen / Surface Managers archive with - closure banners. Their briefs remain in-tree as historical - references. E-family work, T-PB-A / T-PB-B work, and the - testgen predicate tail fold here. R1 Surface's emit-pipeline - boundary responsibilities fold here for the parts R2 touches. -- **Coordination context:** on R2 promotion, this brief's - coordination context becomes the R2 Director Brief - (refactored from [R1 Director Brief](r1-director-brief.md)'s - Staffing section). Scope changes route to director; manager - owns lane-level dispatch inside scope. - -## Slice - -This manager owns six R2 lanes. The seventh R2 lane (T-Ground) is -owned by the R2 Grounding Manager; the eighth (cross-lane demo -discipline) is Director ad-hoc. - -| Lane | Size | R2 Goal | Covers | -|---|---|---|---| -| **T-EFamilyClose** | M | 7 | E-I finish (if still in flight at R2 open) → E-P → E-M → §6a per-method-metadata call per `docs/design-substrate-carrier-port-program.md`. Scope reduces to §6a alone if E-I / E-P / E-M close as part of R1. | -| **T-ShimFloor** | M | 3 | T-PB-A non-lens-producer hand-Rust reduction toward ≤5 irreducible-shim floor; T-PB-B outside-residual-zero (`TESTING.md §Post-R2 shape` carve-out preserved); compiler–`std/` consolidation ratchet → 0. | -| **T-LensMigration** | L | 2 | Every lens producer `.rs` file → `.dag`-authored. Per-file parallel fill queue. Gate: `lens_producer_files_remaining → 0` (introduced via PR #752). Closes the "lens purity by construction" co-anchor claim. | -| **T-Modeling** | M | 4 | Three modeling-faithfulness dissolutions: surface int-literal magnitude at concept layer (PR #745 analysis); `Secret` nominal-opaque graduation; `Dimension` phantom-parameter unit-mismatch enforcement. Each blocks on its paired T-Substrate sub-lane. | -| **T-Substrate** | M | 5 | Three scoped-subset substrate sub-lanes, each sufficient to unblock its paired T-Modeling item (not full substrate-capability close): (a) cardinality-substrate subset for int-literal magnitude; (b) nominal-opaque substrate subset for `Secret`; (c) parametric-algebra-attachment subset for `Dimension`. Full-capability substrate work outside these subsets stays outside R2 scope unless other R2 items demand it. | -| **T-ImpossibleBugs** | S | 6 | Three remaining `[R2+]` impossible-bug classes tagged at `ROADMAP.md:72` (THESIS §"Enumerable impossible-bug classes" is the authority on scheduling tags): nested-optional flatten; unhandled diagnostic paths; unenumerated effects. Sparse lane — fills when other fill queues are saturated. | - -## Framing question this manager answers - -**Does every remaining Tier 1 / Tier 2 / Tier 3 thesis claim not -closed by R1 reach structural closure — carrier-port complete, -shim floor reached, lens producers all `.dag`-authored, modeling- -faithfulness gaps dissolved, substrate prereqs met for those -dissolutions, and the three remaining impossible-bug classes -proven impossible by construction?** - -Today (pre-R2-promotion state): -- E-family carrier port is most of the way through R1 (E-T / E-C - landed; E-I in flight; E-P / E-M work staged). Whether E-P / E-M - close in R1 or inherit as R2 work depends on R1 closure - criterion application; this brief scopes T-EFamilyClose to - cover whatever remains at R2 open. -- T-PB-A reduction wave is active in R1; SG-0 non-test census is - tracked live in `src/v3/compiler/tests/integration/sg0_census_test.rs` - with the ≤5 floor as target. -- `lens_producer_files_remaining` gate is named but pre-zero; the - set of lens producers still in `.rs` is enumerated in the R1 - self-hosting manager's T-PB-A reduction wave. -- The three modeling-faithfulness items (int-lit, `Secret`, - Dimensions) have named dissolution directions in R1 ledger rows - but no compile-time enforcement yet. -- The three `[R2+]` impossible-bug classes are tagged but not yet - dispatched; they wait on Tier 2 substrate that closes in R2. - -The ask: close all six lanes. When this manager's scope closes -alongside R2 Grounding, the thesis-claim release ledger has no -open thesis-level items; post-R2 work is external (adoption, -documentation, community). - -## Sequence + dispatch - -**Critical path** is T-EFamilyClose. The other five lanes are -fill queues operating in parallel with the critical path; any -available worker picks top-priority unblocked work. - -- **Day 1 (R2 open).** T-EFamilyClose dispatches. Whatever E-family - work is still open at R2 open lands first. §6a per-method- - metadata option pick happens here; the four options in - `docs/design-substrate-carrier-port-program.md:169-197` are - evaluated against E-I/E-P evidence gathered in R1. -- **Day 1.** T-LensMigration dispatches as per-file-parallel fill - queue. Per-file retirements land as separate PRs; SG-0 ratchet - + `lens_producer_files_remaining` gate observe progress. No - cross-lane blocker. -- **Day 1.** T-ShimFloor dispatches as per-file-parallel fill - queue for the non-lens-producer subset of T-PB-A. T-PB-B work - (outside-residual-zero) runs in the same fill queue. -- **Day 1.** T-Substrate dispatches three sub-lanes in parallel. - Each sub-lane's close criterion is its paired T-Modeling - unblock, not general substrate-capability completion. The - DB-18 ↔ ROADMAP label mismatch flagged in the R2 proposal - (cross-ref at `docs/r2-structure.md §"Cross-refs"`) is - resolved pre-dispatch: either the ROADMAP row relabels to - match db-history's DB-18 scope, or a new DB number issues for - the R2 parametric-algebra-attachment subset. -- **Gated on T-Substrate sub-lanes.** T-Modeling's three items - dispatch in parallel, each unblocked by its paired T-Substrate - sub-lane. Int-lit blocks on cardinality-substrate subset; - `Secret` blocks on nominal-opaque substrate subset; - Dimensions blocks on parametric-algebra-attachment subset. -- **Gated on Tier 2 substrate reaching usable state.** - T-ImpossibleBugs's three classes dispatch as fill. Nested- - optional flatten and unhandled-diagnostic-paths depend on Tier 2 - runtime-safety proof infrastructure (reaches usable state as - T-Modeling's int-lit + Dimensions work closes the proof - surface); unenumerated-effects depends on effect-system surface - closure (inherited from R1). - -Lane ordering is a **fill-queue model**, not strict sequential. -T-EFamilyClose is the sole critical path. Cross-lane dispatch -failures surface as blocked workers on specific sub-lanes; -manager reassigns to unblocked queues. - -## Hand-off points - -R2 manager structure is **2 standing managers + Director** per -[`docs/r2-structure.md`](../r2-structure.md). - -- **Sideways to R2 Grounding Manager.** Grounding's engine work - (T-Ground-Engine) replaces the declared-carrier read path - through the emit pipeline; Structural Close owns the emit- - pipeline boundary in R2. Coordinate on: - - Emit-pipeline changes Grounding's engine requires — - Structural Close authors or reviews. - - Substrate-capability overlap: Grounding's T-Ground-Rust / - -Python / -Go lanes block on cardinality-substrate + DB-11 - closure. Structural Close's T-Substrate sub-lanes are - scoped to R2 T-Modeling unblocks specifically; if Grounding - needs broader cardinality-substrate work, flag upward - rather than silently expanding T-Substrate scope. - - `TestClaim` variants Grounding introduces (routing- - stability, L4 witness-based): if these require new testgen - predicate extensions, route to Director for ad-hoc - dispatch (no standing Testgen manager in R2). -- **Sideways to Director.** The following route through Director - as ad-hoc dispatches rather than standing-manager authority: - - New testgen predicate schema extensions beyond what R1 - shipped (`ExecuteCommand`, `ForAllTargets`, `LensOutputEquals`, - `DifferentialEquals`, `AlgebraicLaw`, `MockBackedInvariant`). - - Release-demo artifacts per R2 proposal's Demo discipline — - each lane closure PR ships a "here it runs" artifact; - Director surfaces to user. - - Cross-manager dependency surfacing when critical paths - block. -- **Up to director.** Substrate scope-creep flags: if a - T-Substrate sub-lane surfaces work broader than its scoped - acceptance criterion, escalate rather than absorb. The R2 - proposal explicitly commits T-Substrate to "subset sufficient - to unblock T-Modeling," not full-capability close — scope - drift would re-open a design question the proposal already - resolved. -- **Up to director.** §6a per-method-metadata option pick is - a design call informed by E-I/E-P/E-M evidence. Before - committing the option, surface the evidence summary to - director for review (matches the R1 precedent for E-P - attachment-shape design call). -- **Up to director.** Any proposal to amend thesis-claim - closure criteria for a lane (e.g., T-LensMigration shipping - with `lens_producer_files_remaining = N > 0` as "close - enough") is a scope change. - -## Working state - -Lane-owner dispatch status (update as sub-deliverables close). -This section populates on R2 promotion; entries below are -scaffolding. - -**T-EFamilyClose:** -- [ ] E-I landed (may close in R1; if so, strike through) -- [ ] E-P landed (may close in R1; if so, strike through) -- [ ] E-M landed (may close in R1; if so, strike through) -- [ ] §6a per-method-metadata option picked + applied - (Option 0 lens-local / Option 1 type-decl annotations / - Option 2 per-algebra metadata carrier / Option 3 unified - `MethodContract` — per `docs/design-substrate-carrier-port-program.md:169-197`) - -**T-ShimFloor:** -- [ ] Non-lens-producer T-PB-A reductions to ≤5 irreducible-shim floor - (live baseline: `src/v3/compiler/tests/integration/sg0_census_test.rs` - `EXPECTED_HAND_AUTHORED_NON_TEST`) -- [ ] T-PB-B outside-residual-zero per `TESTING.md §Post-R2 shape` -- [ ] Compiler–`std/` consolidation ratchet → 0 -- [ ] `pb_hand_rust_at_shim_floor` predicate evaluates true -- [ ] `pb_rust_tests_outside_residual_zero` predicate evaluates true -- [ ] `pb_self_compile_fixed_point` predicate evaluates true -- [ ] `pb_compiler_std_ratchet_zero` predicate evaluates true - -**T-LensMigration:** -- [ ] Lens-producer enumeration table (snapshot at R2 open) -- [ ] Per-file `.rs` → `.dag` migrations (per-file parallel fill) -- [ ] `lens_producer_files_remaining → 0` gate evaluates true - -**T-Modeling:** -- [ ] Int-literal magnitude at concept layer — lowered + enforced - (blocks on T-Substrate cardinality-subset) -- [ ] `Secret` nominal-opaque graduation — construction- - restriction compile-time enforced - (blocks on T-Substrate nominal-opaque-subset) -- [ ] `Dimension` phantom-parameter arithmetic — - unit-mismatch compile-time enforced - (blocks on T-Substrate parametric-algebra-attachment-subset) - -**T-Substrate:** -- [ ] Cardinality-substrate subset sufficient to close int-literal - magnitude refinement -- [ ] Nominal-opaque substrate subset sufficient to graduate `Secret` -- [ ] Parametric-algebra-attachment subset sufficient to inhabit - `Dimension` in an abelian group algebra -- [ ] DB label reconciliation (ROADMAP ↔ db-history DB-18 scope - mismatch resolved pre-dispatch) - -**T-ImpossibleBugs:** -- [ ] Nested-optional flatten impossible-by-construction -- [ ] Unhandled diagnostic paths impossible-by-construction -- [ ] Unenumerated effects impossible-by-construction - -Decisions log (append as they happen): - -- _(none yet — brief is pre-dispatch)_ - -Open questions for director: - -- _(none yet — brief is pre-dispatch)_ - -Cross-manager notifications queued: - -- _(none yet — awaits R2 open + Grounding Manager dispatch - signals)_ From 3c1e8b7a920922ee5427a6deb53727aac78ea03b Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 19:33:49 -0400 Subject: [PATCH 10/20] WIP: gunbc Director --- ROADMAP.md | 4 ++-- docs/r2-structure.md | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 87794b308f7..9745009cf05 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -45,7 +45,7 @@ Each lane owns one concrete `.dag` gate. Lane owners do the comprehensive decomp | Lane | Size | Covers | Cross-ref into debt ledger | |------|------|--------|----------------------------| | T-P0 | S | P0 sweep (repeat_string, REST_OPS, no_profile_sentinel) | §P0 — real bugs | -| T-Sub | S | `match` over user sums (landed PR #702), `CharClass` in std.unicode, type-alias `where` (landed PR #703) | §P4 (bit.dag refinements), Character-level under-consumption | +| T-Sub | S | `match` over user sums (landed PR #702), `CharClass` in std.unicode (phase-1 landed PR #693; **phase-2 reclassified to R2 substrate-capability per Class 5 Gap 3 — not an R1 T-Sub gate**), type-alias `where` (landed PR #703) | §P4 (bit.dag refinements), Character-level under-consumption | | T-Emit | M | Rust harden, #650 generic-bound fidelity, Python/Go reconcile | SurfaceLiteral→LiteralBits, variant-constructor template | | T-LaneE | XL | Complexity lens v2 parity via substrate-carrier-port | Existing Lane E-T/C/I/P/M program | | T-TestGen | L | Testgen runner, service simulation, first-class TestClaim | DB-15 follow-up | @@ -59,7 +59,7 @@ Each lane owns one concrete `.dag` gate. Lane owners do the comprehensive decomp This section lists gate names + schema-compilability tags; full `TestClaim` declarations will land as deliverables of the lane-brief drafting step (lane owners author them as `.dag` after being named). Each predicate is tagged `[Day 1]` (compiles against today's DB-15 schema — `Compiles`, `FailsWithDiagnostic`, `OutputEquals`, `CostBounded`, `PortHasState`) or `[ext]` (requires a T-TestGen schema extension before compiling). Day-1 predicates are a minority — the majority block on T-TestGen's runner + schema work, which is why T-TestGen is the gate-enabling lane. - **T-P0.** `p0_repeat_string_correct` [Day 1] · `p0_no_fabrication_sentinel` [ext] · `p0_rest_ops_aligned` [ext] -- **T-Sub.** `sub_match_over_user_sum` [Day 1, landed PR #702] · `sub_type_alias_where_lowers` [ext, landed PR #703] · `sub_charclass_in_std_unicode` [ext, open: phase-2 reproduction/triage] +- **T-Sub.** `sub_match_over_user_sum` [Day 1, landed PR #702] · `sub_type_alias_where_lowers` [ext, landed PR #703] · ~~`sub_charclass_in_std_unicode`~~ — phase-1 landed PR #693; **phase-2 reclassified to R2 substrate-capability** (top-level `ValueBody` list/sum + `std.unicode` bootstrap/load-set per Class 5 Gap 3 row below) — no longer an R1 T-Sub gate; tracked in `docs/r2-structure.md` Goal 3 / T-Substrate as a 4th scoped sub-lane (consumer: tokenizer) - **T-Emit.** `emit_rust_fixtures_rustc_green` [ext: `ExecuteCommand`] · `emit_generic_bounds_survive` [ext] · `emit_omni_demo_fixtures_green` [ext: `ForAllTargets` + `ExecuteCommand`] - **T-LaneE.** `complexity_merge_sort_is_nlogn` [ext: `LensOutputEquals`] · `complexity_v3_matches_v2_oracle` [ext: `DifferentialEquals`] - **T-TestGen.** `testgen_structural_coverage` [ext] · `testgen_mock_backed_integration_safe` [ext: `MockBackedInvariant` wiring] · `testgen_manual_claim_is_first_class` [ext] — T-TestGen also owns scoping the predicate shape for `[ext]` gates that other lanes consume; currently includes `lens_producer_files_remaining` for T-PB-A (enumeration declared in `sg0_census_test.rs` at scoping time). diff --git a/docs/r2-structure.md b/docs/r2-structure.md index e10a5453609..ff934bf0f04 100644 --- a/docs/r2-structure.md +++ b/docs/r2-structure.md @@ -36,11 +36,12 @@ Under that discipline, R2's goals are the Tier-1 thesis claims that are *not* ga - `Secret` nominal-opaque graduation (`ROADMAP.md` post-merge-debt section, 2026-04-23 thesis-doc surface) - `Dimension` typed value wrapper with phantom-parameter unit-mismatch enforcement (ibid.) -3. **Substrate prereqs** — named as explicit R2 sub-lanes with **scoped acceptance criteria** (sufficient-to-unblock, not full-capability). Each prereq is pinned to a specific Goal 2 item; full substrate-capability lanes retain open design calls that may predate or postdate R2, and this structure does not commit R2 to close them all: +3. **Substrate prereqs** — named as explicit R2 sub-lanes with **scoped acceptance criteria** (sufficient-to-unblock, not full-capability). Each prereq is pinned to a specific R2 consumer (Goal 2 items + the tokenizer charclass closure inherited from R1); full substrate-capability lanes retain open design calls that may predate or postdate R2, and this structure does not commit R2 to close them all: - - **Cardinality-substrate subset sufficient to close int-literal magnitude refinement** — enough cardinality modeling to let `IntLit` carry a magnitude that narrows to target int algebra at reconciliation. Does NOT commit to the full cardinality-substrate capability (fixed-width-types by-construction, container cardinality bounds in Grounding, etc. — those remain open design calls outside R2 scope unless additional R2 items demand them). - - **Nominal-opaque substrate sufficient to graduate `Secret`** — enough nominal-type modeling to carry construction-restriction (`where only X may construct`) semantics. Adjacent to DB-11 alias-RHS `where` (landed in R1 via PR #703); may or may not overlap DB-18 territory. Acceptance is `Secret` graduation, not a general nominal-type program. - - **Parametric algebra attachment subset sufficient to inhabit `Dimension` in an abelian group algebra** — enough substrate capability to let `Dimension` carry phantom-parameter arithmetic (propagate through operations, compile error on unit-mismatch). Primary authority is `ROADMAP.md §"Post-R1 Program — Grounding Completeness"` (the "Why post-R1" paragraph), which tags this dependency `DB-18 parametric algebra attachment` — but `docs/db-history/db-18.md` currently scopes DB-18 to workflow-effect carrier + Rust reflection (Part 2 shipped) + Go-accessor follow-up (Part 3), not parametric algebra attachment. That mismatch is an existing ROADMAP ↔ db-history inconsistency, not one introduced by this doc; a pre-promotion DB-lane rename or new DB number may be warranted. R2 acceptance is: `Dimension` phantom-parameter arithmetic compiles with unit-mismatch errors, independent of the DB-tag the substrate ends up carrying. + - **Cardinality-substrate subset sufficient to close int-literal magnitude refinement** — enough cardinality modeling to let `IntLit` carry a magnitude that narrows to target int algebra at reconciliation. Consumer: T-Modeling int-lit (Goal 2). Does NOT commit to the full cardinality-substrate capability (fixed-width-types by-construction, container cardinality bounds in Grounding, etc. — those remain open design calls outside R2 scope unless additional R2 items demand them). + - **Nominal-opaque substrate sufficient to graduate `Secret`** — enough nominal-type modeling to carry construction-restriction (`where only X may construct`) semantics. Consumer: T-Modeling Secret (Goal 2). Adjacent to DB-11 alias-RHS `where` (landed in R1 via PR #703); may or may not overlap DB-18 territory. Acceptance is `Secret` graduation, not a general nominal-type program. + - **Parametric algebra attachment subset sufficient to inhabit `Dimension` in an abelian group algebra** — enough substrate capability to let `Dimension` carry phantom-parameter arithmetic (propagate through operations, compile error on unit-mismatch). Consumer: T-Modeling Dimensions (Goal 2). Primary authority is `ROADMAP.md §"Post-R1 Program — Grounding Completeness"` (the "Why post-R1" paragraph), which tags this dependency `DB-18 parametric algebra attachment` — but `docs/db-history/db-18.md` currently scopes DB-18 to workflow-effect carrier + Rust reflection (Part 2 shipped) + Go-accessor follow-up (Part 3), not parametric algebra attachment. That mismatch is an existing ROADMAP ↔ db-history inconsistency, not one introduced by this doc; a pre-promotion DB-lane rename or new DB number may be warranted. R2 acceptance is: `Dimension` phantom-parameter arithmetic compiles with unit-mismatch errors, independent of the DB-tag the substrate ends up carrying. + - **Top-level `ValueBody` list/sum subset + `std.unicode` bootstrap inclusion sufficient to close `sub_charclass_in_std_unicode` phase-2** — enough Class 5 Gap 3 substrate capability for `data ascii_scan_order: List = [Whitespace, Digit, IdentStart, IdentContinue]` to lower structurally (rather than fall to `ValueBody::Unparsed` and trigger R14 hard-fail), plus the `Dag::new()` bootstrap/load-set decision that makes `std.unicode::CharClass` resolvable from `tokenize.dag`. Consumer: tokenizer (R1 T-Sub deferred this phase to substrate per Surface Manager handoff 2026-04-24; reclassified to R2 per ROADMAP amendment). Does NOT commit to the full Class 5 Gap 3 substrate-capability close (other top-level `ValueBody` consumers may need additional variants beyond list/sum); scoped to what unblocks the tokenizer charclass row only. 4. **Remaining R2+ impossible-bug classes** — three classes currently tagged `[R2+]` in `ROADMAP.md §"Lane acceptance — .dag gates"` (T-Demo row; THESIS §"Enumerable impossible-bug classes" is the authority on scheduling tags): - Nested-optional flatten @@ -77,7 +78,7 @@ Continues `docs/briefs/grounding-manager.md` (refreshed for R2 scope on promotio |---|---|---|---| | T-Ground | XL | Grounding | Full T-Ground-* sub-program (Goal 1) | | T-Modeling | M | Director (ad-hoc) | int-lit / Secret / Dimensions (Goal 2) | -| T-Substrate | M | Director (ad-hoc) | Three scoped-subset sub-lanes (Goal 3): cardinality-for-int-lit; nominal-opaque-for-Secret; parametric-algebra-attachment-for-Dimensions — each scoped to its paired T-Modeling unblock, not full substrate-capability | +| T-Substrate | M | Director (ad-hoc) | Four scoped-subset sub-lanes (Goal 3): cardinality-for-int-lit; nominal-opaque-for-Secret; parametric-algebra-attachment-for-Dimensions; top-level-ValueBody-list/sum + std.unicode-bootstrap-for-tokenizer-charclass — each scoped to its paired R2 consumer (T-Modeling × 3 + tokenizer × 1), not full substrate-capability | | T-ImpossibleBugs | S | Director (ad-hoc) | nested-optional flatten / unhandled-diagnostic-paths / unenumerated-effects (Goal 4) | | T-PerMethodMetadata | S | Director (ad-hoc) | §6a per-method-metadata carrier pick (Goal 5) — design-call close, not substrate-capability work | @@ -89,7 +90,10 @@ Continues `docs/briefs/grounding-manager.md` (refreshed for R2 scope on promotio - T-EFamilyClose — R1 T-LaneE's critical-path carrier work (E-T, E-C, E-I, E-P, E-M sub-lanes), enabling the R1 `complexity_merge_sort_is_nlogn` + `complexity_v3_matches_v2_oracle` gates. All E-family carrier-port work closes in R1; only the §6a metadata-pick residual inherits to R2 (Goal 5). - T-TestGen-tail (`testgen_mock_backed_integration_safe` / `MockBackedInvariant` wiring) — R1 T-TestGen gate per `ROADMAP.md §"Lane acceptance — .dag gates"`. Closes in R1. -R2 does not re-own any of the above; under all-R1-gates-green R1 closure, those gates ARE the close conditions and R2 inherits nothing there (except Goal 5's §6a residual, which was not an R1 gate). +R2 does not re-own any of the above; under all-R1-gates-green R1 closure, those gates ARE the close conditions and R2 inherits nothing there — with two named exceptions: + +1. **Goal 5's §6a per-method-metadata pick** — was not an R1 gate; deferred design call inherits to R2. +2. **`sub_charclass_in_std_unicode` phase-2** — was an R1 T-Sub gate, but reclassified to R2 substrate-capability per ROADMAP amendment (2026-04-24) following Surface Manager's handoff that the remaining work is Class 5 Gap 3 substrate-capability scope, not T-Sub-only surface fix. Now a 4th sub-lane under R2 T-Substrate (Goal 3); see lane row above. ## Dependency DAG @@ -99,9 +103,11 @@ T-Ground: Pilot → Rust → Engine → Tests → Dissolve (critical p T-Substrate: cardinality-for-int-lit (subset) ──→ unblocks T-Modeling int-lit nominal-opaque-for-Secret (subset) ─→ unblocks T-Modeling Secret parametric-algebra-for-Dimensions (subset) ─→ unblocks T-Modeling Dimensions + ValueBody-list/sum + std.unicode-bootstrap (subset) ─→ unblocks tokenizer charclass phase-2 T-Modeling: int-lit ← T-Substrate cardinality-for-int-lit Secret ← T-Substrate nominal-opaque-for-Secret Dimensions ← T-Substrate parametric-algebra-for-Dimensions +T-CharClassPhase2: tokenizer retype to Char/List/CharClass ← T-Substrate ValueBody-list/sum + std.unicode-bootstrap T-ImpossibleBugs: 3 independent classes (any worker) T-PerMethodMetadata: §6a pick (any worker; independent) (Goal 6 demo artifacts ship with each lane's closure PR — not a @@ -146,6 +152,7 @@ Purpose: proof-of-work visibility at director cadence. Without it, program slips - **Manager count = 1 + Director.** One standing manager (Grounding) matches R2's single critical path. T-Modeling / T-Substrate / T-ImpossibleBugs are parallel-capable with no critical-path coordination pressure; Director dispatches directly. Adjustable upward if parallel fill-queue depth becomes unmanageable in practice. - **R2 includes substrate prereqs explicitly** per user's (i)-over-(ii) preference (honest scope over tight scope), with **scoped acceptance criteria** per Director refinement (each sub-lane closes on unblock of its paired Goal 2 item; full substrate-capability lanes are not R2-committed). - **Anti-deferral principle is the frame, not velocity numbers.** Per Director observation: 16-hour R1 execution was a peak-day sample, not a baseline. The principle "if dissolution direction is clear and named, deferral is problem-finding not problem-solving" is what survives cadence shifts. +- **`sub_charclass_in_std_unicode` phase-2 reclassified R1 → R2** (2026-04-24, ROADMAP amendment paired with this revision). Surface Manager handoff (sub-child `quiet-gull-882` triage) confirmed the remaining work is Class 5 Gap 3 substrate-capability scope, not T-Sub-only surface fix; reclassifying lets R1 close on T-Sub Day-1 + DB-11 without waiting on substrate-capability work. Phase-2 lands in R2 as a 4th T-Substrate scoped sub-lane (consumer: tokenizer). Reclassification scope is bounded — full Class 5 Gap 3 substrate-capability close remains outside R2 unless additional R2 items demand it; only the tokenizer-charclass-unblock subset is R2-committed. - **Post-R2 stance = STRONG.** R2 is thesis close. Post-R2 work is external (adoption, documentation, community, ecosystem buildout). R3 is reserved as escape hatch only, not as a structural release program. User-locked 2026-04-24 after pressure-test framing: *"real programs are probably required to confirm the thesis is real, but we can keep R2 theoretical to stay fair — future work would pressure test the claims."* The R2 doc's "close-everything" claim is thus scoped to the **structural thesis** (what the compiler proves by construction); practical validation via modeling real programs (e.g., the user's `../ctrl/` follow-up) is a separate post-R2 stream that *tests whether the thesis holds in practice*, without itself being a thesis claim. ## Open calls From cdb25a5b3e16bde7fd69c6cc7cde9aca61659471 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 20:17:19 -0400 Subject: [PATCH 11/20] WIP: gunbc Director --- docs/r2-structure.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/r2-structure.md b/docs/r2-structure.md index ff934bf0f04..21d1c3f9ad7 100644 --- a/docs/r2-structure.md +++ b/docs/r2-structure.md @@ -36,7 +36,7 @@ Under that discipline, R2's goals are the Tier-1 thesis claims that are *not* ga - `Secret` nominal-opaque graduation (`ROADMAP.md` post-merge-debt section, 2026-04-23 thesis-doc surface) - `Dimension` typed value wrapper with phantom-parameter unit-mismatch enforcement (ibid.) -3. **Substrate prereqs** — named as explicit R2 sub-lanes with **scoped acceptance criteria** (sufficient-to-unblock, not full-capability). Each prereq is pinned to a specific R2 consumer (Goal 2 items + the tokenizer charclass closure inherited from R1); full substrate-capability lanes retain open design calls that may predate or postdate R2, and this structure does not commit R2 to close them all: +3. **Substrate prereqs** — named as explicit R2 sub-lanes with **scoped acceptance criteria** (sufficient-to-unblock, not full-capability). Each prereq is pinned to a specific R2 consumer (Goal 2 items + the tokenizer charclass closure inherited from R1 per the named exception in *"Lanes deliberately absent"* below); full substrate-capability lanes retain open design calls that may predate or postdate R2, and this structure does not commit R2 to close them all: - **Cardinality-substrate subset sufficient to close int-literal magnitude refinement** — enough cardinality modeling to let `IntLit` carry a magnitude that narrows to target int algebra at reconciliation. Consumer: T-Modeling int-lit (Goal 2). Does NOT commit to the full cardinality-substrate capability (fixed-width-types by-construction, container cardinality bounds in Grounding, etc. — those remain open design calls outside R2 scope unless additional R2 items demand them). - **Nominal-opaque substrate sufficient to graduate `Secret`** — enough nominal-type modeling to carry construction-restriction (`where only X may construct`) semantics. Consumer: T-Modeling Secret (Goal 2). Adjacent to DB-11 alias-RHS `where` (landed in R1 via PR #703); may or may not overlap DB-18 territory. Acceptance is `Secret` graduation, not a general nominal-type program. @@ -107,7 +107,9 @@ T-Substrate: cardinality-for-int-lit (subset) ──→ unblocks T-Modeling T-Modeling: int-lit ← T-Substrate cardinality-for-int-lit Secret ← T-Substrate nominal-opaque-for-Secret Dimensions ← T-Substrate parametric-algebra-for-Dimensions -T-CharClassPhase2: tokenizer retype to Char/List/CharClass ← T-Substrate ValueBody-list/sum + std.unicode-bootstrap +Tokenizer charclass phase-2 (consumer of T-Substrate's 4th subset; not a peer lane — + consumed inside T-Substrate scope, deliverable owned by tokenizer code): + retype to Char / List / CharClass ← T-Substrate ValueBody-list/sum + std.unicode-bootstrap T-ImpossibleBugs: 3 independent classes (any worker) T-PerMethodMetadata: §6a pick (any worker; independent) (Goal 6 demo artifacts ship with each lane's closure PR — not a From 971ac4421899ce91f3b996c201c45b87a607a900 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 20:18:49 -0400 Subject: [PATCH 12/20] WIP: gunbc Director --- docs/r2-structure.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/r2-structure.md b/docs/r2-structure.md index 21d1c3f9ad7..8dab9759dea 100644 --- a/docs/r2-structure.md +++ b/docs/r2-structure.md @@ -116,7 +116,7 @@ T-PerMethodMetadata: §6a pick (any worker; independent) separate dependency-DAG node; see Demo discipline section.) ``` -Parallel-capable work at any time: Grounding has 2 fill slots (Python, Go) alongside its critical path; Director dispatch has 3 T-Substrate sub-lanes + 3 T-Modeling items (each pair-blocked) + 3 T-ImpossibleBugs classes + 1 T-PerMethodMetadata pick, for roughly 7–10 slots depending on T-Substrate unblock timing. +Parallel-capable work at any time: Grounding has 2 fill slots (Python, Go) alongside its critical path; Director dispatch has 4 T-Substrate sub-lanes (3 T-Modeling unblocks + 1 tokenizer-charclass unblock) + 3 T-Modeling items (each pair-blocked) + 1 tokenizer-charclass deliverable (pair-blocked on the 4th T-Substrate sub-lane) + 3 T-ImpossibleBugs classes + 1 T-PerMethodMetadata pick, for roughly 8–12 slots depending on T-Substrate unblock timing. ## R1 closure criteria From 7c434cc1669617c99f434cc309edce3035ca1de4 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 21:30:50 -0400 Subject: [PATCH 13/20] WIP: gunbc Director --- docs/design-pure-bootstrap-zero.md | 192 +++++++++++++++++++++++++++++ 1 file changed, 192 insertions(+) create mode 100644 docs/design-pure-bootstrap-zero.md diff --git a/docs/design-pure-bootstrap-zero.md b/docs/design-pure-bootstrap-zero.md new file mode 100644 index 00000000000..cfcb604e52b --- /dev/null +++ b/docs/design-pure-bootstrap-zero.md @@ -0,0 +1,192 @@ +# Pure Bootstrap to Zero — Design Proposal + +**Status:** `PROPOSAL` — supersedes the ≤5-floor framing in [`docs/design-pure-bootstrap.md`](design-pure-bootstrap.md) and the 2-3 principled-floor framing in [PR #756](https://github.com/gunb-ai/gunbc/pull/756) on promotion. Until then, this doc is the proposed direction; `design-pure-bootstrap.md` remains the live authority. + +## Frame + +**Goal: zero hand-authored files in v3's source tree.** Better than v2's 1-residual. + +The ≤5-floor target was a sizing convenience masquerading as an architectural lower bound. Auditing the 35 files currently in `EXPECTED_HAND_AUTHORED_NON_TEST` shows the "irreducible" tier (build.rs, bootstrap.rs, lib.rs, dag.rs, dag/ports.rs, dag/effects.rs) isn't structurally irreducible — it's just not-yet-migrated substrate authoring. Each of those files can be generated from a `.dag` authority, with the same pattern v3's other generated files already use. + +Zero is achievable. v2 proved the cycle (1 residual was a TESTING.md choice, not a structural limit). v3's substrate is more structural than v2's (lens-as-substrate-declaration, types-as-data, programs-as-data) — so v3 should hit a tighter floor than v2. + +## Design choice — shape (γ) + +Three escalating shapes were considered: + +- **(α)** PB-1's current scope: data-bootstrap of DAG, hand-Rust everything else. Floor ~6-8. +- **(β)** Bootstrap process modeled in `.dag` + a small hand-Rust universal evaluator. Floor ~1-2. +- **(γ)** Substrate, evaluator, and bootstrap process all data. The compiled binary is fully generated; the host runtime (or the build trampoline) is the only thing not in v3's source tree. Floor: 0. + +**This proposal commits to (γ).** Rationale: + +- (β) is a bridge that gets dissolved into (γ); writing the bridge first is wasted work unless mandatory. It's not mandatory — see "First-time bootstrap" below. +- (γ) matches the thesis claim that the substrate is its own subject ([`docs/thesis/self-inspection.md`](thesis/self-inspection.md)). Hand-authored files in v3's source tree contradict that claim at the implementation layer. +- The runtime requirements for (γ) (a small generated evaluator + Cargo trampoline) are themselves generatable. There's no architectural reason to author them by hand. + +## Bootstrap as data — the conceptual core + +The current model: bootstrap is a *process* implemented in hand-Rust (`bootstrap.rs::Dag::new()`) that loads `.dag` source, runs the compiler pipeline, populates a `Dag`. The chicken-egg is "Dag::new() needs the compiler pipeline, which needs Dag::new()." + +The (γ) model: **bootstrap is data.** A `bootstrap.dag` (or equivalent authority) declares: +- Which `.dag` files load in which order +- What state the loaded `Dag` should reach +- What invariants must hold post-load +- What the entry point evaluates to + +The "evaluator" is a small generic interpreter that: +- Reads the bootstrap data +- Constructs the `Dag` +- Hands it to the rest of the compiler (also data) +- Runs `main` (also data) + +The evaluator is itself generated from a `.dag` authority that describes its operations. Per `feedback_compiler_is_dag_processor`: the compiler knows only Node / Conj / Disj / Cardinality / Bit. The evaluator therefore needs only those primitive operations — small. + +**The chicken-egg breaks at the build step**, not at runtime: the previous-generation binary reads the new bootstrap data and emits the new evaluator binary. Same cycle v2 used, applied recursively to the evaluator itself. + +## First-time bootstrap (the genuine N=0 problem) + +Even (γ) has a first-time bootstrap problem: the very first compiled binary has to come from somewhere. + +Three resolutions, in increasing aggressiveness: + +1. **Shipped pre-built binary.** The "first" binary is a release artifact (downloaded via install script, embedded in a published crate, or shipped as a release asset on GitHub). Subsequent bootstraps regenerate from source. Hand-Rust in v3's source tree: 0. Hand-Rust elsewhere (in the install script or release tooling): negligible / not part of v3. + +2. **Universal-runtime crate.** A tiny `gunbc-runtime` crate (published separately, not in v3's source tree) provides the generic evaluator. v3's source tree is `.dag` files + a generated Cargo.toml that depends on `gunbc-runtime`. The runtime crate is hand-authored, but **outside v3's source tree** (cleanly factored as runtime support, not compiler). + +3. **Procedural macro on existing rustc.** A `#[gunbc::data]` attribute (in a tiny crate) tells rustc to interpret the `.dag` content at compile time. Same shape as 2 but different boundary — the macro is the runtime; the rest is data. + +All three give **0 hand-Rust in v3's source tree.** Resolution choice is downstream of taste + ecosystem strategy; doesn't affect the in-tree floor. + +For this proposal: the in-tree floor target is 0 regardless of which N=0 resolution lands. Pick the resolution as a separate decision; it doesn't gate the migration program. + +## Subsumed lanes + +Existing lanes that fold into this program: + +- **PB-1** ([brief](briefs/pb-1-data-driven-bootstrap.md), XXL) — data-driven bootstrap loader. **Non-goals revised:** PB-1's current non-goals (don't delete tokenize/parse/lower/infer/emit; don't go binary-blob; don't change Dag runtime format) were appropriate for the ≤5-floor framing but contradict 0-floor. Under this proposal they invert: PB-1 is the first phase of a chain that ends with all of those files generated. +- **PB-4** (lower) — generate `lower.rs` from `lower.dag`. SG-3 series + lower.dag authority required. +- **PB-5** (infer) — generate `infer.rs` from `infer.dag`. SG-4 dispatch. +- **PB-6** (emit) — generate `emit.rs` + emit targets from spec authorities (`rust.dag`, `python.dag`, `go.dag`). Lane 1e dependency. + +Existing scope from `design-pure-bootstrap.md` continues to apply for the file-by-file work, just with a tighter target. + +## New lanes + +**PB-Substrate** (new, sized M-L) — generate `dag.rs`, `dag/ports.rs`, `dag/effects.rs` from `src/v3/std/substrate.dag`. The substrate type definitions become data; the Rust types are emitted from them. Cementing test: generated Rust matches the structural facts the substrate model declares. + +**PB-Lib + PB-Build** (subsumes PB-8 aspiration, sized M) — generate `lib.rs` (module declarations + crate exports) and `build.rs` (Cargo build script content) from emit authority. Both files become trampolines that `include!()` generated content from `OUT_DIR`, or vanish entirely if Cargo can be told to look elsewhere. + +**PB-Runtime** (new, sized M-L) — generate `test_runner.rs`, `lens_apply.rs`, `lens_testgen.rs`, `post_emit_verifier.rs` from `.dag` authorities. The "test runner" and "lens evaluator" become data + a tiny generic interpreter. + +**PB-Bootstrap-Process** (new, sized M, the conceptual core) — author `bootstrap.dag` describing the bootstrap workflow as data. Replace `bootstrap.rs` with a generated trampoline. Section "Bootstrap as data" above is its design. + +**PB-Workflow** (existing scope continued) — `workflow_idempotency.rs` and `workflow_parallelism.rs` migrate as Lane 2 dissolution lands. + +**PB-Tier1-Sweep** (per-file fast-retire, sized S each) — depends on above. The 13 Tier-1 files (regen binaries + bin helpers) retire as their backing migrations land. Not blocked on PB-Substrate / PB-Lib / etc., but blocked on PB-1 + PB-4/5/6. + +## TESTING.md rewrite (sibling PR) + +Current `TESTING.md` carves out two permanent Rust-authored test categories: +- Compiler-internal unit tests for Rust-only helpers +- External-toolchain boundary tests (rustc/go/python invocations) + +Both dissolve under 0-floor: + +- **Rust-only-helper unit tests** vanish naturally — there are no Rust-only helpers; everything generates from `.dag`. +- **External-toolchain boundary tests** migrate to `ExecuteCommand`-based `.dag` `TestClaim` declarations (the predicate landed in PR #678; runner support landed in #688/#741). A `TestClaim` like *"emit Rust, invoke rustc on output, check exit code"* is structurally identical to today's hand-Rust boundary tests. + +**TESTING.md rewrite scope:** +- Replace "Post-R2 shape" residual section with "0-residual" framing +- Reference `ExecuteCommand` predicate as the migration path +- Update authority list + +This rewrite is a sibling PR to the design doc — same author (Director or PM), separate land cycle. Could bundle, but TESTING.md is a foundational doc commitment worth its own discussion. + +## Acceptance gates + +R2 / future release acceptance for this program: + +- `EXPECTED_HAND_AUTHORED_NON_TEST` count = 0 +- `EXPECTED_HAND_AUTHORED_TEST` count = 0 +- TESTING.md "Post-R2 shape" residual rewritten to 0-residual +- DB-8 `self_host_fixed_point` converges bit-identically (the no-compromise gate; same as PB-1's) +- Compile cycle still produces a working binary (regen → rustc → run → diff fixed-point) +- All `[ext]` test predicates evaluate against generated authorities +- `bootstrap.dag` declares the bootstrap workflow + first-time bootstrap resolution explicitly + +## Dependency DAG + +``` +PB-Substrate ────────────────┐ + ├──→ enables PB-Lib + PB-Build +PB-1 (data-driven loader) ───┤ (emit Rust files from .dag = generic capability) + │ +PB-4 (lower) ┐ ├──→ enables PB-Bootstrap-Process +PB-5 (infer) ├──→ generic │ (compiler in .dag → bootstrap can be in .dag too) +PB-6 (emit) ┘ .dag │ + compiler │ + │ +PB-Runtime ──────────────────┤ + (test_runner, lens_apply │ + in .dag) │ + │ +PB-Workflow (Lane 2 dissolution) + │ +PB-Tier1-Sweep (per-file ──┘ + retirement; depends on + above-listed migrations) +``` + +**Parallelization:** PB-Substrate, PB-1 (sub-lanes), PB-4, PB-5, PB-6, PB-Runtime, PB-Workflow are all parallel-capable Day-1. PB-Lib + PB-Build is parallel after PB-Substrate's pattern is proven. PB-Bootstrap-Process is parallel after PB-1 + PB-4/5/6 (needs the full compiler in .dag to bootstrap from). PB-Tier1-Sweep is per-file fast-retire after each backing migration lands. + +**Worker capacity:** 6-8 parallel workers can productively dispatch against this DAG without coordination collisions, given the substrate.dag / SG-0 census is the only shared-edit hotspot (each PR removes one entry). Higher worker count = more rebase churn on `sg0_census_test.rs`; lower count = longer wall clock. + +## STOP-AND-ESCALATE + +Inherits from `design-pure-bootstrap.md` + PB-1 brief, plus: + +- **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). If it can't, the 0-floor target is unreachable and the framing needs revision back toward (β). +- **If the universal evaluator turns out to need substrate operations beyond Node / Conj / Disj / Cardinality / Bit** — STOP. The bounded-kernel invariant is load-bearing; expanding it to make (γ) work is wrong. +- **If TESTING.md rewrite reveals test categories that genuinely cannot express in `ExecuteCommand`-based `.dag`** — STOP. May indicate a `TestClaim` predicate gap that's its own substrate work. Surface before forcing the migration. + +## Non-goals + +- **Not picking the N=0 resolution shape in this doc** — three options (shipped binary / runtime crate / rustc macro) are scoped above; pick separately. Doesn't gate migration. +- **Not authoring the program structure as ROADMAP lanes** — this is the design doc; the ROADMAP lane structure is a separate sibling that PM authors when this doc lands. +- **Not committing to a release boundary** — whether 0-floor lands in R2, "before R2 finishes," or a separately-named program is a director call. Per user direction: "needs to finish before R2 finishes, that's all I care." + +## Open calls + +### 1. Cargo conventions vs zero-source-tree + +Cargo expects `Cargo.toml` + `src/lib.rs` (or `src/main.rs`) at fixed paths. Even if these are 1-line trampolines that `include!()` generated content, they're physical files in the source tree. Two readings: + +- **(a) Trampolines count as 0** because their content is generated; the file is just a path-binding for Cargo. Pragmatic; matches "what's in version control" rather than "what's on disk." +- **(b) Trampolines count as N**, where N is the number of trampoline files Cargo conventionally requires. Stricter; floor is N (probably 1-3). + +For this proposal: **trampolines are 0 if their content is generated.** The user's stated goal is "0 hand-authored files" — a 1-line `include!()` trampoline that's itself emitted from a `.dag` authority is generated, not hand-authored. Cargo's path constraint is an environment convention, not v3's source-tree commitment. + +### 2. v3's first hand-Rust file: who owns it during transition? + +During the migration (PB-1 → PB-Substrate → ... → 0), v3 will have a shrinking-but-nonzero hand-Rust count. SG-0 census tracks this. Two questions: + +- Who declares "v3 has reached 0"? Director, on the closure declaration PR. +- What if a migration regresses (introduces a new hand-Rust file)? STOP-AND-ESCALATE; the ratchet only goes down. + +### 3. Bundling vs separating TESTING.md rewrite + +TESTING.md rewrite is structurally separable from the design doc. Bundling: faster, atomic. Separating: cleaner authority layering, easier review. + +Director (you / me) calls. PM may have a preference based on review bandwidth. + +## Cross-refs + +- Existing parent: [`docs/design-pure-bootstrap.md`](design-pure-bootstrap.md) — supersedes the ≤5-floor framing on this doc's promotion. +- Subsumed brief: [`docs/briefs/pb-1-data-driven-bootstrap.md`](briefs/pb-1-data-driven-bootstrap.md) — non-goals revised under the 0-floor target. +- Thesis claim: [`docs/thesis/self-inspection.md`](thesis/self-inspection.md) — "the substrate is its own subject"; this proposal makes that claim load-bearing at the implementation layer (no hand-Rust contradicts the claim). +- Related fixed-point ratchet: `DB-8` — the no-compromise convergence gate. +- TESTING residual authority: `TESTING.md §"Post-R2 shape"` — sibling PR rewrites this section to 0-residual. +- ROADMAP T-PB-A row at `:53` — needs amendment when this proposal lands (acceptance target shifts from ≤5 to 0). +- R2 structure at `docs/r2-structure.md` — "Lanes deliberately absent" section's T-ShimFloor entry needs amendment if this program lands as R2 scope or as a separately-named program. +- Floor-target precedent: PR #756 introduced "2-3 principled floor" framing — gets superseded by 0 under this proposal. From 039f2355460d7696bd67b4a5b5a221a092bbbd7e Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 21:33:50 -0400 Subject: [PATCH 14/20] WIP: gunbc Director --- docs/design-pure-bootstrap-zero.md | 192 ----------------------------- 1 file changed, 192 deletions(-) delete mode 100644 docs/design-pure-bootstrap-zero.md diff --git a/docs/design-pure-bootstrap-zero.md b/docs/design-pure-bootstrap-zero.md deleted file mode 100644 index cfcb604e52b..00000000000 --- a/docs/design-pure-bootstrap-zero.md +++ /dev/null @@ -1,192 +0,0 @@ -# Pure Bootstrap to Zero — Design Proposal - -**Status:** `PROPOSAL` — supersedes the ≤5-floor framing in [`docs/design-pure-bootstrap.md`](design-pure-bootstrap.md) and the 2-3 principled-floor framing in [PR #756](https://github.com/gunb-ai/gunbc/pull/756) on promotion. Until then, this doc is the proposed direction; `design-pure-bootstrap.md` remains the live authority. - -## Frame - -**Goal: zero hand-authored files in v3's source tree.** Better than v2's 1-residual. - -The ≤5-floor target was a sizing convenience masquerading as an architectural lower bound. Auditing the 35 files currently in `EXPECTED_HAND_AUTHORED_NON_TEST` shows the "irreducible" tier (build.rs, bootstrap.rs, lib.rs, dag.rs, dag/ports.rs, dag/effects.rs) isn't structurally irreducible — it's just not-yet-migrated substrate authoring. Each of those files can be generated from a `.dag` authority, with the same pattern v3's other generated files already use. - -Zero is achievable. v2 proved the cycle (1 residual was a TESTING.md choice, not a structural limit). v3's substrate is more structural than v2's (lens-as-substrate-declaration, types-as-data, programs-as-data) — so v3 should hit a tighter floor than v2. - -## Design choice — shape (γ) - -Three escalating shapes were considered: - -- **(α)** PB-1's current scope: data-bootstrap of DAG, hand-Rust everything else. Floor ~6-8. -- **(β)** Bootstrap process modeled in `.dag` + a small hand-Rust universal evaluator. Floor ~1-2. -- **(γ)** Substrate, evaluator, and bootstrap process all data. The compiled binary is fully generated; the host runtime (or the build trampoline) is the only thing not in v3's source tree. Floor: 0. - -**This proposal commits to (γ).** Rationale: - -- (β) is a bridge that gets dissolved into (γ); writing the bridge first is wasted work unless mandatory. It's not mandatory — see "First-time bootstrap" below. -- (γ) matches the thesis claim that the substrate is its own subject ([`docs/thesis/self-inspection.md`](thesis/self-inspection.md)). Hand-authored files in v3's source tree contradict that claim at the implementation layer. -- The runtime requirements for (γ) (a small generated evaluator + Cargo trampoline) are themselves generatable. There's no architectural reason to author them by hand. - -## Bootstrap as data — the conceptual core - -The current model: bootstrap is a *process* implemented in hand-Rust (`bootstrap.rs::Dag::new()`) that loads `.dag` source, runs the compiler pipeline, populates a `Dag`. The chicken-egg is "Dag::new() needs the compiler pipeline, which needs Dag::new()." - -The (γ) model: **bootstrap is data.** A `bootstrap.dag` (or equivalent authority) declares: -- Which `.dag` files load in which order -- What state the loaded `Dag` should reach -- What invariants must hold post-load -- What the entry point evaluates to - -The "evaluator" is a small generic interpreter that: -- Reads the bootstrap data -- Constructs the `Dag` -- Hands it to the rest of the compiler (also data) -- Runs `main` (also data) - -The evaluator is itself generated from a `.dag` authority that describes its operations. Per `feedback_compiler_is_dag_processor`: the compiler knows only Node / Conj / Disj / Cardinality / Bit. The evaluator therefore needs only those primitive operations — small. - -**The chicken-egg breaks at the build step**, not at runtime: the previous-generation binary reads the new bootstrap data and emits the new evaluator binary. Same cycle v2 used, applied recursively to the evaluator itself. - -## First-time bootstrap (the genuine N=0 problem) - -Even (γ) has a first-time bootstrap problem: the very first compiled binary has to come from somewhere. - -Three resolutions, in increasing aggressiveness: - -1. **Shipped pre-built binary.** The "first" binary is a release artifact (downloaded via install script, embedded in a published crate, or shipped as a release asset on GitHub). Subsequent bootstraps regenerate from source. Hand-Rust in v3's source tree: 0. Hand-Rust elsewhere (in the install script or release tooling): negligible / not part of v3. - -2. **Universal-runtime crate.** A tiny `gunbc-runtime` crate (published separately, not in v3's source tree) provides the generic evaluator. v3's source tree is `.dag` files + a generated Cargo.toml that depends on `gunbc-runtime`. The runtime crate is hand-authored, but **outside v3's source tree** (cleanly factored as runtime support, not compiler). - -3. **Procedural macro on existing rustc.** A `#[gunbc::data]` attribute (in a tiny crate) tells rustc to interpret the `.dag` content at compile time. Same shape as 2 but different boundary — the macro is the runtime; the rest is data. - -All three give **0 hand-Rust in v3's source tree.** Resolution choice is downstream of taste + ecosystem strategy; doesn't affect the in-tree floor. - -For this proposal: the in-tree floor target is 0 regardless of which N=0 resolution lands. Pick the resolution as a separate decision; it doesn't gate the migration program. - -## Subsumed lanes - -Existing lanes that fold into this program: - -- **PB-1** ([brief](briefs/pb-1-data-driven-bootstrap.md), XXL) — data-driven bootstrap loader. **Non-goals revised:** PB-1's current non-goals (don't delete tokenize/parse/lower/infer/emit; don't go binary-blob; don't change Dag runtime format) were appropriate for the ≤5-floor framing but contradict 0-floor. Under this proposal they invert: PB-1 is the first phase of a chain that ends with all of those files generated. -- **PB-4** (lower) — generate `lower.rs` from `lower.dag`. SG-3 series + lower.dag authority required. -- **PB-5** (infer) — generate `infer.rs` from `infer.dag`. SG-4 dispatch. -- **PB-6** (emit) — generate `emit.rs` + emit targets from spec authorities (`rust.dag`, `python.dag`, `go.dag`). Lane 1e dependency. - -Existing scope from `design-pure-bootstrap.md` continues to apply for the file-by-file work, just with a tighter target. - -## New lanes - -**PB-Substrate** (new, sized M-L) — generate `dag.rs`, `dag/ports.rs`, `dag/effects.rs` from `src/v3/std/substrate.dag`. The substrate type definitions become data; the Rust types are emitted from them. Cementing test: generated Rust matches the structural facts the substrate model declares. - -**PB-Lib + PB-Build** (subsumes PB-8 aspiration, sized M) — generate `lib.rs` (module declarations + crate exports) and `build.rs` (Cargo build script content) from emit authority. Both files become trampolines that `include!()` generated content from `OUT_DIR`, or vanish entirely if Cargo can be told to look elsewhere. - -**PB-Runtime** (new, sized M-L) — generate `test_runner.rs`, `lens_apply.rs`, `lens_testgen.rs`, `post_emit_verifier.rs` from `.dag` authorities. The "test runner" and "lens evaluator" become data + a tiny generic interpreter. - -**PB-Bootstrap-Process** (new, sized M, the conceptual core) — author `bootstrap.dag` describing the bootstrap workflow as data. Replace `bootstrap.rs` with a generated trampoline. Section "Bootstrap as data" above is its design. - -**PB-Workflow** (existing scope continued) — `workflow_idempotency.rs` and `workflow_parallelism.rs` migrate as Lane 2 dissolution lands. - -**PB-Tier1-Sweep** (per-file fast-retire, sized S each) — depends on above. The 13 Tier-1 files (regen binaries + bin helpers) retire as their backing migrations land. Not blocked on PB-Substrate / PB-Lib / etc., but blocked on PB-1 + PB-4/5/6. - -## TESTING.md rewrite (sibling PR) - -Current `TESTING.md` carves out two permanent Rust-authored test categories: -- Compiler-internal unit tests for Rust-only helpers -- External-toolchain boundary tests (rustc/go/python invocations) - -Both dissolve under 0-floor: - -- **Rust-only-helper unit tests** vanish naturally — there are no Rust-only helpers; everything generates from `.dag`. -- **External-toolchain boundary tests** migrate to `ExecuteCommand`-based `.dag` `TestClaim` declarations (the predicate landed in PR #678; runner support landed in #688/#741). A `TestClaim` like *"emit Rust, invoke rustc on output, check exit code"* is structurally identical to today's hand-Rust boundary tests. - -**TESTING.md rewrite scope:** -- Replace "Post-R2 shape" residual section with "0-residual" framing -- Reference `ExecuteCommand` predicate as the migration path -- Update authority list - -This rewrite is a sibling PR to the design doc — same author (Director or PM), separate land cycle. Could bundle, but TESTING.md is a foundational doc commitment worth its own discussion. - -## Acceptance gates - -R2 / future release acceptance for this program: - -- `EXPECTED_HAND_AUTHORED_NON_TEST` count = 0 -- `EXPECTED_HAND_AUTHORED_TEST` count = 0 -- TESTING.md "Post-R2 shape" residual rewritten to 0-residual -- DB-8 `self_host_fixed_point` converges bit-identically (the no-compromise gate; same as PB-1's) -- Compile cycle still produces a working binary (regen → rustc → run → diff fixed-point) -- All `[ext]` test predicates evaluate against generated authorities -- `bootstrap.dag` declares the bootstrap workflow + first-time bootstrap resolution explicitly - -## Dependency DAG - -``` -PB-Substrate ────────────────┐ - ├──→ enables PB-Lib + PB-Build -PB-1 (data-driven loader) ───┤ (emit Rust files from .dag = generic capability) - │ -PB-4 (lower) ┐ ├──→ enables PB-Bootstrap-Process -PB-5 (infer) ├──→ generic │ (compiler in .dag → bootstrap can be in .dag too) -PB-6 (emit) ┘ .dag │ - compiler │ - │ -PB-Runtime ──────────────────┤ - (test_runner, lens_apply │ - in .dag) │ - │ -PB-Workflow (Lane 2 dissolution) - │ -PB-Tier1-Sweep (per-file ──┘ - retirement; depends on - above-listed migrations) -``` - -**Parallelization:** PB-Substrate, PB-1 (sub-lanes), PB-4, PB-5, PB-6, PB-Runtime, PB-Workflow are all parallel-capable Day-1. PB-Lib + PB-Build is parallel after PB-Substrate's pattern is proven. PB-Bootstrap-Process is parallel after PB-1 + PB-4/5/6 (needs the full compiler in .dag to bootstrap from). PB-Tier1-Sweep is per-file fast-retire after each backing migration lands. - -**Worker capacity:** 6-8 parallel workers can productively dispatch against this DAG without coordination collisions, given the substrate.dag / SG-0 census is the only shared-edit hotspot (each PR removes one entry). Higher worker count = more rebase churn on `sg0_census_test.rs`; lower count = longer wall clock. - -## STOP-AND-ESCALATE - -Inherits from `design-pure-bootstrap.md` + PB-1 brief, plus: - -- **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). If it can't, the 0-floor target is unreachable and the framing needs revision back toward (β). -- **If the universal evaluator turns out to need substrate operations beyond Node / Conj / Disj / Cardinality / Bit** — STOP. The bounded-kernel invariant is load-bearing; expanding it to make (γ) work is wrong. -- **If TESTING.md rewrite reveals test categories that genuinely cannot express in `ExecuteCommand`-based `.dag`** — STOP. May indicate a `TestClaim` predicate gap that's its own substrate work. Surface before forcing the migration. - -## Non-goals - -- **Not picking the N=0 resolution shape in this doc** — three options (shipped binary / runtime crate / rustc macro) are scoped above; pick separately. Doesn't gate migration. -- **Not authoring the program structure as ROADMAP lanes** — this is the design doc; the ROADMAP lane structure is a separate sibling that PM authors when this doc lands. -- **Not committing to a release boundary** — whether 0-floor lands in R2, "before R2 finishes," or a separately-named program is a director call. Per user direction: "needs to finish before R2 finishes, that's all I care." - -## Open calls - -### 1. Cargo conventions vs zero-source-tree - -Cargo expects `Cargo.toml` + `src/lib.rs` (or `src/main.rs`) at fixed paths. Even if these are 1-line trampolines that `include!()` generated content, they're physical files in the source tree. Two readings: - -- **(a) Trampolines count as 0** because their content is generated; the file is just a path-binding for Cargo. Pragmatic; matches "what's in version control" rather than "what's on disk." -- **(b) Trampolines count as N**, where N is the number of trampoline files Cargo conventionally requires. Stricter; floor is N (probably 1-3). - -For this proposal: **trampolines are 0 if their content is generated.** The user's stated goal is "0 hand-authored files" — a 1-line `include!()` trampoline that's itself emitted from a `.dag` authority is generated, not hand-authored. Cargo's path constraint is an environment convention, not v3's source-tree commitment. - -### 2. v3's first hand-Rust file: who owns it during transition? - -During the migration (PB-1 → PB-Substrate → ... → 0), v3 will have a shrinking-but-nonzero hand-Rust count. SG-0 census tracks this. Two questions: - -- Who declares "v3 has reached 0"? Director, on the closure declaration PR. -- What if a migration regresses (introduces a new hand-Rust file)? STOP-AND-ESCALATE; the ratchet only goes down. - -### 3. Bundling vs separating TESTING.md rewrite - -TESTING.md rewrite is structurally separable from the design doc. Bundling: faster, atomic. Separating: cleaner authority layering, easier review. - -Director (you / me) calls. PM may have a preference based on review bandwidth. - -## Cross-refs - -- Existing parent: [`docs/design-pure-bootstrap.md`](design-pure-bootstrap.md) — supersedes the ≤5-floor framing on this doc's promotion. -- Subsumed brief: [`docs/briefs/pb-1-data-driven-bootstrap.md`](briefs/pb-1-data-driven-bootstrap.md) — non-goals revised under the 0-floor target. -- Thesis claim: [`docs/thesis/self-inspection.md`](thesis/self-inspection.md) — "the substrate is its own subject"; this proposal makes that claim load-bearing at the implementation layer (no hand-Rust contradicts the claim). -- Related fixed-point ratchet: `DB-8` — the no-compromise convergence gate. -- TESTING residual authority: `TESTING.md §"Post-R2 shape"` — sibling PR rewrites this section to 0-residual. -- ROADMAP T-PB-A row at `:53` — needs amendment when this proposal lands (acceptance target shifts from ≤5 to 0). -- R2 structure at `docs/r2-structure.md` — "Lanes deliberately absent" section's T-ShimFloor entry needs amendment if this program lands as R2 scope or as a separately-named program. -- Floor-target precedent: PR #756 introduced "2-3 principled floor" framing — gets superseded by 0 under this proposal. From 7db5c913046d3996eba597d0a69461a93fceb1c4 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 21:38:20 -0400 Subject: [PATCH 15/20] WIP: gunbc Director --- docs/design-pure-bootstrap-zero.md | 208 +++++++++++++++++++++++++++++ 1 file changed, 208 insertions(+) create mode 100644 docs/design-pure-bootstrap-zero.md diff --git a/docs/design-pure-bootstrap-zero.md b/docs/design-pure-bootstrap-zero.md new file mode 100644 index 00000000000..6d5f7f51780 --- /dev/null +++ b/docs/design-pure-bootstrap-zero.md @@ -0,0 +1,208 @@ +# Pure Bootstrap to Zero — Design Proposal + +**Status:** `PROPOSAL` — supersedes the ≤5-floor framing in [`docs/design-pure-bootstrap.md`](design-pure-bootstrap.md) and the 2-3 principled-floor framing introduced via [PR #756](https://github.com/gunb-ai/gunbc/pull/756) on promotion. Until then, this doc is the proposed direction; `design-pure-bootstrap.md` remains the live authority. + +### Promotion mechanism + +This doc is PROPOSAL until promoted. **Promotion is a single Director-authored cascade PR** that does **all** of the following atomically (no piecewise promotion — the framing change is load-bearing across multiple authorities and partial promotion would create contradiction): + +- **Who promotes:** Director, after Grounding Manager (R2's standing manager) and at least one R2 substrate-prereq sub-lane have produced stable enough evidence that the (γ) shape is achievable in v3's substrate (i.e., not a paper proposal). +- **What gate:** the cascade PR includes (a) at least one prototyped lane closure proving an existing hand-Rust file can be retired via `.dag` migration without regression, and (b) explicit acknowledgement from PM that the program structure is dispatchable. +- **What retraction:** + - `docs/design-pure-bootstrap.md` updated with a banner pointing at this doc as the new authority; the ≤5-floor framing struck through with explicit retraction language; cross-refs migrated. + - PR #756's "2-3 principled floor" framing similarly retracted in `docs/design-pure-bootstrap.md` with same-PR replacement to "0 floor." + - `ROADMAP.md` T-PB-A row (`:53`) amended to point at the 0-floor target via this doc; the `≤5 irreducible-shim` language struck. + - `docs/r2-structure.md` "Lanes deliberately absent" entry for `T-ShimFloor` updated to reflect the program's new home (R2 absorption or separately-named program — Director call at promotion time). + - `TESTING.md` "Post-R2 shape" residual section either rewritten in this same cascade PR (bundled) or sibling PR landed first (separated). See "TESTING.md rewrite" section below. + - This doc's status banner updated from `PROPOSAL` to `LIVE` with promotion date and citing the cascade PR number. + +If any retraction step can't land in the same PR (e.g., cascading conflicts), promotion blocks; this doc stays `PROPOSAL` until the cascade can be authored atomically. + +## Frame + +**Goal: zero hand-authored files in v3's source tree.** Better than v2's 1-residual. + +The ≤5-floor target was a sizing convenience masquerading as an architectural lower bound. Auditing the 35 files currently in `EXPECTED_HAND_AUTHORED_NON_TEST` shows the "irreducible" tier (build.rs, bootstrap.rs, lib.rs, dag.rs, dag/ports.rs, dag/effects.rs) isn't structurally irreducible — it's just not-yet-migrated substrate authoring. Each of those files can be generated from a `.dag` authority, with the same pattern v3's other generated files already use. + +Zero is achievable. v2 proved the cycle (1 residual was a TESTING.md choice, not a structural limit). v3's substrate is more structural than v2's (lens-as-substrate-declaration, types-as-data, programs-as-data) — so v3 should hit a tighter floor than v2. + +## Design choice — shape (γ) + +Three escalating shapes were considered: + +- **(α)** PB-1's current scope: data-bootstrap of DAG, hand-Rust everything else. Floor ~6-8. +- **(β)** Bootstrap process modeled in `.dag` + a small hand-Rust universal evaluator. Floor ~1-2. +- **(γ)** Substrate, evaluator, and bootstrap process all data. The compiled binary is fully generated; the host runtime (or the build trampoline) is the only thing not in v3's source tree. Floor: 0. + +**This proposal commits to (γ).** Rationale: + +- (β) is a bridge that gets dissolved into (γ); writing the bridge first is wasted work unless mandatory. It's not mandatory — see "First-time bootstrap" below. +- (γ) matches the thesis claim that the substrate is its own subject ([`docs/thesis/self-inspection.md`](thesis/self-inspection.md)). Hand-authored files in v3's source tree contradict that claim at the implementation layer. +- The runtime requirements for (γ) (a small generated evaluator + Cargo trampoline) are themselves generatable. There's no architectural reason to author them by hand. + +## Bootstrap as data — the conceptual core + +The current model: bootstrap is a *process* implemented in hand-Rust (`bootstrap.rs::Dag::new()`) that loads `.dag` source, runs the compiler pipeline, populates a `Dag`. The chicken-egg is "Dag::new() needs the compiler pipeline, which needs Dag::new()." + +The (γ) model: **bootstrap is data.** A `bootstrap.dag` (or equivalent authority) declares: +- Which `.dag` files load in which order +- What state the loaded `Dag` should reach +- What invariants must hold post-load +- What the entry point evaluates to + +The "evaluator" is a small generic interpreter that: +- Reads the bootstrap data +- Constructs the `Dag` +- Hands it to the rest of the compiler (also data) +- Runs `main` (also data) + +The evaluator is itself generated from a `.dag` authority that describes its operations. Per `feedback_compiler_is_dag_processor`: the compiler knows only Node / Conj / Disj / Cardinality / Bit. The evaluator therefore needs only those primitive operations — small. + +**The chicken-egg breaks at the build step**, not at runtime: the previous-generation binary reads the new bootstrap data and emits the new evaluator binary. Same cycle v2 used, applied recursively to the evaluator itself. + +## First-time bootstrap (the genuine N=0 problem) + +Even (γ) has a first-time bootstrap problem: the very first compiled binary has to come from somewhere. + +Three resolutions, in increasing aggressiveness: + +1. **Shipped pre-built binary.** The "first" binary is a release artifact (downloaded via install script, embedded in a published crate, or shipped as a release asset on GitHub). Subsequent bootstraps regenerate from source. Hand-Rust in v3's source tree: 0. Hand-Rust elsewhere (in the install script or release tooling): negligible / not part of v3. + +2. **Universal-runtime crate.** A tiny `gunbc-runtime` crate (published separately, not in v3's source tree) provides the generic evaluator. v3's source tree is `.dag` files + a generated Cargo.toml that depends on `gunbc-runtime`. The runtime crate is hand-authored, but **outside v3's source tree** (cleanly factored as runtime support, not compiler). + +3. **Procedural macro on existing rustc.** A `#[gunbc::data]` attribute (in a tiny crate) tells rustc to interpret the `.dag` content at compile time. Same shape as 2 but different boundary — the macro is the runtime; the rest is data. + +All three give **0 hand-Rust in v3's source tree.** Resolution choice is downstream of taste + ecosystem strategy; doesn't affect the in-tree floor. + +For this proposal: the in-tree floor target is 0 regardless of which N=0 resolution lands. Pick the resolution as a separate decision; it doesn't gate the migration program. + +## Subsumed lanes + +Existing lanes that fold into this program: + +- **PB-1** ([brief](briefs/pb-1-data-driven-bootstrap.md), XXL) — data-driven bootstrap loader. **Non-goals revised:** PB-1's current non-goals (don't delete tokenize/parse/lower/infer/emit; don't go binary-blob; don't change Dag runtime format) were appropriate for the ≤5-floor framing but contradict 0-floor. Under this proposal they invert: PB-1 is the first phase of a chain that ends with all of those files generated. +- **PB-4** (lower) — generate `lower.rs` from `lower.dag`. SG-3 series + lower.dag authority required. +- **PB-5** (infer) — generate `infer.rs` from `infer.dag`. SG-4 dispatch. +- **PB-6** (emit) — generate `emit.rs` + emit targets from spec authorities (`rust.dag`, `python.dag`, `go.dag`). Lane 1e dependency. + +Existing scope from `design-pure-bootstrap.md` continues to apply for the file-by-file work, just with a tighter target. + +## New lanes + +**PB-Substrate** (new, sized M-L) — generate `dag.rs`, `dag/ports.rs`, `dag/effects.rs` from `src/v3/std/substrate.dag`. The substrate type definitions become data; the Rust types are emitted from them. Cementing test: generated Rust matches the structural facts the substrate model declares. + +**PB-Lib + PB-Build** (subsumes PB-8 aspiration, sized M) — generate `lib.rs` (module declarations + crate exports) and `build.rs` (Cargo build script content) from emit authority. Both files become trampolines that `include!()` generated content from `OUT_DIR`, or vanish entirely if Cargo can be told to look elsewhere. + +**PB-Runtime** (new, sized M-L) — generate `test_runner.rs`, `lens_apply.rs`, `lens_testgen.rs`, `post_emit_verifier.rs` from `.dag` authorities. The "test runner" and "lens evaluator" become data + a tiny generic interpreter. + +**PB-Bootstrap-Process** (new, sized M, the conceptual core) — author `bootstrap.dag` describing the bootstrap workflow as data. Replace `bootstrap.rs` with a generated trampoline. Section "Bootstrap as data" above is its design. + +**PB-Workflow** (existing scope continued) — `workflow_idempotency.rs` and `workflow_parallelism.rs` migrate as Lane 2 dissolution lands. + +**PB-Tier1-Sweep** (per-file fast-retire, sized S each) — depends on above. The 13 Tier-1 files (regen binaries + bin helpers) retire as their backing migrations land. Not blocked on PB-Substrate / PB-Lib / etc., but blocked on PB-1 + PB-4/5/6. + +## TESTING.md rewrite (sibling PR or bundled into promotion cascade — Director call) + +Current `TESTING.md` carves out two permanent Rust-authored test categories: +- Compiler-internal unit tests for Rust-only helpers +- External-toolchain boundary tests (rustc/go/python invocations) + +Both dissolve under 0-floor: + +- **Rust-only-helper unit tests** vanish naturally — there are no Rust-only helpers; everything generates from `.dag`. +- **External-toolchain boundary tests** migrate to `ExecuteCommand`-based `.dag` `TestClaim` declarations (the predicate landed in PR #678; runner support landed in #688/#741). A `TestClaim` like *"emit Rust, invoke rustc on output, check exit code"* is structurally identical to today's hand-Rust boundary tests. + +**TESTING.md rewrite scope:** +- Replace "Post-R2 shape" residual section with "0-residual" framing +- Reference `ExecuteCommand` predicate as the migration path +- Update authority list + +The rewrite is structurally separable from this design doc. **Director-call at promotion time** whether to bundle into the promotion cascade or land as a sibling PR first. + +## Acceptance gates + +R2 / future release acceptance for this program: + +- `EXPECTED_HAND_AUTHORED_NON_TEST` count = 0 +- `EXPECTED_HAND_AUTHORED_TEST` count = 0 +- TESTING.md "Post-R2 shape" residual rewritten to 0-residual +- DB-8 `self_host_fixed_point` converges bit-identically (the no-compromise gate; same as PB-1's) +- Compile cycle still produces a working binary (regen → rustc → run → diff fixed-point) +- All `[ext]` test predicates evaluate against generated authorities +- `bootstrap.dag` declares the bootstrap workflow + first-time bootstrap resolution explicitly + +## Dependency DAG + +``` +PB-Substrate ────────────────┐ + ├──→ enables PB-Lib + PB-Build +PB-1 (data-driven loader) ───┤ (emit Rust files from .dag = generic capability) + │ +PB-4 (lower) ┐ ├──→ enables PB-Bootstrap-Process +PB-5 (infer) ├──→ generic │ (compiler in .dag → bootstrap can be in .dag too) +PB-6 (emit) ┘ .dag │ + compiler │ + │ +PB-Runtime ──────────────────┤ + (test_runner, lens_apply │ + in .dag) │ + │ +PB-Workflow (Lane 2 dissolution) + │ +PB-Tier1-Sweep (per-file ──┘ + retirement; depends on + above-listed migrations) +``` + +**Parallelization:** PB-Substrate, PB-1 (sub-lanes), PB-4, PB-5, PB-6, PB-Runtime, PB-Workflow are all parallel-capable Day-1. PB-Lib + PB-Build is parallel after PB-Substrate's pattern is proven. PB-Bootstrap-Process is parallel after PB-1 + PB-4/5/6 (needs the full compiler in .dag to bootstrap from). PB-Tier1-Sweep is per-file fast-retire after each backing migration lands. + +**Worker capacity:** 6-8 parallel workers can productively dispatch against this DAG without coordination collisions, given the substrate.dag / SG-0 census is the only shared-edit hotspot (each PR removes one entry). Higher worker count = more rebase churn on `sg0_census_test.rs`; lower count = longer wall clock. + +## STOP-AND-ESCALATE + +Inherits from `design-pure-bootstrap.md` + PB-1 brief, plus: + +- **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). If it can't, the 0-floor target is unreachable and the framing needs revision back toward (β). +- **If the universal evaluator turns out to need substrate operations beyond Node / Conj / Disj / Cardinality / Bit** — STOP. The bounded-kernel invariant is load-bearing; expanding it to make (γ) work is wrong. +- **If TESTING.md rewrite reveals test categories that genuinely cannot express in `ExecuteCommand`-based `.dag`** — STOP. May indicate a `TestClaim` predicate gap that's its own substrate work. Surface before forcing the migration. + +## Non-goals + +- **Not picking the N=0 resolution shape in this doc** — three options (shipped binary / runtime crate / rustc macro) are scoped above; pick separately. Doesn't gate migration. +- **Not authoring the program structure as ROADMAP lanes** — this is the design doc; the ROADMAP lane structure is a separate sibling that PM authors when this doc lands. +- **Not committing to a release boundary** — whether 0-floor lands in R2, "before R2 finishes," or a separately-named program is a director call. Per user direction: "needs to finish before R2 finishes, that's all I care." + +## Open calls + +### 1. Cargo conventions vs zero-source-tree + +Cargo expects `Cargo.toml` + `src/lib.rs` (or `src/main.rs`) at fixed paths. Even if these are 1-line trampolines that `include!()` generated content, they're physical files in the source tree. Two readings: + +- **(a) Trampolines count as 0** because their content is generated; the file is just a path-binding for Cargo. Pragmatic; matches "what's in version control" rather than "what's on disk." +- **(b) Trampolines count as N**, where N is the number of trampoline files Cargo conventionally requires. Stricter; floor is N (probably 1-3). + +For this proposal: **trampolines are 0 if their content is generated.** The user's stated goal is "0 hand-authored files" — a 1-line `include!()` trampoline that's itself emitted from a `.dag` authority is generated, not hand-authored. Cargo's path constraint is an environment convention, not v3's source-tree commitment. + +### 2. v3's first hand-Rust file: who owns it during transition? + +During the migration (PB-1 → PB-Substrate → ... → 0), v3 will have a shrinking-but-nonzero hand-Rust count. SG-0 census tracks this. Two questions: + +- Who declares "v3 has reached 0"? Director, on the closure declaration PR. +- What if a migration regresses (introduces a new hand-Rust file)? STOP-AND-ESCALATE; the ratchet only goes down. + +### 3. Bundling vs separating TESTING.md rewrite + +TESTING.md rewrite is structurally separable from the design doc. Bundling: faster, atomic. Separating: cleaner authority layering, easier review. + +Director (you / me) calls. PM may have a preference based on review bandwidth. + +## Cross-refs + +- Existing parent: [`docs/design-pure-bootstrap.md`](design-pure-bootstrap.md) — supersedes the ≤5-floor framing on this doc's promotion (see Promotion mechanism above for the cascade requirement). +- Subsumed brief: [`docs/briefs/pb-1-data-driven-bootstrap.md`](briefs/pb-1-data-driven-bootstrap.md) — non-goals revised under the 0-floor target. +- Thesis claim: [`docs/thesis/self-inspection.md`](thesis/self-inspection.md) — "the substrate is its own subject"; this proposal makes that claim load-bearing at the implementation layer (no hand-Rust contradicts the claim). +- Related fixed-point ratchet: `DB-8` — the no-compromise convergence gate. +- TESTING residual authority: `TESTING.md §"Post-R2 shape"` — sibling PR or bundled cascade rewrites this section to 0-residual. +- ROADMAP T-PB-A row at `:53` — amended in promotion cascade (acceptance target shifts from ≤5 to 0). +- R2 structure at `docs/r2-structure.md` — "Lanes deliberately absent" T-ShimFloor entry amended in promotion cascade (program either absorbed into R2 or separately-named). +- Floor-target precedent: PR #756 introduced "2-3 principled floor" framing — gets superseded by 0 under this proposal; retraction happens in promotion cascade. From 1e2d40c4dae94ddde349567fa900fbfbd5ebfc58 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 21:42:50 -0400 Subject: [PATCH 16/20] WIP: gunbc Director --- docs/design-pure-bootstrap-zero.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/design-pure-bootstrap-zero.md b/docs/design-pure-bootstrap-zero.md index 6d5f7f51780..da2709ee7ea 100644 --- a/docs/design-pure-bootstrap-zero.md +++ b/docs/design-pure-bootstrap-zero.md @@ -18,6 +18,14 @@ This doc is PROPOSAL until promoted. **Promotion is a single Director-authored c If any retraction step can't land in the same PR (e.g., cascading conflicts), promotion blocks; this doc stays `PROPOSAL` until the cascade can be authored atomically. +### Pre-promotion deliverables + +These are assertions in this PROPOSAL whose empirical backing must surface in the promotion cascade PR (or in sibling PRs landed before promotion). Naming them explicitly so the cascade PR's reviewer can verify each before the framing change is locked: + +- **35-file audit table** — the §"Frame" claim that the "irreducible tier" (build.rs, bootstrap.rs, lib.rs, dag.rs, dag/ports.rs, dag/effects.rs) isn't structurally irreducible needs an inline table mapping each of the 35 `EXPECTED_HAND_AUTHORED_NON_TEST` entries to (a) why it's currently hand-authored, (b) which migration path retires it (PB-Substrate / PB-1 / PB-4 / PB-5 / PB-6 / PB-Lib+Build / PB-Runtime / PB-Bootstrap-Process / PB-Tier1-Sweep). Goes in the promotion cascade PR. +- **PB-1 brief amendment** — `docs/briefs/pb-1-data-driven-bootstrap.md`'s non-goals (don't delete tokenize/parse/lower/infer/emit; don't go binary-blob; don't change Dag runtime format) invert under 0-floor. The brief must be amended in the promotion cascade PR (not silently after) so PB-1's downstream consumers see the revised scope. +- **TESTING.md "Post-R2 shape" rewrite** — Director-call at promotion time on bundle-vs-sibling per §"TESTING.md rewrite" below; either way, must be authored before this PROPOSAL flips to LIVE. + ## Frame **Goal: zero hand-authored files in v3's source tree.** Better than v2's 1-residual. From 309ea71543e0d1d0a6c75edb48a9ddcdc4ee6f47 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 21:45:50 -0400 Subject: [PATCH 17/20] WIP: gunbc Director --- docs/design-pure-bootstrap-zero.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/design-pure-bootstrap-zero.md b/docs/design-pure-bootstrap-zero.md index da2709ee7ea..92507574634 100644 --- a/docs/design-pure-bootstrap-zero.md +++ b/docs/design-pure-bootstrap-zero.md @@ -105,6 +105,13 @@ Existing scope from `design-pure-bootstrap.md` continues to apply for the file-b **PB-Bootstrap-Process** (new, sized M, the conceptual core) — author `bootstrap.dag` describing the bootstrap workflow as data. Replace `bootstrap.rs` with a generated trampoline. Section "Bootstrap as data" above is its design. + **N=0 runtime boundary verification (per codex `7db5c913` review).** Whichever N=0 resolution lands (shipped binary / `gunbc-runtime` crate / rustc proc-macro), the runtime must be a *generic fixed-point substrate runner* — not hand-authored compiler logic relocated out of v3's source tree. Verification gates that PB-Bootstrap-Process must satisfy: + - **Operation set bounded.** The runtime invokes only the primitive substrate operations (Node / Conj / Disj / Cardinality / Bit per `feedback_compiler_is_dag_processor`) — no compiler-pass logic (no tokenize, no parse, no infer, no lower, no emit) lives in the runtime. If the runtime needs to do any of those, it does so by invoking generated `.dag` programs, not by carrying their logic. + - **Size budget.** A specific LOC ceiling on the runtime (target: <500 LOC of hand-Rust outside v3's tree, modulo language-stdlib-equivalent primitives). If the runtime grows past the budget, it's a signal that compiler authority leaked out. + - **Substrate-runner equivalence test.** A generic-substrate-runner test: feed the runtime a `.dag` program that's structurally equivalent to but textually different from v3's compiler.dag, verify the runtime evaluates it identically. This proves the runtime is generic over `.dag` programs, not specialized to v3's compiler. + + These verification gates land in PB-Bootstrap-Process's acceptance criteria; the promotion cascade PR cites the test results. + **PB-Workflow** (existing scope continued) — `workflow_idempotency.rs` and `workflow_parallelism.rs` migrate as Lane 2 dissolution lands. **PB-Tier1-Sweep** (per-file fast-retire, sized S each) — depends on above. The 13 Tier-1 files (regen binaries + bin helpers) retire as their backing migrations land. Not blocked on PB-Substrate / PB-Lib / etc., but blocked on PB-1 + PB-4/5/6. From de6401195c8d0e54ac89c59feb0cb433864b0866 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 22:00:51 -0400 Subject: [PATCH 18/20] WIP: gunbc Director --- docs/briefs/pure-bootstrap-zero-manager.md | 365 +++++++++++++++++++++ 1 file changed, 365 insertions(+) create mode 100644 docs/briefs/pure-bootstrap-zero-manager.md diff --git a/docs/briefs/pure-bootstrap-zero-manager.md b/docs/briefs/pure-bootstrap-zero-manager.md new file mode 100644 index 00000000000..90ff8c2d928 --- /dev/null +++ b/docs/briefs/pure-bootstrap-zero-manager.md @@ -0,0 +1,365 @@ +# Pure Bootstrap to Zero Manager Brief + +**Status:** `PROPOSAL` — pending cascade promotion of +[`docs/design-pure-bootstrap-zero.md`](../design-pure-bootstrap-zero.md) +(in PROPOSAL on main as of #762). Until that cascade lands, this +brief is the manager's scope-in-preparation; it does not dispatch +work formally. Pre-promotion deliverables (audit table + PB-1 +brief amendment + first prototyped lane closure) are the manager's +first work and gate the cascade. + +**Naming clarity.** This is the **Pure Bootstrap to Zero Program +Manager**. The program is **parallel to R2**, not part of R2. Per +the locked Strong Post-R2 stance ([`docs/r2-structure.md`](../r2-structure.md) +Decisions locked), R2 = thesis close with Grounding Completeness +as single co-anchor. Zero-floor is implementation completeness — +making the codebase match the thesis at the file-count level. Two +distinct concerns; two parallel programs; do not conflate. + +The release-ledger placement of this program (R2 absorption / +separately-named program / under Director closure) is **deferred +to the cascade promotion PR** per the design doc's Promotion +mechanism. Until then: program runs structurally without +committing to a release-ledger label. + +## Orient before reading + +- **Program scope authority:** [`docs/design-pure-bootstrap-zero.md`](../design-pure-bootstrap-zero.md) + (PROPOSAL). Names goals (γ shape, bootstrap-as-data, 0 hand-Rust + in v3 source tree), lane structure, dependency DAG, + acceptance gates, STOP-AND-ESCALATE conditions, pre-promotion + deliverables. Single source for what 0-floor means and how to + verify reaching it. +- **Legacy authority being superseded:** [`docs/design-pure-bootstrap.md`](../design-pure-bootstrap.md) + (≤5-floor framing) + [PR #756](https://github.com/gunb-ai/gunbc/pull/756) + (2-3 principled-floor framing). Both retract atomically in the + cascade promotion PR; until then, they remain live authority. +- **Thesis claim tracked:** [`THESIS.md`](../../THESIS.md) §"Thesis + claims — complete list" + [`docs/thesis/self-inspection.md`](../thesis/self-inspection.md). + Hand-Rust in v3's source tree contradicts "the substrate is its + own subject" at the implementation layer; this program closes + that contradiction. +- **Subsumed brief:** [`docs/briefs/pb-1-data-driven-bootstrap.md`](pb-1-data-driven-bootstrap.md). + PB-1 (XXL, 5 sub-lanes) was authored under R1's ≤5-floor framing; + its non-goals invert under 0-floor and the brief gets amended in + the cascade promotion PR. Lane-owner reports here going forward — + see "Hand-off points / PB-1 lineage transition" below. +- **Coordination context:** Director session (currently + `zesty-bear-812`); per + [`docs/briefs/r1-director-brief.md`](r1-director-brief.md) + Staffing set + [`docs/r2-structure.md`](../r2-structure.md) + Manager structure (R2 has 1 standing manager + Director; + Zero-Floor adds a second standing manager parallel to R2). +- **R1 closure transition:** R1 Self-hosting Manager archives at + R1 close. PB-1 lineage transition (currently reporting through + R1 Self-hosting) routes here at archival. See "Hand-off points" + below for the explicit channel. + +## Slice + +This manager owns the full Pure Bootstrap to Zero program per +[`design-pure-bootstrap-zero.md`](../design-pure-bootstrap-zero.md) +§"Subsumed lanes" + §"New lanes": + +**Subsumed (existing lanes folding under this manager):** + +- **PB-1** ([brief](pb-1-data-driven-bootstrap.md), XXL) — + data-driven bootstrap loader. 5 sub-lanes (PB-1-a through + PB-1-e). Lineage transition from R1 Self-hosting at R1 close. +- **PB-4** — `lower.rs` migration. Blocked on SG-3 series + lower.dag + authority. +- **PB-5** — `infer.rs` migration. SG-4 dispatch. +- **PB-6** — `emit.rs` + emit-target cluster (`emit/python_target.rs`, + `emit/rust_target.rs`, `emit_rust.rs`). Lane 1e dependency. + +**New (introduced by this program):** + +- **PB-Substrate** (M-L) — generate `dag.rs`, `dag/ports.rs`, + `dag/effects.rs` from `src/v3/std/substrate.dag`. Cementing test: + generated Rust matches structural facts. +- **PB-Lib + PB-Build** (M, subsumes PB-8 aspiration) — `lib.rs` and + `build.rs` generated; trampolines or vanish. +- **PB-Runtime** (M-L) — `test_runner.rs`, `lens_apply.rs`, + `lens_testgen.rs`, `post_emit_verifier.rs` from `.dag` authorities. +- **PB-Bootstrap-Process** (M, conceptual core) — `bootstrap.dag` + declares the bootstrap workflow as data; `bootstrap.rs` becomes + generated trampoline. Includes N=0 runtime boundary verification + per design doc (operation-set bounded, size budget, substrate- + runner equivalence test). +- **PB-Workflow** (continuation) — `workflow_idempotency.rs` and + `workflow_parallelism.rs` migrate as Lane 2 dissolution lands. +- **PB-Tier1-Sweep** (per-file fast-retire, S each) — 13 Tier-1 + files (regen binaries + bin helpers) retire as their backing + migrations land. + +## Framing question this manager answers + +**Does v3's source tree reach zero hand-authored files — substrate +generated from `.dag` substrate model, evaluator generated from +primitive operations only, bootstrap process declared as data, +test residual dissolved — such that "the substrate is its own +subject" holds at the implementation layer rather than just the +thesis-claim layer?** + +Today (pre-dispatch state): +- 35 files in `EXPECTED_HAND_AUTHORED_NON_TEST` (post #763 + `lens_depth.rs` retirement). +- TESTING.md "Post-R2 shape" residual carves out two Rust-authored + test categories permanently. +- `bootstrap.rs` is hand-Rust (~470 LOC) with the chicken-egg + framing: Dag::new() needs the compiler pipeline. +- Zero-floor design doc (#762) lays out the program; pre-promotion + deliverables not yet authored. + +The ask: close all program lanes per design doc acceptance gates +(`EXPECTED_HAND_AUTHORED_NON_TEST = 0`, `EXPECTED_HAND_AUTHORED_TEST = 0`, +TESTING.md rewritten, DB-8 fixed-point converges, all `[ext]` +predicates evaluate against generated authorities, `bootstrap.dag` +declares workflow including N=0 resolution). + +## Sequence + dispatch + +**Critical path** is **PB-Bootstrap-Process** — depends on PB-1 +(data-bootstrap) + PB-4/5/6 (compiler in .dag) + PB-Substrate +(substrate types in .dag) being usable at minimum. The other lanes +are fill queues operating in parallel; any available worker picks +top-priority unblocked work. + +**Pre-promotion phase (Day-1 dispatch):** + +- **Pre-promotion deliverable 1: 35-file audit table.** Author the + file-by-file mapping (file → why-currently-hand-authored → + migration-path-into-PB-lane) inline for the cascade promotion PR. + Director already authored a starting categorization in + conversation with PM; this manager refines and authorities it. +- **Pre-promotion deliverable 2: PB-1 brief amendment.** Amend + [`pb-1-data-driven-bootstrap.md`](pb-1-data-driven-bootstrap.md) + non-goals to align with 0-floor (currently they explicitly + reject deletion of tokenize/parse/lower/infer/emit and reject + binary-blob format; under 0-floor those non-goals invert as + scope absorbed into PB-* program lanes). +- **Pre-promotion deliverable 3: first prototyped lane closure.** + Pick one PB-* lane and execute it end-to-end (e.g., PB-Substrate + pilot or PB-1-a continuation) to prove the migration pattern + before the cascade promotion PR locks the framing. + +These three are this manager's first work; they gate cascade +promotion. + +**Post-promotion phase (parallel-capable):** + +- **Day-1 (post-promotion).** PB-Substrate dispatches; pattern + proves substrate-type generation. PB-1 sub-lanes continue; + PB-1-a should be done or near-done from R1 era — verify and + re-baseline. PB-4/5/6 dispatch as substrate evolves. +- **Day-1.** PB-Runtime dispatches. Per-file parallelism over the + 4 runtime files (test_runner / lens_apply / lens_testgen / + post_emit_verifier). +- **As PB-Substrate + PB-1 reach usability.** PB-Lib + PB-Build + dispatches; `lib.rs` + `build.rs` migrate to trampolines. +- **As PB-1 + PB-4/5/6 reach usability.** PB-Bootstrap-Process + dispatches. N=0 runtime boundary verification gates land per + design doc. +- **Continuous, gated on backing migrations.** PB-Tier1-Sweep + retires regen binaries + bin helpers as their backing files + retire. Per-file PRs. +- **Continuous, gated on Lane 2 dissolution.** PB-Workflow handles + workflow_idempotency / workflow_parallelism as Lane 2 dissolves. + +Lane ordering is a **fill-queue model**, not strict sequential. PB- +Bootstrap-Process is the sole critical-path spine. Cross-lane +dispatch failures surface as blocked workers on specific +sub-lanes; manager reassigns to unblocked queues. + +## Hand-off points + +This program is **parallel to R2**; coordination crosses two +manager boundaries (Grounding + Director) and the R1-closure +transition. + +### PB-1 lineage transition (load-bearing) + +PB-1 was authored under R1 era. Its lane-owner (whoever drives +sub-lane PRs against `pb-1-data-driven-bootstrap.md`) currently +reports through R1 Self-hosting Manager. R1 Self-hosting Manager +archives at R1 close. + +**Transition mechanic:** at R1 close, PB-1 lineage explicitly +transitions to this manager. The cascade promotion PR for the +zero-floor design doc names this transition in its acceptance +record, alongside the PB-1 brief amendment. PB-1 sub-lane PRs +authored after R1 close cite this manager as the reporting +channel; pre-R1-close PRs continue under R1 Self-hosting until +archival. + +If R1 closure happens before this manager's brief promotes, PB-1 +lineage transitions to Director ad-hoc (interim) until brief +promotes; then transitions here. + +### Cross-manager notifications queued + +- **Grounding Manager** (substrate-shape coordination). Bidirectional: + - **Zero-Floor → Grounding:** when PB-Substrate lands shape-affecting + changes to `dag.rs` or `dag/*` (substrate type definitions + generated from `substrate.dag`), notify Grounding so T-Ground- + Engine work can adapt. Substrate types are load-bearing for + Grounding's inhabitance-search engine. + - **Grounding → Zero-Floor:** when T-Ground-Engine work needs + new substrate fields or operations beyond what the current + `substrate.dag` declares, notify Zero-Floor before authoring + against shape that's mid-migration. Avoid double-edits to + `dag.rs` from both sides. +- **R1 Self-hosting Manager** (PB-1 lineage; transitional, until R1 + close). Coordinate the lineage transition timing — Self-hosting + signals when ready to hand off; Zero-Floor confirms ownership. + This entry retires when R1 Self-hosting archives. +- **Director** (escalation hub for scope changes, cross-program + conflicts, release-ledger placement decisions, cascade + promotion PR authoring). + +### Up to director + +- **Cascade promotion PR.** This manager prepares the three pre- + promotion deliverables (audit table + PB-1 brief amendment + + first prototyped lane closure); Director authors the cascade PR + per the design doc's Promotion mechanism. Atomic across multiple + authority docs; Director's call on bundling vs sibling for + TESTING.md rewrite. +- **Release-ledger placement.** Whether the program lands as R2 + absorption / separately-named program / under Director closure + is a Director call at promotion time per the design doc. +- **N=0 resolution shape pick.** Three options scoped in the + design doc (shipped binary / `gunbc-runtime` crate / rustc + proc-macro). Director picks at or before PB-Bootstrap-Process + acceptance; doesn't gate earlier lane work. +- **Scope-creep flags.** If a lane surfaces work broader than its + scoped acceptance criterion, escalate rather than absorb. The + design doc commits to bounded subsets; scope drift would re-open + framing decisions the cascade PR locks. + +## Working state + +Lane-owner dispatch status (update as sub-deliverables close). +Section populates on cascade promotion + first dispatches; entries +below are scaffolding. + +**Pre-promotion deliverables (gates the cascade promotion PR):** +- [ ] 35-file audit table authored (file → why-current-hand-authored + → migration-path-into-PB-lane). Inline in cascade PR. +- [ ] PB-1 brief amendment ([`pb-1-data-driven-bootstrap.md`](pb-1-data-driven-bootstrap.md)) + non-goals revised to align with 0-floor. Amends in cascade PR. +- [ ] First prototyped lane closure (PB-Substrate pilot or PB-1-a + continuation) proving migration pattern works. Cited in + cascade PR. + +**PB-1 (XXL, subsumed; lineage transition pending R1 close):** +- [ ] PB-1-a (std fixtures generated constructors) — verify + current state from R1 era; re-baseline. +- [ ] PB-1-b (STAGED_FILES generated constructors) +- [ ] PB-1-c (V3_SPECS generated constructors) +- [ ] PB-1-d (COMPILER_FILES generated constructors) +- [ ] PB-1-e (runtime-path retirement + measurement) + +**PB-Substrate (M-L):** +- [ ] `dag.rs` generated from `src/v3/std/substrate.dag` +- [ ] `dag/ports.rs` generated +- [ ] `dag/effects.rs` generated +- [ ] Cementing test: generated Rust matches substrate model + +**PB-4 (lower):** *(blocked on SG-3 series + `lower.dag` authority)* +- [ ] `lower.dag` authoring +- [ ] `regen_lower` binary +- [ ] `lower_generated.rs` +- [ ] `lower.rs` retired + +**PB-5 (infer):** *(SG-4 dispatch)* +- [ ] `infer.dag` + dispatch +- [ ] `infer_generated.rs` +- [ ] `infer.rs` retired + +**PB-6 (emit cluster):** *(Lane 1e dependency)* +- [ ] `emit.rs` migrated +- [ ] `emit/python_target.rs` migrated +- [ ] `emit/rust_target.rs` migrated +- [ ] `emit_rust.rs` retired (re-export shim collapses) + +**PB-Lib + PB-Build (M):** +- [ ] `lib.rs` generated trampoline +- [ ] `build.rs` generated trampoline (or eliminated) + +**PB-Runtime (M-L):** +- [ ] `test_runner.rs` migrated +- [ ] `lens_apply.rs` migrated +- [ ] `lens_testgen.rs` migrated +- [ ] `post_emit_verifier.rs` migrated + +**PB-Bootstrap-Process (M, conceptual core):** +- [ ] `bootstrap.dag` authored (load order + target state + + invariants + entry point) +- [ ] Universal evaluator generated from primitive-operations + authority +- [ ] `bootstrap.rs` retired or trampoline only +- [ ] N=0 runtime boundary verification: + - [ ] Operation set bounded (Node/Conj/Disj/Cardinality/Bit only) + - [ ] Size budget met (<500 LOC outside v3 tree) + - [ ] Substrate-runner equivalence test passes +- [ ] N=0 resolution shape picked (Director call) + +**PB-Workflow (continuation):** +- [ ] `workflow_idempotency.rs` migrated (Lane 2 dissolution) +- [ ] `workflow_parallelism.rs` migrated (Stage 2e .dag surface + lands first) + +**PB-Tier1-Sweep (per-file fast-retire; depends on backing migrations):** +- [ ] regen_bootstrap.rs +- [ ] regen_lens.rs +- [ ] regen_parse.rs +- [ ] regen_parse_tables.rs +- [ ] regen_tokenize.rs +- [ ] regen_v3.rs +- [ ] regen_bootstrap_emit.rs +- [ ] regen_parse_emit.rs +- [ ] regen_parse_tables_emit.rs +- [ ] dag/builder.rs +- [ ] lens_unused_parameters.rs +- [ ] dimension.rs +- [ ] tokenize_char_class.rs (also unblocks R2 T-Substrate + 4th sub-lane via Class 5 Gap 3 closure — coordination point + with Director-dispatched R2 work) + +**Acceptance gates (per design doc):** +- [ ] `EXPECTED_HAND_AUTHORED_NON_TEST` count = 0 +- [ ] `EXPECTED_HAND_AUTHORED_TEST` count = 0 +- [ ] TESTING.md "Post-R2 shape" residual rewritten to 0-residual +- [ ] DB-8 `self_host_fixed_point` converges bit-identically +- [ ] All `[ext]` test predicates evaluate against generated + authorities +- [ ] `bootstrap.dag` declares workflow + N=0 resolution + +Decisions log (append as they happen): + +- _(none yet — manager is pre-promotion; brief authored + 2026-04-25 per Director request after #762 merge)_ + +Open questions for director: + +- **R1 Self-hosting → Zero-Floor PB-1 lineage transition timing.** + R1 Self-hosting archives at R1 close (hours-to-day per Director + estimate). Confirm transition is automatic at archival, or + requires an explicit handoff PR before R1 closes. +- **Cascade promotion PR authoring lead.** Director's section in + Hand-off says Director authors. Confirm: this manager's three + pre-promotion deliverables are inputs to that PR, or this + manager authors-then-Director-reviews? + +Cross-manager notifications queued: + +- **Grounding Manager**: brief authored 2026-04-25; coordination + channel established for substrate-shape changes (bidirectional + per Hand-off points). No active signal yet — pre-promotion. +- **R1 Self-hosting Manager** (transitional): PB-1 lineage + transition queued for R1 close. Self-hosting Manager should + acknowledge in their working state when ready to hand off. +- **Director**: brief in PROPOSAL pending cascade promotion; + three pre-promotion deliverables are first work and gate the + cascade. From 0604ffb5857c02b05ded07899b8d7effa66022d9 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 22:06:51 -0400 Subject: [PATCH 19/20] WIP: gunbc Director --- docs/briefs/pure-bootstrap-zero-manager.md | 56 +++++++++++++++++----- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/docs/briefs/pure-bootstrap-zero-manager.md b/docs/briefs/pure-bootstrap-zero-manager.md index 90ff8c2d928..1bb106d199f 100644 --- a/docs/briefs/pure-bootstrap-zero-manager.md +++ b/docs/briefs/pure-bootstrap-zero-manager.md @@ -22,6 +22,15 @@ to the cascade promotion PR** per the design doc's Promotion mechanism. Until then: program runs structurally without committing to a release-ledger label. +**Cross-program coordination routing.** Cross-program signals +between Zero-Floor and R2 (Grounding + R2 ad-hoc lanes) route +through Director, who is the only entity with both program +contexts. Manager-to-manager direct coordination is for +substrate-shape only (per Cross-manager notifications queued +below); broader cross-program concerns (scope, ledger placement, +sequencing decisions affecting both programs) escalate to +Director. + ## Orient before reading - **Program scope authority:** [`docs/design-pure-bootstrap-zero.md`](../design-pure-bootstrap-zero.md) @@ -102,8 +111,12 @@ subject" holds at the implementation layer rather than just the thesis-claim layer?** Today (pre-dispatch state): -- 35 files in `EXPECTED_HAND_AUTHORED_NON_TEST` (post #763 - `lens_depth.rs` retirement). +- **Live count authority:** `src/v3/compiler/tests/integration/sg0_census_test.rs` + `EXPECTED_HAND_AUTHORED_NON_TEST` and `EXPECTED_HAND_AUTHORED_TEST` + arrays. Read at dispatch time; brief does not restate the count + inline (drift risk). Reference snapshot: 35 NON_TEST files at + brief authoring (post #763 `lens_depth.rs` retirement); use the + live array as the source-of-truth for any audit work. - TESTING.md "Post-R2 shape" residual carves out two Rust-authored test categories permanently. - `bootstrap.rs` is hand-Rust (~470 LOC) with the chicken-egg @@ -216,6 +229,16 @@ promotes; then transitions here. - **Director** (escalation hub for scope changes, cross-program conflicts, release-ledger placement decisions, cascade promotion PR authoring). + - **Specific coordination case: `tokenize_char_class.rs` retirement.** + PB-Tier1-Sweep retirement of `tokenize_char_class.rs` (per + Working state) closes Class 5 Gap 3 from the substrate side, + which unblocks the R2 T-Substrate 4th sub-lane (charclass phase-2 + consumer = tokenizer). Zero-Floor Manager signals Director when + this retirement lands; Director coordinates dispatch of the + R2 T-Substrate sub-lane (Director-ad-hoc per `r2-structure.md`, + no standing R2 manager owns it). One-sided note from this brief + by design: the consumer side is Director-dispatched, so the + bidirectional pairing collapses to Zero-Floor → Director. ### Up to director @@ -338,19 +361,28 @@ below are scaffolding. Decisions log (append as they happen): -- _(none yet — manager is pre-promotion; brief authored - 2026-04-25 per Director request after #762 merge)_ +- **2026-04-25** — Brief authored per Director request after #762 + merge (charclass reclassification + zero-floor design doc + PROPOSAL). +- **2026-04-25** — **PB-1 lineage transition: automatic at R1 + Self-hosting archive.** No explicit handoff PR required. Verification + on results: PB-1 sub-lane PRs authored after R1 close should cite + Zero-Floor Manager as reporting channel; if they cite R1 Self-hosting + (which has archived), the transition didn't take and Director + surfaces it. Manager confirms first post-R1-archive PB-1 PR routes + here as the verification artifact. +- **2026-04-25** — **Cascade promotion PR authoring split.** Manager + authors the three pre-promotion deliverables as separate PRs (audit + table inline-able into cascade; PB-1 brief amendment; first + prototyped lane closure). Director authors the cascade promotion PR + itself using those as inputs. Pattern matches "what worked" from R1 + brief refreshes: managers own their scope surfaces; director owns + cross-cutting authority changes (the cascade is cross-cutting across + 4 authority docs). Open questions for director: -- **R1 Self-hosting → Zero-Floor PB-1 lineage transition timing.** - R1 Self-hosting archives at R1 close (hours-to-day per Director - estimate). Confirm transition is automatic at archival, or - requires an explicit handoff PR before R1 closes. -- **Cascade promotion PR authoring lead.** Director's section in - Hand-off says Director authors. Confirm: this manager's three - pre-promotion deliverables are inputs to that PR, or this - manager authors-then-Director-reviews? +- _(none — both resolved 2026-04-25; see Decisions log below)_ Cross-manager notifications queued: From 8a8c66a795e72e3143a55f2aee19a313fad4802c Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 24 Apr 2026 22:11:21 -0400 Subject: [PATCH 20/20] WIP: gunbc Director --- docs/briefs/pure-bootstrap-zero-manager.md | 61 +++++++++++++++------- 1 file changed, 41 insertions(+), 20 deletions(-) diff --git a/docs/briefs/pure-bootstrap-zero-manager.md b/docs/briefs/pure-bootstrap-zero-manager.md index 1bb106d199f..ec1589cd288 100644 --- a/docs/briefs/pure-bootstrap-zero-manager.md +++ b/docs/briefs/pure-bootstrap-zero-manager.md @@ -138,26 +138,42 @@ declares workflow including N=0 resolution). are fill queues operating in parallel; any available worker picks top-priority unblocked work. -**Pre-promotion phase (Day-1 dispatch):** +**Pre-promotion phase (Day-1 dispatch).** Cascade promotion requires +**four** pre-promotion items per +[`design-pure-bootstrap-zero.md`](../design-pure-bootstrap-zero.md) +"Pre-promotion deliverables" + "What gate" sections: -- **Pre-promotion deliverable 1: 35-file audit table.** Author the - file-by-file mapping (file → why-currently-hand-authored → +- **Deliverable 1: 35-file audit table.** Author the file-by-file + mapping (file → why-currently-hand-authored → migration-path-into-PB-lane) inline for the cascade promotion PR. Director already authored a starting categorization in conversation with PM; this manager refines and authorities it. -- **Pre-promotion deliverable 2: PB-1 brief amendment.** Amend +- **Deliverable 2: PB-1 brief amendment.** Amend [`pb-1-data-driven-bootstrap.md`](pb-1-data-driven-bootstrap.md) non-goals to align with 0-floor (currently they explicitly reject deletion of tokenize/parse/lower/infer/emit and reject binary-blob format; under 0-floor those non-goals invert as scope absorbed into PB-* program lanes). -- **Pre-promotion deliverable 3: first prototyped lane closure.** - Pick one PB-* lane and execute it end-to-end (e.g., PB-Substrate - pilot or PB-1-a continuation) to prove the migration pattern - before the cascade promotion PR locks the framing. - -These three are this manager's first work; they gate cascade -promotion. +- **Deliverable 3: TESTING.md "Post-R2 shape" rewrite.** Per + design doc Promotion mechanism — TESTING.md residual carve-outs + (compiler-internal unit tests for Rust-only helpers; external- + toolchain boundary tests) dissolve under 0-floor. **Authoring + ownership = Director-call at promotion time** per design doc: + bundle into cascade PR, or sibling PR landed first. This manager + surfaces the readiness signal (when PB-Runtime and ExecuteCommand- + based TestClaim migration work is sufficient evidence to author + the rewrite); Director picks bundle-vs-sibling and either authors + or directs authoring. +- **Gate item 4: first prototyped lane closure.** Per design doc + Promotion mechanism's "What gate" — cascade PR includes at least + one prototyped lane closure proving an existing hand-Rust file + can be retired via `.dag` migration without regression. This + manager picks the lane (e.g., PB-Substrate pilot or PB-1-a + continuation) and executes end-to-end before the cascade locks + the framing. + +Items 1, 2, 4 are this manager's authoring; item 3's authoring is +Director-call. All four gate cascade promotion. **Post-promotion phase (parallel-capable):** @@ -242,12 +258,12 @@ promotes; then transitions here. ### Up to director -- **Cascade promotion PR.** This manager prepares the three pre- - promotion deliverables (audit table + PB-1 brief amendment + - first prototyped lane closure); Director authors the cascade PR - per the design doc's Promotion mechanism. Atomic across multiple - authority docs; Director's call on bundling vs sibling for - TESTING.md rewrite. +- **Cascade promotion PR.** This manager prepares three of the + four pre-promotion items (audit table + PB-1 brief amendment + + first prototyped lane closure); the fourth (TESTING.md rewrite) + is Director-call on authoring per design doc Promotion mechanism. + Director authors the cascade PR itself (atomic across multiple + authority docs) using the manager's deliverables as inputs. - **Release-ledger placement.** Whether the program lands as R2 absorption / separately-named program / under Director closure is a Director call at promotion time per the design doc. @@ -266,11 +282,16 @@ Lane-owner dispatch status (update as sub-deliverables close). Section populates on cascade promotion + first dispatches; entries below are scaffolding. -**Pre-promotion deliverables (gates the cascade promotion PR):** +**Pre-promotion items (all four gate the cascade promotion PR):** - [ ] 35-file audit table authored (file → why-current-hand-authored - → migration-path-into-PB-lane). Inline in cascade PR. + → migration-path-into-PB-lane). Inline in cascade PR. **Owner:** this manager. - [ ] PB-1 brief amendment ([`pb-1-data-driven-bootstrap.md`](pb-1-data-driven-bootstrap.md)) - non-goals revised to align with 0-floor. Amends in cascade PR. + non-goals revised to align with 0-floor. Amends in cascade PR. **Owner:** this manager. +- [ ] TESTING.md "Post-R2 shape" rewrite (residual carve-outs dissolve). + **Owner: Director-call** at promotion time per design doc — bundle into + cascade PR or sibling PR landed first; this manager surfaces the + readiness signal when PB-Runtime + ExecuteCommand-based TestClaim + migration is sufficient evidence to author the rewrite. - [ ] First prototyped lane closure (PB-Substrate pilot or PB-1-a continuation) proving migration pattern works. Cited in cascade PR.