automate_observation: add --events for machine-readable progress - #34
Merged
billy-lau merged 1 commit intoSep 29, 2026
Merged
Conversation
Add an opt-in --events PATH flag ("-" for stdout) that writes progress
as JSON Lines, so CI jobs and other wrappers need not scrape logs.
Events: run_started, devices, device_started, step, device_finished,
run_finished. run_finished comes last even on early exits, exceptions,
Ctrl-C and SIGTERM (caught, then re-raised; a stream without it means
failure, e.g. SIGKILL). It has `ok` and a per-device summary. Device
status is success, partial_check_incomplete, partial_error or failed;
success means the inclusion proof check completed, not that every
split verified. Errors are {reason, message} with stable reason codes.
With "-", other stdout output goes to stderr. Without --events,
behaviour is unchanged, except log lines from the old main() now show
run() as their function name. Schema in docs/automate_observation.md;
additive changes keep v=1.
Test:
- pytest uraniborg/scripts/python/tests/: 116 passed (47 new, 69
existing unmodified).
- Live on an Android 15 emulator: --events -, inclusion proof check,
unknown --serial, SIGTERM mid-run, and no --events (output unchanged).
Change-Id: I04e40b0de40d864aac92ac7bcf466a6ccf606b61
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.
Add an opt-in --events PATH flag ("-" for stdout) that writes progress as JSON Lines, so CI jobs and other wrappers need not scrape logs.
Events: run_started, devices, device_started, step, device_finished, run_finished. run_finished comes last even on early exits, exceptions, Ctrl-C and SIGTERM (caught, then re-raised; a stream without it means failure, e.g. SIGKILL). It has
okand a per-device summary. Device status is success, partial_check_incomplete, partial_error or failed; success means the inclusion proof check completed, not that every split verified. Errors are {reason, message} with stable reason codes.With "-", other stdout output goes to stderr. Without --events, behaviour is unchanged, except log lines from the old main() now show run() as their function name. Schema in docs/automate_observation.md; additive changes keep v=1.
Test:
Change-Id: I04e40b0de40d864aac92ac7bcf466a6ccf606b61