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

Function gate_rejects_done_intent_with_open_task

atomic-canonical/src/gate.rs:482–503  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

480
481 #[test]
482 fn gate_rejects_done_intent_with_open_task() {
483 let mut node = attested_base();
484 node.status = "done".to_string();
485 node.has_acceptance_criterion = vec![{
486 let mut a = ac("urn:atomic:ac:gate-1-ac-1");
487 a.ac_status = "met".to_string();
488 a.verified_by = Some("did:atomic:lee".to_string());
489 a.evidence = Some("urn:atomic:change:01J8".to_string());
490 a
491 }];
492 // Task is still open while the intent claims to be done.
493 node.has_task = vec![task(
494 "urn:atomic:task:gate-1-1",
495 &["urn:atomic:ac:gate-1-ac-1"],
496 )];
497
498 let report = validate_intent(&node);
499 assert!(!report.conforms);
500 assert!(report.results.iter().any(|v| v.shape == "IntentShape"
501 && v.path.as_deref() == Some("status")
502 && v.message.contains("every task must be done")));
503 }
504
505 #[test]
506 fn gate_rejects_done_intent_with_unmet_criterion() {

Callers

nothing calls this directly

Calls 2

attested_baseFunction · 0.85
validate_intentFunction · 0.85

Tested by

no test coverage detected