Skip to main content

silentchecks

Make checks prove they can fail, and make "never ran" visible.

Two failures look exactly like success:

  • A check that cannot fail. A gate that reads the wrong field, compares against an empty list or swallows its own error passes every time. A gate that passes every time looks the same as a gate that works.
  • A check that did not run. A cron job that stopped, a skipped CI step or a script that died before its first line leaves no failure behind, only an absence. An absence reads as "all good".

silentchecks wraps any command-line check and fixes both:

  • Canary: before the real check, it runs the same check on a planted problem it must catch. If the canary passes, the run is BLIND: the check cannot see the problem it exists for, whatever it says about the real input.
  • Ledger: every run leaves a row (passed, failed, blind or error) in a plain JSON Lines file. status lists every check you expect, and names the ones that never ran or are stale instead of leaving them out.

Python 3.10+, no dependencies.

Install

pip install git+https://github.com/novasdiego1/silentchecks

Use

# Run a check with a canary. The canary must FAIL (non-zero exit).
silentchecks run deliveries \
  --canary "python3 stamps.py canary-unstamped.json" \
  -- python3 stamps.py deliveries.json

# What happened, including what did not happen.
silentchecks status --expect deliveries=24h --expect nightly-backup=26h
CHECK           STATE      LAST RUN                   AGE  RUNS  MAX AGE
deliveries      PASSED     2026-11-01T15:55:54+00:00  0s   2     24h
nightly-backup  NEVER-RAN  -                          -    0     26h
  nightly-backup: no run recorded

In cron, wrap the job itself and run status from a different machine or schedule, so a dead scheduler cannot hide its own absence:

0 3 * * *  silentchecks --ledger /var/lib/checks.jsonl run nightly-backup -- /usr/local/bin/verify-backup
0 9 * * *  silentchecks --ledger /var/lib/checks.jsonl status --expect nightly-backup=26h || notify-me

Try the example

examples/stamps.py checks that every delivered item has a completion stamp. With --buggy it reads a field that does not exist and treats "missing" as fine, so it always passes. On the real data, both versions say the same thing; only the canary tells them apart:

cd examples
silentchecks run stamps --canary "python3 stamps.py canary-unstamped.json --buggy" \
  -- python3 stamps.py deliveries.json --buggy
# stamps: BLIND (the canary passed (exit 0): this check did not catch a planted problem; ...)

silentchecks run stamps --canary "python3 stamps.py canary-unstamped.json" \
  -- python3 stamps.py deliveries.json
# stamps: PASSED (exit 0; canary caught)

Writing a good canary

A canary is the check pointed at something you know is wrong:

  • a record that was never written, for a read-after-write check;
  • an item without its completion stamp, for a "everything was delivered" check;
  • a value that must be rejected, for a validator;
  • an empty or truncated file, for a backup check.

Keep canaries out of real data (separate files, a reserved id, a test table), so the safety net never pollutes what it protects.

  • Small, same logic. The canary runs the same validation code on a tiny planted input, not the full job. A backup check does not need a 10 GB restore to prove it notices an empty file.
  • Setup and cleanup. The canary command runs with SILENTCHECKS_CANARY=1 (the real check gets 0), so one script can create its fake record, check, and delete it, and refuse to touch real data while in canary mode.
  • Frequent checks. --canary-every 1h runs the canary only if it was not caught in the last hour; the rows in between say "canary skipped, last caught ..." so nobody mistakes them for proof.

States and exit codes

run verdict Meaning Exit
passed the check passed (and caught the canary, if any) 0
failed the check failed 1
error the check or the canary could not run (not found, timeout) 2
blind the canary passed: the result cannot be trusted 4

status --json gives the same states for scripts and monitoring. status adds never-ran and stale, and exits 1 if any check failed, is blind or errored, 3 if any expected check is missing or stale, 0 otherwise (2 on usage errors). A check that passed 20 or more times, never failed and never used a canary gets a note: from the outside it cannot be told apart from a check that checks nothing.

Limits

  • It runs commands; it does not know what they check. A canary is only as good as the planted problem you give it.
  • The ledger is a local file. If the machine that writes it dies, status on that same machine dies with it: run status from somewhere else.
  • Rows are appended under flock on Linux and macOS, so jobs finishing at the same time do not corrupt the file. On Windows there is no lock.
  • It reads the whole ledger on every status; rotate the file if it grows to millions of rows.

License

MIT.

Metadata

Release files for silentchecks 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for silentchecks 0.1.0
File Size Uploaded Provenance Actions
silentchecks-0.1.0.tar.gz 13.4 kB Without provenance Details for silentchecks-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for silentchecks 0.1.0
File Interpreter ABI Platform Actions
silentchecks-0.1.0-py3-none-any.whl Python 3 none any Details for silentchecks-0.1.0-py3-none-any.whl

Total release size: 24.5 kB

Release files / silentchecks-0.1.0.tar.gz

Download URL silentchecks-0.1.0.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0aef309bce862cec46d71316468b2b8fed9dd293a33d52c251b905d2d6cdb083
BLAKE2b-256 checksum
How to use checksums
e38d5b0dfe3e82bb5579ba25e9730c4bc19a678af3ab0ac60781a628041bf339
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / silentchecks-0.1.0-py3-none-any.whl

Download URL silentchecks-0.1.0-py3-none-any.whl
Size 11.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6d519e5a5918178f9ee32c85285a2e2f20dfb28b15612306611d82ff76abd52e
BLAKE2b-256 checksum
How to use checksums
9f54e1beea4d0d927e85daa68baa413e0c7359aa4df68decec3c83644b7ef243
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for silentchecks 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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