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

Function test_attestation_staleness

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

Source from the content-addressed store, hash-verified

479
480 #[test]
481 fn test_attestation_staleness() {
482 let (repo, id, inputs, _dir) = repo_with_intent();
483 let (node, _kp) = attested_node(&inputs);
484 write_tracked(&repo, &id, &node, &inputs);
485
486 // Fresh against the original inputs.
487 assert!(matches!(
488 load_attestation(&repo, &id, &inputs).unwrap(),
489 Attestation::Fresh(_)
490 ));
491
492 // Simulate an edit to the intent body: the current source hash no longer
493 // matches the recorded anchor -> Stale.
494 let edited = LiftInputs {
495 frontmatter: inputs.frontmatter.clone(),
496 body: format!("{}\n<!-- edited -->", inputs.body),
497 };
498 assert!(matches!(
499 load_attestation(&repo, &id, &edited).unwrap(),
500 Attestation::Stale(_)
501 ));
502 }
503
504 #[test]
505 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