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

Function substance_hash_ignores_review_state

atomic-canonical/src/node.rs:437–478  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

435
436 #[test]
437 fn substance_hash_ignores_review_state() {
438 let base = intent_substance_hash(&node());
439
440 // Intent-level status is review state — hash holds.
441 let mut status = node();
442 status.status = "done".to_string();
443 assert_eq!(
444 intent_substance_hash(&status),
445 base,
446 "status must not move substance"
447 );
448
449 // Per-AC review state (acStatus / verifiedBy / evidence) — hash holds.
450 let mut reviewed = node();
451 reviewed.has_acceptance_criterion[0].ac_status = "met".to_string();
452 reviewed.has_acceptance_criterion[0].verified_by = Some("did:atomic:lee".to_string());
453 reviewed.has_acceptance_criterion[0].evidence = Some("urn:atomic:change:01J8".to_string());
454 assert_eq!(
455 intent_substance_hash(&reviewed),
456 base,
457 "AC review state must not move substance"
458 );
459
460 // Accumulating a verification record — hash holds.
461 let mut verified = node();
462 verified.has_acceptance_criterion[0]
463 .verifications
464 .push(VerificationRecord {
465 type_: "VerificationRecord".to_string(),
466 kind: "manual".to_string(),
467 outcome: "fail".to_string(),
468 scope: "view".to_string(),
469 observed_at_merkle: "ABC".to_string(),
470 reference: None,
471 observation: None,
472 });
473 assert_eq!(
474 intent_substance_hash(&verified),
475 base,
476 "verification records must not move substance"
477 );
478 }
479
480 #[test]
481 fn substance_hash_tracks_the_definition() {

Callers

nothing calls this directly

Calls 3

intent_substance_hashFunction · 0.85
nodeFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected