Mirror `attest`'s tracked-vault write (body = pretty JSON + '\n').
(repo: &Repository, id: &str, node: &CanonicalNode)
| 340 | |
| 341 | /// Mirror `attest`'s tracked-vault write (body = pretty JSON + '\n'). |
| 342 | fn write_tracked(repo: &Repository, id: &str, node: &CanonicalNode) { |
| 343 | let inputs = bridge::read_intent(repo, id).unwrap(); |
| 344 | let mut body = serde_json::to_string_pretty(&node.to_value()).unwrap(); |
| 345 | body.push('\n'); |
| 346 | let mut fm = serde_json::Map::new(); |
| 347 | fm.insert( |
| 348 | "intentId".into(), |
| 349 | Value::String(bridge::normalized_id(repo, id).unwrap()), |
| 350 | ); |
| 351 | fm.insert( |
| 352 | "sourceContentHash".into(), |
| 353 | Value::String(bridge::source_content_hash(&inputs)), |
| 354 | ); |
| 355 | let vpath = bridge::attestation_vault_path(repo, id).unwrap(); |
| 356 | repo.vault_store( |
| 357 | &vpath, |
| 358 | VaultEntryType::Attestation, |
| 359 | body.into_bytes(), |
| 360 | serde_json::to_string(&fm).unwrap(), |
| 361 | ) |
| 362 | .unwrap(); |
| 363 | } |
| 364 | |
| 365 | /// Compute a single row using an explicit verifier keypair (no global store). |
| 366 | fn row_for(repo: &Repository, id: &str, kp: Option<&KeyPair>) -> Row { |