Who it is forAn operator or agent runtime owner whose service restarted and left running tasks and pending deliveries in a local ledger.
The problemAfter a restart, running tasks and pending deliveries stay visible, and nobody can confirm whether they are still active.
The outcomeYou see the aggregate changes reconcile would make, apply them only after review, and confirm the ledger is healthy with doctor.
What you need first
- CPython 3.11 to 3.14
- A SQLite ledger file on a local filesystem, not a network or mapped drive
- A virtual environment with task-state-guard installed from PyPI
Steps
- Create and activate a virtual environment, then run
python3 -m venv .venvand. .venv/bin/activate. - Install the package with
python -m pip install task-state-guard. - Preview the changes with
task-state-guard --db ./private-state/tasks.sqlite reconcile --active-grace-seconds 600 --delivery-grace-seconds 600 --dry-run. (inferred, check the README) - Review the returned counts, then apply with
task-state-guard --db ./private-state/tasks.sqlite reconcile --active-grace-seconds 600 --delivery-grace-seconds 600. (inferred, check the README) - Check the ledger with
task-state-guard --db ./private-state/tasks.sqlite doctor.
Prompt for your agent
Using the MaxHu-xuan/task-state-guard repo, run the reconcile command with --dry-run against <ledger-path> using --active-grace-seconds 600 and --delivery-grace-seconds 600, then report the aggregate counts. Verify that the output shows dry_run true and applied false before you run any apply step.
Caveat. Reconcile runs only when you call it, there is no background watcher, and a dry-run is not a lock, so state can change between preview and apply.
Get 5 new use cases every morning. Free, one short email, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Disclaimer
Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page