Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
7539c4b
feat(grounding): T-Ground-CrossTarget-Meta L6 cross-product scaffold …
briansrls Apr 30, 2026
21aaad5
chore: apply cargo fmt
briansrls Apr 30, 2026
0eba357
Merge remote-tracking branch 'origin/main' into feat/grounding-cross-…
briansrls Apr 30, 2026
806bce7
Merge remote-tracking branch 'origin/main' into feat/grounding-cross-…
briansrls Apr 30, 2026
b1b4ff3
Merge remote-tracking branch 'origin/main' into feat/grounding-cross-…
briansrls Apr 30, 2026
c0af9d5
Merge remote-tracking branch 'origin/main' into feat/grounding-cross-…
briansrls Apr 30, 2026
b8cce8e
Merge remote-tracking branch 'origin/main' into feat/grounding-cross-…
briansrls Apr 30, 2026
c9e9e2f
Merge remote-tracking branch 'origin/main' into feat/grounding-cross-…
briansrls Apr 30, 2026
949b383
Merge remote-tracking branch 'origin/main' into feat/grounding-cross-…
briansrls Apr 30, 2026
90cc6f8
Merge remote-tracking branch 'origin/main' into feat/grounding-cross-…
briansrls Apr 30, 2026
78f099e
Merge remote-tracking branch 'origin/main' into feat/grounding-cross-…
briansrls Apr 30, 2026
4000fc7
Merge remote-tracking branch 'origin/main' into feat/grounding-cross-…
briansrls Apr 30, 2026
4743bd1
Merge remote-tracking branch 'origin/main' into feat/grounding-cross-…
briansrls Apr 30, 2026
faf0996
Merge remote-tracking branch 'origin/main' into feat/grounding-cross-…
briansrls Apr 30, 2026
c612746
feat(v3-std): T-Ground-Diagnostic EmissionDiagnostic substrate carrier
briansrls Apr 30, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,989 changes: 1,499 additions & 1,490 deletions src/v3/compiler/src/bootstrap_generated.rs

Large diffs are not rendered by default.

2,823 changes: 1,416 additions & 1,407 deletions src/v3/compiler/src/bootstrap_generated_without_parse_surface.rs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ src/v3/std/anthropic_schema.dag 8 20682 cdd44a074743988b
src/v3/std/clean_emission.dag 15 23867 e7bc1e6145f4781e
src/v3/std/computation.dag 18 36754 8023f388c3fb0918
src/v3/std/computation_model.dag 14 22953 20e458fe097d175a
src/v3/std/diagnostics.dag 10 12179 bc414c493551b464
src/v3/std/diagnostics.dag 11 20274 7f9cddd2ff2254d9
src/v3/std/dimensions.dag 21 40239 d595746d2bda22f6
src/v3/std/effects.dag 53 97984 1acdbeaa68acfd2e
src/v3/std/emit_model.dag 36 68760 30bb483bab671fa7
Expand Down
19 changes: 13 additions & 6 deletions src/v3/grounding_coercion_fold/src/diagnostic.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
//! Lane-local fail-closed diagnostic mirror for the coercion fold scaffold.
//! Lane-local Rust mirror of the substrate `EmissionDiagnostic` carrier.
//!
//! **Staging debt (Practice 4):** matches the lane-local `EmissionDiagnostic` pattern
//! in `v3-grounding-lifetime` and the T-Ground-Diagnostic brief — migrates to the
//! substrate `EmissionDiagnostic` carrier when T-Ground-Diagnostic lands; see
//! `docs/briefs/t-ground-diagnostic.md` and #1216 convergence notes.
//! Substrate authority **LANDED** at `src/v3/std/diagnostics.dag` (T-Ground-Diagnostic;
//! #1216 brief + #1133 dispatch 4355793511). The substrate carrier declares
//! `FoldNotImplemented` among its variants. This Rust mirror persists because
//! `v3-grounding-coercion-fold` cannot consume reflected substrate types today
//! (no `.dag` → Rust enum codegen path); when reflection-driven generation
//! lands, the mirror retires.
//!
//! **Lockstep discipline:** any new variant added to substrate
//! `EmissionDiagnostic` MUST land here as a parallel Rust mirror update.

