Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 67 additions & 1 deletion ROADMAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,73 @@ Surfaced during the T-Numeric-Reframe escalation (gunbc#828 thread, ratified at

- **`Json` + `Bytes` opaque kernel types — substrate decomposition candidate** (NEW 2026-05-01): per `dsl/std/types.dag:180-181`, `type Json` and `type Bytes` are declared as opaque kernel types with no structural decomposition. Different substrate-gap class from the numeric width-bake-ins (T-Numeric-Construction reframe scope) — those are width-baked aliases; Json/Bytes are unrefined opaque carriers. Decomposition could be a structural fold over JSON value-shape grammar (recursive: `Null | Bool | Number | String | Array | Object`) or a typed bytes-stream carrier with refinements for encoding (UTF-8 / Base64 / etc.). **Out of scope for T-Numeric-Construction reframe** (different decomposition shape). Disposition per Director ratification 2026-05-01: assess after T-Numeric-Construction lands whether this becomes its own R3 lane (≤6 weeks before R3 close = bias to add; >6 weeks = post-R3). Owner: Substrate Mgr; placeholder until disposition lands.

### Reviewer-noise class — a practice, not a debt
### Post-merge debt (2026-05-01 paired exploratory + reflective analyses)

Surfaced by paired Exploratory Analysis (gpt-5-5-pro main@8cd5359; 9 findings against `dsl/std/*.dag` / `src/v2/tests/src/*.rs` / `dsl/extdeps/` / THESIS / INVARIANTS / MODELING / ROADMAP) + Reflective Analysis (gpt-5-5-pro main@6ea9812 → now; 5 cross-PR patterns + 6 course corrections; integration window ~2026-04-28 → 2026-05-01). Verdict from reflective: *advancing, with scaffold-velocity dominating — next quality bar should be closure receipts*. Folded into ROADMAP via PM ingestion of Director-relayed analyses 2026-05-01.

#### A. Exploratory findings — sharpest novel correctness bugs

- **SymbolicCost product normalization violates semiring annihilation law** (NOVEL — sharpest correctness bug from this analysis pair): `dsl/std/algebra.dag:143-153` declares `Semiring<T>` with `a * zero = zero` annihilation, but `src/v3/std/algebra.dag:399-407` `normalize(SymbolicCost)` calls `drop_zero` for both `SumCost` and `ProductCost` terms — `reduce_product` then returns the singleton remaining term. Concrete counterexample: `iterate(ConstantCost(0), LinearCost(n))` builds a `ProductCost` (`src/v3/std/algebra.dag:252-256`), drops the 0, and normalizes to `LinearCost(n)` instead of `ConstantCost(0)`. Same logic mirrored in `src/v3/compiler/src/dag_cost_generated.rs:102-152` (`drop_zero_terms`). Cost-lens reads incorrect facts. **Dissolution**: split additive-zero from multiplicative normalization — sums may drop `ConstantCost(0)`; products must return `ConstantCost(0)` if any factor is zero, and only drop a distinct multiplicative identity. Add law tests for `a + 0 = a`, `a * 1 = a`, `a * 0 = 0`, `iterate(0, body) = 0`. Surfaced 2026-05-01 (Exploratory Finding 1). Owner: R3 Substrate (algebra fix) + R3 Verification (`semiring_zero_annihilates_multiplication_witness` law-witness gate). **The fact this slipped past `T-V-L4-L7-Direct`'s `l7_algebraic_laws_witnessed` gate exposes a coverage gap** — algebraic-law-witness coverage isn't yet exhaustive across declared algebra inhabitants.

- **SubValueRelation claims `BoundedLattice<T>` but `meet(top, a) = a` law violated** (sharpened from already-tracked hand-rolled-lattice row at ROADMAP:362-365): `src/v3/std/induction.dag:372-376` claims `top = PreservedValue` (meet identity), `bottom = SubValueUnknown`, but `src/v3/std/induction.dag:281-288` implements `meet(PreservedValue, b) = PreservedValue` for any non-unknown `b` — the law `meet(top, a) = a` requires returning `b`, not `top`. Concrete counterexample: `meet_sub_value(PreservedValue, StrictSubValue { ... })` returns `PreservedValue` instead of `StrictSubValue`. Downstream consumers reading "this is a `BoundedLattice`" get false algebraic guarantees. **Dissolution**: either add a real top element, weaken the claim to a semilattice/partial-merge structure, or change ordering so implemented meet/join satisfy declared laws. **Stop claiming `BoundedLattice<SubValueRelation>` until law holds.** Surfaced 2026-05-01 (Exploratory Finding 2). Owner: R3 Substrate (fix substrate or weaken claim) + R3 Verification (`bounded_lattice_meet_top_identity_witness` for any T claiming `BoundedLattice<T>`).

- **Emitter `as_bind().expect()` panic paths violate fail-closed boundary** (NOVEL): 6 sites in `src/v3/compiler/src/emit.rs:2157-2166` + `:2205-2214`, `src/v3/compiler/src/emit/rust_target.rs:4475-4485` + `:4569-4579`, `src/v3/compiler/src/emit/python_target.rs:1307-1316` + `:1383-1392` use `as_bind().expect("UserDefined arrow body must point at a Bind")` instead of typed `EmitError` / `EmitPythonError`. Adjacent branches already return typed errors for non-Arrow declarations. Malformed substrate data crashes emitter instead of producing typed diagnostic. **Dissolution**: replace `expect` calls with typed emitter errors carrying offending `DeclarationId` / `NodeId`. Stronger: make `ArrowBody::UserDefined` carry a `BindNodeId` witness that cannot point at other behavior variants (state-space-vs-behavioral-invariants pattern). Surfaced 2026-05-01 (Exploratory Finding 8). Owner: R3 Substrate / R3 PB (adjacent to T-LensProducer-Retirement emit-module surface).

#### B. Exploratory findings — sharpened tracked items

- **`??` and `%` declared in dag-syntax authority but absent from v3 token/parser/operator surface** (sharpened from operator-ontology-three-coexisting-authorities at ROADMAP:424-425): `dsl/extdeps/languages/dag/syntax.dag:99-115` declares `OperatorSpec` rows for `??` (`NullCoalesce` binop) and `%` (`Mod` binop). v3's token taxonomy at `src/v3/std/tokenize.dag:15-60` has `Question` but no `QuestionQuestion`; has `Slash` but no `Percent`. Punctuation list at `:95-123` matches. `src/v3/compiler/parse_tables.dag:173-243` covers `||`, `&&`, comparisons, `+ - * /` but no `%` or `??`. v3 operator ontology at `src/v3/std/substrate.dag:223-253` has Add/Sub/Mul/Div + comparisons + And/Or; no Mod or NullCoalesce. `src/v3/compiler/operators.dag::from_symbol:5-18` no branch. The parse-table cross-validation comment at `parse_tables.dag:149-166` claims cross-validation against `dag_operators` — visibly violated. **Dissolution**: short-term either remove unsupported rows from `dag_operators` until v3 supports them, OR add the full chain (token + parse + OperatorKind + algebra-field mapping + lowering/inference) in one PR. Long-term: T-Ground-Services parser-grammar slice derives parser rows from syntax authority — concrete scope item for that lane. Surfaced 2026-05-01 (Exploratory Finding 4). Owner: R3 Substrate (operator ontology) + R3 Grounding (T-Ground-Services).

- **`CollectionOps` / `StringOps` / `MapOps` duplicate algebra operation surfaces as target-string templates** (sharpened from language-fact-duplication / LanguageSpec-dual-authority at ROADMAP:365 + :424): `dsl/std/algebra.dag:301-326` declares `FreeMonoid<T>` carrying `concat`, `empty`, `length`, `map`, `filter`, `fold`, `flat_map`, etc. as algebraic operations; `:328-349` declares `PartialFunction<K,V>` carrying `lookup`, `empty`, `insert`, `merge`, `keys`, `values`. `dsl/std/languages.dag:281-318` then declares per-target `CollectionOps`, `StringOps`, `MapOps` records with `count: String` / `first: String` / `fold: String` / `empty_list: String` etc. — second operation ontology parallel to FreeMonoid + PartialFunction. **Dissolution**: realize operations should reference `DeclarationRef` / method contracts for algebra fields. Target templates can remain render-data, but identity is "realization of `FreeMonoid<T>.fold` for Rust", not a second `fold: String` field. Surfaced 2026-05-01 (Exploratory Finding 7). Owner: R3 Grounding (T-Ground-LanguageSpec + algebra method contracts).

#### C. Exploratory findings — already tracked (no new ROADMAP row needed)

These confirm/reinforce existing tracked items; no novel scope:

- Hand-rolled Lattice / BoundedLattice instances (DescentEvidence / Encoding / FermiDepth) — already at ROADMAP:362-365
- Target primitive `carrier: String` / `TypeCheckpoint` / `InhabitantDecl` — already at ROADMAP:161-179 + :369
- `src/v3/std/effects.dag` embedded `std.http_path` mirror — already at ROADMAP:367 + :395
- Rust runtime evaluator mirroring `src/v3/std/runtime.dag` `Value` / `EvalFrame` — adjacent to PB/0-hand-Rust at ROADMAP:35-37 + :53-54

#### D. Reflective integration patterns (cross-PR)

5 cross-PR patterns surfaced by integration window analysis. Verdict: *advancing*, but the next cycle should produce closure receipts (deleted bridge / reduced SG-0 count / NYI claim becoming executable / Rust mirror generated from `.dag`) instead of more named gates.

- **Pattern A — author-now/fire-later as default verification style**: TC1, TC2, TC3, free-consequences, RustDagIsomorphism, BridgeLedgerZero all have structural claim shapes BUT integration tests assert `NotYetImplemented` or intentional `Fail` rather than actual theorem satisfaction. Examples: `r3_free_consequences_first_batch_test.rs` expects parallelism lenses to fail on `0 != 1` placeholder + memoization claims to return NYI; `tc3_strong_normalization_deferred_test.rs` expects NYI; `tc1_substrate_lens_eta_equivalence_deferred_test.rs` moved Pass → NYI under BinaryDimensionReportEquals. Acceptable temporary; creates false sense of progress if more fixtures accumulate without one becoming executable. **Course correction #1 (highest-value)**: make one `BinaryDimensionReportEquals` claim actually compare produced `DimensionReport<C>` values, not add another consumer shell. TC1 or RustDagIsomorphism best candidate (directly attacks mirror drift + self-inspection). Owner: R3 Verification.

- **Pattern B — `test_runner.rs` becoming second predicate language**: `src/v3/compiler/src/test_runner.rs` now handles `BinaryDimensionReportEquals`, `BridgeLedgerZero`, `AlgebraicLaw::Commutativity`, existing `ExecuteCommand`, fixed-point, generated-from-Dag, release deferrals, census checks, etc. Already tracked at ROADMAP "test_runner.rs becoming a parallel test-predicate authority"; reinforced here. Every new runner arm delays thesis target where TestClaim predicates are structural data + generated execution consumes them. Owner: R3 Evaluator + R3 PB (managed PB-debt lane; cross-program).

- **Pattern C — typed-carrier-landed + Rust-mirror-remains accumulates faster than dissolved**: appears across `EmissionDiagnostic`, `Value`, `EvalStrategy`, `BridgeLedgerRef`, target-primitive/pilot routing. Comments are honest about lockstep/dissolution (good); integration-wise, project accumulates "same fact in `.dag` plus Rust" surfaces faster than it deletes mirrors. P2/P5 systemic risk. Owner: standing R3 PB-debt-lane discipline; per-PR pairing with `feedback_isomorphism_or_generation_for_mirrors` discipline.

- **Pattern D — numeric work changed philosophy mid-window** (validates T-Numeric-Construction reframe): window first extends fixed-width chain (Int128 / UInt128 / Word128Carrier / Rust i128) and then reframes lane to construction chain via Magnitude (PR #1364). Reframe is correct; risk is that older `OrderedRing<Word*>` path keeps expanding except as migration compatibility. **Going-forward enforcement**: next numeric PR should not add `u128` merely as another table row unless explicitly tied to new `Int<N>` / `Nat<N>` refinement path. Owner: R3 Substrate (T-Numeric-Construction); STOP+PING discipline at brief-finalization for bare width-row additions.

- **Pattern E — bridge retirement tracked, not yet retired**: `BridgeLedgerZero` gives single cross-program ledger (good). Ledger has open rows for `SourceSpan.file` participation, canonical lens-name patching residuals, `include_str` side channels, exact-string patching residuals. Test suite asserts failure at HEAD. Fine for transparency; not thesis progress unless open set shrinks. **Course correction #4**: convert `BridgeLedgerZero` from "known-open reporting" → decreasing-open-count ratchet; or each bridge-owning PR flips one row OR cites why it cannot. Owner: R3 Verification.

#### E. Reflective course corrections — 6 highest-priority

| # | Course correction | Pattern | Owner | Lane connection |
|---|---|---|---|---|
| 1 | One `BinaryDimensionReportEquals` path executes (TC1 or RustDagIsomorphism best candidates) | Pattern A | R3 Verification | T-V-L4-L7-Direct (proximate); requires Evaluator runtime gates firing |
| 2 | `PRELUDE_BARE_RHS_ALIAS_IDENTS` table dissolution + Int128/UInt128/Word128 bare-alias regression tests (`ff1795bb` introduced hard-coded alias names; doesn't include Int128/UInt128/Word128 added in same window — drift between numeric-extension PR + alias-table PR) | Pattern A + integration-bug-pattern | R3 Substrate | Adjacent to T-Ground-Services parser-grammar slice; scope-resolution > name-table |
| 3 | Tighten `resolve_operator_arrow` synthetic-arrow fallback (`8617b8b1` only fails closed when no Conj reached; arbitrary product type that IS Conj but NOT algebra-witness can still pass into old synthetic arrow scaffold; should require declared algebra carrier OR explicit operator field) | Pattern A | R3 Substrate | Operator ontology |
| 4 | `BridgeLedgerZero` from known-open-reporting → decreasing-open-count ratchet | Pattern E | R3 Verification | Owns ledger gate |
| 5 | Pair every new hand-Rust test file with SG-0 count decrease elsewhere OR generated-TestClaim replacement PR | Pattern C | R3 PB + R3 Verification (cross-program PR-discipline rule) | Per `feedback_isomorphism_or_generation_for_mirrors` discipline |
| 6 | `diagnostics_empty_after_bootstrap` for new bootstrap fixture authorities (especially method-template-contract data) so shape tests cannot pass over a semantically diagnostic Dag | Pattern A | R3 Substrate + R3 Verification | Already routed via 2026-04-30 analyses ingestion; reinforced here |

#### F. CI cost signal worth flagging

Commit `e765c86a` raised v3 job timeout 60min + full-suite budget 2400s; transitional per comment. Conflicts with thesis cost-of-change story unless followed by shared bootstrap caches, fewer hand-Rust harnesses, or generated structural assertions. Velocity-Tripwire calibration: the 64 docs / 16 feat / 9 fix commit ratio in the analysis window is informative — high docs ratio means lots of authoring, less retiring; introduction:dissolution PR ratio likely above 3:1 in the window per `INVARIANTS.md §P5(c)`. Worth a Velocity-Tripwire reading via Director's normal cadence (Release Mgr archived per 2026-04-30 disposition; this signal lives at Director / standing managers).

#### G. PM strategic synthesis (cross-cutting meta-themes)

Three meta-themes surface across both analyses:

1. **Algebraic-law-witness coverage gap** (Findings #1 + #2 from Exploratory): SymbolicCost semiring violation + SubValueRelation BoundedLattice-claim-violation are exactly the bug class that `T-V-L4-L7-Direct`'s `l7_algebraic_laws_witnessed` gate should catch by construction. They slipped past because witness coverage isn't exhaustive across each algebra inhabitant. **Structural fix shape**: Verification Mgr's witness suite covers each declared algebra law for each inhabitant. Once exhaustive, this bug class becomes structurally impossible. Connects to T-Free-Consequences-Demonstration's "what does the compiler ACTUALLY guarantee" framing — algebraic-law guarantees are a free consequence of structural law-witness coverage.

2. **Course corrections #1 + #4 + #5 cluster as "make scaffolds executable"** (Pattern A + E + C): converting author-now/fire-later scaffolds into actual structural gates. Per `feedback_construction_over_ratchets` — scaffolds without dissolution triggers become permanent debt; scaffolds with executable gates close. Course-correction shape isn't "stop authoring" — it's "next cycle closes some of the newly-named gates."

3. **Course corrections #2 + #3 + #6 cluster as "tighten existing structural enforcement"**: each corresponds to a specific structural tightening that makes a bug class unrepresentable per `feedback_state_space_vs_behavioral_invariants` (type enforcement > API enforcement).



- **Integration-reflection cadence**: every ~few days, run a reflective + exploratory analysis pair. The 2026-04-15 and 2026-04-18 passes caught items individual PR reviews missed (authority split across PRs, silent cross-PR name-based lookups, the `CreateComment` drift, the `repeat_string` bug). Worth institutionalizing. **Velocity-tripwire reporting (added 2026-04-25 per [PR #810](https://github.com/gunb-ai/gunbc/pull/810) §4)**: each cadence pass also reports introduction:dissolution PR ratio for the window. Heuristic match: PR titles containing `retire`/`dissolve`/`delete`/`remove`/`collapse` count as dissolution; substantial-scaffold-introducing PRs (new hand-Rust file, new sentinel, new Rust mirror of a `.dag` authority) count as introduction. **Calibration caveat**: this is a lower-bound heuristic — feature PRs that ship dissolution work in the same diff (e.g., a T-LensAPI PR adding a lens and retiring three legacy paths) are undercounted. Before a ≥3:1 reading triggers Director review (per INVARIANTS.md §P5 "Dispatch-Discipline Mechanisms" (c)), the cadence pass MUST do a manual sweep for dissolution-bearing feature PRs in the window to avoid false positives. Current 2026-04-18→2026-04-25 baseline: ~1.6:1 (8 dissolution-shaped + 13 substantial introductions; lower bound).

Expand Down
Loading