open-standards/wai/http-conformance/falsify/first-publisher.patch
Transaction Science ac602599d0 http receipts round 3: falsify the fixes
Patches (falsify/run.sh), each failing the corpus cases it names: bytes-unchecked,
decision-unchecked, recovery-record-unchecked, operating-point-unchecked,
session-accepted, declaration-unnamed, first-publisher, matchers-need-object and
set-sha-faults; claim-through-any-receipt, fetch-unmemoised,
fetch-budget-unchecked and file-cap-unchecked regenerated against the new
receipts.rs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-08 04:15:46 -04:00

15 lines
996 B
Diff

# must fail: receipts_ancestor_other_publisher_first
# a soft binding's recovery under the first publisher key held, not the one that signed it (receipts::check_claim)
diff --git a/wai/wai-rs/src/http_binding/receipts.rs b/wai/wai-rs/src/http_binding/receipts.rs
index 83cd7ccb..c7f1b0d5 100644
--- a/wai/wai-rs/src/http_binding/receipts.rs
+++ b/wai/wai-rs/src/http_binding/receipts.rs
@@ -728,7 +728,7 @@ pub fn check_claim(
let r = recovery.filter(|_| matches!(held, ObjectHeld::Object(_)))?;
let mut keys = r.publishers.iter().filter(|(h, _)| h == subject).map(|(_, k)| *k);
let first = keys.next()?;
- Some(if first == claim.signer_pubkey { first } else { keys.find(|k| *k == claim.signer_pubkey).unwrap_or(first) })
+ Some(if first == claim.signer_pubkey { first } else { keys.find(|k| *k == [0; 32]).unwrap_or(first) })
};
let attests = match claim.subject_type {
SubjectType::Object if claim.subject == *cid => Attests::Object,