Skip to content

T-4: canonical-B per-primitive grounding exemplar (unblocks Phase-3 ts/py) - #3421

Closed
briansrls wants to merge 1 commit into
mainfrom
session/witty-crane-295
Closed

briansrls wants to merge 1 commit into
mainfrom
session/witty-crane-295

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Summary

  • Add rust_primitive_grounding_anchor.dag as the operator-ratified canonical-B compile exemplar for per-primitive grounding/coincidence: bool decl-ref → bool_boolean_algebra, RustNever primitive coincidence, and the RustScalar.IntScalar fact-bundle vs std/integer.Int64 coincidence target (fold-discharge, not alias).
  • Align typescript.dag ts_bool_grounding with the same E-6(b) scaffold marker used across other language slices.
  • Restore rust.dag bool anchor URL; fix accidental merge-conflict markers in cpp.dag / cpp_abi.dag that were breaking v2-compiler compile --source-root src/v4.

Why

Operator ratified A-vs-B = B (decl-ref grounding, not GroundingMap spelling twins). rust.dag on main is the verified shape; this PR materializes the depth bar as a compile anchor so held T-4 Phase-3 work (#3308 typescript, #3309 python) can follow the same pattern.

Test plan

  • v2-compiler compile --source-root src/v4 --output-dir /tmp/v4-out — 80 modules, 0 diagnostics

Made with Cursor

Add compile anchor for bool decl-ref, never coincidence, and i64
fact-bundle vs std Int64 coincidence target; align typescript E-6
markers with rust; strip accidental merge-conflict markers from cpp
slices so v2 bootstrap parse is clean again.

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: f63b3b69 · Trigger: schedule
  • Thinking: 191s wall

BLOCKING (1)

Root Cause

  • src/v4/extdeps/languages/rust.dag Rust exposes only the generic IntScalar kind×width axes, so the test can compile without constructing the Signed+Bits64 primitive point → add a concrete Rust i64 fact-bundle/coincidence carrier or an explicit gated receipt, then have the anchor consume that exact carrier.

⚠️ The bool canonical-B staging looks properly bounded, but the new per-primitive exemplar is too weak to serve as the Phase-3 pattern.

type rust_anchor_never_scalar_classifier = RustScalar

// §B refinement case — `RustScalar.IntScalar` fact-bundle (kind×width) vs std `Int64` coincidence target (fold-discharge, not alias).
type rust_anchor_i64_scalar_classifier = RustScalar

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: The i64 exemplar names the whole RustScalar classifier instead of a concrete Rust i64 fact bundle, so it does not anchor the Rust Reference facts or the Int64 coincidence required by INVARIANTS P1 / modeling-discipline Practice 8.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: f63b3b69 · Trigger: manual
  • Comparison: main @ 9d8ba8df ... session/witty-crane-295 @ f63b3b69
  • Conversation: View conversation

1. Story of the diff

This PR is a small v4 grounding-slice cleanup and exemplar. It resolves conflict-marker residue in the C++ ABI / C++ language-model files, preserving the richer C++ scalar/ABI fact-bundle side rather than the shorter resolver-only side. It also keeps the canonical-B bool grounding shape for Rust and TypeScript: language-specific bool grounding points at the shared BooleanAlgebra<Bool> authority instead of reintroducing a per-language spelling map (src/v4/extdeps/languages/rust.dag:83-85, src/v4/extdeps/languages/typescript.dag:26-27). Finally, it adds src/v4/test/claim/manual/rust_primitive_grounding_anchor.dag as a compile-only manual exemplar meant to demonstrate the Rust bool / never / i64 grounding patterns future TypeScript/Python slices should copy.

2. Invariant categories

1. LAYER MODEL

Compliant — the PR touches v4 .dag target-model/test surfaces, not Rust implementation or new Dag substrate variants. The canonical-B bool rows continue to read the existing shared authority (rust_bool_grounding / ts_bool_grounding to bool_boolean_algebra) rather than adding a parallel resolver table; correct.

2. INVARIANTS.md + modeling-discipline.md

Finding — Practice 9 / no comment-duplicating ledgers: src/v4/extdeps/cpp_abi.dag:18 preserves // 🟢 coproduct dissolution — DECISIONS.md T29-ABI. in a conflict-resolution hunk, and src/v4/extdeps/languages/cpp.dag:24 preserves // 🟢 coproduct dissolution — DECISIONS.md T29-CPP-SCALAR-FORWARD. The PR relevance is direct: the diff removes the origin/main alternatives and conflict markers while keeping the stale DECISIONS.md form. The modeling rules retired src/v4/DECISIONS.md as a comment-ledger authority; the inline mark/gate is the authority, with verbose reasoning in PR review, not a deleted ledger doc. Keep the inline T29 slug/gate, but drop the DECISIONS.md reference before landing.

3. CODING.md

Finding — comment discipline: src/v4/test/claim/manual/rust_primitive_grounding_anchor.dag:22 adds explanatory prose for the following declarations, and the same pattern repeats at lines 26, 30, and 33. The new file is 37 lines with 10 comment lines, and these section comments are not the allowed .dag header / anchor / one-line carrier tag shape; they narrate what the declarations mean. The declaration names already carry most of the intent, and any remaining rationale belongs in PR review or a real TestClaim name, not in-file prose.

4. TESTING.md

Finding — behavior-driven test discipline / grounding regression coverage: src/v4/test/claim/manual/rust_primitive_grounding_anchor.dag:33-37 claims the i64 refinement case but only aliases the classifier and axis types (RustScalar, RustIntKind, RustIntWidth) plus the std target (Int64). That compile-only shape catches missing imports, but it would still pass if the actual RustScalar.IntScalar fact-bundle wiring, width/kind pairing, or i64-to-Int64 coincidence path regressed. Since this file is advertised as the Phase-3 depth bar, it needs to pin the actual i64 witness/fact-bundle/coincidence shape with a data row or .dag TestClaim, or the stated scope should be narrowed to “import smoke” so future workers do not copy a shallow exemplar.

5. LOCKED DESIGN DECISIONS

N/A — no locked design doc is changed. The stale DECISIONS.md comment references are handled above as Practice 9 / retired-ledger violations, not as a locked-design divergence.

6. TRACKED vs UNTRACKED DEBT

Compliant — the newly added TypeScript canonical-B staging comment is bounded: src/v4/extdeps/languages/typescript.dag:26 names the E-6(b) exception, the feature:canonical-b-grounding-consumer scaffold, and the dissolve-on trigger B1-CANON+zip-fold consume. That is a tracked bridge rather than silent debt.

2.5. Top-down PM intent review

Finding — semantic dilution of the grounding exemplar: the thesis-level target is that primitive grounding is structural: target-side primitive types are modeled from the target reference, algebra inhabitance is declared structurally, and mapping is a structural algebra-homomorphism search, not a name/table shortcut (THESIS.md:181). The PR’s own new exemplar says it is the Rust primitive grounding “depth bar” for T-4 Phase-3 (src/v4/test/claim/manual/rust_primitive_grounding_anchor.dag:5), but the i64 section at src/v4/test/claim/manual/rust_primitive_grounding_anchor.dag:33-37 only names the participating types; it does not construct or assert the grounding relation. A worker following this exemplar faithfully could ship TypeScript/Python slices that compile as import/type-name smokes without proving the canonical-B per-primitive relation the PM intent requires.

3. Verdict

REQUEST_CHANGES

The canonical-B direction is right, and the bool rows keep single authority. I would not land this as-is because the PR preserves retired DECISIONS.md ledger references and, more importantly, the new Rust primitive exemplar does not actually pin the i64 grounding relationship it is meant to teach downstream slices.

@briansrls briansrls closed this May 20, 2026
@briansrls
briansrls deleted the session/witty-crane-295 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