Mirror `attest`'s tracked-vault write exactly (body = pretty JSON + '\n', flat-string frontmatter anchors).
(repo: &Repository, id: &str, node: &CanonicalNode, inputs: &LiftInputs)
| 366 | /// Mirror `attest`'s tracked-vault write exactly (body = pretty JSON + '\n', |
| 367 | /// flat-string frontmatter anchors). |
| 368 | fn write_tracked(repo: &Repository, id: &str, node: &CanonicalNode, inputs: &LiftInputs) { |
| 369 | let mut body = serde_json::to_string_pretty(&node.to_value()).unwrap(); |
| 370 | body.push('\n'); |
| 371 | let mut fm = serde_json::Map::new(); |
| 372 | fm.insert( |
| 373 | "intentId".into(), |
| 374 | Value::String(normalized_id(repo, id).unwrap()), |
| 375 | ); |
| 376 | fm.insert( |
| 377 | "sourceContentHash".into(), |
| 378 | Value::String(source_content_hash(inputs)), |
| 379 | ); |
| 380 | let frontmatter_json = serde_json::to_string(&fm).unwrap(); |
| 381 | let vpath = attestation_vault_path(repo, id).unwrap(); |
| 382 | repo.vault_store( |
| 383 | &vpath, |
| 384 | VaultEntryType::Attestation, |
| 385 | body.into_bytes(), |
| 386 | frontmatter_json, |
| 387 | ) |
| 388 | .unwrap(); |
| 389 | } |
| 390 | |
| 391 | /// Mirror `attest`'s legacy sidecar write exactly ({node, source} wrapper). |
| 392 | fn write_legacy_sidecar( |