Repository navigation
feat(quickstart): replace act 3 with a crash and restart of a batch - #2840
Merged
Merged
Conversation
Act 3 on MockMed no longer makes a save fail silently. It runs a batch of two notes in a worker process, stops it with SIGKILL after note 1 is saved and checked, and restarts the batch with the same on-disk IdempotencyLedger. The replayer sends no save for note 1 and saves note 2; each note's database is read afterwards. --no-restart replaces --no-break (kept hidden). OpenEMR's Act 3 is unchanged.
MockMed drops a save whose key it already holds, so one record per note can't rule out a resend. The database line now credits 'saved once' only when the restart report shows note 1 skipped with no actions and a VERIFIED ledger outcome. A worker that doesn't finish note 1 is reported as not finishing, not as stopping early (a timeout leaves it running). Review findings 1, 2 and 5 on #2840.
abrichr
enabled auto-merge
November 30, 2026 21:52
Read settled outcomes through one helper (says_verified) instead of four literal comparisons, narrow the optional REPORT.md handler, report a worker failure with contextlib.suppress and exit it cleanly, and update the agent README test to the new plain quickstart command.
This was referenced Dec 1, 2026
Merged
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.
Problem
Act 3 of
openadapt quickstarton MockMed made one save fail silently (the screen showed its saved message, the database had nothing, and OpenAdapt stopped). We no longer lead with that framing anywhere, and the quickstart is the first command people run at launch.Change
Act 3 on MockMed is now a crash and a restart, built on the engine's own at-most-once ledger:
IdempotencyLedgerattached on disk (<out>/restart/ledger/). The replayer reserves the note's key before its first action and records the outcome after the record check.SIGKILL, before note 2 starts.idempotent_replay, 0 actions). Note 2 runs and saves.packages/flow: this composes Flow 4.0.1's public pieces (run gate,Replayer(idempotency_ledger=...),IdempotencyLedger), so it works with the Flow on PyPI.Limits, stated plainly:
Also:
--no-restartreplaces--no-break(kept as a hidden alias).--break-itstays hidden; with a current Flow it runs this quickstart. With engine-only flags or a Flow older than the quickstart minimum it still reaches the engine's owntutorial --break-it, unchanged.--app openemrkeeps its Act 3 (a referral that matches an existing chart; the program stops before saving). It is not a fake banner. Its code path moved into_break_actin the story, and its plain-view label column is narrower now that the bot row is gone (snapshot updated). Not run in Docker here.Real run (headless, this checkout, Flow 4.0.1 from PyPI, macOS, fresh key and Seal homes)
stdout below; stderr was empty. Exit code 0.
No browser or driver process from the run was left afterwards.
Tests and gates
tests/(repo.venv, Flow 4.0.1, via the shared CPU-slot runner): 3493 passed, 32 skipped, 31 xfailed.OPENADAPT_REAL_QUICKSTART=1 pytest tests/test_quickstart.py::test_real_quickstart(real browser, fresh at-rest home; asserts the restart held, note 1 skipped with 0 actions, and therestart/note-1folder is encrypted): passed.tests/test_quickstart_restart.py: the restart reuses the ledger after the kill, a duplicate isn't reported as held, a missing worker skips the act, and a real spawned worker is stopped with SIGKILL.ruff check openadapt tests scriptsandruff format --check openadapt/: clean.mypyon the touched quickstart modules: 2 errors, both inview.py's_draw_screenshot, which this PR doesn't change (also on main).scripts/check_file_size_ratchet.py --base origin/main: passes.scripts/build_capabilities.py --check-pr origin/mainand--guard: pass. There is nocheck_verdict_folds.pyin this repo.--watch(no headed browser on this Mac), Linux, Windows,--app openemr, Flow frompackages/flowsource.