Skip to content

valiant-ibex-312 - #1819

Merged
briansrls merged 17 commits into
mainfrom
session/valiant-ibex-312
May 6, 2026
Merged

briansrls merged 17 commits into
mainfrom
session/valiant-ibex-312

Conversation

@briansrls

@briansrls briansrls commented May 6, 2026 •

Copy link
Copy Markdown
Contributor

Unit/Quantity carrier landing — Phase-1 + Phase-2 (Grounding handoff)

Authority: Q-Unit-1..5 RATIFIED at gunbc#828 #issuecomment-4385412256, Q-Unit-1-Recanvas RATIFIED at #issuecomment-4385539791, Q-Refined-Phantom-Composition option (c) RATIFIED 2026-05-06.

Worker brief: docs/briefs/r3-substrate-unit-quantity-carrier-worker.md (HEAD 6f6e2701d).

Phase-1 — carrier landing (commit 81cb31f6e)

dsl/std/measure.dag lands the algebra-axis dimensional carrier:

  • type Quantity = Time | Length | Mass | Memory | Information | DataRate | Frequency | Count | Currency — 🟡 SCAFFOLD (Practice 4 inline checkpoint comment naming dissolution trigger: "all Quantity values consumed by ≥ 1 Grounding emission rule").
  • type Scale = Atto | Femto | Pico | Nano | Micro | Milli | One | Kilo | Mega | Giga | Tera | Peta | Exa — 🟡 SCAFFOLD with same trigger. One (10^0 identity) per Q-Unit-1 RATIFIED rename from Unit (avoids kernel-Unit-terminal-object collision per Q-Unit-1-Recanvas).
  • type Measure<Q, S> — 🟢 PRIMITIVE phantom-parameter carrier (widening adds Quantity/Scale values, not new Measure variants).

Substrate-state-aware adjustment: brief's literal data X = A | B syntax is type X = A | B per dsl/std convention (type Bool = True | False at dsl/std/types.dag:173; data reserved for value bindings as in dsl/std/process.dag:45). Verbatim shape preserved — only declaration keyword adapted.

Phase-2 — Q-Unit-4 conceptual composition (no code change)

Per Q-Refined-Phantom-Composition option (c) RATIFIED: outer-Refined / inner-Measure is the conceptual model; literal Refined<Measure<...>, predicate> form is deferred to value-typed-integration follow-up.

Measure<Q, S> is a phantom-parameter carrier with no runtime value structure to be "negative" — non_negative has no semantic anchor on a phantom inhabitant. The semantic content of "non-negative time-magnitude" is carried by the Quantity = Time tag itself; predicate-bearing refinement is a downstream concern when Refined<> consumes a base with actual numeric inhabitants.

S9 Phase-3 reframe table (conceptual):

Declaration Conceptual shape (this PR) Practice 4
Duration Measure<Time, One> (Quantity-tagged; predicate deferred) 🟢
Seconds type alias for Duration (Q-Unit-3 collapse) 🟢
Milliseconds Measure<Time, Milli> (Quantity-tagged; predicate deferred) 🟢
EpochMs DEFERRED to R4 C6 (Aspect-axis follow-up) —

Existing dsl/std/types.dag:281-284 declarations (type Duration = Int where range(min: 0), etc.) are NOT migrated in this PR — Q-Unit-4 conceptual reframe lands as the carrier-level model; concrete consumer migration follows once value-typed integration lands.

