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

Function vault_entry_bundle

libatomic/src/daemon/services_agent.rs:803–824  ·  view source on GitHub ↗

The versioned-opaque entry bundle (schema "atomic.vault.entry.bundle.v1"): the stored entry's full domain serialization plus the RAW attestation sources, so the client runs its existing lift/classification code over wire-carried inputs. `kind` selects the attestation scheme (the intent and memory bridges' dual-read paths); `None` bundles the entry with no attestation (the path-resolved `vault show

(
    repo: &Repository,
    kind: Option<Kind>,
    id_or_path: &str,
    entry: &atomic_core::pristine::VaultEntry,
)

Source from the content-addressed store, hash-verified

801/// and memory bridges' dual-read paths); `None` bundles the entry with no
802/// attestation (the path-resolved `vault show` projection).
803fn vault_entry_bundle(
804 repo: &Repository,
805 kind: Option<Kind>,
806 id_or_path: &str,
807 entry: &atomic_core::pristine::VaultEntry,
808) -> Result<VersionedBytes, Status> {
809 let attestation = match kind {
810 Some(Kind::Intent) => intent_attestation_sources(repo, id_or_path),
811 Some(Kind::Memory) => memory_attestation_sources(repo, id_or_path),
812 _ => Value::Null,
813 };
814 let payload = serde_json::json!({
815 "entry": entry,
816 "attestation": attestation,
817 });
818 serde_json::to_vec(&payload)
819 .map(|payload| VersionedBytes {
820 schema: "atomic.vault.entry.bundle.v1".to_string(),
821 payload,
822 })
823 .map_err(|error| Status::internal(error.to_string()))
824}
825
826/// Validate a `ListVaultEntries` sort against the listing it applies to and
827/// resolve UNSPECIFIED to the kind's default key (intents by id, memories by

Callers 1

get_vault_entryMethod · 0.85

Calls 2

Tested by

no test coverage detected