From ed994b0d864825bc6d4c7d8dfb75ffbe5b08fa31 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 28 Apr 2026 18:36:00 -0400 Subject: [PATCH 01/22] WIP: Gunbc PM --- docs/briefs/r2-evaluator-manager.md | 127 ++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 docs/briefs/r2-evaluator-manager.md diff --git a/docs/briefs/r2-evaluator-manager.md b/docs/briefs/r2-evaluator-manager.md new file mode 100644 index 00000000000..0a78a574ff1 --- /dev/null +++ b/docs/briefs/r2-evaluator-manager.md @@ -0,0 +1,127 @@ +# R2 Evaluator Manager Brief + +**Status:** PROPOSAL (per [`docs/r2-structure.md`](../r2-structure.md), Goal 7 added 2026-04-28 via PR #1078). Spawns post-#1078-merge per Transition mechanics step 4. **No prior brief to migrate** — this is a genuinely new R2 manager. + +## Orient before reading + +- **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md). Names this manager one of **7** standing R2 managers (alongside Substrate, Modeling, Grounding, Impossible-Bugs, Pure Bootstrap, R2 Release; cross-program coordination via Director). Manager count rose from 6 to 7 with this lane added per #1078. +- **Program scope source:** [`THESIS.md`](../../THESIS.md) §"Tier 3 — Verification from structure" (L4-L7 verification surface) + [`docs/r2-structure.md`](../r2-structure.md) §"Goal 7 — Evaluator XL". +- **Cross-program consumer:** **R2-Evaluator gates 7 of 10 R3 lanes** (T-Tier3-Dissolution, T-LensProducer-Retirement, T-Verification-L4-L7-Direct, T-Verification-L5-Corpus, T-FixedPoint, T-Omni-Shape-B, T-CostLens-Composition). The Evaluator IS the runtime that R3's consequence layer falls out from. Without it, R3 dispatchers spin. +- **Demo coordination:** signal lane-close to R2 Release Manager (closure ledger; per the structural-acceptance-per-lane-close discipline locked in `r2-structure.md` — the demo IS the structural gate, not a separate artifact). +- **Substrate-fact-introduction procedure** ([`INVARIANTS.md`](../../INVARIANTS.md) §P1): self-serve through the 3-step decision procedure (DAG-ancestor → coproduct-vs-coordinate → primitive-vs-lens-extensible) before escalating substrate-shape questions to Director. + +## Program scope (T-Evaluator XL) + +R2's Goal 7 — **Runtime evaluator for `.dag` programs**. The Evaluator is the runtime layer that: +- Executes `.dag` function bodies structurally (not via the Rust mirrors) +- Applies lenses over reflected program DAGs +- Constructs runtime witnesses (proof artifacts) +- Provides cross-target equivalence harness primitives for L5 verification in R3 + +**Co-XL with T-Substrate** — largest single new lane in R2. Largest single concentration of new R2 work; gates R3 spin-up. + +## Owned deliverables (through R2 close) + +| Sub-lane | Size | Status (at brief authoring) | Description | +|---|---|---|---| +| **Runtime value model** | M | NOT YET AUTHORED — gated on PR-A design lock | Closed-over environments, lazy/eager evaluation strategy, memoization. Per #1078 design challenge #1: locked direction; specific design lands in PR-A. | +| **Body evaluator** | L | NOT YET AUTHORED — gated on Runtime value model | Execute `.dag` function bodies structurally. Bounded forward execution per INVARIANTS P4. Termination by descent evidence (already in substrate per `dsl/std/termination.dag`). | +| **Lens application** | M | NOT YET AUTHORED — gated on PR-C reflection-completeness spec | Extend `reflect_program_dag_nodes_in_file` from "shallow/lossy" to complete reflection (per Reflective Pattern B). Lens application = fold over reflected program DAG via `Lens` framework (lands as R2-T-Substrate-Lens-Primitive sub-lane). | +| **Witness construction** | M | NOT YET AUTHORED | Runtime materialization of proof artifacts (`Witness::Inhabits` / `Witness::Violates` per `src/v3/std/dimensions.dag`); algebraic-law witnesses (associativity, commutativity, identity). | +| **Cross-target equivalence harness primitives** | S | NOT YET AUTHORED | For L5 verification in R3 (algebraic equivalence over a curated corpus, per #1078 design challenge #3 locked decision). Primitives only — corpus authoring is post-R2 (R3 lane T-Verification-L5-Corpus). | + +## Pre-dispatch design lock cadence (per #1078 locked structure) + +Before worker dispatch begins on the implementation sub-lanes above, **5 design PRs land sequentially**: + +| PR | Locks | Status | +|---|---|---| +| **PR-A** | Runtime value model — closed-over environments, lazy/eager strategy, memoization | NOT YET AUTHORED | +| **PR-B** | Witness construction surface — concrete shape for runtime materialization | NOT YET AUTHORED | +| **PR-C** | Reflection completeness spec — what does "complete reflection" mean for `reflect_program_dag_nodes_in_file`? | NOT YET AUTHORED (consumed by R3-T-LensProducer-Retirement) | +| **PR-D** | L5 corpus type spec — algebraic equivalence over curated corpus (locked direction; specific design here) | NOT YET AUTHORED (consumed by R3-T-V-L5-Corpus) | +| **PR-E** | Final integration design — synthesizes PR-A through PR-D into the implementation roadmap | NOT YET AUTHORED | + +Plus **LanguageSpec parallel** (R2-T-Ground-LanguageSpec sub-lane) — Grounding Manager authors the LanguageSpec schema in parallel; Evaluator Manager consumes it for cross-target equivalence work. + +**Director-discretionary timing:** Evaluator design lock cadence may run during R1's final week (mirror of R2's pre-R1-close pattern); design-only work doesn't conflict with R1 closure. + +## Cross-program dependencies + +**Produces:** +- **R3 lane gates** — 7 of 10 R3 lanes block on R2-Evaluator landing. The Evaluator's `Witness` runtime (per `src/v3/std/dimensions.dag`) is what R3-T-Tier3-Dissolution / R3-T-LensProducer-Retirement / R3-T-V-L4-L7-Direct / etc. consume. +- **`Lens` runtime** — R2-T-Substrate-Lens-Primitive's generic `fold_lens: Lens → Dag → DimensionReport` is implemented by the Evaluator. T-CostLens-Composition (R3, under Substrate continuation per #1078 lock) consumes this. + +**Consumes:** +- **Substrate Manager** — additional carriers needed by runtime values (e.g., closed-over environment representation). Design-pass at lane spin-up identifies the dependency. +- **Substrate Manager — `Lens` substrate primitive** (R2-T-Substrate-Lens-Primitive sub-lane). Evaluator implements `fold_lens`; substrate declares the type. + +## Locked design decisions consumed (per #1078 8-question dialogue) + +The Evaluator's substrate decisions inherit from #1078's locked design questions. Worker briefs MUST consume these without re-litigation: + +- **Q1**: `Interval` shared parent in substrate; `BoundDeclaration = StaticBound(Interval) | PlatformDependent` (asymmetric match rule) +- **Q3**: `Cost = Dimension`; `RealizationCost { storage: Cost, access: Map> }` +- **Q6**: `Witness` stays as-is; rich structural validation failures encode into `Diagnostic.kind` extensions (subject to substrate diagnostic-kind dissolution per `src/v3/std/diagnostics.dag` SCAFFOLD note) +- **Q7**: per-call validate yields one `OptionalDiagnostic`; fold accumulates into `DimensionFail.violations: List` +- **Q8**: cross-product validate is conjunctive (`Lens × Lens` runs both; conjunctive fold) + +Full disposition table: [`docs/r2-structure.md`](../r2-structure.md) §4 + [`docs/design-lens-framework.md`](../design-lens-framework.md) §"Design questions to lock before substrate dispatch". + +## Pre-spawn vs post-spawn authority + +- **Pre-spawn (this brief authored post-#1078-merge by PM/Director):** brief authoring + PR-A through PR-E design-lock cadence sequence locked. Manager spawns once a design-lock PR is dispatchable. +- **Post-spawn (Evaluator Manager active):** Manager owns all worker-brief authoring autonomously per "Autonomous dispatch authority" below. Director's role narrows to cross-program conflict resolution + scope-change escalation. + +## Autonomous dispatch authority + +- Authors all T-Evaluator sub-briefs without Director (after PR-A through PR-E design lock). +- Dispatches workers against T-Evaluator sub-briefs. +- Resolves T-Evaluator-internal scope refinements; escalates blockers and scope changes to Director. +- Per `docs/r2-structure.md` P5 dispatch-discipline: every T-Evaluator worker brief that introduces a scaffold names its dissolution trigger + adjacent ROADMAP debt row + contributes-or-defers stance; every PR introducing hand-Rust under `src/v3/` fills the per-PR gate. +- **Cross-program signal authority:** Evaluator-readiness signal goes to Director (gates R3 spin-up); per-sub-lane closure goes to R2 Release Manager (closure ledger). + +## Reporting cadence + +- **Lane-close → R2 Release Manager** (closure ledger). Each sub-lane's structural acceptance gate (e.g., `evaluator_runtime_value_model_landed`, `body_evaluator_executes_std_dag_correctly`) IS the demo per the structural-acceptance-per-lane-close discipline. +- **Cross-program signals** (e.g., `Lens` runtime ready for T-CostLens-Composition consumer) → cross-manager queue. +- **Evaluator-readiness signal** (R3 spin-up gate) → Director. +- **Blockers + scope changes** → Director. +- **Weekly health surfacing to Director:** which sub-lanes within 1 step of unblocking, which workers fill vs. ready, which PR-A through PR-E design locks are landed vs pending. + +## Acceptance — `.dag` gates + +Each sub-lane closes under a structural acceptance gate authored as a `.dag` `TestClaim`: + +- `evaluator_runtime_value_model_landed` — runtime value type declared in substrate; closed-over environment representation correctly implemented +- `evaluator_body_evaluator_correctly_executes_std_termination` — Body evaluator correctly executes `dsl/std/termination.dag` body programs (representative test) +- `evaluator_lens_application_complete_reflection` — `reflect_program_dag_nodes_in_file` returns complete reflection (no shallow/lossy gaps) per the spec authored in PR-C +- `evaluator_witness_construction_per_lens_correct` — runtime witness materialization correct for at least 3 lens instances (complexity / tenant-flow / IFC per design-lens-framework.md) +- `evaluator_cross_target_equivalence_harness_primitives_landed` — primitives ready for R3-T-V-L5-Corpus consumer (no corpus authoring at R2; primitives only) + +**Plus:** `lens_complexity_n_log_n_fold_correct` + `lens_tenant_flow_aggregate_validate_fail_closed` + `lens_ifc_aggregate_validate_fail_closed` (TestClaims from `docs/design-lens-framework.md` I4 + I9). + +## Sub-briefs (authored / pending) + +**Authored:** none yet. Brief is the parent skeleton. + +**Pending (post-spawn manager authors autonomously):** +- PR-A worker brief — Runtime value model design lock +- PR-B worker brief — Witness construction surface design lock +- PR-C worker brief — Reflection completeness spec +- PR-D worker brief — L5 corpus type spec +- PR-E worker brief — Final integration design synthesis +- Implementation worker briefs (one per sub-lane: runtime value model implementation, body evaluator implementation, lens application implementation, witness construction implementation, cross-target equivalence primitives) + +## Working state (fill on spawn) + +Sub-lane status table refreshes here as work lands. Pre-spawn placeholder. Initial state will be PR-A through PR-E design-lock cadence in flight. + +## Cross-refs + +- Parent: `docs/r2-structure.md` §"Goal 7 — Evaluator XL" + §"Evaluator Manager (added 2026-04-28 as Goal 7)" +- R3 dependent lanes: [`docs/r3-structure.md`](../r3-structure.md) §"Lane structure" — 7 of 10 lanes Evaluator-gated +- Lens framework consumer: [`docs/design-lens-framework.md`](../design-lens-framework.md) — `Lens` primitive that Evaluator implements `fold_lens` for +- 8 design questions disposition: [`docs/r2-structure.md`](../r2-structure.md) §4 + [`docs/design-emission-model.md`](../design-emission-model.md) Q1-Q5 + [`docs/design-lens-framework.md`](../design-lens-framework.md) Q6-Q8 +- Pre-dispatch design lock cadence: [`docs/r3-structure.md`](../r3-structure.md) §"Pre-R2-Evaluator design lock cadence" +- INVARIANTS substrate-fact-introduction procedure: [`INVARIANTS.md`](../../INVARIANTS.md) §P1 From 6f955a567f87375cf851b25aac00bcd1a855c65b Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 28 Apr 2026 18:45:03 -0400 Subject: [PATCH 02/22] WIP: Gunbc PM --- docs/briefs/r2-evaluator-manager.md | 42 ++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/docs/briefs/r2-evaluator-manager.md b/docs/briefs/r2-evaluator-manager.md index 0a78a574ff1..93d02c55290 100644 --- a/docs/briefs/r2-evaluator-manager.md +++ b/docs/briefs/r2-evaluator-manager.md @@ -32,19 +32,35 @@ R2's Goal 7 — **Runtime evaluator for `.dag` programs**. The Evaluator is the ## Pre-dispatch design lock cadence (per #1078 locked structure) -Before worker dispatch begins on the implementation sub-lanes above, **5 design PRs land sequentially**: - -| PR | Locks | Status | -|---|---|---| -| **PR-A** | Runtime value model — closed-over environments, lazy/eager strategy, memoization | NOT YET AUTHORED | -| **PR-B** | Witness construction surface — concrete shape for runtime materialization | NOT YET AUTHORED | -| **PR-C** | Reflection completeness spec — what does "complete reflection" mean for `reflect_program_dag_nodes_in_file`? | NOT YET AUTHORED (consumed by R3-T-LensProducer-Retirement) | -| **PR-D** | L5 corpus type spec — algebraic equivalence over curated corpus (locked direction; specific design here) | NOT YET AUTHORED (consumed by R3-T-V-L5-Corpus) | -| **PR-E** | Final integration design — synthesizes PR-A through PR-D into the implementation roadmap | NOT YET AUTHORED | - -Plus **LanguageSpec parallel** (R2-T-Ground-LanguageSpec sub-lane) — Grounding Manager authors the LanguageSpec schema in parallel; Evaluator Manager consumes it for cross-target equivalence work. - -**Director-discretionary timing:** Evaluator design lock cadence may run during R1's final week (mirror of R2's pre-R1-close pattern); design-only work doesn't conflict with R1 closure. +Before worker dispatch begins on the implementation sub-lanes above, **5 design PRs land per their dependency graph** (parallelize where independent; serialize where there's a real dependency): + +``` + ┌───────→ PR-B (Witness construction surface) + │ │ + PR-A ────────┤ ↓ + (Runtime │ │ + value ├───────→ PR-E ←─── PR-C (Reflection completeness spec) + model) │ (Final │ + │ integration) ↓ + └─────────────────────┴── (consumed by R3-T-LensProducer-Retirement) + + PR-D (L5 corpus type spec) ──→ PR-E (independent of A/B/C; cross-target equivalence) + (consumed by R3-T-V-L5-Corpus) +``` + +| PR | Depends on | Parallelizable with | Locks | Status | +|---|---|---|---|---| +| **PR-A** | (foundational) | — | Runtime value model — closed-over environments, lazy/eager strategy, memoization | NOT YET AUTHORED | +| **PR-B** | PR-A | PR-C, PR-D | Witness construction surface — concrete shape for runtime materialization | NOT YET AUTHORED | +| **PR-C** | (foundational; substrate-reflection-shape) | PR-A, PR-B, PR-D | Reflection completeness spec — what does "complete reflection" mean for `reflect_program_dag_nodes_in_file`? | NOT YET AUTHORED (consumed by R3-T-LensProducer-Retirement) | +| **PR-D** | (foundational; cross-target spec) | PR-A, PR-B, PR-C | L5 corpus type spec — algebraic equivalence over curated corpus (locked direction; specific design here) | NOT YET AUTHORED (consumed by R3-T-V-L5-Corpus) | +| **PR-E** | All of PR-A through PR-D | (synthesis; serializes after) | Final integration design — synthesizes PR-A through PR-D into the implementation roadmap | NOT YET AUTHORED | + +**Sequencing principle (per Director directive 2026-04-28):** "focus on dependencies — writing code is fast; we get stuck in review." Parallelize PR-A, PR-C, PR-D as independent foundational design locks; PR-B serializes after PR-A (witness construction uses runtime values); PR-E synthesizes after all four. Worker dispatch on implementation sub-lanes blocks on PR-E. + +Plus **LanguageSpec parallel** (R2-T-Ground-LanguageSpec sub-lane) — Grounding Manager authors the LanguageSpec schema in parallel; Evaluator Manager consumes it for cross-target equivalence work. Independent of PR-A through PR-E. + +**Timing:** Evaluator design lock cadence dispatches **post-#1078-merge** (now). R1 close coordination handled by R1 Closure Manager (PR #1065); per Director directive R1 ASAP, design work shouldn't block on R1 closure mechanics. Specific R1-handover items coordinated via cross-manager queue (see Cross-program dependencies below). ## Cross-program dependencies From 840fae3f5912ca2e381ec3669935954e36585d5a Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 28 Apr 2026 18:48:03 -0400 Subject: [PATCH 03/22] WIP: Gunbc PM --- docs/briefs/r2-evaluator-manager.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/docs/briefs/r2-evaluator-manager.md b/docs/briefs/r2-evaluator-manager.md index 93d02c55290..51f469c6d7c 100644 --- a/docs/briefs/r2-evaluator-manager.md +++ b/docs/briefs/r2-evaluator-manager.md @@ -60,7 +60,13 @@ Before worker dispatch begins on the implementation sub-lanes above, **5 design Plus **LanguageSpec parallel** (R2-T-Ground-LanguageSpec sub-lane) — Grounding Manager authors the LanguageSpec schema in parallel; Evaluator Manager consumes it for cross-target equivalence work. Independent of PR-A through PR-E. -**Timing:** Evaluator design lock cadence dispatches **post-#1078-merge** (now). R1 close coordination handled by R1 Closure Manager (PR #1065); per Director directive R1 ASAP, design work shouldn't block on R1 closure mechanics. Specific R1-handover items coordinated via cross-manager queue (see Cross-program dependencies below). +**Timing — option (c) hybrid (Director-locked 2026-04-28 via dialogue):** + +- **PR-A through PR-D** = design-only (no worker dispatch). **Dispatch immediately post-#1078-merge** — these don't conflict with R1 closure work because no workers are running on them yet. Director writes design docs; the structural-discipline handshake lives where workers dispatch, not here. +- **PR-E (Final integration + worker dispatch brief)** = the load-bearing handshake. **Wait on R1-Closure-Manager-signals-R1-close** before authoring + dispatching. R1 closure window is small (fixture authoring only — single `r1_release_acceptance.dag` + R1C-B's 3 fixtures); the wait is days, not weeks. +- **Worker dispatch on implementation sub-lanes** = blocks on PR-E + R1 close signal jointly. + +Rationale: artificially delaying PR-A through PR-D wouldn't preserve any real handshake invariant — those are design docs. The structural discipline (R1→R2 transition mechanics, manager spawn ordering, dispatch-discipline) fires at worker-dispatch time, which is exactly where PR-E + the joint wait gates it. ## Cross-program dependencies @@ -86,9 +92,15 @@ Full disposition table: [`docs/r2-structure.md`](../r2-structure.md) §4 + [`doc ## Pre-spawn vs post-spawn authority -- **Pre-spawn (this brief authored post-#1078-merge by PM/Director):** brief authoring + PR-A through PR-E design-lock cadence sequence locked. Manager spawns once a design-lock PR is dispatchable. +- **Pre-spawn (this brief authored post-#1078-merge by PM/Director):** brief authoring + PR-A through PR-E design-lock cadence sequence locked. Manager spawns once a design-lock PR is dispatchable. PR-A/B/C/D dispatch immediately (design-only, no workers); PR-E + worker dispatch wait on R1 close signal per option (c) hybrid above. - **Post-spawn (Evaluator Manager active):** Manager owns all worker-brief authoring autonomously per "Autonomous dispatch authority" below. Director's role narrows to cross-program conflict resolution + scope-change escalation. +**R1 test-infrastructure precedent** (per Director coordination 2026-04-28; acknowledged in PR-E worker-dispatch brief — NOT substrate input): R1 closure produced reusable test-infrastructure patterns that PR-E should reference where applicable for R2-Evaluator's own structural-acceptance fixtures: +- **TestPredicate variants from R1C-D** (`CensusBoundCheck` / `CensusSubsetCount` / `RatchetZero` / `GeneratedFromDag` / `FixedPointConverges`) — reusable test-predicate pattern; relevant for Evaluator's `.dag` TestClaim acceptance gates (Acceptance section above). +- **Concession-encoding pattern from `r1_release_acceptance.dag`** (in flight via still-seal-529) — structural-fact-cites-lane-authority shape. Reusable for R2 lane-close fixtures with similar evaluator-ready-vs-substrate-pending disposition. + +**Explicitly NOT from R1** (Director-confirmed 2026-04-28): reflection completeness lives in PR-C (Evaluator's design lock); witness construction is R2-Substrate authority (`Witness` + `DimensionReport` already exist in `src/v3/std/dimensions.dag`); Evaluator constructs witnesses by evaluating `.dag` bodies through the lens framework. R1 doesn't produce substrate facts R2-Evaluator consumes directly. + ## Autonomous dispatch authority - Authors all T-Evaluator sub-briefs without Director (after PR-A through PR-E design lock). From 2aa6441cb3199ecaea216b3f05b39e2c9360bc8e Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 28 Apr 2026 19:04:33 -0400 Subject: [PATCH 04/22] WIP: Gunbc PM --- docs/briefs/r2-grounding-manager.md | 150 +++++++++++++++---- docs/briefs/r2-impossible-bugs-manager.md | 44 +++++- docs/briefs/r2-modeling-manager.md | 70 +++++++-- docs/briefs/r2-pure-bootstrap-manager.md | 89 ++++++++++-- docs/briefs/r2-substrate-manager.md | 166 +++++++++++++++++----- 5 files changed, 415 insertions(+), 104 deletions(-) diff --git a/docs/briefs/r2-grounding-manager.md b/docs/briefs/r2-grounding-manager.md index d21daa143fc..a182c0ed7f8 100644 --- a/docs/briefs/r2-grounding-manager.md +++ b/docs/briefs/r2-grounding-manager.md @@ -1,78 +1,170 @@ # R2 Grounding Manager Brief -**Status:** PROPOSAL (per [`docs/r2-structure.md`](../r2-structure.md), LIVE 2026-04-26 via PR #827). Spawns on R1 close per Transition mechanics step 4. Migrates content from [`grounding-manager.md`](grounding-manager.md) (which archives on R2 promotion). +**Status:** PROPOSAL (per [`docs/r2-structure.md`](../r2-structure.md), LIVE 2026-04-26 via PR #827; refreshed 2026-04-28 post-#1078 merge to absorb the engine-reframe cascade — coercion-engine framing replaced with 5 substrate-completion lanes per `docs/design-emission-model.md`). Eligible to spawn pre-R1-close per `r2-structure.md` Transition mechanics step 4 (no technical R1 dependency). Migrates content from [`grounding-manager.md`](grounding-manager.md) (which archives on R2 promotion). ## Orient before reading -- **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md). Names this manager one of 6 standing R2 managers (alongside Substrate, Modeling, Impossible-Bugs, Pure Bootstrap, R2 Release; cross-program coordination via Director). -- **Program scope source:** [`THESIS.md §"Tier 1 — Structural correctness — Grounding completeness"`](../../THESIS.md) + [`ROADMAP.md §"Post-R1 Program — Grounding Completeness"`](../../ROADMAP.md). -- **Cross-program consumer:** Engine sharpened-(b) full pilot enumeration consumes Substrate Manager's ValueBody-list/sum + std.unicode bootstrap carrier (T-Substrate sub-lane #4). Coordinate via R1 `Cross-manager notifications queued` brief pattern. -- **Demo coordination:** signal lane-close to R2 Release Manager (closure ledger + demo coordination per `docs/r2-structure.md`). +- **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md). Names this manager one of **7** standing R2 managers. Owns **T-Ground XL** sub-program (Goal 1 — Grounding Completeness, the program with R2's only true critical path). +- **Program scope source:** [`THESIS.md §"Tier 1 — Structural correctness — Grounding completeness"`](../../THESIS.md) + [`ROADMAP.md §"Post-R1 Program — Grounding Completeness"`](../../ROADMAP.md) + [`docs/design-emission-model.md`](../design-emission-model.md) (engine-reframe spec). +- **No-engine emission model — locked direction (per `docs/design-emission-model.md` + #1078):** THESIS:171 is explicit: "Coercion = emission. No separate coercion engine." The prior `T-Ground-Engine` lane name implied an authority that "picks up slack" when structure under-determines targets — that violates fail-closed (P3) + parallel-authority discipline (P2). The reframe **dissolves the engine framing** into 5 substrate-completion lanes that surface the real modeling problems the engine framing was hiding. +- **Cross-program consumer:** Coercion-Fold full pilot enumeration via symbolic walk of `rust_pilot_primitives: List` is gated on Substrate Manager's ValueBody-list/sum + `std.unicode` bootstrap carrier. Coordinate via R1 `Cross-manager notifications queued` brief pattern. +- **Demo coordination:** signal lane-close to R2 Release Manager (closure ledger; per the **structural-acceptance-per-lane-close discipline** locked in `r2-structure.md` — the demo IS the structural gate, not a separate artifact). +- **Substrate-fact-introduction procedure** ([`INVARIANTS.md`](../../INVARIANTS.md) §P1): self-serve through the 3-step decision procedure before escalating substrate-shape questions to Director or Substrate Manager. -## Program scope (T-Ground) +## Program scope (T-Ground XL — 11 lanes) -R2's Goal 1 — **Grounding Completeness**. Target-side primitive types (Rust / Python / Go) structurally declared in `.dag` rather than table-driven; coercion via algebraic-inhabitance search; Track-13 dissolution. Inherits from `ROADMAP.md §"Post-R1 Program — Grounding Completeness"`. +R2's Goal 1 — **Grounding Completeness**. Target-side primitive types (Rust / Python / Go) structurally declared in `.dag` rather than table-driven; coercion **as emission** via algebraic-inhabitance search; Track-13 dissolution. -The one true critical path in R2: `Pilot → Rust → Engine → Tests → Dissolve`. Python and Go run as fill-queue alongside the critical path. +The one true critical path in R2: `Pilot → Rust → LanguageSpec → Coercion-Fold → Tests → Dissolve`. Python and Go run as fill-queue alongside the critical path. + +### 11-lane structure (post-engine-reframe; locked 2026-04-28) + +**Foundational (already landed):** +1. **T-Ground-Pilot** S — DONE (PR #765 merged 2026-04-25). Toy inhabitance-search engine for Rust integer family + bool + Unit. + +**Per-target primitive declarations:** +2. **T-Ground-Rust** XL — Rust target-spec primitive declarations end-to-end. Critical path because Coercion-Fold blocks on layers 1–3 populated. +3. **T-Ground-Python** L — Python target-spec primitive declarations; not Coercion-Fold-blocking. Fill queue. +4. **T-Ground-Go** L — Go target-spec primitive declarations; not Coercion-Fold-blocking. Fill queue. + +**5 substrate-completion lanes (replace prior single Engine lane; locked 2026-04-28 per #1078 cascade):** +5. **T-Ground-Coercion-Fold** S — Refinement composition as a structural fold over substrate facts. Replaces the prior single-engine Phase 2 with a fold over ValueBody-list/sum substrate. Includes mirror-consistency probe footprint (PR #989, currently merged on main; post-merge realignment per `design-emission-model.md` §"Affected lanes" option (c) — hold further engine-framed slices, queue cleanup wave once LanguageSpec lands). +6. **T-Ground-LanguageSpec** M — Structured language-spec substrate declaration. Absorbs target primitive/range duplication retirement (Reflective Pattern E) — `Dag::rust_pilot_primitives()` consumed structurally; `RUST_PILOT_PRIMITIVES` Rust mirror retired. Per Q3 lock: each per-target primitive carries `RealizationCost { storage: Cost, access: Map> }`. +7. **T-Ground-Lifetime-Analyzer** M — Derives ownership/lifetime structurally from program use. **No annotation surface** — replaces the retracted "Annotation" lane per Modeling problem 3 corrected. Lifetime is structural fact emerging from program shape, not user-authored markup. +8. **T-Ground-Diagnostic** S — Declared structural ordering for diagnostic enumeration; fail-closed diagnostic surface. Coordinate with Substrate Manager re: `Diagnostic.kind` extensibility (Q6 lock). +9. **T-Ground-CrossTarget-Meta** S — Cross-target uniformity meta-spec. Owns L6 per-(form × target) substrate-load completeness check (different input space from Lens instances; not a structural lens — runtime check). Q5 lock confirmed cardinality-as-connectives axis collapses with PR-PreF Interval; PR-J likely no-op. + +**Closure:** +10. **T-Ground-Tests** S — L4 verification of routing correctness via routing-stability tests + algebra-satisfaction certification. +11. **T-Ground-Dissolve** S — Track-13 dissolution: delete `TypeCheckpoint` / `InhabitantDecl` / `carrier: String` once Coercion-Fold carries the load. Final critical-path step. + +## Pre-dispatch design lock cadence (consumed; per #1078 lock) + +The 8-question design dialogue resolved into a cadence whose merge gates worker dispatch on this manager's lanes: + +| Cadence PR | Locks | Consumer (this manager) | +|---|---|---| +| **PR-PreF** *(Substrate-owned; foundational)* | `Interval` substrate consolidation | All Q1-consuming lanes | +| **PR-F** | Q1 (`BoundDeclaration = StaticBound(Interval) \| PlatformDependent`; consumes PR-PreF) + Q2 Rust axes | T-Ground-Coercion-Fold + T-Ground-Rust | +| **PR-G** | Q2 Python axes | T-Ground-Python | +| **PR-H** | Q2 Go axes | T-Ground-Go | +| **PR-I** | Q3 (per-primitive realization cost — `Cost = Dimension`; Bits/CPUCycles primitives) + Q4 (universal four-property gate) | T-Ground-LanguageSpec + T-Verification-L4-L7-Direct (R3) | +| **PR-J** | Q5 (cardinality enumeration — likely no-op given PR-PreF consolidation) | T-Ground-CrossTarget-Meta | + +**Asymmetric BoundDeclaration match rule (Q1 lock):** target's `Unbounded` universally accepts; target's `ExactInterval(lo,hi)` requires exact range match. Worker briefs MUST consume this without re-litigation. ## Owned deliverables (through R2 close) | Lane | Size | Status (at brief authoring) | Description | |---|---|---|---| -| T-Ground-Pilot | S | DONE (PR #765 merged 2026-04-25) | Toy inhabitance-search engine for Rust integer family + bool + Unit; routing-stability tests demonstrating parity with current table lookup. | -| T-Ground-Rust | M | NOT YET AUTHORED — listed under Sub-briefs Pending below; gated on pre-spawn Director scope refinement per inbox #828. (Pilot PR #765 + Engine Phase 1 typestructure PR #788 are separate dispatched lanes — see those rows; the prior "DISPATCHED" status here was a parenthetical leak from the Engine row's loader-close parking note.) | Rust target-spec primitive declarations end-to-end. Critical path because Engine blocks on layers 1–3 populated. | -| T-Ground-Engine | M | DISPATCHED (Phase 1 typestructure landed PR #788; Phase 2 implementation pending substrate) | Engine that consumes target-spec primitives + does inhabitance-search; dependent on `ValueBody::List` substrate (Substrate Manager dependency). | -| T-Ground-Tests | M | NOT YET AUTHORED | L4 verification of routing correctness via routing-stability tests + algebra-satisfaction certification. | -| T-Ground-Dissolve | M | NOT YET AUTHORED | Track-13 dissolution: delete `TypeCheckpoint` / `InhabitantDecl` / `carrier: String` once Engine carries the load. Final critical-path step. | -| T-Ground-Python | M | FILL QUEUE (parallel after Pilot) | Python target-spec primitive declarations; not Engine-blocking. | -| T-Ground-Go | M | FILL QUEUE (parallel after Pilot) | Go target-spec primitive declarations; not Engine-blocking. | +| T-Ground-Pilot | S | DONE (PR #765 merged 2026-04-25) | Toy inhabitance-search engine; routing-stability tests | +| T-Ground-Rust | XL | NOT YET AUTHORED — Director scope refinement pending; **gated on PR-F merge** | Rust primitive declarations end-to-end; consumes Q1 BoundDeclaration + Q2 Rust axes | +| T-Ground-Python | L | NOT YET AUTHORED — fill queue; **gated on PR-G merge** | Python primitive declarations | +| T-Ground-Go | L | NOT YET AUTHORED — fill queue; **gated on PR-H merge** | Go primitive declarations | +| **T-Ground-Coercion-Fold** *(NEW; replaces engine framing)* | S | NOT YET AUTHORED — **gated on PR-F merge + Substrate ValueBody-list/sum** | Refinement composition as structural fold over substrate facts; absorbs PR #989 mirror-consistency probe footprint | +| **T-Ground-LanguageSpec** *(NEW)* | M | NOT YET AUTHORED — **gated on PR-I merge** | Structured language-spec substrate; absorbs Reflective Pattern E retirement; per-primitive `RealizationCost` | +| **T-Ground-Lifetime-Analyzer** *(NEW; no annotations)* | M | NOT YET AUTHORED | Structural ownership/lifetime derivation from program use | +| **T-Ground-Diagnostic** *(NEW)* | S | NOT YET AUTHORED | Declared structural ordering for diagnostic enumeration | +| **T-Ground-CrossTarget-Meta** *(NEW)* | S | NOT YET AUTHORED — **gated on PR-J merge (likely no-op)** | Cross-target uniformity meta-spec; owns L6 per-(form × target) load-completeness check | +| T-Ground-Tests | S | NOT YET AUTHORED | L4 routing correctness verification | +| T-Ground-Dissolve | S | NOT YET AUTHORED | Track-13 dissolution: delete `TypeCheckpoint` / `InhabitantDecl` / `carrier: String` | ## Cross-program dependencies **Produces (none — Grounding doesn't produce carriers other managers consume).** **Consumes:** -- **Substrate Manager — ValueBody-list/sum + std.unicode bootstrap carrier**: Engine sharpened-(b) full pilot enumeration via symbolic walk of `rust_pilot_primitives: List` is gated on this. Substrate Manager signals readiness via cross-manager queue; Grounding Manager dispatches Engine sharpened-(b) consumer migration on receipt. +- **Substrate Manager — ValueBody-list/sum + std.unicode bootstrap carrier**: Coercion-Fold full pilot enumeration via symbolic walk of `rust_pilot_primitives: List` is gated on this. Substrate Manager signals readiness via cross-manager queue; Grounding Manager dispatches Coercion-Fold consumer migration on receipt. +- **Substrate Manager — PR-PreF Interval consolidation**: required for Q1 BoundDeclaration consumer in Coercion-Fold lane. +- **Substrate Manager — `Diagnostic.kind` extensibility (Q6 lock)**: Diagnostic lane coordinates with Substrate at `CompilerDiagnosticKind` extension time. + +**Adjacent territory:** none (Grounding owns its program completely; cross-target meta-spec is fully internal). + +## Locked design decisions consumed (per #1078 8-question dialogue) + +Worker briefs MUST consume these without re-litigation: + +- **Q1**: `Interval` shared parent (PR-PreF prepended); `BoundDeclaration = StaticBound(Interval) | PlatformDependent`; asymmetric match rule (target's `Unbounded` universal-accepts; target's `ExactInterval(lo,hi)` requires exact range match). +- **Q2 (b3' emission-biased non-violating minimal target modeling)**: `ReferenceModel` shared parent; four-property gate (Faithful / Correct / Minimal / Performant). Each per-target axis (Rust/Python/Go) instances `ReferenceModel`. +- **Q3**: `RealizationCost { storage: Cost, access: Map> }`; `Cost = Dimension`; Bits/CPUCycles substrate primitives sibling to SI base units. +- **Q4**: universal four-property gate (cascaded from Q2) — every reference model verified against the four properties. +- **Q5**: cardinality is the connectives axis; PR-J no-op given PR-PreF consolidation. + +Full disposition: [`docs/r2-structure.md`](../r2-structure.md) §4 + [`docs/design-emission-model.md`](../design-emission-model.md) Q1-Q5. ## Pre-spawn vs post-spawn authority -- **Pre-spawn (now, before R1 close):** Director + PM coordinate on brief authoring per inbox #828 split. PM authors the manager skeleton (this file); Director authors any worker-level briefs not yet existing per the manager's "Pending" sub-briefs list. Both stop authoring once R2 spawns. +- **Pre-spawn (post-#1078-merge):** brief authoring + cadence sequence locked. Manager spawns once a design-lock PR (PR-F earliest) is dispatchable; pre-R1-close spawn allowed (no technical R1 dependency). - **Post-spawn (R2 promotion onward):** Manager owns all worker-brief authoring autonomously per "Autonomous dispatch authority" below. Director's role narrows to cross-program conflict resolution + scope-change escalation. ## Autonomous dispatch authority -- Authors all T-Ground sub-briefs without Director. +- Authors all T-Ground sub-briefs (11 lanes) without Director. - Dispatches workers against T-Ground sub-briefs. - Resolves T-Ground-internal scope refinements; escalates blockers and scope changes to Director. - Per `docs/r2-structure.md` P5 dispatch-discipline: every T-Ground worker brief that introduces a scaffold names its dissolution trigger + adjacent ROADMAP debt row + contributes-or-defers stance; every PR introducing hand-Rust under `src/v3/` fills the per-PR gate. +- **Substrate-fact-introduction procedure** ([`INVARIANTS.md`](../../INVARIANTS.md) §P1) applies to LanguageSpec and Lifetime-Analyzer briefs introducing new substrate types/variants/fields. +- **Cross-program signal authority:** carrier-consumption requests → Substrate Manager via cross-manager queue; per-lane closure → R2 Release Manager (closure ledger). ## Reporting cadence -- Lane-close → R2 Release Manager (closure ledger). -- Cross-program signals (e.g., Engine sharpened-(b) substrate readiness consumed) → cross-manager queue. +- Lane-close → R2 Release Manager (closure ledger). Each lane's structural acceptance gate IS the demo per **structural-acceptance-per-lane-close discipline**. +- Cross-program signals (Substrate carrier consumption, Diagnostic.kind coordination) → cross-manager queue. - Blockers + scope changes → Director. -- Weekly health surfacing to Director: which lanes within 1 step of unblocking, which workers fill vs. ready. +- **Weekly health surfacing to Director:** which lanes within 1 step of unblocking, which workers fill vs. ready, which cadence PRs (PR-F/G/H/I/J) landed vs pending. + +## Acceptance — `.dag` gates + +Each lane closes under a structural acceptance gate authored as a `.dag` `TestClaim`: + +- `pilot_inhabitance_routing_stability_landed` — DONE (PR #765) +- `rust_target_primitives_declared_structurally` +- `python_target_primitives_declared_structurally` +- `go_target_primitives_declared_structurally` +- `coercion_fold_emission_correct` — refinement composition as fold over substrate facts produces correct emission across pilot enumeration +- `language_spec_realization_cost_landed` — per-primitive `RealizationCost { storage, access }` populated; `RUST_PILOT_PRIMITIVES` mirror retired +- `lifetime_analyzer_structural_derivation_landed` — ownership/lifetime derived from program use; no annotation surface introduced +- `diagnostic_structural_ordering_landed` — declared enumeration order; fail-closed diagnostic surface +- `cross_target_meta_l6_load_completeness_landed` — L6 per-(form × target) substrate-load completeness check fires by construction +- `routing_correctness_l4_verified` — Tests lane closes +- `track_13_dissolution_complete` — `TypeCheckpoint` / `InhabitantDecl` / `carrier: String` deleted ## Sub-briefs (authored / pending) Authored: - T-Ground-Pilot (PR #765, merged) -- T-Ground-Engine Phase 1 typestructure (PR #788, merged) - -Pending — pre-spawn Director scope refinement per inbox #828 coordination split (may absorb these into one bundled R2 worker brief or split per lane); post-spawn manager-authored autonomously per "Pre-spawn vs post-spawn authority" subsection above: -- T-Ground-Rust full implementation -- T-Ground-Engine Phase 2 implementation (gated on substrate) +- T-Ground-Coercion-Fold Phase 1 typestructure (PR #788, merged; framed under prior engine-naming — to be cascaded post-LanguageSpec) +- PR #989 (slice 1 mirror-consistency probe; merged on main pre-cascade — cleanup queued per `design-emission-model.md` §"Affected lanes" option (c)) + +Pending — post-spawn manager-authored autonomously: +- T-Ground-Rust full implementation (gated on PR-F) +- T-Ground-Coercion-Fold Phase 2 implementation (gated on PR-F + Substrate ValueBody-list/sum) +- T-Ground-LanguageSpec (gated on PR-I; absorbs target primitive/range duplication retirement) +- T-Ground-Lifetime-Analyzer (M; structural ownership/lifetime derivation) +- T-Ground-Diagnostic (S) +- T-Ground-CrossTarget-Meta (S; gated on PR-J no-op confirmation) - T-Ground-Tests - T-Ground-Dissolve (Track-13 cleanup) - T-Ground-Python - T-Ground-Go +- **Cleanup wave**: post-LanguageSpec, retire PR #989's engine-framed structure into the Coercion-Fold framing (per `design-emission-model.md` §"Affected lanes" option (c)) ## Working state (fill on spawn) -Lane status table refreshes here as work lands. Pre-spawn placeholder. +Spawn refresh, 2026-04-28 (post-#1078 engine-reframe cascade): + +- 11-lane structure replaces the prior 7-lane Pilot/Rust/Engine/Tests/Dissolve framing. +- 5 new substrate-completion lanes added (Coercion-Fold S + LanguageSpec M + Lifetime-Analyzer M + Diagnostic S + CrossTarget-Meta S). +- PR #989 (slice 1 of Phase 2) merged on main pre-cascade — cleanup wave queued; hold further engine-framed slices. +- Cadence PR-F through PR-J gate worker dispatch on dependent lanes; PR-PreF (Substrate-owned) gates Q1-consuming lanes. +- The "Annotation" lane was retracted in favor of structural derivation per Modeling problem 3 corrected; Lifetime-Analyzer replaces it. ## Cross-refs -- Parent: `docs/r2-structure.md` §"Grounding Manager" +- Parent: `docs/r2-structure.md` §"Grounding Manager" (now 11 lanes; engine-reframe locked 2026-04-28) +- Engine-reframe spec: `docs/design-emission-model.md` (no-engine emission discipline; 8 worked examples; Q1-Q5 locks) +- Q6-Q8 (lens framework): `docs/design-lens-framework.md` +- INVARIANTS substrate-fact-introduction procedure: `INVARIANTS.md` §P1 - Migrating from: `docs/briefs/grounding-manager.md` (archives on R2 promotion) -- Pre-spawn engineering: `docs/briefs/grounding-pilot-receipt.md`, `docs/briefs/t-ground-engine-substrate-escalation.md` +- Pre-spawn engineering: `docs/briefs/grounding-pilot-receipt.md`, `docs/briefs/t-ground-engine-substrate-escalation.md` (both pre-cascade — post-cascade naming aligns with new lane structure) +- Thesis-claim disposition: `docs/thesis/r2-r3-thesis-mapping.md` diff --git a/docs/briefs/r2-impossible-bugs-manager.md b/docs/briefs/r2-impossible-bugs-manager.md index 42e1589affd..bd592b26564 100644 --- a/docs/briefs/r2-impossible-bugs-manager.md +++ b/docs/briefs/r2-impossible-bugs-manager.md @@ -1,12 +1,15 @@ # R2 Impossible-Bugs Manager Brief -**Status:** PROPOSAL (per [`docs/r2-structure.md`](../r2-structure.md), LIVE 2026-04-26 via PR #827). Spawns on R1 close per Transition mechanics step 4. NEW manager. +**Status:** PROPOSAL (per [`docs/r2-structure.md`](../r2-structure.md), LIVE 2026-04-26 via PR #827; refreshed 2026-04-28 post-#1078 merge to reference structural-acceptance-per-lane-close discipline + R2-close archival per Director cascade). Eligible to spawn pre-R1-close per `r2-structure.md` Transition mechanics step 4 (no technical R1 dependency). NEW manager. ## Orient before reading -- **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md). Names this manager one of 6 standing R2 managers. +- **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md). Names this manager one of **7** standing R2 managers (count rose from 6 to 7 with Evaluator added 2026-04-28 per #1078). - **Program scope source:** [`docs/r2-structure.md` §"Goals" item 4](../r2-structure.md) + [`THESIS.md §"Enumerable impossible-bug classes"`](../../THESIS.md) (R2+ tags authority). - **Cross-program coordination:** classes that surface substrate gaps escalate to Substrate Manager rather than expanding T-ImpossibleBugs scope. +- **Demo coordination:** signal class-close to R2 Release Manager (closure ledger; per the **structural-acceptance-per-lane-close discipline** locked in `r2-structure.md` — the demo IS the structural gate, not a separate artifact). +- **Lifecycle:** **Manager archives at R2 close** per Director cascade ratified 2026-04-28 (`r3-structure.md` §"R2 manager continuation"): "Modeling/Impossible-Bugs Managers archive at R2 close." No R3 continuation work; post-R2 emergent impossible-bug classes are absorbed by Substrate Manager continuation per closed-system principle (new classes = enumeration was wrong = substrate gap). +- **Substrate-fact-introduction procedure** ([`INVARIANTS.md`](../../INVARIANTS.md) §P1): if implementation surfaces a substrate gap, self-serve through the 3-step decision procedure or signal Substrate Manager. Don't expand T-ImpossibleBugs scope to author substrate locally. ## Program scope (T-ImpossibleBugs) @@ -27,7 +30,7 @@ For each class: - Manager dispatches the implementation worker for each class (each ungated per design-doc audit; substrate gaps surface during execution as STOP-AND-ESCALATE → Substrate Manager). - Substrate-gap discoveries (if any class's implementation surfaces a real substrate need beyond what design docs accounted for) become a Substrate Manager hand-off (escalate per cross-program rule below). This is the exception path; the expected path is direct implementation per design-doc Director-actionable recommendation. - Structural test demonstrating the impossible-bug status (e.g., synthetic input → compile-time diagnostic, not runtime panic) — included in each implementation worker brief's acceptance. -- Class-close signal to R2 Release Manager. +- Class-close signal to R2 Release Manager (per **structural-acceptance-per-lane-close discipline** — the structural test IS the demo). ## Cross-program dependencies @@ -43,23 +46,43 @@ For each class: **Escalation rule:** if a class turns out to need substrate work outside what's already scoped in T-Substrate sub-lanes, **STOP and escalate to Substrate Manager** rather than expanding T-ImpossibleBugs scope. Substrate Manager re-scopes; T-ImpossibleBugs class waits on substrate. +## Locked design decisions consumed (per #1078 dialogue) + +Worker briefs MUST consume these without re-litigation: + +- **Q6 (Witness + Diagnostic.kind extensibility)**: structural-validation failures encode into `Diagnostic.kind` extensions; relevant for unhandled-diagnostic-paths and unenumerated-effects implementation if/when they surface diagnostic-shape questions during dispatch. +- **Closed-system effects model** (PR #808): canonical authority for unenumerated-effects class; 5-behavior structural fold; no annotation surface. + +Full disposition: [`docs/r2-structure.md`](../r2-structure.md) §4. + ## Pre-spawn vs post-spawn authority -- **Pre-spawn (now, before R1 close):** Director + PM coordinate on brief authoring per inbox #828 split. PM authors the manager skeleton (this file); Director authors any worker-level briefs not yet existing per the manager's "Pending" sub-briefs list. Both stop authoring once R2 spawns. +- **Pre-spawn (post-#1078-merge):** brief authoring complete (this skeleton + 3 implementation workers landed via PR #836). Manager spawns once R2 promotion fires; pre-R1-close spawn allowed (no technical R1 dependency). - **Post-spawn (R2 promotion onward):** Manager owns all worker-brief authoring autonomously per "Autonomous dispatch authority" below. Director's role narrows to cross-program conflict resolution + scope-change escalation. +- **R2 close:** Manager archives. No R3 continuation. Post-R2 emergent classes route to Substrate Manager continuation. ## Autonomous dispatch authority - Authors all T-ImpossibleBugs worker briefs without Director. - Dispatches workers against worker briefs (subject to substrate-gating coordination with Substrate Manager). - Resolves T-ImpossibleBugs-internal scope refinements; escalates substrate gaps to Substrate Manager and blockers/scope changes to Director. -- Per `docs/r2-structure.md` P5 dispatch-discipline: every T-ImpossibleBugs worker brief names dissolution trigger + adjacent ROADMAP debt row + contributes-or-defers stance. +- Per `docs/r2-structure.md` P5 dispatch-discipline: every T-ImpossibleBugs worker brief names dissolution trigger + adjacent ROADMAP debt row + contributes-or-defers stance; every PR introducing hand-Rust under `src/v3/` fills the per-PR gate. +- **Cross-program signal authority:** substrate-gap signals → Substrate Manager via cross-manager queue; per-class closure → R2 Release Manager (closure ledger). ## Reporting cadence -- Class-close → R2 Release Manager (closure ledger). +- Class-close → R2 Release Manager (closure ledger; per **structural-acceptance-per-lane-close discipline**). - Substrate-gap discoveries → Substrate Manager (cross-manager queue). - Blockers + scope changes → Director. +- **Weekly health surfacing to Director:** which classes within 1 step of close, which workers fill vs. ready, any substrate-gap escalations in flight. + +## Acceptance — `.dag` gates + +Each class closes under a structural acceptance gate authored as a `.dag` `TestClaim`: + +- `nested_optional_flatten_compile_error` — `Some(Some(x))` is structurally inexpressible (substrate-constructor invariant) — synthetic `T??` input produces compile-time diagnostic +- `unhandled_diagnostic_paths_int_div_first_slice` — `Int / Int` divide-by-zero produces compile-time diagnostic via totality-by-omission (algebra retype) +- `unenumerated_effects_closed_system_complete` — 5-behavior fold over substrate primitives demonstrates effect enumeration is exhaustive; new effect = substrate gap, not new effect kind ## Sub-briefs (authored / pending) @@ -87,7 +110,11 @@ For each class: ## Working state (fill on spawn) -Class status table refreshes here as work lands. Pre-spawn placeholder. +Spawn refresh, 2026-04-28 (post-#1078): + +- Class status table unchanged in scope; 3 implementation workers landed via PR #836. +- Manager archives at R2 close; no R3 continuation work. +- Post-R2 emergent classes route to Substrate Manager continuation per closed-system principle. ## Cross-refs @@ -96,3 +123,6 @@ Class status table refreshes here as work lands. Pre-spawn placeholder. - Effects framing: PR #808 (closed-system effects model + 5-behavior fold) - Effects prereq: PR #805 (Fn→Arrow refactor) - Adjacent designs: PRs #798 (nested-optional), #801 (unhandled diagnostics) +- INVARIANTS substrate-fact-introduction procedure: `INVARIANTS.md` §P1 +- R2-close archival authority: `docs/r3-structure.md` §"R2 manager continuation" +- Thesis-claim disposition: `docs/thesis/r2-r3-thesis-mapping.md` diff --git a/docs/briefs/r2-modeling-manager.md b/docs/briefs/r2-modeling-manager.md index 82464038923..fcb3f84cda5 100644 --- a/docs/briefs/r2-modeling-manager.md +++ b/docs/briefs/r2-modeling-manager.md @@ -1,13 +1,14 @@ # R2 Modeling Manager Brief -**Status:** PROPOSAL (per [`docs/r2-structure.md`](../r2-structure.md), LIVE 2026-04-26 via PR #827). Spawns on R1 close per Transition mechanics step 4. NEW manager. +**Status:** PROPOSAL (per [`docs/r2-structure.md`](../r2-structure.md), LIVE 2026-04-26 via PR #827; refreshed 2026-04-28 post-#1078 merge to consume PR-PreF Interval via Q1 lock + INVARIANTS substrate-fact-introduction procedure). Eligible to spawn pre-R1-close per `r2-structure.md` Transition mechanics step 4 (no technical R1 dependency). NEW manager. ## Orient before reading -- **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md). Names this manager one of 6 standing R2 managers. +- **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md). Names this manager one of **7** standing R2 managers (count rose from 6 to 7 with Evaluator added 2026-04-28). - **Program scope source:** [`docs/r2-structure.md` §"Goals" item 2 (modeling-faithfulness)](../r2-structure.md) + 4th item the rework added (tokenizer charclass phase-2 consumer). -- **Cross-program consumer:** all 4 items consume Substrate Manager carriers. Three dispatch as their T-Substrate dependency lands; Dimensions is dispatchable immediately because the producer audit found the needed phantom-parameter substrate already present. -- **Demo coordination:** signal item-close to R2 Release Manager (closure ledger + demo coordination). +- **Cross-program consumer:** all 4 items consume Substrate Manager carriers. Three dispatch as their T-Substrate dependency lands; Dimensions is dispatchable immediately because the producer audit found the needed phantom-parameter substrate already present. **Int-lit item now consumes PR-PreF Interval** (Q1 lock cascaded 2026-04-28). +- **Demo coordination:** signal item-close to R2 Release Manager (closure ledger; per the **structural-acceptance-per-lane-close discipline** locked in `r2-structure.md` — the demo IS the structural gate, not a separate artifact). +- **Substrate-fact-introduction procedure** ([`INVARIANTS.md`](../../INVARIANTS.md) §P1): self-serve through the 3-step decision procedure when the consumer migration surfaces a substrate gap. If the procedure outcome is "extend substrate," signal Substrate Manager via cross-manager queue rather than authoring substrate locally. ## Program scope (T-Modeling) @@ -15,35 +16,57 @@ R2's Goal 2 — **Modeling-faithfulness dissolution**. Three Tier-1 type-refinem | Item | Consumer of | Status (at brief authoring) | |---|---|---| -| Surface int-literal magnitude at concept layer | T-Substrate cardinality subset | AUTHORED — gated on producer readiness / scoped to range-facts consumer work | +| Surface int-literal magnitude at concept layer | T-Substrate cardinality subset (consuming PR-PreF Interval) | AUTHORED — gated on producer readiness / scoped to range-facts consumer work | | `Secret` nominal-opaque graduation | T-Substrate nominal-opaque subset | AUTHORED — gated on producer readiness | | `Dimension` typed value wrapper with phantom-parameter unit-mismatch enforcement | T-Substrate parametric-algebra subset | AUTHORED — dispatchable immediately; producer audit closed substrate-side | | Tokenizer charclass phase-2 | T-Substrate ValueBody-list/sum subset | AUTHORED — gated on producer readiness; reclassified R1→R2 per Surface Manager handoff 2026-04-24 | +## Pre-dispatch design lock cadence (consumed; per #1078 lock) + +Worker dispatch on the int-lit item gates on **PR-PreF Interval** (Substrate-owned; foundational substrate consolidation). Dimensions item is fully dispatchable now — no cadence dependency. Secret and charclass phase-2 are independent of the cadence. + +| Cadence PR | Locks | Consumer (this manager) | +|---|---|---| +| **PR-PreF** *(Substrate-owned)* | `Interval` substrate consolidation — shared parent | int-lit magnitude item (consumes Q1 BoundDeclaration via Interval) | + +**Asymmetric BoundDeclaration match rule (Q1 lock):** target's `Unbounded` universally accepts; target's `ExactInterval(lo,hi)` requires exact range match. Worker briefs MUST consume this without re-litigation when reasoning about int-magnitude reconciliation across targets. + ## Owned deliverables (through R2 close) For each item: - Worker brief authored (one per item; size S–M). - Worker dispatched as the corresponding T-Substrate sub-lane lands, except Dimensions which is already dispatchable per its producer audit. - Migration into the new substrate carrier; structural test demonstrating the impossible-bug class (e.g., int magnitude overflow → compile error; `Secret` no `Show` instance; `Dimension` + `Dimension` → unit-mismatch error). -- Item-close signal to R2 Release Manager (closure ledger + R2 demo). +- Item-close signal to R2 Release Manager (closure ledger + R2 demo per structural-acceptance-per-lane-close). ## Cross-program dependencies **Produces (none — Modeling consumes carriers, doesn't produce them).** **Consumes:** -- Substrate Manager — cardinality-for-int-lit subset +- Substrate Manager — cardinality-for-int-lit subset (now consumes PR-PreF Interval) - Substrate Manager — nominal-opaque-for-Secret subset - Substrate Manager — parametric-algebra-for-Dimensions subset - Substrate Manager — ValueBody-list/sum + std.unicode bootstrap **Adjacent territory:** - Tokenizer charclass phase-2 historically R1 T-Sub work; reclassified to R2 per Surface Manager handoff 2026-04-24. R1 retains the charclass phase-1 close; R2 Modeling Manager owns phase-2 (the substrate-capability-gated portion). +- **§6a per-method-metadata bulk migration** (R2 Release Manager-owned, but consumes `MethodContract` substrate at method-call sites in `cost.dag`/`complexity.dag`). Modeling Manager doesn't author this; tracked here only as adjacent. + +## Locked design decisions consumed (per #1078 8-question dialogue) + +Worker briefs MUST consume these without re-litigation: + +- **Q1**: `Interval` shared parent in substrate (PR-PreF prepended); `BoundDeclaration = StaticBound(Interval) | PlatformDependent`; asymmetric match rule (target's `Unbounded` universal-accepts; target's `ExactInterval(lo,hi)` requires exact range match). **Consumed by int-lit magnitude item.** +- **Q2 (b3' emission-biased non-violating minimal target modeling)**: relevant only as the framing under which Dimensions item's phantom-unit-mismatch error fires structurally; not directly consumed. +- **Q3 (Cost)**: not directly consumed by this manager (cost belongs to LanguageSpec lane in Grounding); referenced only for awareness. +- **Q5**: cardinality is the connectives axis; collapses with PR-PreF Interval; reinforces Dimensions item's `phantom_unit_mismatch` semantics. + +Full disposition: [`docs/r2-structure.md`](../r2-structure.md) §4. ## Pre-spawn vs post-spawn authority -- **Pre-spawn (now, before R1 close):** Director + PM coordinate on brief authoring per inbox #828 split. PM authors the manager skeleton (this file); Director authored the worker-level briefs listed below. Both stop authoring once R2 spawns. +- **Pre-spawn (post-#1078-merge):** brief authoring + cadence sequence locked. Manager spawns once at least one item is dispatchable; pre-R1-close spawn allowed (Dimensions item is dispatchable immediately). - **Post-spawn (R2 promotion onward):** Manager owns all worker-brief authoring autonomously per "Autonomous dispatch authority" below. Director's role narrows to cross-program conflict resolution + scope-change escalation. ## Autonomous dispatch authority @@ -51,31 +74,50 @@ For each item: - Authors all T-Modeling worker briefs without Director. - Dispatches workers against worker briefs as Substrate Manager signals carrier readiness. - Resolves Modeling-internal scope refinements; escalates blockers and scope changes to Director. -- Per `docs/r2-structure.md` P5 dispatch-discipline: every T-Modeling worker brief names its dissolution trigger + adjacent ROADMAP debt row + contributes-or-defers stance. +- Per `docs/r2-structure.md` P5 dispatch-discipline: every T-Modeling worker brief names its dissolution trigger + adjacent ROADMAP debt row + contributes-or-defers stance; every PR introducing hand-Rust under `src/v3/` fills the per-PR gate. +- **Substrate-fact-introduction procedure** ([`INVARIANTS.md`](../../INVARIANTS.md) §P1) applies when a consumer migration surfaces a substrate gap; if outcome is "extend substrate," signal Substrate Manager rather than authoring locally. +- **Cross-program signal authority:** carrier-consumption requests → Substrate Manager via cross-manager queue; per-item closure → R2 Release Manager (closure ledger). ## Reporting cadence -- Item-close → R2 Release Manager (closure ledger + demo coordination). +- Item-close → R2 Release Manager (closure ledger + demo coordination per structural-acceptance-per-lane-close). - Cross-program signals (consume Substrate Manager carrier-readiness) → cross-manager queue. - Blockers + scope changes → Director. +- **Weekly health surfacing to Director:** which items within 1 step of unblocking (Substrate readiness state); which workers fill vs. ready. + +## Acceptance — `.dag` gates + +Each item closes under a structural acceptance gate authored as a `.dag` `TestClaim`: + +- `int_lit_magnitude_overflow_compile_error` — int-literal exceeding target int range produces compile error via Q1 BoundDeclaration asymmetric match (consumes PR-PreF Interval) +- `secret_t_no_show_instance_compile_error` — `Secret` cannot be shown / serialized at compile time +- `dimension_unit_mismatch_compile_error` — `Dimension` + `Dimension` produces unit-mismatch error via `phantom_unit_mismatch` carrier +- `tokenizer_charclass_phase2_lowers_structurally` — `data ascii_scan_order: List = [...]` lowers structurally via ValueBody-list substrate ## Sub-briefs (authored / pending) -Authored — pre-spawn Director-authored per inbox #828 coordination split; post-spawn manager owns dispatch / refresh per "Pre-spawn vs post-spawn authority" subsection above: -- [`r2-modeling-int-lit-magnitude-worker.md`](r2-modeling-int-lit-magnitude-worker.md) — gated on T-Substrate cardinality readiness; scoped to range-facts consumer work. +Authored — pre-spawn Director-authored per inbox #828 coordination split; post-spawn manager owns dispatch / refresh: +- [`r2-modeling-int-lit-magnitude-worker.md`](r2-modeling-int-lit-magnitude-worker.md) — gated on T-Substrate cardinality readiness + PR-PreF Interval; scoped to range-facts consumer work. - [`r2-modeling-secret-graduation-worker.md`](r2-modeling-secret-graduation-worker.md) — gated on T-Substrate nominal-opaque readiness. - [`r2-modeling-dimensions-phantom-worker.md`](r2-modeling-dimensions-phantom-worker.md) — dispatchable immediately; consumes already-present phantom-parameter substrate. - [`r2-modeling-tokenizer-charclass-phase2-worker.md`](r2-modeling-tokenizer-charclass-phase2-worker.md) — gated on T-Substrate ValueBody-list/sum readiness. -Pending: none at manager-brief authoring time. +Pending: none at manager-brief authoring time. Worker briefs may need refresh post-PR-PreF merge to consume Interval directly rather than introduce a new bound type locally. ## Working state (fill on spawn) -Item status table refreshes here as work lands. Pre-spawn placeholder. +Spawn refresh, 2026-04-28 (post-#1078): + +- Item status table unchanged in scope; int-lit item now consumes PR-PreF Interval via Q1 lock cascade. +- Dimensions remains dispatchable immediately (phantom_params already in substrate). +- Other 3 items continue to gate on Substrate Manager carrier-readiness signals. ## Cross-refs - Parent: `docs/r2-structure.md` §"Modeling Manager" - Goal authority: `docs/r2-structure.md` §"Goals" item 2 - Substrate dependencies: `docs/briefs/r2-substrate-manager.md` +- Q1-Q5 disposition: `docs/r2-structure.md` §4 + `docs/design-emission-model.md` +- INVARIANTS substrate-fact-introduction procedure: `INVARIANTS.md` §P1 - Originating analyses: PR #745 (P4 int-literal row); ROADMAP post-merge-debt 2026-04-23 thesis-doc surface (Secret, Dimensions); 2026-04-24 ROADMAP amendment (charclass reclassification) +- Thesis-claim disposition: `docs/thesis/r2-r3-thesis-mapping.md` diff --git a/docs/briefs/r2-pure-bootstrap-manager.md b/docs/briefs/r2-pure-bootstrap-manager.md index a480eab82c8..20626b52934 100644 --- a/docs/briefs/r2-pure-bootstrap-manager.md +++ b/docs/briefs/r2-pure-bootstrap-manager.md @@ -1,12 +1,14 @@ # R2 Pure Bootstrap Manager Brief -**Status:** PROPOSAL (per [`docs/r2-structure.md`](../r2-structure.md), LIVE 2026-04-26 via PR #827). Spawns on R1 close per Transition mechanics step 4. Migrates content from [`pure-bootstrap-zero-manager.md`](pure-bootstrap-zero-manager.md) (which archives on R2 promotion); **scope narrowed** per the gate-deferral resolution in PR #827. +**Status:** PROPOSAL (per [`docs/r2-structure.md`](../r2-structure.md), LIVE 2026-04-26 via PR #827; refreshed 2026-04-28 post-#1078 merge to absorb 3 distributed bridge retirements + R3 continuation lanes per Director cascade Items 4 + 8 ratified 2026-04-28). **R1-close-gated** per `r2-structure.md` Transition mechanics (PB scope = "what survives R1 close" — pre-R1-close spawn is NOT applicable to this manager). Migrates content from [`pure-bootstrap-zero-manager.md`](pure-bootstrap-zero-manager.md) (which archives on R2 promotion); **scope narrowed** per the gate-deferral resolution in PR #827. ## Orient before reading -- **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md). Names this manager one of 6 standing R2 managers. +- **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md). Names this manager one of **7** standing R2 managers (count rose from 6 to 7 with Evaluator added 2026-04-28 per #1078). - **R1 vs R2 boundary:** R1 owns Pure Bootstrap census-reduction work via T-PB-A / T-PB-B lanes per ROADMAP single authority on gate semantics (target = 0 per `docs/design-pure-bootstrap-zero.md` LIVE 2026-04-25). **R2 Pure Bootstrap Manager owns post-R1 PB program work that survives R1 close — not a duplicate of R1's census-reduction lanes.** -- **Cross-program coordination:** B4's §0.7 file-preference rank carrier touches PB territory; coordinate with Substrate Manager. +- **R3 continuation:** PB Manager continues into R3 with **T-LensProducer-Retirement (XL)** + **T-FixedPoint (M)** + **T-Tier3-Dissolution (M)** + **3 distributed bridge retirements** per Director cascade Item 4. Largest R2-manager continuation footprint into R3. +- **Cross-program coordination:** B4's §0.7 file-preference rank carrier touches PB territory; coordinate with Substrate Manager. Bridge-retirement coordination → Verification Manager (R3) for the unified `bridge_retirement_ledger_zero` audit gate. +- **Substrate-fact-introduction procedure** ([`INVARIANTS.md`](../../INVARIANTS.md) §P1): PB rarely introduces substrate (consumes substrate to dissolve mirrors). When it does (e.g., emergent dissolution surfaces a substrate gap), self-serve through the 3-step decision procedure or signal Substrate Manager. ## Program scope (T-PB; post-R1 only) @@ -15,7 +17,7 @@ - T-PB-B Rust-authored test census reduction (R1 lane work per ROADMAP). - `lens_producer_files_remaining` priority slice (R1 T-PB-A gate per PR #752). -**Owns (post-R1 program work):** +**Owns (post-R1 R2 program work):** | Lane | Size | Status (at brief authoring) | Description | |---|---|---|---| @@ -23,36 +25,82 @@ | Tier 3 mirror dissolutions: computation | M | AUTHORED in [`r2-pb-tier3-mirror-dissolution-workers.md`](r2-pb-tier3-mirror-dissolution-workers.md) | `SizeBound`, `RecursionShape`-related Rust mirror at `dag.rs:839-915` dissolves with same substrate dependency. | | Tier 3 mirror dissolutions: induction | M | AUTHORED in [`r2-pb-tier3-mirror-dissolution-workers.md`](r2-pb-tier3-mirror-dissolution-workers.md) | `RecursionShape`, `InductiveField`, `SubValueRelation` Rust mirror at `dag.rs:916-980` dissolves with same substrate dependency. | | Tier 3 mirror dissolutions: effect-carrier | S | AUTHORED in [`r2-pb-tier3-mirror-dissolution-workers.md`](r2-pb-tier3-mirror-dissolution-workers.md) | `src/v3/compiler/src/dag/effects.rs` (216 LOC) + `compose_operation_effects` in `workflow_idempotency.rs` (105 LOC). Mechanical PB dissolution once self-hosting reaches it. Tier 3 #12 from #810. | -| `kernel_algebra_profile` mirror dissolution | M | GATED (waiting on Substrate Manager `ValueBody::Map` carrier; future T-Substrate sub-lane) | Map-shaped (not list/sum); requires `ValueBody::Map` substrate work. Substrate Manager future sub-lane. | -| Tier 2 `patch_lower_helpers_*` retirement | S | CLOSED by PR #1014 | `patch_lower_helpers_generated_type_alias_refinement`, the lower-helpers `regen_lens` patch path, and the SG-6 special case were retired once generated `lower_helpers` emitted the `refinement` field natively. | +| `kernel_algebra_profile` mirror dissolution | M | GATED (waiting on Substrate Manager `ValueBody::Map` carrier read-path/API + arrow-body evaluation; landed in R2 post-#1017 but consumer plumbing pending) | Map-shaped (not list/sum); requires `ValueBody::Map` substrate work. | +| Tier 2 `patch_lower_helpers_*` retirement | S | CLOSED by PR #1014 (first slice); **R3 continuation lane** for residual | `patch_lower_helpers_generated_type_alias_refinement`, the lower-helpers `regen_lens` patch path, and the SG-6 special case were retired once generated `lower_helpers` emitted the `refinement` field natively. Residual under T-Bridge-Retirement distribution (R3). | | Post-R1 emergent dissolutions | varies | NOT YET MATERIALIZED | Catch-all for new PB work that surfaces post-R1 (new mirror dissolutions discovered during R2; new Rust scaffolds inadvertently introduced and needing dissolution). | +**Owns (R3 continuation — Director cascade Item 4 + Item 8 ratified 2026-04-28):** + +| R3 Lane | Size | Description | +|---|---|---| +| **T-LensProducer-Retirement** | XL | Three program-sized hand-Rust files retired via PB-Runtime + PB-1 patterns. **Internal sub-gates** (Director directive 2026-04-28 — XL framing kept; sub-gate visibility for closure-ledger reporting): (i) `lens_apply.rs` retired (gated on PB-Runtime interpreter-as-data); (ii) `lens_testgen.rs` retired (same gate as `lens_apply.rs`); (iii) `regen_lens.rs` retired (gated on PB-1 bin-shim emit pattern — distinct gate). Closure ledger reports sub-gate progress; lane is one program. **Plus advanced lifetime analyzer cases d/e/f** (closures, async lifetimes, self-referential/Pin) folded in per `design-emission-model.md` Open call 2 — the lifetime analyzer is structurally what replaces `lens_apply.rs`'s reflection work, so advanced cases land alongside retirement. | +| **T-FixedPoint** | M | `compiler.dag` compiles to bit-identical stage0 Rust + bit-identical emitted artifacts; R1's `pb_self_compile_fixed_point` gate closes under stronger interpretation. Depends on R2-Evaluator + SG-0 zero from T-LensProducer-Retirement. | +| **T-Tier3-Dissolution** *(may share with Tier 3 Manager continuing post-R2)* | M | Four hand-Rust mirrors of `.dag` types retired (mirror bodies replaced by Evaluator-backed authority inside `dag.rs` / `dag/effects.rs` / `workflow_idempotency.rs`); **consumer count / mirror-symbol count reaches zero**. SG-0 delta is reported and **usually 0** because the hand-authored file remains on the census after mirror-block retirement — SG-0 reaches 0 through broader PB-Substrate / generated-file retirement + T-LensProducer-Retirement. | +| **3 distributed bridge retirements** *(part of T-Bridge-Retirement distribution map; see Cross-program below)* | varies | (3) canonical lens-name dispatch — lens-producer-retirement adjacent; (4) `include_str!` side channels (e.g., `pipeline_authority.rs`) — compiler-internal bootstrap; (5) `patch_lower_helpers_*` residual — Tier 2 retirement lineage; #1014 was first slice. Verification Manager owns the unified `bridge_retirement_ledger_zero` ledger gate; PB owns retirement work for these 3 bridges. | + ## Cross-program dependencies -**Produces:** none (PB consumes substrate, doesn't produce carriers other managers consume). +**Produces:** none (PB consumes substrate, doesn't produce carriers other managers consume). R3 produces SG-0 zero signal that gates T-FixedPoint. **Consumes:** -- **Substrate Manager — `ValueBody::Map` carrier** (future T-Substrate sub-lane): unblocks `kernel_algebra_profile` mirror dissolution. +- **Substrate Manager — `ValueBody::Map` carrier read-path/API + arrow-body evaluation**: unblocks `kernel_algebra_profile` mirror dissolution. (Substrate landed post-#1017; consumer plumbing pending.) - **Substrate Manager — B4 §0.7 file-preference rank carrier**: touches PB territory; coordinate. - **R1 close**: T-PB-A / T-PB-B census-reduction work completes per R1 gate authority. PB Manager spawns post-close to own everything else. +- **R2-Evaluator (R3 continuation)** — R3 lanes T-LensProducer-Retirement / T-FixedPoint / T-Tier3-Dissolution all gate on R2-Evaluator landing. PB Manager R3 work waits on R2-Evaluator close. +- **R2-T-Ground-Lifetime-Analyzer (R3 continuation)** — provides basic cases a/b/c. Advanced cases d/e/f land inside T-LensProducer-Retirement. +- **Verification Manager (R3) — `bridge_retirement_ledger_zero`**: PB signals per-bridge retirement to Verification's unified ledger. + +## Locked design decisions consumed (per #1078 dialogue + cascade) + +Worker briefs MUST consume these without re-litigation: + +- **T-LensProducer-Retirement XL framing kept** (Director cascade Item 8 ratified 2026-04-28): lane stays as one program; 3 internal sub-gates report sub-progress to closure ledger but do NOT split into 3 independent lanes. Reduces lane fragmentation; preserves the "one program" coherence of lens-producer retirement. +- **T-Bridge-Retirement distribution map** (Director cascade Item 4 ratified 2026-04-28): 5 named bridges; 3 retire under PB ownership (canonical lens-name dispatch / `include_str!` side channels / `patch_lower_helpers_*` residual); 2 retire under Substrate (`SourceSpan.file` + `mark_bootstrap_secret_nominal_opacity()`); Verification owns ledger gate only. **Distribute work, centralize ledger** discipline. +- **Q6 (lens framework)**: `Witness` substrate stays as-is; structural-validation failures encode into `Diagnostic.kind` extensions. Relevant for PB-Runtime interpreter-as-data work. + +Full disposition: [`docs/r2-structure.md`](../r2-structure.md) §4 + [`docs/r3-structure.md`](../r3-structure.md) §"Lane structure". ## Pre-spawn vs post-spawn authority -- **Pre-spawn (now, before R1 close):** Director + PM coordinate on brief authoring per inbox #828 split. PM authors the manager skeleton (this file); Director authors any worker-level briefs not yet existing per the manager's "Pending" sub-briefs list. Both stop authoring once R2 spawns. +- **Pre-spawn (post-#1078-merge, before R1 close):** Director + PM coordinate on brief authoring per inbox #828 split. PM authors the manager skeleton (this file); Director authors any worker-level briefs not yet existing per the manager's "Pending" sub-briefs list. Both stop authoring once R2 spawns. **PB Manager itself is R1-close-gated** — does not spawn pre-R1-close (unlike the other 6 R2 managers). - **Post-spawn (R2 promotion onward):** Manager owns all worker-brief authoring autonomously per "Autonomous dispatch authority" below. Director's role narrows to cross-program conflict resolution + scope-change escalation. ## Autonomous dispatch authority -- Authors all post-R1 PB sub-briefs without Director. +- Authors all post-R1 PB sub-briefs without Director (R2 + R3 continuation). - Dispatches workers against post-R1 PB sub-briefs. - Resolves PB-internal scope refinements; escalates blockers and scope changes to Director. - Per `docs/r2-structure.md` P5 dispatch-discipline: every PB worker brief names dissolution trigger + adjacent ROADMAP debt row + contributes-or-defers stance; per-PR gate applies to all hand-Rust dispatches. +- **Cross-program signal authority:** lane-close → R2 Release Manager (closure ledger); per-bridge retirement → Verification Manager (unified ledger gate); R3 lane closure → Director (R3 spin-up + R3 Release Manager, when authored). ## Reporting cadence -- Lane-close → R2 Release Manager (closure ledger). +- Lane-close → R2 Release Manager (closure ledger; per **structural-acceptance-per-lane-close discipline** — the demo IS the structural gate). +- **T-LensProducer-Retirement sub-gate progress** → R2 Release Manager (per Director directive: closure ledger reports sub-gate progress within the one-program lane). - Cross-program signals (consume Substrate carrier-readiness) → cross-manager queue. +- Per-bridge retirement signal → Verification Manager (R3) for `bridge_retirement_ledger_zero` audit. - Blockers + scope changes → Director. +- **Weekly health surfacing to Director:** which lanes within 1 step of unblocking, R3 continuation readiness, sub-gate progress on T-LensProducer-Retirement. + +## Acceptance — `.dag` gates + +Each lane closes under a structural acceptance gate authored as a `.dag` `TestClaim`: + +**R2 lanes:** +- `tier_3_termination_mirror_dissolved` — mirror at `dag.rs:628-790` deleted; v3 carries the load +- `tier_3_computation_mirror_dissolved` — mirror at `dag.rs:839-915` deleted +- `tier_3_induction_mirror_dissolved` — mirror at `dag.rs:916-980` deleted +- `tier_3_effect_carrier_mirror_dissolved` — `effects.rs` + `compose_operation_effects` deleted +- `kernel_algebra_profile_mirror_dissolved` — gated on ValueBody::Map consumer plumbing + +**R3 continuation lanes:** +- `lens_apply_dot_rs_retired` — `src/v3/compiler/src/lens_apply.rs` deleted +- `lens_testgen_dot_rs_retired` — `src/v3/compiler/src/lens_testgen.rs` deleted +- `regen_lens_dot_rs_retired` — `src/v3/compiler/src/bin/regen_lens.rs` deleted +- `pb_self_compile_fixed_point_strong` — bit-identical stage0 + emitted artifacts +- `bridge_canonical_lens_name_dispatch_retired` — distributed bridge #3 +- `bridge_include_str_side_channels_retired` — distributed bridge #4 (e.g., `pipeline_authority.rs`) +- `bridge_patch_lower_helpers_residual_retired` — distributed bridge #5 ## Sub-briefs (authored / pending) @@ -60,21 +108,32 @@ Authored: - Pre-R1 PB program briefs (in `pure-bootstrap-zero-manager.md`, archives on R2 promotion); content migration here covers post-R1 deliverables only. - [`r2-pb-tier3-mirror-dissolution-workers.md`](r2-pb-tier3-mirror-dissolution-workers.md) — termination, computation, induction, and effect-carrier mirror dissolution worker pack. -Pending — pre-spawn Director-authored per inbox #828 coordination split; post-spawn manager-authored autonomously per "Pre-spawn vs post-spawn authority" subsection above: -- `kernel_algebra_profile` worker brief (gated on Substrate Manager `ValueBody::Map`) +Pending — pre-spawn Director-authored per inbox #828 coordination split; post-spawn manager-authored autonomously: +- `kernel_algebra_profile` worker brief (gated on Substrate Manager `ValueBody::Map` consumer plumbing) +- **R3 T-LensProducer-Retirement** worker briefs (gated on R2-Evaluator close + PB-Runtime interpreter-as-data design + PB-1 bin-shim emit pattern; 3 internal sub-gates) +- **R3 T-FixedPoint** worker brief (gated on SG-0 zero from T-LensProducer-Retirement) +- **R3 T-Tier3-Dissolution** worker brief (may share with Tier 3 Manager continuing post-R2) +- **R3 distributed bridge retirements** — 3 worker briefs (canonical lens-name dispatch / include_str! / patch_lower_helpers_* residual) Closed: -- Tier 2 `patch_lower_helpers_*` retirement (PR #1014) +- Tier 2 `patch_lower_helpers_*` retirement first slice (PR #1014) ## Working state (fill on spawn) -Lane status table refreshes here as work lands. Pre-spawn placeholder. +Spawn refresh, 2026-04-28 (post-#1078): + +- R2 lanes unchanged in scope; status table tracks Tier 3 mirror dissolutions + kernel_algebra_profile. +- R3 continuation added: T-LensProducer-Retirement (XL with 3 internal sub-gates) + T-FixedPoint + T-Tier3-Dissolution + 3 distributed bridge retirements. +- 3 distributed bridges absorbed into existing PB scope per Director cascade Item 4 (no new manager spawning). ## Cross-refs - Parent: `docs/r2-structure.md` §"Pure Bootstrap Manager" +- R3 continuation: `docs/r3-structure.md` §"Lane structure" (T-LensProducer-Retirement / T-FixedPoint / T-Tier3-Dissolution / T-Bridge-Retirement distribution map) - Migrating from: `docs/briefs/pure-bootstrap-zero-manager.md` (archives on R2 promotion) - Self-hosting design: `docs/design-pure-bootstrap-zero.md` LIVE 2026-04-25 - Tier 3 worker pack: [`docs/briefs/r2-pb-tier3-mirror-dissolution-workers.md`](r2-pb-tier3-mirror-dissolution-workers.md) - Tier 3 source: `docs/briefs/debt-paydown-synthesis-2026-04-25.md` items #10 + #12 +- Lens framework spec: `docs/design-lens-framework.md` (Q6+Q7+Q8 locks; consumed by PB-Runtime interpreter-as-data) - ROADMAP single authority on gate semantics: `ROADMAP.md §"Lane acceptance — .dag gates"` +- Thesis-claim disposition: `docs/thesis/r2-r3-thesis-mapping.md` diff --git a/docs/briefs/r2-substrate-manager.md b/docs/briefs/r2-substrate-manager.md index 87b83bf9854..c2a7600e67b 100644 --- a/docs/briefs/r2-substrate-manager.md +++ b/docs/briefs/r2-substrate-manager.md @@ -1,19 +1,22 @@ # R2 Substrate Manager Brief -**Status:** PROPOSAL (per [`docs/r2-structure.md`](../r2-structure.md), LIVE 2026-04-26 via PR #827). Spawns on R1 close per Transition mechanics step 4. NEW manager — no migration source. +**Status:** PROPOSAL (per [`docs/r2-structure.md`](../r2-structure.md), LIVE 2026-04-26 via PR #827; refreshed 2026-04-28 post-#1078 merge to absorb 8-question design locks + Lens primitive sub-lane + post-R2 continuation). Eligible to spawn pre-R1-close per `r2-structure.md` Transition mechanics step 4 — Substrate's ValueBody-list/sum sub-lane is a prereq for R1C-A Sub-deliverable A, so pre-R1-close spawn actively unblocks R1 closure rather than competing with it. NEW manager — no migration source. ## Orient before reading -- **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md). Names this manager one of 6 standing R2 managers; **largest single concentration of R2 work**. +- **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md). Names this manager one of **7** standing R2 managers (count rose from 6 to 7 with R2-Evaluator added 2026-04-28 per #1078). Substrate is **co-XL with Evaluator** — together the largest single concentrations of R2 work. - **Program scope sources:** - - T-Substrate: [`docs/r2-structure.md` §"Goals" item 3](../r2-structure.md) (4 substrate prereq sub-lanes). + - T-Substrate (R2 prereq sub-lanes): [`docs/r2-structure.md` §"Goals" item 3](../r2-structure.md). + - T-Substrate-Lens-Primitive (added 2026-04-28 via #1078): [`docs/r2-structure.md` §"Goals" item 8](../r2-structure.md) + [`docs/design-lens-framework.md`](../design-lens-framework.md). - B4 Identity-Carrier Substrate Pass program: [`docs/briefs/b4-identity-carrier-substrate-pass.md`](b4-identity-carrier-substrate-pass.md). -- **Cross-program producer/readiness owner:** T-Substrate sub-lanes either produce carriers or validate existing substrate readiness for Modeling Manager (3 sub-lanes) + Grounding Manager (Engine sharpened-(b) consumes ValueBody-list/sum). The Dimensions lane is already substrate-ready by audit, so it is a readiness signal rather than new carrier work. + - **Post-R2 continuation:** T-CostLens-Composition (R3 lane under Substrate continuation per Director cascade Item 3 ratified 2026-04-28). Substrate Manager is the only R2 manager that continues operating into R3. +- **Cross-program producer/readiness owner:** T-Substrate sub-lanes either produce carriers or validate existing substrate readiness for Modeling Manager (3 sub-lanes), Grounding Manager (Coercion-Fold consumes ValueBody-list/sum), and Evaluator Manager (Lens primitive). The Dimensions sub-lane is already substrate-ready by audit, so it is a readiness signal rather than new carrier work. +- **Substrate-fact-introduction procedure** ([`INVARIANTS.md`](../../INVARIANTS.md) §P1): the 3-step decision procedure (DAG-ancestor check → coproduct-vs-coordinate check → primitive-vs-lens-extensible check) is **mandatory** for every new substrate type/variant/field this manager introduces. Self-serve through the procedure before escalating substrate-shape questions to Director. `feedback_substrate_principle_audit.md` extends this with a 6-question structural-recovery audit; both apply. - **Watch condition:** if Substrate becomes the new bottleneck (workers idle >7 days waiting for Substrate-authored briefs), split B4 into a dedicated standing **B4 Identity-Carrier Manager** per `docs/r2-structure.md:88` watch trigger. R2 Release Manager surfaces this signal via velocity-tripwire reporting. ## Program scope -**Two coupled sub-programs:** +**Three coupled sub-programs in R2 + one continuation into R3:** ### A. T-Substrate (4 sub-lanes — Goal 3 substrate prereqs) @@ -22,9 +25,30 @@ Each sub-lane is **scoped to its paired R2 consumer set**, not full substrate-ca 1. **Cardinality-substrate subset for int-literal magnitude** — enough cardinality modeling to let `IntLit` carry magnitude that narrows to target int algebra at reconciliation. Consumer: Modeling Manager's int-lit item. 2. **Nominal-opaque substrate subset for `Secret`** — enough nominal-type modeling to carry construction-restriction (`where only X may construct`). Consumer: Modeling Manager's `Secret` item. 3. **Parametric-algebra-attachment subset for `Dimension`** — enough substrate to inhabit `Dimension` in an abelian group algebra (compile error on unit-mismatch). Consumer: Modeling Manager's Dimensions item. -4. **Top-level `ValueBody` list/sum + `std.unicode` bootstrap subset** — enough Class 5 Gap 3 substrate for `data ascii_scan_order: List = [...]` to lower structurally. **Two named consumers**: Modeling Manager's tokenizer charclass phase-2 + Grounding Manager's Engine sharpened-(b) full pilot enumeration. +4. **Top-level `ValueBody` list/sum + `std.unicode` bootstrap subset** — enough Class 5 Gap 3 substrate for `data ascii_scan_order: List = [...]` to lower structurally. **Two named consumers**: Modeling Manager's tokenizer charclass phase-2 + Grounding Manager's Coercion-Fold sub-lane (full pilot enumeration via symbolic walk of `rust_pilot_primitives: List`). -### B. B4 Identity-Carrier Substrate Pass program (12 sub-briefs) +### B. T-Substrate-Lens-Primitive (added 2026-04-28 via #1078) + +Substrate primitive landing for `Lens` per the 8-question dialogue (Q6/Q7/Q8 locked) + the design-lens-framework spec. + +**6-field structural shape** (per Q6/Q7/Q8 locks; cascaded fix from quiet-koi-451's review): +``` +Lens = ( + name: String, + read: (Dag, Behavior) → Witness, // Q6: Witness stays as-is; Diagnostic.kind extends for structural failures + sequential: Monoid, // structural inhabitance; replaces parallel compose+unit cascade + branch: (C, C) → C, + iterate: (LoopBound, C) → C, + validate: (Dag, C) → OptionalDiagnostic // Q7: per-call validate; fold accumulates into DimensionFail.violations +) +``` + +Consumers: +- Evaluator Manager — implements `fold_lens: Lens → Dag → DimensionReport`. +- Substrate Manager (R3 continuation) — T-CostLens-Composition consumes Lens for cost-algebra witnesses. +- Q8 lock: cross-product `Lens × Lens` is conjunctive (both validate runs; conjunctive fold). + +### C. B4 Identity-Carrier Substrate Pass program (12 sub-briefs) From [`docs/briefs/b4-identity-carrier-substrate-pass.md`](b4-identity-carrier-substrate-pass.md). Treats the §0 class from `docs/briefs/debt-paydown-synthesis-2026-04-25.md` as one M-scope substrate program, not 8 item-by-item paydowns. @@ -39,82 +63,146 @@ From [`docs/briefs/b4-identity-carrier-substrate-pass.md`](b4-identity-carrier-s **Phase 3:** discipline ratchet (one-time, after Phase 1) — reviewer-discipline addition for new sentinel-string sites. -## Owned deliverables (through R2 close) +### D. Post-R2 continuation: T-CostLens-Composition (R3 lane) + +**Per Director cascade Item 3 ratified 2026-04-28** ([`docs/r3-structure.md`](../r3-structure.md) §"R3 lane structure"). Substrate continues into R3 to complete the cost-algebra composition lens — the only Substrate work that survives R2 close. + +Why Substrate-owned (not Verification-owned): T-CostLens-Composition is a **structural Lens instance** producing `RealizationCost { storage: Cost, access: Map> }` witnesses (per Q3 lock). The lens framework's structural inhabitance IS the namespacing mechanism; lens-instance authoring is substrate-completion work, not verification work. Verification Manager (R3) asserts the gate fires by construction; doesn't author the lens. + +Depends on R2-T-Substrate-Lens-Primitive landing (the framework primitive that T-CostLens-Composition is a lens-instance of). + +## Pre-dispatch design lock cadence (consumed; per #1078 lock) + +The 8-question design dialogue resolved into a cadence of design PRs whose merge gates worker dispatch on this manager's lanes. **Substrate Manager owns PR-PreF + PR-K**; Director authors them inline in the design docs OR as separate PRs. + +| Cadence PR | Locks | Consumer | +|---|---|---| +| **PR-PreF** | `Interval` substrate consolidation — shared parent for `CardinalityBound` / `SizeBound` / `LoopBound::Cardinality` (additive retrofit; `LoopBound::Descent` and `CostBound` stay distinct). Sets up Q1's `BoundDeclaration = Interval` instance to consume a clean parent rather than introduce a fifth distinct bound type. | All subsequent cadence PRs (PR-F through PR-K), plus T-Substrate cardinality-for-int-lit and T-Modeling Q1-consuming items | +| **PR-I** | Q3 (per-primitive realization cost) — `Cost = Dimension`; Bits/CPUCycles primitives sibling to SI base units; `RealizationCost { storage: Cost, access: Map> }` per-primitive field on LanguageSpec | T-Ground-LanguageSpec + T-Verification-L4-L7-Direct | +| **PR-K** | Q6 + Q7 + Q8 (lens framework spec — structural inhabitance shape, validate signature, conjunctive cross-product) | T-Substrate-Lens-Primitive | + +Dispatch sequence: **PR-PreF lands first** (foundational substrate; everything else depends on it). PR-I and PR-K are independent of each other once PR-PreF lands; both can land in parallel. Worker dispatch on T-Substrate-Lens-Primitive blocks on PR-K merge; cardinality-for-int-lit blocks on PR-PreF merge. + +## Owned deliverables (through R2 close + R3 T-CostLens-Composition continuation) | Sub-lane | Size | Current status | Carrier shape | |---|---|---|---| -| T-Substrate cardinality-for-int-lit | M | BRIEF LANDED (`t-substrate-cardinality-int-lit-worker.md`, PR #806 merged 2026-04-25); duplicate R2 routing doc closed as redundant (`r2-substrate-cardinality-for-int-lit-subset.md`). | range facts + reconciliation narrowing; Int128/Word128 carrier deferred to sibling sub-lane | +| T-Substrate cardinality-for-int-lit | M | BRIEF LANDED (`t-substrate-cardinality-int-lit-worker.md`, PR #806 merged 2026-04-25); duplicate R2 routing doc closed as redundant. **Now consumes PR-PreF Interval** when it lands. | range facts + reconciliation narrowing; Int128/Word128 carrier deferred to sibling sub-lane | | T-Substrate nominal-opaque-for-Secret | M | BRIEF AUTHORED (`r2-substrate-nominal-opaque-for-secret-subset.md`; PR #836 merged 2026-04-26) | nominal-type construction/access restriction | | T-Substrate parametric-algebra-for-Dimensions | M | CLOSED BY AUDIT (`r2-substrate-parametric-algebra-for-dimensions-subset.md`; PR #836 merged 2026-04-26); substrate already exists, consumer dispatchable. | existing `Declaration.phantom_params` + `phantom_unit_mismatch` carrier | | T-Substrate ValueBody-list/sum + std.unicode | L | BRIEF LANDED (`t-substrate-valuebody-list-worker.md`, PR #790 merged 2026-04-25) | top-level list/sum literal lowering + bootstrap/load-set | -| B4.1 DeclarationRef consumer migration | M | LANDED (PR #826 merged 2026-04-26; first consumer migration complete after prior B4.1/B4.1a brief landing). | existing carrier consumer migration | +| **T-Substrate-Lens-Primitive** *(NEW 2026-04-28)* | M | NOT YET AUTHORED — gated on PR-K lock (Q6+Q7+Q8) | `Lens` 6-field record in `src/v3/std/dimensions.dag` (sibling to existing `AnalysisDimension` + `Dimension`); Witness+OptionalDiagnostic+DimensionReport already in substrate | +| **PR-PreF Interval consolidation** *(NEW 2026-04-28)* | S | NOT YET AUTHORED — Director-authored or Substrate-Manager-authored | shared parent type for CardinalityBound / SizeBound / LoopBound::Cardinality | +| B4.1 DeclarationRef consumer migration | M | LANDED (PR #826 merged 2026-04-26) | existing carrier consumer migration | | B4.2 fold-shape carrier | S | BRIEF AUTHORED (`b4-2-structural-fold-shape-carrier-worker.md`; PR #836 merged 2026-04-26) | structural fold-eligibility query/carrier decision | | B4.3 emit-helper carrier | S | LANDED (PR #824 merged 2026-04-26) | typed role marker on Bind/Branch nodes | | B4.4 extdeps-fixture-set carrier | S | LANDED (PR #825 merged 2026-04-26) | typed extdeps-bootstrap-set declaration | | B4.5–B4.12 Phase 2 site dissolutions | S each | QUEUE AUTHORED (`b4-phase-2-site-dissolution-queue.md`); implementation briefs dispatch as Phase 1 carriers land. | mechanical consumer migration per site | +| **R3 continuation: T-CostLens-Composition** *(NEW 2026-04-28; R3 lane)* | M | NOT YET AUTHORED — gated on T-Substrate-Lens-Primitive landing + R2 close | structural Lens instance; Monoid + JoinSemilattice + BoundedLattice witnesses | ## Cross-program dependencies -**Produces (4 carrier-readiness signals):** -- Cardinality-for-int-lit → Modeling Manager (int-lit) +**Produces (5 carrier-readiness signals):** +- Cardinality-for-int-lit → Modeling Manager (int-lit; via PR-PreF Interval) - Nominal-opaque-for-Secret → Modeling Manager (Secret) -- Parametric-algebra-for-Dimensions → Modeling Manager (Dimensions) -- ValueBody-list/sum + std.unicode → Modeling Manager (charclass phase-2) + Grounding Manager (Engine sharpened-(b)) +- Parametric-algebra-for-Dimensions → Modeling Manager (Dimensions; via existing `phantom_params`) +- ValueBody-list/sum + std.unicode → Modeling Manager (charclass phase-2) + Grounding Manager (Coercion-Fold sub-lane) +- **Lens primitive** → Evaluator Manager (implements `fold_lens`); Substrate Manager R3 continuation (T-CostLens-Composition consumes) -**Consumes:** none (Substrate is the substrate). +**Consumes:** none in R2 (Substrate is the substrate). R3 continuation consumes its own R2 output (Lens primitive) plus Evaluator's `fold_lens` runtime. **Adjacent territory:** - B4's §0.7 file-preference rank carrier touches Pure Bootstrap territory. Coordinate with Pure Bootstrap Manager. - `kernel_algebra_profile` mirror dissolution is map-shaped (not list/sum) — tracked as future T-Substrate sub-lane requiring `ValueBody::Map` substrate work; PB Manager consumes when it lands. +- **Diagnostic-kind extensibility (Q6 lock)** — Evaluator Manager extends `Diagnostic.kind` for structural-validation failures. Substrate Manager owns the `CompilerDiagnosticKind` sum; cross-manager coordination at extension time. Known limitation: current substrate is closed sum, tracked under v2 follow-up. + +## Locked design decisions consumed (per #1078 8-question dialogue) + +Worker briefs MUST consume these without re-litigation: + +- **Q1**: `Interval` shared parent in substrate (PR-PreF prepended); `BoundDeclaration = StaticBound(Interval) | PlatformDependent` (asymmetric match rule: target's `Unbounded` universal-accepts; target's `ExactInterval(lo,hi)` requires exact range match). +- **Q3**: `Cost = Dimension`; Bits/CPUCycles substrate primitives sibling to SI base units; `RealizationCost { storage: Cost, access: Map> }`. +- **Q5**: cardinality is the connectives axis; collapses by construction with Q1's `Interval` instances on each connective; PR-J = no-op. +- **Q6**: `Witness` substrate stays as-is; rich structural validation failures encode into `Diagnostic.kind` extensions. +- **Q7**: per-call validate yields one `OptionalDiagnostic`; fold accumulates into `DimensionFail.violations: List`. +- **Q8**: cross-product validate is conjunctive (`Lens × Lens` runs both; conjunctive fold). + +Full disposition: [`docs/r2-structure.md`](../r2-structure.md) §4 + [`docs/design-emission-model.md`](../design-emission-model.md) Q1-Q5 + [`docs/design-lens-framework.md`](../design-lens-framework.md) Q6-Q8. ## Pre-spawn vs post-spawn authority -- **Pre-spawn (now, before R1 close):** Director + PM coordinate on brief authoring per inbox #828 split. PM authors the manager skeleton (this file); Director authors any worker-level briefs not yet existing per the manager's "Pending" sub-briefs list. Both stop authoring once R2 spawns. -- **Post-spawn (R2 promotion onward):** Manager owns all worker-brief authoring autonomously per "Autonomous dispatch authority" below. Director's role narrows to cross-program conflict resolution + scope-change escalation. +- **Pre-spawn (post-#1078-merge):** brief authoring + the cadence sequence (PR-PreF, PR-I, PR-K) locked. Substrate Manager spawns once a design-lock PR is dispatchable; pre-R1-close spawn allowed and actively unblocks R1C-A Sub-deliverable A. +- **Post-spawn (manager active):** Manager owns all worker-brief authoring autonomously per "Autonomous dispatch authority" below. Director's role narrows to cross-program conflict resolution + scope-change escalation. ## Autonomous dispatch authority -- Authors all T-Substrate + B4 sub-briefs without Director. +- Authors all T-Substrate + T-Substrate-Lens-Primitive + B4 sub-briefs without Director. - Dispatches workers against all sub-briefs. - Resolves Substrate-internal scope refinements; escalates blockers and scope changes to Director. -- Per `docs/r2-structure.md` P5 dispatch-discipline: every Substrate worker brief that introduces a scaffold names its dissolution trigger + adjacent ROADMAP debt row + contributes-or-defers stance. +- Per `docs/r2-structure.md` P5 dispatch-discipline: every Substrate worker brief that introduces a scaffold names its dissolution trigger + adjacent ROADMAP debt row + contributes-or-defers stance; every PR introducing hand-Rust under `src/v3/` fills the per-PR gate. +- **Substrate-fact-introduction procedure** ([`INVARIANTS.md`](../../INVARIANTS.md) §P1) applies to every brief introducing new substrate types/variants/fields; document the procedure outcome in the brief. +- **Cross-program signal authority:** carrier-readiness signals → cross-manager queue; per-sub-lane closure → R2 Release Manager (closure ledger); Lens primitive readiness → Evaluator Manager directly. ## Reporting cadence -- Sub-lane / Phase close → R2 Release Manager (closure ledger). -- Cross-program signals (carrier-readiness for 4 carriers) → cross-manager queue (consuming managers ack and dispatch consumer-migration work). +- Sub-lane / Phase close → R2 Release Manager (closure ledger). Each sub-lane's structural acceptance gate (per the **structural-acceptance-per-lane-close discipline** in `r2-structure.md`) IS the demo. +- Cross-program signals (5 carrier-readiness for 5 carriers) → cross-manager queue (consuming managers ack and dispatch consumer-migration work). - Blockers + scope changes → Director. +- **Weekly health surfacing to Director:** which sub-lanes within 1 step of unblocking, which workers fill vs. ready, which cadence PRs (PR-PreF/PR-I/PR-K) landed vs pending, R3 continuation readiness signal. + +## Acceptance — `.dag` gates + +Each sub-lane closes under a structural acceptance gate authored as a `.dag` `TestClaim`: + +- `interval_d_shared_parent_consolidation_landed` — PR-PreF Interval consolidation in substrate; CardinalityBound/SizeBound/LoopBound::Cardinality consume the parent +- `cardinality_int_lit_substrate_landed` — Cardinality substrate subset reconciles IntLit magnitude to target int algebra +- `nominal_opaque_for_secret_substrate_landed` — `Secret` construction-restriction enforced structurally +- `parametric_algebra_for_dimensions_audit_closed` — `phantom_params` + `phantom_unit_mismatch` carry compile-error path +- `valuebody_list_sum_unicode_bootstrap_landed` — `data ascii_scan_order: List` lowers structurally +- `lens_c_primitive_substrate_landed` — `Lens` 6-field record in substrate; consumed by Evaluator's `fold_lens` +- `b4_phase_1_carriers_landed` (B4.1/B4.2/B4.3/B4.4) and `b4_phase_2_dissolutions_landed` (B4.5–B4.12) +- **R3 continuation:** `cost_lens_composition_witnesses_correct` — Monoid + JoinSemilattice + BoundedLattice structural inhabitance demonstrated on representative cost expressions ## Sub-briefs (authored / pending) Authored: -- B4 program brief (this document is the orchestrator; B4 program brief is in [`b4-identity-carrier-substrate-pass.md`](b4-identity-carrier-substrate-pass.md)) -- B4.1 DeclarationRef consumer migration ([`b4-1-declarationref-consumer-migration-worker.md`](b4-1-declarationref-consumer-migration-worker.md)) — brief landed PR #819; first-consumer migration landed PR #826. -- B4.2 structural fold-shape (`b4-2-structural-fold-shape-carrier-worker.md`) — authored PR #836; not yet landed as implementation. -- B4.3 structural emit-helper carrier (`b4-3-structural-emit-helper-carrier-worker.md`) — landed PR #824. -- B4.4 structural extdeps-fixture-set carrier (`b4-4-structural-extdeps-fixture-set-carrier-worker.md`) — landed PR #825. -- T-Substrate cardinality-for-int-lit (`t-substrate-cardinality-int-lit-worker.md`) — landed PR #806; `r2-substrate-cardinality-for-int-lit-subset.md` is a redundant routing/audit receipt, not a dispatch target. -- T-Substrate nominal-opaque-for-Secret (`r2-substrate-nominal-opaque-for-secret-subset.md`) — authored PR #836. -- T-Substrate parametric-algebra-for-Dimensions (`r2-substrate-parametric-algebra-for-dimensions-subset.md`) — closed by audit; producer work not needed. -- T-Substrate ValueBody-list/sum (`t-substrate-valuebody-list-worker.md`) — brief landed PR #790. - -Pending — post-spawn manager-authored autonomously per "Pre-spawn vs post-spawn authority" subsection above: -- B4.2 implementation dispatch (brief exists; implementation not yet landed). -- B4.5–B4.12 Phase 2 implementation briefs that become live as Phase 1 carriers land; queue skeleton exists in `b4-phase-2-site-dissolution-queue.md`. -- Future T-Substrate sibling lanes explicitly excluded from the four R2 prereqs, including Int128/Word128 carrier widening and `ValueBody::Map`, when/if R2 scope admits them. +- B4 program brief ([`b4-identity-carrier-substrate-pass.md`](b4-identity-carrier-substrate-pass.md)) +- B4.1 DeclarationRef consumer migration ([`b4-1-declarationref-consumer-migration-worker.md`](b4-1-declarationref-consumer-migration-worker.md)) — landed PR #826 +- B4.2 structural fold-shape (`b4-2-structural-fold-shape-carrier-worker.md`) — authored PR #836 +- B4.3 structural emit-helper carrier (`b4-3-structural-emit-helper-carrier-worker.md`) — landed PR #824 +- B4.4 structural extdeps-fixture-set carrier (`b4-4-structural-extdeps-fixture-set-carrier-worker.md`) — landed PR #825 +- T-Substrate cardinality-for-int-lit (`t-substrate-cardinality-int-lit-worker.md`) — landed PR #806 +- T-Substrate nominal-opaque-for-Secret (`r2-substrate-nominal-opaque-for-secret-subset.md`) — authored PR #836 +- T-Substrate parametric-algebra-for-Dimensions — closed by audit +- T-Substrate ValueBody-list/sum (`t-substrate-valuebody-list-worker.md`) — landed PR #790 + +Pending — post-spawn manager-authored autonomously: +- **PR-PreF Interval consolidation** worker brief (or Director-authored inline in design doc) +- **T-Substrate-Lens-Primitive** worker brief (gated on PR-K design lock) +- **R3 T-CostLens-Composition** worker brief (gated on Lens primitive landing + R2 close) +- B4.2 implementation dispatch (brief exists; implementation not yet landed) +- B4.5–B4.12 Phase 2 implementation briefs that become live as Phase 1 carriers land ## Working state (fill on spawn) -Spawn refresh, 2026-04-26: +Spawn refresh, 2026-04-28 (post-#1078): -- T-Substrate: cardinality-for-int-lit producer landed (#806); nominal-opaque producer brief exists; parametric-algebra producer closed by audit because `phantom_params` already exists; ValueBody-list/sum brief landed (#790). +- T-Substrate prereqs (R2): cardinality-for-int-lit producer landed (#806); nominal-opaque producer brief exists; parametric-algebra producer closed by audit because `phantom_params` already exists; ValueBody-list/sum landed (#790). +- T-Substrate-Lens-Primitive: NEW lane added 2026-04-28; gated on PR-K cadence lock (Q6+Q7+Q8 design questions resolved into substrate spec). +- PR-PreF Interval: NEW prepended cadence; foundational substrate consolidation; gates everything else. - B4 Phase 1: B4.1, B4.3, B4.4 landed; B4.2 brief exists and remains the immediate unlanded Phase 1 implementation lane. - B4 Phase 2: queue exists; dispatch follows Phase 1 carrier disposition. +- R3 continuation T-CostLens-Composition: deferred to R3 spin-up; gated on Lens primitive landing. ## Cross-refs - Parent: `docs/r2-structure.md` §"Substrate Manager" -- Program brief: `docs/briefs/b4-identity-carrier-substrate-pass.md` +- Lens framework spec: `docs/design-lens-framework.md` (Q6+Q7+Q8 locks; 6-field shape with sequential: Monoid) +- Cost algebra spec: `docs/design-emission-model.md` Q3 (`Cost` + Bits/CPUCycles) +- Q1-Q5/Q6-Q8 disposition: `docs/r2-structure.md` §4 + design docs +- INVARIANTS substrate-fact-introduction procedure: `INVARIANTS.md` §P1 +- B4 program brief: `docs/briefs/b4-identity-carrier-substrate-pass.md` - Synthesis source: `docs/briefs/debt-paydown-synthesis-2026-04-25.md` §0 - Substrate design: `docs/design-substrate-carrier-port-program.md` -- Adjacent: `docs/briefs/b4-1-declarationref-consumer-migration-worker.md` (landed PR #819; first-consumer migration tracked at PR #826) +- R3 continuation lane: `docs/r3-structure.md` §"Lane structure" T-CostLens-Composition (Substrate continuation) +- Thesis-claim disposition: `docs/thesis/r2-r3-thesis-mapping.md` From 544e7501ad154d1872a9463f777effeb97d5dc5f Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 28 Apr 2026 23:06:25 +0000 Subject: [PATCH 05/22] docs(briefs): refresh 6 R2 manager briefs post-#1078 merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aligns all 6 existing R2 manager briefs with #1078's locked design decisions and structural cascade: - Substrate Manager: adds T-Substrate-Lens-Primitive sub-lane (Q6+Q7+Q8 locks) + PR-PreF Interval consolidation + R3 T-CostLens-Composition continuation (Director cascade Item 3); references INVARIANTS §P1 substrate-fact-introduction procedure + Q3 Cost primitives. - Grounding Manager: engine-reframe to 11 lanes (5 substrate-completion lanes replace prior single Engine: Coercion-Fold + LanguageSpec + Lifetime-Analyzer + Diagnostic + CrossTarget-Meta); consumes PR-F through PR-J cadence; PR #989 footprint queued for cleanup wave. - Modeling Manager: int-lit item now consumes PR-PreF Interval via Q1 lock; references INVARIANTS procedure for substrate-gap signaling. - Pure Bootstrap Manager: adds R3 continuation lanes (T-LensProducer- Retirement XL with 3 internal sub-gates per Director cascade Item 8; T-FixedPoint; T-Tier3-Dissolution; 3 distributed bridge retirements per Director cascade Item 4 — distribute work, centralize ledger). - Impossible-Bugs Manager: archives at R2 close per Director cascade; post-R2 emergent classes route to Substrate Manager continuation. - Release Manager: 6→7 manager count; closure ledger spans all 6 other managers + sub-gate progress for T-LensProducer-Retirement; structural- acceptance-per-lane-close discipline (demo IS structural gate); thesis-claim mapping landed via #1078, refresh authority lives here; v2 release-doc-authority guardrail follow-up added as next narrow PR. All 6 briefs now include: structural acceptance .dag TestClaim gates, locked-design-decisions-consumed section, INVARIANTS §P1 procedure references, and option-(c)-hybrid timing notes where R1-close-relevant. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/briefs/r2-release-manager.md | 98 ++++++++++++++++++++++--------- 1 file changed, 70 insertions(+), 28 deletions(-) diff --git a/docs/briefs/r2-release-manager.md b/docs/briefs/r2-release-manager.md index 36fe52d69aa..259b8228370 100644 --- a/docs/briefs/r2-release-manager.md +++ b/docs/briefs/r2-release-manager.md @@ -1,12 +1,13 @@ # R2 Release Manager Brief -**Status:** PROPOSAL (per [`docs/r2-structure.md`](../r2-structure.md), LIVE 2026-04-26 via PR #827). Spawns on R1 close per Transition mechanics step 4. NEW manager — owns release coordination + smallest cross-cutting deliverables. +**Status:** PROPOSAL (per [`docs/r2-structure.md`](../r2-structure.md), LIVE 2026-04-26 via PR #827; refreshed 2026-04-28 post-#1078 merge to absorb 6→7 manager count + structural-acceptance-per-lane-close discipline + cross-program closure ledger across all 6 other R2 managers). Eligible to spawn pre-R1-close per `r2-structure.md` Transition mechanics step 4 (no technical R1 dependency). NEW manager — owns release coordination + smallest cross-cutting deliverables. ## Orient before reading -- **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md). Names this manager one of 6 standing R2 managers; **the closure-ledger and demo-coordination single authority** for R2. +- **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md). Names this manager one of **7** standing R2 managers (count rose from 6 to 7 with Evaluator added 2026-04-28 per #1078); **the closure-ledger and demo-coordination single authority** for R2. - **Program scope source:** [`docs/r2-structure.md` §"Goals" items 5, 6 + cross-cutting deliverables](../r2-structure.md). -- **Cross-program coordination:** receives lane-close signals from all 5 other managers (Grounding, Substrate, Modeling, Impossible-Bugs, Pure Bootstrap); surfaces R2 demo artifacts to user. +- **Cross-program coordination:** receives lane-close signals from all 6 other managers (Substrate, Modeling, Grounding, Impossible-Bugs, Pure Bootstrap, Evaluator); surfaces R2 demo artifacts to user. +- **Structural-acceptance-per-lane-close discipline (Director-locked 2026-04-28):** **the demo IS the structural acceptance gate.** Each lane's closure PR proves the lane closed correctly via a structural acceptance gate (e.g., `omni_layers_share_one_node_tree`, `bound_declaration_carries_three_variants_structurally`, `lens_complexity_n_log_n_fold_correct`). The demo is the gate's evidence — not a separate ad-hoc artifact. R2 Release Manager coordinates visibility (surfacing gates as they fire); the *authoring* of each gate is owned by the lane's manager. This avoids "process gate" framing where demos exist as separate authoring work disconnected from lane closure. ## Program scope (T-Release) @@ -15,13 +16,14 @@ R2's smallest cross-cutting deliverables + release coordination + demo + discipl | Deliverable | Source | Status (at brief authoring) | |---|---|---| | §6a per-method-metadata follow-through (Goal 5) | `docs/design-substrate-carrier-port-program.md §6a` (decision locked at `:171`; live receipt at `:173`; dissolution trigger at `:175`) | DECISION LOCKED — Option 3 unified `MethodContract` carrier; live receipt landed (`src/v3/std/algebra.dag` declares `MethodContract`; `src/v3/lenses/cost.dag` imports via `method_contract_cost_shape` minimal demo consumer). Remaining R2 work: bulk migration of `cost.dag` / `complexity.dag` to live call-site lookup + dissolution-trigger tracking (`size_effect` / `cost_shape` / `callback_element_position` field-by-field retirement). | -| R2 closure demo coordination (Goal 6) | `docs/r2-structure.md` Goal 6 + Demo discipline section | LIVE on spawn (no separate brief; see Demo discipline) | +| R2 closure demo coordination (Goal 6) | `docs/r2-structure.md` Goal 6 + structural-acceptance-per-lane-close discipline | LIVE on spawn (no separate brief; demo IS the structural acceptance gate per Director directive) | | B-wave Tier 0 through-merge | #810 §5 dispatch ordering | IN FLIGHT (B1 #820, B2 #817, B3 #821 — implementation iteration) | | B-wave Tier 2 brief authoring | #810 §5 (B5 Loop construction-closure audit; B6 file-preference rank checklist; B7 priority hint to Pure Bootstrap Manager) | **AUTHORED** — `r2-release-b5-*.md`, `r2-release-b6-*.md`, `r2-release-b7-*.md` (PM portion per inbox #828). B6 resolution: extend `declaration_name_preference_rank` / `collect_symbols` convergence checklist (`std.computation` / `std.induction` / `std.termination`). | | Discipline framework central reporting | INVARIANTS.md §P5 "Dispatch-Discipline Mechanisms" (c) + ROADMAP.md "Integration-reflection cadence" velocity-tripwire | LIVE on spawn (mechanism wired via PRs #810 + #812) | -| Thesis-claim coverage mapping | `docs/r2-structure.md` Open call 1 | NOT YET AUTHORED (lands as part of R1→R2 transition step 4) | -| R2 closure ledger | `docs/r2-structure.md` Manager structure section 6 | LIVE on spawn (tracks lane-close green status across all 5 other managers) | +| Thesis-claim coverage mapping | `docs/r2-structure.md` Open call 1 + `docs/thesis/r2-r3-thesis-mapping.md` (LIVE post-#1078) | LANDED via #1078 — initial mapping complete; refresh as lanes close | +| R2 closure ledger | `docs/r2-structure.md` Manager structure section 7 | LIVE on spawn (tracks lane-close green status across all 6 other managers; sub-gate progress for T-LensProducer-Retirement R3 continuation) | | v2 retirement coordination | `docs/r2-structure.md` Transition mechanics v2-retirement note | LIVE on spawn (post-R2 operational; tracked but not gated) | +| **v2 release-doc-authority guardrail follow-up** *(NEW 2026-04-28)* | `docs/r2-structure.md` §v2-guardrail-requirement-3 + `scripts/check-release-doc-authority.sh` | **NOT YET AUTHORED** — narrow PR scoped to release-state.yaml + projection-checker per gpt-5-5-pro meta-review; tighten retraction-pattern foot-gun (currently exempts unrelated "retracted" prose) | ## Owned deliverables (through R2 close) @@ -31,50 +33,75 @@ R2's smallest cross-cutting deliverables + release coordination + demo + discipl 2. **B5 Loop construction-closure audit brief** — Tier 2 from #810 §5. **MUST start with construction-closure audit, NOT marker design.** If audit confirms Loop only reachable through recursive-function lowering, deliverable is structural integration test. If audit refutes, marker brief. 3. **B6 file-preference rank checklist completion brief** — trivial S, one-line ROADMAP fix per #810 §5. 4. **B7 priority-hint relay to Pure Bootstrap Manager** — lift `patch_lower_helpers_*` retirement to PB-Tier1 priority. Cross-manager signal, not a worker brief. -5. **Thesis-claim coverage mapping** (Open call 1 from `docs/r2-structure.md`) — table mapping every Tier-1 / Tier-2 / Tier-3 THESIS claim to R1-closed / R2-gated / post-R2-external disposition. Lands as part of R1 closure → R2 promotion transition. +5. **Thesis-claim coverage mapping refresh** (Open call 1 from `docs/r2-structure.md`) — initial mapping landed via #1078 at `docs/thesis/r2-r3-thesis-mapping.md`; refresh as lanes close to track per-claim disposition. +6. **v2 release-doc-authority guardrail follow-up** *(NEW 2026-04-28)* — narrow PR scoped per gpt-5-5-pro meta-review: structured `release-state.yaml` + projection-checker that catches structured-state drift (lane counts, dependency-graph membership, thesis-claim disposition); tighten retraction-pattern foot-gun. Pinned-limitation test (`test_foot_gun_currently_allowed`) flips to a contract assertion when this lands. ### Standing-state deliverables (continuous through R2) -6. **B1, B2, B3 Tier 0 through-merge** — coordinate worker iteration on the 3 fail-closed P3 leak fixes already in flight (#820, #817, #821). Surface STOP-AND-ESCALATE signals if workers bounce repeatedly. -7. **R2 demo coordination** — surface "it runs" artifacts at each lane close per Demo discipline (single authority per `docs/r2-structure.md` 2026-04-26 rework). -8. **Closure ledger** — track lane-close green status across all 5 other managers; surface unblocked work to idle workers; coordinate v2 retirement post-R2. -9. **Velocity-tripwire reporting** — each integration-reflection cadence pass, report introduction:dissolution PR ratio across all manager-authored work; surface ≥3:1 readings to Director per INVARIANTS.md §P5 (c). Manual sweep for dissolution-bearing feature PRs first per calibration caveat. -10. **Substrate Manager bottleneck watch** — per `docs/r2-structure.md` watch condition: if Substrate becomes the new bottleneck (workers idle >7 days waiting for Substrate-authored briefs), surface to Director and recommend B4 split into dedicated B4 Identity-Carrier Manager. +7. **B1, B2, B3 Tier 0 through-merge** — coordinate worker iteration on the 3 fail-closed P3 leak fixes already in flight (#820, #817, #821). Surface STOP-AND-ESCALATE signals if workers bounce repeatedly. +8. **R2 demo coordination** — surface "it runs" artifacts at each lane close per **structural-acceptance-per-lane-close discipline** (the demo IS the structural gate; no separate authoring). +9. **Closure ledger** — track lane-close green status across all 6 other managers; surface unblocked work to idle workers; coordinate v2 retirement post-R2; track sub-gate progress for T-LensProducer-Retirement R3 continuation per Director directive. +10. **Velocity-tripwire reporting** — each integration-reflection cadence pass, report introduction:dissolution PR ratio across all manager-authored work; surface ≥3:1 readings to Director per INVARIANTS.md §P5 (c). Manual sweep for dissolution-bearing feature PRs first per calibration caveat. +11. **Substrate Manager bottleneck watch** — per `docs/r2-structure.md` watch condition: if Substrate becomes the new bottleneck (workers idle >7 days waiting for Substrate-authored briefs), surface to Director and recommend B4 split into dedicated B4 Identity-Carrier Manager. ## Cross-program dependencies **Produces:** - Closure ledger updates → Director (weekly health check) + user (R2 demo surfacing). - Velocity-tripwire alerts → Director (when ≥3:1 ratio fires). -- Bottleneck watch alerts → Director (when Substrate Manager workers idle >7 days). +- Bottleneck watch alerts → Director (when Substrate Manager workers idle >7 days, or any manager's workers idle >7 days). +- B7 priority-hint relay → Pure Bootstrap Manager. -**Consumes (lane-close signals from all 5 other managers):** -- Grounding Manager — T-Ground lane-close signals -- Substrate Manager — T-Substrate sub-lane / B4 Phase close signals -- Modeling Manager — T-Modeling item-close signals -- Impossible-Bugs Manager — T-ImpossibleBugs class-close signals -- Pure Bootstrap Manager — post-R1 PB lane-close signals +**Consumes (lane-close signals from all 6 other managers):** +- Substrate Manager — T-Substrate sub-lane / B4 Phase / T-Substrate-Lens-Primitive close signals; **R3 continuation: T-CostLens-Composition** sub-gate progress +- Modeling Manager — T-Modeling item-close signals (4 items) +- Grounding Manager — T-Ground lane-close signals (11 lanes post-engine-reframe) +- Impossible-Bugs Manager — T-ImpossibleBugs class-close signals (3 classes) +- Pure Bootstrap Manager — post-R1 PB lane-close signals + **R3 continuation: T-LensProducer-Retirement (3 sub-gates) / T-FixedPoint / T-Tier3-Dissolution / 3 distributed bridge retirements** +- Evaluator Manager — T-Evaluator sub-lane close signals (5 sub-lanes); PR-A through PR-E design-lock cadence progress **Adjacent territory:** none (Release is cross-cutting). +## Locked design decisions consumed (per #1078 dialogue) + +Worker briefs MUST consume these without re-litigation: + +- **Structural-acceptance-per-lane-close discipline**: demo IS the structural gate; no separate demo authoring work. Release coordinates visibility, doesn't author gates. +- **Manager count 7** (post-Evaluator-add): closure ledger spans 6 other managers (Substrate / Modeling / Grounding / Impossible-Bugs / Pure Bootstrap / Evaluator). +- **R2 manager continuation pattern** (`r3-structure.md` §"R2 manager continuation"): Substrate continues with T-Int128 + T-Anthropic-Wire + T-CostLens-Composition; PB continues with T-LensProducer-Retirement + T-FixedPoint + T-Tier3-Dissolution + 3 distributed bridges; Modeling/Impossible-Bugs archive at R2 close. Closure ledger reports R3 continuation readiness. +- **T-LensProducer-Retirement XL framing** (Director cascade Item 8): one program with 3 internal sub-gates; closure ledger reports sub-gate progress within the one-program lane. +- **T-Bridge-Retirement distribution map** (Director cascade Item 4): retirement work distributed (3 PB + 2 Substrate); ledger gate centralized at Verification (R3). Closure ledger tracks distribution map progress. + ## Pre-spawn vs post-spawn authority -- **Pre-spawn (now, before R1 close):** Director + PM coordinate on brief authoring per inbox #828 split. PM authors the manager skeleton (this file) + the §6a / B5 / B6 / B7 / thesis-claim-mapping briefs that are this manager's PM-portion deliverables (per inbox #828). Both stop authoring once R2 spawns. +- **Pre-spawn (post-#1078-merge):** brief authoring + cross-cutting deliverables locked. Manager spawns once R2 promotion fires; pre-R1-close spawn allowed (no technical R1 dependency). - **Post-spawn (R2 promotion onward):** Manager owns all worker-brief authoring autonomously per "Autonomous dispatch authority" below. Director's role narrows to cross-program conflict resolution + scope-change escalation. ## Autonomous dispatch authority -- Authors all T-Release owned deliverables without Director: worker briefs (§6a follow-through, B5, B6, thesis-claim coverage mapping) and cross-manager signals (B7 priority-hint relay). +- Authors all T-Release owned deliverables without Director: worker briefs (§6a follow-through, B5, B6, thesis-claim coverage mapping refresh, v2 guardrail follow-up) and cross-manager signals (B7 priority-hint relay). - Dispatches workers against owned deliverables. - Owns the **central reporting** layer of P5 dispatch-discipline (per `docs/r2-structure.md`); per-brief paired-dispatch and per-PR gate enforcement happens at each manager's authoring point, not at Release. - Resolves Release-internal scope refinements; escalates blockers and scope changes to Director. +- **Cross-program signal authority:** weekly closure-ledger summary → Director; R2 demo surfacing → user; B7 priority-hint relay → PB Manager; bottleneck watch alerts → Director. ## Reporting cadence -- **To Director (cross-program):** velocity-tripwire alerts (≥3:1 ratio), bottleneck watch alerts (Substrate or any manager idle >7 days), closure-ledger weekly health check. -- **To user (release coordination):** R2 demo artifacts at each lane close (per Demo discipline section); closure ledger surfacing. +- **To Director (cross-program):** velocity-tripwire alerts (≥3:1 ratio), bottleneck watch alerts (any manager's workers idle >7 days), closure-ledger weekly health check, structural-acceptance gate landings. +- **To user (release coordination):** R2 demo artifacts at each lane close (per structural-acceptance-per-lane-close discipline); closure ledger surfacing. +- **From all 6 managers:** lane-close / sub-lane-close / class-close signals via cross-manager queue. - **Blockers + scope changes:** Director. +## Acceptance — `.dag` gates + +Release Manager doesn't author lane-level structural gates (those belong to lane-owning managers per the structural-acceptance-per-lane-close discipline). Release Manager's own acceptance: + +- `r2_closure_ledger_landed` — closure ledger document tracking all 6 other managers' green-status / sub-gate-progress (post-spawn standing artifact) +- `velocity_tripwire_reporting_landed` — introduction:dissolution PR ratio surfaced to Director on integration-reflection cadence; ≥3:1 fires alert +- `thesis_claim_coverage_mapping_refresh_landed` — `docs/thesis/r2-r3-thesis-mapping.md` refreshed as lanes close; per-claim disposition tracked +- `release_doc_authority_v2_guardrail_landed` — structured release-state.yaml + projection-checker; foot-gun pinned-limitation test flips to contract assertion +- `r2_close_signal_to_director_authored` — when all 5 R2-archiving managers (Substrate-prereq side / Modeling / Grounding / Impossible-Bugs / Evaluator) close their lanes, manager surfaces R2-close signal + R3 continuation readiness signal to Director + ## Sub-briefs (authored / pending) Authored (pre-spawn PM portion, inbox #828): @@ -83,20 +110,35 @@ Authored (pre-spawn PM portion, inbox #828): - [`r2-release-b6-file-preference-rank-checklist-worker.md`](r2-release-b6-file-preference-rank-checklist-worker.md) - [`r2-release-b7-priority-hint-relay-to-pure-bootstrap.md`](r2-release-b7-priority-hint-relay-to-pure-bootstrap.md) — cross-manager signal brief -Still pending at R1→R2 transition (not pre-spawn worker briefs): -- Thesis-claim coverage mapping table (Open call 1; lands at R1 close → R2 promotion) +Landed via #1078: +- Initial thesis-claim coverage mapping (`docs/thesis/r2-r3-thesis-mapping.md`) +- Release-doc authority consumer + self-test (`scripts/check-release-doc-authority.sh` + `scripts/test-check-release-doc-authority.sh` + CI wiring) -Post-spawn: manager-authored worker briefs autonomously per "Pre-spawn vs post-spawn authority" above. +Pending — post-spawn manager-authored autonomously: +- **v2 release-doc-authority guardrail follow-up** worker brief (release-state.yaml + projection-checker; per gpt-5-5-pro meta-review) +- Thesis-claim coverage mapping **refresh** worker briefs (as lanes close — incremental refresh, not new authoring) +- Closure ledger weekly summary template (post-spawn standing artifact) ## Working state (fill on spawn) -Closure ledger snapshot + velocity-tripwire ratio refreshes here at each integration-reflection cadence pass. Pre-spawn placeholder. +Spawn refresh, 2026-04-28 (post-#1078): + +- 7-manager structure live (count rose from 6 to 7 with Evaluator added). +- Closure ledger spans all 6 other managers (Substrate / Modeling / Grounding / Impossible-Bugs / PB / Evaluator) + sub-gate progress for T-LensProducer-Retirement (3 internal sub-gates per Director directive). +- Initial thesis-claim coverage mapping landed via #1078; refresh authority lives here. +- v2 guardrail follow-up named as next narrow PR (release-state.yaml + projection-checker). +- Structural-acceptance-per-lane-close discipline locked: Release coordinates visibility, doesn't author gates. ## Cross-refs - Parent: `docs/r2-structure.md` §"R2 Release Manager" - Discipline framework: INVARIANTS.md §P5 "Dispatch-Discipline Mechanisms" (a)/(b)/(c) - Cadence wiring: ROADMAP.md "Integration-reflection cadence" + velocity-tripwire reporting +- Structural-acceptance-per-lane-close discipline: `docs/r2-structure.md` (Director-locked 2026-04-28) - §6a source: `docs/design-substrate-carrier-port-program.md §6a` (decision locked Option 3; live receipt landed) -- Thesis-claim authority: `THESIS.md §"Thesis claims — complete list"` +- Thesis-claim authority: `THESIS.md §"Thesis claims — complete list"` + `docs/thesis/r2-r3-thesis-mapping.md` - B-wave source: `docs/briefs/debt-paydown-synthesis-2026-04-25.md` §5 (B1-B7 dispatch ordering) +- Release-doc authority guardrail: `scripts/check-release-doc-authority.sh` + `scripts/test-check-release-doc-authority.sh` +- v2 guardrail requirements: `docs/r2-structure.md` §v2-guardrail-requirement-3 +- R2 manager continuation pattern: `docs/r3-structure.md` §"R2 manager continuation" +- INVARIANTS substrate-fact-introduction procedure: `INVARIANTS.md` §P1 From ea798b7216e55e9723dc84b901d43a9b03c46db8 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 28 Apr 2026 19:30:06 -0400 Subject: [PATCH 06/22] WIP: Gunbc PM --- docs/briefs/r2-substrate-manager.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/docs/briefs/r2-substrate-manager.md b/docs/briefs/r2-substrate-manager.md index c2a7600e67b..29d0bc96b23 100644 --- a/docs/briefs/r2-substrate-manager.md +++ b/docs/briefs/r2-substrate-manager.md @@ -87,17 +87,18 @@ Dispatch sequence: **PR-PreF lands first** (foundational substrate; everything e | Sub-lane | Size | Current status | Carrier shape | |---|---|---|---| -| T-Substrate cardinality-for-int-lit | M | BRIEF LANDED (`t-substrate-cardinality-int-lit-worker.md`, PR #806 merged 2026-04-25); duplicate R2 routing doc closed as redundant. **Now consumes PR-PreF Interval** when it lands. | range facts + reconciliation narrowing; Int128/Word128 carrier deferred to sibling sub-lane | -| T-Substrate nominal-opaque-for-Secret | M | BRIEF AUTHORED (`r2-substrate-nominal-opaque-for-secret-subset.md`; PR #836 merged 2026-04-26) | nominal-type construction/access restriction | -| T-Substrate parametric-algebra-for-Dimensions | M | CLOSED BY AUDIT (`r2-substrate-parametric-algebra-for-dimensions-subset.md`; PR #836 merged 2026-04-26); substrate already exists, consumer dispatchable. | existing `Declaration.phantom_params` + `phantom_unit_mismatch` carrier | -| T-Substrate ValueBody-list/sum + std.unicode | L | BRIEF LANDED (`t-substrate-valuebody-list-worker.md`, PR #790 merged 2026-04-25) | top-level list/sum literal lowering + bootstrap/load-set | +| T-Substrate cardinality-for-int-lit | M | BRIEF LANDED (`t-substrate-cardinality-int-lit-worker.md`, PR #806 merged 2026-04-25). **Now consumes PR-PreF Interval** when it lands. | range facts + reconciliation narrowing; Int128/Word128 carrier deferred to sibling sub-lane | +| T-Substrate nominal-opaque-for-Secret | M | BRIEF AUTHORED (PR #836); **fail-closed field-projection enforcement LANDED via #937** (NominalOpacityViolation diagnostic + production enforcement before nominal-opaque field descent; complements #900 carrier-only staging). Secret consumer migration still pending per `r2-modeling-secret-graduation-worker.md`. | nominal-type construction/access restriction | +| T-Substrate parametric-algebra-for-Dimensions | M | CLOSED BY AUDIT (PR #836); substrate already exists, consumer dispatchable. **T-Cost-Dimension fail-closed symbolic-cost analysis LANDED via #1003** (DominateScanAcc conjunctive accumulator; relevant to Dimensions consumer modeling). | existing `Declaration.phantom_params` + `phantom_unit_mismatch` carrier | +| T-Substrate ValueBody-list/sum + std.unicode | L | BRIEF LANDED (PR #790 merged 2026-04-25) | top-level list/sum literal lowering + bootstrap/load-set | +| **T-Substrate ValueBody-Map** *(NEW; R2 unblocker)* | M | **SUBSTRATE LANDED via #1017** (string-keyed `ValueBody::Map` + nested `FieldValue::Map` carriers; structural lowering of `Map` literals). **Tightening landed via #1068** (`FieldMap` newtype with private storage + duplicate-key validation at construction). Consumer plumbing (read-path/API + arrow-body evaluation) pending — unblocks PB Manager `kernel_algebra_profile` mirror dissolution. | top-level map literal substrate | | **T-Substrate-Lens-Primitive** *(NEW 2026-04-28)* | M | NOT YET AUTHORED — gated on PR-K lock (Q6+Q7+Q8) | `Lens` 6-field record in `src/v3/std/dimensions.dag` (sibling to existing `AnalysisDimension` + `Dimension`); Witness+OptionalDiagnostic+DimensionReport already in substrate | | **PR-PreF Interval consolidation** *(NEW 2026-04-28)* | S | NOT YET AUTHORED — Director-authored or Substrate-Manager-authored | shared parent type for CardinalityBound / SizeBound / LoopBound::Cardinality | | B4.1 DeclarationRef consumer migration | M | LANDED (PR #826 merged 2026-04-26) | existing carrier consumer migration | -| B4.2 fold-shape carrier | S | BRIEF AUTHORED (`b4-2-structural-fold-shape-carrier-worker.md`; PR #836 merged 2026-04-26) | structural fold-eligibility query/carrier decision | +| B4.2 fold-shape carrier | S | BRIEF AUTHORED (PR #836); **first-consumer wiring LANDED** (`feat(v3): add B4.2 structural fold eligibility`) | structural fold-eligibility query/carrier decision | | B4.3 emit-helper carrier | S | LANDED (PR #824 merged 2026-04-26) | typed role marker on Bind/Branch nodes | | B4.4 extdeps-fixture-set carrier | S | LANDED (PR #825 merged 2026-04-26) | typed extdeps-bootstrap-set declaration | -| B4.5–B4.12 Phase 2 site dissolutions | S each | QUEUE AUTHORED (`b4-phase-2-site-dissolution-queue.md`); implementation briefs dispatch as Phase 1 carriers land. | mechanical consumer migration per site | +| B4.5–B4.12 Phase 2 site dissolutions | S each | QUEUE AUTHORED (`b4-phase-2-site-dissolution-queue.md`); **B4.8 LANDED via #1069** (emit-helper file-marker bind selection in roundtrip fixture; first Phase-2 site dissolved); B4.5/B4.6/B4.7/B4.9–B4.12 still queued as Phase 1 carriers land. | mechanical consumer migration per site | | **R3 continuation: T-CostLens-Composition** *(NEW 2026-04-28; R3 lane)* | M | NOT YET AUTHORED — gated on T-Substrate-Lens-Primitive landing + R2 close | structural Lens instance; Monoid + JoinSemilattice + BoundedLattice witnesses | ## Cross-program dependencies @@ -185,14 +186,15 @@ Pending — post-spawn manager-authored autonomously: ## Working state (fill on spawn) -Spawn refresh, 2026-04-28 (post-#1078): +Spawn refresh, 2026-04-28 (post-#1078, status-refresh against landed PRs): -- T-Substrate prereqs (R2): cardinality-for-int-lit producer landed (#806); nominal-opaque producer brief exists; parametric-algebra producer closed by audit because `phantom_params` already exists; ValueBody-list/sum landed (#790). -- T-Substrate-Lens-Primitive: NEW lane added 2026-04-28; gated on PR-K cadence lock (Q6+Q7+Q8 design questions resolved into substrate spec). -- PR-PreF Interval: NEW prepended cadence; foundational substrate consolidation; gates everything else. -- B4 Phase 1: B4.1, B4.3, B4.4 landed; B4.2 brief exists and remains the immediate unlanded Phase 1 implementation lane. -- B4 Phase 2: queue exists; dispatch follows Phase 1 carrier disposition. -- R3 continuation T-CostLens-Composition: deferred to R3 spin-up; gated on Lens primitive landing. +- **T-Substrate prereqs (R2):** cardinality-for-int-lit producer landed (#806); nominal-opaque substrate landed (#900) + fail-closed field-projection enforcement landed (#937); parametric-algebra closed by audit; ValueBody-list/sum landed (#790); **ValueBody::Map carrier landed (#1017) + tightened (#1068)** — kernel_algebra_profile no longer a "future sub-lane" at substrate level, only consumer plumbing remains. +- **T-Substrate-Lens-Primitive:** NEW lane added 2026-04-28; gated on PR-K cadence lock. +- **PR-PreF Interval:** NEW prepended cadence; foundational substrate consolidation; gates everything else. +- **B4 Phase 1:** B4.1 (#826), B4.3 (#824), B4.4 (#825) landed; B4.2 first-consumer wiring landed. +- **B4 Phase 2:** B4.8 LANDED via #1069 (first Phase-2 dissolution); B4.5/B4.6/B4.7/B4.9–B4.12 still queued. +- **R3 continuation T-CostLens-Composition:** deferred to R3 spin-up; gated on Lens primitive landing. +- **Adjacent landings:** T-Cost-Dimension fail-closed symbolic-cost analysis (#1003) — relevant precedent for Dimensions consumer fail-closed semantics. ## Cross-refs From 8bcb1fcf48f3515d35bd840ee547d3b1cac58764 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 28 Apr 2026 23:33:44 +0000 Subject: [PATCH 07/22] docs(briefs): R2 manager-brief status refresh against landed PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pre-spawn implementation work has progressed materially while #1078 was in flight; managers spawning today would otherwise dispatch against work that's already landed. Refresh per-manager status tables to reflect current main: - **Substrate:** ValueBody::Map landed (#1017 + #1068 tightening); NominalOpacity fail-closed field-projection enforcement (#937); B4.8 Phase-2 site dissolution landed (#1069); B4.2 first-consumer wiring landed; T-Cost-Dimension fail-closed precedent (#1003). - **Grounding:** Rust IntegerRangeFact mirror dissolved (#1005); Python primitives.dag landed (#1080); Go primitives tranche 1 + additional (ac765ce10 + #1046); T-Ground-Engine Phase 2 slice 1 (c0cc8b260) noted as pre-cascade footprint queued for cleanup wave per design-emission-model.md option (c). - **Impossible-Bugs:** all 3 main implementations LANDED pre-spawn (nested-optional flatten #890 + #962 follow-ups; Int/Int totality- by-omission first slice #969; unenumerated effects lens landing #971). Day-1 work is class-close completion + sibling totalization dispatch (indexing/quotient/remainder), not initial implementation. - **Pure Bootstrap:** kernel_algebra_profile substrate met via #1017 + #1068 (consumer plumbing now the remaining R2 work, dispatchable Day-1); T-PB-Runtime ExecuteCommand typed-outcome hardening (#1049) + T-PB-B boundary coverage (#1082) advanced PB-Runtime foundation for R3 lens_apply.rs retirement gate. - **Modeling:** Secret producer side substantially advanced (#900 carrier + #937 fail-closed enforcement); tokenizer charclass scanner-order retype landed pre-cascade (242c65d07); SourceFiltering canonical authority precedent (#1004). - **Release:** initial closure-ledger snapshot now reflects all pre-spawn landings (Impossible-Bugs/Substrate/Ground/PB-Runtime). Evaluator brief unchanged — new lane added 2026-04-28; nothing landed yet (gated on PR-A through PR-E design lock cadence). Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/briefs/r2-grounding-manager.md | 11 ++++++----- docs/briefs/r2-impossible-bugs-manager.md | 19 ++++++++++--------- docs/briefs/r2-modeling-manager.md | 16 ++++++++++------ docs/briefs/r2-pure-bootstrap-manager.md | 8 +++++--- docs/briefs/r2-release-manager.md | 12 ++++++++++-- 5 files changed, 41 insertions(+), 25 deletions(-) diff --git a/docs/briefs/r2-grounding-manager.md b/docs/briefs/r2-grounding-manager.md index a182c0ed7f8..4185ea4bb6a 100644 --- a/docs/briefs/r2-grounding-manager.md +++ b/docs/briefs/r2-grounding-manager.md @@ -58,10 +58,10 @@ The 8-question design dialogue resolved into a cadence whose merge gates worker | Lane | Size | Status (at brief authoring) | Description | |---|---|---|---| | T-Ground-Pilot | S | DONE (PR #765 merged 2026-04-25) | Toy inhabitance-search engine; routing-stability tests | -| T-Ground-Rust | XL | NOT YET AUTHORED — Director scope refinement pending; **gated on PR-F merge** | Rust primitive declarations end-to-end; consumes Q1 BoundDeclaration + Q2 Rust axes | -| T-Ground-Python | L | NOT YET AUTHORED — fill queue; **gated on PR-G merge** | Python primitive declarations | -| T-Ground-Go | L | NOT YET AUTHORED — fill queue; **gated on PR-H merge** | Go primitive declarations | -| **T-Ground-Coercion-Fold** *(NEW; replaces engine framing)* | S | NOT YET AUTHORED — **gated on PR-F merge + Substrate ValueBody-list/sum** | Refinement composition as structural fold over substrate facts; absorbs PR #989 mirror-consistency probe footprint | +| T-Ground-Rust | XL | **PARTIALLY LANDED** — IntegerRangeFact mirror dissolved via #1005 (single-authority `rust_pilot_primitives` + IntegerAlgebra/TargetCarrier identity witnesses + fail-closed bootstrap validation); remainder gated on PR-F | Rust primitive declarations end-to-end; consumes Q1 BoundDeclaration + Q2 Rust axes | +| T-Ground-Python | L | **PARTIALLY LANDED** — `dsl/extdeps/languages/python/primitives.dag` landed via #1080 (lively-wolf-462); remainder fill queue / gated on PR-G | Python primitive declarations | +| T-Ground-Go | L | **PARTIALLY LANDED** — `go/primitives.dag` spec tranche 1 landed (`ac765ce10`); additional Go primitives via #1046 (bright-otter-594); remainder fill queue / gated on PR-H | Go primitive declarations | +| **T-Ground-Coercion-Fold** *(NEW; replaces engine framing)* | S | **PRE-CASCADE FOOTPRINT LANDED** via PR #989 + commit `c0cc8b260` (Phase 2 pilot-list enumeration slice 1; mirror-consistency probe). Per `design-emission-model.md` §"Affected lanes" option (c): hold further engine-framed slices + queue cleanup wave once LanguageSpec lands. Future slices gated on PR-F + Substrate ValueBody-list/sum | Refinement composition as structural fold over substrate facts | | **T-Ground-LanguageSpec** *(NEW)* | M | NOT YET AUTHORED — **gated on PR-I merge** | Structured language-spec substrate; absorbs Reflective Pattern E retirement; per-primitive `RealizationCost` | | **T-Ground-Lifetime-Analyzer** *(NEW; no annotations)* | M | NOT YET AUTHORED | Structural ownership/lifetime derivation from program use | | **T-Ground-Diagnostic** *(NEW)* | S | NOT YET AUTHORED | Declared structural ordering for diagnostic enumeration | @@ -151,10 +151,11 @@ Pending — post-spawn manager-authored autonomously: ## Working state (fill on spawn) -Spawn refresh, 2026-04-28 (post-#1078 engine-reframe cascade): +Spawn refresh, 2026-04-28 (post-#1078 engine-reframe cascade + status-refresh against landed PRs): - 11-lane structure replaces the prior 7-lane Pilot/Rust/Engine/Tests/Dissolve framing. - 5 new substrate-completion lanes added (Coercion-Fold S + LanguageSpec M + Lifetime-Analyzer M + Diagnostic S + CrossTarget-Meta S). +- **Per-target work has begun pre-cadence:** Rust IntegerRangeFact mirror dissolved (#1005); Python primitives.dag landed (#1080); Go primitives spec tranche 1 + additional Go primitives landed (`ac765ce10` + #1046). Manager-spawn task: align this work with Q1 BoundDeclaration + Q2 axes once PR-F/G/H land; may require small refactors to the already-landed primitive declarations. - PR #989 (slice 1 of Phase 2) merged on main pre-cascade — cleanup wave queued; hold further engine-framed slices. - Cadence PR-F through PR-J gate worker dispatch on dependent lanes; PR-PreF (Substrate-owned) gates Q1-consuming lanes. - The "Annotation" lane was retracted in favor of structural derivation per Modeling problem 3 corrected; Lifetime-Analyzer replaces it. diff --git a/docs/briefs/r2-impossible-bugs-manager.md b/docs/briefs/r2-impossible-bugs-manager.md index bd592b26564..b106a6b594a 100644 --- a/docs/briefs/r2-impossible-bugs-manager.md +++ b/docs/briefs/r2-impossible-bugs-manager.md @@ -17,9 +17,9 @@ R2's Goal 4 — **Remaining R2+ impossible-bug classes**. Three classes currentl | Class | Design authority + implementation worker (post PR #836 merge) | Implementation status | Substrate gating | |---|---|---|---| -| Nested-optional flatten | Design: `t-impossiblebugs-nested-optional-flatten-design.md` (PR #798) — closed in scope; Implementation: [`r2-impossible-bugs-nested-optional-flatten-worker.md`](r2-impossible-bugs-nested-optional-flatten-worker.md) (PR #836 — landed) | IMPLEMENTATION WORKER LANDED — dispatchable Day-1 post-spawn | UNGATED per design doc audit (substrate-constructor invariant; cardinality bridge already past per Director reframe) | -| Unhandled diagnostic paths | Design: `t-impossiblebugs-unhandled-diagnostic-paths-design.md` (PR #801) — closed in scope, §4 Director-actionable recommends totality-by-omission; Implementation: [`r2-impossible-bugs-unhandled-diagnostic-paths-worker.md`](r2-impossible-bugs-unhandled-diagnostic-paths-worker.md) (PR #836 — landed) | IMPLEMENTATION WORKER LANDED — dispatchable Day-1 post-spawn (per-class; `Int / Int` first slice) | UNGATED per design doc §4 (totality-by-omission via algebra retype, not predicate-entailment substrate); siblings (indexing, quotient, remainder) queue separately | -| Unenumerated effects | Design: `t-impossiblebugs-unenumerated-effects-design.md` (PR #808) — **canonical authority**, closed-system effects model + 5-behavior fold; Implementation: [`r2-impossible-bugs-unenumerated-effects-worker.md`](r2-impossible-bugs-unenumerated-effects-worker.md) (PR #836 — landed) | IMPLEMENTATION WORKER LANDED — dispatchable Day-1 post-spawn (closed-system per design doc §Q1-Q3 + §Q6) | UNGATED — closed-system structural derivation does not require new substrate; prior worker briefs (`t-impossiblebugs-unenumerated-effects-worker.md` + `-parser-worker.md`) SUPERSEDED 2026-04-25 | +| Nested-optional flatten | Design: `t-impossiblebugs-nested-optional-flatten-design.md` (PR #798) — closed in scope; Worker brief: [`r2-impossible-bugs-nested-optional-flatten-worker.md`](r2-impossible-bugs-nested-optional-flatten-worker.md) (PR #836) | **IMPLEMENTATION LANDED via #890** (substrate-constructor invariant: `cardinality_idempotent_target`, `Dag::alloc_cardinality_decl`, TypeConnective-level enforcement). **Follow-ups landed via #962** (alias peel, resolve_decl idempotence, int literals). Class-close manager work: verify structural test coverage + audit residual integration paths. | UNGATED | +| Unhandled diagnostic paths | Design: `t-impossiblebugs-unhandled-diagnostic-paths-design.md` (PR #801) — closed in scope, §4 Director-actionable recommends totality-by-omission; Worker brief: [`r2-impossible-bugs-unhandled-diagnostic-paths-worker.md`](r2-impossible-bugs-unhandled-diagnostic-paths-worker.md) (PR #836) | **`Int / Int` FIRST SLICE LANDED via #969** (totalized via `Result` + `std.error_primitives` algebraic carrier + target prelude support; subsumes prior PR #931). Manager work: dispatch siblings (indexing / quotient / remainder) per design doc §4 — each queues separately as totality-by-omission slices. | UNGATED per design doc §4 (totality-by-omission via algebra retype, not predicate-entailment substrate) | +| Unenumerated effects | Design: `t-impossiblebugs-unenumerated-effects-design.md` (PR #808) — **canonical authority**, closed-system effects model + 5-behavior fold; Worker brief: [`r2-impossible-bugs-unenumerated-effects-worker.md`](r2-impossible-bugs-unenumerated-effects-worker.md) (PR #836) | **IMPLEMENTATION LANDED via #971** (closed-system structural derivation; lens landing; audit verdict path (ii) — retire `OperationEffect` as parallel representation per design doc Q5.5 / worker req 2). Class-close manager work: verify lens-landing acceptance + drive parallel-representation retirement of `OperationEffect`. | UNGATED — closed-system structural derivation does not require new substrate; prior worker briefs SUPERSEDED 2026-04-25 | Each class becomes an impossible-bug-by-construction at R2 close — not a runtime check, but a structural fact carried by the substrate that the lens / type checker reads. @@ -102,17 +102,18 @@ Each class closes under a structural acceptance gate authored as a `.dag` `TestC - `docs/briefs/t-impossiblebugs-unenumerated-effects-worker.md` (SUPERSEDED 2026-04-25 by design doc PR #808; further dissolved by `r2-impossible-bugs-unenumerated-effects-worker.md` now landing as the implementation authority). - `docs/briefs/t-impossiblebugs-unenumerated-effects-parser-worker.md` (SUPERSEDED 2026-04-25 by design doc; closed-system framing dissolves the proposed parser surface). -**Pending — Manager dispatches the 3 implementation workers landed via PR #836:** -- Dispatch nested-optional-flatten implementation worker (ungated; dispatchable Day-1 post-spawn). -- Dispatch unhandled-diagnostic-paths implementation worker (ungated; per-class — `Int / Int` first slice). -- Dispatch unenumerated-effects implementation worker (ungated; closed-system per design doc). +**Pending — Manager dispatches residuals (3 main implementations already landed via #890/#969/#971; manager drives class-close completion):** +- Nested-optional-flatten: residuals after #890 + #962 (verify structural test coverage; audit integration paths; close class). +- Unhandled-diagnostic-paths: dispatch indexing / quotient / remainder slices (per-class totality-by-omission, modeled on the #969 `Int/Int` first slice). +- Unenumerated-effects: drive `OperationEffect` parallel-representation retirement per #971's path (ii) verdict. - PR #805 Fn→Arrow refactor stays dispatchable as independent vestigial-syntax cleanup (not a thesis-claim closure dependency). ## Working state (fill on spawn) -Spawn refresh, 2026-04-28 (post-#1078): +Spawn refresh, 2026-04-28 (post-#1078, status-refresh against landed PRs): -- Class status table unchanged in scope; 3 implementation workers landed via PR #836. +- **All 3 main implementations landed pre-spawn:** nested-optional flatten (#890 + #962 follow-ups); `Int / Int` totality-by-omission first slice (#969 — subsumes prior #931); unenumerated effects (#971 — closed-system structural derivation; lens landing). +- Manager day-1 work is **class-close completion** (residual coverage + integration audit + parallel-representation retirement) plus **dispatching siblings** of the unhandled-diagnostic-paths totalization pattern (indexing / quotient / remainder). - Manager archives at R2 close; no R3 continuation work. - Post-R2 emergent classes route to Substrate Manager continuation per closed-system principle. diff --git a/docs/briefs/r2-modeling-manager.md b/docs/briefs/r2-modeling-manager.md index fcb3f84cda5..8511ceb6b18 100644 --- a/docs/briefs/r2-modeling-manager.md +++ b/docs/briefs/r2-modeling-manager.md @@ -16,10 +16,10 @@ R2's Goal 2 — **Modeling-faithfulness dissolution**. Three Tier-1 type-refinem | Item | Consumer of | Status (at brief authoring) | |---|---|---| -| Surface int-literal magnitude at concept layer | T-Substrate cardinality subset (consuming PR-PreF Interval) | AUTHORED — gated on producer readiness / scoped to range-facts consumer work | -| `Secret` nominal-opaque graduation | T-Substrate nominal-opaque subset | AUTHORED — gated on producer readiness | -| `Dimension` typed value wrapper with phantom-parameter unit-mismatch enforcement | T-Substrate parametric-algebra subset | AUTHORED — dispatchable immediately; producer audit closed substrate-side | -| Tokenizer charclass phase-2 | T-Substrate ValueBody-list/sum subset | AUTHORED — gated on producer readiness; reclassified R1→R2 per Surface Manager handoff 2026-04-24 | +| Surface int-literal magnitude at concept layer | T-Substrate cardinality subset (consuming PR-PreF Interval) | AUTHORED — gated on producer readiness / scoped to range-facts consumer work. **Adjacent landing:** T-Cost-Dimension fail-closed symbolic-cost analysis (#1003) — DominateScanAcc conjunctive accumulator; relevant precedent for fail-closed semantics in this consumer. | +| `Secret` nominal-opaque graduation | T-Substrate nominal-opaque subset | AUTHORED — gated on producer readiness. **Producer side advanced:** NominalOpacity carrier landed via #900; **fail-closed field-projection enforcement landed via #937** (NominalOpacityViolation diagnostic + production enforcement before field descent). Day-1 consumer migration: `dsl/std/types.dag` retire bare `Secret = String`; land `where only … may construct` semantics; integration test for unauthorized construction without bootstrap stamp. | +| `Dimension` typed value wrapper with phantom-parameter unit-mismatch enforcement | T-Substrate parametric-algebra subset | AUTHORED — dispatchable immediately; producer audit closed substrate-side. | +| Tokenizer charclass phase-2 | T-Substrate ValueBody-list/sum subset | AUTHORED — gated on producer readiness. **In flight:** scanner-order retype landed pre-cascade (commit `242c65d07` — `feat(v3): retype tokenizer charclass scanner order`). Reclassified R1→R2 per Surface Manager handoff 2026-04-24. | ## Pre-dispatch design lock cadence (consumed; per #1078 lock) @@ -52,6 +52,7 @@ For each item: **Adjacent territory:** - Tokenizer charclass phase-2 historically R1 T-Sub work; reclassified to R2 per Surface Manager handoff 2026-04-24. R1 retains the charclass phase-1 close; R2 Modeling Manager owns phase-2 (the substrate-capability-gated portion). - **§6a per-method-metadata bulk migration** (R2 Release Manager-owned, but consumes `MethodContract` substrate at method-call sites in `cost.dag`/`complexity.dag`). Modeling Manager doesn't author this; tracked here only as adjacent. +- **SourceFiltering canonical authority** (#1004 sleek-wren-716) — cross-target drift class closed via independent per-target `excluded_prefixes`. Adjacent to Modeling Manager scope; not owned here, but relevant precedent for cross-target uniformity work. ## Locked design decisions consumed (per #1078 8-question dialogue) @@ -106,11 +107,14 @@ Pending: none at manager-brief authoring time. Worker briefs may need refresh po ## Working state (fill on spawn) -Spawn refresh, 2026-04-28 (post-#1078): +Spawn refresh, 2026-04-28 (post-#1078, status-refresh against landed PRs): - Item status table unchanged in scope; int-lit item now consumes PR-PreF Interval via Q1 lock cascade. +- **Secret producer side substantially advanced:** NominalOpacity carrier (#900) + fail-closed field-projection enforcement (#937) both landed. Day-1 consumer migration is dispatchable. +- **Tokenizer charclass phase-2 in flight:** scanner-order retype (`242c65d07`) landed pre-cascade. +- **Adjacent precedents landed:** SourceFiltering canonical authority (#1004); T-Cost-Dimension fail-closed analysis (#1003). - Dimensions remains dispatchable immediately (phantom_params already in substrate). -- Other 3 items continue to gate on Substrate Manager carrier-readiness signals. +- Other items continue to gate on Substrate Manager carrier-readiness signals where carriers haven't fully landed. ## Cross-refs diff --git a/docs/briefs/r2-pure-bootstrap-manager.md b/docs/briefs/r2-pure-bootstrap-manager.md index 20626b52934..328da152e6e 100644 --- a/docs/briefs/r2-pure-bootstrap-manager.md +++ b/docs/briefs/r2-pure-bootstrap-manager.md @@ -25,7 +25,7 @@ | Tier 3 mirror dissolutions: computation | M | AUTHORED in [`r2-pb-tier3-mirror-dissolution-workers.md`](r2-pb-tier3-mirror-dissolution-workers.md) | `SizeBound`, `RecursionShape`-related Rust mirror at `dag.rs:839-915` dissolves with same substrate dependency. | | Tier 3 mirror dissolutions: induction | M | AUTHORED in [`r2-pb-tier3-mirror-dissolution-workers.md`](r2-pb-tier3-mirror-dissolution-workers.md) | `RecursionShape`, `InductiveField`, `SubValueRelation` Rust mirror at `dag.rs:916-980` dissolves with same substrate dependency. | | Tier 3 mirror dissolutions: effect-carrier | S | AUTHORED in [`r2-pb-tier3-mirror-dissolution-workers.md`](r2-pb-tier3-mirror-dissolution-workers.md) | `src/v3/compiler/src/dag/effects.rs` (216 LOC) + `compose_operation_effects` in `workflow_idempotency.rs` (105 LOC). Mechanical PB dissolution once self-hosting reaches it. Tier 3 #12 from #810. | -| `kernel_algebra_profile` mirror dissolution | M | GATED (waiting on Substrate Manager `ValueBody::Map` carrier read-path/API + arrow-body evaluation; landed in R2 post-#1017 but consumer plumbing pending) | Map-shaped (not list/sum); requires `ValueBody::Map` substrate work. | +| `kernel_algebra_profile` mirror dissolution | M | **SUBSTRATE LANDED via #1017** + tightened via #1068 (`ValueBody::Map` + `FieldValue::Map` + `FieldMap` newtype with duplicate-key validation); **consumer plumbing pending** (read-path/API + arrow-body evaluation). Day-1 manager work: dispatch the consumer-migration worker brief that drives `kernel_algebra_profile` Rust-mirror dissolution against the new substrate. | Map-shaped (not list/sum); substrate dependency now met. | | Tier 2 `patch_lower_helpers_*` retirement | S | CLOSED by PR #1014 (first slice); **R3 continuation lane** for residual | `patch_lower_helpers_generated_type_alias_refinement`, the lower-helpers `regen_lens` patch path, and the SG-6 special case were retired once generated `lower_helpers` emitted the `refinement` field natively. Residual under T-Bridge-Retirement distribution (R3). | | Post-R1 emergent dissolutions | varies | NOT YET MATERIALIZED | Catch-all for new PB work that surfaces post-R1 (new mirror dissolutions discovered during R2; new Rust scaffolds inadvertently introduced and needing dissolution). | @@ -33,7 +33,7 @@ | R3 Lane | Size | Description | |---|---|---| -| **T-LensProducer-Retirement** | XL | Three program-sized hand-Rust files retired via PB-Runtime + PB-1 patterns. **Internal sub-gates** (Director directive 2026-04-28 — XL framing kept; sub-gate visibility for closure-ledger reporting): (i) `lens_apply.rs` retired (gated on PB-Runtime interpreter-as-data); (ii) `lens_testgen.rs` retired (same gate as `lens_apply.rs`); (iii) `regen_lens.rs` retired (gated on PB-1 bin-shim emit pattern — distinct gate). Closure ledger reports sub-gate progress; lane is one program. **Plus advanced lifetime analyzer cases d/e/f** (closures, async lifetimes, self-referential/Pin) folded in per `design-emission-model.md` Open call 2 — the lifetime analyzer is structurally what replaces `lens_apply.rs`'s reflection work, so advanced cases land alongside retirement. | +| **T-LensProducer-Retirement** | XL | Three program-sized hand-Rust files retired via PB-Runtime + PB-1 patterns. **Internal sub-gates** (Director directive 2026-04-28 — XL framing kept; sub-gate visibility for closure-ledger reporting): (i) `lens_apply.rs` retired (gated on PB-Runtime interpreter-as-data); (ii) `lens_testgen.rs` retired (same gate as `lens_apply.rs`); (iii) `regen_lens.rs` retired (gated on PB-1 bin-shim emit pattern — distinct gate). **PB-Runtime foundation has begun pre-R3:** `T-PB-Runtime ExecuteCommand typed-outcome hardening` LANDED via #1049 (replaces `Other(ClaimResult)` partial carrier with 6-variant typed model; namespace-setup detection dissolved via `gunbc_execute_command_bootstrap` helper binary from #1063); T-PB-B ExecuteCommand boundary coverage extended via #1082. PB-Runtime interpreter-as-data still pending — that's the remaining gate for `lens_apply.rs` retirement. Closure ledger reports sub-gate progress; lane is one program. **Plus advanced lifetime analyzer cases d/e/f** (closures, async lifetimes, self-referential/Pin) folded in per `design-emission-model.md` Open call 2 — the lifetime analyzer is structurally what replaces `lens_apply.rs`'s reflection work, so advanced cases land alongside retirement. | | **T-FixedPoint** | M | `compiler.dag` compiles to bit-identical stage0 Rust + bit-identical emitted artifacts; R1's `pb_self_compile_fixed_point` gate closes under stronger interpretation. Depends on R2-Evaluator + SG-0 zero from T-LensProducer-Retirement. | | **T-Tier3-Dissolution** *(may share with Tier 3 Manager continuing post-R2)* | M | Four hand-Rust mirrors of `.dag` types retired (mirror bodies replaced by Evaluator-backed authority inside `dag.rs` / `dag/effects.rs` / `workflow_idempotency.rs`); **consumer count / mirror-symbol count reaches zero**. SG-0 delta is reported and **usually 0** because the hand-authored file remains on the census after mirror-block retirement — SG-0 reaches 0 through broader PB-Substrate / generated-file retirement + T-LensProducer-Retirement. | | **3 distributed bridge retirements** *(part of T-Bridge-Retirement distribution map; see Cross-program below)* | varies | (3) canonical lens-name dispatch — lens-producer-retirement adjacent; (4) `include_str!` side channels (e.g., `pipeline_authority.rs`) — compiler-internal bootstrap; (5) `patch_lower_helpers_*` residual — Tier 2 retirement lineage; #1014 was first slice. Verification Manager owns the unified `bridge_retirement_ledger_zero` ledger gate; PB owns retirement work for these 3 bridges. | @@ -120,9 +120,11 @@ Closed: ## Working state (fill on spawn) -Spawn refresh, 2026-04-28 (post-#1078): +Spawn refresh, 2026-04-28 (post-#1078, status-refresh against landed PRs): - R2 lanes unchanged in scope; status table tracks Tier 3 mirror dissolutions + kernel_algebra_profile. +- **kernel_algebra_profile substrate met:** ValueBody::Map landed (#1017) + tightened (#1068); consumer plumbing is the remaining work — dispatchable Day-1. +- **T-PB-Runtime foundation landed:** ExecuteCommand typed-outcome hardening (#1049) replaces partial `Other(ClaimResult)` carrier; T-PB-B boundary coverage (#1082). PB-Runtime interpreter-as-data still pending — that's the load-bearing gate for `lens_apply.rs` retirement. - R3 continuation added: T-LensProducer-Retirement (XL with 3 internal sub-gates) + T-FixedPoint + T-Tier3-Dissolution + 3 distributed bridge retirements. - 3 distributed bridges absorbed into existing PB scope per Director cascade Item 4 (no new manager spawning). diff --git a/docs/briefs/r2-release-manager.md b/docs/briefs/r2-release-manager.md index 259b8228370..7207a0bd74b 100644 --- a/docs/briefs/r2-release-manager.md +++ b/docs/briefs/r2-release-manager.md @@ -15,7 +15,7 @@ R2's smallest cross-cutting deliverables + release coordination + demo + discipl | Deliverable | Source | Status (at brief authoring) | |---|---|---| -| §6a per-method-metadata follow-through (Goal 5) | `docs/design-substrate-carrier-port-program.md §6a` (decision locked at `:171`; live receipt at `:173`; dissolution trigger at `:175`) | DECISION LOCKED — Option 3 unified `MethodContract` carrier; live receipt landed (`src/v3/std/algebra.dag` declares `MethodContract`; `src/v3/lenses/cost.dag` imports via `method_contract_cost_shape` minimal demo consumer). Remaining R2 work: bulk migration of `cost.dag` / `complexity.dag` to live call-site lookup + dissolution-trigger tracking (`size_effect` / `cost_shape` / `callback_element_position` field-by-field retirement). | +| §6a per-method-metadata follow-through (Goal 5) | `docs/design-substrate-carrier-port-program.md §6a` (decision locked at `:171`; live receipt at `:173`; dissolution trigger at `:175`) | DECISION LOCKED — Option 3 unified `MethodContract` carrier; live receipt landed (`src/v3/std/algebra.dag` declares `MethodContract`; `src/v3/lenses/cost.dag` imports via `method_contract_cost_shape` minimal demo consumer). **Adjacent landing:** T-Cost-Dimension fail-closed symbolic-cost analysis (#1003) — DominateScanAcc conjunctive accumulator + dimension-evidence fail-closed semantics. Remaining R2 work: bulk migration of `cost.dag` / `complexity.dag` to live call-site lookup + dissolution-trigger tracking (`size_effect` / `cost_shape` / `callback_element_position` field-by-field retirement). | | R2 closure demo coordination (Goal 6) | `docs/r2-structure.md` Goal 6 + structural-acceptance-per-lane-close discipline | LIVE on spawn (no separate brief; demo IS the structural acceptance gate per Director directive) | | B-wave Tier 0 through-merge | #810 §5 dispatch ordering | IN FLIGHT (B1 #820, B2 #817, B3 #821 — implementation iteration) | | B-wave Tier 2 brief authoring | #810 §5 (B5 Loop construction-closure audit; B6 file-preference rank checklist; B7 priority hint to Pure Bootstrap Manager) | **AUTHORED** — `r2-release-b5-*.md`, `r2-release-b6-*.md`, `r2-release-b7-*.md` (PM portion per inbox #828). B6 resolution: extend `declaration_name_preference_rank` / `collect_symbols` convergence checklist (`std.computation` / `std.induction` / `std.termination`). | @@ -121,7 +121,7 @@ Pending — post-spawn manager-authored autonomously: ## Working state (fill on spawn) -Spawn refresh, 2026-04-28 (post-#1078): +Spawn refresh, 2026-04-28 (post-#1078, status-refresh against landed PRs): - 7-manager structure live (count rose from 6 to 7 with Evaluator added). - Closure ledger spans all 6 other managers (Substrate / Modeling / Grounding / Impossible-Bugs / PB / Evaluator) + sub-gate progress for T-LensProducer-Retirement (3 internal sub-gates per Director directive). @@ -129,6 +129,14 @@ Spawn refresh, 2026-04-28 (post-#1078): - v2 guardrail follow-up named as next narrow PR (release-state.yaml + projection-checker). - Structural-acceptance-per-lane-close discipline locked: Release coordinates visibility, doesn't author gates. +**Significant pre-spawn landings to track in initial closure-ledger snapshot:** +- **T-ImpossibleBugs:** all 3 main implementations landed (#890 + #962 follow-ups; #969 Int/Int totalization; #971 unenumerated effects lens landing). +- **T-Substrate:** ValueBody::Map (#1017 + #1068 tightening); NominalOpacity fail-closed enforcement (#937); B4.8 Phase-2 site dissolution (#1069); B4.2 first-consumer wiring landed. +- **T-Ground (per-target work pre-cadence):** Rust IntegerRangeFact mirror dissolved (#1005); Python primitives.dag (#1080); Go primitives tranche 1 + additional (`ac765ce10` + #1046). +- **T-PB-Runtime foundation:** ExecuteCommand typed-outcome hardening (#1049); T-PB-B boundary coverage (#1082). +- **Adjacent:** T-Cost-Dimension fail-closed analysis (#1003); SourceFiltering canonical authority (#1004); tokenizer charclass scanner-order retype (`242c65d07`). +- **B-wave Tier 0 status:** B1 #820, B2 #817, B3 #821 still in flight per #810 §5; verify post-spawn whether implementation iteration completed during #1078 review window. + ## Cross-refs - Parent: `docs/r2-structure.md` §"R2 Release Manager" From a9285fce67c6166ffb065aa9b02f81180830afe2 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 28 Apr 2026 19:51:08 -0400 Subject: [PATCH 08/22] WIP: Gunbc PM --- docs/briefs/r2-substrate-manager.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/briefs/r2-substrate-manager.md b/docs/briefs/r2-substrate-manager.md index 29d0bc96b23..3373382e6d2 100644 --- a/docs/briefs/r2-substrate-manager.md +++ b/docs/briefs/r2-substrate-manager.md @@ -7,9 +7,9 @@ - **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md). Names this manager one of **7** standing R2 managers (count rose from 6 to 7 with R2-Evaluator added 2026-04-28 per #1078). Substrate is **co-XL with Evaluator** — together the largest single concentrations of R2 work. - **Program scope sources:** - T-Substrate (R2 prereq sub-lanes): [`docs/r2-structure.md` §"Goals" item 3](../r2-structure.md). - - T-Substrate-Lens-Primitive (added 2026-04-28 via #1078): [`docs/r2-structure.md` §"Goals" item 8](../r2-structure.md) + [`docs/design-lens-framework.md`](../design-lens-framework.md). + - T-Substrate-Lens-Primitive (added 2026-04-28 via #1078): [`docs/r2-structure.md` §"Goals" item 3 (Substrate prereqs) — 5th sub-bullet "T-Substrate-Lens-Primitive"](../r2-structure.md) + [`docs/design-lens-framework.md`](../design-lens-framework.md). Anchor in the Substrate Manager section at `r2-structure.md:96`. - B4 Identity-Carrier Substrate Pass program: [`docs/briefs/b4-identity-carrier-substrate-pass.md`](b4-identity-carrier-substrate-pass.md). - - **Post-R2 continuation:** T-CostLens-Composition (R3 lane under Substrate continuation per Director cascade Item 3 ratified 2026-04-28). Substrate Manager is the only R2 manager that continues operating into R3. + - **Post-R2 continuation:** T-CostLens-Composition (R3 lane under Substrate continuation per Director cascade Item 3 ratified 2026-04-28). Substrate Manager is one of **two** R2 managers that continue operating into R3 — the other being Pure Bootstrap (which carries T-LensProducer-Retirement + T-FixedPoint + T-Tier3-Dissolution + 3 distributed bridges per Director cascade Item 4). Verification is a new R3 manager (not an R2 continuation). Modeling and Impossible-Bugs Managers archive at R2 close. - **Cross-program producer/readiness owner:** T-Substrate sub-lanes either produce carriers or validate existing substrate readiness for Modeling Manager (3 sub-lanes), Grounding Manager (Coercion-Fold consumes ValueBody-list/sum), and Evaluator Manager (Lens primitive). The Dimensions sub-lane is already substrate-ready by audit, so it is a readiness signal rather than new carrier work. - **Substrate-fact-introduction procedure** ([`INVARIANTS.md`](../../INVARIANTS.md) §P1): the 3-step decision procedure (DAG-ancestor check → coproduct-vs-coordinate check → primitive-vs-lens-extensible check) is **mandatory** for every new substrate type/variant/field this manager introduces. Self-serve through the procedure before escalating substrate-shape questions to Director. `feedback_substrate_principle_audit.md` extends this with a 6-question structural-recovery audit; both apply. - **Watch condition:** if Substrate becomes the new bottleneck (workers idle >7 days waiting for Substrate-authored briefs), split B4 into a dedicated standing **B4 Identity-Carrier Manager** per `docs/r2-structure.md:88` watch trigger. R2 Release Manager surfaces this signal via velocity-tripwire reporting. From b4bf6db846f834dc457af48f7c30ce5ac8393691 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 29 Apr 2026 00:06:27 +0000 Subject: [PATCH 09/22] docs(briefs): align Substrate Produces + Release R2-close acceptance MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per gpt-5-5-pro REQUEST_CHANGES on PR #1126 (sha:a9285fce). Two valid findings on coordination-contract internal consistency: 1. **Substrate Produces list omitted ValueBody::Map → PB signal.** The deliverables table at line 94 named ValueBody::Map as an R2 unblocker for PB's kernel_algebra_profile mirror dissolution, but the cross-program "Produces" section listed 5 signals and did not include this one. Same dependency represented in two places with different authority. Fix: add ValueBody::Map carrier read-path/API + arrow-body evaluation as the 6th produced signal targeted at PB Manager; update count from 5 to 6 (also in Reporting-cadence line 150). Remove the "Adjacent territory" note about kernel_algebra_profile being a future sub-lane — substrate already landed via #1017+#1068. 2. **Release R2-close acceptance gate excluded PB from close criterion.** The brief's "Consumes" section correctly named all 6 other managers including PB, but the r2_close_signal_to_director_authored gate at line 103 used "5 R2-archiving managers" (Substrate-prereq / Modeling / Grounding / Impossible-Bugs / Evaluator) — could fire the R2-close signal while PB's R2-scope lanes (Tier 3 mirror dissolutions + kernel_algebra_profile consumer plumbing) are still open. Fix: gate becomes "all 6 other managers' R2-scope lanes complete" with explicit lane-set listed per manager. Distinguish R2-scope completion from manager-archives (Modeling/Impossible-Bugs archive; Substrate/PB continue into R3 with R3-scoped lanes — those don't gate R2 close). Both are P2 single-authority alignments; no scope change. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/briefs/r2-release-manager.md | 2 +- docs/briefs/r2-substrate-manager.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/briefs/r2-release-manager.md b/docs/briefs/r2-release-manager.md index 7207a0bd74b..886ac72f322 100644 --- a/docs/briefs/r2-release-manager.md +++ b/docs/briefs/r2-release-manager.md @@ -100,7 +100,7 @@ Release Manager doesn't author lane-level structural gates (those belong to lane - `velocity_tripwire_reporting_landed` — introduction:dissolution PR ratio surfaced to Director on integration-reflection cadence; ≥3:1 fires alert - `thesis_claim_coverage_mapping_refresh_landed` — `docs/thesis/r2-r3-thesis-mapping.md` refreshed as lanes close; per-claim disposition tracked - `release_doc_authority_v2_guardrail_landed` — structured release-state.yaml + projection-checker; foot-gun pinned-limitation test flips to contract assertion -- `r2_close_signal_to_director_authored` — when all 5 R2-archiving managers (Substrate-prereq side / Modeling / Grounding / Impossible-Bugs / Evaluator) close their lanes, manager surfaces R2-close signal + R3 continuation readiness signal to Director +- `r2_close_signal_to_director_authored` — when **all 6 other managers' R2-scope lanes are complete** (Substrate R2 sub-lanes incl. T-Substrate-Lens-Primitive + B4 / Modeling 4 items / Grounding 11 lanes / Impossible-Bugs 3 classes / Pure Bootstrap R2 lanes incl. Tier 3 mirror dissolutions + kernel_algebra_profile / Evaluator 5 sub-lanes), manager surfaces R2-close signal + R3 continuation readiness signal to Director. **Distinguishing R2-scope-complete from manager-archives:** Modeling and Impossible-Bugs Managers archive at R2 close; Substrate and PB Managers continue into R3 with R3-scoped lanes (T-Int128 / T-Anthropic-Wire / T-CostLens-Composition for Substrate; T-LensProducer-Retirement / T-FixedPoint / T-Tier3-Dissolution / 3 distributed bridges for PB). The R2 close gate fires on R2-scope completion, not on archive — PB's R2 lanes (Tier 3 mirror dissolutions, kernel_algebra_profile consumer plumbing) must be complete; PB's R3 continuation lanes do not gate R2 close. ## Sub-briefs (authored / pending) diff --git a/docs/briefs/r2-substrate-manager.md b/docs/briefs/r2-substrate-manager.md index 3373382e6d2..820aa640927 100644 --- a/docs/briefs/r2-substrate-manager.md +++ b/docs/briefs/r2-substrate-manager.md @@ -103,18 +103,18 @@ Dispatch sequence: **PR-PreF lands first** (foundational substrate; everything e ## Cross-program dependencies -**Produces (5 carrier-readiness signals):** +**Produces (6 carrier-readiness signals):** - Cardinality-for-int-lit → Modeling Manager (int-lit; via PR-PreF Interval) - Nominal-opaque-for-Secret → Modeling Manager (Secret) - Parametric-algebra-for-Dimensions → Modeling Manager (Dimensions; via existing `phantom_params`) - ValueBody-list/sum + std.unicode → Modeling Manager (charclass phase-2) + Grounding Manager (Coercion-Fold sub-lane) +- **ValueBody::Map carrier read-path/API + arrow-body evaluation** → Pure Bootstrap Manager (`kernel_algebra_profile` mirror dissolution). Substrate landed via #1017 + tightened #1068; consumer plumbing is the remaining produced signal. - **Lens primitive** → Evaluator Manager (implements `fold_lens`); Substrate Manager R3 continuation (T-CostLens-Composition consumes) **Consumes:** none in R2 (Substrate is the substrate). R3 continuation consumes its own R2 output (Lens primitive) plus Evaluator's `fold_lens` runtime. **Adjacent territory:** - B4's §0.7 file-preference rank carrier touches Pure Bootstrap territory. Coordinate with Pure Bootstrap Manager. -- `kernel_algebra_profile` mirror dissolution is map-shaped (not list/sum) — tracked as future T-Substrate sub-lane requiring `ValueBody::Map` substrate work; PB Manager consumes when it lands. - **Diagnostic-kind extensibility (Q6 lock)** — Evaluator Manager extends `Diagnostic.kind` for structural-validation failures. Substrate Manager owns the `CompilerDiagnosticKind` sum; cross-manager coordination at extension time. Known limitation: current substrate is closed sum, tracked under v2 follow-up. ## Locked design decisions consumed (per #1078 8-question dialogue) @@ -147,7 +147,7 @@ Full disposition: [`docs/r2-structure.md`](../r2-structure.md) §4 + [`docs/desi ## Reporting cadence - Sub-lane / Phase close → R2 Release Manager (closure ledger). Each sub-lane's structural acceptance gate (per the **structural-acceptance-per-lane-close discipline** in `r2-structure.md`) IS the demo. -- Cross-program signals (5 carrier-readiness for 5 carriers) → cross-manager queue (consuming managers ack and dispatch consumer-migration work). +- Cross-program signals (6 carrier-readiness for 6 carriers) → cross-manager queue (consuming managers ack and dispatch consumer-migration work). - Blockers + scope changes → Director. - **Weekly health surfacing to Director:** which sub-lanes within 1 step of unblocking, which workers fill vs. ready, which cadence PRs (PR-PreF/PR-I/PR-K) landed vs pending, R3 continuation readiness signal. From cb05ecee8d138cdeab1811bbfeaa28fe8fe4ffa4 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 28 Apr 2026 20:13:37 -0400 Subject: [PATCH 10/22] WIP: Gunbc PM --- scripts/check-manager-brief-authority.sh | 345 +++++++++++++++++++++++ 1 file changed, 345 insertions(+) create mode 100755 scripts/check-manager-brief-authority.sh diff --git a/scripts/check-manager-brief-authority.sh b/scripts/check-manager-brief-authority.sh new file mode 100755 index 00000000000..59c12e231c0 --- /dev/null +++ b/scripts/check-manager-brief-authority.sh @@ -0,0 +1,345 @@ +#!/usr/bin/env bash +# Manager-brief authority consumer — verifies that R2 manager briefs +# cite live authorities and use consistent projections across briefs. +# +# Authority: gpt-5-5-pro meta-review on PR #1126 (2026-04-29) + +# `docs/r2-structure.md` §v2-guardrail-requirement-3. +# +# Scope: dissolves the "non-live authority consumed as live" pattern +# that recurred 5+ times during PR #1078 + #1126 review loops (codex +# tooling false-positives + cursor-flagged single-authority drift). +# v1 covers 4 of gpt-5-5-pro's 5 questions: +# Q1 — cited parent authority file existence +# Q2 — cited section anchor existence (§"section name" + path#anchor) +# Q4 — `LANDED via #N` PR is reachable in this branch's history +# Q5 — cross-brief lane-count / manager-count projections agree +# Q3 (controlled status vocabulary) deferred to v2 — too subjective +# for v1; named below as the next narrowing opportunity. +# +# Exit codes: +# 0 — no violations +# 1 — at least one violation + +set -euo pipefail + +ROOT="$(cd "$(dirname "$0")/.." && pwd)" +cd "$ROOT" + +# 7 R2 manager briefs (mirrors r2-structure.md §"Manager structure" +# count of 7 standing managers post-Evaluator-add 2026-04-28). +# Listed explicitly (not glob) so renames surface as violations +# rather than silently passing. +MANAGER_BRIEFS=( + "docs/briefs/r2-evaluator-manager.md" + "docs/briefs/r2-grounding-manager.md" + "docs/briefs/r2-impossible-bugs-manager.md" + "docs/briefs/r2-modeling-manager.md" + "docs/briefs/r2-pure-bootstrap-manager.md" + "docs/briefs/r2-release-manager.md" + "docs/briefs/r2-substrate-manager.md" +) + +violations=0 + +# --------------------------------------------------------------------- +# Q1 — Cited file existence +# --------------------------------------------------------------------- +# Extract markdown links of form [text](path) where path is not a URL, +# not a fragment-only anchor, and not in a known excluded set; verify +# each path exists on disk relative to the brief's directory. + +check_q1_file_existence() { + local brief="$1" + local brief_dir + brief_dir="$(dirname "$brief")" + local brief_violations=0 + + # grep -oE extracts every (path) occurrence; we then strip wrapping + # and drop URLs / pure-anchor / external fragments. + while IFS= read -r raw_path; do + [ -z "$raw_path" ] && continue + + # Strip wrapping parens already done by grep capture; raw_path is + # path[#anchor] potentially. + local path_only="${raw_path%%#*}" + + # Skip URLs. + case "$path_only" in + http://*|https://*|mailto:*) continue ;; + esac + + # Skip pure-anchor (intra-doc) links. + [ -z "$path_only" ] && continue + + # Resolve relative to brief's directory. + local resolved + if [[ "$path_only" = /* ]]; then + resolved="$ROOT$path_only" + else + resolved="$brief_dir/$path_only" + fi + + # Normalize ../ segments via realpath if available, else leave. + if command -v realpath >/dev/null 2>&1; then + resolved="$(realpath -m "$resolved" 2>/dev/null || echo "$resolved")" + fi + + if [ ! -e "$resolved" ]; then + echo "VIOLATION [Q1 file-existence]: $brief" + echo " cited path: $path_only" + echo " resolved: $resolved" + brief_violations=$((brief_violations + 1)) + fi + done < <(grep -oE '\]\([^)]+\)' "$brief" | sed -E 's/^\]\(//; s/\)$//') + + return $brief_violations +} + +# --------------------------------------------------------------------- +# Q2 — Cited section anchor existence +# --------------------------------------------------------------------- +# For `path#anchor` markdown links, verify the anchor matches a heading +# in the target file (heading slugified to GitHub form: lowercase, +# spaces→dashes, punctuation stripped). +# +# Also covers the `§"section name"` and `§N "section name"` prose form: +# grep for the section name in the most-recently-cited file in the +# same line. (Imperfect but catches the common case.) + +slugify() { + echo "$1" \ + | tr '[:upper:]' '[:lower:]' \ + | sed -E 's/[^a-z0-9 -]//g; s/ */-/g; s/--*/-/g; s/^-//; s/-$//' +} + +check_q2_anchor_existence() { + local brief="$1" + local brief_dir + brief_dir="$(dirname "$brief")" + local brief_violations=0 + + # Markdown anchor links: extract path#anchor pairs. + while IFS= read -r raw_link; do + [ -z "$raw_link" ] && continue + case "$raw_link" in + *"#"*) ;; + *) continue ;; + esac + + local path_only="${raw_link%%#*}" + local anchor="${raw_link#*#}" + + case "$path_only" in + http://*|https://*|mailto:*) continue ;; + esac + + # Skip intra-doc anchors and Markdown linkrefs without a path. + [ -z "$path_only" ] && continue + + local resolved + if [[ "$path_only" = /* ]]; then + resolved="$ROOT$path_only" + else + resolved="$brief_dir/$path_only" + fi + + if command -v realpath >/dev/null 2>&1; then + resolved="$(realpath -m "$resolved" 2>/dev/null || echo "$resolved")" + fi + + [ ! -f "$resolved" ] && continue # Q1 already reports missing files + + # Extract all heading slugs from target. + local found=0 + while IFS= read -r heading; do + heading="${heading#"${heading%%[![:space:]]*}"}" # ltrim + heading="${heading##\#* }" # strip leading #s + space + local slug + slug="$(slugify "$heading")" + if [ "$slug" = "$anchor" ]; then + found=1 + break + fi + done < <(grep -E '^#{1,6} ' "$resolved" || true) + + if [ "$found" = "0" ]; then + echo "VIOLATION [Q2 anchor-existence]: $brief" + echo " cited link: $path_only#$anchor" + echo " target file: $resolved" + echo " no heading slug matches '$anchor'" + brief_violations=$((brief_violations + 1)) + fi + done < <(grep -oE '\]\([^)#]+#[^)]+\)' "$brief" | sed -E 's/^\]\(//; s/\)$//') + + return $brief_violations +} + +# --------------------------------------------------------------------- +# Q4 — LANDED via #N PR-reachability check +# --------------------------------------------------------------------- +# Every `LANDED via #N` (or `landed via #N`) claim must correspond to +# a merge commit reachable from this branch's history. + +check_q4_landed_pr_in_history() { + local brief="$1" + local brief_violations=0 + + while IFS= read -r pr_num; do + [ -z "$pr_num" ] && continue + + # Match merge commit subject "(#N)" or "(...#N)" patterns. + if ! git log --all --oneline --grep="(#${pr_num})" 2>/dev/null | grep -q .; then + echo "VIOLATION [Q4 landed-pr-in-history]: $brief" + echo " cited claim: 'LANDED via #${pr_num}'" + echo " but no commit in branch history matches '(#${pr_num})'" + brief_violations=$((brief_violations + 1)) + fi + done < <(grep -oE '(LANDED|landed) via #[0-9]+' "$brief" | grep -oE '#[0-9]+' | tr -d '#' | sort -u) + + return $brief_violations +} + +# --------------------------------------------------------------------- +# Q5 — Cross-brief projection consistency +# --------------------------------------------------------------------- +# Manager count, R2 lane count, R3 lane count, R3-Evaluator-gated count +# all should agree across the briefs that mention them. Drift here is +# exactly the class gpt-5-5-pro flagged ("only manager continues to R3" +# vs PB also continues; "5 R2-archiving managers" vs all 6 managers). + +check_q5_cross_brief_projections() { + local brief_violations=0 + + # Pattern set: (label, regex extracting the count, expected canonical value). + # Canonical values match docs/r2-structure.md (manager count) and + # docs/r3-structure.md (lane counts) authority docs. + declare -a patterns=( + 'standing R2 managers|7|(\d+) standing R2 managers|standing R2 managers' + 'standing managers|7|(\d+) standing managers|standing managers' + 'other managers|6|(\d+) other managers|other managers' + 'R2 managers continuing into R3|2|(\d+)\s*R2 managers? continu|R2 managers continuing into R3' + 'R3 lanes|10|(\d+) R3 lanes|R3 lanes' + 'R3-Evaluator-gated lanes|7|(\d+) of 10 R3 lanes|R3-Evaluator-gated lanes' + ) + + for entry in "${patterns[@]}"; do + local label="${entry%%|*}" + local rest="${entry#*|}" + local canonical="${rest%%|*}" + rest="${rest#*|}" + local pattern="${rest%%|*}" + + declare -A counts_seen=() + local mismatch=0 + local mismatch_details="" + + for brief in "${MANAGER_BRIEFS[@]}"; do + while IFS= read -r match; do + [ -z "$match" ] && continue + # Extract the leading number from the matched substring. + local n + n="$(echo "$match" | grep -oE '^[0-9]+')" + [ -z "$n" ] && continue + counts_seen["$n"]="${counts_seen[$n]:-}${brief}; " + done < <(grep -oE "$pattern" "$brief" 2>/dev/null || true) + done + + if [ "${#counts_seen[@]}" -gt 1 ]; then + mismatch=1 + for n in "${!counts_seen[@]}"; do + mismatch_details+=" count=$n in: ${counts_seen[$n]}"$'\n' + done + fi + + if [ "$mismatch" = "1" ]; then + echo "VIOLATION [Q5 cross-brief-projection]: '$label' inconsistent across briefs" + echo " canonical value: $canonical" + echo " observed counts:" + printf "%s" "$mismatch_details" + brief_violations=$((brief_violations + 1)) + elif [ "${#counts_seen[@]}" -eq 1 ]; then + # Single value seen — verify it matches canonical. + local seen + seen="$(echo "${!counts_seen[@]}" | tr -d ' ')" + if [ "$seen" != "$canonical" ]; then + echo "VIOLATION [Q5 cross-brief-projection]: '$label' diverges from canonical" + echo " canonical value: $canonical" + echo " observed value: $seen" + echo " in: ${counts_seen[$seen]}" + brief_violations=$((brief_violations + 1)) + fi + fi + # If 0 counts seen, no brief mentions this projection — silent OK. + done + + return $brief_violations +} + +# --------------------------------------------------------------------- +# Driver: run all checks across all briefs. +# --------------------------------------------------------------------- + +# Fail-closed precheck: every configured brief must exist. +missing_briefs=() +for brief in "${MANAGER_BRIEFS[@]}"; do + if [ ! -f "$brief" ]; then + missing_briefs+=("$brief") + fi +done + +if [ "${#missing_briefs[@]}" -gt 0 ]; then + echo "Manager-brief authority check FAILED: ${#missing_briefs[@]} configured brief(s) missing." + echo "" + for brief in "${missing_briefs[@]}"; do + echo " MISSING: $brief" + done + echo "" + echo "Each missing brief was declared in MANAGER_BRIEFS in this script." + echo "Either the brief was renamed (update MANAGER_BRIEFS) or genuinely" + echo "retired (remove from MANAGER_BRIEFS with the same review attention" + echo "as adding a new manager)." + exit 1 +fi + +for brief in "${MANAGER_BRIEFS[@]}"; do + check_q1_file_existence "$brief" + rc=$? + violations=$((violations + rc)) + + check_q2_anchor_existence "$brief" + rc=$? + violations=$((violations + rc)) + + check_q4_landed_pr_in_history "$brief" + rc=$? + violations=$((violations + rc)) +done + +check_q5_cross_brief_projections +rc=$? +violations=$((violations + rc)) + +if [ "$violations" -gt 0 ]; then + echo "" + echo "Manager-brief authority check FAILED: $violations violation(s) found." + echo "" + echo "Each violation is a claim in a manager brief that does not match" + echo "live repo state. Either:" + echo " - the cited authority/PR/anchor genuinely doesn't exist → fix" + echo " the citation in the brief" + echo " - the canonical projection (manager count, lane count) drifted" + echo " → update the brief to match the authority doc" + echo " - the script's pattern set is wrong → update MANAGER_BRIEFS or" + echo " the patterns array with the same review attention as adding" + echo " a new authority claim" + echo "" + echo "Authority: gpt-5-5-pro meta-review on PR #1126;" + echo "docs/r2-structure.md §v2-guardrail-requirement-3" + exit 1 +fi + +echo "Manager-brief authority check passed: 7 briefs, no violations." +echo " Q1 (file existence): all cited paths resolve" +echo " Q2 (anchor existence): all path#anchor links match a heading" +echo " Q4 (LANDED via #N): all cited PRs reachable from branch" +echo " Q5 (cross-brief projection): manager/lane counts consistent" From 671e0795c8cd24a35128a389fc6f82c3e5629a6f Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 29 Apr 2026 00:18:34 +0000 Subject: [PATCH 11/22] feat(scripts): manager-brief authority consumer + self-test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per gpt-5-5-pro meta-review on PR #1126: dissolves the recurring "non-live authority consumed as live" pattern that surfaced 5+ times during PR #1078 + #1126 review loops (codex tooling false-positives naming non-existent files / sections; cursor-flagged single-authority drift on Goal numbering + R3 continuation count). v1 covers 4 of gpt-5-5-pro's 5 questions: - **Q1 — cited file existence** — extracts markdown links from each brief, resolves relative paths, fails closed if any cited file doesn't exist on disk. - **Q2 — cited section anchor existence** — for `path#anchor` links, verifies the anchor matches a slugified heading in the target file. - **Q4 — `LANDED via #N` reachability** — two-stage check: (a) fast `git log --grep="(#N)"` for normal merge subjects, (b) fall back to `gh pr view` for squash-merges that drop the suffix (caught a real case for PR #900). Verifies merge SHA is `git merge-base --is-ancestor HEAD`. - **Q5 — cross-brief projection consistency** — extracts manager/lane counts and verifies all briefs that mention a projection agree both cross-brief AND with canonical values from r2-structure.md / r3-structure.md (7 standing managers, 6 other managers, 10 R3 lanes, 7 of 10 Evaluator-gated). Catches drift like "5 R2-archiving managers" vs "all 6 other managers". Q3 (controlled status vocabulary) deferred to v2 — too subjective for a mechanical check; tracked in script header as next narrowing. **Self-test** (`scripts/test-check-manager-brief-authority.sh`): 7 contract assertions — negative cases for each of Q1/Q2/Q4/Q5 (×2) + fail-closed-on-missing-brief + positive case. Mirrors the `test-check-release-doc-authority.sh` pattern. **Wiring:** - Makefile: `manager-brief-authority-check` + `-test` targets; `verify` runs the check. - CI workflow: both check + self-test wired as named steps; check receives `GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}` for the gh API fallback in Q4. **SIGPIPE under pipefail caveat documented inline:** `grep -q .` on a piped `git log` causes pipefail to report failure (grep exits early, git log gets SIGPIPE 141). Workaround: capture output and test `-z`/`-n`. Pinned in Q4 implementation comment. Closes the convergence move gpt-5-5-pro proposed; future review loops that hit the same "non-live authority" class get caught at CI rather than reviewer-by-reviewer prose iteration. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ci.yml | 15 + Makefile | 17 +- scripts/check-manager-brief-authority.sh | 63 ++-- scripts/test-check-manager-brief-authority.sh | 283 ++++++++++++++++++ 4 files changed, 359 insertions(+), 19 deletions(-) create mode 100755 scripts/test-check-manager-brief-authority.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e40ad80df31..b052a3a0207 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,6 +75,21 @@ jobs: # neutering the consumer. run: bash scripts/test-check-release-doc-authority.sh + - name: Manager-brief authority check (P2 single-authority discipline) + # Verifies 7 R2 manager briefs cite live authorities and use + # consistent projections. Q1 (file existence) + Q2 (anchor + # existence) + Q4 (LANDED via #N reachability) + Q5 (cross-brief + # lane-count consistency). Authority: gpt-5-5-pro meta-review + # on PR #1126. + run: bash scripts/check-manager-brief-authority.sh + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Manager-brief authority self-test (consumer not ceremonial) + # Prevents future MANAGER_BRIEFS or pattern-set changes from + # silently neutering the consumer. + run: bash scripts/test-check-manager-brief-authority.sh + - name: Setup Rust uses: actions-rust-lang/setup-rust-toolchain@v1.16.0 with: diff --git a/Makefile b/Makefile index d4f8aa93ac7..95be064456f 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ .DEFAULT_GOAL := help -.PHONY: help preflight-fix ensure-codegen build-release-bins lint-upsert codegen build clean testgen testgen-check bootstrap-check verify verify-fix fmt-fix lint-fix test-all test test-xs test-s test-m test-l test-xl test-small test-medium test-large test-extra-large test-integration test-external check clippy fmt fmt-check test-fix check-fix clippy-fix bootstrap bootstrap-dry build-all build-all-dry design design-dry gist gist-dry gist-diff gist-diff-dry gist-recent gist-recent-dry infra infra-dry readme readme-dry workflow workflow-dry ci release-doc-authority-check release-doc-authority-test +.PHONY: help preflight-fix ensure-codegen build-release-bins lint-upsert codegen build clean testgen testgen-check bootstrap-check verify verify-fix fmt-fix lint-fix test-all test test-xs test-s test-m test-l test-xl test-small test-medium test-large test-extra-large test-integration test-external check clippy fmt fmt-check test-fix check-fix clippy-fix bootstrap bootstrap-dry build-all build-all-dry design design-dry gist gist-dry gist-diff gist-diff-dry gist-recent gist-recent-dry infra infra-dry readme readme-dry workflow workflow-dry ci release-doc-authority-check release-doc-authority-test manager-brief-authority-check manager-brief-authority-test # Preflight: auto-fix rustc warnings before running generators preflight-fix: @@ -57,6 +57,7 @@ verify: lint-upsert @$(MAKE) bootstrap-check @$(MAKE) testgen-check @$(MAKE) release-doc-authority-check + @$(MAKE) manager-brief-authority-check # Release-doc authority consumer — fails if forbidden stale concept names # appear in live (non-retraction) sections of release-control docs. @@ -70,6 +71,20 @@ release-doc-authority-check: release-doc-authority-test: @bash scripts/test-check-release-doc-authority.sh +# Manager-brief authority consumer — verifies that the 7 R2 manager +# briefs cite live authorities and use consistent projections. +# Q1 (file existence) + Q2 (anchor existence) + Q4 (LANDED via #N +# reachability) + Q5 (cross-brief lane-count consistency). +# Authority: gpt-5-5-pro meta-review on PR #1126. +manager-brief-authority-check: + @bash scripts/check-manager-brief-authority.sh + +# Self-test for the manager-brief authority consumer. Without this, +# future MANAGER_BRIEFS or pattern-set changes could silently neuter +# the consumer. +manager-brief-authority-test: + @bash scripts/test-check-manager-brief-authority.sh + # Ensure generated artifacts are up to date verify-fix: lint-upsert @RUSTFLAGS="-D warnings" cargo run -p gunbc-codegen --bin gunbc-bootstrap diff --git a/scripts/check-manager-brief-authority.sh b/scripts/check-manager-brief-authority.sh index 59c12e231c0..3d7baedcb81 100755 --- a/scripts/check-manager-brief-authority.sh +++ b/scripts/check-manager-brief-authority.sh @@ -187,13 +187,38 @@ check_q4_landed_pr_in_history() { while IFS= read -r pr_num; do [ -z "$pr_num" ] && continue - # Match merge commit subject "(#N)" or "(...#N)" patterns. - if ! git log --all --oneline --grep="(#${pr_num})" 2>/dev/null | grep -q .; then - echo "VIOLATION [Q4 landed-pr-in-history]: $brief" - echo " cited claim: 'LANDED via #${pr_num}'" - echo " but no commit in branch history matches '(#${pr_num})'" - brief_violations=$((brief_violations + 1)) + # Two-stage check (squash-merges drop the "(#N)" subject suffix on + # some PRs — see d9bade38f for #900 — so a pure git-log grep gives + # false negatives). Capture explicitly to avoid SIGPIPE under + # pipefail (grep -q exits early, kills upstream git-log). + # + # Stage 1: fast pure-git grep for the common "(#N)" merge subject. + local matches + matches="$(git log --all --oneline --grep="(#${pr_num})" 2>/dev/null || true)" + if [ -n "$matches" ]; then + continue fi + + # Stage 2: fall back to gh API (handles squash-merges with no + # subject suffix). Resolves the merge commit SHA, then verifies + # the SHA is reachable from HEAD. + if command -v gh >/dev/null 2>&1; then + local merge_sha + merge_sha="$(gh pr view "$pr_num" --json mergeCommit --jq '.mergeCommit.oid' 2>/dev/null || true)" + if [ -n "$merge_sha" ] && [ "$merge_sha" != "null" ]; then + if git cat-file -e "$merge_sha" 2>/dev/null && \ + git merge-base --is-ancestor "$merge_sha" HEAD 2>/dev/null; then + continue + fi + fi + fi + + echo "VIOLATION [Q4 landed-pr-in-history]: $brief" + echo " cited claim: 'LANDED via #${pr_num}'" + echo " PR is not reachable from HEAD via either:" + echo " - merge subject containing '(#${pr_num})'" + echo " - gh pr view #${pr_num}'s merge commit being an ancestor of HEAD" + brief_violations=$((brief_violations + 1)) done < <(grep -oE '(LANDED|landed) via #[0-9]+' "$brief" | grep -oE '#[0-9]+' | tr -d '#' | sort -u) return $brief_violations @@ -210,24 +235,26 @@ check_q4_landed_pr_in_history() { check_q5_cross_brief_projections() { local brief_violations=0 - # Pattern set: (label, regex extracting the count, expected canonical value). + # Pattern set: (label, canonical value, POSIX-extended regex). + # Encoding is "label||canonical||regex" using "||" as field separator + # to avoid colliding with the regex's own characters. # Canonical values match docs/r2-structure.md (manager count) and # docs/r3-structure.md (lane counts) authority docs. + # Regex must use POSIX-extended (bash grep -E): [0-9]+, not \d+. declare -a patterns=( - 'standing R2 managers|7|(\d+) standing R2 managers|standing R2 managers' - 'standing managers|7|(\d+) standing managers|standing managers' - 'other managers|6|(\d+) other managers|other managers' - 'R2 managers continuing into R3|2|(\d+)\s*R2 managers? continu|R2 managers continuing into R3' - 'R3 lanes|10|(\d+) R3 lanes|R3 lanes' - 'R3-Evaluator-gated lanes|7|(\d+) of 10 R3 lanes|R3-Evaluator-gated lanes' + 'standing R2 managers||7||[0-9]+ standing R2 managers' + 'standing managers||7||[0-9]+ standing managers' + 'other managers||6||[0-9]+ other managers' + 'R3 lanes||10||[0-9]+ R3 lanes' + 'R3-Evaluator-gated lanes||7||[0-9]+ of 10 R3 lanes' ) for entry in "${patterns[@]}"; do - local label="${entry%%|*}" - local rest="${entry#*|}" - local canonical="${rest%%|*}" - rest="${rest#*|}" - local pattern="${rest%%|*}" + # Field separator is "||" (double-pipe) so single | in regex is safe. + local label="${entry%%||*}" + local rest="${entry#*||}" + local canonical="${rest%%||*}" + local pattern="${rest#*||}" declare -A counts_seen=() local mismatch=0 diff --git a/scripts/test-check-manager-brief-authority.sh b/scripts/test-check-manager-brief-authority.sh new file mode 100755 index 00000000000..543099234d9 --- /dev/null +++ b/scripts/test-check-manager-brief-authority.sh @@ -0,0 +1,283 @@ +#!/usr/bin/env bash +# Self-test for scripts/check-manager-brief-authority.sh. +# +# Why: without this, future changes to MANAGER_BRIEFS or the Q1/Q2/Q4/Q5 +# pattern set could silently neuter the consumer (broaden patterns until +# everything passes, drop briefs from MANAGER_BRIEFS, etc.) and the +# guardrail would become ceremonial. Per-question isolation negative +# tests prove every check is caught individually. +# +# Exit codes: +# 0 — all assertions verified +# 1 — at least one assertion failed (consumer is broken) + +set -euo pipefail + +ROOT="$(cd "$(dirname "$0")/.." && pwd)" +cd "$ROOT" + +CONSUMER="scripts/check-manager-brief-authority.sh" +TMPDIR="$(mktemp -d)" +trap "rm -rf $TMPDIR" EXIT + +# Copy the consumer + setup tmp git repo + 7 brief stubs. +mkdir -p "$TMPDIR/scripts" +cp "$CONSUMER" "$TMPDIR/scripts/" +TEST_CONSUMER="$TMPDIR/scripts/$(basename "$CONSUMER")" + +mkdir -p "$TMPDIR/docs/briefs" "$TMPDIR/docs/thesis" + +# Init a tmp git repo with one synthetic merge commit "(#999)" so Q4 +# positive tests have something to find via git log without needing +# network access to gh. +( + cd "$TMPDIR" + git init -q + git config user.email "test@test.local" + git config user.name "Test" + echo "seed" > seed.txt + git add seed.txt + git commit -q -m "test commit subject (#999)" +) + +# Seed authority files referenced by the briefs. +cat > "$TMPDIR/docs/r2-structure.md" <<'EOF' +# R2 Structure + +## Goal 1 +EOF + +cat > "$TMPDIR/docs/r3-structure.md" <<'EOF' +# R3 Structure +EOF + +cat > "$TMPDIR/docs/thesis/r2-r3-thesis-mapping.md" <<'EOF' +# Thesis Mapping +EOF + +# Helper: write 7 minimal briefs, optionally overriding one with custom content. +write_clean_briefs() { + local override_brief="${1:-}" + local override_content="${2:-}" + + for name in evaluator grounding impossible-bugs modeling pure-bootstrap release substrate; do + local brief="$TMPDIR/docs/briefs/r2-${name}-manager.md" + if [ "r2-${name}-manager.md" = "$override_brief" ]; then + printf "%s" "$override_content" > "$brief" + else + cat > "$brief" </dev/null 2>&1; then + cd "$ROOT" + echo "FAIL [Q1/missing-file]: consumer passed on a fixture with a missing cited file" + return 1 + fi + cd "$ROOT" + return 0 +} + +# --------------------------------------------------------------------- +# Q2 — anchor-existence negative test +# --------------------------------------------------------------------- + +test_negative_q2_missing_anchor() { + write_clean_briefs "r2-evaluator-manager.md" \ + "# Brief\n\nReferences [r2-structure with bogus anchor](../r2-structure.md#nonexistent-anchor) — should fail Q2." + + cd "$TMPDIR" + if bash "$TEST_CONSUMER" >/dev/null 2>&1; then + cd "$ROOT" + echo "FAIL [Q2/missing-anchor]: consumer passed on a fixture with a bogus anchor" + return 1 + fi + cd "$ROOT" + return 0 +} + +# --------------------------------------------------------------------- +# Q4 — LANDED-PR-not-in-history negative test +# --------------------------------------------------------------------- +# A claim "LANDED via #88888888" must fail because the tmp repo's only +# merge commit is "(#999)". The fall-back gh API call will return null +# for an obviously-unreachable PR number against the tmp repo's origin +# (which is unset), so the assertion fires. + +test_negative_q4_unreachable_pr() { + write_clean_briefs "r2-evaluator-manager.md" \ + "# Brief\n\nClaims work LANDED via #88888888 (unreachable in tmp repo) — should fail Q4." + + cd "$TMPDIR" + if bash "$TEST_CONSUMER" >/dev/null 2>&1; then + cd "$ROOT" + echo "FAIL [Q4/unreachable-pr]: consumer passed on a fixture with an unreachable PR claim" + return 1 + fi + cd "$ROOT" + return 0 +} + +# --------------------------------------------------------------------- +# Q5 — cross-brief projection mismatch negative test +# --------------------------------------------------------------------- +# Have one brief say "5 standing R2 managers" while others say 7. +# The mismatch must be reported. + +test_negative_q5_count_mismatch() { + # Default briefs say "7 standing R2 managers"; override one to say 5. + write_clean_briefs "r2-evaluator-manager.md" \ + "# Brief\n\nReferences [r2-structure](../r2-structure.md).\n\nManager count: 5 standing R2 managers (intentional drift)." + + cd "$TMPDIR" + if bash "$TEST_CONSUMER" >/dev/null 2>&1; then + cd "$ROOT" + echo "FAIL [Q5/count-mismatch]: consumer passed on a fixture with mismatched manager counts" + return 1 + fi + cd "$ROOT" + return 0 +} + +# --------------------------------------------------------------------- +# Q5 — divergent-from-canonical negative test +# --------------------------------------------------------------------- +# All briefs agree on "5 standing R2 managers" — agreement is preserved +# but it diverges from canonical (7). + +test_negative_q5_divergent_from_canonical() { + for name in evaluator grounding impossible-bugs modeling pure-bootstrap release substrate; do + cat > "$TMPDIR/docs/briefs/r2-${name}-manager.md" </dev/null 2>&1; then + cd "$ROOT" + echo "FAIL [Q5/divergent-from-canonical]: consumer passed on a fixture where all briefs agree on a non-canonical value" + return 1 + fi + cd "$ROOT" + return 0 +} + +# --------------------------------------------------------------------- +# Fail-closed precheck — missing brief test +# --------------------------------------------------------------------- + +test_negative_missing_brief_fails_closed() { + write_clean_briefs + rm "$TMPDIR/docs/briefs/r2-evaluator-manager.md" + + cd "$TMPDIR" + local output + if output="$(bash "$TEST_CONSUMER" 2>&1)"; then + exit_code=0 + else + exit_code=$? + fi + cd "$ROOT" + + if [ "$exit_code" -eq 0 ]; then + echo "FAIL [missing-brief]: consumer passed with one brief missing" + return 1 + fi + if ! echo "$output" | grep -q "MISSING: docs/briefs/r2-evaluator-manager.md"; then + echo "FAIL [missing-brief]: consumer failed but didn't name the missing brief" + echo " Expected output to contain: 'MISSING: docs/briefs/r2-evaluator-manager.md'" + echo " Actual output:" + echo "$output" | sed 's/^/ /' + return 1 + fi + return 0 +} + +# --------------------------------------------------------------------- +# Positive case — all 7 briefs clean, all 4 questions pass +# --------------------------------------------------------------------- + +test_positive_all_clean() { + write_clean_briefs + + cd "$TMPDIR" + local output exit_code + if output="$(bash "$TEST_CONSUMER" 2>&1)"; then + exit_code=0 + else + exit_code=$? + fi + cd "$ROOT" + + if [ "$exit_code" -ne 0 ]; then + echo "FAIL [positive]: consumer rejected a clean fixture" + echo " output:" + echo "$output" | sed 's/^/ /' + return 1 + fi + if ! echo "$output" | grep -q "no violations"; then + echo "FAIL [positive]: consumer didn't print success message on clean fixture" + return 1 + fi + return 0 +} + +# --------------------------------------------------------------------- +# Driver +# --------------------------------------------------------------------- + +failures=0 + +for test_fn in \ + test_negative_q1_missing_file \ + test_negative_q2_missing_anchor \ + test_negative_q4_unreachable_pr \ + test_negative_q5_count_mismatch \ + test_negative_q5_divergent_from_canonical \ + test_negative_missing_brief_fails_closed; do + echo "Test ($test_fn): negative case should fail consumer..." + if "$test_fn"; then + echo " PASS" + else + failures=$((failures + 1)) + fi +done + +echo "Test (positive): clean fixture should pass consumer..." +if test_positive_all_clean; then + echo " PASS" +else + failures=$((failures + 1)) +fi + +if [ "$failures" -gt 0 ]; then + echo "" + echo "Self-test FAILED: $failures contract assertion(s) failed." + echo "The consumer at $CONSUMER is not enforcing its declared contract." + exit 1 +fi + +echo "" +echo "Self-test PASSED: 7 contract assertions verified" +echo " (5 negative — Q1/Q2/Q4/Q5×2 + missing-brief; 1 positive — clean fixture)" From d8cf2fa18f2560d09dc486f47b44cf7c284deb20 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 29 Apr 2026 00:22:21 +0000 Subject: [PATCH 12/22] =?UTF-8?q?fix(scripts):=20manager-brief=20Q4=20?= =?UTF-8?q?=E2=80=94=20gh-first=20for=20CI=20shallow-clone=20compat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI failed on the first run of the checker because the workflow uses fetch-depth=1 (shallow clone), so the Q4 fall-back stage's git-log --grep="(#N)" can't see merge history. The two-stage check worked locally because git log had full history; in CI it found nothing on either stage. Restructure Q4 to gh-first: - **Stage 1 (primary):** gh pr view N --json state — returns MERGED for actually-merged PRs regardless of clone depth or squash-merge subject variance. CI passes GH_TOKEN automatically. - **Stage 2 (fallback):** git log --grep — kept for offline dev / auth-blocked environments. In CI with fetch-depth=1 this stage finds nothing; that's why Stage 1 is primary. Reasoning: "is this PR actually merged" is what we want to verify; gh state=MERGED answers it directly. The previous git-log+ancestor check was defense-in-depth, but actually fragile in shallow clones which is the CI default. Co-Authored-By: Claude Opus 4.7 (1M context) --- scripts/check-manager-brief-authority.sh | 50 +++++++++++++----------- 1 file changed, 28 insertions(+), 22 deletions(-) diff --git a/scripts/check-manager-brief-authority.sh b/scripts/check-manager-brief-authority.sh index 3d7baedcb81..5d7da6658cf 100755 --- a/scripts/check-manager-brief-authority.sh +++ b/scripts/check-manager-brief-authority.sh @@ -187,37 +187,43 @@ check_q4_landed_pr_in_history() { while IFS= read -r pr_num; do [ -z "$pr_num" ] && continue - # Two-stage check (squash-merges drop the "(#N)" subject suffix on - # some PRs — see d9bade38f for #900 — so a pure git-log grep gives - # false negatives). Capture explicitly to avoid SIGPIPE under - # pipefail (grep -q exits early, kills upstream git-log). + # Two-stage check ordered for CI compatibility (CI uses + # fetch-depth=1 shallow clone, so git-log can't see merge history; + # gh API works regardless of clone depth). # - # Stage 1: fast pure-git grep for the common "(#N)" merge subject. + # Capture all output explicitly — don't pipe to grep -q under + # pipefail (grep -q exits early on first match, causes SIGPIPE + # on upstream git-log, pipefail reports pipeline failure). + # + # Stage 1 (primary): gh pr view — works in shallow clone, robust + # to squash-merge subject variance (PR #900 was squash-merged + # without "(#900)" suffix; pure git-grep would miss it). + local pr_state="" + if command -v gh >/dev/null 2>&1; then + pr_state="$(gh pr view "$pr_num" --json state --jq '.state' 2>/dev/null || true)" + if [ "$pr_state" = "MERGED" ]; then + continue + fi + fi + + # Stage 2 (fallback): pure-git grep for "(#N)" merge subject. + # Used when gh is unavailable (offline dev) or auth-blocked. + # In CI with fetch-depth=1 this stage finds nothing — that's + # why Stage 1 is primary. local matches matches="$(git log --all --oneline --grep="(#${pr_num})" 2>/dev/null || true)" if [ -n "$matches" ]; then continue fi - # Stage 2: fall back to gh API (handles squash-merges with no - # subject suffix). Resolves the merge commit SHA, then verifies - # the SHA is reachable from HEAD. - if command -v gh >/dev/null 2>&1; then - local merge_sha - merge_sha="$(gh pr view "$pr_num" --json mergeCommit --jq '.mergeCommit.oid' 2>/dev/null || true)" - if [ -n "$merge_sha" ] && [ "$merge_sha" != "null" ]; then - if git cat-file -e "$merge_sha" 2>/dev/null && \ - git merge-base --is-ancestor "$merge_sha" HEAD 2>/dev/null; then - continue - fi - fi - fi - echo "VIOLATION [Q4 landed-pr-in-history]: $brief" echo " cited claim: 'LANDED via #${pr_num}'" - echo " PR is not reachable from HEAD via either:" - echo " - merge subject containing '(#${pr_num})'" - echo " - gh pr view #${pr_num}'s merge commit being an ancestor of HEAD" + echo " PR is not in MERGED state via either:" + echo " - gh pr view #${pr_num} returning state=MERGED" + echo " - git log finding a merge subject '(#${pr_num})'" + if [ -n "$pr_state" ] && [ "$pr_state" != "MERGED" ]; then + echo " - gh reports state=${pr_state}" + fi brief_violations=$((brief_violations + 1)) done < <(grep -oE '(LANDED|landed) via #[0-9]+' "$brief" | grep -oE '#[0-9]+' | tr -d '#' | sort -u) From c69a0eaedf3a4c42eedac553faf5b6deacd8398d Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 29 Apr 2026 00:24:36 +0000 Subject: [PATCH 13/22] =?UTF-8?q?fix(scripts):=20manager-brief=20check=20?= =?UTF-8?q?=E2=80=94=20set=20-e=20+=20return=20interaction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per claude-opus-4-7 review on PR #1126: three non-blocking findings addressed. 1. **set -e + return non-zero**: the per-brief driver loop used `check_q1_file_existence "$brief"; rc=$?` — under set -euo pipefail, a function returning non-zero is treated as a failed command and exits the script before the accumulator runs. Result was "stop at first failing brief," not "report all violations in one pass" as intended. Fix: use `|| rc=$?` form (with explicit `rc=0` reset). This keeps set -e from firing on expected-non-zero returns while still capturing the count. 2. **Q2 doc/code mismatch**: header comment promised both `path#anchor` markdown form AND `§"section name"` prose form. Implementation only handled markdown. Trim the comment to match the code; track prose-form in v2 follow-up alongside Q3 status-vocabulary as next narrowing. 3. **Q5 pattern overlap (exploratory)**: claude-opus-4-7 flagged that "standing managers" might substring-match "standing R2 managers". Empirical check shows it doesn't (POSIX regex requires the exact "standing managers" sequence; "R2 " breaks the match). Documented inline; no pattern change needed. 8-bit return-code truncation noted by reviewer is theoretical at current scale (briefs typically have <10 violations) and is now moot since the global `violations` accumulator is plain bash arithmetic; only the per-function `return` is uint8-bounded. Co-Authored-By: Claude Opus 4.7 (1M context) --- scripts/check-manager-brief-authority.sh | 44 +++++++++++++++++------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/scripts/check-manager-brief-authority.sh b/scripts/check-manager-brief-authority.sh index 5d7da6658cf..d8c27fb35fa 100755 --- a/scripts/check-manager-brief-authority.sh +++ b/scripts/check-manager-brief-authority.sh @@ -96,15 +96,16 @@ check_q1_file_existence() { } # --------------------------------------------------------------------- -# Q2 — Cited section anchor existence +# Q2 — Cited section anchor existence (markdown form only) # --------------------------------------------------------------------- # For `path#anchor` markdown links, verify the anchor matches a heading # in the target file (heading slugified to GitHub form: lowercase, # spaces→dashes, punctuation stripped). # -# Also covers the `§"section name"` and `§N "section name"` prose form: -# grep for the section name in the most-recently-cited file in the -# same line. (Imperfect but catches the common case.) +# Out of scope for v1: `§"section name"` prose-form citations. They're +# common in the briefs but parsing "what file does this prose § +# reference" requires more context than a regex can give. v2 candidate; +# tracked alongside Q3 status-vocabulary as the next narrowing. slugify() { echo "$1" \ @@ -247,9 +248,16 @@ check_q5_cross_brief_projections() { # Canonical values match docs/r2-structure.md (manager count) and # docs/r3-structure.md (lane counts) authority docs. # Regex must use POSIX-extended (bash grep -E): [0-9]+, not \d+. + # + # Per claude-opus-4-7 review: empirical check confirms the bare + # "standing managers" pattern does NOT substring-match + # "standing R2 managers" — the regex requires "managers" + # immediately after "standing" with one space, which "R2 " breaks. + # The two patterns coexist as separate constraints; if a brief + # uses either phrasing the count must match canonical (7). declare -a patterns=( 'standing R2 managers||7||[0-9]+ standing R2 managers' - 'standing managers||7||[0-9]+ standing managers' + 'standing managers (no R2 qualifier)||7||[0-9]+ standing managers' 'other managers||6||[0-9]+ other managers' 'R3 lanes||10||[0-9]+ R3 lanes' 'R3-Evaluator-gated lanes||7||[0-9]+ of 10 R3 lanes' @@ -334,22 +342,32 @@ if [ "${#missing_briefs[@]}" -gt 0 ]; then exit 1 fi +# Drive the per-brief checks. Use `|| rc=$?` to prevent `set -e` from +# exiting on a function that returns non-zero — we WANT to keep going +# and report all violations across all briefs in a single run, not +# stop at the first failing one. (Without `||`, `set -e` treats the +# function call's non-zero return as a failed command.) +# +# The functions still return uint8 via `return $brief_violations`, but +# we read it via $? immediately and accumulate into the global +# `violations` int — which is plain bash arithmetic and not bounded +# to 8 bits. This sidesteps the 256-violation truncation foot-gun. for brief in "${MANAGER_BRIEFS[@]}"; do - check_q1_file_existence "$brief" - rc=$? + rc=0 + check_q1_file_existence "$brief" || rc=$? violations=$((violations + rc)) - check_q2_anchor_existence "$brief" - rc=$? + rc=0 + check_q2_anchor_existence "$brief" || rc=$? violations=$((violations + rc)) - check_q4_landed_pr_in_history "$brief" - rc=$? + rc=0 + check_q4_landed_pr_in_history "$brief" || rc=$? violations=$((violations + rc)) done -check_q5_cross_brief_projections -rc=$? +rc=0 +check_q5_cross_brief_projections || rc=$? violations=$((violations + rc)) if [ "$violations" -gt 0 ]; then From ea33aeb9d97755362a5fcac3188453f2e1d39540 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 29 Apr 2026 00:27:09 +0000 Subject: [PATCH 14/22] =?UTF-8?q?fix(scripts):=20manager-brief=20Q4=20?= =?UTF-8?q?=E2=80=94=20explicit=20--repo=20for=20CI=20gh=20detection?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI failed Q4 even after gh-first restructure: actions/checkout@v4's shallow clone exposes the remote in a form 'gh pr view' doesn't always auto-detect, so the stage-1 gh call returned empty (no error message in v1 because stderr was redirected to /dev/null) and the stage-2 git-log fallback also failed (shallow clone has no merge history). Three fixes in this commit: 1. **Derive REPO_SLUG from `git config remote.origin.url`** at script start. Falls back to "gunb-ai/gunbc" if origin isn't readable (self-test runs in tmpdir with no remote). 2. **Pass `--repo "$REPO_SLUG"` explicitly to `gh pr view`** so it doesn't have to infer from the cwd's git remote. 3. **Capture gh stderr** to a temp file and surface it in the violation diagnostic. If gh is auth-failing or rate-limited, the violation message now shows why instead of looking like "PR doesn't exist." Both checker + self-test still pass locally. CI should now succeed. Co-Authored-By: Claude Opus 4.7 (1M context) --- scripts/check-manager-brief-authority.sh | 28 +++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/scripts/check-manager-brief-authority.sh b/scripts/check-manager-brief-authority.sh index d8c27fb35fa..164439ed6b1 100755 --- a/scripts/check-manager-brief-authority.sh +++ b/scripts/check-manager-brief-authority.sh @@ -25,6 +25,19 @@ set -euo pipefail ROOT="$(cd "$(dirname "$0")/.." && pwd)" cd "$ROOT" +# Derive the GitHub repo slug for `gh pr view --repo`. Required in CI +# because `actions/checkout@v4`'s shallow clone may not expose the +# remote in a form `gh` auto-detects (CI ran `gh pr view 1080` and got +# nothing, even though locally the same call returns state=MERGED). +# Falls back to "gunb-ai/gunbc" if origin isn't readable (e.g., +# self-test tmpdir with no remote set). +REPO_SLUG="$(git config --get remote.origin.url 2>/dev/null \ + | sed -E 's#.*github\.com[:/]##; s#\.git$##' \ + || echo "")" +if [ -z "$REPO_SLUG" ]; then + REPO_SLUG="gunb-ai/gunbc" +fi + # 7 R2 manager briefs (mirrors r2-structure.md §"Manager structure" # count of 7 standing managers post-Evaluator-add 2026-04-28). # Listed explicitly (not glob) so renames surface as violations @@ -199,9 +212,14 @@ check_q4_landed_pr_in_history() { # Stage 1 (primary): gh pr view — works in shallow clone, robust # to squash-merge subject variance (PR #900 was squash-merged # without "(#900)" suffix; pure git-grep would miss it). - local pr_state="" + # Pass --repo explicitly: `actions/checkout@v4`'s shallow clone + # exposes the remote in a form `gh` doesn't always auto-detect. + # Capture stderr so auth/rate-limit failures surface in diagnostics. + local pr_state="" gh_stderr="" if command -v gh >/dev/null 2>&1; then - pr_state="$(gh pr view "$pr_num" --json state --jq '.state' 2>/dev/null || true)" + pr_state="$(gh pr view "$pr_num" --repo "$REPO_SLUG" --json state --jq '.state' 2>/tmp/gh-stderr-$$ || true)" + gh_stderr="$(cat /tmp/gh-stderr-$$ 2>/dev/null || true)" + rm -f /tmp/gh-stderr-$$ if [ "$pr_state" = "MERGED" ]; then continue fi @@ -220,11 +238,15 @@ check_q4_landed_pr_in_history() { echo "VIOLATION [Q4 landed-pr-in-history]: $brief" echo " cited claim: 'LANDED via #${pr_num}'" echo " PR is not in MERGED state via either:" - echo " - gh pr view #${pr_num} returning state=MERGED" + echo " - gh pr view #${pr_num} --repo ${REPO_SLUG} returning state=MERGED" echo " - git log finding a merge subject '(#${pr_num})'" if [ -n "$pr_state" ] && [ "$pr_state" != "MERGED" ]; then echo " - gh reports state=${pr_state}" fi + if [ -n "$gh_stderr" ]; then + echo " gh stderr (truncated to 200 chars):" + echo " $(echo "$gh_stderr" | head -c 200)" + fi brief_violations=$((brief_violations + 1)) done < <(grep -oE '(LANDED|landed) via #[0-9]+' "$brief" | grep -oE '#[0-9]+' | tr -d '#' | sort -u) From 32561e2696f1f5ed21289da9eb1bde7397a63a61 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 29 Apr 2026 00:32:22 +0000 Subject: [PATCH 15/22] fix(ci): grant pull-requests:read for manager-brief authority check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The check uses `gh pr view --json state` to verify "LANDED via #N" claims map to MERGED PRs. Default GITHUB_TOKEN scopes only include contents:read; pull-request access fails with: GraphQL: Resource not accessible by integration (repository.pullRequest) Surfaced when the script's stderr-capture fix (ea33aeb9d) made the actual error message visible — diagnostic improvement paid off immediately. Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b052a3a0207..2ebb133c1de 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,6 +13,11 @@ on: permissions: contents: read + # Manager-brief authority check uses `gh pr view --json state` to + # verify "LANDED via #N" claims map to MERGED PRs. Default + # GITHUB_TOKEN scopes don't include pull-request read; without this + # the check fails with "Resource not accessible by integration". + pull-requests: read # Cancel in-flight runs on new pushes to the same PR. Keyed on the PR # number (not `head_ref`) so two fork PRs that happen to share a branch From d564f00176dd18d1d26a27430236687eac1ec8ba Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 28 Apr 2026 20:47:03 -0400 Subject: [PATCH 16/22] WIP: Gunbc PM --- scripts/check-manager-brief-authority.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/scripts/check-manager-brief-authority.sh b/scripts/check-manager-brief-authority.sh index 164439ed6b1..8ab79914bb3 100755 --- a/scripts/check-manager-brief-authority.sh +++ b/scripts/check-manager-brief-authority.sh @@ -126,6 +126,15 @@ slugify() { | sed -E 's/[^a-z0-9 -]//g; s/ */-/g; s/--*/-/g; s/^-//; s/-$//' } +# Strip leading "# " / "## " / ... markdown heading marker from a line +# and return the heading text. Don't use Bash's `##` glob — it's +# greedy through the LAST space, so "## Goal 7 — Evaluator XL" +# becomes "XL" instead of "Goal 7 — Evaluator XL". sed regex with +# explicit hash-count + whitespace bound avoids that. +strip_heading_marker() { + echo "$1" | sed -E 's/^#{1,6}[[:space:]]+//' +} + check_q2_anchor_existence() { local brief="$1" local brief_dir @@ -163,11 +172,13 @@ check_q2_anchor_existence() { [ ! -f "$resolved" ] && continue # Q1 already reports missing files - # Extract all heading slugs from target. + # Extract all heading slugs from target. Use strip_heading_marker + # (sed-based) — Bash's `##\#* ` glob is greedy through the LAST + # space, dropping multi-word heading text. local found=0 while IFS= read -r heading; do heading="${heading#"${heading%%[![:space:]]*}"}" # ltrim - heading="${heading##\#* }" # strip leading #s + space + heading="$(strip_heading_marker "$heading")" local slug slug="$(slugify "$heading")" if [ "$slug" = "$anchor" ]; then From 91b5274fc3ee7812a13eb0631a65fa86f9df1196 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 29 Apr 2026 00:48:31 +0000 Subject: [PATCH 17/22] =?UTF-8?q?fix(scripts):=20manager-brief=20checker?= =?UTF-8?q?=20=E2=80=94=20markdown-bold=20+=20heading-strip=20+=20Q3=20tri?= =?UTF-8?q?gger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per gpt-5-5-pro REQUEST_CHANGES on PR #1126 (sha:ea33aeb9). Three findings — one BLOCKING (Q5 was ceremonial on its load-bearing projection), one secondary (heading-strip glob bug), one coverage gap. 1. **Q5 markdown-bold mismatch (BLOCKING).** Live briefs use `Names this manager one of **7** standing R2 managers` — markdown emphasis around the count. The pre-fix regex `[0-9]+ standing R2 managers` required a bare leading digit, so it matched zero claims on every brief. Counts_seen stayed empty → "0 counts seen → silent OK" branch fired → check passed ceremonially. A future drift to `**6** standing R2 managers` would have been invisible. Fix: regex now optionally accepts `**` before and after the digit: `\*?\*?[0-9]+\*?\*? standing R2 managers`. Extraction strips asterisks (`tr -d '*'`) before parsing. Verified on live briefs: $ grep -oE '\*?\*?[0-9]+\*?\*? standing R2 managers' docs/briefs/r2-*-manager.md docs/briefs/r2-evaluator-manager.md:**7** standing R2 managers docs/briefs/r2-grounding-manager.md:**7** standing R2 managers docs/briefs/r2-impossible-bugs-manager.md:**7** standing R2 managers docs/briefs/r2-modeling-manager.md:**7** standing R2 managers docs/briefs/r2-pure-bootstrap-manager.md:**7** standing R2 managers docs/briefs/r2-release-manager.md:**7** standing R2 managers docs/briefs/r2-substrate-manager.md:**7** standing R2 managers Now actually catches all 7 briefs' projections. 2. **Heading-strip glob bug (Q2 secondary).** `${heading##\#* }` is a Bash glob that strips through the LAST space, so "## Goal 7 — Evaluator XL" becomes "XL" instead of "Goal 7 — Evaluator XL". Multi-word heading anchors silently false-fail. Fix: introduced `strip_heading_marker()` helper using sed regex `^#{1,6}[[:space:]]+` for accurate prefix-only stripping. 3. **Self-test fixture format mismatch (coverage gap).** Self-test used bare-digit form ("7 standing R2 managers"); live briefs use markdown-bold ("**7** standing R2 managers"). Fixture proved Q5 for a format the live docs don't use, masking finding 1. Fix: updated all clean + drift fixtures in self-test to use markdown-bold form. Verifies Q5 catches the actual format. 4. **Q3 dissolution trigger (per debt-tracking discipline).** Previous "v2; the next narrowing opportunity" was a future bucket without a checkable trigger. Replaced with concrete trigger: "first reviewer-flagged status-string drift class that Q1/Q2/Q4/Q5 don't catch." Until that surfaces, status vocabulary is captured indirectly via Q5 count-projection consistency. Local checker + self-test still pass after fixes; Q5 now actually fires on live brief content rather than silently passing ceremonial. Co-Authored-By: Claude Opus 4.7 (1M context) --- scripts/check-manager-brief-authority.sh | 40 ++++++++++++------- scripts/test-check-manager-brief-authority.sh | 27 +++++++++---- 2 files changed, 46 insertions(+), 21 deletions(-) diff --git a/scripts/check-manager-brief-authority.sh b/scripts/check-manager-brief-authority.sh index 8ab79914bb3..3d4385db782 100755 --- a/scripts/check-manager-brief-authority.sh +++ b/scripts/check-manager-brief-authority.sh @@ -13,8 +13,16 @@ # Q2 — cited section anchor existence (§"section name" + path#anchor) # Q4 — `LANDED via #N` PR is reachable in this branch's history # Q5 — cross-brief lane-count / manager-count projections agree -# Q3 (controlled status vocabulary) deferred to v2 — too subjective -# for v1; named below as the next narrowing opportunity. +# Q3 (controlled status vocabulary) deferred to v2 with concrete +# dissolution trigger: implement Q3 when ANY status-string drift +# slips past Q1/Q2/Q4/Q5 in a real review (i.e., a brief edit +# introduces an unrecognized status keyword that none of the +# existing checks catch). At that point Q3 has a known unhandled +# class to encode against. Until then, status vocabulary is +# captured indirectly by Q5 (count-projection consistency catches +# the most common drift class — wrong manager/lane counts). +# DISSOLUTION TRIGGER: first reviewer-flagged status-string drift +# class that Q1/Q2/Q4/Q5 don't catch. # # Exit codes: # 0 — no violations @@ -282,18 +290,21 @@ check_q5_cross_brief_projections() { # docs/r3-structure.md (lane counts) authority docs. # Regex must use POSIX-extended (bash grep -E): [0-9]+, not \d+. # - # Per claude-opus-4-7 review: empirical check confirms the bare - # "standing managers" pattern does NOT substring-match - # "standing R2 managers" — the regex requires "managers" - # immediately after "standing" with one space, which "R2 " breaks. - # The two patterns coexist as separate constraints; if a brief - # uses either phrasing the count must match canonical (7). + # Markdown bold (`**7**`) handling — per gpt-5-5-pro review on + # ea33aeb9d: live briefs write counts with markdown emphasis + # (e.g., "Names this manager one of **7** standing R2 managers"). + # Earlier patterns required a bare leading digit and so missed + # every live count claim — the check passed silently because no + # matches at all means "0 counts seen → silent OK" per the + # mismatch logic below. Patterns now optionally accept "**" before + # and after the digit; extraction strips asterisks before + # parsing the integer. declare -a patterns=( - 'standing R2 managers||7||[0-9]+ standing R2 managers' - 'standing managers (no R2 qualifier)||7||[0-9]+ standing managers' - 'other managers||6||[0-9]+ other managers' - 'R3 lanes||10||[0-9]+ R3 lanes' - 'R3-Evaluator-gated lanes||7||[0-9]+ of 10 R3 lanes' + 'standing R2 managers||7||\*?\*?[0-9]+\*?\*? standing R2 managers' + 'standing managers (no R2 qualifier)||7||\*?\*?[0-9]+\*?\*? standing managers' + 'other managers||6||\*?\*?[0-9]+\*?\*? other managers' + 'R3 lanes||10||\*?\*?[0-9]+\*?\*? R3 lanes' + 'R3-Evaluator-gated lanes||7||\*?\*?[0-9]+\*?\*? of 10 R3 lanes' ) for entry in "${patterns[@]}"; do @@ -311,8 +322,9 @@ check_q5_cross_brief_projections() { while IFS= read -r match; do [ -z "$match" ] && continue # Extract the leading number from the matched substring. + # Strip markdown bold asterisks first (live briefs use **N**). local n - n="$(echo "$match" | grep -oE '^[0-9]+')" + n="$(echo "$match" | tr -d '*' | grep -oE '^[0-9]+')" [ -z "$n" ] && continue counts_seen["$n"]="${counts_seen[$n]:-}${brief}; " done < <(grep -oE "$pattern" "$brief" 2>/dev/null || true) diff --git a/scripts/test-check-manager-brief-authority.sh b/scripts/test-check-manager-brief-authority.sh index 543099234d9..1c8c093f97f 100755 --- a/scripts/test-check-manager-brief-authority.sh +++ b/scripts/test-check-manager-brief-authority.sh @@ -56,6 +56,11 @@ cat > "$TMPDIR/docs/thesis/r2-r3-thesis-mapping.md" <<'EOF' EOF # Helper: write 7 minimal briefs, optionally overriding one with custom content. +# Uses markdown-bold form (**7**) to match the format live briefs use — +# per gpt-5-5-pro review on ea33aeb9d, earlier fixtures used bare +# digits ("7 standing R2 managers") which proved Q5 for a format the +# live docs don't actually use. Live briefs write +# "Names this manager one of **7** standing R2 managers". write_clean_briefs() { local override_brief="${1:-}" local override_content="${2:-}" @@ -72,8 +77,8 @@ References [r2-structure](../r2-structure.md) — clean. References [r3-structure](../r3-structure.md) — clean. References [thesis](../thesis/r2-r3-thesis-mapping.md) — clean. -Manager count: 7 standing R2 managers. -R3 has 10 R3 lanes. +Names this manager one of **7** standing R2 managers. +R3 has **10** R3 lanes. EOF fi done @@ -144,14 +149,19 @@ test_negative_q4_unreachable_pr() { # The mismatch must be reported. test_negative_q5_count_mismatch() { - # Default briefs say "7 standing R2 managers"; override one to say 5. + # Default briefs say "**7** standing R2 managers"; override one to + # say "**5**" — markdown-bold form matches live briefs (per + # gpt-5-5-pro review). Pre-fix this test passed silently because + # the regex required bare digits and missed the bolded count + # entirely on both fixtures, leaving counts_seen empty (no + # mismatch to flag). write_clean_briefs "r2-evaluator-manager.md" \ - "# Brief\n\nReferences [r2-structure](../r2-structure.md).\n\nManager count: 5 standing R2 managers (intentional drift)." + "# Brief\n\nReferences [r2-structure](../r2-structure.md).\n\nNames this manager one of **5** standing R2 managers (intentional drift)." cd "$TMPDIR" if bash "$TEST_CONSUMER" >/dev/null 2>&1; then cd "$ROOT" - echo "FAIL [Q5/count-mismatch]: consumer passed on a fixture with mismatched manager counts" + echo "FAIL [Q5/count-mismatch]: consumer passed on a fixture with mismatched manager counts (markdown-bold form)" return 1 fi cd "$ROOT" @@ -165,18 +175,21 @@ test_negative_q5_count_mismatch() { # but it diverges from canonical (7). test_negative_q5_divergent_from_canonical() { + # All briefs agree on **5** standing R2 managers — agreement is + # preserved but diverges from canonical (7). Markdown-bold form + # matches live brief format. for name in evaluator grounding impossible-bugs modeling pure-bootstrap release substrate; do cat > "$TMPDIR/docs/briefs/r2-${name}-manager.md" </dev/null 2>&1; then cd "$ROOT" - echo "FAIL [Q5/divergent-from-canonical]: consumer passed on a fixture where all briefs agree on a non-canonical value" + echo "FAIL [Q5/divergent-from-canonical]: consumer passed on a fixture where all briefs agree on a non-canonical value (markdown-bold form)" return 1 fi cd "$ROOT" From 97affdb8cccd0214f24fbe1d8bc049a17f4bdac0 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 29 Apr 2026 01:01:19 +0000 Subject: [PATCH 18/22] fix(scripts+briefs): manager-brief Q2 prose-form check + align 7 citations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per gpt-5-5-pro BLOCKING on PR #1126 (sha:91b5274fc): Q2 explicitly excluded prose §"section name" citations, but live briefs use those for load-bearing INVARIANTS / r2-structure / design authority claims. The exclusion left 12 real authority drifts uncheckable. **Implements Q2-prose** (in addition to Q2-markdown-anchor): For each `§"quoted section"` or `§AnchorToken` in a brief: 1. Compute the prefix BEFORE this citation (running prefix; the bug in v0 was using before-first-§ for every iteration, so subsequent citations on the same line resolved against the first link's target instead of their own). 2. Find the most recent markdown link `[text](path)` in the prefix — that's the cited file. Fall back to bare `.md` token via `resolve_authority_file()` (tries `$ROOT/`, `$ROOT/docs/`, `$ROOT/docs/thesis/`, `$ROOT/docs/briefs/`). 3. `grep -F` for the section text in the cited file. Permissive substring match (vs Q2-markdown's slug match) — accepts paraphrased section names while still catching the load-bearing "section deleted" failure mode. **Caught 12 real drifts on first run** — all now fixed: - r2-evaluator-manager.md: §"Goal 7 — Evaluator XL" + §"Evaluator Manager (added 2026-04-28 as Goal 7)" → §"Evaluator Manager (added 2026-04-28 amendment)" (matches r2-structure.md:159 actual heading) - r2-grounding-manager.md: §"Tier 1 — Structural correctness — Grounding completeness" → §"Tier 1 — Structural correctness" (matches THESIS.md:168 actual prose) - r2-impossible-bugs-manager.md (×2): §"R2 manager continuation" → §"Manager structure" (matches r3-structure.md:103 actual heading) - r2-impossible-bugs-manager.md: §Q1-Q3 + §Q6 → §Q1, §Q2, §Q3 + §Q6 (range citation didn't match anything literal; expand to discrete) - r2-release-manager.md (×2): §"R2 manager continuation" → §"Manager structure" - r2-release-manager.md (×2): §v2-guardrail-requirement-3 → §"v2 guardrail requirements" (matches r2-structure.md:490 body) - r2-substrate-manager.md: §"R3 lane structure" → §"Lane structure" (matches r3-structure.md:86 actual heading) Local checker + self-test still pass after fixes. Reinforces gpt-5-5-pro's earlier meta-observation: a checker that names a discipline but doesn't enforce it on the live format is documented cheating. Q2-prose closes that gap; the briefs' authority citations now have to match section text that actually exists. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/briefs/r2-evaluator-manager.md | 4 +- docs/briefs/r2-grounding-manager.md | 2 +- docs/briefs/r2-impossible-bugs-manager.md | 6 +- docs/briefs/r2-release-manager.md | 8 +- docs/briefs/r2-substrate-manager.md | 2 +- scripts/check-manager-brief-authority.sh | 154 +++++++++++++++++++++- 6 files changed, 158 insertions(+), 18 deletions(-) diff --git a/docs/briefs/r2-evaluator-manager.md b/docs/briefs/r2-evaluator-manager.md index 51f469c6d7c..1d7373ee029 100644 --- a/docs/briefs/r2-evaluator-manager.md +++ b/docs/briefs/r2-evaluator-manager.md @@ -5,7 +5,7 @@ ## Orient before reading - **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md). Names this manager one of **7** standing R2 managers (alongside Substrate, Modeling, Grounding, Impossible-Bugs, Pure Bootstrap, R2 Release; cross-program coordination via Director). Manager count rose from 6 to 7 with this lane added per #1078. -- **Program scope source:** [`THESIS.md`](../../THESIS.md) §"Tier 3 — Verification from structure" (L4-L7 verification surface) + [`docs/r2-structure.md`](../r2-structure.md) §"Goal 7 — Evaluator XL". +- **Program scope source:** [`THESIS.md`](../../THESIS.md) §"Tier 3 — Verification from structure" (L4-L7 verification surface) + [`docs/r2-structure.md`](../r2-structure.md) §"Evaluator Manager (added 2026-04-28 amendment)". - **Cross-program consumer:** **R2-Evaluator gates 7 of 10 R3 lanes** (T-Tier3-Dissolution, T-LensProducer-Retirement, T-Verification-L4-L7-Direct, T-Verification-L5-Corpus, T-FixedPoint, T-Omni-Shape-B, T-CostLens-Composition). The Evaluator IS the runtime that R3's consequence layer falls out from. Without it, R3 dispatchers spin. - **Demo coordination:** signal lane-close to R2 Release Manager (closure ledger; per the structural-acceptance-per-lane-close discipline locked in `r2-structure.md` — the demo IS the structural gate, not a separate artifact). - **Substrate-fact-introduction procedure** ([`INVARIANTS.md`](../../INVARIANTS.md) §P1): self-serve through the 3-step decision procedure (DAG-ancestor → coproduct-vs-coordinate → primitive-vs-lens-extensible) before escalating substrate-shape questions to Director. @@ -147,7 +147,7 @@ Sub-lane status table refreshes here as work lands. Pre-spawn placeholder. Initi ## Cross-refs -- Parent: `docs/r2-structure.md` §"Goal 7 — Evaluator XL" + §"Evaluator Manager (added 2026-04-28 as Goal 7)" +- Parent: `docs/r2-structure.md` §"Evaluator Manager (added 2026-04-28 amendment)" (lane row in §"Manager structure" + §"Lane structure" table) - R3 dependent lanes: [`docs/r3-structure.md`](../r3-structure.md) §"Lane structure" — 7 of 10 lanes Evaluator-gated - Lens framework consumer: [`docs/design-lens-framework.md`](../design-lens-framework.md) — `Lens` primitive that Evaluator implements `fold_lens` for - 8 design questions disposition: [`docs/r2-structure.md`](../r2-structure.md) §4 + [`docs/design-emission-model.md`](../design-emission-model.md) Q1-Q5 + [`docs/design-lens-framework.md`](../design-lens-framework.md) Q6-Q8 diff --git a/docs/briefs/r2-grounding-manager.md b/docs/briefs/r2-grounding-manager.md index 4185ea4bb6a..9ea863ea41a 100644 --- a/docs/briefs/r2-grounding-manager.md +++ b/docs/briefs/r2-grounding-manager.md @@ -5,7 +5,7 @@ ## Orient before reading - **R2 structure authority:** [`docs/r2-structure.md`](../r2-structure.md). Names this manager one of **7** standing R2 managers. Owns **T-Ground XL** sub-program (Goal 1 — Grounding Completeness, the program with R2's only true critical path). -- **Program scope source:** [`THESIS.md §"Tier 1 — Structural correctness — Grounding completeness"`](../../THESIS.md) + [`ROADMAP.md §"Post-R1 Program — Grounding Completeness"`](../../ROADMAP.md) + [`docs/design-emission-model.md`](../design-emission-model.md) (engine-reframe spec). +- **Program scope source:** [`THESIS.md §"Tier 1 — Structural correctness"`](../../THESIS.md) (Grounding completeness sub-claim) + [`ROADMAP.md §"Post-R1 Program — Grounding Completeness"`](../../ROADMAP.md) + [`docs/design-emission-model.md`](../design-emission-model.md) (engine-reframe spec). - **No-engine emission model — locked direction (per `docs/design-emission-model.md` + #1078):** THESIS:171 is explicit: "Coercion = emission. No separate coercion engine." The prior `T-Ground-Engine` lane name implied an authority that "picks up slack" when structure under-determines targets — that violates fail-closed (P3) + parallel-authority discipline (P2). The reframe **dissolves the engine framing** into 5 substrate-completion lanes that surface the real modeling problems the engine framing was hiding. - **Cross-program consumer:** Coercion-Fold full pilot enumeration via symbolic walk of `rust_pilot_primitives: List` is gated on Substrate Manager's ValueBody-list/sum + `std.unicode` bootstrap carrier. Coordinate via R1 `Cross-manager notifications queued` brief pattern. - **Demo coordination:** signal lane-close to R2 Release Manager (closure ledger; per the **structural-acceptance-per-lane-close discipline** locked in `r2-structure.md` — the demo IS the structural gate, not a separate artifact). diff --git a/docs/briefs/r2-impossible-bugs-manager.md b/docs/briefs/r2-impossible-bugs-manager.md index b106a6b594a..3ab3421520c 100644 --- a/docs/briefs/r2-impossible-bugs-manager.md +++ b/docs/briefs/r2-impossible-bugs-manager.md @@ -8,7 +8,7 @@ - **Program scope source:** [`docs/r2-structure.md` §"Goals" item 4](../r2-structure.md) + [`THESIS.md §"Enumerable impossible-bug classes"`](../../THESIS.md) (R2+ tags authority). - **Cross-program coordination:** classes that surface substrate gaps escalate to Substrate Manager rather than expanding T-ImpossibleBugs scope. - **Demo coordination:** signal class-close to R2 Release Manager (closure ledger; per the **structural-acceptance-per-lane-close discipline** locked in `r2-structure.md` — the demo IS the structural gate, not a separate artifact). -- **Lifecycle:** **Manager archives at R2 close** per Director cascade ratified 2026-04-28 (`r3-structure.md` §"R2 manager continuation"): "Modeling/Impossible-Bugs Managers archive at R2 close." No R3 continuation work; post-R2 emergent impossible-bug classes are absorbed by Substrate Manager continuation per closed-system principle (new classes = enumeration was wrong = substrate gap). +- **Lifecycle:** **Manager archives at R2 close** per Director cascade ratified 2026-04-28 (`r3-structure.md` §"Manager structure"): "Modeling/Impossible-Bugs Managers archive at R2 close." No R3 continuation work; post-R2 emergent impossible-bug classes are absorbed by Substrate Manager continuation per closed-system principle (new classes = enumeration was wrong = substrate gap). - **Substrate-fact-introduction procedure** ([`INVARIANTS.md`](../../INVARIANTS.md) §P1): if implementation surfaces a substrate gap, self-serve through the 3-step decision procedure or signal Substrate Manager. Don't expand T-ImpossibleBugs scope to author substrate locally. ## Program scope (T-ImpossibleBugs) @@ -89,7 +89,7 @@ Each class closes under a structural acceptance gate authored as a `.dag` `TestC **Design docs landed (closed in scope — next-step recommendations are authority for implementation worker briefs):** - `docs/briefs/t-impossiblebugs-nested-optional-flatten-design.md` (PR #798) — design + scoping closed; implementation path: substrate-constructor invariant per design doc §Director-actionable. - `docs/briefs/t-impossiblebugs-unhandled-diagnostic-paths-design.md` (PR #801) — design + scoping closed; implementation path: totality-by-omission per design doc §4 Director-actionable recommendation. -- `docs/briefs/t-impossiblebugs-unenumerated-effects-design.md` (PR #808) — canonical authority; implementation path: closed-system structural derivation per design doc §Q1-Q3 + §Q6. +- `docs/briefs/t-impossiblebugs-unenumerated-effects-design.md` (PR #808) — canonical authority; implementation path: closed-system structural derivation per design doc §Q1, §Q2, §Q3 + §Q6. **Implementation worker briefs landed on main via PR #836 merge — manager dispatches against these:** - [`docs/briefs/r2-impossible-bugs-nested-optional-flatten-worker.md`](r2-impossible-bugs-nested-optional-flatten-worker.md) — M; ungated per design doc (substrate-constructor invariant; cardinality bridge already past per Director audit). @@ -125,5 +125,5 @@ Spawn refresh, 2026-04-28 (post-#1078, status-refresh against landed PRs): - Effects prereq: PR #805 (Fn→Arrow refactor) - Adjacent designs: PRs #798 (nested-optional), #801 (unhandled diagnostics) - INVARIANTS substrate-fact-introduction procedure: `INVARIANTS.md` §P1 -- R2-close archival authority: `docs/r3-structure.md` §"R2 manager continuation" +- R2-close archival authority: `docs/r3-structure.md` §"Manager structure" - Thesis-claim disposition: `docs/thesis/r2-r3-thesis-mapping.md` diff --git a/docs/briefs/r2-release-manager.md b/docs/briefs/r2-release-manager.md index 886ac72f322..2934f4945df 100644 --- a/docs/briefs/r2-release-manager.md +++ b/docs/briefs/r2-release-manager.md @@ -23,7 +23,7 @@ R2's smallest cross-cutting deliverables + release coordination + demo + discipl | Thesis-claim coverage mapping | `docs/r2-structure.md` Open call 1 + `docs/thesis/r2-r3-thesis-mapping.md` (LIVE post-#1078) | LANDED via #1078 — initial mapping complete; refresh as lanes close | | R2 closure ledger | `docs/r2-structure.md` Manager structure section 7 | LIVE on spawn (tracks lane-close green status across all 6 other managers; sub-gate progress for T-LensProducer-Retirement R3 continuation) | | v2 retirement coordination | `docs/r2-structure.md` Transition mechanics v2-retirement note | LIVE on spawn (post-R2 operational; tracked but not gated) | -| **v2 release-doc-authority guardrail follow-up** *(NEW 2026-04-28)* | `docs/r2-structure.md` §v2-guardrail-requirement-3 + `scripts/check-release-doc-authority.sh` | **NOT YET AUTHORED** — narrow PR scoped to release-state.yaml + projection-checker per gpt-5-5-pro meta-review; tighten retraction-pattern foot-gun (currently exempts unrelated "retracted" prose) | +| **v2 release-doc-authority guardrail follow-up** *(NEW 2026-04-28)* | `docs/r2-structure.md` §"v2 guardrail requirements" + `scripts/check-release-doc-authority.sh` | **NOT YET AUTHORED** — narrow PR scoped to release-state.yaml + projection-checker per gpt-5-5-pro meta-review; tighten retraction-pattern foot-gun (currently exempts unrelated "retracted" prose) | ## Owned deliverables (through R2 close) @@ -68,7 +68,7 @@ Worker briefs MUST consume these without re-litigation: - **Structural-acceptance-per-lane-close discipline**: demo IS the structural gate; no separate demo authoring work. Release coordinates visibility, doesn't author gates. - **Manager count 7** (post-Evaluator-add): closure ledger spans 6 other managers (Substrate / Modeling / Grounding / Impossible-Bugs / Pure Bootstrap / Evaluator). -- **R2 manager continuation pattern** (`r3-structure.md` §"R2 manager continuation"): Substrate continues with T-Int128 + T-Anthropic-Wire + T-CostLens-Composition; PB continues with T-LensProducer-Retirement + T-FixedPoint + T-Tier3-Dissolution + 3 distributed bridges; Modeling/Impossible-Bugs archive at R2 close. Closure ledger reports R3 continuation readiness. +- **R2 manager continuation pattern** (`r3-structure.md` §"Manager structure"): Substrate continues with T-Int128 + T-Anthropic-Wire + T-CostLens-Composition; PB continues with T-LensProducer-Retirement + T-FixedPoint + T-Tier3-Dissolution + 3 distributed bridges; Modeling/Impossible-Bugs archive at R2 close. Closure ledger reports R3 continuation readiness. - **T-LensProducer-Retirement XL framing** (Director cascade Item 8): one program with 3 internal sub-gates; closure ledger reports sub-gate progress within the one-program lane. - **T-Bridge-Retirement distribution map** (Director cascade Item 4): retirement work distributed (3 PB + 2 Substrate); ledger gate centralized at Verification (R3). Closure ledger tracks distribution map progress. @@ -147,6 +147,6 @@ Spawn refresh, 2026-04-28 (post-#1078, status-refresh against landed PRs): - Thesis-claim authority: `THESIS.md §"Thesis claims — complete list"` + `docs/thesis/r2-r3-thesis-mapping.md` - B-wave source: `docs/briefs/debt-paydown-synthesis-2026-04-25.md` §5 (B1-B7 dispatch ordering) - Release-doc authority guardrail: `scripts/check-release-doc-authority.sh` + `scripts/test-check-release-doc-authority.sh` -- v2 guardrail requirements: `docs/r2-structure.md` §v2-guardrail-requirement-3 -- R2 manager continuation pattern: `docs/r3-structure.md` §"R2 manager continuation" +- v2 guardrail requirements: `docs/r2-structure.md` §"v2 guardrail requirements" +- R2 manager continuation pattern: `docs/r3-structure.md` §"Manager structure" - INVARIANTS substrate-fact-introduction procedure: `INVARIANTS.md` §P1 diff --git a/docs/briefs/r2-substrate-manager.md b/docs/briefs/r2-substrate-manager.md index 820aa640927..df6a9d288b3 100644 --- a/docs/briefs/r2-substrate-manager.md +++ b/docs/briefs/r2-substrate-manager.md @@ -65,7 +65,7 @@ From [`docs/briefs/b4-identity-carrier-substrate-pass.md`](b4-identity-carrier-s ### D. Post-R2 continuation: T-CostLens-Composition (R3 lane) -**Per Director cascade Item 3 ratified 2026-04-28** ([`docs/r3-structure.md`](../r3-structure.md) §"R3 lane structure"). Substrate continues into R3 to complete the cost-algebra composition lens — the only Substrate work that survives R2 close. +**Per Director cascade Item 3 ratified 2026-04-28** ([`docs/r3-structure.md`](../r3-structure.md) §"Lane structure"). Substrate continues into R3 to complete the cost-algebra composition lens — the only Substrate work that survives R2 close. Why Substrate-owned (not Verification-owned): T-CostLens-Composition is a **structural Lens instance** producing `RealizationCost { storage: Cost, access: Map> }` witnesses (per Q3 lock). The lens framework's structural inhabitance IS the namespacing mechanism; lens-instance authoring is substrate-completion work, not verification work. Verification Manager (R3) asserts the gate fires by construction; doesn't author the lens. diff --git a/scripts/check-manager-brief-authority.sh b/scripts/check-manager-brief-authority.sh index 3d4385db782..33a00c691d5 100755 --- a/scripts/check-manager-brief-authority.sh +++ b/scripts/check-manager-brief-authority.sh @@ -117,16 +117,23 @@ check_q1_file_existence() { } # --------------------------------------------------------------------- -# Q2 — Cited section anchor existence (markdown form only) +# Q2 — Cited section anchor existence (markdown links + prose §) # --------------------------------------------------------------------- -# For `path#anchor` markdown links, verify the anchor matches a heading +# Two forms covered (per gpt-5-5-pro review on 91b5274fc; deferring +# prose form left load-bearing INVARIANTS/r2-structure/design +# authority claims uncheckable): +# +# Form A — markdown `path#anchor`: verify the anchor matches a heading # in the target file (heading slugified to GitHub form: lowercase, # spaces→dashes, punctuation stripped). # -# Out of scope for v1: `§"section name"` prose-form citations. They're -# common in the briefs but parsing "what file does this prose § -# reference" requires more context than a regex can give. v2 candidate; -# tracked alongside Q3 status-vocabulary as the next narrowing. +# Form B — prose `§"section name"` or `§AnchorToken`: identify the +# cited file via the most recent markdown link / bare `.md` reference +# on the same line, then grep -F for the section text in the target. +# Permissive vs heading-only Form A — accepts the section text +# appearing anywhere in the file (since prose citations may use +# paraphrased section names) — but still catches the "section deleted" +# class, which is the load-bearing failure mode. slugify() { echo "$1" \ @@ -207,6 +214,134 @@ check_q2_anchor_existence() { return $brief_violations } +# Resolve a bare filename like "INVARIANTS.md" or "r2-structure.md" to +# a filesystem path by trying known authority-doc locations. +# Returns empty string if unresolvable. +resolve_authority_file() { + local name="$1" + local candidates=( + "$ROOT/$name" + "$ROOT/docs/$name" + "$ROOT/docs/thesis/$name" + "$ROOT/docs/briefs/$name" + ) + for candidate in "${candidates[@]}"; do + if [ -f "$candidate" ]; then + echo "$candidate" + return + fi + done + echo "" +} + +# Q2-prose: verify §"section" / §Anchor citations resolve in the +# most-recently-cited file on the same line. +check_q2_prose_section_existence() { + local brief="$1" + local brief_violations=0 + + # Read brief line-by-line so we can pair each § citation with the + # cited file from the same line. + while IFS= read -r line || [ -n "$line" ]; do + # Skip lines without § citations. + case "$line" in + *§*) ;; + *) continue ;; + esac + + # Process § citations in order, advancing a running prefix so that + # the Nth citation's prefix is everything up to (but not including) + # the Nth §. Each citation pairs with the most recent markdown + # link or bare `.md` token in its OWN prefix, not the global + # before-first-§ prefix. + local remaining="$line" + + # Find every §-citation in the line. Two forms: + # §"quoted section text" + # §AnchorToken (alphanumeric, hyphens, dots, no spaces — anchors, + # P1/P5/Q6 tokens, "v2-guardrail-requirement-3", etc.) + while IFS= read -r citation; do + [ -z "$citation" ] && continue + + local section_text="$citation" + # Strip leading § and quotes. + section_text="${section_text#§}" + section_text="${section_text#\"}" + section_text="${section_text%\"}" + + # Compute the prefix for THIS citation: everything in `remaining` + # before the next occurrence of this citation, then advance + # `remaining` past it for the next iteration. + local prefix="${remaining%%${citation}*}" + # Advance remaining past the citation. + remaining="${remaining#*${citation}}" + + # Identify the cited file: scan the prefix backward for either: + # 1. A markdown link [text](path) — extract path. + # 2. A bare `.md` token — try resolving via known + # authority-doc locations. + local cited_file="" + + # Try markdown link form: extract last [...](path). + local md_path + md_path="$(echo "$prefix" | grep -oE '\]\([^)]+\)' | tail -1 | sed -E 's/^\]\(//; s/\)$//')" + if [ -n "$md_path" ]; then + # Strip anchor portion if present. + md_path="${md_path%%#*}" + case "$md_path" in + http://*|https://*|mailto:*) md_path="" ;; + esac + if [ -n "$md_path" ]; then + local brief_dir + brief_dir="$(dirname "$brief")" + if [[ "$md_path" = /* ]]; then + cited_file="$ROOT$md_path" + else + cited_file="$brief_dir/$md_path" + fi + if command -v realpath >/dev/null 2>&1; then + cited_file="$(realpath -m "$cited_file" 2>/dev/null || echo "$cited_file")" + fi + fi + fi + + # Fallback: bare `.md` token. Look for the last + # whitespace-or-backtick-bounded `*.md` in the prefix. + if [ -z "$cited_file" ] || [ ! -f "$cited_file" ]; then + local bare_md + bare_md="$(echo "$prefix" | grep -oE '[A-Za-z][A-Za-z0-9_./-]*\.md' | tail -1)" + if [ -n "$bare_md" ]; then + # Strip leading directory if present (e.g., docs/r2-structure.md) + local resolved + resolved="$(resolve_authority_file "$(basename "$bare_md")")" + if [ -n "$resolved" ]; then + cited_file="$resolved" + fi + fi + fi + + # If we couldn't pair the § citation with a cited file, skip + # silently — ambiguous prose; don't false-positive. + [ -z "$cited_file" ] && continue + [ ! -f "$cited_file" ] && continue + + # Verify the section text appears in the cited file. + # Permissive match: grep -F (literal substring), not slug match. + # This catches the load-bearing class ("section deleted") while + # tolerating paraphrased prose citations. + if ! grep -F -q "$section_text" "$cited_file" 2>/dev/null; then + echo "VIOLATION [Q2 prose-section-existence]: $brief" + echo " prose citation: §\"$section_text\"" + echo " resolved cited file: $cited_file" + echo " section text not found in target file" + brief_violations=$((brief_violations + 1)) + fi + done < <(echo "$line" | grep -oE '§"[^"]+"|§[A-Za-z][A-Za-z0-9._-]*[A-Za-z0-9]|§[A-Za-z]') + done < "$brief" + + return $brief_violations +} + # --------------------------------------------------------------------- # Q4 — LANDED via #N PR-reachability check # --------------------------------------------------------------------- @@ -406,6 +541,10 @@ for brief in "${MANAGER_BRIEFS[@]}"; do check_q2_anchor_existence "$brief" || rc=$? violations=$((violations + rc)) + rc=0 + check_q2_prose_section_existence "$brief" || rc=$? + violations=$((violations + rc)) + rc=0 check_q4_landed_pr_in_history "$brief" || rc=$? violations=$((violations + rc)) @@ -436,6 +575,7 @@ fi echo "Manager-brief authority check passed: 7 briefs, no violations." echo " Q1 (file existence): all cited paths resolve" -echo " Q2 (anchor existence): all path#anchor links match a heading" +echo " Q2 (markdown anchors): all path#anchor links match a heading" +echo " Q2 (prose §): all §\"section\" / §Anchor citations resolve in cited files" echo " Q4 (LANDED via #N): all cited PRs reachable from branch" echo " Q5 (cross-brief projection): manager/lane counts consistent" From 6dafaecf1f7026b1b95100ec189db50a8bd1c9b0 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 29 Apr 2026 01:02:55 +0000 Subject: [PATCH 19/22] =?UTF-8?q?chore(scripts):=20manager-brief=20?= =?UTF-8?q?=E2=80=94=20mktemp=20gh-stderr=20+=20Q1=20false-pos=20trigger?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per claude-opus-4-7 APPROVE-with-exploratory-observations on PR #1126 (sha:91b5274f). Two non-blocking cleanups landed. 1. **gh-stderr capture: $$ → mktemp.** Previous form used `/tmp/gh-stderr-$$` which is fine in CI but a crashed run on a shared dev box could leak the file. `mktemp` gives a unique path + paired cleanup in scope. 2. **Q1 false-positive trigger documented.** Q1 currently treats every `](path)` as a filesystem reference. Markdown reference- style link definitions and code-block examples containing `](foo)` would false-positive. No briefs use either form today; added DISSOLUTION TRIGGER comment naming the condition that would force context-aware extraction (skip fenced code blocks + reference definitions). The third observation (squash-merge for the WIP: Gunbc PM commits) is a merge-time decision; PR-level chore. Co-Authored-By: Claude Opus 4.7 (1M context) --- scripts/check-manager-brief-authority.sh | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/scripts/check-manager-brief-authority.sh b/scripts/check-manager-brief-authority.sh index 33a00c691d5..bbf9e38ee8d 100755 --- a/scripts/check-manager-brief-authority.sh +++ b/scripts/check-manager-brief-authority.sh @@ -68,6 +68,15 @@ violations=0 # Extract markdown links of form [text](path) where path is not a URL, # not a fragment-only anchor, and not in a known excluded set; verify # each path exists on disk relative to the brief's directory. +# +# Known limitation (per claude-opus-4-7 review on 91b5274fc): every +# `](path)` is treated as a filesystem reference. Markdown +# reference-style link definitions (`[ref]: path`) and code-block +# examples containing `](foo)` would false-positive. Currently no +# briefs use either form. DISSOLUTION TRIGGER: first false-positive +# from a brief that introduces a code-block example or reference-style +# link, at which point Q1 needs context-aware extraction (skip lines +# inside fenced code blocks; skip reference definitions). check_q1_file_existence() { local brief="$1" @@ -371,9 +380,14 @@ check_q4_landed_pr_in_history() { # Capture stderr so auth/rate-limit failures surface in diagnostics. local pr_state="" gh_stderr="" if command -v gh >/dev/null 2>&1; then - pr_state="$(gh pr view "$pr_num" --repo "$REPO_SLUG" --json state --jq '.state' 2>/tmp/gh-stderr-$$ || true)" - gh_stderr="$(cat /tmp/gh-stderr-$$ 2>/dev/null || true)" - rm -f /tmp/gh-stderr-$$ + # mktemp avoids the $$-PID approach: a crashed run on a shared + # dev box could leak /tmp/gh-stderr-$$ files; mktemp gives unique + # path + cleanup is paired in this scope. + local gh_stderr_file + gh_stderr_file="$(mktemp)" + pr_state="$(gh pr view "$pr_num" --repo "$REPO_SLUG" --json state --jq '.state' 2>"$gh_stderr_file" || true)" + gh_stderr="$(cat "$gh_stderr_file" 2>/dev/null || true)" + rm -f "$gh_stderr_file" if [ "$pr_state" = "MERGED" ]; then continue fi From da1d52d69a3423a48025f5d0407f9c25ca5487f4 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Tue, 28 Apr 2026 21:18:56 -0400 Subject: [PATCH 20/22] WIP: Gunbc PM --- scripts/check-manager-brief-authority.sh | 11 ++++++++--- scripts/test-check-manager-brief-authority.sh | 6 ++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/check-manager-brief-authority.sh b/scripts/check-manager-brief-authority.sh index bbf9e38ee8d..958e74abcf5 100755 --- a/scripts/check-manager-brief-authority.sh +++ b/scripts/check-manager-brief-authority.sh @@ -354,8 +354,13 @@ check_q2_prose_section_existence() { # --------------------------------------------------------------------- # Q4 — LANDED via #N PR-reachability check # --------------------------------------------------------------------- -# Every `LANDED via #N` (or `landed via #N`) claim must correspond to -# a merge commit reachable from this branch's history. +# Every `LANDED via #N`, `landed via #N`, or `Landed via #N` claim +# must correspond to a merge commit reachable from this branch's +# history. Case-insensitive extraction (per gpt-5-5-pro review on +# 91b5274f): live briefs use all three case forms — UPPERCASE for +# emphasized status-table claims, title-case for sentence-leading +# headings (e.g., r2-release-manager.md "Landed via #1078:"), and +# lowercase for inline prose. check_q4_landed_pr_in_history() { local brief="$1" @@ -416,7 +421,7 @@ check_q4_landed_pr_in_history() { echo " $(echo "$gh_stderr" | head -c 200)" fi brief_violations=$((brief_violations + 1)) - done < <(grep -oE '(LANDED|landed) via #[0-9]+' "$brief" | grep -oE '#[0-9]+' | tr -d '#' | sort -u) + done < <(grep -oEi 'landed via #[0-9]+' "$brief" | grep -oE '#[0-9]+' | tr -d '#' | sort -u) return $brief_violations } diff --git a/scripts/test-check-manager-brief-authority.sh b/scripts/test-check-manager-brief-authority.sh index 1c8c093f97f..06e836ce9e1 100755 --- a/scripts/test-check-manager-brief-authority.sh +++ b/scripts/test-check-manager-brief-authority.sh @@ -61,6 +61,11 @@ EOF # digits ("7 standing R2 managers") which proved Q5 for a format the # live docs don't actually use. Live briefs write # "Names this manager one of **7** standing R2 managers". +# +# Includes a `landed via #999` claim in the clean fixture (lowercase, +# matching live brief format) so the Q4 positive path is non-vacuous — +# per gpt-5-5-pro review on 91b5274f. The tmp git repo (test_q4 setup +# below) seeds a "(#999)" merge subject so this resolves cleanly. write_clean_briefs() { local override_brief="${1:-}" local override_content="${2:-}" @@ -79,6 +84,7 @@ References [thesis](../thesis/r2-r3-thesis-mapping.md) — clean. Names this manager one of **7** standing R2 managers. R3 has **10** R3 lanes. +Substrate landed via #999 (positive Q4 fixture; tmp-git seed). EOF fi done From 3ba4f2c185697ffe39755edff2a57455d19ce035 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 29 Apr 2026 01:19:56 +0000 Subject: [PATCH 21/22] fix(scripts): manager-brief Q4 case-insensitive + title-case test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per gpt-5-5-pro APPROVE_WITH_COMMENTS on PR #1126 (sha:91b5274f → 6dafaecf): Q4 silently missed title-case "Landed via #N" claims. **Finding 1 (Q4 case sensitivity):** live briefs use three case forms of "landed via #N": - UPPERCASE — emphasized status-table claims (most common) - lowercase — inline prose ("landed via #900", "landed via #937", ...) - title-case — sentence-leading headings (r2-release-manager.md:113 "Landed via #1078:") The pre-fix regex `(LANDED|landed) via` missed the title-case form, silently passing any future unique `Landed via #N` claim. Fix: `grep -oEi 'landed via #[0-9]+'` (case-insensitive flag). **Finding 2 (Q4 self-test gap):** Q4 negative fixture used UPPERCASE "LANDED via #88888888"; positive fixture had no landed-PR claim at all. Title-case wasn't covered. Fixes: - Added `test_negative_q4_unreachable_pr_titlecase` using "Landed via #88888887" — verifies case-insensitive Q4 catches title-case. - Updated `write_clean_briefs` clean fixture to include "Substrate landed via #999" (lowercase, matching real brief format). Q4 positive path is now non-vacuous: tmp git repo seeds "(#999)" merge subject so this resolves cleanly. **Finding 3 (Q2 prose deferral note)**: STALE — Q2-prose was implemented in 97affdb8c (2 commits before this review). The reviewer cited line numbers from before the implementation; current code at `scripts/check-manager-brief-authority.sh:121` says "Two forms covered" not "v2 candidate". No action needed. Self-test now: 8 contract assertions (6 negative + 1 positive + 1 fail-closed-on-missing-brief). Co-Authored-By: Claude Opus 4.7 (1M context) --- scripts/test-check-manager-brief-authority.sh | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/scripts/test-check-manager-brief-authority.sh b/scripts/test-check-manager-brief-authority.sh index 06e836ce9e1..2cc8e7a0ac0 100755 --- a/scripts/test-check-manager-brief-authority.sh +++ b/scripts/test-check-manager-brief-authority.sh @@ -148,6 +148,23 @@ test_negative_q4_unreachable_pr() { return 0 } +# Per gpt-5-5-pro review on 91b5274f: live briefs use title-case +# "Landed via #N" in addition to UPPERCASE/lowercase forms; verify the +# case-insensitive Q4 regex catches it. Q4 is now grep -oEi. +test_negative_q4_unreachable_pr_titlecase() { + write_clean_briefs "r2-evaluator-manager.md" \ + "# Brief\n\nLanded via #88888887 (title-case, unreachable in tmp repo) — should fail Q4." + + cd "$TMPDIR" + if bash "$TEST_CONSUMER" >/dev/null 2>&1; then + cd "$ROOT" + echo "FAIL [Q4/unreachable-pr-titlecase]: consumer passed on title-case 'Landed via #N' with unreachable PR" + return 1 + fi + cd "$ROOT" + return 0 +} + # --------------------------------------------------------------------- # Q5 — cross-brief projection mismatch negative test # --------------------------------------------------------------------- @@ -272,6 +289,7 @@ for test_fn in \ test_negative_q1_missing_file \ test_negative_q2_missing_anchor \ test_negative_q4_unreachable_pr \ + test_negative_q4_unreachable_pr_titlecase \ test_negative_q5_count_mismatch \ test_negative_q5_divergent_from_canonical \ test_negative_missing_brief_fails_closed; do @@ -298,5 +316,5 @@ if [ "$failures" -gt 0 ]; then fi echo "" -echo "Self-test PASSED: 7 contract assertions verified" -echo " (5 negative — Q1/Q2/Q4/Q5×2 + missing-brief; 1 positive — clean fixture)" +echo "Self-test PASSED: 8 contract assertions verified" +echo " (6 negative — Q1/Q2/Q4×2/Q5×2 + missing-brief; 1 positive — clean fixture w/ landed-PR)" From b9f7a1c1588574b0f631beb2e47b3f687cc12d53 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Wed, 29 Apr 2026 01:27:55 +0000 Subject: [PATCH 22/22] chore(briefs): strip trailing whitespace at r2-evaluator-manager.md:46 Per codex review on PR #1126 (sha:3ba4f2c1): `git diff --check origin/main...HEAD` flagged trailing whitespace inside the PR-A-through-PR-E dependency-graph ASCII art. Removed. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/briefs/r2-evaluator-manager.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/briefs/r2-evaluator-manager.md b/docs/briefs/r2-evaluator-manager.md index 1d7373ee029..6bf06c68670 100644 --- a/docs/briefs/r2-evaluator-manager.md +++ b/docs/briefs/r2-evaluator-manager.md @@ -43,7 +43,7 @@ Before worker dispatch begins on the implementation sub-lanes above, **5 design model) │ (Final │ │ integration) ↓ └─────────────────────┴── (consumed by R3-T-LensProducer-Retirement) - + PR-D (L5 corpus type spec) ──→ PR-E (independent of A/B/C; cross-target equivalence) (consumed by R3-T-V-L5-Corpus) ```