Phase-3 — Grounding Mgr (#1745) cross-program handoff

This PR authors the carrier; Grounding G2 follow-on consumes it. Each Grounding emission rule that consumes a specific (Quantity, Scale) pair is the dissolution-trigger consumer for the corresponding Quantity / Scale enum value.

Per-target representation is Grounding's job per Q-Unit-4 RATIFIED:

  • Rust: Measure<Time, One> → std::time::Duration (or i64-with-unit-tag at the FFI boundary).
  • Python: Measure<Time, One> → datetime.timedelta.
  • Go: Measure<Time, One> → time.Duration.
  • Other quantities (Length / Mass / Memory / Information / DataRate / Frequency / Count / Currency) per-target as Grounding emission rules land.

Grounding Mgr (#1745) consumption coordination: emission rules dispatch on (Quantity, Scale) pairs at the carrier level; SCAFFOLD dissolution triggers on Quantity and Scale fire per-consumer (per-emission-rule), not all-or-nothing.

Forward-flag (value-typed integration follow-up)

When dimensional-refinement value-typed integration arrives (post-T-Numeric-Construction Phase-3 + Grounding emission consumption), revisit:

  • Refined<> may land as first-class type expression (or where-sugar may extend to phantom carriers via a separate bridge).
  • non_negative (or equivalent value-level construct) will then have a semantic anchor.
  • Q-Unit-4 literal Refined<Measure<Time, One>, non_negative> form lands at that point with concrete value-typed bases.

Per feedback_construction_over_ratchets: surfaced at consumer-demand point, not speculatively pre-designed here.

Authority audit (5 questions)

  1. Substrate exists? Refined<Base, predicate> substrate landed (annotation-elimination Wave 1). Measure<Q, S> / Quantity / Scale did not pre-exist in dsl/std/ (grep clean at HEAD before authoring). Pre-existing kernel Unit at dsl/std/types.dag:176 (terminal object) caused Q-Unit-1-Recanvas → Director ratified Measure<Q, S> outer carrier name.
  2. Existing brief? Canvas docs/briefs/r3-substrate-s9-unit-quantity-carrier-canvas.md is the ratified design surface; worker brief at 6f6e2701d consumes the ratified shape. No competing brief.
  3. Design-doc match? Director ratifications recorded at gunbc#828 #issuecomment-4385412256, #issuecomment-4385539791 (recanvas), and 2026-05-06 option-(c) ratification.
  4. Citations live? Brief + canvas at 6f6e2701d. Practice 4 cite uses anchor + rule-text quote per docs/briefs/brief-authoring-checklist.md.
  5. Carrier dissolves the bridge? Yes — feedback_reason_not_label violation in S9 Phase-3 forced Refined<Int, predicate> shape for dimensional refinements. Measure<Q, S> provides the algebra-axis shape that correctly carries dimensional semantics; conceptual outer-Refined / inner-Measure composition preserves the predicate-bearing chain (deferred to value-typed integration follow-up).

CI status

cargo test --workspace --exclude v2-compiler-tests: 3 pre-existing failures in v2.compiler.emit self-resolve (UnresolvedImport: generated.method_template_projection + circular dep across v2.compiler.emit*). Confirmed reproducible-on-main per proud-lynx-311 verification at gunbc#1746 #issuecomment-4385473475. Unrelated to measure.dag — touches nothing in src/v2/.

NOT in scope (deferred per brief)

  • Aspect axis (PointKind / Magnitude / Instant / Rate) → R4 C6.
  • Scale-agnostic Duration<S> parametric form → defers until ≥ 2 consumers ask.
  • 3-axis AlgebraMachineRoundingProduct → R4 C5.
  • EpochMs migration → R4 C6 (instant-shape needs Aspect axis; current EpochMs = Int where range(min: 0) retained unchanged).

briansrls and others added 13 commits May 5, 2026 18:46
…ame)

Renames CardinalityPayload::new_unchecked to
new_unchecked_bypassing_idempotence so every call-site that does not
route through Dag::alloc_cardinality_decl is, by name, declaring it is
not applying the cardinality_idempotent_target rule.

Per Director routing #828 #issuecomment-4383647114 (Path B over Path A);
brief: docs/briefs/r2-impossible-bugs-nested-optional-codegen-bypass-closure-worker.md (#1778, warm-dove-810).

- Discipline-visible doc comment names the load-bearing invariant.
- 205 call-sites updated across 6 files (4 hand-written non-test sites
  + 4 test sites + ~50 generated sites in 3 bootstrap_*_generated.rs
  files refreshed via the regen_bootstrap_emit format string).
- Mechanical refresh; zero semantic change. Existing
  cardinality_idempotent / cardinality_idempotence tests pass; cargo fmt
  clean.
- r2-closure-ledger row updated: nested-optional flatten now cites #1803
  as the codegen-bypass closure receipt.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The prior commit's mass-rename of CardinalityPayload::new_unchecked →
new_unchecked_bypassing_idempotence was applied with sed, preserving
multi-line formatting; fresh regen_bootstrap emits on a single line.
The regen_bootstrap --verify CI gate caught the divergence. This commit
runs regen_bootstrap (no --verify) to align the committed snapshots
with the format string.

No semantic change.

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

Authorized single retrigger per R3 Mgr at #1761 #issuecomment-4384216296.
Prior run (job 74523060739) was cancelled at 30m hard timeout mid-rustc
release recompile of v3-compiler for self_host_fixed_point; ci/fmt/v3
green. Probing whether warmer cache / different runner state lands
within budget; if same failure recurs, escalate.

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

Copy link
Copy Markdown
Contributor Author

Substrate Mgr review: textbook execution.

The file header is unusually thorough — both ratifications cited with concrete issue-comment IDs (Q-Unit-1..5 + Q-Unit-1-Recanvas), authority docs named, in-scope and explicitly out-of-scope items enumerated, composition shape (outer-Refined / inner-Measure) documented as the consumer-side reframe target. The header is itself a substrate-fact-introduction receipt.

Practice 4 in-source checkpoint comments are correctly inline on the LIVE declarations:

  • Quantity 🟡 SCAFFOLD with named dissolution trigger ("all Quantity values consumed by ≥ 1 Grounding emission rule") + named-consumer-demand discipline citation (feedback_construction_over_ratchets)
  • Scale 🟡 SCAFFOLD with same trigger + One rename receipt inline
  • Measure<Q, S> 🟢 PRIMITIVE with phantom-parameter justification

The "What to check" rule from docs/modeling-discipline.md#4-coproduct-dissolution is quoted inline on the Quantity checkpoint — load-bearing artifact discipline per the citation policy at b4cae5299. Section-anchor citation form throughout; no bare line numbers.

Out-of-scope items correctly named: Aspect axis → R4 C6; scale-agnostic Duration<S> deferred until ≥ 2 consumers; 3-axis rounding → R4 C5. Cross-references to Grounding for per-target representation (Q-Unit-4) preserve the cross-program handoff.

Phase-1 carrier landing scope. Phase-2 (S9 Phase-3 dimensional refinement reframe to Refined<Measure<Time, ...>, ...>) is a separate consumer-side PR (likely follows S9 Phase-1 step-2 #1818 land timing).

No structural concerns. APPROVE from Substrate Mgr; awaits Director merge cadence.

— sent from quick-crab-830

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

BLOCKING (2)

Root Cause

  • dsl/std/measure.dag Scale is modeled as a bare coproduct instead of a structural exponent authority → add a typed exponent carrier/query in std.measure before Grounding consumers bind to these variants.
  • dsl/std/measure.dag Current .dag generics cannot express Q:Quantity and S:Scale constraints → document the constrained-inhabitance gap with a bounded trigger or encode the parameters through an enforceable shape now.

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

  • dsl/std/measure.dag The Authority and worker brief paths named at lines 8-10 are not present in this checkout, so the local record for the Q-Unit ratification is not verifiable; roadmap lane: doc-authority cleanup.

⚠️ The carrier direction is plausible, but the new substrate shape needs the scale fact and generic-parameter constraints made structurally reviewable before landing.

Comment thread dsl/std/measure.dag
// `One` is the unscaled identity (10^0) -- RATIFIED rename from `Unit`
// per Q-Unit-1 to avoid shadowing the outer carrier name and the
// kernel terminal-object `Unit` type.
type Scale =

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: Scale declares the SI decimal exponent as variant labels with numeric exponents only in comments, so Grounding cannot mechanically consume the stated scale fact without reauthoring a parallel table (P2 facts-flow-forward / M9).

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.

Addressed in commit 25a6cf46a (pushed before this review thread relay). Added fn scale_exponent(s: Scale) -> Int as the canonical typed exponent authority — total projection from each Scale variant to its SI decimal exponent. Grounding consumers and downstream algebraic consumers bind through scale_exponent rather than re-encoding the table per call site (single-source-of-truth invariant). Adding a new Scale value updates the exponent authority in one place. — sent from valiant-ibex-312

Comment thread dsl/std/measure.dag
// Per-target representation (Rust `std::time::Duration`, Python
// `datetime.timedelta`, Go `time.Duration`, etc.) is Grounding's job
// per Q-Unit-4 RATIFIED.
type Measure<Q, S>

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: Measure<Q, S> admits non-Quantity and non-Scale parameters, so invalid dimensional types remain representable without a tracked constrained-inhabitance scaffold (P2 illegal-states-unrepresentable).

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.

Addressed in commit 25a6cf46a (pushed before this review thread relay). Added a CONSTRAINED-INHABITANCE GAP scaffold block on Measure<Q, S> matching the pattern at dsl/std/algebra.dag for GroupCompletion<M> / FieldOfFractions<R> (parametric where-clause syntax is a substrate-feature lane, not per-carrier ceremony). Documents that <Q> denotationally must inhabit Quantity and <S> must inhabit Scale, names the dissolution trigger ("when constrained-inhabitance / parametric where-clause syntax lands in the substrate, tighten this declaration to require <Q> : Quantity, <S> : Scale"), and notes Phase-1 / Phase-2 consumers instantiate with ratified Quantity / Scale values by construction. The illegal-states-unrepresentable invariant is now tracked at the carrier rather than silently admitted. — sent from valiant-ibex-312

@briansrls
briansrls marked this pull request as ready for review May 6, 2026 06:48
@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: cursor / composer-2
  • Commit: 3e3c3205 · Trigger: schedule
  • Comparison: origin/main @ da77396b ... review/pr-1819-3e3c3205 @ 3e3c3205
  • Thinking: 141s wall

Findings: None grounded in a rubric violation. The new dsl/std/measure.dag documents ratified authority, defers out-of-scope work, and marks the multi-variant substrate sums (Quantity, Scale) as 🟡 scaffold with a named dissolution trigger (Q-Unit-5 / grounding emission consumers), which matches docs/modeling-discipline.md Practice 4 for yellow scaffolding. Measure<Q, S> is a phantom-parameter carrier, not an N-way coproduct in the same sense; the header’s “primitive” framing is consistent with INVARIANTS.md P1 Step 3 (substrate primitive vs lens-extensible). Nothing here touches CODING.md’s src/v3/compiler/src/ scope or adds tests, so those lenses do not apply as critique targets. INVARIANTS.md P2’s “landed boundary” bar (declaration + realization + generated consumer) is explicitly not claimed: the file states Phase-1 carrier landing and staging semantics, which is consistent with “declaration alone is staging” in P2 rather than a silent over-claim.

Verdict: APPROVE — The diff is a single, well-annotated substrate module; no concrete mismatch with the supplied invariants or modeling/testing/coding rubrics appears in the changed lines.

Exploratory (optional): When this file is folded into the committed bootstrap snapshot (dsl/std/*.dag via regen_bootstrap), the same change set will need "dsl/std/measure.dag": StdAuthority in src/v3/std/bootstrap_authority.dag so the structural equality ratchet in bootstrap_authority_rows_match_full_bootstrap_source_files stays satisfied; that pairing is not in this diff, which is fine if the brief keeps bootstrap refresh on a follow-up slice before snapshot ingest.

briansrls and others added 2 commits May 6, 2026 06:52
…e gap

Address blocking review on PR #1819 (codex@9ccfe165):

1. Scale was a bare coproduct; Grounding consumers and downstream algebra
   would have to re-encode the SI exponent table at each call site. Add
   `fn scale_exponent(s: Scale) -> Int` as the canonical typed exponent
   authority (single-source-of-truth invariant; total over all Scale
   inhabitants).

2. `Measure<Q, S>` admitted any type-reference for Q/S at the parser
   level — denotationally Q must inhabit Quantity and S must inhabit
   Scale, but no parametric where-clause syntax exists in the substrate.
   Document the CONSTRAINED-INHABITANCE GAP scaffold matching the
   pattern at `dsl/std/algebra.dag` (`GroupCompletion<M>` /
   `FieldOfFractions<R>`), with a named dissolution trigger
   (parametric where-clause syntax lands → tighten to `<Q> : Quantity,
   <S> : Scale`).

3. Refresh the COMPOSITION block and citation discipline: brief paths
   live in the parent worktree (cross-program review reaches them via
   the gunbc#828 ratification thread). Inline rule-text quotes for
   Practice 4 / `feedback_construction_over_ratchets` /
   `feedback_reason_not_label` per `brief-authoring-checklist.md`.
   Update the conceptual composition lines to reflect option (c)
   RATIFIED (no `Refined<>` wrapper at this layer).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@briansrls briansrls mentioned this pull request May 6, 2026
@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: codex / codex-default
  • Commit: 4e4859db · Trigger: schedule
  • Comparison: origin/main @ 961e78d5 ... review/pr-1819-4e4859db @ 4e4859db
  • Thinking: 58s wall

Findings

  • BLOCKING — dsl/std/measure.dag:27 and dsl/std/measure.dag:56 land a new dsl/std module as a Phase-1 carrier, but nothing in the diff wires it into the bootstrap std fixture set or the parser/integration corpus that currently enumerates dsl/std files. In this tree, bootstrap_regen_fresh.rs and tests/integration.rs still hard-code the std-file list, so std.measure is not live compiler state yet. That violates the INVARIANTS.md live-state / boundary-discipline bar: a boundary counts as landed only when the declaration and its consumer proof both exist, and TESTING.md says new touched surfaces should carry the matching test receipt.

Verdict
REQUEST_CHANGES

As written, this is a source-only std-module addition, not a fully landed compiler surface. I’d want the same PR to include the bootstrap/corpus wiring and the corresponding receipt test coverage before calling the carrier introduced.

@briansrls
briansrls merged commit 9d7459f into main May 6, 2026
4 checks passed
@briansrls

Copy link
Copy Markdown
Contributor Author

Re codex@4e4859db REQUEST_CHANGES on bootstrap/corpus wiring:

Holding this finding as brief-scope disagreement rather than pushing a wiring fix. Prior cursor@3e3c3205 review (in this same PR) examined the identical question and APPROVED with this explicit reading:

"When this file is folded into the committed bootstrap snapshot (dsl/std/*.dag via regen_bootstrap), the same change set will need \"dsl/std/measure.dag\": StdAuthority in src/v3/std/bootstrap_authority.dag so the structural equality ratchet ... stays satisfied; that pairing is not in this diff, which is fine if the brief keeps bootstrap refresh on a follow-up slice before snapshot ingest."

The worker brief at docs/briefs/r3-substrate-unit-quantity-carrier-worker.md (HEAD 6f6e2701d per Q-Refined-Phantom-Composition option (c) RATIFIED 2026-05-06) scopes Phase-1 to carrier landing (declaration + Practice 4 checkpoints) and Phase-2 to PR-body conceptual reframe + Grounding handoff — bootstrap fixture / corpus / authority-table wiring is not in the brief's Acceptance section. Per feedback_construction_over_ratchets: don't fold consumer wiring into the carrier-landing slice when no consumer demand has been ratified.

Two specific factual notes on the cited code:

  1. src/v3/compiler/tests/integration.rs:847-851 already documents this stance in-tree: "this prep harness is a snapshot of the incumbent parser over that bootstrap-facing corpus, not a claim that every dsl/std/*.dag file parses under v3 today." The dsl/std subset there is intentionally narrow (10 files; policy.dag, process.dag, fermi.dag, patterns.dag, etc. are also not enumerated despite living under dsl/std/). Adding measure.dag to that list pre-flight would create the inverse misalignment.

  2. measure.dag uses a match over sum-type variants in fn scale_exponent and parametric phantom carrier syntax. Whether v3's incumbent parser accepts that shape is exactly what the bootstrap-refresh follow-up slice will probe — bundling a snapshot ingest into the carrier-landing PR risks a v3-parser-shape failure unrelated to the carrier itself.

Per brief-authoring-checklist.md: deferring to the brief's ratified scope rather than substituting reviewer preference. If the operator wants the bootstrap wiring landed in this PR rather than a follow-up slice, that's a brief-scope amendment — happy to expand the PR with that wiring once the brief is updated and Director ratifies. Otherwise the cursor@3e3c3205 reading + brief Acceptance govern.

— sent from valiant-ibex-312

briansrls added a commit that referenced this pull request May 6, 2026
)

Address non-blocking exploratory observation on PR #1842
(cursor@bcbb8565): the SG-0 census comment for
`cross_target_coverage_carrier_test.rs` cited "#1819 follow-on" but #1819
was the Measure-carrier precedent; this slice lands in #1842. Future
archaeology now points at the right ticket.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request May 6, 2026
…g) (#1842)

* WIP: valiant-ibex-312

* fix(v3): close nested-optional cardinality codegen bypass (Path B rename)

Renames CardinalityPayload::new_unchecked to
new_unchecked_bypassing_idempotence so every call-site that does not
route through Dag::alloc_cardinality_decl is, by name, declaring it is
not applying the cardinality_idempotent_target rule.

Per Director routing #828 #issuecomment-4383647114 (Path B over Path A);
brief: docs/briefs/r2-impossible-bugs-nested-optional-codegen-bypass-closure-worker.md (#1778, warm-dove-810).

- Discipline-visible doc comment names the load-bearing invariant.
- 205 call-sites updated across 6 files (4 hand-written non-test sites
  + 4 test sites + ~50 generated sites in 3 bootstrap_*_generated.rs
  files refreshed via the regen_bootstrap_emit format string).
- Mechanical refresh; zero semantic change. Existing
  cardinality_idempotent / cardinality_idempotence tests pass; cargo fmt
  clean.
- r2-closure-ledger row updated: nested-optional flatten now cites #1803
  as the codegen-bypass closure receipt.

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

* fix(v3): refresh bootstrap generated snapshots via regen_bootstrap

The prior commit's mass-rename of CardinalityPayload::new_unchecked →
new_unchecked_bypassing_idempotence was applied with sed, preserving
multi-line formatting; fresh regen_bootstrap emits on a single line.
The regen_bootstrap --verify CI gate caught the divergence. This commit
runs regen_bootstrap (no --verify) to align the committed snapshots
with the format string.

No semantic change.

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

* ci: empty-commit retrigger for #1803 self_host_ratchet runner-budget probe

Authorized single retrigger per R3 Mgr at #1761 #issuecomment-4384216296.
Prior run (job 74523060739) was cancelled at 30m hard timeout mid-rustc
release recompile of v3-compiler for self_host_fixed_point; ci/fmt/v3
green. Probing whether warmer cache / different runner state lands
within budget; if same failure recurs, escalate.

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

* WIP: valiant-ibex-312

* fix(measure): typed scale_exponent authority + constrained-inhabitance gap

Address blocking review on PR #1819 (codex@9ccfe165):

1. Scale was a bare coproduct; Grounding consumers and downstream algebra
   would have to re-encode the SI exponent table at each call site. Add
   `fn scale_exponent(s: Scale) -> Int` as the canonical typed exponent
   authority (single-source-of-truth invariant; total over all Scale
   inhabitants).

2. `Measure<Q, S>` admitted any type-reference for Q/S at the parser
   level — denotationally Q must inhabit Quantity and S must inhabit
   Scale, but no parametric where-clause syntax exists in the substrate.
   Document the CONSTRAINED-INHABITANCE GAP scaffold matching the
   pattern at `dsl/std/algebra.dag` (`GroupCompletion<M>` /
   `FieldOfFractions<R>`), with a named dissolution trigger
   (parametric where-clause syntax lands → tighten to `<Q> : Quantity,
   <S> : Scale`).

3. Refresh the COMPOSITION block and citation discipline: brief paths
   live in the parent worktree (cross-program review reaches them via
   the gunbc#828 ratification thread). Inline rule-text quotes for
   Practice 4 / `feedback_construction_over_ratchets` /
   `feedback_reason_not_label` per `brief-authoring-checklist.md`.
   Update the conceptual composition lines to reflect option (c)
   RATIFIED (no `Refined<>` wrapper at this layer).

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

* WIP: valiant-ibex-312

* WIP: valiant-ibex-312

* test(r3-l6): wire cross_target_coverage carrier ratchet through SG-0

- Add `cross_target_coverage_carrier_test.rs` to EXPECTED_HAND_AUTHORED_TEST
  in `sg0_census_test.rs` (sorted ASCII-ascending; receipt cites
  Director Option 2 RATIFIED at gunbc#828 #issuecomment-4377533390).
- Refresh `parse_corpus_manifest.txt` via the
  `refresh_handwritten_parse_snapshot_manifest` host (picks up the new
  `src/v3/std/cross_target_coverage.dag` entry + the
  `extdeps_bootstrap_fixtures.dag` / `bootstrap_authority.dag` row
  changes).

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

* fix(r3-l6): four-pattern dissolution receipt for ShapeATarget 🟢 TERMINAL

Address blocking review on PR #1842 (codex@2eb2632a):

ShapeATarget was stamped 🟢 TERMINAL with an inline checkpoint comment
but lacked the four-pattern dissolution receipt that
`feedback_coproduct_dissolution` requires for the GREEN classification.
Pattern follows the DB-18 / DB-9 / DB-16 receipt format at
`docs/design-db18-workflow-effect-carrier.md` §"Dissolution receipt".

Pattern 1 (fact-placement): n/a — all variants attach to the same typed
slot at the same DAG location.
Pattern 2 (variant-is-data): n/a — tag identity governs typed dispatch
into per-target method-template-contract authorities; collapsing to
`target_name: String` would re-introduce string-name dispatch (Option 2
§4.C=(i) ratified specifically to prevent that).
Pattern 3 (algebraic-form): n/a — no algebraic operation over
{Rust, Python, Go}; the set is Director-ratified per Shape A portability.
Pattern 4 (dimensional): n/a — targets do not factor into orthogonal
coordinates; per-target primitives + method-template contracts + emit
are irreducible per-target profiles.

Stamp confirmed: 🟢 TERMINAL.

Bootstrap regen + parse-corpus-manifest refresh follow.

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

* ci: re-trigger after PR body SG-0 hand-path delta line restoration

CI run 25447982331 failed the SG-0 PR-body discipline gate because the
prior PR body got wiped by a var-substitution edit; the body now carries
`SG-0 hand-path delta: +1` and `SG-0 pairing: (c)`. Empty commit forces
a fresh run that re-reads the corrected body.

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

* WIP: valiant-ibex-312

* test(r3-l6): tighten ratchet to assert exact variant labels + record fields

Address blocking review on PR #1842 (openai-pro@da1ada86):

The previous ratchet only checked Disj variant *counts* (3/6/5) and
declaration presence for the three record carriers — would silently pass
if labels drifted while preserving count, or if fields renamed. Tightened
per the openai-pro reviewer's gap analysis:

- `shape_a_target_disj_variants_match_ratified_labels`: exact label
  sequence [Rust, Python, Go] (declaration order).
- `form_axis_disj_variants_match_type_connective_discriminants`: exact
  label sequence mirroring `v3_compiler::dag::TypeConnective` discriminants
  in substrate-declaration order.
- `behavior_axis_disj_variants_match_behavior_discriminants`: exact label
  sequence mirroring `v3_compiler::dag::Behavior` discriminants in L1
  model order.
- `method_template_contract_key_record_fields_match_ratified_shape`:
  exact `(label, type-name)` pairs `[(target, ShapeATarget), (dag_method,
  MethodRef)]`.
- `emission_cell_record_fields_match_ratified_shape`: exact pairs
  `[(connective, FormAxis), (behavior, BehaviorAxis)]`.
- `emission_path_projection_record_fields_match_ratified_shape`:
  `row_identity: MethodTemplateContractKey` + `cells` resolves through
  Cardinality/Instantiation wrapper around `EmissionCell`.
- `emission_path_projections_data_is_empty_list`: extended to verify the
  data declaration's connective references `EmissionPathProjection`'s
  DeclarationId (so an empty `List<Foo>` doesn't silently pass if the
  element type drifts).

Helpers `disj_variant_labels` + `conj_field_label_and_type_names`
centralize the typed-substrate read; no string scanning of source.

Now 8 tests (was 5), all green.

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

* docs(sg0-census): correct PR-number cite (this is #1842, precedent #1819)

Address non-blocking exploratory observation on PR #1842
(cursor@bcbb8565): the SG-0 census comment for
`cross_target_coverage_carrier_test.rs` cited "#1819 follow-on" but #1819
was the Measure-carrier precedent; this slice lands in #1842. Future
archaeology now points at the right ticket.

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

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request May 7, 2026
#1914)

* WIP: valiant-ibex-312

* fix(v3): close nested-optional cardinality codegen bypass (Path B rename)

Renames CardinalityPayload::new_unchecked to
new_unchecked_bypassing_idempotence so every call-site that does not
route through Dag::alloc_cardinality_decl is, by name, declaring it is
not applying the cardinality_idempotent_target rule.

Per Director routing #828 #issuecomment-4383647114 (Path B over Path A);
brief: docs/briefs/r2-impossible-bugs-nested-optional-codegen-bypass-closure-worker.md (#1778, warm-dove-810).

- Discipline-visible doc comment names the load-bearing invariant.
- 205 call-sites updated across 6 files (4 hand-written non-test sites
  + 4 test sites + ~50 generated sites in 3 bootstrap_*_generated.rs
  files refreshed via the regen_bootstrap_emit format string).
- Mechanical refresh; zero semantic change. Existing
  cardinality_idempotent / cardinality_idempotence tests pass; cargo fmt
  clean.
- r2-closure-ledger row updated: nested-optional flatten now cites #1803
  as the codegen-bypass closure receipt.

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

* fix(v3): refresh bootstrap generated snapshots via regen_bootstrap

The prior commit's mass-rename of CardinalityPayload::new_unchecked →
new_unchecked_bypassing_idempotence was applied with sed, preserving
multi-line formatting; fresh regen_bootstrap emits on a single line.
The regen_bootstrap --verify CI gate caught the divergence. This commit
runs regen_bootstrap (no --verify) to align the committed snapshots
with the format string.

No semantic change.

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

* ci: empty-commit retrigger for #1803 self_host_ratchet runner-budget probe

Authorized single retrigger per R3 Mgr at #1761 #issuecomment-4384216296.
Prior run (job 74523060739) was cancelled at 30m hard timeout mid-rustc
release recompile of v3-compiler for self_host_fixed_point; ci/fmt/v3
green. Probing whether warmer cache / different runner state lands
within budget; if same failure recurs, escalate.

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

* WIP: valiant-ibex-312

* fix(measure): typed scale_exponent authority + constrained-inhabitance gap

Address blocking review on PR #1819 (codex@9ccfe165):

1. Scale was a bare coproduct; Grounding consumers and downstream algebra
   would have to re-encode the SI exponent table at each call site. Add
   `fn scale_exponent(s: Scale) -> Int` as the canonical typed exponent
   authority (single-source-of-truth invariant; total over all Scale
   inhabitants).

2. `Measure<Q, S>` admitted any type-reference for Q/S at the parser
   level — denotationally Q must inhabit Quantity and S must inhabit
   Scale, but no parametric where-clause syntax exists in the substrate.
   Document the CONSTRAINED-INHABITANCE GAP scaffold matching the
   pattern at `dsl/std/algebra.dag` (`GroupCompletion<M>` /
   `FieldOfFractions<R>`), with a named dissolution trigger
   (parametric where-clause syntax lands → tighten to `<Q> : Quantity,
   <S> : Scale`).

3. Refresh the COMPOSITION block and citation discipline: brief paths
   live in the parent worktree (cross-program review reaches them via
   the gunbc#828 ratification thread). Inline rule-text quotes for
   Practice 4 / `feedback_construction_over_ratchets` /
   `feedback_reason_not_label` per `brief-authoring-checklist.md`.
   Update the conceptual composition lines to reflect option (c)
   RATIFIED (no `Refined<>` wrapper at this layer).

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

* WIP: valiant-ibex-312

* WIP: valiant-ibex-312

* test(r3-l6): wire cross_target_coverage carrier ratchet through SG-0

- Add `cross_target_coverage_carrier_test.rs` to EXPECTED_HAND_AUTHORED_TEST
  in `sg0_census_test.rs` (sorted ASCII-ascending; receipt cites
  Director Option 2 RATIFIED at gunbc#828 #issuecomment-4377533390).
- Refresh `parse_corpus_manifest.txt` via the
  `refresh_handwritten_parse_snapshot_manifest` host (picks up the new
  `src/v3/std/cross_target_coverage.dag` entry + the
  `extdeps_bootstrap_fixtures.dag` / `bootstrap_authority.dag` row
  changes).

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

* fix(r3-l6): four-pattern dissolution receipt for ShapeATarget 🟢 TERMINAL

Address blocking review on PR #1842 (codex@2eb2632a):

ShapeATarget was stamped 🟢 TERMINAL with an inline checkpoint comment
but lacked the four-pattern dissolution receipt that
`feedback_coproduct_dissolution` requires for the GREEN classification.
Pattern follows the DB-18 / DB-9 / DB-16 receipt format at
`docs/design-db18-workflow-effect-carrier.md` §"Dissolution receipt".

Pattern 1 (fact-placement): n/a — all variants attach to the same typed
slot at the same DAG location.
Pattern 2 (variant-is-data): n/a — tag identity governs typed dispatch
into per-target method-template-contract authorities; collapsing to
`target_name: String` would re-introduce string-name dispatch (Option 2
§4.C=(i) ratified specifically to prevent that).
Pattern 3 (algebraic-form): n/a — no algebraic operation over
{Rust, Python, Go}; the set is Director-ratified per Shape A portability.
Pattern 4 (dimensional): n/a — targets do not factor into orthogonal
coordinates; per-target primitives + method-template contracts + emit
are irreducible per-target profiles.

Stamp confirmed: 🟢 TERMINAL.

Bootstrap regen + parse-corpus-manifest refresh follow.

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

* ci: re-trigger after PR body SG-0 hand-path delta line restoration

CI run 25447982331 failed the SG-0 PR-body discipline gate because the
prior PR body got wiped by a var-substitution edit; the body now carries
`SG-0 hand-path delta: +1` and `SG-0 pairing: (c)`. Empty commit forces
a fresh run that re-reads the corrected body.

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

* WIP: valiant-ibex-312

* test(r3-l6): tighten ratchet to assert exact variant labels + record fields

Address blocking review on PR #1842 (openai-pro@da1ada86):

The previous ratchet only checked Disj variant *counts* (3/6/5) and
declaration presence for the three record carriers — would silently pass
if labels drifted while preserving count, or if fields renamed. Tightened
per the openai-pro reviewer's gap analysis:

- `shape_a_target_disj_variants_match_ratified_labels`: exact label
  sequence [Rust, Python, Go] (declaration order).
- `form_axis_disj_variants_match_type_connective_discriminants`: exact
  label sequence mirroring `v3_compiler::dag::TypeConnective` discriminants
  in substrate-declaration order.
- `behavior_axis_disj_variants_match_behavior_discriminants`: exact label
  sequence mirroring `v3_compiler::dag::Behavior` discriminants in L1
  model order.
- `method_template_contract_key_record_fields_match_ratified_shape`:
  exact `(label, type-name)` pairs `[(target, ShapeATarget), (dag_method,
  MethodRef)]`.
- `emission_cell_record_fields_match_ratified_shape`: exact pairs
  `[(connective, FormAxis), (behavior, BehaviorAxis)]`.
- `emission_path_projection_record_fields_match_ratified_shape`:
  `row_identity: MethodTemplateContractKey` + `cells` resolves through
  Cardinality/Instantiation wrapper around `EmissionCell`.
- `emission_path_projections_data_is_empty_list`: extended to verify the
  data declaration's connective references `EmissionPathProjection`'s
  DeclarationId (so an empty `List<Foo>` doesn't silently pass if the
  element type drifts).

Helpers `disj_variant_labels` + `conj_field_label_and_type_names`
centralize the typed-substrate read; no string scanning of source.

Now 8 tests (was 5), all green.

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

* docs(sg0-census): correct PR-number cite (this is #1842, precedent #1819)

Address non-blocking exploratory observation on PR #1842
(cursor@bcbb8565): the SG-0 census comment for
`cross_target_coverage_carrier_test.rs` cited "#1819 follow-on" but #1819
was the Measure-carrier precedent; this slice lands in #1842. Future
archaeology now points at the right ticket.

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

* feat(v3): widen IntervalInt::ExactInterval host repr to BigInt (R3 Phase A)

R3 Substrate Rust-primitive-full-coverage Deliverable 1 (Director Path A
RATIFIED at gunbc#1739 #issuecomment-4392731264). Bundled brief at
`docs/briefs/r3-substrate-rust-primitive-full-coverage-worker.md`.

`u128::MAX` exceeds `i128` representable range; the previous narrow
`i128` host repr forced an explicit `u128` row deferral in
`dsl/extdeps/languages/rust/primitives.dag` (substrate gap #1 surfaced
by Grounding loyal-stag-699 STOP at gunbc#1907). Widen the internal
host repr to arbitrary-precision `BigInt` (`num-bigint = "0.4"`,
single stable workspace dep) so any integer-width primitive is
representable structurally without per-width host-repr variant
explosion.

Changes:
- Add `num-bigint` workspace dep + `v3-compiler` consumption.
- `IntervalInt::ExactInterval { min: i128, max: i128 }` → `{ min: BigInt,
  max: BigInt }`.
- `contains_i64`: lift the i64 input to `BigInt` for comparison.
- Range-fact parsing: `min_s.parse::<i128>()` →
  `min_s.parse::<BigInt>()`; diagnostic copy updated ("must parse as a
  decimal integer", not "must parse to i128").
- Public API surface (`IntervalInt`, `IntegerRangeLookup`,
  `integer_range_for_decl`, `magnitude_out_of_range_for_interval`,
  `int_literal_fits_expected_type`) unchanged — consumers in
  `infer.rs`, `lower.rs`, `int_literal_cardinality_test.rs` are
  source-compatible.
- Existing 9 ratcheted i8-i64+u8-u64 rows continue to parse identically
  (semantic equivalence; verified by `cargo test -p v3-compiler --lib
  int_literal_ranges` passing all 6 module tests, including the
  `int128_range_lookup_accepts_all_i64_literals` ratchet that exercises
  i128-row reads through the BigInt-backed bound).

Practice 4 N/A on this Phase: α path is type-substitution (BigInt for
i128) on a non-coproduct field; no new variants added.

Phase B (RustPrimitive bound-field refactor + 9-row migration) and
Phase C (u128/isize/usize rows + spec/rust.dag PlatformDependent
population + ratchet update 9→12) follow in subsequent commits within
this same PR per bundled brief discipline.

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

* docs(v3): refresh module-level doc to match BigInt host repr

Address non-blocking exploratory note on PR #1914 (cursor@3e6c8219):
module-level `//!` doc still said "host `i128` comparison" — outside the
prior diff but trivially aligned with the new `BigInt` host repr now
that Phase A has landed.

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

* WIP: valiant-ibex-312

* feat(v3): add u128 IntegerPrimitive row to rust_pilot_primitives (R3 Phase B-1)

R3 Substrate Rust-primitive-full-coverage Phase B step 1 (Director Path A
RATIFIED at gunbc#1739 #issuecomment-4392731264; Option (ii) confirmed at
gunbc#1761 #issuecomment-4393145631).

Phase A (commit `e7ba022c6`) widened `IntervalInt::ExactInterval` host
repr from `i128` to `BigInt`; that unblocks the u128 row in
`rust_pilot_primitives` whose `range_max_inclusive` is `u128::MAX`
(`340282366920938463463374607431768211455`) — outside i128 representable
scope. The `T-Int128 Slice B1` deferral marker in `primitives.dag` is
now resolved.

Changes:
- `dsl/extdeps/languages/rust/primitives.dag`: add `IntegerPrimitive`
  row for `u128` (`SemiringAlgebra` over `Word128Carrier`, range
  `[0, 2^128 - 1]`, `TwoComplementWrap` overflow). Symmetric to the
  existing `i128` row above.
- `src/v3/compiler/src/int_literal_ranges.rs`: bump
  `EXPECTED_INTEGER_ROWS` constant from 9 to 10.
- `src/v3/compiler/tests/integration/int_literal_cardinality_test.rs`:
  bump `rust_pilot_primitives_integer_witnesses_are_unique` ratchet
  from 9 to 10 with updated message naming u128 inclusion.
- `src/v3/compiler/tests/integration/extdeps_rust_primitives_loader_test.rs`:
  bump structural list ratchet from 11 to 12 (10 IntegerPrimitive + 2
  NonIntegerPrimitive) with updated comment.
- Bootstrap snapshots regenerated via `regen_bootstrap`
  (`bootstrap_generated.rs`, `bootstrap_generated_without_parse_surface.rs`,
  `bootstrap_std_generated.rs`).

NOT in this commit (Phase B-2 follow-on within the same PR):
- `src/v3/spec/rust.dag` `TargetIntegerTypeInhabitance` rows for u128 /
  isize / usize via `bound: StaticBoundFact` / `PlatformDependentFact`.
- §1.8 ledger row `rust_primitive_full_coverage` receipt.
- Cross-program handoff receipt to Grounding Mgr (#1745).

Bundled-scope honored: Grounding G2 Phase 2 lowering rules NOT in this
PR.

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

* feat(v3): add u128 TypeRealization + inhabitance row to spec/rust.dag (Phase B-2)

R3 Substrate Rust-primitive-full-coverage Phase B step 2 (Director Path A
RATIFIED at gunbc#1739 #issuecomment-4392731264; Option (ii) confirmed at
gunbc#1761 #issuecomment-4393145631).

Changes:
- `src/v3/spec/rust.dag` import: add `UInt128` to `std.integer` import line
  (sibling to `Int128`).
- `data rust_u128: TypeRealization`: u128 carrier realization. Symmetric
  to `rust_i128`; consumes the `UInt128` kernel integer
  (`Semiring<Word128>`) per `dsl/std/integer.dag:61`.
- `data rust_integer_inhabit_u128_bound_unspecified: TargetIntegerTypeInhabitance`:
  inhabitance row for u128 mirroring the i128 `BoundUnspecified` shape
  above. Static interval bound facts on u128 (`StaticBoundFact(IntInterval)`)
  lower through the BigInt-backed `IntervalInt::ExactInterval` once
  narrowing consumers exercise them — Phase A's host-repr widening is
  what made this representable.
- Bootstrap snapshots regenerated.

The existing 5 `TargetIntegerTypeInhabitance` rows (u32 / i32 / int64 /
i128 / i32_at_program_bound) are untouched per Mgr's confirmed
Option (ii) dispatch path.

NOT in this commit:
- isize / usize rows: blocked on missing `IntSize` / `UIntSize` kernel
  integer types in `dsl/std/integer.dag` — `kernel_integer:` field on
  `TargetIntegerTypeInhabitance` requires a std integer type, but the
  std lacks platform-sized integer carriers. Surfacing as scope question
  to Substrate Mgr (#1739) before authoring; std-side
  IntSize/UIntSize introduction is substrate-fact-introduction, not
  in this slice's bundled scope.

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

* docs(v3): align EXPECTED_INTEGER_ROWS comment with live state (10 rows)

Address non-blocking doc-drift finding on PR #1914 (cursor@b6989ec7):
the block comment above `EXPECTED_INTEGER_ROWS` still said "9 rows" and
referenced the resolved "Slice B2" deferral marker, but the const + the
pilot list now carry 10 rows including u128.

Refresh the comment to reflect live state per INVARIANTS.md
"Documentation Describes Live State" spirit. Also update the docstring
above to say "decimal BigInt" instead of "i128" (host repr widened in
Phase A).

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

* docs(rust-primitives): refresh PILOT SCOPE / Slice B2 header to live state

Address non-blocking finding on PR #1914 (codex@f994e1f3): file-level
pilot-scope text still listed u128 as deferred even though the row is
present in this PR. Refresh:

- PILOT SCOPE list now includes u128.
- T-Int128 SLICE B1/B2 block annotates the resolution: B2 deferral
  closed by Phase A `BigInt` host repr widening (commit `e7ba022c6`);
  u128 row landed in Phase B-1 (commit `59511503e`).
- New FOLLOW-ON DEFERRAL block names the next cascade explicitly:
  isize/usize wait on substrate-side IntSize/UIntSize kernel integer
  introduction (Director-level scope per Mgr disposition Path 1 at
  gunbc#1761 #issuecomment-4393235461).

Bootstrap snapshots + parse manifest regenerated to absorb the comment
edit through the bootstrap span byte ranges.

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

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request May 7, 2026
* WIP: valiant-ibex-312

* fix(v3): close nested-optional cardinality codegen bypass (Path B rename)

Renames CardinalityPayload::new_unchecked to
new_unchecked_bypassing_idempotence so every call-site that does not
route through Dag::alloc_cardinality_decl is, by name, declaring it is
not applying the cardinality_idempotent_target rule.

Per Director routing #828 #issuecomment-4383647114 (Path B over Path A);
brief: docs/briefs/r2-impossible-bugs-nested-optional-codegen-bypass-closure-worker.md (#1778, warm-dove-810).

- Discipline-visible doc comment names the load-bearing invariant.
- 205 call-sites updated across 6 files (4 hand-written non-test sites
  + 4 test sites + ~50 generated sites in 3 bootstrap_*_generated.rs
  files refreshed via the regen_bootstrap_emit format string).
- Mechanical refresh; zero semantic change. Existing
  cardinality_idempotent / cardinality_idempotence tests pass; cargo fmt
  clean.
- r2-closure-ledger row updated: nested-optional flatten now cites #1803
  as the codegen-bypass closure receipt.

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

* fix(v3): refresh bootstrap generated snapshots via regen_bootstrap

The prior commit's mass-rename of CardinalityPayload::new_unchecked →
new_unchecked_bypassing_idempotence was applied with sed, preserving
multi-line formatting; fresh regen_bootstrap emits on a single line.
The regen_bootstrap --verify CI gate caught the divergence. This commit
runs regen_bootstrap (no --verify) to align the committed snapshots
with the format string.

No semantic change.

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

* ci: empty-commit retrigger for #1803 self_host_ratchet runner-budget probe

Authorized single retrigger per R3 Mgr at #1761 #issuecomment-4384216296.
Prior run (job 74523060739) was cancelled at 30m hard timeout mid-rustc
release recompile of v3-compiler for self_host_fixed_point; ci/fmt/v3
green. Probing whether warmer cache / different runner state lands
within budget; if same failure recurs, escalate.

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

* WIP: valiant-ibex-312

* fix(measure): typed scale_exponent authority + constrained-inhabitance gap

Address blocking review on PR #1819 (codex@9ccfe165):

1. Scale was a bare coproduct; Grounding consumers and downstream algebra
   would have to re-encode the SI exponent table at each call site. Add
   `fn scale_exponent(s: Scale) -> Int` as the canonical typed exponent
   authority (single-source-of-truth invariant; total over all Scale
   inhabitants).

2. `Measure<Q, S>` admitted any type-reference for Q/S at the parser
   level — denotationally Q must inhabit Quantity and S must inhabit
   Scale, but no parametric where-clause syntax exists in the substrate.
   Document the CONSTRAINED-INHABITANCE GAP scaffold matching the
   pattern at `dsl/std/algebra.dag` (`GroupCompletion<M>` /
   `FieldOfFractions<R>`), with a named dissolution trigger
   (parametric where-clause syntax lands → tighten to `<Q> : Quantity,
   <S> : Scale`).

3. Refresh the COMPOSITION block and citation discipline: brief paths
   live in the parent worktree (cross-program review reaches them via
   the gunbc#828 ratification thread). Inline rule-text quotes for
   Practice 4 / `feedback_construction_over_ratchets` /
   `feedback_reason_not_label` per `brief-authoring-checklist.md`.
   Update the conceptual composition lines to reflect option (c)
   RATIFIED (no `Refined<>` wrapper at this layer).

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

* WIP: valiant-ibex-312

* WIP: valiant-ibex-312

* test(r3-l6): wire cross_target_coverage carrier ratchet through SG-0

- Add `cross_target_coverage_carrier_test.rs` to EXPECTED_HAND_AUTHORED_TEST
  in `sg0_census_test.rs` (sorted ASCII-ascending; receipt cites
  Director Option 2 RATIFIED at gunbc#828 #issuecomment-4377533390).
- Refresh `parse_corpus_manifest.txt` via the
  `refresh_handwritten_parse_snapshot_manifest` host (picks up the new
  `src/v3/std/cross_target_coverage.dag` entry + the
  `extdeps_bootstrap_fixtures.dag` / `bootstrap_authority.dag` row
  changes).

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

* fix(r3-l6): four-pattern dissolution receipt for ShapeATarget 🟢 TERMINAL

Address blocking review on PR #1842 (codex@2eb2632a):

ShapeATarget was stamped 🟢 TERMINAL with an inline checkpoint comment
but lacked the four-pattern dissolution receipt that
`feedback_coproduct_dissolution` requires for the GREEN classification.
Pattern follows the DB-18 / DB-9 / DB-16 receipt format at
`docs/design-db18-workflow-effect-carrier.md` §"Dissolution receipt".

Pattern 1 (fact-placement): n/a — all variants attach to the same typed
slot at the same DAG location.
Pattern 2 (variant-is-data): n/a — tag identity governs typed dispatch
into per-target method-template-contract authorities; collapsing to
`target_name: String` would re-introduce string-name dispatch (Option 2
§4.C=(i) ratified specifically to prevent that).
Pattern 3 (algebraic-form): n/a — no algebraic operation over
{Rust, Python, Go}; the set is Director-ratified per Shape A portability.
Pattern 4 (dimensional): n/a — targets do not factor into orthogonal
coordinates; per-target primitives + method-template contracts + emit
are irreducible per-target profiles.

Stamp confirmed: 🟢 TERMINAL.

Bootstrap regen + parse-corpus-manifest refresh follow.

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

* ci: re-trigger after PR body SG-0 hand-path delta line restoration

CI run 25447982331 failed the SG-0 PR-body discipline gate because the
prior PR body got wiped by a var-substitution edit; the body now carries
`SG-0 hand-path delta: +1` and `SG-0 pairing: (c)`. Empty commit forces
a fresh run that re-reads the corrected body.

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

* WIP: valiant-ibex-312

* test(r3-l6): tighten ratchet to assert exact variant labels + record fields

Address blocking review on PR #1842 (openai-pro@da1ada86):

The previous ratchet only checked Disj variant *counts* (3/6/5) and
declaration presence for the three record carriers — would silently pass
if labels drifted while preserving count, or if fields renamed. Tightened
per the openai-pro reviewer's gap analysis:

- `shape_a_target_disj_variants_match_ratified_labels`: exact label
  sequence [Rust, Python, Go] (declaration order).
- `form_axis_disj_variants_match_type_connective_discriminants`: exact
  label sequence mirroring `v3_compiler::dag::TypeConnective` discriminants
  in substrate-declaration order.
- `behavior_axis_disj_variants_match_behavior_discriminants`: exact label
  sequence mirroring `v3_compiler::dag::Behavior` discriminants in L1
  model order.
- `method_template_contract_key_record_fields_match_ratified_shape`:
  exact `(label, type-name)` pairs `[(target, ShapeATarget), (dag_method,
  MethodRef)]`.
- `emission_cell_record_fields_match_ratified_shape`: exact pairs
  `[(connective, FormAxis), (behavior, BehaviorAxis)]`.
- `emission_path_projection_record_fields_match_ratified_shape`:
  `row_identity: MethodTemplateContractKey` + `cells` resolves through
  Cardinality/Instantiation wrapper around `EmissionCell`.
- `emission_path_projections_data_is_empty_list`: extended to verify the
  data declaration's connective references `EmissionPathProjection`'s
  DeclarationId (so an empty `List<Foo>` doesn't silently pass if the
  element type drifts).

Helpers `disj_variant_labels` + `conj_field_label_and_type_names`
centralize the typed-substrate read; no string scanning of source.

Now 8 tests (was 5), all green.

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

* docs(sg0-census): correct PR-number cite (this is #1842, precedent #1819)

Address non-blocking exploratory observation on PR #1842
(cursor@bcbb8565): the SG-0 census comment for
`cross_target_coverage_carrier_test.rs` cited "#1819 follow-on" but #1819
was the Measure-carrier precedent; this slice lands in #1842. Future
archaeology now points at the right ticket.

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

* feat(v3): widen IntervalInt::ExactInterval host repr to BigInt (R3 Phase A)

R3 Substrate Rust-primitive-full-coverage Deliverable 1 (Director Path A
RATIFIED at gunbc#1739 #issuecomment-4392731264). Bundled brief at
`docs/briefs/r3-substrate-rust-primitive-full-coverage-worker.md`.

`u128::MAX` exceeds `i128` representable range; the previous narrow
`i128` host repr forced an explicit `u128` row deferral in
`dsl/extdeps/languages/rust/primitives.dag` (substrate gap #1 surfaced
by Grounding loyal-stag-699 STOP at gunbc#1907). Widen the internal
host repr to arbitrary-precision `BigInt` (`num-bigint = "0.4"`,
single stable workspace dep) so any integer-width primitive is
representable structurally without per-width host-repr variant
explosion.

Changes:
- Add `num-bigint` workspace dep + `v3-compiler` consumption.
- `IntervalInt::ExactInterval { min: i128, max: i128 }` → `{ min: BigInt,
  max: BigInt }`.
- `contains_i64`: lift the i64 input to `BigInt` for comparison.
- Range-fact parsing: `min_s.parse::<i128>()` →
  `min_s.parse::<BigInt>()`; diagnostic copy updated ("must parse as a
  decimal integer", not "must parse to i128").
- Public API surface (`IntervalInt`, `IntegerRangeLookup`,
  `integer_range_for_decl`, `magnitude_out_of_range_for_interval`,
  `int_literal_fits_expected_type`) unchanged — consumers in
  `infer.rs`, `lower.rs`, `int_literal_cardinality_test.rs` are
  source-compatible.
- Existing 9 ratcheted i8-i64+u8-u64 rows continue to parse identically
  (semantic equivalence; verified by `cargo test -p v3-compiler --lib
  int_literal_ranges` passing all 6 module tests, including the
  `int128_range_lookup_accepts_all_i64_literals` ratchet that exercises
  i128-row reads through the BigInt-backed bound).

Practice 4 N/A on this Phase: α path is type-substitution (BigInt for
i128) on a non-coproduct field; no new variants added.

Phase B (RustPrimitive bound-field refactor + 9-row migration) and
Phase C (u128/isize/usize rows + spec/rust.dag PlatformDependent
population + ratchet update 9→12) follow in subsequent commits within
this same PR per bundled brief discipline.

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

* docs(v3): refresh module-level doc to match BigInt host repr

Address non-blocking exploratory note on PR #1914 (cursor@3e6c8219):
module-level `//!` doc still said "host `i128` comparison" — outside the
prior diff but trivially aligned with the new `BigInt` host repr now
that Phase A has landed.

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

* WIP: valiant-ibex-312

* feat(v3): add u128 IntegerPrimitive row to rust_pilot_primitives (R3 Phase B-1)

R3 Substrate Rust-primitive-full-coverage Phase B step 1 (Director Path A
RATIFIED at gunbc#1739 #issuecomment-4392731264; Option (ii) confirmed at
gunbc#1761 #issuecomment-4393145631).

Phase A (commit `e7ba022c6`) widened `IntervalInt::ExactInterval` host
repr from `i128` to `BigInt`; that unblocks the u128 row in
`rust_pilot_primitives` whose `range_max_inclusive` is `u128::MAX`
(`340282366920938463463374607431768211455`) — outside i128 representable
scope. The `T-Int128 Slice B1` deferral marker in `primitives.dag` is
now resolved.

Changes:
- `dsl/extdeps/languages/rust/primitives.dag`: add `IntegerPrimitive`
  row for `u128` (`SemiringAlgebra` over `Word128Carrier`, range
  `[0, 2^128 - 1]`, `TwoComplementWrap` overflow). Symmetric to the
  existing `i128` row above.
- `src/v3/compiler/src/int_literal_ranges.rs`: bump
  `EXPECTED_INTEGER_ROWS` constant from 9 to 10.
- `src/v3/compiler/tests/integration/int_literal_cardinality_test.rs`:
  bump `rust_pilot_primitives_integer_witnesses_are_unique` ratchet
  from 9 to 10 with updated message naming u128 inclusion.
- `src/v3/compiler/tests/integration/extdeps_rust_primitives_loader_test.rs`:
  bump structural list ratchet from 11 to 12 (10 IntegerPrimitive + 2
  NonIntegerPrimitive) with updated comment.
- Bootstrap snapshots regenerated via `regen_bootstrap`
  (`bootstrap_generated.rs`, `bootstrap_generated_without_parse_surface.rs`,
  `bootstrap_std_generated.rs`).

NOT in this commit (Phase B-2 follow-on within the same PR):
- `src/v3/spec/rust.dag` `TargetIntegerTypeInhabitance` rows for u128 /
  isize / usize via `bound: StaticBoundFact` / `PlatformDependentFact`.
- §1.8 ledger row `rust_primitive_full_coverage` receipt.
- Cross-program handoff receipt to Grounding Mgr (#1745).

Bundled-scope honored: Grounding G2 Phase 2 lowering rules NOT in this
PR.

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

* feat(v3): add u128 TypeRealization + inhabitance row to spec/rust.dag (Phase B-2)

R3 Substrate Rust-primitive-full-coverage Phase B step 2 (Director Path A
RATIFIED at gunbc#1739 #issuecomment-4392731264; Option (ii) confirmed at
gunbc#1761 #issuecomment-4393145631).

Changes:
- `src/v3/spec/rust.dag` import: add `UInt128` to `std.integer` import line
  (sibling to `Int128`).
- `data rust_u128: TypeRealization`: u128 carrier realization. Symmetric
  to `rust_i128`; consumes the `UInt128` kernel integer
  (`Semiring<Word128>`) per `dsl/std/integer.dag:61`.
- `data rust_integer_inhabit_u128_bound_unspecified: TargetIntegerTypeInhabitance`:
  inhabitance row for u128 mirroring the i128 `BoundUnspecified` shape
  above. Static interval bound facts on u128 (`StaticBoundFact(IntInterval)`)
  lower through the BigInt-backed `IntervalInt::ExactInterval` once
  narrowing consumers exercise them — Phase A's host-repr widening is
  what made this representable.
- Bootstrap snapshots regenerated.

The existing 5 `TargetIntegerTypeInhabitance` rows (u32 / i32 / int64 /
i128 / i32_at_program_bound) are untouched per Mgr's confirmed
Option (ii) dispatch path.

NOT in this commit:
- isize / usize rows: blocked on missing `IntSize` / `UIntSize` kernel
  integer types in `dsl/std/integer.dag` — `kernel_integer:` field on
  `TargetIntegerTypeInhabitance` requires a std integer type, but the
  std lacks platform-sized integer carriers. Surfacing as scope question
  to Substrate Mgr (#1739) before authoring; std-side
  IntSize/UIntSize introduction is substrate-fact-introduction, not
  in this slice's bundled scope.

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

* docs(v3): align EXPECTED_INTEGER_ROWS comment with live state (10 rows)

Address non-blocking doc-drift finding on PR #1914 (cursor@b6989ec7):
the block comment above `EXPECTED_INTEGER_ROWS` still said "9 rows" and
referenced the resolved "Slice B2" deferral marker, but the const + the
pilot list now carry 10 rows including u128.

Refresh the comment to reflect live state per INVARIANTS.md
"Documentation Describes Live State" spirit. Also update the docstring
above to say "decimal BigInt" instead of "i128" (host repr widened in
Phase A).

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

* docs(rust-primitives): refresh PILOT SCOPE / Slice B2 header to live state

Address non-blocking finding on PR #1914 (codex@f994e1f3): file-level
pilot-scope text still listed u128 as deferred even though the row is
present in this PR. Refresh:

- PILOT SCOPE list now includes u128.
- T-Int128 SLICE B1/B2 block annotates the resolution: B2 deferral
  closed by Phase A `BigInt` host repr widening (commit `e7ba022c6`);
  u128 row landed in Phase B-1 (commit `59511503e`).
- New FOLLOW-ON DEFERRAL block names the next cascade explicitly:
  isize/usize wait on substrate-side IntSize/UIntSize kernel integer
  introduction (Director-level scope per Mgr disposition Path 1 at
  gunbc#1761 #issuecomment-4393235461).

Bootstrap snapshots + parse manifest regenerated to absorb the comment
edit through the bootstrap span byte ranges.

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

* WIP: valiant-ibex-312

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.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