Mirror `attest`'s tracked-vault write exactly (body = pretty JSON + '\n', flat-string frontmatter anchors).
(repo: &Repository, id: &str, node: &CanonicalNode, inputs: &LiftInputs)
| 410 | /// Mirror `attest`'s tracked-vault write exactly (body = pretty JSON + '\n', |
| 411 | /// flat-string frontmatter anchors). |
| 412 | fn write_tracked(repo: &Repository, id: &str, node: &CanonicalNode, inputs: &LiftInputs) { |
| 413 | let mut body = serde_json::to_string_pretty(&node.to_value()).unwrap(); |
| 414 | body.push('\n'); |
| 415 | let mut fm = serde_json::Map::new(); |
| 416 | fm.insert( |
| 417 | "intentId".into(), |
| 418 | Value::String(normalized_id(repo, id).unwrap()), |
| 419 | ); |
| 420 | fm.insert( |
| 421 | "sourceContentHash".into(), |
| 422 | Value::String(source_content_hash(inputs)), |
| 423 | ); |
| 424 | let frontmatter_json = serde_json::to_string(&fm).unwrap(); |
| 425 | let vpath = attestation_vault_path(repo, id).unwrap(); |
| 426 | repo.vault_store( |
| 427 | &vpath, |
| 428 | VaultEntryType::Attestation, |
| 429 | body.into_bytes(), |
| 430 | frontmatter_json, |
| 431 | ) |
| 432 | .unwrap(); |
| 433 | } |
| 434 | |
| 435 | /// Mirror `attest`'s legacy sidecar write exactly ({node, source} wrapper). |
| 436 | fn write_legacy_sidecar( |