From 79073f2f9145c8a0927fb4b9ccc382ff89db2ae5 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 6 May 2026 18:00:56 +0000 Subject: [PATCH 1/4] docs(briefs): refresh regen_lens audits after PB dispatch verification MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Consumer audit: fix stale anchors (SG-0 :237, REGEN_OUTPUTS :479-513, nine bins); update BinShim handoff row for landed carrier; add 2026-05-06 mechanical verification delta vs origin/main @ 194ddb7a8. - Retirement readiness: record BinShim carrier as verified on main; annotate dispatch-ready row (4) as mechanically satisfied — chain still gated on Item 4, emit pattern, instance, §7.2, §7.3. Co-authored-by: Cursor --- .../briefs/r3-pb-regen-lens-consumer-audit.md | 31 ++++++++++++++----- ...rst-binshim-target-retirement-readiness.md | 4 +-- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/docs/briefs/r3-pb-regen-lens-consumer-audit.md b/docs/briefs/r3-pb-regen-lens-consumer-audit.md index 0ef60e3cbf5..bef5a0103cf 100644 --- a/docs/briefs/r3-pb-regen-lens-consumer-audit.md +++ b/docs/briefs/r3-pb-regen-lens-consumer-audit.md @@ -51,16 +51,16 @@ These imports are what the future `BinShim` emitter must end up calling from emi | Surface | Live location (verified) | Cutover delta | |---|---|---| -| **Cargo bin entry** | `src/v3/compiler/Cargo.toml`: `[[bin]] name = "regen_lens" path = "src/bin/regen_lens.rs"` | `path` updates to the emitted location once the file is generated. The `name = "regen_lens"` and CLI invocation surface stay stable so the 8-bin Cargo manifest's authority surface is unchanged. | -| **`build.rs` `REGEN_OUTPUTS`** | `src/v3/compiler/build.rs:479-516` (25 entries on origin/main HEAD at audit time) | Add the emitted shim's path to `REGEN_OUTPUTS` so SG-0's `sg0_generated_partition_is_producer_owned` invariant counts the file as generated. The current `REGEN_OUTPUTS` lists every per-lens `lens_*_generated.rs` (the bin's *outputs*) but NOT the bin itself — `regen_lens.rs` is the producer, not a generated artifact. After retirement, the bin moves from "hand-authored producer" to "generated artifact" and the manifest grows by 1. | +| **Cargo bin entry** | `src/v3/compiler/Cargo.toml`: `[[bin]] name = "regen_lens" path = "src/bin/regen_lens.rs"` | `path` updates to the emitted location once the file is generated. The `name = "regen_lens"` and CLI invocation surface stay stable so the nine-bin Cargo manifest's authority surface is unchanged (binary name is what tooling and diagnostics key on). | +| **`build.rs` `REGEN_OUTPUTS`** | `src/v3/compiler/build.rs:479-513` (25 entries on origin/main HEAD at audit time) | Add the emitted shim's path to `REGEN_OUTPUTS` so SG-0's `sg0_generated_partition_is_producer_owned` invariant counts the file as generated. The current `REGEN_OUTPUTS` lists every per-lens `lens_*_generated.rs` (the bin's *outputs*) but NOT the bin itself — `regen_lens.rs` is the producer, not a generated artifact. After retirement, the bin moves from "hand-authored producer" to "generated artifact" and the manifest grows by 1. | | **`GENERATED_FILES` runtime constant** | Built from `REGEN_OUTPUTS` per `build.rs:520-526`, exposed as `v3_compiler::generated_files::GENERATED_FILES`. | Auto-updates when `REGEN_OUTPUTS` grows; no separate edit. The bin imports this exact constant (line 22), so its own re-emission produces a consistent self-reference. | -| **Package `v3-compiler` declares eight `[[bin]]` targets**: `regen_bootstrap`, `regen_lens`, `regen_parse`, `regen_parse_tables`, `regen_tokenize`, `regen_v3`, `self_host_fixed_point`, `r1c_e_emit_gates` | `src/v3/compiler/Cargo.toml` `[[bin]]` blocks | Other bins follow the same template after `regen_lens` lands as the canonical first slice (per design-doc §4.3 + BinShim brief §"First slice"). They are NOT in scope for sub-gate 3 — but they ARE in scope for the broader BinShim retirement program once the carrier and pattern stabilize. | +| **Package `v3-compiler` declares nine explicit `[[bin]]` targets** (`regen_bootstrap`, `regen_lens`, `regen_parse`, `regen_parse_tables`, `regen_tokenize`, `regen_v3`, `emit_method_template_projection`, `self_host_fixed_point`, `r1c_e_emit_gates`) | `src/v3/compiler/Cargo.toml:47-85` `[[bin]]` blocks | Other bins follow the same template after `regen_lens` lands as the canonical first slice (per design-doc §4.3 + BinShim brief §"First slice"). They are NOT in scope for sub-gate 3 — but they ARE in scope for the broader BinShim retirement program once the carrier and pattern stabilize. | ## SG-0 census surface | Authority | Live location (verified) | Cutover delta | |---|---|---| -| `EXPECTED_HAND_AUTHORED_NON_TEST` | `src/v3/compiler/tests/integration/sg0_census_test.rs:174` lists `"src/v3/compiler/src/bin/regen_lens.rs"` | Remove the entry. SG-0 census decreases by 1; `REGEN_OUTPUTS` grows by 1 (above). Both updates land atomically in the same retirement PR. | +| `EXPECTED_HAND_AUTHORED_NON_TEST` | `src/v3/compiler/tests/integration/sg0_census_test.rs:237` lists `"src/v3/compiler/src/bin/regen_lens.rs"` (table `EXPECTED_HAND_AUTHORED_NON_TEST` begins `:211`) | Remove the entry. SG-0 census decreases by 1; `REGEN_OUTPUTS` grows by 1 (above). Both updates land atomically in the same retirement PR. | | Census comment trail | `sg0_census_test.rs:50-67` documents the 2026 SG-6 cutover that folded 4 per-lens regen bins + `regen_infer_helpers` into the unified `regen_lens` shim. | Future entry: comment annotation that `regen_lens.rs` retired via Item-5 BinShim emit pattern + `data regen_lens_shim` instance under `dsl/std/runtime/bin_shims/regen_lens.dag`. | ## Test surface (consumers that exercise the bin or its registry) @@ -98,13 +98,13 @@ This is the load-bearing audit deliverable: a per-handoff row naming exactly wha | Handoff | Owner | Consumes from this audit | What that PR adds | |---|---|---|---| -| **`type BinShim` carrier landing** | Substrate Manager (per design-doc §5.4 + #1347 STOP+PING) | Field requirements named in design-doc §4.2's example `data regen_lens_shim: BinShim = { name: "regen_lens", entry: regen_lens, ... }`: a `name` field whose value is the **Cargo `[[bin]]` target name** (e.g. `"regen_lens"` per `src/v3/compiler/Cargo.toml`'s `[[bin]] name = "regen_lens"` block), and `entry: () -> std.process.ProcessExit` whose structural model is the bin's existing `fn main() -> ExitCode` (line 33). Whatever pipeline-composition fields the §4.2 sketch settles on are Substrate Manager's call. **Not derivable from `LENS_REGISTRY_ENTRY_TYPE` at line 26** — that constant is the registry-entry meta-tag string the bin uses to look up `LensRegistryEntry` records inside `regen.dag`, not a property of the bin-shim itself. | `type BinShim { ... }` declaration in `dsl/std/runtime/bin_shim.dag` (or wherever Substrate picks). | +| **`type BinShim` carrier** | Substrate Manager — **landed on main** (`src/v3/std/bin_shim.dag:19-23`) | Live substrate record: `entrypoint_name: NonEmptyStr`, `description: String`, `entry: DeclarationRef` (points at a `.dag` entry function for the shim body — see [`dsl/std/runtime/bin_shims/README.md`](../../dsl/std/runtime/bin_shims/README.md) naming convention). Design-doc §4.2 sketches historically used a `name` field; scheduled work keys off **`entrypoint_name`** matching the Cargo `[[bin]]` name (`"regen_lens"`). **`entry` resolves in substrate** to the declaration named by the ref — not to `LENS_REGISTRY_ENTRY_TYPE` at line 26 of `regen_lens.rs`, which tags rows inside `regen.dag`. Hand-Rust `fn main() -> ExitCode` (line 33) remains the behavioral model for §7.2 until `.dag` entry replaces it. | No further carrier-introduction PR required for retirement chain; regressions remain Substrate-owned per §5.4. | | **`data regen_lens_shim: BinShim` instance authoring** | PB Manager (R3 worker, dispatched by PB on carrier landing) | Field values from the audit's "Source surface" + "Internal crate imports" tables. The `entry` field references a `regen_lens_main` declaration that fold-mirrors the current `fn main` body via the locked PB-Runtime emit pattern. | New file `dsl/std/runtime/bin_shims/regen_lens.dag` per the framework convention in PR #1347. | | **BinShim emit pattern (the `.dag` emitter)** | PB Manager (R3 worker) | The bin's import surface (the 5 internal crates listed above) — the emitter must produce emitted Rust that calls these same crate APIs, since they are NOT being retired (they're producer-side authority). | New `.dag` emitter program analogous to `dsl/extdeps/languages/rust/emit.dag` per design-doc §4.2 + anti-bridge invariant #4. | | **§7.2 equivalence fixture authoring** | PB Manager (R3 worker) — same retirement PR | The behavioral spec from the bin's docstring + `sg6_regen_lens_cli_smoke_regenerates_named_entry_without_drift` test (which IS the runtime evidence base). The fixture asserts: emitted-Rust + hand-Rust produce identical regenerated `lens_*_generated.rs` output for every `LensRegistryEntry` in `regen.dag`. | TestClaim `regen_lens_bin_shim_emits_behaviorally_equivalent_to_hand_rust` per design-doc §7.2 locked name. | | **Cargo `path` flip** | PB Manager (same retirement PR) | The Cargo `[[bin]]` block at `Cargo.toml` (above). | `path = "src/bin/regen_lens.rs"` updates to whatever absolute path the emitted file lands at (or stays the same if the emitter writes to the same path). | -| **`REGEN_OUTPUTS` extension** | PB Manager (same retirement PR) | The list at `build.rs:479-516` (25 entries on origin/main HEAD at audit time). | Add `"src/v3/compiler/src/bin/regen_lens.rs"` (the now-emitted path). | -| **SG-0 census drop** | PB Manager (same retirement PR) | `sg0_census_test.rs:174`. | Remove the entry. | +| **`REGEN_OUTPUTS` extension** | PB Manager (same retirement PR) | The list at `build.rs:479-513` (25 entries on origin/main HEAD at audit time). | Add `"src/v3/compiler/src/bin/regen_lens.rs"` (the now-emitted path). | +| **SG-0 census drop** | PB Manager (same retirement PR) | `sg0_census_test.rs:237`. | Remove the entry. | | **Doc status flips** | PB Manager (same retirement PR) | The 4 doc references in §"Documentation surface" above. | Mark RESOLVED/MET/closed as appropriate. | ## STOP / report-instead-of-invent @@ -145,6 +145,21 @@ Observed deltas: No carrier/emitter implementation is implied by these deltas. The current cutover blocker is not "find the `BinShim` carrier"; it is "provide a non-fabricated `regen_lens_main` entry target and loader story, then author the instance/emitter/§7.2/SG-0 changes in their assigned slices." +## Delta — 2026-05-06 mechanical verification (warm-ant-877 dispatch) + +Repro pin: `origin/main @ 194ddb7a8e3cb033698e4f6749f93f436afde354`. + +PB Manager dispatch: close honest checklist rows with **docs + mechanical audits** only — no `BinShim` carrier-field invention, no `.dag` instance authoring. + +| Audit | Command / surface | Result | +|---|---|---| +| Registry data rows | `rg -n '^data .*_entry: LensRegistryEntry' src/v3/compiler/regen.dag` | **9** rows | +| Cargo bins | `src/v3/compiler/Cargo.toml:47-85` | **9** `[[bin]]` targets; `regen_lens` at `:52-54` | +| Producer manifest | `src/v3/compiler/build.rs:479-513` | **25** `REGEN_OUTPUTS` paths; still **no** `src/v3/compiler/src/bin/regen_lens.rs` | +| SG-0 census | `sg0_census_test.rs` | `regen_lens.rs` path string at **:237**; `EXPECTED_HAND_AUTHORED_NON_TEST` at `:211-293` | +| Instance directory | `dsl/std/runtime/bin_shims/` | **README.md only** (no `regen_lens.dag`) — row #1 / `regen_lens_main` STOP still authoritative per README §"Substrate prerequisite" | +| Carrier | `src/v3/std/bin_shim.dag:19-23` | Unchanged live `BinShim` record | + ## Cross-refs - Parent design lock: [`docs/design-pb-runtime-interpreter.md`](../design-pb-runtime-interpreter.md) §4 (Item 5 emit pattern), §4.3 (dissolution path), §5.1 (sub-gate decomposition), §7.2 (BinShim equivalence fixture). @@ -154,4 +169,4 @@ No carrier/emitter implementation is implied by these deltas. The current cutove - Quick-newt's parallel readiness checklist: [`docs/briefs/r3-pb-regen-lens-first-binshim-target-retirement-readiness.md`](r3-pb-regen-lens-first-binshim-target-retirement-readiness.md). - PB Manager brief: [`docs/briefs/r2-pure-bootstrap-manager.md`](r2-pure-bootstrap-manager.md#program-scope-t-pb-post-r1-only) — R3 continuation table row for BinShim instances + emit pattern + retirement dispatch. - Substrate-fact-introduction procedure: [`INVARIANTS.md`](../../INVARIANTS.md) §P1. -- Live source paths cited (anchor for future workers): `src/v3/compiler/src/bin/regen_lens.rs`, `src/v3/compiler/regen.dag`, `src/v3/compiler/Cargo.toml`, `src/v3/compiler/build.rs:479-516`, `src/v3/compiler/tests/integration/sg0_census_test.rs:174`, `src/v3/compiler/tests/integration/lens_register_correspondence_test.rs`, `src/v3/compiler/tests/integration/sg6_hand_authored_census_test.rs`, `scripts/slow-test-exemptions.txt:78`, `dsl/std/process.dag:39` (`type ProcessExit`). +- Live source paths cited (anchor for future workers): `src/v3/compiler/src/bin/regen_lens.rs`, `src/v3/compiler/regen.dag`, `src/v3/compiler/Cargo.toml`, `src/v3/compiler/build.rs:479-513`, `src/v3/compiler/tests/integration/sg0_census_test.rs:237`, `src/v3/compiler/tests/integration/lens_register_correspondence_test.rs`, `src/v3/compiler/tests/integration/sg6_hand_authored_census_test.rs`, `scripts/slow-test-exemptions.txt:78`, `dsl/std/process.dag:39` (`type ProcessExit`). diff --git a/docs/briefs/r3-pb-regen-lens-first-binshim-target-retirement-readiness.md b/docs/briefs/r3-pb-regen-lens-first-binshim-target-retirement-readiness.md index bdb991ec598..b88e401189d 100644 --- a/docs/briefs/r3-pb-regen-lens-first-binshim-target-retirement-readiness.md +++ b/docs/briefs/r3-pb-regen-lens-first-binshim-target-retirement-readiness.md @@ -20,7 +20,7 @@ | Object | What “live” means | Retirement blocker until | |--------|-------------------|---------------------------| -| **`BinShim` carrier** | Substrate-declared record type per design doc section 4.2 (`entrypoint_name`, `description`, `entry: … → std.process.ProcessExit`); path is Substrate dispatch (e.g. `dsl/std/runtime/bin_shim.dag` or equivalent). | **Substrate Manager** lands carrier via `INVARIANTS.md` substrate-fact introduction (P1) if not already on `main`. **STOP:** carrier-shape pressure during instance authoring → P1 to Substrate, not ad-hoc PB edits to the type (design doc section 5.4). | +| **`BinShim` carrier** | Substrate-declared record type per design doc section 4.2; live shape: `entrypoint_name`, `description`, `entry: DeclarationRef` in [`src/v3/std/bin_shim.dag`](../../src/v3/std/bin_shim.dag). | **Landed on `main`** — verified `origin/main @ 194ddb7a8` (warm-ant-877 mechanical audit, 2026-05-06). **`BinShim` carrier introduction is not a remaining retirement blocker.** Retirement remains gated on Item 5 emit pattern, `regen_lens_main` + instance row, §7.2, Item 4 convergence, §7.3 disposition — see §Dispatch-ready row. **STOP:** carrier-shape pressure during instance authoring → Substrate Manager P1 per design doc section 5.4 — **do not** invent fields ad hoc from the PB lane. | **`std.process.ProcessExit`** | Entry functions return the existing substrate carrier (design doc section 4.2 cites `dsl/std/process.dag`). | **Substrate** (already authoritative on `main` at design-lock authoring; re-verify at dispatch). Owner for regression: **Substrate Manager**. | | **Item 5 emit pattern** | `.dag` emitter translates each `BinShim` data instance to one `AUTO-GENERATED` Rust `main` template (design doc section 4.2); mirrors other Rust emit modules (anti-bridge invariant #4). | **PB Manager** — BinShim brief deliverable 2; implementation worker TBD at dispatch. **STOP:** parallel emit logic / divergence from `dsl/extdeps/languages/rust/emit.dag` shape → escalate per [`r3-pb-binshim-retirement-worker.md`](r3-pb-binshim-retirement-worker.md) STOP section. | | **`data regen_lens_shim: BinShim = { … }`** | Pure-data witness of the current `regen_lens` pipeline under `dsl/std/runtime/bin_shims/` (paths TBD per BinShim program). | **PB-assigned worker** owning `dsl/std/runtime/bin_shims/` (declaration framework + per-shim rows per BinShim brief deliverable 1). *Do not* conflate this checklist’s author with that write scope. | @@ -74,7 +74,7 @@ Green for **sub-gate 3 retirement worker dispatch** when **all** are true (cumul 1. R2 close — **done** (#1275 per sub-gate 3 brief). 2. R2-Evaluator stable — **Evaluator Manager**. 3. Item 4 landed; `pb_runtime_equivalent_to_evaluator_on_corpus` evaluates true — **PB-Runtime + Evaluator owners**. -4. Substrate-owned `BinShim` carrier on `main` — **Substrate Manager**. +4. Substrate-owned `BinShim` carrier on `main` — **Substrate Manager**. **Mechanically verified** on `origin/main @ 194ddb7a8` (`src/v3/std/bin_shim.dag`; warm-ant-877, 2026-05-06) — this criterion is **not** the active blocker for the retirement chain. 5. `std.process.ProcessExit` verified on `main` — **Substrate Manager** (verification). 6. BinShim emit pattern landed — **PB Manager** (deliverable 2). 7. `data regen_lens_shim: BinShim` authored under `dsl/std/runtime/bin_shims/` — **PB-assigned bin_shims worker** (declaration framework + instance scope). From c110e69a6eb17b42f2c031504138b5ce11ecbd6e Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 6 May 2026 18:09:03 +0000 Subject: [PATCH 2/4] docs(briefs): align regen_lens PR with PB review (carrier landed, build.rs pins) - Readiness: rewrite Non-authority to match landed BinShim carrier + real blockers. - Consumer audit: refresh intro/Scope/Non-overlap; 9 registry rows; GENERATED_FILES row cites REGEN_OUTPUTS :479-513 and manifest loop :514-526. Co-authored-by: Cursor --- docs/briefs/r3-pb-regen-lens-consumer-audit.md | 10 +++++----- ...n-lens-first-binshim-target-retirement-readiness.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/briefs/r3-pb-regen-lens-consumer-audit.md b/docs/briefs/r3-pb-regen-lens-consumer-audit.md index bef5a0103cf..5823292fe88 100644 --- a/docs/briefs/r3-pb-regen-lens-consumer-audit.md +++ b/docs/briefs/r3-pb-regen-lens-consumer-audit.md @@ -1,6 +1,6 @@ # R3 PB — `regen_lens.rs` consumer audit (carrier-independent, docs-only) -**Status:** AUDIT artifact (docs-only, carrier-independent). Authored 2026-05-01 by PB Manager continuation per Director follow-up on inbox #1149 — bounded post-#1347 planning slice that maps `src/v3/compiler/src/bin/regen_lens.rs`'s consumer / build / CI / call surfaces and the exact handoff points for the future `BinShim` carrier + instance + emitter + §7.2 equivalence fixture, **without** waiting on or inventing the carrier. +**Status:** AUDIT artifact (docs-only, carrier-independent). Authored 2026-05-01 by PB Manager continuation per Director follow-up on inbox #1149 — bounded post-#1347 planning slice that maps `src/v3/compiler/src/bin/regen_lens.rs`'s consumer / build / CI / call surfaces and the exact handoff points for **`BinShim` instance + emitter + §7.2 equivalence** (substrate `BinShim` carrier is on `main`; this audit does **not** invent carrier fields). **Parent authorities:** - [`docs/design-pb-runtime-interpreter.md`](../design-pb-runtime-interpreter.md) §4 (Item 5 emit pattern), §4.3 (dissolution path), §5.1 (sub-gate decomposition), §7.2 (BinShim equivalence fixture). @@ -13,13 +13,13 @@ This audit does NOT introduce authority. Every cell cites a live file/line on or ## Scope -Carrier-independent dependency map for the future sub-gate-3 retirement worker. Names every consumer / build / CI / call / test / doc surface that participates in the cutover from the hand-Rust `regen_lens.rs` to the `.dag`-emitted equivalent. **Does NOT** propose carrier shape, emit semantics, or implementation order — those are quick-newt's territory + Substrate Manager's territory + future carrier-landing PR's territory. +Carrier-independent dependency map for the future sub-gate-3 retirement worker. Names every consumer / build / CI / call / test / doc surface that participates in the cutover from the hand-Rust `regen_lens.rs` to the `.dag`-emitted equivalent. **Does NOT** propose emit semantics or implementation order — carrier shape lives in `src/v3/std/bin_shim.dag`; instance / emitter / §7.2 sequencing remain PB + Substrate dispatch per linked briefs. ## Non-overlap reminder - **This audit:** consumer / handoff map. Docs-only. - **quick-newt** (separate session): retirement-readiness implementation attempt path → see `r3-pb-regen-lens-first-binshim-target-retirement-readiness.md` referenced above. -- **Substrate Manager**: `BinShim` carrier-type shape (not yet on main; STOP+PING tracked in #1347). +- **Substrate Manager**: `BinShim` carrier regressions + **P1** if instance authoring surfaces carrier-shape pressure (`BinShim` record is on `main`; not “waiting on carrier landing”). - **PB framework PR (#1347):** `dsl/std/runtime/bin_shims/` framework directory + naming convention. Authored. ## Source surface (the file itself) @@ -31,7 +31,7 @@ Carrier-independent dependency map for the future sub-gate-3 retirement worker. | Header docstring | "Unified lens-regen driver. Narrow host shim for `src/v3/compiler/regen.dag`: reads every `data _entry: LensRegistryEntry` record out of the bootstrap Dag, compiles the referenced `.dag` lens, and writes the `emit_rust_module` projection to the declared output path." (line 1-6) | | Entry-point shape | `fn main() -> ExitCode` (line 33) — already returns a `std::process::ExitCode`, structurally close to the design-doc §4.2 `entry: () -> std.process.ProcessExit` contract. Re-declaring it as a `BinShim.entry` does NOT require evolving the substrate `ProcessExit` shape. | | `LENS_REGISTRY_ENTRY_TYPE` | `&str = "LensRegistryEntry"` (line 26) — string-keyed lookup against `regen.dag`'s `data _entry: LensRegistryEntry` records. | -| Authority source | `src/v3/compiler/regen.dag` — the bin reads 11 `LensRegistryEntry` records here (verified `grep -c "_entry: LensRegistryEntry" src/v3/compiler/regen.dag`). | +| Authority source | `src/v3/compiler/regen.dag` — the bin reads **9** `data …_entry: LensRegistryEntry` rows (`rg -n '^data .*_entry: LensRegistryEntry'`). A broader `_entry: LensRegistryEntry` match counts comment lines too — use the anchored query for totals (see §Delta — 2026-05-05). | ## Internal crate imports (the bin's PB-Runtime-equivalent surfaces) @@ -53,7 +53,7 @@ These imports are what the future `BinShim` emitter must end up calling from emi |---|---|---| | **Cargo bin entry** | `src/v3/compiler/Cargo.toml`: `[[bin]] name = "regen_lens" path = "src/bin/regen_lens.rs"` | `path` updates to the emitted location once the file is generated. The `name = "regen_lens"` and CLI invocation surface stay stable so the nine-bin Cargo manifest's authority surface is unchanged (binary name is what tooling and diagnostics key on). | | **`build.rs` `REGEN_OUTPUTS`** | `src/v3/compiler/build.rs:479-513` (25 entries on origin/main HEAD at audit time) | Add the emitted shim's path to `REGEN_OUTPUTS` so SG-0's `sg0_generated_partition_is_producer_owned` invariant counts the file as generated. The current `REGEN_OUTPUTS` lists every per-lens `lens_*_generated.rs` (the bin's *outputs*) but NOT the bin itself — `regen_lens.rs` is the producer, not a generated artifact. After retirement, the bin moves from "hand-authored producer" to "generated artifact" and the manifest grows by 1. | -| **`GENERATED_FILES` runtime constant** | Built from `REGEN_OUTPUTS` per `build.rs:520-526`, exposed as `v3_compiler::generated_files::GENERATED_FILES`. | Auto-updates when `REGEN_OUTPUTS` grows; no separate edit. The bin imports this exact constant (line 22), so its own re-emission produces a consistent self-reference. | +| **`GENERATED_FILES` runtime constant** | `REGEN_OUTPUTS` (`build.rs:479-513`) is iterated into the emitted manifest (`build.rs:514-526` writes `out_dir/v3_generated_files.rs` with `pub static GENERATED_FILES: &[&str]`); exposed as `v3_compiler::generated_files::GENERATED_FILES`. | Auto-updates when `REGEN_OUTPUTS` grows; no separate edit. The bin imports this exact constant (`regen_lens.rs` line 22), so its own re-emission produces a consistent self-reference. | | **Package `v3-compiler` declares nine explicit `[[bin]]` targets** (`regen_bootstrap`, `regen_lens`, `regen_parse`, `regen_parse_tables`, `regen_tokenize`, `regen_v3`, `emit_method_template_projection`, `self_host_fixed_point`, `r1c_e_emit_gates`) | `src/v3/compiler/Cargo.toml:47-85` `[[bin]]` blocks | Other bins follow the same template after `regen_lens` lands as the canonical first slice (per design-doc §4.3 + BinShim brief §"First slice"). They are NOT in scope for sub-gate 3 — but they ARE in scope for the broader BinShim retirement program once the carrier and pattern stabilize. | ## SG-0 census surface diff --git a/docs/briefs/r3-pb-regen-lens-first-binshim-target-retirement-readiness.md b/docs/briefs/r3-pb-regen-lens-first-binshim-target-retirement-readiness.md index b88e401189d..1e05e055cae 100644 --- a/docs/briefs/r3-pb-regen-lens-first-binshim-target-retirement-readiness.md +++ b/docs/briefs/r3-pb-regen-lens-first-binshim-target-retirement-readiness.md @@ -4,7 +4,7 @@ **Purpose.** One place to answer: “What must be true before `src/v3/compiler/src/bin/regen_lens.rs` may be deleted and replaced by emitted-from-`.dag` Rust?” This doc **does not** authorize implementation, deletion, or `.dag` instance rows; it tracks **owners** and **STOP** routing so PB Manager can clear dispatch without re-deriving facts from three parent briefs. -**Non-authority.** Actual retirement waits for **PB-Runtime Item 4** (transitive emitter discipline), **Substrate-owned `BinShim` carrier**, **declaration framework + instance authoring** under `dsl/std/runtime/bin_shims/` (separate worker scope), **BinShim emitter**, then a **retirement PR** that lands equivalence + census deltas together. Until then, treat every row below as “not green for retirement.” +**Non-authority.** Actual retirement waits for **PB-Runtime Item 4** (transitive emitter discipline), **declaration framework + instance authoring** under `dsl/std/runtime/bin_shims/` (`regen_lens_main` / `data regen_lens_shim` — separate worker scope), **BinShim emitter**, **§7.2 equivalence**, then a **retirement PR** that lands census deltas together with behavioral proof. The **`BinShim` substrate carrier is already on `main`** ([`src/v3/std/bin_shim.dag`](../../src/v3/std/bin_shim.dag)); carrier introduction is **not** a remaining gate — remaining gaps are emit pattern, instance row, §7.2, Item 4 convergence, and §7.3 disposition (see §Required design objects and §Dispatch-ready row). Until dispatch-ready criteria hold, treat every row below as “not green for retirement.” **Scope boundary.** This checklist intentionally **does not** specify `.dag` syntax for `data regen_lens_shim: BinShim = { … }` or touch `dsl/std/runtime/bin_shims/**` contents — that write scope is assigned elsewhere (declaration framework + instances). This file is readiness + accountability only. From 9ddb0a6d5c4865b228a6c1cf615c80c9fc805372 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 6 May 2026 18:53:26 +0000 Subject: [PATCH 3/4] docs(briefs): fix markdown table row trailing pipe (readiness checklist) Non-blocking review: Required design objects row for BinShim carrier was missing the closing | on the last column. Co-authored-by: Cursor --- ...3-pb-regen-lens-first-binshim-target-retirement-readiness.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/briefs/r3-pb-regen-lens-first-binshim-target-retirement-readiness.md b/docs/briefs/r3-pb-regen-lens-first-binshim-target-retirement-readiness.md index 1e05e055cae..ee8d3dc3775 100644 --- a/docs/briefs/r3-pb-regen-lens-first-binshim-target-retirement-readiness.md +++ b/docs/briefs/r3-pb-regen-lens-first-binshim-target-retirement-readiness.md @@ -20,7 +20,7 @@ | Object | What “live” means | Retirement blocker until | |--------|-------------------|---------------------------| -| **`BinShim` carrier** | Substrate-declared record type per design doc section 4.2; live shape: `entrypoint_name`, `description`, `entry: DeclarationRef` in [`src/v3/std/bin_shim.dag`](../../src/v3/std/bin_shim.dag). | **Landed on `main`** — verified `origin/main @ 194ddb7a8` (warm-ant-877 mechanical audit, 2026-05-06). **`BinShim` carrier introduction is not a remaining retirement blocker.** Retirement remains gated on Item 5 emit pattern, `regen_lens_main` + instance row, §7.2, Item 4 convergence, §7.3 disposition — see §Dispatch-ready row. **STOP:** carrier-shape pressure during instance authoring → Substrate Manager P1 per design doc section 5.4 — **do not** invent fields ad hoc from the PB lane. +| **`BinShim` carrier** | Substrate-declared record type per design doc section 4.2; live shape: `entrypoint_name`, `description`, `entry: DeclarationRef` in [`src/v3/std/bin_shim.dag`](../../src/v3/std/bin_shim.dag). | **Landed on `main`** — verified `origin/main @ 194ddb7a8` (warm-ant-877 mechanical audit, 2026-05-06). **`BinShim` carrier introduction is not a remaining retirement blocker.** Retirement remains gated on Item 5 emit pattern, `regen_lens_main` + instance row, §7.2, Item 4 convergence, §7.3 disposition — see §Dispatch-ready row. **STOP:** carrier-shape pressure during instance authoring → Substrate Manager P1 per design doc section 5.4 — **do not** invent fields ad hoc from the PB lane. | | **`std.process.ProcessExit`** | Entry functions return the existing substrate carrier (design doc section 4.2 cites `dsl/std/process.dag`). | **Substrate** (already authoritative on `main` at design-lock authoring; re-verify at dispatch). Owner for regression: **Substrate Manager**. | | **Item 5 emit pattern** | `.dag` emitter translates each `BinShim` data instance to one `AUTO-GENERATED` Rust `main` template (design doc section 4.2); mirrors other Rust emit modules (anti-bridge invariant #4). | **PB Manager** — BinShim brief deliverable 2; implementation worker TBD at dispatch. **STOP:** parallel emit logic / divergence from `dsl/extdeps/languages/rust/emit.dag` shape → escalate per [`r3-pb-binshim-retirement-worker.md`](r3-pb-binshim-retirement-worker.md) STOP section. | | **`data regen_lens_shim: BinShim = { … }`** | Pure-data witness of the current `regen_lens` pipeline under `dsl/std/runtime/bin_shims/` (paths TBD per BinShim program). | **PB-assigned worker** owning `dsl/std/runtime/bin_shims/` (declaration framework + per-shim rows per BinShim brief deliverable 1). *Do not* conflate this checklist’s author with that write scope. | From 615533bca458313ccaaab27eeb5f0b8d5d722d30 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 6 May 2026 19:53:00 +0000 Subject: [PATCH 4/4] docs(briefs): align handoff wording after BinShim carrier landed - Instance-authoring owner row: drop 'on carrier landing'; dispatch is for the bin_shims slice, not contingent on carrier introduction. - Section heading: replace 'future BinShim carrier' with landed-carrier framing. Addresses composer-2 APPROVE_WITH_COMMENTS on PR #1847. Co-authored-by: Cursor --- docs/briefs/r3-pb-regen-lens-consumer-audit.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/briefs/r3-pb-regen-lens-consumer-audit.md b/docs/briefs/r3-pb-regen-lens-consumer-audit.md index 5823292fe88..c02d7763140 100644 --- a/docs/briefs/r3-pb-regen-lens-consumer-audit.md +++ b/docs/briefs/r3-pb-regen-lens-consumer-audit.md @@ -92,14 +92,14 @@ These imports are what the future `BinShim` emitter must end up calling from emi | `docs/audit/t-v2-retirement-audit.md` §"1. STOP conditions for implementation" S-3 row | S-3 entry (`regen_lens.rs` retirement) — "NOT MET" | Flips to "MET" when retirement lands. | | `docs/briefs/t-pb-a-lens-producer-priority-slice-first-retirement-worker.md` §"Lens producers / lens-adjacent (priority-slice candidates)" `regen_lens.rs` row + §"Queue after Slice 1 (recommended order for follow-on briefs)" Tier-1/regen entry | Earlier T-PB-A scoping ("Tier-1 / regen: regen_lens.rs — depends on PB-1 + emit") | Already names the dependency chain; informational. | -## Handoff points for the future `BinShim` carrier + instance + emitter + §7.2 fixture +## Handoff points — landed `BinShim` carrier; instance + emitter + §7.2 fixture This is the load-bearing audit deliverable: a per-handoff row naming exactly what each future PR consumes from this audit. | Handoff | Owner | Consumes from this audit | What that PR adds | |---|---|---|---| | **`type BinShim` carrier** | Substrate Manager — **landed on main** (`src/v3/std/bin_shim.dag:19-23`) | Live substrate record: `entrypoint_name: NonEmptyStr`, `description: String`, `entry: DeclarationRef` (points at a `.dag` entry function for the shim body — see [`dsl/std/runtime/bin_shims/README.md`](../../dsl/std/runtime/bin_shims/README.md) naming convention). Design-doc §4.2 sketches historically used a `name` field; scheduled work keys off **`entrypoint_name`** matching the Cargo `[[bin]]` name (`"regen_lens"`). **`entry` resolves in substrate** to the declaration named by the ref — not to `LENS_REGISTRY_ENTRY_TYPE` at line 26 of `regen_lens.rs`, which tags rows inside `regen.dag`. Hand-Rust `fn main() -> ExitCode` (line 33) remains the behavioral model for §7.2 until `.dag` entry replaces it. | No further carrier-introduction PR required for retirement chain; regressions remain Substrate-owned per §5.4. | -| **`data regen_lens_shim: BinShim` instance authoring** | PB Manager (R3 worker, dispatched by PB on carrier landing) | Field values from the audit's "Source surface" + "Internal crate imports" tables. The `entry` field references a `regen_lens_main` declaration that fold-mirrors the current `fn main` body via the locked PB-Runtime emit pattern. | New file `dsl/std/runtime/bin_shims/regen_lens.dag` per the framework convention in PR #1347. | +| **`data regen_lens_shim: BinShim` instance authoring** | PB Manager (R3 worker; PB dispatch for the `dsl/std/runtime/bin_shims/` instance slice — **not** contingent on carrier introduction, which is already on `main`) | Field values from the audit's "Source surface" + "Internal crate imports" tables. The `entry` field references a `regen_lens_main` declaration that fold-mirrors the current `fn main` body via the locked PB-Runtime emit pattern. | New file `dsl/std/runtime/bin_shims/regen_lens.dag` per the framework convention in PR #1347. | | **BinShim emit pattern (the `.dag` emitter)** | PB Manager (R3 worker) | The bin's import surface (the 5 internal crates listed above) — the emitter must produce emitted Rust that calls these same crate APIs, since they are NOT being retired (they're producer-side authority). | New `.dag` emitter program analogous to `dsl/extdeps/languages/rust/emit.dag` per design-doc §4.2 + anti-bridge invariant #4. | | **§7.2 equivalence fixture authoring** | PB Manager (R3 worker) — same retirement PR | The behavioral spec from the bin's docstring + `sg6_regen_lens_cli_smoke_regenerates_named_entry_without_drift` test (which IS the runtime evidence base). The fixture asserts: emitted-Rust + hand-Rust produce identical regenerated `lens_*_generated.rs` output for every `LensRegistryEntry` in `regen.dag`. | TestClaim `regen_lens_bin_shim_emits_behaviorally_equivalent_to_hand_rust` per design-doc §7.2 locked name. | | **Cargo `path` flip** | PB Manager (same retirement PR) | The Cargo `[[bin]]` block at `Cargo.toml` (above). | `path = "src/bin/regen_lens.rs"` updates to whatever absolute path the emitted file lands at (or stays the same if the emitter writes to the same path). |