Skip to content

automate_observation: add --events for machine-readable progress - #34

Merged
billy-lau merged 1 commit into
android:mainfrom
billy-lau:uraniborg/machine-readable-progress
Sep 29, 2026
Merged

billy-lau merged 1 commit into
android:mainfrom
billy-lau:uraniborg/machine-readable-progress

Conversation

@billy-lau

Copy link
Copy Markdown
Member

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

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
@billy-lau
billy-lau merged commit 6f1de4a into android:main Sep 29, 2026
7 checks passed
@billy-lau
billy-lau deleted the uraniborg/machine-readable-progress branch September 29, 2026 15: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.

1 participant