Skip to content

docs(r3): design-free-consequences — Lane 3 closure deliverable - #1391

Merged
briansrls merged 8 commits into
mainfrom
docs/free-consequences-design
May 1, 2026
Merged

briansrls merged 8 commits into
mainfrom
docs/free-consequences-design

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Summary

  • adds docs/design-free-consequences.md as the Lane 3 prose deliverable
  • maps auto-parallelism, auto-loop-parallelism, auto-memoization, and cross-target optimization to their lens algebra inputs and testcase anchors
  • keeps space-bound CX as a status/reference item under R1/T-LaneE authority rather than re-deriving a Lane 3 proof

Validation

  • git diff --check
  • cargo fmt --all --check

Status

PROPOSAL — subject to Director ratification on per-consequence framing.

@briansrls

Copy link
Copy Markdown
Contributor Author

Manager review — APPROVE; clean Lane 3 prose deliverable with substantive enhancement

Strong execution. Closes the Lane 3 acceptance pair (10-gate suite + design doc) when this merges.

Substantive findings

  1. Dual-deliverable framing explicit (header) — "testcase half is the 10-gate suite ... this document is the prose half." User directive cited verbatim. Sets up the closure pairing cleanly.
  2. Discipline anchor (feedback_lenses_not_passes) — explicit citation as the underlying framing; positions all 5 sections as derived from the lens-not-passes invariant rather than re-derivation.
  3. DB-3/DB-20 split preserved across both parallelism sections — both auto-parallelism + auto-loop-parallelism explicitly NOT DimensionReport<C> consumers. Critical to prevent the PR feat(v3): TC1 unified consumer + Free-Consequences first batch (5 gates) #1353 → fix(v3): keep Free-Consequences parallelism off DimensionReport #1376 mistake from re-emerging at the prose level.
  4. Memoization-subsumes-lens-fold-caching dissolution discipline (§3) — "Runtime memoization of a lens fold is one instance of this same free consequence, not a separate 'lens framework caching' feature." Exact framing from Director's #828 c#4356050427 memoization framing. Anchors Lens.read purity invariant from design-lens-framework.md.
  5. Cross-target nuance correctly framed (§4) — "not byte-identical, not identical syntax. Each target may choose target-native forms. The guarantee is that the cost and semantic relation is structurally preserved through the target's LanguageSpec facts." Constant folding example concrete. This avoids the byte-equal anti-pattern.
  6. Space-bound CX cites R1 authority correctly (§5) — complexity_merge_sort_is_nlogn / complexity_merge_sort_v3_matches_v2_oracle / lane_e_bundled_witness_host_emit_parity named; R1 closure manager + R2-R3 thesis mapping cross-refs. Explicit "Lane 3 does not re-prove space bounds" framing per feedback_audit_adjacent_authority_first discipline. Honest tracking-only mention of thesis-validation-plan.md deferring proven space bound per function.
  7. Closure shape explicit (final §) — "closes only when this document and the 10-gate suite are both accepted. The gates are not heuristic demos." Anchors the substrate-fact-introduction cadence.

Substantive enhancement (manager flag for transparency)

The lens algebra in §1 + §2 adds Lens<Effect-Commutativity> as a factor:

  • §1 Auto-parallelism: Lens<Bind-Independence> * Lens<Effect-Commutativity> * Lens<Cost>
  • §2 Auto-loop-parallelism: Lens<Iteration-Independence> * Lens<Effect-Commutativity> * Lens<Cost>

This goes beyond the dispatch text (which followed r3-structure.md L101 verbatim: Lens<Bind-Independence>·Lens<Cost> only). The enhancement is structurally correct — independence alone is insufficient if effects don't commute — and grounded in docs/design-db18-workflow-effect-carrier.md + docs/design-db20-lane2-stage2e-parallelism-lens.md.

Manager call: the enhancement is substantively right; the cited DB-18/DB-20 authorities support it. But it does diverge from r3-structure.md L101's 2-factor framing. Two dispositions:

  • Land as-is (preferred) — this prose document IS the place to make the lens algebra substantively correct rather than copying r3-structure.md drift; the testcase anchors don't change.
  • Director-ratify if the 3-factor framing should propagate back into r3-structure.md L101 for cross-authority consistency.

I'll surface to Director on #828 for the propagation-vs-prose-only call. Not a blocker; the document stands.

Discipline respected

  • No substrate edits ✓
  • No new TestPredicate variants ✓
  • No new lens carriers invented (cites existing DB-18 / DB-20 / lens-framework only) ✓
  • DB-3/DB-20 framing honored across both parallelism sections ✓
  • 153 lines (within ~1-2 page target) ✓
  • 9+ adjacent-authority cross-refs (feedback_audit_adjacent_authority_first applied) ✓

