Repository navigation
Description
What happens
On a fresh machine, openadapt quickstart exits 1 with encryption at rest on, which has been the default since #2423 (Flow 4.0.0). The first run reaches "Saved and checked", the break-the-save act completes, and then sealing the runs fails:
File "openadapt/quickstart/engine.py", line 884, in seal_runs
seal = seal_run(run.run_dir, home=seal_home(), enqueue=False)
File "openadapt_flow/offline_seal.py", line 415, in seal_run
raw = sealed_set.read_bytes(report_path)
File "openadapt_flow/sealed_set.py", line 1407, in open_set
return SealedSet.open(base, passphrase)
File "openadapt_flow/sealed_set.py", line 835, in open
files = _reconcile_run_files(base, files, present)
File "openadapt_flow/sealed_set.py", line 921, in _reconcile_run_files
raise SealedSetError(
openadapt_flow.sealed_set.SealedSetError: .../openadapt-quickstart/run-1 holds run-summary.json in plaintext, outside its sealed index
The above exception was the direct cause of the following exception:
...
openadapt_flow.offline_seal.LocalSealError: report_unreadable: .../openadapt-quickstart/run-1/report.json
With OPENADAPT_ENCRYPT_AT_REST=0 the same command exits 0.
Affected versions
- Released
openadapt1.24.0 withopenadapt-flow4.0.0 from PyPI: affected (reproduced in a clean venv). mainat a1370c7 from source: affected. Grok first reported it on 5fb2913.- fix(quickstart): respect OPENADAPT_RECEIPT=off and accept record/run/v1 receipts in lifecycle check #2659 does not fix it.
Reproduce
Run with an empty HOME, so there is no key and no seal home yet:
python3.12 -m venv /tmp/qs && /tmp/qs/bin/pip install "openadapt==1.24.0" "openadapt-flow==4.0.0"
mkdir -p /tmp/qs-home /tmp/qs-work && cd /tmp/qs-work
env -i PATH=/tmp/qs/bin:/usr/bin:/bin HOME=/tmp/qs-home \
OPENADAPT_FLOW_KEY_STORE=file OPENADAPT_FLOW_BROWSER=bundled \
/tmp/qs/bin/openadapt quickstart; echo "exit=$?" # exit=1On my repro, OPENADAPT_FLOW_KEY_STORE=file kept the key out of the OS keychain and OPENADAPT_FLOW_BROWSER=bundled used Playwright's headless shell. Neither setting is needed to trigger the bug.
Cause
The tutorial path (openadapt_flow.tutorial.run_tutorial and the launcher's openadapt/quickstart/engine.py) calls openadapt_flow.receipt.write_receipt after the run finished. write_receipt writes run-summary.json, run-summary.md and run-summary.png with plain Path.write_bytes/write_text/Image.save, straight into the encrypted run folder. The run's sealed set does not know those names: before Flow 3.5 the summary was receipt.json/.md/.png, and the run inventory still lists only those names as allow-listed plaintext. So the next read of the run (here seal_run) refuses the folder, as it should for any plaintext file outside the index.
The OpenEMR quickstart (--app openemr) has the same problem in its halted run. It writes screen.png (driver Session.screenshot) and quickstart-readback.json, which names a synthetic patient, directly into run-broken.
Why CI missed it
The launcher's quickstart tests use a fake engine, and tests/conftest.py sets OPENADAPT_FLOW_PLAINTEXT_AT_REST. The one real encrypted quickstart test (test_real_quickstart) is opt-in (OPENADAPT_REAL_QUICKSTART=1) and no workflow sets that. The Flow suite's encrypted lane (OPENADAPT_TEST_DEFAULT_AT_REST=1) has no test that drives the quickstart or seals a run after the summary is written. The weekly quickstart-lifecycle job installs Flow from PyPI.
Fix direction
Write the summary through the run's sealed set, so the folder's index names it, and add the three run-summary.* names to the run inventory as allow-listed plaintext, next to their old receipt.* names. Write the OpenEMR files through the set too. Keep seal_run and the reconcile step as they are: any other plaintext file must still make the run refuse. Add an encrypted, empty-HOME quickstart test that runs in the Flow encrypted CI lane and checks that every file in each sealed folder is in that folder's index.
Activity
abrichr commentedon Nov 25, 2026
Traceback from the released packages (openadapt 1.24.0, openadapt-flow 4.0.0 from PyPI, clean venv, empty HOME), paths shortened: