One judgment per original criterion. Machine observations are evidence, never independent review obligations or substitutes for a verdict.
(report: &Value, criteria: Vec<CriterionEvidence>)
| 278 | /// One judgment per original criterion. Machine observations are evidence, |
| 279 | /// never independent review obligations or substitutes for a verdict. |
| 280 | pub fn for_intent(report: &Value, criteria: Vec<CriterionEvidence>) -> Self { |
| 281 | let mut plan = Self::construct(report, criteria); |
| 282 | let observations = std::mem::take(&mut plan.cards); |
| 283 | let report_hash = digest(report); |
| 284 | let graph_hash = digest(&report["graph"]); |
| 285 | plan.cards = plan.criteria.iter().map(|criterion| { |
| 286 | let result = json!({ |
| 287 | "criterion": criterion, |
| 288 | "observations": observations.iter().filter(|card| card.assessment.criterion == criterion.criterion).collect::<Vec<_>>(), |
| 289 | "reportContentHash": report_hash, |
| 290 | "structuralEvidenceHash": graph_hash, |
| 291 | }); |
| 292 | let id = digest(&result); |
| 293 | ReviewCard { |
| 294 | id: id.clone(), source: report_hash.clone(), path: String::new(), |
| 295 | assessment: CardAssessment { |
| 296 | intent: criterion.intent.clone(), criterion: criterion.criterion.clone(), |
| 297 | card: format!("urn:atomic:criterion-evidence:{id}"), result_hash: digest(&result), |
| 298 | outcome: CardOutcome::Pending, rationale: None, evidence: None, approved_by: None, |
| 299 | }, |
| 300 | result, relevance: "Original criterion, declared evidence and pinned report context; unavailable observations are not passing evidence".into(), |
| 301 | } |
| 302 | }).collect(); |
| 303 | plan.schema = "atomic.criterion-review-worklist.v2".into(); |
| 304 | plan |
| 305 | } |
| 306 | |
| 307 | /// Build only evidence-linked, constructible work. Execution is not a verdict. |
| 308 | pub fn construct(report: &Value, mut criteria: Vec<CriterionEvidence>) -> Self { |