What do you want to do?
3 use cases
-
Preview restart cleanup of stuck tasks before applying it
Dry-run a SQLite task ledger, review aggregate counts, then apply timeouts and delivery closures.
- Task State Guard
- Software and DevOps
- Intermediate
View prompt
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.
-
Record task and delivery closures only from real outcomes
Write terminal task states and delivery states from a Python worker without guessing success.
- Task State Guard
- Software and DevOps
- Intermediate
View prompt
Using the MaxHu-xuan/task-state-guard repo, write a short Python script that creates a task in <ledger-path>, starts it, and closes it as succeeded only after your worker reports success. Verify that you call set_delivery with delivered only after a real transport acknowledgement, and report the final task and delivery states.
-
Check a workflow ledger's health before trusting its history
Run a counts-only doctor check on a SQLite task ledger and read its exit code.
- Task State Guard
- Software and DevOps
- Intermediate
View prompt
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.
How to use Task State Guard
- Check you have what it needs: 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.
- Open MaxHu-xuan/task-state-guard on GitHub and read the README and license.
- 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)
These steps come from our top use case, Preview restart cleanup of stuck tasks before applying it, which also has a copy-paste agent prompt.
Get 5 new use cases every morning. Free, one short email, unsubscribe anytime.
Get them freeTask State Guard alternatives · Best AI repos for Software and DevOps
About this repo
- Who it is forDevelopers and operators running AI agents, background workers, or local workflows that need to recover task state after a restart or timeout.
- Why it is hot
- LanguagePython
- Sourcegithub.com/MaxHu-xuan/task-state-guard · Back to Hot repos
Requirements
- 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
Maintain Task State Guard? Add the Featured on Deduped badge
Paste this into your README:
[](https://dedupedai.com/use-cases/maxhu-xuan-task-state-guard/?ref=badge)
Questions about Task State Guard
What is Task State Guard?
TaskStateGuard is a Python library and CLI that reconciles stuck AI-agent task and delivery states in a local SQLite ledger. It is an open-source project on GitHub: https://github.com/MaxHu-xuan/task-state-guard.
Who is Task State Guard for?
Developers and operators running AI agents, background workers, or local workflows that need to recover task state after a restart or timeout.
What can I do with Task State Guard?
3 use cases so far, for example: Preview restart cleanup of stuck tasks before applying it; Record task and delivery closures only from real outcomes; Check a workflow ledger's health before trusting its history. Each has steps and a copy-paste agent prompt.
What do I need to run Task State Guard?
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.
What are alternatives to Task State Guard?
Other hot AI repos in Software and DevOps: Harness2, iFixAi, Orca, Diagram Design, AI Memory.
Is Task State Guard safe to run?
Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.