Skip to main content

error-claim-audit

An offline static CLI that checks documented Python error behaviour against production source. Python 3.9 or later; no runtime dependencies.

Install with pip install ., then run:

error-claim-audit path/to/project --json
python -m error_claim_audit path/to/project --verbose

The tool exits 0 for PASS, exits 2 for FAIL, and exits 1 for usage or input errors. The default failure threshold is MEDIUM. --fail-on HIGH still prints MEDIUM findings but lets those findings pass. --ignore RULE,... drops selected findings. --version prints 0.1.0.

Rules:

  • documented-exit-code-unproduced (HIGH)
  • documented-exception-unraised (HIGH)
  • documented-error-message-unproduced (MEDIUM)

Only root README.md and docs/**/*.md supply claims. Exit promises in prose count; fenced shell exit commands do not. Exception promises count in prose, inline code, and fences. Message claims require the word error and a quoted string of at least four characters on the same line. Matching is exact and case sensitive for messages. Exit claims are integers from 0 through 255.

Production Python files supply AST evidence. Tests, test_*.py, *_test.py, fixtures and docs trees are excluded. Malformed Python is skipped. The tool never imports or executes target code, accesses the network, or opens .env. Symlink files are skipped. An unreadable source or documentation file causes an input error rather than a partial audit.

Literal sys.exit, SystemExit, exit and quit arguments supply exit evidence. The one framework implication modeled is creation of an ArgumentParser plus a parse_args call in the same file: together these supply exit 2. The tool also follows literal returns in functions named main when sys.exit(main()) appears in the same file. Nested function returns are excluded. Variables, computed values, dynamic imports, aliases and cross-file data flow are not resolved. Static evidence does not prove that a path is reachable.

Only raised names count as exception evidence; caught names and bare re-raises do not. Literal first arguments of raised calls supply message evidence. Literal arguments of sys.stderr.write or print with file=sys.stderr supply message evidence when they contain the word error.

JSON includes status, deterministic findings (rule, severity, file, line, claim), verified_claims grouped into exit_codes, exceptions and messages, and a summary of unique claims, findings, and verified claims. Repeated claims are verified once; unmatched occurrences retain documentation locations. No claims means PASS. With no production source, all claims are findings. Undocumented behaviour never causes a finding.

This complements pytest/unittest, which observe runtime behaviour; readme-claim-audit, which checks install names, flags, links and versions; api-claim-audit, which checks symbols and signatures; config-claim-audit, which checks default values; and bandit/ruff, which check code issues. It does not replace these tools.

Run tests from the source tree:

PYTHONPATH=src python3 -m unittest discover -s tests -v
python3 -m build

MIT licensed.

Metadata

Release files for error-claim-audit 0.1.0

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

Built distribution (wheel)

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

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

Download URL error_claim_audit-0.1.0-py3-none-any.whl
Size 7.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bbef1deaff42eab11e128f200216aa3478c0c3c234b24ae174cbf2f26c18d321
BLAKE2b-256 checksum
How to use checksums
67cfa704bed862efbd2e4113d928ad4d49c9671ca1868873e8786e729aab0d5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for error-claim-audit 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

1 release file 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