cli: batch/streaming mode (harel run) per SPEC §13.7#15
Merged
Conversation
Add `harel run [-]`: read NDJSON argv lines from stdin (or a file), run each
command in order against one store + virtual clock, and stream one NDJSON result
object per line (`{ ok, exit, result, error? }`). A failing line does not abort
the stream; the process exit is the first non-zero line exit. Add `python -m
harel` entry point.
Switch CLI conformance to a true black box: delegate to the spec repo's
`conformance/run_cli.py`, invoking `python -m harel` as a subprocess (§13.6).
Bump the vendor/harel submodule to the commit carrying §13.7, run_cli.py, and the
02-stream case. Exclude the vendored submodule from ruff.
Closes #12.
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 #12. Implements the streaming mode specced in fruwehq/harel#14 (SPEC §13.7).
What
harel run [-]reads NDJSON argv lines from stdin (or a file arg), executes each command in order against one store + one virtual clock, and streams one NDJSON result object per line:{ ok, exit, result, error? }, flushed as it completes.runare rejected per-line (exit 2).python -m harelentry point.Conformance / black box
vendor/harelsubmodule to the commit carrying §13.7,conformance/cli/02-stream, and the referencerun_cli.py.run_cli.py, invokingpython -m harelas a subprocess — catching packaging/entry-point regressions an in-process import would mask. Bothcli/01-turnstileandcli/02-streampass.ruff + mypy clean; full suite green (135 tests).