Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions scripts/ci-merge/sg0-pr-body-append.4079.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SG-0 hand-path delta: +0

SG-0 pairing: (c) Net +0 on `EXPECTED_HAND_AUTHORED_TEST` — same-path expansion of `v4_emit_host_harness_test.rs` (INVARIANTS §P5(b) parse/tokenize receipt for `branch_dispatch/rung_8.dag` + `branch_dispatch_rung8_eval.dag`; mirrors landed #4064 nat_semiring rung-8 pattern). Deferral: `_internal/ROADMAP_OPS.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`; dissolve when branch_dispatch complete roster executes from `.dag` eval only (W3.6 / P5-C) without this host harness probe — gunb-ai/gunbc#4079.
66 changes: 66 additions & 0 deletions src/v3/compiler/tests/integration/v4_emit_host_harness_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ const NAT_SEMIRING_RUNG_8_PATH: &str = "src/v4/test/claim/nat_semiring/rung_8.da
const NAT_SEMIRING_RUNG8_EVAL_DAG: &str =
include_str!("../../../../v4/test/claim/workflow/nat_semiring_rung8_eval.dag");
const NAT_SEMIRING_RUNG8_EVAL_PATH: &str = "src/v4/test/claim/workflow/nat_semiring_rung8_eval.dag";
const BRANCH_DISPATCH_RUNG_8_DAG: &str =
include_str!("../../../../v4/test/claim/branch_dispatch/rung_8.dag");
const BRANCH_DISPATCH_RUNG_8_PATH: &str = "src/v4/test/claim/branch_dispatch/rung_8.dag";
const BRANCH_DISPATCH_RUNG8_EVAL_DAG: &str =
include_str!("../../../../v4/test/claim/workflow/branch_dispatch_rung8_eval.dag");
const BRANCH_DISPATCH_RUNG8_EVAL_PATH: &str =
"src/v4/test/claim/workflow/branch_dispatch_rung8_eval.dag";

/// Minimal python host fixture: five stdout bytes (MVP runtime value `5` alignment).
const EMIT_HOST_PYTHON_FIXTURE_SOURCE: &str = "import sys\nsys.stdout.buffer.write(b'\\x00' * 5)\n";
Expand Down Expand Up @@ -539,6 +546,65 @@ fn v4_nat_semiring_rung8_dag_tokenizes_and_parses_full_law_roster() {
);
}

#[test]
fn v4_branch_dispatch_rung8_dag_tokenizes_and_parses_full_fixture_roster() {
let rung_8 = parse_module(BRANCH_DISPATCH_RUNG_8_DAG, BRANCH_DISPATCH_RUNG_8_PATH);
for name in [
"run_claim_branch_dispatch_well_formed",
"run_claim_branch_dispatch_equals_refl",
"run_claim_branch_dispatch_content_hash_stable",
] {
assert!(
surface_declares_data(&rung_8, name),
"{BRANCH_DISPATCH_RUNG_8_PATH}: missing run row {name}"
);
}
assert!(
surface_declares_data(&rung_8, "phase4_branch_dispatch_rung8_runtime_value_rows"),
"{BRANCH_DISPATCH_RUNG_8_PATH}: runtime roster carrier (3 rows)"
);
assert!(
surface_declares_fn(&rung_8, "rung8_tier1_eval_run"),
"{BRANCH_DISPATCH_RUNG_8_PATH}: T-22 eval constructor must call run_test_claim"
);
assert!(
BRANCH_DISPATCH_RUNG_8_DAG.contains("run_test_claim("),
"{BRANCH_DISPATCH_RUNG_8_PATH}: roster rows must thread run_test_claim verdicts (not fabricated Pass)"
);

let eval_module = parse_module(
BRANCH_DISPATCH_RUNG8_EVAL_DAG,
BRANCH_DISPATCH_RUNG8_EVAL_PATH,
);
for name in [
"run_branch_dispatch_rung8_eval",
"branch_dispatch_rung8_gate",
"branch_dispatch_rung8_zero_deferred",
] {
assert!(
surface_declares_fn(&eval_module, name),
"{BRANCH_DISPATCH_RUNG8_EVAL_PATH}: missing fn {name}"
);
}
assert!(
surface_declares_data(&eval_module, "witness_branch_dispatch_rung8_gate_closed"),
"{BRANCH_DISPATCH_RUNG8_EVAL_PATH}: authoring-time F5 gate witness (data binding)"
);
assert!(
BRANCH_DISPATCH_RUNG8_EVAL_DAG
.contains("branch_dispatch_rung8_gate(report: run_branch_dispatch_rung8_eval())"),
"{BRANCH_DISPATCH_RUNG8_EVAL_PATH}: closed witness must consume full gate (non-empty roster + zero Deferred)"
);
assert!(
BRANCH_DISPATCH_RUNG8_EVAL_DAG.contains("phase4_branch_dispatch_rung8_runtime_value_rows"),
"{BRANCH_DISPATCH_RUNG8_EVAL_PATH}: CorpusEvalReport must consume rung-8 roster"
);
assert!(
BRANCH_DISPATCH_RUNG8_EVAL_DAG.contains("corpus_report_tally"),
"{BRANCH_DISPATCH_RUNG8_EVAL_PATH}: VerdictTally via corpus_report_tally"
);
}

