Skip to main content

Crate shigoto_gate

Crate shigoto_gate 

Source
Expand description

shigoto-gate — typed precondition Gate trait + standard gates.

Spec: theory/SHIGOTO.md §III.9. Gates are PURE — they evaluate against the scheduler snapshot without IO. IO-dependent gating is itself a Job that produces a typed fact a downstream gate checks.

Structs§

AllUpstreamsTerminal
AllUpstreamsTerminal — every direct DAG predecessor has reached a terminal phase ({Succeeded, Skipped, Deadlettered}). The scheduler implicitly applies this gate to enforce DAG edge semantics; consumers don’t normally register it explicitly.
GateContext
Everything a Gate needs to make its decision: the job in question, the FSM snapshot (every other job’s phase), the DAG (so gates like AllUpstreamsTerminal can ask about predecessors).
OperatorApproved
OperatorApproved — pass iff an external operator has flipped a pre-arranged flag. The flag itself lives in the consumer’s state store; this gate is a thin wrapper that holds an Arc<AtomicBool> or similar. v0.1 ships with a Closure variant that takes a Fn() -> bool for tests + ad-hoc cases.

Enums§

GateOutcome

Traits§

Gate
One typed precondition. Pure — no IO. Gate impls that “need” IO are antipatterns; the right shape is a Job that emits a typed fact and a downstream gate that checks the fact.

Functions§

reduce
Reduce a cohort of Gate outcomes to one GateAggregate that the FSM advance() consumes. Worst-outcome wins: any Skip → Skipped; no Skip but any Wait → SomeWaiting; otherwise → AllPassed. The first Skip’s reason is preserved.