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