From c3b420bf98f19d81fb225d8dfcf96777779f7200 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 30 Apr 2026 22:48:32 +0000 Subject: [PATCH 1/9] docs(r3): T-V2-Retirement bounded planning/audit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per Director dispatch via cool-stag-230 (R3 PB): T-V2-Retirement was absorbed into R3 on 2026-04-30 (PR #1319, "nothing deferred past R3" directive). This is a planning/audit slice ahead of any implementation. PM-authored T-V2-Retirement worker brief is NOT yet on main; this audit records that as STOP condition S-1 and proceeds with bounded inventory + gate disposition only. No code, test, or workspace changes. Centers on the two Director-named gates: - v2_oracle_no_remaining_test_consumers (G-1): 2 substantive test consumers identified (p0_std_render_repeat_string_test, m2_substrate_inhabitance_test::v3_kernel_algebra_profile_mirror_*). - v2_directory_deleted (G-2): blocked by G-1 + PB-Runtime trampoline (S-4) + legacy emit chain retirement + verification.dag convergence. Per-gate fields per dispatch: current consumers, owner, prerequisites, STOP condition, what counts as green. Sequencing diagram in §4. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/audit/t-v2-retirement-audit.md | 158 ++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) create mode 100644 docs/audit/t-v2-retirement-audit.md diff --git a/docs/audit/t-v2-retirement-audit.md b/docs/audit/t-v2-retirement-audit.md new file mode 100644 index 00000000000..72e8f2414d8 --- /dev/null +++ b/docs/audit/t-v2-retirement-audit.md @@ -0,0 +1,158 @@ +# T-V2-Retirement — Bounded Planning / Audit + +**Status:** PROPOSAL (audit only). Authored 2026-04-30 (silent-boar-29) per Director dispatch via cool-stag-230 (R3 PB). +**Authority basis:** `docs/r3-structure.md` §11 row "T-V2-Retirement" + ROADMAP §"v2 retirement" (PR #1319, 2026-04-30 user directive *"nothing can be deferred past R3"*). +**Scope:** planning + audit only. **No code/test/build changes.** No deletions, no workspace edits, no v2/v3 import bridge, no PB-Runtime trampoline implementation. + +--- + +## 1. STOP conditions for implementation + +Implementation MUST NOT begin until all of the following are green. This audit treats them as hard preconditions. + +| # | STOP condition | State at audit time | +|---|---|---| +| S-1 | PM-authored `T-V2-Retirement` worker brief landed under `docs/briefs/` | **NOT MET** — `docs/briefs/` contains no `t-v2-retirement-*` or equivalent file as of `origin/main` HEAD `5e6b48b40`. PB manager standing brief (`docs/briefs/r2-pure-bootstrap-manager.md`, refreshed 2026-04-28) predates the 2026-04-30 lane absorption and does not yet enumerate T-V2-Retirement under §"R3 lanes". | +| S-2 | T-FixedPoint closed | NOT MET (R3 in flight; gate per `r3-structure.md` Lane 5). | +| S-3 | T-LensProducer-Retirement closed (all 3 sub-gates: `lens_apply.rs`, `lens_testgen.rs`, `regen_lens.rs`) | NOT MET (R3 in flight; sub-gates per `r2-pure-bootstrap-manager.md` row T-LensProducer-Retirement + `design-pb-runtime-interpreter.md` §5.1). | +| S-4 | PB-Runtime trampoline lands such that bootstrap no longer routes through `src/v2/stage0` | NOT MET (PB-Runtime interpreter-as-data is the gate per `design-pb-runtime-interpreter.md` §3). | + +Per dispatch: violation of any STOP-condition row blocks T-V2-Retirement implementation work. Audit work (this doc, refinements, consumer-list updates) is unblocked. + +--- + +## 2. v2 footprint inventory (audit snapshot at HEAD `5e6b48b40`) + +### 2.1 `src/v2/` source tree + +- **79 `.rs` files** under `src/v2/` (`find src/v2 -name '*.rs' | wc -l`). +- **32 `.dag` files** under `src/v2/` (`find src/v2 -name '*.dag' | wc -l`). + - r3-structure.md §11 cites "~28 `.dag`"; current count is 32. Audit-time correction; not load-bearing for either gate. + +### 2.2 Workspace / Cargo references to v2 + +`Cargo.toml` (`/Cargo.toml:5-7`): +``` +members = [ + "src/v2/stage0", # v2 self-hosted compiler + "src/v2/tests", # v2 self-hosted compiler tests + ... +] +``` + +`src/v3/compiler/Cargo.toml:32-33`: +``` +v2-compiler = { path = "../../v2/stage0" } +v2-compiler-tests = { path = "../../v2/tests" } +``` + +These are the only Cargo edges from non-`src/v2/` crates into v2. **Both are gated by gate G-2** (§3.2). + +### 2.3 Tests / consumers that import or read v2 + +Search: `grep -rln 'src/v2/\|v2_compiler\b' src/ tests/` excluding `src/v2/` itself. After filtering doc-comment-only matches, **substantive consumers are**: + +| Consumer | Kind of dependency | Removal class | +|---|---|---| +| `src/v3/compiler/Cargo.toml` (lines 32-33) | Cargo `path =` deps on `v2-compiler` + `v2-compiler-tests` | drops with G-1 (after all callers below dissolve) | +| `src/v3/compiler/tests/integration/p0_std_render_repeat_string_test.rs` | Uses `v2_compiler::v2_compiler_compile::compile_to_resolved`, `v2_compiler::v2_interpreter`, `v2_compiler_tests::helpers::resolve_imports_transitively` as **behavior oracle** for `repeat_string` lower-time fold | **Test consumer** — directly counts against `v2_oracle_no_remaining_test_consumers`. Owner: PB Manager (per lane). Disposition: replace v2 oracle with v3 evaluator equivalence-corpus row, OR delete the test if the property is structurally guaranteed. | +| `src/v3/compiler/tests/integration/m2_substrate_inhabitance_test.rs` | `v3_kernel_algebra_profile_mirror_matches_v2_stage0_authority` (line 991) compares v3 `dag::kernel_algebra_profile` against `v2_compiler::std_algebra::kernel_algebra_profile()`. Dual-authority drift ratchet. | **Test consumer** — counts against G-1. Disposition: once v3 substrate inhabitance is the single authority (via `dsl/std/algebra.dag`), retire the v2-mirror parity test; v3-side authority continues under the existing inhabitance suite. Cross-ref `feedback_isomorphism_or_generation_for_mirrors.md`. | +| `src/v3/compiler/tests/integration/cementing/cementing_lens_registry_dispatch_test.rs` (line 140) | String literal `"src/v2/complexity.dag (5488L)"` only — **not a code dependency** | **NOT a G-1 consumer**; cosmetic update at deletion time. | +| `src/v3/compiler/src/dag.rs` (lines 526, 983, 1562, 1598, 1602, 3102) | Doc-comment references to v2 only; no `use v2_compiler` | **NOT a G-1 consumer**; comment hygiene at deletion time. | +| `src/v3/std/anthropic_operations.dag:20`, `src/v3/std/rust_method_template_contracts.dag:21`, `src/v3/lenses/complexity.dag:13` | Doc-comment references | **NOT a G-1 consumer**; comment hygiene. | +| `src/v3/SELF_HOSTING.md` | Doc reference | **NOT a G-1 consumer**. | + +**Test-consumer count for `v2_oracle_no_remaining_test_consumers`: 2** (`p0_std_render_repeat_string_test.rs`, `m2_substrate_inhabitance_test.rs`). Plus the entire `src/v2/tests` crate (15 test files), which is internal to v2 and falls with G-2 (workspace member removal). + +### 2.4 Legacy emit chain + +Per `src/v3/std/rust_method_template_contracts.dag:1-22` (header note): the v2 emit pipeline still consumes the legacy `rust_simple_method_specs` / `rust_method_templates()` / `rust_method_wraps_result()` chain in `dsl/extdeps/languages/rust/emit.dag` because v2 has no bootstrap-Dag consumer infrastructure. **Full retirement of those legacy authorities is part of T-V2-Retirement scope** (already named in the file's header comment). When G-2 fires, the `dsl/extdeps/languages/{rust,python,go}/emit.dag` legacy chain becomes deletable (audited at deletion time, not now). + +### 2.5 Dual `verification.dag` convergence + +Per ROADMAP.md §"File-preference rank is a ratified-parallel-authority scaffold": `module std.verification` exists at both `dsl/std/verification.dag` (v2 surface: `AssertKind / TestClaim / TestCase`) and `src/v3/std/verification.dag` (v3 surface: `DiagnosticKind / DiagnosticReference / PortStateExpectation`). The two surfaces are **disjoint today**; convergence requires a design call on which surface wins (or whether both are kept under disjoint module paths). + +**Audit position:** convergence of `verification.dag` is a **prerequisite for G-2** (deleting `src/v2/` requires that no surviving authority depends on the v2 `verification.dag` surface). It is **NOT** a prerequisite for G-1 (test-consumer dissolution does not require the convergence). Owner: Substrate Manager (continuation) for the design call; PB Manager for the v2-side deletion once the call lands. + +### 2.6 Bootstrap path + +Bootstrap currently routes through `src/v2/stage0`. Until PB-Runtime trampoline lands (S-4), G-2 is structurally blocked: removing `src/v2/stage0` from the workspace breaks the build chain. PB-Runtime trampoline is the **structural prerequisite** that converts `src/v2/` from "active bootstrap dependency" to "pure historical reference." + +--- + +## 3. Gate-by-gate disposition + +### 3.1 Gate G-1 — `v2_oracle_no_remaining_test_consumers` + +| Field | Value | +|---|---| +| **Definition** | No test outside `src/v2/` references `v2_compiler` or `v2_compiler_tests` crates (substantive `use` / function call, not doc-comment / string-literal). | +| **Current consumers (count: 2)** | `src/v3/compiler/tests/integration/p0_std_render_repeat_string_test.rs`; `src/v3/compiler/tests/integration/m2_substrate_inhabitance_test.rs`. Plus the Cargo edges in `src/v3/compiler/Cargo.toml:32-33` which become removable once both tests dissolve. | +| **Owner** | PB Manager (R3 continuation); cross-ref Substrate Manager for `kernel_algebra_profile` authority migration. | +| **Prerequisites** | (a) v3-side replacement for the `repeat_string` lower-time-fold oracle (equivalence-corpus row backed by v3 evaluator, OR proof that the property is structurally guaranteed and the test is redundant). (b) v3-side single-authority for `kernel_algebra_profile` such that the v2-mirror parity test is no longer load-bearing. | +| **STOP condition for G-1 work** | S-1 (PM worker brief). Without the brief, the per-test disposition (replace vs. delete) is not authorized. | +| **What counts as green** | A grep over `src/v3/compiler/tests/` and `tests/` for `v2_compiler\b` or `v2_compiler_tests\b` returns zero matches in non-doc-comment positions. Cargo edges in `src/v3/compiler/Cargo.toml:32-33` deleted. `cargo test --workspace --exclude v2-compiler-tests` still passes (i.e., test coverage was not silently dropped). Receipt artifact: short closure note linking to the two test dispositions. | + +### 3.2 Gate G-2 — `v2_directory_deleted` + +| Field | Value | +|---|---| +| **Definition** | `src/v2/` directory removed; `Cargo.toml` workspace `members` no longer lists `src/v2/stage0` or `src/v2/tests`; bootstrap chain routes through PB-Runtime trampoline only. | +| **Current consumers** | The build itself (workspace members), via `src/v2/stage0` as bootstrap source-of-truth; the legacy emit chain (`dsl/extdeps/languages/{rust,python,go}/emit.dag` — `rust_simple_method_specs`, `rust_method_templates()`, `rust_method_wraps_result()`); the `dsl/std/verification.dag` v2 surface. | +| **Owner** | PB Manager (R3 continuation). | +| **Prerequisites** | (a) **G-1 green** (no test consumers). (b) **S-4 green** — PB-Runtime trampoline is the live bootstrap. (c) Legacy emit chain (§2.4) retired or migrated to v3 authorities. (d) `verification.dag` convergence design-call landed (§2.5) and v2 surface no longer load-bearing for any surviving authority. | +| **STOP condition for G-2 work** | S-1 + S-4 + G-1. | +| **What counts as green** | `find src/v2 -type f` returns empty (or directory does not exist). `Cargo.toml` workspace `members` array does not contain any `src/v2/...` entry. `cargo build --workspace` + `cargo test --workspace` both pass with no remaining `v2-compiler*` references. `dsl/extdeps/languages/{rust,python,go}/emit.dag` legacy chain deleted or audited as no-consumer. PR description includes an explicit checklist mapping each prerequisite (a)-(d) to a closed receipt. | + +--- + +## 4. Consequence chain (why the gates are in this order) + +``` +S-2 T-FixedPoint ──┐ +S-3 T-LensProducer ─┼──> S-4 PB-Runtime trampoline live ──> G-2 prerequisite (b) + │ +S-1 PM brief ───────┴──> G-1 dispositions authorized ──> G-1 green ──> G-2 prerequisite (a) + │ + legacy emit chain retired (§2.4) ───────────────────►├──> G-2 green + │ + verification.dag convergence (§2.5) ────────────────►┘ +``` + +**Consequence:** T-V2-Retirement is structurally a *consequence* of T-FixedPoint + T-LensProducer-Retirement + the legacy-emit / verification convergence work — not a parallel program. Pulling it into R3 (per Director directive) is structurally cheap precisely because the dependency edges are already named; the lane carries auditing + sequencing, not new substrate. + +--- + +## 5. Non-goals (audit-time reaffirmation) + +- **No code deletion** as part of this audit. All deletions wait on §3 prerequisites. +- **No workspace member removal.** Both `src/v2/stage0` and `src/v2/tests` remain workspace members until G-2 fires. +- **No test rewiring.** The two G-1 consumer tests are catalogued, not modified. +- **No v2/v3 import bridge.** Per `feedback_no_textual_enforcement_bridges.md` + `feedback_construction_over_ratchets.md`: do not introduce a re-export shim or compatibility module to "ease" deletion. Either the consumer dissolves to a v3-native equivalent, or the test is deleted with a receipt. +- **No PB-Runtime trampoline implementation** in this lane — that work belongs to T-LensProducer-Retirement / T-FixedPoint and is a *prerequisite*, not a sub-task, of T-V2-Retirement. +- **No claim that T-V2-Retirement implementation can start before its STOP conditions are green.** + +--- + +## 6. Open audit questions (for PM brief author) + +These are NOT decisions — they are routing questions the PM-authored worker brief should resolve: + +1. **G-1 disposition for `p0_std_render_repeat_string_test.rs`:** replace with v3 evaluator row, or delete as redundant (if `repeat_string` lower-time fold is structurally guaranteed)? Cross-ref `r3-pb-runtime-equivalence-corpus-seed-audit.md`. +2. **G-1 disposition for `m2_substrate_inhabitance_test.rs::v3_kernel_algebra_profile_mirror_matches_v2_stage0_authority`:** which v3-side authority replaces `v2_compiler::std_algebra::kernel_algebra_profile()` as the single source? Owner of the migration: PB or Substrate? +3. **§2.5 `verification.dag` convergence:** which surface wins — v2's `AssertKind/TestClaim/TestCase`, v3's `DiagnosticKind/DiagnosticReference/PortStateExpectation`, or both under disjoint module paths? Substrate Manager design call. +4. **§2.4 legacy emit chain:** retire under T-V2-Retirement scope, or split into a sibling sub-lane? Header note in `rust_method_template_contracts.dag` already names retirement as deferred to "Pure-Bootstrap-Zero / v2 retirement scope" — confirm scope boundary. + +--- + +## 7. Acceptance summary + +This audit is intentionally bounded: + +- **Inventory:** §2 (v2 footprint, consumers, legacy emit chain, dual verification surface, bootstrap path). +- **Gate dispositions:** §3 (G-1, G-2 — each with consumers, owner, prerequisites, STOP condition, green criteria). +- **Sequencing:** §4 (consequence chain). +- **Non-goals:** §5. +- **Routing for PM brief:** §6. + +**Implementation remains gated on §1 STOP conditions, foremost S-1 (PM worker brief).** This document is suitable input for that brief. From 8fc00711fb7f4d1cd47bab76b19747f811fa45b5 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 30 Apr 2026 23:59:54 +0000 Subject: [PATCH 2/9] docs(audit): tighten T-V2-Retirement authority-basis citation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewer flagged that ROADMAP §"v2 retirement" is not a real anchor. Verified: ROADMAP.md has inline scope references at lines 366 and 421 but no dedicated section. r3-structure.md is the actual live anchor (Lane structure §11 + §165). Replace the loose citation with the precise one and call out PR #1319 (commit a83b58bbd) as the ratifying merge. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/audit/t-v2-retirement-audit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/audit/t-v2-retirement-audit.md b/docs/audit/t-v2-retirement-audit.md index 72e8f2414d8..a87dc54ad7f 100644 --- a/docs/audit/t-v2-retirement-audit.md +++ b/docs/audit/t-v2-retirement-audit.md @@ -1,7 +1,7 @@ # T-V2-Retirement — Bounded Planning / Audit **Status:** PROPOSAL (audit only). Authored 2026-04-30 (silent-boar-29) per Director dispatch via cool-stag-230 (R3 PB). -**Authority basis:** `docs/r3-structure.md` §11 row "T-V2-Retirement" + ROADMAP §"v2 retirement" (PR #1319, 2026-04-30 user directive *"nothing can be deferred past R3"*). +**Authority basis:** `docs/r3-structure.md` Lane structure §11 row "T-V2-Retirement" (added 2026-04-30) + `docs/r3-structure.md` §165 (the post-R3 → R3 move row). PR #1319 (commit `a83b58bbd`, "gunbc Director", 2026-04-30) is the ratifying merge; it carries the user directive *"nothing can be deferred past R3."* `ROADMAP.md` mentions "v2 retirement" inline at lines 366 and 421 as scope references, but does NOT carry a dedicated `§"v2 retirement"` section — `r3-structure.md` is the live anchor. **Scope:** planning + audit only. **No code/test/build changes.** No deletions, no workspace edits, no v2/v3 import bridge, no PB-Runtime trampoline implementation. --- From c89f053d837b58ef463811cdf9207d9f6b7d9156 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 1 May 2026 00:02:07 +0000 Subject: [PATCH 3/9] docs(audit): Cargo edges drop with G-1, not G-2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewer flagged §2.2 contradicted §2.3 row 1 + §3.1 green criteria. The two v2-* path deps in src/v3/compiler/Cargo.toml exist purely to support the 2 test consumers; once those dissolve the deps are dead, so they must drop with G-1, not wait on G-2. G-2 still owns workspace- member removal for src/v2/stage0 and src/v2/tests themselves. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/audit/t-v2-retirement-audit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/audit/t-v2-retirement-audit.md b/docs/audit/t-v2-retirement-audit.md index a87dc54ad7f..f1be9c4cfff 100644 --- a/docs/audit/t-v2-retirement-audit.md +++ b/docs/audit/t-v2-retirement-audit.md @@ -46,7 +46,7 @@ v2-compiler = { path = "../../v2/stage0" } v2-compiler-tests = { path = "../../v2/tests" } ``` -These are the only Cargo edges from non-`src/v2/` crates into v2. **Both are gated by gate G-2** (§3.2). +These are the only Cargo edges from non-`src/v2/` crates into v2. **Both edges drop with G-1** (§3.1) — they exist solely to support the two test consumers in §2.3, so once those dissolve the deps are dead and must be deleted as part of G-1 closure (§3.1 green criteria explicitly require this). G-2 then removes the `src/v2/stage0` and `src/v2/tests` workspace members themselves. ### 2.3 Tests / consumers that import or read v2 From bd93986f75d28633750d64abb56caaf63a02ca5c Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 1 May 2026 01:21:18 +0000 Subject: [PATCH 4/9] docs(audit): clarify per-gate STOP authority + fix v2 search regex MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewer flagged two issues on c30d0cce: 1. BLOCKING (single-authority gate language): §1 said implementation MUST NOT begin until ALL STOPs green, but §3.1 G-1.STOP only required S-1. Two authorities for the same question. Resolved by making §3 the single authority and clarifying per-gate scope: G-1 (test-consumer dissolution) needs only S-1; G-2 (workspace deletion) needs S-1+S-2+S-3+S-4+G-1. 2. NON-BLOCKING (grep pattern): v2_compiler\\b doesn't match v2_compiler_tests because _ is a word char. Corrected to '\\bv2_compiler(_tests)?\\b'. Re-ran on current tree; consumer inventory unchanged (the original pattern matched p0_std test via the 'v2_compiler::' substring, but the regex was technically buggy). Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/audit/t-v2-retirement-audit.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/audit/t-v2-retirement-audit.md b/docs/audit/t-v2-retirement-audit.md index f1be9c4cfff..683dccc9069 100644 --- a/docs/audit/t-v2-retirement-audit.md +++ b/docs/audit/t-v2-retirement-audit.md @@ -8,7 +8,11 @@ ## 1. STOP conditions for implementation -Implementation MUST NOT begin until all of the following are green. This audit treats them as hard preconditions. +STOP conditions are hard preconditions, but they do **not** all gate the same work. Per-gate authority — single source for "may this work begin?": + +- **G-1 (test-consumer dissolution) implementation may begin once S-1 is green.** S-2/S-3/S-4 are NOT prerequisites for G-1: replacing the two v2-oracle test consumers (§2.3) with v3 evaluator equivalents — or deleting them as redundant — needs only the PM-authored disposition (S-1). The v3 evaluator already exists; no FixedPoint/LensProducer/PB-Runtime work is structurally required to retire those two tests. +- **G-2 (workspace-member deletion + `src/v2/` removal) implementation may not begin until S-1 + S-2 + S-3 + S-4 + G-1 are all green** (per §3.2 prerequisites). +- **Audit work** (this doc, refinements, consumer-list updates) is unblocked at all times. | # | STOP condition | State at audit time | |---|---|---| @@ -17,7 +21,7 @@ Implementation MUST NOT begin until all of the following are green. This audit t | S-3 | T-LensProducer-Retirement closed (all 3 sub-gates: `lens_apply.rs`, `lens_testgen.rs`, `regen_lens.rs`) | NOT MET (R3 in flight; sub-gates per `r2-pure-bootstrap-manager.md` row T-LensProducer-Retirement + `design-pb-runtime-interpreter.md` §5.1). | | S-4 | PB-Runtime trampoline lands such that bootstrap no longer routes through `src/v2/stage0` | NOT MET (PB-Runtime interpreter-as-data is the gate per `design-pb-runtime-interpreter.md` §3). | -Per dispatch: violation of any STOP-condition row blocks T-V2-Retirement implementation work. Audit work (this doc, refinements, consumer-list updates) is unblocked. +The §3 gate rows (G-1.STOP, G-2.STOP) are the single authority for which STOP rows block which work; this section's table records state only. --- @@ -50,7 +54,7 @@ These are the only Cargo edges from non-`src/v2/` crates into v2. **Both edges d ### 2.3 Tests / consumers that import or read v2 -Search: `grep -rln 'src/v2/\|v2_compiler\b' src/ tests/` excluding `src/v2/` itself. After filtering doc-comment-only matches, **substantive consumers are**: +Search: `grep -rEln 'src/v2/|\bv2_compiler(_tests)?\b' src/ tests/` excluding `src/v2/` itself. (Earlier drafts used `v2_compiler\b`, which fails to match `v2_compiler_tests` because `_` is a word character; the corrected pattern covers both crates explicitly.) After filtering doc-comment-only matches, **substantive consumers are**: | Consumer | Kind of dependency | Removal class | |---|---|---| From bb7a628393118ed5f0e63cdeb1b59d015b2ee027 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 1 May 2026 01:45:09 +0000 Subject: [PATCH 5/9] =?UTF-8?q?docs(audit):=20align=20G-2=20STOP=20row=20w?= =?UTF-8?q?ith=20=C2=A71=20(S-2+S-3=20explicit)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewer flagged §1 ('S-1+S-2+S-3+S-4+G-1') disagreed with §3.2 STOP row ('S-1+S-4+G-1') — same file gave two incompatible checklists for G-2. §3 was already named as single authority (§1 last bullet), so the §3.2 row was the one out of sync. Updated to match §1 and added the structural reason: S-2/S-3 closure is what makes S-4 the live bootstrap; without them, removing src/v2/stage0 breaks the build chain even with PB-Runtime present. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/audit/t-v2-retirement-audit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/audit/t-v2-retirement-audit.md b/docs/audit/t-v2-retirement-audit.md index 683dccc9069..c734d8cd84f 100644 --- a/docs/audit/t-v2-retirement-audit.md +++ b/docs/audit/t-v2-retirement-audit.md @@ -105,7 +105,7 @@ Bootstrap currently routes through `src/v2/stage0`. Until PB-Runtime trampoline | **Current consumers** | The build itself (workspace members), via `src/v2/stage0` as bootstrap source-of-truth; the legacy emit chain (`dsl/extdeps/languages/{rust,python,go}/emit.dag` — `rust_simple_method_specs`, `rust_method_templates()`, `rust_method_wraps_result()`); the `dsl/std/verification.dag` v2 surface. | | **Owner** | PB Manager (R3 continuation). | | **Prerequisites** | (a) **G-1 green** (no test consumers). (b) **S-4 green** — PB-Runtime trampoline is the live bootstrap. (c) Legacy emit chain (§2.4) retired or migrated to v3 authorities. (d) `verification.dag` convergence design-call landed (§2.5) and v2 surface no longer load-bearing for any surviving authority. | -| **STOP condition for G-2 work** | S-1 + S-4 + G-1. | +| **STOP condition for G-2 work** | S-1 + S-2 + S-3 + S-4 + G-1 (matches §1 per-gate authority). S-2 (T-FixedPoint) and S-3 (T-LensProducer-Retirement) are explicit prerequisites because their closure is what allows S-4 (PB-Runtime trampoline) to be the live bootstrap; without S-2+S-3, removing `src/v2/stage0` from the workspace breaks the build chain even if PB-Runtime is technically present. | | **What counts as green** | `find src/v2 -type f` returns empty (or directory does not exist). `Cargo.toml` workspace `members` array does not contain any `src/v2/...` entry. `cargo build --workspace` + `cargo test --workspace` both pass with no remaining `v2-compiler*` references. `dsl/extdeps/languages/{rust,python,go}/emit.dag` legacy chain deleted or audited as no-consumer. PR description includes an explicit checklist mapping each prerequisite (a)-(d) to a closed receipt. | --- From e12288c5a8cc3b27157fc9679b7a834cecc96d9a Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 1 May 2026 02:29:00 +0000 Subject: [PATCH 6/9] docs(r3): T-V2-Retirement per-surface migration matrix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to #1338. Per-file/per-surface mapping for gates G-1 (v2_oracle_no_remaining_test_consumers) and G-2 (v2_directory_deleted), covering the three populations dispatch named: - Population A: 13 internal src/v2/tests/src/*.rs files (fall with G-2, not G-1; coverage-migration question routed to PM brief). - Population B: 2 substantive G-1 consumers (p0_std_render_repeat_string, m2_substrate_inhabitance::v3_kernel_algebra_profile_mirror_*) — each with current dep / role / owner / proposed migration / prerequisite / STOP / green criteria. - Population C: doc-comment / string-literal references; cosmetic at G-2. Plus: - §4 legacy emit chain (rust_simple_method_specs / rust_method_templates / rust_method_wraps_result) — G-2 prerequisite, not G-1. - §5 dual verification.dag surface — routed to Substrate Manager per dispatch non-goals; no convergence shape proposed here. Docs-only mapping. No code/test/workspace/bridge changes. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../audit/t-v2-retirement-migration-matrix.md | 178 ++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 docs/audit/t-v2-retirement-migration-matrix.md diff --git a/docs/audit/t-v2-retirement-migration-matrix.md b/docs/audit/t-v2-retirement-migration-matrix.md new file mode 100644 index 00000000000..bce93132e6f --- /dev/null +++ b/docs/audit/t-v2-retirement-migration-matrix.md @@ -0,0 +1,178 @@ +# T-V2-Retirement — Per-Surface Migration Matrix + +**Status:** PROPOSAL (audit/planning only). Authored 2026-05-01 (silent-boar-29) per Director dispatch via cool-stag-230 (R3 PB). +**Parent:** `docs/audit/t-v2-retirement-audit.md` (#1338, merged). This doc is the next planning slice — per-surface mapping for gates `v2_oracle_no_remaining_test_consumers` (G-1) and `v2_directory_deleted` (G-2). +**Authority basis:** `docs/r3-structure.md` Lane structure §11 + §165 (PR #1319, 2026-04-30) + `docs/audit/t-v2-retirement-audit.md` §3 (gate authority) + `docs/design-test-infra.md:10-14` (dual `verification.dag` framing). +**Scope:** docs-only mapping. **No code/test rewiring; no v2 deletion; no workspace member changes; no v2/v3 import bridge; no decision on `verification.dag` convergence (routed to Substrate / Director).** + +--- + +## 1. Definitions reused from #1338 + +- **G-1** counts only test surfaces *outside* `src/v2/` that substantively reference `v2_compiler` or `v2_compiler_tests` crates (substantive `use` / call, not doc-comment / string literal). +- **G-2** owns workspace-member removal of `src/v2/stage0` + `src/v2/tests` and full `src/v2/` deletion; prerequisites include G-1 green + S-1..S-4. +- **STOP S-1** (PM-authored T-V2-Retirement worker brief) gates G-1 implementation. Until S-1 lands, this matrix is mapping only — no per-surface migration may be executed. + +Search command (corrected per #1338 review): `grep -rEln 'src/v2/|\bv2_compiler(_tests)?\b' src/ tests/` excluding `src/v2/`. + +--- + +## 2. Surface inventory at HEAD (`origin/main` 662567645) + +The r3-structure.md §11 phrase "~13 v2-using test files" resolves to **two distinct populations** that must not be conflated: + +### 2.1 Population A — internal to `src/v2/tests` crate (13 files) + +These import `v2_compiler::*` from inside the v2 tests crate. They are **internal to v2** and fall with **G-2** (workspace member removal of `src/v2/tests`). They do **NOT** count against G-1. + +``` +src/v2/tests/src/bootstrap.rs +src/v2/tests/src/derive_bound_fail_closed_test.rs +src/v2/tests/src/diagnostics.rs +src/v2/tests/src/effects.rs +src/v2/tests/src/helpers.rs +src/v2/tests/src/infer_semantics.rs +src/v2/tests/src/int_pow_bounded_test.rs +src/v2/tests/src/parse.rs +src/v2/tests/src/peano_materialization_cap_test.rs +src/v2/tests/src/pipeline.rs +src/v2/tests/src/render_repeat_test.rs +src/v2/tests/src/source_audit.rs +src/v2/tests/src/sub_value_lattice_factor_test.rs +``` + +(Plus `src/v2/tests/src/lib.rs` and `src/v2/tests/src/bug_sentinel_ratchet.rs` which do not directly import `v2_compiler` but are part of the same crate; total 15 files in `src/v2/tests/src/`.) + +**Migration disposition for Population A:** none individually. The crate retires as a unit when G-2's workspace-member removal fires. Per-test coverage migration (if any v2-tests-crate behavior is not already covered by v3-side tests) is the responsibility of the PM-authored worker brief — flagged as routing question §6.1. + +### 2.2 Population B — substantive G-1 consumers (2 files) + +These are the only test surfaces *outside* `src/v2/` that substantively reference v2 crates. Each is enumerated in §3 with disposition. + +``` +src/v3/compiler/tests/integration/p0_std_render_repeat_string_test.rs +src/v3/compiler/tests/integration/m2_substrate_inhabitance_test.rs +``` + +### 2.3 Population C — non-G-1 references (cosmetic at deletion) + +Doc-comments, string literals, README mentions. **Not** G-1 consumers; cleaned up cosmetically during G-2. + +| File | Kind | +|---|---| +| `src/v3/compiler/tests/integration/cementing/cementing_lens_registry_dispatch_test.rs:140` | string literal `"src/v2/complexity.dag (5488L)"` | +| `src/v3/compiler/src/dag.rs` (lines 526, 983, 1562, 1598, 1602, 3102) | doc-comments | +| `src/v3/lenses/complexity.dag:13` | doc-comment | +| `src/v3/std/anthropic_operations.dag:20` | doc-comment | +| `src/v3/std/rust_method_template_contracts.dag:21` | doc-comment + the legacy emit chain note (§4) | +| `src/v3/SELF_HOSTING.md` | doc reference | + +--- + +## 3. Population B — per-file G-1 disposition + +### 3.1 `src/v3/compiler/tests/integration/p0_std_render_repeat_string_test.rs` + +| Field | Value | +|---|---| +| Current dependency | `use v2_compiler::v2_compiler_compile::{compile_to_resolved, ResolvedPipelineResult}; use v2_compiler::v2_interpreter::{self, Value}; use v2_compiler_tests::helpers::resolve_imports_transitively;` | +| Role | Behavior oracle for the `repeat_string(s:, n:)` lower-time fold. Compiles a small program through the v2 pipeline and runs the v2 interpreter to assert output value. | +| Counts against G-1? | **Yes** (substantive `use` of both v2 crates). | +| Owner | PB Manager (per `docs/audit/t-v2-retirement-audit.md` §3.1). | +| Proposed migration | **Replace with a v3 evaluator equivalence-corpus row**, per `r3-pb-runtime-equivalence-corpus-seed-audit.md`. The property under test (lower-time fold of `repeat_string` to a string literal) is independently expressible against the v3 evaluator surface; the v2 interpreter is only the *current* oracle, not a structural requirement. **Alternate disposition:** if the property is structurally guaranteed by v3 lower-time evaluation rules (e.g., the fold is a typed primitive composition), delete the test as redundant with a receipt linking to the structural guarantee. | +| Prerequisite | S-1 (PM brief authorizes the disposition choice: replace vs. delete). | +| STOP condition | S-1 unmet → no migration. | +| What green looks like | File no longer matches `\bv2_compiler(_tests)?\b`; the `repeat_string` lower-time-fold property has a v3-side receipt (either an equivalence-corpus row or a structural-guarantee citation), not a silent test deletion. | + +### 3.2 `src/v3/compiler/tests/integration/m2_substrate_inhabitance_test.rs` + +| Field | Value | +|---|---| +| Current dependency | `fn v2_profile_to_v3(p: v2_compiler::std_algebra::AlgebraProfile) -> AlgebraProfile { use v2_compiler::std_algebra::AlgebraProfile as V2; ... }` (line 992-993) and `let v2_map = v2_compiler::std_algebra::kernel_algebra_profile();` (line 1005), inside `v3_kernel_algebra_profile_mirror_matches_v2_stage0_authority` (line 991). | +| Role | Drift ratchet: asserts v3 `dag::kernel_algebra_profile` matches v2 stage0's `std_algebra::kernel_algebra_profile()` row-for-row, treating v2 stage0's table as the authority for the kernel algebra profile. | +| Counts against G-1? | **Yes** (substantive 3 references). | +| Owner | PB Manager + Substrate Manager (cross-program — the authority migration is Substrate-shape; the test retirement is PB). | +| Proposed migration | **Migrate the authority** to `dsl/std/algebra.dag` (or its successor as v3 substrate inhabitance is consolidated), then **retire the parity test** entirely — once the v2 mirror is no longer the authority, parity is structurally meaningless. Per `feedback_isomorphism_or_generation_for_mirrors.md`: hand-maintained Rust↔.dag mirrors must be replaced by generation or by an isomorphism test, not by hand-maintenance + parity assertion. The end state is a single `kernel_algebra_profile` authority on the v3 side, with no v2 mirror to compare against. | +| Prerequisite | S-1 (PM brief routes the authority migration between PB + Substrate per §P1 substrate-fact-introduction); landing of v3-side single-authority `kernel_algebra_profile` (Substrate continuation work). | +| STOP condition | S-1 unmet → no migration. Substrate-side authority migration not landed → parity test cannot be safely retired (would lose drift detection). | +| What green looks like | `kernel_algebra_profile` has a single v3-side authority (under `dsl/std/algebra.dag` or named successor); `m2_substrate_inhabitance_test.rs` no longer matches `\bv2_compiler\b`; the rest of `m2_substrate_inhabitance_test.rs` (other tests in the file) continue to pass under `cargo test --workspace --exclude v2-compiler-tests`. | + +--- + +## 4. Legacy emit chain — `rust_method_template_contracts.dag` header note + +### 4.1 Surface + +Per `src/v3/std/rust_method_template_contracts.dag:1-22` header: v2's emit pipeline still consumes the legacy authorities + +``` +dsl/extdeps/languages/rust/emit.dag:53 data rust_simple_method_specs: List +dsl/extdeps/languages/rust/emit.dag:66 fn rust_method_templates() -> Map +dsl/extdeps/languages/rust/emit.dag:72 fn rust_method_wraps_result() -> Map +``` + +because v2 has no bootstrap-Dag consumer infrastructure to read the v3-side `MethodTemplateContract` rows. Header note explicitly defers full retirement to "Pure-Bootstrap-Zero / v2 retirement scope." + +Parallel chains exist for python and go targets (per `dsl/extdeps/languages/{python,go}/emit.dag`); the same disposition applies. + +### 4.2 Disposition + +| Field | Value | +|---|---| +| Counts against G-1? | **No** (not a test consumer; it is an authority surface in `dsl/extdeps/`). | +| Counts against G-2? | **Yes** as a prerequisite — the chain consumes v2 emit infrastructure; deleting `src/v2/` requires that no surviving authority depends on v2-routable emit. | +| Owner | PB Manager. Cross-ref `r3-pb-binshim-retirement-worker.md` and the T-Ground-LanguageSpec scope-E lineage. | +| Proposed migration | Once PB-Runtime trampoline is the live bootstrap (S-4) and v3-side `MethodTemplateContract` rows are consumed by the v3 emitter end-to-end, **delete `rust_simple_method_specs` + `rust_method_templates()` + `rust_method_wraps_result()` from `dsl/extdeps/languages/rust/emit.dag`** and the parallel python/go chains. The `MethodTemplateContract` rows under `src/v3/std/{rust,python,go}_method_template_contracts.dag` already exist as the single-authority replacement. | +| Prerequisite | S-2 (T-FixedPoint) + S-3 (T-LensProducer-Retirement) + S-4 (PB-Runtime trampoline) + v3 emitter consumes `MethodTemplateContract` end-to-end (this last is partly out-of-scope of T-V2-Retirement; flagged §6.2). | +| STOP condition | If the v3 emitter does not yet consume `MethodTemplateContract` rows for at least one target, the legacy chain cannot be deleted. | +| What green looks like | `grep -rln 'rust_simple_method_specs\|rust_method_templates\|rust_method_wraps_result' dsl/ src/v3/` returns no matches under `dsl/extdeps/`; the v3 emitter's targets compile + emit identical output (bit-identical artifacts ratchet from T-FixedPoint). | + +--- + +## 5. Dual `verification.dag` convergence — *routed, not decided* + +### 5.1 Surface + +Per `docs/design-test-infra.md:10-14` and `src/v3/std/verification.dag` header comment: + +- **`dsl/std/verification.dag`** (v2-era): `AssertKind`, `TestClaim { kind, label }`, `TestCase { name, claims, ignored }`. Older behavioral-assertion model. +- **`src/v3/std/verification.dag`** (v3, extended by DB-15): `TestPredicate`, `TestClaim { name, source, file_name, predicate }`, `TestSuite`. Structural authority for generated tests. + +The v3 file's own header reads: *"`dsl/std/verification.dag` remains the older v2-era behavioral-assertion model; it is not silently superseded here. Convergence trigger: once v2 retires and the shared std tree can host the v3 verification surface directly, dissolve the duplicate definitions back to one `std.verification`."* + +### 5.2 Disposition + +| Field | Value | +|---|---| +| Counts against G-1? | **No.** Not a test consumer crate. | +| Counts against G-2? | **Yes** as a prerequisite — `src/v2/` cannot be deleted while the v2-era `dsl/std/verification.dag` surface is load-bearing for any surviving authority. | +| Owner | **Substrate Manager** for the convergence design call (which surface wins, or whether both are kept under disjoint module paths); PB Manager for the v2-side cleanup once the call lands. | +| Proposed migration | **Routed to Substrate / Director per dispatch non-goals.** This doc records the surface and ownership; it does not propose a convergence shape. The header on `src/v3/std/verification.dag` already names the trigger ("once v2 retires and the shared std tree can host the v3 verification surface directly"); whether v3's `TestPredicate`/`TestSuite` model fully replaces v2's `AssertKind`/`TestClaim`/`TestCase` model, or whether some v2 surface continues under a renamed module path, is a Substrate Manager design call. | +| Prerequisite | Substrate convergence design call (open). | +| STOP condition | No design call → no migration. PB Manager must NOT unilaterally delete `dsl/std/verification.dag` v2 surface as part of G-2 without the design call landing first. | +| What green looks like | A single canonical `std.verification` (or Substrate-ratified disjoint coexistence) such that `src/v2/` deletion does not strand any surviving authority that referenced the v2-era surface. Receipt: link to the Substrate Manager design-call resolution. | + +--- + +## 6. Open routing questions (for PM brief author / Substrate Manager) + +These are NOT decisions — they are routing questions surfaced by the migration-mapping work. Resolution belongs to the PM-authored T-V2-Retirement worker brief and (for §6.3) the Substrate Manager design call. + +1. **Population A coverage migration (§2.1):** are any behaviors covered by the 13 internal `src/v2/tests/src/*.rs` files NOT already covered by v3-side tests? If yes, which ones, and where do they migrate? If no, the entire crate retires under G-2 with no per-test work. Quick-audit recommendation: spot-check `derive_bound_fail_closed_test.rs`, `int_pow_bounded_test.rs`, `peano_materialization_cap_test.rs`, `sub_value_lattice_factor_test.rs` (the named-property tests; the others are pipeline/parse coverage which v3 likely subsumes). +2. **Legacy emit chain end-to-end consumer (§4.2):** does the v3 emitter currently consume `MethodTemplateContract` rows end-to-end for any target, or only at the row-population layer (Phase 1 per the header)? If end-to-end consumption is incomplete, that completion is a prerequisite for §4.2 migration and may be a sibling sub-lane rather than part of T-V2-Retirement. +3. **`verification.dag` convergence (§5.2):** routed to Substrate Manager. Specifically: does v3's `TestPredicate`/`TestClaim { name, source, file_name, predicate }`/`TestSuite` cover all behavior expressible under v2's `AssertKind`/`TestClaim { kind, label }`/`TestCase`, or does any surviving authority require continuation of the v2 surface under a renamed module path? +4. **Cosmetic Population C cleanup ordering (§2.3):** these are doc-comment / string-literal references to `src/v2/`. Cleanest moment to do the cleanup is alongside G-2 deletion, since rewording before deletion is wasted churn (the comments are accurate descriptions of current state). Recommendation: do not pre-empt; sweep at G-2. + +--- + +## 7. Acceptance summary + +This matrix is intentionally bounded: + +- §2 enumerates **Population A** (13 internal files, fall with G-2), **Population B** (2 substantive G-1 consumers), **Population C** (cosmetic). +- §3 gives per-file G-1 disposition for both Population B files (current dependency / role / G-1? / owner / proposed migration / prerequisite / STOP / green). +- §4 maps the legacy emit chain (G-2 prerequisite, not G-1). +- §5 maps the dual `verification.dag` surface as routed to Substrate / Director — no convergence decision proposed. +- §6 routes 4 open questions to the PM brief author. + +**Implementation remains gated on `t-v2-retirement-audit.md` §1 STOP conditions, foremost S-1.** This matrix is suitable input for the PM-authored worker brief. From e50a9cb21cd9485e54a7de3164010d1c88f41cfd Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 1 May 2026 03:56:14 +0000 Subject: [PATCH 7/9] docs(audit): add Cargo edges to Population B G-1 scope (#1346) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewer flagged that Population B as written omitted the src/v3/compiler/Cargo.toml:32-33 v2-* path deps that #1338 §3.1 green criteria explicitly require deleting at G-1 closure. Without including them, the matrix could declare consumers 'migrated' while v2-compiler/v2-compiler-tests remain live workspace deps — parallel- authority residue per INVARIANTS §P2. Fixed §2.2 (now '2 test files + 2 Cargo edges') and added §3.3 with per-edge disposition fields. Mechanical deletion gated on §3.1 + §3.2 green; pre-emptive removal would break live tests. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../audit/t-v2-retirement-migration-matrix.md | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/docs/audit/t-v2-retirement-migration-matrix.md b/docs/audit/t-v2-retirement-migration-matrix.md index bce93132e6f..d4ec27390ed 100644 --- a/docs/audit/t-v2-retirement-migration-matrix.md +++ b/docs/audit/t-v2-retirement-migration-matrix.md @@ -45,15 +45,24 @@ src/v2/tests/src/sub_value_lattice_factor_test.rs **Migration disposition for Population A:** none individually. The crate retires as a unit when G-2's workspace-member removal fires. Per-test coverage migration (if any v2-tests-crate behavior is not already covered by v3-side tests) is the responsibility of the PM-authored worker brief — flagged as routing question §6.1. -### 2.2 Population B — substantive G-1 consumers (2 files) +### 2.2 Population B — substantive G-1 consumers (2 test files + 2 Cargo edges) -These are the only test surfaces *outside* `src/v2/` that substantively reference v2 crates. Each is enumerated in §3 with disposition. +These are the surfaces *outside* `src/v2/` that substantively reference v2 crates. Each is enumerated in §3 with disposition. **Per #1338 §3.1 green criteria, G-1 closure requires both the test-file dispositions AND deletion of the two Cargo edges below**; treating only the test files as Population B would let the matrix declare consumers "migrated" while `v2-compiler` / `v2-compiler-tests` remain live workspace dependencies of `src/v3/compiler` — exactly the parallel-authority residue INVARIANTS §P2 (facts-flow-forward) forbids. +Test consumers (2 files): ``` src/v3/compiler/tests/integration/p0_std_render_repeat_string_test.rs src/v3/compiler/tests/integration/m2_substrate_inhabitance_test.rs ``` +Cargo edges (2 lines): +``` +src/v3/compiler/Cargo.toml:32 v2-compiler = { path = "../../v2/stage0" } +src/v3/compiler/Cargo.toml:33 v2-compiler-tests = { path = "../../v2/tests" } +``` + +The Cargo edges have no other consumer in `src/v3/compiler` — they exist solely to support the two test files in §3.1 / §3.2. Their deletion is mechanical once both tests dissolve, but it is **part of G-1 closure, not a downstream cleanup**. + ### 2.3 Population C — non-G-1 references (cosmetic at deletion) Doc-comments, string literals, README mentions. **Not** G-1 consumers; cleaned up cosmetically during G-2. @@ -97,6 +106,19 @@ Doc-comments, string literals, README mentions. **Not** G-1 consumers; cleaned u | STOP condition | S-1 unmet → no migration. Substrate-side authority migration not landed → parity test cannot be safely retired (would lose drift detection). | | What green looks like | `kernel_algebra_profile` has a single v3-side authority (under `dsl/std/algebra.dag` or named successor); `m2_substrate_inhabitance_test.rs` no longer matches `\bv2_compiler\b`; the rest of `m2_substrate_inhabitance_test.rs` (other tests in the file) continue to pass under `cargo test --workspace --exclude v2-compiler-tests`. | +### 3.3 `src/v3/compiler/Cargo.toml:32-33` — `v2-compiler` + `v2-compiler-tests` path deps + +| Field | Value | +|---|---| +| Current dependency | `v2-compiler = { path = "../../v2/stage0" }` and `v2-compiler-tests = { path = "../../v2/tests" }`. | +| Role | Workspace-internal Cargo edges; exist solely to support §3.1 + §3.2. No other consumer in `src/v3/compiler`. | +| Counts against G-1? | **Yes** — per #1338 §3.1 green criteria, G-1 closure requires these edges deleted alongside the test-file dispositions. INVARIANTS §P2 (facts-flow-forward): leaving the deps live while the only callers are gone leaves a parallel-authority residue. | +| Owner | PB Manager (per `docs/audit/t-v2-retirement-audit.md` §3.1; same lane as §3.1 + §3.2). | +| Proposed migration | Mechanical deletion of both lines from `src/v3/compiler/Cargo.toml` once both §3.1 + §3.2 are green. No replacement; `src/v3/compiler` does not need v2 crates after the test consumers retire. | +| Prerequisite | §3.1 green + §3.2 green. (Pre-emptive deletion would break the live tests.) | +| STOP condition | Either §3.1 or §3.2 still has substantive `\bv2_compiler(_tests)?\b` references → cannot delete without breaking the build. | +| What green looks like | `grep -n 'v2-compiler\|v2_compiler' src/v3/compiler/Cargo.toml` returns no matches; `cargo build -p v3-compiler` and `cargo test -p v3-compiler` both pass. The `src/v2/stage0` and `src/v2/tests` workspace members remain (G-2 owns their removal). | + --- ## 4. Legacy emit chain — `rust_method_template_contracts.dag` header note From 1c75be39c0417f4ebc00bd3919bff7ac260458ff Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 1 May 2026 04:10:38 +0000 Subject: [PATCH 8/9] =?UTF-8?q?docs(audit):=20=C2=A74.2=20per-target=20gat?= =?UTF-8?q?e=20for=20legacy=20emit=20chain=20(#1346)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewer flagged two flaws in §4.2: 1. STOP 'at least one target' would allow deleting all three legacy chains (rust/python/go) once end-to-end consumption is proven for any one — violates THESIS cross-target drift prevention. 2. Green criteria grep only checks rust_* names; python uses python_method_templates and go uses go_method_templates (verified in dsl/extdeps/languages/{python,go}/emit.dag). Python/Go legacy authorities could be deleted while still load-bearing. Fixed: gate is now per-target ('cannot delete target-T legacy unless end-to-end consumption is proven for target T'). Green grep broadened to '\\b(rust|python|go)_(simple_method_specs|method_templates|method_wraps_result)\\b' covering all three target families. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/audit/t-v2-retirement-migration-matrix.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/audit/t-v2-retirement-migration-matrix.md b/docs/audit/t-v2-retirement-migration-matrix.md index d4ec27390ed..67d406bec10 100644 --- a/docs/audit/t-v2-retirement-migration-matrix.md +++ b/docs/audit/t-v2-retirement-migration-matrix.md @@ -145,9 +145,9 @@ Parallel chains exist for python and go targets (per `dsl/extdeps/languages/{pyt | Counts against G-2? | **Yes** as a prerequisite — the chain consumes v2 emit infrastructure; deleting `src/v2/` requires that no surviving authority depends on v2-routable emit. | | Owner | PB Manager. Cross-ref `r3-pb-binshim-retirement-worker.md` and the T-Ground-LanguageSpec scope-E lineage. | | Proposed migration | Once PB-Runtime trampoline is the live bootstrap (S-4) and v3-side `MethodTemplateContract` rows are consumed by the v3 emitter end-to-end, **delete `rust_simple_method_specs` + `rust_method_templates()` + `rust_method_wraps_result()` from `dsl/extdeps/languages/rust/emit.dag`** and the parallel python/go chains. The `MethodTemplateContract` rows under `src/v3/std/{rust,python,go}_method_template_contracts.dag` already exist as the single-authority replacement. | -| Prerequisite | S-2 (T-FixedPoint) + S-3 (T-LensProducer-Retirement) + S-4 (PB-Runtime trampoline) + v3 emitter consumes `MethodTemplateContract` end-to-end (this last is partly out-of-scope of T-V2-Retirement; flagged §6.2). | -| STOP condition | If the v3 emitter does not yet consume `MethodTemplateContract` rows for at least one target, the legacy chain cannot be deleted. | -| What green looks like | `grep -rln 'rust_simple_method_specs\|rust_method_templates\|rust_method_wraps_result' dsl/ src/v3/` returns no matches under `dsl/extdeps/`; the v3 emitter's targets compile + emit identical output (bit-identical artifacts ratchet from T-FixedPoint). | +| Prerequisite | S-2 (T-FixedPoint) + S-3 (T-LensProducer-Retirement) + S-4 (PB-Runtime trampoline) + v3 emitter consumes `MethodTemplateContract` end-to-end **for every emitted target (Rust + Python + Go)**, not just one (this last is partly out-of-scope of T-V2-Retirement; flagged §6.2). | +| STOP condition | Per-target gate. If the v3 emitter does not consume `MethodTemplateContract` rows end-to-end for **target T**, the **target-T** legacy authority (`{rust\|python\|go}_*` chain in `dsl/extdeps/languages/T/emit.dag`) cannot be deleted. Targets are independent: it is NOT acceptable to delete all three legacy chains because end-to-end consumption is only proven for one. THESIS cross-target drift prevention + INVARIANTS §P2 forbid leaving any target's legacy authority load-bearing while its sibling is deleted. | +| What green looks like | The legacy authority symbols are different per target; check **all three target families** explicitly. Rust: `rust_simple_method_specs`, `rust_method_templates`, `rust_method_wraps_result`. Python: `python_method_templates` (and any sibling `python_method_wraps_result` / `python_simple_method_specs` if introduced before deletion). Go: `go_method_templates` (and siblings if introduced). Verification command: `grep -rEn '\b(rust\|python\|go)_(simple_method_specs\|method_templates\|method_wraps_result)\b' dsl/ src/v3/` returns no matches under `dsl/extdeps/`. The v3 emitter's targets all compile + emit identical output (bit-identical artifacts ratchet from T-FixedPoint, applied per target). | --- From 8879cd1ec44a01e788627bffeda246c986521f06 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 1 May 2026 04:12:19 +0000 Subject: [PATCH 9/9] =?UTF-8?q?docs(audit):=20=C2=A75.1=20quote=20TestClai?= =?UTF-8?q?m.requires=20+=20=C2=A76.3=20dependency-edge=20routing=20(#1346?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewer flagged that §5.1's v3 surface quote omitted 'requires: List' even though src/v3/std/verification.dag:290 makes it the single authority for ResourceReference edges attached to a claim. Silent omission lets the convergence question drop a load-bearing dependency-edge fact (INVARIANTS §P2 facts-flow-forward). Fixed §5.1 to include 'requires' on TestClaim, plus TestObligation, plus the citation that requires is the single authority. §6.3 routing question extended with sub-question (b): does v2 TestCase carry an equivalent dependency-edge fact, and what is the convergence call's disposition for the requires field? Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/audit/t-v2-retirement-migration-matrix.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/audit/t-v2-retirement-migration-matrix.md b/docs/audit/t-v2-retirement-migration-matrix.md index 67d406bec10..d1c84641492 100644 --- a/docs/audit/t-v2-retirement-migration-matrix.md +++ b/docs/audit/t-v2-retirement-migration-matrix.md @@ -158,7 +158,7 @@ Parallel chains exist for python and go targets (per `dsl/extdeps/languages/{pyt Per `docs/design-test-infra.md:10-14` and `src/v3/std/verification.dag` header comment: - **`dsl/std/verification.dag`** (v2-era): `AssertKind`, `TestClaim { kind, label }`, `TestCase { name, claims, ignored }`. Older behavioral-assertion model. -- **`src/v3/std/verification.dag`** (v3, extended by DB-15): `TestPredicate`, `TestClaim { name, source, file_name, predicate }`, `TestSuite`. Structural authority for generated tests. +- **`src/v3/std/verification.dag`** (v3, extended by DB-15): `TestPredicate`, `TestClaim { name, source, file_name, predicate, requires: List }`, `TestSuite`, `TestObligation { resources: List }`. Structural authority for generated tests. Per `src/v3/std/verification.dag:290`: **`TestClaim.requires` is the single authority for `ResourceReference` edges attached to a claim** — `claim_obligation_resources` (L325) and `materialize_test_obligations` (L333) walk this field for obligation materialization. Any convergence call (§5.2) MUST address whether v2-era `TestCase { name, claims, ignored }` carries an equivalent dependency-edge fact or whether v2 retirement strands the requires/obligation surface; INVARIANTS §P2 (facts-flow-forward) forbids silently dropping the edge. The v3 file's own header reads: *"`dsl/std/verification.dag` remains the older v2-era behavioral-assertion model; it is not silently superseded here. Convergence trigger: once v2 retires and the shared std tree can host the v3 verification surface directly, dissolve the duplicate definitions back to one `std.verification`."* @@ -182,7 +182,7 @@ These are NOT decisions — they are routing questions surfaced by the migration 1. **Population A coverage migration (§2.1):** are any behaviors covered by the 13 internal `src/v2/tests/src/*.rs` files NOT already covered by v3-side tests? If yes, which ones, and where do they migrate? If no, the entire crate retires under G-2 with no per-test work. Quick-audit recommendation: spot-check `derive_bound_fail_closed_test.rs`, `int_pow_bounded_test.rs`, `peano_materialization_cap_test.rs`, `sub_value_lattice_factor_test.rs` (the named-property tests; the others are pipeline/parse coverage which v3 likely subsumes). 2. **Legacy emit chain end-to-end consumer (§4.2):** does the v3 emitter currently consume `MethodTemplateContract` rows end-to-end for any target, or only at the row-population layer (Phase 1 per the header)? If end-to-end consumption is incomplete, that completion is a prerequisite for §4.2 migration and may be a sibling sub-lane rather than part of T-V2-Retirement. -3. **`verification.dag` convergence (§5.2):** routed to Substrate Manager. Specifically: does v3's `TestPredicate`/`TestClaim { name, source, file_name, predicate }`/`TestSuite` cover all behavior expressible under v2's `AssertKind`/`TestClaim { kind, label }`/`TestCase`, or does any surviving authority require continuation of the v2 surface under a renamed module path? +3. **`verification.dag` convergence (§5.2):** routed to Substrate Manager. Specifically: (a) does v3's `TestPredicate`/`TestClaim { name, source, file_name, predicate, requires }`/`TestSuite`/`TestObligation` cover all behavior expressible under v2's `AssertKind`/`TestClaim { kind, label }`/`TestCase`, or does any surviving authority require continuation of the v2 surface under a renamed module path? (b) Does v2's `TestCase { name, claims, ignored }` carry any equivalent of v3's `TestClaim.requires: List` dependency-edge fact? If not, the convergence must explicitly account for whether v2-side claims have implicit dependency edges that need promotion to `requires` before v2 retirement, or whether v2-side claims are dependency-free and the requires field simply does not apply on the v2 surface. INVARIANTS §P2 forbids silently dropping the edge. 4. **Cosmetic Population C cleanup ordering (§2.3):** these are doc-comment / string-literal references to `src/v2/`. Cleanest moment to do the cleanup is alongside G-2 deletion, since rewording before deletion is wasted churn (the comments are accurate descriptions of current state). Recommendation: do not pre-empt; sweep at G-2. ---