Skip to content

cli: batch/streaming mode (harel run) per SPEC §13.7#15

Merged
fruwe merged 1 commit into
mainfrom
cli-streaming
Jun 30, 2026
Merged

cli: batch/streaming mode (harel run) per SPEC §13.7#15
fruwe merged 1 commit into
mainfrom
cli-streaming

Conversation

@fruwe

@fruwe fruwe commented Jun 30, 2026

Copy link
Copy Markdown
Member

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.
  • A failing line does not abort the stream; the process exit code is the first non-zero line exit, else 0. Malformed lines and nested run are rejected per-line (exit 2).
  • Adds a python -m harel entry point.

Conformance / black box

  • Bumps the vendor/harel submodule to the commit carrying §13.7, conformance/cli/02-stream, and the reference run_cli.py.
  • Switches this repo's CLI conformance to a true black box (spec/conformance: language-agnostic black-box CLI conformance runner harel#16): the harness now delegates to the spec repo's run_cli.py, invoking python -m harel as a subprocess — catching packaging/entry-point regressions an in-process import would mask. Both cli/01-turnstile and cli/02-stream pass.
  • Adds direct unit tests for streaming (happy path, failure-doesn't-abort + exit aggregation, malformed line, nested-run guard).

ruff + mypy clean; full suite green (135 tests).

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.
@fruwe fruwe merged commit b0bbad6 into main Jun 30, 2026
1 check passed
@fruwe fruwe deleted the cli-streaming branch June 30, 2026 07:52
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.

cli: implement streaming/batch command mode (harel#14)

1 participant