Mirror `attest`'s tracked-vault write (body = pretty JSON + '\n').
(repo: &Repository, id: &str, node: &MemoryNode)
| 596 | |
| 597 | /// Mirror `attest`'s tracked-vault write (body = pretty JSON + '\n'). |
| 598 | fn write_tracked(repo: &Repository, id: &str, node: &MemoryNode) { |
| 599 | let inputs = bridge::read_memory(repo, id).unwrap(); |
| 600 | let mut body = serde_json::to_string_pretty(&node.to_value()).unwrap(); |
| 601 | body.push('\n'); |
| 602 | let mut fm = Map::new(); |
| 603 | fm.insert("memoryId".into(), Value::String(bridge::memory_id(id))); |
| 604 | fm.insert( |
| 605 | "sourceContentHash".into(), |
| 606 | Value::String(bridge::source_content_hash(&inputs)), |
| 607 | ); |
| 608 | let vpath = bridge::attestation_vault_path(id); |
| 609 | repo.vault_store( |
| 610 | &vpath, |
| 611 | VaultEntryType::Attestation, |
| 612 | body.into_bytes(), |
| 613 | serde_json::to_string(&fm).unwrap(), |
| 614 | ) |
| 615 | .unwrap(); |
| 616 | } |
| 617 | |
| 618 | /// Compute a row with an explicit verifier keypair (no global store). |
| 619 | fn row_for(repo: &Repository, id: &str, kp: Option<&KeyPair>) -> Row { |