Skip to main content

Admit, observe and settle

run() admits the workflow first — a file that fails admission throws NikaOperationError and no handle is created. The returned NikaRun carries id plus the observation methods; the run itself is not an async iterator. Subscribe through run.events(); the result for this observation leg lives in run.result(). The result’s settlement carries the engine’s cause, task tally, spend, elapsed time and error when available. A paused result closes observation at a human gate without claiming the workflow can never resume.

Stop observation without cancelling

Aborting the observer stops only that view. It never cancels engine work.

Cancel explicitly

Cancellation is idempotent for a run owned by this client. Passing a run from another client instance throws NikaRunOwnershipError. cancellation_requested acknowledges the action, not its outcome. Keep awaiting run.result(): the actual runtime result may be cancelled, succeeded, failed or paused. A missing runtime settlement after the resident’s grace period is reported as interrupted rather than fabricated cancellation.

Events

Design an additive event reducer.

Receipts

Preserve and verify engine-issued proof.