MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_attestation_staleness

Function test_attestation_staleness

atomic-cli/src/commands/intent/bridge.rs:489–510  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

487
488 #[test]
489 fn test_attestation_staleness() {
490 let (repo, id, inputs, _dir) = repo_with_intent();
491 let (node, _kp) = attested_node(&inputs);
492 write_tracked(&repo, &id, &node, &inputs);
493
494 // Fresh against the original inputs.
495 assert!(matches!(
496 load_attestation(&repo, &id, &inputs).unwrap(),
497 Attestation::Fresh(_)
498 ));
499
500 // Simulate an edit to the intent body: the current source hash no longer
501 // matches the recorded anchor -> Stale.
502 let edited = LiftInputs {
503 frontmatter: inputs.frontmatter.clone(),
504 body: format!("{}\n<!-- edited -->", inputs.body),
505 };
506 assert!(matches!(
507 load_attestation(&repo, &id, &edited).unwrap(),
508 Attestation::Stale(_)
509 ));
510 }
511
512 #[test]
513 fn test_legacy_sidecar_raw_arg_fallback_is_found() {

Callers

nothing calls this directly

Calls 4

repo_with_intentFunction · 0.85
attested_nodeFunction · 0.70
write_trackedFunction · 0.70
cloneMethod · 0.45

Tested by

no test coverage detected