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

Function test_attestation_staleness

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

Source from the content-addressed store, hash-verified

495
496 #[test]
497 fn test_attestation_staleness() {
498 let (repo, id, inputs, _dir) = repo_with_memory();
499 let (node, _kp) = attested_node(&inputs);
500 write_tracked(&repo, &id, &node, &inputs);
501
502 // Fresh against the original inputs.
503 assert!(matches!(
504 load_attestation(&repo, &id, &inputs).unwrap(),
505 Attestation::Fresh(_)
506 ));
507
508 // Edit the body -> current source hash no longer matches -> Stale.
509 let edited = MemLiftInputs {
510 frontmatter: inputs.frontmatter.clone(),
511 body: format!("{}\n<!-- edited -->", inputs.body),
512 };
513 assert!(matches!(
514 load_attestation(&repo, &id, &edited).unwrap(),
515 Attestation::Stale(_)
516 ));
517 }
518}

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