Skip to content

The local executor #12

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.

The local executor (tier 1)

What an executor is, how it is called, the tier 1 capabilities, and the guarantee that nothing leaks between journeys. Builds on proposals 0002, 0008, 0009, 0010, 0011 and 0032.

Executors

  1. Executors differ in capability, never in meaning. A lifecycle, an outcome, a status or an event means the same under every executor.
  2. The local executor runs a journey in process, with no persistence: a journey lives only as long as the call that runs it, and nothing survives a crash. Durable executors belong to a later tier.

Running a journey

  1. run(workflow instance) runs exactly one journey and returns its result: succeeded, failed or aborted (proposal 0009). It never throws for anything that happens inside the journey; failures and aborts are in the result. An asynchronous executor returns the same result asynchronously.
  2. The executor asks the workflow instance for its step descriptors, data and reporters (proposals 0009 and 0011).
  3. A workflow instance runs at most one journey. Handing an instance that has already run, or is running, to an executor is a configuration error: its data bag already belongs to a journey.

Stateless, one journey at a time

  1. An executor is stateless between journeys. When run returns, nothing of that journey remains in the executor: no data, no statuses, no reporters. An executor may run many journeys, one after another.
  2. One journey at a time. An executor never runs two journeys concurrently. A call to run while another journey is running on the same executor is refused before anything starts: no journey, no events. Implementations should make this impossible where their language allows it. For parallelism, create several executors, for example one per thread.
  3. One dispatcher per journey. The default dispatcher is created afresh for each journey. A dispatcher given to the executor (proposal 0011) is used for each journey in turn; the workflow's reporters added for a journey are removed when that journey ends, so they never receive another journey's events.

Capabilities in tier 1

  1. Execution modes: sync and async. An executor declares which modes it accepts, for steps, hooks and reporters alike. Anything it does not accept is a configuration error (proposal 0032): caught when the workflow is built if the language can, otherwise when the journey runs. A language offers whichever executors make sense for it; whether an asynchronous executor also accepts synchronous steps is that language's choice, stated as a capability.
  2. Configuration checks: build-time-configuration-check or run-time-configuration-check (proposal 0032). A language claims exactly one.
  3. A language claims its capabilities alongside its tier, and its conformance runner runs the cases tagged with them.

Not in tier 1

  • Executors that require particular hooks, for example for pending steps: with durable runs.
  • Persistence, resuming after a crash, and pending steps: durable runs.

Tier

Activity

  1. added
    proposal
    status: planned
    tier: 1
    status: evaluating
    and removed
    status: planned
    on Oct 1, 2026
  2. 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 holds the agreed design. The conformance checklist is updated in itinera-dev/conformance#12. This proposal is ready for a maintainer to set status: ready.

  3. added
    status: ready
    and removed
    status: evaluating
    on Oct 2, 2026
  4. github-actions commented on Oct 2, 2026

    @github-actions

    Accepted on 2026-10-02 in #37.

  5. 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