Cross-claim coordination

Discipline patterns from this cycle now visible across all 5 sections — DB-3/DB-20 + lens-not-passes + memoization-dissolution + audit-adjacent-authority. Document reads as a synthesis of the cycle's learned patterns, not a fresh derivation. That's the right shape for closure prose.

Status: approved. Lane 3 acceptance pair (10-gate suite ✓ + this design doc) complete when this merges. T-Free-Consequences-Demonstration becomes the first fully-closed R3 lane under Verification Mgr.

— sent from fierce-ferret-556

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: cursor / composer-2
  • Commit: bf0d4a23 · Trigger: schedule
  • Comparison: origin/main @ f7d5ff3d ... review/pr-1391-bf0d4a23 @ bf0d4a23
  • Thinking: 28s wall

Verdict: APPROVE — The diff only adds docs/design-free-consequences.md. It is explicitly PROPOSAL, disclaims new substrate / TestPredicate / lens carriers, and frames “free consequences” as conditional on named lens witnesses with conservative fallback when evidence is missing — which matches P3 (fail-closed) and P1 (“no heuristic pass”) from INVARIANTS.md without the doc pretending those producers are already substantive. Section 5 correctly treats space-bound CX as reference / R1 authority, avoiding “Documentation Describes Live State” drift. CODING.md / TESTING.md do not apply to this diff (no Rust or test changes). Cross-links and the named gate list align with the existing two fixture files (10 claims total). No rubric-grounded findings from the diff.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: bf0d4a23 · Trigger: manual
  • Comparison: main @ f7d5ff3d ... docs/free-consequences-design @ bf0d4a23
  • Conversation: View conversation

1. Story of the diff

This PR adds docs/design-free-consequences.md, a prose closure artifact for Lane 3’s “free consequences” work. The document deliberately frames each consequence as conditional on declared lens witnesses rather than as a new compiler pass or a new substrate surface: it says up front that it adds no substrate facts, TestPredicate variants, or lens carriers (docs/design-free-consequences.md:3-6). The load-bearing pattern is repeated across auto-parallelism, loop parallelism, memoization, and cross-target optimization: a guarantee exists only when named lens inputs produce evidence, and otherwise the compiler must take a conservative path rather than infer from heuristics (docs/design-free-consequences.md:14-17). It also keeps Space-Bound CX scoped as reference/status material rather than expanding Lane 3’s authority over space proofs (docs/design-free-consequences.md:140-146).

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation).

N/A — the diff is documentation-only and explicitly says it “does not introduce substrate facts, new TestPredicate variants, or new lens carriers” (docs/design-free-consequences.md:3-6).

  1. INVARIANTS.md + modeling-discipline.md.

Compliant — fail-closed / facts-flow-forward discipline is stated directly: guarantees are structural only when named lens inputs exist and produce witnesses, and missing witnesses require conservative behavior rather than heuristic inference (docs/design-free-consequences.md:14-17). The same pattern appears in the safety cases for dependent binds and branch arms (docs/design-free-consequences.md:52-54) and for loop evidence (docs/design-free-consequences.md:77-78).

  1. CODING.md.

N/A — no Rust implementation, helper placement, error/result shape, or method/free-function surface is changed.

  1. TESTING.md.

Compliant — for a docs-only closure artifact, the prose ties itself to the existing 10-gate suite (docs/design-free-consequences.md:11-13) and names behavior anchors for each guarantee family, including auto-parallelism (docs/design-free-consequences.md:46-50), loop parallelism (docs/design-free-consequences.md:71-75), memoization (docs/design-free-consequences.md:96-99), and cross-target optimization (docs/design-free-consequences.md:121-124). I did not verify fixture contents because they are not part of this diff.

  1. LOCKED DESIGN DECISIONS.

Compliant — the doc references locked or previously assigned surfaces without silently changing them: workflow parallelism stays outside DimensionReport<C> and rooted in DB-20-style ordinary lens data (docs/design-free-consequences.md:39-44), loop evidence is likewise kept out of DimensionReport<C> (docs/design-free-consequences.md:66-69), and Lens.read purity is cited as a locked invariant rather than redefined (docs/design-free-consequences.md:90-94).

  1. TRACKED vs UNTRACKED DEBT.

Compliant — the only temporary shape called out in the diff is the pending auto-parallelism fixture lens, and it is documented, bounded to the current first-batch fixture / LensOutputEquals consumer shape, and given a dissolution trigger: move to src/v3/lenses/parallelism.dag once the real producer lands (docs/design-free-consequences.md:41-44). The closure paragraph also bounds the gates as consumer-shape pins that become substantive when Lens<C> producers and R2-Evaluator witness construction land (docs/design-free-consequences.md:150-153).

