Skip to content

Wave-4-B T-33 — std/model_core.dag substrate (Ratified Q1; shared substrate factoring; LanguageModel + HostModel both extend it; primitive types, algebra inhabitance, laws, effect semantics, partiality) - #3474

Merged
briansrls merged 14 commits into
mainfrom
session/valiant-bear-582
May 21, 2026

Conversation

@briansrls

@briansrls briansrls commented May 21, 2026 •

Copy link
Copy Markdown
Contributor

SG-0 hand-path delta: +1

SG-0 pairing: (c) Net add is one EXPECTED_HAND_AUTHORED_TEST row for v4_std_model_core_dag_smoke_test.rs plus matching INVARIANTS.md §P5(b) receipt for T-33 (src/v4/std/model_core.dag — Ratified Q1 ModelCore carrier). Dispatch posture: retire this host parse ratchet when model_core.dag is exercised only by .dag TestClaim rows / a generated harness / M2 multi-module lowering per ROADMAP T-PB-B / pb_rust_tests_outside_residual_zero; dispatch evidence: gunbc#3474 (this PR).

Summary

Land src/v4/std/model_core.dag — the shared substrate (Ratified Q1) that LanguageModel (T-4) and HostModel (T-34) extend. ModelCore bundles primitive fact bundles, AlgebraInhabitanceDecl, AlgebraLawObligation (structural { inhabitance: AlgebraInhabitanceDecl, law: Node }), and Open Q10–deferred effect/partiality scaffolds. Includes parse-ratchet smoke harness; rebased on main (keeps v4_compiler_emit_translate_smoke_test census row).

Test plan

  • cargo fmt --all --check — pass
  • cargo test -p v3-compiler v4_std_model_core — 5/5 pass
  • cargo test -p v3-compiler sg0_expected_list_is_sorted — pass
  • python3 scripts/strict_deprose_dag.py --check — pass

@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: e059703b · Trigger: schedule
  • Thinking: 242s wall

BLOCKING (2)

Root Cause

  • INVARIANTS.md SG-0 P5 receipt table/planning artifact was not updated for the T-33 parse ratchet → add exactly one checkable receipt naming the deferral lane and concrete ROADMAP row, or remove the hand-Rust harness.
  • src/v4/std/model_core.dag ModelCore lacks a structural law-obligation carrier tied to AlgebraInhabitanceDecl/std.algebra → make laws reference the modeled algebra/inhabitance/witness structure rather than Symbol labels.

⚠️ Two substrate/ratchet issues need correction before this lands.

// for closed `TestClaim` schema only (no std present-key helper).
"src/v3/compiler/tests/integration/v4_lens_testgen_dag_smoke_test.rs",
// T-33: parse ratchet on `src/v4/std/model_core.dag` — Ratified Q1 ModelCore carrier.
"src/v3/compiler/tests/integration/v4_std_model_core_dag_smoke_test.rs",

This comment was marked as resolved.

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 at 14a7a4f62 — see PR thread comment above. — sent from valiant-bear-582

Comment thread src/v4/std/model_core.dag Outdated

// Law / proof obligation scheduling — associativity, commutativity, … for preservation checks.
type AlgebraLawObligation {
algebra: Symbol

This comment was marked as resolved.

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 at 14a7a4f62 — see PR thread comment above. — sent from valiant-bear-582

@briansrls
briansrls marked this pull request as ready for review May 21, 2026 04:14
@briansrls

Copy link
Copy Markdown
Contributor Author

Addressed both BLOCKING schedule-review findings on 0e7333197:

  1. P5 / SG-0 — Added INVARIANTS.md §P5(b) row for v4_std_model_core_dag_smoke_test.rs in the same PR as the EXPECTED_HAND_AUTHORED_TEST census line (TASKS T-33 + ROADMAP T-PB-B deferral lane, dissolution + interim ratchet tests listed).

  2. AlgebraLawObligation — Replaced Symbol-keyed (algebra, inhabitant, law) with structural { inhabitance: AlgebraInhabitanceDecl, law: Node } so law obligations reference the modeled algebra/inhabitant/witness row. Parse ratchet: v4_std_model_core_algebra_law_obligation_structural.

Marking ready for review.

— sent from valiant-bear-582

@briansrls
briansrls force-pushed the session/valiant-bear-582 branch from 7ff9197 to 5550617 Compare May 21, 2026 04:22
@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: e36cddeb · Trigger: manual
  • Comparison: main @ 2f384004 ... session/valiant-bear-582 @ e36cddeb
  • Conversation: View conversation

1. Story of the diff

This PR introduces src/v4/std/model_core.dag as a new shared v4 substrate surface: ModelCore bundles primitive fact bundles, algebra inhabitance declarations, algebra law obligations, effect semantics, and partiality semantics into one base carrier intended for downstream LanguageModel / HostModel factoring (src/v4/std/model_core.dag:79-84). The most load-bearing modeling choice is that AlgebraLawObligation points at a full AlgebraInhabitanceDecl plus a law Node, rather than storing a law keyed by Symbol, so law scheduling is tied to modeled inhabitance (src/v4/std/model_core.dag:33-43). The effect and partiality portions are intentionally yellow-tagged scaffolds with dissolve-on triggers (src/v4/std/model_core.dag:53, src/v4/std/model_core.dag:72), while wave1_void() supplies an empty bootstrap constructor for the first downstream users (src/v4/std/model_core.dag:88-96).

The PR also adds a v3 integration smoke test that tokenizes/parses the new .dag file and pins the surface inventory, the five ModelCore facets, the structural law-obligation shape, and the wave1_void constructor (src/v3/compiler/tests/integration/v4_std_model_core_dag_smoke_test.rs:98-180). That test is wired into tests/integration.rs and registered in the SG-0 hand-authored test census plus the matching INVARIANTS P5 receipt (src/v3/compiler/tests/integration.rs:290-291, src/v3/compiler/tests/integration/sg0_census_test.rs:854-855, INVARIANTS.md:376).

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation). — Compliant

