Mirror `attest`'s tracked-vault write exactly.
(repo: &Repository, id: &str, node: &MemoryNode, inputs: &MemLiftInputs)
| 320 | |
| 321 | /// Mirror `attest`'s tracked-vault write exactly. |
| 322 | fn write_tracked(repo: &Repository, id: &str, node: &MemoryNode, inputs: &MemLiftInputs) { |
| 323 | let mut body = serde_json::to_string_pretty(&node.to_value()).unwrap(); |
| 324 | body.push('\n'); |
| 325 | let mut fm = serde_json::Map::new(); |
| 326 | fm.insert("memoryId".into(), Value::String(memory_id(id))); |
| 327 | fm.insert( |
| 328 | "sourceContentHash".into(), |
| 329 | Value::String(source_content_hash(inputs)), |
| 330 | ); |
| 331 | let frontmatter_json = serde_json::to_string(&fm).unwrap(); |
| 332 | let vpath = attestation_vault_path(id); |
| 333 | repo.vault_store( |
| 334 | &vpath, |
| 335 | VaultEntryType::Attestation, |
| 336 | body.into_bytes(), |
| 337 | frontmatter_json, |
| 338 | ) |
| 339 | .unwrap(); |
| 340 | } |
| 341 | |
| 342 | /// Mirror `attest`'s legacy sidecar write exactly ({node, source} wrapper). |
| 343 | fn write_legacy_sidecar( |