3. Verdict

APPROVE. The diff is a scoped documentation deliverable that avoids claiming new substrate authority, keeps guarantees witness-driven and fail-closed, and bounds its temporary/pending lens language with a dissolution path. No review finding is anchored in the changed lines.

@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: bf0d4a23 · Trigger: schedule
  • Thinking: 397s wall

BLOCKING (2)

Root Cause

  • docs/thesis/r2-r3-thesis-mapping.md Free-consequence disposition stayed at the pre-lane state after T-Free-Consequences-Demonstration was added → update the mapping rows to name the R3 demonstration lane/gates or explicitly state how the new lane supersedes the old "post-R3/no demo lane" classification.
  • src/v3/compiler/tests/fixtures/r3_free_consequences_second_batch.dag auto_loop_parallelism_pending_lens and auto_loop_parallelism_pending_expected encode the same scalar placeholder → make pending loop gates mismatch like the first-batch auto-parallelism gates or gate acceptance on the real structural producer.

ROADMAP — Incomplete

  • T-Free-Consequences-Demonstration: The lane is present in docs/r3-structure.md, but the thesis coverage map still says these consequences are not release-gated and have no demo lane.

⚠️ The design direction is sound, but the release authority split and non-fail-closed pending loop gate need fixing before this closes.

@@ -0,0 +1,153 @@
# Design: Free Consequences

**Status:** PROPOSAL - Lane 3 closure deliverable for

This comment was marked as resolved.

loop parallelizer.

This mirrors `Lens<Bind-Independence>` rather than creating a new dimension. The
second-batch fixture therefore uses the same ordinary `LensOutputEquals` shape

This comment was marked as resolved.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: cursor / composer-2
  • Commit: 640c1695 · Trigger: schedule
  • Comparison: origin/main @ f7d5ff3d ... review/pr-1391-640c1695 @ 640c1695
  • Thinking: 906s wall

Findings: None. The diff only adds docs/design-free-consequences.md and tightens one row in docs/r3-structure.md. There is no compiler or substrate change, so P1–P5, modeling-practice checks on types/boundaries, CODING.md, and TESTING.md do not apply in a way this diff can violate. The new doc is explicitly PROPOSAL, states it does not introduce substrate facts or new carriers, and frames guarantees as conditional on witnesses with conservative fallback—consistent with fail-closed / “lenses not passes” framing in INVARIANTS.md. Referenced fixtures src/v3/compiler/tests/fixtures/r3_free_consequences_{first,second}_batch.dag are present in the tree, so this is not an obvious “docs describe non-live state” mismatch for those paths.

Verdict: APPROVE — Narrow documentation deliverable; prose matches the updated lane table (effect-commutativity in the free-consequences algebra); no rubric violations grounded in the diff.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: dc1e7130 · Trigger: schedule
  • Comparison: origin/main @ e0c1091b ... review/pr-1391-dc1e7130 @ dc1e7130
  • Thinking: 12s wall

Verdict: APPROVE — Docs + a small fixture/test adjustment that flips the loop-parallelism placeholder to fail-closed (0 != 1), with the test updated to match. The doc explicitly calls out the intentional mismatch and the dissolution trigger (real WorkflowParallelismReport producer in src/v3/lenses/parallelism.dag). Consistent with feedback_lenses_not_passes, no substrate changes, no invariant violations observed.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: 4ce4f45f · Trigger: schedule
  • Comparison: origin/main @ 9ae8d8c0 ... review/pr-1391-4ce4f45f @ 4ce4f45f
  • Thinking: 12s wall

Verdict: APPROVE — Docs-only Lane 3 closure deliverable plus a small fail-closed adjustment to the second-batch fixture/test. The placeholder mismatch (0 != 1) intentionally keeps the loop-parallelism gates failing until a real Lens<Iteration-Independence> producer lands, with a clear dissolution pointer to src/v3/lenses/parallelism.dag. The thesis-mapping table and r3-structure.md row update align with the new design doc. No substrate changes, no invariant violations observed in the diff.

@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: 4ce4f45f · Trigger: schedule
  • Thinking: 103s wall

Non-blocking — Strengths

  • docs/design-free-consequences.md Classified as mixed: design/docs, .dag fixture, and Rust integration-test changes, with no new substrate facts or carrier shapes introduced.

ROADMAP — Verified

  • T-Free-Consequences-Demonstration: The lane authority, thesis mapping, and fail-closed pending loop gate now agree on the R3 demonstration scope.

✅ No blocking concerns found in the changed lines.

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