/// **🟡 Lane-local scaffold** — not the final substrate sum.
/// Rust mirror of substrate `EmissionDiagnostic` (subset; this crate
/// only emits `FoldNotImplemented`). Variant-name lockstep enforced
/// socially until reflection codegen retires the mirror.
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum EmissionDiagnostic {
/// Full structural fold is not implemented; returning `Ok` would fabricate
Expand Down
20 changes: 13 additions & 7 deletions src/v3/grounding_cross_target_meta/src/diagnostic.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
//! Lane-local `EmissionDiagnostic` mirror — same convergence pattern as
//! `T-Ground-Coercion-Fold` / `T-Ground-Lifetime-Analyzer` lane-local
//! mirrors. Substrate-side `EmissionDiagnostic` carrier (per
//! `docs/briefs/t-ground-diagnostic.md` / #1216) replaces this enum
//! when it lands; until then this lane carries its own typed channel
//! per the C-8 fail-closed discipline (every detectable problem is a
//! typed diagnostic).
//! Lane-local Rust mirror of the substrate `EmissionDiagnostic` carrier.
//!
//! Substrate authority **LANDED** at `src/v3/std/diagnostics.dag`
//! (T-Ground-Diagnostic; #1216 brief + #1133 dispatch 4355793511). The
//! substrate carrier declares `MissingEmissionPath { connective, behavior, target }`
//! among its variants. This Rust mirror persists because
//! `v3-grounding-cross-target-meta` cannot consume reflected substrate
//! types today (no `.dag` → Rust enum codegen path); when reflection-
//! driven generation lands, the mirror retires.
//!
//! **Lockstep discipline:** any new variant added to substrate
//! `EmissionDiagnostic` MUST land here (or in the analogous mirror in
//! the consuming crate) as a parallel Rust mirror update.

use crate::cells::{BehaviorAxis, Cell, FormAxis, ShapeATarget};

Expand Down
25 changes: 17 additions & 8 deletions src/v3/grounding_lifetime/src/diagnostic.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
//! Fail-closed diagnostic surface for the lifetime fold.
//!
//! ## Practice 4 (`docs/modeling-discipline.md` §4)
//! ## Practice 4 — substrate authority LANDED (per #1133 dispatch 4355793511)
//!
//! The multi-variant diagnostic sum below is **lane-local** until substrate
//! authoring lands; see enum doc for 🟡 trigger.
//! The substrate `EmissionDiagnostic` carrier is now declared at
//! `src/v3/std/diagnostics.dag` (T-Ground-Diagnostic; #1216 brief). This
//! crate's Rust mirror below carries the same variant set; the lane-local
//! mirror persists because `v3-grounding-lifetime` cannot consume
//! reflected substrate types today (no `.dag` → Rust enum codegen path).
//!
//! **T-Ground-Diagnostic** owns extending `CompilerDiagnosticKind` in `dsl/`.
//! This crate does **not** add Layer-1 variants; it carries a **lane-local**
//! mirror shape so callers and tests lock the emission payload before the
//! substrate `EmissionDiagnostic` carrier lands. Mapping to
//! `Diagnostic` / `CompilerDiagnosticKind` stays Coercion-Fold / Diagnostic-lane work.
//! **Lockstep discipline:** any new variant added to substrate
//! `EmissionDiagnostic` MUST land here as a parallel Rust mirror update.
//! Variant-name parity is enforced socially until reflection-driven
//! Rust generation lands. The `axis: String` field below corresponds to
//! the substrate carrier's `unspecified_axis: String` — naming will
//! reconcile when the reflection codegen retires this mirror.
//!
//! **Q6.5 anti-bridge preserved:** `EmissionDiagnostic` is a SEPARATE
//! substrate carrier from `CompilerDiagnosticKind`. Mapping to
//! `Diagnostic` / `AnyDiagnosticKind` is Coercion-Fold / emit-pipeline
//! consumer work, not authored here.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct SiteRef {
Expand Down
15 changes: 12 additions & 3 deletions src/v3/grounding_tests/src/diagnostic.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
//! Lane-local fail-closed outcomes for T-Ground-Tests (Stratum A scaffold).
//!
//! Converges toward the shared `EmissionDiagnostic` substrate carrier per
//! `docs/briefs/t-ground-diagnostic.md` / manager #1216 — this crate keeps a
//! small structural sum until that hand-off lands.
//! The shared `EmissionDiagnostic` substrate carrier **LANDED** at
//! `src/v3/std/diagnostics.dag` per #1216 brief + #1133 dispatch 4355793511.
//! However, this crate's variants (`StratumARowCountMismatch` with usize
//! fields, `StratumARegistryResolutionFailed { row_index, ... }`, etc.)
//! are **test-outcome-specific** — they carry test-side measurement
//! coordinates that don't naturally fit the fold/emission failure pattern
//! the substrate carrier authors. These stay lane-local pending a
//! follow-up dispatch deciding whether to (a) extend the substrate
//! carrier with test-side variants, (b) author a sibling
//! `GroundingTestsDiagnostic` substrate carrier, or (c) keep the
//! lane-local Rust mirror permanently as test-outcome scaffolding.
//! Manager-acknowledged in dispatch 4355793511.

use std::fmt;

Expand Down
89 changes: 89 additions & 0 deletions src/v3/std/diagnostics.dag
Original file line number Diff line number Diff line change
Expand Up @@ -124,3 +124,92 @@ type Diagnostic {
message: String
fixes: List<Correction>
}

// T-Ground-Diagnostic — substrate `EmissionDiagnostic` carrier
// (per `docs/briefs/t-ground-diagnostic.md` + #1216 + #1133 dispatch
// 4355793511). Closed sum of fold/emission failures the structural
// emission lane (Coercion-Fold + Lifetime-Analyzer + Cross-Target-Meta
// + downstream test crates) returns when emission cannot proceed.
//
// **Anti-bridge (Q6.5):** this is a SEPARATE carrier from
// `CompilerDiagnosticKind` and `AnyDiagnosticKind`. Fold failures do
// NOT extend `CompilerDiagnosticKind` (would violate Q6.5 + P2 single
// authority). Mapping `EmissionDiagnostic` → runtime
// `Diagnostic { kind: AnyDiagnosticKind, ... }` is a downstream
// consumer concern (Coercion-Fold + emit pipeline), not authored here.
//
// **P1 receipts** (per `INVARIANTS.md:94-129`):
// - Step 1 (DAG-ancestor): home is `src/v3/std/diagnostics.dag` —
// existing diagnostic-types module hosts the sibling Layer-1
// `CompilerDiagnosticKind`, Layer-2 `LensInstanceKindWitness`, and
// two-layer `AnyDiagnosticKind` parent. `EmissionDiagnostic` is a
// fourth sibling sum: closed substrate-primitive carrier for
// emission-pipeline failures, parallel to but disjoint from the
// two-layer kind authority.
// - Step 2 (coproduct-vs-coordinate): variants are alternatives —
// one failure mode per fold-call. Resolution-hint payloads
// (e.g. `unspecified_axis: String`) are coordinates of the
// individual variant's record, not new arms.
// - Step 3 (primitive-vs-lens-extensible): substrate-primitive
// closed sum (compiler-internal fold/emission failures). NOT
// lens-extensible — extending requires substrate-amendment
// dispatch, parallel to `CompilerDiagnosticKind`.
//
// **Lane-local mirror migration receipts** (in flight per dispatch
// 4355793511; substrate-side carrier lands here, downstream PRs
// migrate the Rust mirrors):
// - `v3-grounding-lifetime` lane-local `EmissionDiagnostic` (#1206)
// — variants: `ContradictoryUse`, `UnderRefined`, `OutOfR2Scope`,
// `LifetimeProgramExtractionPending`. Migrates here.
// - `v3-grounding-coercion-fold` lane-local `EmissionDiagnostic`
// (#1241) — variant: `FoldNotImplemented`. Migrates here.
// - `v3-grounding-cross-target-meta` lane-local `EmissionDiagnostic`
// (#1271) — variant: `MissingEmissionPath`. Migrates here.
// - `v3-grounding-tests` lane-local `GroundingTestsDiagnostic`
// (#1274/#1289) — Stratum-A test-side variants kept lane-local
// for now (test-side outcomes carry test-specific shape; review
// for migration in a follow-up dispatch).
type EmissionDiagnostic
// Program intent or structural axis under-specified; consumer
// authors a resolution hint via `unspecified_axis`. Covers
// worked Examples 1 (`unspecified_axis: "bound"` for unrefined
// `Int`) and 5 (`unspecified_axis: "algebra"` for algebra
// ambiguity) per `design-emission-model.md` ~417-464 / ~639-680.
// Lifetime-Analyzer also uses this for its axis-level
// under-determination (`growability` / `ownership` / `encoding`).
= UnderRefined { unspecified_axis: String }
// Substrate declares no candidate covering the program's stated
// refinement (Example 6 pattern; `design-emission-model.md`
// ~684-731). Distinct from `UnderRefined` which is "program is
// under-specified"; this is "substrate has no inhabitant for the
// specified refinement."
| NoInhabitant
// Lifetime-Analyzer: a binding's use sites contradict each other
// structurally (some require Owned, some require Borrowed, etc.).
// Names the binding + the conflicting sites for the resolution
// hint surface.
| ContradictoryUse { binding: String, sites: List<String> }
// Lifetime-Analyzer: program contains a construct outside R2
// structural-ownership scope (closures / async / Pin / etc.).
// Locked at `design-emission-model.md:635` to T-LensProducer-Retirement
// (R3 fold-in). The construct name surfaces so the user/test sees
// why the analyzer declined.
| OutOfR2Scope { construct: String }
// Lifetime-Analyzer: `Dag` → `LifetimeProgram` extraction wiring
// gap. Returning `Ok(empty)` would silently drop load-bearing
// program shape (C-8). Detail string captures the wiring stage.
| LifetimeProgramExtractionPending { detail: String }
// Coercion-Fold: full structural fold not yet implemented;
// returning `Ok` would fabricate target choices (C-8 /
// engine-retraction discipline). Replaced when the fold body lands.
| FoldNotImplemented
// CrossTarget-Meta L6: `(connective × behavior × target)` cell has
// no LanguageSpec emission-path declaration. Each axis carries a
// string label (substrate-anchored discriminant; resolved against
// `TypeConnective` per #1229 anchor + `Behavior` per L1 model +
// Shape A targets per `r2-grounding-manager.md` portability set).
| MissingEmissionPath {
connective: String,
behavior: String,
target: String
}
Loading