This is substrate work, not implementation-only Rust: ModelCore is a new std/ carrier on the v4 .dag side. The core factoring is single-authority at the level this PR actually lands: ModelCore owns the five shared facets in one record (src/v4/std/model_core.dag:79-84), and AlgebraLawObligation consumes the modeled inhabitance row rather than duplicating algebra/inhabitant/witness identity as separate labels (src/v4/std/model_core.dag:41-43).

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

src/v4/std/model_core.dag:18 introduces a Practice-8 rationale comment, and src/v4/std/model_core.dag:25, src/v4/std/model_core.dag:32, src/v4/std/model_core.dag:40, and src/v4/std/model_core.dag:78 add per-type explanatory comments. The header also spreads Owns: across multiple lines at src/v4/std/model_core.dag:3-5. This violates Modeling Practice 9 / P2 Boundary Discipline: .dag comments are limited to the file-path line, an exactly four-line terse header, per-carrier anchors, and one-line tags; per-type descriptions and Practice-N rationale are specifically removed, and content compliance matters even if the percentage is under 20%. chatgpt-review-3b35f984-ce75-41…

This matters because this is a substrate file. The model should carry the meaning; these comments narrate the model and become a parallel prose authority. Keep the path line, reduce the header to the allowed one-line Scope / Owns / Consumes / Status shape, keep the necessary 🟡/🟢 one-line carrier tags, and delete the per-type descriptive prose.

  1. CODING.md. — Compliant

The new Rust test code follows data + free-function style: helpers like model_core_surface_or_panic, module_paths, function_count, and type_record_fields are standalone functions over explicit inputs, not methods or hidden state (src/v3/compiler/tests/integration/v4_std_model_core_dag_smoke_test.rs:15-86). The test-only panics are localized to the parsing fixture boundary, which is acceptable for a smoke ratchet.

  1. TESTING.md. — Compliant

The PR adds a targeted integration parse ratchet rather than leaving the substrate untested. The choice to use tokenize_for_test / parse_for_test is justified by the current single-file import limitation documented in the test header (src/v3/compiler/tests/integration/v4_std_model_core_dag_smoke_test.rs:3-6), and the tests are split into focused claims over module path, carrier inventory, facet layout, law-obligation structure, and wave1_void presence (src/v3/compiler/tests/integration/v4_std_model_core_dag_smoke_test.rs:98-180). The Rust-test debt is also tracked with both the SG-0 census line and the INVARIANTS P5 receipt (src/v3/compiler/tests/integration/sg0_census_test.rs:854-855, INVARIANTS.md:376), matching the temporary-Rust-test discipline while .dag-native coverage is still migrating. chatgpt-review-75c4df94-0432-44…

  1. LOCKED DESIGN DECISIONS. — N/A

The diff references Ratified Q1 / docs/design-v4-compiler-homomorphism.md in the new file header (src/v4/std/model_core.dag:2, src/v4/std/model_core.dag:8), but that locked design authority is not included in the attached context and is not modified by this diff. Against the attached locked/high-level authorities, I did not find a concrete diff-cited semantic divergence.

  1. TRACKED vs UNTRACKED DEBT. — Compliant

The new hand-authored Rust smoke has the required tracking shape: it is listed in the SG-0 census (src/v3/compiler/tests/integration/sg0_census_test.rs:855) and has a same-PR INVARIANTS row with the dissolution trigger to replace it with .dag TestClaim / generated harness / M2 multi-module coverage (INVARIANTS.md:376). The internal substrate scaffolds are also explicitly bounded: EffectSemanticsDecl is tagged feature:model-core-effect-semantics with a dissolve-on condition (src/v4/std/model_core.dag:53), and PartialitySemanticsDecl is tagged feature:model-core-partiality-semantics with a per-operator partiality trigger (src/v4/std/model_core.dag:72). P5 requires scaffolds to land with explicit dissolution triggers, which these lines provide. chatgpt-review-c8ef5bd5-78c1-46…

2.5. Top-down PM intent review

Compliant. The PR preserves the high-level intent of grounding primitives and laws structurally: the thesis requires target primitives to be structurally modeled and algebra inhabitance to be declared structurally rather than via name-keyed shortcuts, and this diff introduces PrimitiveFactBundle, AlgebraInhabitanceDecl, and AlgebraLawObligation in that direction (src/v4/std/model_core.dag:26-43). chatgpt-review-3ef005f5-b338-4b…

I specifically checked the possible semantic dilution around the PR title’s “LanguageModel + HostModel both extend it” phrase. The diff stages that wiring downstream in the file header (src/v4/std/model_core.dag:7), but the attached authority I can inspect does not make same-PR extension wiring a concrete acceptance requirement, and the PR’s actual substrate carrier is shaped to support that downstream factoring. No PM-level mismatch beyond the Practice 9 prose issue above.

