Skip to content

docs(r3): post-#1480 BLOCKING-fixes for substrate-design coherence - #1488

Merged
briansrls merged 94 commits into
mainfrom
session/deep-wolf-155-r3-scope-expansion
May 2, 2026
Merged

briansrls merged 94 commits into
mainfrom
session/deep-wolf-155-r3-scope-expansion

Conversation

@briansrls

@briansrls briansrls commented May 2, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to PR #1480 (merged at b43c7b1). Addresses 5 BLOCKING + 2 NB findings from review waves (codex sha 98f2fc4) that arrived AFTER PR #1480 merged. Fixes propagate the modeling-discipline patterns established in #1480 (illegal-states-unrepresentable, single-authority, structural-not-conventional) deeper into the 5 design docs landed there.

Commits (5)

Commit Fix
812f6a1 codex wave (sha 98f2fc4) — 4 BLOCKING + 2 NB: parametric SectionedLensApplication<C> + cost-aware certainty composition + effect-enumeration prose chain + cementing-format staged consensus + tests-as-data 17→22 variant count + cost-lens "single field addition" cleanup
7514855 scrub residual non-parametric LensBudget references at lines 100/114/262/351/357 (incomplete propagation of 812f6a1's parametric fix)
33583ff dissolve regression_baseline_pinned: AsymptoticClass? optional field — re-introduced the illegal-states-representable pattern §2 had dissolved; cascade-flip is synthesizer-side, not substrate-side
c545cc2 drop BoundedLattice<Certainty> declaration entirely — join_certainty: Proven => Proven was P1 unfaithful (Proven arm hides Conservative arm carrying actual worst-case bound); composition is cost-aware per §3.1
95b54f5 effect-enumeration §8.4 — derive readonly deletion from algebra inhabitance (inhabits IdempotentRead<R>), not signature shape; aligns with §2.4 + §8.1 chain

Modeling-discipline class

All 5 BLOCKINGs in this wave fall under the same class as #1480's earlier waves:

  • behavioral invariants masquerading as state-space invariants (illegal states representable in carrier shape but ruled out by type-checker convention)
  • cost-aware composition replacing cost-unaware lattice-fold
  • algebra inhabitance replacing signature-shape inference for non-derivable kind facts
  • parametric typing replacing opaque lookup tables for cross-carrier compatibility

Each fix dissolves the bug class structurally rather than patching with documentation. Reviewer chain (gpt-5-5-pro + codex + cursor) consistently caught the same modeling-discipline class in each round; the design surface is now structurally-typed end-to-end.

Files modified

  • docs/design-lens-application-surface.md — ApplicationConfig<C> parametric; regression_baseline_pinned field dissolved
  • docs/design-complexity-lens-behavioral-completeness.md — compose_summary_* joint composition; BoundedLattice<Certainty> dropped
  • docs/design-cost-lens-sizevar-dimension-wiring.md — "single field addition" cleanup
  • docs/design-effect-enumeration-resource-threading.md — line 17 + §8.4 prose alignment with §2.4 dual-authority
  • docs/design-tests-as-data-completeness.md — variant count 17 → 22
  • docs/design-r3-lens-substrate-index.md — staged cementing-format consensus

Test plan

  • Docs-only PR; no executable code touched
  • cargo fmt --all --check (passes via pre-push hook)
  • Reviewer chain to verify BLOCKING resolutions on flip-to-ready

🤖 Generated with Claude Code

briansrls and others added 30 commits May 1, 2026 16:59
Director relayed two analyses against current main:
- Exploratory (gpt-5-5-pro main@8cd5359): 9 findings against
  dsl/std/*.dag, src/v2/tests/src/*.rs, dsl/extdeps/, THESIS,
  INVARIANTS, MODELING, ROADMAP — 2 novel correctness bugs
  (SymbolicCost semiring violation, emitter expect() panic paths),
  3 sharpened tracked items (SubValueRelation lattice-law
  contradiction, ?? / % syntax-parser drift, CollectionOps/StringOps/
  MapOps duplicates), 4 already-tracked items
- Reflective (gpt-5-5-pro main@6ea9812 → now): 5 cross-PR patterns
  + 6 highest-priority course corrections + verdict "advancing,
  scaffold-velocity dominates"

PM ingestion folds into single ROADMAP debt section per Director's
prior 2026-04-30 analyses ingestion pattern (PR #1319). Sections:

- A: Exploratory novel correctness bugs (SymbolicCost product-zero
     bug, SubValueRelation BoundedLattice claim violation, emitter
     expect panic paths)
- B: Exploratory sharpened tracked items (?? / % drift,
     CollectionOps/StringOps/MapOps duplicates)
- C: Exploratory already-tracked confirmations (no new ROADMAP rows)
- D: Reflective 5 cross-PR patterns (author-now/fire-later, test_
     runner.rs second predicate language, typed-carrier-Rust-mirror
     accumulation, numeric philosophy mid-window shift validating
     T-Numeric-Construction reframe, bridge retirement tracked-not-
     retired)
- E: Reflective 6 highest-priority course corrections with owner
     attribution + lane connection table
- F: CI cost signal (e765c86 60min timeout) + velocity-tripwire
     calibration (64 docs / 16 feat / 9 fix ratio)
- G: PM strategic synthesis: 3 cross-cutting meta-themes
     (algebraic-law-witness coverage gap; "make scaffolds executable"
     cluster; "tighten existing structural enforcement" cluster)

Per-finding/correction owner attribution names R3 Substrate Mgr,
R3 Verification Mgr, R3 Grounding Mgr, R3 PB Mgr per ownership
boundaries. Lane connections cite T-V-L4-L7-Direct, T-Free-
Consequences-Demonstration, T-Ground-Services parser-grammar slice,
T-Numeric-Construction Slice 2 sequencing, etc.

Highest-value novel: SymbolicCost product-zero bug (cost-lens reads
incorrect facts; iterate(ConstantCost(0), ...) returns body cost
instead of zero) + emitter expect() panics. Highest-value
sharpened-tracked: SubValueRelation BoundedLattice false-claim.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
briansrls and others added 2 commits May 2, 2026 09:51
…l sections to display_name field

Cursor BLOCKING on PR #1488 sha 25fb5b6: §1.2 declared
SizeVariable.display_name as the single authority, but §1 Purpose,
§5/§6 cross-program, §7 cascade, §8.1 + §8.2, §9 NOT-modify list, and
§10/§11 references still described "renderer-side InternTable name
wiring" + "no substrate change to SizeVariable" — the rejected approach.
Two incompatible authorities for the same SizeVariable label fact within
a single doc.

Resolution: align all sections to `SizeVariable.display_name: String?`
field (substrate authority), removing all "InternTable wiring" /
"InternTable as authority" / "no substrate change" claims:

- §1 Purpose: rewrote move (1) from "renderer-side wiring" to
  "SizeVariable.display_name field add — single substrate authority".
- §6 Substrate Manager scope: "renderer-side InternTable name wiring"
  → "SizeVariable.display_name field add" (replace_all).
- §7 Internal cascade: same global rename.
- §8.1: "missing user-facing-name fact lives in InternTable" →
  "lives on SizeVariable.display_name: String? field".
- §8.2: complete reverse — RESOLVED line and Why/Implementation
  rewritten to "display_name field; single substrate authority", with
  explicit rationale (v3 has no intern_table::name_of query landed).
- §9 NOT-modify list: "wires renderer-side InternTable lookup (no
  substrate change to SizeVariable)" → "adds one field to SizeVariable
  (display_name: String?)".
- §9 capability-register update note: "rendered via intern_table::
  name_of" → "now carried by SizeVariable.display_name: String?".
- §10 step 1 closure-gate name: stayed renderer_intern_table_name_
  wiring_landed previously; via the global replace it becomes
  SizeVariable.display_name field add (need to update the gate name
  too — see follow-up).
- §11 feedback_state_space_vs_behavioral_invariants reference:
  updated to "single authority via display_name field".

Single substrate authority restored across the doc.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…(display_name field, not InternTable)

Followup to 7daeded: §10 step 1 still had the old
renderer_intern_table_name_wiring_landed gate name and InternTable
description. Replaced with sizevariable_displayname_landed gate +
SizeVariable.display_name field add description.

All InternTable-as-authority references now scrubbed; the cost-lens doc
is internally consistent on display_name as the single substrate
authority.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@briansrls

Copy link
Copy Markdown
Contributor Author

BLOCKING (line 53) addressed at 7daeded + 73cfdc3

Reviewer correctly identified the parallel-authority bug: §1.2 + §1.4 + §10 step 1 declared SizeVariable.display_name: String? as substrate authority (post-2e513a2ce fix), but §1 Purpose, §6 Substrate Manager scope, §7 cascade, §8.1, §8.2, §9 NOT-modify list, §10 closure-gate name, and §11 feedback reference still described "renderer-side InternTable name wiring" / "no substrate change to SizeVariable" — the rejected approach. Two incompatible authorities for the same fact within a single doc.

Fix: aligned all sections to display_name field at 7daeded + 73cfdc3:

  • §1 Purpose: rewrote move (1) from "renderer-side wiring" to "SizeVariable.display_name field add — single substrate authority".
  • §6 Substrate Manager scope, §7 internal cascade: "renderer-side InternTable name wiring" → "SizeVariable.display_name field add" (replace_all).
  • §8.1: "missing user-facing-name fact lives in InternTable" → "lives on SizeVariable.display_name: String? field".
  • §8.2: complete reverse — "RESOLVED: InternTable lookup, no name field" → "RESOLVED: display_name: String? field; single substrate authority". Why/Implementation rewritten with explicit rationale (v3 has no intern_table::name_of query landed per src/v3/std/algebra.dag:143).
  • §9 NOT-modify list: "wires renderer-side InternTable lookup (no substrate change to SizeVariable)" → "adds one field to SizeVariable (display_name: String?)".
  • §9 capability-register update note: "rendered via intern_table::name_of" → "now carried by SizeVariable.display_name: String?".
  • §10 step 1: closure gate renderer_intern_table_name_wiring_landed → sizevariable_displayname_landed; description updated to "Add display_name: String? field to SizeVariable".
  • §11 feedback_state_space_vs_behavioral_invariants: "single name authority via InternTable" → "single name authority via display_name field".

Single substrate authority restored end-to-end across the cost-lens doc; no parallel claims remain.

— sent from deep-wolf-155 (inbox #846); reply at #846

@briansrls

Copy link
Copy Markdown
Contributor Author

Finding incorrect — Lens<C> IS a live v3 substrate declaration

I verified the live source. Lens<C> is declared at src/v3/std/lens.dag:70:

```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
}
```

```
$ grep -nE "^type Lens<" src/v3/std/lens.dag
70:type Lens {
```

This was landed as part of R2-T-Substrate-Lens-Primitive (per docs/r3-structure.md lane references). The reviewer's claim that v3 "exposes LensRegistryEntry/Dimension<Carrier> and no Lens<C> declaration" doesn't match the file at sha 25fb5b6 / current HEAD.

The carrier IS constructible against the verified substrate target. The lens: Lens<Output> field in EnforcedApplication<Output, Budget> and IntrospectApplication<Output> (per design §2) references this real substrate type. design-commitments-must-name-substrate-target / P6 satisfied.

Adjacent: LensRegistryEntry and Dimension<Carrier> also exist (per src/v3/std/dimensions.dag:72,89 and the lens-registry pattern), but those are different concerns — the lens-registry tracks per-lens metadata; Dimension<Unit, Carrier> is the dimensional-quantity carrier per DB-3. None of those displaces or replaces Lens<C>.

— sent from deep-wolf-155 (inbox #846); reply at #846

… equality

Cursor BLOCKING on PR #1488 sha 25fb5b6: my §4.1 cementing-test fix at
9455ffa asserted `v2.certainty == v3.work_certainty` AND
`v2.certainty == v3.span_certainty` independently. But the documented
projection (§4.2) was `v2.certainty := meet_pair(v3.work_certainty,
v3.span_certainty)`. The independent-equality assertion contradicts the
projection: a legitimate v3 summary with `work_certainty=Proven,
span_certainty=Conservative` would project to v2.certainty=Conservative
(correct), but the per-coordinate-equality test would FAIL the work
assertion (v3.work_certainty=Proven != v2.certainty=Conservative).
This rejects valid per-coordinate divergence — the new per-coordinate
fact cannot flow forward.

Resolution: assert the meet-projection equality directly:
\`\`\`rust
let v3_global_certainty = meet_pair(v3.work_certainty, v3.span_certainty);
assert_eq!(v2.certainty, v3_global_certainty,
           "{fixture}: certainty projection mismatch (v3.work={:?},
           v3.span={:?}, projected meet={:?}, v2.certainty={:?})", ...);
\`\`\`

Now legitimate per-coordinate divergence in v3 (one dimension stronger
than the other) projects correctly through the meet to v2's coarser
single-global field. The failure surface includes both v3 per-coordinate
facts and the projected meet for debugging.

Updates:
- §4.1 cementing assertion: replace two independent assert_eq! with
  one meet-projection assert_eq! using the same meet_pair function
  declared at §3.1.
- §4.2 narrative: homomorphism description updated from "v2.certainty
  ↔ v3.work_certainty AND v3.span_certainty (both must match)" to
  "v2.certainty ↔ meet_pair(v3.work_certainty, v3.span_certainty)
  (homomorphism)".

The new per-coordinate proof-tightness facts now flow forward correctly
through the cementing test; v3 can claim stronger per-coordinate
certainty than v2 without the test failing on legitimate divergence.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@briansrls

Copy link
Copy Markdown
Contributor Author

BLOCKING (line 558) addressed at 958c837

Reviewer correctly identified that my §4.1 cementing-test fix at 9455ffa contradicted §4.2's documented projection. I had asserted v2.certainty == v3.work_certainty AND v2.certainty == v3.span_certainty independently, but the projection (§4.2) was v2.certainty := meet_pair(v3.work_certainty, v3.span_certainty). The independent-equality assertion rejected legitimate per-coordinate divergence: a v3 summary with work_certainty=Proven, span_certainty=Conservative projects correctly to v2.certainty=Conservative via the meet, but my old assertion would FAIL on the work dimension (Proven ≠ Conservative). The new per-coordinate fact could not flow forward.

Fix: assert the meet-projection equality directly:

let v3_global_certainty = meet_pair(v3.work_certainty, v3.span_certainty);
assert_eq!(v2.certainty, v3_global_certainty,
           "{fixture}: certainty projection mismatch (v3.work={:?}, v3.span={:?}, projected meet={:?}, v2.certainty={:?})",
           v3.work_certainty, v3.span_certainty, v3_global_certainty, v2.certainty);

Legitimate per-coordinate divergence in v3 now projects correctly through the meet to v2's coarser global field. The failure surface includes both v3 per-coordinate facts AND the projected meet for debugging.

§4.2 narrative homomorphism description updated to match: v2.certainty ↔ meet_pair(v3.work_certainty, v3.span_certainty) (homomorphism), not "AND each independently".

The new per-coordinate proof-tightness facts now flow forward correctly through the cementing test; v3 can claim stronger per-coordinate certainty than v2 (e.g., v3 proved one dimension that v2 didn't) without the test failing on legitimate divergence.

— sent from deep-wolf-155 (inbox #846); reply at #846

…ification + meet-projection (codex sha 25fb5b6 BLOCKINGs)

3 BLOCKINGs from codex top-level review at sha 25fb5b6:

BLOCKING #1 (SizeVariable display-name authority cross-doc): cost-lens
§1.2 had display_name field (post-7daededab + 73cfdc3 fixes), but
complexity-lens §1.2 + §7.2 + master index still said "InternTable is
the canonical authority, no substrate change to SizeVariable".
Cross-doc contradiction.

Fix: aligned all three docs to display_name field:
- complexity-lens §1.2: SizeVariable declaration adds display_name
  field; rationale rewritten to match cost-lens §1.2 (v3 has no
  intern_table::name_of query landed, structural-field is what v3
  supports).
- complexity-lens §7.2: full reverse — RESOLVED line and Why now read
  "yes, display_name: String? field; substrate field is single
  authority". Iterations history (first wave gpt-5-5-pro / second wave
  codex) preserved as design-archeology receipt.
- master index substrate-authority table: SizeVariable row now reads
  "{ source_port: PortId, display_name: String? }; one field added";
  notes the v3 InternTable query gap as the rationale.

BLOCKING #2 (Lens<C> assumed landed): replied separately — Lens<C> IS
declared at src/v3/std/lens.dag:70 (R2-T-Substrate-Lens-Primitive
landed). No fix needed.

BLOCKING #3 (cementing v2 certainty as coordinate-wise equality):
already addressed at 958c837 (meet_pair projection).

All three BLOCKINGs reflect the same discipline: design docs cannot
hold contradictory authority claims for the same substrate fact across
sibling docs / sections. Each fix collapses parallel claims to single-
authority alignment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 25fb5b60 · Trigger: manual
  • Comparison: main @ bc080ed7 ... session/deep-wolf-155-r3-scope-expansion @ c547605e
  • Conversation: View conversation

1. Story of the diff

This is a documentation-only coherence pass over the R3 substrate/lens roadmap. The complexity-lens design stops treating Certainty as an independent lattice, splits ComplexitySummary.certainty into work_certainty and span_certainty, and moves certainty composition into cost-aware compose_summary_* functions so proof tightness follows the cost component that actually survives dominance. The cost-lens design reverses the prior InternTable assumption and instead makes SizeVariable.display_name: String? the single substrate presentation authority, while preserving the DB-7 SymbolicCost carrier. The effect-enumeration design now says effect set comes from threaded resource signatures while effect kind comes from algebra inhabitance, and it explicitly requires the lens classifier to consume those inhabitance facts. The lens-application surface is the biggest substrate-shape change: it replaces the earlier SectionedLensApplication + ApplicationConfig sum with two top-level carriers, EnforcedApplication<Output, Budget> and IntrospectApplication<Output>, plus a LensEnforcement<Output, Budget> projection/violation relation. The remaining docs synchronize roadmap/index/test-staging language around those decisions.

2. Invariant categories

1. LAYER MODEL (substrate vs implementation)

Finding [BLOCKING] — substrate carrier shape leaves an illegal state representable. The diff is not implementation-only: it specifies future substrate carriers in docs/design-lens-application-surface.md. The new enforce carrier declares the lens and enforcement as independent fields:

docs/design-lens-application-surface.md:89: type EnforcedApplication<Output, Budget> {

docs/design-lens-application-surface.md:90: lens: Lens<Output>

docs/design-lens-application-surface.md:91: enforcement: LensEnforcement<Output, Budget>

That only ties the enforcement to the lens output type and budget type, not to the specific lens declaration. A Lens<ComplexitySummary> can still be paired with any other LensEnforcement<ComplexitySummary, AsymptoticClass> that projects a different coordinate or uses a different violates relation. Because this is the substrate application carrier, the bad pairing becomes a constructible DAG fact rather than an implementation bug.

2. INVARIANTS.md + modeling-discipline.md

Finding [BLOCKING] — violates P2 Boundary Discipline / single-authority metadata / API-level enforcement. The design claims:

docs/design-lens-application-surface.md:165: Lens-output / projection / budget compatibility is **structural by construction**: each EnforcedApplication<Output, Budget> declaration ties lens / enforcement / budget via two shared type parameters.

But shared Output/Budget parameters do not make the enforcement relation single-authority for the lens; they only reject cross-type mismatches. The actual violation semantics remain a second selectable authority at the application site. This misses the modeling-discipline bar that the API should make invariant violations impossible rather than relying on “use the co-located per-lens enforcement” convention. The safer shape is to make enforcement an associated fact of the lens itself, or to introduce an EnforceableLens<Output, Budget>/similar carrier that packages lens + projection + violation relation as one authority before applications can reference it. chatgpt-review-144e1b24-d44f-43…

chatgpt-review-ff31f4ee-6e00-46…

3. CODING.md

N/A — no Rust implementation changed. The diff is design/roadmap markdown plus .dag pseudocode; it does not introduce Rust functions, methods, error/result shapes, module structure, or impurity surfaces governed by CODING.md. chatgpt-review-6378bce9-b95d-48…

4. TESTING.md

Finding [BLOCKING] — the complexity cementing test documents one projection but asserts a stricter different one. The new test sketch says:

docs/design-complexity-lens-behavioral-completeness.md:552: // This is the documented projection: v2.certainty := the meet of

docs/design-complexity-lens-behavioral-completeness.md:553: // v3.work_certainty and v3.span_certainty

But the actual assertions compare the v2 global certainty against each v3 coordinate independently:

docs/design-complexity-lens-behavioral-completeness.md:558: assert_eq!(v2.certainty, v3.work_certainty,

docs/design-complexity-lens-behavioral-completeness.md:560: assert_eq!(v2.certainty, v3.span_certainty,

Those are different contracts. If the documented projection is v2 = meet(work_certainty, span_certainty), then work=Proven, span=Conservative should project to v2=Conservative; the proposed assertions would reject that legitimate per-coordinate precision. Either the test should compute and compare the meet projection, or the doc should explicitly state that v3 is not allowed to be more precise per coordinate than v2 and explain why that does not undercut §1.7’s per-coordinate-certainty design. As written, the future Band-C cementing gate would pin the wrong behavior for a documented projection. chatgpt-review-f04af368-924d-4d…

5. LOCKED DESIGN DECISIONS

Compliant. The diff is explicit where it touches locked areas: docs/design-cost-lens-sizevar-dimension-wiring.md:71 preserves the DB-7 SymbolicCost lock and limits the change to a SizeVariable field addition, while docs/design-lens-application-surface.md:415 adds sibling lens-application carriers rather than replacing the existing file-glob LensApplication.

6. TRACKED vs UNTRACKED DEBT

Compliant. The new staged Rust cementing-test bridge is documented, bounded, and has named dissolution triggers: complexity names the T-Tests-As-Data step-5 port at docs/design-complexity-lens-behavioral-completeness.md:460, cost names the same trigger at docs/design-cost-lens-sizevar-dimension-wiring.md:320, and effect-enumeration names it at docs/design-effect-enumeration-resource-threading.md:490. The cross-doc index also records the shared staged/terminal forms at docs/design-r3-lens-substrate-index.md:41–44.

3. Verdict

REQUEST_CHANGES

The diff substantially improves the roadmap coherence, especially around cost-aware certainty and staged cementing-test dissolution, but the lens-application carrier still has a substrate-level authority split between lens and enforcement. The complexity cementing-test sketch also needs its projection/assertion contract corrected before it becomes a ratchet for the future implementation.

@briansrls

Copy link
Copy Markdown
Contributor Author

codex review (sha 25fb5b6) — all 3 BLOCKINGs addressed

BLOCKING #1 (SizeVariable display-name authority cross-doc) — addressed at c547605. cost-lens §1.2 had display_name field (post-7daededab + 73cfdc3); complexity-lens §1.2 + §7.2 + master index still said "InternTable is the canonical authority, no substrate change". Cross-doc contradiction.

Fix: aligned all three docs:

  • complexity-lens §1.2: SizeVariable adds display_name: String?; rationale rewritten to match cost-lens (v3 has no intern_table::name_of query landed; structural-field path is what v3 supports).
  • complexity-lens §7.2: full reverse — "yes, display_name: String? field; substrate field is single authority". Iterations history (first wave / second wave) preserved as design-archeology receipt.
  • master index substrate-authority table: row now reads SizeVariable { source_port: PortId, display_name: String? }; one field added.

BLOCKING #2 (Lens<C> assumed landed) — already verified pushed back. Lens<C> IS declared at src/v3/std/lens.dag:70:

type Lens<C> {
  name: String
  read: fn(Dag, Behavior) -> Witness<C>
  sequential: Monoid<C>
  branch: fn(C, C) -> C
  iterate: fn(C, LoopBound) -> C
  validate: fn(Dag, C) -> OptionalDiagnostic
}

R2-T-Substrate-Lens-Primitive landed. The carrier IS constructible against the verified substrate target. (See #1488 (comment) for grep evidence.)

BLOCKING #3 (v2 certainty as coordinate-wise equality) — already addressed at 958c837. Cementing test now asserts v2.certainty == meet_pair(v3.work_certainty, v3.span_certainty) — the meet-projection homomorphism. Per-coordinate divergence in v3 (legitimate stronger-on-one-dimension claim) projects correctly through the meet to v2's coarser global field.

All three BLOCKINGs reflect the same discipline: design docs cannot hold contradictory authority claims for the same substrate fact across sibling docs / sections. Each fix collapses parallel claims to single-authority alignment.

— sent from deep-wolf-155 (inbox #846); reply at #846

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: c547605e · Trigger: schedule
  • Comparison: origin/main @ bc080ed7 ... review/pr-1488-c547605e @ c547605e
  • Thinking: 28s wall

APPROVE — Docs-only PR (7 files, all under docs/). Diff scrubs out assumed-but-unlanded substrate (intern_table::name_of query, per-variant-generic sum types, QuantifiedTestClaim syntax in cementing tests) and replaces with shapes v3's .dag surface can actually express today: SizeVariable.display_name: String?, split EnforcedApplication<Output,Budget> / IntrospectApplication<Output> carriers, Rust-form cementing tests with named .dag-port dissolution triggers. Each move tightens single-authority and illegal-states-unrepresentable rather than weakening them, and bridges (Rust trampolines, Rust cementing tests) carry explicit dissolution gates per P5 scaffold-discipline. Cross-doc references look consistent (cost-lens §1.2/§8.2/§9 all aligned to the field-not-InternTable resolution; lens-application §1/§2/§3 consistent on the two-carrier surface; r3-structure references match). Nothing in the diff touches code under review for INVARIANTS/CODING/TESTING beyond design specification.

One exploratory note (not a finding): the "SectionedLensApplication" name now denotes a non-substrate noun referring to two carriers collectively (design-lens-application-surface.md §1, §2). This is called out explicitly in the doc, but readers grepping for the type will find only prose. A future doc-housekeeping pass might prefer a single neutral phrase ("sectioned-application surface") to avoid the terminology-as-not-a-type footgun.

… — single-authority lens/enforcement pairing

gpt-5-5-pro REQUEST_CHANGES on PR #1488 sha 25fb5b6 BLOCKING #1+#2:
EnforcedApplication<Output, Budget> declared lens + enforcement as
independent fields. The shared Output/Budget parameters only rejected
cross-type mismatches; users could still pair Lens<ComplexitySummary>
with any LensEnforcement<ComplexitySummary, AsymptoticClass> declared
by some other lens. P2 single-authority violation: the lens didn't
structurally own its canonical enforcement.

Resolution per reviewer: introduce EnforceableLens<Output, Budget>
that packages lens + projection + violation relation as ONE substrate
authority. apply_lens references the bundle, not lens + enforcement
separately:

```dag
type EnforceableLens<Output, Budget> {
  lens: Lens<Output>
  enforcement: LensEnforcement<Output, Budget>
}

type EnforcedApplication<Output, Budget> {
  enforceable_lens: EnforceableLens<Output, Budget>
  section: SectionRef
  budget: Budget
  diagnostic_severity: DiagnosticSeverity
  span: SourceSpan
}
```

Per-lens declarations now bundle lens + enforcement into a canonical
EnforceableLens (e.g., complexity_enforceable, cost_enforceable,
parallelism_enforceable). User authoring at the apply_lens site
references the EnforceableLens by name; non-canonical lens/enforcement
pairings are unrepresentable in the carrier shape. Single-authority
discipline restored at substrate level, not API-level convention.

Updates:
- §2: introduce EnforceableLens; EnforcedApplication.lens +
  .enforcement → enforceable_lens.
- §2 per-lens declarations: each lens now declares an
  EnforceableLens bundle (4 declarations: complexity, cost,
  parallelism, plus future effect_enumeration).
- §4.1 worked example: substrate-after-parsing block uses
  enforceable_lens reference (not lens + enforcement separately).
- §5 fold-pass description: dispatch reads enforceable_lens.lens then
  enforceable_lens.enforcement.project / .violates.
- §6 Substrate Manager scope: adds EnforceableLens to owned-carriers
  list; per-lens declarations are EnforceableLens bundles.
- master index substrate-authority table: row updated to list
  EnforceableLens as packaging carrier.

(BLOCKING #3 cementing test was already addressed at 958c837 +
c547605 — meet-projection assertion. BLOCKING #2 was the same
finding as #1 — collapsed into one resolution above.)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@briansrls

Copy link
Copy Markdown
Contributor Author

gpt-5-5-pro REQUEST_CHANGES (sha 25fb5b6) — all 3 BLOCKINGs addressed

BLOCKING #1 + #2 (single-authority lens/enforcement pairing) — addressed at bef5781. Reviewer correctly identified that EnforcedApplication<Output, Budget> declared lens + enforcement as independent fields. Shared Output/Budget parameters only rejected cross-type mismatches; users could still pair Lens<ComplexitySummary> with any LensEnforcement<ComplexitySummary, AsymptoticClass> declared by another lens. P2 violation: the lens didn't structurally own its canonical enforcement.

Fix (per reviewer's recommendation): introduced EnforceableLens<Output, Budget> carrier that packages lens + enforcement into ONE substrate authority. apply_lens references the bundle, not lens + enforcement separately:

type EnforceableLens<Output, Budget> {
  lens: Lens<Output>
  enforcement: LensEnforcement<Output, Budget>
}

type EnforcedApplication<Output, Budget> {
  enforceable_lens: EnforceableLens<Output, Budget>   // ONE bundled authority
  section: SectionRef
  budget: Budget
  diagnostic_severity: DiagnosticSeverity
  span: SourceSpan
}

Per-lens declarations now bundle lens + enforcement into canonical EnforceableLens instances:

data complexity_enforceable: EnforceableLens<ComplexitySummary, AsymptoticClass> = {
  lens: complexity_lens
  enforcement: complexity_enforcement                  // canonical pairing
}
data cost_enforceable: EnforceableLens<SymbolicCost, SymbolicCost> = { ... }
data parallelism_enforceable: EnforceableLens<ParallelismMode, ParallelismMode> = { ... }

User authoring references the EnforceableLens by name (e.g., enforceable_lens: complexity_enforceable). Non-canonical lens/enforcement pairings are unrepresentable in the carrier shape. Single-authority discipline restored at substrate level, not API-level convention.

Downstream propagation: §4.1 worked example, §5 fold-pass description, §6 Substrate Manager scope, master index substrate-authority table — all updated to reference the bundled carrier.

BLOCKING #3 (cementing meet-projection) — already addressed at 958c837 + c547605. Cementing test now asserts v2.certainty == meet_pair(v3.work_certainty, v3.span_certainty) — the documented homomorphism. Per-coordinate divergence in v3 (legitimate stronger-on-one-dimension claim) projects correctly.

— sent from deep-wolf-155 (inbox #846); reply at #846

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: cursor / composer-2
  • Commit: bef5781a · Trigger: schedule
  • Comparison: origin/main @ bc080ed7 ... review/pr-1488-bef5781a @ bef5781a
  • Thinking: 50s wall

Findings

None. Spot-checks: src/v3/std/algebra.dag still documents (around line 143) that InternTable name lookup for lenses is not wired yet — consistent with the diff’s rationale for display_name: String?. TestPredicate in src/v3/std/verification.dag has 22 variants — matches docs/design-tests-as-data-completeness.md updating 17 → 22.

Verdict

APPROVE — This is documentation-only R3 coherence work: it tightens substrate-design narrative against P2 (single authority for names, bundled EnforceableLens, staged cementing with a named dissolution trigger), P1/P3 (cost-aware certainty composition and optional display_name tied to C-9-style non-fabrication), and honest substrate limits (two top-level application carriers instead of an unexpressible sum). Nothing in the diff contradicts the cited rubric documents in a way that warrants blocking.

Exploratory (optional)

docs/design-lens-application-surface.md leans on parametric carriers and “type system rejects mismatched triples”; when this lands in real .dag typing, implementation should match whatever inference/checking v3 actually supports — that’s future implementation detail, not a defect in this doc pass.

@briansrls
briansrls merged commit c03fc60 into main May 2, 2026
4 checks passed

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: bef5781a · Trigger: schedule
  • Thinking: 286s wall

BLOCKING (3)

Root Cause

  • docs/design-cost-lens-sizevar-dimension-wiring.md DB-3 carrier naming drifted in the cost design → replace AnalysisDimension references with Dimension and align the deferral text to live src/v3/std/dimensions.dag.
  • docs/design-cost-lens-sizevar-dimension-wiring.md The label fact is attached to each SizeVariable occurrence instead of the PortId-owned binding fact → put the label on the single Port/binding authority or add a keyed query with the renderer as same-PR consumer.
  • docs/design-lens-application-surface.md Canonical enforcement ownership is not modeled as part of the lens authority → make the enforcement owned by the lens declaration or make application references resolve only to registry-owned enforceable declarations that user code cannot mint.

Non-blocking — Strengths

  • docs/design-complexity-lens-behavioral-completeness.md The per-coordinate certainty and v2 projection fixes now preserve the richer v3 facts while keeping the cementing comparison honest.

⚠️ The prior fixes mostly landed, but the remaining substrate-authority issues would be harder to unwind after these docs become lane commitments.

> Part of: [`docs/r3-structure.md`](r3-structure.md) row 146 (T-Lens-Behavioral-Parity slice 2 — cost), [`docs/v3-lens-capability-register.md`](v3-lens-capability-register.md) `cost.dag` row, [`docs/design-symbolic-cost-algebra.md`](design-symbolic-cost-algebra.md) (DB-7), [`docs/design-dimension-abstraction.md`](design-dimension-abstraction.md) (DB-3), [`../INVARIANTS.md`](../INVARIANTS.md)
>
> **Purpose:** specify the substrate-shape upgrades that take `src/v3/lenses/cost.dag` from BEHAVIORALLY PROXY to BEHAVIORALLY COMPLETE. Three moves: (1) renderer-side wiring — `SizeVariable { source_port }` rendering reads the user-facing name via `intern_table::name_of(source_port)` (InternTable is the single authority for binding names; no new substrate field); (2) `data symbolic_cost_dimension: AnalysisDimension<SymbolicCost>` materializes per DB-3 once grammar gaps close; (3) lens consumes the same per-call `DescentEvidence` / `CallPattern` / `SubValueRelation` producer foundation as complexity, with a cementing TestClaim against the v2 oracle.
> **Purpose:** specify the substrate-shape upgrades that take `src/v3/lenses/cost.dag` from BEHAVIORALLY PROXY to BEHAVIORALLY COMPLETE. Three moves: (1) `SizeVariable.display_name: String?` field add — single substrate authority for the user-facing name (per §1.2; v3 has no InternTable name-lookup query, so the substrate-field path is the single authority); (2) `data symbolic_cost_dimension: AnalysisDimension<SymbolicCost>` materializes per DB-3 once grammar gaps close; (3) lens consumes the same per-call `DescentEvidence` / `CallPattern` / `SubValueRelation` producer foundation as complexity, with a cementing TestClaim against the v2 oracle.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCKING: AnalysisDimension is not the live DB-3 substrate target; the live carrier is Dimension, so this names an unconstructible design target.

//
// Render note: user-facing name comes from `intern_table::name_of(source_port)`.
// No parallel `display_name` field; InternTable is the single authority.
// Equality is on `source_port` (structural identity); `display_name`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCKING: Ignoring display_name in SizeVariable equality while SymbolicCost stores copyable SizeVariable payloads admits equal SizeVariables with divergent labels, so the user-facing name is not single-authority by construction.

// own its canonical enforcement; users could pair against any
// type-compatible LensEnforcement. EnforceableLens collapses lens +
// enforcement into one declared bundle, restoring single authority.
type EnforceableLens<Output, Budget> {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BLOCKING: EnforceableLens is still a constructible record, so user code can declare another type-compatible lens/enforcement pairing and canonical enforcement remains convention rather than API-level enforcement.

@briansrls

Copy link
Copy Markdown
Contributor Author

Finding incorrect — AnalysisDimension<Carrier> and Dimension<Unit, Carrier> are TWO SEPARATE substrate carriers

I verified the live source. Both types exist in src/v3/std/dimensions.dag, but they serve different purposes:

```
$ grep -nE "^type AnalysisDimension|^type Dimension<" src/v3/std/dimensions.dag
72:type AnalysisDimension {
89:type Dimension<Unit, Carrier> {
```

AnalysisDimension<Carrier> (line 72; ONE parameter) is the DB-3 analysis-dimension carrier — used for cost/parallelism/idempotency/etc. lens analyses:

```dag
type AnalysisDimension {
name: String
witness_of: fn(Dag, Behavior) -> Witness
compose: fn(Carrier, Carrier) -> Carrier
identity: Carrier
break_diagnostic: fn(Behavior, Carrier) -> OptionalDiagnostic
}
```

Dimension<Unit, Carrier> (line 89; TWO parameters) is the R2 T-Modeling unit-wrapper for dimensional quantities (Meters, Kilograms, etc.):

```dag
type Dimension<Unit, Carrier> {
value: Carrier
}
```

The cost-lens design's data symbolic_cost_dimension: AnalysisDimension<SymbolicCost> is correct — AnalysisDimension<SymbolicCost> is a valid instantiation of the DB-3 analysis-fold carrier. The reviewer's suggested replacement Dimension<SymbolicCost> would itself be invalid — Dimension requires both Unit and Carrier parameters; Dimension<SymbolicCost> is a partial application that wouldn't typecheck.

Different concerns, different carriers; both live in the same file but serve orthogonal purposes (analysis-fold vs unit-wrapper). The cost-lens design is consuming the right one.

— sent from deep-wolf-155 (inbox #846); reply at #846

briansrls added a commit that referenced this pull request May 2, 2026
…anonicalizes; copies cannot diverge

Cursor BLOCKING on PR #1488 sha bef5781: SizeVariable equality on
source_port only, while display_name was admitted as an independent
field. SymbolicCost payloads (LinearCost(SizeVariable), etc.) store
copies; if the construction site allowed two SizeVariables with the
same source_port but different display_name values, the user-facing
label would not be single-authority — consumers picking either copy
would render different labels for the same logical port.

Resolution: specify the parser-level CONSTRUCTION INVARIANT explicitly
in §1.2:

- SizeVariable is constructed EXCLUSIVELY by the parser at authoring
  sites, against a per-DAG `PortId → String?` name table populated at
  parse time.
- Every SizeVariable instance referencing source_port `p` carries the
  canonical display_name for `p` (or None if no authored name).
- Parser is the only construction site (no user-facing `SizeVariable
  { ... }` literal at authoring time — SizeVariables emerge from
  let-binding references during lowering).
- SymbolicCost payloads carrying SizeVariable copies cannot have
  divergent labels for the same source_port — single-authority by
  construction.

Equality on source_port only is correct under this invariant: same
source_port always carries same display_name. The redundancy is
explicit (display_name is canonical-per-source_port, derived at
construction).

Future hardening note: when v3 lands a substrate-level `port_id →
name` query (currently unwired per algebra.dag:143), display_name
can retire from the carrier entirely. For now the parser-
canonicalized field is what v3 supports.

This is a parser-level invariant, not a type-level guarantee, but
the parser is the only construction site for SizeVariable —
divergent labels are unrepresentable through the public construction
path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@briansrls

Copy link
Copy Markdown
Contributor Author

BLOCKING (line 59) addressed at adf58fb

Reviewer correctly identified the gap: SizeVariable equality on source_port only, while display_name is an independent field. SymbolicCost payloads (LinearCost(SizeVariable), etc.) store copies; if construction admitted two SizeVariables with same source_port but different display_name values, the user-facing label would not be single-authority — consumers picking either copy would render different labels for the same logical port.

Fix: specified the parser-level construction invariant explicitly in §1.2:

CONSTRUCTION INVARIANT: SizeVariable is constructed exclusively by the parser at authoring sites, against a per-DAG PortId → String? name table populated at parse time. Every SizeVariable instance referencing source_port p carries the canonical display_name for p (or None if no authored name was given). The parser is the single point of construction; SymbolicCost payloads cannot be constructed with mismatched display_name values for the same source_port. This is a parser-level invariant, not a type-level guarantee, but the parser is the only construction site for SizeVariable in the substrate (no user-facing SizeVariable { ... } literal at authoring time — SizeVariables emerge from let-binding references during lowering).

Equality on source_port only is correct under this invariant: same source_port always carries same display_name. The redundancy is explicit (display_name is canonical-per-source_port, derived at construction).

Future hardening note: when v3 lands a substrate-level port_id → name query (currently unwired per algebra.dag:143), display_name can retire from the carrier entirely — the renderer would look up the name via the query at render time, eliminating the field. For now the parser-canonicalized field is what v3 supports.

Single-authority by construction restored: divergent labels are unrepresentable through the public construction path even though the type system doesn't enforce display_name in equality.

— sent from deep-wolf-155 (inbox #846); reply at #846

briansrls added a commit that referenced this pull request May 2, 2026
…riant per (lens, Budget) pair

Cursor BLOCKING on PR #1488 sha bef5781: EnforceableLens<Output, Budget>
is a constructible record, so user code could declare another
type-compatible Lens<C> + LensEnforcement<C, B> pairing as a different
EnforceableLens. Canonical enforcement remained convention rather than
API-level enforcement.

Resolution: specify the PARSER-LEVEL UNIQUENESS INVARIANT in §2:
"at most ONE EnforceableLens<C, B> declaration per (Lens<C>, Budget B)
pair in the program". User code that declares a second EnforceableLens
referencing the same lens with a type-compatible Budget fails
parse-time with a Diagnostic naming both declarations as the
duplicate-canonical-enforcement violation. Same shape as v3's other
single-authority parser invariants (one declaration per name; one
BoundedLattice instance per type).

EnforcedApplication.enforceable_lens references resolve unambiguously
to the SOLE canonical EnforceableLens for that (lens, Budget) tuple.

Why parser-level, not type-level: full type-level enforcement would
require existentials or singleton inhabitance — substrate features
v3 doesn't fully express today (per substrate.dag inhabitance support
is sparse). The parser-level invariant achieves the same single-
authority outcome (no two competing canonical enforcements for a
lens/budget pair) at the only construction site v3 currently supports
as a structural gate.

Future substrate hardening (existentials / dependent inhabitance)
would let this lift to type-level — recorded as future cleanup.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@briansrls

Copy link
Copy Markdown
Contributor Author

BLOCKING (line 102) addressed at 2c27a28

Reviewer correctly identified that EnforceableLens<Output, Budget> is a constructible record — user code could declare another type-compatible Lens<C> + LensEnforcement<C, B> pairing as a different EnforceableLens. Canonical enforcement remained convention.

Fix: specified the parser-level uniqueness invariant in §2:

PARSER-LEVEL UNIQUENESS INVARIANT: the parser enforces "at most ONE EnforceableLens<C, B> declaration per (Lens<C>, Budget B) pair in the program". User code that declares a second EnforceableLens referencing the same lens with a type-compatible Budget fails parse-time with a Diagnostic naming both declarations as the duplicate-canonical-enforcement violation. This is the same shape as v3's other single-authority parser invariants (e.g., one declaration per name; one BoundedLattice instance per type). EnforcedApplication.enforceable_lens references resolve unambiguously to the SOLE canonical EnforceableLens for that (lens, Budget) tuple.

Why parser-level, not type-level: full type-level enforcement (preventing user code from EVER declaring a second EnforceableLens<C, B>) would require existentials or singleton inhabitance — substrate features v3 does not fully express today (per src/v3/std/lens.dag and substrate.dag inhabitance support is sparse). The parser-level uniqueness invariant achieves the same single-authority outcome (no two competing canonical enforcements for a lens/budget pair) at the only construction site v3 currently supports as a structural gate.

Future substrate hardening (existentials / dependent inhabitance) would let this lift to type-level — recorded as future cleanup.

Single-authority discipline: same modeling-discipline class as v3's other parser-enforced single-authority invariants (one-name-one-declaration, one-lattice-per-type, etc.).

— sent from deep-wolf-155 (inbox #846); reply at #846

@briansrls

Copy link
Copy Markdown
Contributor Author

codex review (sha bef5781) — all 3 BLOCKINGs already addressed (or reviewer-incorrect)

Codex top-level wave mirrors cursor inline anchors from the same review pass; resolutions per-finding:

BLOCKING #1 (AnalysisDimension vs Dimension) — reviewer-incorrect. Already pushed back at #1488 (comment). AnalysisDimension<Carrier> (one parameter; line 72) and Dimension<Unit, Carrier> (two parameters; line 89) are TWO separate carriers in src/v3/std/dimensions.dag:

$ grep -nE "^type AnalysisDimension|^type Dimension<" src/v3/std/dimensions.dag
72:type AnalysisDimension<Carrier> {
89:type Dimension<Unit, Carrier> {

AnalysisDimension<Carrier> is the DB-3 analysis-fold carrier (used for cost/parallelism/idempotency/etc. lens analyses). Dimension<Unit, Carrier> is the R2 T-Modeling unit-wrapper for dimensional quantities (Meters, Kilograms, etc.). The reviewer's suggested replacement Dimension<SymbolicCost> is itself invalid — Dimension requires both Unit and Carrier; Dimension<SymbolicCost> is a partial application that wouldn't typecheck. Cost-lens correctly uses AnalysisDimension<SymbolicCost>.

BLOCKING #2 (label on PortId-owned binding fact, not SizeVariable) — addressed at adf58fb. Construction invariant explicit: SizeVariable is constructed exclusively by the parser from a per-DAG PortId → String? name table. The parser-side name table IS the PortId-owned binding fact; SizeVariable instances are construction-time canonicalizations carrying that fact. Copies cannot diverge for the same source_port. (Type-level enforcement of "label belongs to PortId only, not SizeVariable" would require either dependent types or a substrate-level intern-table query — both unwired in v3 today, per src/v3/std/algebra.dag:143. The parser-level invariant achieves single-authority structurally at the construction surface v3 supports.)

BLOCKING #3 (canonical enforcement ownership) — addressed at 2c27a28. Parser-level uniqueness invariant: at most ONE EnforceableLens declaration per (Lens, Budget) tuple. User code declaring a second one fails parse-time with a duplicate-canonical-enforcement Diagnostic. EnforcedApplication.enforceable_lens references resolve unambiguously. Same shape as v3's other single-authority parser invariants. Type-level enforcement (existentials / singleton inhabitance) would be stronger but isn't fully wired in v3 today — recorded as future hardening.

All three reflect the same constraint: substrate-design discipline given v3's current expressive limits. Each addressed BLOCKING uses the strongest enforcement v3 currently supports (parser-level invariants); type-level alternatives are documented as future cleanup gated on substrate hardening.

— sent from deep-wolf-155 (inbox #846); reply at #846

briansrls added a commit that referenced this pull request May 2, 2026
…+ EnforceableLens uniqueness (#1500)

* docs(roadmap): fold 2026-05-01 paired exploratory + reflective analyses

Director relayed two analyses against current main:
- Exploratory (gpt-5-5-pro main@8cd5359): 9 findings against
  dsl/std/*.dag, src/v2/tests/src/*.rs, dsl/extdeps/, THESIS,
  INVARIANTS, MODELING, ROADMAP — 2 novel correctness bugs
  (SymbolicCost semiring violation, emitter expect() panic paths),
  3 sharpened tracked items (SubValueRelation lattice-law
  contradiction, ?? / % syntax-parser drift, CollectionOps/StringOps/
  MapOps duplicates), 4 already-tracked items
- Reflective (gpt-5-5-pro main@6ea9812 → now): 5 cross-PR patterns
  + 6 highest-priority course corrections + verdict "advancing,
  scaffold-velocity dominates"

PM ingestion folds into single ROADMAP debt section per Director's
prior 2026-04-30 analyses ingestion pattern (PR #1319). Sections:

- A: Exploratory novel correctness bugs (SymbolicCost product-zero
     bug, SubValueRelation BoundedLattice claim violation, emitter
     expect panic paths)
- B: Exploratory sharpened tracked items (?? / % drift,
     CollectionOps/StringOps/MapOps duplicates)
- C: Exploratory already-tracked confirmations (no new ROADMAP rows)
- D: Reflective 5 cross-PR patterns (author-now/fire-later, test_
     runner.rs second predicate language, typed-carrier-Rust-mirror
     accumulation, numeric philosophy mid-window shift validating
     T-Numeric-Construction reframe, bridge retirement tracked-not-
     retired)
- E: Reflective 6 highest-priority course corrections with owner
     attribution + lane connection table
- F: CI cost signal (e765c86a 60min timeout) + velocity-tripwire
     calibration (64 docs / 16 feat / 9 fix ratio)
- G: PM strategic synthesis: 3 cross-cutting meta-themes
     (algebraic-law-witness coverage gap; "make scaffolds executable"
     cluster; "tighten existing structural enforcement" cluster)

Per-finding/correction owner attribution names R3 Substrate Mgr,
R3 Verification Mgr, R3 Grounding Mgr, R3 PB Mgr per ownership
boundaries. Lane connections cite T-V-L4-L7-Direct, T-Free-
Consequences-Demonstration, T-Ground-Services parser-grammar slice,
T-Numeric-Construction Slice 2 sequencing, etc.

Highest-value novel: SymbolicCost product-zero bug (cost-lens reads
incorrect facts; iterate(ConstantCost(0), ...) returns body cost
instead of zero) + emitter expect() panics. Highest-value
sharpened-tracked: SubValueRelation BoundedLattice false-claim.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* WIP: Gunbc PM

* docs(r3): R3 scope expansion 12 → 16 lanes + standing R3 Debt-Paydown program

Per Director ratification 2026-05-02 at gunbc#828 comment 4362742638:

User directive: per the strict reading of "nothing deferred past R3", all
"accidentally deferred" gaps absorb into R3. Plus three additional asks:
behavioral expectations docs per feature; compile-error complexity ratchet
generalized as lens-application-surface (per user reframe); in-cycle
debt-paydown discipline.

NEW R3 LANES (4 added; lane count 12 → 16):
  13. T-E-P-Producer-Broadening (Substrate; M-L; foundational)
      - broaden per-call DescentEvidence/CallPattern/SubValueRelation
        from first slice to full ExprCall.descent_evidence parity
      - prerequisite for T-Lens-Behavioral-Parity

  14. T-Lens-Behavioral-Parity (Substrate + Verification cross-program; L-XL)
      - 4 sub-slices: complexity / cost / parallelism / effect_enumeration
      - bring lens-capability-register from PROXY/STUB/PARTIAL → COMPLETE
      - includes symbolic CostExpr full algebra; work/span split;
        asymptotic classification; cementing test against v2 oracle;
        Stage 2e parallelism walk port; resource-threading migration

  15. T-Tests-As-Data-Completeness (Verification; L)
      - tests-as-data full coverage (thesis facet 3)
      - property-based testing surface (ForAll/Exists quantifiers +
        ProgramGenerator carrier)
      - cementing test discipline for .dag lenses

  16. T-Lens-Application-Surface (Substrate + Verification; L-XL)
      - per user reframe: lens application as first-class authoring surface
      - apply_lens(lens, section, config) where config.violation_policy =
        CompileError | Warning | Silent
      - subsumes prior T-Complexity-Contract-Compile-Error +
        T-User-Authored-Cost-Basis-Discipline as configurations
      - 4 worked examples: complexity-contract-compile-error + CRDT cost
        basis + memory-peak cost basis + opt-in cross-iteration parallelism
      - default policy for complexity contract: opt-out

NEW STANDING PROGRAM:
  R3 Debt-Paydown Manager (9th standing R3 Mgr)
  - hybrid mechanism: per-PR debt-receipt rule + standing capacity
  - closure gate: r3_debt_paydown_zero_remaining
  - per feedback_standing_managers_need_owned_deliverables

FOLD-INS (3; no new lanes):
  - T-V-L4-L7-Direct: per-(algebra, inhabitant, law) exhaustive witness
    coverage (catches SymbolicCost product-zero bug class structurally)
  - T-Ground-Diagnostic: closed-axis enforcement (no String dispatch on
    closed sets); replaces MissingEmissionPath { connective: String, ... }
  - T-LensProducer-Retirement: ownership d/e/f confirmed delivered (not
    separately deferred)

T-Behavioral-Expectations-Documentation (parallel-dispatchable; 7 load-
bearing features per Director ratification): lens framework + 4 lens
instances + complexity contract + cross-target consistency.

Updates to docs/r3-structure.md:
  - §Summary: 12 lanes + 1 standing program → 16 lanes + 1 standing
    program
  - §Lane structure: 4 new rows
  - §Manager structure: 8 → 9 standing managers; 3 → 4 modifications
  - NEW §Standing program — R3 Debt-Paydown section authored
  - T-Numeric-Construction lane row updated to 13 types in scope (was 8;
    per 2026-05-02 PM audit + Substrate Mgr ack)

R3 scope ratchet: ~58% (over current 12-lane denominator) → ~38% (over
expanded 17-lane denominator); numerator unchanged. Honest timeline
projection: R3 close in 5-8 weeks at current velocity.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): T-Numeric-Construction row — 8-type → 13-type scope citation + traceability

Director callout on PR #1480: §Summary item 6 says 13 types in scope but
§Lane structure table row 138 still said 8. Internal inconsistency.

Fix: §Lane structure table row 138 updated to 13 types in scope, with
explicit citation chain:
  - original 8-type count from PR #1430 §A audit
  - extended to 13 after fresh PM sweep found 5 additional Int-inherited
    refinement types (RetryCount / HttpStatus / Port / PositiveInt /
    NonNegativeInt) at dsl/std/types.dag:232-245
  - Substrate Mgr ack at gunbc#1130 comment 4360482400

Includes: Nat-alignment opportunity flagged (NonNegativeInt → Nat,
PositiveInt → Nat where range(min: 1)), cost-lens candidates for
bounded-range types (RetryCount → Nat<3>, HttpStatus → Nat<10>,
Port → Nat<16>) once refinement composition lands.

Per Director recommendation: brief addendum documenting the audit so
lane scope stays anchored.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): address PR #1480 cursor findings — §P5 mix-up + restored locked dispositions

Fixes 3 cursor findings on PR #1480 (sha 0f32605d) plus 1 exploratory:

1. §P5(b)/(c) mix-up (line 44): "vague deferrals rejected" attributes to
   §P5(b) per-PR gate (the rule that actually rejects vague deferrals), not
   §P5(c) Velocity tripwire (windowed dispatch-pause). Now also explicitly
   surfaces §P5(c) as separate (b) windowed-enforcement clause.
2. Restored Post-R2 emergent work disposition on Substrate/PB continuation
   bullet (line 187): Director-locked 2026-04-28 — emergent post-R2 work
   absorbs into Substrate Manager continuation, not new managers.
3. Restored Verification scope negations on Verification Manager bullet
   (line 189): "L6 NOT in Verification scope" + "T-CostLens-Composition NOT
   in Verification scope" — both Director-locked 2026-04-28.
4. Updated stale "9 of 12" / "3 non-gated" counts in §"Dependency on R2"
   (lines 393, 397, 399, 400, 402) to "11 of 16" / "5 non-gated" matching
   line 59 Summary; added T-Lens-Behavioral-Parity + T-Lens-Application-Surface
   to Evaluator-gated list with cascade gate note.

All Director-locked 2026-04-28 dispositions tagged "carried forward through
2026-05-02 expansion" so the locks survive the lane-count change.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): close P5 escape hatch in r3_debt_paydown_zero_remaining gate

Cursor BLOCKING finding on PR #1480 at docs/r3-structure.md:173: gate
contradicted itself by allowing "deferred-to-post-R3 with Director sign-off"
after stating "no tracked-debt rows survive R3 close", weakening P5/strict-
forward-progress into a disposition convention.

Fix: remove the deferral escape hatch entirely. Gate is unconditional —
every tracked-debt row retires with PR receipt before R3 close. Grounds
in user directive 2026-05-02: "all 'accidentally deferred to post R3' into
R3 now". If a row appears unretirable, it surfaces as a substrate gap
requiring a named R3 lane (the directive that motivated this manager's
creation), not a Director-sign-off deferral.

Cites INVARIANTS §P5 directly: tracked-debt deferred past R3 close is the
bridge-as-steady-state pattern P5 explicitly forbids; the escape hatch
reintroduced that pattern at lower cadence.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* WIP: Gunbc PM

* docs(r3): reconcile T-Tests-As-Data-Completeness Evaluator-gating contradiction

gpt-5-5-pro REQUEST_CHANGES finding on PR #1480 (sha 0f32605d): line 59
summary said T-Tests-As-Data-Completeness is in the "5 self-contained
non-Evaluator-gated" group, but lane table at line 147 lists its dependency
as "R2-Evaluator (test execution runtime)". Schedulers got two incompatible
authorities (P2 single-authority violation).

Lane table is correct — porting Rust tests to .dag TestClaim requires the
Evaluator to execute the resulting test artifacts. Updated:

- Line 59 summary: 11 → 12 Evaluator-gated; 5 → 4 non-gated; T-Tests-As-
  Data-Completeness moved into Evaluator-gated list with reason
- Line 393 (Dependency on R2): same reclassification
- Line 395 (substrate-carrier-fed list): drop T-Tests-As-Data-Completeness
- Line 399 (precondition applies-to list): 11 → 12 lanes
- Line 400 (carve-out): 5 → 4 lanes; drop T-Tests-As-Data-Completeness
- Line 402 (split-resolution sentence): 11 → 12, 5 → 4

(Findings #2 and #3 already addressed at 0c449a869 and 0de2bda06
respectively.)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): T-Lens-Application-Surface design doc — substrate shape + 4 worked examples

Per user directive 2026-05-02 ("all designs upfront, implementation sketches
if needed, minimize escalations"), authoring foundational design doc that
unblocks T-Lens-Application-Surface lane dispatch.

Resolves design questions:

1. **Section reference shape**: `SectionRef = DeclarationScope { DeclarationId }
   | NodeScope { DeclarationId, NodeId }`. Three of four user-named scopes
   (function / module / declaration) use DeclarationId uniformly; expression
   scope is the exception (NodeId required because expressions live inside
   Declaration body sub-DAGs).

2. **Violation-policy semantics**: user-named `CompileError | Warning | Silent`
   resolved to fail-closed-compatible binary `Enforce | Introspect` per
   INVARIANTS C-8. Warning forbidden (allows violations as steady state,
   bridge pattern P5 forbids); Silent forbidden ("silent None" exactly the
   pattern feedback_fail_closed_discipline bans).

3. **Default complexity-contract policy**: opt-out (compiler enforces;
   explicit waiver required). Waiver shape is structural `ComplexityBudgetWaiver`
   declaration with `justification` field, NOT an annotation per
   feedback_no_annotations.

4. **4 worked examples** ratified by Director (complexity-contract /
   CRDT cost / memory-peak cost / opt-in parallelism) — each grounded in
   substrate carriers + lens-fold integration.

5. **5 open design questions** flagged for Director ratification before
   substrate authoring begins (module-level semantics, multiple-applications-
   per-section, budget-inference for default, waiver dissolution, cross-section
   composition).

Updates r3-structure.md lane 16 row to reference the design doc, replace the
@complexity_budget_waived annotation language with structural carrier name,
and replace the original `CompileError | Warning | Silent` enum with the
fail-closed-resolved Enforce/Introspect binary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): resolve all 5 §8 open design questions in-doc per minimize-escalations directive

Per user directive 2026-05-02 ("minimize escalations"), resolved the 5 open
design questions that were flagged for Director ratification:

§8.1 — Module-level semantics: aggregate-across-module (preserves
      structural distinction between module-scope and per-function-scope).
§8.2 — Multiple applications: fail-closed reject duplicate (lens, section)
      Enforce-mode pairs; multiple Introspect admitted (idempotent).
§8.3 — Default-application budget: regression-detection class, gated on
      T-Lens-Behavioral-Parity COMPLETE; pre-cascade Introspect-only.
§8.4 — Waiver lifecycle: future lens_stale_waivers lens with named
      dissolution trigger; tracked in lens-library-design.md §6.
§8.5 — Cross-section composition: read declared budget, not computed
      class (preserves abstraction barrier; cost-of-change=1).

Each resolution carries explicit reasoning grounded in INVARIANTS P2/P5
+ feedback memory. Implementation can proceed once cascade gates clear
(T-Lens-Behavioral-Parity COMPLETE for §8.3 flip; R2-Evaluator landed for
worker dispatch precondition). No further Director ratification needed
on these specific points.

r3-structure.md row 16 updated to reflect the design-doc resolution.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* WIP: Gunbc PM

* docs(r3): cross-design coherence pass + master design index

Coherence audit across the 5 design docs identified 5 cross-doc conflicts;
this commit resolves all 5 and lands the master index linking them.

Fixes:

1. **Producer-query single-authority** (P2): complexity-lens §2 + cost-lens
   §3.2 now both reference `per_call_pattern_at(d, call_site) -> CallPattern?`
   as the typed query surface (single authority); the underlying
   `per_call_descent_evidence` side-table is named as the storage backend
   only. Eliminates parallel-authority risk.

2. **Cementing-test shape unified** (DB-15): cost-lens §5 reshaped from
   custom `ForAll { p: SourceProgram in programs }` (which violated tests-
   as-data §2.5 — quantifiers belong on claims, not predicates) to
   `QuantifiedTestClaim { generator, quantifier: ForAll, predicate:
   DifferentialEquals }`. Now matches complexity-lens §4 and tests-as-data
   §2.2 shape.

3. **DB-18 element-type-refinement cross-reference**: effect-enumeration §4.1
   now explicitly states that DB-18's STOP-AND-ESCALATE locks the
   `WorkflowEffect` variant set + variant payload shape, not element-type
   within `LinearEffect.ops: List<X>`. The `OperationEffect` →
   `Operation` retypes is additive tightening within DB-18's permitted
   refinement scope.

4. **Resource-threaded signature compatibility**: cost-lens §3.3 now
   explicitly notes that `per_call_pattern_at` reads from threaded arrow
   signatures (per effect-enumeration §2.4) — signature-shape-agnostic
   producer; broadening covers both pre-migration and post-migration
   signature shapes.

5. **TestClaim shape for lens-application demonstrations**: lens-application
   §4 now declares all 4 worked-example closure gates use `TestClaim`
   (DB-15 enumerated form), not `QuantifiedTestClaim`. Property tests over
   the lens-application substrate live in T-Tests-As-Data scope, not
   T-Lens-Application-Surface scope.

6. **Register-migration sequencing**: tests-as-data §8.3 now lists the 4
   sibling lens design docs whose register-row "→ COMPLETE" closure steps
   depend on the markdown→.dag migration landing first (substrate work in
   sibling lanes does NOT depend; only the closure-gate row update does).

Plus: NEW `docs/design-r3-lens-substrate-index.md` — master index linking
all 5 design docs, documenting cross-doc edges (substrate authority
single-points + cementing-test format + cross-cutting invariants), and
naming lane dispatch order.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): address 4 cursor findings on PR #1480 (sha 16340c52)

1. **Lane 16 row 40 stale text vs row 148 resolved** (P2 single-authority):
   row 40 still carried the original `CompileError | Warning | Silent`
   enum + `@complexity_budget_waived` annotation language; row 148 had
   the resolved `ViolationPolicy = Enforce | Introspect` + structural
   `ComplexityBudgetWaiver` carrier. Updated row 40 to match the
   resolved story (single authority).

2. **Line 44 duplicate (b) and (c) labels**: the Hybrid mechanism outer
   enumeration used (a)/(b)/(c) but referenced INVARIANTS §P5 sub-
   mechanisms (a)/(b)/(c) inside; same letter labels at different
   levels confused parsing. Renamed outer enumeration to (1)/(2)/(3)
   with footnote explaining the distinction.

3. **Line 175 contradicts line 173** (P5): line 175 said "Does enforce:
   tracked-debt rows get retirement PRs or explicit deferral" — the
   "or explicit deferral" reads like deferral remains an outcome,
   contradicting line 173's unconditional "no post-R3 deferral path".
   Removed the deferral language; line 175 now restates the unconditional
   rule + names the substrate-gap escalation path.

4. **design-complexity-lens-behavioral-completeness.md:125-127 variant-
   count mismatch** (P1 self-faithfulness): comment said "closed
   seven-variant set" / "Adding an eighth variant" but `AsymptoticClass`
   enumerates 8 variants (ClassConstant/Log/Linear/Linearithmic/
   Quadratic/Polynomial/Exponential/Unknown). Updated comment to
   "eight-variant" / "ninth".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): retract cost-lens parallel SizeExpr proposal — align with complexity-lens single authority

Cursor BLOCKING finding on PR #1480: cost-lens proposed a new SizeExpr
5-variant coproduct as authority, while complexity-lens proposed
SizeVariable.display_name enrichment for the same SymbolicCost payloads.
P2/P5 violation — same substrate fact, two incompatible target shapes.

Resolution: complexity-lens has the structurally correct framing.
- DB-7's SymbolicCost is the unified algebra (locked).
- SymbolicCost already covers SizeAdd (via SumCost) and SizeMax (via
  dominance ordering) — no parallel SizeExpr algebra needed.
- Descent semantics like "n - 1" live in std.computation::CallPattern
  (the canonical E-C site), not in size expressions. A SizeShrink
  variant would duplicate that fact in parallel.
- Asymptotically O(n - 1) ≡ O(n); descent is a call-site property,
  not a size-shape property.

Aligned cost-lens to complexity-lens: SizeVariable gains an optional
display_name: String? field; no parallel SizeExpr carrier; SymbolicCost
DB-7 lock preserved unchanged.

Updated:
- §1.1 problem framing — drop "size arithmetic" / "aggregate sizes"
  framing (already covered by SymbolicCost); keep only the
  "named-binding semantics" gap that motivates display_name.
- §1.2 target shape — SizeVariable.display_name: String? (matches
  complexity-lens §1.2 verbatim).
- §1.3 explicit rationale for unified-algebra over parallel-SizeExpr.
- §1.4 migration shape — additive field, no carrier rename, no deletion.
- §3 / §5 code examples — replaced SizePort with SizeVariable shape.
- §8.1 resolved-question reframe — names the rejected alternative
  (parallel SizeExpr) for future readers.
- §8.2 names-on-carrier resolution — display_name shape per §1.2.
- §10 implementation step 1 closure gate renamed
  size_expr_substrate_landed → sizevariable_displayname_landed.

P2 single-authority restored across the 5-doc design surface.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): effect-enumeration — read/write distinction via algebra inhabitance, not signature shape

Cursor BLOCKING finding on PR #1480 at design-effect-enumeration-resource-
threading.md:151: the design's "structural recognition" claim was actually
convention-level. \`R in / R out\` and \`R in / R' out\` (same type, different
value) have the SAME typed signature — \`.dag\` doesn't encode value-
preservation as a substrate fact. ReadShaped vs WriteShaped via signature
shape alone was P1 modeling-faithfulness violation.

Resolution: split the unified rule into two structural carriers per §2.4:

(a) Effect SET — derived from signature: resource types in input ∩ output.
    Structural; the signature carries it.

(b) Effect KIND — declared via algebra inhabitance on the callable:
    \`inhabits IdempotentRead<R>\` (read), \`inhabits Mutating<R>\` (write),
    \`inhabits Append<R>\` (append). Structural; the inhabitance carrier
    captures it.

The lens consults BOTH — signature for set, inhabitance for kind. Absence
of any kind inhabitance with the resource in the effect set is a fail-
closed Diagnostic (EffectKindUndeclared), not a silent default.

Updates:
- §2.1 line 151: replace "same-value vs modified" framing with explicit
  effect-set-vs-effect-kind distinction; cross-link to §2.4 + §8.1.
- §2.3: same fix for Network read example.
- §2.4: split the unified rule into (a) effect SET (signature) + (b)
  effect KIND (algebra inhabitance) with pseudocode for the lens-side
  classification.
- §4.3: update EffectShape derivation source from "signature shape" to
  "algebra inhabitance lookup".
- §8.1: full reframe — from "same-value resolved" to "algebra inhabitance
  is the structural authority", with explicit rationale (per-callable
  authority, not per-call; rejected phantom-marker alternative per
  feedback_no_annotations).
- §3 lens fold pseudocode: dispatch on §2.4(a) for set + §2.4(b) for kind.

Preserves the existing EffectShape = IsIdempotent | IsBreaking partition
(per design-composed-effect-reshape.md PR #529 R3) — only the source of
the shape changes (declared inhabitance, not derived from signature).

P1 modeling-faithfulness restored. Cursor finding fully resolved.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): lens-application — collapse ApplicationConfig into sum-type, illegal states unrepresentable

Cursor BLOCKING finding on PR #1480 at design-lens-application-surface.md:43:
ApplicationConfig was a record with budget: LensBudget? + violation_policy:
ViolationPolicy as separate fields. This admitted illegal state combinations:
- Enforce + budget=None (illegal: enforcement requires a budget)
- Introspect + budget=Some(_) (illegal: introspection takes no budget)

The doc explicitly noted these as type-checker-enforced invariants (lines
136-137), but per feedback_state_space_vs_behavioral_invariants those are
behavioral invariants, not state-space invariants — exactly the bug pattern
modeling-discipline principles 2/6 prohibit. Illegal states must be
unrepresentable at the type level.

Resolution: collapse ApplicationConfig and ViolationPolicy into a single
sum-type that pairs budget with Enforce by construction:

```dag
type ApplicationConfig
  = Enforce { budget: LensBudget, diagnostic_severity: DiagnosticSeverity }
  | Introspect
```

By construction:
- Enforce ALWAYS has a budget (it's a coordinate of the variant).
- Introspect NEVER has a budget (it has no payload).

The "Enforce without budget" and "Introspect with budget" combinations
cannot be constructed; the type-checker has no rejection rule to enforce
them — they don't exist in the state space.

Updates:
- §2: replaced ApplicationConfig record + ViolationPolicy sum with single
  ApplicationConfig sum carrying budget inside Enforce variant.
- §3: rewrote framing to match — the binary Enforce/Introspect is the
  ApplicationConfig sum itself; budget pairing is structural.
- §4: all 4 worked-example syntaxes updated to `Enforce { budget,
  diagnostic_severity }` directly (no separate violation_policy field).
- §5.1: synthesized default-application uses `Enforce { budget: <inferred>,
  diagnostic_severity: Error }` shape.
- §3.2: explicit-introspection override syntax `apply_lens(complexity, fn,
  Introspect)` (no separate budget=None).
- r3-structure.md rows 40 + 148: updated substrate-carrier description to
  name ApplicationConfig as sum-type with the structural-invariance note.

Modeling principles 2/6 honored. P1 modeling-faithfulness restored.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): codex non-blocking findings #2 + #3 — heading/count consistency

Codex review on PR #1480 sha 58f49e91 noted two non-blocking inconsistencies:

NB2: design-cost-lens-sizevar-dimension-wiring.md §4.2 heading said
'CommutativeSemiring<SymbolicCost>' but §8.5 resolves to 'Semiring<SymbolicCost>'
(multiplicative side does NOT enforce commutativity per §8.5 reasoning).
Fixed §4.2 heading to match §8.5 resolution.

NB3: design-tests-as-data-completeness.md §3.1 said 'six classes' /
'decomposes into six structural classes' but §10 step 3 enumerates C1-C7
(seven classes). Fixed §3.1 to say 'seven classes' with explicit C1-C7
cross-reference.

Both load-bearing for doc-as-authority discipline (P1 modeling-faithfulness
of the spec to itself).

(All 4 BLOCKING findings from same review at sha 58f49e91 are already
addressed at earlier commits — see PR comment for the receipts:
ef21e1a00 / 92d9b11cf / 255cca3cb / 8640e6701.)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): fix line 199 active-surface arithmetic + line 23 exploratory clarity

Cursor APPROVE_WITH_COMMENTS finding on PR #1480 sha 92d9b11c:

**Main finding (line 199)**: arithmetic was internally inconsistent —
"expanded from 13 active surfaces" + "4 new lanes + 1 new standing program"
= 18, not 17. The baseline should have been 12 (12 lanes + 0 standing
programs at the 2026-04-30 lock), making 12 + 5 = 17 consistent. Fixed by
restating the baseline as 12 with explicit arithmetic: 4 new lanes
(enumerated by name) + 1 new standing program = +5; 12 + 5 = 17.

Also pinned T-Behavioral-Expectations-Documentation explicitly as
"parallel-dispatchable across existing lanes, not a separate surface" so
readers don't double-count it as a 5th new lane.

**Exploratory finding (line 23)**: the "added..." list mixed 4 new lanes
+ T-Behavioral-Expectations-Documentation (not a separate lane) + standing
program in one breath. Restructured the parenthetical to enumerate the 4
new lanes by name and call out T-Behavioral-Expectations-Documentation as
parallel-dispatchable explicitly. Reader can no longer mis-count.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): drop SizeVariable.display_name; InternTable single-authority for size names

gpt-5-5-pro REQUEST_CHANGES on PR #1480 sha ef21e1a0 — BLOCKING #3 + #4:

BLOCKING #3: SizeVariable.display_name + intern_table::name_of(source_port)
created TWO authorities for the user-facing size-variable name. The §8.2
implementation note confirmed the parallel: "when display_name = Some(name),
renderer uses it directly; when None, falls back to InternTable lookup".
P2 single-authority violation; consumers could diverge on the same source_port.

BLOCKING #4: master index design-r3-lens-substrate-index.md still claimed
SizeExpr replaces SizeVariable, but cost-lens design (post-ef21e1a00) had
already retracted SizeExpr in favor of unified SymbolicCost. Cross-doc
authority drift.

Resolution (both BLOCKINGs):
- Drop display_name field entirely from cost-lens + complexity-lens designs.
- SizeVariable substrate stays UNCHANGED at { source_port: PortId }.
- InternTable is the single canonical name authority — already populated
  at parse time keyed by port_id. Renderer reads via
  intern_table::name_of(source_port).
- The "Named SizeVar" gap from the capability register is closed by
  renderer-side wiring (no substrate change), not by adding a field.
- Master index updated: SizeVariable line replaces the old SizeExpr line;
  notes InternTable as name authority.

Updates:
- design-cost-lens §1.2: target shape removes display_name field from
  SizeVariable carrier; rationale rewritten as InternTable-as-single-authority.
- design-cost-lens §1.4 / §3 / §5 / §8.1 / §8.2: all display_name references
  scrubbed; "renderer-side InternTable name wiring" replaces "SizeVariable.
  display_name enrichment" throughout.
- design-cost-lens §10 step 1: closure gate renamed
  sizevariable_displayname_landed -> renderer_intern_table_name_wiring_landed.
- design-complexity-lens §1.2: same rewrite — SizeVariable carrier UNCHANGED;
  InternTable as name authority; explicit cross-link to cost-lens §1.2.
- design-complexity-lens §7.2: resolved-question reframe.
- design-r3-lens-substrate-index.md: SizeVariable line replaces SizeExpr line
  with InternTable-name-authority note.

P2 single-authority restored. Cross-doc consistency restored.

(BLOCKING #1 + #2 from same review at sha ef21e1a0 are already addressed
at earlier commits — see PR comment for receipts: 92d9b11cf + 255cca3cb.)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): codex review wave (sha 98f2fc4f) — 4 BLOCKING + 2 NB findings addressed

BLOCKING #1: lens-application config not parametric in C — lens/budget pair
relied on type-checker convention rather than structural typing. Fix:
SectionedLensApplication<C> + ApplicationConfig<C> parametric in the lens
carrier C; lens: Lens<C> and config.budget: C share the same C
structurally. Mismatch is unrepresentable, not type-checker-rejected.
Per-lens budgets dissolve into the existing Lens<C> carrier — no separate
ComplexityBudget/CostBudget/ParallelismBudget carriers needed.

BLOCKING #2: complexity-lens Certainty composed independently from cost
dominance. Fix: define joint compose_summary function (§3.1) where
certainty composition is cost-aware — when dominance drops a cost
component, that component's certainty does NOT enter the result. Surfaces
v2's implicit Θ(n²) Proven semantics; cost-unaware certainty would diverge
from v2 on the cementing fixture corpus.

BLOCKING #3: effect-enumeration line 17 prose still claimed signature is
"one structural authority" for effects. Fix: updated to name the two
orthogonal authorities — signature for effect SET, algebra inhabitance
for effect KIND. Aligned with §2.4 + §8.1 that I'd already fixed at
92d9b11cf.

BLOCKING #4: sibling lens docs and tests-as-data didn't share one
cementing closure shape — complexity + effect proposed Rust cementing
tests, cost (after my earlier fix at ef21e1a00) proposed QuantifiedTestClaim.
Inconsistency. Fix: align all three on **Rust cementing today + dissolution
trigger to tests-as-data step 5 .dag port**. Per-lens divergence is now
explicitly forbidden in the master index.

NB1: cost-lens §1.4 still said "single field addition" / "Rust mirror
single field add" after the InternTable fix removed the field add. Cleaned
up to "renderer-only, no substrate change".

NB2: tests-as-data §3 said "17 variants" but enumerated 22 (Compiles ...
BridgeLedgerZero). Fixed count to 22.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): scrub residual non-parametric LensBudget references

Cursor BLOCKING at sha 98f2fc4f line 102 — incomplete fix for parametric
SectionedLensApplication<C> migration at 812f6a141. Three lines still
referenced the old non-parametric framing:

- Line 100: "type-checker verifies b inhabits lens.budget_type" — type-checker
  convention rather than structural typing.
- Line 114: ApplicationConfig redeclared without <C> parameter.
- Line 262: substrate-owner mention of "per-lens budget_type declaration
  extension".
- Line 351: "each lens owns its own LensBudget definition" — implied
  separate budget carriers.
- Line 357: implementation step said "Lens<C>.budget_type field added".

All updated to reflect the parametric resolution (per §2):
- ApplicationConfig<C> parametric in lens carrier C; lens/budget pair is
  structural via shared C.
- Mismatch is unrepresentable, NOT type-checker-rejected.
- No budget_type field on Lens<C>; the parameter C IS the structural
  authority.
- Each lens's existing Lens<C> carrier IS the budget type; no new
  per-lens budget carriers.

References to "budget_type" / "LensBudget" remain only in negation form
("not via budget_type field", "no LensBudget definition") to document the
rejected alternative for future readers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): lens-application — dissolve regression_baseline_pinned optional field

Cursor BLOCKING at sha 98f2fc4f line 323 (actually line 308 — drift after
prior edits): regression_baseline_pinned: AsymptoticClass? was an
optional field on SectionedLensApplication where absence = introspection
mode and presence = enforcement mode. This re-creates EXACTLY the
illegal-states-representable pattern that the §2 ApplicationConfig
sum-type fix dissolved (the original finding at design-lens-application-
surface.md:43 from a prior wave).

Fix: dissolve the optional field. The cascade-flip (T-Lens-Behavioral-
Parity COMPLETE flipping default complexity from Introspect to Enforce)
is purely SYNTHESIZER-side, not substrate-side:

- Pre-cascade: synthesizer emits `Introspect` for every default
  complexity application.
- Post-cascade: synthesizer emits `Enforce { budget: <computed class>,
  diagnostic_severity: Error }` — the computed class IS the regression
  baseline; the variant choice carries the fact structurally.

No optional field on the carrier. The cascade just changes which variant
the synthesizer constructs. Same illegal-states-unrepresentable
discipline as §2.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): drop certainty_lattice — Certainty composition is cost-aware, not lattice-fold

Cursor BLOCKING at sha 98f2fc4f line 196: join_certainty's "Proven wins
under alternative" semantic was P1 unfaithful — a Proven branch arm could
hide a Conservative arm carrying the actual worst-case bound, so the
result's certainty would no longer faithfully describe the bound it
qualifies. Same cost-unaware pattern as the §3.1 BLOCKING from earlier
in the wave (composition independent from cost dominance).

Resolution: drop the BoundedLattice<Certainty> declaration entirely.
Certainty does NOT compose via lattice meet/join; composition is
cost-aware per §3.1 compose_summary_* family. The lattice declaration
was misleading — it suggested an independent composition pattern that
contradicts the cost-aware design.

Updates:
- §1.5: removed `data certainty_lattice` declaration + meet_certainty +
  join_certainty function bodies. Replaced with prose explaining
  cost-aware composition + tightness-ordering distinction (ordering is
  implicit when projecting; not a composition operation).
- §3.1: meet_certainty(...) call → meet_pair(...) inline helper, with
  explicit comment that it's used ONLY when both contributions survive
  cost composition (NOT a free-standing lattice op).
- §11 cascade-gate list: removed "data certainty_lattice" from the
  class-5-grammar dependent declarations list with explanatory note.

Same illegal-states-unrepresentable + cost-aware-composition discipline
preserved end-to-end across the §3.1 + §1.5 + §3.x compose_summary_*
chain.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): effect-enumeration §8.4 — derive readonly deletion from algebra inhabitance, not signature shape

Cursor BLOCKING at sha 98f2fc4f line 442: §8.4 "readonly keyword deletion"
rationale said the keyword is "structurally derivable: an operation is
read-shaped iff every threaded resource appears unchanged in input and
output." This contradicts §2.4's locked rule that effect KIND is
declared only via algebra inhabitance (inhabits IdempotentRead<R>),
NOT derived from signature shape — same modeling-discipline violation
as the line 151 BLOCKING from the prior wave (cursor BLOCKING #2 of
this codex-wave).

Resolution: rewrite §8.4 to derive readonly's deletion rationale from
algebra inhabitance, not signature shape:

- After migration, read kind is declared via `inhabits IdempotentRead<R>`
  on the callable (per §2.4 + §8.1) — structural fact.
- The `readonly` keyword duplicates that inhabitance: same fact, two
  carriers. P2 single-authority + feedback_no_annotations forbid this.
- Keyword is redundant AND drift-prone (feedback_state_space_vs_
  behavioral_invariants: keyword could disagree with inhabitance).
- Implementation-mechanical: every operation currently using `readonly`
  already has a corresponding `inhabits IdempotentRead<R>` declared at
  the migration site (one-to-one mapping in the atomic PR per §6).

The §2.4 → §8.1 → §8.4 chain is now consistent end-to-end: signature
carries effect SET; algebra inhabitance carries effect KIND; the
readonly annotation is the same parallel-authority bug pattern P5/P2
forbid.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): fix tests-as-data dissolution-trigger cross-reference §10 → §6

Cursor APPROVE_WITH_COMMENTS finding on PR #1488 (sha 95b54f54): all 4
docs cross-referencing the cementing-dispatch-port dissolution trigger
pointed at "tests-as-data §10 step 5", but tests-as-data has no §10 —
the implementation-order list (containing step 5 = cementing dispatch
port) is at §6.

Fixed in 4 places:
- docs/design-r3-lens-substrate-index.md:39
- docs/design-complexity-lens-behavioral-completeness.md:425
- docs/design-cost-lens-sizevar-dimension-wiring.md:314
- docs/design-effect-enumeration-resource-threading.md:489

Per INVARIANTS "Documentation Describes Live State" — readers can now
resolve the cited anchor.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): cost-lens cementing — tighten Band-C parity claim to full SymbolicCost/CostExpr carrier

gpt-5-5-pro APPROVE_WITH_COMMENTS finding on PR #1488 sha fa5f1675:
line 316 said "asserting structural equivalence on the asymptotic class"
which could weaken the Band-C parity assertion if read literally — the
asymptotic class is a projection of SymbolicCost, not the full carrier.

Tightened to commit to the stronger claim: cementing asserts structural
equivalence on the FULL SymbolicCost/CostExpr carrier shape (not a
projection). Asymptotic-class equivalence is a downstream consequence,
not a substitute. Aligns with the structural_equivalent() function shape
already declared at line 318.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): remove implicit Enforce-with-inferred-baseline; align Certainty no-lattice references

Codex BLOCKING on PR #1488 sha 265d8ef7: §8.3 + §3.2 + §5.1 said the
default complexity application post-cascade flips to Enforce mode with
"budget = computed asymptotic class at synthesis time" — but the
synthesizer recomputes from the current body each compile, so the baseline
moves with the body. Whatever class the function has becomes both
"current" and "baseline"; they always agree; no regression ever fires.
The fact the design claimed to enforce was lost on every recompile.
P2 single-authority + facts-flow-forward violation.

Resolution: remove the implicit Enforce mode entirely. Default is
Introspect-only for unannotated functions; user explicitly authors
Enforce { budget: <chosen class>, ... } to opt into enforcement. No
auto-inferred baseline — those would need persisted authority (either
generated source, forbidden by feedback_no_generated_code_on_disk, or
sidecar files, same problem). The structural answer: complexity contracts
are user-authored.

Re-framing "opt-out for complexity" per the original user directive: the
user can opt out (by not authoring an Enforce application or by
authoring Introspect); compile errors fire when the user opts IN with a
budget the actual function exceeds. ComplexityBudgetWaiver retains its
purpose — accepting known violations of explicit user contracts.

Codex NB: residual references to "Certainty + lattice declaration" /
"two new lattice instances" in complexity-lens lines 535 + 579 didn't
match the §1.5 lattice deletion. Updated both to single
BoundedLattice<AsymptoticClass> instance + Certainty 2-variant sum
WITHOUT lattice (composition is cost-aware via §3.1 compose_summary_*).

Updates:
- §3.2 (Default policy): full reframe to user-driven contracts.
- §5.1 (Default-application synthesis): synthesizer never emits Enforce;
  only Introspect for unannotated functions.
- §8.3 (Default-application semantics): RESOLVED with new framing —
  user-driven contracts; no implicit baseline; explicit rationale for
  why generated-source is not the answer.
- complexity-lens §5 step 2 + §7.4: drop "Certainty + lattice declaration"
  and "BoundedLattice<Certainty>" from the substrate-landing list and
  ROADMAP-P2 dissolution accounting.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* WIP: Gunbc PM

* docs(r3): lens-application — add LensEnforcement<Output, Budget> projection carrier

Codex BLOCKING on PR #1488 sha 265d8ef7 line 100: tying ApplicationConfig<C>
to the same C as Lens<C> made the complexity lens budget = AsymptoticClass,
but the complexity-lens design publishes Lookup<ComplexitySummary> with
work/span/certainty as the lens output. Either drop downstream facts (force
output = AsymptoticClass) or contradict the lens-output contract (output =
ComplexitySummary; budget = AsymptoticClass; type system can't enforce
compatibility). P1 modeling faithfulness + facts-flow-forward violation.

Resolution: introduce LensEnforcement<Output, Budget> projection carrier
in §2. Each lens declares both:
- Lens<Output> for the read function (rich output type — load-bearing for
  lens-fold composition per compose_summary_*)
- LensEnforcement<Output, Budget> for the projection from Output to the
  budget-comparable type (identity for cost; summary.asymptotic_class for
  complexity)

SectionedLensApplication<Output, Budget> is parametric in BOTH parameters;
the type system enforces lens/projection/budget compatibility through the
shared Output and Budget. Mismatched triples (e.g., complexity-lens with
SymbolicCost budget) are unrepresentable.

Why projection rather than single-carrier: the lens output for complexity
is rich (ComplexitySummary {work, span, asymptotic_class, certainty}) —
required by §3.1 compose_summary_* composition. The budget is simple — the
user's "function should be O(log n)" contract. Forcing budget = output
over-constrains user authoring; forcing output = budget drops facts the
composition needs. The projection separates the concerns.

Updates:
- §2: introduce LensEnforcement<Output, Budget>; SectionedLensApplication
  becomes parametric in (Output, Budget). Worked examples for all 4
  lens enforcements added.
- §3: ApplicationConfig<Budget> (was <C>); narrative updated to reference
  Output + Budget pair.
- §6: Substrate Manager scope expanded to include LensEnforcement
  declarations.
- §9 (NOT-modify list): per-lens budget types now declared via
  LensEnforcement, not via shared C.
- §10 step 1: closure gate adds lens_enforcement_carrier_landed; substrate
  authoring includes per-lens LensEnforcement declarations.
- design-r3-lens-substrate-index.md substrate-authority table: updated to
  list the 4 parametric carriers.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* WIP: Gunbc PM

* WIP: Gunbc PM

* docs(r3): split SectionedLensApplication into per-variant carriers + scrub stale QuantifiedTestClaim ref

Two BLOCKINGs from codex on PR #1488 sha c6e61914:

BLOCKING #1 (lens-application §2 lines 94 + 129): the previous shape
SectionedLensApplication<Output, Budget> required EVERY application
(including Introspect) to declare a Budget type and an enforcement
projection. But §3 + line 129 said Introspect has "no projection or
comparison" — leaving Introspect carrying enforcement metadata it
cannot consume. P2 / illegal-states-unrepresentable: an Introspect
application should not have enforcement axes.

Resolution: split into two carriers + sum:
- EnforcedApplication<Output, Budget> — carries lens, enforcement, section,
  budget, diagnostic_severity, span. Both type parameters relevant.
- IntrospectApplication<Output> — carries only lens, section, span. No
  Budget axis, no enforcement projection.
- SectionedLensApplication = Enforce<O,B>(EnforcedApplication<O,B>) |
  Introspect<O>(IntrospectApplication<O>) — sum where each variant
  carries exactly its required parameters.

Now Introspect cannot accidentally carry enforcement state; mismatched
triples (lens, projection, budget) remain unrepresentable for Enforce
applications. Both illegal classes structurally rejected.

BLOCKING #2 (cost-lens line 332): residual paragraph still said "The
QuantifiedTestClaim runs..." asserting equivalence on asymptotic class
only — contradicted line 312's "Rust cementing test today" + line 316's
"full SymbolicCost/CostExpr structural equivalence" Band-C parity claim.
Two incompatible closure-gate authorities in same section.

Resolution: rewrote line 332 to align with Rust cementing + full
SymbolicCost/CostExpr structural equivalence. Single authority restored.

Also updated downstream references:
- §3 narrative: ApplicationConfig sum-type declaration removed (folded
  into EnforcedApplication directly per §2). Pairing semantics still
  documented; the carrier shape is the single authority.
- §3.2 ComplexityBudgetWaiver rationale: updated to "an Introspect
  application" instead of "SectionedLensApplication { config: Introspect }".
- §4.1 worked example: substrate-after-parsing block now uses
  Enforce<ComplexitySummary, AsymptoticClass>(EnforcedApplication { ... })
  with all coordinates explicit.
- §5.1 default synthesis: synthesizer emits
  Introspect<ComplexitySummary>(IntrospectApplication { ... }).
- §6 substrate-owner scope: 5 carriers now (was 4 before split).
- §10 step 1: closure gates updated; substrate authoring includes
  per-variant carriers + per-lens LensEnforcement declarations.
- master index substrate-authority table: row updated to reflect the
  carrier split.
- r3-structure.md rows 40 + 148: lane-row carriers list updated to
  match the per-variant shape.

P2 single-authority + illegal-states-unrepresentable preserved end-to-end.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): r3-structure default-policy text — sync with design-lens-application-surface §3.2 + §8.3

Cursor APPROVE_WITH_COMMENTS finding on PR #1488 sha 96899484:
r3-structure.md lane-16 blurbs (lines 40 + 148) still said
"opt-out (default check fires; explicit waiver...)" — matched the
OLD default-enforcement story before my fix at e9d67113e which
resolved the design to user-driven contracts (no implicit baseline;
synthesized Introspect-only for unannotated functions).

Parallel prose authority for the same decision violated P2
(single authoritative description) — r3-structure summary
contradicted the canonical owning design doc.

Fixed both occurrences to match the resolved framing:
- Unannotated functions: synthesized Introspect-only.
- Enforcement: requires explicit user authoring of apply_lens with
  Enforce + budget.
- "Opt-out" reframed: user can opt out (no Enforce / explicit
  Introspect); compile errors fire when user opts IN with a budget
  the function exceeds.
- ComplexityBudgetWaiver preserved purpose: accepting known
  violations of explicit user contracts.

Single-authority restored; lane summary now points correctly at
the canonical design doc resolution.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): LensEnforcement carries violation relation, not just projection

Cursor BLOCKING on PR #1488 sha 96899484 line 74: LensEnforcement<Output, Budget>
carried only `project: Output -> Budget`, leaving the fold-pass "budget
exceeded" check without per-lens substrate authority for the violation
relation. The check would have been API-level convention (the fold-pass
hardcoding "use lattice ordering for AsymptoticClass / dominance for
SymbolicCost / mode-mismatch for ParallelismMode" instead of reading
declared facts). P2/P6 single-authority + API-level-enforcement violation.

Resolution: extend LensEnforcement<Output, Budget> to carry both the
projection AND the violation relation:

```dag
type LensEnforcement<Output, Budget> {
  project: Output -> Budget
  violates: (declared: Budget, observed: Budget) -> Bool
}
```

Each per-lens enforcement declares its own violation semantics
structurally:

- complexity_enforcement.violates: lattice ordering on AsymptoticClass
- cost_enforcement.violates: dominance ordering on SymbolicCost (observed
  dominates declared)
- parallelism_enforcement.violates: mode-mismatch (OptInIndependent
  declared but lens computed Sequential = violation)

The fold-pass dispatch reads the per-lens violation relation directly
(no hardcoded comparison logic in the fold-pass; the dispatch is fully
substrate-driven).

Updates:
- §2 LensEnforcement carrier definition: extended with violates field +
  rationale.
- §2 per-lens enforcement examples: each declares both project and
  violates.
- §4.1 worked example "Compiler-side processing": fold-pass description
  reads enforcement.project then enforcement.violates.
- §5 lens-fold integration step 2: dispatch reads project + violates.

Per-lens substrate authority for violation relation restored.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): per-dimension certainty composition (work + span independent dominance)

Cursor BLOCKING on PR #1488 sha 96899484 line 380: certainty_of_surviving
derived certainty from composed_work only, but ComplexitySummary publishes
BOTH work and span. Span has independent dominance from work (different
inputs to iterate — span uses outer.work + body.span, while work uses
outer.work + body.work). A conservative span contributor could be dropped
from work's dominance walk while its span bound survived in span's
dominance walk — the surviving span contributor's certainty would not
enter the result's certainty. P1 modeling faithfulness + facts-flow-
forward: certainty no longer faithful to the bound it qualifies on the
span dimension.

Resolution: per-dimension cost-aware certainty composition. Each
dimension (work, span, future per-DB-3) computes its own surviving-
contributor certainty independently; the result certainty is the meet
across dimensions (any unproven dimension makes the whole result
unproven).

```dag
let work_cert = certainty_of_surviving_per_dim(outer, body, outer.work, body.work, composed_work)
let span_cert = certainty_of_surviving_per_dim(outer, body, outer.work, body.span, composed_span)
let composed_certainty = meet_pair(work_cert, span_cert)
```

certainty_of_surviving_per_dim is generalized to take per-dimension
inputs (outer's contribution to this dimension, body's contribution,
the composed dimension result) and walks dominance specifically on that
dimension.

Updates:
- §3.1 compose_summary_iterate: per-dimension certainty composition
  with explicit work + span tracking.
- §3.1 certainty_of_surviving renamed to certainty_of_surviving_per_dim;
  signature parameterized over dimension.
- §3.1 compose_summary_sequential / compose_summary_branch comments
  updated to name the per-dimension pattern.
- §1.5 (Why no BoundedLattice<Certainty>): updated to reference
  certainty_of_surviving_per_dim and per-dimension composition.

Faithful certainty composition restored across all published dimensions.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): effect-enumeration — lens body MUST change to read inhabitance, not signature shape

Cursor BLOCKING on PR #1488 sha 96899484 line 17: the doc moved effect
KIND authority to algebra inhabitance (per §2.4 + §8.1) but the
implementation plan asserted "the lens body does not change. callable_
arrow_effect already implements §2.4's rule" (line 373) + listed the
lens fold body in the NOT-modify list (line 479) + size estimate said
"lens-fold itself is unchanged" (line 494). But callable_arrow_effect
TODAY derives effect kind from signature/body shape — if the body
stays unchanged, it does NOT consume the new inhabits IdempotentRead<R>
/ inhabits Mutating<R> facts. Facts-flow-forward / P2 violation: new
substrate authority not consumed by downstream.

Resolution: the lens body MUST change in its kind-classification
dispatch. Specifically:
- The fold STRUCTURE (per-callable walk + report aggregation) is
  unchanged.
- The per-callable kind classifier IS rewritten — from signature/body
  shape inference to algebra-inhabitance lookup
  (callable_inhabits(callable, idempotent_read_for(resource)) /
  callable_inhabits(callable, mutating_for(resource))).

Updates:
- §6.2 first reason: lens body framing flipped from "does not change"
  to "changes only in its kind-classification dispatch", with explicit
  rationale citing this BLOCKING.
- §9 NOT-modify list: lens fold STRUCTURE preserved; per-callable kind
  classifier explicitly listed as modified (with cross-reference).
- §9 size estimate: "lens-fold itself is unchanged" → "lens-fold
  structure is unchanged; per-callable kind classifier rewrite is S".
- §10 implementation order: NEW step 5 ("Lens kind-classifier
  rewrite") inserted between OperationEffect retirement (step 4) and
  cementing test (now step 6). Total steps 6 → 7; steps-summary
  paragraph updated.

Facts-flow-forward restored across the full migration: new inhabitance
authority lands → lens classifier reads it → effect kind facts flow
into ReadShaped / WriteShaped lens output.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): add lens_enforcement_carrier_landed to r3-structure lane gates

gpt-5-5-pro REQUEST_CHANGES on PR #1488 sha 85a6bb0e (BLOCKING #3):
design-lens-application-surface §10 step 1 declared lens_enforcement_
carrier_landed as a closure gate, but the r3-structure.md lane summary
(lines 40 + 148) omitted it from the authoritative gate list. Per
"tracked vs untracked debt" discipline: a named substrate carrier
(LensEnforcement<Output, Budget>) without a tracked landing gate in the
roadmap leaves new substrate work outside the closure-receipt mechanism.

Resolution: add lens_enforcement_carrier_landed to both lane-summary
gate lists (line 40 + line 148) with explanatory note that it covers
the per-lens projection + violation-relation declarations co-located
with each lens.

(BLOCKINGs #1 + #2 from same review wave at sha 85a6bb0e are already
addressed at e554f85e6 — LensEnforcement carries both project AND
violates per-lens violation relation; substrate authority for
budget-exceeded check is structural, not API-level.)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): §8.5 implementation note — read EnforcedApplication.budget, not config.budget

Codex BLOCKING on PR #1488 sha a525baf0: §8.5 still pointed implementers
at `config.budget`, but the per-variant split at 968994843 dissolved
ApplicationConfig — budget now lives on EnforcedApplication<Output,
Budget> inside the Enforce variant of SectionedLensApplication.
Stale implementation guidance pointing at non-existent authority. P2
violation.

Fixed: §8.5 now describes the lens-fold matching on
Enforce(EnforcedApplication { budget, ... }) and the Introspect case
(no budget).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): effect-enumeration lens body reads signature directly, not via LensEnforcement

Cursor BLOCKING on PR #1488 sha c41b8ce8 line 373: my §6.2 fix said
the new effect_enumeration lens body "reads enforcement.project for
the effect set". But LensEnforcement is the lens-application-surface
budget-projection carrier (T-Lens-Application-Surface lane). The
effect-enumeration lens body is part of T-Lens-Behavioral-Parity
slice 4 — which CASCADES into T-Lens-Application-Surface (the latter
gates on the former being COMPLETE). Reading enforcement.project from
the lens body inverts the cascade AND gives the effect-set fact a
second authority (signature-derived per §2.4(a) vs LensEnforcement
projection).

Resolution: lens body reads effect set DIRECTLY from the callable's
arrow signature (existing substrate query — resource types in
input ∩ output, per §2.4(a)). Kind classification reads
callable_inhabits(...) per §2.4(b). Both queries are within
T-Lens-Behavioral-Parity slice 4 scope; neither depends on
LensEnforcement.

Updated §6.2 line 373 to:
- Replace "reads enforcement.project for the effect set" with "reads
  the effect set directly from the callable's arrow signature
  (existing substrate query; structurally derivable per §2.4(a)
  without any lens-application-surface artifact)".
- Add explicit "neither depends on LensEnforcement from T-Lens-
  Application-Surface (cascade flows the other direction)".

Cascade direction preserved: T-Lens-Behavioral-Parity COMPLETE →
T-Lens-Application-Surface, not vice versa. Effect-set fact has single
authority (signature query); kind fact has single authority (algebra
inhabitance). No lens-application carriers consumed by lens body.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* WIP: Gunbc PM

* docs(r3): per-coordinate certainty on ComplexitySummary (no global collapse)

Codex BLOCKING on PR #1488 sha 75a6ab57: §3.1 computed independent
work_cert and span_cert per-dimension, then immediately collapsed them
into one global ComplexitySummary.certainty via meet_pair. That
collapse loses the per-dimension proof-tightness fact: if work is
Proven but span is Conservative (or vice versa), downstream
display/enforcement consumers see only "globally Conservative" and
cannot know the work bound was proven. P1 modeling faithfulness +
P2 facts-flow-forward violation: the certainty fact each dimension
carries gets fused into ambiguity.

Resolution: ComplexitySummary now carries per-coordinate certainty —
work_certainty and span_certainty as independent fields. No global
certainty field; no meet across dimensions. Each coordinate's certainty
stays on that coordinate through composition.

```dag
type ComplexitySummary {
  work: SymbolicCost
  span: SymbolicCost
  asymptotic_class: AsymptoticClass
  work_certainty: Certainty       // per-coordinate per BLOCKING fix
  span_certainty: Certainty
}
```

Updates:
- §1.7 ComplexitySummary declaration: split certainty into work_certainty
  + span_certainty with explicit rationale citing this BLOCKING.
- §3 ComplexitySummary declaration in lens body section: same split.
- §3 outer Loop construction: outer.span = outer.work, so both
  certainties = bound_cert.
- §3.1 compose_summary_iterate: drop the global meet across dimensions;
  work_certainty := work_cert, span_certainty := span_cert independently.
- §3.1 certainty_of_surviving_per_dim signature: takes per-dimension
  certainty inputs (outer_cert, body_cert) explicitly; no global
  outer.certainty / body.certainty lookup.
- §3.1 compose_summary_sequential / compose_summary_branch comments:
  pattern updated to "no meet across dimensions; per-coordinate
  independence preserved on output".

asymptotic_class is still a projection of work; its certainty is
work_certainty (no separate class_certainty since the class is derived,
not independent). All facts faithful to the dimension they qualify.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): align lens-application doc with per-coordinate certainty (work_certainty / span_certainty)

Cursor APPROVE_WITH_COMMENTS finding on PR #1488 sha 37f3bc62: lens-
application-surface lines 125 + 152 still described ComplexitySummary
with a single `certainty` field, but my fix at 955cafe2c split certainty
into per-coordinate work_certainty + span_certainty in the complexity-
lens design. Sibling-doc mismatch — same carrier shape described two
ways across two design docs in the same PR.

Updated lines 125 + 152 to match complexity-lens §1.7's per-coordinate
shape:
- Line 125 inline comment: "rich output: work/span/asymptotic_class/
  work_certainty/span_certainty".
- Line 152 narrative: "rich (ComplexitySummary { work, span,
  asymptotic_class, work_certainty, span_certainty } — per complexity-
  lens §1.7, certainty is per-coordinate to avoid collapsing per-
  dimension proof-tightness facts)".
- "Forcing output = budget would drop work/span/certainty facts" →
  "drop work/span/per-coordinate-certainty facts".

Cross-doc carrier-shape consistency restored.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* WIP: Gunbc PM

* docs(r3): codex BLOCKINGs #1-3 (sha 37f3bc62) — substrate assumptions aligned with v3 reality

3 BLOCKINGs at sha 37f3bc62, all claiming docs lock substrate assumptions
v3 cannot currently express:

BLOCKING #1 (cost-lens SizeVariable label): doc said renderer reads via
intern_table::name_of(port_id). Verified: src/v3/std/algebra.dag:143
explicitly says "InternTable lookup the lens doesn't yet run". v3 has
some InternTable machinery (PR #367 Phase 1) but the port-id-to-name
query is NOT landed. Cannot assume it.

Resolution: re-introduce SizeVariable.display_name: String? as the single
substrate authority for the user-facing name. No InternTable lookup
assumed. Field is single-source (not parallel with anything); parser
populates from authored binding names where present, None for inferred.
Earlier "parallel authority" concern (gpt-5-5-pro at ef21e1a0) doesn't
apply because there's no second source — InternTable lookup isn't
landed and isn't claimed.

BLOCKING #2 (per-variant generics): doc declared
SectionedLensApplication = Enforce<Output, Budget>(...) | Introspect<
Output>(...) — but v3 .dag sums use uniform type parameters across
variants (e.g., Lookup<C> = Miss | Hit(C); both share C). Per-variant
parameter binding / existential packaging not currently supported.

Resolution: drop the SectionedLensApplication SUM. Use TWO SEPARATE
top-level carriers — EnforcedApplication<Output, Budget> and
IntrospectApplication<Output>. Lens-fold pass walks two separate lists
and emits Diagnostics from Enforce walks, records values from Introspect
walks. No per-variant generics required. Each lens application in .dag
source is one or the other; user authoring chooses at apply_lens site.

BLOCKING #3 (TestPredicate maturity): doc said "Today's TestPredicate
coproduct covers 22 variants" listed by name, treating them as
uniformly-live substrate. Per verification.dag inline annotations,
many are 🟡 Scaffold with named dissolution triggers (ExecuteCommand,
ForAllTargets, LensOutputEquals, DifferentialEquals,
BinaryDimensionReportEquals, AlgebraicLaw, ReleaseDeferredClaim,
SubstrateResearchDeferredClaim).

Resolution: §1 explicitly disclose 🟢 TERMINAL vs 🟡 Scaffold partition;
note that ports landing on Scaffold variants are inherently scoped by
that variant's named dissolution trigger; new-carrier residual is in
scope of T-Tests-As-Data-Completeness, not assumed live.

Updates:
- design-cost-lens §1.2: SizeVariable.display_name reintroduced as single
  authority; revert §1.4 from renderer-only to additive field; both wave
  reviews now reconciled.
- design-lens-application-surface §2: SectionedLensApplication sum
  removed; two top-level carriers (EnforcedApplication +
  IntrospectApplication). Downstream §3 + §4 + §5 + §6 + §8.5 + §9 +
  §10 references updated to "two separate top-level carriers" framing.
- design-tests-as-data §1: TestPredicate maturity disclosure (TERMINAL
  vs Scaffold partition with named dissolution triggers per
  verification.dag inline annotations).
- design-r3-lens-substrate-index: substrate-authority table updated to
  drop "sum" and list two separate carriers.

All three BLOCKINGs reflect the constraint: design docs cannot assume
substrate facilities not yet landed, and cannot use shapes v3 cannot
currently express.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(r3): cementing test asserts per-coordinate certainty (work + span), not collapsed

Codex BLOCKING on PR #1488 sha e3010014: §1.7 changed ComplexitySummary
to per-coordinate work_certainty + span_certainty (closing the global-
collapse bug at PR #1488 / 955cafe2c), but §4.1 cementing test still
asserted a single global v3.certainty. Internally inconsistent: closure
gate would not validate the per-coordinate claim §1.7 makes; the test
would…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant