Skip to content

engine+cli: introspection + step-by-step execution (§14)#25

Merged
fruwe merged 1 commit into
mainfrom
stepping-introspection
Jun 30, 2026
Merged

engine+cli: introspection + step-by-step execution (§14)#25
fruwe merged 1 commit into
mainfrom
stepping-introspection

Conversation

@fruwe

@fruwe fruwe commented Jun 30, 2026

Copy link
Copy Markdown
Member

Closes #21.

Implements introspection + step-by-step execution (SPEC §14) in the engine and CLI.

Library (Host/Instance):

  • inject(instance, event, payload=None) — validate + enqueue, no processing (in either
    mode); deliver now delegates to it.
  • step(instance, n=1) — process exactly n RTC steps; returns one per-step record each
    { event, transition, entered, exited, published, spawned, faulted }. Deltas for
    entered/exited come from the active_leaf_names() diff; published/spawned from
    the host deltas; transition is the target state name (captured in run_transition).
  • inspect(instance){ status, config, esvs, queue, deferred, timers, history, dead_letter }.
  • a mode flag (auto|manual) on the host/store; maybe_run() runs to quiescence in auto
    mode only, so manual mode enqueues without processing.

CLI: harel mode [auto|manual] (persisted in the store), harel inject,
harel step [--steps N], harel inspect [--json]. In manual mode send/env/advance
enqueue/arm without running. mode is carried through the store's meta.json.

Tests: unit tests for inject/step/inspect/mode + the auto↔manual toggle, and the new
cli/03-stepping black-box case (suite fetched from fruwehq/harel-conformance@main
until the v0.0.1 tag exists). ruff + mypy clean; 152 tests pass.

@fruwe fruwe merged commit c451fd3 into main Jun 30, 2026
1 check passed
@fruwe fruwe deleted the stepping-introspection branch June 30, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

engine+cli: introspection + step-by-step execution

1 participant