DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to check a workflow ledger's health before trusting its history with Task State Guard

Run a counts-only doctor check on a SQLite task ledger and read its exit code.

Short answer: Create and activate a virtual environment, then run python3 -m venv .venv and . .venv/bin/activate; then install the package with python -m pip install task-state-guard; run task-state-guard --db ./private-state/tasks.sqlite doctor. All steps.

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

  1. Create and activate a virtual environment, then run python3 -m venv .venv and . .venv/bin/activate.
  2. Install the package with python -m pip install task-state-guard.
  3. Run task-state-guard --db ./private-state/tasks.sqlite doctor.
  4. 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.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for MaxHu-xuan/task-state-guard and "Check a workflow ledger's health before trusting its history"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer