Skip to main content

validate_transition

Function validate_transition 

Source
pub fn validate_transition(
    from: PendingState,
    op: PendingOp,
) -> Result<TransitionResult>
Expand description

Apply the state-machine matrix from specs/pending-system.md §4.

from \ opGateUngateMarkDone
Open→ Gatederror→ Done
Gatedno-op→ Open→ Done
Doneerrorerrorno-op

Rationale (spec §4):

  • gate from Done is an error: a fully-complete item cannot be re-gated; the intended workflow is to add a new pending item describing the follow-up gate.
  • ungate from Open or Done is an error: ungate is the inverse of gate, not a generic “reset” — it requires an explicit [/] source.
  • Gate on Gated and MarkDone on Done are idempotent no-ops, not errors, so the granular CLI flags can be re-run safely (skill retries, watch loops).