open-standards/wai/http-conformance/falsify/no-root-flag.patch
Transaction Science 1cddbdad19 wai: http-conformance falsification patches and their runner
Twelve patches, each breaking one function (the content hash's domain, the
root flag, the left-subtree rule, the chunk counter, the component digest
check, the Content-Range and content-coding checks, the union, the trailing-
byte rule, the missing-digest plan, the class merge, the selection digest
test), each naming the cases that must fail. run.sh applies each to a fresh
worktree, requires the build, and requires verify to fail naming them; then
the Python mutations and the differential.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-05 07:52:43 -04:00

15 lines
713 B
Diff

# must fail: head_proof_ok_O3
# the root merge drops the ROOT flag (head_proof::merge_root)
diff --git a/wai/wai-rs/src/http_binding/head_proof.rs b/wai/wai-rs/src/http_binding/head_proof.rs
index 40b6f1fa..69ba8a98 100644
--- a/wai/wai-rs/src/http_binding/head_proof.rs
+++ b/wai/wai-rs/src/http_binding/head_proof.rs
@@ -40,7 +40,7 @@ fn left_len(n: u64) -> u64 {
/// The root of a tree from its two children: BLAKE3's parent node with the ROOT flag.
fn merge_root(l: &ChainingValue, r: &ChainingValue) -> [u8; 32] {
- *merge_subtrees_root(l, r, Mode::Hash).as_bytes()
+ merge_subtrees_non_root(l, r, Mode::Hash)
}
/// The non-root chaining value of the subtree `x[..len]` whose first chunk is at