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:548–575  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

546
547 #[test]
548 fn attestation_entry_never_a_row() {
549 // Mirror memory/mod.rs: after attesting, vault_list("memory/") contains the
550 // memory entry but no path under attestations/.
551 let (repo, _dir) = repo();
552 store_memory(&repo, "m6", "context", &[], ":::memory\nX.\n:::");
553 let kp = KeyPair::generate();
554 let node = attest_with(&repo, "m6", &kp);
555 write_tracked(&repo, "m6", &node);
556
557 let listed = repo.vault_list("memory/", None).unwrap();
558 assert!(
559 listed.iter().all(|e| !e.path.starts_with("attestations/")),
560 "attestation entries must not appear under the memory/ prefix"
561 );
562 assert!(
563 listed.iter().any(|e| e.path == "memory/m6.md"),
564 "the memory entry itself is listed"
565 );
566 // And it never becomes its own row id (applying the same production
567 // filters: no attestations/, no index scaffold).
568 let ids: Vec<String> = listed
569 .iter()
570 .filter(|e| !e.path.starts_with("attestations/"))
571 .filter(|e| !is_index_scaffold(&repo, &e.path))
572 .map(|e| bridge::memory_id(&e.path))
573 .collect();
574 assert_eq!(ids, vec!["m6".to_string()]);
575 }
576}

Callers

nothing calls this directly

Calls 9

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
iterMethod · 0.45

Tested by

no test coverage detected