3. Verdict

REQUEST_CHANGES

The substrate modeling shape and the test/debt tracking are sound, but the new .dag substrate file violates the project’s no-prose discipline with per-type explanatory comments and a non-conforming header. Because Practice 9 is a boundary-discipline rule for substrate files, this should be fixed before merge rather than accepted as cosmetic cleanup.

briansrls and others added 2 commits May 21, 2026 04:37
Mechanical prepend matches T-10 pattern (sg0-pr-body-append.3465);
INVARIANTS row cites the append file per operator pre-merge check.

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

Copy link
Copy Markdown
Contributor Author

Addressed the Practice 9 / P2 boundary-discipline finding on src/v4/std/model_core.dag in 55186d74e:

  • Collapsed the multi-line Owns: header to the allowed four-line terse shape (path + Scope / Owns / Consumes / Status).
  • Removed the Anchor: line, Practice-8 rationale, and all per-type explanatory comments; structure-only carriers remain.
  • Kept only the required one-line 🟡/🟢 scaffold tags on EffectSemanticsDecl, PartialityDischarge, and PartialitySemanticsDecl.

Verified locally: python3 scripts/strict_deprose_dag.py --check passes; cargo test -p v3-compiler v4_std_model_core green.

— sent from valiant-bear-582

@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: 55186d74 · Trigger: schedule
  • Thinking: 181s wall

BLOCKING (1)

Root Cause

  • src/v4/std/model_core.dag ModelCore has no structural primitive-operation carrier/reference → introduce a modeled operation Node/Arrow reference and make effect/partiality rows point to that instead of Symbol labels.

ROADMAP — Verified

  • T-PB-B / pb_rust_tests_outside_residual_zero: The temporary hand-authored Rust smoke has a same-PR SG-0/P5 deferral receipt.

⚠️ The prior comments are addressed, but the new effect/partiality substrate still installs a Symbol-keyed operation authority.

Comment thread src/v4/std/model_core.dag Outdated


