Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
1285997
WIP: nimble-pike-489
briansrls Apr 30, 2026
25427ed
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
b442238
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
f14a8f8
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
74fa641
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
4774ae4
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
853d5bc
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
4f7be5e
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
5d48402
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
bfd5f65
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
98ab768
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
e6fac41
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
1ed4d89
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
5250566
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
079ad5a
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
cec7595
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
2ec300c
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
e0cb30c
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
4ab1982
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
6eb6fc0
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
881a602
WIP: nimble-pike-489
briansrls Apr 30, 2026
aa2cc23
chore: apply cargo fmt
briansrls Apr 30, 2026
c6efce2
WIP: nimble-pike-489
briansrls Apr 30, 2026
8209b39
fix(workspace): resolve Cargo.toml merge — keep grounding_cross_targe…
briansrls Apr 30, 2026
da19f80
WIP: nimble-pike-489
briansrls Apr 30, 2026
335bb9d
chore(grounding-tests): drop unused include_str paths after bootstrap…
briansrls Apr 30, 2026
f78ea59
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
d04dd48
docs(grounding-tests): Practice 4 🟡 ledger on GroundingTestsDiagnosti…
briansrls Apr 30, 2026
aeda82a
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
38f6887
refactor(grounding-tests): split row_fingerprint into small field ext…
briansrls Apr 30, 2026
c01517b
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
3d957af
fix(grounding-tests): fail-closed SingleTemplate arity in emit_templa…
briansrls Apr 30, 2026
af11a3b
fix(grounding-tests): fail-closed unknown list in assert_expected_row…
briansrls Apr 30, 2026
9c489fe
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
briansrls Apr 30, 2026
7490ebf
Merge remote-tracking branch 'origin/main' into refactor/grounding-li…
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
8 changes: 8 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ members = [
"src/v3/grounding_coercion_fold",
# T-Ground-CrossTarget-Meta — L6 cross-product walker (TypeConnective × Behavior × Shape A target).
"src/v3/grounding_cross_target_meta",
# T-Ground-Tests — L4 routing-stability Stratum A (name-keyed parity) vs LanguageSpec rows.
"src/v3/grounding_tests",
# Linux ExecuteCommand unshare bootstrap — fd3 sentinel + FD_CLOEXEC before execvp
"src/v3/execute_command_bootstrap",
# v1 compiler — ARCHIVED. No longer in the build or generation path.
Expand Down
14 changes: 14 additions & 0 deletions src/v3/grounding_tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "v3-grounding-tests"
version.workspace = true
edition.workspace = true
license.workspace = true

# T-Ground-Tests — L4 routing-stability Stratum A (name-keyed parity) against
# LanguageSpec Phase 1 `MethodTemplateContract` row authorities. Sibling to
# grounding_pilot / grounding_engine / grounding_lifetime / grounding_coercion_fold;
# does not touch `src/v3/compiler/` SG-0.

[dependencies]
v3-compiler = { path = "../compiler" }
v3-grounding-lifetime = { path = "../grounding_lifetime" }
71 changes: 71 additions & 0 deletions src/v3/grounding_tests/src/diagnostic.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
//! 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.

use std::fmt;

/// Typed failure for Stratum A routing-parity checks (`t-ground-tests.md` §Test plan item 1).
///
/// **Practice 4 (`docs/modeling-discipline.md`): 🟡 YELLOW** — lane-local `Result` carrier until
/// these cases fold into shared `EmissionDiagnostic` (`t-ground-diagnostic.md` / manager #1216).
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum GroundingTestsDiagnostic {
/// `List<MethodTemplateContract>` row count drift vs Director-locked Phase 1 shape.
StratumARowCountMismatch {
list_name: String,
expected: usize,
actual: usize,
},
/// `dag_method: MethodRef` did not resolve to a `MethodDeclaration` name literal.
StratumARegistryResolutionFailed {
list_name: String,
row_index: usize,
detail: String,
},
/// Two structural witnesses disagreed (e.g. digest mismatch across bootstrap constructions).
StratumALockstepMismatch {
list_name: String,
method_name: String,
detail: String,
},
/// Expected Substrate declaration or connective shape was absent or non-conforming.
StratumADagProjectionFailed { step: &'static str, detail: String },
}

impl fmt::Display for GroundingTestsDiagnostic {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
GroundingTestsDiagnostic::StratumARowCountMismatch {
list_name,
expected,
actual,
} => write!(
f,
"Stratum A row-count mismatch for `{list_name}`: expected {expected}, got {actual}"
),
GroundingTestsDiagnostic::StratumARegistryResolutionFailed {
list_name,
row_index,
detail,
} => write!(
f,
"Stratum A registry resolution failed for `{list_name}` row {row_index}: {detail}"
),
GroundingTestsDiagnostic::StratumALockstepMismatch {
list_name,
method_name,
detail,
} => write!(
f,
"Stratum A lockstep mismatch for `{list_name}` method `{method_name}`: {detail}"
),
GroundingTestsDiagnostic::StratumADagProjectionFailed { step, detail } => {
write!(f, "Stratum A Dag projection failed at `{step}`: {detail}")
}
}
}
}

impl std::error::Error for GroundingTestsDiagnostic {}
56 changes: 56 additions & 0 deletions src/v3/grounding_tests/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
//! T-Ground-Tests — L4 routing-correctness verification (Stratum A scaffold).
//!
//! See `docs/briefs/t-ground-tests.md` (lane 10 / `routing_correctness_l4_verified` gate).
//! This crate generalizes the pilot Stratum A pattern (`src/v3/grounding_pilot/src/lib.rs:408-460`)
//! onto Phase 1 `MethodTemplateContract` row authorities (`#1195` / `#1196` / `#1210`).
//!
//! **SG-0:** no `src/v3/compiler/` edits — consumers only.
//!
//! Stratum A routing-parity tests live in the `stratum_a` module’s `stratum_a_tests` section so
//! they exercise the module’s fail-closed API without reaching private helpers from here.

pub mod diagnostic;
mod stratum_a;

pub use diagnostic::GroundingTestsDiagnostic;
pub use stratum_a::{
stratum_a_list_digest, verify_stratum_a_lockstep_all_targets, RowFingerprint,
EXPECTED_STRATUM_A_ROW_COUNTS,
};

#[cfg(test)]
mod tests {
use v3_compiler::dag::Dag;
use v3_grounding_lifetime::{
analyze_lifetime_facts, axes::LanguageSpecAxes, extract_lifetime_program,
};

use super::GroundingTestsDiagnostic;

/// Sibling dep smoke: bootstrap `Dag::new()` stays empty for lifetime extraction.
#[test]
fn grounding_lifetime_sibling_wires_through_bootstrap() {
let dag = Dag::new();
let axes = LanguageSpecAxes::example_rust_string_family();
let report = analyze_lifetime_facts(&dag, &axes).expect("bootstrap ok");
assert!(report.is_empty());
let program = extract_lifetime_program(&dag).expect("extract empty");
assert!(program.bindings.is_empty());
}

#[test]
fn stratum_a_diagnostic_display_is_non_empty() {
let e = GroundingTestsDiagnostic::StratumARowCountMismatch {
list_name: "x".to_string(),
expected: 1,
actual: 2,
};
assert!(!e.to_string().is_empty());

let e2 = GroundingTestsDiagnostic::StratumADagProjectionFailed {
step: "test",
detail: "detail".to_string(),
};
assert!(!e2.to_string().is_empty());
}
}
Loading
Loading