|
| 1 | +================================================== |
| 2 | +New Features (2026-06-19) — Checkpoint & Resume |
| 3 | +================================================== |
| 4 | + |
| 5 | +Durable execution for long action lists, plus a ``py.typed`` marker so the |
| 6 | +package's inline type hints are honored by type checkers. Pure standard |
| 7 | +library; wired through the full stack (facade, ``AC_*`` executor commands, |
| 8 | +MCP tools, Script Builder). |
| 9 | + |
| 10 | +.. contents:: |
| 11 | + :local: |
| 12 | + :depth: 2 |
| 13 | + |
| 14 | + |
| 15 | +Flow checkpoint & resume |
| 16 | +======================= |
| 17 | + |
| 18 | +A multi-hour unattended flow that dies at step 400 should not restart from |
| 19 | +zero. :func:`run_resumable` persists ``{run_id, step_index, variables}`` |
| 20 | +after each executed step to a pluggable store; on a later run with the same |
| 21 | +``run_id`` it fast-forwards past completed steps and rehydrates the script |
| 22 | +variables:: |
| 23 | + |
| 24 | + from je_auto_control import run_resumable, CheckpointStore |
| 25 | + |
| 26 | + store = CheckpointStore("runs.db") |
| 27 | + result = run_resumable(actions, run_id="nightly-invoices", store=store) |
| 28 | + result["resumed_from"] # 0 on a fresh run, N when resuming after a crash |
| 29 | + |
| 30 | +On normal completion the checkpoint is cleared. The store is injectable, so |
| 31 | +resume is unit-tested deterministically without a real crash: |
| 32 | +``CheckpointStore.save`` / ``load`` / ``clear``. |
| 33 | + |
| 34 | +Executor / MCP commands: |
| 35 | + |
| 36 | +* ``AC_run_resumable`` — run ``actions`` with checkpoint/resume keyed by |
| 37 | + ``run_id`` (persisted to ``db``). |
| 38 | +* ``AC_checkpoint_status`` — the saved checkpoint for a run (or null). |
| 39 | +* ``AC_checkpoint_clear`` — delete a run's checkpoint. |
| 40 | + |
| 41 | +(and the matching ``ac_run_resumable`` / ``ac_checkpoint_status`` / |
| 42 | +``ac_checkpoint_clear`` MCP tools). |
| 43 | + |
| 44 | + |
| 45 | +``py.typed`` marker |
| 46 | +================== |
| 47 | + |
| 48 | +The package now ships a PEP 561 ``py.typed`` marker, so Mypy / Pyright / |
| 49 | +Pylance honor AutoControl's inline type annotations in downstream code — |
| 50 | +completing the value of the typed public API. No code change for callers; |
| 51 | +just better editor autocompletion and type checking out of the box. |
0 commit comments