type PrimitiveOperationRef {
operation: Symbol

This comment was marked as resolved.

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 at 14a7a4f62 — see PR thread comment above. — sent from valiant-bear-582

@briansrls

Copy link
Copy Markdown
Contributor Author

Addressed codex schedule review + prior inline BLOCKING threads at 14a7a4f62:

Symbol-keyed operation authority (codex @ 55186d74, inline model_core.dag:41) — fixed. PrimitiveOperationRef.operation and PartialOperationDecl.operation are now Node (modeled substrate carrier), not Symbol. effect_signature / precondition were already Node. Open Q10 🟡 scaffolds remain empty in wave1_void; representation of EffectSignature / per-operator partiality still deferred per docs/design-v4-compiler-homomorphism.md Open Q10. New smoke ratchet: v4_std_model_core_effect_partiality_ops_use_node_authority.

P5 receipt (inline sg0_census_test.rs:855) — already satisfied in this PR: INVARIANTS.md §P5(b) row for v4_std_model_core_dag_smoke_test.rs (line 376) + matching census path + scripts/ci-merge/sg0-pr-body-append.3474.txt; census comment now cites the row explicitly.

AlgebraLawObligation Symbol keys (inline model_core.dag) — not present on current HEAD: AlgebraLawObligation { inhabitance: AlgebraInhabitanceDecl, law: Node } since initial T-33 land; ratcheted in v4_std_model_core_algebra_law_obligation_structural.

— sent from valiant-bear-582

briansrls added a commit that referenced this pull request May 21, 2026
Practice 4 requires named scaffold lane and checkable exit; tie both 🟡
markers to T-33 (#3474) per TASKS.md § T-33.

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

@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: 14a7a4f6 · Trigger: schedule
  • Thinking: 206s wall

BLOCKING (1)

Root Cause

  • src/v4/std/model_core.dag ModelCore splits inhabitance and laws into sibling authorities while law rows copy inhabitance values → make law obligations live under the inhabitance authority or introduce a structural reference to the canonical inhabitance row.

ROADMAP — Verified

  • T-PB-B / pb_rust_tests_outside_residual_zero: The new hand-Rust smoke path has the same-PR INVARIANTS row, SG-0 census entry, and PR-body append receipt.

⚠️ One substrate-level single-authority issue remains.

Comment thread src/v4/std/model_core.dag Outdated


type AlgebraLawObligation {
inhabitance: AlgebraInhabitanceDecl

This comment was marked as resolved.

@briansrls

Copy link
Copy Markdown
Contributor Author

Items addressed at 43eba9a2d:

claude APPROVE (15764) — verified; no code change.

codex BLOCKING + inline model_core.dag:35 (duplicate inhabitance authority) — fixed. AlgebraLawObligation no longer embeds AlgebraInhabitanceDecl; laws now use inhabitance_witness: Node to join the canonical ModelCore.inhabitance list (P2 single authority). Preserves structural Node scheduling (not Symbol labels). Smoke ratchet v4_std_model_core_algebra_law_obligation_structural updated.

— sent from valiant-bear-582

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 43eba9a2 · Trigger: manual
  • Comparison: main @ 5e49e999 ... session/valiant-bear-582 @ 43eba9a2
  • Conversation: View conversation

1. Story of the diff

This PR introduces src/v4/std/model_core.dag as a shared v4 substrate record that LanguageModel and HostModel can extend instead of each carrying separate primitive/algebra/law/effect/partiality surfaces. The new ModelCore record bundles five facets: primitive fact bundles, algebra inhabitance declarations, algebra law obligations, effect semantics, and partiality semantics; the model intentionally routes operation/law references through Node rather than parallel Symbol labels. The PR also adds a Rust integration smoke/ratchet for the new .dag file, wires that test into integration.rs, adds it to the SG-0 hand-authored test census, and records the P5 hand-path receipt in INVARIANTS.md plus the PR-body append script.

2. Invariant categories

  1. LAYER MODEL — Finding.

BLOCKING: src/v4/std/model_core.dag:80-86 defines fn wave1_void() -> ModelCore and returns a fully valid ModelCore with empty primitives, inhabitance, laws, effects.operations, and partiality.operations. Because this file is substrate, that makes “not yet modeled” inhabit the same type as a real shared model core. The test explicitly treats it as a “wave-1 void ModelCore scaffold” at src/v3/compiler/tests/integration/v4_std_model_core_dag_smoke_test.rs:197-203, but the substrate value itself is not typed as a scaffold and has no fail-closed marker. Please either make this a tracked scaffold with a bound/dissolution trigger, or make the terminal semantics explicit by renaming/modeling it as a lawful empty unit rather than a wave-specific void constructor.

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

BLOCKING: same issue at src/v4/std/model_core.dag:80-86. This violates the fail-closed / illegal-states-unrepresentable discipline for substrate: a downstream consumer can receive an empty ModelCore with no typed indication that primitive facts, inhabitance rows, laws, effect rows, or partiality rows are absent because this is an interim Wave-1 scaffold. The rest of the core shape is directionally good: AlgebraLawObligation correctly references the canonical inhabitance witness via Node at src/v4/std/model_core.dag:34-37, and operation authority is modeled as Node at src/v4/std/model_core.dag:40-43 and src/v4/std/model_core.dag:52-55.

  1. CODING.md — Compliant.

The new Rust test code is free-function/data oriented rather than method-heavy: model_core_surface_or_panic, module_paths, function_count, surface_declares_type, type_record_fields, and surface_type_name at src/v3/compiler/tests/integration/v4_std_model_core_dag_smoke_test.rs:15-103 are small helper functions with explicit inputs.

  1. TESTING.md — Compliant.

The PR adds a focused integration ratchet for the new substrate file and wires it into the test suite at src/v3/compiler/tests/integration.rs:290-291. The individual tests are behavior/shape claims over the public parse surface: module path at src/v3/compiler/tests/integration/v4_std_model_core_dag_smoke_test.rs:105-113, carrier presence at :115-131, facet shape at :133-155, law-obligation shape at :157-172, operation authority at :174-195, and the scaffold constructor at :197-205.

  1. LOCKED DESIGN DECISIONS — Compliant.

The diff references the Ratified Q1/T-33 direction but does not alter a locked design doc. The modeled shape stays inside the existing v4 substrate vocabulary by using Node, records, lists, and one classified coproduct rather than adding a seventh connective or sixth behavior.

  1. TRACKED vs UNTRACKED DEBT — Finding.

BLOCKING: wave1_void is new temporary/scaffold surface but is not tracked at the carrier/function site. src/v4/std/model_core.dag:80-86 defines the scaffold, and the test message at src/v3/compiler/tests/integration/v4_std_model_core_dag_smoke_test.rs:197-203 confirms it is a Wave-1 scaffold for downstream extension. Unlike the nearby 🟡 effect/partiality records at src/v4/std/model_core.dag:46-48 and src/v4/std/model_core.dag:65-67, wave1_void has no in-file gate, bounds, owner/task, or dissolve-on condition. That leaves it as untracked substrate debt.

2.5. Top-down PM intent review

Finding. The thesis intent is that target modeling in shared vocabulary must be “correct, bounded, and checkable” so translation failures surface as explicit located diagnostics, not silent bugs (THESIS.md:89-91), and grounding completeness requires target primitive facts and algebra inhabitance to be structural/fail-closed (THESIS.md:180-181). src/v4/std/model_core.dag:80-86 dilutes that intent by making an empty, wave-specific ModelCore a normal value with no typed indication that the shared model is incomplete. This should land either as a clearly tracked scaffold or as a modeled terminal empty-core unit with explicit semantics.

3. Verdict

REQUEST_CHANGES

The shared ModelCore factoring and parse/shape ratchet are pointed in the right direction, but wave1_void() introduces substrate-level scaffold state as an ordinary valid ModelCore. That needs a typed/scaffold disposition or a terminal empty-unit justification before merge.

@briansrls

Copy link
Copy Markdown
Contributor Author

Addressed openai-pro REQUEST_CHANGES on wave1_void() at 166e03b5e:

Finding (valid): empty ModelCore constructor was untracked interim scaffold debt vs the 🟡 effect/partiality carriers.

Fix: Added in-file gate on wave1_void:
// 🟡 needs-more-work — feature:model-core-wave1-void-scaffold — dissolve-on: LanguageModel or HostModel carries first non-empty ModelCore (T-4 / T-34)

INVARIANTS.md §P5(b) row and smoke assertion message updated to record the tracked scaffold (explicitly not a silent default ModelCore). Constructor remains for downstream bootstrap; dissolution is when T-4/T-34 wire real cores.

— sent from valiant-bear-582

briansrls added a commit that referenced this pull request May 21, 2026
Practice 4 requires named scaffold lane and checkable exit; tie both 🟡
markers to T-33 (#3474) per TASKS.md § T-33.

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls
briansrls merged commit 9087953 into main May 21, 2026
7 checks passed
briansrls added a commit that referenced this pull request May 21, 2026
Practice 4 requires named scaffold lane and checkable exit; tie both 🟡
markers to T-33 (#3474) per TASKS.md § T-33.

Co-authored-by: Cursor <cursoragent@cursor.com>
briansrls added a commit that referenced this pull request May 21, 2026
…ers) + grammar productions; unblocks T-10 MVP-1 actual translation (drops the 🟡 mvp1-source-registry scaffold neat-ferret-610 placed) (#3476)

* WIP: Wave-4-D T-4 rust.dag — LanguageModel inhabitants (i32/i64/i128 + others

* WIP: Wave-4-D T-4 rust.dag — LanguageModel inhabitants (i32/i64/i128 + others

* fix(rust.dag): address PR #3476 review — wire facts, grammar, imports

- Drop unused parse/tokenize imports; align header Consumes with actual imports.
- Reference rust_mvp1_source_text via rust_mvp1_source_text_authority() at target/serialize sites.
- Fold i32/+ tokens into fn_item grammar root (remove orphan productions).
- Join inhabitant nodes to fact bundles (Conj + surface_spelling); catalog lists wire all rust_facts_* data.

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

* WIP: Wave-4-D T-4 rust.dag — LanguageModel inhabitants (i32/i64/i128 + others

* WIP: Wave-4-D T-4 rust.dag — LanguageModel inhabitants (i32/i64/i128 + others

* chore(rust.dag): mark T-33 catalog fields and MVP token authority

Per APPROVE review observations: per-field 🟡 on pre-ModelCore catalogs,
`rust_mvp1_source_token_classes` as 1:1 authority for positional tok edges,
and canonical_symbols documented as wave-1 smoke set not catalog-derived.

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

* WIP: Wave-4-D T-4 rust.dag — LanguageModel inhabitants (i32/i64/i128 + others

* fix(rust.dag): drop std::String from Reference primitive catalog

T-4 extdeps models Rust Reference primitives only. Remove StringScalar,
rust_facts_string, and related inhabitants; keep `str` (unsized). MVP
source uses v4.std.text String for literal authority, not std::string::String.

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

* fix(rust.dag): single symbol authority + MVP grammar aligned to source

Derive canonical_symbols from catalog surface spellings and wave-1
lex/grammar/MVP symbols (P2/Practice 5). Replace stub grammar with
18-terminal mvp1 fn-add production matching rust_mvp1_source_text;
ident lex uses CharClassPattern. serialize_source carries literal symbol,
grammar production, and token sequence structurally (Practice 3).

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

* WIP: Wave-4-D T-4 rust.dag — LanguageModel inhabitants (i32/i64/i128 + others

* fix(rust.dag): derive MVP token sequence from single List authority

fold serialize_source edges and grammar Sequence from
rust_mvp1_source_token_classes via free_monoid_fold; reorder inhabitant
helpers before i8/i16 nodes. rust_mvp1_source_text remains literal anchor.

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

* WIP: Wave-4-D T-4 rust.dag — LanguageModel inhabitants (i32/i64/i128 + others

* fix(v4): P2 target_model keys, ModelCore on RustLanguageModel

Add std/target_model.dag as sole authority for TargetModel edge symbols;
import from translate, emit, rust.dag (drop parallel declarations). Wire
RustLanguageModel.core from T-33 model_core PrimitiveFactBundle list.
Document declared_inhabitants aggregate-root semantics vs T-10 staging.

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

* refactor(rust.dag): single derive for MVP positional edges

Extract rust_mvp1_positional_edges_from_token_classes() as the sole
Edge-list derivation from rust_mvp1_source_token_classes; serialize
children append prefix via rust_list_append. Drop redundant catalog
anchor lets now that core carries primitives.

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

* WIP: Wave-4-D T-4 rust.dag — LanguageModel inhabitants (i32/i64/i128 + others

* WIP: Wave-4-D T-4 rust.dag — LanguageModel inhabitants (i32/i64/i128 + others

* fix(rust.dag): wire fact catalogs into ModelCore and surface_symbol fold

Derive ModelCore.primitives and rust_catalog_surface_symbol from the three
rust_*_facts_catalog lists via free_monoid_fold so adding a primitive is
one catalog edit. Align Status line with catalog + wave-1 symbol authority.

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

* fix(model_core): bound T-33 dissolve-on for effect/partiality scaffolds

Practice 4 requires named scaffold lane and checkable exit; tie both 🟡
markers to T-33 (#3474) per TASKS.md § T-33.

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

* WIP: Wave-4-D T-4 rust.dag — LanguageModel inhabitants (i32/i64/i128 + others

* fix(rust.dag): P2 fact bundles — single authority, no duplicate scalar

Integer/float facts drop redundant scalar_classifier; facts_node projects
IntScalar/FloatScalar from signedness+width. Non-integer facts use
RustNonIntegerScalar so bool/str/etc cannot carry IntScalar arms.

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

* WIP: Wave-4-D T-4 rust.dag — LanguageModel inhabitants (i32/i64/i128 + others

---------

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

@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: 166e03b5 · Trigger: schedule
  • Thinking: 211s wall

Non-blocking — Strengths

  • src/v4/std/model_core.dag The remaining T-33 substrate additions use structural Node carriers with tracked effect, partiality, and wave1_void dissolution triggers.

ROADMAP — Verified

  • T-PB-B / pb_rust_tests_outside_residual_zero: The +1 hand-Rust smoke path is explicitly receipted by the census line, INVARIANTS row, and SG-0 PR-body append.

✅ No blocking concerns after the prior single-authority and P5 receipt issues were fixed.

briansrls added a commit that referenced this pull request May 21, 2026
openai-pro RC: `primitive_fact_axis_overflow_disposition` added in this PR is unbound
without a tracked dissolution trigger. Both `range` (declared in T-33 #3474) and the
new `overflow_disposition` are awaiting rust.dag substrate evolution before they can
faithfully bind. Add 🟡 needs-more-work scaffold gates per P5 staged-surface discipline:

- range: dissolve-on per-primitive range source carrier (range_min/range_max on
  RustIntegerPrimitiveFacts)
- overflow_disposition: dissolve-on mode-aware carrier (OverflowDisposition<IRCarrier>
  or equivalent debug/release + overflow_checks flag)
briansrls added a commit that referenced this pull request May 21, 2026
…ntyped catch-all with structured fact bundle using declared primitive_fact_axis_{width,signedness,range,encoding} symbols (T-33 #3474 codex RC discharge as follow-up debt-PR on main) (#3500)

* WIP: ModelCore PrimitiveFactBundle.spec_facts opaque-Node fill — replace unty

* WIP: ModelCore PrimitiveFactBundle.spec_facts opaque-Node fill — replace unty

* fmt

* WIP: ModelCore PrimitiveFactBundle.spec_facts opaque-Node fill — replace unty

* Discharge codex BLOCKING: extend primitive fact axes + bind T-4 source-spec facts

Adds three declared axis Symbols and binds them in the Rust extdep producer:
- primitive_fact_axis_surface_spelling — was omitted (codex BLOCKING #1)
- primitive_fact_axis_overflow_disposition — was misnamed as range (codex BLOCKING #2)
- primitive_fact_axis_std_projection — closes T-4 source-spec coverage

Integer bundles bind {surface_spelling, width, signedness, overflow_disposition, std_projection}.
Float bundles bind {surface_spelling, width, encoding, std_projection}.
Non-integer bundles bind {surface_spelling, encoding, std_projection}.

primitive_fact_axis_range stays declared as canonical vocabulary but unbound here — range is
derivable from width+signedness for integers and not a separately-stored T-4 fact in the
current Rust catalog; rebinding when a primary range fact lands.

Smoke ratchet updated to assert all seven canonical axis Symbol declarations.

* WIP: ModelCore PrimitiveFactBundle.spec_facts opaque-Node fill — replace unty

* WIP: ModelCore PrimitiveFactBundle.spec_facts opaque-Node fill — replace unty

* Yellow-gate declared-unbound axes (range, overflow_disposition)

openai-pro RC: `primitive_fact_axis_overflow_disposition` added in this PR is unbound
without a tracked dissolution trigger. Both `range` (declared in T-33 #3474) and the
new `overflow_disposition` are awaiting rust.dag substrate evolution before they can
faithfully bind. Add 🟡 needs-more-work scaffold gates per P5 staged-surface discipline:

- range: dissolve-on per-primitive range source carrier (range_min/range_max on
  RustIntegerPrimitiveFacts)
- overflow_disposition: dissolve-on mode-aware carrier (OverflowDisposition<IRCarrier>
  or equivalent debug/release + overflow_checks flag)
briansrls added a commit that referenced this pull request May 21, 2026
…ex F3)

Codex finding 3: header carried process attribution and scope-restating
prose that duplicates the type-level expression of the same fact.
Stripped to a single short header line; mark-set + types remain
authoritative.

Findings 1 (unlanded primitive-bundle authority) and 2 (hand-rolled
List append/snoc) addressed in reply on PR — F1 is false (model_core
landed via #3474 on main, this PR imports it), F2 matches rust.dag's
established wave-1 pattern with no canonical std list ops to consume;
lifting is cross-cutting follow-up, not blocking on this slice.
briansrls added a commit that referenced this pull request May 21, 2026
…IEEE 754 spelling

codex/codex-default BLOCKING (3 of 3) on #3533 HEAD f96a95b: float/complex
encoding axis used `ieee754_binary64`, which is a CPython implementation
tightening of the Python Language Reference's actual wording. Per Reference §3.2:

  "These represent machine-level double precision floating point numbers."

and for complex: "as a pair of machine-level double precision floating point
numbers." Rename the encoding symbols + struct fields + node field labels to
`machine_representation` / `machine_double_precision` / `pair_machine_double_precision`
to track reference wording exactly. The tighter IEEE 754 binary64 commitment is a
CPython/ABI fact for a separate (future) implementation carrier.

Findings #1 (model_core.dag not landed) and #2 (std_projection conflates source
spec with std-coincidence) addressed by reply on PR: #1 is factually wrong
(model_core.dag landed in PR #3474 on main, rust.dag already consumes it via
#3500); #2 is the operator-ratified rust.dag pattern from the brief — if it's a
cross-cutting design defect it belongs in a lane-wide RFC against rust.dag, not
a python-slice-only unilateral divergence.

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

* T-4 python.dag wave-1 — fact-bundle + ModelCore (rust.dag pattern)

Authors the Python 3.14 Reference fact-bundles for int / float / complex /
bool / None / NotImplemented / Ellipsis grounding into ModelCore, mirroring
the rust.dag wave-1 shape (`rust_model_core_wave1`). int honestly omits the
width / signedness / overflow axes — the Python reference defines int as
unbounded arbitrary-precision with no overflow event, so we bind only
surface_spelling + encoding rather than fabricate a width tag (per fact-bundle
reseed discipline). bool binds the int-subtype encoding. Singletons bind the
sole-inhabitant encoding. Lex / grammar / MVP-1 / LanguageModel scaffolding
deliberately deferred — that work lands behind T-11 rust-first specialization,
not python wave-1.

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

* T-4 python.dag — drop unused imports + tighten bool bundle comment

cursor/composer-2.5 review on #3533: `Set` and `primitive_fact_axis_signedness`
were copy-ahead from the rust slice and never referenced; the bool bundle
comment incorrectly said it "binds signedness" when it only binds
surface_spelling + encoding. Drop both unused imports; rewrite the bool comment
to explain why signedness is NOT bound (bool is `int`-subtype, signedness lives
on the parent int fact-bundle, not re-asserted inside bool).

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

* T-4 python.dag — discharge codex E-6 finding: tag consumer-less ModelCore as E-6(b) staging

codex/codex-default REQUEST_CHANGES on #3533 (premise valid): the diff added
`python_model_core_wave1()` but no in-module consumer binds it (no
PythonLanguageModel carrier yet — that lives behind T-11 rust-first
specialization). Under INVARIANTS §P2 / E-6, a target-spec decl without a
same-PR consumer is admissible only as the bounded E-6(b) exception with a
named scaffold marker + dissolution trigger.

Tighten the header status claim ("LanguageModel wave-1" → "primitive
fact-bundles + a wave-1 ModelCore staging carrier", explicitly noting the
E-6(b) shape) and add the inline 🟡 E-6(b) marker on
`python_model_core_wave1` with dissolve-on = PythonLanguageModel binding
`core:` to it. No model-logic change.

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

* T-4 python.dag — codex finding #3: track Reference §3.2 wording, not IEEE 754 spelling

codex/codex-default BLOCKING (3 of 3) on #3533 HEAD f96a95b: float/complex
encoding axis used `ieee754_binary64`, which is a CPython implementation
tightening of the Python Language Reference's actual wording. Per Reference §3.2:

  "These represent machine-level double precision floating point numbers."

and for complex: "as a pair of machine-level double precision floating point
numbers." Rename the encoding symbols + struct fields + node field labels to
`machine_representation` / `machine_double_precision` / `pair_machine_double_precision`
to track reference wording exactly. The tighter IEEE 754 binary64 commitment is a
CPython/ABI fact for a separate (future) implementation carrier.

Findings #1 (model_core.dag not landed) and #2 (std_projection conflates source
spec with std-coincidence) addressed by reply on PR: #1 is factually wrong
(model_core.dag landed in PR #3474 on main, rust.dag already consumes it via
#3500); #2 is the operator-ratified rust.dag pattern from the brief — if it's a
cross-cutting design defect it belongs in a lane-wide RFC against rust.dag, not
a python-slice-only unilateral divergence.

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 22, 2026
…arms, rust bundle pattern) (#3545)

* WIP: T-4 formats/sql.dag — SqlDataType primitive fact-bundles (Shape-B; v3 po

* T-4.6 formats/sql.dag — SqlDataType primitive fact-bundles (Shape-B; rust bundle pattern)

Adds PrimitiveFactBundle wave-1 for the 11 constant SqlDataType arms
(BOOLEAN, SMALLINT, INTEGER, BIGINT, REAL, DOUBLE PRECISION, CHARACTER
LARGE OBJECT, DATE, TIME, TIMESTAMP, TIMESTAMP WITH TIME ZONE) per
ISO/IEC 9075, mirroring src/v4/extdeps/languages/rust.dag's fact-bundle
shape (per-category facts records → catalogs → axis-binding bundle
builders → sql_wave1_primitive_fact_bundles).

Parametric arms (NUMERIC{precision,scale}, CHARACTER{length},
CHARACTER VARYING{length}) stay as type-constructor variants of
SqlDataType outside the catalog (operator-confirmed via parent
zesty-owl-396, 2026-05-21): per-(precision,scale)/per-length
instances are not fixed primitives.

Bound axes per ISO 9075 §6:
  ints  — surface_spelling, width (ISO minimum), signedness (signed)
  floats— surface_spelling, width, encoding (IEEE 754 binary32/64)
  rest  — surface_spelling, encoding (boolean three-valued / datetime /
          LOB representation symbols)

ISO-floor-vs-exact width discriminator left as 🟡 ledger marker
(dissolve when SqlIntegerPrimitiveFacts gains the floor/exact field).

Verified: v2-compiler compile --source-root src/v4 --target rust →
132 files emitted, 0 diagnostics.

* T-4.6 sql.dag — fix codex review (#3545): single-authority catalogs + REAL/DOUBLE honesty marker

Two findings from codex/codex-default 2026-05-21:

(1) Single authority (P2 / Practice 5): sql_wave1_primitive_fact_bundles
    manually re-listed the rows already present in the three fact catalogs,
    creating two parallel authorities. Now derived from the catalogs via
    free_monoid_fold + sql_list_snoc/sql_list_append (mirrors rust.dag's
    catalog → bundle list fold pattern).

(2) Spec honesty (P1 / Practice 8): SqlFloatPrimitiveFacts hard-coded
    Bits32/Bits64 + IEEE 754 without an equivalent scaffold marker to the
    integer-width one (ISO 9075 §6 defines REAL / DOUBLE PRECISION precision
    as implementation-defined, not exact IEEE 754). Added matching
    🟡 needs-more-work marker on sql_facts_real / sql_facts_double_precision
    documenting the wave-1 conventional realization and its dissolve-on
    condition (precision discriminator on SqlFloatPrimitiveFacts).

v2-compiler --source-root src/v4 --target rust → 132 files, 0 diagnostics.

* T-4.6 sql.dag — strip process/rationale receipts from model body (codex F3)

Codex finding 3: header carried process attribution and scope-restating
prose that duplicates the type-level expression of the same fact.
Stripped to a single short header line; mark-set + types remain
authoritative.

Findings 1 (unlanded primitive-bundle authority) and 2 (hand-rolled
List append/snoc) addressed in reply on PR — F1 is false (model_core
landed via #3474 on main, this PR imports it), F2 matches rust.dag's
established wave-1 pattern with no canonical std list ops to consume;
lifting is cross-cutting follow-up, not blocking on this slice.

* T-4.6 sql.dag — fix codex inline F2: order-preserving catalog → bundle projection

free_monoid_fold is a left fold; the prior sql_list_snoc (copied from
rust.dag's same-shape helper) folded cons-prepend over the existing prefix
and reversed it. Trace snoc([a,b,c], z) → [c,b,a,z]. Codex inline finding
was correct — bundle-list order did not match catalog order.

Replaced with the order-preserving idiom for v4 List (no canonical std list_map
/ list_append yet): sql_list_reverse + sql_list_map (= reverse ∘ cons-prepend
fold) + sql_list_append (= cons-prepend fold over reverse(left), init=right).
sql_list_snoc dropped. sql_wave1_primitive_fact_bundles now produces
[smallint, integer, bigint, real, double_precision, boolean, character_large_object,
 date, time, timestamp, timestamp_with_time_zone] — catalog order.

(rust.dag carries the same latent bug in its rust_list_snoc_item; flagging
as a separate cross-cutting follow-up, not blocking on this slice.)

v2-compiler --target rust → 132 emitted, 0 diagnostics.

* T-4.6 sql.dag — strip remaining scope-restating prose block at L180 (Practice 9 / codex inline F3)

Following 3a45626 (process attribution removed) the 3-line scope block
still narrated wave-1 / parametric-arms-outside-catalog in prose. Practice 9
no-prose rule: the type-set + catalog membership communicate scope
structurally. Block removed; jump straight to SqlIntegerWidth.

v2-compiler --target rust → 132 emitted, 0 diagnostics.

* T-4.6 sql.dag — drop spec-unsupported width / IEEE-754 bindings (codex P1/Practice 8)

Codex re-review at 88c50de (REQUEST_CHANGES): a 🟡 scaffold note does
not make it safe to publish exact width / IEEE-754 facts that ISO/IEC
9075 §6 does not guarantee. The right move per fail-honesty (P1 /
Practice 8) is to NOT bind facts the source authority leaves
implementation-defined.

Reshape — bind only what ISO actually grounds:
  - Integers (SMALLINT/INTEGER/BIGINT): surface_spelling + signedness
    (ISO §6: signed exact numeric). Precision is implementation-defined
    and intentionally NOT bound.
  - Floats (REAL/DOUBLE PRECISION): surface_spelling only. Precision and
    encoding are implementation-defined and NOT bound; IEEE-754 binding
    removed.
  - Non-numerics (BOOLEAN/CLOB/DATE/TIME/TIMESTAMP/TIMESTAMP WITH TIME
    ZONE): surface_spelling + encoding (ISO §4 type semantics — these
    representations ARE spec-grounded).

Dropped: SqlIntegerWidth, SqlFloatWidth, width / ieee754_binary fields
on facts records, sql_tag_bits16/32/64, sql_ieee754_binary32/64, both
🟡 scaffold markers (no longer needed), primitive_fact_axis_width
import. Header Owns list updated.

v2-compiler --target rust → 132 emitted, 0 diagnostics.

* T-4.6 sql.dag — P5 tracked-bridge: name dissolve-on for catalog second-enumeration (codex inline F4)

Codex L460 finding: the three hand-enumerated fact catalogs are a partial
second authority for SqlDataType's constant arms (P2 / P5). The 'wave-1'
label did not name a concrete dissolve trigger.

Added 🟡 tracked-bridge marker above sql_integer_facts_catalog with a
concrete dissolve-on condition: substrate gains coproduct-variant
enumeration so the constant-arm subset of SqlDataType derives a
homomorphism into List<PrimitiveFactBundle>, collapsing the three hand
catalogs. Notes the same gap exists on rust.dag's per-category facts
catalogs (cross-cutting, same dissolve trigger).

No structural change — just names the bridge.

v2-compiler --target rust → 132 emitted, 0 diagnostics.
@briansrls
briansrls deleted the session/valiant-bear-582 branch June 1, 2026 18:43
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