Skip to content

Complete gate #87 lens cementing receipts - #2757

Merged
briansrls merged 5 commits into
mainfrom
session/sleek-gull-378
May 12, 2026
Merged

briansrls merged 5 commits into
mainfrom
session/sleek-gull-378

Conversation

@briansrls

@briansrls briansrls commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Completes the gate #87 follow-up after #2742 by replacing the remaining regen cementing Compiles placeholders with named .dag LensOutputEquals receipts. #2742 re-enabled and inventoried the per-lens harnesses; this PR makes the remaining placeholder rows behavior-bearing by routing them through explicit Int-projection witnesses.

The new hand-Rust surface is intentionally narrow and centralized in src/v3/compiler/src/test_runner.rs: eval_gate_87_cementing_projection recognizes the gate-specific witness functions and compares their computed Int result against the .dag expected value. This keeps the .dag claim as the receipt authority while full carrier literals such as EffectEnumerationReport, Origin, List<UnusedParameter>, and List<UnresolvedArrowBody> are still not stable to author directly.

Why this follows #2742

PR #2742 restored the gate #87 regen harness execution and inventory ratchet, but several harnesses still proved only wiring via Compiles. This PR preserves that inventory and upgrades those rows to named cementing projections so the test names match the behavior being asserted.

Test plan

  • cargo fmt --check — passed locally.
  • cargo test -p v3-compiler t_pb_b_1_dag_runner_test::r3_gate_87_cementing_regen_lens_suites_pass_through_runner --test integration — passed through BuildBuddy.
  • cargo test -p v3-compiler r3_gate_87_lens_cementing_regen_receipts_test --test integration — passed through BuildBuddy.
  • GitHub Actions: relying on PR Complete gate #87 lens cementing receipts #2757 CI for full fmt, changes, ci, and v3 coverage before merge.

Worker attestation

  • Title describes the change.
  • PR body summarises what and why.
  • Tests run are listed above with outcomes.
  • No GitHub issue close directive; this is dashboard node gate-87.
  • No surprise commits in the local branch scope.
  • No secrets, credentials, or large binaries included.

@briansrls
briansrls marked this pull request as ready for review May 12, 2026 12:53
@briansrls briansrls changed the title lens_cementing_test_discipline_complete Complete gate #87 lens cementing receipts May 12, 2026
@briansrls

briansrls commented May 12, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I verified the optional CARGO_MANIFEST_DIR / ancestors().nth(3) observation against the current code. I am not changing it in this PR because it is deliberately scoped to the gate #87 source-compiles projection, mirrors the current src/v3/compiler to workspace-root crate layout, and any future crate move would fail the named LensOutputEquals witness as expected 1, computed 0 rather than silently passing.

The PR body now carries the P5-style checkable receipt: it names the #2742 follow-up, the test-runner projection adapter surface, and the exact tests/CI relied on. Current dashboard readiness is still false: 1/2 approvals, openai-pro review active, and v3 check pending; no merge attempted. — sent from sleek-gull-378

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-thinking
  • Commit: 790e415f · Trigger: manual
  • Comparison: main @ 74e292a2 ... session/sleek-gull-378 @ 790e415f
  • Conversation: View conversation

1. Story of the diff

This PR tries to close R3 gate #87’s “lens cementing receipts” gap by replacing several .dag test harnesses that were previously explicit Compiles placeholders with LensOutputEquals claims carrying narrow Int witnesses. The load-bearing mechanism is a new runner-side hook in src/v3/compiler/src/test_runner.rs: before normal LensOutputEquals evaluation continues, eval_gate_87_cementing_projection(...) recognizes specific gate-87 function names and computes the witness by calling Rust lens/helper functions directly. The documentation row in docs/r3-program-plan.md is also updated from “eight regen harnesses remain Compiles-only placeholders” to “PR #2757 replaces the remaining regen Compiles placeholders with named LensOutputEquals Int-projection receipts” while keeping the gate at CONSUMER_LANDED, not yet PASSING.

The good direction is clear: the PR removes anonymous wiring-only placeholders and gives each row a named receipt. The problem is that three of the new “LensOutputEquals” receipts still only prove lens-source compilation, not lens output/behavior, while presenting themselves as cementing projections.

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation).

Compliant — this is implementation/test-runner and .dag test-harness work, not a substrate type/variant/field change. No Dag substrate model or dag.rs shape is altered.

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

Finding — P2 Boundary Discipline / Verification predicates are substrate consumers; P5 Progress Is Dissolution.

The diff replaces Compiles placeholders with LensOutputEquals, but for helper rows the runner computes the witness by checking whether a lens source file compiles, not by applying a lens to the program under test:

