Skip to main content

Crate shigoto_types

Crate shigoto_types 

Source
Expand description

shigoto-types — typed primitives every other shigoto crate consumes.

Spec: theory/SHIGOTO.md §III.1–III.4 + §III.11–III.12.

v0.1.0 is the scaffold: trait + enum + struct surfaces declared, implementations land as the bootstrap consumer (tend) migrates per theory/SHIGOTO.md §IV.3 (M0.9 in the broader plan).

Re-exports§

pub use failure::Failure;
pub use failure::FailureKind;
pub use failure::classify;
pub use failure::signature;
pub use sink::AuditFileSink;
pub use sink::InMemorySink;
pub use sink::MultiSink;
pub use sink::NullSink;
pub use sink::Sink;
pub use chain::Chain;
pub use classify::ChainedClassifier;
pub use classify::Classifier;
pub use classify::FailureClassifier;
pub use classify::FnClassifier;
pub use watch::EscalationRouting;
pub use watch::ScheduleWindow;
pub use watch::TimeoutWatcher;
pub use watch::WatchAction;
pub use watch::WatchRule;
pub use policy::CascadePolicy;
pub use decision::Decision;
pub use converge::Action;
pub use converge::AppliedChange;
pub use converge::ApplyMetrics;
pub use converge::Change;
pub use converge::ChangeSeverity;
pub use converge::FailedChange;
pub use converge::NoMetrics;
pub use converge::Outcome;
pub use converge::Plan;
pub use converge::PlanId;
pub use converge::Reconciler;
pub use converge::ReconcilerError;
pub use converge::SharedReconciler;
pub use converge::build_outcome;
pub use converge::change;
pub use converge::change_with_severity;

Modules§

chain
Chain<I, O> — first-match-wins composition over typed rules.
classify
Typed input classification — the canonical Classifier<I, O> trait every fleet-wide raw-input-to-typed-event pipeline consumes. Spec: theory/CONVERGENCE-ADOPTION.md §II.5, Phase 0.2.
converge
converge — the universal state-convergence trait + typed Plan/Outcome border.
decision
Typed pure action-decision — the canonical Decision trait every fleet-wide “decide a controller action from a structured context” rule consumes. Spec: theory/CONVERGENCE-ADOPTION.md §II.3.
failure
Typed failure classification — the META primitive every long-running pleme-io reconciler consumes.
policy
Typed policy cascade — the canonical CascadePolicy trait every fleet-wide multi-layer-override system consumes. Spec: theory/CONVERGENCE-ADOPTION.md §II.2.
sink
Typed event sink — the canonical Sink<T> trait every fleet-wide event recorder consumes. Spec: theory/CONVERGENCE-ADOPTION.md §II.1, Phase 0.1.
testing
Test-helpers for typed-primitive authors.
watch
Typed stuck-state escalation — the canonical TimeoutWatcher<S> primitive every fleet-wide FSM-timeout watchdog consumes. Spec: theory/CONVERGENCE-ADOPTION.md §II.4, Phase 0.3.

Structs§

IllegalTransition
Rejected transition — (from, signal) is not a legal FSM cell. Returning Result instead of panicking lets consumers report drift (an operator action attempting an illegal transition) without crashing the scheduler.
JobId
Typed identity for a Job. Stable across cycles + scheduler restarts.
JobKindId
Typed work-class identifier. Stored as String (not &'static str) so it serializes through serde without lifetime constraints. Cheap Clone is fine for the volume we expect (≤ ~100 kinds across the whole scheduler).
Snapshot
Read-only snapshot of the scheduler’s current FSM map.
TickReceipt
Derived per-tick rollup the scheduler emits on every tick.
TransitionEvent
UnhealedDrift

Enums§

GateAggregate
Aggregate gate outcome — what the cohort of gates collectively said. Per §III.9 individual gates return Pass / Wait / Skip; the aggregate is the worst outcome (Skip > Wait > Pass) per a typed reducer in shigoto-gate. We carry the rolled-up result here so the FSM stays language-agnostic about how the rollup is computed.
JobPhase
FSM phase a Job inhabits. See theory/SHIGOTO.md §III.3 for the transition table.
JobScope
JobSubject
RetryOutcome
Retry decision from a RetryPolicy::decide() call. Same shape that shigoto-retry’s RetryDecision exposes — duplicated as a typed signal payload so the FSM stays in shigoto-types without a dependency on shigoto-retry.
Signal
FSM driver — every legal way a Job’s phase can change. Exhaustive over the (JobPhase, Signal) cross-product per theory/SHIGOTO.md §IV.1; the advance table below enumerates every cell.
SkipReason
TransitionReason

Traits§

ErasedJob
Trait-object dispatch surface. The scheduler holds Box<dyn ErasedJob> (Job itself isn’t object-safe because of the associated types); ErasedJob collapses the typed Output + Error to () + boxed error so the scheduler can store heterogeneous jobs in one DAG.
Job
The typed Job trait — what every consumer’s domain-specific job implements. Per theory/SHIGOTO.md §III.1.
JobError
JobInput
Inputs / Outputs / Errors implement these marker traits so the scheduler can serialize across boundaries when persistence lands.
JobOutput
OutputSink
Typed receiver for Job::Output values. Jobs call record on a successful execute so consumers (reconcile receipts, audit trails, dashboards) can read the typed outcomes the scheduler’s phase-tracking discards.
RecordingJob
Convenience trait that captures the most common Job authoring shape across pleme-io consumers: a Job whose typed Output flows through an OutputSink for consumer-side capture, and whose identity decomposes into (scope, kind, subject).

Functions§

advance
The canonical FSM driver. Pure: same (from, signal) always produces the same result. Exhaustive over JobPhase × Signal — adding a new phase or signal fails to compile until every cell of the cross-product is decided.