Verify conflict-pack bytes against the claimed conflict-set identity. The pack is the canonical [`crate::repository::ConflictSetObject`] bytes (not a family bag): its identity is re-derived here so a forged or stale pack cannot ride alongside a binding commit. Conflict objects carry graph facts only — identities, base/sides, modes, claimants — so they may enter Git; provenance/attestation payload
(
bytes: &[u8],
claimed_hash: &atomic_core::Hash,
)
| 119 | /// facts only — identities, base/sides, modes, claimants — so they may enter |
| 120 | /// Git; provenance/attestation payloads still never do. |
| 121 | pub fn validate_conflicts_pack( |
| 122 | bytes: &[u8], |
| 123 | claimed_hash: &atomic_core::Hash, |
| 124 | ) -> Result<(), ConflictPackError> { |
| 125 | use atomic_core::types::Base32; |
| 126 | let actual = conflicts_pack_self_validates(bytes)?; |
| 127 | if actual != *claimed_hash { |
| 128 | return Err(ConflictPackError::HashMismatch { |
| 129 | claimed: claimed_hash.to_base32(), |
| 130 | actual: actual.to_base32(), |
| 131 | }); |
| 132 | } |
| 133 | Ok(()) |
| 134 | } |
| 135 | |
| 136 | /// Errors from conflict-pack admission into a binding tree. |
| 137 | #[derive(Debug, thiserror::Error)] |
no test coverage detected