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

Function test_attestation_staleness

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

Source from the content-addressed store, hash-verified

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