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

Function inspect_intent

libatomic/src/review/incremental.rs:952–973  ·  view source on GitHub ↗
(repo: &Repository, key: &str)

Source from the content-addressed store, hash-verified

950}
951
952fn inspect_intent(repo: &Repository, key: &str) -> CliResult<Value> {
953 let inputs = bridge::read_intent(repo, key).map_err(CliError::Repository)?;
954 let freshness =
955 match bridge::load_attestation(repo, key, &inputs).map_err(CliError::Repository)? {
956 bridge::Attestation::Fresh(_) => "fresh_not_signature_verified",
957 bridge::Attestation::Stale(_) => "stale",
958 bridge::Attestation::None => "missing",
959 };
960 let (node, lift_error) = match bridge::lift(&inputs) {
961 Ok(node) => (encode(&node)?, Value::Null),
962 Err(error) => (Value::Null, json!(error.to_string())),
963 };
964 Ok(
965 json!({ "id": key, "authenticated": false, "attestation_status": freshness,
966 "source_hash": bridge::source_content_hash(&inputs),
967 "source": "current_vault_document_not_historical_signed_snapshot",
968 "frontmatter": inputs.frontmatter, "body": inputs.body,
969 "authenticated_criteria": Value::Null,
970 "current_document_criteria_and_tasks": node, "lift_error": lift_error,
971 "acceptance_verdict": "not_evaluated" }),
972 )
973}
974
975fn recorded_diff(
976 repo: &Repository,

Callers 1

resolve_with_sessionFunction · 0.85

Calls 4

encodeFunction · 0.70
read_intentFunction · 0.50
load_attestationFunction · 0.50
liftFunction · 0.50

Tested by

no test coverage detected