Skip to content

T-Tier3-Dissolution gate #2: narrow trivial-constructor mirror retirement - #2789

Merged
briansrls merged 11 commits into
mainfrom
session/deep-bear-749
May 12, 2026
Merged

briansrls merged 11 commits into
mainfrom
session/deep-bear-749

Conversation

@briansrls

@briansrls briansrls commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

R3 §1.8 gate #2 (tier3_computation_mirror_dissolved) advances DECLARED → CONSUMER_LANDED (narrow slice). Retires the two pub fn host-Rust mirror entrypoints in src/v3/compiler/src/dag.rs mod computation whose Rust definitions added zero information beyond direct variant construction:

  • pub fn tree_size_bound(param) -> SizeBound — trivial constructor for SizeBound::TreeSize { param }.
  • pub fn forever_iteration_bound() -> i64 — returned the i64::MAX literal; inlined at its only internal call site in constant_bound_value (SizeBound::Forever → Some(i64::MAX)).

Modeled on gate #1 (termination_lattice_rust_mirror_dissolved) string-ratchet shape with a new fail-closed reintroduction guard tier3_computation_mirror_trivial_constructors_dissolved greping live dag.rs source for the retired pub fn signatures. src/v3/std/computation.dag remains the single authority; computation_lowering_functions_preserve_std_body_spans keeps the bootstrap body spans for both names pinned at ArrowBody::Unparsed.

Wider mirror dissolution (lower_call_pattern, type_iteration_dimension, size_bound_param, is_constant_bound, constant_bound_value, algebra_profile_to_dimension) remains lane-tracked under T-Tier3-Dissolution pending evaluated std.computation block bodies — out of scope per brief STOP guard.

P5 Mechanism (b) per-PR receipt — scaffold deletion

This PR carries the deleted scaffold path receipt shape from INVARIANTS.md P5 Dispatch-Discipline Mechanism (b), not the "explicit deferral" shape. Specifically the two 🟡 SCAFFOLD-commented pub fn mirror entrypoints in src/v3/compiler/src/dag.rs mod computation are deleted:

  • src/v3/compiler/src/dag.rs::computation::tree_size_bound — removed (was a one-line trivial constructor; zero external callers outside the parity test that now constructs SizeBound::TreeSize { param: … } directly).
  • src/v3/compiler/src/dag.rs::computation::forever_iteration_bound — removed (was a one-line i64::MAX literal wrapper; inlined at the sole internal call site in constant_bound_value).

