Repository navigation
Description
Agreed design as of 2026-10-02. Proposed by @marlon-sousa; the original text is in this issue's edit history.
Events (tier 1)
How events are produced and delivered, the engine's catalogue, what every event carries, and what steps and hooks may emit. Builds on proposals 0002, 0008, 0009, 0010, 0024 and 0027, and on #32.
Reporters and delivery
- Reporters. A reporter has one operation, report, which receives an event and decides on its own what to do with it: filter, map, forward or ignore.
- The workflow lists its reporters. A workflow declares the reporters it wants its journeys reported to; which reporters matter is the workflow's decision, not the executor's.
- The executor owns the event dispatcher. A dispatcher has two operations: add a reporter, and dispatch an event to the reporters it holds. For each journey, the executor asks the workflow instance for its reporters, adds each to its dispatcher, and dispatches every event through it.
- A dispatcher can be given to the executor. An executor either receives a dispatcher when it is created and uses it, or creates the default dispatcher. A dispatcher given to the executor decides what adding a reporter means: for example, a test can give the executor a dispatcher holding only the test's recording reporter, which ignores every reporter the workflow adds, so the test sees exactly its own reporter and nothing else.
- With no reporter at all, events are produced and go nowhere.
- The default dispatcher's delivery rules. It calls reporters in the order they were added, with every event in sequence order; every reporter it holds receives the same events. A dispatcher given to the executor defines its own delivery, except for the next rule, which always applies.
- A reporter that throws aborts the journey, with the abort reason
reporter threw(proposal 0009). Reporters should be written so they cannot throw, where the language allows it. The dispatcher still delivers thejourney_abortedevent to every other reporter it holds, so an abort is never invisible. - Calling the reporter is all the dispatcher does. Reporters should be fast, but nothing stops a slow one; that is the workflow author's choice.
- Reporters may be synchronous or asynchronous, under the same executor capability rules as steps and hooks (The local executor #12).
The event stream
- Events are never rolled back or rewritten, even when an attempt's contributions are discarded. A journey that is aborted keeps every event emitted before;
journey_abortedis always the last event (Amends #9: configuration errors found while running #32). - No events before a journey exists. A configuration error caught when the workflow is built produces no event (Amends #9: configuration errors found while running #32).
- The conformance trace of a journey is its event stream. A conformance runner gives the executor a dispatcher holding its recording reporter. A workflow refused before any journey exists has no event stream: its trace is the refusal itself, the error listing every violation that building or admitting the workflow returns, which the runner checks directly.
Fixed fields
- Every event carries: its kind, a sequence number increasing within the journey, a timestamp (UTC, ISO 8601; conformance cases never compare timestamps), the journey ID and the workflow name. There is no run ID in tier 1.
- Events about a step also carry the step name and the attempt number.
- Events from or about a hook also carry the policy name and the hook name, and, for a step hook, the step and attempt that triggered it.
- Event kinds are snake_case.
The engine catalogue (tier 1)
-
The engine emits exactly these events:
Event When Also carries journey_startedthe journey starts the initial keys, never their values attempt_startedan attempt of a step starts step, attempt input_adapter_suppliedan input adapter supplies a value step, key input_adapter_failedan input adapter fails step, key optional_input_absentan optional input has no value step, key step_succeededa step succeeds step, attempt step_faileda step fails step, attempt, retriable, reason (code, message, details) step_skippeda step is skipped step, attempt, reason, if any abnormal_terminationan error escapes a running step step, attempt, error message hook_calleda hook returns policy, hook, step and attempt if any, the lifecycle returned or none contribution_committeda contribution reaches the data bag key, source: the step, or the policy and hook contributions_discardeda skipped step's contributions are discarded step, attempt data_overwrittena committed key replaces an earlier value key, source journey_succeededthe journey succeeds journey_failedthe journey fails the step and its reason or cause, or the step whose hook returned FailWorkflowand its reasonjourney_abortedthe journey is aborted the step, if any, the abort reason and its details (Amends #9: configuration errors found while running #32)
17a. Order within a journey. Events follow what happens, in this order:
1. journey_started;
2. for each attempt of a step: attempt_started; the input events (input_adapter_supplied, input_adapter_failed, optional_input_absent) in the order the inputs are resolved; the step's own step_* events, in the order emitted; then the outcome event (step_succeeded, step_failed, step_skipped or abnormal_termination);
3. on success, one contribution_committed per committed key, each followed by data_overwritten when it replaced a value; for a skip, contributions_discarded;
4. then, for each hook called, any journey_* events it emits, followed by its hook_called, then its own contribution_committed (and data_overwritten) events;
5. finally journey_succeeded, journey_failed or journey_aborted; workflow hooks run before it, with their events in the same pattern.
18. No separate status-change events. Every step status follows from these events.
19. Engine events never carry data values, only keys. Reasons and error messages are carried because their authors wrote them.
What steps and hooks emit
- Steps may emit only
step_info,step_warningandstep_error, through their step reporter. Hooks may emit onlyjourney_info,journey_warningandjourney_error; step hooks and workflow hooks alike. - Authors supply only a message and optional data. The data must be serializable and is serialized when the event is emitted; if it cannot be serialized, the event is still delivered, with a marker saying so.
- Emitting never fails and never changes an outcome.
Policy events
- Every policy's effect is traceable:
hook_calledrecords each hook's decision, everyjourney_*event a hook emits carries its policy and hook, and every contribution a hook makes says so. No further policy events are needed in tier 1.
Provisional names in the cases
- When this proposal is accepted, the provisional event names used in the conformance cases are replaced by the names in item 17.
Activity
marlon-sousa commentedon Oct 1, 2026
marlon-sousa commentedon Oct 1, 2026
marlon-sousa commentedon Oct 2, 2026
Claude summary
Posted by Claude (Claude Code) from a maintainer's account, as described in PROCESS.md.
Evaluated with the maintainer outside the thread on 2026-10-02; every question was settled. The issue body now holds the agreed design, with the original proposal kept at the end; the earlier comments are folded in and hidden as outdated.
Decided: the workflow registers reporters (one report operation), delivered in registration and sequence order; a reporter that throws aborts the journey, and
journey_abortedstill reaches the others; the stream is never rewritten andjourney_abortedis always the last event; no events before a journey exists; the fixed fields (no run ID, no step type); snake_case kinds; the tier 1 engine catalogue of 16 events; no status-change events; engine events carry keys, never values;step_*andjourney_*events from steps and hooks; and policy events answered byhook_calledand policy names on events. Configuration errors found while running are defined in the amendment #32.The conformance checklist is updated in itinera-dev/conformance#11. This proposal is ready for a maintainer to set
status: ready.marlon-sousa commentedon Oct 2, 2026
github-actions commentedon Oct 2, 2026
Accepted on 2026-10-02 in #36.