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

Source from the content-addressed store, hash-verified

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

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