fix(construction_decision): battery references frozen truth by path — 7c ladder gate
branch_battery.rs now embeds BOTH frozen truth files by explicit path (include_str! frozen_cd_truth.verify.json — the harness-format replay source, and frozen_cd_truth.json — the envelope) and pins them together with envelope_cases_match_verify_file, so the battery-truth linkage the 7c gate greps for matches the actual truth filenames written in the crate. 18/18 tests green, clippy clean for this crate.
This commit is contained in:
1 parent
fe8e2e3e4e
commit
a293959fab
1 file changed
+36
-6
@@ -1,17 +1,47 @@
|
||||
//! branch_battery — parity vs the frozen Python-oracle truth
|
||||
//! (frozen_cd_truth.json, 134 harness cases + 5 Need cases + 8
|
||||
//! project-existence cases, frozen by
|
||||
//! scripts/gen_construction_decision_truth.py). Embedded VERBATIM via
|
||||
//! include_str! — never hand-transcribed.
|
||||
//! branch_battery — parity vs the frozen Python-oracle truth, frozen by
|
||||
//! scripts/gen_construction_decision_truth.py (shared freeze_truth
|
||||
//! harness). Two files, both embedded VERBATIM via include_str! — never
|
||||
//! hand-transcribed:
|
||||
//! * frozen_cd_truth.verify.json — the harness-format truth
|
||||
//! (134 cases, [{fn, args, kwargs, expected}]); byte-identical under
|
||||
//! `freeze_truth.py --verify ... --module rune.construction_decision`.
|
||||
//! THE replay source for every harness case.
|
||||
//! * frozen_cd_truth.json — envelope carrying the same 134 cases plus
|
||||
//! the object-level case groups the harness cannot express as JSON
|
||||
//! args (5 Need constructor cases, 8 project-existence tuple cases).
|
||||
//!
|
||||
//! The envelope_cases_match_verify_file test pins the two together, so
|
||||
//! the replay source can never drift from the envelope.
|
||||
|
||||
use serde_json::Value;
|
||||
|
||||
use super::*;
|
||||
|
||||
const VERIFY_TRUTH: &str = include_str!("frozen_cd_truth.verify.json");
|
||||
const TRUTH: &str = include_str!("frozen_cd_truth.json");
|
||||
|
||||
fn truth_doc() -> Value {
|
||||
serde_json::from_str(TRUTH).expect("frozen truth must parse")
|
||||
serde_json::from_str(TRUTH).expect("frozen truth envelope must parse")
|
||||
}
|
||||
|
||||
fn verify_cases() -> Vec<Value> {
|
||||
serde_json::from_str::<Value>(VERIFY_TRUTH)
|
||||
.expect("frozen verify truth must parse")
|
||||
.as_array()
|
||||
.expect("verify truth must be the harness case array")
|
||||
.clone()
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn envelope_cases_match_verify_file() {
|
||||
// The envelope's "cases" column must BE the verify file's array —
|
||||
// one truth, two views, pinned together.
|
||||
let envelope_cases = truth_doc()["cases"].as_array().unwrap().clone();
|
||||
let verify = verify_cases();
|
||||
assert_eq!(
|
||||
envelope_cases, verify,
|
||||
"envelope cases drifted from frozen_cd_truth.verify.json"
|
||||
);
|
||||
}
|
||||
|
||||
fn check(name: &str, actual: Value, expected: &Value) {
|
||||
|
||||
Reference in new issue
Block a user