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

Function test_attestation_staleness

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

Source from the content-addressed store, hash-verified

498
499 #[test]
500 fn test_attestation_staleness() {
501 let (repo, id, inputs, _dir) = repo_with_intent();
502 let (node, _kp) = attested_node(&inputs);
503 write_tracked(&repo, &id, &node, &inputs);
504
505 // Fresh against the original inputs.
506 assert!(matches!(
507 load_attestation(&repo, &id, &inputs).unwrap(),
508 Attestation::Fresh(_)
509 ));
510
511 // Simulate an edit to the intent body: the current source hash no longer
512 // matches the recorded anchor -> Stale.
513 let edited = LiftInputs {
514 frontmatter: inputs.frontmatter.clone(),
515 body: format!("{}\n<!-- edited -->", inputs.body),
516 };
517 assert!(matches!(
518 load_attestation(&repo, &id, &edited).unwrap(),
519 Attestation::Stale(_)
520 ));
521 }
522
523 #[test]
524 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