engine+cli: introspection + step-by-step execution (§14)#25
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 eithermode);
delivernow delegates to it.step(instance, n=1)— process exactlynRTC steps; returns one per-step record each{ event, transition, entered, exited, published, spawned, faulted }. Deltas forentered/exitedcome from theactive_leaf_names()diff;published/spawnedfromthe host deltas;
transitionis the target state name (captured inrun_transition).inspect(instance)—{ status, config, esvs, queue, deferred, timers, history, dead_letter }.modeflag (auto|manual) on the host/store;maybe_run()runs to quiescence in automode 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 modesend/env/advanceenqueue/arm without running.
modeis carried through the store'smeta.json.Tests: unit tests for inject/step/inspect/mode + the auto↔manual toggle, and the new
cli/03-steppingblack-box case (suite fetched fromfruwehq/harel-conformance@mainuntil the
v0.0.1tag exists). ruff + mypy clean; 152 tests pass.