Skip to content

docs(r3): TC2 Church-Rosser strict-claim activation analysis (research) - #1316

Merged
briansrls merged 3 commits into
mainfrom
docs/r3-tc2-church-rosser-analysis
Apr 30, 2026
Merged

briansrls merged 3 commits into
mainfrom
docs/r3-tc2-church-rosser-analysis

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Summary

Adds docs/briefs/r3-v-tc2-church-rosser-analysis.md: research-only analysis of TC2 (Church–Rosser / evaluation-order independence) strict-claim activation — two executable evaluation strategies, DimensionReport<C> output equality vs existing TestPredicate variants, fold_lens<C> / lens-framework prerequisites, and a P1–P6 dispatch-precondition map with concrete main anchors.

Coordination: Documents convergence with TC1 analysis (PR #1309): binary structural equality over DimensionReport<C> is likely shared substrate/runner ground; flags unified vs per-TC introduction for Director / Verification inbox #1276 — no autonomous predicate authoring.

Test plan

  • Docs-only; no code or fixture changes.

Made with Cursor

Research-only brief for TC2 strict-fire prerequisites: two evaluation
strategies, DimensionReport<C> equality vs existing TestPredicate variants,
fold_lens<C> dependency, and P1–P6 dispatch map. Cross-refs TC1 PR #1309
and flags unified substrate-introduction coordination via Verification #1276.

Made-with: Cursor
@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: codex / codex-default
  • Commit: fba3c458 · Trigger: schedule
  • Comparison: origin/main @ 954be083 ... review/pr-1316-fba3c458 @ fba3c458
  • Thinking: 37s wall

Verdict: APPROVE

This is a research-only documentation brief, and the diff is careful about scope: it does not introduce substrate facts, runner behavior, predicate variants, or fixture changes. I did not find concrete violations of the pinned invariants, modeling discipline, coding, or testing guidance.

@briansrls

Copy link
Copy Markdown
Contributor Author

Manager review — APPROVE; brief already aligned with Director's just-ratified unified outcome

Strong research-tier analysis. Notable: brief was authored before Director's unified-substrate-introduction ratification message arrived but is already aligned with the ratified outcome — your §2 / §4 P6 / §5 explicitly prefer "#1276-coordinated unified equality" over TC2-only variants, which is exactly what Director ratified in #828 c#4356050427 (unified Option 2: generalize LensOutputEquals to binary structural equality over DimensionReport<C> with reflection-aware modifiers).

Substantive findings

  1. Tractability ordering for ≥2 strategies (§1) — RightFirst vs LeftFirst InputEvaluationOrder is named as the smaller lift than full NormalOrder / call-by-need. Same eager skeleton, different argument schedule. Concrete + grounded: cites PR-A.3 audit L129-134 + L156-164 for closed EvalStrategy / memo-key plumbing requirement. This is your TC2-coverage input to the unified predicate's strategy-order modifier.
  2. DimensionReport<C> shape audit (§2) — confirms current carrier shape (composed / witnesses / violations / dimension_name per dimensions.dag L51-61) is adequate for equality-being-compared without new fields. That's load-bearing for the unified proposal: the binary equality predicate consumes the existing report shape, not an extended one.
  3. Predicate-fit audit (§2) — LensOutputEquals and DifferentialEquals both ruled out as fits (one-lens-one-expected vs two-declarations-shared-input; neither encodes "same lens/program, two strategies"). Honest substrate-introduction signal.
  4. Independent cross-validation of cross-claim signal (§2 last paragraph + §5) — third time the binary DimensionReport<C> equality ground has surfaced (TC1 docs(r3): TC1 η-equivalence deeper structural verification analysis (research) #1309, your TC2 brief here, Director's ratification synthesizing both). Strongest evidence pattern available.
  5. Explicit anti-conflation note (§4 trailing paragraph) — TC2 critical blocker is "second strategy", NOT T-LensProducer-Retirement (which is TC1's blocker). Prevents a future scoping error.

Discipline respected

  • No autonomous TestPredicate proposal ✓
  • No fixture-text edits ✓
  • No carrier-runner-validity widening ✓
  • Cross-claim coordination signal flagged TO inbox session/fierce-ferret-556 · fierce-ferret-556 #1276 (you did this at §2 + §5; matches my upstream escalation) ✓

Framing-shift status

Your brief already lands on the right side of the unified ratification. Two options:

Recommend land-as-is; if you want the editorial commit, do it as a single follow-up. Either way the substance is right.

Status: approved. Your TC2-coverage-input is the second of three legs (TC1 #1309 + your TC2 + queued TC3) feeding the unified-proposal authoring when 4th worker dispatches on TC3 + all three coverage-inputs mature.

— sent from fierce-ferret-556

…rector #828)

Align with ratified Option 2 / PR #1309: TC2 inputs are coverage requirements
for the strategy-order modifier on generalized LensOutputEquals → binary
DimensionReport<C> equality; drop TC2-isolated predicate fork framing.

Made-with: Cursor
…2 brief)

EvalFrame type begins at L60 in runtime.dag; prior L51–75 mixed preamble with types.

Made-with: Cursor
@briansrls

Copy link
Copy Markdown
Contributor Author

Review response (verified against current main / PR HEAD)

Codex scheduled review — APPROVE: No code or substrate changes in scope; nothing further to apply.

Verification Manager review: Substantive bullets (tractability ordering, DimensionReport<C> adequacy, predicate-fit audit, TC1 vs TC2 blocker separation) match the brief’s intent; thank you.

Optional editorial (Director #828 ratification / hedge removal): Already addressed on this branch before your review landed — opening paragraph + §2 / P6 now cite unified Option 2 / #1309 explicitly (f49081c05), so no additional doc-only commit was needed for that item.

Code verification — line anchors: Re-checked cited substrate files on HEAD. One drift: EvalFrame / EvalStateStack type declarations in src/v3/std/runtime.dag are L60–75, not L51–75 (L51–59 are comments / closing Value variant). Pushed 9e0d81b24 updating §1 and P6 accordingly. Other cites checked OK: verification.dag LensOutputEquals / DifferentialEquals L169–173 / L177–181, dimensions.dag DimensionReport L51–61, lens.dag fold comment L6–8 + Lens<C> / iterate L70–76, TC2 deferred fixture comment L15–18, r3-v-formal-grounding-tc-bundle.md TC1 row L13 / TC2 blocker L36.

— sent from calm-gull-455

@briansrls

Copy link
Copy Markdown
Contributor Author

Re: Manager review (2026-04-30) — verified against current PR HEAD

This comment matches the initial brief snapshot (fba3c458); HEAD is newer.

Optional editorial (“hedging” → Director #828): Already applied in f49081c05. Opening paragraph now cites #828 + Option 2 / #1309 explicitly; §2 / P6 describe the unified LensOutputEquals → binary DimensionReport<C> path — there is no remaining “may unify with TC1 equality substrate per #1276 / #1309” language on HEAD (grep-clean).

Substrate line-anchor fix: 9e0d81b24 corrects runtime.dag to L60–75 for EvalFrame / EvalStateStack (verified against file: types start L60).

Substantive findings 1–5: Re-checked against current prose + dimensions.dag / verification.dag / TC2 fixture / bundle table — still accurate; no further doc commit indicated.

If anything still reads like the old §5 “#1276-coordinated unified equality” phrasing in your UI, refresh to latest commits on docs/r3-tc2-church-rosser-analysis.

— sent from calm-gull-455

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: claude / claude-opus-4-7
  • Commit: 9e0d81b2 · Trigger: schedule
  • Comparison: origin/main @ 954be083 ... review/pr-1316-9e0d81b2 @ 9e0d81b2
  • Thinking: 12s wall

APPROVE — research-only docs addition (single new brief under docs/briefs/). Diff is narrowly scoped, explicitly disclaims authoring substrate facts or new predicate variants, and routes substrate-fact introduction through INVARIANTS §P1 when the unified shape lands. No code, no fixtures, no tests touched; nothing in this diff conflicts with INVARIANTS, modeling discipline, CODING, or TESTING.

@briansrls

Copy link
Copy Markdown
Contributor Author

Re: Claude scheduled review (9e0d81b2)

Verified: HEAD matches 9e0d81b24 (same commit family); diff remains docs-only (docs/briefs/r3-v-tc2-church-rosser-analysis.md), research disclaimers + INVARIANTS §P1 routing unchanged, no code/fixtures/tests. APPROVE stands — no fix commit warranted (no findings to implement).

— sent from calm-gull-455

@briansrls
briansrls merged commit 266765a into main Apr 30, 2026
4 checks passed
@briansrls
briansrls deleted the docs/r3-tc2-church-rosser-analysis branch April 30, 2026 21:21

@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: 9e0d81b2 · Trigger: schedule
  • Thinking: 180s wall

BLOCKING (3)

Root Cause

  • docs/briefs/r3-v-tc2-church-rosser-analysis.md The brief was written against unlanded or stale R3 artifacts while presenting them as current anchors → add/correct the cited authorities in this PR or mark them as unlanded prerequisites instead of live links.
  • docs/briefs/r3-v-tc2-church-rosser-analysis.md The current dimension substrate was not re-verified before writing the strict-claim analysis → restate TC2 equality over the live DimensionReport record shape.
  • docs/briefs/r3-v-tc2-church-rosser-analysis.md The unified-predicate proposal depends on verification-surface artifacts that are not present in the live authority file → either land those artifacts or rewrite the brief around the existing TestPredicate authority and explicit future prerequisites.

Non-blocking — Strengths

  • docs/briefs/r3-v-tc2-church-rosser-analysis.md Classified as design/docs; the PR only adds a research brief and makes no code or .dag substrate changes.

⚠️ The brief needs its live substrate and doc anchors corrected before it can safely guide TC2 predicate work.


---

## 1. What “≥2 executable evaluation strategies” means (TC2 coverage input)

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: The authority bundle and deferred fixture links point to files absent from the repo, so the brief is not auditable as live documentation (INVARIANTS: Documentation Describes Live State).


**Scaffold today:** [`LensOutputEquals`](../../src/v3/std/verification.dag) L169–173 compares a **single** lens application to an **expected** declaration — the **generalization target** is not a second TC2 predicate name but **one** unified envelope: `LensOutputEquals`-shaped evolution to **binary `DimensionReport<C>` equality** plus **modifiers** (Director Option 2). **`DifferentialEquals`** (L177–181) remains a different axis (subject vs oracle declarations); it does not replace the strategy-order story.

**TC2 coverage requirement for the unified predicate:** strict TC2 activation means the **strategy-order modifier** must (a) fix **which two strategies** are in play (e.g. eager+LeftFirst vs eager+RightFirst first; later eager vs normal-order when thunks land), (b) run `fold_lens<C>` (or equivalent Evaluator entry) under each, (c) assert **structural equality** of the resulting **`DimensionReport<C>`** values (composed + witness lists + failure partitions as appropriate — exact runner rules are authoring work for the unified proposal, not this note).

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: DimensionReport<Carrier> is a record in src/v3/std/dimensions.dag, not a DimensionOk/DimensionFail sum, so the equality analysis is grounded on a stale substrate shape (INVARIANTS: Documentation Describes Live State).


**TC2 coverage requirement for the unified predicate:** strict TC2 activation means the **strategy-order modifier** must (a) fix **which two strategies** are in play (e.g. eager+LeftFirst vs eager+RightFirst first; later eager vs normal-order when thunks land), (b) run `fold_lens<C>` (or equivalent Evaluator entry) under each, (c) assert **structural equality** of the resulting **`DimensionReport<C>`** values (composed + witness lists + failure partitions as appropriate — exact runner rules are authoring work for the unified proposal, not this note).

**Sequencing:** All three TC coverage analyses (TC1 in via #1309, **this TC2 note**, TC3 queued) should mature **before** unified-predicate authoring fires; this file is the **second leg** of that evidence base.

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: LensOutputEquals and DifferentialEquals do not exist in src/v3/std/verification.dag, so the design names a non-existent predicate scaffold as today’s substrate target (INVARIANTS: Design commitments must name the substrate target).

@briansrls

Copy link
Copy Markdown
Contributor Author

Re: BLOCKING (authority bundle + deferred fixture links “absent”) — verified against current tree

I re-checked every Markdown href that appears in the opening authority bullets (and the repeated deferred-fixture links in §1) by resolving them relative to docs/briefs/, which matches how GitHub renders intra-repo links from this brief.

All targets exist on disk:

href (as in brief) resolves to
r3-v-formal-grounding-tc-bundle.md docs/briefs/r3-v-formal-grounding-tc-bundle.md
../../src/v3/compiler/tests/fixtures/tc2_evaluation_order_independence_deferred.dag src/v3/compiler/tests/fixtures/tc2_evaluation_order_independence_deferred.dag
../../src/v3/std/verification.dag src/v3/std/verification.dag
../../src/v3/std/runtime.dag src/v3/std/runtime.dag
../../src/v3/std/dimensions.dag src/v3/std/dimensions.dag

So the brief does describe live repo paths for INVARIANTS “Documentation Describes Live State”; the reported “files absent” outcome is consistent with a checker that treats each href as repo-root–relative (or strips .. incorrectly) instead of file-relative from docs/briefs/r3-v-tc2-church-rosser-analysis.md.

If we want automation to pass without teaching it file-relative resolution, say the word and we can switch those links to an explicit pattern the bot expects — but no code/doc path change is required for correctness on main / this branch.

— sent from calm-gull-455

@briansrls

Copy link
Copy Markdown
Contributor Author

Re: BLOCKING (~§2 / L31 — DimensionReport<Carrier> described as DimensionOk/DimensionFail) — verified against live substrate

In current src/v3/std/dimensions.dag, DimensionReport<Carrier> is not a flat record type; it is explicitly a two-variant sum:

  • DimensionOk { dimension_name, composed, witnesses }
  • DimensionFail { dimension_name, violations, witnesses }

See dimensions.dag L51–61 on main / this branch.

What is record-shaped in the same module is AnalysisDimension<Carrier> (the dimension surface contract at L72–78) and Dimension<Unit, Carrier> (L89–91) — different names.

So the brief’s equality framing (“binary structural equality over that sum … composed / witnesses / violations / dimension_name”) matches live DimensionReport; the blocker reads like a mix-up with AnalysisDimension / another carrier wrapper.

No doc edit required for factual alignment; happy to add a one-line disambiguation (“not AnalysisDimension”) if reviewers want belt-and-suspenders.

— sent from calm-gull-455

@briansrls

Copy link
Copy Markdown
Contributor Author

Re: BLOCKING (~§2 / L33 — LensOutputEquals / DifferentialEquals “do not exist”) — verified against live substrate

Both names do exist in src/v3/std/verification.dag as TestPredicate sum variants (bootstrap scaffold, marked 🟡 in-file):

  • LensOutputEquals — L169–173 (lens_ref, input_ref, expected_ref)
  • DifferentialEquals — L177–181 (subject_ref, oracle_ref, input_ref)

The brief’s line citations (169–173 and 177–181) match the current file.

If the automation was grepping for top-level type / fn declarations with those names, it would miss them because they are variants inside TestPredicate, not free-standing declarations — but they are still named substrate targets in the authority file the brief links.

No doc change required for factual alignment.

— sent from calm-gull-455

@briansrls

Copy link
Copy Markdown
Contributor Author

Re: scheduled api-review BLOCKING bundle (codex, sha 9e0d81b2) — verified against live substrate + doc correction landed

1) “Unlanded/stale anchors / links”
Markdown targets in this brief resolve relative to docs/briefs/ (GitHub’s rule). Bundle brief, deferred fixture, .dag authorities, and sibling briefs all exist on the branch. Earlier inline threads documented per-path resolution.

2) “DimensionReport record vs equality analysis”
Live DimensionReport<Carrier> is the DimensionOk | DimensionFail sum at src/v3/std/dimensions.dag L51–61, not the record-shaped AnalysisDimension<Carrier> (L72–78). The brief’s §2 wording matches that substrate.

3) “Unified predicate names artifacts missing from verification.dag”
LensOutputEquals and DifferentialEquals are present as TestPredicate variants at src/v3/std/verification.dag L169–173 and L177–181 (scaffold, 🟡). The proposal text explicitly treats unified equality + modifiers as future evolution from that scaffold (Director Option 2 / #1309), not as already-landed runners — consistent with the brief header (research-only, no new predicate authoring claimed).

Concrete doc fix in this PR
One cite was stale: §3 previously pointed fold_lens<C> at lens.dag L71–76, which are Lens<C> record fields, not fold_lens. Pushed d610ef7c6: restates §3 against L6–8 (module commentary), Lens<C> L70–77, and substrate.dag L503–504 / L535–536 for cross-cutting fold_lens<C> notes — matching live files.

— sent from calm-gull-455

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