How arisros/fate works
fate is a dependency-free Go statechart engine. Users define a machine, create and start an actor, then send events; the actor evaluates transitions and actions to update its state and context. Delays and invoked work are exposed as pending effects for adapters to drive. Snapshots support persistence and restoration. Separate product surfaces provide HTTP simulation, a Temporal workflow adapter, and descriptor-based visualization and inspection. The graph follows README capabilities; some subsystem links are based on documented APIs because their implementation was not sampled.
Main entry points: actor.go Actor runtime · main.go Fate CLI · workflow_actor.go Temporal adapter · machine.go Machine config
Components 18
Statechart core
- Machine config
machine.go - Config validation
validator.go - Actor runtime
actor.go - Actions
action.go - Guards
guard.go - State values
state_value.go
Effects and adapters
- Delayed transitions
timer.go - Invocations
invoke.go - Temporal adapter
temporal/workflow_actor.go - HTTP simulator
httphandler/handler.go
Inspection tools
- Snapshot persistence
persist.go - Machine descriptor
descriptor.go - Chart renderers
render/ascii.go - Fate CLI
cmd/fate/main.go - Snapshot diff
diff/diff.go
Other components
- Machine user
- Studio client
- Temporal services
Connections 22
- Machine user → Machine config: defines
- Machine config → Config validation: validates config
- Machine user → Actor runtime: creates and starts
- Actor runtime → Machine config: uses
- Machine user → Actor runtime: sends events
- Actor runtime → Guards: checks transitions
- Actor runtime → State values: updates state
- Actor runtime → Actions: runs actions
- Actor runtime → Delayed transitions: exposes timers
- Actor runtime → Invocations: exposes invocations
- Temporal adapter → Actor runtime: drives effects
- Temporal services → Temporal adapter: hosts workflow
- Temporal adapter → Temporal services: runs activities
- HTTP simulator → Actor runtime: dispatches events
- Studio client → HTTP simulator: simulates machine
- Actor runtime → Snapshot persistence: persists snapshot
- Machine user → Actor runtime: requests snapshot
- Actor runtime → Machine descriptor: describes machine
- Fate CLI → Machine descriptor: loads descriptor
- Fate CLI → Chart renderers: renders chart
- Fate CLI → Snapshot diff: compares snapshots
- Machine user → Fate CLI: inspects JSON