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

Function test_attestation_staleness

atomic-cli/src/commands/memory/bridge.rs:555–575  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

553
554 #[test]
555 fn test_attestation_staleness() {
556 let (repo, id, inputs, _dir) = repo_with_memory();
557 let (node, _kp) = attested_node(&inputs);
558 write_tracked(&repo, &id, &node, &inputs);
559
560 // Fresh against the original inputs.
561 assert!(matches!(
562 load_attestation(&repo, &id, &inputs).unwrap(),
563 Attestation::Fresh(_)
564 ));
565
566 // Edit the body -> current source hash no longer matches -> Stale.
567 let edited = MemLiftInputs {
568 frontmatter: inputs.frontmatter.clone(),
569 body: format!("{}\n<!-- edited -->", inputs.body),
570 };
571 assert!(matches!(
572 load_attestation(&repo, &id, &edited).unwrap(),
573 Attestation::Stale(_)
574 ));
575 }
576}

Callers

nothing calls this directly

Calls 4

repo_with_memoryFunction · 0.85
attested_nodeFunction · 0.70
write_trackedFunction · 0.70
cloneMethod · 0.45

Tested by

no test coverage detected