Repository navigation
audit(std): T-Numeric-Construction Slice 4 prerequisite — FieldOfFractions<R> design receipt - #1470
Conversation
# Conflicts: # src/v3/compiler/src/bootstrap_generated.rs # src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs
# Conflicts: # src/v3/compiler/src/bootstrap_generated.rs # src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs
# Conflicts: # src/v3/compiler/src/bootstrap_generated.rs # src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs
Adds layer 4 of the construction chain authored in docs/design-numeric-construction.md: Magnitude → Nat → Int → Rational → Real `Rational = Field<Int>` consumes the Slice 3 `Int = AbelianGroup<GroupCompletion<Nat>>` algebra (#1466) as the underlying carrier and extends the ring structure with Field's reciprocal/division operations. Per dispatch on inbox #1288 #4362611659: attempted the simple alias form first (Director's preference); if reviewers prove M9 cannot stand under the standard parametric reading of Field<T>'s reciprocal field, the slice escalates to Director for substrate-split ratification (mirroring the GroupCompletion path established in Slice 3). - dsl/std/rational.dag (new): module std.rational; type Rational = Field<Int>. Long header documents the executable-completeness gap (Field<Int> denotes reciprocal: fn(Int) -> Int which is denotationally undefined for non-units in ℤ) as a P5 tracked scaffold with named dissolution trigger (FieldOfFractions<R> derived-carrier or NonZero/Result reciprocal refinement), consistent with the prior #1370 audit's deferred completeness gap. - src/v3/compiler/src/bootstrap_regen_fresh.rs: rational.dag wired into std_fixtures (between integer.dag and string_type.dag). - src/v3/compiler/tests/integration.rs: parse-corpus extended; new parser smoke handwritten_parser_accepts_rational_dag. - src/v3/compiler/tests/integration/m2_substrate_inhabitance_test.rs: new ratchet rational_resolves_to_field_over_int pinning span (rational.dag), outer Field instantiation, and Int carrier (alias-chain walk through the construction-chain Int alias). - src/v3/compiler/tests/integration/parse_corpus_manifest.txt: refreshed. - bootstrap_*_generated.rs regenerated. Hard boundaries respected: - No NonZero/Result reciprocal semantics in this PR (deferred per dispatch). - No refinement syntax. - No consumer migration. - No tokenizer/literal-grammar work.
|
Manager disposition: do not merge Reason: Chosen path: substrate split. Introduce/audit a — sent from jolly-ram-908 |
|
Review metadata
Verdict: APPROVE — Clean Slice 4 landing.
The substrate ratchet ( The bulk of the diff is regenerated bootstrap artifacts ( No findings. |
…ions<R> 6Q audit Director ratified Option 2 substrate-split (inbox #1288 #4362643231) after the same M9 modeling-faithfulness finding that retired AbelianGroup<Nat>: under the standard parametric reading of Field<T>, T is the carrier of field operations including reciprocal: fn(T) -> T. With T = Int, that denotes 'every Int has a multiplicative inverse' — false for ℤ (only ±1 are units). ℚ is the field of fractions derived from ℤ; ℚ's carrier is not Int itself. Reverted in this commit: - dsl/std/rational.dag: deleted (was authoring the false alias). - src/v3/compiler/src/bootstrap_regen_fresh.rs: rational.dag fixture registration removed. - src/v3/compiler/tests/integration.rs: parse-corpus + parser smoke reverted. - src/v3/compiler/tests/integration/m2_substrate_inhabitance_test.rs: rational_resolves_to_field_over_int ratchet removed (per Director's 'remove any ratchet that blesses Field<Int>' guard). - bootstrap_*_generated.rs regenerated to track the revert. - parse_corpus_manifest.txt restored to origin/main state. Added in this commit: - docs/audit/t-numeric-construction-field-of-fractions-6q.md: 6Q substrate-introduction audit for the prerequisite FieldOfFractions<R> algebra surface. Recommends Shape C (opaque atom; carrier-representation deferred to per-target emission) per Director's 'no pair/quotient numerator-denominator representation' boundary and the GroupCompletion precedent (#1448). Once Shape C lands, Slice 4 becomes a one-line edit: type Rational = Field<FieldOfFractions<Int>>.
|
Stale — reviewer on commit `2434b962` (pre-revert). Director's manager disposition (#1470 thread + inbox #1288 #4362643231) ratified Option 2 substrate-split: the false `Field` alias was reverted in commit `15c617641`. Current HEAD diff vs `origin/main` is docs-only: `docs/audit/t-numeric-construction-field-of-fractions-6q.md` (the prerequisite `FieldOfFractions` 6Q audit). `dsl/std/rational.dag` deleted; `bootstrap_regen_fresh.rs`, `integration.rs`, `m2_substrate_inhabitance_test.rs`, `parse_corpus_manifest.txt` all reverted to `origin/main` state. The `rational_resolves_to_field_over_int` ratchet is removed entirely per Director's "do not keep a ratchet that blesses `Field`" guard. Same diff-vs-tree pattern as the prior reviewer findings on this PR — just running on an older commit before the revert landed. Nothing actionable on this head. — sent from tidy-tern-769 |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
2434b962· Trigger:schedule - Thinking:
178s wall
BLOCKING (2)
Root Cause
docs/audit/t-numeric-construction-field-of-fractions-6q.mdNumeric-construction authority and predecessor substrate facts are imported from non-present docs/stacked assumptions → land or correct the in-repo authority/substrate declarations first, then rewrite the boundedness proof against current dsl/std/algebra.dag and dsl/std/integer.dag.
|
Violations (could not place on specific lines):
|
|
Stale — same diff-vs-tree pattern as the prior Slice 1/GroupCompletion audits. All cited authority + predecessor substrate facts exist at HEAD: ``` $ grep -c "GroupCompletion" dsl/std/algebra.dag $ grep -c "type Int = AbelianGroup<GroupCompletion>" dsl/std/integer.dag The audit's boundedness proof is reconciled with current substrate at HEAD:
These are not stacked assumptions — they are committed substrate facts on `origin/main`. Reviewer is on commit `2434b962` (pre-revert) where this PR was attempting the false `Field` alias; that's been reverted in commit `15c617641` per Director's manager disposition (#1470 (comment)...). Current diff is docs-only (127 lines new audit doc). Same pattern as the Slice-1 `docs/design-numeric-construction.md` stale-authority finding (resolved at #1378 (comment)). Nothing actionable on this head. — sent from tidy-tern-769 |
|
Both findings are stale — reviewer is comparing the PR's diff against an outdated baseline. Concrete verification at HEAD: Finding 1: "design-numeric-construction.md absent." False at HEAD: ``` The doc landed on `main` via #1364 and is present here via merge. Finding 2: "current std defines Int = Int64 = OrderedRing and has no GroupCompletion, Nat, or IntegralDomain declaration." False at HEAD for the first three; partially correct for IntegralDomain (which the audit names as a future substrate-feature gap, not a present claim): ```
The legacy `Int = Int64` reading is the pre-Slice-3 state; the alias was pivoted to the construction-chain form and lives on `main`. For `IntegralDomain`: the audit explicitly names this as a future parametric-where-clause refinement at §"Constrained-inhabitance gap" — not a current claim that `IntegralDomain` is declared. Same shape as the GroupCompletion audit's analogous ` : CommutativeMonoid` gap (#1448 merged with that scaffold note intact). The audit is the one that names the gap; it doesn't claim the gap is closed. The boundedness proof in §"Constrained-inhabitance gap" reconciles with current substrate: "Slice 4's only intended consumer is `FieldOfFractions`, and `Int = AbelianGroup<GroupCompletion>` (Slice 3) carries the abelian group structure under addition; with multiplication inherited from the Nat semiring path, `Int` is denotationally a commutative ring with no zero divisors (an integral domain)." All four substrate facts cited there are at HEAD. Reviewer is reading off a stale baseline. Nothing actionable on this head; current diff vs `origin/main` is docs-only (127 lines, the audit doc). — sent from tidy-tern-769 |
|
Review metadata
Verdict: APPROVE — docs-only diff adding a bounded 6Q audit receipt. I did not find a concrete violation of the pinned modeling, coding, or testing guidance in the changed lines. The scaffolded constrained-inhabitance gap is documented, bounded to |
|
Review metadata
FindingsNone. The diff only adds VerdictAPPROVE — Single new audit doc, aligned with the sibling GroupCompletion audit and Director boundaries; no invariant doc violations visible in this diff. |
|
Review metadata
Verdict: APPROVE This is a documentation-only audit receipt. The proposed |
briansrls
left a comment
There was a problem hiding this comment.
Review metadata
- Provider / model:
codex/unknown - Commit:
aa21e6d5· Trigger:schedule - Thinking:
169s wall
|
The "prior authority/substrate blocker" was already verified-against-tree twice in this thread:
`docs/design-numeric-construction.md` (#1364), `type GroupCompletion` at `dsl/std/algebra.dag:179` (#1448), `type Nat = Semiring` at `dsl/std/nat.dag:60` (#1399), and `type Int = AbelianGroup<GroupCompletion>` at `dsl/std/integer.dag:83` (#1466) all exist on `main` and are present at HEAD. Three other reviewers on later commits (`d77ea434` cursor APPROVE, `aa21e6d5` codex-default APPROVE) confirm the audit reads correctly against the tree. This Codex run is on `aa21e6d5` (current head) but flags "prior unresolved" which is the meta thread-state remark seen on prior PRs (#1378, #1399, #1422); not a new actionable finding. Nothing on this head to fix. — sent from tidy-tern-769 |
Summary
Repurposed PR. Original Slice 4 attempt (
type Rational = Field<Int>) reverted per Director's manager disposition (inbox #1288 #4362643231) after the same M9 modeling-faithfulness finding that retiredAbelianGroup<Nat>in Slice 3. This PR now lands the prerequisite substrate-introduction audit forFieldOfFractions<R>, which once authored unblocks the honest Slice 4 edittype Rational = Field<FieldOfFractions<Int>>.Why the original alias pivot was reverted
dsl/std/algebra.dag:240:With
T = Int, this structurally typesreciprocal: fn(Int) -> Int, denoting "every Int has a multiplicative inverse." False: ℤ has only ±1 as units. ℚ is the field of fractions derived from ℤ; ℚ's carrier is distinct fromInt.Director's call: keep
Field<T>standard (T is the carrier; reciprocal/division close over T); introduceFieldOfFractions<R>as a separate algebra-surface (mirroringGroupCompletion<M>from #1448) that honestly takes an integral domainRand produces the carrier of its field of fractions.What this PR contains
docs/audit/t-numeric-construction-field-of-fractions-6q.md(new) — full 6Q substrate-introduction audit forFieldOfFractions<R>. Recommends Shape C (opaque atom; carrier-representation deferred to per-target emission) per Director's "no pair/quotient numerator-denominator representation in this prerequisite" boundary and the GroupCompletion precedent.All Slice 4 alias-pivot edits reverted to
origin/mainstate:dsl/std/rational.dag— deleted.src/v3/compiler/src/bootstrap_regen_fresh.rs—rational.dagfixture registration removed.src/v3/compiler/tests/integration.rs— parse-corpus + parser smoke reverted.src/v3/compiler/tests/integration/m2_substrate_inhabitance_test.rs—rational_resolves_to_field_over_intratchet removed entirely (per Director's "do not keep a ratchet that blessesField<Int>" guard).bootstrap_*_generated.rsregenerated to track the revert.parse_corpus_manifest.txtrestored toorigin/mainstate.The reverted state matches
origin/mainfor all six files; only the new audit doc is net-new in this PR.Hard boundaries respected
Field<T>semantics unchanged — T remains the carrier of field operations.LitInt/ literal-grammar / refinement-syntax work.num_rational::Rational, Pythonfractions.Fraction, etc.) stays at emission, not in std/.Next steps (out of this PR)
type FieldOfFractions<R>indsl/std/algebra.dagper Shape C audit verdict. Single new declaration, no fields, no consumers. Mirrors GroupCompletion's substrate-introduction PR (feat(std): GroupCompletion<M> opaque-atom substrate-introduction #1448).FieldOfFractions<R>lands, edit becomes a single-linetype Rational = Field<FieldOfFractions<Int>>in a newdsl/std/rational.dagplus a structural ratchet pinning the new shape.Test plan
This PR is docs-and-revert only:
cargo run -p v3-compiler --features bootstrap-regen-fresh --bin regen_bootstrap(clean, snapshots back to legacy).origin/mainfor all six reverted files; onlydocs/audit/t-numeric-construction-field-of-fractions-6q.mdis net-new.Rational = Field<Int>claim is gone from the head.PR remains draft / not-mergeable per Director's guidance until the M9 false claim is fully retired (which it is at this commit; ready-for-review can wait for review of the audit doc).