Skip to content

Cases for spec#10 (Hooks, lifecycles and workflow roles) #10

Closed

Description

@marlon-sousa

Cases for itinera-dev/spec#10 (Hooks, lifecycles and workflow roles)

Opened before the proposal is accepted, so the checklist exists while it is evaluated (waiting for spec). Updated on 2026-10-02 to match the agreed design in spec#10. The cases pull request may be merged once spec#10 is status: ready.

What the cases must check

Order of hooks

  • A retriable failure with budget left calls the retry hook, then retries; with the budget exhausted, only the failure hook is called, with the cause "retries exhausted".
  • An abnormal termination calls the abnormal termination hook first, then the retry or failure hook.

Lifecycles

  • A success hook returning nothing moves on; after the last step the journey succeeds.
  • FinishWorkflow from a success hook ends the journey as succeeded; remaining steps are not executed.
  • FailWorkflow from a success hook fails the journey; the step stays succeeded and its contributions are committed.
  • FailWorkflow carries a reason, named in the result with the step.
  • FailWorkflow from a retry hook gives up at once, and the failure hook is not called.
  • FinishWorkflow from a failure hook aborts the journey with the reason "invalid lifecycle".

Workflow hooks

  • On success, the workflow success hook runs once; on failure, the workflow failure hook runs once.
  • Neither workflow hook runs when the journey is aborted.
  • Workflow hooks request data from the workflow by key and type, resolved from the data bag (required, optional, wrong type).

Data from the workflow

  • A step hook's request for data from the workflow is resolved like an input of its step: through the step's input adapter for that key if any, otherwise from the data bag.
  • A missing required value aborts the journey, a missing optional one is absent, and a wrong type aborts, for hooks as for steps.

Throwing and reading

  • A hook that throws aborts the journey with the reason "hook threw", and no hook runs afterwards.
  • Hooks can request the attempt number and the journey ID.

Writing

  • A hook's contributions are committed when it returns, even when the step failed.
  • A workflow hook's contributions appear in the journey's output.
  • Events say whether a contribution came from a hook or a step.

Workflow roles

  • A policy requesting a role receives the workflow through that role and can call its operations.
  • A policy requesting a role the workflow does not provide is refused at admission, reported with other violations.
  • The same policy attached to two workflows that both provide its role works in both.

Activity

  1. added
    tier: 1
    implements-proposal
    waiting for spec
    on Oct 2, 2026
  2. changed the title [-]Cases for spec#10 (Hooks and lifecycles)[/-] [+]Cases for spec#10 (Hooks, lifecycles and workflow roles)[/+] 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

    implements-proposaltier: 1waiting for spec

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions