@hackage keiro0.4.0.1
Event sourcing framework and workflow engine
Categories
License
BSD-3-Clause
Maintainer
nadeem@gmail.com
Links
Versions
- 0.4.0.1 Wed, 29 Jul 2026
Installation
Tested Compilers
Dependencies (35)
- aeson >=2.2.2 && <2.3
- aeson-casing >=0.2 && <0.3
- base >=4.21 && <5
- base16-bytestring >=1.0.2 && <1.1
- bytestring >=0.11 && <0.13
- containers >=0.6 && <0.8 Show all…
Dependents (2)
@hackage/kioku-core, @hackage/keiro-dsl
keiro — 経路
keiro is a Haskell library for event sourcing and workflow orchestration. It combines an append-only event store, a pure functional state machine, and subscription workers into one library-shaped runtime that an application imports and runs against PostgreSQL.
The name
経路 (keiro) means route, path, or course in Japanese: the way something travels from an origin to a destination.
| Kanji | Reading | Meaning |
|---|---|---|
| 経 | kei | to pass through, to elapse, a way, a longitude |
| 路 | ro | a road, path, or way |
The name is literal. keiro is about the paths events take through a system:
- an event stream is the route an aggregate's history has taken;
- a subscription follows the route through the global event log;
- a projection routes events into queryable read models;
- a process manager routes source events into commands for another stream;
- a workflow is a durable route through state, timers, and external effects.
The sibling project keiki (継起, "successive occurrence") names the succession of events. keiro names the routes those events travel and the routes downstream processes follow.
What it provides
The current v1 library provides:
- typed stream names through
Keiro.Stream; - event codecs, schema versions, event type validation, and upcasters through
Keiro.Codec; - the author-facing
EventStreamcontract inKeiro.EventStream; runCommandandrunCommandWithSqlinKeiro.Commandfor the canonical load, streaming replay, decide, append-event-batch cycle with optimistic concurrency;- advisory snapshots in
Keiro.Snapshot; - read models, inline projections, async projection helpers, and rebuild
metadata in
Keiro.ReadModelandKeiro.Projection; - event-sourced process managers in
Keiro.ProcessManager; - durable timer storage and workers in
Keiro.Timer.
The stable contracts used by future Keiro packages live in the sibling
keiro-core package. The full keiro package depends on keiro-core and
re-exports those core modules, so existing imports such as Keiro.Codec,
Keiro.EventStream, Keiro.Stream, and Keiro.Integration.Event continue to
work for applications that depend on keiro.
The top-level Keiro module re-exports the core stream, codec, event-stream,
command, and snapshot APIs. Read-model, projection, process-manager, and timer
modules are exposed directly so applications can import them explicitly.
Runtime stack
keiro is not a server. The keiro-core package contains reusable contracts and
pure helpers; the keiro package adds the runtime that composes these
dependencies:
- kiroku for the PostgreSQL-backed append-only event store;
- keiki for the pure
SymTransducerstate-machine core; - shibuya for subscription and worker supervision;
- hasql and effectful for database access and effect handling;
- Streamly for streaming reads and worker loops.
Development
From the repository root:
cabal build all
cabal test all
cabal test jitsurei-test
just haskell-verify
The package metadata lives in keiro/keiro.cabal. The implementation plans and design
history live under docs/masterplans/, docs/plans/, and docs/research/.
User-facing documentation starts at docs/user/README.md. Long-form,
guide-backed examples start at docs/guides/README.md and use the sibling
jitsurei package as their executable source.
Status
The event-sourcing core, hardened replay validation, snapshots, fenced read
models and projections, process managers, routers, durable timers,
transactional messaging (outbox/inbox), dead-letter tooling, and named-step
durable workflows are implemented — production-shaped for controlled early
use, not yet a 1.0. See the repository-level README.md and
docs/user/production-status.md for the
authoritative status.
Remaining work is future-facing: exactly-once async projection checkpoint/user-SQL transactions once shibuya exposes that boundary, and higher-level ergonomic facades over the low-level APIs.
License
BSD-3-Clause.