Mirror `attest`'s tracked-vault write (body = pretty JSON + '\n').
(repo: &Repository, id: &str, node: &MemoryNode)
| 427 | |
| 428 | /// Mirror `attest`'s tracked-vault write (body = pretty JSON + '\n'). |
| 429 | fn write_tracked(repo: &Repository, id: &str, node: &MemoryNode) { |
| 430 | let inputs = bridge::read_memory(repo, id).unwrap(); |
| 431 | let mut body = serde_json::to_string_pretty(&node.to_value()).unwrap(); |
| 432 | body.push('\n'); |
| 433 | let mut fm = Map::new(); |
| 434 | fm.insert("memoryId".into(), Value::String(bridge::memory_id(id))); |
| 435 | fm.insert( |
| 436 | "sourceContentHash".into(), |
| 437 | Value::String(bridge::source_content_hash(&inputs)), |
| 438 | ); |
| 439 | let vpath = bridge::attestation_vault_path(id); |
| 440 | repo.vault_store( |
| 441 | &vpath, |
| 442 | VaultEntryType::Attestation, |
| 443 | body.into_bytes(), |
| 444 | serde_json::to_string(&fm).unwrap(), |
| 445 | ) |
| 446 | .unwrap(); |
| 447 | } |
| 448 | |
| 449 | /// Compute a row with an explicit verifier keypair (no global store). |
| 450 | fn row_for(repo: &Repository, id: &str, kp: Option<&KeyPair>) -> Row { |