Select the change objects allowed into the optional `changes.pack`. This is the audited sync-pack boundary (RFC §8.6): only [`ObjectFamily::Change`] records may enter a binding pack, and each must hash-verify (`blake3(bytes) == key`) so the pack stays content-addressed. Provenance/attestation/view sidecars — the families that can contain unhashed private payloads — are refused, never silently cop
(
candidates: &[ObjectRecord],
)
| 70 | /// Provenance/attestation/view sidecars — the families that can contain |
| 71 | /// unhashed private payloads — are refused, never silently copied into Git. |
| 72 | pub fn binding_pack_records( |
| 73 | candidates: &[ObjectRecord], |
| 74 | ) -> Result<Vec<ObjectRecord>, BindingTreeError> { |
| 75 | let mut allowed = Vec::with_capacity(candidates.len()); |
| 76 | for record in candidates { |
| 77 | match record.family { |
| 78 | ObjectFamily::Change => {} |
| 79 | family => { |
| 80 | return Err(BindingTreeError::Encode(format!( |
| 81 | "binding pack refused {family:?} object {key}: only V3 change files may enter Git", |
| 82 | key = record.key |
| 83 | ))) |
| 84 | } |
| 85 | } |
| 86 | if Hash::of(&record.bytes).to_hex() != record.key { |
| 87 | return Err(BindingTreeError::HashMismatch { |
| 88 | key: record.key.clone(), |
| 89 | }); |
| 90 | } |
| 91 | allowed.push(record.clone()); |
| 92 | } |
| 93 | Ok(allowed) |
| 94 | } |
| 95 | |
| 96 | /// Structurally validate conflict-pack bytes without a claimed identity. |
| 97 | /// |