{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "maxhu-xuan-task-state-guard--audit-workflow-ledger-health-with-doctor",
 "repo": "MaxHu-xuan/task-state-guard",
 "repo_url": "https://github.com/MaxHu-xuan/task-state-guard",
 "repo_slug": "maxhu-xuan-task-state-guard",
 "title": "Check a workflow ledger's health before trusting its history",
 "page_title": "How to check a workflow ledger's health before trusting its history with Task State Guard",
 "summary": "Run a counts-only doctor check on a SQLite task ledger and read its exit code.",
 "who": "An operations engineer who needs to decide whether a local workflow ledger is trustworthy after an incident or a restart.",
 "problem": "Task history may contain inconsistent states, timestamps, or event chains, and reading raw task data risks exposing prompts or task bodies.",
 "outcome": "You get a counts-only health result with an exit code of 0 for a healthy ledger and 1 when inconsistencies exist.",
 "steps": [
  "Create and activate a virtual environment, then run `python3 -m venv .venv` and `. .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."
 ],
 "agent_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.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "15 minutes",
 "basis": "readme",
 "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.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "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"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/maxhu-xuan-task-state-guard/audit-workflow-ledger-health-with-doctor/",
 "md": "https://dedupedai.com/use-cases/maxhu-xuan-task-state-guard/audit-workflow-ledger-health-with-doctor/index.md",
 "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 hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/maxhu-xuan-task-state-guard--audit-workflow-ledger-health-with-doctor.json",
 "api_version": "v1"
}
