Skip to content

Events #11

Closed
Closed

Description

@marlon-sousa

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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. With no reporter at all, events are produced and go nowhere.
  6. 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.
  7. 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 the journey_aborted event to every other reporter it holds, so an abort is never invisible.
  8. 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.
  9. Reporters may be synchronous or asynchronous, under the same executor capability rules as steps and hooks (The local executor #12).

The event stream

  1. 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_aborted is always the last event (Amends #9: configuration errors found while running #32).
  2. 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).
  3. 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

  1. 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.
  2. Events about a step also carry the step name and the attempt number.
  3. 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.
  4. Event kinds are snake_case.

The engine catalogue (tier 1)

  1. The engine emits exactly these events:

    Event When Also carries
    journey_started the journey starts the initial keys, never their values
    attempt_started an attempt of a step starts step, attempt
    input_adapter_supplied an input adapter supplies a value step, key
    input_adapter_failed an input adapter fails step, key
    optional_input_absent an optional input has no value step, key
    step_succeeded a step succeeds step, attempt
    step_failed a step fails step, attempt, retriable, reason (code, message, details)
    step_skipped a step is skipped step, attempt, reason, if any
    abnormal_termination an error escapes a running step step, attempt, error message
    hook_called a hook returns policy, hook, step and attempt if any, the lifecycle returned or none
    contribution_committed a contribution reaches the data bag key, source: the step, or the policy and hook
    contributions_discarded a skipped step's contributions are discarded step, attempt
    data_overwritten a committed key replaces an earlier value key, source
    journey_succeeded the journey succeeds
    journey_failed the journey fails the step and its reason or cause, or the step whose hook returned FailWorkflow and its reason
    journey_aborted the 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

  1. Steps may emit only step_info, step_warning and step_error, through their step reporter. Hooks may emit only journey_info, journey_warning and journey_error; step hooks and workflow hooks alike.
  2. 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.
  3. Emitting never fails and never changes an outcome.

Policy events

  1. Every policy's effect is traceable: hook_called records each hook's decision, every journey_* 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

  1. When this proposal is accepted, the provisional event names used in the conformance cases are replaced by the names in item 17.

Tier

Activity

  1. added
    proposal
    status: planned
    tier: 1
    on Oct 1, 2026
  2. marlon-sousa commented on Oct 1, 2026

    @marlon-sousa
    Author
  3. marlon-sousa commented on Oct 1, 2026

    @marlon-sousa
    Author
  4. added
    status: evaluating
    and removed
    status: planned
    on Oct 2, 2026
  5. marlon-sousa commented on Oct 2, 2026

    @marlon-sousa
    ContributorAuthor

    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_aborted still reaches the others; the stream is never rewritten and journey_aborted is 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_* and journey_* events from steps and hooks; and policy events answered by hook_called and 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.

  6. marlon-sousa commented on Oct 2, 2026

    @marlon-sousa
    Author
  7. added
    status: ready
    and removed
    status: evaluating
    on Oct 2, 2026
  8. github-actions commented on Oct 2, 2026

    @github-actions

    Accepted on 2026-10-02 in #36.

  9. locked as resolved and limited conversation to collaborators on Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalstatus: readytier: 1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions