Skip to main content

seal

Function seal 

Source
pub fn seal(transition: Transition, issue: &str, stamp: &str) -> String
Expand description

The seal of one transition: the proof, tracked in the record beside the stamp, that the stamp was written by the transition that appends its event.

The ledger that holds the event is checkout-local and never tracked, so no gate reading a clone can compare a stamp with it. The seal is the tracked half: the SHA-256 of the event, the issue and the stamp, written by transition in the same write as the stamp and read by Plan::build, which gives a stamp without its seal no effect on status and reports it as stamp_without_event. mj_pj_seal_rows in lib/project.sh computes the same digest for the awk engine.

use majordomus_cli::plan::{seal, Transition};
let s = seal(Transition::Done, "I0001", "2026-09-16T12:00:00Z");
assert!(s.starts_with("sha256:") && s.len() == 7 + 64);
// A seal proves one stamp of one move of one issue, and nothing else.
assert_ne!(s, seal(Transition::Start, "I0001", "2026-09-16T12:00:00Z"));
assert_ne!(s, seal(Transition::Done, "I0002", "2026-09-16T12:00:00Z"));
assert_ne!(s, seal(Transition::Done, "I0001", "2026-09-16T12:00:01Z"));