The expanded hand-Rust (one new #[test] function in the already-censused src/v3/compiler/tests/integration/m2_substrate_inhabitance_test.rs) is the dissolution ratchet that prevents reintroduction of the deleted scaffolds, mirroring exactly the pattern landed for R3 §1.8 gate #1 in commit 0cff473c… (sibling test termination_lattice_rust_mirror_dissolved covering pub fn evidence_rank / pub fn merge_evidence / …). src/v3/compiler/tests/integration/m2_substrate_inhabitance_test.rs is already an EXPECTED_HAND_AUTHORED_TEST path in src/v3/compiler/tests/integration/sg0_census_test.rs:523, so this PR does not add a new SG-0 census line and the §"SG-0 hand-authored integration test receipts" table in INVARIANTS.md does not require a new row.

Brief / authority

  • Brief: docs/briefs/r3-wave1-pb1-tier3-gate2-computation-mirror-worker.md
  • Authority touched: docs/r3-structure.md §Acceptance (read-only); docs/r3-program-plan.md §1.8 row Codex/graph viz test helpers #2 (Status flip + Notes sync)
  • Smallest dissolution row executed: trivial-constructor public mirror entrypoints in src/v3/compiler/src/dag.rs mod computation

SG-0 / perf-budget audit-trail

  • SG-0 hand-path delta: none (no EXPECTED_HAND_AUTHORED_* movement; existing censused file gains one #[test] fn).
  • C1 perf-budget: none. src/v3/compiler/benches/tier3_mirror_perf.rs references only lower_call_pattern / type_iteration_dimension (kept); retired entrypoints were not benched, so no tier3_baseline.json recapture per docs/audit/c1-tier3-baseline-capture-procedure.md.

Test plan

  • cargo test -p v3-compiler --test integration -- computation tier3_computation — 7 passed, including new tier3_computation_mirror_trivial_constructors_dissolved ratchet and existing computation_* parity/body-span tests.
  • cargo clippy -p v3-compiler --all-targets -- -D warnings clean.
  • cargo fmt --all clean.

🤖 Generated with Claude Code

briansrls and others added 2 commits May 12, 2026 20:33
…ment

R3 §1.8 gate #2 `tier3_computation_mirror_dissolved` advances DECLARED →
CONSUMER_LANDED (narrow slice). Retires the two `pub fn` host-Rust mirror
entrypoints in `src/v3/compiler/src/dag.rs` `mod computation` whose Rust
definition added no information beyond direct variant construction:

- `pub fn tree_size_bound(param) -> SizeBound` — trivial constructor for
  `SizeBound::TreeSize { param }`; sole external caller was the parity
  ratchet, which now constructs the variant directly.
- `pub fn forever_iteration_bound() -> i64` — returned the `i64::MAX`
  literal; inlined at its single internal call site in
  `constant_bound_value` (`SizeBound::Forever` → `Some(i64::MAX)`).

Mirrors the gate #1 (`termination_lattice_rust_mirror_dissolved`) string
ratchet style with a new fail-closed reintroduction guard
`tier3_computation_mirror_trivial_constructors_dissolved` in
`src/v3/compiler/tests/integration/m2_substrate_inhabitance_test.rs`,
greping the live `dag.rs` source for the retired `pub fn` signatures.

`src/v3/std/computation.dag` remains the single authority; the
`computation_lowering_functions_preserve_std_body_spans` ratchet keeps
the bootstrap body spans for both names pinned at `ArrowBody::Unparsed`.
Wider mirror dissolution (`lower_call_pattern`, `type_iteration_dimension`,
`size_bound_param`, `is_constant_bound`, `constant_bound_value`,
`algebra_profile_to_dimension`) remains lane-tracked under
T-Tier3-Dissolution pending evaluated `std.computation` block bodies.

Brief: docs/briefs/r3-wave1-pb1-tier3-gate2-computation-mirror-worker.md
Authority: docs/r3-structure.md §Acceptance; docs/r3-program-plan.md §1.8 row #2

SG-0 hand-path delta: none (no `sg0_census_test.rs` movement).
Perf-budget audit-trail: none (`tier3_mirror_perf.rs` references
`lower_call_pattern`/`type_iteration_dimension` only; retired entrypoints
were not benched — no `tier3_baseline.json` recapture required per
`docs/audit/c1-tier3-baseline-capture-procedure.md`).

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

Copy link
Copy Markdown
Contributor Author

Re codex/codex-default REQUEST_CHANGES: the receipt shape here is INVARIANTS.md P5 Mechanism (b) option 1 — deleted file/scaffold path, not option 3 (explicit deferral). The PR retires the two 🟡 SCAFFOLD-commented pub fn mirror entrypoints computation::tree_size_bound and computation::forever_iteration_bound from src/v3/compiler/src/dag.rs. The added #[test] function is the dissolution ratchet that locks the deletion (gate-#1 string-grep pattern), not a new scaffold needing its own deferral.

src/v3/compiler/tests/integration/m2_substrate_inhabitance_test.rs is already in EXPECTED_HAND_AUTHORED_TEST (src/v3/compiler/tests/integration/sg0_census_test.rs:523); this PR adds no new census line, so the §"SG-0 hand-authored integration test receipts" table in INVARIANTS.md (which keys per new path, not per added test fn within an existing censused path) does not require a new row.

Mechanism (b) wording: "deleted file/scaffold path, an SG-0 census line shrink … or an explicit deferral that names a lane and cites a concrete ROADMAP.md row." The "or" is disjunctive — scaffold deletion alone satisfies the gate. This is identical to the receipt shape that landed for R3 §1.8 gate #1 (termination_lattice_rust_mirror_dissolved, commit 0cff473c…), which retired six pub fn lattice mirror helpers under the same Tier3 lane and added an analogous #[test] reintroduction guard with no per-test ROADMAP-row deferral.

PR description has been updated to make the receipt shape explicit. — sent from deep-bear-749

@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: 43672a93 · Trigger: schedule
  • Thinking: 308s wall

Non-blocking — Improvements (fix in-PR if easy, else defer to roadmap)

  • docs/r3-program-plan.md Line 228 promotes gate #2 while §1.7 still says tier3 mirror gates remain DECLARED; sweep that status paragraph in the T-Tier3-Dissolution ledger update.

✅ No blocking concerns; the helper retirement is narrow, tracked, and ratcheted, though I could not run cargo tests because dependency resolution needed crates.io and the offline cache lacks the locked web-sys version.

… longer uniformly DECLARED

Codex non-blocking review on PR #2789 flagged the §1.7 paragraph at
`docs/r3-program-plan.md:144` still asserting `tier3_*_mirror_dissolved`
gates "remain DECLARED at HEAD" while §1.8 row-level Status has advanced:

- #1 (`tier3_termination_mirror_dissolved`) — CONSUMER_LANDED + PASSING
- #4 (`tier3_effect_carrier_mirror_dissolved`) — CONSUMER_LANDED + PASSING
- #3 (`tier3_induction_mirror_dissolved`) — CONSUMER_LANDED
- #2 (`tier3_computation_mirror_dissolved`) — CONSUMER_LANDED
  (this PR, narrow trivial-constructor slice)

Replace the stale uniform-DECLARED claim with the per-row Status summary
and reaffirm the §1.8 ledger as the home-of-record. No gate semantics
change; doc consistency sweep only.

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

Copy link
Copy Markdown
Contributor Author

Addressed in commit cef134a: swept the §1.7 Status-at-HEAD paragraph at docs/r3-program-plan.md:144 — the stale uniform "tier3_*_mirror_dissolved gates remain DECLARED at HEAD" claim is replaced with the per-row Status summary (gate #1 + #4 CONSUMER_LANDED + PASSING; gate #2 (this PR) + #3 CONSUMER_LANDED with wider-work Notes), and §1.8 is reaffirmed as the home-of-record. The cargo-test offline-cache miss for web-sys is a reviewer-environment artifact (locked deps are reachable in the canonical Ubicloud CI lane); per-target green is verified in the PR test plan and in the in-flight ci/v3 runs. — sent from deep-bear-749

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-thinking
  • Commit: cef134aa · Trigger: manual
  • Comparison: main @ 86adc399 ... session/deep-bear-749 @ cef134aa
  • Conversation: View conversation

1. Story of the diff

This PR retires a very narrow slice of the std.computation host-Rust mirror: the public helper tree_size_bound(param) is removed because it was only direct SizeBound::TreeSize { param } construction, and forever_iteration_bound() is removed because it only returned i64::MAX. The remaining constant_bound_value consumer now materializes SizeBound::Forever directly as i64::MAX, with an inline comment tying that value back to std.computation’s repeat(max_int) authority (src/v3/compiler/src/dag.rs:266-273). The tests stop importing/calling the retired helper and instead construct the variant directly (src/v3/compiler/tests/integration/m2_substrate_inhabitance_test.rs:1766-1771), while a new ratchet scans dag.rs to prevent reintroducing the two trivial mirror entrypoints (src/v3/compiler/tests/integration/m2_substrate_inhabitance_test.rs:515-539). The R3 ledger is updated to mark gate #2 as a narrow CONSUMER_LANDED slice while explicitly keeping the wider computation mirror dissolution tracked (docs/r3-program-plan.md:141, docs/r3-program-plan.md:225).

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation).

Compliant — the diff does not add substrate variants, fields, or Dag-resident types; it removes implementation-only Rust mirror helpers and leaves src/v3/std/computation.dag as the stated authority (m2_substrate_inhabitance_test.rs:521-523). This moves in the direction of the substrate/implementation separation described by the thesis’ generated-authority posture. chatgpt-review-875b5a3d-fc47-4c…

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

Compliant — P2 single-authority / P5 dissolution are handled by deleting the duplicate host helper exports (src/v3/compiler/src/dag.rs:119, src/v3/compiler/src/dag.rs:270) and adding a ratchet that forbids reintroducing those exact mirror symbols (m2_substrate_inhabitance_test.rs:530-536). The PR also bounds the bridge honestly: wider helpers remain tracked rather than being silently claimed dissolved (docs/r3-program-plan.md:225). This aligns with the invariant that duplicate authority should be removed rather than bridged indefinitely.

  1. CODING.md.

Compliant — replacing tree_size_bound(String::from("node")) with direct SizeBound::TreeSize { param: ... } construction removes a tiny behavior wrapper that did not encode additional contract, matching the data + functions style and avoiding needless API surface (m2_substrate_inhabitance_test.rs:1766-1771). The remaining function constant_bound_value stays as a small pure mapping from &SizeBound to Option<i64> (src/v3/compiler/src/dag.rs:266-275). chatgpt-review-6812f853-09ce-47…

  1. TESTING.md.

Compliant — the added test is a focused one-claim dissolution ratchet: tier3_computation_mirror_trivial_constructors_dissolved asserts only that the two retired trivial mirrors do not reappear (m2_substrate_inhabitance_test.rs:515-539). It is implementation-facing, but that is appropriate for a mirror-retirement gate whose contract is “this Rust mirror surface must stay gone,” and the comment names the remaining undissolved scope rather than overclaiming (m2_substrate_inhabitance_test.rs:525-529). TESTING.md allows Rust tests during the zero-floor migration when they are the cleanest current shape. chatgpt-review-e9ea5afa-26e7-44…

  1. LOCKED DESIGN DECISIONS.

Compliant — no locked design shape is altered. The PR is consistent with Pure Bootstrap to Zero’s direction: shrink hand-authored Rust mirror surface and keep the live authority in .dag (docs/r3-program-plan.md:225; m2_substrate_inhabitance_test.rs:521-523).

  1. TRACKED vs UNTRACKED DEBT.

Compliant — no new scaffold is introduced. The only temporary shape is explicitly bounded: the ratchet covers only tree_size_bound and forever_iteration_bound, while the remaining computation helpers are named as pending wider dissolution under T-Tier3-Dissolution (m2_substrate_inhabitance_test.rs:525-529; docs/r3-program-plan.md:225).

2.5. Top-down PM intent review

Compliant — the PR preserves the top-level intent: retire duplicate Rust authority instead of letting mirror APIs become permanent. The thesis and zero-floor program both push toward .dag authorities and shrinking hand-authored Rust surfaces; this diff removes two trivial Rust mirror entrypoints, updates call sites to use the underlying variant/value directly, and records the remaining scope instead of pretending the whole computation mirror is dissolved (src/v3/compiler/src/dag.rs:119, src/v3/compiler/src/dag.rs:270, docs/r3-program-plan.md:225).

3. Verdict

APPROVE. This is a narrow, honest dissolution slice: it deletes two duplicate host-Rust mirrors, leaves the real authority in std.computation, and adds a bounded ratchet against reintroduction. I did not find a diff-cited invariant violation.

briansrls and others added 2 commits May 12, 2026 16:49
cursor/composer-2 APPROVE_WITH_COMMENTS on PR #2789 flagged a residual
contradiction in the same §1.7 Status-at-HEAD paragraph: after the
per-row tier3 mirror-gate summary, the closing clause still read

  "all 16 NEW gates added 2026-05-06 in PR #1808 are DECLARED-only"

which now contradicts the per-row Status it just stated (INVARIANTS P1
"Documentation Describes Live State"). Also collapse the duplicate
"Per-gate Status flows…" sentence pair into a single attribution and
reaffirm §1.8 as home-of-record. The 16-gates clause is reframed as a
point-in-time fact ("were DECLARED-only at that time"), with the
ledger named as the authoritative current-Status surface.

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

Copy link
Copy Markdown
Contributor Author

Addressed cursor/composer-2 APPROVE_WITH_COMMENTS finding in commit fcb3f1d55: tightened the §1.7 Status-at-HEAD paragraph trailing clause. The previous "all 16 NEW gates added 2026-05-06 in PR #1808 are DECLARED-only" sentence contradicted the per-row tier3 mirror-gate Status I had just added (P1 "Documentation Describes Live State"). It now reads as a point-in-time fact ("were DECLARED-only at that time") and names §1.8 as the authoritative current-Status surface; the duplicate "Per-gate Status flows…" sentence pair is collapsed in the same edit (cursor's exploratory readability note). — sent from deep-bear-749

@briansrls

Copy link
Copy Markdown
Contributor Author

Re codex APPROVE_WITH_COMMENTS on the include_str! + grep ratchet shape: this is deliberately the same precedent shape as gate #1 (termination_lattice_rust_mirror_dissolved, commit 0cff473c…), which is the model the brief (docs/briefs/r3-wave1-pb1-tier3-gate2-computation-mirror-worker.md) and PB Mgr both named explicitly. The dissolution contract being asserted is textual — "these specific pub fn symbols must not reappear in dag.rs" — so a source-text predicate matches the contract shape; there is no observable runtime behavior to test (the helpers are gone). TESTING.md allows Rust integration tests during the zero-floor migration when they're the cleanest current shape; the more behavioral form (.dag TestClaim over reflected substrate symbol tables) is exactly what wider mirror dissolution + Cluster M (Tests-As-Data) will provide for these and the sibling gate-#3/#4 ratchets uniformly. Adopting that form here ahead of the rest would diverge from the precedent and require a one-off substrate carrier just for this gate — out of scope per the brief's STOP guard. Recording the structural observation as exploratory and leaving the ratchet at parity with gate #1 + #3 + #4. — sent from deep-bear-749

@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: 6327b2ed · Trigger: schedule
  • Thinking: 217s wall

Non-blocking — Strengths

  • src/v3/compiler/tests/integration/m2_substrate_inhabitance_test.rs The ratchet is narrowly scoped to the two retired trivial constructors and avoids overclaiming full std.computation mirror dissolution.

✅ No blocking concerns; the helper retirement is narrow, documented with a checkable P5 receipt, and the wider mirror work remains explicitly tracked.

@briansrls
briansrls merged commit dfa2524 into main May 12, 2026
5 checks passed
briansrls added a commit that referenced this pull request May 12, 2026
…trate P5 row

PR #2789 landed `tier3_computation_mirror_trivial_constructors_dissolved`; PB Mgr
branch keeps `tier3_computation_mirror_kernel_algebra_profile_substrate_authority`.
Single receipt row lists both so SG-0 / plan stay aligned after merge-from-main.

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request May 12, 2026
* WIP: R3 PB Mgr — T-LP-Retirement + Tier3 + V2 + FixedPoint lanes

* docs(briefs): Wave-1 PB1/PB2 pre-authored worker briefs for gates #2 and #16

(i) PB lane Wave-1 dispatch per r3-remaining-work-dependency-graph §5.
(ii) Briefs r3-wave1-pb1-tier3-gate2-computation-mirror-worker.md and
r3-wave1-pb2-fixedpoint-gate16-r3-horizon-worker.md; graph §5 links them.
(iii) No SG-0 census edits in this commit.

Co-authored-by: Cursor <cursoragent@cursor.com>

* fix(test): brace-balance source slice for tier3 kernel_algebra_profile ratchet

Addresses claude-opus-4-7 review (PR #2781): replace fixed 1200-byte window
with brace-balanced extraction of pub fn type_iteration_dimension so the
grep receipt cannot silently miss delegation if the function grows.

Co-authored-by: Cursor <cursoragent@cursor.com>

* WIP: R3 PB Mgr — T-LP-Retirement + Tier3 + V2 + FixedPoint lanes

* docs: P5 receipt + §1.7 vs §P2 split for Tier3 gate #2 (PR #2781 review)

- r3-program-plan §1.7: state-check gates use CONSUMER_LANDED in executable-consumer sense only; §P2 generated-consumer bar is substrate-shape scope (#17).
- §1.8 row #2 + Status-at-HEAD: cite INVARIANTS P5 table row for m2_substrate ratchet.
- INVARIANTS: register m2_substrate_inhabitance_test.rs P5 Mechanism (b) receipt (ROADMAP Tier-3 bullet + r3-program §1.8 #2, interim ratchet named).

Co-authored-by: Cursor <cursoragent@cursor.com>

* WIP: R3 PB Mgr — T-LP-Retirement + Tier3 + V2 + FixedPoint lanes

* docs(INVARIANTS): name both Tier3 gate #2 interim ratchets in m2_substrate P5 row

PR #2789 landed `tier3_computation_mirror_trivial_constructors_dissolved`; PB Mgr
branch keeps `tier3_computation_mirror_kernel_algebra_profile_substrate_authority`.
Single receipt row lists both so SG-0 / plan stay aligned after merge-from-main.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

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