(repo: &Repository, key: &str)
| 950 | } |
| 951 | |
| 952 | fn 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 | |
| 975 | fn recorded_diff( |
| 976 | repo: &Repository, |
no test coverage detected