prove: refute mutated program models and prove portable replay
- bounded witness candidates are now also tried when the proposition contains program-model calls that Rust cannot evaluate; Lean's decide is the authority, so a mutated model refutes only with a kernel-verified negation (M07) - e2e: model mutation refuted; bundle replayed from a different checkout path - full acceptance run: 11 passed, 0 failed, 271.39 s - STATUS updated with the final evidence
This commit is contained in:
1 parent
47e46320cc
commit
add8ccada1
3 files changed
+80
-16
No files matched your search
@@ -273,3 +273,59 @@ fn stale_bundle_is_rejected_after_a_source_change() {
|
||||
"{report}"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn mutated_program_model_is_refuted_not_verified() {
|
||||
let directory = work("model-mutation");
|
||||
let project = directory.join("project");
|
||||
std::fs::create_dir_all(&project).expect("project dir");
|
||||
for file in ["algebra.mq.md", "arithmetic.mq.md"] {
|
||||
std::fs::copy(repo().join("examples").join(file), project.join(file)).expect("copy");
|
||||
}
|
||||
let entry = project.join("arithmetic.mq.md");
|
||||
let source = std::fs::read_to_string(&entry).expect("read");
|
||||
std::fs::write(
|
||||
&entry,
|
||||
source.replace("`return x * x`", "`return x * x - 1`"),
|
||||
)
|
||||
.expect("mutate return");
|
||||
let (code, report) = check(&entry, &[]);
|
||||
assert_eq!(code, 1, "{report}");
|
||||
assert_eq!(report["targets"][0]["outcome"], "refuted", "{report}");
|
||||
assert_eq!(report["targets"][0]["scope"], "program_model");
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn bundle_replays_from_a_different_checkout_directory() {
|
||||
let first = work("clean-replay-a");
|
||||
let second = work("clean-replay-b");
|
||||
let bundle = first.join("bundle");
|
||||
for file in ["algebra.mq.md", "vector.mq.md"] {
|
||||
std::fs::copy(repo().join("examples").join(file), first.join(file)).expect("copy");
|
||||
}
|
||||
let (code, report) = check(
|
||||
&first.join("vector.mq.md"),
|
||||
&["--out", bundle.to_str().expect("utf8")],
|
||||
);
|
||||
assert_eq!(code, 0, "{report}");
|
||||
// A different absolute checkout path with identical source bytes.
|
||||
for file in ["algebra.mq.md", "vector.mq.md"] {
|
||||
std::fs::copy(repo().join("examples").join(file), second.join(file)).expect("copy");
|
||||
}
|
||||
let second_bundle = second.join("bundle");
|
||||
std::fs::create_dir_all(&second_bundle).expect("bundle dir");
|
||||
for file in ["manifest.json", "proof.ndjson"] {
|
||||
std::fs::copy(bundle.join(file), second_bundle.join(file)).expect("copy bundle");
|
||||
}
|
||||
let (code, replayed) = run(&[
|
||||
"replay",
|
||||
second.join("vector.mq.md").to_str().expect("utf8"),
|
||||
second_bundle.to_str().expect("utf8"),
|
||||
"--json",
|
||||
]);
|
||||
assert_eq!(code, 0, "{replayed}");
|
||||
assert_eq!(replayed["targets"][0]["outcome"], "verified", "{replayed}");
|
||||
assert_eq!(replayed["targets"][0]["freshness"], "current");
|
||||
}
|
||||
Reference in new issue
Block a user