#[test]
fn emit_host_runner_go_row_runs_and_parses_stdout() {
let work_dir = emit_host_runner::default_work_dir(&format!(
Expand Down
44 changes: 44 additions & 0 deletions src/v4/test/claim/branch_dispatch/rung_8.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// src/v4/test/claim/branch_dispatch/rung_8.dag
// Scope: phase4/branch_dispatch rung-8 TestClaimRun roster — full fixture claim corpus.
// Status: W3.6 — T-22 eval → TestClaimRun via run_test_claim (single authority for all claim kinds).

module v4.test.claim.branch_dispatch.rung_8


import v4.compiler.eval { TestClaimRun, run_test_claim, test_claim_input }
import v4.std.collection { List }
import v4.std.node { Node }
import v4.std.runtime { RuntimeValue }
import v4.std.verification { TestClaim }
import v4.test.claim.computation_shapes.branch_dispatch {
claim_branch_dispatch_content_hash_stable,
claim_branch_dispatch_equals_refl,
claim_branch_dispatch_well_formed
}
import v4.test.claim.rung_3_4_common { rung34_test_claim_subject }


fn rung8_tier1_eval_run(claim: TestClaim) -> TestClaimRun<Node, RuntimeValue> {
run_test_claim(
subject: rung34_test_claim_subject(
claim: claim,
evaluator_input: test_claim_input(c: claim)
)
)
}


data run_claim_branch_dispatch_well_formed: TestClaimRun<Node, RuntimeValue> = rung8_tier1_eval_run(claim: claim_branch_dispatch_well_formed)


data run_claim_branch_dispatch_equals_refl: TestClaimRun<Node, RuntimeValue> = rung8_tier1_eval_run(claim: claim_branch_dispatch_equals_refl)


data run_claim_branch_dispatch_content_hash_stable: TestClaimRun<Node, RuntimeValue> = rung8_tier1_eval_run(claim: claim_branch_dispatch_content_hash_stable)


data phase4_branch_dispatch_rung8_runtime_value_rows: List<TestClaimRun<Node, RuntimeValue>> = [
run_claim_branch_dispatch_well_formed,
run_claim_branch_dispatch_equals_refl,
run_claim_branch_dispatch_content_hash_stable
]
2 changes: 1 addition & 1 deletion src/v4/test/claim/computation_shapes/branch_dispatch.dag
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// src/v4/test/claim/computation_shapes/branch_dispatch.dag
// Scope: Phase 4 ladder fixture — well-formed Branch computation-node with positional arms.
// Status: T-14 corpus rows; execution deferred to T-22 runner bridge.
// Status: T-14 corpus rows; rung-8 execution wired in v4.test.claim.branch_dispatch.rung_8.
// Fixture id: phase4/branch_dispatch (docs/planning/v4-correctness-ladder-2026-05-30.md §7 Phase 4).
// Discovery: T-22 runner enumerates src/v4/test/claim/** recursively.

Expand Down
43 changes: 43 additions & 0 deletions src/v4/test/claim/workflow/branch_dispatch_rung8_eval.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// src/v4/test/claim/workflow/branch_dispatch_rung8_eval.dag
// Scope: W3.6 rung-8 corpus eval — phase4/branch_dispatch full fixture claim roster (3 rows).
// Status: T-22 eval → TestClaimRun → CorpusEvalReport → VerdictTally (zero Deferred acceptance).

module v4.test.claim.workflow.branch_dispatch_rung8_eval


import v4.std.algebra { is_empty }
import v4.std.logic { Bool }
import v4.std.nat { Zero }
import v4.test.claim.branch_dispatch.rung_8 { phase4_branch_dispatch_rung8_runtime_value_rows }
import v4.test.claim.workflow.testclaim_corpus_runner {
CorpusEvalReport,
corpus_entries_from_node_runtime_value_runs,
corpus_report_tally
}


fn run_branch_dispatch_rung8_eval() -> CorpusEvalReport {
CorpusEvalReport {
entries: corpus_entries_from_node_runtime_value_runs(
runs: phase4_branch_dispatch_rung8_runtime_value_rows
)
}
}


// F5 acceptance: non-empty roster and zero Deferred.
fn branch_dispatch_rung8_gate(report: CorpusEvalReport) -> Bool {
if is_empty(xs: report.entries) {
false
} else {
branch_dispatch_rung8_zero_deferred(report: report)
}
}


fn branch_dispatch_rung8_zero_deferred(report: CorpusEvalReport) -> Bool {
corpus_report_tally(r: report).deferred == Zero
}


data witness_branch_dispatch_rung8_gate_closed: Bool = branch_dispatch_rung8_gate(report: run_branch_dispatch_rung8_eval())
Loading