Configuration
Configure Jizoku with the host repo and queue:
config :jizoku, repo: MyApp.Repo, partition: "tenant_acme", queue: "default"Omit
:partitionfor the exact legacy namespace. When it is configured, workers, cron delivery, runtime commands, and inspection use that partition by default; explicit overrides must come from trusted host routing.Do not derive
:partitiondirectly from an unauthenticated request or treat partition isolation as host authorization.Do not configure
:executorfor step execution.Use explicit
journal_storageonly when replacing the default inferred Ecto storage boundary.
Worker Loop
- Start one or more supervised workers that call
Jizoku.execute_next/1. - Back off briefly when
execute_next/1returns{:ok, :none}. - Add metrics, capacity limits, and shutdown behavior around the public call rather than inside workflow modules.
- Keep workers generic. They should not encode workflow-specific business decisions.
Cron
- Declare cron triggers in workflow modules.
- Keep recurring scheduling in the host app.
- Deliver cron activations with
Jizoku.Executor.Payload.cron/3andJizoku.Runtime.Runner.perform/2. - Include
signal_idor a completeintended_windowfor idempotent cron triggers. - Preserve the active
:partitionin durable cron payloads. - Do not deliver step or compensation payloads through
Runner.perform/2.
Runtime Commands
- Host API and operator boundaries may build
Jizoku.Runtime.Signalvalues and pass them toJizoku.apply_signal/2. - Attach host-owned metadata and idempotency keys for externally delivered commands so duplicate delivery and operator audit history are explicit.
- Preserve the active partition when constructing or adapting signals; a signal whose explicit partition conflicts with runtime options is rejected.
- Assert
command_historyin integration tests for cancel, resume, approval, rejection, replay, and scheduler-driven starts. - Convert outbound commands to raw
Jido.Signalonly throughJizoku.Runtime.Signal.JidoAdapter. Pass recognized inbound Jido command envelopes directly toJizoku.apply_signal/2. Route domain signals through an allowlistedJizoku.Jido.SignalResolver; keep workflow modules and lifecycle command selection in trusted host code. - Do not let resolvers accept storage, queue, runtime, dispatch, or module names from signal payloads. Jizoku keeps those choices at the host call boundary.
- Treat CloudEvents source and ID as one identity. Reusing that pair is an exact delivery retry and reuses the first durable resolver decision; send a new ID for a new domain event.
- Authorize inbound Jido commands before calling Jizoku. Their CloudEvents source is persisted as audit provenance and is not an authorization grant.
Read-Model Visibility
- Authorize run listing, inspection, graph, and explanation calls at the host boundary.
- Use
Jizoku.ReadModel.Visibility.redact/2for default external-safe views orJizoku.ReadModel.Visibility.redact/3with a host policy when exposing read-model data to actor-scoped UI, API, or CLI surfaces. - Treat
:auditorvisibility as privileged; it preserves full snapshots and diagnostics. - Use
:externalor:operatorvisibility for surfaces that need status, current/manual task state, and safe next actions without payloads, command history, claim metadata, attempt inputs/results/errors, or manual metadata. - Keep durable history immutable. Visibility policy derives read-side projections only and must not be treated as deletion or retention policy.
Observability
- Use
Jizoku.Telemetry.metrics/0for the recommended metric definitions; usepartition_metrics/0only after reviewing partition cardinality. - Keep telemetry reporters, exporters, dashboards, alerts, sampling, and structured logger integration in the host app.
- Use trace and run identifiers for diagnostic correlation, not metric labels.
- Reconcile durable operational truth through the read model. Runtime telemetry is best-effort and is not an outbox or exactly-once delivery channel.
Bedrock
- Use Bedrock when the host needs durable backend delivery, delayed visibility, lease ownership, heartbeats, retry requeue, dead-letter behavior, or distributed worker recovery.
- Keep Bedrock code in adapter modules.
- Do not let workflow modules depend on Bedrock APIs.
- Use
examples/bedrock_minimal_host_appas the reference integration shape.