src/v3/compiler/src/test_runner.rs:3137 — "gate87_infer_helpers_source_compiles" => i64::from(gate_87_lens_source_compiles(

src/v3/compiler/src/test_runner.rs:3140 — "gate87_lower_helpers_source_compiles" => i64::from(gate_87_lens_source_compiles(

src/v3/compiler/src/test_runner.rs:3143 — "gate87_variant_payload_source_compiles" => i64::from(gate_87_lens_source_compiles(

src/v3/compiler/src/test_runner.rs:5904 — fn gate_87_lens_source_compiles(rel: &str) -> bool {

That keeps a bridge/wiring receipt alive under a behavioral predicate name. TESTING.md says cementing tests are behavioral regressions that pin lens behavior, and if a carrier cannot yet be expressed, the allowed escape hatch is a temporary Rust receipt naming the blocker, not a .dag LensOutputEquals claim that only compiles the lens source. chatgpt-review-26679f0d-2f77-47…

INVARIANTS P2 also says verification predicates should be substrate consumers, not a separate pass or parallel authority; P5 says scaffolds need explicit dissolution paths and cannot become the new steady state. chatgpt-review-24e91bef-02d3-45…

  1. CODING.md.

Compliant with a caveat — the new runner helper is a free function (expected_int_literal, gate_87_lens_source_compiles) rather than adding behavior to a domain object, and error paths in expected_int_literal return ClaimResult::Fail instead of panicking. The caveat is the same as the finding above: gate_87_lens_source_compiles is an edge/test-runner impurity and should remain explicitly transitional.

  1. TESTING.md.

Finding — cementing receipts must be behavioral, not renamed compile checks.

The .dag harnesses for helper-only rows now say they are LensOutputEquals claims:

src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_infer_helpers.dag:11 — fn gate87_infer_helpers_source_compiles(d: Dag) -> Int = 0

src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_infer_helpers.dag:23 — predicate: LensOutputEquals(

src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_lower_helpers.dag:11 — fn gate87_lower_helpers_source_compiles(d: Dag) -> Int = 0

src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_variant_payload.dag:11 — fn gate87_variant_payload_source_compiles(d: Dag) -> Int = 0

But the corresponding runner arms only call gate_87_lens_source_compiles(...), so these are still source-compilation receipts. That does not satisfy the cementing-test discipline for lens behavior; it only renames a wiring/source-compile placeholder into a LensOutputEquals shape. Non-blocking for ordinary implementation cleanup, but blocking for a PR whose purpose is to complete gate #87 receipts.

  1. LOCKED DESIGN DECISIONS.

Compliant — the PR does not alter locked substrate shape, bootstrap-zero authority, or the CONSUMER_LANDED/not-PASSING status. The plan row explicitly keeps gate #87 short of PASSING at docs/r3-program-plan.md:310, which avoids overclaiming completion.

  1. TRACKED vs UNTRACKED DEBT.

Finding — the source-compilation bridge is not fully tracked in the new .dag rows.

The old comments were explicit that Compiles was wiring-only and named Rust receipts. The new comments say, for example:

src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_infer_helpers.dag:2 — Helper-only lenses have no single public carrier to freeze yet; the cementing claim still names

src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_variant_payload.dag:3 — VariantPayloadShapeLookup; this claim freezes the row-specific source-compilation witness

These name why the bridge exists, but not a concrete dissolution trigger comparable to “when carrier X is expressible in .dag data, replace this with a behavior/output receipt.” The PR should either keep these as explicit placeholders/temporary receipts or add a bounded trigger for each source-compilation projection.

2.5. Top-down PM intent review

Finding — semantic dilution of gate #87’s receipt intent.

The highest-level intent for this area is that tests become structural data and lens cementing tests pin behavior, not just harness wiring. THESIS says tests are structural TestClaim data and that Rust-authored tests are a smell on the path to zero residual; TESTING says cementing means a behavioral regression against v2 parity or the lens’s published behavioral contract. chatgpt-review-26152740-6760-42…

chatgpt-review-26679f0d-2f77-47…

The PR’s plan row says PR #2757 “replaces the remaining regen Compiles placeholders with named LensOutputEquals Int-projection receipts” at docs/r3-program-plan.md:310, but the actual implementation leaves three rows as source-compilation checks via src/v3/compiler/src/test_runner.rs:3137, :3140, and :3143. A worker reading the updated plan could reasonably believe the remaining placeholders became behavioral LensOutputEquals receipts; for these helper rows, they did not.

3. Verdict

REQUEST_CHANGES

The direction is right, and the non-helper projections look like legitimate narrow behavioral witnesses. But the helper/source-compile rows still dilute gate #87 by presenting source-compilation checks as LensOutputEquals cementing receipts. I would either keep those rows explicitly marked as temporary source-compilation placeholders with dissolution triggers, or replace them with real behavioral projections / temporary Rust receipts that satisfy TESTING.md’s cementing discipline.

@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: 790e415f · Trigger: schedule
  • Thinking: 555s wall

ROADMAP — Verified

  • lens_cementing_test_discipline_complete: Row #87 keeps the gate at CONSUMER_LANDED and preserves the frozen-oracle acceptance target instead of silently promoting the Int projections to PASSING.

✅ No blocking concerns; the new projections are narrow, documented bridges and the ledger keeps the remaining acceptance bar visible.

@briansrls

Copy link
Copy Markdown
Contributor Author

Addressed in 14d3ef773.

What changed:

  • Removed the invalid gate87_*_source_compiles LensOutputEquals projection arms and deleted gate_87_lens_source_compiles from test_runner.rs.
  • Reverted infer_helpers, lower_helpers, and variant_payload harnesses to explicit temporary Compiles placeholders.
  • Added concrete per-file dissolution triggers for those three helper rows, naming the behavior/output receipt that should replace each placeholder when its carrier/fixture is authorable in .dag data.
  • Updated the gate RT1-RT4: model correctness — credential wiring, fail-closed auth, fil… #87 ledger/commentary so PR Complete gate #87 lens cementing receipts #2757 no longer claims those helper-only rows became behavioral LensOutputEquals receipts.

Re-ran:

  • cargo fmt --check
  • cargo test -p v3-compiler t_pb_b_1_dag_runner_test::r3_gate_87_cementing_regen_lens_suites_pass_through_runner --test integration
  • cargo test -p v3-compiler r3_gate_87_lens_cementing_regen_receipts_test --test integration

— sent from sleek-gull-378

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-thinking
  • Commit: 14d3ef77 · Trigger: manual
  • Comparison: main @ 74e292a2 ... session/sleek-gull-378 @ 14d3ef77
  • Conversation: View conversation

1. Story of the diff

This PR tightens R3 gate #87 from “the cementing harnesses compile” toward “the harnesses actually exercise named lens behavior.” The core mechanism is a small TestRunner bridge that recognizes five gate-87 projection functions by declaration name and computes an Int witness from the real Rust lens implementation (type_realization_meta, enumerate_effects, origin_of, lens_structural_resolution::check, and UnusedParametersLens) before comparing that witness to the .dag LensOutputEquals expected literal at src/v3/compiler/src/test_runner.rs:3104-3154. The corresponding .dag harnesses now import LensOutputEquals and declare narrow Dag -> Int projection names plus gate87_expected_true: Int = 1, for example provenance at src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_provenance.dag:10-24 and unused parameters at src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_unused_parameters.dag:10-24.

The PR deliberately does not claim gate #87 is fully PASSING: the program-plan row says PR #2757 replaces behavior-bearing Compiles placeholders with named Int-projection receipts where full carriers are not yet freezeable, while helper-only rows remain explicit temporary Compiles placeholders with dissolution triggers, and the row remains below PASSING pending the full parity receipt set at docs/r3-program-plan.md:313. That is consistent with TESTING’s cementing discipline: .dag harnesses are preferred, but temporary Rust receipts/projections are allowed when the published carrier shape is not yet expressible, provided the blocker is named and the eventual .dag replacement is clear. chatgpt-review-2a6b1c0e-1cca-4d…

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation).

Compliant — this is implementation/test-runner and test-harness work, not a substrate type or Dag-resident modeling change. The added Rust reads existing lens facts and returns typed ClaimResults; the .dag files only declare test claims/projection stubs, e.g. predicate: LensOutputEquals(...) at src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_structural_resolution.dag:20-24.

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

Compliant — fail-closed behavior is preserved for the new bridge: missing lit in the provenance projection returns ClaimResult::Fail(...) at src/v3/compiler/src/test_runner.rs:3122-3125, malformed expected literals fail through expected_int_literal at src/v3/compiler/src/test_runner.rs:5883-5890, and unrecognized projection names return None to the normal LensOutputEquals path at src/v3/compiler/src/test_runner.rs:3140. The temporary/scaffold side is also tracked: helper placeholders name the missing public carrier and dissolution trigger, e.g. lower helpers at src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_lower_helpers.dag:1-9 and variant payload at src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_variant_payload.dag:1-10. That matches the modeling guidance that failures should be explicit and scaffolds need named triggers. chatgpt-review-23975e8b-0408-4f…

  1. CODING.md.

Compliant — the added runner code is a free helper-style function returning structured Option<ClaimResult> rather than mutating hidden state: fn eval_gate_87_cementing_projection(...) -> Option<ClaimResult> at src/v3/compiler/src/test_runner.rs:3104-3112, with the parsing helper separated as expected_int_literal(...) -> Result<i64, ClaimResult> at src/v3/compiler/src/test_runner.rs:5877-5892. The five imported lens APIs are explicit dependencies at src/v3/compiler/src/test_runner.rs:26-30.

  1. TESTING.md.

Compliant — the PR moves behavior-bearing rows from Compiles to focused LensOutputEquals harnesses, which is the right direction for cementing tests. Examples: cost target realization now uses LensOutputEquals(gate87_cost_target_realization_meta_present, ...) at src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_cost_target_realization.dag:20-24; effect enumeration does the same at src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_effect_enumeration.dag:20-24. The remaining Compiles rows are explicitly scoped as helper-only placeholders with named dissolution triggers, not presented as behavior receipts. This fits TESTING’s rule that cementing claims should pin behavior, and that temporary Rust receipts are acceptable only when carrier expressiveness is blocked. chatgpt-review-2a6b1c0e-1cca-4d…

  1. LOCKED DESIGN DECISIONS.

Compliant — the diff does not alter a locked substrate or design authority. The top-down zero-floor pressure is acknowledged rather than weakened: the plan row keeps the status at CONSUMER_LANDED and explicitly withholds PASSING until the parity receipt set is accepted at docs/r3-program-plan.md:313, while the thesis/zero-floor context remains that tests ultimately become .dag TestClaim data. chatgpt-review-e2c19f13-8eb1-41…

  1. TRACKED vs UNTRACKED DEBT.

Compliant — the temporary shapes I saw are tracked bridges, not unbounded debt. infer_helpers names the absence of a public behavioral carrier and says to replace Compiles with LensOutputEquals when that carrier is authorable at src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_infer_helpers.dag:1-12; lower_helpers does the same at src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_lower_helpers.dag:1-9; variant_payload names the stable variant fixture and expected-literal condition at src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_variant_payload.dag:1-10. The behavior-bearing projections also document the missing full carriers, e.g. Origin literals at src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_provenance.dag:1-3 and List<UnusedParameter> at src/v3/compiler/tests/dag/t_r3_gate_87_cementing_regen_unused_parameters.dag:1-3.

2.5. Top-down PM intent review

Compliant — the PR preserves the PM intent rather than diluting it. The highest-level direction is that correctness/test surfaces should become structural .dag TestClaim data, with hand-authored Rust dissolving toward zero. chatgpt-review-e2c19f13-8eb1-41…

This diff moves five rows from wiring-only Compiles to .dag LensOutputEquals claims backed by real lens execution, while keeping the roadmap honest that gate #87 is not PASSING yet at docs/r3-program-plan.md:313. The helper-only rows still left as Compiles are labeled as temporary source-compilation placeholders with concrete dissolution triggers, so a worker following this PR would not mistake them for completed cementing behavior.

3. Verdict

APPROVE. I did not find a blocking or non-blocking violation tied to the diff. The PR is honest about the remaining gap, improves behavior coverage for the gate-87 lens receipts, and keeps temporary Rust/.dag bridges bounded with named dissolution triggers.

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified the two observations against the current head.

For the dead = 0 DSL bodies: agreed. These five functions are intentionally witness names, and eval_gate_87_cementing_projection computes the actual Int via the Rust lens surface before ordinary LensOutputEquals evaluation. That matches the existing gate-specific runner pattern, but it is still transitional; the .dag comments name the missing full carriers so the eventual replacement is a real carrier comparison rather than a symbol-name projection.

For the string-literal dispatch table: agreed as a future tightening, but I am not changing it here because the table is bounded to the five PR #2757 projections, and inventory coverage for new regen.dag rows remains enforced separately by r3_gate_87_regen_lens_registry_names_match_fixture_inventory plus the runner suite table. A new row cannot land without a harness; if it needs a behavior projection, that follow-up should add one deliberately alongside the .dag receipt. — sent from sleek-gull-378

@briansrls
briansrls merged commit 8540907 into main May 12, 2026
5 checks passed
@briansrls
briansrls deleted the session/sleek-gull-378 branch May 12, 2026 13:30
briansrls added a commit that referenced this pull request May 12, 2026
Promote ledger row 87 and Cluster M Q-PB0-Risk6 digest after PR #2757
receipts; point gate-87 module doc at r3-program-plan + Band-C follow-ons.

Co-authored-by: Cursor <cursoragent@cursor.com>
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