Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
fc7e7a7
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
1f05e4f
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
c3ec207
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
98b0907
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
5cd91d8
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
11c6483
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
1c61b8c
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
2eca141
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
87e36d4
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
9fa68bf
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
6cf334f
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
af6d25f
fix(v4): emit-vs-eval routes host input via subject.input.evaluator_i…
briansrls May 30, 2026
807a7dd
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
fc6e384
fix(v4): fail-closed host logical_run and split emit-vs-eval inputs
briansrls May 30, 2026
6140d69
docs(v4): restore verdict.dag ALGEBRA block and substrate law comments
briansrls May 30, 2026
a26c684
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
9e4b44e
docs(v4): W3 backlog note on nat_semiring rung3/4 gate discrimination
briansrls May 30, 2026
2b0d7b7
chore: apply cargo fmt (integration module order, emit_host_runner)
briansrls May 30, 2026
fa914cd
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
7e63cba
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
800a92f
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
d6e99d1
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
bb5ff4c
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
cf2df6b
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
43815da
fix(test): restore ASCII order in EXPECTED_HAND_AUTHORED_TEST
briansrls May 30, 2026
dcfaa28
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
dec01cc
fix(ci): add SG-0 PR-body append for +1 census path (PR #3958)
briansrls May 30, 2026
93de72c
fix(v4): thread deferred diagnostic at-node; document Rust receipt W3…
briansrls May 30, 2026
c181326
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
cf7ae84
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
1a4e020
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
80db736
fix(v4): address openai-pro review — ExecutionEvidence disposition + …
briansrls May 30, 2026
ed41893
chore: apply cargo fmt (emit_host_runner)
briansrls May 30, 2026
7df34f2
Merge remote-tracking branch 'origin/main' into session/keen-raven-29…
briansrls May 30, 2026
784711d
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
b22aee7
fix(v4): thread fixture inputs through emit_host_runner; single-absen…
briansrls May 30, 2026
8e33478
docs(v4): cite T-PB-B/W3 on emit_host_rust_authority_pin dissolution
briansrls May 30, 2026
c1bb45b
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
88249bb
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
0af43c0
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
a7a0955
fix(v4): address openai-pro blockers — deferred actual, empty roster …
briansrls May 30, 2026
184d21f
Merge remote-tracking branch 'origin/main' into session/keen-raven-29…
briansrls May 30, 2026
461d20d
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
a501ea3
fix(ci): restore fail-closed bootstrap and T-22 corpus gates
briansrls May 30, 2026
3c55146
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
4be92e9
chore: apply cargo fmt (emit_host_runner typed host outcomes)
briansrls May 30, 2026
2eb0ad8
fix(v4): HostLogicalRun success-only carrier (no nested Witness)
briansrls May 30, 2026
f00143e
WIP: W2 (Runtime/TestClaim): host harness for rung 4 on nat_semiring …
briansrls May 30, 2026
167755c
fix(v4): emit_host NonEmptyDiagnostics outcomes + parse-based harness
briansrls May 30, 2026
4d7350e
chore: apply cargo fmt (v4_emit_host_harness_test)
briansrls May 30, 2026
f8872a6
merge: origin/main into session/keen-raven-290-w2-emit-host
briansrls May 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,16 @@ jobs:
id: v4_bootstrap_compile
timeout-minutes: 35
continue-on-error: true
env:
V4_BOOTSTRAP_TIMEOUT_SECS: 480
run: |
set +euo pipefail
bash scripts/v4-bootstrap-viability.sh
ec=$?
echo "exitcode=${ec}" >> "$GITHUB_OUTPUT"
exit "${ec}"
- name: v2 → v4 bootstrap resolve-posture gate (CI emit-wall bridge)
if: needs.affected.outputs.v4 == 'true' && steps.v4_bootstrap_compile.outputs.exitcode != '0'
if: needs.affected.outputs.v4 == 'true' && (steps.v4_bootstrap_compile.outputs.exitcode == '124' || steps.v4_bootstrap_compile.outputs.exitcode == '143')
id: v4_bootstrap_resolve_posture
run: |
set -euo pipefail
Expand All @@ -313,7 +315,7 @@ jobs:
- name: 'T-22 TestClaim corpus structural bridge — manual .dag corpus'
if: needs.affected.outputs.v4 == 'true' || needs.affected.outputs.workflow_policy == 'true'
env:
V4_TESTCLAIM_TIMEOUT_SECS: 360
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
Expand Down
5 changes: 5 additions & 0 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ members = [
"src/v3/compiler",
"tools/gen_gunbc_ci_workflow_dag",
"tools/ci_affected_components",
"tools/emit_host_runner",
"src/v3/grounding_pilot",
"src/v3/grounding_engine",
"src/v3/grounding_lifetime",
Expand Down
3 changes: 3 additions & 0 deletions scripts/ci-merge/sg0-pr-body-append.3958.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SG-0 hand-path delta: +1

SG-0 pairing: (c) dispatch for P5(b) net +1 on `EXPECTED_HAND_AUTHORED_TEST` (`v4_emit_host_harness_test.rs`); concrete dispatch evidence: gunb-ai/gunbc#3958 (W2 host harness) → W3 wires `nat_semiring_rung34_runtime_value_rows` + `run_emit_host_rust` transport (dissolves `emit_host_transport_not_wired` and retires this probe). Lane cite: `_internal/ROADMAP_OPS.md` **T-PB-B** / `pb_rust_tests_outside_residual_zero`.
1 change: 1 addition & 0 deletions src/v3/compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ libc = { version = "0.2", default-features = false }
criterion = "0.5"
gen_gunbc_ci_workflow_dag = { path = "../../../tools/gen_gunbc_ci_workflow_dag" }
ci_affected_components = { path = "../../../tools/ci_affected_components" }
emit_host_runner = { path = "../../../tools/emit_host_runner" }
serde = { workspace = true }
serde_json = { workspace = true }
# T-V2 G-1 manifest ratchet: structured Cargo.toml walk (`toml` value parse).
Expand Down
2 changes: 2 additions & 0 deletions src/v3/compiler/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ mod v4_compiler_compile_public_terminal_smoke_test;
mod v4_compiler_emit_translate_smoke_test;
#[path = "integration/v4_compiler_parse_table_dag_smoke_test.rs"]
mod v4_compiler_parse_table_dag_smoke_test;
#[path = "integration/v4_emit_host_harness_test.rs"]
mod v4_emit_host_harness_test;
#[path = "integration/v4_extdeps_coordination_dag_smoke_test.rs"]
mod v4_extdeps_coordination_dag_smoke_test;
#[path = "integration/v4_extdeps_file_system_dag_smoke_test.rs"]
Expand Down
25 changes: 15 additions & 10 deletions src/v3/compiler/tests/integration/sg0_census_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -851,8 +851,6 @@ const EXPECTED_HAND_AUTHORED_TEST: &[&str] = &[
"src/v3/compiler/tests/integration/v2_oracle_no_remaining_test_consumers_test.rs",
// T-15: tokenize/parse smoke on `src/v4/bin/main.dag` + trampoline source anchors (see harness module docs).
"src/v3/compiler/tests/integration/v4_bin_main_dag_smoke_test.rs",
// T-15: bin/main.dag execution + bootstrap fixpt stage1==stage2 harness (`t_15_self_host_fixed_point`).
"src/v3/compiler/tests/integration/v4_t15_self_host_fixed_point_harness_test.rs",
// Wave-5-A / P3 commitment 6: validate_then_compile public terminal on 00_compile.dag.
"src/v3/compiler/tests/integration/v4_compiler_compile_public_terminal_smoke_test.rs",
// T-10 / Wave-3-B: tokenize/parse smoke on `06_translate.dag`, `05_emit.dag`, MVP-1 claim.
Expand All @@ -865,21 +863,24 @@ const EXPECTED_HAND_AUTHORED_TEST: &[&str] = &[
// T-7: parse-table memoization receipt (`02_parse.dag`, grammar_validation claim, ListTailResult).
// SG-0 + INVARIANTS §P5(b) receipt — row `v4_compiler_parse_table_dag_smoke_test.rs` in INVARIANTS.md.
"src/v3/compiler/tests/integration/v4_compiler_parse_table_dag_smoke_test.rs",
// W2 / T-38 rung-4 host harness: behavior-driven `tools/emit_host_runner` + `.dag` surface
// needles (`emit_host.dag`, `host_run.dag`, `test_claim_falsification.dag`).
// SG-0 + INVARIANTS §P5(b) receipt (+1 census path). Dissolves when W3 wires transport
// into `run_emit_host_rust` and rung-3/4 TestClaim rows replace hand-Rust probes.
"src/v3/compiler/tests/integration/v4_emit_host_harness_test.rs",
// T-4.8 coordination substrate: decomposed WireContractFacts + CoordinationBind shape,
// with WIRECONTRACT-OBLIGATION-TABLE-T4.8 per-effect obligation rows.
"src/v3/compiler/tests/integration/v4_extdeps_coordination_dag_smoke_test.rs",
// Wave-2-C2 / T-4.5: extdeps/file_system.dag pure resource model (Practice 11 companion).
"src/v3/compiler/tests/integration/v4_extdeps_file_system_dag_smoke_test.rs",
// T-4.16: `ConfigPatchRecord` / `config_patch_layer` consumer smoke on `black.dag`
// (zero diagnostics; `BlackConfigPatch` materializes `FieldPatch<T>` fields).
// SG-0 + INVARIANTS §P5(b) receipt.
"src/v3/compiler/tests/integration/v4_extdeps_formatters_black_dag_smoke_test.rs",
// T-4.8 coordination substrate: decomposed WireContractFacts + CoordinationBind shape,
// with WIRECONTRACT-OBLIGATION-TABLE-T4.8 per-effect obligation rows.
"src/v3/compiler/tests/integration/v4_extdeps_coordination_dag_smoke_test.rs",
// T-4.7 React framework substrate: `compile_to_dag` smoke on
// `src/v4/extdeps/frameworks/react.dag` (zero module diagnostics).
// SG-0 ratchet per INVARIANTS §P5(b) + typescript extdeps precedent.
"src/v3/compiler/tests/integration/v4_extdeps_react_dag_smoke_test.rs",
// T-16-A+ TaskManager omni fixture: compile_to_dag smoke + SQL DDL projection receipt.
"src/v3/compiler/tests/integration/v4_test_fixture_task_manager_demo_smoke_test.rs",
// T-21 IRT-1: incremental re-exec frontier (`src/v4/lens/affected_set.dag`);
// `re_exec_frontier_from_diff` + mechanical reverification claim; SG-0 + INVARIANTS §P5(b).
"src/v3/compiler/tests/integration/v4_lens_affected_set_dag_smoke_test.rs",
Expand All @@ -898,22 +899,26 @@ const EXPECTED_HAND_AUTHORED_TEST: &[&str] = &[
// `manual_test_claim_for_manual_anchor` in `src/v4/lens/testgen.dag`; `src/v4/std/verification.dag`
// for closed `TestClaim` schema only (no std present-key helper).
"src/v3/compiler/tests/integration/v4_lens_testgen_dag_smoke_test.rs",
// P9 single-owner: corpus scan for `fn llvm_instruction_cost` under src/v4/ (replaces dissolved
// v4_lens_cost_dag_smoke_test.rs ratchet). SG-0 + INVARIANTS §P5(b) receipt.
"src/v3/compiler/tests/integration/v4_p9_llvm_instruction_cost_single_owner_test.rs",
// T-33: parse ratchet on `src/v4/std/model_core.dag` — Ratified Q1 ModelCore carrier.
// SG-0 + INVARIANTS §P5(b) receipt — row `v4_std_model_core_dag_smoke_test.rs` in INVARIANTS.md.
"src/v3/compiler/tests/integration/v4_std_model_core_dag_smoke_test.rs",
// T-15: bin/main.dag execution + bootstrap fixpt stage1==stage2 harness (`t_15_self_host_fixed_point`).
"src/v3/compiler/tests/integration/v4_t15_self_host_fixed_point_harness_test.rs",
// T-19/T-20 closeout ratchets over v4 testgen + bootstrap-infra parse surfaces.
// SG-0 + INVARIANTS §P5(b) receipt; dissolves when the same checks are `.dag`
// TestClaims or generated harness coverage.
"src/v3/compiler/tests/integration/v4_test_bootstrap_infra_closeout_test.rs",
// T-16-A+ TaskManager omni fixture: compile_to_dag smoke + SQL DDL projection receipt.
"src/v3/compiler/tests/integration/v4_test_fixture_task_manager_demo_smoke_test.rs",
// T-21/T-24: `workflow/ci.dag` Wave-0 selection consumes `RerunNodeSet` for TestClaim roster narrowing.
// SG-0 + INVARIANTS §P5(b) receipt; dissolves when `.dag` TestClaim harness replaces probe.
"src/v3/compiler/tests/integration/v4_workflow_ci_runner_dag_smoke_test.rs",
// RELEASE_TODO §5 Phase 1a: `workflow/release.dag` + hand-synced release.yml (install.dag Phase 1b).
// SG-0 + INVARIANTS §P5(b) receipt; dissolves when YamlStatic emission replaces host probes.
"src/v3/compiler/tests/integration/v4_workflow_release_dag_smoke_test.rs",
// P9 single-owner: corpus scan for `fn llvm_instruction_cost` under src/v4/ (replaces dissolved
// v4_lens_cost_dag_smoke_test.rs ratchet). SG-0 + INVARIANTS §P5(b) receipt.
"src/v3/compiler/tests/integration/v4_p9_llvm_instruction_cost_single_owner_test.rs",
// §1.8 gate #96 (`value_body_substrate_mirror_isomorphism_executable`):
// CI-visible generated Rust `ValueBody` mirror vs `substrate.dag`
// constructor isomorphism. Dissolves when `ValueBody` no longer has a
Expand Down
221 changes: 221 additions & 0 deletions src/v3/compiler/tests/integration/v4_emit_host_harness_test.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
//! **Layer:** integration
//!
//! **W2 / joint spec** `compiler-spine-runtime-rung34-min-runner-interface-2026-05-30.md` §4.2:
//! emit-host harness substrate (`emit_host.dag`, `host_run.dag`, `test_claim_falsification.dag`,
//! `nat_semiring_rung34_eval.dag`) + executable boundary `tools/emit_host_runner`.
//!
//! **ROADMAP:** `ROADMAP.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`;
//! **TASKS.md** T-38 / rung-4 host receipt path.
//!
//! **PR receipt (P5 Mechanism (b)):** this harness + matching `EXPECTED_HAND_AUTHORED_TEST`
//! line in `sg0_census_test.rs` land in the same PR. **This PR (+1 census path):**
//! `v4_emit_host_harness_test.rs` — behavior-driven `run_emit_host_rust` (compile + run fixture,
//! `HostExit` Holds witness + five-byte stdout parse) plus **tokenize/parse** surface receipts
//! for W2 `.dag` modules (not `str::contains` source probes per TESTING.md).
//!
//! **Dissolution trigger:** W3 populates `nat_semiring_rung34_runtime_value_rows`
//! and wires `run_emit_host_rust` in `emit_host.dag` to invoke `tools/emit_host_runner` (removes
//! `emit_host_transport_not_wired` on the Rust row); delete this file when rung-3/4 claims +
//! generated harness replace hand-Rust probes (see `nat_semiring_rung34_eval.dag` roster comment).
//!
//! **TESTING.md:** substrate `.dag` eval remains hermetic (`run_emit_host_rust` → `Rejected` until
//! W3/CI wiring); this test exercises the Rust transport the `.dag` row models, not substrate eval.

use v3_compiler::parse_for_test;
use v3_compiler::parse_surface::{SurfaceItem, SurfaceVariant};
use v3_compiler::tokenize_for_test;

const EMIT_HOST_DAG: &str = include_str!("../../../../v4/compiler/emit_host.dag");
const EMIT_HOST_PATH: &str = "src/v4/compiler/emit_host.dag";
const HOST_RUN_DAG: &str = include_str!("../../../../v4/std/host_run.dag");
const HOST_RUN_PATH: &str = "src/v4/std/host_run.dag";
const FALSIFICATION_DAG: &str = include_str!("../../../../v4/std/test_claim_falsification.dag");
const FALSIFICATION_PATH: &str = "src/v4/std/test_claim_falsification.dag";
const NAT_SEMIRING_RUNG34_EVAL_DAG: &str =
include_str!("../../../../v4/test/claim/workflow/nat_semiring_rung34_eval.dag");
const NAT_SEMIRING_RUNG34_EVAL_PATH: &str =
"src/v4/test/claim/workflow/nat_semiring_rung34_eval.dag";

/// Minimal fixture: five stdout bytes (MVP runtime value `5` alignment).
const EMIT_HOST_FIXTURE_SOURCE: &str =
"fn main() { let _ = std::io::Write::write_all(&mut std::io::stdout(), &[0u8; 5]); }";

fn parse_module(source: &str, path: &str) -> v3_compiler::parse_surface::SurfaceModule {
let tokens =
tokenize_for_test(source, path).unwrap_or_else(|e| panic!("{path}: tokenize: {e:?}"));
parse_for_test(&tokens, path).unwrap_or_else(|e| panic!("{path}: parse: {e:?}"))
}

fn surface_declares_fn(module: &v3_compiler::parse_surface::SurfaceModule, name: &str) -> bool {
module.items.iter().any(|item| match item {
SurfaceItem::Fn {
name: item_name, ..
}
| SurfaceItem::FnExternalBody {
name: item_name, ..
} => item_name == name,
_ => false,
})
}

fn surface_declares_type(module: &v3_compiler::parse_surface::SurfaceModule, name: &str) -> bool {
module.items.iter().any(|item| {
matches!(
item,
SurfaceItem::TypeSum { name: decl_name, .. }
| SurfaceItem::TypeRecord { name: decl_name, .. }
| SurfaceItem::TypeAlias { name: decl_name, .. }
| SurfaceItem::TypeAtom { name: decl_name, .. }
if decl_name == name
)
})
}

fn type_record_field_names(
module: &v3_compiler::parse_surface::SurfaceModule,
type_name: &str,
) -> Vec<String> {
module
.items
.iter()
.find_map(|item| match item {
SurfaceItem::TypeRecord { name, fields, .. } if name == type_name => Some(
fields
.iter()
.map(|field| field.name.clone())
.collect::<Vec<_>>(),
),
_ => None,
})
.unwrap_or_else(|| panic!("{type_name}: missing type record"))
}

fn type_sum_variant<'a>(
module: &'a v3_compiler::parse_surface::SurfaceModule,
type_name: &str,
variant_name: &str,
) -> &'a SurfaceVariant {
module
.items
.iter()
.find_map(|item| match item {
SurfaceItem::TypeSum { name, variants, .. } if name == type_name => {
variants.iter().find(|variant| variant.name == variant_name)
}
_ => None,
})
.unwrap_or_else(|| panic!("missing `{type_name}.{variant_name}` variant"))
}

#[test]
fn emit_host_runner_rust_row_builds_runs_and_parses_stdout() {
let work_dir = emit_host_runner::default_work_dir(&format!(
"gunbc_v4_emit_host_harness_{}",
std::process::id()
));
let inputs = emit_host_runner::EmitHostFixtureInputs {
claim_input_root: "w2_harness_claim_input".to_string(),
expected_eval_root: "w2_harness_expected_eval".to_string(),
};
let receipt =
emit_host_runner::run_emit_host_rust(EMIT_HOST_FIXTURE_SOURCE, &inputs, &work_dir)
.expect("run_emit_host_rust");
assert!(
receipt.exit.exit_holds(),
"expected successful host exit (Holds witness), got {:?}",
receipt.exit
);
assert!(
emit_host_runner::host_logical_run_from_exit(&receipt.exit, receipt.stdout_bytes.clone())
.is_some(),
"logical_run projection requires Holds exit"
);
emit_host_runner::runtime_value_parse_rust(&receipt.stdout_bytes)
.expect("runtime_value_parse_rust on fixture stdout");
}

#[test]
fn v4_host_run_dag_tokenizes_and_parses_logical_run_carrier() {
let module = parse_module(HOST_RUN_DAG, HOST_RUN_PATH);
assert!(
surface_declares_type(&module, "HostRunStdout"),
"{HOST_RUN_PATH}: HostRunStdout carrier"
);
assert!(
surface_declares_type(&module, "HostLogicalRun"),
"{HOST_RUN_PATH}: HostLogicalRun carrier"
);
assert_eq!(
type_record_field_names(&module, "HostLogicalRun"),
vec!["stdout".to_string()],
"{HOST_RUN_PATH}: success-only logical run (no nested Witness)"
);
assert!(
surface_declares_fn(&module, "host_logical_run_from_exit"),
"{HOST_RUN_PATH}: host_logical_run_from_exit"
);
}

#[test]
fn v4_falsification_dag_tokenizes_and_parses_execution_evidence() {
let module = parse_module(FALSIFICATION_DAG, FALSIFICATION_PATH);
assert!(
surface_declares_type(&module, "FalsificationReceipt"),
"{FALSIFICATION_PATH}: FalsificationReceipt"
);
let receipt_fields = type_record_field_names(&module, "FalsificationReceipt");
assert!(
receipt_fields.contains(&"subject".to_string()),
"{FALSIFICATION_PATH}: FalsificationReceipt.subject"
);
for variant in ["Host", "Interpreter", "EvidenceNone"] {
let _ = type_sum_variant(&module, "ExecutionEvidence", variant);
}
}

#[test]
fn v4_emit_host_dag_tokenizes_and_parses_fail_closed_surface() {
let module = parse_module(EMIT_HOST_DAG, EMIT_HOST_PATH);
for name in [
"run_emit_host_rust",
"run_emit_host",
"host_exit_failure_outcome",
"run_test_claim_emit_vs_eval_for_claim",
"run_test_claim_emit_vs_eval",
] {
assert!(
surface_declares_fn(&module, name),
"{EMIT_HOST_PATH}: missing fn {name}"
);
}
assert!(
module.items.iter().any(|item| matches!(
item,
SurfaceItem::Data { name, .. } if name == "emit_host_transport_not_wired"
)),
"{EMIT_HOST_PATH}: transport_not_wired symbol"
);
}

#[test]
fn v4_nat_semiring_rung_gate_dag_tokenizes_and_parses_empty_roster_gates() {
let module = parse_module(NAT_SEMIRING_RUNG34_EVAL_DAG, NAT_SEMIRING_RUNG34_EVAL_PATH);
for name in [
"nat_semiring_rung34_report_has_evidence",
"nat_semiring_rung3_gate",
"nat_semiring_rung4_gate",
"run_nat_semiring_rung34_eval",
] {
assert!(
surface_declares_fn(&module, name),
"{NAT_SEMIRING_RUNG34_EVAL_PATH}: missing fn {name}"
);
}
assert!(
module.items.iter().any(|item| matches!(
item,
SurfaceItem::Data { name, .. } if name == "nat_semiring_rung34_runtime_value_rows"
)),
"{NAT_SEMIRING_RUNG34_EVAL_PATH}: empty runtime roster"
);
}
Loading
Loading