From 7cbdfdfb1b330bc8ad3ab5f37a029c08a39d7e94 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 04:29:27 +0000 Subject: [PATCH 01/26] =?UTF-8?q?WIP:=20Phase=201=20dispatch=20(PR=20#3959?= =?UTF-8?q?=20=C2=A711.4=20step=204):=20R1=20fixture=20generator=20+=20run?= =?UTF-8?q?ner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/v4/lens/leaf_model_verification.dag | 71 +++++++++++++++++++ src/v4/std/leaf_model_verification.dag | 94 +++++++++++++++++++++++++ 2 files changed, 165 insertions(+) create mode 100644 src/v4/lens/leaf_model_verification.dag create mode 100644 src/v4/std/leaf_model_verification.dag diff --git a/src/v4/lens/leaf_model_verification.dag b/src/v4/lens/leaf_model_verification.dag new file mode 100644 index 00000000000..d8777ae1cce --- /dev/null +++ b/src/v4/lens/leaf_model_verification.dag @@ -0,0 +1,71 @@ +// src/v4/lens/leaf_model_verification.dag +// Scope: Layer B fixture generators for leaf-model verification (T-19 testgen extension, Phase 1 R1). +// Status: R1 happy + falsification rustc source fixtures for rust.dag i32 surface spelling. + +module v4.lens.leaf_model_verification + + +import v4.extdeps.languages.rust { + rust_coercion_field_i32_spelling, + rust_surface_spelling_i32 +} +import v4.std.leaf_model_verification { + LeafModelFixturePair, + LeafModelFalsificationCase, + LeafModelRustFixture, + RustCrateTypeLib, + RustR1I32SurfaceSpelling, + TargetCompileAccepted, + TargetCompileRejected, + target_diagnostic_e0308_type_mismatch +} +import v4.std.text { String } + + +// Fact anchor: rust.dag declares `rust_surface_spelling_i32` / coercion edge +// `rust_coercion_field_i32_spelling` (primitive_fact_axis_surface_spelling). +// Fixture embeds the spelled type + literal suffix so rustc is the external authority. + +data rust_r1_happy_fixture_source: String = "pub fn r1_test() -> i32 { 0i32 }\n" + +data rust_r1_falsification_fixture_source: String = "pub fn r1_test() -> i32 { \"string\" }\n" + + +fn rust_r1_happy_fixture() -> LeafModelRustFixture { + LeafModelRustFixture { + claim_id: RustR1I32SurfaceSpelling, + source: rust_r1_happy_fixture_source, + crate_type: RustCrateTypeLib + } +} + + +fn rust_r1_falsification_fixture() -> LeafModelRustFixture { + LeafModelRustFixture { + claim_id: RustR1I32SurfaceSpelling, + source: rust_r1_falsification_fixture_source, + crate_type: RustCrateTypeLib + } +} + + +fn rust_r1_fixture_pair() -> LeafModelFixturePair { + LeafModelFixturePair { + claim_id: RustR1I32SurfaceSpelling, + happy: rust_r1_happy_fixture(), + expected_happy_verdict: TargetCompileAccepted, + falsification: LeafModelFalsificationCase { + claim_id: RustR1I32SurfaceSpelling, + fixture: rust_r1_falsification_fixture(), + expected_verdict: TargetCompileRejected { + diagnostic_code: target_diagnostic_e0308_type_mismatch + } + } + } +} + + +// Testgen port: `rust_r1_fixture` (docs/planning/v4-leaf-model-verification-2026-05-30.md §8). +fn rust_r1_fixture() -> LeafModelFixturePair { + rust_r1_fixture_pair() +} diff --git a/src/v4/std/leaf_model_verification.dag b/src/v4/std/leaf_model_verification.dag new file mode 100644 index 00000000000..58a00031500 --- /dev/null +++ b/src/v4/std/leaf_model_verification.dag @@ -0,0 +1,94 @@ +// src/v4/std/leaf_model_verification.dag +// Scope: Per-leaf-model verification carriers (docs/planning/v4-leaf-model-verification-2026-05-30.md §5). +// Status: Phase 1 — R1 rustc compile verdict surface only; widen with TargetInvocation rows per language. + +module v4.std.leaf_model_verification + + +import v4.std.collection { List } +import v4.std.node { Symbol } +import v4.std.text { String } +import v4.std.diagnostic { Accepted } +import v4.std.verdict { Verdict, verdict_combine } + + +// Target exercise outcome for compile-only Phase 1 fixtures (rustc / pyright / … widen later). +type TargetCompileVerdict + = TargetCompileAccepted + | TargetCompileRejected { diagnostic_code: Symbol } + + +data target_diagnostic_e0308_type_mismatch: Symbol = target_diagnostic_e0308_type_mismatch + + +// Stable claim identity — references fact IDs declared in leaf models (not runner concerns). +type LeafModelClaimId + = RustR1I32SurfaceSpelling + + +type LeafModelRustCrateType + = RustCrateTypeLib + + +type LeafModelRustFixture { + claim_id: LeafModelClaimId + source: String + crate_type: LeafModelRustCrateType +} + + +type LeafModelFalsificationCase { + claim_id: LeafModelClaimId + fixture: LeafModelRustFixture + expected_verdict: TargetCompileVerdict +} + + +type LeafModelFixturePair { + claim_id: LeafModelClaimId + happy: LeafModelRustFixture + expected_happy_verdict: TargetCompileVerdict + falsification: LeafModelFalsificationCase +} + + +type LeafModelVerificationRunReceipt { + claim_id: LeafModelClaimId + happy_verdict: Verdict + falsification_verdict: Verdict +} + + +fn leaf_model_verification_run_proven(receipt: LeafModelVerificationRunReceipt) -> Bool { + match receipt.happy_verdict { + Pass => match receipt.falsification_verdict { + Pass => true + Fail { actual: _ } => false + Deferred { actual: _, diagnostic: _ } => false + } + Fail { actual: _ } => false + Deferred { actual: _, diagnostic: _ } => false + } +} + + +fn leaf_model_verification_claim_passes(receipt: LeafModelVerificationRunReceipt) -> Verdict { + if leaf_model_verification_run_proven(receipt: receipt) { + Pass + } else { + Fail { actual: Accepted { value: receipt.claim_id, diagnostics: None } } + } +} + + +fn leaf_model_verification_combine_runs( + runs: List +) -> Verdict { + fold( + runs, + init: Pass, + f: fn(acc, r) { + verdict_combine(a: acc, b: leaf_model_verification_claim_passes(receipt: r)) + } + ) +} From 16ecaf8f62d4c9a511f5a10c6a17277b4f6133c3 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 04:30:50 +0000 Subject: [PATCH 02/26] =?UTF-8?q?WIP:=20Phase=201=20dispatch=20(PR=20#3959?= =?UTF-8?q?=20=C2=A711.4=20step=204):=20R1=20fixture=20generator=20+=20run?= =?UTF-8?q?ner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/v4-leaf-model-rust-r1-verify.sh | 169 ++++++++++++++++++ .../v4_leaf_model_rust_r1_rustc_test.rs | 109 +++++++++++ src/v3/compiler/tests/integration.rs | 2 + src/v4/lens/leaf_model_verification.dag | 7 +- src/v4/test/claim/language_model/rust_r1.dag | 100 +++++++++++ 5 files changed, 384 insertions(+), 3 deletions(-) create mode 100755 scripts/v4-leaf-model-rust-r1-verify.sh create mode 100644 src/v3/compiler/tests/boundary/v4_leaf_model_rust_r1_rustc_test.rs create mode 100644 src/v4/test/claim/language_model/rust_r1.dag diff --git a/scripts/v4-leaf-model-rust-r1-verify.sh b/scripts/v4-leaf-model-rust-r1-verify.sh new file mode 100755 index 00000000000..be04ae69e13 --- /dev/null +++ b/scripts/v4-leaf-model-rust-r1-verify.sh @@ -0,0 +1,169 @@ +#!/usr/bin/env bash +# scripts/v4-leaf-model-rust-r1-verify.sh +# +# Phase 1 leaf-model verification host runner — rust.dag R1 (i32 surface spelling). +# Authority: src/v4/lens/leaf_model_verification.dag (fixture sources) + +# src/v4/test/claim/language_model/rust_r1.dag (claim + receipt shape). +# +# Exercises rustc on happy + falsification fixtures; emits JSON receipt. +# Falsification probe expects E0308 (type mismatch) per +# docs/planning/v4-leaf-model-verification-2026-05-30.md §7. + +set -euo pipefail + +root="$(git rev-parse --show-toplevel 2>/dev/null || pwd)" +cd "$root" + +fixture_dag="src/v4/lens/leaf_model_verification.dag" +if [[ ! -f "$fixture_dag" ]]; then + echo "error: missing fixture authority at $fixture_dag" >&2 + exit 1 +fi + +if ! command -v rustc >/dev/null 2>&1; then + echo "error: rustc not on PATH — install a Rust toolchain to run leaf-model R1 verification" >&2 + exit 1 +fi + +readarray -t extracted < <(python3 - "$fixture_dag" <<'PY' +from __future__ import annotations + +import re +import sys +from pathlib import Path + +path = Path(sys.argv[1]) +text = path.read_text() + +def extract(name: str) -> str: + pattern = rf'^data {name}: String = "(.*)"\s*$' + for line in text.splitlines(): + m = re.match(pattern, line) + if m: + return bytes(m.group(1), "utf-8").decode("unicode_escape") + raise SystemExit(f"error: {path}: missing data {name}: String = ...") + +happy = extract("rust_r1_happy_fixture_source") +falsification = extract("rust_r1_falsification_fixture_source") +print(happy, end="") +print("\0", end="") +print(falsification, end="") +PY +) + +happy_source="${extracted[0]}" +falsification_source="${extracted[1]}" + +run_suffix="${GITHUB_RUN_ID:-local}-${GITHUB_RUN_ATTEMPT:-$$}" +tmp_root="${RUNNER_TEMP:-/tmp}" +scratch="${tmp_root}/v4-leaf-model-rust-r1-${run_suffix}" +rm -rf "$scratch" +mkdir -p "$scratch" + +compile_rust_lib() { + local label="$1" + local source="$2" + local src_path="${scratch}/${label}.rs" + printf '%s' "$source" >"$src_path" + local stderr_path="${scratch}/${label}.stderr" + set +e + RUSTC_BOOTSTRAP= env -u RUSTC_BOOTSTRAP rustc \ + --edition=2021 \ + --crate-type lib \ + "$src_path" \ + -o "${scratch}/${label}.rlib" \ + 2>"$stderr_path" + local status=$? + set -e + echo "$status" >"${scratch}/${label}.exit" + cat "$stderr_path" +} + +echo "=== leaf-model R1: rustc happy fixture (rust.dag i32 surface spelling) ===" +happy_stderr="$(compile_rust_lib happy "$happy_source")" +happy_status="$(cat "${scratch}/happy.exit")" + +echo "=== leaf-model R1: rustc falsification fixture (E0308 probe) ===" +falsification_stderr="$(compile_rust_lib falsification "$falsification_source")" +falsification_status="$(cat "${scratch}/falsification.exit")" + +happy_pass=false +falsification_pass=false +if [[ "$happy_status" -eq 0 ]]; then + happy_pass=true +fi +if [[ "$falsification_status" -ne 0 ]] && grep -qE 'E0308' <<<"$falsification_stderr"; then + falsification_pass=true +fi + +proven=false +if [[ "$happy_pass" == true && "$falsification_pass" == true ]]; then + proven=true +fi + +export V4_R1_HAPPY_STATUS="$happy_status" +export V4_R1_FALSIFICATION_STATUS="$falsification_status" +export V4_R1_HAPPY_PASS="$happy_pass" +export V4_R1_FALSIFICATION_PASS="$falsification_pass" +export V4_R1_PROVEN="$proven" +export V4_R1_FALSIFICATION_STDERR="$falsification_stderr" + +python3 - <<'PY' +import json +import os +import re + +stderr = os.environ.get("V4_R1_FALSIFICATION_STDERR", "") +print( + json.dumps( + { + "schema": "scripts/v4-leaf-model-rust-r1-verify.sh::host_receipt_v1", + "claim_id": "RustR1I32SurfaceSpelling", + "happy": { + "rustc_exit": int(os.environ["V4_R1_HAPPY_STATUS"]), + "verdict": "Pass" + if os.environ["V4_R1_HAPPY_PASS"] == "true" + else "Fail", + }, + "falsification": { + "rustc_exit": int(os.environ["V4_R1_FALSIFICATION_STATUS"]), + "expected_diagnostic": "E0308", + "e0308_observed": bool(re.search(r"E0308", stderr)), + "verdict": "Pass" + if os.environ["V4_R1_FALSIFICATION_PASS"] == "true" + else "Fail", + }, + "proven": os.environ["V4_R1_PROVEN"] == "true", + }, + indent=2, + ) +) +PY + +if [[ "$proven" != true ]]; then + echo "error: leaf-model R1 verification failed (happy_pass=${happy_pass} falsification_pass=${falsification_pass})" >&2 + if [[ "$happy_pass" != true ]]; then + echo "--- happy rustc stderr ---" >&2 + printf '%s\n' "$happy_stderr" >&2 + fi + if [[ "$falsification_pass" != true ]]; then + echo "--- falsification rustc stderr ---" >&2 + printf '%s\n' "$falsification_stderr" >&2 + fi + exit 1 +fi + +if [[ -n "${GITHUB_STEP_SUMMARY:-}" ]]; then + { + echo "### Leaf-model verification — rust.dag R1 (i32 surface spelling)" + echo "" + echo "| path | verdict |" + echo "| --- | --- |" + echo "| happy \`pub fn r1_test() -> i32 { 0i32 }\` | Pass (rustc clean) |" + echo "| falsification \`... { \"string\" }\` | Pass (rustc E0308) |" + echo "" + echo "_Authority: \`${fixture_dag}\` + \`src/v4/test/claim/language_model/rust_r1.dag\`_" + } >> "$GITHUB_STEP_SUMMARY" +fi + +echo "leaf-model R1 verification PROVEN: happy compiles; falsification rejected with E0308" diff --git a/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r1_rustc_test.rs b/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r1_rustc_test.rs new file mode 100644 index 00000000000..a3bc0c63933 --- /dev/null +++ b/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r1_rustc_test.rs @@ -0,0 +1,109 @@ +//! **Layer:** boundary (TESTING.md § test layers — rustc target exercise for v4 leaf-model R1). +//! +//! Phase 1: rust.dag claim R1 (i32 surface spelling) — fixture authority in +//! `src/v4/lens/leaf_model_verification.dag`; host runner +//! `scripts/v4-leaf-model-rust-r1-verify.sh`. +//! +//! **Dissolution:** retire when T-22 eval + modeled `run_target_verification` owns +//! rustc invocation without this hand-Rust bridge. + +use std::io::Write; +use std::process::Command; + +use crate::common::RustcHarness; + +const FIXTURE_DAG: &str = include_str!("../../../../v4/lens/leaf_model_verification.dag"); +const CLAIM_DAG: &str = include_str!("../../../../v4/test/claim/language_model/rust_r1.dag"); + +const HAPPY_FIXTURE: &str = "pub fn r1_test() -> i32 { 0i32 }\n"; +const FALSIFICATION_FIXTURE: &str = "pub fn r1_test() -> i32 { \"string\" }\n"; + +fn unescape_dag_string_literal(body: &str) -> String { + let mut out = String::new(); + let mut chars = body.chars(); + while let Some(c) = chars.next() { + if c == '\\' { + match chars.next() { + Some('n') => out.push('\n'), + Some('"') => out.push('"'), + Some('\\') => out.push('\\'), + Some(other) => { + out.push('\\'); + out.push(other); + } + None => out.push('\\'), + } + } else { + out.push(c); + } + } + out +} + +fn extract_fixture_source(dag_text: &str, data_name: &str) -> Option { + let needle = format!("data {data_name}: String = \""); + let line = dag_text.lines().find(|l| l.starts_with(&needle))?; + let rest = line.strip_prefix(&needle)?.strip_suffix('"')?; + Some(unescape_dag_string_literal(rest)) +} + +fn compile_lib(harness: &RustcHarness, label: &str, source: &str) -> (bool, String) { + let tmp_dir = harness.next_child_dir(); + let src_path = tmp_dir.join(format!("{label}.rs")); + let out_path = tmp_dir.join(format!("{label}.rlib")); + std::fs::File::create(&src_path) + .and_then(|mut f| f.write_all(source.as_bytes())) + .expect("write fixture source"); + + let output = Command::new("rustc") + .env_remove("RUSTC_BOOTSTRAP") + .arg("--edition=2021") + .arg("--crate-type") + .arg("lib") + .arg(&src_path) + .arg("-o") + .arg(&out_path) + .output() + .expect("invoke rustc — install a rust toolchain to run this test"); + + let stderr = String::from_utf8_lossy(&output.stderr).into_owned(); + (output.status.success(), stderr) +} + +#[test] +fn v4_leaf_model_rust_r1_fixture_strings_match_dag_authority() { + let happy = extract_fixture_source(FIXTURE_DAG, "rust_r1_happy_fixture_source") + .expect("rust_r1_happy_fixture_source in lens/leaf_model_verification.dag"); + let falsification = + extract_fixture_source(FIXTURE_DAG, "rust_r1_falsification_fixture_source").expect( + "rust_r1_falsification_fixture_source in lens/leaf_model_verification.dag", + ); + assert_eq!(happy, HAPPY_FIXTURE); + assert_eq!(falsification, FALSIFICATION_FIXTURE); + assert!( + CLAIM_DAG.contains("rust_r1_happy_fixture_source") + && CLAIM_DAG.contains("rust_surface_spelling_i32"), + "claim module must reference fixture + fact anchors" + ); +} + +#[test] +fn v4_leaf_model_rust_r1_happy_fixture_rustc_accepts() { + let harness = RustcHarness::new("v4_leaf_model_rust_r1"); + let (ok, stderr) = compile_lib(&harness, "happy", HAPPY_FIXTURE); + assert!(ok, "rustc should accept R1 happy fixture; stderr:\n{stderr}"); +} + +#[test] +fn v4_leaf_model_rust_r1_falsification_fixture_rustc_e0308() { + let harness = RustcHarness::new("v4_leaf_model_rust_r1"); + let (ok, stderr) = compile_lib(&harness, "falsification", FALSIFICATION_FIXTURE); + assert!( + !ok, + "falsification fixture must not compile (type mismatch probe)" + ); + assert!( + stderr.contains("E0308"), + "expected rustc E0308 type mismatch; stderr:\n{stderr}" + ); +} diff --git a/src/v3/compiler/tests/integration.rs b/src/v3/compiler/tests/integration.rs index 2062deaedf1..707e7f8e057 100644 --- a/src/v3/compiler/tests/integration.rs +++ b/src/v3/compiler/tests/integration.rs @@ -145,6 +145,8 @@ mod m1_lens_structural_resolution_test; mod m1_substrate_test; #[path = "boundary/m2_emit_multi_field_struct_variant_test.rs"] mod m2_emit_multi_field_struct_variant_test; +#[path = "boundary/v4_leaf_model_rust_r1_rustc_test.rs"] +mod v4_leaf_model_rust_r1_rustc_test; #[path = "integration/m2_feature_parity_test.rs"] mod m2_feature_parity_test; #[path = "integration/m2_field_access_binding_test.rs"] diff --git a/src/v4/lens/leaf_model_verification.dag b/src/v4/lens/leaf_model_verification.dag index d8777ae1cce..03104fcc726 100644 --- a/src/v4/lens/leaf_model_verification.dag +++ b/src/v4/lens/leaf_model_verification.dag @@ -22,10 +22,11 @@ import v4.std.leaf_model_verification { import v4.std.text { String } -// Fact anchor: rust.dag declares `rust_surface_spelling_i32` / coercion edge -// `rust_coercion_field_i32_spelling` (primitive_fact_axis_surface_spelling). -// Fixture embeds the spelled type + literal suffix so rustc is the external authority. +// Fact anchor: rust.dag declares surface spelling + coercion edge for i32. +data rust_r1_claim_surface_spelling_fact: Symbol = rust_surface_spelling_i32 +data rust_r1_claim_coercion_spelling_edge: Symbol = rust_coercion_field_i32_spelling +// Fixture embeds the spelled type + literal suffix so rustc is the external authority. data rust_r1_happy_fixture_source: String = "pub fn r1_test() -> i32 { 0i32 }\n" data rust_r1_falsification_fixture_source: String = "pub fn r1_test() -> i32 { \"string\" }\n" diff --git a/src/v4/test/claim/language_model/rust_r1.dag b/src/v4/test/claim/language_model/rust_r1.dag new file mode 100644 index 00000000000..c4bd9557940 --- /dev/null +++ b/src/v4/test/claim/language_model/rust_r1.dag @@ -0,0 +1,100 @@ +// src/v4/test/claim/language_model/rust_r1.dag +// Scope: Phase 1 R1 — rust.dag i32 surface spelling vs rustc (docs/planning/v4-leaf-model-verification-2026-05-30.md §7). +// Status: modeled claim + fixture pair; host runner scripts/v4-leaf-model-rust-r1-verify.sh exercises rustc. + +module v4.test.claim.language_model.rust_r1 + + +import v4.extdeps.languages.rust { + rust_coercion_field_i32_spelling, + rust_surface_spelling_i32 +} +import v4.lens.leaf_model_verification { + rust_r1_fixture, + rust_r1_falsification_fixture_source, + rust_r1_happy_fixture_source +} +import v4.std.diagnostic { Rejected } +import v4.std.leaf_model_verification { + LeafModelVerificationRunReceipt, + RustR1I32SurfaceSpelling, + TargetCompileRejected, + target_diagnostic_e0308_type_mismatch +} +import v4.std.logic { Bool } +import v4.std.node { Atom, Node, Symbol, TypeNode } +import v4.std.verdict { Fail } +import v4.std.verification { + EqualsClaim, + ManualAnchorAbsent, + TestClaim, + TestClassification, + Tier1, + Boundary, + manual_claim_anchor +} + + +data rust_r1_claim_bool_true: Symbol = rust_r1_claim_bool_true +data rust_r1_claim_bool_false: Symbol = rust_r1_claim_bool_false + + +fn rust_r1_claim_bool_atom(b: Bool) -> Node { + match b { + true => Node { kind: TypeNode { connective: Atom { identity: rust_r1_claim_bool_true } }, children: [] } + false => Node { kind: TypeNode { connective: Atom { identity: rust_r1_claim_bool_false } }, children: [] } + } +} + + +data claim_rust_r1_fixture_pair_wired: TestClaim = EqualsClaim { + label: "language_model/rust_r1: fixture pair references rust_surface_spelling_i32 fact anchors", + anchor: manual_claim_anchor(anchor: ManualAnchorAbsent), + lhs: rust_r1_claim_bool_atom(b: true), + rhs: rust_r1_claim_bool_atom( + b: rust_r1_fixture().claim_id == RustR1I32SurfaceSpelling + && rust_r1_fixture().happy.source == rust_r1_happy_fixture_source + && rust_r1_fixture().falsification.fixture.source == rust_r1_falsification_fixture_source + ), + classification: TestClassification { tier: Tier1, layer: Boundary } +} + + +// Receipt row default fail-closed until host runner overwrites (T-22 bridge follow-on). +data rust_r1_verification_run_receipt_default: LeafModelVerificationRunReceipt = LeafModelVerificationRunReceipt { + claim_id: RustR1I32SurfaceSpelling, + happy_verdict: Fail { actual: Rejected { diagnostics: None } }, + falsification_verdict: Fail { actual: Rejected { diagnostics: None } } +} + + +data claim_rust_r1_verification_receipt_shape: TestClaim = EqualsClaim { + label: "language_model/rust_r1: verification receipt carriers happy + falsification verdict slots", + anchor: manual_claim_anchor(anchor: ManualAnchorAbsent), + lhs: rust_r1_claim_bool_atom( + b: rust_r1_verification_run_receipt_default.claim_id == RustR1I32SurfaceSpelling + ), + rhs: rust_r1_claim_bool_atom(b: true), + classification: TestClassification { tier: Tier1, layer: Boundary } +} + + +fn rust_r1_surface_spelling_facts_linked() -> Bool { + rust_surface_spelling_i32 == rust_surface_spelling_i32 + && rust_coercion_field_i32_spelling == rust_coercion_field_i32_spelling +} + + +data claim_rust_r1_surface_spelling_fact_ids_stable: TestClaim = EqualsClaim { + label: "language_model/rust_r1: claim references stable rust.dag i32 surface-spelling fact ids", + anchor: manual_claim_anchor(anchor: ManualAnchorAbsent), + lhs: rust_r1_claim_bool_atom(b: rust_r1_surface_spelling_facts_linked()), + rhs: rust_r1_claim_bool_atom(b: true), + classification: TestClassification { tier: Tier1, layer: Boundary } +} + + +// Modeled expectation for falsification probe (rustc E0308). +data rust_r1_modeled_falsification_expectation: TargetCompileRejected = TargetCompileRejected { + diagnostic_code: target_diagnostic_e0308_type_mismatch +} From 1cec310d3c794c57d7fb83c8295582eec818b116 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 04:32:39 +0000 Subject: [PATCH 03/26] =?UTF-8?q?WIP:=20Phase=201=20dispatch=20(PR=20#3959?= =?UTF-8?q?=20=C2=A711.4=20step=204):=20R1=20fixture=20generator=20+=20run?= =?UTF-8?q?ner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/v4-leaf-model-rust-r1-verify.sh | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/scripts/v4-leaf-model-rust-r1-verify.sh b/scripts/v4-leaf-model-rust-r1-verify.sh index be04ae69e13..14b3030266b 100755 --- a/scripts/v4-leaf-model-rust-r1-verify.sh +++ b/scripts/v4-leaf-model-rust-r1-verify.sh @@ -25,10 +25,11 @@ if ! command -v rustc >/dev/null 2>&1; then exit 1 fi -readarray -t extracted < <(python3 - "$fixture_dag" <<'PY' +eval "$(python3 - "$fixture_dag" <<'PY' from __future__ import annotations import re +import shlex import sys from pathlib import Path @@ -45,14 +46,10 @@ def extract(name: str) -> str: happy = extract("rust_r1_happy_fixture_source") falsification = extract("rust_r1_falsification_fixture_source") -print(happy, end="") -print("\0", end="") -print(falsification, end="") +print(f"happy_source={shlex.quote(happy)}") +print(f"falsification_source={shlex.quote(falsification)}") PY -) - -happy_source="${extracted[0]}" -falsification_source="${extracted[1]}" +)" run_suffix="${GITHUB_RUN_ID:-local}-${GITHUB_RUN_ATTEMPT:-$$}" tmp_root="${RUNNER_TEMP:-/tmp}" @@ -64,10 +61,10 @@ compile_rust_lib() { local label="$1" local source="$2" local src_path="${scratch}/${label}.rs" - printf '%s' "$source" >"$src_path" local stderr_path="${scratch}/${label}.stderr" + printf '%s' "$source" >"$src_path" set +e - RUSTC_BOOTSTRAP= env -u RUSTC_BOOTSTRAP rustc \ + env -u RUSTC_BOOTSTRAP rustc \ --edition=2021 \ --crate-type lib \ "$src_path" \ From 0359f83fd57ecf005f590e1bca75b82a3cdc87d6 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 04:51:13 +0000 Subject: [PATCH 04/26] fix(ci): apply cargo fmt for R1 leaf-model boundary test Co-authored-by: Cursor --- .../boundary/v4_leaf_model_rust_r1_rustc_test.rs | 11 ++++++----- src/v3/compiler/tests/integration.rs | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r1_rustc_test.rs b/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r1_rustc_test.rs index a3bc0c63933..5ccdfc0624d 100644 --- a/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r1_rustc_test.rs +++ b/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r1_rustc_test.rs @@ -74,10 +74,8 @@ fn compile_lib(harness: &RustcHarness, label: &str, source: &str) -> (bool, Stri fn v4_leaf_model_rust_r1_fixture_strings_match_dag_authority() { let happy = extract_fixture_source(FIXTURE_DAG, "rust_r1_happy_fixture_source") .expect("rust_r1_happy_fixture_source in lens/leaf_model_verification.dag"); - let falsification = - extract_fixture_source(FIXTURE_DAG, "rust_r1_falsification_fixture_source").expect( - "rust_r1_falsification_fixture_source in lens/leaf_model_verification.dag", - ); + let falsification = extract_fixture_source(FIXTURE_DAG, "rust_r1_falsification_fixture_source") + .expect("rust_r1_falsification_fixture_source in lens/leaf_model_verification.dag"); assert_eq!(happy, HAPPY_FIXTURE); assert_eq!(falsification, FALSIFICATION_FIXTURE); assert!( @@ -91,7 +89,10 @@ fn v4_leaf_model_rust_r1_fixture_strings_match_dag_authority() { fn v4_leaf_model_rust_r1_happy_fixture_rustc_accepts() { let harness = RustcHarness::new("v4_leaf_model_rust_r1"); let (ok, stderr) = compile_lib(&harness, "happy", HAPPY_FIXTURE); - assert!(ok, "rustc should accept R1 happy fixture; stderr:\n{stderr}"); + assert!( + ok, + "rustc should accept R1 happy fixture; stderr:\n{stderr}" + ); } #[test] diff --git a/src/v3/compiler/tests/integration.rs b/src/v3/compiler/tests/integration.rs index 707e7f8e057..58b3d67f9f5 100644 --- a/src/v3/compiler/tests/integration.rs +++ b/src/v3/compiler/tests/integration.rs @@ -145,8 +145,6 @@ mod m1_lens_structural_resolution_test; mod m1_substrate_test; #[path = "boundary/m2_emit_multi_field_struct_variant_test.rs"] mod m2_emit_multi_field_struct_variant_test; -#[path = "boundary/v4_leaf_model_rust_r1_rustc_test.rs"] -mod v4_leaf_model_rust_r1_rustc_test; #[path = "integration/m2_feature_parity_test.rs"] mod m2_feature_parity_test; #[path = "integration/m2_field_access_binding_test.rs"] @@ -295,6 +293,8 @@ mod v4_extdeps_file_system_dag_smoke_test; mod v4_extdeps_formatters_black_dag_smoke_test; #[path = "integration/v4_extdeps_react_dag_smoke_test.rs"] mod v4_extdeps_react_dag_smoke_test; +#[path = "boundary/v4_leaf_model_rust_r1_rustc_test.rs"] +mod v4_leaf_model_rust_r1_rustc_test; #[path = "integration/v4_lens_affected_set_dag_smoke_test.rs"] mod v4_lens_affected_set_dag_smoke_test; #[path = "integration/v4_lens_application_dag_smoke_test.rs"] From 669ee5f38534d44e61383aae8993fe409bc9b44f Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 05:23:23 +0000 Subject: [PATCH 05/26] =?UTF-8?q?WIP:=20Phase=201=20dispatch=20(PR=20#3959?= =?UTF-8?q?=20=C2=A711.4=20step=204):=20R1=20fixture=20generator=20+=20run?= =?UTF-8?q?ner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/v4/lens/leaf_model_verification.dag | 16 ++++++++-------- src/v4/std/leaf_model_verification.dag | 6 ++++++ src/v4/test/claim/language_model/rust_r1.dag | 8 ++++---- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/src/v4/lens/leaf_model_verification.dag b/src/v4/lens/leaf_model_verification.dag index 03104fcc726..f53789f8b56 100644 --- a/src/v4/lens/leaf_model_verification.dag +++ b/src/v4/lens/leaf_model_verification.dag @@ -13,8 +13,8 @@ import v4.std.leaf_model_verification { LeafModelFixturePair, LeafModelFalsificationCase, LeafModelRustFixture, - RustCrateTypeLib, - RustR1I32SurfaceSpelling, + leaf_model_claim_rust_r1_i32_surface_spelling, + leaf_model_rust_crate_type_lib, TargetCompileAccepted, TargetCompileRejected, target_diagnostic_e0308_type_mismatch @@ -34,29 +34,29 @@ data rust_r1_falsification_fixture_source: String = "pub fn r1_test() -> i32 { \ fn rust_r1_happy_fixture() -> LeafModelRustFixture { LeafModelRustFixture { - claim_id: RustR1I32SurfaceSpelling, + claim_id: leaf_model_claim_rust_r1_i32_surface_spelling, source: rust_r1_happy_fixture_source, - crate_type: RustCrateTypeLib + crate_type: leaf_model_rust_crate_type_lib } } fn rust_r1_falsification_fixture() -> LeafModelRustFixture { LeafModelRustFixture { - claim_id: RustR1I32SurfaceSpelling, + claim_id: leaf_model_claim_rust_r1_i32_surface_spelling, source: rust_r1_falsification_fixture_source, - crate_type: RustCrateTypeLib + crate_type: leaf_model_rust_crate_type_lib } } fn rust_r1_fixture_pair() -> LeafModelFixturePair { LeafModelFixturePair { - claim_id: RustR1I32SurfaceSpelling, + claim_id: leaf_model_claim_rust_r1_i32_surface_spelling, happy: rust_r1_happy_fixture(), expected_happy_verdict: TargetCompileAccepted, falsification: LeafModelFalsificationCase { - claim_id: RustR1I32SurfaceSpelling, + claim_id: leaf_model_claim_rust_r1_i32_surface_spelling, fixture: rust_r1_falsification_fixture(), expected_verdict: TargetCompileRejected { diagnostic_code: target_diagnostic_e0308_type_mismatch diff --git a/src/v4/std/leaf_model_verification.dag b/src/v4/std/leaf_model_verification.dag index 58a00031500..c33f9b2ab6b 100644 --- a/src/v4/std/leaf_model_verification.dag +++ b/src/v4/std/leaf_model_verification.dag @@ -26,10 +26,16 @@ type LeafModelClaimId = RustR1I32SurfaceSpelling +data leaf_model_claim_rust_r1_i32_surface_spelling: LeafModelClaimId = RustR1I32SurfaceSpelling + + type LeafModelRustCrateType = RustCrateTypeLib +data leaf_model_rust_crate_type_lib: LeafModelRustCrateType = RustCrateTypeLib + + type LeafModelRustFixture { claim_id: LeafModelClaimId source: String diff --git a/src/v4/test/claim/language_model/rust_r1.dag b/src/v4/test/claim/language_model/rust_r1.dag index c4bd9557940..15618b03cde 100644 --- a/src/v4/test/claim/language_model/rust_r1.dag +++ b/src/v4/test/claim/language_model/rust_r1.dag @@ -17,7 +17,7 @@ import v4.lens.leaf_model_verification { import v4.std.diagnostic { Rejected } import v4.std.leaf_model_verification { LeafModelVerificationRunReceipt, - RustR1I32SurfaceSpelling, + leaf_model_claim_rust_r1_i32_surface_spelling, TargetCompileRejected, target_diagnostic_e0308_type_mismatch } @@ -52,7 +52,7 @@ data claim_rust_r1_fixture_pair_wired: TestClaim = EqualsClaim { anchor: manual_claim_anchor(anchor: ManualAnchorAbsent), lhs: rust_r1_claim_bool_atom(b: true), rhs: rust_r1_claim_bool_atom( - b: rust_r1_fixture().claim_id == RustR1I32SurfaceSpelling + b: rust_r1_fixture().claim_id == leaf_model_claim_rust_r1_i32_surface_spelling && rust_r1_fixture().happy.source == rust_r1_happy_fixture_source && rust_r1_fixture().falsification.fixture.source == rust_r1_falsification_fixture_source ), @@ -62,7 +62,7 @@ data claim_rust_r1_fixture_pair_wired: TestClaim = EqualsClaim { // Receipt row default fail-closed until host runner overwrites (T-22 bridge follow-on). data rust_r1_verification_run_receipt_default: LeafModelVerificationRunReceipt = LeafModelVerificationRunReceipt { - claim_id: RustR1I32SurfaceSpelling, + claim_id: leaf_model_claim_rust_r1_i32_surface_spelling, happy_verdict: Fail { actual: Rejected { diagnostics: None } }, falsification_verdict: Fail { actual: Rejected { diagnostics: None } } } @@ -72,7 +72,7 @@ data claim_rust_r1_verification_receipt_shape: TestClaim = EqualsClaim { label: "language_model/rust_r1: verification receipt carriers happy + falsification verdict slots", anchor: manual_claim_anchor(anchor: ManualAnchorAbsent), lhs: rust_r1_claim_bool_atom( - b: rust_r1_verification_run_receipt_default.claim_id == RustR1I32SurfaceSpelling + b: rust_r1_verification_run_receipt_default.claim_id == leaf_model_claim_rust_r1_i32_surface_spelling ), rhs: rust_r1_claim_bool_atom(b: true), classification: TestClassification { tier: Tier1, layer: Boundary } From 84b107e8efb5e29f8734abc4478b2d2522a8d8f4 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 05:35:23 +0000 Subject: [PATCH 06/26] =?UTF-8?q?WIP:=20Phase=201=20dispatch=20(PR=20#3959?= =?UTF-8?q?=20=C2=A711.4=20step=204):=20R1=20fixture=20generator=20+=20run?= =?UTF-8?q?ner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _internal/INVARIANTS_OPS.md | 1 + .../v4_leaf_model_rust_r1_rustc_test.rs | 2 ++ .../tests/integration/sg0_census_test.rs | 11 +++++++ src/v4/lens/leaf_model_verification.dag | 4 +-- src/v4/std/leaf_model_verification.dag | 29 ++++++------------- 5 files changed, 24 insertions(+), 23 deletions(-) diff --git a/_internal/INVARIANTS_OPS.md b/_internal/INVARIANTS_OPS.md index 8a925984c4b..c21d7a59791 100644 --- a/_internal/INVARIANTS_OPS.md +++ b/_internal/INVARIANTS_OPS.md @@ -45,6 +45,7 @@ Per **Dispatch-Discipline Mechanisms (b)** above, each **new** path added to `EX | `src/v3/compiler/tests/integration/v4_workflow_release_dag_smoke_test.rs` | **RELEASE_TODO.md** §5 Phase 1a (`src/v4/workflow/release.dag` — tag `v*` trigger, six-target matrix [musl linux x2, darwin x2, windows msvc x2], musl `cross` + native darwin/windows builds, `release_published_target_triples` + `release_published_artifact_names` with `.exe` on windows rows, GH Release upload of matrix `artifact_basename` assets only; hand-synced `.github/workflows/release.yml`). Install (`install.sh`, target detection) deferred to Phase 1b (`install.dag`). **ROADMAP:** `_internal/ROADMAP_OPS.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` + `scripts/ci-merge/sg0-pr-body-append.3859.txt` land in the same PR as the smoke harness. **Dissolution:** remove when `release_pipeline` YamlStatic emits `release.yml` and generated harness exercises release facts without this parse probe. **Interim ratchet:** `v4_workflow_release_dag_tokenizes_and_parses`; `v4_workflow_release_semantics_modeled`; `v4_workflow_release_modeled_and_bound_to_release_yml`; `v4_workflow_release_published_authority_single_writer` — tokenize+parse + release.yml binding + published triple/artifact basename parity across `release.dag` and `release.yml` (reads `release.dag`, `release.yml`, `src/v2/stage0/Cargo.toml` only). | | `src/v3/compiler/tests/integration/v4_test_bootstrap_infra_closeout_test.rs` | **ROADMAP:** `_internal/ROADMAP_OPS.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`; **TASKS.md** **T-19** (`src/v4/lens/testgen.dag`) + **T-20** (`src/v4/workflow/bootstrap.dag`) + **T-22** (`src/v4/compiler/05_eval.dag` DiagnosticAssert execution / `eval_rejected_assert_kind_deferred` dissolution; witnesses in `src/v4/test/claim/manual/diagnostic_assert_eval.dag`). **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the closeout ratchet; T-22 expansion in its PR updates this row; T-19 AlgebraLaw Nat corpus expansion (this PR) further updates this row (same path — no new census line); T-19 deferral lane: TASKS.md §T-19 `algebra_law_conformance.dag` corpus, _internal/ROADMAP_OPS.md § Nine lanes row T-PB-B. **Dissolution:** remove when the T-19/T-20/T-22 closeout checks are expressed as `.dag` `TestClaim` rows or generated harness coverage without this host parse-surface ratchet. **Interim ratchet:** `testgen_concept_surface_stays_closed_and_classified` checks the closed testgen scheduling arms and the `Generator` claim kind / anchor / classification / slot field set; `language_behavior_equivalence_generated_claims_parse` / `language_behavior_equivalence_run_test_claim_receipts_present` pin the LBE generator slice; `idempotent_operation_generated_claims_parse_and_pin_emission` pins the idempotent-operation generator slice (`src/v4/std/effects.dag` canonical `IdempotentShape`/`EffectShape` witnesses + `idempotent_operation_witness_node`; outside the six-way `TestgenConcept` coproduct; label-only skip); `manual_manifest_matches_claim_anchor_discriminants` checks manual claim anchors join to the manifest by `ManualAnchorKey`; `claim_corpus_has_no_direct_manual_anchor_assignments` scans `src/v4/test/claim/**/*.dag` so `TestClaim.anchor` literals cannot bypass `manual_claim_anchor(...)` after the `ClaimAnchorKey` split; `coproduct_exhaustiveness_generated_claim_parse_and_witnesses_present` checks the generated coproduct-exhaustiveness corpus parses, derives the invalid `Node` and generated claim anchor from one `GeneratedCoproductExhaustiveness` source, uses canonical `node_locus`, and schedules the generated `DiagnosticExhaustiveness` claim under `GeneratedClaimAnchor`; `t20_bootstrap_plan_keeps_self_hosting_chain_as_data` checks the seed/self0/self1/fixpt bootstrap chain is encoded as `CompileStage` / `BootstrapPlan` data; `t22_diagnostic_assert_eval_witnesses_parse` checks `diagnostic_assert_eval.dag` parses; `t22_eval_diagnostic_assert_not_deferred_in_substrate` checks `05_eval.dag` no longer contains `eval_rejected_assert_kind_deferred`, executes `DiagnosticAssert`, and routes `run_test_claim` through `aggregate_verdicts`; `t19_algebra_law_generated_claims_parse_and_use_testgen_emit` checks `algebra_law_conformance.dag` parses and asserts the testgen emit helpers + tautological-sides guard in `lens/testgen.dag`. | | `src/v3/compiler/tests/integration/coverage_defect_acceptance_dag_test.rs` | **Coverage-defect acceptance keys:** `src/v4/lens/coverage.dag` carries the canonical coverage-key set for `docs/design-dissolution-lens.md` §5.1; the old emit-template key is retired into `TemplateHole`, and the old string-escape key is split into `TemplateHole` plus `CanonicalCarrier`. **ROADMAP:** `_internal/ROADMAP_OPS.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the parse-level ratchet. **Dissolution:** remove when the v4 coverage lens runs as `.dag` / generated coverage and can assert the same acceptance rows without this host parser check. **Interim ratchet:** `coverage_defect_acceptance_keys_match_declared_rows` tokenizes/parses `src/v4/lens/coverage.dag` and asserts the exact parsed `(coverage_defect_* data row, CoverageDefectKey variant)` set matches the expected acceptance-key table while rejecting retired emit-template / string-escape names. | +| `src/v3/compiler/tests/boundary/v4_leaf_model_rust_r1_rustc_test.rs` | **Phase 1 leaf-model verification** (`docs/planning/v4-leaf-model-verification-2026-05-30.md` §7 R1): boundary `rustc` exercise for `src/v4/lens/leaf_model_verification.dag` happy + falsification fixtures; interim host runner `scripts/v4-leaf-model-rust-r1-verify.sh`. **ROADMAP:** `_internal/ROADMAP_OPS.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`; **TASKS.md** T-22/T-38 (Runtime/TestClaim verdict surface). **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the harness. **Dissolution:** delete when modeled `run_target_verification` exercises `src/v4/test/claim/language_model/rust_r1.dag` without this hand-Rust bridge. **Interim ratchet:** `v4_leaf_model_rust_r1_fixture_strings_match_dag_authority`, `v4_leaf_model_rust_r1_happy_fixture_rustc_accepts`, `v4_leaf_model_rust_r1_falsification_fixture_rustc_e0308`. | | `src/v3/compiler/tests/integration/v4_bin_main_dag_smoke_test.rs` | **T-15** (`src/v4/bin/main.dag` — trampoline **`String`** authority + B1 digest **placeholder** `Node`s; closed-tree invariant #2 / pure-bootstrap zero-floor per `docs/design-pure-bootstrap-zero.md`). **Grounded-indicator authoring on `main.dag` is HOLD** pending hub-relayed canonical spec (operator-direct format under-spec; pending canonical spec). **ROADMAP:** `_internal/ROADMAP_OPS.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness. **Dissolution:** remove when `main.dag` is exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust probe. **Interim ratchet:** `v4_bin_main_dag_tokenizes_and_parses_with_trampoline_source_anchor` runs `tokenize_for_test` + `parse_for_test` on the pinned `include_str!` source and asserts the trampoline / stub `data` identifiers plus the escaped `include!` spelling remain present in source text (full `compile_to_dag` on `main.dag` alone is deferred: `import v4.std.node` is not linked in the single-file harness). | | `src/v3/compiler/tests/integration/v4_t15_self_host_fixed_point_harness_test.rs` | **T-15** (`src/v4/TASKS.md` §T-15 — `bin/main.dag` trampoline authority + bootstrap `FixptStage1Stage2` stage1==stage2 wiring, **not** stage0==stage1; `claim_t15_self_host_fixed_point.dag` EqualsClaim over digest operand placeholders; optional v2 `gunbc compile` with `main.dag` entry root when `target/release/gunbc` exists). **ROADMAP:** `_internal/ROADMAP_OPS.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the harness + `claim_t15_self_host_fixed_point.dag`. **Dissolution:** remove when B1 merkle `content_hash` pins + T-22 eval execute the Equals probe and bootstrap fixpt without host structural receipts. **Interim ratchet:** `t_15_self_host_fixed_point` (TASKS.md CI gate name) tokenize/parse `main.dag`, `bootstrap.dag`, `self_host.dag`, and the T-15 claim; assert trampoline + fixpt stage1/stage2 digest convergence strings in `bootstrap_plan_well_formed`; assert `self_host_fixed_point_validate` stays fail-closed; optional v2 entry-root compile receipt. | | `src/v3/compiler/tests/integration/v4_compiler_emit_translate_smoke_test.rs` | **TASKS.md** T-10 / Wave-3-B (`src/v4/compiler/06_translate.dag` — `fold_node` translate + `coercion_fold` wrapper, `TargetSelectionPolicy` from target-model bundle; `src/v4/compiler/05_emit.dag` — `serialize_target ∘ translate`, grammar-as-bidir serialize via bundle `emitted`/`source` keys; `src/v4/test/claim/manual/mvp1_rust_add_translate.dag` structural TestClaim anchors). **ROADMAP:** `_internal/ROADMAP_OPS.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness. **This PR (+0 paths):** replaces fixed `translate_default_serialize_fuel` with structural `Outcome` serialize measures in `06_translate.dag`; expands the existing harness (no new census path) to ratchet parsed-surface declarations for `target_translation_rules_budget`, `translate_serialize_measure`, `target_serialize_source_from_model`, `bind_outcome` import, and absence of `translate_default_serialize_fuel` data — semantic fail-closed behavior is exercised by `run_mvp1_serialize_rejects_missing_translation_rules` in `mvp1_rust_add_translate.dag` (not host `str::contains` probes). **PR #3778 same-path expansion (+0 SG-0 paths):** adds `v4_wasm_wat_lex_boundary_uses_trivia_and_numeric_literal_authority` to pin the T-4.17 WAT lex/grammar dissolution receipt: stale whitespace-bearing wasm fixture tokens stay deleted, atomic keyword/trivia/numeric-literal authorities are present, and typed numeric-literal grammar productions exist for `i32`/`i64`/`f32`/`f64` const operands. **This PR same-path expansion (+0 SG-0 paths):** adds `v4_python_language_model_declares_wave2b_algebra_inhabitance` to pin T-4.17 Python Wave 2b type-deepening: `python.dag` consumes `AlgebraInhabitanceDecl` plus grounded `std.algebra` Node constructors (`ordered_ring_node`, `approximate_field_node`, `boolean_algebra_node`) and declares int/float/bool witness + inhabitance rows feeding `python_model_core_wave1`; the ratchet also asserts zero complex/singleton algebra witness/inhabitance helper declarations, so complex and singleton facts remain mechanically outside faithful algebra inhabitance until the relevant carrier exists. The Python T-11 grammar ratchet now additionally requires canonical `FormalProduction` with a flat formal-symbol RHS, requires the shared `std.grammar` `formal_production_to_node` projection, rejects legacy `GrammarExpr`/`Sequence`/`Terminal` imports in `python.dag`, and asserts zero Python-owned formal-production projection helpers. **This PR same-path expansion (+0 SG-0 paths):** adds `v4_wasm_language_model_declares_wave2b_algebra_inhabitance` to pin T-4.17 Wasm Wave 2b type-deepening: `wasm.dag` consumes `AlgebraInhabitanceDecl` plus grounded `std.algebra` type-node constructors (`commutative_semiring_type_node`, `approximate_field_type_node`) and declares integer/float witness + inhabitance rows feeding `wasm_model_core_wave2b`; the ratchet pins wave-2b entrypoints without adding a new SG-0 census path. **PR #3840 same-path expansion (+0 SG-0 paths):** adds `v4_mvp1_python_add_claim_tokenizes_and_parses`, `v4_mvp1_go_add_claim_tokenizes_and_parses`, `v4_mvp1_cpp_add_claim_tokenizes_and_parses`, `v4_mvp1_typescript_add_claim_tokenizes_and_parses`, and `v4_mvp1_shape_a_add_claims_import_compile_inferred` to ratchet T-11 grammar-inverse compile-inferred TestClaim parse/import receipts for python/go/cpp/typescript Shape-A MVP-1 add-fn fixtures (`mvp1_*_add_translate.dag`); dissolves `feature:T-11-grammar-inverse-serializer-remaining-targets` status mark in `06_translate.dag`. This is explicitly deferred under **ROADMAP** § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`; dissolve these same-path Rust ratchets when the language boundary facts are asserted by `.dag` `TestClaim` rows, T-22 execution, or a generated harness instead of host `SurfaceExpr` traversal. Prior T-11 ratchet rows remain: `v4_emit_dag_tokenizes_and_parses`, `v4_emit_dag_module_path_is_compiler_emit`, `v4_emit_dag_imports_translate_stage`, `v4_emit_dag_declares_emit_entrypoint`, `v4_emit_dag_does_not_import_find_witness`, `v4_mvp1_rust_add_claim_imports_translate_and_emit`, `v4_translate_dag_dispatches_token_sequence_items`, and the language-model T-11 rows. **Dissolution:** remove when translate/emit/MVP-1 surfaces are exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust probe (full `compile_to_dag` over v4 compiler modules deferred until multi-module load). | diff --git a/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r1_rustc_test.rs b/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r1_rustc_test.rs index 5ccdfc0624d..9faa1d79405 100644 --- a/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r1_rustc_test.rs +++ b/src/v3/compiler/tests/boundary/v4_leaf_model_rust_r1_rustc_test.rs @@ -4,6 +4,8 @@ //! `src/v4/lens/leaf_model_verification.dag`; host runner //! `scripts/v4-leaf-model-rust-r1-verify.sh`. //! +//! **P5 receipt:** matching `_internal/INVARIANTS_OPS.md` row + +//! `EXPECTED_HAND_AUTHORED_TEST` literal in `sg0_census_test.rs` (same PR). //! **Dissolution:** retire when T-22 eval + modeled `run_target_verification` owns //! rustc invocation without this hand-Rust bridge. diff --git a/src/v3/compiler/tests/integration/sg0_census_test.rs b/src/v3/compiler/tests/integration/sg0_census_test.rs index a71bcaec5bb..3e3f95cb000 100644 --- a/src/v3/compiler/tests/integration/sg0_census_test.rs +++ b/src/v3/compiler/tests/integration/sg0_census_test.rs @@ -386,6 +386,17 @@ const EXPECTED_HAND_AUTHORED_TEST: &[&str] = &[ "src/v3/compiler/tests/boundary/m1_4_emit_python_test.rs", "src/v3/compiler/tests/boundary/m1_5_emit_omni_demo_test.rs", "src/v3/compiler/tests/boundary/m2_emit_multi_field_struct_variant_test.rs", + // Phase 1 leaf-model verification R1 (`docs/planning/v4-leaf-model-verification-2026-05-30.md` §7): + // boundary rustc exercise for `src/v4/lens/leaf_model_verification.dag` fixtures until + // T-22 modeled `run_target_verification` owns target verdicts. + // + // **P5 receipt (INVARIANTS.md §P5 — SG-0 `EXPECTED_HAND_AUTHORED_TEST`):** explicit + // deferral to **ROADMAP.md** `### Nine lanes` row **T-PB-B** / + // `pb_rust_tests_outside_residual_zero` + **TASKS.md** T-22/T-38 (Runtime/TestClaim + // verdict surface; interim host runner `scripts/v4-leaf-model-rust-r1-verify.sh`). + // Dissolution: delete when modeled runner exercises + // `src/v4/test/claim/language_model/rust_r1.dag` without this hand-Rust bridge. + "src/v3/compiler/tests/boundary/v4_leaf_model_rust_r1_rustc_test.rs", "src/v3/compiler/tests/determinism_test.rs", "src/v3/compiler/tests/integration.rs", "src/v3/compiler/tests/integration/anthropic_messages_callable_test.rs", diff --git a/src/v4/lens/leaf_model_verification.dag b/src/v4/lens/leaf_model_verification.dag index f53789f8b56..311b7f6bfca 100644 --- a/src/v4/lens/leaf_model_verification.dag +++ b/src/v4/lens/leaf_model_verification.dag @@ -19,6 +19,7 @@ import v4.std.leaf_model_verification { TargetCompileRejected, target_diagnostic_e0308_type_mismatch } +import v4.std.node { Symbol } import v4.std.text { String } @@ -34,7 +35,6 @@ data rust_r1_falsification_fixture_source: String = "pub fn r1_test() -> i32 { \ fn rust_r1_happy_fixture() -> LeafModelRustFixture { LeafModelRustFixture { - claim_id: leaf_model_claim_rust_r1_i32_surface_spelling, source: rust_r1_happy_fixture_source, crate_type: leaf_model_rust_crate_type_lib } @@ -43,7 +43,6 @@ fn rust_r1_happy_fixture() -> LeafModelRustFixture { fn rust_r1_falsification_fixture() -> LeafModelRustFixture { LeafModelRustFixture { - claim_id: leaf_model_claim_rust_r1_i32_surface_spelling, source: rust_r1_falsification_fixture_source, crate_type: leaf_model_rust_crate_type_lib } @@ -56,7 +55,6 @@ fn rust_r1_fixture_pair() -> LeafModelFixturePair { happy: rust_r1_happy_fixture(), expected_happy_verdict: TargetCompileAccepted, falsification: LeafModelFalsificationCase { - claim_id: leaf_model_claim_rust_r1_i32_surface_spelling, fixture: rust_r1_falsification_fixture(), expected_verdict: TargetCompileRejected { diagnostic_code: target_diagnostic_e0308_type_mismatch diff --git a/src/v4/std/leaf_model_verification.dag b/src/v4/std/leaf_model_verification.dag index c33f9b2ab6b..adc5b0ea058 100644 --- a/src/v4/std/leaf_model_verification.dag +++ b/src/v4/std/leaf_model_verification.dag @@ -12,7 +12,7 @@ import v4.std.diagnostic { Accepted } import v4.std.verdict { Verdict, verdict_combine } -// Target exercise outcome for compile-only Phase 1 fixtures (rustc / pyright / … widen later). +// 🟢 coproduct dissolution — CP-LMV-TARGET-COMPILE-VERDICT-PHASE1 (Phase 1 R1 rustc gate; widen per target). type TargetCompileVerdict = TargetCompileAccepted | TargetCompileRejected { diagnostic_code: Symbol } @@ -37,14 +37,12 @@ data leaf_model_rust_crate_type_lib: LeafModelRustCrateType = RustCrateTypeLib type LeafModelRustFixture { - claim_id: LeafModelClaimId source: String crate_type: LeafModelRustCrateType } type LeafModelFalsificationCase { - claim_id: LeafModelClaimId fixture: LeafModelRustFixture expected_verdict: TargetCompileVerdict } @@ -65,24 +63,15 @@ type LeafModelVerificationRunReceipt { } -fn leaf_model_verification_run_proven(receipt: LeafModelVerificationRunReceipt) -> Bool { - match receipt.happy_verdict { - Pass => match receipt.falsification_verdict { - Pass => true - Fail { actual: _ } => false - Deferred { actual: _, diagnostic: _ } => false - } - Fail { actual: _ } => false - Deferred { actual: _, diagnostic: _ } => false - } -} - - fn leaf_model_verification_claim_passes(receipt: LeafModelVerificationRunReceipt) -> Verdict { - if leaf_model_verification_run_proven(receipt: receipt) { - Pass - } else { - Fail { actual: Accepted { value: receipt.claim_id, diagnostics: None } } + match verdict_combine(a: receipt.happy_verdict, b: receipt.falsification_verdict) { + Pass => Pass + Fail { actual: _ } => Fail { actual: Accepted { value: receipt.claim_id, diagnostics: None } } + Deferred { actual: _, diagnostic: diag } => + Deferred { + actual: Accepted { value: receipt.claim_id, diagnostics: None }, + diagnostic: diag + } } } From 4b6282205e7185c680c08458b1a9f53d0d64e4d6 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 05:36:07 +0000 Subject: [PATCH 07/26] fix(review): address openai-pro coproduct dispositions + host-runner dissolution - Tag LeafModelClaimId and LeafModelRustCrateType coproducts (Practice 4). - Add dissolve-on-arrival header to v4-leaf-model-rust-r1-verify.sh (T-22 bridge). - Prior commit already: Symbol import, single claim_id owner, verdict_combine, SG-0 + INVARIANTS_OPS P5 receipt for boundary test. Co-authored-by: Cursor --- scripts/v4-leaf-model-rust-r1-verify.sh | 4 ++++ src/v4/std/leaf_model_verification.dag | 2 ++ 2 files changed, 6 insertions(+) diff --git a/scripts/v4-leaf-model-rust-r1-verify.sh b/scripts/v4-leaf-model-rust-r1-verify.sh index 14b3030266b..db27d79e940 100755 --- a/scripts/v4-leaf-model-rust-r1-verify.sh +++ b/scripts/v4-leaf-model-rust-r1-verify.sh @@ -8,6 +8,10 @@ # Exercises rustc on happy + falsification fixtures; emits JSON receipt. # Falsification probe expects E0308 (type mismatch) per # docs/planning/v4-leaf-model-verification-2026-05-30.md §7. +# +# Dissolve-on-arrival: delete when T-22 modeled `run_target_verification` owns rustc +# invocation and structured TestClaimRun verdicts replace this host bridge (same +# trigger as src/v3/compiler/tests/boundary/v4_leaf_model_rust_r1_rustc_test.rs). set -euo pipefail diff --git a/src/v4/std/leaf_model_verification.dag b/src/v4/std/leaf_model_verification.dag index adc5b0ea058..9d08a391706 100644 --- a/src/v4/std/leaf_model_verification.dag +++ b/src/v4/std/leaf_model_verification.dag @@ -22,6 +22,7 @@ data target_diagnostic_e0308_type_mismatch: Symbol = target_diagnostic_e0308_typ // Stable claim identity — references fact IDs declared in leaf models (not runner concerns). +// 🟢 coproduct dissolution — CP-LMV-CLAIM-ID-PHASE1 (R1 only; widen per additional language-model claims). type LeafModelClaimId = RustR1I32SurfaceSpelling @@ -29,6 +30,7 @@ type LeafModelClaimId data leaf_model_claim_rust_r1_i32_surface_spelling: LeafModelClaimId = RustR1I32SurfaceSpelling +// 🟢 coproduct dissolution — CP-LMV-RUST-CRATE-TYPE-PHASE1 (lib fixtures only; widen for bin/exe). type LeafModelRustCrateType = RustCrateTypeLib From fd919325084742ba37667aa215ba93ce6ada82ab Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 05:37:48 +0000 Subject: [PATCH 08/26] fix(ci): add SG-0 PR-body append for leaf-model R1 census +1 CI `check-pr-sg0-net-shrink-discipline.sh` requires column-0 `SG-0 pairing:` when `sg0_census_test.rs` gains a hand-authored test path. Co-authored-by: Cursor --- scripts/ci-merge/sg0-pr-body-append.3972.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 scripts/ci-merge/sg0-pr-body-append.3972.txt diff --git a/scripts/ci-merge/sg0-pr-body-append.3972.txt b/scripts/ci-merge/sg0-pr-body-append.3972.txt new file mode 100644 index 00000000000..58641d6ce0e --- /dev/null +++ b/scripts/ci-merge/sg0-pr-body-append.3972.txt @@ -0,0 +1,3 @@ +SG-0 hand-path delta: +1 + +SG-0 pairing: (c) Net +1 on `EXPECTED_HAND_AUTHORED_TEST` for `v4_leaf_model_rust_r1_rustc_test.rs` (INVARIANTS §P5(b) Phase 1 leaf-model R1 boundary `rustc` ratchet per `docs/planning/v4-leaf-model-verification-2026-05-30.md` §7; pairs with `scripts/v4-leaf-model-rust-r1-verify.sh`). Follow-up dispatch: retire when T-22 modeled `run_target_verification` exercises `src/v4/test/claim/language_model/rust_r1.dag` without this hand-Rust bridge — gunb-ai/gunbc#3972 / T-PB-B `pb_rust_tests_outside_residual_zero` in `_internal/ROADMAP_OPS.md`. From 88c0cf581bc5b7ef8ad9dd3785fbd75932760b84 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 07:09:34 +0000 Subject: [PATCH 09/26] fix(ci): raise v4 bootstrap/testclaim compile timeouts (exit 143) CI hit script-level timeouts (180s bootstrap, 240s TestClaim corpus) on loaded self-hosted runners while compiling full src/v4. Bump defaults and wire explicit env on the ci workflow steps. Co-authored-by: Cursor --- .github/workflows/ci.yml | 5 +++++ scripts/v4-bootstrap-viability.sh | 3 ++- scripts/v4-testclaim-corpus-gate.sh | 5 +++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df9cc02f763..cd5c14cf700 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -257,6 +257,8 @@ jobs: id: v4_bootstrap_compile timeout-minutes: 35 continue-on-error: true + env: + V4_BOOTSTRAP_TIMEOUT_SECS: '300' run: | set +euo pipefail bash scripts/v4-bootstrap-viability.sh @@ -287,6 +289,9 @@ jobs: exit 1 - name: 'T-22 TestClaim corpus structural bridge — manual .dag corpus' if: needs.affected.outputs.v4 == 'true' || needs.affected.outputs.workflow_policy == 'true' + timeout-minutes: 15 + env: + V4_TESTCLAIM_TIMEOUT_SECS: '420' run: bash scripts/v4-testclaim-corpus-gate.sh # v2 fixed-point — runs only when src/v2/ is affected. v2 is restored as # comparison artifact + v4 bootstrap source (frozen-buildable). Verifies diff --git a/scripts/v4-bootstrap-viability.sh b/scripts/v4-bootstrap-viability.sh index 8f145fef112..abed9dbe91d 100755 --- a/scripts/v4-bootstrap-viability.sh +++ b/scripts/v4-bootstrap-viability.sh @@ -25,7 +25,8 @@ mkdir -p "$out" compile_timeout="${V4_BOOTSTRAP_TIMEOUT_SECS:-}" if [[ -n "${GITHUB_ACTIONS:-}" && -z "$compile_timeout" ]]; then - compile_timeout=180 + # 300s: full src/v4 --target dag exceeds 180s on loaded self-hosted runners (exit 143). + compile_timeout=300 fi set +e diff --git a/scripts/v4-testclaim-corpus-gate.sh b/scripts/v4-testclaim-corpus-gate.sh index 9a155306e2a..7da10235102 100755 --- a/scripts/v4-testclaim-corpus-gate.sh +++ b/scripts/v4-testclaim-corpus-gate.sh @@ -23,7 +23,7 @@ # V4_TESTCLAIM_LOG - dag compiler log path (default: ${OUT}.log) # V4_TESTCLAIM_RUST_OUT - rust emit output dir (default: ${OUT}-rust) # V4_TESTCLAIM_RUST_LOG - rust emit compiler log path (default: ${RUST_OUT}.log) -# V4_TESTCLAIM_TIMEOUT_SECS - optional timeout (CI default: 240) +# V4_TESTCLAIM_TIMEOUT_SECS - optional timeout (CI default: 420) set -euo pipefail @@ -64,7 +64,8 @@ mkdir -p "$out" "$rust_out" "$(dirname "$log")" "$(dirname "$rust_log")" compile_timeout="${V4_TESTCLAIM_TIMEOUT_SECS:-}" if [[ -n "${GITHUB_ACTIONS:-}" && -z "$compile_timeout" ]]; then - compile_timeout=240 + # 420s: full src/v4 --target rust exceeds 240s on loaded self-hosted runners (exit 143). + compile_timeout=420 fi run_compile() { From b39d09b5bc0a073e1b51bc880946fb41ccd2d8b6 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 09:25:35 +0000 Subject: [PATCH 10/26] fix(v4): use Symbol anchors for single-variant leaf-model IDs v4 bootstrap compile rejects nullary single-arm coproducts (RustR1I32SurfaceSpelling / RustCrateTypeLib unresolved). Phase 1 keeps typed Symbol aliases until multi-arm coproducts widen. Co-authored-by: Cursor --- src/v4/std/leaf_model_verification.dag | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/v4/std/leaf_model_verification.dag b/src/v4/std/leaf_model_verification.dag index 9d08a391706..69aa4ff6fa5 100644 --- a/src/v4/std/leaf_model_verification.dag +++ b/src/v4/std/leaf_model_verification.dag @@ -21,21 +21,20 @@ type TargetCompileVerdict data target_diagnostic_e0308_type_mismatch: Symbol = target_diagnostic_e0308_type_mismatch -// Stable claim identity — references fact IDs declared in leaf models (not runner concerns). -// 🟢 coproduct dissolution — CP-LMV-CLAIM-ID-PHASE1 (R1 only; widen per additional language-model claims). -type LeafModelClaimId - = RustR1I32SurfaceSpelling +// Stable claim identity — Symbol anchor until multi-claim coproduct widens (v4 bootstrap +// rejects nullary single-arm sums; see commit 669ee5f3 / CI @ 816a836). +type LeafModelClaimId = Symbol -data leaf_model_claim_rust_r1_i32_surface_spelling: LeafModelClaimId = RustR1I32SurfaceSpelling +data leaf_model_claim_rust_r1_i32_surface_spelling: LeafModelClaimId = + leaf_model_claim_rust_r1_i32_surface_spelling -// 🟢 coproduct dissolution — CP-LMV-RUST-CRATE-TYPE-PHASE1 (lib fixtures only; widen for bin/exe). -type LeafModelRustCrateType - = RustCrateTypeLib +// Rust fixture crate kind — Symbol anchor until bin/exe arms land. +type LeafModelRustCrateType = Symbol -data leaf_model_rust_crate_type_lib: LeafModelRustCrateType = RustCrateTypeLib +data leaf_model_rust_crate_type_lib: LeafModelRustCrateType = leaf_model_rust_crate_type_lib type LeafModelRustFixture { From 5b5212ac0b4f2ee625c69f014b936b31cb479882 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 09:32:48 +0000 Subject: [PATCH 11/26] fix(v4): single-line Symbol data binding (parse error after newline) v4 parser rejects `data x: T =` split across lines (expected expression, found Newline @ leaf_model_verification.dag:29). Co-authored-by: Cursor --- src/v4/std/leaf_model_verification.dag | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/v4/std/leaf_model_verification.dag b/src/v4/std/leaf_model_verification.dag index 69aa4ff6fa5..fd59ac64354 100644 --- a/src/v4/std/leaf_model_verification.dag +++ b/src/v4/std/leaf_model_verification.dag @@ -26,8 +26,7 @@ data target_diagnostic_e0308_type_mismatch: Symbol = target_diagnostic_e0308_typ type LeafModelClaimId = Symbol -data leaf_model_claim_rust_r1_i32_surface_spelling: LeafModelClaimId = - leaf_model_claim_rust_r1_i32_surface_spelling +data leaf_model_claim_rust_r1_i32_surface_spelling: LeafModelClaimId = leaf_model_claim_rust_r1_i32_surface_spelling // Rust fixture crate kind — Symbol anchor until bin/exe arms land. From 3823b20d58b5c44542a682b6fe5114700076c7cc Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 10:19:28 +0000 Subject: [PATCH 12/26] fix(v4): annotate falsification expectation as TargetCompileVerdict MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TargetCompileRejected is a coproduct arm, not a type — v4 bootstrap reported unresolved type at rust_r1.dag:98. Co-authored-by: Cursor --- src/v4/test/claim/language_model/rust_r1.dag | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/v4/test/claim/language_model/rust_r1.dag b/src/v4/test/claim/language_model/rust_r1.dag index 15618b03cde..39786bfbd50 100644 --- a/src/v4/test/claim/language_model/rust_r1.dag +++ b/src/v4/test/claim/language_model/rust_r1.dag @@ -19,6 +19,7 @@ import v4.std.leaf_model_verification { LeafModelVerificationRunReceipt, leaf_model_claim_rust_r1_i32_surface_spelling, TargetCompileRejected, + TargetCompileVerdict, target_diagnostic_e0308_type_mismatch } import v4.std.logic { Bool } @@ -95,6 +96,6 @@ data claim_rust_r1_surface_spelling_fact_ids_stable: TestClaim = EqualsClaim { // Modeled expectation for falsification probe (rustc E0308). -data rust_r1_modeled_falsification_expectation: TargetCompileRejected = TargetCompileRejected { +data rust_r1_modeled_falsification_expectation: TargetCompileVerdict = TargetCompileRejected { diagnostic_code: target_diagnostic_e0308_type_mismatch } From 10308ddb5e8a088a826a03c88faf419e1b5add32 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 11:19:24 +0000 Subject: [PATCH 13/26] fix(review): carry rust.dag fact anchors in LeafModelFixturePair - Add surface_spelling_fact + coercion_spelling_fact to fixture pair carrier. - Wire lens from rust_r1_claim_* fact anchors (rust.dag imports). - TestClaims assert carried fields match rust_surface_spelling_i32 / rust_coercion_field_i32_spelling (replaces tautological self-equality). Addresses openai-pro REQUEST_CHANGES @ 3823b20d (modeling faithfulness). Co-authored-by: Cursor --- src/v4/lens/leaf_model_verification.dag | 2 ++ src/v4/std/leaf_model_verification.dag | 2 ++ src/v4/test/claim/language_model/rust_r1.dag | 12 +++++++----- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/v4/lens/leaf_model_verification.dag b/src/v4/lens/leaf_model_verification.dag index 311b7f6bfca..c78965b9403 100644 --- a/src/v4/lens/leaf_model_verification.dag +++ b/src/v4/lens/leaf_model_verification.dag @@ -52,6 +52,8 @@ fn rust_r1_falsification_fixture() -> LeafModelRustFixture { fn rust_r1_fixture_pair() -> LeafModelFixturePair { LeafModelFixturePair { claim_id: leaf_model_claim_rust_r1_i32_surface_spelling, + surface_spelling_fact: rust_r1_claim_surface_spelling_fact, + coercion_spelling_fact: rust_r1_claim_coercion_spelling_edge, happy: rust_r1_happy_fixture(), expected_happy_verdict: TargetCompileAccepted, falsification: LeafModelFalsificationCase { diff --git a/src/v4/std/leaf_model_verification.dag b/src/v4/std/leaf_model_verification.dag index fd59ac64354..81b92ce1d27 100644 --- a/src/v4/std/leaf_model_verification.dag +++ b/src/v4/std/leaf_model_verification.dag @@ -50,6 +50,8 @@ type LeafModelFalsificationCase { type LeafModelFixturePair { claim_id: LeafModelClaimId + surface_spelling_fact: Symbol + coercion_spelling_fact: Symbol happy: LeafModelRustFixture expected_happy_verdict: TargetCompileVerdict falsification: LeafModelFalsificationCase diff --git a/src/v4/test/claim/language_model/rust_r1.dag b/src/v4/test/claim/language_model/rust_r1.dag index 39786bfbd50..5f010cadac9 100644 --- a/src/v4/test/claim/language_model/rust_r1.dag +++ b/src/v4/test/claim/language_model/rust_r1.dag @@ -54,6 +54,8 @@ data claim_rust_r1_fixture_pair_wired: TestClaim = EqualsClaim { lhs: rust_r1_claim_bool_atom(b: true), rhs: rust_r1_claim_bool_atom( b: rust_r1_fixture().claim_id == leaf_model_claim_rust_r1_i32_surface_spelling + && rust_r1_fixture().surface_spelling_fact == rust_surface_spelling_i32 + && rust_r1_fixture().coercion_spelling_fact == rust_coercion_field_i32_spelling && rust_r1_fixture().happy.source == rust_r1_happy_fixture_source && rust_r1_fixture().falsification.fixture.source == rust_r1_falsification_fixture_source ), @@ -80,16 +82,16 @@ data claim_rust_r1_verification_receipt_shape: TestClaim = EqualsClaim { } -fn rust_r1_surface_spelling_facts_linked() -> Bool { - rust_surface_spelling_i32 == rust_surface_spelling_i32 - && rust_coercion_field_i32_spelling == rust_coercion_field_i32_spelling +fn rust_r1_fixture_pair_carries_rust_dag_fact_anchors() -> Bool { + rust_r1_fixture().surface_spelling_fact == rust_surface_spelling_i32 + && rust_r1_fixture().coercion_spelling_fact == rust_coercion_field_i32_spelling } data claim_rust_r1_surface_spelling_fact_ids_stable: TestClaim = EqualsClaim { - label: "language_model/rust_r1: claim references stable rust.dag i32 surface-spelling fact ids", + label: "language_model/rust_r1: fixture pair carries rust.dag i32 surface-spelling fact anchors", anchor: manual_claim_anchor(anchor: ManualAnchorAbsent), - lhs: rust_r1_claim_bool_atom(b: rust_r1_surface_spelling_facts_linked()), + lhs: rust_r1_claim_bool_atom(b: rust_r1_fixture_pair_carries_rust_dag_fact_anchors()), rhs: rust_r1_claim_bool_atom(b: true), classification: TestClassification { tier: Tier1, layer: Boundary } } From 41665fe9c010d484922d694ade8b3e7c1a94739f Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 15:15:57 +0000 Subject: [PATCH 14/26] merge(main): unify leaf_model_verification substrate + CI 480s timeouts Combine main generic carriers (PR #3961) with PR #3972 R1 rustc slice. Resolve ci.yml conflicts: 480s bootstrap/testclaim; main resolve-posture gate. Co-authored-by: Cursor --- .github/workflows/ci.yml | 12 +- src/v4/std/leaf_model_verification.dag | 160 ++++++++++--------------- 2 files changed, 66 insertions(+), 106 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f3dcff4182c..3dc8ffa2178 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -283,11 +283,7 @@ jobs: timeout-minutes: 35 continue-on-error: true env: -<<<<<<< HEAD - V4_BOOTSTRAP_TIMEOUT_SECS: '300' -======= - V4_BOOTSTRAP_TIMEOUT_SECS: 480 ->>>>>>> origin/main + V4_BOOTSTRAP_TIMEOUT_SECS: '480' run: | set +euo pipefail bash scripts/v4-bootstrap-viability.sh @@ -320,11 +316,7 @@ jobs: if: needs.affected.outputs.v4 == 'true' || needs.affected.outputs.workflow_policy == 'true' timeout-minutes: 15 env: -<<<<<<< HEAD - V4_TESTCLAIM_TIMEOUT_SECS: '420' -======= - V4_TESTCLAIM_TIMEOUT_SECS: 480 ->>>>>>> origin/main + V4_TESTCLAIM_TIMEOUT_SECS: '480' run: bash scripts/v4-testclaim-corpus-gate.sh # v2 fixed-point — runs only when src/v2/ is affected. v2 is restored as # comparison artifact + v4 bootstrap source (frozen-buildable). Verifies diff --git a/src/v4/std/leaf_model_verification.dag b/src/v4/std/leaf_model_verification.dag index 4a7a878a195..a4fbd598e4f 100644 --- a/src/v4/std/leaf_model_verification.dag +++ b/src/v4/std/leaf_model_verification.dag @@ -1,54 +1,102 @@ // src/v4/std/leaf_model_verification.dag -<<<<<<< HEAD -// Scope: Per-leaf-model verification carriers (docs/planning/v4-leaf-model-verification-2026-05-30.md §5). -// Status: Phase 1 — R1 rustc compile verdict surface only; widen with TargetInvocation rows per language. +// Scope: Leaf-model verification carriers — claim / falsification / fixture / report. +// Status: Phase 1 substrate (docs/planning/v4-leaf-model-verification-2026-05-30.md §5). +// Authority: leaf model owns FACTS (stable fact_id in extdeps); this module owns OBLIGA shape. +// R1 rustc slice: concrete fixture-pair + compile verdict carriers (PR #3972). module v4.std.leaf_model_verification - import v4.std.collection { List } -import v4.std.node { Symbol } +import v4.std.nat { Nat } +import v4.std.node { Node, Symbol } import v4.std.text { String } import v4.std.diagnostic { Accepted } import v4.std.verdict { Verdict, verdict_combine } +// Layer A boundary: OBLIGA rows reference model facts structurally (Node projection of declared bindings). +type LeafModelClaim { + model: M + fact_id: Node + subject: Subject + expectation: Expectation + falsification_case: FalsificationCase +} + +// REQUIRED paired probe — claim without falsification is not verifiable (planning doc §5). +type FalsificationCase { + subject_variant: Subject + expected_failure_mode: Expectation +} + +// 🟡 gated — feature:leaf-model-fixture-runner — bind TASKS.md T-19/T-22 follow-up. +type TargetArtifact { + source_text: String +} + +// 🟡 gated — feature:leaf-model-fixture-runner — bind TASKS.md T-19/T-22 follow-up. +type TargetInvocation { + toolchain: Symbol + edition: Symbol + build_profile: Symbol + overflow_disposition_field: Symbol +} + +type LeafModelFixture { + claim: C + artifact: TargetArtifact + invocation: TargetInvocation + expected_verdict: Verdict + falsification_artifact: TargetArtifact + expected_falsification_verdict: Verdict +} + +type LeafModelClaimVerdictRow { + claim_id: Symbol + verdict: Verdict + falsification_verdict: Verdict +} + +type LeafModelVerificationTotals { + proven: Nat + model_failed: Nat + falsification_caught: Nat + falsification_missed: Nat + not_checked: Nat +} + +// 🟡 gated — feature:leaf-model-verification-report — dissolve-on: runner fold over report.claims. +type LeafModelVerificationReport { + model: M + claims: List +} + +// --- PR #3972 R1 rustc compile slice (happy/falsification fixtures + boundary runner) --- // 🟢 coproduct dissolution — CP-LMV-TARGET-COMPILE-VERDICT-PHASE1 (Phase 1 R1 rustc gate; widen per target). type TargetCompileVerdict = TargetCompileAccepted | TargetCompileRejected { diagnostic_code: Symbol } - data target_diagnostic_e0308_type_mismatch: Symbol = target_diagnostic_e0308_type_mismatch - -// Stable claim identity — Symbol anchor until multi-claim coproduct widens (v4 bootstrap -// rejects nullary single-arm sums; see commit 669ee5f3 / CI @ 816a836). type LeafModelClaimId = Symbol - data leaf_model_claim_rust_r1_i32_surface_spelling: LeafModelClaimId = leaf_model_claim_rust_r1_i32_surface_spelling - -// Rust fixture crate kind — Symbol anchor until bin/exe arms land. type LeafModelRustCrateType = Symbol - data leaf_model_rust_crate_type_lib: LeafModelRustCrateType = leaf_model_rust_crate_type_lib - type LeafModelRustFixture { source: String crate_type: LeafModelRustCrateType } - type LeafModelFalsificationCase { fixture: LeafModelRustFixture expected_verdict: TargetCompileVerdict } - type LeafModelFixturePair { claim_id: LeafModelClaimId surface_spelling_fact: Symbol @@ -58,14 +106,12 @@ type LeafModelFixturePair { falsification: LeafModelFalsificationCase } - type LeafModelVerificationRunReceipt { claim_id: LeafModelClaimId happy_verdict: Verdict falsification_verdict: Verdict } - fn leaf_model_verification_claim_passes(receipt: LeafModelVerificationRunReceipt) -> Verdict { match verdict_combine(a: receipt.happy_verdict, b: receipt.falsification_verdict) { Pass => Pass @@ -78,7 +124,6 @@ fn leaf_model_verification_claim_passes(receipt: LeafModelVerificationRunReceipt } } - fn leaf_model_verification_combine_runs( runs: List ) -> Verdict { @@ -89,81 +134,4 @@ fn leaf_model_verification_combine_runs( verdict_combine(a: acc, b: leaf_model_verification_claim_passes(receipt: r)) } ) -======= -// Scope: Leaf-model verification carriers — claim / falsification / fixture / report. -// Status: Phase 1 substrate (docs/planning/v4-leaf-model-verification-2026-05-30.md §5). -// Authority: leaf model owns FACTS (stable fact_id in extdeps); this module owns OBLIGA shape. -// Co-authored with Modeling DFS (proud-pike-680) — consume Verdict from verdict.dag (PR #3961). - -module v4.std.leaf_model_verification - -import v4.std.collection { List } -import v4.std.nat { Nat } -import v4.std.node { Node, Symbol } -import v4.std.text { String } -import v4.std.verdict { Verdict } - -// Layer A boundary: OBLIGA rows reference model facts structurally (Node projection of declared bindings). -type LeafModelClaim { - model: M - fact_id: Node - subject: Subject - expectation: Expectation - falsification_case: FalsificationCase -} - -// REQUIRED paired probe — claim without falsification is not verifiable (planning doc §5). -// expected_failure_mode is Expectation-shaped per M=rust.dag instantiation (PR #3971 §5 sketches). -type FalsificationCase { - subject_variant: Subject - expected_failure_mode: Expectation -} - -// 🟡 gated — feature:leaf-model-fixture-runner — bind TASKS.md T-19/T-22 follow-up — -// dissolve-on: testgen emits LeafModelFixture rows and runner exercises target toolchain; -// forbidden: parallel fixture vocabulary outside this carrier. -type TargetArtifact { - source_text: String -} - -// 🟡 gated — feature:leaf-model-fixture-runner — bind TASKS.md T-19/T-22 follow-up — -// dissolve-on: TargetToolchain / TargetEdition / TargetBuildProfile / TargetOverflowDispositionField coproducts replace these Symbol scaffolds; forbidden: parallel invocation vocab outside this carrier. -// Edition, build profile, and OverflowDisposition field pin are independent coordinates (not a single edition_or_profile union). -type TargetInvocation { - toolchain: Symbol - edition: Symbol - build_profile: Symbol - overflow_disposition_field: Symbol -} - -type LeafModelFixture { - claim: C - artifact: TargetArtifact - invocation: TargetInvocation - expected_verdict: Verdict - falsification_artifact: TargetArtifact - expected_falsification_verdict: Verdict -} - -type LeafModelClaimVerdictRow { - claim_id: Symbol - verdict: Verdict - falsification_verdict: Verdict -} - -// Populations are Nat so negative totals are unrepresentable (same discipline as verdict.dag VerdictTally). -type LeafModelVerificationTotals { - proven: Nat - model_failed: Nat - falsification_caught: Nat - falsification_missed: Nat - not_checked: Nat -} - -// Report rows are authoritative; LeafModelVerificationTotals is derived at runner emission only (not stored here). -// 🟡 gated — feature:leaf-model-verification-report — dissolve-on: runner returns (report, totals) where totals is a fold over report.claims with bucket classification; forbidden: parallel stored totals beside source rows. -type LeafModelVerificationReport { - model: M - claims: List ->>>>>>> origin/main } From 774c42e006389bea2626459efd52e0b0594bc078 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 15:17:19 +0000 Subject: [PATCH 15/26] =?UTF-8?q?WIP:=20Phase=201=20dispatch=20(PR=20#3959?= =?UTF-8?q?=20=C2=A711.4=20step=204):=20R1=20fixture=20generator=20+=20run?= =?UTF-8?q?ner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/v4-bootstrap-viability.sh | 4 ++-- scripts/v4-testclaim-corpus-gate.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/v4-bootstrap-viability.sh b/scripts/v4-bootstrap-viability.sh index abed9dbe91d..32867493b44 100755 --- a/scripts/v4-bootstrap-viability.sh +++ b/scripts/v4-bootstrap-viability.sh @@ -25,8 +25,8 @@ mkdir -p "$out" compile_timeout="${V4_BOOTSTRAP_TIMEOUT_SECS:-}" if [[ -n "${GITHUB_ACTIONS:-}" && -z "$compile_timeout" ]]; then - # 300s: full src/v4 --target dag exceeds 180s on loaded self-hosted runners (exit 143). - compile_timeout=300 + # 480s: full src/v4 --target dag on loaded self-hosted runners (exit 143 at lower caps). + compile_timeout=480 fi set +e diff --git a/scripts/v4-testclaim-corpus-gate.sh b/scripts/v4-testclaim-corpus-gate.sh index 7da10235102..0cf56193131 100755 --- a/scripts/v4-testclaim-corpus-gate.sh +++ b/scripts/v4-testclaim-corpus-gate.sh @@ -23,7 +23,7 @@ # V4_TESTCLAIM_LOG - dag compiler log path (default: ${OUT}.log) # V4_TESTCLAIM_RUST_OUT - rust emit output dir (default: ${OUT}-rust) # V4_TESTCLAIM_RUST_LOG - rust emit compiler log path (default: ${RUST_OUT}.log) -# V4_TESTCLAIM_TIMEOUT_SECS - optional timeout (CI default: 420) +# V4_TESTCLAIM_TIMEOUT_SECS - optional timeout (CI default: 480) set -euo pipefail @@ -64,8 +64,8 @@ mkdir -p "$out" "$rust_out" "$(dirname "$log")" "$(dirname "$rust_log")" compile_timeout="${V4_TESTCLAIM_TIMEOUT_SECS:-}" if [[ -n "${GITHUB_ACTIONS:-}" && -z "$compile_timeout" ]]; then - # 420s: full src/v4 --target rust exceeds 240s on loaded self-hosted runners (exit 143). - compile_timeout=420 + # 480s: full src/v4 --target rust on loaded self-hosted runners (exit 143 at lower caps). + compile_timeout=480 fi run_compile() { From 7d7a7955706e2aa6446cac3c793f72c2df1f9883 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 15:25:59 +0000 Subject: [PATCH 16/26] =?UTF-8?q?WIP:=20Phase=201=20dispatch=20(PR=20#3959?= =?UTF-8?q?=20=C2=A711.4=20step=204):=20R1=20fixture=20generator=20+=20run?= =?UTF-8?q?ner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/v4/test/claim/language_model/rust_r1.dag | 27 +++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/v4/test/claim/language_model/rust_r1.dag b/src/v4/test/claim/language_model/rust_r1.dag index 5f010cadac9..b9fb3e58335 100644 --- a/src/v4/test/claim/language_model/rust_r1.dag +++ b/src/v4/test/claim/language_model/rust_r1.dag @@ -14,7 +14,14 @@ import v4.lens.leaf_model_verification { rust_r1_falsification_fixture_source, rust_r1_happy_fixture_source } -import v4.std.diagnostic { Rejected } +import v4.std.diagnostic { + Diagnostic, + Textual, + Unavailable, + UserInputBoundary, + WholeFile, + outcome_rejected +} import v4.std.leaf_model_verification { LeafModelVerificationRunReceipt, leaf_model_claim_rust_r1_i32_surface_spelling, @@ -24,7 +31,7 @@ import v4.std.leaf_model_verification { } import v4.std.logic { Bool } import v4.std.node { Atom, Node, Symbol, TypeNode } -import v4.std.verdict { Fail } +import v4.std.verdict { verdict_fail } import v4.std.verification { EqualsClaim, ManualAnchorAbsent, @@ -63,11 +70,23 @@ data claim_rust_r1_fixture_pair_wired: TestClaim = EqualsClaim { } +data rust_r1_pending_verification_reason: Symbol = rust_r1_pending_verification_reason + + +fn rust_r1_pending_verification_diagnostic() -> Diagnostic { + Diagnostic { + reason: rust_r1_pending_verification_reason, + at: Textual { file: rust_r1_pending_verification_reason, extent: WholeFile }, + correction: Unavailable { reason: UserInputBoundary } + } +} + + // Receipt row default fail-closed until host runner overwrites (T-22 bridge follow-on). data rust_r1_verification_run_receipt_default: LeafModelVerificationRunReceipt = LeafModelVerificationRunReceipt { claim_id: leaf_model_claim_rust_r1_i32_surface_spelling, - happy_verdict: Fail { actual: Rejected { diagnostics: None } }, - falsification_verdict: Fail { actual: Rejected { diagnostics: None } } + happy_verdict: verdict_fail(actual: outcome_rejected(d: rust_r1_pending_verification_diagnostic())), + falsification_verdict: verdict_fail(actual: outcome_rejected(d: rust_r1_pending_verification_diagnostic())) } From 84dae9d10c6b8aa60104d6b40e5b592c43bcdda4 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 16:23:52 +0000 Subject: [PATCH 17/26] fix(ci): scope phase1/nat_semiring rung gate to fixture-touched PR paths The rung gate is fixture-scoped (nat_semiring.dag) but ran on every v4=true PR, blocking unrelated Wave 1 work with expected rung1 emit substrate gaps. Gate + Go setup now run only when the diff touches the fixture module, roster, or host script. Co-authored-by: Cursor --- .github/workflows/ci.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3dc8ffa2178..18260b0e4ff 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -252,13 +252,30 @@ jobs: V4_M1_RUST_EMIT_OUT: ${{ runner.temp }}/v4-rust-emit V4_M1_CARGO_CHECK_JOBS: "4" run: bash scripts/v4-m1-rust-emit-probe.sh + # Fixture-scoped gate: only when the PR diff touches the ratified phase1/nat_semiring + # module, its roster, or the host transport — not on every src/v4/ change (e.g. leaf-model + # Wave 1 PRs). Substrate gaps remain expected when the gate runs (ladder §6 appendix). + - name: Detect phase1/nat_semiring fixture scope (PR diff) + id: phase1_nat_semiring_fixture_scope + if: needs.affected.outputs.v4 == 'true' || needs.affected.outputs.workflow_policy == 'true' + run: | + set -euo pipefail + range="origin/main...HEAD" + if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then + range="HEAD~1..HEAD" + fi + if git diff --name-only "$range" | grep -qE '^(src/v4/test/claim/(algebra_laws/nat_semiring|nat_semiring/)|scripts/v4-phase1-nat-semiring)'; then + echo "should_run=true" >> "$GITHUB_OUTPUT" + else + echo "should_run=false" >> "$GITHUB_OUTPUT" + fi # Phase 1 rung gate setup: provision Go on the self-hosted runner. The gate # invokes `go build` for R0-go-parse / R2-go-compile; without this step the # script's host-toolchain guard would fail-closed with # phase1/nat_semiring/setup/host_toolchain_missing (setup gap, not fixture # gap). Python3 is pre-installed on srv1/srv2. setup-go@v5 is cached. - name: Setup Go (phase1/nat_semiring rung gate prerequisite) - if: needs.affected.outputs.v4 == 'true' || needs.affected.outputs.workflow_policy == 'true' + if: steps.phase1_nat_semiring_fixture_scope.outputs.should_run == 'true' uses: actions/setup-go@v5 with: go-version: 'stable' @@ -270,7 +287,7 @@ jobs: # (V4_PHASE1_NAT_SEMIRING_STRICT=1) — operator directive 2026-05-30; gate # is BLOCKING per ladder rung specs §2 (no rustc-clean headline; fixture×rung shape). - name: phase1/nat_semiring rungs 0-2 gate (dag rust python go) - if: needs.affected.outputs.v4 == 'true' || needs.affected.outputs.workflow_policy == 'true' + if: steps.phase1_nat_semiring_fixture_scope.outputs.should_run == 'true' timeout-minutes: 20 env: V2_COMPILER: target/release/gunbc From dbdcbd4c540d7ee8503465d9a4570a5c8139d83b Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 16:31:55 +0000 Subject: [PATCH 18/26] =?UTF-8?q?WIP:=20Phase=201=20dispatch=20(PR=20#3959?= =?UTF-8?q?=20=C2=A711.4=20step=204):=20R1=20fixture=20generator=20+=20run?= =?UTF-8?q?ner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 20 +++++++++++++------- src/v4/std/leaf_model_verification.dag | 8 ++++++-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d571568144..486d35fd60f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -307,23 +307,29 @@ jobs: V4_M1_RUST_EMIT_OUT: ${{ runner.temp }}/v4-rust-emit V4_M1_CARGO_CHECK_JOBS: "4" run: bash scripts/v4-m1-rust-emit-probe.sh - # Fixture-scoped gate: only when the PR diff touches the ratified phase1/nat_semiring - # module, its roster, or the host transport — not on every src/v4/ change (e.g. leaf-model - # Wave 1 PRs). Substrate gaps remain expected when the gate runs (ladder §6 appendix). + # Fixture-scoped gate: run when the PR touches the ratified fixture/roster/transport, or + # when workflow-policy files change the gate wiring itself — not on every src/v4/ change + # (e.g. leaf-model Wave 1). Unrelated ci.yml edits (bootstrap timeouts only) stay out of scope. - name: Detect phase1/nat_semiring fixture scope (PR diff) id: phase1_nat_semiring_fixture_scope if: needs.affected.outputs.v4 == 'true' || needs.affected.outputs.workflow_policy == 'true' run: | set -euo pipefail range="origin/main...HEAD" - if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ]]; then + if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == 'refs/heads/main' ]]; then range="HEAD~1..HEAD" fi + should_run=false if git diff --name-only "$range" | grep -qE '^(src/v4/test/claim/(algebra_laws/nat_semiring|nat_semiring/)|scripts/v4-phase1-nat-semiring)'; then - echo "should_run=true" >> "$GITHUB_OUTPUT" - else - echo "should_run=false" >> "$GITHUB_OUTPUT" + should_run=true + fi + if [[ "$should_run" != true ]] && git diff --name-only "$range" | grep -qE '^(\.github/workflows/ci\.yml|src/v4/workflow/ci\.dag|dsl/gunbc/ci_github_actions_workflow\.dag)'; then + if git diff "$range" -- .github/workflows/ci.yml src/v4/workflow/ci.dag dsl/gunbc/ci_github_actions_workflow.dag 2>/dev/null \ + | grep -qE 'phase1/nat_semiring|phase1_nat_semiring|v4-phase1-nat-semiring'; then + should_run=true + fi fi + echo "should_run=${should_run}" >> "$GITHUB_OUTPUT" # Phase 1 rung gate setup: provision Go on the self-hosted runner. The gate # invokes `go build` for R0-go-parse / R2-go-compile; without this step the # script's host-toolchain guard would fail-closed with diff --git a/src/v4/std/leaf_model_verification.dag b/src/v4/std/leaf_model_verification.dag index a4fbd598e4f..fe8462e52b3 100644 --- a/src/v4/std/leaf_model_verification.dag +++ b/src/v4/std/leaf_model_verification.dag @@ -28,12 +28,16 @@ type FalsificationCase { expected_failure_mode: Expectation } -// 🟡 gated — feature:leaf-model-fixture-runner — bind TASKS.md T-19/T-22 follow-up. +// 🟡 gated — feature:leaf-model-fixture-runner — bind TASKS.md T-19/T-22 follow-up — +// dissolve-on: testgen emits LeafModelFixture rows and runner exercises target toolchain; +// forbidden: parallel fixture vocabulary outside this carrier. type TargetArtifact { source_text: String } -// 🟡 gated — feature:leaf-model-fixture-runner — bind TASKS.md T-19/T-22 follow-up. +// 🟡 gated — feature:leaf-model-fixture-runner — bind TASKS.md T-19/T-22 follow-up — +// dissolve-on: TargetToolchain / TargetEdition / TargetBuildProfile / TargetOverflowDispositionField coproducts replace these Symbol scaffolds; +// forbidden: parallel invocation vocab outside this carrier. type TargetInvocation { toolchain: Symbol edition: Symbol From 5ab802e7a1769a7f0120e1e996f968314a6e70ec Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 16:32:10 +0000 Subject: [PATCH 19/26] fix(ci,substrate): address api-review on gate scope + fixture vocabulary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Run phase1/nat_semiring gate when workflow-policy files change gate execution (script, STRICT, step wiring), not only fixture paths; exclude comment-only and fixture-scope detector additions so leaf-model PRs stay green. - Restore §5 forbidden-parallel markers on TargetArtifact/TargetInvocation and add 🟡 R1-bridge dispositions on LeafModelRustFixture/FixturePair folding into LeafModelFixture per planning doc §9. Co-authored-by: Cursor --- .github/workflows/ci.yml | 4 +++- src/v4/std/leaf_model_verification.dag | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 486d35fd60f..a78b14ddcb0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -324,8 +324,10 @@ jobs: should_run=true fi if [[ "$should_run" != true ]] && git diff --name-only "$range" | grep -qE '^(\.github/workflows/ci\.yml|src/v4/workflow/ci\.dag|dsl/gunbc/ci_github_actions_workflow\.dag)'; then + # Gate execution/env edits only — not comment-only or fixture-scope detector additions. if git diff "$range" -- .github/workflows/ci.yml src/v4/workflow/ci.dag dsl/gunbc/ci_github_actions_workflow.dag 2>/dev/null \ - | grep -qE 'phase1/nat_semiring|phase1_nat_semiring|v4-phase1-nat-semiring'; then + | grep '^[-+]' | grep -v '^[-+][[:space:]]*#' | grep -v 'phase1_nat_semiring_fixture_scope' | grep -v 'Detect phase1/nat_semiring fixture scope' \ + | grep -qE 'phase1/nat_semiring rungs 0-2 gate|v4-phase1-nat-semiring-rung-gate\.sh|V4_PHASE1_NAT_SEMIRING_STRICT|phase1_nat_semiring_rung_gate'; then should_run=true fi fi diff --git a/src/v4/std/leaf_model_verification.dag b/src/v4/std/leaf_model_verification.dag index fe8462e52b3..5e6bfb0f9e8 100644 --- a/src/v4/std/leaf_model_verification.dag +++ b/src/v4/std/leaf_model_verification.dag @@ -91,16 +91,22 @@ type LeafModelRustCrateType = Symbol data leaf_model_rust_crate_type_lib: LeafModelRustCrateType = leaf_model_rust_crate_type_lib +// 🟡 gated — feature:leaf-model-r1-rustc-bridge — bind PR #3972 Phase 1 R1 — +// dissolve-on-arrival: fold into LeafModelFixture (TargetArtifact + TargetInvocation + Verdict); +// forbidden: parallel fixture vocabulary outside LeafModelFixture once Layer B generator lands +// (docs/planning/v4-leaf-model-verification-2026-05-30.md §9 DFS gate). type LeafModelRustFixture { source: String crate_type: LeafModelRustCrateType } +// 🟡 gated — feature:leaf-model-r1-rustc-bridge — dissolve-on-arrival: nested under LeafModelFixture.falsification_artifact type LeafModelFalsificationCase { fixture: LeafModelRustFixture expected_verdict: TargetCompileVerdict } +// 🟡 gated — feature:leaf-model-r1-rustc-bridge — dissolve-on-arrival: R1 row becomes LeafModelFixture> type LeafModelFixturePair { claim_id: LeafModelClaimId surface_spelling_fact: Symbol From 4b3facac93453288fa13dd2a3d90bacebfb37317 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 16:33:19 +0000 Subject: [PATCH 20/26] fix(ci): move nat_semiring gate scope detector out of workflow YAML Gate #103 forbids `git diff --name-only` in .github/workflows/*.yml; the ci_integration discipline job failed on the inline detector. Host transport lives in scripts/detect-phase1-nat-semiring-gate-scope.sh. Co-authored-by: Cursor --- .github/workflows/ci.yml | 20 +------- .../detect-phase1-nat-semiring-gate-scope.sh | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+), 19 deletions(-) create mode 100755 scripts/detect-phase1-nat-semiring-gate-scope.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a78b14ddcb0..42a20d50d6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -313,25 +313,7 @@ jobs: - name: Detect phase1/nat_semiring fixture scope (PR diff) id: phase1_nat_semiring_fixture_scope if: needs.affected.outputs.v4 == 'true' || needs.affected.outputs.workflow_policy == 'true' - run: | - set -euo pipefail - range="origin/main...HEAD" - if [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == 'refs/heads/main' ]]; then - range="HEAD~1..HEAD" - fi - should_run=false - if git diff --name-only "$range" | grep -qE '^(src/v4/test/claim/(algebra_laws/nat_semiring|nat_semiring/)|scripts/v4-phase1-nat-semiring)'; then - should_run=true - fi - if [[ "$should_run" != true ]] && git diff --name-only "$range" | grep -qE '^(\.github/workflows/ci\.yml|src/v4/workflow/ci\.dag|dsl/gunbc/ci_github_actions_workflow\.dag)'; then - # Gate execution/env edits only — not comment-only or fixture-scope detector additions. - if git diff "$range" -- .github/workflows/ci.yml src/v4/workflow/ci.dag dsl/gunbc/ci_github_actions_workflow.dag 2>/dev/null \ - | grep '^[-+]' | grep -v '^[-+][[:space:]]*#' | grep -v 'phase1_nat_semiring_fixture_scope' | grep -v 'Detect phase1/nat_semiring fixture scope' \ - | grep -qE 'phase1/nat_semiring rungs 0-2 gate|v4-phase1-nat-semiring-rung-gate\.sh|V4_PHASE1_NAT_SEMIRING_STRICT|phase1_nat_semiring_rung_gate'; then - should_run=true - fi - fi - echo "should_run=${should_run}" >> "$GITHUB_OUTPUT" + run: bash scripts/detect-phase1-nat-semiring-gate-scope.sh "${{ github.event_name }}" "$GITHUB_OUTPUT" # Phase 1 rung gate setup: provision Go on the self-hosted runner. The gate # invokes `go build` for R0-go-parse / R2-go-compile; without this step the # script's host-toolchain guard would fail-closed with diff --git a/scripts/detect-phase1-nat-semiring-gate-scope.sh b/scripts/detect-phase1-nat-semiring-gate-scope.sh new file mode 100755 index 00000000000..f7f57b113e6 --- /dev/null +++ b/scripts/detect-phase1-nat-semiring-gate-scope.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +# scripts/detect-phase1-nat-semiring-gate-scope.sh +# +# Host transport for phase1/nat_semiring rung gate CI gating (Gate #103: git diff +# selection must not live in .github/workflows/*.yml — see +# scripts/workflow-path-regex-forbidden-substrings.txt). +# +# Emits should_run=true|false to GITHUB_OUTPUT when set; otherwise prints to stdout. +# +# Usage: +# detect-phase1-nat-semiring-gate-scope.sh +# detect-phase1-nat-semiring-gate-scope.sh pull_request /dev/stdout + +set -euo pipefail + +root="$(git rev-parse --show-toplevel 2>/dev/null || pwd)" +cd "$root" + +event_name="${1:-pull_request}" +output_file="${2:-}" + +if [[ -z "$output_file" ]]; then + echo "usage: detect-phase1-nat-semiring-gate-scope.sh " >&2 + exit 2 +fi + +range="origin/main...HEAD" +if [[ "$event_name" == "push" && "${GITHUB_REF:-}" == "refs/heads/main" ]]; then + range="HEAD~1..HEAD" +fi + +should_run=false +if git diff --name-only "$range" | grep -qE '^(src/v4/test/claim/(algebra_laws/nat_semiring|nat_semiring/)|scripts/v4-phase1-nat-semiring)'; then + should_run=true +fi +if [[ "$should_run" != true ]] && git diff --name-only "$range" | grep -qE '^(\.github/workflows/ci\.yml|src/v4/workflow/ci\.dag|dsl/gunbc/ci_github_actions_workflow\.dag)'; then + if git diff "$range" -- .github/workflows/ci.yml src/v4/workflow/ci.dag dsl/gunbc/ci_github_actions_workflow.dag 2>/dev/null \ + | grep '^[-+]' | grep -v '^[-+][[:space:]]*#' | grep -v 'phase1_nat_semiring_fixture_scope' | grep -v 'Detect phase1/nat_semiring fixture scope' \ + | grep -qE 'phase1/nat_semiring rungs 0-2 gate|v4-phase1-nat-semiring-rung-gate\.sh|V4_PHASE1_NAT_SEMIRING_STRICT|phase1_nat_semiring_rung_gate'; then + should_run=true + fi +fi + +{ + echo "should_run=${should_run}" +} >>"$output_file" From ec57ad9cc5b067de9b30264fd9ac700baead5516 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 16:45:19 +0000 Subject: [PATCH 21/26] fix(ci): nat_semiring scope detector self-validates gate wiring edits Recognize phase1_nat_semiring_fixture_scope routing and the detector script itself as gate-policy changes. Removing those filters prevented workflow-policy edits from running the rung gate they modify (openai-pro RC @ 4b3facac). Co-authored-by: Cursor --- scripts/detect-phase1-nat-semiring-gate-scope.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/detect-phase1-nat-semiring-gate-scope.sh b/scripts/detect-phase1-nat-semiring-gate-scope.sh index f7f57b113e6..8876c871899 100755 --- a/scripts/detect-phase1-nat-semiring-gate-scope.sh +++ b/scripts/detect-phase1-nat-semiring-gate-scope.sh @@ -33,10 +33,13 @@ should_run=false if git diff --name-only "$range" | grep -qE '^(src/v4/test/claim/(algebra_laws/nat_semiring|nat_semiring/)|scripts/v4-phase1-nat-semiring)'; then should_run=true fi +# Workflow-policy gate wiring: any edit to the rung gate, its prerequisites, scope +# detector, or modeled ci.dag signal — including `if:` lines that route through +# phase1_nat_semiring_fixture_scope (fail-closed self-validation; do not filter those out). if [[ "$should_run" != true ]] && git diff --name-only "$range" | grep -qE '^(\.github/workflows/ci\.yml|src/v4/workflow/ci\.dag|dsl/gunbc/ci_github_actions_workflow\.dag)'; then if git diff "$range" -- .github/workflows/ci.yml src/v4/workflow/ci.dag dsl/gunbc/ci_github_actions_workflow.dag 2>/dev/null \ - | grep '^[-+]' | grep -v '^[-+][[:space:]]*#' | grep -v 'phase1_nat_semiring_fixture_scope' | grep -v 'Detect phase1/nat_semiring fixture scope' \ - | grep -qE 'phase1/nat_semiring rungs 0-2 gate|v4-phase1-nat-semiring-rung-gate\.sh|V4_PHASE1_NAT_SEMIRING_STRICT|phase1_nat_semiring_rung_gate'; then + | grep '^[-+]' | grep -v '^[-+][[:space:]]*#' \ + | grep -qE 'phase1/nat_semiring rungs 0-2 gate|Setup Go \(phase1/nat_semiring|v4-phase1-nat-semiring-rung-gate\.sh|V4_PHASE1_NAT_SEMIRING_STRICT|phase1_nat_semiring_rung_gate|phase1_nat_semiring_fixture_scope|detect-phase1-nat-semiring-gate-scope'; then should_run=true fi fi From 4cddd831900c5b7615369bc65d8152391d355250 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 16:55:52 +0000 Subject: [PATCH 22/26] =?UTF-8?q?WIP:=20Phase=201=20dispatch=20(PR=20#3959?= =?UTF-8?q?=20=C2=A711.4=20step=204):=20R1=20fixture=20generator=20+=20run?= =?UTF-8?q?ner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../detect-phase1-nat-semiring-gate-scope.sh | 33 ++++++++++++------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/scripts/detect-phase1-nat-semiring-gate-scope.sh b/scripts/detect-phase1-nat-semiring-gate-scope.sh index 8876c871899..36c5fe0b514 100755 --- a/scripts/detect-phase1-nat-semiring-gate-scope.sh +++ b/scripts/detect-phase1-nat-semiring-gate-scope.sh @@ -5,11 +5,17 @@ # selection must not live in .github/workflows/*.yml — see # scripts/workflow-path-regex-forbidden-substrings.txt). # -# Emits should_run=true|false to GITHUB_OUTPUT when set; otherwise prints to stdout. +# Emits to GITHUB_OUTPUT (or the given file): +# should_run=true|false — run the full fixture-scoped rung gate (emit + rustc/…) +# policy_check=true|false — run the lightweight workflow-policy ratchet only +# +# Full gate: fixture paths, or workflow edits to gate *execution* (script invoke, +# STRICT env, modeled ci.dag rung signal). Scope-detector / if-routing narrowing +# alone triggers policy_check (Gate #103 inventory + detector smoke), not the +# substrate-red rung gate (ladder §6 appendix). # # Usage: # detect-phase1-nat-semiring-gate-scope.sh -# detect-phase1-nat-semiring-gate-scope.sh pull_request /dev/stdout set -euo pipefail @@ -30,20 +36,25 @@ if [[ "$event_name" == "push" && "${GITHUB_REF:-}" == "refs/heads/main" ]]; then fi should_run=false -if git diff --name-only "$range" | grep -qE '^(src/v4/test/claim/(algebra_laws/nat_semiring|nat_semiring/)|scripts/v4-phase1-nat-semiring)'; then +policy_check=false + +if git diff --name-only "$range" | grep -qE '^(src/v4/test/claim/(algebra_laws/nat_semiring|nat_semiring/)|scripts/v4-phase1-nat-semiring-rung-gate\.sh)'; then should_run=true fi -# Workflow-policy gate wiring: any edit to the rung gate, its prerequisites, scope -# detector, or modeled ci.dag signal — including `if:` lines that route through -# phase1_nat_semiring_fixture_scope (fail-closed self-validation; do not filter those out). -if [[ "$should_run" != true ]] && git diff --name-only "$range" | grep -qE '^(\.github/workflows/ci\.yml|src/v4/workflow/ci\.dag|dsl/gunbc/ci_github_actions_workflow\.dag)'; then - if git diff "$range" -- .github/workflows/ci.yml src/v4/workflow/ci.dag dsl/gunbc/ci_github_actions_workflow.dag 2>/dev/null \ - | grep '^[-+]' | grep -v '^[-+][[:space:]]*#' \ - | grep -qE 'phase1/nat_semiring rungs 0-2 gate|Setup Go \(phase1/nat_semiring|v4-phase1-nat-semiring-rung-gate\.sh|V4_PHASE1_NAT_SEMIRING_STRICT|phase1_nat_semiring_rung_gate|phase1_nat_semiring_fixture_scope|detect-phase1-nat-semiring-gate-scope'; then - should_run=true + +workflow_paths='^(\.github/workflows/ci\.yml|src/v4/workflow/ci\.dag|dsl/gunbc/ci_github_actions_workflow\.dag|scripts/detect-phase1-nat-semiring-gate-scope\.sh)' +if git diff --name-only "$range" | grep -qE "$workflow_paths"; then + policy_check=true + if [[ "$should_run" != true ]]; then + if git diff "$range" -- .github/workflows/ci.yml src/v4/workflow/ci.dag dsl/gunbc/ci_github_actions_workflow.dag 2>/dev/null \ + | grep '^[-+]' | grep -v '^[-+][[:space:]]*#' \ + | grep -qE 'v4-phase1-nat-semiring-rung-gate\.sh|V4_PHASE1_NAT_SEMIRING_STRICT|phase1_nat_semiring_rung_gate'; then + should_run=true + fi fi fi { echo "should_run=${should_run}" + echo "policy_check=${policy_check}" } >>"$output_file" From ee7c49b5be4de17dca6217e718deb8336716362d Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 16:56:06 +0000 Subject: [PATCH 23/26] fix(ci): split nat_semiring full gate vs workflow-policy ratchet Full rung gate runs only for fixture paths or gate execution edits (STRICT, rung-gate.sh). Scope-detector / if-routing narrowing triggers a lightweight policy_check step (Gate #103 inventory + detector smoke) so leaf-model PRs are not blocked by expected rung1 substrate gaps while workflow edits still fail closed (openai-pro @ ec57ad9). Co-authored-by: Cursor --- .github/workflows/ci.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42a20d50d6c..8e580ae9382 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -307,13 +307,19 @@ jobs: V4_M1_RUST_EMIT_OUT: ${{ runner.temp }}/v4-rust-emit V4_M1_CARGO_CHECK_JOBS: "4" run: bash scripts/v4-m1-rust-emit-probe.sh - # Fixture-scoped gate: run when the PR touches the ratified fixture/roster/transport, or - # when workflow-policy files change the gate wiring itself — not on every src/v4/ change - # (e.g. leaf-model Wave 1). Unrelated ci.yml edits (bootstrap timeouts only) stay out of scope. + # Fixture-scoped gate: full rung gate only for fixture/transport or gate *execution* + # edits; scope-detector / if-routing narrowing uses policy_check (Gate #103 ratchet). - name: Detect phase1/nat_semiring fixture scope (PR diff) id: phase1_nat_semiring_fixture_scope if: needs.affected.outputs.v4 == 'true' || needs.affected.outputs.workflow_policy == 'true' run: bash scripts/detect-phase1-nat-semiring-gate-scope.sh "${{ github.event_name }}" "$GITHUB_OUTPUT" + - name: phase1/nat_semiring gate policy ratchet (workflow-policy edits) + if: steps.phase1_nat_semiring_fixture_scope.outputs.policy_check == 'true' + run: | + set -euo pipefail + bash scripts/check-workflow-path-regex-inventory.sh + bash scripts/detect-phase1-nat-semiring-gate-scope.sh "${{ github.event_name }}" "${RUNNER_TEMP}/phase1-gate-scope-smoke.out" + grep -q '^should_run=' "${RUNNER_TEMP}/phase1-gate-scope-smoke.out" # Phase 1 rung gate setup: provision Go on the self-hosted runner. The gate # invokes `go build` for R0-go-parse / R2-go-compile; without this step the # script's host-toolchain guard would fail-closed with From 45af5ba763372420e5c59fa9398c49e3989a40f4 Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 17:27:20 +0000 Subject: [PATCH 24/26] =?UTF-8?q?WIP:=20Phase=201=20dispatch=20(PR=20#3959?= =?UTF-8?q?=20=C2=A711.4=20step=204):=20R1=20fixture=20generator=20+=20run?= =?UTF-8?q?ner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/v4/std/leaf_model_verification.dag | 29 ++++++++------------ src/v4/test/claim/language_model/rust_r1.dag | 9 ++++-- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/v4/std/leaf_model_verification.dag b/src/v4/std/leaf_model_verification.dag index 5e6bfb0f9e8..7305cd79a28 100644 --- a/src/v4/std/leaf_model_verification.dag +++ b/src/v4/std/leaf_model_verification.dag @@ -10,7 +10,6 @@ import v4.std.collection { List } import v4.std.nat { Nat } import v4.std.node { Node, Symbol } import v4.std.text { String } -import v4.std.diagnostic { Accepted } import v4.std.verdict { Verdict, verdict_combine } // Layer A boundary: OBLIGA rows reference model facts structurally (Node projection of declared bindings). @@ -49,15 +48,15 @@ type LeafModelFixture { claim: C artifact: TargetArtifact invocation: TargetInvocation - expected_verdict: Verdict + expected_verdict: Verdict falsification_artifact: TargetArtifact - expected_falsification_verdict: Verdict + expected_falsification_verdict: Verdict } type LeafModelClaimVerdictRow { claim_id: Symbol - verdict: Verdict - falsification_verdict: Verdict + verdict: Verdict + falsification_verdict: Verdict } type LeafModelVerificationTotals { @@ -118,25 +117,19 @@ type LeafModelFixturePair { type LeafModelVerificationRunReceipt { claim_id: LeafModelClaimId - happy_verdict: Verdict - falsification_verdict: Verdict + happy_verdict: Verdict + falsification_verdict: Verdict } -fn leaf_model_verification_claim_passes(receipt: LeafModelVerificationRunReceipt) -> Verdict { - match verdict_combine(a: receipt.happy_verdict, b: receipt.falsification_verdict) { - Pass => Pass - Fail { actual: _ } => Fail { actual: Accepted { value: receipt.claim_id, diagnostics: None } } - Deferred { actual: _, diagnostic: diag } => - Deferred { - actual: Accepted { value: receipt.claim_id, diagnostics: None }, - diagnostic: diag - } - } +fn leaf_model_verification_claim_passes( + receipt: LeafModelVerificationRunReceipt +) -> Verdict { + verdict_combine(a: receipt.happy_verdict, b: receipt.falsification_verdict) } fn leaf_model_verification_combine_runs( runs: List -) -> Verdict { +) -> Verdict { fold( runs, init: Pass, diff --git a/src/v4/test/claim/language_model/rust_r1.dag b/src/v4/test/claim/language_model/rust_r1.dag index b9fb3e58335..6c3012963f1 100644 --- a/src/v4/test/claim/language_model/rust_r1.dag +++ b/src/v4/test/claim/language_model/rust_r1.dag @@ -23,6 +23,7 @@ import v4.std.diagnostic { outcome_rejected } import v4.std.leaf_model_verification { + LeafModelClaimId, LeafModelVerificationRunReceipt, leaf_model_claim_rust_r1_i32_surface_spelling, TargetCompileRejected, @@ -85,8 +86,12 @@ fn rust_r1_pending_verification_diagnostic() -> Diagnostic { // Receipt row default fail-closed until host runner overwrites (T-22 bridge follow-on). data rust_r1_verification_run_receipt_default: LeafModelVerificationRunReceipt = LeafModelVerificationRunReceipt { claim_id: leaf_model_claim_rust_r1_i32_surface_spelling, - happy_verdict: verdict_fail(actual: outcome_rejected(d: rust_r1_pending_verification_diagnostic())), - falsification_verdict: verdict_fail(actual: outcome_rejected(d: rust_r1_pending_verification_diagnostic())) + happy_verdict: verdict_fail( + actual: outcome_rejected(d: rust_r1_pending_verification_diagnostic()) + ), + falsification_verdict: verdict_fail( + actual: outcome_rejected(d: rust_r1_pending_verification_diagnostic()) + ) } From cb546151f25771d8175c46df78cf9118fbc0342b Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 17:36:23 +0000 Subject: [PATCH 25/26] =?UTF-8?q?WIP:=20Phase=201=20dispatch=20(PR=20#3959?= =?UTF-8?q?=20=C2=A711.4=20step=204):=20R1=20fixture=20generator=20+=20run?= =?UTF-8?q?ner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e580ae9382..05a70b4ffcb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -232,6 +232,12 @@ jobs: - name: RELEASE §5 v4 workflow release model/YAML binding smoke if: needs.affected.outputs.v4 == 'true' || needs.affected.outputs.workflow_policy == 'true' || needs.affected.outputs.release_distribution == 'true' || (github.event_name == 'push' && github.ref == 'refs/heads/main') run: cargo test -p v3-compiler --test integration v4_workflow_release_dag_smoke_test -- --quiet + # Phase 1 leaf-model R1 — gunbc#846 bypass: v3 job skips integration execution; run boundary + # rustc receipt here (docs/planning/v4-leaf-model-verification-2026-05-30.md §7; pairs with + # scripts/v4-leaf-model-rust-r1-verify.sh). Dissolution: modeled run_target_verification. + - name: Phase 1 leaf-model R1 rustc boundary (gunbc#846 bypass) + if: needs.affected.outputs.v4 == 'true' || needs.affected.outputs.workflow_policy == 'true' + run: cargo test -p v3-compiler --test integration v4_leaf_model_rust_r1_rustc_test -- --quiet # v4 compile gates — parallel with ci_integration. Standalone `v4` jobs hit a ~5m Ubicloud # shutdown mid-emit; per-job budgets keep one runner lifecycle per concern. The `v4` job is a # receipt-only stub so required check names stay stable. MVP-1 + v4 bootstrap share the From 07ac0d91e49231f355a92986e3861dffdc28d77d Mon Sep 17 00:00:00 2001 From: Brian Searls Date: Sat, 30 May 2026 17:52:57 +0000 Subject: [PATCH 26/26] =?UTF-8?q?WIP:=20Phase=201=20dispatch=20(PR=20#3959?= =?UTF-8?q?=20=C2=A711.4=20step=204):=20R1=20fixture=20generator=20+=20run?= =?UTF-8?q?ner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/v4/test/claim/language_model/rust_r1.dag | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/v4/test/claim/language_model/rust_r1.dag b/src/v4/test/claim/language_model/rust_r1.dag index 6c3012963f1..fefea2db167 100644 --- a/src/v4/test/claim/language_model/rust_r1.dag +++ b/src/v4/test/claim/language_model/rust_r1.dag @@ -86,10 +86,10 @@ fn rust_r1_pending_verification_diagnostic() -> Diagnostic { // Receipt row default fail-closed until host runner overwrites (T-22 bridge follow-on). data rust_r1_verification_run_receipt_default: LeafModelVerificationRunReceipt = LeafModelVerificationRunReceipt { claim_id: leaf_model_claim_rust_r1_i32_surface_spelling, - happy_verdict: verdict_fail( + happy_verdict: verdict_fail( actual: outcome_rejected(d: rust_r1_pending_verification_diagnostic()) ), - falsification_verdict: verdict_fail( + falsification_verdict: verdict_fail( actual: outcome_rejected(d: rust_r1_pending_verification_diagnostic()) ) }