Skip to content

test(flow): encrypted quickstart test follows #2840's act 3 - #2866

Merged
abrichr merged 1 commit into
mainfrom
fix/quickstart-encrypted-break-it
Dec 1, 2026
Merged

abrichr merged 1 commit into
mainfrom
fix/quickstart-encrypted-break-it

Conversation

@abrichr

@abrichr abrichr commented Dec 1, 2026

Copy link
Copy Markdown
Member

Main is red. #2840 replaced quickstart act 3 with a crash and restart of a batch, and renamed run_quickstart's break_it keyword to last_act. packages/flow/tests/test_quickstart_encrypted.py::test_quickstart_on_a_fresh_machine_seals_every_run still passed break_it=True, so flow unit shard 1 fails with a TypeError on every PR.

The test now:

  • passes last_act=True;
  • requires outcome.restart.held, in place of the old OpenEMR-style outcome.broken.stopped;
  • expects act 3's sealed folders (note-1, note-1-restart, note-2-restart) in place of run-broken, still each with no unindexed files.

The test's purpose doesn't change: every run, act 3 included, seals with encryption on, on a fresh machine.

Checked locally: the test passes (1 passed, about 19 s), and ruff check and format are clean. No other caller passes break_it=.

#2840 replaced act 3 with a crash and restart of a batch and renamed
run_quickstart's break_it to last_act, so this test failed with a
TypeError on main. It now runs act 3, requires the restart to hold,
and checks that note-1 and both restart runs are sealed with no
unindexed files.
@abrichr

abrichr commented Dec 1, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: APPROVE

From: Grok
Reviewed-Head: 9a7f928

I found no blocker. This is a one-file test update that matches #2840's run_quickstart contract, and it is the right fix for the TypeError that is failing Flow unit CI on current main.

Behavior

  • run_quickstart at this head takes last_act: bool, not break_it. I found no remaining run_quickstart(..., break_it=) caller.
  • With the default MockMed engine, Act 3 is crash_and_restart: it writes restart/note-1, then restart/note-1-restart and restart/note-2-restart. RestartFacts.held is the success predicate (note 1 saved, the worker killed, note 1 skipped with no actions, note 2 saved, each note once in its database). Replacing outcome.broken.stopped with outcome.restart is not None and outcome.restart.held matches that.
  • The sealed-folder assertion now requires those three Act 3 names in addition to recording, bundle, and run-1. Because the test matches on p.name, the restart/ prefix does not matter. Every sealed folder is still checked for unindexed files. run-{index} still has to be VERIFIED and to contain seal.json, receipt.json, and a sealed run-summary.json.

I confirmed the failure on current main in OpenAdapt#2848's flow core unit (shard 3/4) junit (run 46554348944): TypeError: run_quickstart() got an unexpected keyword argument 'break_it' at 0.004s. (Shard packing is by measured file time, so this test is not always in shard 1.) ruff check on the changed file is clean.

Generality: no change inside packages/flow/openadapt_flow. The new folder names come from the launcher's default MockMed Act 3 (openadapt/quickstart/restart.py), which this test already drives. The engine-agnostic rule is not affected.

Limitations, not blockers:

  • I did not re-run the ~19s hidden-browser test on this box. The TypeError evidence is from fix(flow): declare constellations.json so wrap publish keeps it intact #2848's CI against main e8be026847c9, and the new names and held check were read against crash_and_restart / RestartFacts at this head.
  • Act 3 folders are checked for a complete seal, not for VERIFIED the way run-1 is. That is appropriate for the skipped note-1-restart run.

CI at this head: dependency-review, gitleaks, validate-platform-manifest, smoke, and launcher / run-ci have passed; review-verdict passed (no protected paths). packages / scope was still queued when I posted, so this PR's own Flow unit shards had not started. I am not merging. No release decision is needed for this test-only fix; the maintainer can merge once this PR's Flow unit shards are green.

@abrichr
abrichr enabled auto-merge December 1, 2026 03:08
@abrichr

abrichr commented Dec 1, 2026

Copy link
Copy Markdown
Member Author

Independent adversarial review: REQUEST CHANGES

From: Codex
Reviewed-Head: 9a7f928

last_act=True selects the MockMed restart. restart.held requires the worker to stop, the replay of note 1 to take zero actions, and both notes to exist exactly once. All three expected folder names match the implementation. The headless fresh-home test passed (python -m pytest -q tests/test_quickstart_encrypted.py, 1 passed in 18.21s).

One coverage gap remains at packages/flow/tests/test_quickstart_encrypted.py:117. The existing _unindexed helper compares disk files with opened._files after open_set has added allowed files it found on disk. I checked the stored indexes from the passing run. All three restart folders matched exactly. In run-1, both seal.json and seal.html were absent from the stored index, yet the assertion passed.

Please compare each restart run directory with its stored index before reconciliation. For Act 2, account explicitly for the Seal files written after finalization. This keeps the expected exports working and makes an unexpected unindexed file fail the test.

@abrichr
abrichr added this pull request to the merge queue Dec 1, 2026
Merged via the queue into main with commit a8cc637 Dec 1, 2026
49 checks passed
@abrichr
abrichr deleted the fix/quickstart-encrypted-break-it branch December 1, 2026 05:26
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