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

Function compute_row

atomic-cli/src/commands/memory/list.rs:304–338  ·  view source on GitHub ↗

Compute one memory's row. A read/lift/attestation failure for a SINGLE memory degrades that row's computed columns to `–`/0 rather than aborting the list.

(repo: &Repository, id: &str, verifier: Option<&Verifier>)

Source from the content-addressed store, hash-verified

302/// Compute one memory's row. A read/lift/attestation failure for a SINGLE memory
303/// degrades that row's computed columns to `–`/0 rather than aborting the list.
304fn compute_row(repo: &Repository, id: &str, verifier: Option<&Verifier>) -> Row {
305 let inputs = match bridge::read_memory(repo, id) {
306 Ok(i) => i,
307 Err(_) => {
308 return Row {
309 id: id.to_string(),
310 kind: NA.to_string(),
311 status: NA.to_string(),
312 about: 0,
313 attested: Attested::None,
314 verifies: Verifies::Na,
315 updated: String::new(),
316 }
317 }
318 };
319 let attestation = bridge::load_attestation(repo, id, &inputs);
320 let (attested, verifies, node_owned) = match attestation {
321 Ok(a) => {
322 let verifies = compute_verifies(&a, verifier);
323 (classify(&a), verifies, Some(a))
324 }
325 Err(_) => (Attested::None, Verifies::Na, None),
326 };
327 let node = node_owned.as_ref().and_then(attested_node);
328 let (kind, status, about) = kind_status_about(node, &inputs);
329 Row {
330 id: id.to_string(),
331 kind,
332 status,
333 about,
334 attested,
335 verifies,
336 updated: String::new(),
337 }
338}
339
340impl MemoryList {
341 /// The shared render — the exact local body's table and JSON shapes,

Callers 2

runMethod · 0.70
row_forFunction · 0.70

Calls 6

read_memoryFunction · 0.85
kind_status_aboutFunction · 0.85
as_refMethod · 0.80
load_attestationFunction · 0.70
compute_verifiesFunction · 0.70
classifyFunction · 0.70

Tested by

no test coverage detected