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

Function attestation_entry_never_a_row

atomic-cli/src/commands/memory/list.rs:759–786  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

757
758 #[test]
759 fn attestation_entry_never_a_row() {
760 // Mirror memory/mod.rs: after attesting, vault_list("memory/") contains the
761 // memory entry but no path under attestations/.
762 let (repo, _dir) = repo();
763 store_memory(&repo, "m6", "context", &[], ":::memory\nX.\n:::");
764 let kp = KeyPair::generate();
765 let node = attest_with(&repo, "m6", &kp);
766 write_tracked(&repo, "m6", &node);
767
768 let listed = repo.vault_list("memory/", None).unwrap();
769 assert!(
770 listed.iter().all(|e| !e.path.starts_with("attestations/")),
771 "attestation entries must not appear under the memory/ prefix"
772 );
773 assert!(
774 listed.iter().any(|e| e.path == "memory/m6.md"),
775 "the memory entry itself is listed"
776 );
777 // And it never becomes its own row id (applying the same production
778 // filters: no attestations/, no index scaffold).
779 let ids: Vec<String> = listed
780 .iter()
781 .filter(|e| !e.path.starts_with("attestations/"))
782 .filter(|e| !is_index_scaffold(&repo, &e.path))
783 .map(|e| bridge::memory_id(&e.path))
784 .collect();
785 assert_eq!(ids, vec!["m6".to_string()]);
786 }
787}

Callers

nothing calls this directly

Calls 10

repoFunction · 0.85
store_memoryFunction · 0.85
is_index_scaffoldFunction · 0.85
memory_idFunction · 0.85
vault_listMethod · 0.80
attest_withFunction · 0.70
write_trackedFunction · 0.70
unwrapMethod · 0.45
collectMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected