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

Function test_attestation_staleness

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

Source from the content-addressed store, hash-verified

442
443 #[test]
444 fn test_attestation_staleness() {
445 let (repo, id, inputs, _dir) = repo_with_memory();
446 let (node, _kp) = attested_node(&inputs);
447 write_tracked(&repo, &id, &node, &inputs);
448
449 // Fresh against the original inputs.
450 assert!(matches!(
451 load_attestation(&repo, &id, &inputs).unwrap(),
452 Attestation::Fresh(_)
453 ));
454
455 // Edit the body -> current source hash no longer matches -> Stale.
456 let edited = MemLiftInputs {
457 frontmatter: inputs.frontmatter.clone(),
458 body: format!("{}\n<!-- edited -->", inputs.body),
459 };
460 assert!(matches!(
461 load_attestation(&repo, &id, &edited).unwrap(),
462 Attestation::Stale(_)
463 ));
464 }
465}

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