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, and an exit code your pipeline can act on. No model, no API key, no network call, nothing uploaded.

pip install assurance-cli

assurance diff — coverage over any two sets

The general form. Give it what a task required and what it actually read; it tells you the difference and exits non-zero on a gap. Keys are anything you can name.

# A retrieval agent: did the retriever see the whole question?
assurance diff \
  --expected corpus-for-this-question.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 last line matters as much as the ratio: the retriever drew on a document the scope never allowed. It is reported, and it earns no credit against the denominator.

Inputs are whatever you already have — a file with one key per line, a JSON array of strings or of objects with a key/id/name/path field, - for stdin, or a comma-separated list inline.

# Gate an agentic code review on having actually read the diff
git diff --name-only origin/main...HEAD > changed.txt
assurance diff --expected changed.txt --found reviewed.txt \
  --scope "files changed in this pull request" --where "the review log" --fail-on-gap

# Did the eval suite run every declared case?
assurance diff --expected cases.json --found ran.json --scope "declared eval cases" --fail-on-gap

# Were all the partitions loaded?
aws s3 ls s3://lake/dt=2026-08-14/ | awk '{print $4}' > loaded.txt
assurance diff --expected expected-partitions.txt --found loaded.txt --where "the warehouse"

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

--json gives you the full record for a CI artefact: complete, read of required, and each way an expectation failed to be evidence kept separate.

assurance check — coverage over a folder of dated files

When the thing you must account for is a series on disk, the expected set is derived for you from the filenames. Monthly, quarterly, weekly, daily, or plain numbered.

assurance check ~/reports
# 22 of 24 months from 01/2024 to 12/2025 in reports — not in this folder: 03/2025, 07/2025

assurance check ~/reports --from 2024-01 --to 2025-12 --fail-on-gap
assurance check ~/invoices --expect numbered          # gaps in INV-0001..INV-0450

The derivation is printed with the ratio, so you can disagree with the denominator rather than only with the result. That is deliberate: a denominator a tool invents for you is a denominator nobody can argue with.

assurance init / --against-baseline — did anything change underneath?

Write a baseline of a folder, then ask later whether it still holds. Catches the file that was quietly replaced, the row count that moved, the figure that no longer matches its source.

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

Exit codes

Code Meaning
0 Ran, and either found no gap or was not asked to fail on one
1 A finding — a coverage gap with --fail-on-gap, or a baseline that no longer holds
2 Could not run: bad path, unreadable key list, unparseable JSON

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

Who this is for

If you run Use it to check
RAG or retrieval pipelines The retrieved set against the documents the question spans
Agentic code review in CI Files reviewed against git diff --name-only
Batch or ETL jobs Records processed against records declared
Eval harnesses Cases executed against cases declared
Compliance evidence collection Controls with evidence against controls in scope
Research or thesis data A folder that several people have been editing for months
Any reporting series Months, quarters, weeks, days, or invoice numbers with a hole in them

What it will not do

  • It will not invent your expected set. diff takes your declaration; check derives one from filenames and prints how. Both are arguable on purpose.
  • It does not read file contents except to profile a baseline you asked for.
  • It never sends anything anywhere. No network calls, no telemetry, no keys.
  • No model decides any of it. See assurance-core for the arithmetic; this package owns all filesystem I/O.

Also in this family

Licence

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

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.2.0.tar.gz (23.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.2.0-py3-none-any.whl (20.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: assurance_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 23.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.2.0.tar.gz
Algorithm Hash digest
SHA256 32ae2891c599061685256736fa21a0ee62211a019f86bf876bf92d571c2ce3d0
MD5 38752e3e99853e747e876213159922e6
BLAKE2b-256 c3097ff35d65bc747cb3abf69dd4756fc68e0f46a2f6870cb2322eb532a4f8c9

See more details on using hashes here.

Provenance

The following attestation bundles were made for assurance_cli-0.2.0.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: assurance_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 20.4 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 688a5ae625bf167ef76705b54fe2fa1fc04361bf7e0617f329e0ec5322d41f00
MD5 1058ea3d71b8ef00f5c9b2a7f754b75a
BLAKE2b-256 5660b0cce38e49a543b64e3f347148ea133a395d13a080188c6b58106d825d0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for assurance_cli-0.2.0-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

0.3.1

2 files

0.3.0

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

This release

0.2.0 This release

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