Mirror `attest`'s tracked-vault write exactly (body = pretty JSON + '\n', flat-string frontmatter anchors).
(repo: &Repository, id: &str, node: &CanonicalNode, inputs: &LiftInputs)
| 483 | /// Mirror `attest`'s tracked-vault write exactly (body = pretty JSON + '\n', |
| 484 | /// flat-string frontmatter anchors). |
| 485 | fn write_tracked(repo: &Repository, id: &str, node: &CanonicalNode, inputs: &LiftInputs) { |
| 486 | let mut body = serde_json::to_string_pretty(&node.to_value()).unwrap(); |
| 487 | body.push('\n'); |
| 488 | let mut fm = serde_json::Map::new(); |
| 489 | fm.insert( |
| 490 | "intentId".into(), |
| 491 | Value::String(normalized_id(repo, id).unwrap()), |
| 492 | ); |
| 493 | fm.insert( |
| 494 | "sourceContentHash".into(), |
| 495 | Value::String(source_content_hash(inputs)), |
| 496 | ); |
| 497 | let frontmatter_json = serde_json::to_string(&fm).unwrap(); |
| 498 | let vpath = attestation_vault_path(repo, id).unwrap(); |
| 499 | repo.vault_store( |
| 500 | &vpath, |
| 501 | VaultEntryType::Attestation, |
| 502 | body.into_bytes(), |
| 503 | frontmatter_json, |
| 504 | ) |
| 505 | .unwrap(); |
| 506 | } |
| 507 | |
| 508 | /// Mirror `attest`'s legacy sidecar write exactly ({node, source} wrapper). |
| 509 | fn write_legacy_sidecar( |