From 2fccc2a2d8ccc56d736b235fc07d8d41f21fa65b Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 05:13:26 +0000 Subject: [PATCH 01/50] docs(briefs): Substrate bridge SourceSpan.file participation retirement worker brief MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Authored for gunbc#1958 Substrate-owned bridge slice. Targets audit-row #2 (kernel Bool patch BOOL_TYPES_FILE) + row #6 (pipeline authority PIPELINE_AUTHORITY_FILE) per r3-program-plan.md §5 line 353 scope-narrowing. Sibling #1959 closed as already-retired by PR #1272. Co-Authored-By: Claude Opus 4.7 (1M context) --- ...e-source-span-file-participation-worker.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md diff --git a/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md b/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md new file mode 100644 index 00000000000..9811b03c9c9 --- /dev/null +++ b/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md @@ -0,0 +1,66 @@ +# Worker brief — Substrate bridge: `SourceSpan.file` participation checks (1 of 2) + +**Sub-issue**: gunbc#1958 (parented under #1939 Substrate Mgr lane). +**Sibling**: gunbc#1959 closed 2026-05-07 — already retired by PR #1272. +**Authority anchors**: `docs/briefs/bridge-retirement-audit-sourcespan-family.md` (19-row enumeration); `docs/r3-program-plan.md:353` Substrate-owned scope clarification; `src/v3/std/bridge_ledger.dag` row `bridge_source_span_file_participation_retired` (status=`Proposed`). + +## Scope (Substrate-owned, narrow) + +Per **r3-program-plan.md §5 line 353** Y4 scope-clarification: + +> Substrate-owned: `SourceSpan.file` participation checks (**hand-Rust audit sites only** — +> `bootstrap.rs:519` doc-comment + `:137` / `:287` / `:309` hardcoded path strings; +> codegen-emitted `SourceSpan::new(...)` offsets in `bootstrap_generated.rs` are a +> separate generated-file bridge shape, **NOT counted as Substrate-owned manual hand-Rust**). + +This brief targets **bootstrap.rs hand-Rust sites only**. The 19-row audit packet's broader rows (`lens_apply.rs`, `test_runner.rs`, `dag.rs::declaration_by_name` rank tables, etc.) are owned by Verification / PB per the audit-packet leaf-first schedule — **not in scope here**. + +## Concrete anchor sites in `bootstrap.rs` at HEAD + +| Anchor | Site | Bridge shape | +|---|---|---| +| 1 | `:125-129` Bool resolver | `d.span.file == BOOL_TYPES_FILE` — identity-by-path-string (audit row #2) | +| 2 | `:138` | `SourceSpan::new(BOOL_TYPES_FILE, 0, 0)` — diagnostic span manufactured from path constant (audit row #2) | +| 3 | `:285` | `BootstrapAuthorityKey::new(PIPELINE_AUTHORITY_FILE)` — string-keyed authority (audit row #6) | +| 4 | `:288` | `SourceSpan::new(PIPELINE_AUTHORITY_FILE, 0, 0)` — diagnostic span (audit row #6) | +| 5 | `:309` | `SourceSpan::new("", 0, 0)` — **test fixture, NOT a bridge** (synthetic span; OK to keep) | +| 6 | `:519` doc-comment | references `SourceSpan.file` for prose only (no runtime check; doc-update on retirement) | + +Authority constants: `BOOL_TYPES_FILE` (`dsl/std/types.dag`), `PIPELINE_AUTHORITY_FILE` (`src/v3/compiler/src/pipeline.dag` per `pipeline_authority.rs`). + +## Retirement shape (per audit-packet rows #2 + #6) + +**Row #2 (kernel Bool patch)** — replace identity-by-path with structural lookup: +- Use `Dag::declaration_by_name("Bool")` already-canonical lookup; gate by **bootstrap-module witness** (declaration's owning module-id rather than `span.file` string match). +- Diagnostic span: synthesize from `BootstrapAuthorityKey` rather than `SourceSpan::new(BOOL_TYPES_FILE, 0, 0)` — the `BootstrapAuthorityKey::new(...)` wrapper already exists at `:125`, and `DiagnosticAttribution::BootstrapAuthority` (per `:519` doc-comment) is the steady-state attribution surface (PB row 82). +- **Prerequisite**: `dsl/std/types.dag` ↔ `src/v3/std/types.dag` duplicate-module convergence per ROADMAP T-P0 must NOT regress; if both hold a `Bool`, `declaration_by_name` rank still applies (audit row #14 — root blocker, **out-of-scope here**). + +**Row #6 (pipeline authority)** — replace `PIPELINE_AUTHORITY_FILE` guards: +- `report_pipeline_authority_error` (`:283-292`) — drop the path-string from both `BootstrapAuthorityKey` and `SourceSpan::new`. Replace with a **`BootstrapAuthority::Pipeline` typed key** (extend the enum if needed); diagnostic span sourced from the offending stage binding's actual `SourceSpan`, not a manufactured `(file, 0, 0)`. +- Coordinate with PB-owned `bridge_include_str_side_channels_retired` (audit row #6 sibling) — `pipeline_authority.rs::ordered_pipeline_stages` already reads `PipelineStageBinding` structurally; the bridge is ONLY in the diagnostic-span manufacturing path. + +## Acceptance + +1. `bootstrap.rs` no longer references `BOOL_TYPES_FILE` or `PIPELINE_AUTHORITY_FILE` outside doc-comments. +2. The two diagnostic paths (kernel Bool not-found, pipeline-authority error) carry typed `DiagnosticAttribution::BootstrapAuthority` with the appropriate `BootstrapAuthorityKey` variant — verified by `kernel_bool_path_a_diagnostic_carries_bootstrap_authority_attribution` (already exists at `:519+`) extended for the pipeline path if not present. +3. `src/v3/std/bridge_ledger.dag` row `bridge_source_span_file_participation_retired` advances `Proposed` → `Retired` for the Substrate-owned scope; ledger receipt mentions PR # + scope-narrowing (audit rows #2 + #6 only; rows #1, #3-5, #7-19 remain under their owners). +4. `dag.rs::bridge_source_span_file_participation_retired` ratchet test (if not already authored — Verification-owned per `r3-v-bridge-ratchet-test-design.md`) passes; if test doesn't exist yet, surface to Verification Mgr (#1940) for ratchet authoring as cross-Mgr handoff. +5. Bootstrap regen: `cargo test -p v3-compiler bootstrap_regen_fresh -- --ignored` clean (path-string deletion must not perturb regen byte-snapshot). +6. Full suite: `cargo test --workspace --exclude v2-compiler-tests` green; `cargo clippy --all-targets -- -D warnings` clean. + +## STOP / PING criteria + +- **STOP** if removing `d.span.file == BOOL_TYPES_FILE` (anchor #1) causes `declaration_by_name("Bool")` to resolve to a different declaration (rank-table ambiguity from duplicate `Bool` in `src/v3/std/types.dag` vs `dsl/std/types.dag`). This is audit row #14 root-blocker territory — surface to Mgr; do NOT delete the rank table to "fix it". +- **STOP** if `BootstrapAuthority` enum doesn't have a `Pipeline` variant and adding one cascades into emit/diagnostic surfaces beyond bootstrap.rs. Surface scope-creep to Mgr. +- **PING** Verification Mgr (#1940 / `witty-swift-269` if active) when this lands so they can advance the ledger-zero audit (`docs/briefs/r3-v-bridge-retirement-ledger-zero-audit.md` row 1). + +## Cross-Mgr handoff + +- **PB Mgr**: audit row #6's sibling (`bridge_include_str_side_channels_retired` for `pipeline_authority.rs` compile-body drift) is PB-owned; this Substrate slice does NOT touch the include_str path, only the diagnostic-span path. No cross-PR coordination needed unless audit row interpretation drifts at execution time. +- **Verification Mgr**: ratchet authoring + ledger-zero audit advancement. + +## Worker disposition + +Single PR (~150-300 LoC delta + test). Use standing-authority merge per Director directive 2026-05-07 once CLEAN + green CI + reviewer comments without BLOCKING + sitting >30min. + +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-07 per Director endorsement at gunbc#828 #issuecomment-4394293399. From 8c5f054430ffcc5aa5d9cbe9123a492cc55c70ec Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 05:24:11 +0000 Subject: [PATCH 02/50] docs(briefs): S5 Variant-aware projection carrier canvas (#1947) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Surfaces 3 carrier-shape options (α RestResponseProjection variant-tag / β Declaration variant_projection_metadata / γ free-standing CoproductProjection) for Director ratification before worker brief authoring. Mgr-tier recommendation = γ (DeclarationRef-keyed, avoids tag-string-as-identity bridge). Co-Authored-By: Claude Opus 4.7 (1M context) --- ...variant-aware-projection-carrier-canvas.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 docs/briefs/r3-substrate-s5-variant-aware-projection-carrier-canvas.md diff --git a/docs/briefs/r3-substrate-s5-variant-aware-projection-carrier-canvas.md b/docs/briefs/r3-substrate-s5-variant-aware-projection-carrier-canvas.md new file mode 100644 index 00000000000..3cf0e4bc62e --- /dev/null +++ b/docs/briefs/r3-substrate-s5-variant-aware-projection-carrier-canvas.md @@ -0,0 +1,79 @@ +# Canvas — Substrate S5 Variant-aware projection metadata carrier + +**Sub-issue**: gunbc#1947 (parented under #1939 Substrate Mgr lane). +**Authority**: `docs/r3-design-schedule-2026-05-06.md` §S5 (lines 101-106); `docs/r3-program-plan.md:979` Q-Anthropic-Variant-Aware (RATIFIED-by-default — all 3 paydowns); Substrate canvas C1. +**Status**: **canvas — Director-tier ratification needed on carrier shape before worker brief authoring**. + +## Scope + +Typed REST response projection carrier for **coproduct response bodies** — the substrate fact that lets a typed REST response `from`-path resolver dispatch on a sum-type response variant rather than collapsing into untyped JSON. + +Closure: §1.8 gates #29-#30 (T-Anthropic-Wire 2 gates); unblocks #1702 Anthropic re-dispatch + 3 follow-up paydown PRs (Anthropic Messages 200 residual + 2 sibling coproduct slices already-briefed at `r3-coproduct-{2,3}-*.md`). + +## Why a canvas not a worker brief + +Carrier shape is a **substrate-fact-introduction (P1 procedure)** with non-trivial design space. Authoring a worker brief without Director ratification of shape risks rework. Surfacing 3 carrier-shape options for ratification. + +## Carrier-shape options + +### Option α — Variant-tag projection on `RestResponseProjection` + +Extend the existing `RestResponseProjection` carrier (if extant; else introduce alongside `CoproductWireContract` at `dsl/extdeps/llm/anthropic.dag:20-30` precedent) with a per-variant projection field: + +```dag +type RestResponseProjection + = { request_path: String + , response_variant_tag: String + , response_body_field: List + } +``` + +Indexed by `(method, response_variant_tag)`. Resolver picks the matching projection by parsing the response wire-tag (e.g., `type` discriminator in Anthropic's content-block coproducts) and dispatching to the variant's projection. + +**Pro**: minimal new substrate; reuses `FieldProjection` shape; aligns with `CoproductWireContract::InternallyTaggedObject` (which Anthropic uses already at `:20-30`). +**Con**: tag-string IS a bridge — the rank-table risk of audit-row #14 family. Acceptable because tag strings are wire-protocol identity (not internal compiler identity), but worth flagging. + +### Option β — Sum-type metadata on `Declaration` + +Generalize: every coproduct `Declaration` carries optional `variant_projection_metadata: Option>`. The resolver finds the declaration via existing identity surface (declaration_by_name or DeclarationRef) and picks variant by structural variant-id, not wire string. + +**Pro**: structural — no string bridge. Reuses sum-type variant identity already in `Declaration` (TypeBody::Sum variant constructors per VariantConstruct lowerer at memory/MEMORY.md:201). +**Con**: heavier substrate change; couples REST-response-specific concern to general `Declaration`. May leak to other coproduct uses without need. + +### Option γ — Free-standing `CoproductProjection` carrier + +New top-level carrier in `dsl/extdeps/llm/wire_contracts.dag` (or similar): + +```dag +type CoproductProjection + = { coproduct_decl: DeclarationRef + , wire_tag_field: String // e.g., "type" + , variant_projections: Map + } +``` + +Lookup: `coproduct_projection_for(decl: DeclarationRef) -> CoproductProjection`. Wire-tag string lives in projection data, not in identity dispatch. + +**Pro**: localizes the wire-coproduct-dispatch concern to one named carrier; avoids polluting `Declaration`. DeclarationRef-keyed (not span.file-keyed) — clean of audit-row-#14 concerns. +**Con**: new carrier type; some duplication if `RestResponseProjection` already carries a similar shape. + +## Director ratification ask + +1. **Pick α / β / γ** (or surface a fourth option). Provisional Mgr-tier recommendation: **γ** — DeclarationRef-keyed, localized to wire-protocol concern, doesn't leak into `Declaration` general surface, avoids the tag-string-as-identity concern of α. +2. Confirm scope: carrier-only at S5, or carrier + 1 of 3 paydowns bundled? Current default per Q-Anthropic-Variant-Aware = carrier + ALL 3 paydowns separately (already briefed). Confirm S5 dispatch is **carrier-only**; the 3 paydowns dispatch in their own briefs. + +## On ratification — worker brief scope + +Will author execution brief covering: +- New carrier definition in chosen location (`dsl/extdeps/llm/wire_contracts.dag` per γ, or alternate per ratification) +- Indexing API (`coproduct_projection_for(decl) -> CoproductProjection` or analog) +- Resolver wiring point in `from`-path resolution (typed REST response projection consumer) +- Acceptance: §1.8 gates #29-#30 advance from declared → carrier-landed; #1702 branch unparks +- Bootstrap regen + clippy + workspace tests green +- Cross-Mgr handoff: 3 coproduct paydown briefs already authored (`r3-coproduct-{1,2,3}-*-worker.md`) ready to dispatch in their own PRs post-S5 land + +## Worker pin candidates (post-ratification) + +valiant-ibex-312 (recently freed post-#1933 IntPlatform/UIntPlatform land — substrate-fact-introduction precedent owner) OR smart-ram-167. Final pin at dispatch. + +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-07 per Director endorsement at gunbc#828 #issuecomment-4394293399 of authoring next 2-3 unbriefed items. From d82695049748bfdbbd8539ea0cc9adcb3026e7d3 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 05:25:31 +0000 Subject: [PATCH 03/50] =?UTF-8?q?docs(briefs):=20SourceSpan.file=20brief?= =?UTF-8?q?=20=E2=80=94=20same-slice=20prerequisite=20+=20section=20anchor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Director calibration (gunbc#2079 #issuecomment-...): 1. Promote ratchet-test cross-Mgr handoff from conditional Acceptance #4 to upfront same-slice BLOCKING prerequisite gate (per feedback_same_slice_dissolution_discipline). 2. Replace `r3-program-plan.md:353` line-cite with `§5 Y4 scope-clarification` section anchor (per feedback_section_anchors_over_line_numbers). Code-line anchors in bootstrap.rs left as-is (anchor sites worker navigates to). Co-Authored-By: Claude Opus 4.7 (1M context) --- ...ate-bridge-source-span-file-participation-worker.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md b/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md index 9811b03c9c9..738906aef43 100644 --- a/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md +++ b/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md @@ -2,11 +2,15 @@ **Sub-issue**: gunbc#1958 (parented under #1939 Substrate Mgr lane). **Sibling**: gunbc#1959 closed 2026-05-07 — already retired by PR #1272. -**Authority anchors**: `docs/briefs/bridge-retirement-audit-sourcespan-family.md` (19-row enumeration); `docs/r3-program-plan.md:353` Substrate-owned scope clarification; `src/v3/std/bridge_ledger.dag` row `bridge_source_span_file_participation_retired` (status=`Proposed`). +**Authority anchors**: `docs/briefs/bridge-retirement-audit-sourcespan-family.md` (19-row enumeration); `docs/r3-program-plan.md` **§5 Y4 scope-clarification** (current line 353 anchor — verify section heading at HEAD); `src/v3/std/bridge_ledger.dag` row `bridge_source_span_file_participation_retired` (status=`Proposed`). + +## Cross-Mgr prerequisite (same-slice blocking gate) + +`bridge_source_span_file_participation_retired` ratchet test (Verification-owned per `r3-v-bridge-ratchet-test-design.md`). If not yet authored at HEAD when worker starts, surface to Verification Mgr (#2075 / lane #1940) for ratchet authoring **AS A SAME-SLICE BLOCKING PREREQUISITE** — Substrate worker's PR does NOT merge until Verification's ratchet is in place. Do NOT proceed under "surface as follow-up" framing; the dissolution trigger (ratchet passing) IS a same-slice acceptance criterion. Sequence: Verification ratchet PR lands first → this Substrate retirement PR consumes it. ## Scope (Substrate-owned, narrow) -Per **r3-program-plan.md §5 line 353** Y4 scope-clarification: +Per **r3-program-plan.md §5 Y4 scope-clarification**: > Substrate-owned: `SourceSpan.file` participation checks (**hand-Rust audit sites only** — > `bootstrap.rs:519` doc-comment + `:137` / `:287` / `:309` hardcoded path strings; @@ -44,7 +48,7 @@ Authority constants: `BOOL_TYPES_FILE` (`dsl/std/types.dag`), `PIPELINE_AUTHORIT 1. `bootstrap.rs` no longer references `BOOL_TYPES_FILE` or `PIPELINE_AUTHORITY_FILE` outside doc-comments. 2. The two diagnostic paths (kernel Bool not-found, pipeline-authority error) carry typed `DiagnosticAttribution::BootstrapAuthority` with the appropriate `BootstrapAuthorityKey` variant — verified by `kernel_bool_path_a_diagnostic_carries_bootstrap_authority_attribution` (already exists at `:519+`) extended for the pipeline path if not present. 3. `src/v3/std/bridge_ledger.dag` row `bridge_source_span_file_participation_retired` advances `Proposed` → `Retired` for the Substrate-owned scope; ledger receipt mentions PR # + scope-narrowing (audit rows #2 + #6 only; rows #1, #3-5, #7-19 remain under their owners). -4. `dag.rs::bridge_source_span_file_participation_retired` ratchet test (if not already authored — Verification-owned per `r3-v-bridge-ratchet-test-design.md`) passes; if test doesn't exist yet, surface to Verification Mgr (#1940) for ratchet authoring as cross-Mgr handoff. +4. `dag.rs::bridge_source_span_file_participation_retired` ratchet test passes (authored by Verification per the **Cross-Mgr prerequisite** gate above; confirmed-present at HEAD before this PR merges). 5. Bootstrap regen: `cargo test -p v3-compiler bootstrap_regen_fresh -- --ignored` clean (path-string deletion must not perturb regen byte-snapshot). 6. Full suite: `cargo test --workspace --exclude v2-compiler-tests` green; `cargo clippy --all-targets -- -D warnings` clean. From f26a582bdf8c275fb4a74e8a4dc5a9d69f659fee Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 05:28:12 +0000 Subject: [PATCH 04/50] =?UTF-8?q?docs(briefs):=20SourceSpan.file=20brief?= =?UTF-8?q?=20=E2=80=94=20umbrella=20stays=20Open=20per=20P2=20ledger=20di?= =?UTF-8?q?scipline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address BLOCKING inline review at line 46: bridge_source_span_file_participation_retired is an Open umbrella whose green predicate is "no production code path consults SourceSpan.file" per r3-structure.md:115. Partial retirement was explicitly rejected 2026-04-29 (Director acceptance #1130 / dispatch #1139). Changes: - Add Ledger-discipline preamble: umbrella row stays Open; receipt updates audit-packet enumeration, NOT bridge_ledger.dag. - Acceptance #3 reframed: do NOT mutate bridge_ledger.dag; mark rows #2 + #6 retired in the audit packet only. - Authority anchor updated: status=Open (not Proposed); add r3-structure.md:115 + bridge_ledger.dag:125-129 line refs. - Cross-Mgr section reframed: umbrella ratchet cannot flip on this PR alone; Verification's ledger-zero audit progress field is post-merge tracking, not a same-slice pre-merge blocker. Reconciles with BLOCKING finding (Director calibration #1 assumed umbrella ratchet could flip on partial retirement, which r3-structure.md:115 forbids). Co-Authored-By: Claude Opus 4.7 (1M context) --- ...bridge-source-span-file-participation-worker.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md b/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md index 738906aef43..2635216a14c 100644 --- a/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md +++ b/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md @@ -2,11 +2,17 @@ **Sub-issue**: gunbc#1958 (parented under #1939 Substrate Mgr lane). **Sibling**: gunbc#1959 closed 2026-05-07 — already retired by PR #1272. -**Authority anchors**: `docs/briefs/bridge-retirement-audit-sourcespan-family.md` (19-row enumeration); `docs/r3-program-plan.md` **§5 Y4 scope-clarification** (current line 353 anchor — verify section heading at HEAD); `src/v3/std/bridge_ledger.dag` row `bridge_source_span_file_participation_retired` (status=`Proposed`). +**Authority anchors**: `docs/briefs/bridge-retirement-audit-sourcespan-family.md` (19-row enumeration); `docs/r3-program-plan.md` **§5 Y4 scope-clarification** (current line 353 anchor — verify section heading at HEAD); `src/v3/std/bridge_ledger.dag:125-129` row `bridge_source_span_file_participation_retired` (status=`Open`); `docs/r3-structure.md:115` umbrella-gate framing. -## Cross-Mgr prerequisite (same-slice blocking gate) +## Ledger-discipline preamble (P2 single-authority) -`bridge_source_span_file_participation_retired` ratchet test (Verification-owned per `r3-v-bridge-ratchet-test-design.md`). If not yet authored at HEAD when worker starts, surface to Verification Mgr (#2075 / lane #1940) for ratchet authoring **AS A SAME-SLICE BLOCKING PREREQUISITE** — Substrate worker's PR does NOT merge until Verification's ratchet is in place. Do NOT proceed under "surface as follow-up" framing; the dissolution trigger (ratchet passing) IS a same-slice acceptance criterion. Sequence: Verification ratchet PR lands first → this Substrate retirement PR consumes it. +**The umbrella ledger row stays `Open`.** Per `docs/r3-structure.md:115` and Director acceptance #1130 / dispatch #1139 (2026-04-29): partial string-check retirement was **explicitly rejected** because parallel participation rules would remain. The umbrella's green predicate is *"no production code path consults `SourceSpan.file` for participation/inclusion logic"* — all-or-nothing. Production inclusion sites enumerated at `r3-structure.md:115` (in `lens_apply.rs` / `lower.rs` / `emit.rs`) are NOT in this Substrate slice's scope; they retire under their owners. + +This PR's outcome = **retire the bootstrap.rs subset of audit-packet rows #2 + #6 only**. Receipt = update the audit-packet enumeration table at `docs/briefs/bridge-retirement-audit-sourcespan-family.md` to mark rows #2 + #6 retired with the PR # citation. **Do NOT mutate `bridge_ledger.dag`** for this PR — the umbrella row stays `Open` until ALL production sites in the audit packet (rows #1, #3-19 minus test-only / out-of-family) are retired across owner-scoped PRs. + +## Cross-Mgr coordination (informational; NOT a same-slice blocker) + +The umbrella `bridge_source_span_file_participation_retired` ratchet (Verification's `bridge_retirement_ledger_zero` audit per `r3-v-bridge-retirement-ledger-zero-audit.md`) cannot flip green on this PR alone — production sites in `lens_apply.rs` / `lower.rs` / `emit.rs` (per `r3-structure.md:115`) remain post-this-PR. Verification's ledger-zero audit advances when ALL audit-packet rows retire; this PR contributes rows #2 + #6 progress only. No same-slice ratchet-test gate applies to this PR; ping Verification Mgr (#2075 / lane #1940) on merge so they can update the ledger-zero audit progress field, but their action is **post-merge tracking**, not a pre-merge blocker. ## Scope (Substrate-owned, narrow) @@ -47,7 +53,7 @@ Authority constants: `BOOL_TYPES_FILE` (`dsl/std/types.dag`), `PIPELINE_AUTHORIT 1. `bootstrap.rs` no longer references `BOOL_TYPES_FILE` or `PIPELINE_AUTHORITY_FILE` outside doc-comments. 2. The two diagnostic paths (kernel Bool not-found, pipeline-authority error) carry typed `DiagnosticAttribution::BootstrapAuthority` with the appropriate `BootstrapAuthorityKey` variant — verified by `kernel_bool_path_a_diagnostic_carries_bootstrap_authority_attribution` (already exists at `:519+`) extended for the pipeline path if not present. -3. `src/v3/std/bridge_ledger.dag` row `bridge_source_span_file_participation_retired` advances `Proposed` → `Retired` for the Substrate-owned scope; ledger receipt mentions PR # + scope-narrowing (audit rows #2 + #6 only; rows #1, #3-5, #7-19 remain under their owners). +3. **Ledger discipline (per Ledger-discipline preamble):** `src/v3/std/bridge_ledger.dag` row stays `Open` — do NOT mutate. Audit-packet table at `docs/briefs/bridge-retirement-audit-sourcespan-family.md` updated to mark **rows #2 + #6 only** retired with this PR's # citation (rows #1, #3-5, #7-19 remain under their owners; umbrella row advances to `Retired` only when ALL production sites are retired across owner-scoped PRs). 4. `dag.rs::bridge_source_span_file_participation_retired` ratchet test passes (authored by Verification per the **Cross-Mgr prerequisite** gate above; confirmed-present at HEAD before this PR merges). 5. Bootstrap regen: `cargo test -p v3-compiler bootstrap_regen_fresh -- --ignored` clean (path-string deletion must not perturb regen byte-snapshot). 6. Full suite: `cargo test --workspace --exclude v2-compiler-tests` green; `cargo clippy --all-targets -- -D warnings` clean. From beabfa41f91053fcef8f830aaf08eb94415417fd Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 05:36:43 +0000 Subject: [PATCH 05/50] =?UTF-8?q?docs(briefs):=20S5=20CoproductProjection?= =?UTF-8?q?=20worker=20brief=20=E2=80=94=20=CE=B3=20ratified=20(#1947)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Director ratification of option γ at gunbc#828 #issuecomment-4394369848. Free-standing CoproductProjection carrier in src/v3/std/, DeclarationRef-keyed, typed WireTagValue leaf, 4 same-slice acceptance gates. Surfaces 3 substrate observations for STOP-and-PING (DeclarationRef String alias; FieldRef does-not-exist-at-HEAD; tag_field String asymmetry) — worker must escalate, not silently work around. PB Mgr cross-Mgr ping at carrier landing (heads-up, not blocker). Co-Authored-By: Claude Opus 4.7 (1M context) --- ...-s5-coproduct-projection-carrier-worker.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md diff --git a/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md b/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md new file mode 100644 index 00000000000..eed5d47105e --- /dev/null +++ b/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md @@ -0,0 +1,67 @@ +# Worker brief — Substrate S5 `CoproductProjection` carrier (γ) + +**Sub-issue**: gunbc#1947 (parented under #1939 Substrate Mgr lane). +**Authority**: Director ratification of **option γ** at gunbc#828 #issuecomment-4394369848 (2026-05-07); supersedes the canvas at `docs/briefs/r3-substrate-s5-variant-aware-projection-carrier-canvas.md` (canvas may be deleted after this brief lands). +**Closure predicate**: §1.8 gates #29-#30 (T-Anthropic-Wire 2 gates); unblocks Anthropic #1702 re-dispatch + 3 already-briefed coproduct paydowns (`r3-coproduct-{1,2,3}-*-worker.md`). + +## Scope + +Substrate-fact-introduction (P1 procedure): typed REST response projection carrier for coproduct response bodies. Free-standing carrier keyed by `DeclarationRef`; wire-tag in DATA, not identity. + +## Carrier shape (binding per Director) + +**Location**: `src/v3/std/coproduct_projection.dag` (verify-via-grep at HEAD that this file does not yet exist; if a near-neighbor already hosts compatible projection types, fold in cleanly). **NOT** `dsl/std/` — this is compiler-internal projection substrate, not user-facing language vocabulary. Contrast: `dsl/std/serialization.dag::CoproductWireContract` lives in `dsl/std/` because users declare wire contracts; `CoproductProjection` is for internal projection-resolver dispatch. + +**Initial shape** (refine in implementation as ergonomics demand): + +```dag +type CoproductProjection { + declaration: DeclarationRef + variant_field_projections: Map + wire_tag_field: FieldRef // which field carries the wire-tag discriminator + wire_tag_values: Map +} +``` + +`WireTagValue` MUST be a typed leaf (sum type or named record), **not** `String`. If Anthropic + REST both serialize as string at the wire boundary, encode the typed-on-our-side / serialized-at-emit pattern: `WireTagValue` stays typed in substrate; serialization adapter handles `String <-> WireTagValue` at the wire boundary. + +### Substrate observations the worker must surface (do not silently work around) + +1. **`DeclarationRef = String` alias at `dsl/std/serialization.dag:16`** — Director's ratification framing emphasizes "typed key, not string identity (avoids audit row #14 collision)". The current `DeclarationRef` IS a String alias. If `CoproductProjection.declaration: DeclarationRef` is to be a real typed key, either (a) `DeclarationRef` itself must promote to a structural typed shape (e.g., `(module: ModuleId, name: DeclarationName)` record) — substantial substrate change, surface as scope question; OR (b) accept the alias as a soft-typed nominal handle for this carrier slice and note the future-promotion debt. **STOP-and-PING the Mgr** before proceeding; don't choose silently. + +2. **`FieldRef` does not exist at HEAD** as a standalone type (only `InputFieldRef` mentioned in `services.dag:34`). The brief asks for a typed `FieldRef` carrier. Either reuse `InputFieldRef` if its semantics generalize, or introduce `FieldRef` alongside `CoproductProjection`. Choose pragmatically; don't introduce a parallel-authority second `FieldRef`. + +3. **`InternallyTaggedObject.tag_field: String`** at `dsl/std/serialization.dag:49` already uses a String tag-field. The new typed `FieldRef` shape will create a typed/string asymmetry between the two carriers. Either (a) `CoproductProjection.wire_tag_field` is `FieldRef` and the asymmetry is documented as tracked debt (eventually `InternallyTaggedObject` migrates), or (b) accept `String` for `wire_tag_field` to match. Director's binding constraint #2 is explicit: typed leaf `WireTagValue`; the `wire_tag_field` field shape is less hard-binding. Recommend (a) — typed introduction here, debt note for `InternallyTaggedObject` migration. + +## Acceptance gates (same-slice, all must pass) + +1. **Carrier landed** in `src/v3/std/coproduct_projection.dag` (or chosen location post-grep) with the shape above (modulo STOP-resolved decisions on items 1-3). +2. **Anthropic #1702 re-dispatch wires through `CoproductProjection`** — NOT through any `response_variant_tag: String` shim. The `from`-path resolver consumes `CoproductProjection` to dispatch on coproduct response variants. (Anthropic #1702 work is preserved on branch `codex/cc1-target-integer-structural-fold` per Grounding G5; merge unblocks on this carrier.) +3. **At least one of the 3 already-briefed coproduct paydowns consumes `CoproductProjection`** — proof of multi-consumer composability. Refutes "carrier with single consumer is just an interface" anti-pattern. Worker picks the easiest of `r3-coproduct-{1,2,3}-*-worker.md` to thread through; documents which one in the PR description. The other two paydowns dispatch in their own PRs after. +4. **No `Option<>` wrapping on `Declaration`** — verify via grep at acceptance time that no `variant_projection_metadata: Option<...>` field was added to `Declaration` (per Director's β-rejection rationale; `feedback_node_not_god_struct` analog). +5. Bootstrap regen: `cargo test -p v3-compiler bootstrap_regen_fresh -- --ignored` clean (carrier is added; no existing surface should perturb). +6. Full suite: `cargo test --workspace --exclude v2-compiler-tests` green; `cargo clippy --all-targets -- -D warnings` clean. + +## STOP / PING criteria + +- **STOP** before proceeding if: + - `DeclarationRef` typed-promotion question (substrate observation #1) cannot be answered locally — surface to Mgr (warm-wolf-698 / inbox #2068). + - `FieldRef` introduction cascades into emit/typecheck surfaces beyond `coproduct_projection.dag` and the chosen consumer paydown — surface scope-creep. + - At carrier-shape implementation time, `WireTagValue` typed-leaf shape forces a String<->typed adapter that has nontrivial bootstrap-regen impact — surface. +- **PING** PB Mgr (#2074 / `warm-dove-618`) at carrier-landing time per Director's cross-Mgr coordination note: PB owns `T-LensProducer-Retirement` which may consume similar projection shapes. They may have downstream needs constraining the carrier. **This is a heads-up, not a same-slice blocker** — PB's input refines future iterations. + +## Cross-Mgr coordination + +- **Anthropic #1702 (Grounding G5)**: re-dispatch unblocks at carrier-landing. Heads-up to Grounding Mgr (#1944 / `clever-otter-128` if active) at PR-open time. +- **PB Mgr (#2074)**: see PING above. +- **Verification Mgr (#2075)**: ratchet authoring for `bridge_*_carrier_landed`-shaped gates is Verification's standing concern; no specific same-slice handoff expected here unless ledger row needs to advance (which on a carrier-introduction is normal — §1.8 gates #29-#30 advance to `CONSUMER_LANDED` per closure predicate). + +## Worker pin (Mgr disposition) + +**valiant-ibex-312** preferred — substrate-fact-introduction precedent owner (delivered IntPlatform/UIntPlatform via PR #1933). Fallback: smart-ram-167. Final pin at dispatch. + +## Auto-spawn caveat + +Per Director's note 2026-05-07: worker auto-spawn from Mgr-context is currently bug-affected (PM investigating); manual dispatch via PR creation under Mgr session branch is acceptable for low-risk shapes but L+ workers should hold until fix. This carrier is L-sized (substrate-fact-introduction + 1 multi-consumer paydown thread-through); recommend **HOLD dispatch until auto-spawn fix lands** or operator-directed manual route. Brief is dispatch-ready regardless. + +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-07 per Director γ-ratification at gunbc#828 #issuecomment-4394369848. From 925a412b0de5ed1209eb48d7336327effc5bdc8a Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 05:38:41 +0000 Subject: [PATCH 06/50] =?UTF-8?q?docs(briefs):=20SourceSpan.file=20brief?= =?UTF-8?q?=20=E2=80=94=20resolve=20Acceptance=20#4=20/=20Cross-Mgr=20cont?= =?UTF-8?q?radiction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit openai-pro REQUEST_CHANGES at PR #2079 #issuecomment-... flagged Acceptance #4 ("ratchet test passes ... confirmed-present at HEAD before merge") contradicting the reframed Cross-Mgr section ("No same-slice ratchet-test gate applies; post-merge tracking only"). Both said different things about whether the umbrella ratchet is a pre-merge blocker. Resolution: Acceptance #4 reframed to explicitly state "No umbrella-ratchet pre-merge gate" — worker does NOT wait for Verification ratchet authoring; acceptance for this slice is the audit-packet receipt update in #3. Cross-Mgr handoff also updated to remove "ratchet authoring" from Verification's same-slice duties. Co-Authored-By: Claude Opus 4.7 (1M context) --- ...-substrate-bridge-source-span-file-participation-worker.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md b/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md index 2635216a14c..b4b05d79f6c 100644 --- a/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md +++ b/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md @@ -54,7 +54,7 @@ Authority constants: `BOOL_TYPES_FILE` (`dsl/std/types.dag`), `PIPELINE_AUTHORIT 1. `bootstrap.rs` no longer references `BOOL_TYPES_FILE` or `PIPELINE_AUTHORITY_FILE` outside doc-comments. 2. The two diagnostic paths (kernel Bool not-found, pipeline-authority error) carry typed `DiagnosticAttribution::BootstrapAuthority` with the appropriate `BootstrapAuthorityKey` variant — verified by `kernel_bool_path_a_diagnostic_carries_bootstrap_authority_attribution` (already exists at `:519+`) extended for the pipeline path if not present. 3. **Ledger discipline (per Ledger-discipline preamble):** `src/v3/std/bridge_ledger.dag` row stays `Open` — do NOT mutate. Audit-packet table at `docs/briefs/bridge-retirement-audit-sourcespan-family.md` updated to mark **rows #2 + #6 only** retired with this PR's # citation (rows #1, #3-5, #7-19 remain under their owners; umbrella row advances to `Retired` only when ALL production sites are retired across owner-scoped PRs). -4. `dag.rs::bridge_source_span_file_participation_retired` ratchet test passes (authored by Verification per the **Cross-Mgr prerequisite** gate above; confirmed-present at HEAD before this PR merges). +4. **No umbrella-ratchet pre-merge gate** (per Cross-Mgr coordination section): the umbrella `bridge_source_span_file_participation_retired` ratchet predicate cannot flip green on this slice alone — production sites in `lens_apply.rs` / `lower.rs` / `emit.rs` remain post-this-PR. Worker does NOT wait for Verification ratchet authoring. Acceptance for this slice is the audit-packet receipt update in #3 above; Verification's ledger-zero audit progress field updates **post-merge**. 5. Bootstrap regen: `cargo test -p v3-compiler bootstrap_regen_fresh -- --ignored` clean (path-string deletion must not perturb regen byte-snapshot). 6. Full suite: `cargo test --workspace --exclude v2-compiler-tests` green; `cargo clippy --all-targets -- -D warnings` clean. @@ -67,7 +67,7 @@ Authority constants: `BOOL_TYPES_FILE` (`dsl/std/types.dag`), `PIPELINE_AUTHORIT ## Cross-Mgr handoff - **PB Mgr**: audit row #6's sibling (`bridge_include_str_side_channels_retired` for `pipeline_authority.rs` compile-body drift) is PB-owned; this Substrate slice does NOT touch the include_str path, only the diagnostic-span path. No cross-PR coordination needed unless audit row interpretation drifts at execution time. -- **Verification Mgr**: ratchet authoring + ledger-zero audit advancement. +- **Verification Mgr**: post-merge ledger-zero audit progress update (per `r3-v-bridge-retirement-ledger-zero-audit.md`); no same-slice ratchet authoring required for this slice. ## Worker disposition From 5b3a9f8405e95960b9f4198b1dc943910f82bb2c Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 01:47:35 -0400 Subject: [PATCH 07/50] =?UTF-8?q?WIP:=20R3=20Substrate=20Mgr=20=E2=80=94?= =?UTF-8?q?=20lane=20through=20R3=20close?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...strate-s5-coproduct-projection-carrier-worker.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md b/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md index eed5d47105e..264c0d059d9 100644 --- a/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md +++ b/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md @@ -25,13 +25,18 @@ type CoproductProjection { `WireTagValue` MUST be a typed leaf (sum type or named record), **not** `String`. If Anthropic + REST both serialize as string at the wire boundary, encode the typed-on-our-side / serialized-at-emit pattern: `WireTagValue` stays typed in substrate; serialization adapter handles `String <-> WireTagValue` at the wire boundary. -### Substrate observations the worker must surface (do not silently work around) +### Substrate observations — Director pre-ratified dispositions (gunbc#828 #issuecomment-4394416049) -1. **`DeclarationRef = String` alias at `dsl/std/serialization.dag:16`** — Director's ratification framing emphasizes "typed key, not string identity (avoids audit row #14 collision)". The current `DeclarationRef` IS a String alias. If `CoproductProjection.declaration: DeclarationRef` is to be a real typed key, either (a) `DeclarationRef` itself must promote to a structural typed shape (e.g., `(module: ModuleId, name: DeclarationName)` record) — substantial substrate change, surface as scope question; OR (b) accept the alias as a soft-typed nominal handle for this carrier slice and note the future-promotion debt. **STOP-and-PING the Mgr** before proceeding; don't choose silently. +These were flagged as STOP-and-PING in canvas; Director pre-ratified the dispositions so worker can proceed without re-pinging unless evidence forces escalation. -2. **`FieldRef` does not exist at HEAD** as a standalone type (only `InputFieldRef` mentioned in `services.dag:34`). The brief asks for a typed `FieldRef` carrier. Either reuse `InputFieldRef` if its semantics generalize, or introduce `FieldRef` alongside `CoproductProjection`. Choose pragmatically; don't introduce a parallel-authority second `FieldRef`. +1. **`DeclarationRef = String` alias at `dsl/std/serialization.dag:16`** — **Disposition: (b) accept alias for this slice + debt note.** Promoting `DeclarationRef` to structural typed shape mid-slice is cascade scope creep per `feedback_construction_over_ratchets`. Document the soft-typed nominal handle in `CoproductProjection` carrier comments; add a debt-paydown row pointing at future structural promotion of `DeclarationRef`. **Re-escalate to Mgr only if** worker surfaces evidence the alias actively breaks something same-slice (e.g., Anthropic #1702 wiring triggers a string-identity bridge per `feedback_opaque_strings_attract_heuristics`). -3. **`InternallyTaggedObject.tag_field: String`** at `dsl/std/serialization.dag:49` already uses a String tag-field. The new typed `FieldRef` shape will create a typed/string asymmetry between the two carriers. Either (a) `CoproductProjection.wire_tag_field` is `FieldRef` and the asymmetry is documented as tracked debt (eventually `InternallyTaggedObject` migrates), or (b) accept `String` for `wire_tag_field` to match. Director's binding constraint #2 is explicit: typed leaf `WireTagValue`; the `wire_tag_field` field shape is less hard-binding. Recommend (a) — typed introduction here, debt note for `InternallyTaggedObject` migration. +2. **`FieldRef` does not exist at HEAD; only `InputFieldRef` at `services.dag:34`** — **Disposition: grep-decide between two structural patterns.** Worker greps `services.dag` + adjacent surface for `InputFieldRef` consumers BEFORE deciding (per `feedback_emitter_workaround_is_gap_symptom` + `feedback_audit_adjacent_authority_first`): + - If `InputFieldRef` carries input-specific structural context → introduce `FieldRef` as the general carrier; treat `InputFieldRef` as specialization (compose, not parallel-author). + - If `InputFieldRef` is just narrowly-named for an input use-case → rename to `FieldRef` (per `feedback_naming_is_aliasing` — rename is structural-cheap). + - **Do NOT** manufacture a parallel-authority second `FieldRef`. + +3. **`InternallyTaggedObject.tag_field: String` asymmetry at `dsl/std/serialization.dag:49`** — **Disposition: typed introduction here + debt note for future migration.** Per `feedback_parallel_representation_debt`, the typed/string asymmetry is recorded as known shape mismatch with named dissolution (eventual `InternallyTaggedObject.tag_field: FieldRef` migration). Do NOT fix in same slice unless evidence shows the asymmetry actively blocks a downstream consumer. ## Acceptance gates (same-slice, all must pass) From 2900228b381a531afaa5d6a0e3ee67dd5dda8efe Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 05:47:48 +0000 Subject: [PATCH 08/50] =?UTF-8?q?docs(briefs):=20S5=20brief=20=E2=80=94=20?= =?UTF-8?q?absorb=20Director=20pre-ratifications=20for=203=20STOP-and-PING?= =?UTF-8?q?=20items?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Director pre-ratified dispositions at gunbc#828 #issuecomment-4394416049: 1. DeclarationRef alias: accept (b) + debt note (re-escalate only on same-slice break) 2. FieldRef: grep-decide between InputFieldRef-as-specialization vs rename 3. tag_field String asymmetry: typed introduction + debt note for migration Worker proceeds without re-pinging unless evidence forces escalation. STOP-criteria section narrowed accordingly. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../r3-substrate-s5-coproduct-projection-carrier-worker.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md b/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md index 264c0d059d9..aaa3d188087 100644 --- a/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md +++ b/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md @@ -50,8 +50,8 @@ These were flagged as STOP-and-PING in canvas; Director pre-ratified the disposi ## STOP / PING criteria - **STOP** before proceeding if: - - `DeclarationRef` typed-promotion question (substrate observation #1) cannot be answered locally — surface to Mgr (warm-wolf-698 / inbox #2068). - - `FieldRef` introduction cascades into emit/typecheck surfaces beyond `coproduct_projection.dag` and the chosen consumer paydown — surface scope-creep. + - Substrate observation #1 (`DeclarationRef` alias): evidence emerges mid-slice that the alias actively breaks something (e.g., string-identity bridge on Anthropic #1702 wire) — re-escalate; default disposition (b) otherwise applies without re-ping. + - Substrate observation #2 (`FieldRef` introduction): cascades into emit/typecheck surfaces beyond `coproduct_projection.dag` + the chosen consumer paydown — surface scope-creep. - At carrier-shape implementation time, `WireTagValue` typed-leaf shape forces a String<->typed adapter that has nontrivial bootstrap-regen impact — surface. - **PING** PB Mgr (#2074 / `warm-dove-618`) at carrier-landing time per Director's cross-Mgr coordination note: PB owns `T-LensProducer-Retirement` which may consume similar projection shapes. They may have downstream needs constraining the carrier. **This is a heads-up, not a same-slice blocker** — PB's input refines future iterations. From 0e8724bccbdb656c637cbdd6ea46b47c3e75ef46 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 05:56:33 +0000 Subject: [PATCH 09/50] =?UTF-8?q?docs(r3):=20Q-Reification=20Gate=20A=20re?= =?UTF-8?q?ceipt=20=E2=80=94=20Option=20A=20(Dag-as-carrier)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Director ratification at gunbc#828 #issuecomment-4394427814 + proposal merge at PR #2096 (commit fec869202): src/v3/std/substrate.dag::Dag IS the reflected program; no new substrate carrier required. ReflectedProgram rejected. Gate A patches: 1. r3-program-plan.md §10.3: new Q-Reification row marked RATIFIED with PR #2096 merge link + Gate A receipt scope (this PR + #1960 closed-as-non-addition). 2. r3-v-pattern-a-tc1-v1-worker.md: 3 sites — status header (Q-Reification CLEARED, Branch B η non-vacuity remains), worker-pin gate, E6-G1.a/E3 producer dependency. Replaces ReflectedProgram with consumer-wiring nuance: lens fold consumes Dag via .dag body authority through Evaluator. 3. r3-pr-e6-g1a-option3-static-lens-worker.md: 2 sites — same nuance: deferred work is consumer-wiring, NOT a separate carrier. 4. r3-pr-e8-w1-producer-contract-test-plan-worker.md: 1 site — fold-over-Dag reframe. Receipt of pass-by-construction: this PR adds NO new .dag declaration to src/v3/std/. The ratification is structurally a non-addition (Option A correctness proof per same-slice dissolution discipline). Co-Authored-By: Claude Opus 4.7 (1M context) --- .../r3-pr-e6-g1a-option3-static-lens-worker.md | 12 +++++++++--- ...r3-pr-e8-w1-producer-contract-test-plan-worker.md | 6 ++++-- docs/briefs/r3-v-pattern-a-tc1-v1-worker.md | 6 +++--- docs/r3-program-plan.md | 1 + 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/docs/briefs/r3-pr-e6-g1a-option3-static-lens-worker.md b/docs/briefs/r3-pr-e6-g1a-option3-static-lens-worker.md index e1b011f1213..b045265b467 100644 --- a/docs/briefs/r3-pr-e6-g1a-option3-static-lens-worker.md +++ b/docs/briefs/r3-pr-e6-g1a-option3-static-lens-worker.md @@ -13,7 +13,10 @@ whose non-function fields are projected through the evaluator, and whose carrier. This is not a reflected-program fold. Lens-over-`Dag` folding is deferred to -Q-Reification / `ReflectedProgram` typed declaration-reference carrier work. +follow-on consumer-wiring work (`Dag` IS the reflected program per Q-Reification +Option A ratified 2026-05-07 [#2096](https://github.com/gunb-ai/gunbc/pull/2096); +the deferred work is **wiring lens-fold consumers through `.dag` body authority +via the Evaluator**, NOT a separate `ReflectedProgram` carrier). ## Context @@ -143,8 +146,11 @@ The implementation PR must demonstrate: 7. The test proves no `lens_apply`, `eval_substrate_reify`, or reflection helper is imported or called. 8. PR body explicitly says: this is a lens consumer-wiring mechanism - demonstration; lens-over-`Dag` folding is deferred to - `ReflectedProgram` / typed declaration-reference carrier work. + demonstration; lens-over-`Dag` folding is deferred to follow-on + consumer-wiring (`Dag` IS the reflected program per Q-Reification Option A + ratified 2026-05-07 [#2096](https://github.com/gunb-ai/gunbc/pull/2096); the + deferred work is wiring fold consumers through `.dag` body authority via the + Evaluator, NOT a separate `ReflectedProgram` carrier). Validation should be the narrowest relevant test target plus any repository format/check command normally required for touched files. diff --git a/docs/briefs/r3-pr-e8-w1-producer-contract-test-plan-worker.md b/docs/briefs/r3-pr-e8-w1-producer-contract-test-plan-worker.md index 6543123796d..b191760dde0 100644 --- a/docs/briefs/r3-pr-e8-w1-producer-contract-test-plan-worker.md +++ b/docs/briefs/r3-pr-e8-w1-producer-contract-test-plan-worker.md @@ -181,8 +181,10 @@ slice requires any of these: - broadening W1 beyond Rust / Int / one named output bind before typed observation authority lands; - treating #1857 as runner, E8, Q-Reification, or lens-over-`Dag` authority; -- using `lens_apply.rs`, reflected-program folding, or `ReflectedProgram` to - justify W1; +- using `lens_apply.rs`, reflected-program folding, or fold-over-`Dag` (per + Q-Reification Option A ratified 2026-05-07 [#2096](https://github.com/gunb-ai/gunbc/pull/2096), + `Dag` IS the reflected program; no separate `ReflectedProgram` carrier exists) + to justify W1; - executing fixture `rust_emit_output` / `dag_eval_output` stub bodies as producer semantics; - comparing emitted source, raw stdout bytes, diagnostics, or exit code as diff --git a/docs/briefs/r3-v-pattern-a-tc1-v1-worker.md b/docs/briefs/r3-v-pattern-a-tc1-v1-worker.md index 311f18705b8..5fd6e7144c0 100644 --- a/docs/briefs/r3-v-pattern-a-tc1-v1-worker.md +++ b/docs/briefs/r3-v-pattern-a-tc1-v1-worker.md @@ -1,6 +1,6 @@ # R3 Pattern-A — TC1 first executable slice (V1) Worker Brief -**Status:** **HELD** — **Q-Reification** STOP + **Director η non-vacuity (Branch B)** 2026-05-06 ([gunbc#828](https://github.com/gunb-ai/gunbc/issues/828)). **Q-PAFS Path A** remains **ACCEPTED** (PR [#1824](https://github.com/gunb-ai/gunbc/pull/1824) merge record on `main`). **V1 (`tc1_eta_equivalence_executable`) unpairs** from Evaluator **E3 Option 3** narrow **argument-opaque** representative slice for **TC1 acceptance** — that shape yields **vacuous** `BinaryDimensionReportEquals` (constant `DimensionReport`); it cannot honestly close the gate against [`r3-v-tc1-eta-equivalence-deeper-analysis.md`](r3-v-tc1-eta-equivalence-deeper-analysis.md) §What TC1 Asserts + §Strict-Fire Extension Surface. **Resume dispatch** only after **Q-Reification + ReflectedProgram\** (real lens-over-Dag fold, non-vacuous η obligation) **or** Director-visible §1.8 / program-plan semantics revision (explicit “plumbing-only” TC1 milestone — **not** ratified 2026-05-06). **Pre-auth queue:** patch this brief when Q-Reification / carrier land — do **not** replace wholesale. +**Status:** **HELD** — **Director η non-vacuity (Branch B)** 2026-05-06 ([gunbc#828](https://github.com/gunb-ai/gunbc/issues/828)). **Q-Reification CLEARED 2026-05-07** ([Option A ratified](https://github.com/gunb-ai/gunbc/pull/2096), `Dag` IS the reflected program; no separate carrier). **Q-PAFS Path A** remains **ACCEPTED** (PR [#1824](https://github.com/gunb-ai/gunbc/pull/1824) merge record on `main`). **V1 (`tc1_eta_equivalence_executable`) unpairs** from Evaluator **E3 Option 3** narrow **argument-opaque** representative slice for **TC1 acceptance** — that shape yields **vacuous** `BinaryDimensionReportEquals` (constant `DimensionReport`); it cannot honestly close the gate against [`r3-v-tc1-eta-equivalence-deeper-analysis.md`](r3-v-tc1-eta-equivalence-deeper-analysis.md) §What TC1 Asserts + §Strict-Fire Extension Surface. **Resume dispatch** only after lens fold consumes `Dag` via `.dag` body authority through Evaluator (real lens-over-Dag fold, non-vacuous η obligation) **or** Director-visible §1.8 / program-plan semantics revision (explicit "plumbing-only" TC1 milestone — **not** ratified 2026-05-06). **Q-Reification gate is cleared**; remaining hold is Branch B η non-vacuity only. **Parent:** [`docs/briefs/r3-verification-manager.md`](r3-verification-manager.md) — absorbed formal-grounding / Pattern-A cluster (not a fourth lane; see [`docs/r3-structure.md`](../r3-structure.md) §"Manager structure"). @@ -26,7 +26,7 @@ Gates **#12–#14** (TC2 / TC3 / RustDagIsomorphism executables) stay **DECLARED | --- | --- | --- | | **Primary** | **bold-crane-790** ([gunbc#1748](https://github.com/gunb-ai/gunbc/issues/1748)) | **Track A** ( **V6** ledger audit, TC2/TC3/RustDagIso, partner-scope PRs per schedule): when session active **and** **V6** reaches a **clean checkpoint** acceptable to Verification Mgr — route **those** PRs through bold-crane. **`tc1_eta_equivalence_executable` / TC1 V1 slice excluded** until Branch B hold clears (above). | | **Alternate** | **New worker** (spawn per `feedback_idle_workers_dispatchable_directly`) | If bold-crane saturated on **V6** or archived — substitute for **non-TC1-V1** Track A work; do **not** interpret as TC1 dispatch unblock. | -| **TC1 V1** | bold-crane (when **unheld**) | Same primary pin resumes **only** when **Q-Reification + ReflectedProgram\** (or revised §1.8 TC1 semantics) satisfies non-vacuous η per Director ratification. | +| **TC1 V1** | bold-crane (when **unheld**) | Same primary pin resumes **only** when lens fold over `Dag` (per Q-Reification Option A; `Dag` IS the reflected program) consumes `.dag` body authority through Evaluator with non-vacuous η obligation, **or** revised §1.8 TC1 semantics satisfies non-vacuous η per Director ratification. | **cool-heron-521** remains on **V2 / V4 / V5** prep per partition; **not** the default home for V1 unless explicitly redirected. @@ -51,7 +51,7 @@ Hold **without** widening by inertia: | Dependency | Owner | Why | | --- | --- | --- | -| **E6-G1.a / E3 producer** | Evaluator Mgr | Fold must yield reports that **depend on reflected program shape** enough for **non-vacuous η-invariance** — **not** satisfied by **argument-opaque** `read`/`validate` (PR #1844 strict shape). **Blocked** until **Q-Reification** + **ReflectedProgram\** (or equivalent) lands **and** STOP clears; then TC1 V1 may re-pair on **ratified** producer contract. | +| **E6-G1.a / E3 producer** | Evaluator Mgr | Fold must yield reports that **depend on reflected program shape** enough for **non-vacuous η-invariance** — **not** satisfied by **argument-opaque** `read`/`validate` (PR #1844 strict shape). **Q-Reification cleared 2026-05-07 (Option A: `Dag` IS the reflected program)**; remaining block is non-vacuous η obligation via lens fold consuming `Dag` body authority through Evaluator. TC1 V1 re-pairs on ratified producer contract once that fold lands. | | **T-Substrate-Lens-Primitive + lens producer retirement progress** | Substrate / PB lanes | Path A assumes existing fold machinery; no parallel `lens_apply` interpretation for the fold receipts. | | **Representative lens set + eta pair declaration refs** | Substrate (facts) + Verification (fixture refs) | Finite, Director-visible set enumerated in `.dag` / declarations — not “all `Lens`” in V1. | diff --git a/docs/r3-program-plan.md b/docs/r3-program-plan.md index f01e869be9e..ceef9abb875 100644 --- a/docs/r3-program-plan.md +++ b/docs/r3-program-plan.md @@ -993,6 +993,7 @@ Substrate canvas + plan-poke-hole both folded in. Key absorptions: | Q-Slice-C-Retirement-Receipt | Slice C → :425 retirement receipt: Mgr-tier vs worker authoring; single combined vs per-slice | Mgr-tier authoring; single combined receipt covering Slice A+B+C (Brian-style condensation per `feedback_brief_pr_cadence`). | RATIFIED-by-default (Substrate Mgr C3) | | Q-Substrate-Grounding-DAG-Routing | Slice C residual `.dag` files overlap Grounding scope (`docs/parallelism-design.md` etc.) — routing | Substrate Mgr owns Slice C residual entirely; cross-Mgr coord with bold-ferret-748 for Grounding-impacting `.dag` content via comment-thread review (no separate Grounding dispatch). | RATIFIED-by-default (Substrate Mgr C4) | | Q-Substrate-Cadence-Throughput | 10 wait-window briefs in PR #1782 + 6+ substrate carrier dispatches form serialized queue; rate-limits R3 close | Authorize parallel-dispatch where lanes have no shared prerequisite (T-E-P + L6 + Numeric-Construction parallel; X1.b sequenced post-E6-G0c; coproduct paydowns sequenced post-variant-aware carrier). PM tracks cadence in §9 weekly cadence; lane-owning Mgr packages PR-sized specs. | RATIFIED-by-default (Substrate Mgr E1+E2) | +| Q-Reification | Substrate-fact-introduction (P1 procedure) for compiled-Dag → evaluator-Value reification — does R3 require a new `ReflectedProgram` carrier, or is `src/v3/std/substrate.dag::Dag` already the reflected program? | **Option A (Dag-as-carrier) ratified** — `Dag` IS the reflected program; no new substrate carrier required. `ReflectedProgram` rejected (4-fail per `feedback_no_metadata_markers` + `feedback_parallel_representation_debt` + `feedback_dissolve_bridges` + `INVARIANTS.md` C-1). Proposal landed at [PR #2096](https://github.com/gunb-ai/gunbc/pull/2096) (merge commit `fec869202`, 2026-05-07); receipt = pass-by-construction (no new `.dag` declaration added to `src/v3/std/`). | **RATIFIED 2026-05-07 (Option A)** — Gate A receipt PR (Substrate Mgr): brief patches `ReflectedProgram` → `Dag` across `r3-v-pattern-a-tc1-v1-worker.md` + `r3-pr-e6-g1a-option3-static-lens-worker.md` + `r3-pr-e8-w1-producer-contract-test-plan-worker.md`; #1960 closed-as-non-addition. Gate B (Verification TC1 V1 lens body in `.dag` + Evaluator E3.c representative consumes `Dag`) coordinates separately. | | Q-Lens-Behavioral-Parity-R3-Closeability | **WAS RED** (T-Lens-Behavioral-Parity 4-lens scope L-XL + 4 sub-slices per lens + T-E-P-Producer-Broadening foundational dep; Substrate Mgr honest assessment: may not close cleanly in R3 timeline). **Substrate Mgr S2 canvas authored 2026-05-06** (`docs/briefs/r3-substrate-s2-t-lbp-scope-calibration-canvas.md`): per-lens × per-sub-slice blocker matrix (16 cells); option (a) full T-LBP / option (b) narrow to complexity+cost / option (c) substrate-gap subdivision feasibility analysis. | **Director ratified option (b) 2026-05-06** at [gunbc#828 #issuecomment-4385329180](https://github.com/gunb-ai/gunbc/issues/828#issuecomment-4385329180) (zesty-bear-812 Director session; cross-relayed via deep-wolf-155 propagation PR). **Q1 (option a) REJECTED**: requires landing 4c (caller-side effect-set pinning carrier) inside R3 — substrate-fact-introduction-without-confirmed-bridge-consumer; circular against R3 close per `INVARIANTS.md` P1. **Q2 (option b) RATIFIED**: T-LBP narrows to **complexity + cost lenses only** in R3 (both share T-E-P producer dependency; closing simultaneously is critical-path fastest). **Carved to R4** per `docs/r4-carve-out-routing.md` (commit `811de219f`): C1 parallelism lens (Stage 2e walker port substrate exists; port + rewire), C2 effect_enumeration lens (4c carrier P1 substrate-fact-introduction required), C3 #83 register zero-proxy/zero-stub narrowed to in-R3 lenses (complexity + cost) with parallelism + effect_enum entries documented as R4-carved. Q3 N/A. | **RATIFIED 2026-05-06 (option b)** — T-LBP R3 scope = complexity + cost lenses only; parallelism + effect_enum + register-narrow carved to R4 per canonical routing ledger. | --- From 2601d7d263449cb81bb66004a1492b2589afe366 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 06:03:32 +0000 Subject: [PATCH 10/50] =?UTF-8?q?docs(briefs):=20S5=20=E2=80=94=20delete?= =?UTF-8?q?=20superseded=20canvas=20+=20name=20dissolution=20trigger=20for?= =?UTF-8?q?=20tag=5Ffield=20asymmetry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit openai-pro REQUEST_CHANGES at gunbc#2079: 2 BLOCKING findings (P2 single-authority + P5 dissolution trigger). Fixes: 1. Delete docs/briefs/r3-substrate-s5-variant-aware-projection-carrier-canvas.md (superseded by the γ-ratified worker brief in same PR; would otherwise leave two current-looking S5 status authorities post-merge — one saying ratification pending, one saying γ ratified). 2. Substrate observation #3 (tag_field String/FieldRef asymmetry) now carries a binding named dissolution trigger: when FieldRef exists as top-level carrier AND InputFieldRef is classified, migrate InternallyTaggedObject.tag_field via follow-on Substrate hygiene PR. Worker MUST add debt-paydown row to authoritative debt ledger before merging carrier-introduction PR. Co-Authored-By: Claude Opus 4.7 (1M context) --- ...-s5-coproduct-projection-carrier-worker.md | 2 +- ...variant-aware-projection-carrier-canvas.md | 79 ------------------- 2 files changed, 1 insertion(+), 80 deletions(-) delete mode 100644 docs/briefs/r3-substrate-s5-variant-aware-projection-carrier-canvas.md diff --git a/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md b/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md index aaa3d188087..06bdd6a0c58 100644 --- a/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md +++ b/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md @@ -36,7 +36,7 @@ These were flagged as STOP-and-PING in canvas; Director pre-ratified the disposi - If `InputFieldRef` is just narrowly-named for an input use-case → rename to `FieldRef` (per `feedback_naming_is_aliasing` — rename is structural-cheap). - **Do NOT** manufacture a parallel-authority second `FieldRef`. -3. **`InternallyTaggedObject.tag_field: String` asymmetry at `dsl/std/serialization.dag:49`** — **Disposition: typed introduction here + debt note for future migration.** Per `feedback_parallel_representation_debt`, the typed/string asymmetry is recorded as known shape mismatch with named dissolution (eventual `InternallyTaggedObject.tag_field: FieldRef` migration). Do NOT fix in same slice unless evidence shows the asymmetry actively blocks a downstream consumer. +3. **`InternallyTaggedObject.tag_field: String` asymmetry at `dsl/std/serialization.dag:49`** — **Disposition: typed introduction here + debt note for future migration with named dissolution trigger.** Per `feedback_parallel_representation_debt`, the typed/string asymmetry is recorded as known shape mismatch. **Dissolution trigger** (binding per P5 scaffold/debt discipline): when **(a)** `FieldRef` exists as a typed top-level carrier in the substrate AND **(b)** `InputFieldRef` (currently at `services.dag:34`) has been classified — either retained as input-scoped specialization or renamed to general `FieldRef` per substrate observation #2 above — THEN migrate `InternallyTaggedObject.tag_field: String` → `InternallyTaggedObject.tag_field: FieldRef` in a follow-on Substrate hygiene PR (analogous to Q2 `result_port` canonical rename per Substrate Mgr standing dispatch authority). Worker MUST add a debt-paydown row to `docs/debt/r3-debt-paydown-ledger-2026-05-02.md` (or current authoritative debt ledger at HEAD) naming this carrier + dissolution trigger before merging the carrier-introduction PR. Do NOT fix in same slice unless evidence shows the asymmetry actively blocks a downstream consumer. ## Acceptance gates (same-slice, all must pass) diff --git a/docs/briefs/r3-substrate-s5-variant-aware-projection-carrier-canvas.md b/docs/briefs/r3-substrate-s5-variant-aware-projection-carrier-canvas.md deleted file mode 100644 index 3cf0e4bc62e..00000000000 --- a/docs/briefs/r3-substrate-s5-variant-aware-projection-carrier-canvas.md +++ /dev/null @@ -1,79 +0,0 @@ -# Canvas — Substrate S5 Variant-aware projection metadata carrier - -**Sub-issue**: gunbc#1947 (parented under #1939 Substrate Mgr lane). -**Authority**: `docs/r3-design-schedule-2026-05-06.md` §S5 (lines 101-106); `docs/r3-program-plan.md:979` Q-Anthropic-Variant-Aware (RATIFIED-by-default — all 3 paydowns); Substrate canvas C1. -**Status**: **canvas — Director-tier ratification needed on carrier shape before worker brief authoring**. - -## Scope - -Typed REST response projection carrier for **coproduct response bodies** — the substrate fact that lets a typed REST response `from`-path resolver dispatch on a sum-type response variant rather than collapsing into untyped JSON. - -Closure: §1.8 gates #29-#30 (T-Anthropic-Wire 2 gates); unblocks #1702 Anthropic re-dispatch + 3 follow-up paydown PRs (Anthropic Messages 200 residual + 2 sibling coproduct slices already-briefed at `r3-coproduct-{2,3}-*.md`). - -## Why a canvas not a worker brief - -Carrier shape is a **substrate-fact-introduction (P1 procedure)** with non-trivial design space. Authoring a worker brief without Director ratification of shape risks rework. Surfacing 3 carrier-shape options for ratification. - -## Carrier-shape options - -### Option α — Variant-tag projection on `RestResponseProjection` - -Extend the existing `RestResponseProjection` carrier (if extant; else introduce alongside `CoproductWireContract` at `dsl/extdeps/llm/anthropic.dag:20-30` precedent) with a per-variant projection field: - -```dag -type RestResponseProjection - = { request_path: String - , response_variant_tag: String - , response_body_field: List - } -``` - -Indexed by `(method, response_variant_tag)`. Resolver picks the matching projection by parsing the response wire-tag (e.g., `type` discriminator in Anthropic's content-block coproducts) and dispatching to the variant's projection. - -**Pro**: minimal new substrate; reuses `FieldProjection` shape; aligns with `CoproductWireContract::InternallyTaggedObject` (which Anthropic uses already at `:20-30`). -**Con**: tag-string IS a bridge — the rank-table risk of audit-row #14 family. Acceptable because tag strings are wire-protocol identity (not internal compiler identity), but worth flagging. - -### Option β — Sum-type metadata on `Declaration` - -Generalize: every coproduct `Declaration` carries optional `variant_projection_metadata: Option>`. The resolver finds the declaration via existing identity surface (declaration_by_name or DeclarationRef) and picks variant by structural variant-id, not wire string. - -**Pro**: structural — no string bridge. Reuses sum-type variant identity already in `Declaration` (TypeBody::Sum variant constructors per VariantConstruct lowerer at memory/MEMORY.md:201). -**Con**: heavier substrate change; couples REST-response-specific concern to general `Declaration`. May leak to other coproduct uses without need. - -### Option γ — Free-standing `CoproductProjection` carrier - -New top-level carrier in `dsl/extdeps/llm/wire_contracts.dag` (or similar): - -```dag -type CoproductProjection - = { coproduct_decl: DeclarationRef - , wire_tag_field: String // e.g., "type" - , variant_projections: Map - } -``` - -Lookup: `coproduct_projection_for(decl: DeclarationRef) -> CoproductProjection`. Wire-tag string lives in projection data, not in identity dispatch. - -**Pro**: localizes the wire-coproduct-dispatch concern to one named carrier; avoids polluting `Declaration`. DeclarationRef-keyed (not span.file-keyed) — clean of audit-row-#14 concerns. -**Con**: new carrier type; some duplication if `RestResponseProjection` already carries a similar shape. - -## Director ratification ask - -1. **Pick α / β / γ** (or surface a fourth option). Provisional Mgr-tier recommendation: **γ** — DeclarationRef-keyed, localized to wire-protocol concern, doesn't leak into `Declaration` general surface, avoids the tag-string-as-identity concern of α. -2. Confirm scope: carrier-only at S5, or carrier + 1 of 3 paydowns bundled? Current default per Q-Anthropic-Variant-Aware = carrier + ALL 3 paydowns separately (already briefed). Confirm S5 dispatch is **carrier-only**; the 3 paydowns dispatch in their own briefs. - -## On ratification — worker brief scope - -Will author execution brief covering: -- New carrier definition in chosen location (`dsl/extdeps/llm/wire_contracts.dag` per γ, or alternate per ratification) -- Indexing API (`coproduct_projection_for(decl) -> CoproductProjection` or analog) -- Resolver wiring point in `from`-path resolution (typed REST response projection consumer) -- Acceptance: §1.8 gates #29-#30 advance from declared → carrier-landed; #1702 branch unparks -- Bootstrap regen + clippy + workspace tests green -- Cross-Mgr handoff: 3 coproduct paydown briefs already authored (`r3-coproduct-{1,2,3}-*-worker.md`) ready to dispatch in their own PRs post-S5 land - -## Worker pin candidates (post-ratification) - -valiant-ibex-312 (recently freed post-#1933 IntPlatform/UIntPlatform land — substrate-fact-introduction precedent owner) OR smart-ram-167. Final pin at dispatch. - -— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-07 per Director endorsement at gunbc#828 #issuecomment-4394293399 of authoring next 2-3 unbriefed items. From 1b9f743ed1ec67d615e61f5d75a4efecb7032a6d Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 06:07:52 +0000 Subject: [PATCH 11/50] =?UTF-8?q?docs(r3):=20Q-Reification=20row=20?= =?UTF-8?q?=E2=80=94=20fix=20invariant=20cite=20(C-1=20=E2=86=92=20P2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cursor review at gunbc#2079 #issuecomment-... flagged C-1 as mis-keyed: INVARIANTS.md C-1 is "missing args fail closed; no LitNull sentinels" (P3 fail-closed family), not parallel-representation/duplicate-authority. The correct cite for rejecting a parallel ReflectedProgram alongside Dag is P2 single authority (INVARIANTS.md line 148: cost of change is proportional to how many files encode the same fact). Cite updated to "INVARIANTS.md P2 single authority" with inline gloss. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/r3-program-plan.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/r3-program-plan.md b/docs/r3-program-plan.md index ceef9abb875..06dfef50c14 100644 --- a/docs/r3-program-plan.md +++ b/docs/r3-program-plan.md @@ -993,7 +993,7 @@ Substrate canvas + plan-poke-hole both folded in. Key absorptions: | Q-Slice-C-Retirement-Receipt | Slice C → :425 retirement receipt: Mgr-tier vs worker authoring; single combined vs per-slice | Mgr-tier authoring; single combined receipt covering Slice A+B+C (Brian-style condensation per `feedback_brief_pr_cadence`). | RATIFIED-by-default (Substrate Mgr C3) | | Q-Substrate-Grounding-DAG-Routing | Slice C residual `.dag` files overlap Grounding scope (`docs/parallelism-design.md` etc.) — routing | Substrate Mgr owns Slice C residual entirely; cross-Mgr coord with bold-ferret-748 for Grounding-impacting `.dag` content via comment-thread review (no separate Grounding dispatch). | RATIFIED-by-default (Substrate Mgr C4) | | Q-Substrate-Cadence-Throughput | 10 wait-window briefs in PR #1782 + 6+ substrate carrier dispatches form serialized queue; rate-limits R3 close | Authorize parallel-dispatch where lanes have no shared prerequisite (T-E-P + L6 + Numeric-Construction parallel; X1.b sequenced post-E6-G0c; coproduct paydowns sequenced post-variant-aware carrier). PM tracks cadence in §9 weekly cadence; lane-owning Mgr packages PR-sized specs. | RATIFIED-by-default (Substrate Mgr E1+E2) | -| Q-Reification | Substrate-fact-introduction (P1 procedure) for compiled-Dag → evaluator-Value reification — does R3 require a new `ReflectedProgram` carrier, or is `src/v3/std/substrate.dag::Dag` already the reflected program? | **Option A (Dag-as-carrier) ratified** — `Dag` IS the reflected program; no new substrate carrier required. `ReflectedProgram` rejected (4-fail per `feedback_no_metadata_markers` + `feedback_parallel_representation_debt` + `feedback_dissolve_bridges` + `INVARIANTS.md` C-1). Proposal landed at [PR #2096](https://github.com/gunb-ai/gunbc/pull/2096) (merge commit `fec869202`, 2026-05-07); receipt = pass-by-construction (no new `.dag` declaration added to `src/v3/std/`). | **RATIFIED 2026-05-07 (Option A)** — Gate A receipt PR (Substrate Mgr): brief patches `ReflectedProgram` → `Dag` across `r3-v-pattern-a-tc1-v1-worker.md` + `r3-pr-e6-g1a-option3-static-lens-worker.md` + `r3-pr-e8-w1-producer-contract-test-plan-worker.md`; #1960 closed-as-non-addition. Gate B (Verification TC1 V1 lens body in `.dag` + Evaluator E3.c representative consumes `Dag`) coordinates separately. | +| Q-Reification | Substrate-fact-introduction (P1 procedure) for compiled-Dag → evaluator-Value reification — does R3 require a new `ReflectedProgram` carrier, or is `src/v3/std/substrate.dag::Dag` already the reflected program? | **Option A (Dag-as-carrier) ratified** — `Dag` IS the reflected program; no new substrate carrier required. `ReflectedProgram` rejected (4-fail per `feedback_no_metadata_markers` + `feedback_parallel_representation_debt` + `feedback_dissolve_bridges` + `INVARIANTS.md` **P2 single authority** — adding a parallel `ReflectedProgram` carrier alongside `Dag` would introduce duplicate authority for the same structural fact). Proposal landed at [PR #2096](https://github.com/gunb-ai/gunbc/pull/2096) (merge commit `fec869202`, 2026-05-07); receipt = pass-by-construction (no new `.dag` declaration added to `src/v3/std/`). | **RATIFIED 2026-05-07 (Option A)** — Gate A receipt PR (Substrate Mgr): brief patches `ReflectedProgram` → `Dag` across `r3-v-pattern-a-tc1-v1-worker.md` + `r3-pr-e6-g1a-option3-static-lens-worker.md` + `r3-pr-e8-w1-producer-contract-test-plan-worker.md`; #1960 closed-as-non-addition. Gate B (Verification TC1 V1 lens body in `.dag` + Evaluator E3.c representative consumes `Dag`) coordinates separately. | | Q-Lens-Behavioral-Parity-R3-Closeability | **WAS RED** (T-Lens-Behavioral-Parity 4-lens scope L-XL + 4 sub-slices per lens + T-E-P-Producer-Broadening foundational dep; Substrate Mgr honest assessment: may not close cleanly in R3 timeline). **Substrate Mgr S2 canvas authored 2026-05-06** (`docs/briefs/r3-substrate-s2-t-lbp-scope-calibration-canvas.md`): per-lens × per-sub-slice blocker matrix (16 cells); option (a) full T-LBP / option (b) narrow to complexity+cost / option (c) substrate-gap subdivision feasibility analysis. | **Director ratified option (b) 2026-05-06** at [gunbc#828 #issuecomment-4385329180](https://github.com/gunb-ai/gunbc/issues/828#issuecomment-4385329180) (zesty-bear-812 Director session; cross-relayed via deep-wolf-155 propagation PR). **Q1 (option a) REJECTED**: requires landing 4c (caller-side effect-set pinning carrier) inside R3 — substrate-fact-introduction-without-confirmed-bridge-consumer; circular against R3 close per `INVARIANTS.md` P1. **Q2 (option b) RATIFIED**: T-LBP narrows to **complexity + cost lenses only** in R3 (both share T-E-P producer dependency; closing simultaneously is critical-path fastest). **Carved to R4** per `docs/r4-carve-out-routing.md` (commit `811de219f`): C1 parallelism lens (Stage 2e walker port substrate exists; port + rewire), C2 effect_enumeration lens (4c carrier P1 substrate-fact-introduction required), C3 #83 register zero-proxy/zero-stub narrowed to in-R3 lenses (complexity + cost) with parallelism + effect_enum entries documented as R4-carved. Q3 N/A. | **RATIFIED 2026-05-06 (option b)** — T-LBP R3 scope = complexity + cost lenses only; parallelism + effect_enum + register-narrow carved to R4 per canonical routing ledger. | --- From 55470a1a1a7d8d316d531adc58b9063e61860d71 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 06:17:52 +0000 Subject: [PATCH 12/50] =?UTF-8?q?docs(briefs):=20S5=20=E2=80=94=20name=20d?= =?UTF-8?q?issolution=20trigger=20for=20DeclarationRef=20alias=20debt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit openai-pro REQUEST_CHANGES at gunbc#2079: substrate observation #1 had desired endpoint ("future structural promotion of DeclarationRef") but no checkable dissolution trigger — same P5 gap that #3 (tag_field asymmetry) had been fixed for in commit 2601d7d26. Trigger now binding: promote DeclarationRef when EITHER (a) audit-row #14 (declaration_name_preference_rank / declaration_by_name rank-table) closes — dsl/std ↔ src/v3/std module convergence makes name-keyed identity unambiguous and structural module identity available, OR (b) any DeclarationRef-typed consumer surfaces a string-identity bridge per feedback_opaque_strings_attract_heuristics (heuristic patching, naming- convention dispatch, suffix/prefix matching). Worker MUST add debt-paydown row before merging carrier-introduction PR (same pattern as the tag_field debt requirement). Co-Authored-By: Claude Opus 4.7 (1M context) --- .../r3-substrate-s5-coproduct-projection-carrier-worker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md b/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md index 06bdd6a0c58..31d78898fab 100644 --- a/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md +++ b/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md @@ -29,7 +29,7 @@ type CoproductProjection { These were flagged as STOP-and-PING in canvas; Director pre-ratified the dispositions so worker can proceed without re-pinging unless evidence forces escalation. -1. **`DeclarationRef = String` alias at `dsl/std/serialization.dag:16`** — **Disposition: (b) accept alias for this slice + debt note.** Promoting `DeclarationRef` to structural typed shape mid-slice is cascade scope creep per `feedback_construction_over_ratchets`. Document the soft-typed nominal handle in `CoproductProjection` carrier comments; add a debt-paydown row pointing at future structural promotion of `DeclarationRef`. **Re-escalate to Mgr only if** worker surfaces evidence the alias actively breaks something same-slice (e.g., Anthropic #1702 wiring triggers a string-identity bridge per `feedback_opaque_strings_attract_heuristics`). +1. **`DeclarationRef = String` alias at `dsl/std/serialization.dag:16`** — **Disposition: (b) accept alias for this slice + debt note with named dissolution trigger.** Promoting `DeclarationRef` to structural typed shape mid-slice is cascade scope creep per `feedback_construction_over_ratchets`. Document the soft-typed nominal handle in `CoproductProjection` carrier comments. **Dissolution trigger** (binding per P5 scaffold/debt discipline): promote `DeclarationRef` from `String` alias to structural typed shape (e.g., `(module: ModuleId, name: DeclarationName)` record, or `DeclarationId` with bootstrap-module witness) when **EITHER (a)** audit-row #14 (`declaration_name_preference_rank` / `declaration_by_name` rank-table at `bridge-retirement-audit-sourcespan-family.md:93` row 14) closes — i.e., dsl/std ↔ src/v3/std module convergence makes name-keyed identity unambiguous and the substrate has structural module identity available; **OR (b)** any `DeclarationRef`-typed consumer surfaces a string-identity bridge per `feedback_opaque_strings_attract_heuristics` (e.g., heuristic patching on the alias' string contents, naming-convention dispatch, suffix/prefix matching). Worker MUST add a debt-paydown row to authoritative debt ledger naming `DeclarationRef` + this trigger before merging carrier-introduction PR. **Re-escalate to Mgr** if neither (a) nor (b) is satisfied but evidence emerges mid-slice that the alias actively breaks something same-slice (e.g., Anthropic #1702 wiring forces a string-identity dispatch). 2. **`FieldRef` does not exist at HEAD; only `InputFieldRef` at `services.dag:34`** — **Disposition: grep-decide between two structural patterns.** Worker greps `services.dag` + adjacent surface for `InputFieldRef` consumers BEFORE deciding (per `feedback_emitter_workaround_is_gap_symptom` + `feedback_audit_adjacent_authority_first`): - If `InputFieldRef` carries input-specific structural context → introduce `FieldRef` as the general carrier; treat `InputFieldRef` as specialization (compose, not parallel-author). From 8a1f5c738cb6f5e3bbad1c276d322eba9ccfe803 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 06:24:29 +0000 Subject: [PATCH 13/50] =?UTF-8?q?docs:=20complete=20Q-Reification=20stale-?= =?UTF-8?q?cite=20sweep=20=E2=80=94=20e6-g1a=20brief=20:169=20+=20Q-PAFS?= =?UTF-8?q?=20row?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit codex BLOCKING at gunbc#2079: docs/briefs/r3-pr-e6-g1a-option3-static-lens-worker.md:169 still said TC1/V1 "waits for Q-Reification and the carrier landing", contradicting the same brief's lines 15-19 + 148-153 saying Dag IS the carrier and no separate carrier lands. Fixed: 1. e6-g1a brief line 167-170 paragraph: clarified V1 waits for consumer-wiring work (lens fold consuming Dag via .dag body authority through Evaluator), NOT for a carrier-introduction. 2. r3-program-plan.md:954 Q-PAFS row text was the same shape: "Resume after Q-Reification + ReflectedProgram" — contradicted my new Q-Reification row in the same diff. Updated: Q-Reification STOP CLEARED 2026-05-07 (Option A); remaining hold = Branch B η non-vacuity only. Out-of-scope-for-this-PR: docs/briefs/r3-pr-e6-g1a-option3-feasibility-probe.md contains 4 stale cites but is not modified in this PR; stale-on-main can be swept in a follow-up if needed (single source of truth is the e6-g1a-static-lens worker brief, not the feasibility probe per Q-PAFS Path A acceptance). Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/briefs/r3-pr-e6-g1a-option3-static-lens-worker.md | 7 +++++-- docs/r3-program-plan.md | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/briefs/r3-pr-e6-g1a-option3-static-lens-worker.md b/docs/briefs/r3-pr-e6-g1a-option3-static-lens-worker.md index b045265b467..27c16318ac7 100644 --- a/docs/briefs/r3-pr-e6-g1a-option3-static-lens-worker.md +++ b/docs/briefs/r3-pr-e6-g1a-option3-static-lens-worker.md @@ -166,5 +166,8 @@ format/check command normally required for touched files. Verification V1 remains cascade-routed separately: if TC1 can use this argument-opaque representative, V1 may pair with E3 in narrow form; if TC1 -requires real lens-over-`Dag` folding, V1 waits for Q-Reification and the -carrier landing. +requires real lens-over-`Dag` folding (consuming `Dag` via `.dag` body +authority through Evaluator per Q-Reification Option A ratified 2026-05-07 +[#2096](https://github.com/gunb-ai/gunbc/pull/2096); `Dag` IS the reflected +program — no separate carrier lands), V1 waits for that consumer-wiring work +to land, NOT for a carrier-introduction. diff --git a/docs/r3-program-plan.md b/docs/r3-program-plan.md index 06dfef50c14..7ef8d73b471 100644 --- a/docs/r3-program-plan.md +++ b/docs/r3-program-plan.md @@ -951,7 +951,7 @@ Substrate canvas + plan-poke-hole both folded in. Key absorptions: | ID | Question | PM recommendation (applied as default) | Status | |---|---|---|---| -| Q-PAFS | Which Pattern-A (DimensionReport-typed family) first executable slice (TC1 vs RustDagIsomorphism vs other) | **TC1 first slice = static representative via E6-G1.a (Path A)** — `docs/briefs/r3-v-tc1-eta-equivalence-deeper-analysis.md`: **DESIGN → ACCEPTED** (2026-05-06): Path B (TC1 generic G1.b / X1.b) **deferred**; Path C (RustDagIsomorphism before TC1) **not** under Q-PAFS default (Director reorder only). PM default and Verification Mgr engineering choice **align on Path A**. **ACCEPTED 2026-05-06** per Brian directive ("approved path A countersign"). **Canonical row authority:** the **committed text of this §10.3 table** at repo `HEAD` (PR #1824 is the **merge record** for the countersign landing on `main`, not a second source of truth). | **ACCEPTED 2026-05-06 (Path A)** — **Policy** locked (TC1 first via E6-G1.a static representative). **Implementation supersession 2026-05-06:** TC1 V1 (`tc1_eta_equivalence_executable`) **HELD** — Director [#828](https://github.com/gunb-ai/gunbc/issues/828) **η non-vacuity (Branch B)** + **Q-Reification** STOP; V1 **unpairs** from Evaluator E3 Option 3 **argument-opaque** slice (vacuous vs `docs/briefs/r3-v-tc1-eta-equivalence-deeper-analysis.md` §What TC1 Asserts). Resume after Q-Reification + **ReflectedProgram\** (non-vacuous fold) or explicit §1.8 plumbing-only milestone (**not** ratified). Evaluator E3 narrow mechanism may proceed **without** TC1 pairing. Worker elaboration (non-authoritative): `docs/briefs/r3-v-pattern-a-tc1-v1-worker.md`. Path B / Path C deferred-not-blocked. | +| Q-PAFS | Which Pattern-A (DimensionReport-typed family) first executable slice (TC1 vs RustDagIsomorphism vs other) | **TC1 first slice = static representative via E6-G1.a (Path A)** — `docs/briefs/r3-v-tc1-eta-equivalence-deeper-analysis.md`: **DESIGN → ACCEPTED** (2026-05-06): Path B (TC1 generic G1.b / X1.b) **deferred**; Path C (RustDagIsomorphism before TC1) **not** under Q-PAFS default (Director reorder only). PM default and Verification Mgr engineering choice **align on Path A**. **ACCEPTED 2026-05-06** per Brian directive ("approved path A countersign"). **Canonical row authority:** the **committed text of this §10.3 table** at repo `HEAD` (PR #1824 is the **merge record** for the countersign landing on `main`, not a second source of truth). | **ACCEPTED 2026-05-06 (Path A)** — **Policy** locked (TC1 first via E6-G1.a static representative). **Implementation supersession 2026-05-06:** TC1 V1 (`tc1_eta_equivalence_executable`) **HELD** — Director [#828](https://github.com/gunb-ai/gunbc/issues/828) **η non-vacuity (Branch B)** + **Q-Reification** STOP **CLEARED 2026-05-07 (Option A: `Dag` IS the reflected program — see Q-Reification row below)**; remaining hold = **Director η non-vacuity (Branch B)** only. V1 **unpairs** from Evaluator E3 Option 3 **argument-opaque** slice (vacuous vs `docs/briefs/r3-v-tc1-eta-equivalence-deeper-analysis.md` §What TC1 Asserts). Resume after lens fold consumes `Dag` via `.dag` body authority through Evaluator (real lens-over-Dag fold, non-vacuous η obligation; consumer-wiring work, NOT carrier-introduction) or explicit §1.8 plumbing-only milestone (**not** ratified). Evaluator E3 narrow mechanism may proceed **without** TC1 pairing. Worker elaboration (non-authoritative): `docs/briefs/r3-v-pattern-a-tc1-v1-worker.md`. Path B / Path C deferred-not-blocked. | | Q-NYI-Accounting | NYI claim coverage/completeness accounting | Mark NYI incomplete in aggregation reporting; ratchet to executable per evaluator-slice landing | RATIFIED-by-default | | Q-Std-Carrier-Phasing | Rust std-carrier phasing (Option/Cardinal/HigherOrderMethodSpec/allocator-hasher) | Phase 1 = default-only/default-instance; later phases as separate Substrate slices post-Phase-1 | RATIFIED-by-default | | Q-Drift-Reconcile | Drift items routing (#1638, #1499, declaration_by_name) | Single Debt-Paydown worker reconciles all three → one PR closing rows in ledger + ROADMAP | RATIFIED-by-default | From 5fc9221c29954544ce9f2a121a06a49cf0ad3049 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 06:29:20 +0000 Subject: [PATCH 14/50] =?UTF-8?q?docs(briefs):=20S5=20=E2=80=94=20fix=20In?= =?UTF-8?q?putFieldRef=20mis-read;=20reframe=20observations=20#2=20+=20#3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit codex BLOCKING at gunbc#2079 line 22: my brief mis-read services.dag:28-36. The text actually says "No separate InputFieldRef carrier is introduced here, since ParamToken.name already carries the same shape and adding a wrapper would duplicate without strengthening the structural invariant" — i.e., InputFieldRef does NOT exist; the comment REJECTS the wrapper. Fixes: 1. Substrate observation #2 reframed: no FieldRef-shaped carrier exists at HEAD; services.dag:28-36 precedent argues against wrapper unless it strengthens structural invariant. New (a)/(b) STOP-and-PING: (a) follow services.dag precedent — wire_tag_field: String + key invariant on wire_tag_values + fixture-load fail-closed check; (b) introduce typed FieldRef — must justify per "duplicate without strengthening" test. 2. Carrier shape (line 19): wire_tag_field: FieldRef → {String|FieldRef} pending observation #2 resolution. 3. Substrate observation #3 reframed: InternallyTaggedObject asymmetry is conditional on path (b); under path (a) no asymmetry exists. Trigger correspondingly conditional. Removed stale "InputFieldRef classified" trigger clause. Co-Authored-By: Claude Opus 4.7 (1M context) --- ...ate-s5-coproduct-projection-carrier-worker.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md b/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md index 31d78898fab..412a80a58a0 100644 --- a/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md +++ b/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md @@ -18,7 +18,7 @@ Substrate-fact-introduction (P1 procedure): typed REST response projection carri type CoproductProjection { declaration: DeclarationRef variant_field_projections: Map - wire_tag_field: FieldRef // which field carries the wire-tag discriminator + wire_tag_field: {String|FieldRef} // shape decided by substrate observation #2 STOP-and-PING; see disposition wire_tag_values: Map } ``` @@ -31,12 +31,16 @@ These were flagged as STOP-and-PING in canvas; Director pre-ratified the disposi 1. **`DeclarationRef = String` alias at `dsl/std/serialization.dag:16`** — **Disposition: (b) accept alias for this slice + debt note with named dissolution trigger.** Promoting `DeclarationRef` to structural typed shape mid-slice is cascade scope creep per `feedback_construction_over_ratchets`. Document the soft-typed nominal handle in `CoproductProjection` carrier comments. **Dissolution trigger** (binding per P5 scaffold/debt discipline): promote `DeclarationRef` from `String` alias to structural typed shape (e.g., `(module: ModuleId, name: DeclarationName)` record, or `DeclarationId` with bootstrap-module witness) when **EITHER (a)** audit-row #14 (`declaration_name_preference_rank` / `declaration_by_name` rank-table at `bridge-retirement-audit-sourcespan-family.md:93` row 14) closes — i.e., dsl/std ↔ src/v3/std module convergence makes name-keyed identity unambiguous and the substrate has structural module identity available; **OR (b)** any `DeclarationRef`-typed consumer surfaces a string-identity bridge per `feedback_opaque_strings_attract_heuristics` (e.g., heuristic patching on the alias' string contents, naming-convention dispatch, suffix/prefix matching). Worker MUST add a debt-paydown row to authoritative debt ledger naming `DeclarationRef` + this trigger before merging carrier-introduction PR. **Re-escalate to Mgr** if neither (a) nor (b) is satisfied but evidence emerges mid-slice that the alias actively breaks something same-slice (e.g., Anthropic #1702 wiring forces a string-identity dispatch). -2. **`FieldRef` does not exist at HEAD; only `InputFieldRef` at `services.dag:34`** — **Disposition: grep-decide between two structural patterns.** Worker greps `services.dag` + adjacent surface for `InputFieldRef` consumers BEFORE deciding (per `feedback_emitter_workaround_is_gap_symptom` + `feedback_audit_adjacent_authority_first`): - - If `InputFieldRef` carries input-specific structural context → introduce `FieldRef` as the general carrier; treat `InputFieldRef` as specialization (compose, not parallel-author). - - If `InputFieldRef` is just narrowly-named for an input use-case → rename to `FieldRef` (per `feedback_naming_is_aliasing` — rename is structural-cheap). - - **Do NOT** manufacture a parallel-authority second `FieldRef`. +2. **No `FieldRef`-shaped carrier exists at HEAD** — corrected per codex BLOCKING at PR #2079. Earlier framing referenced "`InputFieldRef` at `services.dag:34`" — that line is a **comment explicitly REJECTING** the wrapper: *"No separate `InputFieldRef` carrier is introduced here, since `ParamToken.name` already carries the same shape and adding a wrapper would duplicate without strengthening the structural invariant"* (`src/v3/std/services.dag:28-36`). The services.dag precedent: parameter-input identity lives in `Map`'s key invariant + `ParamToken.name`; no parallel typed-handle wrapper. -3. **`InternallyTaggedObject.tag_field: String` asymmetry at `dsl/std/serialization.dag:49`** — **Disposition: typed introduction here + debt note for future migration with named dissolution trigger.** Per `feedback_parallel_representation_debt`, the typed/string asymmetry is recorded as known shape mismatch. **Dissolution trigger** (binding per P5 scaffold/debt discipline): when **(a)** `FieldRef` exists as a typed top-level carrier in the substrate AND **(b)** `InputFieldRef` (currently at `services.dag:34`) has been classified — either retained as input-scoped specialization or renamed to general `FieldRef` per substrate observation #2 above — THEN migrate `InternallyTaggedObject.tag_field: String` → `InternallyTaggedObject.tag_field: FieldRef` in a follow-on Substrate hygiene PR (analogous to Q2 `result_port` canonical rename per Substrate Mgr standing dispatch authority). Worker MUST add a debt-paydown row to `docs/debt/r3-debt-paydown-ledger-2026-05-02.md` (or current authoritative debt ledger at HEAD) naming this carrier + dissolution trigger before merging the carrier-introduction PR. Do NOT fix in same slice unless evidence shows the asymmetry actively blocks a downstream consumer. + **Disposition (revised)**: `CoproductProjection.wire_tag_field` faces the same shape question — does it need a typed wrapper, or does the structural invariant already exist elsewhere? Two paths, **STOP-and-PING the Mgr** before choosing: + - **(a) Follow services.dag precedent (no wrapper)**: `wire_tag_field: String`, with structural identity carried by `Map` key invariant on `wire_tag_values` + a fail-closed check at fixture load that `wire_tag_field` names a real field on the coproduct's variant payloads. Adds NO new carrier; aligns with `feedback_construction_over_ratchets`. Asymmetry with `WireTagValue` (typed leaf, binding per Director constraint #2) is acceptable — values and field-handles are distinct concerns. + - **(b) Introduce typed `FieldRef`**: new top-level structural carrier; ergonomic when consumers need to compose field-identity across coproduct + record + tagged-object surfaces. Stronger structural invariant than (a) but introduces a new carrier — must justify per services.dag precedent's "duplicate without strengthening" test. + - **Do NOT** manufacture an `InputFieldRef`-shaped wrapper (services.dag:28-36 explicitly rejected that shape). + +3. **`InternallyTaggedObject.tag_field: String` asymmetry at `dsl/std/serialization.dag:49`** — **Disposition: conditional debt with named dissolution trigger.** Asymmetry only exists if substrate observation #2 resolves to **path (b)** (introduce typed `FieldRef`). If observation #2 resolves to **path (a)** (no wrapper, follow services.dag precedent), then `wire_tag_field: String` matches `InternallyTaggedObject.tag_field: String` — no asymmetry, no debt. Per `feedback_parallel_representation_debt`, recorded as shape-question rather than known mismatch. + + **Dissolution trigger** (binding per P5 scaffold/debt discipline; applies ONLY if observation #2 path (b) is chosen): when **(a)** typed `FieldRef` exists as top-level carrier (introduced via observation #2 path (b)) AND **(b)** evidence emerges that a downstream consumer benefits from typed field-identity in `InternallyTaggedObject` (per `feedback_emitter_workaround_is_gap_symptom`), THEN migrate `InternallyTaggedObject.tag_field: String` → `FieldRef` in a follow-on Substrate hygiene PR. Worker MUST add a debt-paydown row to authoritative debt ledger at HEAD naming this carrier + trigger before merging the carrier-introduction PR. Do NOT fix in same slice unless evidence shows the asymmetry actively blocks a downstream consumer. ## Acceptance gates (same-slice, all must pass) From 598776f4f8448de4236b52c126b813b472b67b0b Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 06:30:27 +0000 Subject: [PATCH 15/50] =?UTF-8?q?docs(briefs):=20S5=20=E2=80=94=20consolid?= =?UTF-8?q?ate=20split=20per-variant=20maps=20into=20single=20keyed=20entr?= =?UTF-8?q?y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit openai-pro REQUEST_CHANGES at gunbc#2079: CoproductProjection shape split per-variant data across two parallel maps (variant_field_projections + wire_tag_values), admitting illegal states where keysets drift (P2 boundary discipline / illegal-states-unrepresentable). Fix: introduce CoproductVariantProjection { field_projection, wire_tag_value } as the per-variant keyed value; CoproductProjection.variant_projections becomes Map. Single keyed authority per variant. Director's binding constraint #2 enumerated the two fields separately but said "refine in implementation as ergonomics demand" — consolidation preserves the substantive constraints (typed WireTagValue leaf, structural per-variant projection) while enforcing keyset alignment by carrier shape. Empty-payload variants encoded via FieldProjection::Empty constructor (or analog), not via map-absence. Co-Authored-By: Claude Opus 4.7 (1M context) --- ...trate-s5-coproduct-projection-carrier-worker.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md b/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md index 412a80a58a0..f3766354cc6 100644 --- a/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md +++ b/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md @@ -15,14 +15,20 @@ Substrate-fact-introduction (P1 procedure): typed REST response projection carri **Initial shape** (refine in implementation as ergonomics demand): ```dag +type CoproductVariantProjection { + field_projection: FieldProjection // payload field projection for this variant + wire_tag_value: WireTagValue // typed wire-tag for this variant +} + type CoproductProjection { - declaration: DeclarationRef - variant_field_projections: Map - wire_tag_field: {String|FieldRef} // shape decided by substrate observation #2 STOP-and-PING; see disposition - wire_tag_values: Map + declaration: DeclarationRef + wire_tag_field: {String|FieldRef} // shape decided by substrate observation #2 STOP-and-PING; see disposition + variant_projections: Map } ``` +**Single-keyed-fact discipline (P2 boundary)**: per-variant payload + tag-value are one keyed fact, not two parallel maps. Director's binding constraint #2 originally enumerated them as separate fields ("refine in implementation as ergonomics demand"); the consolidated `CoproductVariantProjection` shape preserves the substantive constraints (typed `WireTagValue` leaf, structural per-variant projection) while making illegal states unrepresentable — a variant cannot have a field projection without a wire-tag value or vice versa. If "variant has no payload fields" is legitimate (e.g., Anthropic's empty-payload variants), encode that explicitly via a `FieldProjection::Empty` constructor or analog inside `CoproductVariantProjection.field_projection` rather than as absence from one map. + `WireTagValue` MUST be a typed leaf (sum type or named record), **not** `String`. If Anthropic + REST both serialize as string at the wire boundary, encode the typed-on-our-side / serialized-at-emit pattern: `WireTagValue` stays typed in substrate; serialization adapter handles `String <-> WireTagValue` at the wire boundary. ### Substrate observations — Director pre-ratified dispositions (gunbc#828 #issuecomment-4394416049) From 4656801fefa3bf1178799023a685b5a2be957854 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 06:43:18 +0000 Subject: [PATCH 16/50] =?UTF-8?q?docs(briefs):=20S5=20=E2=80=94=20fix=20st?= =?UTF-8?q?ale=20split-map=20vocab=20in=20path=20(a)=20+=20scope=20STOP-an?= =?UTF-8?q?d-PING=20umbrella?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit openai-pro REQUEST_CHANGES at gunbc#2079: 2 BLOCKING findings. 1. Path (a) at line 43 still referenced "Map key invariant on wire_tag_values" — that's the superseded split-map vocab; the consolidated shape is Map on variant_projections. Path (a) now references the consolidated map; per-variant WireTagValue lives inside CoproductVariantProjection. 2. Pre-ratification umbrella at line 36 said "all 3 dispositions pre-ratified, proceed without re-pinging" — but observation #2 was re-opened after the codex InputFieldRef finding and explicitly says STOP-and-PING. Contradictory. Umbrella now scoped: observations #1 + #3 are pre-ratified; #2 is re-opened STOP-and-PING — worker MUST escalate before choosing path (a) vs (b). Co-Authored-By: Claude Opus 4.7 (1M context) --- .../r3-substrate-s5-coproduct-projection-carrier-worker.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md b/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md index f3766354cc6..8bebfb70899 100644 --- a/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md +++ b/docs/briefs/r3-substrate-s5-coproduct-projection-carrier-worker.md @@ -33,14 +33,14 @@ type CoproductProjection { ### Substrate observations — Director pre-ratified dispositions (gunbc#828 #issuecomment-4394416049) -These were flagged as STOP-and-PING in canvas; Director pre-ratified the dispositions so worker can proceed without re-pinging unless evidence forces escalation. +**Pre-ratification scope** — Director pre-ratified observations **#1 (DeclarationRef alias)** and **#3 (tag_field asymmetry conditional)** at gunbc#828 #issuecomment-4394416049; worker proceeds on those without re-pinging unless evidence forces escalation. **Observation #2 was re-opened** after codex BLOCKING at gunbc#2079 corrected an `InputFieldRef` mis-read; #2's `wire_tag_field` shape decision (path (a) vs (b)) **remains an open STOP-and-PING** — worker MUST escalate to Mgr before choosing, NOT proceed silently. 1. **`DeclarationRef = String` alias at `dsl/std/serialization.dag:16`** — **Disposition: (b) accept alias for this slice + debt note with named dissolution trigger.** Promoting `DeclarationRef` to structural typed shape mid-slice is cascade scope creep per `feedback_construction_over_ratchets`. Document the soft-typed nominal handle in `CoproductProjection` carrier comments. **Dissolution trigger** (binding per P5 scaffold/debt discipline): promote `DeclarationRef` from `String` alias to structural typed shape (e.g., `(module: ModuleId, name: DeclarationName)` record, or `DeclarationId` with bootstrap-module witness) when **EITHER (a)** audit-row #14 (`declaration_name_preference_rank` / `declaration_by_name` rank-table at `bridge-retirement-audit-sourcespan-family.md:93` row 14) closes — i.e., dsl/std ↔ src/v3/std module convergence makes name-keyed identity unambiguous and the substrate has structural module identity available; **OR (b)** any `DeclarationRef`-typed consumer surfaces a string-identity bridge per `feedback_opaque_strings_attract_heuristics` (e.g., heuristic patching on the alias' string contents, naming-convention dispatch, suffix/prefix matching). Worker MUST add a debt-paydown row to authoritative debt ledger naming `DeclarationRef` + this trigger before merging carrier-introduction PR. **Re-escalate to Mgr** if neither (a) nor (b) is satisfied but evidence emerges mid-slice that the alias actively breaks something same-slice (e.g., Anthropic #1702 wiring forces a string-identity dispatch). 2. **No `FieldRef`-shaped carrier exists at HEAD** — corrected per codex BLOCKING at PR #2079. Earlier framing referenced "`InputFieldRef` at `services.dag:34`" — that line is a **comment explicitly REJECTING** the wrapper: *"No separate `InputFieldRef` carrier is introduced here, since `ParamToken.name` already carries the same shape and adding a wrapper would duplicate without strengthening the structural invariant"* (`src/v3/std/services.dag:28-36`). The services.dag precedent: parameter-input identity lives in `Map`'s key invariant + `ParamToken.name`; no parallel typed-handle wrapper. **Disposition (revised)**: `CoproductProjection.wire_tag_field` faces the same shape question — does it need a typed wrapper, or does the structural invariant already exist elsewhere? Two paths, **STOP-and-PING the Mgr** before choosing: - - **(a) Follow services.dag precedent (no wrapper)**: `wire_tag_field: String`, with structural identity carried by `Map` key invariant on `wire_tag_values` + a fail-closed check at fixture load that `wire_tag_field` names a real field on the coproduct's variant payloads. Adds NO new carrier; aligns with `feedback_construction_over_ratchets`. Asymmetry with `WireTagValue` (typed leaf, binding per Director constraint #2) is acceptable — values and field-handles are distinct concerns. + - **(a) Follow services.dag precedent (no wrapper)**: `wire_tag_field: String`, with structural identity carried by the consolidated `Map` key invariant on `variant_projections` (each variant's `wire_tag_value` is the per-variant typed authority) + a fail-closed check at fixture load that the `String` value names a real field on the coproduct's variant payloads. Adds NO new carrier; aligns with `feedback_construction_over_ratchets`. Asymmetry with `WireTagValue` (typed leaf, binding per Director constraint #2) is acceptable — values and field-handles are distinct concerns. - **(b) Introduce typed `FieldRef`**: new top-level structural carrier; ergonomic when consumers need to compose field-identity across coproduct + record + tagged-object surfaces. Stronger structural invariant than (a) but introduces a new carrier — must justify per services.dag precedent's "duplicate without strengthening" test. - **Do NOT** manufacture an `InputFieldRef`-shaped wrapper (services.dag:28-36 explicitly rejected that shape). From aac5b3b4a4cc2a0702faed66d07a59f51dd044a5 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 07:24:31 +0000 Subject: [PATCH 17/50] =?UTF-8?q?docs(briefs):=20descent=5Fexecution=5Fpro?= =?UTF-8?q?of=20canvas=20=E2=80=94=204-residual=20coproduct-dissolution=20?= =?UTF-8?q?audit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Director ratified split disposition at gunbc#828 #issuecomment-4394696074: descent_execution_proof STANDS ALONE (consumer-side termination-contract substrate function with fail-closed residual enumeration; folding into T-E-P-Producer-Broadening explicitly rejected — different concern axis). Canvas surfaces 3 carrier-shape options for the residual enumeration per Director's coproduct-dissolution audit suggestion: α: 4-variant coproduct verbatim from §10.3 row 966 (Missing | Unknown | Incomplete | NonStrict) β: 3-axis dimensional product (presence × completeness × strictness) γ (recommended): reuse DescentEvidence at termination.dag:14-17 for "absent/unknown" via EvidenceUnknown(DescentEvidence) payload-variant + separate EvidenceIncomplete — ratchets variant count 4 → 2 via dimensional folding while honoring services.dag "no parallel wrapper" precedent. Mgr recommendation γ; β rejected unless 3 axes provably compose orthogonally. Co-Authored-By: Claude Opus 4.7 (1M context) --- ...ubstrate-descent-execution-proof-canvas.md | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) create mode 100644 docs/briefs/r3-substrate-descent-execution-proof-canvas.md diff --git a/docs/briefs/r3-substrate-descent-execution-proof-canvas.md b/docs/briefs/r3-substrate-descent-execution-proof-canvas.md new file mode 100644 index 00000000000..b97c2bd3d72 --- /dev/null +++ b/docs/briefs/r3-substrate-descent-execution-proof-canvas.md @@ -0,0 +1,108 @@ +# Canvas — Substrate `descent_execution_proof` carrier (P1 substrate-fact-introduction) + +**Parent**: gunbc#1939 (Substrate Mgr lane); will be parented under a PM-authored work-item under #1939 post-ratification. +**Authority**: `docs/r3-program-plan.md` §10.3 row Q-EVAL-Descent-Termination-Contract (line 966); Director ratification of split disposition at gunbc#828 #issuecomment-4394696074 (descent_execution_proof STANDS ALONE; folds-into-T-E-P explicitly rejected). +**Closure predicate**: Evaluator E2 descent termination contract consumer (#1971); fail-closed residual enumeration is the load-bearing structural fact. +**Status**: **canvas — Director-tier ratification needed on residual enumeration shape before worker brief authoring**. + +## Scope + +Substrate carrier for executor-side termination-contract verification: + +``` +descent_execution_proof(&Dag, ClusterId, PortId) + -> Result +``` + +Per §10.3 row 966 the residual enumeration was provisionally named `Missing | Unknown | Incomplete | NonStrict`. The shape question is: **what is the minimum-irreducible variant set for `DescentResidual`?** + +## Adjacent substrate (grep-verified at HEAD) + +`src/v3/std/termination.dag:14-17` already defines: + +```dag +type DescentEvidence + = Strict + | NonIncreasing + | DescentUnknown +``` + +with `BoundedLattice` ordering `DescentUnknown < NonIncreasing < Strict` (top = `Strict`, bottom = `DescentUnknown` per fail-closed discipline). `merge_evidence` / `join_evidence` are conservative-meet / optimistic-join. + +So the residual question must reconcile with the existing 3-variant evidence type. **`Unknown` in the residual enumeration ≡ `DescentEvidence::DescentUnknown`**; reusing the existing carrier is the structural-cheap default unless a distinction emerges. + +## Carrier-shape options for the residual enumeration + +### Option α — 4-variant coproduct (as named in §10.3 row 966) + +```dag +type DescentResidual + = Missing // no DescentEvidence carrier present at the call site + | Unknown // DescentEvidence::DescentUnknown surfaced + | Incomplete // per-path evidence exists but some paths uncovered + | NonStrict // evidence is NonIncreasing (not Strict) +``` + +**Pro**: matches §10.3 row 966 verbatim; explicit named cases; readable at the consumer. +**Con**: `Missing` and `Unknown` may collapse — both are "evidence-absent" with different cardinalities (no carrier vs `DescentUnknown` carrier). Per `feedback_coproduct_dissolution`, this is the kind of variant pair that should ratchet downward unless there's a load-bearing distinction. Same for `Incomplete` vs `NonStrict` — both are "evidence-present-but-insufficient", differing on which axis (path-coverage vs strictness). + +### Option β — Dimensional product report + +```dag +type DescentResidualReport { + presence: EvidencePresence // CarrierPresent | CarrierAbsent + completeness: PathCoverage // AllPathsCovered | SomePathsUncovered + strictness: StrictnessVerdict // Strict | NonIncreasing | NotApplicable +} +``` + +Decomposes the 4-coproduct into 3 orthogonal axes; the executor reports per-axis verdict; the "fail" condition is any non-top axis. + +**Pro**: maximum structural decomposition per `feedback_coproduct_dissolution`; eliminates illegal-state question of whether `Incomplete` and `NonStrict` are mutually exclusive (the answer: no — a proof can be both); per-axis independent reasoning. +**Con**: heavier shape; requires defining 3 sub-types (`EvidencePresence`, `PathCoverage`, `StrictnessVerdict`) instead of 1; `StrictnessVerdict::NotApplicable` admits illegal state when carrier is absent (presence=CarrierAbsent + strictness=Strict shouldn't be representable). If the 3 axes don't actually compose orthogonally (i.e., some combinations are nonsensical), product shape is wrong. + +### Option γ — Reuse `DescentEvidence` for "absent/unknown"; 2 additional residuals + +```dag +type DescentResidual + = EvidenceUnknown(DescentEvidence) // wraps DescentUnknown (or NonIncreasing reported as not-strict) + | EvidenceIncomplete // multi-path partial coverage +``` + +3-variant collapse of α: `Missing` and `Unknown` fold into a single `EvidenceUnknown(DescentEvidence)` payload (the `Missing` case is `DescentUnknown` synthesized by the executor when no carrier is present); `NonStrict` folds into `EvidenceUnknown(NonIncreasing)` since the existing lattice already distinguishes `NonIncreasing` from `Strict`; `Incomplete` remains separate because path-coverage IS structurally distinct from per-evidence strictness. + +**Pro**: reuses `DescentEvidence` carrier per `feedback_audit_adjacent_authority_first`; ratchets variant count from 4 → 2 via dimensional folding; `EvidenceUnknown(Strict)` is unrepresentable by construction (Strict isn't a residual). +**Con**: payload-typed variant is heavier than bare-name variant; consumers must pattern-match on the payload to recover the original 4-case story; "Strict" appearing under `EvidenceUnknown` requires an inhabited-only-by-non-Strict refinement type or a runtime check (mild illegal-state risk). + +## Mgr-tier recommendation + +Provisional **γ**: ratchets the variant count via dimensional folding (per Director's coproduct-dissolution audit suggestion) while reusing the existing `DescentEvidence` carrier (services.dag-style "no parallel wrapper" precedent). The `Strict`-shouldn't-appear-here illegal-state risk is mild and addressable via either a refinement type (`DescentEvidence \ Strict`) or a fixture-load fail-closed check. + +If γ's payload-pattern-match cost is unacceptable for consumer ergonomics, **α** with explicit Mgr-acknowledgment that `Missing` ≡ `Unknown` (rather than fold via constructor injection) is the second-best — names the cases verbatim from §10.3 at the cost of one redundant variant. + +**β rejected** unless the 3 axes provably compose orthogonally — risk of admitting illegal states (carrier-absent + strictness=Strict) is real and would require additional refinement-shape work. + +## Director ratification ask + +1. **Pick α / β / γ** (or surface a fourth option). Provisional Mgr recommendation: **γ**. +2. Confirm the existing `DescentEvidence` 3-variant lattice at `termination.dag:14-17` is the authoritative starting point — i.e., the residual carrier composes with it rather than re-inventing it. +3. Confirm the typed signature `descent_execution_proof(&Dag, ClusterId, PortId) -> Result` from §10.3 row 966 is verbatim-binding, OR ratify a refinement (e.g., `&Dag` may need to be `&Dag` + module witness; `ClusterId` + `PortId` are existing Substrate types — verify via grep at worker brief time). + +## On ratification — worker brief scope + +Will author execution brief covering: +- `DescentResidual` carrier in `src/v3/std/termination.dag` (or sibling file if cleaner) per chosen option +- `DescentExecutionProof` carrier shape (witness payload — likely a mini-DAG or per-path evidence map) +- `descent_execution_proof()` substrate function signature in DSL with fail-closed body shape +- Acceptance: §1.8 gates per row 966 closure predicate; bootstrap regen + clippy + workspace tests green +- Cross-Mgr handoff: Evaluator (#1971 / crisp-bat-13) consumes carrier; Q-EVAL-Descent-Termination-Contract row 966 advances to `CONSUMER_LANDED` + +## Worker pin (Mgr disposition) + +**quick-koi-190** — already authorized through quick-crab per §10.3 row 966 ("quick-koi-190 implementation already authorized through quick-crab"); also currently on T-E-P P1 work which is conceptually adjacent (DescentEvidence producer broadening). Final pin at dispatch. + +## Auto-spawn caveat + +Per Director note 2026-05-07: worker auto-spawn from Mgr-context is bug-affected; HOLD dispatch on this canvas's worker brief until auto-spawn fix lands per L-sized-not-low-risk threshold. + +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-07 post-#2079 merge per Director serial-cadence direction at gunbc#828 #issuecomment-4394696074. Coproduct-dissolution audit per Director's micro-suggestion in same message. From 622361c2c7380be504593f16d890d2b8d024a962 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 07:28:44 +0000 Subject: [PATCH 18/50] =?UTF-8?q?docs(briefs):=20SourceSpan=20brief=20Row?= =?UTF-8?q?=20#6=20=E2=80=94=20derive=20from=20bootstrap=5Fauthority=20map?= =?UTF-8?q?,=20no=20new=20enum=20variant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit codex BLOCKING (post-merge of #2079, on commit 85ceb85a — same brief is now on main): my Row #6 disposition told the worker to introduce a new BootstrapAuthority::Pipeline variant ("extend the enum if needed"). That violates P2 single-authority — src/v3/std/bootstrap_authority.dag:90 already has "src/v3/compiler/pipeline.dag": CompilerAuthority, classifying pipeline.dag under the existing CompilerAuthority variant. The :14-17 comment is explicit: "the path itself is the BootstrapAuthoritySet map key; variants carry no duplicate path payload" — single authority, not extension-by-variant. Fix: Row #6 now instructs worker to derive the typed key from the existing bootstrap_authority-map witness (BootstrapAuthorityKey threading the existing CompilerAuthority classifier), refining the constructor surface if needed — NOT introducing a new enum variant. STOP-and-PING criteria updated to forbid new-variant resolution under any path. Co-Authored-By: Claude Opus 4.7 (1M context) --- ...strate-bridge-source-span-file-participation-worker.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md b/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md index b4b05d79f6c..df2b25b5eae 100644 --- a/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md +++ b/docs/briefs/r3-substrate-bridge-source-span-file-participation-worker.md @@ -45,8 +45,10 @@ Authority constants: `BOOL_TYPES_FILE` (`dsl/std/types.dag`), `PIPELINE_AUTHORIT - Diagnostic span: synthesize from `BootstrapAuthorityKey` rather than `SourceSpan::new(BOOL_TYPES_FILE, 0, 0)` — the `BootstrapAuthorityKey::new(...)` wrapper already exists at `:125`, and `DiagnosticAttribution::BootstrapAuthority` (per `:519` doc-comment) is the steady-state attribution surface (PB row 82). - **Prerequisite**: `dsl/std/types.dag` ↔ `src/v3/std/types.dag` duplicate-module convergence per ROADMAP T-P0 must NOT regress; if both hold a `Bool`, `declaration_by_name` rank still applies (audit row #14 — root blocker, **out-of-scope here**). -**Row #6 (pipeline authority)** — replace `PIPELINE_AUTHORITY_FILE` guards: -- `report_pipeline_authority_error` (`:283-292`) — drop the path-string from both `BootstrapAuthorityKey` and `SourceSpan::new`. Replace with a **`BootstrapAuthority::Pipeline` typed key** (extend the enum if needed); diagnostic span sourced from the offending stage binding's actual `SourceSpan`, not a manufactured `(file, 0, 0)`. +**Row #6 (pipeline authority)** — replace `PIPELINE_AUTHORITY_FILE` guards by deriving the typed key from the existing single-authority map: +- `src/v3/std/bootstrap_authority.dag:90` already has `"src/v3/compiler/pipeline.dag": CompilerAuthority` — `pipeline.dag` is already classified under the existing `BootstrapAuthority::CompilerAuthority` variant. **DO NOT introduce a new `BootstrapAuthority::Pipeline` variant** — that would duplicate substrate authority (the `bootstrap_authority` map at `:30` is the single authority per the file's :14-17 comment: *"the path itself is the BootstrapAuthoritySet map key; variants carry no duplicate path payload"*). +- `report_pipeline_authority_error` (`:283-292`) — drop the path-string from both `BootstrapAuthorityKey` and `SourceSpan::new`. Derive the typed key from the existing `bootstrap_authority`-map witness — i.e., `BootstrapAuthorityKey` is constructed from the `(path, BootstrapAuthority::CompilerAuthority)` row already in the data, not by extending the enum. Diagnostic span sourced from the offending stage binding's actual `SourceSpan`, not a manufactured `(file, 0, 0)`. +- If the worker finds that `BootstrapAuthorityKey::new()` constructor signature doesn't currently accept a typed-classifier argument, the right shape is to thread the `BootstrapAuthority` variant through the existing constructor (refining the constructor surface), NOT to add a new top-level enum variant. - Coordinate with PB-owned `bridge_include_str_side_channels_retired` (audit row #6 sibling) — `pipeline_authority.rs::ordered_pipeline_stages` already reads `PipelineStageBinding` structurally; the bridge is ONLY in the diagnostic-span manufacturing path. ## Acceptance @@ -61,7 +63,7 @@ Authority constants: `BOOL_TYPES_FILE` (`dsl/std/types.dag`), `PIPELINE_AUTHORIT ## STOP / PING criteria - **STOP** if removing `d.span.file == BOOL_TYPES_FILE` (anchor #1) causes `declaration_by_name("Bool")` to resolve to a different declaration (rank-table ambiguity from duplicate `Bool` in `src/v3/std/types.dag` vs `dsl/std/types.dag`). This is audit row #14 root-blocker territory — surface to Mgr; do NOT delete the rank table to "fix it". -- **STOP** if `BootstrapAuthority` enum doesn't have a `Pipeline` variant and adding one cascades into emit/diagnostic surfaces beyond bootstrap.rs. Surface scope-creep to Mgr. +- **STOP** if deriving the typed key for the pipeline diagnostic from the existing `bootstrap_authority` map (per Row #6 disposition above — `CompilerAuthority` row at `bootstrap_authority.dag:90`) cascades into emit/diagnostic surfaces beyond bootstrap.rs (e.g., `BootstrapAuthorityKey::new()` constructor refinement leaks into other call sites). Surface scope-creep to Mgr. **Do NOT** introduce a new `BootstrapAuthority::Pipeline` variant under any STOP-resolution path — that's duplicate substrate authority. - **PING** Verification Mgr (#1940 / `witty-swift-269` if active) when this lands so they can advance the ledger-zero audit (`docs/briefs/r3-v-bridge-retirement-ledger-zero-audit.md` row 1). ## Cross-Mgr handoff From e2741c4f78df26077d47640dcb42294fa566395a Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 07:33:02 +0000 Subject: [PATCH 19/50] =?UTF-8?q?docs(briefs):=20descent=5Fexecution=5Fpro?= =?UTF-8?q?of=20worker=20brief=20=E2=80=94=20=CE=B3=20ratified=20(2-varian?= =?UTF-8?q?t=20residual)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Director ratification at gunbc#828 #issuecomment-4395060514: - DescentResidual = EvidenceUnknown(DescentEvidence) | EvidenceIncomplete (4 → 2 dissolution: Missing+Unknown fold via DescentUnknown injection; NonStrict folds via NonIncreasing wrap; Incomplete retained — different concern axis from evidence-lattice) - DescentEvidence 3-variant lattice at termination.dag:14-17 confirmed as authoritative composition target - Type signature from §10.3 row 966 confirmed verbatim-binding Director-asked canvas-shape verification absorbed: worker STOPs if EvidenceIncomplete decomposes into payload-variants (timeout / depth-bound / evaluator-error-during-proof-construction); proceeds as 2-variant otherwise. 7 same-slice acceptance gates incl Evaluator E2 #1971 consumer wiring in same PR + §10.3 row 966 row-text refresh to cite γ-disposition. Worker pin: quick-koi-190 (pre-authorized per §10.3 row 966). Auto-spawn HOLD per L-sized threshold; surgical-recreate path ratified case-by-case if critical path blocked. Co-Authored-By: Claude Opus 4.7 (1M context) --- ...ubstrate-descent-execution-proof-worker.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 docs/briefs/r3-substrate-descent-execution-proof-worker.md diff --git a/docs/briefs/r3-substrate-descent-execution-proof-worker.md b/docs/briefs/r3-substrate-descent-execution-proof-worker.md new file mode 100644 index 00000000000..fbbe9b8b299 --- /dev/null +++ b/docs/briefs/r3-substrate-descent-execution-proof-worker.md @@ -0,0 +1,71 @@ +# Worker brief — Substrate `descent_execution_proof` carrier (γ) + +**Sub-issue**: TBD (PM creates under #1939 post-this-brief landing; Evaluator's #1971 `Depends on:` retargets to that issue). +**Authority**: Director ratification of **option γ** at gunbc#828 #issuecomment-4395060514 (2026-05-07); supersedes the canvas at `docs/briefs/r3-substrate-descent-execution-proof-canvas.md` (canvas may be deleted after this brief lands). +**Closure predicate**: Evaluator E2 descent termination contract consumer (#1971); §10.3 row 966 row-text refresh to cite γ-disposition (2-variant residual, not 4-variant prose). + +## Scope + +Substrate-fact-introduction (P1 procedure): consumer-side typed substrate function for executor termination-contract verification. Composes with existing `DescentEvidence` lattice at `src/v3/std/termination.dag:14-17`; no parallel "absent/unknown" axis. + +## Carrier shape (binding per Director γ ratification) + +**Location**: `src/v3/std/termination.dag` (extend the existing file — `DescentEvidence` already lives there; sibling typing keeps the lattice + residual co-located). Verify-via-grep at HEAD that no near-neighbor file has prior claim. + +```dag +type DescentResidual + = EvidenceUnknown(DescentEvidence) // wraps DescentUnknown for absent-evidence; wraps NonIncreasing for not-strict + | EvidenceIncomplete // proof-construction state: per-path coverage incomplete +``` + +**Single substrate function**: + +```dag +fn descent_execution_proof( + dag: &Dag, + cluster: ClusterId, + port: PortId, +) -> Result +``` + +**`DescentExecutionProof`** payload — verify shape at implementation time. Likely a per-path evidence map keyed by branch identifier with each entry carrying `DescentEvidence::Strict` (non-Strict per-path entries surface as `EvidenceUnknown(NonIncreasing)` residual via the executor's join semantics). If a richer witness shape is needed, surface as STOP-and-PING. + +### Director-asked verification (canvas-shape time) + +**STOP-and-PING the Mgr** if `EvidenceIncomplete` decomposes into payload-variants. Worker greps the existing executor-error surface for partial-coverage / timeout / depth-bound reasons: +- If `EvidenceIncomplete` is genuinely **unit-variant** (proof construction either completes for all paths or fails wholesale on one of the existing residual reasons): ratchet stops at 2-variant — proceed with γ as ratified. +- If `EvidenceIncomplete` carries a specific reason payload (e.g., `EvidenceIncomplete { reason: TimeoutReason | DepthBoundExceeded | EvaluatorErrorDuringProofConstruction }`): surface to Mgr; canvas may need a 4-decompose-to-3 update with payload-variant. + +Per Director: "this is canvas-shape verification, not a re-ratification ask. If the worker hits substrate evidence that requires payload structure, surface as STOP-and-PING; otherwise proceed with γ as 2-variant." + +## Acceptance gates (same-slice, all must pass) + +1. **`DescentResidual` carrier landed** in `src/v3/std/termination.dag` (or chosen location post-grep) per ratified γ shape (modulo STOP-resolution on `EvidenceIncomplete` payload). +2. **`DescentExecutionProof` carrier landed** with witness payload shape (per-path evidence map or richer structure surfaced via STOP-and-PING). +3. **`descent_execution_proof()` substrate function landed** with the typed signature from §10.3 row 966 (verbatim per Director confirm). +4. **Evaluator E2 (#1971) consumes the carrier** in same-slice — proves multi-consumer composability is unnecessary for this carrier (Evaluator IS the consumer per closure predicate; carrier-with-single-consumer-as-interface anti-pattern doesn't apply because the carrier is consumer-cementing for executor termination contract). PR description names the Evaluator consumer call site. +5. **§10.3 row 966 row-text update**: ROADMAP cites γ-disposition (2-variant residual) replacing the prose `Missing | Unknown | Incomplete | NonStrict` 4-variant naming. Per Director: "ROADMAP §10.3 row 966 row text should update on Gate A landing to cite this ratification." +6. Bootstrap regen: `cargo test -p v3-compiler bootstrap_regen_fresh -- --ignored` clean. +7. Full suite: `cargo test --workspace --exclude v2-compiler-tests` green; `cargo clippy --all-targets -- -D warnings` clean. + +## STOP / PING criteria + +- **STOP** if `EvidenceIncomplete` decomposes into payload-variants per the Director-asked verification above — surface to Mgr (warm-wolf-698 / inbox #2068) before adding a payload; canvas update needed. +- **STOP** if `DescentExecutionProof` witness shape requires substantial new substrate (e.g., a fresh per-path-witness type with non-trivial bootstrap-regen impact) — surface scope-creep. +- **STOP** if §10.3 row 966's verbatim signature requires refinement at implementation time (`&Dag` may need module witness; `ClusterId` / `PortId` are existing Substrate types — verify via grep at brief-execution time; surface if drift). +- **PING** Evaluator Mgr (#2065 / `crisp-bat-13`) at PR-open time so they can retarget #1971 `Depends on:` to the carrier work-item AND begin consumer wiring against the same PR. + +## Cross-Mgr coordination + +- **Evaluator Mgr (#2065 / crisp-bat-13)**: same-slice consumer (E2 `descent_execution_proof` consumer at #1971). PING at PR-open; coordinate consumer wiring in same PR per acceptance gate #4. +- **Verification Mgr (#2075 / wise-bear-525)**: standing-program ratchet authoring is Verification's concern; no specific same-slice handoff expected unless ledger row needs to advance. + +## Worker pin (Mgr disposition) + +**quick-koi-190** — pre-authorized per §10.3 row 966 ("quick-koi-190 implementation already authorized through quick-crab"); also conceptually adjacent to T-E-P P1 work (DescentEvidence producer broadening) which quick-koi-190 has been on. Final pin at dispatch. + +## Auto-spawn caveat + +Per Director note 2026-05-07 + ratification at #4395060514: worker auto-spawn from Mgr-context is bug-affected (ctrl#217); HOLD dispatch on this brief until auto-spawn fix lands per L-sized-not-low-risk threshold, OR escalate via surgical-recreate path if Pattern A cascade or another critical path is blocked. Director ratifies surgical-recreate case-by-case. + +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-07 per Director γ-ratification at gunbc#828 #issuecomment-4395060514. From 0a0491cc84a5e6384a02bd0e03475c9eafb29723 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 03:43:04 -0400 Subject: [PATCH 20/50] =?UTF-8?q?WIP:=20R3=20Substrate=20Mgr=20=E2=80=94?= =?UTF-8?q?=20lane=20through=20R3=20close?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ubstrate-descent-execution-proof-canvas.md | 108 ------------------ 1 file changed, 108 deletions(-) delete mode 100644 docs/briefs/r3-substrate-descent-execution-proof-canvas.md diff --git a/docs/briefs/r3-substrate-descent-execution-proof-canvas.md b/docs/briefs/r3-substrate-descent-execution-proof-canvas.md deleted file mode 100644 index b97c2bd3d72..00000000000 --- a/docs/briefs/r3-substrate-descent-execution-proof-canvas.md +++ /dev/null @@ -1,108 +0,0 @@ -# Canvas — Substrate `descent_execution_proof` carrier (P1 substrate-fact-introduction) - -**Parent**: gunbc#1939 (Substrate Mgr lane); will be parented under a PM-authored work-item under #1939 post-ratification. -**Authority**: `docs/r3-program-plan.md` §10.3 row Q-EVAL-Descent-Termination-Contract (line 966); Director ratification of split disposition at gunbc#828 #issuecomment-4394696074 (descent_execution_proof STANDS ALONE; folds-into-T-E-P explicitly rejected). -**Closure predicate**: Evaluator E2 descent termination contract consumer (#1971); fail-closed residual enumeration is the load-bearing structural fact. -**Status**: **canvas — Director-tier ratification needed on residual enumeration shape before worker brief authoring**. - -## Scope - -Substrate carrier for executor-side termination-contract verification: - -``` -descent_execution_proof(&Dag, ClusterId, PortId) - -> Result -``` - -Per §10.3 row 966 the residual enumeration was provisionally named `Missing | Unknown | Incomplete | NonStrict`. The shape question is: **what is the minimum-irreducible variant set for `DescentResidual`?** - -## Adjacent substrate (grep-verified at HEAD) - -`src/v3/std/termination.dag:14-17` already defines: - -```dag -type DescentEvidence - = Strict - | NonIncreasing - | DescentUnknown -``` - -with `BoundedLattice` ordering `DescentUnknown < NonIncreasing < Strict` (top = `Strict`, bottom = `DescentUnknown` per fail-closed discipline). `merge_evidence` / `join_evidence` are conservative-meet / optimistic-join. - -So the residual question must reconcile with the existing 3-variant evidence type. **`Unknown` in the residual enumeration ≡ `DescentEvidence::DescentUnknown`**; reusing the existing carrier is the structural-cheap default unless a distinction emerges. - -## Carrier-shape options for the residual enumeration - -### Option α — 4-variant coproduct (as named in §10.3 row 966) - -```dag -type DescentResidual - = Missing // no DescentEvidence carrier present at the call site - | Unknown // DescentEvidence::DescentUnknown surfaced - | Incomplete // per-path evidence exists but some paths uncovered - | NonStrict // evidence is NonIncreasing (not Strict) -``` - -**Pro**: matches §10.3 row 966 verbatim; explicit named cases; readable at the consumer. -**Con**: `Missing` and `Unknown` may collapse — both are "evidence-absent" with different cardinalities (no carrier vs `DescentUnknown` carrier). Per `feedback_coproduct_dissolution`, this is the kind of variant pair that should ratchet downward unless there's a load-bearing distinction. Same for `Incomplete` vs `NonStrict` — both are "evidence-present-but-insufficient", differing on which axis (path-coverage vs strictness). - -### Option β — Dimensional product report - -```dag -type DescentResidualReport { - presence: EvidencePresence // CarrierPresent | CarrierAbsent - completeness: PathCoverage // AllPathsCovered | SomePathsUncovered - strictness: StrictnessVerdict // Strict | NonIncreasing | NotApplicable -} -``` - -Decomposes the 4-coproduct into 3 orthogonal axes; the executor reports per-axis verdict; the "fail" condition is any non-top axis. - -**Pro**: maximum structural decomposition per `feedback_coproduct_dissolution`; eliminates illegal-state question of whether `Incomplete` and `NonStrict` are mutually exclusive (the answer: no — a proof can be both); per-axis independent reasoning. -**Con**: heavier shape; requires defining 3 sub-types (`EvidencePresence`, `PathCoverage`, `StrictnessVerdict`) instead of 1; `StrictnessVerdict::NotApplicable` admits illegal state when carrier is absent (presence=CarrierAbsent + strictness=Strict shouldn't be representable). If the 3 axes don't actually compose orthogonally (i.e., some combinations are nonsensical), product shape is wrong. - -### Option γ — Reuse `DescentEvidence` for "absent/unknown"; 2 additional residuals - -```dag -type DescentResidual - = EvidenceUnknown(DescentEvidence) // wraps DescentUnknown (or NonIncreasing reported as not-strict) - | EvidenceIncomplete // multi-path partial coverage -``` - -3-variant collapse of α: `Missing` and `Unknown` fold into a single `EvidenceUnknown(DescentEvidence)` payload (the `Missing` case is `DescentUnknown` synthesized by the executor when no carrier is present); `NonStrict` folds into `EvidenceUnknown(NonIncreasing)` since the existing lattice already distinguishes `NonIncreasing` from `Strict`; `Incomplete` remains separate because path-coverage IS structurally distinct from per-evidence strictness. - -**Pro**: reuses `DescentEvidence` carrier per `feedback_audit_adjacent_authority_first`; ratchets variant count from 4 → 2 via dimensional folding; `EvidenceUnknown(Strict)` is unrepresentable by construction (Strict isn't a residual). -**Con**: payload-typed variant is heavier than bare-name variant; consumers must pattern-match on the payload to recover the original 4-case story; "Strict" appearing under `EvidenceUnknown` requires an inhabited-only-by-non-Strict refinement type or a runtime check (mild illegal-state risk). - -## Mgr-tier recommendation - -Provisional **γ**: ratchets the variant count via dimensional folding (per Director's coproduct-dissolution audit suggestion) while reusing the existing `DescentEvidence` carrier (services.dag-style "no parallel wrapper" precedent). The `Strict`-shouldn't-appear-here illegal-state risk is mild and addressable via either a refinement type (`DescentEvidence \ Strict`) or a fixture-load fail-closed check. - -If γ's payload-pattern-match cost is unacceptable for consumer ergonomics, **α** with explicit Mgr-acknowledgment that `Missing` ≡ `Unknown` (rather than fold via constructor injection) is the second-best — names the cases verbatim from §10.3 at the cost of one redundant variant. - -**β rejected** unless the 3 axes provably compose orthogonally — risk of admitting illegal states (carrier-absent + strictness=Strict) is real and would require additional refinement-shape work. - -## Director ratification ask - -1. **Pick α / β / γ** (or surface a fourth option). Provisional Mgr recommendation: **γ**. -2. Confirm the existing `DescentEvidence` 3-variant lattice at `termination.dag:14-17` is the authoritative starting point — i.e., the residual carrier composes with it rather than re-inventing it. -3. Confirm the typed signature `descent_execution_proof(&Dag, ClusterId, PortId) -> Result` from §10.3 row 966 is verbatim-binding, OR ratify a refinement (e.g., `&Dag` may need to be `&Dag` + module witness; `ClusterId` + `PortId` are existing Substrate types — verify via grep at worker brief time). - -## On ratification — worker brief scope - -Will author execution brief covering: -- `DescentResidual` carrier in `src/v3/std/termination.dag` (or sibling file if cleaner) per chosen option -- `DescentExecutionProof` carrier shape (witness payload — likely a mini-DAG or per-path evidence map) -- `descent_execution_proof()` substrate function signature in DSL with fail-closed body shape -- Acceptance: §1.8 gates per row 966 closure predicate; bootstrap regen + clippy + workspace tests green -- Cross-Mgr handoff: Evaluator (#1971 / crisp-bat-13) consumes carrier; Q-EVAL-Descent-Termination-Contract row 966 advances to `CONSUMER_LANDED` - -## Worker pin (Mgr disposition) - -**quick-koi-190** — already authorized through quick-crab per §10.3 row 966 ("quick-koi-190 implementation already authorized through quick-crab"); also currently on T-E-P P1 work which is conceptually adjacent (DescentEvidence producer broadening). Final pin at dispatch. - -## Auto-spawn caveat - -Per Director note 2026-05-07: worker auto-spawn from Mgr-context is bug-affected; HOLD dispatch on this canvas's worker brief until auto-spawn fix lands per L-sized-not-low-risk threshold. - -— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-07 post-#2079 merge per Director serial-cadence direction at gunbc#828 #issuecomment-4394696074. Coproduct-dissolution audit per Director's micro-suggestion in same message. From 0cfea88cea6b7041de4ad13f021bd3eef018430a Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 07:43:31 +0000 Subject: [PATCH 21/50] =?UTF-8?q?docs(briefs):=20descent=5Fexecution=5Fpro?= =?UTF-8?q?of=20=E2=80=94=20narrow=20EvidenceUnknown=20payload=20via=20Non?= =?UTF-8?q?StrictEvidence=20subset;=20delete=20superseded=20canvas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit openai-pro REQUEST_CHANGES at gunbc#2105: 2 findings. 1. BLOCKING (LAYER MODEL / illegal states unrepresentable): worker brief shape `EvidenceUnknown(DescentEvidence)` admitted EvidenceUnknown(Strict) even though the canvas itself acknowledged Strict-isn't-a-residual as illegal. P2 requires API-level enforcement, not prose convention. Fix: introduce typed subset `NonStrictEvidence = NonIncreasing | DescentUnknown`; residual now `EvidenceUnknown(NonStrictEvidence)` — illegal-states-unrepresentable by construction. NonStrictEvidence lands in same file as DescentResidual; composes with existing 3-variant DescentEvidence via inhabitation, not re-definition. 2. NON-BLOCKING (live-state drift): canvas + worker brief both visible with "ratification needed" vs "ratified" status — same P2 single-authority shape as the S5 canvas/worker-brief co-existence at #2079. Fix: delete docs/briefs/r3-substrate-descent-execution-proof-canvas.md (worker brief frontmatter already names it as superseded; with canvas gone the live authority is unambiguous). Co-Authored-By: Claude Opus 4.7 (1M context) --- .../r3-substrate-descent-execution-proof-worker.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/briefs/r3-substrate-descent-execution-proof-worker.md b/docs/briefs/r3-substrate-descent-execution-proof-worker.md index fbbe9b8b299..023e1991972 100644 --- a/docs/briefs/r3-substrate-descent-execution-proof-worker.md +++ b/docs/briefs/r3-substrate-descent-execution-proof-worker.md @@ -13,11 +13,19 @@ Substrate-fact-introduction (P1 procedure): consumer-side typed substrate functi **Location**: `src/v3/std/termination.dag` (extend the existing file — `DescentEvidence` already lives there; sibling typing keeps the lattice + residual co-located). Verify-via-grep at HEAD that no near-neighbor file has prior claim. ```dag +// Non-Strict subset of DescentEvidence — P2 API-level enforcement: a residual +// can never wrap Strict (Strict means termination IS provable; not a residual). +type NonStrictEvidence + = NonIncreasing + | DescentUnknown + type DescentResidual - = EvidenceUnknown(DescentEvidence) // wraps DescentUnknown for absent-evidence; wraps NonIncreasing for not-strict - | EvidenceIncomplete // proof-construction state: per-path coverage incomplete + = EvidenceUnknown(NonStrictEvidence) // wraps DescentUnknown for absent-evidence; wraps NonIncreasing for not-strict + | EvidenceIncomplete // proof-construction state: per-path coverage incomplete ``` +**Illegal-states-unrepresentable rationale**: the canvas's `EvidenceUnknown(DescentEvidence)` shape would admit `EvidenceUnknown(Strict)` — illegal by construction (Strict means termination is provable, which is not a residual). Per P2 (API-level enforcement over convention), the residual carrier MUST narrow the payload via a typed subset rather than rely on a runtime-only check. `NonStrictEvidence` is the minimum-irreducible 2-variant subset of `DescentEvidence` that's actually a residual. Worker MUST land `NonStrictEvidence` in the same file as `DescentResidual` (`src/v3/std/termination.dag`); compose with existing 3-variant `DescentEvidence` via inhabitation, not by re-defining variants. + **Single substrate function**: ```dag From ce12428637b1f24533e17ba9c838d9433d5bc440 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 07:48:23 +0000 Subject: [PATCH 22/50] =?UTF-8?q?docs(briefs):=20descent=5Fexecution=5Fpro?= =?UTF-8?q?of=20=E2=80=94=20section-anchor=20cite=20for=20=C2=A710.3=20row?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit codex BLOCKING at gunbc#2105 line 47: my brief cited "§10.3 row 966" but the actual line is now 986 (after my Q-Reification row insert in PR #2079 shifted §10.3 by 20 lines). Reviewer's "no such section" claim is wrong on substance (file + section + row all exist) but the line drift IS real. Fix per feedback_section_anchors_over_line_numbers (Director calibration in gunbc#2079): replaced all "§10.3 row 966" with "§10.3 Q-EVAL-Descent- Termination-Contract row" — name-anchor instead of line-anchor, drift-immune. 5 occurrences cleaned (closure predicate, acceptance gate #3, gate #5, STOP criterion, worker pin justification). Stylistic "row row-text" repetition collapsed to "row text". Co-Authored-By: Claude Opus 4.7 (1M context) --- .../r3-substrate-descent-execution-proof-worker.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/briefs/r3-substrate-descent-execution-proof-worker.md b/docs/briefs/r3-substrate-descent-execution-proof-worker.md index 023e1991972..c28ff29fb6a 100644 --- a/docs/briefs/r3-substrate-descent-execution-proof-worker.md +++ b/docs/briefs/r3-substrate-descent-execution-proof-worker.md @@ -2,7 +2,7 @@ **Sub-issue**: TBD (PM creates under #1939 post-this-brief landing; Evaluator's #1971 `Depends on:` retargets to that issue). **Authority**: Director ratification of **option γ** at gunbc#828 #issuecomment-4395060514 (2026-05-07); supersedes the canvas at `docs/briefs/r3-substrate-descent-execution-proof-canvas.md` (canvas may be deleted after this brief lands). -**Closure predicate**: Evaluator E2 descent termination contract consumer (#1971); §10.3 row 966 row-text refresh to cite γ-disposition (2-variant residual, not 4-variant prose). +**Closure predicate**: Evaluator E2 descent termination contract consumer (#1971); §10.3 Q-EVAL-Descent-Termination-Contract row text refresh to cite γ-disposition (2-variant residual, not 4-variant prose). ## Scope @@ -50,9 +50,9 @@ Per Director: "this is canvas-shape verification, not a re-ratification ask. If 1. **`DescentResidual` carrier landed** in `src/v3/std/termination.dag` (or chosen location post-grep) per ratified γ shape (modulo STOP-resolution on `EvidenceIncomplete` payload). 2. **`DescentExecutionProof` carrier landed** with witness payload shape (per-path evidence map or richer structure surfaced via STOP-and-PING). -3. **`descent_execution_proof()` substrate function landed** with the typed signature from §10.3 row 966 (verbatim per Director confirm). +3. **`descent_execution_proof()` substrate function landed** with the typed signature from §10.3 Q-EVAL-Descent-Termination-Contract row (verbatim per Director confirm). 4. **Evaluator E2 (#1971) consumes the carrier** in same-slice — proves multi-consumer composability is unnecessary for this carrier (Evaluator IS the consumer per closure predicate; carrier-with-single-consumer-as-interface anti-pattern doesn't apply because the carrier is consumer-cementing for executor termination contract). PR description names the Evaluator consumer call site. -5. **§10.3 row 966 row-text update**: ROADMAP cites γ-disposition (2-variant residual) replacing the prose `Missing | Unknown | Incomplete | NonStrict` 4-variant naming. Per Director: "ROADMAP §10.3 row 966 row text should update on Gate A landing to cite this ratification." +5. **§10.3 Q-EVAL-Descent-Termination-Contract row text update**: ROADMAP cites γ-disposition (2-variant residual) replacing the prose `Missing | Unknown | Incomplete | NonStrict` 4-variant naming. Per Director: "ROADMAP §10.3 Q-EVAL-Descent-Termination-Contract row text should update on Gate A landing to cite this ratification." 6. Bootstrap regen: `cargo test -p v3-compiler bootstrap_regen_fresh -- --ignored` clean. 7. Full suite: `cargo test --workspace --exclude v2-compiler-tests` green; `cargo clippy --all-targets -- -D warnings` clean. @@ -60,7 +60,7 @@ Per Director: "this is canvas-shape verification, not a re-ratification ask. If - **STOP** if `EvidenceIncomplete` decomposes into payload-variants per the Director-asked verification above — surface to Mgr (warm-wolf-698 / inbox #2068) before adding a payload; canvas update needed. - **STOP** if `DescentExecutionProof` witness shape requires substantial new substrate (e.g., a fresh per-path-witness type with non-trivial bootstrap-regen impact) — surface scope-creep. -- **STOP** if §10.3 row 966's verbatim signature requires refinement at implementation time (`&Dag` may need module witness; `ClusterId` / `PortId` are existing Substrate types — verify via grep at brief-execution time; surface if drift). +- **STOP** if §10.3 Q-EVAL-Descent-Termination-Contract row's verbatim signature requires refinement at implementation time (`&Dag` may need module witness; `ClusterId` / `PortId` are existing Substrate types — verify via grep at brief-execution time; surface if drift). - **PING** Evaluator Mgr (#2065 / `crisp-bat-13`) at PR-open time so they can retarget #1971 `Depends on:` to the carrier work-item AND begin consumer wiring against the same PR. ## Cross-Mgr coordination @@ -70,7 +70,7 @@ Per Director: "this is canvas-shape verification, not a re-ratification ask. If ## Worker pin (Mgr disposition) -**quick-koi-190** — pre-authorized per §10.3 row 966 ("quick-koi-190 implementation already authorized through quick-crab"); also conceptually adjacent to T-E-P P1 work (DescentEvidence producer broadening) which quick-koi-190 has been on. Final pin at dispatch. +**quick-koi-190** — pre-authorized per §10.3 Q-EVAL-Descent-Termination-Contract row ("quick-koi-190 implementation already authorized through quick-crab"); also conceptually adjacent to T-E-P P1 work (DescentEvidence producer broadening) which quick-koi-190 has been on. Final pin at dispatch. ## Auto-spawn caveat From 93c6f7640d412643fcbceae375a0abab7c999b6b Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 08:56:09 +0000 Subject: [PATCH 23/50] =?UTF-8?q?docs(briefs):=20T-CostLens-Composition=20?= =?UTF-8?q?canvas=20=E2=80=94=20Lens=20composition=20shape?= =?UTF-8?q?=20(#1957)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pre-staged per Director endorsement of T-CostLens-Composition canvas-shape authoring. Surfaces 3 composition options for the Lens instance: α: two separate lenses, externally joined — REJECTED (violates §1.8 gate #39 no_coercion_cost_dimension by construction) β: single Lens with composed witness in read — strong but requires Lens carrier-shape refactor (target-context threading) γ (recommended): Lens reads structural cost via algebra-fold + target-realization composed via existing Lookup substrate at lookup.dag:48-60 — preserves generic Lens carrier; satisfies all 4 §1.8 gates (#37-40) by construction; aligns with feedback_audit_adjacent_authority_first Adjacent substrate verified at HEAD: lens.dag:70-77 (Lens), algebra.dag:12+ (SymbolicCost 7-variant + Semiring), lookup.dag:48-60 (Lookup + MissingCost lens-boundary). Co-Authored-By: Claude Opus 4.7 (1M context) --- ...substrate-t-costlens-composition-canvas.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 docs/briefs/r3-substrate-t-costlens-composition-canvas.md diff --git a/docs/briefs/r3-substrate-t-costlens-composition-canvas.md b/docs/briefs/r3-substrate-t-costlens-composition-canvas.md new file mode 100644 index 00000000000..5db2272e436 --- /dev/null +++ b/docs/briefs/r3-substrate-t-costlens-composition-canvas.md @@ -0,0 +1,76 @@ +# Canvas — Substrate T-CostLens-Composition (`Lens` instance shape) + +**Sub-issue**: gunbc#1957 (parented under #1939 Substrate Mgr lane). +**Authority**: `docs/r3-program-plan.md` §10.3 T-CostLens-Composition row at line 399 ("(TBD from Substrate canvas)" — explicitly Substrate Mgr canvas territory); `docs/r3-design-schedule-2026-05-06.md:72` cost-lens-as-discriminator framing. +**Closure predicate**: §1.8 gates #37-40 (structural-fold + thesis-unification + no-separate-cost-dimension + executable predicate) + #70 demonstration. +**Status**: **canvas — Director-tier ratification needed on composition shape before worker brief authoring**. + +## Adjacent substrate (grep-verified at HEAD) + +- `src/v3/std/lens.dag:70-77` defines the generic `Lens` carrier (`read`, `sequential: Monoid`, `branch`, `iterate`, `validate`). Already-landed; NOT subject to redesign. +- `src/v3/std/algebra.dag:12+` defines `SymbolicCost` 7-variant coproduct (`ProductCost`, `SumCost`, etc.) + `Semiring` inhabitance. Algebra-cost side already-substrate. +- `src/v3/std/lookup.dag:48-60` scaffolds `Lookup` + `MissingCost` lens-boundary-fallback shape. +- `src/v3/std/machine_constraints.dag` (per memory + #1933) defines `MachineWidth` substrate; target-realization side has structural facts available. +- `src/v3/std/dimensions.dag:10` notes `data symbolic_cost_dimension: AnalysisDimension` is **deferred** — that's part of the canvas territory. + +## Scope + +T-CostLens-Composition lands a **single `Lens` instance** (or near-equivalent) that composes algebra-cost (already-substrate via `Semiring`) with target-realization-cost (read via `MachineConstraint` / target language spec) end-to-end. Per Director's "cost-lens-as-discriminator" framing: the cost lens orders faithful-representation alternatives by per-primitive realization cost; Grounding selects lowest-cost faithful representation. + +**Key invariant** (gate #39 `no_coercion_cost_dimension`): NO separate cost dimension for coercion vs realization vs algebra — one `SymbolicCost` algebra, all three sources feed into it via `Semiring` operations. + +## Carrier-composition options + +### Option α — Two separate lenses, externally joined + +`Lens` reads algebra-cost only (structural-fold over Behavior + algebra inhabitance); separate `Lens` reads target-realization-cost from LanguageSpec; composition happens at the consumer (Grounding). + +**Pro**: Each lens has a single concern; algebra-cost is target-independent (purer). +**Con**: Violates gate #39 by construction — TWO cost dimensions, joined by convention not by carrier shape. `coercion_cost_equals_complexity_by_construction` (gate #38) would have to be a derived theorem rather than structural-by-construction. Rejected. + +### Option β — Single `Lens` with composed witness in `read` + +`Lens::read(dag, behavior) -> Witness` reads BOTH algebra-cost AND target-realization-cost, composing them via `Semiring` (sum for sequential operations, product for branch/iterate as appropriate). Target-realization-cost obtained via per-primitive lookup keyed on `MachineConstraint` instances at the Behavior's primitives. + +**Pro**: Single cost dimension by construction (gate #39 satisfied structurally); `coercion_cost_equals_complexity_by_construction` is true by construction (gate #38) because coercion is just another operation feeding into the same algebra. End-to-end composition is the carrier's `read` signature. +**Con**: `read` becomes target-aware — needs target-language-spec context threaded through. May force Lens generic's `read: fn(Dag, Behavior) -> Witness` to gain a third parameter (target-context) — substrate-impacting refactor of the generic lens carrier, OR cost lens carries a captured target reference (closure-shape, less structural). + +### Option γ — `Lens` reads structural; target-realization via `Lookup` + +`Lens::read` reads structural-cost via algebra-fold (Behavior + `SymbolicCost` algebra inhabitance); target-realization-cost composed via existing `Lookup` infrastructure at `lookup.dag:48-60`. The lookup is keyed on per-primitive identity (target-spec-derived); when present, lookup-cost composes into the lens output via `Semiring::sum`. + +**Pro**: Reuses existing `Lookup` substrate (per `feedback_audit_adjacent_authority_first` — already authored). Generic `Lens` carrier unchanged; target-realization-cost enters via Lookup's `MissingCost` lens-boundary-fallback shape (already-substrate). Single-cost-dimension preserved (Lookup output IS `SymbolicCost`). `cost_lens_reads_target_realization` (gate #37) is satisfied by Lookup composition; `no_coercion_cost_dimension` (gate #39) is satisfied because Lookup output composes into the same algebra. +**Con**: Lookup-via-Lens-during-read is slightly indirect; consumers must know Lookup is part of the cost computation (vs being lens-internal). Mitigation: lens implementation hides Lookup composition; consumers see only `Lens::read` interface. + +## Mgr-tier recommendation + +Provisional **γ**: composes via existing `Lookup` substrate (already-authored at `lookup.dag:48-60`); preserves generic `Lens` carrier shape unchanged; satisfies all 4 §1.8 gates by construction (#37 via Lookup, #38 via Semiring composition, #39 via single algebra, #40 via the carrier's typed `read` output). Aligns with `feedback_audit_adjacent_authority_first` + `feedback_compositional_not_templating`. + +**β** is second-best if Lookup composition turns out to be insufficient for end-to-end realization-cost reading at canvas-implementation time (e.g., target-realization-cost requires more context than a per-primitive lookup can carry). + +**α rejected** — violates gate #39 by construction. + +## Director ratification ask + +1. **Pick α / β / γ** (or surface fourth option). Provisional Mgr recommendation: **γ** (Lookup composition). +2. Confirm `Lens` generic at `lens.dag:70-77` is authoritative starting point (no carrier-shape refactor in T-CostLens scope). Per option γ this is unchanged; per option β it would refactor. +3. Confirm `data symbolic_cost_dimension: AnalysisDimension` (currently deferred per `dimensions.dag:10`) lands as part of T-CostLens-Composition or stays separately deferred to a Dimensions sub-lane. + +## On ratification — worker brief scope + +Will author execution brief covering: +- `Lens` instance authoring in DSL (likely `src/v3/lenses/cost.dag` per existing convention; verify-via-grep at brief time) +- `read` implementation per chosen option (γ Lookup composition / β composed witness) +- `cost_lens_demonstration` (gate #70): ≥2 algebra-instances composed + ≥1 recursive call + observable cost-bound output — fixture program + executor wiring same-slice +- 4 §1.8 gates (#37-40) advance to executable status +- `data symbolic_cost_dimension` lands or stays deferred per question 3 + +## Worker pin (Mgr disposition) + +Substrate-fact-introduction precedent owners — valiant-ibex-312 (delivered IntPlatform/UIntPlatform, S5 candidate) OR smart-ram-167. Final pin at dispatch. + +## Auto-spawn caveat + +Per Director's standing note + cache-staleness cluster ctrl#217: HOLD dispatch on this canvas's worker brief until auto-spawn fix lands per L-sized substrate-fact-introduction threshold. + +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-07 post-#2105 merge per Director endorsement of pre-staging T-CostLens-Composition canvas-shape. From 054dcdeb0cc60482d0ee3fc0d3e90c8c8398cc36 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 09:30:11 +0000 Subject: [PATCH 24/50] =?UTF-8?q?docs(briefs):=20T-Workflow-As-Data=20canv?= =?UTF-8?q?as=20=E2=80=94=20audit-receipt-honoring=20scope-narrowing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pre-staged per Director endorsement. Q-Workflow-As-Data-Carriers (§10.3 row 983) named 5 carriers; grep-verified at HEAD that 4 of 5 ALREADY EXIST in dsl/extdeps/github/actions.dag (218 lines). Only WorkflowSecret is wholly net-new substrate. Surfaces 3 options: α: maximalist 5-carrier introduction in dsl/std/workflow.dag — REJECTED (admits parallel-representation debt vs audit-receipt #1771 reuse-first directive) β (recommended): minimalist — only WorkflowSecret + Cron refinement net-new; lens consumes extdeps.github.actions directly. Honors feedback_audit_adjacent_authority_first. γ: like β + WorkflowObservationAnchor for typed lens-consumption-shape; natural ratchet from β if evidence accumulates. Sequencing: dispatch-ready post-T-LBP COMPLETE per §S4 design-schedule:95; brief authoring lands in advance per pre-staging discipline. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../r3-substrate-t-workflow-as-data-canvas.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 docs/briefs/r3-substrate-t-workflow-as-data-canvas.md diff --git a/docs/briefs/r3-substrate-t-workflow-as-data-canvas.md b/docs/briefs/r3-substrate-t-workflow-as-data-canvas.md new file mode 100644 index 00000000000..69cbf5f039e --- /dev/null +++ b/docs/briefs/r3-substrate-t-workflow-as-data-canvas.md @@ -0,0 +1,77 @@ +# Canvas — Substrate T-Workflow-As-Data carriers (5-row scope-narrowing) + +**Sub-issue**: gunbc#1956 (T-Workflow-As-Data CI-workflow-as-.dag-data demo, parented under #1939); umbrella scope is §10.3 row Q-Workflow-As-Data-Carriers (line 983, OPEN — Substrate Mgr scoping needed). +**Authority**: `docs/r3-program-plan.md:474-480` (5 carrier names) + `docs/r3-design-schedule-2026-05-06.md:84-88` (audit-first directive); `dsl/extdeps/github/actions.dag` (218 lines, already-substrate); audit-and-delta receipt landed 2026-05-06 via #1771 (closed #1873). +**Closure predicate**: §1.8 gates #53 (workflow_substrate_carriers_landed), #54 (timing_lens_carrier_landed), #55 (shared_external_attachment_pattern_documented), #56 (ci_workflow_modeled_as_dag), #62 (substrate_gap_file_ingestion_closed), #63 (substrate_gap_workflow_scheduling_closed). +**Status**: **canvas — Director-tier ratification needed on reuse-vs-new scope before worker brief authoring**. + +## Observation: 4 of 5 named carriers ALREADY exist in `extdeps.github.actions` + +Per §S4 design-schedule directive line 84 (codex BLOCKING 2026-05-06): "S4 worker brief MUST audit `extdeps.github.actions` first and either (a) extend/refine existing carriers via T-Workflow-As-Data lens-consumption-shape additions (preferred per `feedback_audit_adjacent_authority_first` + `feedback_parallel_representation_debt`), or (b) explicitly dissolve `extdeps.github.actions` with a migration path before introducing parallel carriers." + +Grep-verified `dsl/extdeps/github/actions.dag` at HEAD: + +| §10.3 row 983 carrier name | extdeps.github.actions HEAD | Reuse/refine | Net new substrate | +|---|---|---|---| +| `WorkflowTrigger` (Push / PullRequest / Cron / Manual) | `WorkflowTrigger` (Push / PullRequest / Schedule / WorkflowDispatch / WorkflowCall) at `:40` | Refine: `Schedule { cron: String }` → typed `Cron` carrier (per design-schedule:87) | minimal | +| `WorkflowStep` (run command + dependencies + outputs) | `Step` at `:103` | Reuse name `Step`; lens-consumption may add observation anchor | none if pure reuse | +| `WorkflowMatrix` (parameter expansion) | `MatrixStrategy` at `:66+` (inside `Job`) | Reuse + possibly extract as standalone carrier for lens consumption | minimal | +| `WorkflowSecret` (provider-typed, opaque-at-rest, scoped-by-step) | NOT EXTANT in actions.dag at HEAD | **NEW substrate** | full carrier | +| `RunnerResource` (compute class, OS, hardware) | `RunnerSpec` + `RunnerLabel` at `:88+` | Reuse + parameterize as `RunnerResource` for lens-shape consumption | minimal | +| `Workflow` composing carrier | `Workflow` at `:20` (untyped composition) | Refine to parameterized form for lens generic dispatch | minimal | + +**Key finding**: of the 5 named carriers in §10.3 row 983, **only `WorkflowSecret` is wholly new substrate**. The other 4 are reuse-or-refine of existing `extdeps.github.actions` types. The audit-and-delta receipt (#1771, closed via #1873) confirmed this shape; the canvas territory now is **the lens-consumption-shape question**, NOT a 5-carrier-introduction question. + +## Real canvas question (post-audit) + +Given the existing `extdeps.github.actions` substrate is the reuse-base, what's the **minimum additional substrate** needed for T-Workflow-As-Data closure? + +### Option α — Maximalist: introduce all 5 named carriers in `dsl/std/workflow.dag` as parametric refinements + +New file `dsl/std/workflow.dag` declares parameterized versions of all 5 carriers; `extdeps.github.actions` types become specialized instances via composition. New `WorkflowSecret` lands here. + +**Pro**: clean substrate-internal home for T-Workflow-As-Data; lens consumption talks to `dsl/std/workflow.dag` (compiler-internal vocabulary), not `dsl/extdeps/github/` (external-tool vocabulary). +**Con**: introduces parallel-representation debt with `extdeps.github.actions` (per `feedback_parallel_representation_debt`). The audit-receipt's reuse-first directive argues against this. 5 new types when only 1 is wholly novel. + +### Option β — Minimalist (audit-receipt-honoring): land only `WorkflowSecret` + `Cron` refinement; lens consumes existing `extdeps.github.actions` types directly + +Single new file `dsl/std/workflow_secret.dag` (or fold into `extdeps.github.actions` if scope-cohering) carrying `WorkflowSecret` + the typed `Cron` refinement. Lens-consumption shapes (e.g., `WorkflowObservationAnchor`) land in `dsl/std/workflow.dag` separately if/when needed by the lens; T-Workflow-As-Data's CI-workflow-as-.dag-data demo (#1956) consumes the refined `extdeps.github.actions` directly. + +**Pro**: minimal substrate addition; honors audit-receipt's reuse-first directive (`feedback_audit_adjacent_authority_first`); single point of new-substrate, single point of refinement. No parallel-representation debt. +**Con**: lens consumption talks to `extdeps.github.actions` (external-tool vocabulary) — may look conceptually inconsistent with other lens consumers reading `dsl/std/*` types. Mitigation: documented as deliberate audit-receipt outcome. + +### Option γ — Lens-consumption-shape carrier separately + minimal new substrate + +Like β but with `WorkflowObservationAnchor` (per Substrate Mgr design stance at gunbc#1130 comment-4374109666) explicitly authored alongside `WorkflowSecret`. The lens-consumption layer is its own typed carrier; doesn't conflate with `extdeps.github.actions` reuse. + +**Pro**: separates "external-tool vocabulary" (extdeps.github.actions, reuse) from "lens-consumption substrate" (new `WorkflowObservationAnchor`); each layer has single concern. Lens consumers read `WorkflowObservationAnchor`, which references `extdeps.github.actions::Workflow` structurally. +**Con**: 2 new substrate carriers vs β's 1; mild scope expansion. Justifiable IF lens-consumption-shape genuinely needs typed handle distinct from `extdeps.github.actions::Workflow`. + +## Mgr-tier recommendation + +Provisional **β** (minimalist, audit-receipt-honoring): only `WorkflowSecret` + `Cron` refinement land as net-new substrate. Lens consumes `extdeps.github.actions` directly until evidence shows a typed lens-handle is needed. **γ** is the natural ratchet from β if lens-consumption-shape evidence accumulates (per `feedback_construction_over_ratchets` — model first, dissolve later if substrate evidence forces). + +**α rejected** — admits parallel-representation debt against `extdeps.github.actions` audit-receipt findings. + +## Director ratification ask + +1. **Pick α / β / γ** (or surface fourth). Mgr recommendation: **β**. +2. Confirm `extdeps.github.actions` audit-receipt at #1771 is the binding precedent for reuse-first posture (i.e., the audit confirmed reuse is the right shape, not deprecation). +3. Confirm `WorkflowSecret` location: `dsl/std/workflow_secret.dag` (new file) vs fold into existing `extdeps.github.actions` (extension). Provisional Mgr preference: **new file** (compiler-internal substrate, distinct from external-tool vocabulary; honors layer model). +4. Confirm whether §1.8 gate #54 (`timing_lens_carrier_landed`) and gate #55 (`shared_external_attachment_pattern_documented`) are in T-Workflow-As-Data scope or fold to T-LBP / separate sub-lane. + +## On ratification — worker brief scope + +Will author execution brief covering: +- `WorkflowSecret` carrier (`dsl/std/workflow_secret.dag` per option β/γ) +- `Cron` typed refinement (location TBD per question 3) +- (γ only) `WorkflowObservationAnchor` lens-consumption-shape carrier +- Worker pin: substrate-fact-introduction precedent owners (valiant-ibex-312 / smart-ram-167) +- Acceptance: §1.8 gates #53-#56 + #62-#63 advance per closure-predicate scope +- T-Workflow-As-Data #1956 demo consumer wiring (CI-workflow-as-.dag-data) in same-slice or cross-Mgr handoff per Director ratification + +## Sequencing caveat + +Per §S4 design-schedule line 95: "post-T-Lens-Behavioral-Parity COMPLETE (per `r3-structure.md` §"Dependency on R2"; lens consumption needs lenses COMPLETE)". This canvas is dispatch-ready post-T-LBP COMPLETE; brief authoring can land in advance per pre-staging discipline but worker dispatch waits. + +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-07 post-#2105 merge per Director endorsement of pre-staging next-up substrate canvases. Honors audit-and-delta receipt #1771 (closed #1873) reuse-first directive. From 102071e509d25e36554ba5255a795f0596d78359 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 10:04:25 +0000 Subject: [PATCH 25/50] =?UTF-8?q?docs(briefs):=20T-CostLens-Composition=20?= =?UTF-8?q?worker=20brief=20=E2=80=94=20=CE=B3=20ratified;=20delete=20canv?= =?UTF-8?q?as?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Director ratification at gunbc#828 #issuecomment-4395691775: - γ option ratified (Lens + Lookup composition) - Lens generic at lens.dag:70-77 confirmed authoritative (no refactor in scope) - symbolic_cost_dimension: AnalysisDimension defers to separate Dimensions sub-lane Critical reframing absorbed: src/v3/lenses/cost.dag ALREADY EXISTS (status: STRUCTURALLY TERMINAL; BEHAVIORALLY PROXY). T-CostLens-Composition is behavioral-completion + target-realization-wiring, NOT P1 carrier introduction. Worker reads existing lens; advances PROXY → BEHAVIORALLY COMPLETE via Lookup composition. 8 same-slice acceptance gates incl §1.8 #37-40 + #70 demonstration + lens status header refresh + §10.3 row text refresh. Out-of-scope (deferred per Director): symbolic_cost_dimension; Lens generic refactor (STOP-and-PING if implementation reveals need). Canvas deleted per single-authority discipline (same precedent as S5 + descent_execution_proof canvas deletions). Co-Authored-By: Claude Opus 4.7 (1M context) --- ...substrate-t-costlens-composition-canvas.md | 76 ------------------- ...substrate-t-costlens-composition-worker.md | 66 ++++++++++++++++ 2 files changed, 66 insertions(+), 76 deletions(-) delete mode 100644 docs/briefs/r3-substrate-t-costlens-composition-canvas.md create mode 100644 docs/briefs/r3-substrate-t-costlens-composition-worker.md diff --git a/docs/briefs/r3-substrate-t-costlens-composition-canvas.md b/docs/briefs/r3-substrate-t-costlens-composition-canvas.md deleted file mode 100644 index 5db2272e436..00000000000 --- a/docs/briefs/r3-substrate-t-costlens-composition-canvas.md +++ /dev/null @@ -1,76 +0,0 @@ -# Canvas — Substrate T-CostLens-Composition (`Lens` instance shape) - -**Sub-issue**: gunbc#1957 (parented under #1939 Substrate Mgr lane). -**Authority**: `docs/r3-program-plan.md` §10.3 T-CostLens-Composition row at line 399 ("(TBD from Substrate canvas)" — explicitly Substrate Mgr canvas territory); `docs/r3-design-schedule-2026-05-06.md:72` cost-lens-as-discriminator framing. -**Closure predicate**: §1.8 gates #37-40 (structural-fold + thesis-unification + no-separate-cost-dimension + executable predicate) + #70 demonstration. -**Status**: **canvas — Director-tier ratification needed on composition shape before worker brief authoring**. - -## Adjacent substrate (grep-verified at HEAD) - -- `src/v3/std/lens.dag:70-77` defines the generic `Lens` carrier (`read`, `sequential: Monoid`, `branch`, `iterate`, `validate`). Already-landed; NOT subject to redesign. -- `src/v3/std/algebra.dag:12+` defines `SymbolicCost` 7-variant coproduct (`ProductCost`, `SumCost`, etc.) + `Semiring` inhabitance. Algebra-cost side already-substrate. -- `src/v3/std/lookup.dag:48-60` scaffolds `Lookup` + `MissingCost` lens-boundary-fallback shape. -- `src/v3/std/machine_constraints.dag` (per memory + #1933) defines `MachineWidth` substrate; target-realization side has structural facts available. -- `src/v3/std/dimensions.dag:10` notes `data symbolic_cost_dimension: AnalysisDimension` is **deferred** — that's part of the canvas territory. - -## Scope - -T-CostLens-Composition lands a **single `Lens` instance** (or near-equivalent) that composes algebra-cost (already-substrate via `Semiring`) with target-realization-cost (read via `MachineConstraint` / target language spec) end-to-end. Per Director's "cost-lens-as-discriminator" framing: the cost lens orders faithful-representation alternatives by per-primitive realization cost; Grounding selects lowest-cost faithful representation. - -**Key invariant** (gate #39 `no_coercion_cost_dimension`): NO separate cost dimension for coercion vs realization vs algebra — one `SymbolicCost` algebra, all three sources feed into it via `Semiring` operations. - -## Carrier-composition options - -### Option α — Two separate lenses, externally joined - -`Lens` reads algebra-cost only (structural-fold over Behavior + algebra inhabitance); separate `Lens` reads target-realization-cost from LanguageSpec; composition happens at the consumer (Grounding). - -**Pro**: Each lens has a single concern; algebra-cost is target-independent (purer). -**Con**: Violates gate #39 by construction — TWO cost dimensions, joined by convention not by carrier shape. `coercion_cost_equals_complexity_by_construction` (gate #38) would have to be a derived theorem rather than structural-by-construction. Rejected. - -### Option β — Single `Lens` with composed witness in `read` - -`Lens::read(dag, behavior) -> Witness` reads BOTH algebra-cost AND target-realization-cost, composing them via `Semiring` (sum for sequential operations, product for branch/iterate as appropriate). Target-realization-cost obtained via per-primitive lookup keyed on `MachineConstraint` instances at the Behavior's primitives. - -**Pro**: Single cost dimension by construction (gate #39 satisfied structurally); `coercion_cost_equals_complexity_by_construction` is true by construction (gate #38) because coercion is just another operation feeding into the same algebra. End-to-end composition is the carrier's `read` signature. -**Con**: `read` becomes target-aware — needs target-language-spec context threaded through. May force Lens generic's `read: fn(Dag, Behavior) -> Witness` to gain a third parameter (target-context) — substrate-impacting refactor of the generic lens carrier, OR cost lens carries a captured target reference (closure-shape, less structural). - -### Option γ — `Lens` reads structural; target-realization via `Lookup` - -`Lens::read` reads structural-cost via algebra-fold (Behavior + `SymbolicCost` algebra inhabitance); target-realization-cost composed via existing `Lookup` infrastructure at `lookup.dag:48-60`. The lookup is keyed on per-primitive identity (target-spec-derived); when present, lookup-cost composes into the lens output via `Semiring::sum`. - -**Pro**: Reuses existing `Lookup` substrate (per `feedback_audit_adjacent_authority_first` — already authored). Generic `Lens` carrier unchanged; target-realization-cost enters via Lookup's `MissingCost` lens-boundary-fallback shape (already-substrate). Single-cost-dimension preserved (Lookup output IS `SymbolicCost`). `cost_lens_reads_target_realization` (gate #37) is satisfied by Lookup composition; `no_coercion_cost_dimension` (gate #39) is satisfied because Lookup output composes into the same algebra. -**Con**: Lookup-via-Lens-during-read is slightly indirect; consumers must know Lookup is part of the cost computation (vs being lens-internal). Mitigation: lens implementation hides Lookup composition; consumers see only `Lens::read` interface. - -## Mgr-tier recommendation - -Provisional **γ**: composes via existing `Lookup` substrate (already-authored at `lookup.dag:48-60`); preserves generic `Lens` carrier shape unchanged; satisfies all 4 §1.8 gates by construction (#37 via Lookup, #38 via Semiring composition, #39 via single algebra, #40 via the carrier's typed `read` output). Aligns with `feedback_audit_adjacent_authority_first` + `feedback_compositional_not_templating`. - -**β** is second-best if Lookup composition turns out to be insufficient for end-to-end realization-cost reading at canvas-implementation time (e.g., target-realization-cost requires more context than a per-primitive lookup can carry). - -**α rejected** — violates gate #39 by construction. - -## Director ratification ask - -1. **Pick α / β / γ** (or surface fourth option). Provisional Mgr recommendation: **γ** (Lookup composition). -2. Confirm `Lens` generic at `lens.dag:70-77` is authoritative starting point (no carrier-shape refactor in T-CostLens scope). Per option γ this is unchanged; per option β it would refactor. -3. Confirm `data symbolic_cost_dimension: AnalysisDimension` (currently deferred per `dimensions.dag:10`) lands as part of T-CostLens-Composition or stays separately deferred to a Dimensions sub-lane. - -## On ratification — worker brief scope - -Will author execution brief covering: -- `Lens` instance authoring in DSL (likely `src/v3/lenses/cost.dag` per existing convention; verify-via-grep at brief time) -- `read` implementation per chosen option (γ Lookup composition / β composed witness) -- `cost_lens_demonstration` (gate #70): ≥2 algebra-instances composed + ≥1 recursive call + observable cost-bound output — fixture program + executor wiring same-slice -- 4 §1.8 gates (#37-40) advance to executable status -- `data symbolic_cost_dimension` lands or stays deferred per question 3 - -## Worker pin (Mgr disposition) - -Substrate-fact-introduction precedent owners — valiant-ibex-312 (delivered IntPlatform/UIntPlatform, S5 candidate) OR smart-ram-167. Final pin at dispatch. - -## Auto-spawn caveat - -Per Director's standing note + cache-staleness cluster ctrl#217: HOLD dispatch on this canvas's worker brief until auto-spawn fix lands per L-sized substrate-fact-introduction threshold. - -— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-07 post-#2105 merge per Director endorsement of pre-staging T-CostLens-Composition canvas-shape. diff --git a/docs/briefs/r3-substrate-t-costlens-composition-worker.md b/docs/briefs/r3-substrate-t-costlens-composition-worker.md new file mode 100644 index 00000000000..bee4a910dbe --- /dev/null +++ b/docs/briefs/r3-substrate-t-costlens-composition-worker.md @@ -0,0 +1,66 @@ +# Worker brief — Substrate T-CostLens-Composition (γ ratified) + +**Sub-issue**: gunbc#1957 (parented under #1939 Substrate Mgr lane). +**Authority**: Director ratification of **option γ** at gunbc#828 #issuecomment-4395691775 (2026-05-07); supersedes the canvas at `docs/briefs/r3-substrate-t-costlens-composition-canvas.md` (canvas may be deleted after this brief lands per single-authority discipline). +**Closure predicate**: §1.8 gates #37 `cost_lens_reads_target_realization`, #38 `coercion_cost_equals_complexity_by_construction`, #39 `no_coercion_cost_dimension`, #40 `symbolic_cost_expr_equals_executable`, plus #70 `cost_lens_demonstration`. + +## Important framing — this is NOT a substrate-fact-introduction + +`src/v3/lenses/cost.dag` ALREADY EXISTS at HEAD as a `STRUCTURALLY TERMINAL; BEHAVIORALLY PROXY` lens (per the file's status header). T-CostLens-Composition is **behavioral-completion + target-realization-wiring**, NOT P1 carrier introduction. Substrate primitives are all already-substrate: + +- `Lens` generic at `src/v3/std/lens.dag:70-77` — **untouched** per Director ratification (any refactor is separate scope, STOP-and-PING) +- `SymbolicCost` 7-variant + `Semiring` at `src/v3/std/algebra.dag:12+` +- `Lookup` + `MissingCost` lens-boundary-fallback at `src/v3/std/lookup.dag:48-60` +- `lenses/cost.dag` lens-instance scaffolding (existing behavioral PROXY) + +Worker should **read the existing `lenses/cost.dag`** before doing anything else; the work is to advance it from PROXY → BEHAVIORALLY COMPLETE via target-realization composition, NOT to manufacture parallel substrate. + +## Scope (binding per Director γ ratification) + +Wire target-realization-cost into the existing `lenses/cost.dag` `Lens` instance via `Lookup` composition, satisfying all 4 §1.8 gates by construction: + +- **#37 `cost_lens_reads_target_realization`** — lens output reads target-realization cost from `Lookup` keyed on per-primitive identity (target-spec-derived). `MissingCost` lens-boundary-fallback already substrate at `lookup.dag:48-60`. +- **#38 `coercion_cost_equals_complexity_by_construction`** — coercion-cost composes into the same `SymbolicCost` algebra as algebra-cost via `Semiring::sum` / `::product`; the equation is structural, not derived. +- **#39 `no_coercion_cost_dimension`** — single `SymbolicCost` algebra; no parallel cost dimension. The existing lens is already structurally aligned (uses `std.algebra::sequential`/`iterate`/`max_path`); worker confirms no parallel dimension introduced. +- **#40 `symbolic_cost_expr_equals_executable`** — runtime-executable `SymbolicCostExprEquals` predicate consuming the lens output. Test_runner / cementing-test harness wiring per existing infrastructure. + +Plus **#70 `cost_lens_demonstration`** — fixture program with ≥2 algebra-instances composed + ≥1 recursive call + observable cost-bound output. Same-slice acceptance. + +## Out-of-scope (deferred per Director ratification) + +- `data symbolic_cost_dimension: AnalysisDimension` — Director ratified DEFER to separate Dimensions sub-lane (per §10.3 Q-CostLens-Dimensions framing if/when authored). T-CostLens proceeds without it; consumes the dimension as structural fact only when it lands. +- `Lens` generic carrier-shape refactor — STOP-and-PING the Mgr if implementation reveals a need; that's separate Director-tier scope question, NOT T-CostLens absorption. + +## Acceptance gates (same-slice, all must pass) + +1. `lenses/cost.dag` advanced from `STRUCTURALLY TERMINAL; BEHAVIORALLY PROXY` → `BEHAVIORALLY COMPLETE` per `docs/v3-lens-capability-register.md` audit; status header updated in the file itself. +2. **#37 satisfied**: lens output documented to read target-realization cost via `Lookup`. Code-level cite in PR description. +3. **#38 + #39 satisfied by construction**: lens output is `SymbolicCost`-typed; no parallel cost dimension visible in the diff. Verified via grep at acceptance time. +4. **#40 satisfied**: `SymbolicCostExprEquals` predicate executable in test_runner; runtime predicate evaluates against representative input (NOT NotYetImplemented shell). +5. **#70 satisfied**: `cost_lens_demonstration` fixture program lands at `src/v3/compiler/tests/integration/` (or appropriate fixture location); ≥2 algebra-instances + ≥1 recursive call + observable cost-bound output verified by demonstration test. +6. Bootstrap regen: `cargo test -p v3-compiler bootstrap_regen_fresh -- --ignored` clean. +7. Full suite: `cargo test --workspace --exclude v2-compiler-tests` green; `cargo clippy --all-targets -- -D warnings` clean. +8. **§10.3 row text refresh**: `docs/r3-program-plan.md` §10.3 T-CostLens-Composition row (currently "(TBD from Substrate canvas)") updated to cite γ-disposition + this PR's # as the receipt. + +## STOP / PING criteria + +- **STOP** if implementation reveals `Lens` generic at `lens.dag:70-77` needs carrier-shape refactor (e.g., `read: fn(Dag, Behavior) -> Witness` needs target-context threading) — that's separate Director-tier scope per Director's confirmed ask #2; do NOT absorb into T-CostLens. +- **STOP** if `Lookup` composition is structurally insufficient for end-to-end realization-cost reading (e.g., target-realization-cost requires more context than per-primitive lookup can carry) — surface to Mgr; canvas option β (composed-witness) may need re-ratification. +- **STOP** if `cost_lens_demonstration` fixture authoring requires `data symbolic_cost_dimension` to be present — that contradicts Director's defer disposition; surface to Mgr to resolve cross-lane dependency. +- **PING** Verification Mgr (#2075 / `wise-bear-525`) at PR-open time so they can advance Pattern-A executable gate #40 `symbolic_cost_expr_equals_executable` per §1.6 NYI → executable transition discipline. + +## Cross-Mgr coordination + +- **Verification Mgr (#2075)**: PING at PR-open per gate #40 transition; ratchet authoring is Verification's standing concern. +- **Grounding Mgr**: target-realization-cost reading depends on target language spec (per `r3-design-schedule:72` cost-lens-as-discriminator). If target-spec data isn't yet populated for the demonstration fixture's targets, surface to Grounding Mgr (#1944 / current active session) for cross-lane data population. +- **R4-carve note**: T-LBP option (b) RATIFIED 2026-05-06 means T-LBP R3 scope = complexity + cost lenses only. T-CostLens-Composition closing simultaneously with `cost_lens_behaviorally_complete` (gate #80) is the critical-path-fastest sequencing per Q-LBP option (b). + +## Worker pin (Mgr disposition) + +Substrate-fact-introduction precedent owners — **valiant-ibex-312** (delivered IntPlatform/UIntPlatform via PR #1933, S5 candidate) OR **smart-ram-167**. Lens-behavioral work also has precedent owners; final pin at dispatch. + +## Auto-spawn caveat + +Per Director's standing note + cache-staleness cluster ctrl#217: HOLD dispatch on this brief until auto-spawn fix lands per L-sized substrate-behavioral-completion threshold, OR Mgr-direct authoring if scope-cohering small-enough (this is L-sized; Mgr-direct is unlikely fit unless Director ratifies surgical-recreate path for cascade unblock). + +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-07 post-#2112 merge per Director γ-ratification at gunbc#828 #issuecomment-4395691775. From 34faf0c16a05c42d180d9cdd19b6f1f93e5a0ee5 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 10:04:41 +0000 Subject: [PATCH 26/50] Delete superseded T-CostLens canvas (worker brief is single live authority) --- ...substrate-t-costlens-composition-canvas.md | 76 ------------------- 1 file changed, 76 deletions(-) delete mode 100644 docs/briefs/r3-substrate-t-costlens-composition-canvas.md diff --git a/docs/briefs/r3-substrate-t-costlens-composition-canvas.md b/docs/briefs/r3-substrate-t-costlens-composition-canvas.md deleted file mode 100644 index 5db2272e436..00000000000 --- a/docs/briefs/r3-substrate-t-costlens-composition-canvas.md +++ /dev/null @@ -1,76 +0,0 @@ -# Canvas — Substrate T-CostLens-Composition (`Lens` instance shape) - -**Sub-issue**: gunbc#1957 (parented under #1939 Substrate Mgr lane). -**Authority**: `docs/r3-program-plan.md` §10.3 T-CostLens-Composition row at line 399 ("(TBD from Substrate canvas)" — explicitly Substrate Mgr canvas territory); `docs/r3-design-schedule-2026-05-06.md:72` cost-lens-as-discriminator framing. -**Closure predicate**: §1.8 gates #37-40 (structural-fold + thesis-unification + no-separate-cost-dimension + executable predicate) + #70 demonstration. -**Status**: **canvas — Director-tier ratification needed on composition shape before worker brief authoring**. - -## Adjacent substrate (grep-verified at HEAD) - -- `src/v3/std/lens.dag:70-77` defines the generic `Lens` carrier (`read`, `sequential: Monoid`, `branch`, `iterate`, `validate`). Already-landed; NOT subject to redesign. -- `src/v3/std/algebra.dag:12+` defines `SymbolicCost` 7-variant coproduct (`ProductCost`, `SumCost`, etc.) + `Semiring` inhabitance. Algebra-cost side already-substrate. -- `src/v3/std/lookup.dag:48-60` scaffolds `Lookup` + `MissingCost` lens-boundary-fallback shape. -- `src/v3/std/machine_constraints.dag` (per memory + #1933) defines `MachineWidth` substrate; target-realization side has structural facts available. -- `src/v3/std/dimensions.dag:10` notes `data symbolic_cost_dimension: AnalysisDimension` is **deferred** — that's part of the canvas territory. - -## Scope - -T-CostLens-Composition lands a **single `Lens` instance** (or near-equivalent) that composes algebra-cost (already-substrate via `Semiring`) with target-realization-cost (read via `MachineConstraint` / target language spec) end-to-end. Per Director's "cost-lens-as-discriminator" framing: the cost lens orders faithful-representation alternatives by per-primitive realization cost; Grounding selects lowest-cost faithful representation. - -**Key invariant** (gate #39 `no_coercion_cost_dimension`): NO separate cost dimension for coercion vs realization vs algebra — one `SymbolicCost` algebra, all three sources feed into it via `Semiring` operations. - -## Carrier-composition options - -### Option α — Two separate lenses, externally joined - -`Lens` reads algebra-cost only (structural-fold over Behavior + algebra inhabitance); separate `Lens` reads target-realization-cost from LanguageSpec; composition happens at the consumer (Grounding). - -**Pro**: Each lens has a single concern; algebra-cost is target-independent (purer). -**Con**: Violates gate #39 by construction — TWO cost dimensions, joined by convention not by carrier shape. `coercion_cost_equals_complexity_by_construction` (gate #38) would have to be a derived theorem rather than structural-by-construction. Rejected. - -### Option β — Single `Lens` with composed witness in `read` - -`Lens::read(dag, behavior) -> Witness` reads BOTH algebra-cost AND target-realization-cost, composing them via `Semiring` (sum for sequential operations, product for branch/iterate as appropriate). Target-realization-cost obtained via per-primitive lookup keyed on `MachineConstraint` instances at the Behavior's primitives. - -**Pro**: Single cost dimension by construction (gate #39 satisfied structurally); `coercion_cost_equals_complexity_by_construction` is true by construction (gate #38) because coercion is just another operation feeding into the same algebra. End-to-end composition is the carrier's `read` signature. -**Con**: `read` becomes target-aware — needs target-language-spec context threaded through. May force Lens generic's `read: fn(Dag, Behavior) -> Witness` to gain a third parameter (target-context) — substrate-impacting refactor of the generic lens carrier, OR cost lens carries a captured target reference (closure-shape, less structural). - -### Option γ — `Lens` reads structural; target-realization via `Lookup` - -`Lens::read` reads structural-cost via algebra-fold (Behavior + `SymbolicCost` algebra inhabitance); target-realization-cost composed via existing `Lookup` infrastructure at `lookup.dag:48-60`. The lookup is keyed on per-primitive identity (target-spec-derived); when present, lookup-cost composes into the lens output via `Semiring::sum`. - -**Pro**: Reuses existing `Lookup` substrate (per `feedback_audit_adjacent_authority_first` — already authored). Generic `Lens` carrier unchanged; target-realization-cost enters via Lookup's `MissingCost` lens-boundary-fallback shape (already-substrate). Single-cost-dimension preserved (Lookup output IS `SymbolicCost`). `cost_lens_reads_target_realization` (gate #37) is satisfied by Lookup composition; `no_coercion_cost_dimension` (gate #39) is satisfied because Lookup output composes into the same algebra. -**Con**: Lookup-via-Lens-during-read is slightly indirect; consumers must know Lookup is part of the cost computation (vs being lens-internal). Mitigation: lens implementation hides Lookup composition; consumers see only `Lens::read` interface. - -## Mgr-tier recommendation - -Provisional **γ**: composes via existing `Lookup` substrate (already-authored at `lookup.dag:48-60`); preserves generic `Lens` carrier shape unchanged; satisfies all 4 §1.8 gates by construction (#37 via Lookup, #38 via Semiring composition, #39 via single algebra, #40 via the carrier's typed `read` output). Aligns with `feedback_audit_adjacent_authority_first` + `feedback_compositional_not_templating`. - -**β** is second-best if Lookup composition turns out to be insufficient for end-to-end realization-cost reading at canvas-implementation time (e.g., target-realization-cost requires more context than a per-primitive lookup can carry). - -**α rejected** — violates gate #39 by construction. - -## Director ratification ask - -1. **Pick α / β / γ** (or surface fourth option). Provisional Mgr recommendation: **γ** (Lookup composition). -2. Confirm `Lens` generic at `lens.dag:70-77` is authoritative starting point (no carrier-shape refactor in T-CostLens scope). Per option γ this is unchanged; per option β it would refactor. -3. Confirm `data symbolic_cost_dimension: AnalysisDimension` (currently deferred per `dimensions.dag:10`) lands as part of T-CostLens-Composition or stays separately deferred to a Dimensions sub-lane. - -## On ratification — worker brief scope - -Will author execution brief covering: -- `Lens` instance authoring in DSL (likely `src/v3/lenses/cost.dag` per existing convention; verify-via-grep at brief time) -- `read` implementation per chosen option (γ Lookup composition / β composed witness) -- `cost_lens_demonstration` (gate #70): ≥2 algebra-instances composed + ≥1 recursive call + observable cost-bound output — fixture program + executor wiring same-slice -- 4 §1.8 gates (#37-40) advance to executable status -- `data symbolic_cost_dimension` lands or stays deferred per question 3 - -## Worker pin (Mgr disposition) - -Substrate-fact-introduction precedent owners — valiant-ibex-312 (delivered IntPlatform/UIntPlatform, S5 candidate) OR smart-ram-167. Final pin at dispatch. - -## Auto-spawn caveat - -Per Director's standing note + cache-staleness cluster ctrl#217: HOLD dispatch on this canvas's worker brief until auto-spawn fix lands per L-sized substrate-fact-introduction threshold. - -— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-07 post-#2105 merge per Director endorsement of pre-staging T-CostLens-Composition canvas-shape. From b7d808e48ee5df7cf4b1e2c8f510a08fd553c42c Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 11:17:30 +0000 Subject: [PATCH 27/50] =?UTF-8?q?docs(briefs):=20T-WAD=20Slice=201=20worke?= =?UTF-8?q?r=20brief=20=E2=80=94=20=CE=B2=20ratified;=20delete=20canvas?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Director ratification at gunbc#828 #issuecomment-4395945465: 4 asks confirmed: 1. β ratified (minimalist reuse-first) 2. #1771 audit-receipt binding precedent confirmed 3. WorkflowSecret folds into dsl/extdeps/github/actions.dag (provider- specific scope; NOT new dsl/std/ file unless cross-provider evidence) 4. §1.8 gates #54 + #55 split into separate slices (slice 2 = timing-and-pattern; slice 3 = ci_workflow_modeled_as_dag) Slice 1 net-new substrate (only): - WorkflowSecret + SecretScope carriers - CronExpression + CronField (typed refinement of existing WorkflowTrigger::Schedule { cron: String } at actions.dag:43) Other 4 carriers from §10.3 row 983 reused as-is from extdeps.github.actions per audit-receipt #1771 directive. 6 same-slice acceptance gates incl no-parallel-representation grep + gate #53/#62/#63 advancement + bootstrap regen + clippy. Cross-provider STOP-and-PING per Director ask #3 caveat: worker greps adjacent provider work for WorkflowSecret-shape evidence; surfaces if found before finalizing fold-into-extdeps. Canvas deleted per single-authority discipline (S5 + descent_execution_proof + T-CostLens precedent). Co-Authored-By: Claude Opus 4.7 (1M context) --- .../r3-substrate-t-workflow-as-data-canvas.md | 77 -------------- ...trate-t-workflow-as-data-slice-1-worker.md | 100 ++++++++++++++++++ 2 files changed, 100 insertions(+), 77 deletions(-) delete mode 100644 docs/briefs/r3-substrate-t-workflow-as-data-canvas.md create mode 100644 docs/briefs/r3-substrate-t-workflow-as-data-slice-1-worker.md diff --git a/docs/briefs/r3-substrate-t-workflow-as-data-canvas.md b/docs/briefs/r3-substrate-t-workflow-as-data-canvas.md deleted file mode 100644 index 69cbf5f039e..00000000000 --- a/docs/briefs/r3-substrate-t-workflow-as-data-canvas.md +++ /dev/null @@ -1,77 +0,0 @@ -# Canvas — Substrate T-Workflow-As-Data carriers (5-row scope-narrowing) - -**Sub-issue**: gunbc#1956 (T-Workflow-As-Data CI-workflow-as-.dag-data demo, parented under #1939); umbrella scope is §10.3 row Q-Workflow-As-Data-Carriers (line 983, OPEN — Substrate Mgr scoping needed). -**Authority**: `docs/r3-program-plan.md:474-480` (5 carrier names) + `docs/r3-design-schedule-2026-05-06.md:84-88` (audit-first directive); `dsl/extdeps/github/actions.dag` (218 lines, already-substrate); audit-and-delta receipt landed 2026-05-06 via #1771 (closed #1873). -**Closure predicate**: §1.8 gates #53 (workflow_substrate_carriers_landed), #54 (timing_lens_carrier_landed), #55 (shared_external_attachment_pattern_documented), #56 (ci_workflow_modeled_as_dag), #62 (substrate_gap_file_ingestion_closed), #63 (substrate_gap_workflow_scheduling_closed). -**Status**: **canvas — Director-tier ratification needed on reuse-vs-new scope before worker brief authoring**. - -## Observation: 4 of 5 named carriers ALREADY exist in `extdeps.github.actions` - -Per §S4 design-schedule directive line 84 (codex BLOCKING 2026-05-06): "S4 worker brief MUST audit `extdeps.github.actions` first and either (a) extend/refine existing carriers via T-Workflow-As-Data lens-consumption-shape additions (preferred per `feedback_audit_adjacent_authority_first` + `feedback_parallel_representation_debt`), or (b) explicitly dissolve `extdeps.github.actions` with a migration path before introducing parallel carriers." - -Grep-verified `dsl/extdeps/github/actions.dag` at HEAD: - -| §10.3 row 983 carrier name | extdeps.github.actions HEAD | Reuse/refine | Net new substrate | -|---|---|---|---| -| `WorkflowTrigger` (Push / PullRequest / Cron / Manual) | `WorkflowTrigger` (Push / PullRequest / Schedule / WorkflowDispatch / WorkflowCall) at `:40` | Refine: `Schedule { cron: String }` → typed `Cron` carrier (per design-schedule:87) | minimal | -| `WorkflowStep` (run command + dependencies + outputs) | `Step` at `:103` | Reuse name `Step`; lens-consumption may add observation anchor | none if pure reuse | -| `WorkflowMatrix` (parameter expansion) | `MatrixStrategy` at `:66+` (inside `Job`) | Reuse + possibly extract as standalone carrier for lens consumption | minimal | -| `WorkflowSecret` (provider-typed, opaque-at-rest, scoped-by-step) | NOT EXTANT in actions.dag at HEAD | **NEW substrate** | full carrier | -| `RunnerResource` (compute class, OS, hardware) | `RunnerSpec` + `RunnerLabel` at `:88+` | Reuse + parameterize as `RunnerResource` for lens-shape consumption | minimal | -| `Workflow` composing carrier | `Workflow` at `:20` (untyped composition) | Refine to parameterized form for lens generic dispatch | minimal | - -**Key finding**: of the 5 named carriers in §10.3 row 983, **only `WorkflowSecret` is wholly new substrate**. The other 4 are reuse-or-refine of existing `extdeps.github.actions` types. The audit-and-delta receipt (#1771, closed via #1873) confirmed this shape; the canvas territory now is **the lens-consumption-shape question**, NOT a 5-carrier-introduction question. - -## Real canvas question (post-audit) - -Given the existing `extdeps.github.actions` substrate is the reuse-base, what's the **minimum additional substrate** needed for T-Workflow-As-Data closure? - -### Option α — Maximalist: introduce all 5 named carriers in `dsl/std/workflow.dag` as parametric refinements - -New file `dsl/std/workflow.dag` declares parameterized versions of all 5 carriers; `extdeps.github.actions` types become specialized instances via composition. New `WorkflowSecret` lands here. - -**Pro**: clean substrate-internal home for T-Workflow-As-Data; lens consumption talks to `dsl/std/workflow.dag` (compiler-internal vocabulary), not `dsl/extdeps/github/` (external-tool vocabulary). -**Con**: introduces parallel-representation debt with `extdeps.github.actions` (per `feedback_parallel_representation_debt`). The audit-receipt's reuse-first directive argues against this. 5 new types when only 1 is wholly novel. - -### Option β — Minimalist (audit-receipt-honoring): land only `WorkflowSecret` + `Cron` refinement; lens consumes existing `extdeps.github.actions` types directly - -Single new file `dsl/std/workflow_secret.dag` (or fold into `extdeps.github.actions` if scope-cohering) carrying `WorkflowSecret` + the typed `Cron` refinement. Lens-consumption shapes (e.g., `WorkflowObservationAnchor`) land in `dsl/std/workflow.dag` separately if/when needed by the lens; T-Workflow-As-Data's CI-workflow-as-.dag-data demo (#1956) consumes the refined `extdeps.github.actions` directly. - -**Pro**: minimal substrate addition; honors audit-receipt's reuse-first directive (`feedback_audit_adjacent_authority_first`); single point of new-substrate, single point of refinement. No parallel-representation debt. -**Con**: lens consumption talks to `extdeps.github.actions` (external-tool vocabulary) — may look conceptually inconsistent with other lens consumers reading `dsl/std/*` types. Mitigation: documented as deliberate audit-receipt outcome. - -### Option γ — Lens-consumption-shape carrier separately + minimal new substrate - -Like β but with `WorkflowObservationAnchor` (per Substrate Mgr design stance at gunbc#1130 comment-4374109666) explicitly authored alongside `WorkflowSecret`. The lens-consumption layer is its own typed carrier; doesn't conflate with `extdeps.github.actions` reuse. - -**Pro**: separates "external-tool vocabulary" (extdeps.github.actions, reuse) from "lens-consumption substrate" (new `WorkflowObservationAnchor`); each layer has single concern. Lens consumers read `WorkflowObservationAnchor`, which references `extdeps.github.actions::Workflow` structurally. -**Con**: 2 new substrate carriers vs β's 1; mild scope expansion. Justifiable IF lens-consumption-shape genuinely needs typed handle distinct from `extdeps.github.actions::Workflow`. - -## Mgr-tier recommendation - -Provisional **β** (minimalist, audit-receipt-honoring): only `WorkflowSecret` + `Cron` refinement land as net-new substrate. Lens consumes `extdeps.github.actions` directly until evidence shows a typed lens-handle is needed. **γ** is the natural ratchet from β if lens-consumption-shape evidence accumulates (per `feedback_construction_over_ratchets` — model first, dissolve later if substrate evidence forces). - -**α rejected** — admits parallel-representation debt against `extdeps.github.actions` audit-receipt findings. - -## Director ratification ask - -1. **Pick α / β / γ** (or surface fourth). Mgr recommendation: **β**. -2. Confirm `extdeps.github.actions` audit-receipt at #1771 is the binding precedent for reuse-first posture (i.e., the audit confirmed reuse is the right shape, not deprecation). -3. Confirm `WorkflowSecret` location: `dsl/std/workflow_secret.dag` (new file) vs fold into existing `extdeps.github.actions` (extension). Provisional Mgr preference: **new file** (compiler-internal substrate, distinct from external-tool vocabulary; honors layer model). -4. Confirm whether §1.8 gate #54 (`timing_lens_carrier_landed`) and gate #55 (`shared_external_attachment_pattern_documented`) are in T-Workflow-As-Data scope or fold to T-LBP / separate sub-lane. - -## On ratification — worker brief scope - -Will author execution brief covering: -- `WorkflowSecret` carrier (`dsl/std/workflow_secret.dag` per option β/γ) -- `Cron` typed refinement (location TBD per question 3) -- (γ only) `WorkflowObservationAnchor` lens-consumption-shape carrier -- Worker pin: substrate-fact-introduction precedent owners (valiant-ibex-312 / smart-ram-167) -- Acceptance: §1.8 gates #53-#56 + #62-#63 advance per closure-predicate scope -- T-Workflow-As-Data #1956 demo consumer wiring (CI-workflow-as-.dag-data) in same-slice or cross-Mgr handoff per Director ratification - -## Sequencing caveat - -Per §S4 design-schedule line 95: "post-T-Lens-Behavioral-Parity COMPLETE (per `r3-structure.md` §"Dependency on R2"; lens consumption needs lenses COMPLETE)". This canvas is dispatch-ready post-T-LBP COMPLETE; brief authoring can land in advance per pre-staging discipline but worker dispatch waits. - -— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-07 post-#2105 merge per Director endorsement of pre-staging next-up substrate canvases. Honors audit-and-delta receipt #1771 (closed #1873) reuse-first directive. diff --git a/docs/briefs/r3-substrate-t-workflow-as-data-slice-1-worker.md b/docs/briefs/r3-substrate-t-workflow-as-data-slice-1-worker.md new file mode 100644 index 00000000000..f7fd48060ad --- /dev/null +++ b/docs/briefs/r3-substrate-t-workflow-as-data-slice-1-worker.md @@ -0,0 +1,100 @@ +# Worker brief — Substrate T-Workflow-As-Data Slice 1 (β ratified) + +**Sub-issue**: parent #1956 (T-WAD CI-workflow-as-.dag-data demo) eventually consumes; PM authors a Slice-1-specific work-item under #1939 post-this-brief landing. +**Authority**: Director ratification of **option β** at gunbc#828 #issuecomment-4395945465 (2026-05-07); 4 asks confirmed (β / #1771 audit-receipt binding / WorkflowSecret folds into extdeps / slice 2-3 separate canvases). +**Closure predicate**: §1.8 gate #53 `workflow_substrate_carriers_landed` (this slice) + #62 `substrate_gap_file_ingestion_closed` + #63 `substrate_gap_workflow_scheduling_closed` (per T-Workflow-As-Data lane row scope). + +## Slice scope (binding per Director) + +T-Workflow-As-Data is split into 3 sub-slices per Director ratification ask #4: +- **Slice 1 (this brief)** — workflow substrate carriers (β minimalist) +- **Slice 2** — timing-and-pattern (TimingMeasurement + TimingObservationSet + WorkflowObservationAnchor + TimingBudget; gates #54 #55) — SEPARATE canvas, gated on T-LBP COMPLETE per §S4 design-schedule:95 +- **Slice 3** — `ci_workflow_modeled_as_dag` demonstration (gate #56) — SEPARATE canvas, consumes slices 1+2 + +**Slice 1 net-new substrate** (only what was identified as wholly novel in the canvas): +1. `WorkflowSecret` carrier — provider-typed, opaque-at-rest, scoped-by-step +2. `Cron` typed refinement of existing `WorkflowTrigger::Schedule { cron: String }` (currently String; refine to typed cron expression) + +Out-of-slice for the 4 reuse-named carriers (per audit #1771): +- `WorkflowTrigger` already at `dsl/extdeps/github/actions.dag:40` (only the inner `Schedule { cron: String }` refines to `Cron` shape per #2 above; outer `WorkflowTrigger` enum unchanged) +- `Step` (=`WorkflowStep`) at `:103`, `MatrixStrategy` (=`WorkflowMatrix`) inside `Job` at `:66+`, `RunnerSpec`+`RunnerLabel` (=`RunnerResource`) at `:88+`, `Workflow` at `:20` — all reused as-is; lens consumes existing types directly per `feedback_audit_adjacent_authority_first` + +## Carrier shape (binding per Director ask #3) + +**Location**: `dsl/extdeps/github/actions.dag` — fold-into-extdeps, NOT new `dsl/std/` file. Per Director rationale: all sibling carriers already live there + secret management IS provider-specific (GitHub Secrets, GitLab Variables, AWS Secrets Manager, etc.) — putting `WorkflowSecret` in `dsl/std/` would imply cross-provider universality that doesn't exist at HEAD. + +**`WorkflowSecret`**: + +```dag +// Opaque-at-rest secret reference scoped by step. Name parameter carries the +// provider-side secret identifier (e.g., "GITHUB_TOKEN", "ANTHROPIC_API_KEY") +// without exposing the secret value at substrate level. Resolution happens at +// workflow-execution time via the provider's secret store. +type WorkflowSecret { + name: Name // typed identifier (provider-scoped) + scope: SecretScope // step-level vs job-level vs workflow-level +} + +type SecretScope = StepScope | JobScope | WorkflowScope +``` + +**`Cron`** typed refinement at `dsl/extdeps/github/actions.dag:43`: + +```dag +// Refines WorkflowTrigger::Schedule { cron: String } to typed cron carrier. +// Cron expression is structured (minute / hour / day-of-month / month / day-of-week) +// rather than opaque-string; fail-closed on parse errors at fixture load. +type CronExpression { + minute: CronField + hour: CronField + day_of_month: CronField + month: CronField + day_of_week: CronField +} + +type CronField = Wildcard | Exact(Int) | List(List) | Range(Int, Int) | Step(Int, Int) + +// WorkflowTrigger update: replace inner Schedule { cron: String } with typed Cron. +type WorkflowTrigger + = ... // existing variants unchanged + | Schedule { cron: CronExpression } // typed (was: String) + | ... +``` + +**STOP-and-PING the Mgr** if `CronExpression` decomposes into more than 5 fields (e.g., year support or seconds support emerges as needed) — that's substrate-shape expansion warranting Director ratification. + +### Cross-provider scope question (Director ratification ask #3 caveat) + +Per Director: "if your lane visibility shows evidence the carrier is intended cross-provider (e.g., Anthropic provider work uses same shape), surface and we can elevate to `dsl/std/`. Default is fold-into-extdeps; promote-to-std only when cross-provider evidence accumulates." + +Worker greps the codebase + adjacent provider work (Anthropic, OpenAI per `dsl/extdeps/llm/`) for `WorkflowSecret`-shaped patterns BEFORE folding. If cross-provider evidence emerges, **STOP-and-PING the Mgr**; otherwise proceed with fold-into-extdeps. + +## Acceptance gates (same-slice, all must pass) + +1. `WorkflowSecret` + `SecretScope` carriers landed in `dsl/extdeps/github/actions.dag`. +2. `CronExpression` + `CronField` carriers landed in `dsl/extdeps/github/actions.dag`; existing `WorkflowTrigger::Schedule { cron: String }` migrated to `Schedule { cron: CronExpression }` with fixture-load fail-closed parse semantics. +3. **No parallel-representation**: verify via grep that `dsl/std/` does NOT contain `WorkflowSecret`, `CronExpression`, or sibling shapes (would indicate accidental general-substrate creation against Director ratification). +4. §1.8 gates advance: #53 `workflow_substrate_carriers_landed` → CONSUMER_LANDED; #62 `substrate_gap_file_ingestion_closed` + #63 `substrate_gap_workflow_scheduling_closed` advance per closure predicate. +5. Bootstrap regen: `cargo test -p v3-compiler bootstrap_regen_fresh -- --ignored` clean. +6. Full suite: `cargo test --workspace --exclude v2-compiler-tests` green; `cargo clippy --all-targets -- -D warnings` clean. + +## STOP / PING criteria + +- **STOP** if cross-provider evidence emerges for `WorkflowSecret` shape (per Director ask #3 caveat) — surface to Mgr; promote-to-`dsl/std/` requires Director re-ratification. +- **STOP** if `CronExpression` field-count expands beyond 5 (e.g., year / seconds / nanoseconds) — substrate-shape expansion warrants Director ratification. +- **STOP** if migration of existing `WorkflowTrigger::Schedule { cron: String }` cascades into emit/typecheck surfaces beyond actions.dag — surface scope-creep. +- **PING** Verification Mgr (#2075) at PR-open time so they can advance §1.8 gates #53/#62/#63 ratchet authoring per standing concern. + +## Sequencing + +Per §S4 design-schedule:95: Slice 1 dispatch-ready post-T-LBP COMPLETE (lens consumption needs lenses COMPLETE). Brief authoring lands in advance per pre-staging discipline. Slice 2 + Slice 3 are SEPARATE canvases authored when their preconditions clear (slice 2 gates on T-LBP COMPLETE; slice 3 consumes 1+2). + +## Worker pin (Mgr disposition) + +valiant-ibex-312 OR smart-ram-167 (substrate-fact-introduction precedent owners). Final pin at dispatch. + +## Auto-spawn caveat + +Per Director's standing note + cache-staleness cluster ctrl#217: HOLD dispatch on this brief until auto-spawn fix lands per L-sized substrate-fact-introduction threshold. + +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-07 per Director β-ratification at gunbc#828 #issuecomment-4395945465. From dac25f6120b1aed922362eb9749f92a813281d6d Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 11:55:49 +0000 Subject: [PATCH 28/50] docs(briefs): T-LAS Demo (#1952) complexity-contract compile-error worker brief MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pre-staged execution brief per Director endorsement of T-LAS demos via direct worker brief path (no canvas — design-lock at docs/design-lens-application- surface.md specifies fixture shape verbatim at line 292). 7 same-slice acceptance gates: fixture program (O(n²) body + Enforce O(log n) budget) + TestClaim assertion + diagnostic structural validation + no regression on T-LBP cementing + bootstrap regen + clippy + §1.8 #92 advancement. Hard prerequisites STOP-and-PING: T-LAS Slice A landed (gates #88-#91) AND T-LBP complexity-lens BEHAVIORALLY COMPLETE (gate #79). Worker does not author against partial substrate. Sibling demos #1953 (CRDT cost) + #1954 (memory-peak cost) share the same hard-prerequisite + TestClaim shape pattern — could dispatch as 3 sequential PRs or single multi-demo PR (worker's call at dispatch). Co-Authored-By: Claude Opus 4.7 (1M context) --- ...omplexity-contract-compile-error-worker.md | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 docs/briefs/r3-substrate-t-las-demo-complexity-contract-compile-error-worker.md diff --git a/docs/briefs/r3-substrate-t-las-demo-complexity-contract-compile-error-worker.md b/docs/briefs/r3-substrate-t-las-demo-complexity-contract-compile-error-worker.md new file mode 100644 index 00000000000..8c997a4201f --- /dev/null +++ b/docs/briefs/r3-substrate-t-las-demo-complexity-contract-compile-error-worker.md @@ -0,0 +1,62 @@ +# Worker brief — Substrate T-LAS Demo: complexity-contract compile-error + +**Sub-issue**: gunbc#1952 (parented under #1939 Substrate Mgr lane). +**Authority**: `docs/design-lens-application-surface.md` §"Closure gate" line 292 (`complexity_violation_compile_error_demonstrated`); V execution-split brief at `docs/briefs/r3-v-t-lens-application-surface-execution-split-worker.md` Slice B B1 row #92. +**Closure predicate**: §1.8 gate #92 `complexity_violation_compile_error_demonstrated`. +**Status**: **execution brief — no canvas needed**; design-lock specifies fixture shape verbatim. Direct dispatch on T-LAS Slice A landing + T-LBP complexity-lens BEHAVIORALLY COMPLETE. + +## Scope + +Land the **first T-LAS demonstration** per `design-lens-application-surface.md:292`: + +> "complexity_violation_compile_error_demonstrated — a TestClaim that constructs a function with O(n²) body + a lens application requiring O(log n) + asserts a Diagnostic is produced." + +Concrete fixture shape per design-lock §"Apply complexity lens with Enforce" (lines 272-292): +- Function with O(n²) body (e.g., nested loop on input list) +- `apply_lens(complexity, fn, Enforce { budget: LogN, diagnostic_severity: Error })` +- Compiler emits a `Diagnostic` with severity `Error` because actual complexity (O(n²)) exceeds named budget (O(log n)) + +## Hard prerequisites + +- **T-LAS Slice A landed** (gates #88-#91): `EnforcedApplication` + `IntrospectApplication` + `SectionRef` + `LensEnforcement` + Enforce-mode diagnostic routing through `DiagnosticSeverity` per design §3 + INVARIANTS C-8. +- **T-LBP complexity-lens BEHAVIORALLY COMPLETE**: `complexity_lens: Lens` returns work/span/asymptotic_class/work_certainty/span_certainty per design line 168. `complexity_lens_behaviorally_complete` (gate #79) PASSING. + +If either prerequisite is not landed at worker-pickup time: **STOP-and-PING** the Mgr; do NOT author a placeholder fixture against a NotYetImplemented carrier. + +## Acceptance gates (same-slice, all must pass) + +1. **Fixture program** lands at `src/v3/compiler/tests/integration/` (or appropriate fixture location): function with provably-O(n²) body + `apply_lens(complexity, , Enforce { budget: , diagnostic_severity: Error })`. Use a simple-enough O(n²) construction that the complexity lens can prove the bound (nested loops over input list — NOT a recursive call where T-E-P producer broadening might undercoverage). +2. **TestClaim** asserting the compile produces a `Diagnostic` with severity `Error` referencing the lens-application's `SectionRef` declaration. Per V execution-split brief: TestClaim shape is Verification-owned (`TESTING.md`); coordinate with Verification Mgr (#2075) at PR-open time for shape alignment. +3. **Diagnostic content structurally validates** the violation routing per gate #91 — severity = Error (not Warning); attribution = lens-application site; mentions actual complexity vs budget. +4. **No regression on existing complexity-lens-behaviorally-complete tests**: gate #79 cementing test (per #1950 brief landing) stays green. +5. Bootstrap regen: `cargo test -p v3-compiler bootstrap_regen_fresh -- --ignored` clean. +6. Full suite: `cargo test --workspace --exclude v2-compiler-tests` green; `cargo clippy --all-targets -- -D warnings` clean. +7. **§1.8 gate #92 advances** to PASSING / executable status; ROADMAP row text refresh on T-Lens-Application-Surface lane row noting demo landing. + +## STOP / PING criteria + +- **STOP** if either hard prerequisite (T-LAS Slice A or T-LBP complexity BEHAVIORALLY COMPLETE) is not landed at pickup time. Surface to Mgr; do NOT proceed against a partial substrate. +- **STOP** if the O(n²) fixture body forces T-E-P producer broadening to handle additional `SubValueRelation` variants. Per `feedback_state_space_vs_behavioral_invariants`, demo fixtures should exercise existing producer coverage, not force new producer work; pick a simpler fixture (nested loops over a list literal) or surface scope-creep. +- **STOP** if Diagnostic-emission semantics for Enforce-mode require additional substrate beyond `LensEnforcement` (e.g., a Diagnostic-routing helper) — surface to Mgr; that's Slice A scope-extension. +- **PING** Verification Mgr (#2075) at PR-open per V execution-split brief: TestClaim shape + corpus fixture authority is Verification-owned. Coordinate same-slice or via cross-Mgr sequence (Verification authors TestClaim shape; this PR consumes). + +## Cross-Mgr coordination + +- **Verification Mgr (#2075 / wise-bear-525)**: TestClaim authoring + diagnostic-shape assertion per V execution-split Slice B B1. PING at PR-open; same-slice consumption preferred for crisp landing. +- **PB Mgr (#2074)**: no expected handoff (this is a leaf demo PR; doesn't touch lens-producer-retirement scope). + +## Related siblings + +- #1953 T-LAS CRDT cost basis demo (gate #93) — sibling brief; same Slice B B1 row. +- #1954 T-LAS memory-peak cost basis demo (gate #94) — sibling brief; same Slice B B1 row. +- All three demos share the same hard-prerequisite pattern (Slice A + relevant lens BEHAVIORALLY COMPLETE) and same TestClaim/Diagnostic shape; could dispatch as 3 sequential PRs OR a single multi-demo PR (Worker's call at dispatch time, with Mgr ratification if going multi-demo). + +## Worker pin (Mgr disposition) + +Demonstration-tier work — different precedent owners than substrate-fact-introduction. Suggest **valiant-ant-72** (per quick-crab freed-pool list) or workers with prior demo/fixture experience. Final pin at dispatch. + +## Auto-spawn caveat + +Per Director's standing note + cache-staleness cluster ctrl#217: HOLD dispatch until auto-spawn fix lands. This is M-sized (single fixture + TestClaim wiring) per design-lock simplicity — could be candidate for surgical-recreate path if Director ratifies for cascade unblock. + +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-07 per Director endorsement of T-LAS demos pre-staging via execution-brief direct path (canvas-first not needed; design-lock specifies shape). From 214f2862a84ddd0410351e2848d8b53b00392921 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 12:30:56 +0000 Subject: [PATCH 29/50] =?UTF-8?q?docs(briefs):=20T-LAS=20Demos=20#1953=20+?= =?UTF-8?q?=20#1954=20=E2=80=94=20cost-basis=20sibling=20worker=20brief?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pre-staged sibling brief covering both cost-basis demos (CRDT cost basis + memory-peak cost basis) per Director endorsement of T-LAS demos via direct worker-brief path. Single brief for two demos because they share: - Hard-prerequisite pattern (T-LAS Slice A + T-LBP cost-lens BEHAVIORALLY COMPLETE) - TestClaim + Diagnostic structural validation shape - apply_lens(cost, ...) Enforce mode Sibling of #1952 brief (complexity-contract compile-error). Worker's call at dispatch on multi-demo PR vs sequential PRs (Mgr ratification needed if going multi-demo). #1953 (CRDT) substrate per design §4.2 + cost-basis-declaration audit at docs/audit/t-user-authored-cost-basis-discipline-worked-examples.md. #1954 (memory-peak) substrate per design §4.3; STOP-and-PING if Dimension substrate (deferred to Dimensions sub-lane per Director ratification at gunbc#828 #issuecomment-4395691775) not yet landed. 6 same-slice acceptance gates per demo + same STOP-and-PING discipline as #1952. Co-Authored-By: Claude Opus 4.7 (1M context) --- ...e-t-las-demos-cost-basis-sibling-worker.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 docs/briefs/r3-substrate-t-las-demos-cost-basis-sibling-worker.md diff --git a/docs/briefs/r3-substrate-t-las-demos-cost-basis-sibling-worker.md b/docs/briefs/r3-substrate-t-las-demos-cost-basis-sibling-worker.md new file mode 100644 index 00000000000..6a00dc2be9e --- /dev/null +++ b/docs/briefs/r3-substrate-t-las-demos-cost-basis-sibling-worker.md @@ -0,0 +1,77 @@ +# Worker brief — Substrate T-LAS Demos: cost-basis sibling (#1953 + #1954) + +**Sub-issues**: gunbc#1953 (CRDT cost basis demo) + gunbc#1954 (memory-peak cost basis demo). Both parented under #1939; same hard-prerequisite + TestClaim shape pattern as #1952. +**Authority**: `docs/design-lens-application-surface.md` §4.2 (CRDT cost basis, line 294) + §4.3 (memory-peak cost basis, line 315); V execution-split brief at `docs/briefs/r3-v-t-lens-application-surface-execution-split-worker.md` Slice B B1 rows #93 + #94. +**Closure predicates**: §1.8 gate #93 (`crdt_cost_basis_demonstrated`) + #94 (`memory_peak_cost_basis_demonstrated`). +**Status**: **execution brief — no canvas needed**; design-lock specifies fixture shape verbatim for both. Sibling pattern with #1952 (`r3-substrate-t-las-demo-complexity-contract-compile-error-worker.md`). + +## Scope (sibling-of-#1952 framing) + +This brief covers BOTH cost-basis demos. Worker's call at dispatch time on whether to ship as one multi-demo PR or two sequential PRs (per Director note at #1952 brief: "could dispatch as 3 sequential PRs OR a single multi-demo PR (Worker's call at dispatch time, with Mgr ratification if going multi-demo)"). If multi-demo, ping Mgr for ratification at PR-open. + +### #1953 — CRDT cost basis demo (§4.2 verbatim) + +```dag +apply_lens(cost, my_crdt_field, Enforce { + budget: SymbolicCost { per_op: O_log_replicas } + diagnostic_severity: Error +}) +``` + +- `section: DeclarationScope { declaration: my_crdt_field }` (same shape as §4.1) +- Per-write cost basis is **cost-lens-owned authority** (separate fact from lens-application config) — see `docs/audit/t-user-authored-cost-basis-discipline-worked-examples.md`. Worker reads that audit before authoring fixture. +- Compiler-side processing: cost lens reads CRDT field's per-write cost; when composing with surrounding lens applications via T-CostLens-Composition, per-op budget participates. Loop writing N times → O(N·log replicas) by composition. + +### #1954 — Memory-peak cost basis demo (§4.3 verbatim) + +```dag +apply_lens(cost, my_memory_intensive_function, Enforce { + budget: SymbolicCost { dimension: Memory, per_call: O_input_size } + diagnostic_severity: Error +}) +``` + +- Cost lens carries **multi-dimension** `SymbolicCost` (per existing `Dimension` substrate from T-CostLens-Composition). +- Time-dimension and memory-dimension independent: both lens applications can apply to the same function with different budgets per dimension. +- Memory-peak composition semantics (max / live-overlap / similar) MUST be declared in the cost-lens authority — generic application config does NOT decide peak algebra. + +## Hard prerequisites (same as #1952 + cost-specific) + +- **T-LAS Slice A landed** (gates #88-#91): `EnforcedApplication` + `IntrospectApplication` + `SectionRef` + `LensEnforcement` + Enforce-mode diagnostic routing per design §3 + INVARIANTS C-8. +- **T-LBP cost-lens BEHAVIORALLY COMPLETE** (gate #80 `cost_lens_behaviorally_complete`): per-target realization cost reading + Lookup composition per T-CostLens-Composition (γ ratified per gunbc#828 #issuecomment-4395691775). +- **#1954-specific**: `Dimension` substrate landed (per Director ratification at gunbc#828 #issuecomment-4395691775 ask #3 — deferred to separate Dimensions sub-lane). If Dimensions sub-lane has not landed at pickup time, **STOP-and-PING** the Mgr; #1953 may be dispatchable independently while #1954 holds. +- **#1953-specific**: cost-basis-declaration substrate per `t-user-authored-cost-basis-discipline-worked-examples.md` audit. Worker grep-verifies the audit's named substrate exists at HEAD before authoring. + +## Acceptance gates (same-slice, all must pass per demo) + +For EACH of #1953 + #1954: + +1. **Fixture program** lands at `src/v3/compiler/tests/integration/`: function/declaration with structured cost basis + `apply_lens(cost, , Enforce { budget: , diagnostic_severity: Error })` per §4.2/§4.3 verbatim. +2. **TestClaim** asserting either Diagnostic-emission (when actual exceeds budget) OR clean-compile (when actual ≤ budget). Per V execution-split: TestClaim shape Verification-owned; PING Verification Mgr (#2075). +3. **Diagnostic structural validation** per gate #91 violation routing — severity = Error; attribution = lens-application site; mentions actual vs budget composition. +4. **No regression on T-LBP cost-lens cementing** (gate #80) — coordinate timing with #1951 cementing test. +5. Bootstrap regen + workspace tests + clippy clean. +6. **§1.8 gate advances to PASSING**: #93 for #1953; #94 for #1954. + +## STOP / PING criteria + +- **STOP** if either hard prerequisite is not landed at pickup. Same discipline as #1952. +- **STOP** if `Dimension` substrate is not landed (specific to #1954). #1953 may proceed independently. +- **STOP** if T-CostLens-Composition (γ-ratified worker brief at #2114) hasn't been worker-dispatched + landed before these demos pick up — cost lens BEHAVIORALLY COMPLETE is the hard precondition. +- **STOP** if memory-peak composition semantics (max / live-overlap) are not yet declared in cost-lens authority at HEAD (specific to #1954) — surface to Mgr; that's cost-lens-authority scope, not demo scope. +- **PING** Verification Mgr (#2075) at PR-open: TestClaim shape coordination per V execution-split brief. + +## Cross-Mgr coordination + +- **Verification Mgr (#2075)**: TestClaim authoring; same-slice consumption preferred per #1952 sibling pattern. +- **Substrate Mgr (this lane)**: cost-lens authority changes (composition semantics for memory-peak per §4.3) may surface as scope-creep; Mgr coordinates. + +## Worker pin (Mgr disposition) + +Same precedent as #1952 (demonstration-tier, distinct from substrate-fact-introduction). **valiant-ant-72** or other workers with prior demo/fixture experience. Multi-demo dispatch consolidation = same worker for both #1953 + #1954. + +## Auto-spawn caveat + +Per Director's standing note + cache-staleness cluster ctrl#217: HOLD dispatch until auto-spawn fix lands. Each demo is M-sized; multi-demo PR is L-sized. Surgical-recreate path candidate if Director ratifies for cascade unblock. + +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-07 per Director endorsement of T-LAS demos pre-staging via execution-brief direct path. Sibling of `r3-substrate-t-las-demo-complexity-contract-compile-error-worker.md` (#1952); share hard-prerequisite + TestClaim + Diagnostic-validation shape pattern. From 000d47421df92bebd49c40c1f19bc35119112e8c Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 18:13:15 +0000 Subject: [PATCH 30/50] =?UTF-8?q?docs(briefs):=20T-CostLens=20=E2=80=94=20?= =?UTF-8?q?update=20Sub-issue=20from=20#1957=20to=20#2141=20(post-surgical?= =?UTF-8?q?-recreate)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PM executed Director's surgical-recreate ratification (gunbc#828 #issuecomment-4397693699) at 17:54:43Z: closed #1957, created fresh #2141 to trigger pollAutoSpawn fresh-creation path. Worker fierce-ram-21 (#2153) spawned on #2141. 1-line brief update per Director's queued-action commitment: brief now references #2141 + cites surgical-recreate authority. #1957 closed-as-superseded. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/briefs/r3-substrate-t-costlens-composition-worker.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/briefs/r3-substrate-t-costlens-composition-worker.md b/docs/briefs/r3-substrate-t-costlens-composition-worker.md index bee4a910dbe..fc6212e0f78 100644 --- a/docs/briefs/r3-substrate-t-costlens-composition-worker.md +++ b/docs/briefs/r3-substrate-t-costlens-composition-worker.md @@ -1,6 +1,6 @@ # Worker brief — Substrate T-CostLens-Composition (γ ratified) -**Sub-issue**: gunbc#1957 (parented under #1939 Substrate Mgr lane). +**Sub-issue**: gunbc#2141 (parented under #1939 Substrate Mgr lane; supersedes #1957 per surgical-recreate at gunbc#828 #issuecomment-4397693699). **Authority**: Director ratification of **option γ** at gunbc#828 #issuecomment-4395691775 (2026-05-07); supersedes the canvas at `docs/briefs/r3-substrate-t-costlens-composition-canvas.md` (canvas may be deleted after this brief lands per single-authority discipline). **Closure predicate**: §1.8 gates #37 `cost_lens_reads_target_realization`, #38 `coercion_cost_equals_complexity_by_construction`, #39 `no_coercion_cost_dimension`, #40 `symbolic_cost_expr_equals_executable`, plus #70 `cost_lens_demonstration`. From 3cf53a4d6f4087760c1656b5eacf97452645f699 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 22:04:24 +0000 Subject: [PATCH 31/50] =?UTF-8?q?docs(proposals):=20Q-Lens-Target-Context?= =?UTF-8?q?=20canvas=20(=CE=B2-extended=20substrate-shape=20question)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Director α-revised supersession at gunbc#828 #issuecomment-4400920572 elevated β-extended path (introduce first-precedent .dag-side fold-over-realization-rows + name active-target authority shape) from slice-tier to canvas-tier. Authored per Q-PAFS template: - Substrate-state at HEAD grep-verified (Lens.read no target-context; zero .dag-side fold-over-realizations precedent; 15+ lens instances using generic Lens) - Binary question: should .dag-side lenses receive target-context for target-keyed reading? - Options matrix: (i) LanguageSpec param to fold; (ii) per-target lens instances [parallel-representation debt]; (iii) global accessor [REJECTED global-state anti-pattern] - Mgr provisional preference: (i) - Cross-cutting: cost.dag load-bearing; emission_provenance.dag secondary; other 13+ lenses target-agnostic Framework discipline anchors per Director corrections: - feedback_same_slice_dissolution_discipline - feedback_parallel_representation_debt - feedback_abstraction_layering (sibling canvas) Sibling canvas (ε path): q-cost-composition-layering-canvas.md authoring follows. Both canvases together address deeper cross-cutting axis: does target-context belong .dag-side (β-extended) or emit-side (ε)? Co-Authored-By: Claude Opus 4.7 (1M context) --- .../proposals/q-lens-target-context-canvas.md | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 docs/proposals/q-lens-target-context-canvas.md diff --git a/docs/proposals/q-lens-target-context-canvas.md b/docs/proposals/q-lens-target-context-canvas.md new file mode 100644 index 00000000000..392a8b3f4fa --- /dev/null +++ b/docs/proposals/q-lens-target-context-canvas.md @@ -0,0 +1,161 @@ +# Canvas — Q-Lens-Target-Context (β-extended substrate-shape question) + +**Authority**: Director ratification of α-revised T-CostLens supersession at gunbc#828 #issuecomment-4400920572 — β-extended path (introduce first-precedent .dag-side fold-over-realization-rows + name active-target authority shape) elevated from slice-tier to canvas-tier. + +**Cross-cutting parent**: PR #2171 α-revised pure-docs (cost.dag deferred-discussion + 5-option matrix + 4 findings) merged 2026-05-07 — captures substrate-state-honest framing pending this canvas's ratification. + +**Sibling canvas**: `q-cost-composition-layering-canvas.md` (ε path; abstraction-layering test for cost-specific Rust-side wiring). + +**Status**: **canvas — Director-tier ratification needed on substrate shape before any T-CostLens follow-on slice or other lens-with-target-context work**. + +## Substrate-state at HEAD (grep-verified) + +`src/v3/std/lens.dag:70-77` defines the generic Lens carrier: + +```dag +type Lens { + name: String + read: fn(Dag, Behavior) -> Witness + sequential: Monoid + branch: fn(C, C) -> C + iterate: fn(C, LoopBound) -> C + validate: fn(Dag, C) -> OptionalDiagnostic +} +``` + +**`read` signature carries no target-context**. Per-primitive realization-cost reading (T-CostLens-Composition gate #37) requires the lens to know WHICH target it's emitting for to pick the right realization row. Realizations are consumed Rust-side at emit time only (`emit/{rust,python}_target.rs` builds `HashMap` from data-row scan); zero `.dag`-side fold-over-`List` / `List` / `List` precedent at HEAD. + +**Lens instances at HEAD** (`src/v3/lenses/`): complexity, cost, dag_shape, effect_enumeration, emission_provenance, idempotency, named_function_count, parallelism, provenance, structural_resolution, unused_parameters, variant_payload, lens_composition_associative_witness, infer_helpers, lower_helpers — 15+ lens instances using the generic Lens carrier. + +## Question (binary) + +**Should .dag-side lenses receive target-context for target-keyed reading?** + +This is a substrate-fact-introduction (P1 procedure): introducing first-precedent `.dag`-side fold-over-realization-rows substrate-consumption pattern. Yes-or-no decision; affects every future lens with target-context needs (not just cost). + +## Options matrix + +### Option (i) — `LanguageSpec` parameter to lens fold + +Refactor `Lens::read` from `fn(Dag, Behavior) -> Witness` to `fn(Dag, Behavior, LanguageSpec) -> Witness`. All 15+ existing lens instances thread `LanguageSpec` parameter; consumers pass active-target at lens-application time. + +**Pro**: +- Most additive at lens-instance level (instances that don't use target-context can ignore the parameter) +- Matches Rust-side `active_language` cache discipline (per fierce-ram-21's grep at gunbc#2153 c#4399898495) +- Single substrate-shape change; cascade is bounded (15 lens instances + their consumers) +- Future lenses that need target-context can use it without further substrate refactoring + +**Con**: +- Threading cost across 15 existing lens instances (even if they ignore the parameter, signature change cascades) +- Forces target-context awareness on lens-fold-pass authority even when only one lens (cost) needs it +- Lens generic refactor requires its own canvas + worker brief (per `feedback_pre_authored_brief_queue`) + +### Option (ii) — Per-target lens instances + +Author per-target lens instances: `cost_lens_rust`, `cost_lens_python`, `cost_lens_go` (and analogous for any other target-context-needing lens). Lens-fold-pass dispatches on target at consumer level; each lens instance is target-specific. + +**Pro**: +- No `Lens` carrier-shape refactor needed +- Existing 14 non-cost lenses untouched +- Each lens instance is target-specific by construction + +**Con**: +- **Explosion-by-target**: N targets × M target-context-needing lenses = N×M lens instances (3 targets × 1 cost-needing lens currently = 3 instances; grows to 9 if 3 lenses need target-context) +- Lens-fold-pass authority must dispatch on target — substrate-side dispatch logic +- Per-lens-per-target authoring duplicates lens shape; parallel-representation debt +- Violates `feedback_parallel_representation_debt` (canonical-authority-consumption rule — Lens exists; per-target instances multiply rather than consume) + +**Status**: structurally weakest option; named for completeness. + +### Option (iii) — Global accessor (REJECTED) + +New substrate accessor `current_language_spec(): LanguageSpec` callable from inside lens fold body. + +**Pro**: minimal surface change; one new accessor. + +**Con**: +- **Global-state anti-pattern** per `feedback_state_space_vs_behavioral_invariants` (lens output should be a function of explicit inputs, not implicit global state) +- Hidden dispatch state at fold-time; breaks lens compositionality +- No structural visibility into "which target" at lens-output read time + +**Rejected** per anti-pattern framing; named only as the third option of the matrix per template completeness. + +## Mgr-tier provisional preference + +**Option (i)** — `LanguageSpec` parameter to lens fold. Most structurally correct: bounded substrate-shape change; matches Rust-side discipline; preserves Lens generic; future-proofs additional target-context-needing lenses. + +The threading cost across 15 existing lens instances is real but manageable per `feedback_construction_over_ratchets` (model first; threading is mechanical). Each non-target-context-using instance can simply ignore the parameter (`fn(_dag, _behavior, _lang_spec) -> Witness`). + +If Director ratifies (i), the cascade: +1. Lens carrier-shape refactor PR (separate Q-PAFS-template canvas + worker brief — substrate-fact-introduction territory) +2. 15 existing lens instances thread `LanguageSpec` parameter (mechanical migration; `_lang_spec` for non-using instances) +3. T-CostLens follow-on slice authors `target_realization_cost_for_callable` helper consuming `LanguageSpec` per-primitive lookup +4. Cementing receipts + capability-register row + §10.3 row updates per α-narrow-eventually shape (post-canvas-ratification) + +## Cross-cutting question + +**Which other lenses beyond cost plausibly need target-context?** + +Grep + analysis of `src/v3/lenses/` instances: +- **complexity.dag**: structural-fold over algebra; no target-context need (complexity IS target-agnostic) +- **dag_shape.dag**: structural; no target need +- **effect_enumeration.dag**: structural-effect axis; no target need +- **emission_provenance.dag**: emission-side reading — POSSIBLY target-context need +- **idempotency.dag**: structural; no target need +- **named_function_count.dag**: structural; no target need +- **parallelism.dag**: R4-carved; structural at HEAD +- **provenance.dag**: structural; no target need +- **structural_resolution.dag**: structural; no target need +- **unused_parameters.dag**: structural; no target need +- **variant_payload.dag**: structural; no target need +- **lens_composition_associative_witness.dag**: meta-lens; no target need + +**Net finding**: cost.dag is the load-bearing target-context-needing lens; emission_provenance.dag is a secondary candidate (emission-side framing; target-keyed emission may need lookup). Other lenses are target-agnostic. + +This means option (i)'s threading cost is mostly mechanical (14 of 15 instances don't substantively use `LanguageSpec`). Option (ii)'s explosion-by-target is bounded too (cost × 3 targets + emission_provenance × 3 targets = 6 per-target instances if (ii) chosen) — but still violates parallel-representation discipline. + +**Mgr lean reaffirmed**: option (i). + +## Director ratification ask + +1. **Pick (i) / (ii) / (iii)** (or surface fourth option). Mgr provisional preference: **(i)**. +2. **Confirm Lens generic refactor scope**: if (i) ratified, refactor lands as separate canvas + worker-brief cycle (per Q-PAFS template) BEFORE T-CostLens follow-on slice. Confirm sequencing. +3. **`LanguageSpec` parameter shape**: if (i), confirm whether `LanguageSpec` is the right type-level parameter (vs `&LanguageSpec` reference-shape, vs `LanguageSpecId` lookup-key). DSL conventions favor value-shape where feasible; verify at refactor brief time. +4. **Cross-cutting impact ratification**: confirm `emission_provenance.dag` is the secondary target-context candidate (not exhaustive — invite Director scrutiny on lens-instance survey). + +## On ratification — sequencing + +Post-ratification cascade: +1. **Q-Lens-Target-Context PROPOSAL doc** lands per Q-PAFS template (this canvas matures into proposal) +2. **Lens refactor canvas + worker brief** authored next (separate cycle if (i) ratified) +3. **Lens refactor PR** — Mgr-tier or worker dispatch; threading 15 lens instances +4. **T-CostLens follow-on slice** authors `target_realization_cost_for_callable` helper consuming new `LanguageSpec` parameter; cementing receipts + capability-register + §10.3 row updates per α-narrow-eventually shape +5. **Verification ratchet authoring** sequences against gate transitions (#37/#40/#70 advancement) + +## Sibling canvas (ε path) + +`q-cost-composition-layering-canvas.md` — addresses whether cost composition factoring (target-agnostic-shape × target-specific-values) is structurally honest, allowing Rust-side wiring without `.dag`-side first-precedent. If ε is ratified instead of (i), the substrate-shape decision IS that target-context belongs emit-side; `.dag`-side carrier holds abstract cost shape; concrete values flow through Rust-side composition. + +The deeper cross-cutting question — does target-context belong .dag-side (β-extended, this canvas) or emit-side (ε, sibling canvas) — is the load-bearing axis. Director's ratification should consider both canvases as a pair. + +## Framework discipline anchors + +Citing per Director correction at gunbc#828 c#4400774036 + c#4400921658: + +- **`feedback_same_slice_dissolution_discipline`**: bridge-with-named-dissolution anti-pattern. β-extended (this canvas's path) was rejected at slice-tier because the named dissolution ("when γ-extended Lens refactor lands, fold helper into Lens::read") was future-scope-not-same-slice. This canvas authors the substrate move at canvas-tier so that follow-on slice's same-slice acceptance is structurally grounded. +- **`feedback_parallel_representation_debt`**: canonical-authority-consumption rule. Option (ii) per-target instances violates this (Lens exists; per-target instances multiply rather than consume). Option (i) honors by refactoring the canonical authority itself. +- **`feedback_abstraction_layering`** (sibling canvas anchor): see Q-Cost-Composition-Layering for cost-specific abstraction-layering test. + +## Worker pin (post-ratification) + +Lens refactor (if (i) ratified): substrate-fact-introduction precedent owners — valiant-ibex-312 OR smart-ram-167. Worker dispatched per substantial substrate change. + +T-CostLens follow-on slice: fierce-ram-21 (continuity from α-revised). + +## Cross-Mgr coordination + +- **Verification Mgr (#2075 / wise-bear-525)**: ratchet authoring on §1.6 NYI → executable transitions (cost-lens BEHAVIORALLY COMPLETE gate #80, T-CostLens gates #37/#40/#70) sequences post-canvas-ratification. +- **Evaluator Mgr (#2065 / crisp-bat-13)**: lens consumers downstream — Pattern A predicates (TC1/TC2/TC3) consume lens output; target-context propagation impacts their predicate structure. +- **Grounding Mgr (#1944)**: target-realization data is Grounding lane authority; lens fold consuming target-keyed lookups means cross-Mgr data-flow dependency. + +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-07 per Director α-revised supersession at gunbc#828 #issuecomment-4400920572 + canvas authoring queue per gunbc#2068 #issuecomment-4401221750. From 89b0c7073752f7f08fb70dd0828297b57fcd43fb Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 22:06:21 +0000 Subject: [PATCH 32/50] =?UTF-8?q?docs(proposals):=20Q-Cost-Composition-Lay?= =?UTF-8?q?ering=20canvas=20(=CE=B5=20substrate-shape=20question)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sibling canvas to q-lens-target-context-canvas.md. Director α-revised supersession at gunbc#828 #issuecomment-4400920572 elevated ε path (Rust-side cost-composition wiring; preserves cost.dag PROXY) from slice-tier to canvas-tier. Authored per Q-PAFS template: - Factoring claim: cost = (target-agnostic-shape SymbolicCost algebra) × (target-specific-values per-primitive realization-cost data loaded Rust-side) - Test against feedback_abstraction_layering (Director-named anchor at gunbc#828 c#4400921658): pure objective concepts × language-agnostic LanguageSpec × emit-side composition. Compliance test for each layer. - Pro factoring (ε structurally honest): SymbolicCost algebra is target- agnostic at HEAD; Rust-side composition is natural home; #38/#39 substrate- already-aligned per Slice 1 finding. - Con factoring (ε is parallel-representation debt): N parallel Rust-side compositions if multiple lenses need target-context; lens-framework abstraction stops at substrate boundary; future lenses hit same dilemma. Mgr provisional reading: factoring honest for COST specifically; NOT generalizable. ε right framing IF cost is the singular need + factoring holds. If N>1 target-context-needing lenses surface, β-extended (option (i) from sibling canvas) becomes the right path. Director ratification ask: 3-way choice (ε) Cost-specific Rust-side composition; preserves cost.dag PROXY (β-extended option (i)) Lens refactor for LanguageSpec parameter (both sequenced) ε now for cost; β-extended later if N>1 Framework discipline anchors: - feedback_abstraction_layering (Director-named for this canvas) - feedback_parallel_representation_debt - feedback_same_slice_dissolution_discipline Canvas-pair complete; sibling canvas + this canvas address the deeper cross-cutting axis: target-context belongs .dag-side (β-extended) or emit-side (ε)? Director ratification across both informs T-CostLens follow-on slice + downstream lens architecture. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../q-cost-composition-layering-canvas.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 docs/proposals/q-cost-composition-layering-canvas.md diff --git a/docs/proposals/q-cost-composition-layering-canvas.md b/docs/proposals/q-cost-composition-layering-canvas.md new file mode 100644 index 00000000000..4d3cfc79d88 --- /dev/null +++ b/docs/proposals/q-cost-composition-layering-canvas.md @@ -0,0 +1,114 @@ +# Canvas — Q-Cost-Composition-Layering (ε substrate-shape question) + +**Authority**: Director ratification of α-revised T-CostLens supersession at gunbc#828 #issuecomment-4400920572 — ε path (Rust-side cost-composition wiring; preserves `cost.dag` PROXY without introducing first-precedent .dag-side fold-over-realizations) elevated from slice-tier to canvas-tier. + +**Cross-cutting parent**: PR #2171 α-revised pure-docs (cost.dag deferred-discussion + 5-option matrix + 4 findings) merged 2026-05-07. + +**Sibling canvas**: `q-lens-target-context-canvas.md` (β-extended path; substrate-shape question on whether `.dag`-side lenses receive target-context). + +**Status**: **canvas — Director-tier ratification needed; cost-specific factoring claim test against `feedback_abstraction_layering`**. + +## The factoring claim + +**ε path proposes**: cost composition factors as **(target-agnostic-shape) × (target-specific-values)**, where: +- **Target-agnostic-shape** = the abstract `SymbolicCost` algebra (7-variant: `ConstantCost`, `LinearCost`, `LogCost`, `LinearithmicCost`, `QuadraticCost`, `ExponentialCost`, `PolynomialCost(Int)`) + `Semiring` composition (sequential / branch / iterate via `sum`/`product`) +- **Target-specific-values** = per-primitive realization-cost facts (`TypeRealization.cost: Int`, `CallableRealization.cost: Int`, etc.) loaded Rust-side at emit time + +If this factoring is **structurally honest**, cost composition can happen Rust-side: the Rust consumer reads the abstract `SymbolicCost` shape from the `.dag`-side lens output, then composes target-specific values via Rust-side data-flow (HashMap-build over realization rows, lookup, multiply by abstract structural coefficients). + +If this factoring is **NOT honest**, cost composition NEEDS .dag-side target-context — ε is parallel-representation debt (Rust-side wiring duplicates / bypasses the canonical Lens-framework authority). + +## Test against `feedback_abstraction_layering` (Director-named anchor) + +Per Director correction at gunbc#828 c#4400921658: + +> `feedback_abstraction_layering` — objective concepts pure; LanguageSpec language-agnostic. Cite this as the framework anchor for whether emit-side cost-keyed composition respects abstraction layering. + +**Abstraction-layering test**: + +1. **Pure objective-concepts layer**: `SymbolicCost` algebra at `src/v3/std/algebra.dag:12+` carries the abstract shape. Per `feedback_abstraction_layering`, objective concepts must be pure — no language/target awareness leaks. +2. **LanguageSpec layer**: language-agnostic; describes structural per-target realization facts without committing to a specific language's idioms. +3. **Emit-side composition layer**: Rust-side `emit/{rust,python}_target.rs` reads LanguageSpec data + abstract `SymbolicCost` shape; composes per-target concrete cost via per-primitive HashMap-lookup. + +**Layering compliance test**: +- ✓ Layer 1 (objective): `SymbolicCost` algebra is target-agnostic. Holds at HEAD. +- ✓ Layer 2 (LanguageSpec): per-primitive realization-cost facts are language-agnostic substrate-data. Holds at HEAD (`src/v3/spec/{rust,python,go}.dag` rows are spec-data, not Rust-specific dispatch). +- ⚠️ Layer 3 (emit-side composition): IF cost composition factors honestly, this layer is the natural home for (target-agnostic × target-specific) → concrete cost. IF factoring fails, this layer carries load-bearing logic that should have been substrate. + +## Honest-factoring evidence + +### Pro factoring (ε is structurally honest) + +**Argument**: `SymbolicCost` is already target-agnostic. Per fierce-ram-21's grep at gunbc#2153 c#4399898495 (Slice 1 finding): + +> `lenses/cost.dag` lens output is already `Lookup`-typed; `Lookup` MissingCost/HitCost machinery all already substrate. #38/#39 substrate-already-aligned. + +Cost composition via `Semiring::sum`/`::product` is structural-fact at HEAD. The abstract algebra IS the load-bearing substrate. Per-primitive realization values are downstream data-flow that doesn't need .dag-side lens-fold authority — Rust consumer reads the abstract shape + multiplies per-primitive concrete values. + +**Empirical test**: at HEAD, `lens_cost_symbolic_generated.rs` (or analogous Rust consumer) IS the natural home for emit-time cost composition. No substrate-shape change needed; ε is "make Rust-side composition explicit + document as the canonical path". + +### Con factoring (ε is parallel-representation debt) + +**Argument**: cost composition that reads target-realization-rows via Rust-side HashMap-build IS load-bearing logic. If Rust-side does the composition, the lens-framework abstraction stops at "abstract `SymbolicCost` shape from structural fold"; concrete cost values flow OUTSIDE the Lens framework via Rust-side data-flow. + +This means: **the lens-framework authority for cost composition is incomplete at the substrate layer** — Rust-side carries load-bearing semantics that should have been substrate. Per `feedback_parallel_representation_debt`, parallel-author-Rust-side-composition violates canonical-authority-consumption (Lens exists; the cost-specific composition should consume it through, not bypass it). + +**Empirical test**: future lenses needing target-context (e.g., emission_provenance per Q-Lens-Target-Context canvas) face the same dilemma — does each lens-with-target-context get its own Rust-side wiring? That's N parallel Rust-side compositions, each violating the lens-framework abstraction. + +## Mgr-tier provisional reading + +The factoring claim is **probably honest for cost specifically** but **probably NOT generalizable**: + +- **Cost-specific honest**: `SymbolicCost` algebra is genuinely target-agnostic; per-primitive realization-cost is genuinely target-specific data; Rust-side composition is the natural home per `feedback_abstraction_layering`. +- **Not generalizable**: emission_provenance (and possibly other future lenses) may have target-keyed structural-needs that DON'T factor as cleanly. ε for cost works; ε for emission_provenance may not. + +**Mgr provisional reading**: ε is the right framing **IF** cost is the only target-context-needing lens at HEAD AND the factoring honestly holds for cost specifically. Per Q-Lens-Target-Context canvas's cross-cutting analysis, cost.dag IS load-bearing target-context-needing; emission_provenance.dag is only secondary. If only cost has the need + the factoring is structurally honest for cost, ε is the more constrained path. + +If multiple lenses surface target-context needs over time, ε's per-lens Rust-side wiring becomes parallel-representation debt → β-extended (Q-Lens-Target-Context option (i)) becomes the right path. + +## Directorratification ask + +1. **Test the factoring**: is `SymbolicCost` × per-primitive-realization-cost an honest factoring per `feedback_abstraction_layering`? Or does it carry hidden parallel-authority? +2. **Generalization scope**: if ε is ratified for cost, what's the principle for future target-context-needing lenses? (Per-lens Rust-side wiring? Or Q-Lens-Target-Context cascade if N>1?) +3. **Cost-specific vs cross-cutting decision**: ε is the more-constrained path IF cost is the singular need. If emission_provenance or other lenses surface, β-extended (option (i) from Q-Lens-Target-Context) is the right path. **Director ratifies one of**: + - **(ε)** Cost-specific Rust-side composition; preserves `cost.dag` PROXY; future lenses re-evaluate independently. + - **(β-extended option (i))** Lens refactor for `LanguageSpec` parameter; .dag-side composes via Lookup; future lenses use the new shape uniformly. + - **(both, sequenced)**: ε now for cost; β-extended later if/when N>1 target-context-needing lenses surface. + +## On ratification — sequencing + +**If ε ratified**: +1. **Q-Cost-Composition-Layering PROPOSAL doc** matures (this canvas). +2. **T-CostLens follow-on slice** Rust-side wiring: `lens_cost_symbolic_generated.rs` (or analog) authors per-primitive realization-cost composition; `cost.dag` lens output stays abstract `SymbolicCost`-typed; PROXY status either retained or refined to "BEHAVIORALLY COMPLETE for abstract-shape; concrete composition Rust-side per ε ratification". +3. **§10.3 row refresh** + capability-register row updated per ε disposition. +4. **Cementing receipts**: gates #37 + #40 + #70 advance via Rust-side composition demonstrating end-to-end cost reading. #70 demonstration fixture lands per ε framing. +5. **Future lenses with target-context need**: re-ratify per-lens (re-open canvas if N>1). + +**If β-extended (option (i)) ratified instead**: see Q-Lens-Target-Context canvas for sequencing (Lens refactor → 15-instance threading → T-CostLens follow-on slice consumes new shape). + +**If both sequenced**: ε now for cost as transitional; β-extended later as canonical when need-count surfaces. + +## Framework discipline anchors + +- **`feedback_abstraction_layering`** (Director-named for this canvas): objective concepts pure; LanguageSpec language-agnostic. Test: does ε's emit-side composition respect the layer separation, or does it leak target-specific logic into objective-concepts-layer? Mgr provisional reading: ε respects the layering IF the factoring is honest for cost. +- **`feedback_parallel_representation_debt`**: canonical-authority-consumption rule. Test: does ε's Rust-side wiring duplicate or bypass Lens framework? Mgr provisional reading: ε is bounded to one consumer (cost) at HEAD; doesn't yet violate. Re-evaluates if N>1. +- **`feedback_same_slice_dissolution_discipline`**: bridge-with-named-dissolution anti-pattern. Test: does ε ship a bridge with a named-future-dissolution to β-extended? Mgr provisional reading: NO if Director ratifies ε as canonical-for-cost (not as "transitional until β-extended"). YES if Director ratifies "both sequenced" — that becomes a named-future-dissolution. + +## Sibling canvas + +**Q-Lens-Target-Context** addresses the broader cross-cutting question: should `.dag`-side lenses receive target-context generally? This canvas (Q-Cost-Composition-Layering) addresses the cost-specific factoring claim. The two canvases together give Director ratification surface across both substrate-shape decisions. + +**Deeper cross-cutting axis**: target-context belongs `.dag`-side (β-extended) or emit-side (ε)? The two canvases articulate the choices; Director ratifies the load-bearing shape. + +## Worker pin (post-ratification) + +If ε ratified: T-CostLens follow-on slice — fierce-ram-21 (continuity from α-revised); Rust-side wiring is implementation-tier, not substrate-fact-introduction. + +If β-extended ratified: Lens refactor + downstream slices — see Q-Lens-Target-Context. + +## Cross-Mgr coordination + +- **Verification Mgr (#2075)**: ratchet authoring on §1.6 NYI → executable transitions sequences post-canvas-ratification. +- **Grounding Mgr (#1944)**: target-realization data is Grounding lane authority. Under ε, Rust-side consumer reads the data; under β-extended, lens fold reads via `LanguageSpec` parameter. Cross-Mgr coordination on data-availability shape. + +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-07 per Director α-revised supersession at gunbc#828 #issuecomment-4400920572 + framework anchor correction at c#4400921658. Sibling to `q-lens-target-context-canvas.md` (β-extended path). From 00551a80166ba5bc9a01ce220aeb18d10c7fe8d8 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 18:17:47 -0400 Subject: [PATCH 33/50] =?UTF-8?q?WIP:=20R3=20Substrate=20Mgr=20=E2=80=94?= =?UTF-8?q?=20lane=20through=20R3=20close?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/proposals/q-cost-composition-layering-canvas.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/proposals/q-cost-composition-layering-canvas.md b/docs/proposals/q-cost-composition-layering-canvas.md index 4d3cfc79d88..06a00f57c7f 100644 --- a/docs/proposals/q-cost-composition-layering-canvas.md +++ b/docs/proposals/q-cost-composition-layering-canvas.md @@ -11,7 +11,7 @@ ## The factoring claim **ε path proposes**: cost composition factors as **(target-agnostic-shape) × (target-specific-values)**, where: -- **Target-agnostic-shape** = the abstract `SymbolicCost` algebra (7-variant: `ConstantCost`, `LinearCost`, `LogCost`, `LinearithmicCost`, `QuadraticCost`, `ExponentialCost`, `PolynomialCost(Int)`) + `Semiring` composition (sequential / branch / iterate via `sum`/`product`) +- **Target-agnostic-shape** = the abstract `SymbolicCost` algebra (7-variant per `src/v3/std/algebra.dag:181-188` at HEAD: `ConstantCost(Int)` | `LinearCost(SizeVariable)` | `PolynomialCost { var, degree }` | `ProductCost(NonSingletonList)` | `SumCost(NonSingletonList)` | `LogCost(SizeVariable)` | `UnknownCost(String)`) + `Semiring` composition (sequential via `SumCost` / `ProductCost`; branch / iterate via algebra ops) - **Target-specific-values** = per-primitive realization-cost facts (`TypeRealization.cost: Int`, `CallableRealization.cost: Int`, etc.) loaded Rust-side at emit time If this factoring is **structurally honest**, cost composition can happen Rust-side: the Rust consumer reads the abstract `SymbolicCost` shape from the `.dag`-side lens output, then composes target-specific values via Rust-side data-flow (HashMap-build over realization rows, lookup, multiply by abstract structural coefficients). From 33afd89df9c8cf7b7c686db89115fce37f16b51e Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 18:23:45 -0400 Subject: [PATCH 34/50] =?UTF-8?q?WIP:=20R3=20Substrate=20Mgr=20=E2=80=94?= =?UTF-8?q?=20lane=20through=20R3=20close?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/proposals/q-cost-composition-layering-canvas.md | 2 +- docs/proposals/q-lens-target-context-canvas.md | 2 +- docs/r3-program-plan.md | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/proposals/q-cost-composition-layering-canvas.md b/docs/proposals/q-cost-composition-layering-canvas.md index 06a00f57c7f..fd5dc34d7e3 100644 --- a/docs/proposals/q-cost-composition-layering-canvas.md +++ b/docs/proposals/q-cost-composition-layering-canvas.md @@ -6,7 +6,7 @@ **Sibling canvas**: `q-lens-target-context-canvas.md` (β-extended path; substrate-shape question on whether `.dag`-side lenses receive target-context). -**Status**: **canvas — Director-tier ratification needed; cost-specific factoring claim test against `feedback_abstraction_layering`**. +**Status**: **canvas — Director-RATIFIED 2026-05-07 (ε standalone for cost; canonical-not-transitional)**; PROPOSAL maturation pending. Ratification at gunb-ai/gunbc#2181 #issuecomment-... — ε ratified as canonical-for-cost; β-extended DEFERRED to N=2 trigger event (when second lens surfaces target-context need); "both sequenced" REJECTED as bridge-with-named-dissolution anti-pattern. ## The factoring claim diff --git a/docs/proposals/q-lens-target-context-canvas.md b/docs/proposals/q-lens-target-context-canvas.md index 392a8b3f4fa..2a669c42535 100644 --- a/docs/proposals/q-lens-target-context-canvas.md +++ b/docs/proposals/q-lens-target-context-canvas.md @@ -6,7 +6,7 @@ **Sibling canvas**: `q-cost-composition-layering-canvas.md` (ε path; abstraction-layering test for cost-specific Rust-side wiring). -**Status**: **canvas — Director-tier ratification needed on substrate shape before any T-CostLens follow-on slice or other lens-with-target-context work**. +**Status**: **canvas — DRAFT/DEFERRED 2026-05-07; reopens on N=2 trigger event**. Director ratified ε path for cost (sibling canvas Q-Cost-Composition-Layering ratified 2026-05-07); β-extended substrate-wide refactor case isn't proven at HEAD with N=1 (only cost). Canvas reopens when SECOND lens surfaces real target-context need beyond cost (emission_provenance per cross-cutting analysis is most likely candidate). Until then, no proposal-maturation authoring; Q-Lens-Target-Context stays in canvas-authoring queue. Closed-system disposition: if N=2 condition never fires, β-extended never fires. ## Substrate-state at HEAD (grep-verified) diff --git a/docs/r3-program-plan.md b/docs/r3-program-plan.md index c5160371101..9a41ed8de58 100644 --- a/docs/r3-program-plan.md +++ b/docs/r3-program-plan.md @@ -233,10 +233,10 @@ This principle is NOT a separate lane; it's a per-lane gate-shape requirement ap | 34 | `bridge_include_str_side_channels_retired` | state-check | T-Bridge-Retirement | DECLARED | substrate query surface | | 35 | `bridge_exact_string_patching_residual_retired` | state-check | T-Bridge-Retirement | DECLARED | umbrella for exact-string scaffolds | | 36 | `bridge_retirement_ledger_zero` | ledger-count | T-Bridge-Retirement | DECLARED | unified ledger reports 0 | -| 37 | `cost_lens_reads_target_realization` | structural-fold | T-CostLens-Composition | DECLARED — deferred to #2175 canvas per α-narrow | requires Behavior→primitive-identity wiring | +| 37 | `cost_lens_reads_target_realization` | structural-fold | T-CostLens-Composition | DECLARED — ε path RATIFIED 2026-05-07 (Q-Cost-Composition-Layering canvas at PR #2181; canonical-not-transitional); closes via Rust-side composition reading abstract `SymbolicCost` × per-primitive realization-cost in T-CostLens follow-on slice | Rust-side composition per ε ratification | | 38 | `coercion_cost_equals_complexity_by_construction` | structural-fold | T-CostLens-Composition | **SATISFIED-BY-CONSTRUCTION** (α-narrow PR #2171; `Semiring` `sequential`/`iterate` at `src/v3/std/algebra.dag:181-188` is sole composition authority — no parallel "complexity-vs-cost" reconciliation surface exists) | thesis unification holds structurally | | 39 | `no_coercion_cost_dimension` | substrate-shape | T-CostLens-Composition | **SATISFIED-BY-CONSTRUCTION** (α-narrow PR #2171; `SymbolicCost` 7-variant at `src/v3/std/algebra.dag:181` is the sole cost dimension; no parallel `CoercionCost` carrier exists at HEAD per grep) | no separate cost dimension | -| 40 | `symbolic_cost_expr_equals_executable` | SymbolicCost-typed | T-CostLens-Composition | DECLARED — deferred to #2175 canvas + Verification Mgr (#2075) lane per α-narrow | runtime prereq: cost lens/report producer | +| 40 | `symbolic_cost_expr_equals_executable` | SymbolicCost-typed | T-CostLens-Composition | DECLARED — ε path RATIFIED 2026-05-07 (Q-Cost-Composition-Layering canvas); closes via Verification Mgr (#2075) ratchet authoring on Rust-side composition consumer + executable predicate per ε path | runtime prereq: cost lens consumer per ε | | 41 | `v2_oracle_no_remaining_test_consumers` | state-check | T-V2-Retirement | DECLARED | no .rs test consumes src/v2/ | | 42 | `v2_directory_deleted` | state-check | T-V2-Retirement | DECLARED | src/v2/ removed from workspace | | 43 | `auto_parallelism_independent_binds_emit_parallel` | demonstration | T-Free-Consequences-Demonstration | DECLARED | bind-independent → parallel emit | From 4209eb7f3aea25a4ee5ef17749d8d038cd19b20b Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 22:24:44 +0000 Subject: [PATCH 35/50] =?UTF-8?q?docs:=20=CE=B5=20ratified=20canonical=20f?= =?UTF-8?q?or=20cost;=20=CE=B2-extended=20deferred=20to=20N=3D2=20?= =?UTF-8?q?=E2=80=94=20gate=20updates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Director ratification at gunb-ai/gunbc#2181 #issuecomment-... : - (ε) RATIFIED standalone for cost composition (canonical-not-transitional) - (β-extended option (i)) DEFERRED to N=2 trigger event (second lens with target-context need beyond cost) - ("both sequenced") REJECTED as bridge-with-named-dissolution anti-pattern Same-slice acceptance gates landed: 1. Q-Cost-Composition-Layering canvas: status updated from "ratification needed" → "Director-RATIFIED 2026-05-07 (ε standalone; canonical-not- transitional); PROPOSAL maturation pending" 2. Q-Lens-Target-Context canvas: status updated from "ratification needed" → "DRAFT/DEFERRED 2026-05-07; reopens on N=2 trigger event" (second lens with substantive target-context need; emission_provenance most likely candidate per cross-cutting analysis §3) 3. r3-program-plan.md gate-table rows #37 + #40 + #70: ε path ratified; close via Rust-side composition reading abstract SymbolicCost × per- primitive realization-cost in T-CostLens follow-on slice 4. r3-program-plan.md §10.3 T-CostLens-Composition row: ε ratified for #37/#40/#70; β-extended deferred per N=2 trigger 5. v3-lens-capability-register.md cost.dag row: ε disposition cited; #2175 continues as cross-cutting umbrella tracker Closed-system disposition per Director: if N=2 condition never fires, β-extended never fires — structurally correct under closed-system design. Framework discipline anchors honored: - feedback_abstraction_layering: ε respects layering (objective concepts pure; target-specific values flow at emit time per Layer-3 honesty test) - feedback_parallel_representation_debt: bounded to N=1; reopens at N=2 - feedback_same_slice_dissolution_discipline: ε ratified canonical, not transitional - feedback_construction_over_ratchets: substrate-shape question answered structurally - feedback_substrate_principle_audit: substrate-fact authored at canvas- tier; ratification follows P1 procedure Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/r3-program-plan.md | 4 ++-- docs/v3-lens-capability-register.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/r3-program-plan.md b/docs/r3-program-plan.md index 9a41ed8de58..ed1163b0985 100644 --- a/docs/r3-program-plan.md +++ b/docs/r3-program-plan.md @@ -266,7 +266,7 @@ This principle is NOT a separate lane; it's a per-lane gate-shape requirement ap | 67 | `numeric_construction_demonstration` | demonstration | T-Numeric-Construction | DECLARED (NEW 2026-05-06) | `Int<32>` + `Real<64>` round-trip | | 68 | `anthropic_wire_demonstration` | demonstration | T-Anthropic-Wire | DECLARED (NEW 2026-05-06) | deterministic mock; live-API NOT closure gate | | 69 | `bridge_retirement_demonstration` | demonstration | T-Bridge-Retirement | DECLARED (NEW 2026-05-06) | typed-identity-surface in production code | -| 70 | `cost_lens_demonstration` | demonstration | T-CostLens-Composition | DECLARED — deferred to #2175 canvas per α-narrow | ≥2 algebra-instances + ≥1 recursive call | +| 70 | `cost_lens_demonstration` | demonstration | T-CostLens-Composition | DECLARED — ε path RATIFIED 2026-05-07 (Q-Cost-Composition-Layering canvas at PR #2181); closes via Rust-side composition fixture demonstrating end-to-end cost reading per ε in T-CostLens follow-on slice | ≥2 algebra-instances + ≥1 recursive call | | 71 | `v3_self_host_demonstration` | demonstration | T-V2-Retirement | DECLARED (NEW 2026-05-06) | bootstrap PB-Runtime trampoline runs end-to-end | | 72 | `e_p_producer_demonstration` | demonstration | T-E-P-Producer-Broadening | DECLARED (NEW 2026-05-06) | call-site produces full descent evidence | | 73 | `lens_behavioral_parity_demonstration` | demonstration | T-Lens-Behavioral-Parity | DECLARED (NEW 2026-05-06) | **R3:** complexity+cost vs frozen v2-oracle snapshot; parallelism/effect_enum **R4-carved** (see `r3-structure.md` §"Acceptance") | @@ -396,7 +396,7 @@ Each retires per its natural-owner program prerequisites. Verification Mgr's `br | T-Omni-Shape-B | RED | (post-R2-Evaluator + Shape A targets) | dependencies | (TBD) | | T-Anthropic-Wire | YELLOW | 3 coproduct worker briefs dispatched on PR #1782 wait-window + 2 OPEN closure tags at HEAD (`dsl/extdeps/llm/anthropic.dag` `:189` + `:68`) | three coproduct slices land + variant-aware projection carrier authored | post-#1782 merge + 3 follow-up paydown PRs | | T-Bridge-Retirement | YELLOW | per-bridge dispatches | 5 sub-bridges retire | post-T-FixedPoint | -| T-CostLens-Composition | YELLOW | α-narrow ratified at gunb-ai/gunbc#828 #issuecomment-4400772335 — gates **#38** + **#39** structurally satisfied at HEAD by construction (`SymbolicCost` sole cost dimension; `Semiring` sole composition authority); receipts landed via PR #2171. Gates **#37** + **#40** + **#70** deferred to follow-on Behavior→primitive-identity wiring canvas at gunb-ai/gunbc#2175 (cross-cutting with T-LBP cementing tests #1950 / #1951; Q-Lens-Target-Context PROPOSAL deferred to its own canvas cycle per Director ratification — NOT a T-CostLens stowaway). | R2-Evaluator + R2-T-Substrate-Lens-Primitive + #2175 canvas ratification (for #37/#40/#70) | partial close per α; full close post-#2175 | +| T-CostLens-Composition | YELLOW | α-narrow ratified at gunb-ai/gunbc#828 #issuecomment-4400772335 — gates **#38** + **#39** structurally satisfied at HEAD by construction (`SymbolicCost` sole cost dimension; `Semiring` sole composition authority); receipts landed via PR #2171. **ε path RATIFIED 2026-05-07** (Q-Cost-Composition-Layering canvas at PR #2181, canonical-not-transitional) — gates **#37** + **#40** + **#70** close via Rust-side composition reading abstract `SymbolicCost` × per-primitive realization-cost in T-CostLens follow-on slice. **Q-Lens-Target-Context β-extended path DEFERRED** to N=2 trigger event (when second lens surfaces target-context need; emission_provenance most likely candidate per cross-cutting analysis); not active R3 ratification gate. | R2-Evaluator + R2-T-Substrate-Lens-Primitive + T-CostLens follow-on slice (Rust-side composition per ε) | partial close per α; #37/#40/#70 close post-ε-slice | | T-V2-Retirement | RED | `r3-tv2-*` briefs | T-FixedPoint + T-LensProducer | longest-path | | T-Free-Consequences-Demonstration | YELLOW | `r3-v-free-consequences-worker` | R2-Evaluator + T-CostLens-Composition | post-deps | | T-E-P-Producer-Broadening | YELLOW | (TBD from Substrate canvas) | (foundational; in flight) | weeks | diff --git a/docs/v3-lens-capability-register.md b/docs/v3-lens-capability-register.md index 7f70bd8c878..2045179d17f 100644 --- a/docs/v3-lens-capability-register.md +++ b/docs/v3-lens-capability-register.md @@ -38,7 +38,7 @@ A lens is only "done" when **both** axes are at their strongest grade for the sc | Lens | Structural | Behavioral | v2 counterpart | v3 output | What v2 has that v3 drops | |---|---|---|---|---|---| | `complexity.dag` | TERMINAL | **PROXY** | `src/v2/complexity.dag` (5488L) | `v3.std.lookup::Lookup = Miss \| Hit(Int)` per port (generated consumer: `src/v3/compiler/src/lens_cost_generated.rs` via `regen_lens` / `emit_rust_module`); `src/v3/std/{termination,computation,induction}.dag` stage E-T/E-C/E-I vocabulary; E-P side-table producer `v3_compiler::dag::per_call_descent_evidence` exists for the first recursive self-call / arithmetic-descent slice; E-M method carrier parity is closed by structural subsumption — lens output unchanged until cost/complexity consumers read per-call facts | `CostExpr` (Sum/Mul/Log/Const), `SizeExpr`, work/span split, `Certainty`, asymptotic classification, recurrence bounds | -| `cost.dag` | TERMINAL | **PROXY** | v2 `CostExpr` (embedded in `complexity.dag`) | `v3.std.lookup::Lookup = Miss \| Hit(SymbolicCost)` per port (generated consumer: `src/v3/compiler/src/lens_cost_symbolic_generated.rs` via `regen_lens` / `emit_rust_module`; Rust surface re-exports `SymbolicCostLookup` as a type alias for `Lookup`); E-C stages `std.computation::CallPattern` / `LoweringTarget`; E-I stages `std.induction::SubValueRelation` / `CostBound`; E-P adds the first side-table `v3_compiler::dag::per_call_descent_evidence` producer; E-M method carrier parity is closed by structural subsumption. **T-CostLens-Composition α-narrow disposition** (Director-ratified at gunb-ai/gunbc#828 #issuecomment-4400772335 via PR #2171): §1.8 gates **#38** `coercion_cost_equals_complexity_by_construction` + **#39** `no_coercion_cost_dimension` are structurally satisfied at HEAD by construction (`SymbolicCost` algebra at `src/v3/std/algebra.dag:181-188` is the sole cost dimension; `Semiring` `sequential` / `iterate` composition is the only authority — no parallel cost dimension exists). Gates **#37** `cost_lens_reads_target_realization`, **#40** `symbolic_cost_expr_equals_executable`, **#70** `cost_lens_demonstration` deferred to follow-on substrate canvas at gunb-ai/gunbc#2175 (Behavior→primitive-identity wiring; cross-cutting with T-LBP cementing tests #1950 / #1951). | Named `SizeVar` with value semantics (v3's `SizeVariable` carries only `source_port: PortId`). `Dimension` wiring deferred on grammar gaps. **E-I carriers are present and E-P has a first narrow producer slice;** broader producer coverage, cost/complexity lens consumption, and the same-source v2/v3 cementing test remain pending. | +| `cost.dag` | TERMINAL | **PROXY** | v2 `CostExpr` (embedded in `complexity.dag`) | `v3.std.lookup::Lookup = Miss \| Hit(SymbolicCost)` per port (generated consumer: `src/v3/compiler/src/lens_cost_symbolic_generated.rs` via `regen_lens` / `emit_rust_module`; Rust surface re-exports `SymbolicCostLookup` as a type alias for `Lookup`); E-C stages `std.computation::CallPattern` / `LoweringTarget`; E-I stages `std.induction::SubValueRelation` / `CostBound`; E-P adds the first side-table `v3_compiler::dag::per_call_descent_evidence` producer; E-M method carrier parity is closed by structural subsumption. **T-CostLens-Composition α-narrow disposition** (Director-ratified at gunb-ai/gunbc#828 #issuecomment-4400772335 via PR #2171): §1.8 gates **#38** `coercion_cost_equals_complexity_by_construction` + **#39** `no_coercion_cost_dimension` are structurally satisfied at HEAD by construction (`SymbolicCost` algebra at `src/v3/std/algebra.dag:181-188` is the sole cost dimension; `Semiring` `sequential` / `iterate` composition is the only authority — no parallel cost dimension exists). Gates **#37** `cost_lens_reads_target_realization`, **#40** `symbolic_cost_expr_equals_executable`, **#70** `cost_lens_demonstration` close via **ε path** RATIFIED 2026-05-07 (Q-Cost-Composition-Layering canvas at PR #2181; canonical-not-transitional): Rust-side composition reading abstract `SymbolicCost` × per-primitive realization-cost in T-CostLens follow-on slice. Q-Lens-Target-Context (β-extended substrate-wide refactor) DEFERRED to N=2 trigger event (second lens with target-context need; emission_provenance most likely candidate per cross-cutting analysis). #2175 follow-on issue continues tracking cross-cutting scope umbrella. | Named `SizeVar` with value semantics (v3's `SizeVariable` carries only `source_port: PortId`). `Dimension` wiring deferred on grammar gaps. **E-I carriers are present and E-P has a first narrow producer slice;** broader producer coverage, cost/complexity lens consumption, and the same-source v2/v3 cementing test remain pending. | | `effect_enumeration.dag` | TERMINAL | **PARTIAL** | None (v3-native) | `EffectEnumerationReport { facts, coverage_gaps, redundant_reads, transaction }` derived from the five `Behavior` variants and callable type-signature shape; generated consumer target: `src/v3/compiler/src/lens_effect_enumeration_generated.rs` via `regen_lens` / `emit_rust_module` | Audit verdict is path (ii): live primitives still require ambient resource/transport metadata rather than returned-modified-resource signatures (`dsl/std/resources.dag`, `dsl/std/primitives.dag`, `dsl/extdeps/shell.dag`, `dsl/extdeps/github/auth.dag`). Full `OperationEffect` retirement, resource-threading migration, and caller-side effect-set pinning are follow-up work. | | `idempotency.dag` | TERMINAL | **COMPLETE** | None (v3-native) | `WorkflowIdempotencyReport` via `lane2_workflow_at` + `std.effects::lane2_workflow_idempotency_report` | — (behavioral authority for the `WorkflowEffect` walk is `lane2_workflow_idempotency_report` in `src/v3/std/effects.dag`. `workflow_idempotency.rs` is still **parallel staging** for native `Dag` entry — same projection, hand mirror until an explicit dissolution removes it or routes through generated-only code; INVARIANTS P2 cleanup, not “two competing semantics.”) | | `parallelism.dag` | PARTIAL | **STUB** | None (v3-native) | Unconditional `report_parallelism_unsupported(LensSurfacePending, …)` | — (real analysis in `src/v3/compiler/src/workflow_parallelism.rs`. **STUB reason:** Stage 2e parallelism walk not yet ported to `.dag` / `lane2_workflow_at` / `std.effects` — the `.dag` stub’s pending reason matches that gap, not the old “cannot emit `match` on imported user sums” era. `emit_rust_module` already lowers that match path; parallelism stays pending until the lens is rewired like `idempotency.dag`.) | From db88b10043d7136eed4600115b9a8def63cbe0c5 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 22:37:54 +0000 Subject: [PATCH 36/50] docs(proposals): canvas inventory grounded in live src/v3/lenses/ registry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit codex BLOCKING at gunb-ai/gunbc#2181 (sha 00551a80): Q-Lens-Target-Context canvas inventory was "copied from expected lens set instead of live src/v3/lenses/ registry"; emission_provenance trigger references not grounded in live file content. Same shape of error as 3 prior BLOCKING reversals (Q-Reification, S5 DeclarationRef, T-CostLens merge-content). Substrate-state-grep is being treated as retrospective-correction rather than prerequisite. Tightening: this is the 4th occurrence; should be hard-prerequisite-discipline going forward. Fixes: 1. Q-Lens-Target-Context inventory section: replaced approximate "15+ lens instances" framing with exact `ls`-grep registry (15 .dag files listed by name), notes infer_helpers + lower_helpers are helper modules authoring shared structural fns rather than top-level lens instances. 2. emission_provenance.dag analysis grounded in HEAD file status header: STATUS = STRUCTURALLY TERMINAL; LENS-INSTANCE FIXTURE-BOUND; BEHAVIORALLY DEFERRED. `read` body is fail-closed Empty stub. Lens does NOT currently read target-context inside fold; producer-side instrumentation records target-specific entries consumed via standard framework. Reframed as "ungrounded at HEAD" rather than "POSSIBLY target-context need" — re-evaluates at producer-wiring landing. 3. Net finding: N=1 confirmed at HEAD (cost.dag only); N=2 is empirically open pending lens-completion cycles, NOT pre-claimable. Plus non-blocking improvement: Q-Cost-Composition-Layering line 9 stale `#issuecomment-...` placeholder replaced with concrete ratification comment id `#issuecomment-4401584012`. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/proposals/q-cost-composition-layering-canvas.md | 2 +- docs/proposals/q-lens-target-context-canvas.md | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/proposals/q-cost-composition-layering-canvas.md b/docs/proposals/q-cost-composition-layering-canvas.md index fd5dc34d7e3..464e08acd1a 100644 --- a/docs/proposals/q-cost-composition-layering-canvas.md +++ b/docs/proposals/q-cost-composition-layering-canvas.md @@ -6,7 +6,7 @@ **Sibling canvas**: `q-lens-target-context-canvas.md` (β-extended path; substrate-shape question on whether `.dag`-side lenses receive target-context). -**Status**: **canvas — Director-RATIFIED 2026-05-07 (ε standalone for cost; canonical-not-transitional)**; PROPOSAL maturation pending. Ratification at gunb-ai/gunbc#2181 #issuecomment-... — ε ratified as canonical-for-cost; β-extended DEFERRED to N=2 trigger event (when second lens surfaces target-context need); "both sequenced" REJECTED as bridge-with-named-dissolution anti-pattern. +**Status**: **canvas — Director-RATIFIED 2026-05-07 (ε standalone for cost; canonical-not-transitional)**; PROPOSAL maturation pending. Ratification at gunb-ai/gunbc#2181 #issuecomment-4401584012 — ε ratified as canonical-for-cost; β-extended DEFERRED to N=2 trigger event (when second lens surfaces target-context need); "both sequenced" REJECTED as bridge-with-named-dissolution anti-pattern. ## The factoring claim diff --git a/docs/proposals/q-lens-target-context-canvas.md b/docs/proposals/q-lens-target-context-canvas.md index 2a669c42535..70cd4f20660 100644 --- a/docs/proposals/q-lens-target-context-canvas.md +++ b/docs/proposals/q-lens-target-context-canvas.md @@ -25,7 +25,7 @@ type Lens { **`read` signature carries no target-context**. Per-primitive realization-cost reading (T-CostLens-Composition gate #37) requires the lens to know WHICH target it's emitting for to pick the right realization row. Realizations are consumed Rust-side at emit time only (`emit/{rust,python}_target.rs` builds `HashMap` from data-row scan); zero `.dag`-side fold-over-`List` / `List` / `List` precedent at HEAD. -**Lens instances at HEAD** (`src/v3/lenses/`): complexity, cost, dag_shape, effect_enumeration, emission_provenance, idempotency, named_function_count, parallelism, provenance, structural_resolution, unused_parameters, variant_payload, lens_composition_associative_witness, infer_helpers, lower_helpers — 15+ lens instances using the generic Lens carrier. +**Lens instances at HEAD** (`src/v3/lenses/`, exact registry per `ls`): `complexity.dag`, `cost.dag`, `dag_shape.dag`, `effect_enumeration.dag`, `emission_provenance.dag`, `idempotency.dag`, `infer_helpers.dag`, `lens_composition_associative_witness.dag`, `lower_helpers.dag`, `named_function_count.dag`, `parallelism.dag`, `provenance.dag`, `structural_resolution.dag`, `unused_parameters.dag`, `variant_payload.dag` — **exactly 15 .dag files** using the generic `Lens` carrier (some are helper modules — `infer_helpers` / `lower_helpers` — that author shared structural fns rather than top-level lens instances). ## Question (binary) @@ -100,7 +100,7 @@ Grep + analysis of `src/v3/lenses/` instances: - **complexity.dag**: structural-fold over algebra; no target-context need (complexity IS target-agnostic) - **dag_shape.dag**: structural; no target need - **effect_enumeration.dag**: structural-effect axis; no target need -- **emission_provenance.dag**: emission-side reading — POSSIBLY target-context need +- **emission_provenance.dag**: STATUS at HEAD = `STRUCTURALLY TERMINAL; LENS-INSTANCE FIXTURE-BOUND; BEHAVIORALLY DEFERRED`. `read` body is a fail-closed `Empty` stub until producer wiring lands (per file's status header). Producer-side instrumentation hooks at `emit/rust_target.rs::render_named_template` would record target-keyed `*SyntaxBinding` / `*OpsBinding` provenance entries that the lens framework's `Empty`/`Concat` framework then consumes. **Whether this constitutes target-context need is currently UNGROUNDED** — emission_provenance at HEAD doesn't read target-realization data inside the lens fold; the producer-side records target-specific entries which the lens consumes via existing framework. Re-evaluate at producer-wiring landing time. NOT a confirmed N=2 candidate; flagged speculative pending behavioral-completion grep. - **idempotency.dag**: structural; no target need - **named_function_count.dag**: structural; no target need - **parallelism.dag**: R4-carved; structural at HEAD @@ -110,7 +110,7 @@ Grep + analysis of `src/v3/lenses/` instances: - **variant_payload.dag**: structural; no target need - **lens_composition_associative_witness.dag**: meta-lens; no target need -**Net finding**: cost.dag is the load-bearing target-context-needing lens; emission_provenance.dag is a secondary candidate (emission-side framing; target-keyed emission may need lookup). Other lenses are target-agnostic. +**Net finding**: cost.dag is the load-bearing target-context-needing lens at HEAD. emission_provenance.dag was previously framed as a secondary candidate but per emission_provenance.dag status header (`STRUCTURALLY TERMINAL; LENS-INSTANCE FIXTURE-BOUND; BEHAVIORALLY DEFERRED`; `read` body fail-closed `Empty` stub), the lens does NOT currently read target-context inside the fold — producer-side instrumentation records target-specific entries which the lens framework consumes via standard `Empty`/`Concat`. Whether emission_provenance constitutes a real N=2 trigger candidate is **ungrounded at HEAD** and re-evaluates when producer wiring lands. Other 13 lenses are target-agnostic per file headers / structural framing. **N=1 confirmed at HEAD**; N=2 is empirically open pending lens-completion cycles, not pre-claimable. This means option (i)'s threading cost is mostly mechanical (14 of 15 instances don't substantively use `LanguageSpec`). Option (ii)'s explosion-by-target is bounded too (cost × 3 targets + emission_provenance × 3 targets = 6 per-target instances if (ii) chosen) — but still violates parallel-representation discipline. From 65f86a65529d4c2555e2eb48693fd59f17257a22 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 22:39:55 +0000 Subject: [PATCH 37/50] docs(proposals): fix Director-ratification-ask typo + #37 gate-id clarification footnote MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cursor APPROVE_WITH_COMMENTS at gunb-ai/gunbc#2181 (sha 4209eb7f) flagged 2 NON-BLOCKING items + 1 exploratory: 1. (NON-BLOCKING) Q-Cost-Composition-Layering line 69: `## Directorratification ask` → `## Director ratification ask` (whitespace typo) 2. (NON-BLOCKING) Q-Cost-Composition-Layering line 9 placeholder `#issuecomment-...`: ALREADY ADDRESSED in commit `db88b1004` (replaced with `#issuecomment-4401584012`) 3. (Exploratory) Gate #37 id `cost_lens_reads_target_realization` framing implies .dag lens body performs realization read; per ε ratification it's Rust-side composition consumer. Added clarifying footnote noting gate-id retention + Rust-side closure path; rename candidate post-follow-on-slice landing. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/proposals/q-cost-composition-layering-canvas.md | 2 +- docs/r3-program-plan.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/proposals/q-cost-composition-layering-canvas.md b/docs/proposals/q-cost-composition-layering-canvas.md index 464e08acd1a..c34cbe00780 100644 --- a/docs/proposals/q-cost-composition-layering-canvas.md +++ b/docs/proposals/q-cost-composition-layering-canvas.md @@ -66,7 +66,7 @@ The factoring claim is **probably honest for cost specifically** but **probably If multiple lenses surface target-context needs over time, ε's per-lens Rust-side wiring becomes parallel-representation debt → β-extended (Q-Lens-Target-Context option (i)) becomes the right path. -## Directorratification ask +## Director ratification ask 1. **Test the factoring**: is `SymbolicCost` × per-primitive-realization-cost an honest factoring per `feedback_abstraction_layering`? Or does it carry hidden parallel-authority? 2. **Generalization scope**: if ε is ratified for cost, what's the principle for future target-context-needing lenses? (Per-lens Rust-side wiring? Or Q-Lens-Target-Context cascade if N>1?) diff --git a/docs/r3-program-plan.md b/docs/r3-program-plan.md index ed1163b0985..6b9b86c397c 100644 --- a/docs/r3-program-plan.md +++ b/docs/r3-program-plan.md @@ -233,7 +233,7 @@ This principle is NOT a separate lane; it's a per-lane gate-shape requirement ap | 34 | `bridge_include_str_side_channels_retired` | state-check | T-Bridge-Retirement | DECLARED | substrate query surface | | 35 | `bridge_exact_string_patching_residual_retired` | state-check | T-Bridge-Retirement | DECLARED | umbrella for exact-string scaffolds | | 36 | `bridge_retirement_ledger_zero` | ledger-count | T-Bridge-Retirement | DECLARED | unified ledger reports 0 | -| 37 | `cost_lens_reads_target_realization` | structural-fold | T-CostLens-Composition | DECLARED — ε path RATIFIED 2026-05-07 (Q-Cost-Composition-Layering canvas at PR #2181; canonical-not-transitional); closes via Rust-side composition reading abstract `SymbolicCost` × per-primitive realization-cost in T-CostLens follow-on slice | Rust-side composition per ε ratification | +| 37 | `cost_lens_reads_target_realization` | structural-fold | T-CostLens-Composition | DECLARED — ε path RATIFIED 2026-05-07 (Q-Cost-Composition-Layering canvas at PR #2181; canonical-not-transitional); closes via Rust-side composition reading abstract `SymbolicCost` × per-primitive realization-cost in T-CostLens follow-on slice. **Note**: gate id retains historical `cost_lens_reads_target_realization` framing; per ε ratification, the *reading* of target-realization is Rust-side composition consumer, not the `.dag` lens body — the lens output stays abstract `SymbolicCost`-typed; per-primitive realization data flows at emit time. Rename or footnote candidate post-follow-on-slice landing. | Rust-side composition per ε ratification | | 38 | `coercion_cost_equals_complexity_by_construction` | structural-fold | T-CostLens-Composition | **SATISFIED-BY-CONSTRUCTION** (α-narrow PR #2171; `Semiring` `sequential`/`iterate` at `src/v3/std/algebra.dag:181-188` is sole composition authority — no parallel "complexity-vs-cost" reconciliation surface exists) | thesis unification holds structurally | | 39 | `no_coercion_cost_dimension` | substrate-shape | T-CostLens-Composition | **SATISFIED-BY-CONSTRUCTION** (α-narrow PR #2171; `SymbolicCost` 7-variant at `src/v3/std/algebra.dag:181` is the sole cost dimension; no parallel `CoercionCost` carrier exists at HEAD per grep) | no separate cost dimension | | 40 | `symbolic_cost_expr_equals_executable` | SymbolicCost-typed | T-CostLens-Composition | DECLARED — ε path RATIFIED 2026-05-07 (Q-Cost-Composition-Layering canvas); closes via Verification Mgr (#2075) ratchet authoring on Rust-side composition consumer + executable predicate per ε path | runtime prereq: cost lens consumer per ε | From 686027d96578edd84658fd205d42a932d6948fb4 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 22:46:32 +0000 Subject: [PATCH 38/50] =?UTF-8?q?docs(proposals):=20Q-Lens-Target-Context?= =?UTF-8?q?=20=E2=80=94=20absorb=20PM=20canvas-review=20concerns=201-3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Director relayed PM canvas review at gunb-ai/gunbc#2068 c#4401627536: Concern 1 (RESOLVED via grep-verify): empirical N=1 confirmation. PM ran `grep -lc 'TypeRealization|CallableRealization|MethodTemplateContract| target_realization|realization_cost|LanguageSpec' src/v3/lenses/*.dag`; only cost.dag has 3 hits, all 14 others have 0 refs (including emission_provenance.dag which I'd previously framed speculatively). Net-finding §3 updated with grep result inline + "N=1 empirically grounded" framing replacing speculative "secondary candidate" language. Empirical basis for DEFERRED β-extended disposition strengthened. Concern 2 (Option (ii) multiplier framing): per-target lens instances replicate the entire Lens authoring surface — N×M × 4 (carrier + monoid sequential + branch + iterate) authoring overhead. Updated Con bullet to reflect the multiplier explicitly: 3 targets × 1 cost lens × 4 = 12 authored fns; grows to 36 if 3 lenses need target-context. Cites feedback_parallel_representation_debt as the P2 framing. Concern 3 (Option (i) threading cost quantification): replaced narrative "threading cost is real but manageable" with quantified breakdown — ~15 signature changes + 14 ignore-parameter patterns + 1 consumer + cementing- test revalidation. Helps future Director ratification at N=2 trigger event. All 3 amendments are docs-only refinements; ε ratification at gunbc#2181 c#4401584012 unchanged. Strengthens canvas as durable substrate-shape decision record. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/proposals/q-lens-target-context-canvas.md | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/docs/proposals/q-lens-target-context-canvas.md b/docs/proposals/q-lens-target-context-canvas.md index 70cd4f20660..ce2fb3c8a18 100644 --- a/docs/proposals/q-lens-target-context-canvas.md +++ b/docs/proposals/q-lens-target-context-canvas.md @@ -46,7 +46,7 @@ Refactor `Lens::read` from `fn(Dag, Behavior) -> Witness` to `fn(Dag, Beha - Future lenses that need target-context can use it without further substrate refactoring **Con**: -- Threading cost across 15 existing lens instances (even if they ignore the parameter, signature change cascades) +- **Threading cost across 15 existing lens instances** (quantified): ~15 lens instances × signature change (`fn(Dag, Behavior) -> Witness` → `fn(Dag, Behavior, LanguageSpec) -> Witness`) + 14 ignore-parameter patterns (`_lang_spec` per lens that doesn't substantively use target-context) + 1 cost-using consumer + cementing-test revalidation per ratchet-test discipline. Real but bounded cost; mechanical migration. - Forces target-context awareness on lens-fold-pass authority even when only one lens (cost) needs it - Lens generic refactor requires its own canvas + worker brief (per `feedback_pre_authored_brief_queue`) @@ -60,7 +60,7 @@ Author per-target lens instances: `cost_lens_rust`, `cost_lens_python`, `cost_le - Each lens instance is target-specific by construction **Con**: -- **Explosion-by-target**: N targets × M target-context-needing lenses = N×M lens instances (3 targets × 1 cost-needing lens currently = 3 instances; grows to 9 if 3 lenses need target-context) +- **Explosion-by-target with authoring multiplier**: N targets × M target-context-needing lenses = N×M lens instances. Each instance replicates the entire `Lens` shape's authoring surface: per-target instance × 4 (carrier + monoid `sequential` + `branch` + `iterate`) authoring overhead. Concretely: 3 targets × 1 cost-needing lens currently = 3 instances × 4 = **12 authored fns**; grows to 36 if 3 lenses need target-context. Per `feedback_parallel_representation_debt`, N×M×4 multiplier is exactly the parallel-authority accumulation P2 prevents. - Lens-fold-pass authority must dispatch on target — substrate-side dispatch logic - Per-lens-per-target authoring duplicates lens shape; parallel-representation debt - Violates `feedback_parallel_representation_debt` (canonical-authority-consumption rule — Lens exists; per-target instances multiply rather than consume) @@ -110,7 +110,19 @@ Grep + analysis of `src/v3/lenses/` instances: - **variant_payload.dag**: structural; no target need - **lens_composition_associative_witness.dag**: meta-lens; no target need -**Net finding**: cost.dag is the load-bearing target-context-needing lens at HEAD. emission_provenance.dag was previously framed as a secondary candidate but per emission_provenance.dag status header (`STRUCTURALLY TERMINAL; LENS-INSTANCE FIXTURE-BOUND; BEHAVIORALLY DEFERRED`; `read` body fail-closed `Empty` stub), the lens does NOT currently read target-context inside the fold — producer-side instrumentation records target-specific entries which the lens framework consumes via standard `Empty`/`Concat`. Whether emission_provenance constitutes a real N=2 trigger candidate is **ungrounded at HEAD** and re-evaluates when producer wiring lands. Other 13 lenses are target-agnostic per file headers / structural framing. **N=1 confirmed at HEAD**; N=2 is empirically open pending lens-completion cycles, not pre-claimable. +**Net finding** (empirically grep-verified per PM canvas-review at gunbc#2181 c#4401624921): + +``` +$ grep -lc 'TypeRealization|CallableRealization|MethodTemplateContract|target_realization|realization_cost|LanguageSpec' src/v3/lenses/*.dag +src/v3/lenses/cost.dag:3 +[14 other lenses]:0 +``` + +**Only `cost.dag` has realization-row consumption refs at HEAD (3 hits)**. All 14 other lenses (including `emission_provenance.dag`) have ZERO refs to target-realization vocabulary. N=1 empirically grounded. + +emission_provenance.dag was speculatively framed as secondary candidate but per its file status header (`STRUCTURALLY TERMINAL; LENS-INSTANCE FIXTURE-BOUND; BEHAVIORALLY DEFERRED`; `read` body fail-closed `Empty` stub), the lens does NOT currently read target-context inside the fold — producer-side instrumentation records target-specific entries which the lens framework consumes via standard `Empty`/`Concat`. The grep result confirms: emission_provenance is NOT a target-realization-row consumer at HEAD. Re-evaluates when producer wiring lands. + +**N=1 confirmed at HEAD by grep**; N=2 is empirically open pending future lens-completion cycles surfacing target-realization consumption, not pre-claimable. This means option (i)'s threading cost is mostly mechanical (14 of 15 instances don't substantively use `LanguageSpec`). Option (ii)'s explosion-by-target is bounded too (cost × 3 targets + emission_provenance × 3 targets = 6 per-target instances if (ii) chosen) — but still violates parallel-representation discipline. From 2c9c343af65d5b519aab4b62a59644afefceded5 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 23:08:06 +0000 Subject: [PATCH 39/50] =?UTF-8?q?docs(proposals):=20canvases=20=E2=80=94?= =?UTF-8?q?=20collapse=20stale=20ratification-ask=20sections=20post-ratifi?= =?UTF-8?q?cation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit codex BLOCKING at gunb-ai/gunbc#2181 (sha be9a9c94): both canvases had stale "Director ratification ask" sections after status headers were updated to RATIFIED/DEFERRED. Per INVARIANTS P1 "Documentation Describes Live State" — canvas internally presented both settled and unsettled authority. Fixes: 1. Q-Cost-Composition-Layering line 69-76: "Director ratification ask" section collapsed to "Director ratification (RECEIVED 2026-05-07)" with ε ratified, β-extended deferred, "both sequenced" rejected. Three options recorded as historical with ratification cite. Eliminates the rejected "both, sequenced" line that conflicted with status-header "canonical-not- transitional" framing. 2. Q-Lens-Target-Context line 131-136: "Director ratification ask" section collapsed to "Director disposition (DEFERRED 2026-05-07; reopens on N=2 trigger event)". Original ratification asks recorded as FROZEN; revisit at N=2 trigger event with then-current substrate-state grep. Eliminates live-now-ratify framing that conflicted with status-header DEFERRED. Both canvases now single live authority — RATIFIED/DEFERRED dispositions, no internal ratification-ask drift. Future re-ratification (Q-Lens-Target- Context at N=2 trigger) refreshes options matrix at that point per substrate-state-honesty discipline. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../q-cost-composition-layering-canvas.md | 20 +++++++++++-------- .../proposals/q-lens-target-context-canvas.md | 20 ++++++++++++++----- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/docs/proposals/q-cost-composition-layering-canvas.md b/docs/proposals/q-cost-composition-layering-canvas.md index c34cbe00780..6b0c7eb0b22 100644 --- a/docs/proposals/q-cost-composition-layering-canvas.md +++ b/docs/proposals/q-cost-composition-layering-canvas.md @@ -66,14 +66,18 @@ The factoring claim is **probably honest for cost specifically** but **probably If multiple lenses surface target-context needs over time, ε's per-lens Rust-side wiring becomes parallel-representation debt → β-extended (Q-Lens-Target-Context option (i)) becomes the right path. -## Director ratification ask - -1. **Test the factoring**: is `SymbolicCost` × per-primitive-realization-cost an honest factoring per `feedback_abstraction_layering`? Or does it carry hidden parallel-authority? -2. **Generalization scope**: if ε is ratified for cost, what's the principle for future target-context-needing lenses? (Per-lens Rust-side wiring? Or Q-Lens-Target-Context cascade if N>1?) -3. **Cost-specific vs cross-cutting decision**: ε is the more-constrained path IF cost is the singular need. If emission_provenance or other lenses surface, β-extended (option (i) from Q-Lens-Target-Context) is the right path. **Director ratifies one of**: - - **(ε)** Cost-specific Rust-side composition; preserves `cost.dag` PROXY; future lenses re-evaluate independently. - - **(β-extended option (i))** Lens refactor for `LanguageSpec` parameter; .dag-side composes via Lookup; future lenses use the new shape uniformly. - - **(both, sequenced)**: ε now for cost; β-extended later if/when N>1 target-context-needing lenses surface. +## Director ratification (RECEIVED 2026-05-07) + +Director ratified at gunb-ai/gunbc#2181 #issuecomment-4401584012: + +1. **Factoring test**: ratified honest for cost specifically per `feedback_abstraction_layering` (Layer 1 objective concepts pure; Layer 2 LanguageSpec language-agnostic; Layer 3 emit-side composition reads abstract shape × concrete values). +2. **Generalization scope**: per-lens Rust-side wiring is acceptable bounded to N=1 at HEAD; reopens at N=2 trigger event (sibling Q-Lens-Target-Context canvas DEFERRED until then). +3. **Path ratified**: + - **(ε) RATIFIED** as canonical-not-transitional for cost composition. Cost-specific Rust-side composition; preserves `cost.dag` PROXY; future lenses re-evaluate independently per N=2 trigger. + - **(β-extended option (i)) DEFERRED** to N=2 trigger event (sibling canvas). + - **(both, sequenced) REJECTED** as bridge-with-named-dissolution anti-pattern per `feedback_same_slice_dissolution_discipline`. + +Closed-system disposition: if N=2 condition never fires, β-extended never fires — structurally correct under closed-system design. ## On ratification — sequencing diff --git a/docs/proposals/q-lens-target-context-canvas.md b/docs/proposals/q-lens-target-context-canvas.md index ce2fb3c8a18..b4f4ee67704 100644 --- a/docs/proposals/q-lens-target-context-canvas.md +++ b/docs/proposals/q-lens-target-context-canvas.md @@ -128,12 +128,22 @@ This means option (i)'s threading cost is mostly mechanical (14 of 15 instances **Mgr lean reaffirmed**: option (i). -## Director ratification ask +## Director disposition (DEFERRED 2026-05-07; reopens on N=2 trigger event) -1. **Pick (i) / (ii) / (iii)** (or surface fourth option). Mgr provisional preference: **(i)**. -2. **Confirm Lens generic refactor scope**: if (i) ratified, refactor lands as separate canvas + worker-brief cycle (per Q-PAFS template) BEFORE T-CostLens follow-on slice. Confirm sequencing. -3. **`LanguageSpec` parameter shape**: if (i), confirm whether `LanguageSpec` is the right type-level parameter (vs `&LanguageSpec` reference-shape, vs `LanguageSpecId` lookup-key). DSL conventions favor value-shape where feasible; verify at refactor brief time. -4. **Cross-cutting impact ratification**: confirm `emission_provenance.dag` is the secondary target-context candidate (not exhaustive — invite Director scrutiny on lens-instance survey). +Director ratified at gunb-ai/gunbc#2181 #issuecomment-4401584012: **β-extended (option (i)) DEFERRED**. Sibling Q-Cost-Composition-Layering ratified ε standalone for cost; β-extended substrate-wide refactor case isn't proven at HEAD with N=1 (only cost.dag has realization-row consumption refs per grep). Canvas reopens when SECOND lens surfaces real target-context need beyond cost. + +Closed-system disposition: if N=2 condition never fires, β-extended never fires. + +### Re-ratification asks (FROZEN; revisit at N=2 trigger event) + +When N=2 trigger fires and canvas reopens, the original ratification asks become live again: + +1. Pick (i) / (ii) / (iii) (or surface fourth option). Mgr provisional preference recorded: **(i)**. +2. Confirm Lens generic refactor scope: if (i) ratified, refactor lands as separate canvas + worker-brief cycle (per Q-PAFS template) BEFORE consumer slices. +3. `LanguageSpec` parameter shape: type-level parameter vs reference-shape vs lookup-key. +4. Cross-cutting impact ratification per second-lens evidence (per N=2-triggering lens's grep). + +These asks are FROZEN at canvas-author-time framing; re-evaluate against substrate state at re-open time (both options matrix and provisional preference may need refresh against then-current lens registry). ## On ratification — sequencing From 7d708af8ab8bbfd3dd4370cecf56496e037f9c87 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 23:09:48 +0000 Subject: [PATCH 40/50] =?UTF-8?q?docs(proposals):=20Q-Lens-Target-Context?= =?UTF-8?q?=20=E2=80=94=20separate=20live=20N=3D1=20from=20reopen-only=20f?= =?UTF-8?q?uture=20N=3D2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit openai-pro APPROVE_WITH_COMMENTS at gunb-ai/gunbc#2181 (sha be9a9c94): canvas line 127 mixed live N=1 authority with speculative N=2 candidate in one current-state cost count. Per P1 Documentation Describes Live State + P2 single-authority metadata: the live count at HEAD is `cost × 3 targets = 3 per-target instances` (× 4 authoring-multiplier per Option (ii) Con = 12 fns). The `emission_provenance × 3` figure is a reopen-only future scenario that materializes only if emission_provenance becomes the second real target-context lens at producer- wiring landing time. Updated to separate the two clearly: live count + reopen-only future scenario marked separately. Aligns with the grep-verified N=1 finding established earlier in canvas §3. Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/proposals/q-lens-target-context-canvas.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/proposals/q-lens-target-context-canvas.md b/docs/proposals/q-lens-target-context-canvas.md index b4f4ee67704..fdd219f9527 100644 --- a/docs/proposals/q-lens-target-context-canvas.md +++ b/docs/proposals/q-lens-target-context-canvas.md @@ -124,7 +124,7 @@ emission_provenance.dag was speculatively framed as secondary candidate but per **N=1 confirmed at HEAD by grep**; N=2 is empirically open pending future lens-completion cycles surfacing target-realization consumption, not pre-claimable. -This means option (i)'s threading cost is mostly mechanical (14 of 15 instances don't substantively use `LanguageSpec`). Option (ii)'s explosion-by-target is bounded too (cost × 3 targets + emission_provenance × 3 targets = 6 per-target instances if (ii) chosen) — but still violates parallel-representation discipline. +This means option (i)'s threading cost is mostly mechanical (14 of 15 instances don't substantively use `LanguageSpec`). Option (ii)'s explosion-by-target at HEAD is bounded to **N=1**: `cost × 3 targets = 3 per-target instances` (× 4 authoring-multiplier per Option (ii) Con bullet = 12 fns). The `emission_provenance × 3` instances are a **reopen-only future scenario** that materializes only if emission_provenance becomes the second real target-context lens at producer-wiring landing time — currently NOT applicable per the grep-verified N=1 finding above. Option (ii) still violates parallel-representation discipline regardless of N count. **Mgr lean reaffirmed**: option (i). From 786dcf5dac1c38585babd7f05e2c7f6088978c71 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Thu, 7 May 2026 19:25:50 -0400 Subject: [PATCH 41/50] =?UTF-8?q?WIP:=20R3=20Substrate=20Mgr=20=E2=80=94?= =?UTF-8?q?=20lane=20through=20R3=20close?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/proposals/q-cost-composition-layering-canvas.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/proposals/q-cost-composition-layering-canvas.md b/docs/proposals/q-cost-composition-layering-canvas.md index 6b0c7eb0b22..c9418462131 100644 --- a/docs/proposals/q-cost-composition-layering-canvas.md +++ b/docs/proposals/q-cost-composition-layering-canvas.md @@ -88,9 +88,7 @@ Closed-system disposition: if N=2 condition never fires, β-extended never fires 4. **Cementing receipts**: gates #37 + #40 + #70 advance via Rust-side composition demonstrating end-to-end cost reading. #70 demonstration fixture lands per ε framing. 5. **Future lenses with target-context need**: re-ratify per-lens (re-open canvas if N>1). -**If β-extended (option (i)) ratified instead**: see Q-Lens-Target-Context canvas for sequencing (Lens refactor → 15-instance threading → T-CostLens follow-on slice consumes new shape). - -**If both sequenced**: ε now for cost as transitional; β-extended later as canonical when need-count surfaces. +**(Historical alternatives — REJECTED at ratification):** β-extended (option (i)) ratified-instead path and "both, sequenced" path both rejected per Director ratification (see Director ratification section above). Sequencing under those alternatives recorded only in the canvas-historical record at this point; not live. ## Framework discipline anchors From e57a3901a0e7b304c27f58b9a616a229ce9deb5b Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 8 May 2026 01:03:49 +0000 Subject: [PATCH 42/50] =?UTF-8?q?docs(briefs):=20T-CostLens=20worker=20bri?= =?UTF-8?q?ef=20=E2=80=94=20=CE=B5=20supersession=20header=20(=CE=B3=20ret?= =?UTF-8?q?ained=20as=20context)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR #2181 merged at eff426de5 ratifies ε path canonical-not-transitional for cost composition. Brief was authored under γ scope (.dag-side Lookup composition). Add binding ε supersession header at top; retain γ section as historical context per single-authority discipline. cost.dag stays PROXY under ε; composition is Rust-side (abstract SymbolicCost shape × per-primitive realization values). Authority: Director ratification at gunb-ai/gunbc#2181 #issuecomment-4401584012. Co-Authored-By: Claude Opus 4.7 (1M context) --- ...3-substrate-t-costlens-composition-worker.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/briefs/r3-substrate-t-costlens-composition-worker.md b/docs/briefs/r3-substrate-t-costlens-composition-worker.md index fc6212e0f78..a51f1a497c6 100644 --- a/docs/briefs/r3-substrate-t-costlens-composition-worker.md +++ b/docs/briefs/r3-substrate-t-costlens-composition-worker.md @@ -1,8 +1,19 @@ -# Worker brief — Substrate T-CostLens-Composition (γ ratified) +# Worker brief — Substrate T-CostLens-Composition (ε ratified — supersedes γ) + +**SCOPE-SUPERSESSION 2026-05-08 (post-PR #2181 merge `eff426de5`)**: this brief now operates under **ε ratification** per Director at gunb-ai/gunbc#2181 #issuecomment-4401584012 (Q-Cost-Composition-Layering canvas RATIFIED canonical-not-transitional for cost). γ scope (`Lookup` .dag-side composition driving PROXY → BEHAVIORALLY COMPLETE) is superseded. Under ε: **`cost.dag` stays PROXY**; cost composition happens **Rust-side** (target-agnostic abstract `SymbolicCost` shape from `cost.dag` lens output × target-specific per-primitive realization-cost values composed by Rust consumer at emit time). Authority documents: `docs/proposals/q-cost-composition-layering-canvas.md` (ε canvas, RATIFIED) + `docs/proposals/q-lens-target-context-canvas.md` (β-extended sibling DEFERRED to N=2 trigger). Sections below originally authored under γ — read through the ε lens: any "Lookup .dag-side composition" reference now means "Rust-side composition consuming abstract `SymbolicCost` shape from the .dag-side lens output". γ-historical text retained for context per single-authority discipline; the supersession header is binding. **Sub-issue**: gunbc#2141 (parented under #1939 Substrate Mgr lane; supersedes #1957 per surgical-recreate at gunbc#828 #issuecomment-4397693699). -**Authority**: Director ratification of **option γ** at gunbc#828 #issuecomment-4395691775 (2026-05-07); supersedes the canvas at `docs/briefs/r3-substrate-t-costlens-composition-canvas.md` (canvas may be deleted after this brief lands per single-authority discipline). -**Closure predicate**: §1.8 gates #37 `cost_lens_reads_target_realization`, #38 `coercion_cost_equals_complexity_by_construction`, #39 `no_coercion_cost_dimension`, #40 `symbolic_cost_expr_equals_executable`, plus #70 `cost_lens_demonstration`. +**Authority (live)**: Director ratification of **option ε** at gunb-ai/gunbc#2181 #issuecomment-4401584012 (2026-05-08, post-PR-#2181-merge). Supersedes prior γ ratification at gunbc#828 #issuecomment-4395691775; γ-historical authority retained as context-only. +**Closure predicate**: §1.8 gates #37 `cost_lens_reads_target_realization` (ε: closes via Rust-side consumer reading abstract `SymbolicCost` shape + composing per-target concrete cost), #38 `coercion_cost_equals_complexity_by_construction` (already by construction at HEAD per α-narrow PR #2171), #39 `no_coercion_cost_dimension` (already by construction at HEAD), #40 `symbolic_cost_expr_equals_executable` (ε: SymbolicCostExprEquals predicate consumes Rust-side composition output), plus #70 `cost_lens_demonstration` (ε: fixture program with ≥2 algebra-instances + ≥1 recursive call + observable cost-bound output via Rust-side end-to-end cost reading). +**`cost.dag` status header refines to**: `STRUCTURALLY TERMINAL; BEHAVIORALLY COMPLETE for abstract-shape (.dag-side); concrete composition Rust-side per ε ratification PR #2181`. PROXY framing for the abstract→concrete boundary stays. + +**Out-of-scope (unchanged under ε)**: `Lens` generic carrier-shape refactor (β-extended DEFERRED to N=2 trigger per sibling canvas — STOP-and-PING if surfaces); `data symbolic_cost_dimension` (separate Dimensions sub-lane). + +— Supersession authored by warm-wolf-698 (Substrate Mgr) 2026-05-08 post-PR-#2181 merge. γ-section text below retained as context-only; the ε supersession header above is the live binding scope. + +--- + +## (γ-historical context — superseded by ε header above) ## Important framing — this is NOT a substrate-fact-introduction From 1405823b5034ce52879f03d93b5bb4bca06e69cd Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 8 May 2026 02:00:14 +0000 Subject: [PATCH 43/50] =?UTF-8?q?docs(proposals):=20Q-Complexity-Compositi?= =?UTF-8?q?on-Layering=20canvas=20=E2=80=94=20DRAFT=20(factoring=20tested,?= =?UTF-8?q?=20=CE=B5=20precedent=20does=20NOT=20apply)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Director authorized canvas authoring at gunb-ai/gunbc#828 c#4402669133 as parallel structure to Q-Cost-Composition-Layering (ε RATIFIED). Substrate- grep on src/v3/lenses/complexity.dag at HEAD shows the factoring claim DIFFERS from cost-lens: - Cost-lens needed (target-agnostic shape × target-specific values) factoring → Rust-side composition (ε) - Complexity-lens has NO target-specific axis; output is structural property of DAG topology + algebra-instance composition; substrate- native fully-on-.dag-side completion Mgr provisional reading: ε precedent does NOT apply; complexity-lens BEHAVIORAL COMPLETION is direct slice-tier substrate authoring (carrier introduction follows SymbolicCost precedent + T-E-P P1 carrier consumption). Director ratification ask: Q1 (factoring finding correct), Q2 (slice-tier directly bypassing canvas), Q3 (fresh worker pin). Cross-Mgr: Verification Mgr (#2075) pinged on v2-oracle snapshot capture status (cross-cutting prerequisite for #1950/#1951 cementing dispatch). Co-Authored-By: Claude Opus 4.7 (1M context) --- ...-complexity-composition-layering-canvas.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 docs/proposals/q-complexity-composition-layering-canvas.md diff --git a/docs/proposals/q-complexity-composition-layering-canvas.md b/docs/proposals/q-complexity-composition-layering-canvas.md new file mode 100644 index 00000000000..1396a0437fb --- /dev/null +++ b/docs/proposals/q-complexity-composition-layering-canvas.md @@ -0,0 +1,106 @@ +# Canvas — Q-Complexity-Composition-Layering (substrate-shape question) + +**Authority**: Director authorization at gunb-ai/gunbc#828 #issuecomment-4402669133 — canvas-tier scope question for complexity-lens BEHAVIORAL COMPLETION; parallel structure to Q-Cost-Composition-Layering (RATIFIED 2026-05-07 ε path) but **factoring claim differs per substrate-grep**. + +**Status**: **canvas — DRAFT 2026-05-08**; PROPOSAL maturation pending Director ratification. + +**Sibling canvases (already RATIFIED)**: `q-cost-composition-layering-canvas.md` (ε path; cost-lens specific factoring); `q-lens-target-context-canvas.md` (β-extended; DEFERRED to N=2 trigger). + +## The factoring claim under test + +The cost-lens canvas RATIFIED ε factoring: + +> **(target-agnostic-shape) × (target-specific-values)** — abstract `SymbolicCost` algebra (Layer 1 objective concepts pure) × per-primitive realization-cost values (Layer 2 LanguageSpec) → composed Rust-side at emit time (Layer 3 emit composition). + +**Question**: does complexity-lens completion fit the same factoring? **Substrate-grep finding (per `src/v3/lenses/complexity.dag` HEAD): NO.** + +## Substrate-grep grounding (HEAD: `complexity.dag` at origin/main) + +Status header at HEAD: +> Status: STRUCTURALLY TERMINAL; BEHAVIORALLY PROXY. ... Forward fold over `d.nodes` builds a per-port integer depth map. ... **This lens does not subsume v2's complexity analysis.** v2's `src/v2/complexity.dag` produces `ComplexitySummary { work, span, output_size, certainty }` with symbolic `CostExpr` / `SizeExpr` and asymptotic classification. This lens produces a single integer per port — the structural depth of the producing behavior in the DAG. ... **Genuine equivalence blocks on consuming the staged `DescentEvidence`, `CallPattern`, and `SubValueRelation` carriers at live call sites.** + +Key structural facts: + +1. **Output type at HEAD**: `Lookup` per port (single integer = structural depth). NOT a target-keyed algebra. +2. **PROXY → COMPLETE delta**: blocking-on consumption of `DescentEvidence` / `CallPattern` / `SubValueRelation` carriers — **all just landed via T-E-P P1 cascade (Slices 1-4 closed gates #76/#77/#78 + cementing per Slice 4 #2192 merged 2026-05-08 00:42Z)**. +3. **No target-realization-cost reading**: complexity-lens output is structural-depth-of-DAG, not per-target concrete-cost. No HashMap-build over `TypeRealization` / `CallableRealization` rows. No `LanguageSpec` parameter. No target-context dependence. +4. **No symbolic algebra**: `ComplexitySummary { work, span, output_size, certainty }` from v2 is **R3 scope per option (b) RATIFIED 2026-05-06** but not yet substrate-typed at HEAD; v3's `complexity.dag` produces only structural-depth `Int`. + +## Factoring test against `feedback_abstraction_layering` + +Re-applying the abstraction-layering test the cost-canvas used: + +1. **Layer 1 (objective concepts pure)**: complexity-lens's "abstract shape" at HEAD = `Lookup` (structural depth). The `ComplexitySummary` algebra is the R3-scope target shape. Both are target-agnostic by construction (depth + work/span/output-size are properties of the DAG structure, not of any particular target language). +2. **Layer 2 (LanguageSpec)**: **N/A** — complexity composition does NOT consume per-primitive realization-cost rows. Structural depth is computed from the DAG topology alone; work/span/output-size from algebra-instance composition (Semiring / Semilattice operations on the carriers themselves). No LanguageSpec data flows in. +3. **Layer 3 (emit-side composition)**: **N/A** — there is no "concrete per-target value" downstream of the abstract shape. Complexity-lens output is the final answer, not an intermediate consumed by Rust-side per-target multiplication. + +**Factoring conclusion**: ε's (target-agnostic × target-specific) factoring **does not apply** to complexity-lens because there is no target-specific axis. Complexity composition is **fully .dag-side substrate-native** — no cross-layer Rust consumer needed. + +## What complexity-lens BEHAVIORAL COMPLETION actually requires + +Per the lens's own status header + R3 scope per Q-Lens-Behavioral-Parity-R3-Closeability option (b) RATIFIED 2026-05-06 (gunb-ai/gunbc#828 #issuecomment-4385329180): + +**Gate #79 `complexity_lens_behaviorally_complete`** ledger text (`docs/r3-program-plan.md:278`): +> symbolic CostExpr + work/span split + asymptotic classification + cementing test + +The completion path is **direct .dag-side substrate authoring**: + +1. **Symbolic CostExpr carrier authoring**: introduce `ComplexityCost` / `WorkSpan` / `AsymptoticClass` algebra in `src/v3/std/algebra.dag` (or sibling) — analogous to how `SymbolicCost` lives there for cost-lens. Carrier introduction is P1 substrate-fact-introduction; needs prior canvas if first-precedent, but the cost-lens precedent shows the algebra-authoring pattern is well-trod. +2. **Lens output type widening**: change `complexity.dag::cost_of` from returning `Lookup` to returning `Lookup` (or the chosen carrier shape). +3. **Algebra-composition rules**: Semiring-style sequential / parallel composition rules for work-span; asymptotic-classification fold over the carrier. +4. **Carrier consumption from T-E-P P1**: where the depth fold currently treats Transform behaviors uniformly (all weight 1), the completed lens consumes `DescentEvidence` / `CallPattern` / `SubValueRelation` to classify recursive-call behavior asymptotically (e.g., StrictSubValue = O(log n) recursive descent vs SubValueUnknown = unbounded). + +Target-context independence holds throughout: complexity is a property of the DAG structure + algebra-instance composition, not of any target language. + +## Mgr provisional reading + +**ε-precedent does NOT apply**. Complexity-lens completion is structurally **direct .dag-side substrate authoring + carrier introduction + T-E-P P1 carrier consumption** — none of the cost-lens "Rust-side composition" pattern translates. The cross-layer factoring question is moot here because there's no target-specific axis to factor. + +**Implication for dispatch**: complexity-lens BEHAVIORAL COMPLETION is **a fresh Substrate slice-tier work-item**, NOT a canvas-pair-deferred substrate-shape question. Concrete next steps: + +1. **Carrier-introduction canvas (mini)**: brief substrate-shape question on `ComplexityCost` / `WorkSpan` / `AsymptoticClass` carrier shape. Likely a quick ratification — cost-lens's `SymbolicCost` carrier is precedent for the algebra-authoring discipline. Could be slice-tier directly if Director ratifies analogous-to-SymbolicCost shape without canvas. +2. **Slice authoring**: lens widening + algebra composition + T-E-P P1 carrier consumption. Mgr-tier dispatch to fresh worker pin (eager-bat-178 NOT a fit per Director read; this is different problem class than producer-broadening). +3. **Cementing test (#1950)**: downstream once substrate completion lands; consumes frozen v2-oracle snapshot per `r2-structure.md` §"Lane structure" framing. v2-oracle snapshot capture status pending Verification Mgr (#2075) cross-Mgr ping (in flight: #2075 c#4402679181). + +## Honest scope-question delta vs cost-lens + +The **load-bearing distinction** between cost-lens (ε ratified) and complexity-lens: + +| | Cost-lens (ε path) | Complexity-lens (this canvas) | +|---|---|---| +| Cross-layer factoring needed? | YES (target-realization-cost reading) | NO (no target axis) | +| Rust-side composition? | YES (HashMap-build over realization rows) | NO (.dag-side substrate-native) | +| `LanguageSpec` parameter consumption? | At Rust-consumer boundary | Not used | +| Substrate-shape ambiguity? | Yes (ε vs β-extended) | No (one path: direct .dag substrate completion) | +| Canvas-vs-slice boundary | Canvas tier (substrate-shape question warranted) | Slice tier (carrier introduction is small ratification) | + +## Director ratification ask + +**Provisional reading for ratification**: + +1. **Q1**: Is the substrate-grep finding correct that complexity-lens factoring does NOT match cost-lens ε? (i.e., no target-context axis; no Rust-side composition; pure .dag substrate completion) +2. **Q2**: If Q1 yes, do you ratify **slice-tier dispatch directly** (carrier-introduction follows `SymbolicCost` precedent + T-E-P P1 carrier consumption) — bypassing canvas-tier scope question for the carrier shape? +3. **Q3**: If Q2 yes, fresh worker pin or hold for queue? + +**Mgr lean**: Q1 = yes; Q2 = yes (cost-lens carrier-introduction precedent makes this a follow-on, not first-precedent); Q3 = fresh worker pin once briefs author. + +## Sibling canvases anchor + +- `q-cost-composition-layering-canvas.md` — ε RATIFIED for cost +- `q-lens-target-context-canvas.md` — β-extended DEFERRED to N=2 trigger +- This canvas — complexity-lens factoring honestly tested and found NOT to fit ε; recommended slice-tier disposition + +## Framework discipline anchors + +- **`feedback_abstraction_layering`**: applied. Layer 1/2/3 test surfaces the no-target-axis finding directly. +- **`feedback_per_instance_ratification` (Pattern-A discipline analog)**: ε is per-lens, not blanket-extended. Complexity-lens explicitly tested fresh; finding may differ from cost. +- **`feedback_construction_over_ratchets`**: substrate completion proceeds by direct authoring (carrier + lens + composition), not by ratchet-over-PROXY. +- **`feedback_substrate_principle_audit`**: substrate-fact-introduction (carrier shape) gets canvas-tier ratification; if Director ratifies cost-lens precedent applies, slice-tier directly. + +## Cross-Mgr coordination + +- **Verification Mgr (#2075)**: v2-oracle snapshot capture status — cross-cutting prerequisite for cementing dispatch (#1950 + #1951 both gate on this); pinged at #2075 c#4402679181. +- **Grounding Mgr (#1944)**: not applicable — complexity-lens has no target-realization data dependency. +- **PM (#846)**: cross-lane T-LBP narrowed-scope partner brief (`docs/briefs/r3-v-t-lbp-narrowed-scope-partner-worker.md`) consumes this canvas's disposition for downstream cementing-discipline. + +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-08 per Director authorization at gunb-ai/gunbc#828 #issuecomment-4402669133. From ab382e31a8491b341dbe3407d35a663538d5a3fd Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 8 May 2026 02:15:52 +0000 Subject: [PATCH 44/50] docs(briefs): T-LBP complexity-lens substrate-completion worker brief (Q1/Q2/Q3 RATIFIED) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pre-authored brief for complexity-lens BEHAVIORAL COMPLETION substrate work per Director Q1/Q2/Q3 ratification at gunb-ai/gunbc#828 c#4402714255. Three deliverables: carrier introduction (ComplexityCost / WorkSpan / AsymptoticClass following SymbolicCost precedent) + lens widening (complexity.dag PROXY → COMPLETE) + T-E-P P1 carrier consumption (DescentEvidence / CallPattern / SubValueRelation for asymptotic classification of recursive-call behavior). Indirect-variant dependency surfaced as worker-grep concern at slice- authoring time (T-E-P P1 Slice 5+ pending; eager-bat-178 stream). Cementing test (#1950) is separate downstream brief; v2-oracle snapshot ownership pending Q4 cross-Mgr ratification. Worker pin: fresh-pool pick at dispatch time (NOT eager-bat-178 per Director Q3 framing; NOT fierce-ram-21 busy with cost-lens ε). Same-window-dispatch discipline applies post-canvas-merge (PR #2197). Pre-authored vs pre-known discipline applied per feedback_pre_known_vs_pre_authored_briefs.md memorialized 2026-05-08. Co-Authored-By: Claude Opus 4.7 (1M context) --- ...lexity-lens-substrate-completion-worker.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 docs/briefs/r3-substrate-t-lbp-complexity-lens-substrate-completion-worker.md diff --git a/docs/briefs/r3-substrate-t-lbp-complexity-lens-substrate-completion-worker.md b/docs/briefs/r3-substrate-t-lbp-complexity-lens-substrate-completion-worker.md new file mode 100644 index 00000000000..3b51f321feb --- /dev/null +++ b/docs/briefs/r3-substrate-t-lbp-complexity-lens-substrate-completion-worker.md @@ -0,0 +1,86 @@ +# Worker brief — Substrate T-LBP complexity-lens substrate completion + +**Sub-issue**: TBD (parented under R3 Substrate Mgr lane #1939; new sub-issue created at dispatch time per same-window-dispatch discipline). +**Authority**: Director ratification of Q1/Q2/Q3 at gunb-ai/gunbc#828 #issuecomment-4402714255 — Q-Complexity-Composition-Layering canvas (`docs/proposals/q-complexity-composition-layering-canvas.md`) finding ratified: ε precedent does NOT apply (no target-context axis); slice-tier dispatch authorized; `SymbolicCost` precedent applies for carrier introduction (canvas-tier bypassed for carrier shape). +**Closure predicate**: §1.8 row #79 `complexity_lens_behaviorally_complete` — symbolic CostExpr + work/span split + asymptotic classification + cementing test. **This brief covers substrate completion only**; cementing test (#1950) is a separate downstream brief at `docs/briefs/r3-substrate-t-lbp-complexity-lens-cementing-test-worker.md`. + +## Important framing — this is NOT P1 substrate-fact-introduction + +`SymbolicCost` is the established precedent for algebra carrier introduction (substrate-tier; canvas-tier-bypass-able when precedent applies per Director Q2 ratification). `ComplexityCost` / `WorkSpan` / `AsymptoticClass` parallel that shape; carrier introduction is **follow-on substrate authoring**, NOT first-precedent P1 work. + +`src/v3/lenses/complexity.dag` ALREADY EXISTS at HEAD as `STRUCTURALLY TERMINAL; BEHAVIORALLY PROXY` (forward fold over `d.nodes` building `Lookup` per port = single-integer structural depth). This brief advances it to `STRUCTURALLY TERMINAL; BEHAVIORALLY COMPLETE` via carrier introduction + lens widening + T-E-P P1 carrier consumption. + +## Scope (binding per Director Q1/Q2/Q3 ratification) + +Three coordinated authoring deltas: + +### Deliverable 1 — Carrier introduction (algebra) + +Author `ComplexityCost` (or chosen alternate carrier name) algebra parallel to `SymbolicCost` 7-variant shape at `src/v3/std/algebra.dag` (or sibling location appropriate per algebra organization at HEAD). Required carriers per ledger row #79 framing: + +- **Symbolic cost expression** carrier (analog of `SymbolicCost`) +- **Work/span split** — typically two carriers or a record `WorkSpan { work: ComplexityCost, span: ComplexityCost }` +- **Asymptotic classification** — finite enum of asymptotic classes (`O(1)` / `O(log n)` / `O(n)` / `O(n log n)` / `O(n^2)` / `O(2^n)` / `Unknown` — exact set is worker call per substrate-tooling at HEAD; v2's classification at `src/v2/complexity.dag` is the precedent reference) + +Sequential / branch / iterate composition rules via `Semiring` (or analogous algebra instance) — same shape as `Semiring` per cost-lens precedent. `MaxPath` semantics for span composition (parallel max; sequential sum). + +### Deliverable 2 — Lens widening at `src/v3/lenses/complexity.dag` + +Change `cost_of(d, port_id)` from returning `Lookup` to returning `Lookup` (or chosen carrier shape). The forward-fold structure stays — substrate invariant that producers precede consumers in `d.nodes` continues to make this a pure catamorphism. Widening is mechanical: `entry_for(acc, behavior)` returns the structurally-typed carrier rather than a single integer. + +Status header refines: `STRUCTURALLY TERMINAL; BEHAVIORALLY PROXY` → `STRUCTURALLY TERMINAL; BEHAVIORALLY COMPLETE`. + +### Deliverable 3 — T-E-P P1 carrier consumption + +For Transform behaviors that are recursive self-calls, consume `DescentEvidence` / `CallPattern` / `SubValueRelation` carriers (landed via T-E-P P1 Slices 1-4 at #2167/#2178/#2182/#2192) to classify recursive-call asymptotic behavior: + +- `StrictSubValue` per-arg → bounded structural descent → finite recursion → composes into asymptotic class per call-pattern (e.g., halving → `O(log n)`; element-wise → `O(n)`) +- `SubValueUnknown` → asymptotic class falls through to `Unknown` +- `PreservedValue` → non-descending arg; doesn't drive recursion bound + +**Indirect-call dependency** (worker grep at slice authoring time): + +T-E-P P1 Slice 5+ (Indirect/`TransformDispatch::Indirect` / `ArrowPortRef` variant) is a separate active work stream (eager-bat-178, dispatched at gunb-ai/gunbc#2166 c#4402718554; PR #2198 in flight on a different scope, sequencing TBD). If the complexity-lens slice's representative-source corpus exercises higher-order-fn patterns (`fold(list, init, f)` / `map(list, f)` etc.) that use indirect dispatch, this brief's worker may need to **wait on Slice 5+ Indirect-variant land** for those classifications. Worker should grep at slice-authoring time: + +- If complexity-lens completion can demonstrate on direct-call-only representative sources, proceed without Indirect-variant dependency. +- If indirect-call coverage is structurally required for the asymptotic-classification carrier consumption, STOP and surface to Mgr for sequencing coordination with eager-bat-178. + +## Out-of-scope (deferred) + +- **Cementing test (#1950)**: covered by separate downstream brief `docs/briefs/r3-substrate-t-lbp-complexity-lens-cementing-test-worker.md`; gates additionally on frozen v2-oracle snapshot capture (cross-Mgr ownership Q4 pending at #828 c#4402702798; PB Mgr lean per Verification authoritative read at #2075 c#4402691581). +- **`Lens` generic carrier-shape refactor**: β-extended DEFERRED to N=2 trigger per `q-lens-target-context-canvas.md`; STOP-and-PING if surfaces during this slice. +- **Cost-lens substrate completion**: separate active stream (fierce-ram-21 ε path at PR #2194); not absorbed. + +## Acceptance gates (same-slice, all must pass) + +1. `complexity.dag` advanced from `STRUCTURALLY TERMINAL; BEHAVIORALLY PROXY` → `STRUCTURALLY TERMINAL; BEHAVIORALLY COMPLETE` per `docs/v3-lens-capability-register.md` audit; status header updated in the file itself. +2. Carrier introduction: `ComplexityCost` (or chosen name) + `WorkSpan` + `AsymptoticClass` algebra at appropriate `std` location with Semiring composition; carriers consumable structurally. +3. Lens output type widened from `Lookup` to `Lookup` (or chosen carrier shape); forward-fold structure preserved. +4. T-E-P P1 carrier consumption: recursive-call asymptotic classification reads `DescentEvidence` / `CallPattern` / `SubValueRelation` per call-pattern. +5. **#79 satisfied by construction**: lens output documented to carry symbolic CostExpr + work/span split + asymptotic classification. Code-level cite in PR description. +6. Bootstrap regen: `cargo test -p v3-compiler bootstrap_regen_fresh -- --ignored` clean. +7. Full suite: `cargo test --workspace --exclude v2-compiler-tests` green; `cargo clippy --all-targets -- -D warnings` clean. +8. **§10.3 row text refresh**: `docs/r3-program-plan.md` §10.3 T-LBP complexity-lens substrate-completion row updated to cite Q-Complexity-Composition-Layering canvas RATIFIED + this PR's # as the receipt. + +## STOP / PING criteria + +- **STOP** if Indirect-call coverage is structurally required for the chosen representative-source asymptotic classifications — surface to Mgr for sequencing coordination with eager-bat-178 Slice 5+ work. +- **STOP** if `SymbolicCost` precedent shape doesn't actually fit `ComplexityCost` (e.g., asymptotic-classification carrier needs structurally different shape than 7-variant). Surface to Mgr; may re-open canvas-tier scope question for carrier shape (Director Q2 was ratified contingent on precedent applying). +- **STOP** if lens widening reveals `Lens` generic at `lens.dag:70-77` needs carrier-shape refactor — that's β-extended DEFERRED to N=2 trigger per sibling canvas; do NOT absorb into this slice. +- **PING** Verification Mgr (#2075 / wise-bear-525) at PR-open time per Pattern-A executable-gate ratchet discipline (gate #79 transition from PROXY → COMPLETE). + +## Worker pin + +Fresh pool pin TBD (NOT eager-bat-178 per Director Q3 framing — different problem class than T-E-P P1 producer-broadening; NOT fierce-ram-21 — busy with cost-lens ε Slice 1a→1b chain). Mgr's call on which fresh-pool worker at dispatch time. + +## Cross-Mgr coordination + +- **Verification Mgr (#2075)**: PING at PR-open per gate #79 PROXY → COMPLETE transition; ratchet authoring is Verification's standing concern. +- **Eager-bat-178**: cross-stream coordination if complexity-lens slice's worker finds Indirect-variant dependency surfaces during T-E-P P1 carrier consumption authoring. +- **#1950 downstream**: complexity-lens cementing test dispatch (separate brief) gates on this brief's substrate-completion landing + frozen v2-oracle snapshot capture (Q4 cross-Mgr ownership). + +## Auto-spawn caveat + +Per Director's standing note + cache-staleness cluster ctrl#217: HOLD dispatch on this brief until auto-spawn fix lands per L-sized substrate-behavioral-completion threshold, OR Mgr-direct authoring if scope-cohering small-enough (this is L-sized; Mgr-direct is unlikely fit). Same-window-dispatch discipline applies post-canvas-merge. + +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-08 per Director Q1/Q2/Q3 RATIFIED at gunb-ai/gunbc#828 #issuecomment-4402714255; sibling canvas at `docs/proposals/q-complexity-composition-layering-canvas.md` (RATIFIED via PR #2197). From 3bcd5048a36de30a11439d6700fcd658adbccd51 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 8 May 2026 02:28:14 +0000 Subject: [PATCH 45/50] docs(briefs): rewrite complexity-lens brief consuming live design authority (codex BLOCKING fix) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Codex BLOCKING (3 findings) at #2199 sha 7a8bb6dc: 1. Brief authored against missing canvas instead of reconciling with docs/design-complexity-lens-behavioral-completeness.md (which exists at HEAD with comprehensive substrate spec) 2. Producer coverage treated as optional corpus scope; should be hard T-E-P-Producer-Broadening prerequisite 3. Stale/non-in-repo planning authority cited; should be r3-structure.md row 146 (T-LBP slice 1) All three BLOCKING findings VALID — substrate-grep-before-authoring discipline failure on my part (feedback_substrate_grep_before_authoring already memorialized; violated own discipline). Rewrite delegates carrier shape, dimension wiring, and consumer rewrite to live design doc §§1.1-1.6 verbatim: - §1.1 SymbolicCost — already at algebra.dag; no change - §1.2 SizeVariable — display_name enrichment - §1.3 work_dimension + span_dimension — two AnalysisDimension instances - §1.4 AsymptoticClass + BoundedLattice instance - §1.5 Certainty (cost-aware composition; no lattice) - §1.6 cost_bound_to_symbolic projection - §1.7 ComplexitySummary record + lens widening T-E-P P1 hard prerequisite per design's authority discipline + r3- structure.md row 146; STOP-and-PING if T-E-P P1 not COMPLETE at slice authoring time. Authority cites updated to live r3-structure.md row 146. Co-Authored-By: Claude Opus 4.7 (1M context) --- ...lexity-lens-substrate-completion-worker.md | 106 ++++++++++-------- 1 file changed, 61 insertions(+), 45 deletions(-) diff --git a/docs/briefs/r3-substrate-t-lbp-complexity-lens-substrate-completion-worker.md b/docs/briefs/r3-substrate-t-lbp-complexity-lens-substrate-completion-worker.md index 3b51f321feb..33a58b3edab 100644 --- a/docs/briefs/r3-substrate-t-lbp-complexity-lens-substrate-completion-worker.md +++ b/docs/briefs/r3-substrate-t-lbp-complexity-lens-substrate-completion-worker.md @@ -1,86 +1,102 @@ # Worker brief — Substrate T-LBP complexity-lens substrate completion -**Sub-issue**: TBD (parented under R3 Substrate Mgr lane #1939; new sub-issue created at dispatch time per same-window-dispatch discipline). -**Authority**: Director ratification of Q1/Q2/Q3 at gunb-ai/gunbc#828 #issuecomment-4402714255 — Q-Complexity-Composition-Layering canvas (`docs/proposals/q-complexity-composition-layering-canvas.md`) finding ratified: ε precedent does NOT apply (no target-context axis); slice-tier dispatch authorized; `SymbolicCost` precedent applies for carrier introduction (canvas-tier bypassed for carrier shape). -**Closure predicate**: §1.8 row #79 `complexity_lens_behaviorally_complete` — symbolic CostExpr + work/span split + asymptotic classification + cementing test. **This brief covers substrate completion only**; cementing test (#1950) is a separate downstream brief at `docs/briefs/r3-substrate-t-lbp-complexity-lens-cementing-test-worker.md`. +**Sub-issue**: TBD (parented under R3 Substrate Mgr lane #1939; new sub-issue created at dispatch time). +**Authority — live design doc**: [`docs/design-complexity-lens-behavioral-completeness.md`](../design-complexity-lens-behavioral-completeness.md) — comprehensive R3 design that resolves substrate-shape questions for `lenses/complexity.dag` PROXY → COMPLETE. **All implementation decisions trace to this doc**; brief delegates carrier shape, dimension wiring, and consumer-rewrite to its §§1.1–1.6 + §3. +**Authority — lane row**: [`docs/r3-structure.md`](../r3-structure.md) row 146 (T-Lens-Behavioral-Parity slice 1 — complexity). +**Authority — Director ratification**: Q-Complexity-Composition-Layering canvas (`docs/proposals/q-complexity-composition-layering-canvas.md`) Q1/Q2/Q3 RATIFIED at gunb-ai/gunbc#828 #issuecomment-4402714255 — finding: ε precedent does NOT apply (no target-context axis); slice-tier dispatch authorized; existing substrate authorities (`SymbolicCost`, `CostBound`, `ComplexitySummary`, `AsymptoticClass`) consumed, NOT re-introduced. +**Closure predicate**: §1.8 row #79 `complexity_lens_behaviorally_complete` (work/span split + asymptotic classification + cementing test); cementing test (#1950) is a separate downstream brief. -## Important framing — this is NOT P1 substrate-fact-introduction +## Important framing — this is NOT substrate-fact-introduction -`SymbolicCost` is the established precedent for algebra carrier introduction (substrate-tier; canvas-tier-bypass-able when precedent applies per Director Q2 ratification). `ComplexityCost` / `WorkSpan` / `AsymptoticClass` parallel that shape; carrier introduction is **follow-on substrate authoring**, NOT first-precedent P1 work. +Per the live design doc §1, **all six substrate carriers already exist or are minor enrichments**, not new P1 facts: -`src/v3/lenses/complexity.dag` ALREADY EXISTS at HEAD as `STRUCTURALLY TERMINAL; BEHAVIORALLY PROXY` (forward fold over `d.nodes` building `Lookup` per port = single-integer structural depth). This brief advances it to `STRUCTURALLY TERMINAL; BEHAVIORALLY COMPLETE` via carrier introduction + lens widening + T-E-P P1 carrier consumption. +- §1.1 `SymbolicCost` 7-variant — already at `src/v3/std/algebra.dag` (DB-7); no substrate change +- §1.2 `SizeVariable` — enrichment (add `display_name: String?`), not new type +- §1.3 work/span — TWO `AnalysisDimension` instances (`work_dimension` + `span_dimension`) per DB-3; the `AnalysisDimension` parent already declared in `src/v3/std/dimensions.dag` +- §1.4 `AsymptoticClass` — 8-variant sum + `BoundedLattice` instance, declared in `src/v3/std/algebra.dag` per design §1.4 spec (NB: `data` form gated on class-5 record bodies; Rust-execution authority pattern applies until grammar lands) +- §1.5 `Certainty = Proven | Conservative` — complexity-lens-local sum type; declared in `lenses/complexity.dag` per design §1.5 +- §1.6 `RecurrenceForm` + `CostBound` — both already at `src/v3/std/induction.dag`; missing piece is the `cost_bound_to_symbolic` projection (design §1.6 spec) -## Scope (binding per Director Q1/Q2/Q3 ratification) +Plus §1.7 `ComplexitySummary` record (work + span + cost + asymptotic + certainty coordinates) at `lenses/complexity.dag`. -Three coordinated authoring deltas: +**Use existing carriers verbatim**; do NOT invent parallel names (e.g., `ComplexityCost`). Per `feedback_parallel_representation_debt`: `CostBound` is canonical for the proof; `SymbolicCost` is the display/composition algebra; consume both, do not re-author. -### Deliverable 1 — Carrier introduction (algebra) +## Hard prerequisite — T-E-P-Producer-Broadening must be COMPLETE -Author `ComplexityCost` (or chosen alternate carrier name) algebra parallel to `SymbolicCost` 7-variant shape at `src/v3/std/algebra.dag` (or sibling location appropriate per algebra organization at HEAD). Required carriers per ledger row #79 framing: +Per design doc §"Authority discipline": *"Implementation lane is T-Lens-Behavioral-Parity slice 1 (complexity); cascade-gated on T-E-P-Producer-Broadening"*. Per `docs/r3-structure.md` T-Lens-Behavioral-Parity row, complexity-lens BEHAVIORAL COMPLETION cannot land before T-E-P-Producer-Broadening covers all live call sites. -- **Symbolic cost expression** carrier (analog of `SymbolicCost`) -- **Work/span split** — typically two carriers or a record `WorkSpan { work: ComplexityCost, span: ComplexityCost }` -- **Asymptotic classification** — finite enum of asymptotic classes (`O(1)` / `O(log n)` / `O(n)` / `O(n log n)` / `O(n^2)` / `O(2^n)` / `Unknown` — exact set is worker call per substrate-tooling at HEAD; v2's classification at `src/v2/complexity.dag` is the precedent reference) +**Live status of T-E-P P1**: +- Slices 1-4 (#2167/#2178/#2182/#2192): direct-call sub-class closed +- Slice 5+ (Indirect/`TransformDispatch::Indirect` / `ArrowPortRef`): in flight via eager-bat-178 (current PR #2198 is repositioned arithmetic-Div follow-up; real Slice 5 indirect-call work is next per worker disposition at gunb-ai/gunbc#2166 c#4402742599) +- Additional sub-classes per design §3 may surface (parser/worklist/fold-body classes named in eager-bat-178's prior planning framing) -Sequential / branch / iterate composition rules via `Semiring` (or analogous algebra instance) — same shape as `Semiring` per cost-lens precedent. `MaxPath` semantics for span composition (parallel max; sequential sum). +**Worker action**: STOP and surface to Mgr at slice authoring time IF T-E-P P1 is not yet declared COMPLETE across all sub-classes the design doc names. `complexity_lens_behaviorally_complete` cannot ship while T-E-P producer carriers are partial — `DescentEvidence` / `CallPattern` / `SubValueRelation` reads at recursive-call sites would have gaps that propagate into the lens output. Prior framing (in earlier draft of this brief) treating producer coverage as optional corpus scope was wrong; this brief retracts that position. -### Deliverable 2 — Lens widening at `src/v3/lenses/complexity.dag` +## Scope (binding per design doc + Director ratification) -Change `cost_of(d, port_id)` from returning `Lookup` to returning `Lookup` (or chosen carrier shape). The forward-fold structure stays — substrate invariant that producers precede consumers in `d.nodes` continues to make this a pure catamorphism. Widening is mechanical: `entry_for(acc, behavior)` returns the structurally-typed carrier rather than a single integer. +Three coordinated authoring deltas — all named in the design doc, all consume existing substrate: -Status header refines: `STRUCTURALLY TERMINAL; BEHAVIORALLY PROXY` → `STRUCTURALLY TERMINAL; BEHAVIORALLY COMPLETE`. +### Deliverable 1 — Substrate enrichments per design §§1.1–1.6 -### Deliverable 3 — T-E-P P1 carrier consumption +Author the named substrate enrichments per design doc verbatim: -For Transform behaviors that are recursive self-calls, consume `DescentEvidence` / `CallPattern` / `SubValueRelation` carriers (landed via T-E-P P1 Slices 1-4 at #2167/#2178/#2182/#2192) to classify recursive-call asymptotic behavior: +- **§1.2**: extend `SizeVariable` in `src/v3/std/algebra.dag` with `display_name: String?` field; add `size_variable_eq` (equality on `source_port` only). +- **§1.3**: declare `work_dimension` + `span_dimension` data declarations in `lenses/complexity.dag` per design §1.3 spec; respect class-5 record-body cascade gate (Rust-execution authority pattern via `v3_compiler::analyze_symbolic_cost_dimension` until class-5 grammar lands; substrate-data-spec stays in `.dag` per P5 dissolution-trigger discipline). +- **§1.4**: declare `AsymptoticClass` 8-variant + `BoundedLattice` instance + `meet_asymptotic_class` / `join_asymptotic_class` / `classify(SymbolicCost) -> AsymptoticClass` in `src/v3/std/algebra.dag` per design §1.4 spec. +- **§1.5**: declare `Certainty = Proven | Conservative` in `lenses/complexity.dag` per design §1.5 spec; **no `BoundedLattice` declaration** (composition is cost-aware via §3.1 `compose_summary_*` family, not lattice-fold). +- **§1.6**: add `cost_bound_to_symbolic(CostBound) -> SymbolicCost` projection in `src/v3/std/induction.dag` per design §1.6 spec. -- `StrictSubValue` per-arg → bounded structural descent → finite recursion → composes into asymptotic class per call-pattern (e.g., halving → `O(log n)`; element-wise → `O(n)`) -- `SubValueUnknown` → asymptotic class falls through to `Unknown` -- `PreservedValue` → non-descending arg; doesn't drive recursion bound +### Deliverable 2 — `ComplexitySummary` record + lens widening -**Indirect-call dependency** (worker grep at slice authoring time): +Per design §1.7 + §3: -T-E-P P1 Slice 5+ (Indirect/`TransformDispatch::Indirect` / `ArrowPortRef` variant) is a separate active work stream (eager-bat-178, dispatched at gunb-ai/gunbc#2166 c#4402718554; PR #2198 in flight on a different scope, sequencing TBD). If the complexity-lens slice's representative-source corpus exercises higher-order-fn patterns (`fold(list, init, f)` / `map(list, f)` etc.) that use indirect dispatch, this brief's worker may need to **wait on Slice 5+ Indirect-variant land** for those classifications. Worker should grep at slice-authoring time: +- Declare `ComplexitySummary { work, span, cost, asymptotic, certainty }` record in `lenses/complexity.dag`. +- Widen lens output type from `Lookup` to `Lookup`; preserve forward-fold catamorphism shape (substrate invariant on `d.nodes` ordering). +- Implement `compose_summary_*` family per design §3.1 — sequential / iterate / branch-max compositions; per-dimension certainty projection consuming the cost-aware composition shape from §1.5. +- Status header refines: `STRUCTURALLY TERMINAL; BEHAVIORALLY PROXY` → `STRUCTURALLY TERMINAL; BEHAVIORALLY COMPLETE`. -- If complexity-lens completion can demonstrate on direct-call-only representative sources, proceed without Indirect-variant dependency. -- If indirect-call coverage is structurally required for the asymptotic-classification carrier consumption, STOP and surface to Mgr for sequencing coordination with eager-bat-178. +### Deliverable 3 — T-E-P P1 carrier consumption (recurrence wiring) -## Out-of-scope (deferred) +Per design §1.6 + §3: consume `RecurrenceForm` + `master_theorem` (E-I lane substrate already at HEAD) at recursive-call sites; classify per call-pattern via T-E-P P1 `DescentEvidence` / `CallPattern` / `SubValueRelation`. Routes through `cost_bound_to_symbolic` projection (Deliverable 1 §1.6). -- **Cementing test (#1950)**: covered by separate downstream brief `docs/briefs/r3-substrate-t-lbp-complexity-lens-cementing-test-worker.md`; gates additionally on frozen v2-oracle snapshot capture (cross-Mgr ownership Q4 pending at #828 c#4402702798; PB Mgr lean per Verification authoritative read at #2075 c#4402691581). -- **`Lens` generic carrier-shape refactor**: β-extended DEFERRED to N=2 trigger per `q-lens-target-context-canvas.md`; STOP-and-PING if surfaces during this slice. -- **Cost-lens substrate completion**: separate active stream (fierce-ram-21 ε path at PR #2194); not absorbed. +## Out-of-scope + +- **Cementing test (#1950)**: separate downstream brief at `docs/briefs/r3-substrate-t-lbp-complexity-lens-cementing-test-worker.md`; gates additionally on frozen v2-oracle snapshot capture (Q4 RATIFIED 2026-05-08 — PB Manager owns; #828 c#4402740072). +- **`Lens` generic carrier-shape refactor**: β-extended DEFERRED to N=2 trigger per `q-lens-target-context-canvas.md`; STOP-and-PING if surfaces. +- **Cost-lens substrate completion**: separate active stream (fierce-ram-21 ε path); not absorbed. +- **Class-5 record bodies in `data` declarations**: cascade-gated per design §1.3 + §1.4 NB; stay on Rust-execution authority pattern until grammar lands; do not block this slice on class-5. ## Acceptance gates (same-slice, all must pass) -1. `complexity.dag` advanced from `STRUCTURALLY TERMINAL; BEHAVIORALLY PROXY` → `STRUCTURALLY TERMINAL; BEHAVIORALLY COMPLETE` per `docs/v3-lens-capability-register.md` audit; status header updated in the file itself. -2. Carrier introduction: `ComplexityCost` (or chosen name) + `WorkSpan` + `AsymptoticClass` algebra at appropriate `std` location with Semiring composition; carriers consumable structurally. -3. Lens output type widened from `Lookup` to `Lookup` (or chosen carrier shape); forward-fold structure preserved. -4. T-E-P P1 carrier consumption: recursive-call asymptotic classification reads `DescentEvidence` / `CallPattern` / `SubValueRelation` per call-pattern. +1. T-E-P-Producer-Broadening declared COMPLETE before this slice opens (worker grep at slice-authoring time per Hard prerequisite section above). +2. All §§1.1–1.7 substrate enrichments authored per design doc verbatim; carrier names match design doc (NO renames — `ComplexitySummary` / `AsymptoticClass` / `Certainty` / `cost_bound_to_symbolic`). +3. `complexity.dag` advanced from `STRUCTURALLY TERMINAL; BEHAVIORALLY PROXY` → `STRUCTURALLY TERMINAL; BEHAVIORALLY COMPLETE`; status header updated in the file itself. +4. Lens output type widened: `Lookup` → `Lookup`; forward-fold catamorphism preserved. 5. **#79 satisfied by construction**: lens output documented to carry symbolic CostExpr + work/span split + asymptotic classification. Code-level cite in PR description. 6. Bootstrap regen: `cargo test -p v3-compiler bootstrap_regen_fresh -- --ignored` clean. 7. Full suite: `cargo test --workspace --exclude v2-compiler-tests` green; `cargo clippy --all-targets -- -D warnings` clean. -8. **§10.3 row text refresh**: `docs/r3-program-plan.md` §10.3 T-LBP complexity-lens substrate-completion row updated to cite Q-Complexity-Composition-Layering canvas RATIFIED + this PR's # as the receipt. +8. **r3-structure.md row 146 receipt-text refresh** + `docs/v3-lens-capability-register.md` complexity-lens row update reflecting BEHAVIORAL COMPLETE; cite this PR's # as the receipt. ## STOP / PING criteria -- **STOP** if Indirect-call coverage is structurally required for the chosen representative-source asymptotic classifications — surface to Mgr for sequencing coordination with eager-bat-178 Slice 5+ work. -- **STOP** if `SymbolicCost` precedent shape doesn't actually fit `ComplexityCost` (e.g., asymptotic-classification carrier needs structurally different shape than 7-variant). Surface to Mgr; may re-open canvas-tier scope question for carrier shape (Director Q2 was ratified contingent on precedent applying). -- **STOP** if lens widening reveals `Lens` generic at `lens.dag:70-77` needs carrier-shape refactor — that's β-extended DEFERRED to N=2 trigger per sibling canvas; do NOT absorb into this slice. -- **PING** Verification Mgr (#2075 / wise-bear-525) at PR-open time per Pattern-A executable-gate ratchet discipline (gate #79 transition from PROXY → COMPLETE). +- **STOP** if T-E-P-Producer-Broadening is not yet COMPLETE across all live call-site sub-classes — surface to Mgr; coordinate sequencing with eager-bat-178. +- **STOP** if any §§1.1–1.6 design spec doesn't map structurally onto substrate at HEAD (e.g., grammar gap beyond class-5; algebra primitive missing) — surface to Mgr for canvas-tier re-open. +- **STOP** if `Lens` generic carrier-shape refactor surfaces — β-extended DEFERRED to N=2 trigger; do NOT absorb. +- **PING** Verification Mgr (#2075 / wise-bear-525) at PR-open per Pattern-A executable-gate ratchet for #79 PROXY → COMPLETE transition. ## Worker pin -Fresh pool pin TBD (NOT eager-bat-178 per Director Q3 framing — different problem class than T-E-P P1 producer-broadening; NOT fierce-ram-21 — busy with cost-lens ε Slice 1a→1b chain). Mgr's call on which fresh-pool worker at dispatch time. +Fresh-pool pick at dispatch time (NOT eager-bat-178 per Director Q3 framing — different problem class than T-E-P producer-broadening, plus they own the prerequisite Slice 5+ work; NOT fierce-ram-21 — busy with cost-lens ε Slice 1a→1b chain). ## Cross-Mgr coordination -- **Verification Mgr (#2075)**: PING at PR-open per gate #79 PROXY → COMPLETE transition; ratchet authoring is Verification's standing concern. -- **Eager-bat-178**: cross-stream coordination if complexity-lens slice's worker finds Indirect-variant dependency surfaces during T-E-P P1 carrier consumption authoring. -- **#1950 downstream**: complexity-lens cementing test dispatch (separate brief) gates on this brief's substrate-completion landing + frozen v2-oracle snapshot capture (Q4 cross-Mgr ownership). +- **Verification Mgr (#2075)**: PR-open ping per Pattern-A executable-gate. +- **Eager-bat-178**: T-E-P P1 sequencing — this slice gates on Slice 5+ Indirect-variant land + any further sub-classes. +- **PB Manager (#2074)**: separate stream for v2-oracle snapshot capture (Q4 RATIFIED); not on this slice's critical path but on downstream cementing (#1950). +- **#1950 downstream**: complexity-lens cementing test gates on this slice's BEHAVIORAL COMPLETION + frozen v2-oracle snapshot. ## Auto-spawn caveat -Per Director's standing note + cache-staleness cluster ctrl#217: HOLD dispatch on this brief until auto-spawn fix lands per L-sized substrate-behavioral-completion threshold, OR Mgr-direct authoring if scope-cohering small-enough (this is L-sized; Mgr-direct is unlikely fit). Same-window-dispatch discipline applies post-canvas-merge. +L-sized substrate-behavioral-completion threshold; HOLD dispatch on this brief until auto-spawn fix lands per ctrl#217 + same-window-dispatch discipline applies post-canvas-merge (PR #2197) AND post-T-E-P P1 COMPLETE. -— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-08 per Director Q1/Q2/Q3 RATIFIED at gunb-ai/gunbc#828 #issuecomment-4402714255; sibling canvas at `docs/proposals/q-complexity-composition-layering-canvas.md` (RATIFIED via PR #2197). +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-08 per Director Q1/Q2/Q3 RATIFIED at gunb-ai/gunbc#828 #issuecomment-4402714255; **rewritten 2026-05-08 post-codex BLOCKING at #2199** to consume existing design authority `docs/design-complexity-lens-behavioral-completeness.md` verbatim (prior draft had three BLOCKING violations: missing-canvas reconciliation, optional-producer-coverage, stale-row receipt; all three addressed in this rewrite). Sibling canvas at `docs/proposals/q-complexity-composition-layering-canvas.md`. From 46304a19a7752497e1d3128790eadf6fbe3ae4ed Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 8 May 2026 03:56:46 +0000 Subject: [PATCH 46/50] =?UTF-8?q?docs(proposals):=20Q-PerfWithinBaseline?= =?UTF-8?q?=20canvas=20=E2=80=94=20DRAFT=20(canvas-tier=20P1=20procedure?= =?UTF-8?q?=20per=20Q6=20RATIFIED)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Director Q6 RATIFIED canvas-tier-required at gunb-ai/gunbc#828 c#4403163639 for PerfWithinBaseline TestPredicate variant authoring. Three substantive substrate-shape questions resolved: Q1 baseline shape: (a) literal-Int rejected as strict-mirror-of-CostBounded defeats semantic load; (b) DeclarationRef-to-stored-data composes LensOutputEquals + data X: SymbolicCost precedent at HEAD; (c) runtime- fixture-injection over-authors. Mgr lean (b). Q2 ComparisonOp composition: (i) reuse existing ComparisonOp via test- runner-side resolution matches LensOutputEquals path; (ii) new relative- op-set introduces parallel-representation debt. Mgr lean (i). Q3 baseline-storage scope: (α) in-scope slice authors example data; (β) out-of-scope variant-only slice + PB consumer authors baseline data matches existing layering. Mgr lean (β). Combined Mgr lean: Q1(b) + Q2(i) + Q3(β) — variant authored as compositional extension; baseline-storage is PB consumer-tier work. Cross-Mgr: PB Mgr #2138 worker (crisp-swift-433) holds dispatch on #2204 land; T-Tier3-Dissolution #2085 R-4 prereq encoded. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../q-perf-within-baseline-canvas.md | 169 ++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 docs/proposals/q-perf-within-baseline-canvas.md diff --git a/docs/proposals/q-perf-within-baseline-canvas.md b/docs/proposals/q-perf-within-baseline-canvas.md new file mode 100644 index 00000000000..cb6f08889b9 --- /dev/null +++ b/docs/proposals/q-perf-within-baseline-canvas.md @@ -0,0 +1,169 @@ +# Canvas — Q-PerfWithinBaseline (TestPredicate variant substrate-shape question) + +**Authority**: Director Q6 RATIFIED canvas-tier required at gunb-ai/gunbc#828 #issuecomment-4403163639 — substrate-fact-introduction with three substantive unresolved axes; canvas-tier P1 procedure applies per `feedback_substrate_principle_audit`. + +**Status**: **canvas — DRAFT 2026-05-08**; PROPOSAL maturation pending Director ratification of options. + +**Sub-issue**: gunb-ai/gunbc#2204 (Substrate T-Tier3 PerfWithinBaseline TestPredicate variant); cross-routed from PB Mgr #2074 c#4403061394 for T-Tier3-Dissolution lane #2085 Phase-2 R-4 prereq. + +## What this canvas resolves + +**Three substantive substrate-shape questions** (per Director's Q6 ratification framing): + +1. **What "baseline" IS**: literal-Int / DeclarationRef-to-stored-data / runtime-fixture-injection / new substrate type? +2. **ComparisonOp composition**: existing `ComparisonOp` shape vs new relative-comparison op-set? +3. **Baseline-storage substrate scope**: where does the baseline value live? + +## Substrate-grep grounding (HEAD: `src/v3/std/verification.dag`) + +Existing `TestPredicate` variants relevant to factoring claim: + +``` +type TestPredicate + = ... + | CostBounded { // line 125+: absolute-bound perf check + bind_name: String + comparator: ComparisonOp + bound: Int // ← literal-Int absolute + } + | LensOutputEquals { // line 173+: stored-reference comparison + lens_ref: DeclarationRef + input_ref: DeclarationRef + expected_ref: DeclarationRef // ← reference to `data X: SymbolicCost = ...` + } + | OracleEquals { // line 181+: oracle-keyed comparison + subject_ref: DeclarationRef + oracle_ref: DeclarationRef + input_ref: DeclarationRef + } + | ... +``` + +**Precedent finding**: `DeclarationRef`-to-stored-`data X: SymbolicCost` is **already-substrate** at HEAD (per `LensOutputEquals.expected_ref` + the comment at line 190 citing the pattern). Stored-cost-reference via DeclarationRef is NOT novel substrate; it composes existing patterns. + +`ComparisonOp` is imported from `v3.std.substrate` at line 21; the type definition is upstream. `CostBounded.comparator` consumes it for literal-Int comparison; the composition surface for stored-reference comparison is the open question. + +## Q1 — What "baseline" IS + +### Option (a) — Literal-Int baseline (strict-dual of CostBounded) + +```dag +| PerfWithinBaseline { + bind_name: String + comparator: ComparisonOp + baseline: Int // literal absolute value + } +``` + +**Pro**: strict-mirror of `CostBounded`; `feedback_strict_mirror_vs_novel_substrate_fact` would apply at slice-tier-direct. +**Con**: defeats the purpose — "baseline" semantically implies stored/computed reference, not absolute literal. Rename of CostBounded with no new fact. Director Q6 ratified canvas-tier-required because this option doesn't carry the load-bearing semantics; rejecting (a). + +### Option (b) — DeclarationRef-to-stored-data baseline (compositional, existing precedent) + +```dag +| PerfWithinBaseline { + subject: DeclarationRef // bind to be measured + comparator: ComparisonOp + baseline_ref: DeclarationRef // reference to `data baseline_X: SymbolicCost = ...` + } +``` + +**Pro**: composes existing precedent at HEAD (`LensOutputEquals.expected_ref` + `data X: SymbolicCost = ...` form already substrate); single-authority discipline preserved. Baseline value lives in a substrate `data` declaration; predicate references it. Cross-target stable per `feedback_construction_over_ratchets`. +**Con**: requires a `data` declaration per baseline (one-baseline-per-test program); may proliferate boilerplate vs literal form. Mitigated by reusable baseline declarations across multiple PerfWithinBaseline call-sites. + +### Option (c) — Runtime-fixture-injection baseline (genuinely-novel substrate) + +```dag +| PerfWithinBaseline { + subject: DeclarationRef + comparator: ComparisonOp + baseline_fixture: FixtureKey // new substrate primitive + } +data FixtureKey = ... // new substrate type +``` + +**Pro**: allows runtime-injected baselines (e.g., per-test-environment values not declarable at substrate-time). +**Con**: introduces new substrate primitive (`FixtureKey`); breaks substrate-declared-form discipline; couples test-execution to runtime-config. P1 substrate-fact-introduction procedure required (DAG-ancestor / coproduct-vs-coordinate / primitive-vs-lens-extensible). Significantly higher cost than (b). + +**Mgr lean Q1**: **(b)** — composes existing precedent at HEAD; minimal substrate-fact delta; baseline-as-DeclarationRef-to-stored-data matches `LensOutputEquals` pattern. (a) defeats semantic load; (c) is over-authoring for the present need. + +## Q2 — ComparisonOp composition + +Existing `ComparisonOp` (per `v3.std.substrate` import) operates on literal-typed comparand pairs. Question: does it compose under (b)'s stored-reference shape? + +### Option (i) — Reuse existing ComparisonOp (compositional) + +`PerfWithinBaseline.comparator: ComparisonOp` operates on `cost_of(subject) ⟨op⟩ value_of(baseline_ref)`. Both sides resolve to `SymbolicCost` (or projected `Int` per asymptotic-class extraction); existing `ComparisonOp` semantics apply. Test-runner injects the resolution. + +**Pro**: zero new substrate; composes existing op-set. Single-authority discipline. +**Con**: requires test-runner to resolve `baseline_ref` to a comparable value before applying ComparisonOp; the resolution path needs to exist already (likely does per `LensOutputEquals` + `data X: SymbolicCost` consumption in test_runner per `test_runner.rs:2451` cite). + +### Option (ii) — New relative-comparison op-set (novel) + +Introduce `RelativeComparisonOp` parallel to `ComparisonOp`: +```dag +type RelativeComparisonOp = WithinTolerance(Float) | StrictlyBetter | StrictlyWorse | ... +``` + +**Pro**: explicit semantics for tolerance-bounded relative comparison. +**Con**: parallel-representation debt vs `ComparisonOp`; introduces `Float` substrate (new); P1 procedure required. Higher cost; not justified by present need. + +**Mgr lean Q2**: **(i)** — reuse existing ComparisonOp; test-runner-side resolution of baseline_ref is the natural composition (matches `LensOutputEquals` resolution path). + +## Q3 — Baseline-storage substrate scope + +Under (b) + (i), baseline value lives in a substrate `data X: SymbolicCost = ...` declaration referenced via `DeclarationRef`. Question: is the baseline-storage in-scope for #2204 slice or a separate sub-issue? + +### Option (α) — In-scope: slice authors example baseline data + uses it + +#2204 slice authors a representative `data baseline_example: SymbolicCost = ...` plus the `PerfWithinBaseline` variant; downstream consumers (PB #2138) reuse the pattern + author their own baseline data declarations as needed. + +**Pro**: same-slice acceptance; slice ships with working example. +**Con**: scope-creep risk; example baseline may not match production baseline storage shape needed by PB consumer. + +### Option (β) — Out-of-scope: variant-only slice; baseline-storage in PB consumer slice + +#2204 slice authors only the `PerfWithinBaseline` variant; baseline-storage authoring is downstream PB consumer work. PB #2138 adds the `data baseline_X: SymbolicCost = ...` declarations they need + references them via the new variant. + +**Pro**: clean scope boundary; substrate-introduces-the-shape; consumer-introduces-the-data. Matches single-authority discipline (substrate doesn't author test-specific data). +**Con**: slice can't fully demonstrate without consumer data; cementing test deferred to PB consumer. + +**Mgr lean Q3**: **(β)** — variant-only substrate slice; baseline-storage data declarations are PB consumer-tier authoring. Matches the layering at HEAD (`LensOutputEquals` is substrate-tier; `data X: SymbolicCost` declarations are consumer-tier-authored). + +## Combined Mgr lean + +**Q1 (b) + Q2 (i) + Q3 (β)**: PerfWithinBaseline variant authored as compositional extension over existing `DeclarationRef` + `ComparisonOp` substrate; baseline-storage is PB consumer-tier work; #2204 slice scope is variant-only. + +```dag +// proposed addition to TestPredicate at src/v3/std/verification.dag +| PerfWithinBaseline { + subject: DeclarationRef + comparator: ComparisonOp + baseline_ref: DeclarationRef + } +``` + +This is **canvas-tier-then-slice-tier**: canvas ratifies the (b)+(i)+(β) shape; slice authors the variant verbatim per ratified shape; PB consumer authors baseline data declarations downstream. + +## Director ratification ask + +1. **Q1**: ratify (b) DeclarationRef-to-stored-data baseline (composes existing `LensOutputEquals` precedent)? +2. **Q2**: ratify (i) reuse existing ComparisonOp (test-runner-side resolution per `LensOutputEquals` path)? +3. **Q3**: ratify (β) variant-only slice scope (baseline-storage to PB consumer)? +4. **Q3-followup**: if (β), confirm slice cementing-test acceptance gates either (a) include trivial baseline data declaration in slice OR (b) defer cementing to PB consumer slice landing? + +**Mgr lean**: Q1 (b), Q2 (i), Q3 (β), Q3-followup (a) — slice includes trivial baseline data for cementing receipt; PB consumer authors production baselines. Maintains slice self-testing per `TESTING.md` + matches Q4 PB cross-Mgr ownership boundary. + +## Cross-Mgr coordination + +- **PB Mgr (#2074)**: T-Tier3-Dissolution #2085 Phase-2 R-4 prereq is #2204; PB has authored `Depends on: #2204` against #2085. Ratification disposition shapes PB's #2138 worker brief authoring (which baseline data declarations they author + reference). +- **Verification Mgr (#2075)**: PerfWithinBaseline ratchet authoring at PR-open per Pattern-A executable-gate; cross-Mgr PING when slice opens. + +## Framework discipline anchors + +- **`feedback_strict_mirror_vs_novel_substrate_fact`**: (a) literal-Int baseline would have been strict-mirror; rejected because semantic load doesn't transfer. Director ratified canvas-tier-required; Mgr's preferred (b) composes existing precedent without introducing new fact. +- **`feedback_construction_over_ratchets`**: (b) composes `LensOutputEquals` + `data X: SymbolicCost` precedent at HEAD; structural truth from substrate-grep drives the choice. +- **`feedback_substrate_grep_before_authoring`**: substrate-grep findings (DeclarationRef + data declaration precedent) load-bearing for option-disambiguation. +- **`feedback_substrate_principle_audit`**: P1 procedure applied; DAG-ancestor (TestPredicate sum), coproduct-vs-coordinate (sum variant; not coordinate), primitive-vs-lens-extensible (substrate primitive; not lens-extensible) all resolved. + +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-08 per Director Q6 RATIFIED canvas-tier-required at gunb-ai/gunbc#828 #issuecomment-4403163639. Sibling sub-issue at gunb-ai/gunbc#2204; cross-routed from PB Mgr ask at #2074 c#4403061394. From aab11236d86618afb97bf3d524ad11e40e927515 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 8 May 2026 04:12:47 +0000 Subject: [PATCH 47/50] docs(proposals): Q-PerfWithinBaseline canvas REVISED (supersedes wrong-shape original) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Director disposition at gunb-ai/gunbc#828 c#4403265220 authorized supersession after BLOCKING at PR #2209 c#4403246233 verified VALID: original canvas conflated symbolic SymbolicCost (cost-lens substrate) with wall-clock measured median/p99 baseline (T-Tier3 perf gate substrate per docs/r3-structure.md:225 + :461 Director-locked 2026-04-28). Revised canvas frames as two-path ratification: - P1 author full perf-budget substrate in-R3 (multi-slice; pattern-5 genuinely-novel substrate-fact-introduction) - P2 explicitly post-R3 per Director-locked recommendation (zero in-R3 effort; structural close per r3-structure.md:461 'R3 deliverable is structural close; perf is downstream') Mgr lean: P2 — Director-locked recommendation explicit; trigger- condition ('someone authors perf-budget claim with concrete numbers and tooling') not met; R3 horizon constraint argues against multi- slice perf-budget substrate adding to 5-orthogonal-dependency picture. Original canvas at q-perf-within-baseline-canvas.md retained with SUPERSEDED-BY header per durable-decision-record discipline. 5th discipline-failure of 2026-05-08 cycle: substrate-grep verified substrate-precedent but missed consumer-side requirement at canonical authority doc; Director self-flagged symmetric two-axis verification gap; canvas-finding-taxonomy needs precondition 'consumer-side requirement grep-verified at canonical authority doc'. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../q-perf-within-baseline-canvas-revised.md | 95 +++++++++++++++++++ .../q-perf-within-baseline-canvas.md | 8 +- 2 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 docs/proposals/q-perf-within-baseline-canvas-revised.md diff --git a/docs/proposals/q-perf-within-baseline-canvas-revised.md b/docs/proposals/q-perf-within-baseline-canvas-revised.md new file mode 100644 index 00000000000..09fbea2ae48 --- /dev/null +++ b/docs/proposals/q-perf-within-baseline-canvas-revised.md @@ -0,0 +1,95 @@ +# Canvas — Q-PerfWithinBaseline (REVISED — supersedes wrong-shape original) + +**Authority**: Director disposition at gunb-ai/gunbc#828 #issuecomment-4403265220 — supersession authorized after BLOCKING at PR #2209 c#4403246233 verified VALID. Original canvas at `docs/proposals/q-perf-within-baseline-canvas.md` (merged via PR #2209) is **SUPERSEDED-BY this revised canvas**; original retained as historical record per durable-decision-record discipline. + +**Status**: **canvas — DRAFT 2026-05-08 (REVISED)**; PROPOSAL maturation pending Director path-call ratification. + +**Sub-issue**: gunb-ai/gunbc#2204 (Substrate T-Tier3 PerfWithinBaseline TestPredicate variant); cross-routed from PB Mgr #2074 c#4403061394. + +## What this canvas resolves + +Original canvas conflated **symbolic SymbolicCost** (cost-lens substrate) with **wall-clock measured median/p99 baseline** (T-Tier3 perf gate substrate) — two distinct fact-shapes. The Mgr lean Q1(b) `baseline_ref: DeclarationRef → data baseline_X: SymbolicCost` addressed substrate-precedent (`LensOutputEquals` pattern) but missed the consumer-side requirement. + +**Substrate-grep at canonical authority** (`docs/r3-structure.md:225` + `:461`): + +> **C1 — Tier-3 mirror dissolution perf budget** sub-gate of T-Tier3-Dissolution: `tier3_mirror_dissolution_perf_within_budget` with thresholds **≤2× median, ≤5× p99**. + +> **DECISION (Director-locked 2026-04-28):** Either measurable as a `.dag` TestClaim (`tier3_mirror_dissolution_perf_within_budget` with explicit numeric threshold) OR explicitly post-R3 with no in-R3 perf gate. ... Recommended path: **explicitly post-R3** unless someone authors the perf-budget claim with concrete numbers and tooling. R3 deliverable is structural close; perf is downstream. + +The gate measures **wall-clock perf at runtime** with ratio thresholds — a different substrate axis from substrate-time `data X: SymbolicCost` declarations. + +## The strategic question (revised Q1) + +Per Director-locked 2026-04-28 (`r3-structure.md:461`), there are TWO paths for T-Tier3 perf budget: + +### Path P1 — Author full perf-budget substrate IN-R3 + +**Scope**: introduce wall-clock-measurement carrier as new substrate-fact (genuinely-novel; canvas-finding taxonomy pattern 5): + +- New substrate type `PerfBaselineMeasurement { median_ns: Int, p99_ns: Int }` (or analogous) +- Runtime-resolution path for measurement (where do measured values come from? fixture-storage? captured-at-test-runner-time? CI-collected baseline?) +- Ratio-comparison op composition (\`≤2× median\` is real-number ratio; existing `ComparisonOp` may not compose; possibly new `RatioComparisonOp`) +- Multi-slice authoring (carrier introduction + runtime-resolution + comparison-op + cementing fixture + integration with T-Tier3 dispatch) + +**Cycle cost**: multi-slice in-R3 effort; substantial substrate-fact-introduction not previously budgeted in R3 plan; uncertain whether achievable in R3 horizon given current 5-orthogonal-dependency picture for T-LBP cementing close. + +**Pro**: keeps T-Tier3 R-4 perf gate in R3 closure surface; structural completeness. +**Con**: multi-slice substantial scope; risks slipping R3 close; Director-locked recommendation explicitly leans against this path absent concrete tooling/numbers authorship. + +### Path P2 — Explicitly post-R3 (Director-locked 2026-04-28 RECOMMENDED PATH) + +**Scope**: explicitly defer perf-budget claim to post-R3; in-R3 deliverable for T-Tier3 is **structural close only** (mirror retirement; consumer count → 0; SG-0 delta reported per `r3-structure.md:196` lane row). T-Tier3 R-4 perf gate is post-R3-carved per Director-locked decision. + +**Concrete actions if P2 ratifies**: +1. **Close #2204 sub-issue as superseded-by-deferral** — `PerfWithinBaseline` TestPredicate variant authoring is post-R3 work, not in-R3 substrate. +2. **Notify PB Mgr (#2074)** that #2138 worker dispatch chain is post-R3 per Director-locked deferral; PB R-4 prereq for #2085 dissolves to "post-R3" status (R-4 is not an R3-load-bearing gate per the explicit `r3-structure.md:461` framing). +3. **Update §10.3 capability-register row** for Q-PerfWithinBaseline canvas: SUPERSEDED-by-revised + revised disposition POST-R3-DEFERRED. +4. **Preserve original canvas as historical record** with SUPERSEDED-BY header pointing to this revised canvas. + +**Cycle cost**: zero in-R3 substrate effort; T-Tier3 lane closes structurally; perf substrate is genuinely-post-R3 work. + +**Pro**: matches Director-locked 2026-04-28 recommended path; respects R3 horizon; structural close = R3 deliverable per `r3-structure.md:461` ("R3 deliverable is structural close; perf is downstream"). +**Con**: cross-Mgr signal: PB needs to absorb #2138 worker dispatch deferral; may surface R3-close-shape question if T-Tier3 lane has implicit perf-gate expectations from other consumers. + +## Mgr lean + +**P2 RECOMMENDED** per Director-locked 2026-04-28 explicit recommendation at `r3-structure.md:461`. Reasoning: + +1. **Director-locked recommendation explicit**: "explicitly post-R3 unless someone authors the perf-budget claim with concrete numbers and tooling". No one has authored concrete numbers/tooling; the path-trigger condition for P1 is not met. +2. **R3 horizon constraint**: 5-orthogonal-dependency picture for T-LBP cementing close already busy; adding multi-slice perf-budget substrate authoring risks R3 slip. +3. **Structural close discipline**: T-Tier3 lane row at `r3-structure.md:196` says "consumer count / mirror-symbol count reaches zero" — that's the structural close criterion; perf is auxiliary. +4. **Cross-Mgr signal clean**: PB Mgr's #2138 dispatch absorbs the deferral cleanly under Q4-style cross-Mgr ownership routing. + +## Director ratification ask + +**Path call**: ratify **P1** (author full perf-budget substrate in-R3) OR **P2** (explicitly post-R3 per Director-locked recommendation)? + +**Mgr lean: P2** per reasoning above. + +If P2 ratifies: +- Close #2204 as superseded-by-deferral +- Notify PB Mgr (#2074) for #2138 dispatch chain disposition +- Update §10.3 capability-register row + r3-program-plan §10.3 row for T-Tier3 R-4 explicit-post-R3 status +- Original canvas at `docs/proposals/q-perf-within-baseline-canvas.md` retained with SUPERSEDED-BY header + +If P1 ratifies: +- Reset canvas-tier P1 procedure (DAG-ancestor / coproduct-vs-coordinate / primitive-vs-lens-extensible) on `PerfBaselineMeasurement` carrier +- Multi-slice authoring sequence +- Substrate-shape canvas extension on runtime-resolution path + +## History (auto-merge race + cycle-tier discipline) + +**Auto-merge race**: original canvas merged at 04:02:35Z; codex BLOCKING surfaced at 04:02:43Z (~8s window). Director's disposition at c#4403265220 declined sit-window patch per `feedback_construction_over_ratchets` — structural fix is grep-verify-consumer-side at canonical authority doc, not process-discipline-patch. + +**Two-axis verification discipline gap** (Director-tier self-flag at c#4403265220): canvas authoring + ratification both verified substrate-precedent (`LensOutputEquals` pattern) but neither verified consumer-side requirement (`r3-structure.md:225` + `:461` gate semantics). Memorialized as 5-row canvas-finding-pattern triage **precondition**: triage applies ONLY when consumer-side requirement is grep-verified at canonical authority doc. + +**Cycle position**: 5th discipline-failure in 2026-05-08 audit cycle (after complexity-lens brief BLOCKING, Slice 5 dispatch substrate-gap, ε-path tier-disambiguation, Q5 strict-mirror triage, Q6 substrate-precedent-without-consumer-side). Pattern: substrate-grep discipline at canonical authority doc has multiple pitfalls; triage taxonomy refines per cycle's findings. + +## Framework discipline anchors + +- **`feedback_substrate_grep_before_authoring`**: violated at canvas-authoring layer (consumer-side grep missed); discipline-anchor surfaces from this BLOCKING + revision. +- **`feedback_canvas_finding_taxonomy`**: 5-row table needs precondition "consumer-side requirement grep-verified at canonical authority doc" per Director's c#4403265220 refinement. +- **`feedback_construction_over_ratchets`**: structural fix (grep discipline) > process-discipline-patch (sit-window); ratify via P2 per Director-locked recommendation. +- **`feedback_dispatch_dont_preask_symmetric`**: Director's two-axis verification gap symmetric to my prior cycle violations; cross-tier discipline. + +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-08 per Director disposition at gunb-ai/gunbc#828 #issuecomment-4403265220. Supersedes `docs/proposals/q-perf-within-baseline-canvas.md` (merged via PR #2209; retained as historical record). diff --git a/docs/proposals/q-perf-within-baseline-canvas.md b/docs/proposals/q-perf-within-baseline-canvas.md index cb6f08889b9..be850ba9114 100644 --- a/docs/proposals/q-perf-within-baseline-canvas.md +++ b/docs/proposals/q-perf-within-baseline-canvas.md @@ -1,6 +1,10 @@ -# Canvas — Q-PerfWithinBaseline (TestPredicate variant substrate-shape question) +# Canvas — Q-PerfWithinBaseline (TestPredicate variant substrate-shape question) — **SUPERSEDED** -**Authority**: Director Q6 RATIFIED canvas-tier required at gunb-ai/gunbc#828 #issuecomment-4403163639 — substrate-fact-introduction with three substantive unresolved axes; canvas-tier P1 procedure applies per `feedback_substrate_principle_audit`. +**SUPERSEDED-BY** [`q-perf-within-baseline-canvas-revised.md`](q-perf-within-baseline-canvas-revised.md) per Director disposition at gunb-ai/gunbc#828 #issuecomment-4403265220 (2026-05-08). This canvas was authored against substrate-precedent (`LensOutputEquals` symbolic-cost pattern) but missed consumer-side requirement at `docs/r3-structure.md:225` + `:461` (T-Tier3 perf gate is wall-clock measured median/p99, not symbolic cost). Q1(b)+Q2(i)+Q3(β) ratification at #828 c#4403208482 is **invalid as authored**; revised canvas supersedes with correct two-path framing (P1 in-R3 perf-budget substrate vs P2 explicitly post-R3 per Director-locked 2026-04-28 recommendation). Retained as historical record per durable-decision-record discipline. + +--- + +**Authority** (original): Director Q6 RATIFIED canvas-tier required at gunb-ai/gunbc#828 #issuecomment-4403163639 — substrate-fact-introduction with three substantive unresolved axes; canvas-tier P1 procedure applies per `feedback_substrate_principle_audit`. **Status**: **canvas — DRAFT 2026-05-08**; PROPOSAL maturation pending Director ratification of options. From 14afafc365355438d7b4be6333fa5b85001d0f91 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 8 May 2026 04:19:43 +0000 Subject: [PATCH 48/50] =?UTF-8?q?docs(proposals):=20Q-PerfWithinBaseline?= =?UTF-8?q?=20canvas-revised=20=E2=80=94=20correct=20trigger-condition=20f?= =?UTF-8?q?raming=20per=20Director=20c#4403297623?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Director caught second-axis grep failure on revised canvas: my P2 reasoning #1 ("path-trigger condition for P1 is not met") was structurally wrong. Existing tooling at HEAD substantially meets the Director-locked 2026-04-28 trigger-condition ("someone authors the perf-budget claim with concrete numbers and tooling"): - docs/briefs/r3-pb-tier3-perf-budget-worker.md - docs/audit/c1-tier3-perf-budget-readiness-matrix.md - src/v3/compiler/benches/tier3_mirror_perf.rs - docs/audit/c1-tier3-baseline-capture-procedure.md - docs/audit/c1-r3-canonical-bench-host-decision-matrix.md Plus thresholds (≤2× median, ≤5× p99) + capture discipline (N=3 min, N=5 preferred) + canonical bench host option matrix. P1 is bridging existing tooling to substrate (compositional-extension), NOT multi-slice greenfield genuinely-novel pattern-5 as originally framed. Smaller scope than canvas-finding-taxonomy pattern 5 implies. Path-call genuinely depends on PB Mgr's R-3 (canonical CI bench host) + R-7 (tier3_baseline.json baseline-capture path) decisions per their audit response at c#4403059897. Path-call DEFERRED to cross-Mgr coordination outcome with PB Mgr (#2074); Substrate Mgr surfaces with corrected framing this turn. Sixth discipline-failure of cycle (mine, second-axis grep gap on existing-tooling state); same-class as Director's first-axis grep gap on consumer-side requirement at the prior turn. Memorialized as two-axis verification discipline anchor. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../q-perf-within-baseline-canvas-revised.md | 41 +++++++++++++++---- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/docs/proposals/q-perf-within-baseline-canvas-revised.md b/docs/proposals/q-perf-within-baseline-canvas-revised.md index 09fbea2ae48..ecccf6523ba 100644 --- a/docs/proposals/q-perf-within-baseline-canvas-revised.md +++ b/docs/proposals/q-perf-within-baseline-canvas-revised.md @@ -51,20 +51,43 @@ Per Director-locked 2026-04-28 (`r3-structure.md:461`), there are TWO paths for **Pro**: matches Director-locked 2026-04-28 recommended path; respects R3 horizon; structural close = R3 deliverable per `r3-structure.md:461` ("R3 deliverable is structural close; perf is downstream"). **Con**: cross-Mgr signal: PB needs to absorb #2138 worker dispatch deferral; may surface R3-close-shape question if T-Tier3 lane has implicit perf-gate expectations from other consumers. -## Mgr lean +## Trigger-condition state at HEAD (CORRECTED 2026-05-08 per Director c#4403297623) -**P2 RECOMMENDED** per Director-locked 2026-04-28 explicit recommendation at `r3-structure.md:461`. Reasoning: +Director-locked recommendation at `r3-structure.md:461` reads: *"explicitly post-R3 unless someone authors the perf-budget claim with concrete numbers and tooling."* My initial supersession-canvas Mgr-lean reasoning #1 ("path-trigger condition for P1 is not met") was **structurally wrong** per Director's grep at c#4403297623. Existing tooling at HEAD substantially meets the trigger: -1. **Director-locked recommendation explicit**: "explicitly post-R3 unless someone authors the perf-budget claim with concrete numbers and tooling". No one has authored concrete numbers/tooling; the path-trigger condition for P1 is not met. -2. **R3 horizon constraint**: 5-orthogonal-dependency picture for T-LBP cementing close already busy; adding multi-slice perf-budget substrate authoring risks R3 slip. -3. **Structural close discipline**: T-Tier3 lane row at `r3-structure.md:196` says "consumer count / mirror-symbol count reaches zero" — that's the structural close criterion; perf is auxiliary. -4. **Cross-Mgr signal clean**: PB Mgr's #2138 dispatch absorbs the deferral cleanly under Q4-style cross-Mgr ownership routing. +| Artifact | Path | Status | +|---|---|---| +| Perf-budget worker brief | `docs/briefs/r3-pb-tier3-perf-budget-worker.md` | landed | +| Readiness matrix | `docs/audit/c1-tier3-perf-budget-readiness-matrix.md` | landed | +| Bench harness | `src/v3/compiler/benches/tier3_mirror_perf.rs` | merged | +| Baseline capture procedure | `docs/audit/c1-tier3-baseline-capture-procedure.md` | landed | +| Canonical bench host decision matrix | `docs/audit/c1-r3-canonical-bench-host-decision-matrix.md` | landed | -## Director ratification ask +Plus concrete thresholds explicit (≤2× median, ≤5× p99); multi-run capture discipline authored (N=3 minimum, N=5 preferred); option matrix for canonical bench host. **Trigger-condition is effectively met.** P1 (in-R3 substrate authoring) is bridging existing tooling to substrate — NOT multi-slice greenfield as I originally framed. Smaller scope than canvas-finding-pattern 5 ("genuinely-novel substrate-fact-introduction") implies; closer to compositional-extension over existing tooling-substrate boundary. -**Path call**: ratify **P1** (author full perf-budget substrate in-R3) OR **P2** (explicitly post-R3 per Director-locked recommendation)? +## Mgr lean (REVISED — path-call deferred to PB Mgr cross-Mgr coordination) -**Mgr lean: P2** per reasoning above. +Per Director disposition at c#4403297623, **path-call is NOT Substrate-Mgr-leanable as a free-standing call** — it depends on PB Mgr's load-bearing R-3 (canonical CI bench host) + R-7 (`tier3_baseline.json` baseline-capture path) decisions. PB Mgr's audit response at #828 c#4403059897 surfaced both as pending. + +**Cross-Mgr coordination required**: +- If PB Mgr resolves R-3 + R-7 cleanly + chooses to author the in-R3 substrate-variant integration → **P1 is the natural path** +- If PB Mgr defers R-3/R-7 OR chooses a path that doesn't require the substrate-variant in R3 → **P2 is the natural path** + +**Cross-Mgr surface (this canvas's actionable next step)**: ping PB Mgr (#2074) asking for R-3/R-7 disposition + their lean on whether P1 in-R3 substrate-variant authoring fits in PB lane scope OR P2 defer is the right call. Path-call ratification follows PB Mgr's surface. + +**Substrate Mgr provisional lean (post-PB-cross-Mgr-coord)**: +- If PB Mgr leans P1: Substrate Mgr concurs (existing tooling + bridging to substrate is bounded scope; tooling-substrate-bridge does NOT trigger pattern-5 P1 procedure since carrier-shape composes existing tooling at HEAD). +- If PB Mgr leans P2: Substrate Mgr concurs (R3 horizon + structural-close priority are clean reasons; no longer rests on disproven trigger-condition framing). + +## Director ratification ask (REVISED) + +**Path call deferred to PB Mgr cross-Mgr coordination outcome**: + +1. Substrate Mgr surfaces to PB Mgr (#2074) with corrected trigger-condition framing + R-3/R-7 disposition ask + P1/P2 lean ask. +2. PB Mgr responds with R-3/R-7 disposition + their P1/P2 lean. +3. Director ratifies path-call based on cross-Mgr alignment between Substrate + PB Mgr leans. + +**Substrate Mgr commits to surface to PB this turn** with the corrected framing. If P2 ratifies: - Close #2204 as superseded-by-deferral From 6112120b13d908f22c4fb2b13de3153a35cf7ab8 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 8 May 2026 06:53:56 +0000 Subject: [PATCH 49/50] =?UTF-8?q?docs(proposals):=20Q-ValueBody-Drift-Reso?= =?UTF-8?q?lution=20canvas=20=E2=80=94=20DRAFT=20(codegen-generation=20lea?= =?UTF-8?q?n)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit D1 substrate-shape question per Q-ValueBody-Isomorphism RATIFIED at gunb-ai/gunbc#828 c#4403972737. Variant-inventory readiness input from PR #2218 (merged 2026-05-08) confirms drift: Rust 5 variants vs substrate 3 constructors; asymmetry on Scalar+List Rust-only + Map payload-parity-with-semantic-gap. Two-axis verification at HEAD: - Substrate-precedent: codegen tooling exists (regen_bootstrap_emit; 5 _generated.rs files; regen_bootstrap binary). Pattern-3 strict- mirror codegen extension applies; no pattern-5 P1 procedure. - Consumer-side requirement: V1 worker brief explicitly names mirror- parity-vs-codegen-generation as D1 path-pair. Mgr lean: (b) codegen-generation. Path (a) mirror-parity perpetuates parallel-representation debt; (b) dissolves the dual-taxonomy class by construction (substrate canonical, Rust codegens). Map dup-key gap handled via (ii) Rust-side post-codegen wrapping (substrate stays minimal). Director ratification ask: D1 (b) + D1-followup (ii). Carrier slice path post-ratification: extend regen_bootstrap_emit; add Scalar+List constructors to substrate; regen + remove hand-Rust enum; handle Map dup-key per ratified followup. Worker pin fresh-pool per same-window-dispatch. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../q-valuebody-drift-resolution-canvas.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 docs/proposals/q-valuebody-drift-resolution-canvas.md diff --git a/docs/proposals/q-valuebody-drift-resolution-canvas.md b/docs/proposals/q-valuebody-drift-resolution-canvas.md new file mode 100644 index 00000000000..bfe32202672 --- /dev/null +++ b/docs/proposals/q-valuebody-drift-resolution-canvas.md @@ -0,0 +1,95 @@ +# Canvas — Q-ValueBody-Drift-Resolution (substrate↔Rust mirror parity question) + +**Authority**: Q-ValueBody-Isomorphism RATIFIED (Director at gunb-ai/gunbc#828 #issuecomment-4403972737, 2026-05-08; Brian sanctioned IN-R3). D1 (mirror-parity-vs-codegen-generation choice) routed to Substrate Mgr per V1 worker brief §Dependencies. + +**Status**: **canvas — DRAFT 2026-05-08**; PROPOSAL maturation pending Director ratification on D1 path-call. + +**Sub-issue**: cross-Mgr — Verification Mgr V1 worker brief at `docs/briefs/r3-v-valuebody-substrate-mirror-isomorphism-v1-worker.md`; readiness input via PR #2218 merged 2026-05-08 (variant-inventory at `docs/r3/r3-v-valuebody-variant-inventory.md`). + +## Drift fact (per PR #2218 inventory at HEAD) + +**Rust live carrier** (`src/v3/compiler/src/dag.rs:436-504`): **5 variants** +- `Unparsed(SourceSpan)` — substrate parity ✓ +- `Structural { fields: Vec<(String, FieldValue)> }` — substrate parity ✓ +- `Scalar(LiteralBits)` — Rust-only +- `List(Vec)` — Rust-only +- `Map(FieldMap)` — payload-parity-with-semantic-gap (FieldMap dup-key invariant Rust-side; substrate `List` lacks the invariant) + +**Substrate** (`src/v3/std/substrate.dag:179-182`): **3 constructors** +- `ValueBodyUnparsed(SourceSpan)` ✓ +- `ValueBodyStructural { fields: List }` ✓ +- `ValueBodyMap(List)` ✓ (payload-parity; semantic-gap on dup-key) + +**Asymmetry**: Rust-only Scalar + List; substrate-Map weaker invariant than Rust FieldMap. + +## D1 — two path options + +### Path (a) — Mirror-parity (substrate adds constructors) + +Add `ValueBodyScalar(LiteralBits)` + `ValueBodyList(List)` to substrate; optionally add substrate-level dup-key invariant on Map. + +**Pro**: maintains explicit substrate authoring; no codegen tooling change. +**Con**: parallel-authority — two hand-edited authorities for the same algebraic surface; same drift class persists; future divergences trivially recur. Per `feedback_parallel_representation_debt`: this is the wrong tier of debt to absorb. + +### Path (b) — Codegen-generation (Rust derives from substrate canonical authority) + +Substrate is canonical; Rust enum codegens from substrate definition via existing precedent. + +**Substrate-grep at HEAD finds existing codegen tooling**: +- `src/v3/compiler/src/regen_bootstrap_emit.rs`: `render_bootstrap_generated_rs` + `render_bootstrap_std_generated_rs` exposed at `lib.rs:3277` — substrate→Rust emit pipeline at HEAD +- Generated files at HEAD: `bootstrap_generated.rs`, `dag_lookup_generated.rs`, `dag_scalar_generated.rs`, `diagnostics_generated.rs`, `parse_surface_generated.rs` — multiple precedents +- `regen_bootstrap` binary: `cargo run -p v3-compiler --features bootstrap-regen-fresh --bin regen_bootstrap` runs the substrate→Rust regen pipeline (used in PR #2194 1a.0 regen receipt) + +**Codegen precedent IS established at HEAD**. Extending the existing pipeline to cover the Rust-only `Scalar` + `List` variants (substrate adds them, codegen emits Rust enum from substrate) is **pattern-3 (strict-mirror codegen extension)**, NOT pattern-5 (genuinely novel substrate-fact-introduction). Per canvas-finding-taxonomy at `feedback_canvas_finding_taxonomy.md`: pattern-3 ratifies at slice-tier directly, no canvas-tier P1 procedure required. + +**Pro**: dissolves dual-taxonomy class entirely; substrate is canonical; future drift impossible by construction. Per `feedback_isomorphism_or_generation_for_mirrors` (Verification Mgr's referenced discipline): codegen-generation is the right shape for substrate↔Rust mirror surfaces. Per `feedback_parallel_representation_debt`: cost-of-change=1 (one authority, codegen-derived consumer). +**Con**: codegen extension is bounded engineering effort (not free); Map dup-key invariant gap still needs decision (substrate-level invariant or Rust-side post-codegen wrapping). + +## Mgr lean + +**Path (b) codegen-generation RECOMMENDED**: + +1. **Codegen precedent at HEAD verified** (5 `_generated.rs` files; `regen_bootstrap_emit` pipeline; binary in flight via PR #2194). Pattern-3 strict-mirror codegen extension; no canvas-tier P1 procedure needed. +2. **Single-authority discipline preserved** per `feedback_parallel_representation_debt`; substrate is canonical for the algebraic surface; Rust-side dissolves to codegen-derived consumer. +3. **Future-drift-impossible by construction**: future variant additions land substrate-side once; Rust regen propagates automatically. Dissolves the discipline-failure class that surfaced this canvas. +4. **Map dup-key semantic-gap** is a separate sub-question: either (i) substrate-level invariant on `List` Map (constructor-level uniqueness — would require new substrate primitive), or (ii) Rust-side post-codegen wrapping in FieldMap (preserves existing Rust invariant; substrate-side remains agnostic). Mgr lean (ii) — preserves Rust-side invariant; substrate-side stays minimal. + +## Director ratification ask + +1. **D1**: ratify (b) codegen-generation? (Mgr lean: yes — codegen precedent at HEAD; pattern-3 strict-mirror extension; dissolves drift class) +2. **D1-followup**: Map dup-key gap — (i) substrate-level invariant or (ii) Rust-side post-codegen wrapping? (Mgr lean: (ii) Rust-side wrapping; substrate stays minimal) + +## Two-axis verification (per `feedback_canvas_two_axis_verification`) + +**Axis 1 — substrate-precedent**: codegen tooling at HEAD verified at `regen_bootstrap_emit.rs` + 5 `_generated.rs` files. (b) extends established precedent. + +**Axis 2 — consumer-side requirement**: V1 worker brief at `docs/briefs/r3-v-valuebody-substrate-mirror-isomorphism-v1-worker.md` names "mirror parity vs codegen-generation" as the explicit D1 choice. Consumer-side framing matches the path-pair this canvas presents. PR #2218 inventory confirms the drift fact + path-pair structurally. + +Both axes grep-verified before authoring. + +## Carrier slice (post-D1 ratification) + +If (b) ratifies, downstream carrier slice: + +1. Extend `src/v3/compiler/src/regen_bootstrap_emit.rs` (or analog) to emit Rust `ValueBody` enum from substrate `ValueBody` type — pattern-3 codegen extension +2. Add `ValueBodyScalar(LiteralBits)` + `ValueBodyList(List)` constructors to `src/v3/std/substrate.dag` (substrate-canonical authoring) +3. Run `regen_bootstrap` to propagate; commit regenerated files +4. Remove hand-authored Rust `ValueBody` enum from `src/v3/compiler/src/dag.rs:436-504` +5. (Per D1-followup ratification) handle Map dup-key gap: either substrate-invariant or Rust-post-codegen-wrapping +6. zesty-moth-793 V1 worker (#2142) sequences Slice 2 (mirror-parity verification cementing test) post-carrier-slice land + +Worker pin for carrier slice: fresh-pool pick at dispatch time per same-window-dispatch discipline (post-ctrl#217 fix RESOLVED 2026-05-08). + +## Cross-Mgr coordination + +- **Verification Mgr (#2075 / wise-bear-525)**: V1 worker brief consumer; standing wait through D1 ratification + carrier slice land per their c#4404094879 sequencing posture. Surface receipt at carrier-slice PR-open. +- **PR #2218 readiness input** (variant inventory) merged 2026-05-08; concrete artifact pointer for canvas authoring. + +## Framework discipline anchors + +- **`feedback_canvas_finding_taxonomy`**: pattern-3 (strict-mirror codegen extension) per existing precedent; ratifies slice-tier-direct under canvas authority. +- **`feedback_canvas_two_axis_verification`**: both axes grep-verified at HEAD before authoring (substrate-precedent + consumer-side). +- **`feedback_parallel_representation_debt`**: (b) dissolves dual-taxonomy class; structurally cleaner per single-authority discipline. +- **`feedback_isomorphism_or_generation_for_mirrors`** (Verification Mgr's referenced discipline): codegen-generation matches the established shape. + +— Authored by warm-wolf-698 (Substrate Mgr) 2026-05-08 per Q-ValueBody-Isomorphism RATIFIED at gunb-ai/gunbc#828 #issuecomment-4403972737; D1 routed via V1 worker brief §Dependencies; readiness input from PR #2218 (variant-inventory) merged 2026-05-08. From 087fe8fed2404fa7e6267cac09ad603c4d49bf26 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Fri, 8 May 2026 07:16:55 +0000 Subject: [PATCH 50/50] docs(proposals): Q-ValueBody-Drift-Resolution canvas amend authority cite (codex BLOCKING fix) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Director ratified (α) amendment-PR at gunb-ai/gunbc#828 c#4404398425 post-codex-BLOCKING at PR #2222 c#4404360699. Canvas originally cited regen_bootstrap_emit.rs as codegen authority for ValueBody runtime mirror; corrected to scripts/regen_runtime_mirrors.py which is the substrate→Rust runtime-mirror generator (reads substrate.dag, emits dag_scalar_generated.rs etc.). regen_bootstrap_emit.rs is a separate codegen system that generates bootstrap_generated.rs (bootstrap parser/lower compile snapshot). D1 (b) codegen-generation ratification UNCHANGED; only authority-path cites corrected. Carrier slice path at canvas §6-step plan now references correct runtime-mirror generator. Canvas inline notes mark amendment location for future-reader audit trail. 8th cycle-tier framing-failure (Mgr-tier; same fine-granularity gap parallel to Director-tier failure at c#4404256128). Two-axis verification discipline applied at insufficient granularity (verified codegen-tooling- exists but didn't disambiguate against bootstrap-vs-runtime-mirror systems). Discipline anchor refinement: when canvas cites a codegen system / tooling / authority path, identify the SPECIFIC generator/handler for the target-file-class. Don't accept 'tooling exists' at coarse granularity. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../q-valuebody-drift-resolution-canvas.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/proposals/q-valuebody-drift-resolution-canvas.md b/docs/proposals/q-valuebody-drift-resolution-canvas.md index bfe32202672..e4cf4531f83 100644 --- a/docs/proposals/q-valuebody-drift-resolution-canvas.md +++ b/docs/proposals/q-valuebody-drift-resolution-canvas.md @@ -36,9 +36,9 @@ Add `ValueBodyScalar(LiteralBits)` + `ValueBodyList(List)` to substr Substrate is canonical; Rust enum codegens from substrate definition via existing precedent. **Substrate-grep at HEAD finds existing codegen tooling**: -- `src/v3/compiler/src/regen_bootstrap_emit.rs`: `render_bootstrap_generated_rs` + `render_bootstrap_std_generated_rs` exposed at `lib.rs:3277` — substrate→Rust emit pipeline at HEAD -- Generated files at HEAD: `bootstrap_generated.rs`, `dag_lookup_generated.rs`, `dag_scalar_generated.rs`, `diagnostics_generated.rs`, `parse_surface_generated.rs` — multiple precedents -- `regen_bootstrap` binary: `cargo run -p v3-compiler --features bootstrap-regen-fresh --bin regen_bootstrap` runs the substrate→Rust regen pipeline (used in PR #2194 1a.0 regen receipt) +- **`scripts/regen_runtime_mirrors.py`** (CORRECTED 2026-05-08 post-codex BLOCKING at PR #2222 c#4404360699): substrate→Rust **runtime-mirror** generator; reads `src/v3/std/substrate.dag` (script line 16); emits `src/v3/compiler/src/dag_scalar_generated.rs` + similar runtime mirrors (script line 984+). **This is the correct authority path for ValueBody enum codegen** — the `ValueBody` Rust enum is a runtime mirror of substrate `ValueBody`, not a bootstrap snapshot. +- `regen_bootstrap_emit.rs` + `bin/regen_bootstrap` is a **separate codegen system** that generates `bootstrap_generated.rs` (bootstrap parser/lower compile snapshot; used in PR #2194 1a.0 regen). Not the right path for runtime-mirror codegen. +- Generated files at HEAD (mixed across both systems): `bootstrap_generated.rs` (bootstrap-emit), `dag_lookup_generated.rs` + `dag_scalar_generated.rs` + `diagnostics_generated.rs` + `parse_surface_generated.rs` (runtime-mirrors per `regen_runtime_mirrors.py`). **Codegen precedent IS established at HEAD**. Extending the existing pipeline to cover the Rust-only `Scalar` + `List` variants (substrate adds them, codegen emits Rust enum from substrate) is **pattern-3 (strict-mirror codegen extension)**, NOT pattern-5 (genuinely novel substrate-fact-introduction). Per canvas-finding-taxonomy at `feedback_canvas_finding_taxonomy.md`: pattern-3 ratifies at slice-tier directly, no canvas-tier P1 procedure required. @@ -49,7 +49,7 @@ Substrate is canonical; Rust enum codegens from substrate definition via existin **Path (b) codegen-generation RECOMMENDED**: -1. **Codegen precedent at HEAD verified** (5 `_generated.rs` files; `regen_bootstrap_emit` pipeline; binary in flight via PR #2194). Pattern-3 strict-mirror codegen extension; no canvas-tier P1 procedure needed. +1. **Codegen precedent at HEAD verified** (5 `_generated.rs` files; `scripts/regen_runtime_mirrors.py` substrate→Rust runtime-mirror pipeline). Pattern-3 strict-mirror codegen extension; no canvas-tier P1 procedure needed. 2. **Single-authority discipline preserved** per `feedback_parallel_representation_debt`; substrate is canonical for the algebraic surface; Rust-side dissolves to codegen-derived consumer. 3. **Future-drift-impossible by construction**: future variant additions land substrate-side once; Rust regen propagates automatically. Dissolves the discipline-failure class that surfaced this canvas. 4. **Map dup-key semantic-gap** is a separate sub-question: either (i) substrate-level invariant on `List` Map (constructor-level uniqueness — would require new substrate primitive), or (ii) Rust-side post-codegen wrapping in FieldMap (preserves existing Rust invariant; substrate-side remains agnostic). Mgr lean (ii) — preserves Rust-side invariant; substrate-side stays minimal. @@ -61,7 +61,7 @@ Substrate is canonical; Rust enum codegens from substrate definition via existin ## Two-axis verification (per `feedback_canvas_two_axis_verification`) -**Axis 1 — substrate-precedent**: codegen tooling at HEAD verified at `regen_bootstrap_emit.rs` + 5 `_generated.rs` files. (b) extends established precedent. +**Axis 1 — substrate-precedent**: codegen tooling at HEAD verified at `scripts/regen_runtime_mirrors.py` (substrate→Rust runtime-mirror generator) + 5 `_generated.rs` files. (b) extends established precedent. (Originally cited `regen_bootstrap_emit.rs` — corrected 2026-05-08 per codex BLOCKING; bootstrap-emit and runtime-mirror are separate codegen systems.) **Axis 2 — consumer-side requirement**: V1 worker brief at `docs/briefs/r3-v-valuebody-substrate-mirror-isomorphism-v1-worker.md` names "mirror parity vs codegen-generation" as the explicit D1 choice. Consumer-side framing matches the path-pair this canvas presents. PR #2218 inventory confirms the drift fact + path-pair structurally. @@ -71,9 +71,9 @@ Both axes grep-verified before authoring. If (b) ratifies, downstream carrier slice: -1. Extend `src/v3/compiler/src/regen_bootstrap_emit.rs` (or analog) to emit Rust `ValueBody` enum from substrate `ValueBody` type — pattern-3 codegen extension +1. Extend `scripts/regen_runtime_mirrors.py` to emit Rust `ValueBody` enum from substrate `ValueBody` type — pattern-3 codegen extension on the runtime-mirror generator 2. Add `ValueBodyScalar(LiteralBits)` + `ValueBodyList(List)` constructors to `src/v3/std/substrate.dag` (substrate-canonical authoring) -3. Run `regen_bootstrap` to propagate; commit regenerated files +3. Run `scripts/regen_runtime_mirrors.py` to propagate; commit regenerated files 4. Remove hand-authored Rust `ValueBody` enum from `src/v3/compiler/src/dag.rs:436-504` 5. (Per D1-followup ratification) handle Map dup-key gap: either substrate-invariant or Rust-post-codegen-wrapping 6. zesty-moth-793 V1 worker (#2142) sequences Slice 2 (mirror-parity verification cementing test) post-carrier-slice land