Who it is forAn operations engineer who needs to decide whether a local workflow ledger is trustworthy after an incident or a restart.
The problemTask history may contain inconsistent states, timestamps, or event chains, and reading raw task data risks exposing prompts or task bodies.
The outcomeYou get a counts-only health result with an exit code of 0 for a healthy ledger and 1 when inconsistencies exist.
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. - Run
task-state-guard --db ./private-state/tasks.sqlite doctor. - Read the aggregate output and the exit code, where 0 means healthy and 1 means a structure, state, timestamp, or event chain inconsistency exists in the current database.
Prompt for your agent
Using the MaxHu-xuan/task-state-guard repo, run the doctor command against <ledger-path> and report the aggregate counts and the exit code. Verify that the output contains only counts and no task IDs, prompts, or message bodies.
Caveat. Doctor reports inconsistencies in the current database only, and the README does not describe a repair step, so a failing result still needs operator review.
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