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

Function prepare

atomic-repository/src/intent_evidence.rs:192–202  ·  view source on GitHub ↗

Resolve the node the gate should validate together with its native pins. A fresh attestation is gated as itself; an unattested or stale intent is gated as the raw lifted node, matching the CLI's ordinary validation.

(repo: &Repository, id: &str)

Source from the content-addressed store, hash-verified

190/// A fresh attestation is gated as itself; an unattested or stale intent is
191/// gated as the raw lifted node, matching the CLI's ordinary validation.
192pub fn prepare(repo: &Repository, id: &str) -> Result<PreparedIntent, EvidenceError> {
193 let inputs = intent_bridge::read_intent(repo, id)?;
194 let node = match intent_bridge::load_attestation(repo, id, &inputs)? {
195 intent_bridge::Attestation::Fresh(node) => *node,
196 intent_bridge::Attestation::Stale(_) | intent_bridge::Attestation::None => {
197 intent_bridge::lift(&inputs)?
198 }
199 };
200 let context = context_from_inputs(repo, &inputs)?;
201 Ok(PreparedIntent { node, context })
202}
203
204/// Read a manifest within the protocol ceiling.
205pub fn read_manifest(path: &Path) -> Result<Vec<u8>, EvidenceError> {

Callers 3

newMethod · 0.50
new_spanMethod · 0.50
replay_vault_evidenceMethod · 0.50

Calls 4

read_intentFunction · 0.85
context_from_inputsFunction · 0.85
load_attestationFunction · 0.70
liftFunction · 0.70

Tested by

no test coverage detected