Mirror `attest`'s tracked-vault write exactly.
(repo: &Repository, id: &str, node: &MemoryNode, inputs: &MemLiftInputs)
| 373 | |
| 374 | /// Mirror `attest`'s tracked-vault write exactly. |
| 375 | fn write_tracked(repo: &Repository, id: &str, node: &MemoryNode, inputs: &MemLiftInputs) { |
| 376 | let mut body = serde_json::to_string_pretty(&node.to_value()).unwrap(); |
| 377 | body.push('\n'); |
| 378 | let mut fm = serde_json::Map::new(); |
| 379 | fm.insert("memoryId".into(), Value::String(memory_id(id))); |
| 380 | fm.insert( |
| 381 | "sourceContentHash".into(), |
| 382 | Value::String(source_content_hash(inputs)), |
| 383 | ); |
| 384 | let frontmatter_json = serde_json::to_string(&fm).unwrap(); |
| 385 | let vpath = attestation_vault_path(id); |
| 386 | repo.vault_store( |
| 387 | &vpath, |
| 388 | VaultEntryType::Attestation, |
| 389 | body.into_bytes(), |
| 390 | frontmatter_json, |
| 391 | ) |
| 392 | .unwrap(); |
| 393 | } |
| 394 | |
| 395 | /// Mirror `attest`'s legacy sidecar write exactly ({node, source} wrapper). |
| 396 | fn write_legacy_sidecar( |