Skip to main content

assurance-cli

PyPI Tests Python License

Did the job cover everything it was supposed to cover?

One command. One honest ratio. An exit code your pipeline can act on.

pip install assurance-cli
assurance diff --expected corpus.txt --found retrieved.json \
  --scope "documents the question spans" --where "the retrieved set" --fail-on-gap
2 of 5 documents the question spans — not in the retrieved set: doc-2, doc-3, doc-5
also present and not expected: doc-9

That second line matters as much as the ratio: the retriever drew on something the scope never allowed. It's reported, and it earns no credit.

No account · no API key · no network call · no model decides any of it

Three commands

diff is the general one. check is the special case for a folder of dated or numbered tabular files — if your files are .md, or named in a format it can't read, use diff and declare the set yourself.

assurance diff — any two sets of keys

# code review agent actually read the diff?
git diff --name-only origin/main...HEAD > changed.txt
assurance diff --expected changed.txt --found reviewed.txt --fail-on-gap

# eval suite ran every declared case?
assurance diff --expected cases.json --found ran.json --fail-on-gap

# straight from a pipe
retriever --query "$Q" | jq -r '.chunks[].doc_id' | \
  assurance diff --expected corpus.txt --found - --json

Inputs are whatever you already have: one key per line, a JSON array (strings, or objects with key/id/name/path), - for stdin, or an inline comma list.

assurance check — a folder of dated or numbered files

assurance check ~/reports
22 of 24 months from 2024-01 to 2025-12 in reports — not in this folder: March 2025, July 2025
— Range inferred from filenames: earliest 2024-01, latest 2025-12. Override with --from / --to.
assurance check ~/invoices --expect numbered
7 of 8 runs from inv_0001 to inv_0008 in invoices — not in this folder: INV-0006
— Range inferred from filenames: earliest inv_0001, latest inv_0008. Override with --from / --to.

Monthly, quarterly, weekly, daily, numbered. That last line is the derivation: it prints with every ratio so you can disagree with the denominator, not just the result.

When a file is there under a name it can't read, it says so beside the gap, because that's the difference between never produced and produced and named differently:

11 of 12 months from 2025-01 to 2025-12 — not in this folder: March 2025
— 1 name here could not be read as any of them: March FINAL v2.csv

assurance init — did anything change underneath?

assurance init ~/thesis-data
# Baseline written to ~/thesis-data/.assurance.json — 34 tabular files recorded.

# ... weeks pass, several people touch the folder ...
assurance check ~/thesis-data --against-baseline

Exit codes

0 it checked, and either found no gap or wasn't asked to fail on one
1 a finding: a gap with --fail-on-gap, a stale baseline, or nothing it could check
2 could not run: bad path, unreadable list, unparseable JSON, a table where keys were expected

"I couldn't check this" exits 1, not 0. A folder whose filenames it can't parse must not look like a folder it checked and found whole.

Diagnostics go to stderr, results to stdout, so --json stays pipeable.

It expects your files, not tidy ones

  • Excel exports work. UTF-8 BOM and CRLF are handled; a BOM used to glue itself to your first key and report it as missing and unexpected in the same sentence
  • Spaces, unicode and month words in filenamesInventory Report August 2024.csv parses
  • .xlsx, and nested subfolders
  • A piped CSV is refused, not misread. It names the column-picking command instead of quietly admitting your header row as a key
  • When it can't work out a series it says so, rather than reporting an empty check as a pass

Use it for

expected found
RAG documents the question spans chunks retrieved
Code review in CI git diff --name-only files reviewed
ETL / batch records or partitions declared records or partitions loaded
Compliance controls in scope controls with evidence
Research data the series you expect what's actually in the folder

What it won't do

  • Invent your expected set. diff takes your declaration; check derives one and prints how
  • Send anything anywhere. No network, no telemetry, no keys
  • Guess. A JSON object of id → metadata is refused, not interpreted

Family

assurance-core — the pure arithmetic, zero dependencies · assurance-mcp — the same checks as MCP tools

Upstream is I-Ops; this repo is a publication, never a source. Apache-2.0.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

assurance_cli-0.3.1.tar.gz (28.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

assurance_cli-0.3.1-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

Details for the file assurance_cli-0.3.1.tar.gz.

File metadata

  • Download URL: assurance_cli-0.3.1.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for assurance_cli-0.3.1.tar.gz
Algorithm Hash digest
SHA256 cdc7c0cbd3a7b10afd74b2076f1eb8d750feac590bd79b79ac5f965efec06ecb
MD5 48237b2281058452a23a478adda968fb
BLAKE2b-256 ddbd0879e1ecc0fff572f642096caf8a46fb33a86a51cd78eaa2364661bcaf4e

See more details on using hashes here.

Provenance

The following attestation bundles were made for assurance_cli-0.3.1.tar.gz:

Publisher: publish.yml on i-ops-hq/assurance-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file assurance_cli-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: assurance_cli-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 23.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for assurance_cli-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ee220c90e6ec6b2ed7c56b8141a50e05a1a7b5f8d4c65956ea37d1c698b6cb05
MD5 55b4ff244d6f3e025ff53389ce2c1197
BLAKE2b-256 ff0a8f447b16c8926dd0f69b1bd10125476a490ba5ba778c77579fec4153c989

See more details on using hashes here.

Provenance

The following attestation bundles were made for assurance_cli-0.3.1-py3-none-any.whl:

Publisher: publish.yml on i-ops-hq/assurance-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.4.0

2 files

This release

0.3.1 This release

2 files

0.3.0

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page