evidence-docs
Deterministic, verifiable claim corpora for AI-assisted codebase
documentation: human-authored topics and observations with explicit
provenance back to source/tests/spec, validated against real git history
and rendered into both a human-readable Markdown site and an AI-facing
context bundle.
evidence-docs grew out of documenting a single change to a real codebase
as a set of small, individually-sourced claims instead of one big
freeform writeup, and hardening the validator against every way that
approach can be gamed or drift silently (see docs/schema.md
for the full trust-boundary write-up).
Why a claim corpus instead of a doc?
A normal doc is one blob of prose that is either entirely trusted or
entirely suspect. A claim corpus instead splits it into many small
observations, each with:
- a
claim_kind(behavior,invariant,constraint,interface,dependency,failure_mode,decision_record), - an
epistemic_status(how strongly it's been checked -- fromexecution_verifieddown tomodel_inference), - explicit
provenance: which file/test/spec it came from, and a content hash of that source at the commit the claim was authored against.
evidence-docs validate/generate re-check that hash against the actual
git blob at the declared commit, reject unknown/typo'd source kinds, and
reject any observation whose declared commit doesn't match the one you're
generating for. The result is a corpus where "this claim is
execution_verified" means something a machine can double-check, not just
something an author asserted.
Install
pip install evidence-docs
(Python 3.9+, one dependency: PyYAML.)
First verified result in two lines
pip install evidence-docs && evidence-docs demo
demo builds a throwaway git repo + a tiny real corpus in a temp directory,
runs the actual validate path against it (PASS), then breaks a copy of that
same corpus three different ways -- a stale content_digest, a typo'd
source_kind, a provenance.repo_commit that disagrees with --repo-commit
-- and validates each of those too, so you see exactly what gets rejected and
why. Nothing it touches persists: everything runs in a temp directory that is
removed when the command exits.
Quick start
evidence-docs init docs/claims
# ... see docs/claims/EXAMPLE.md for a fully worked topic + observation you
# can copy and edit -- including the full enum reference for every field
# that only accepts a fixed set of values -- registering each new
# topic_id/observation_id in id-registry.yaml first ...
evidence-docs validate docs/claims --repo-commit <full-git-sha>
evidence-docs generate docs/claims \
--generated-at 2026-08-09T10:30:00Z \
--repo-commit <full-git-sha>
# writes docs/claims/site/index.md (human-readable) and
# docs/claims/bundle/*.jsonl + manifest.json (AI-facing)
evidence-docs context docs/claims \
--query '{"seeds": {"paths": ["src/foo.py"]}, "token_budget": 4000}'
# prints a JSON selection of claims relevant to those seed paths, stdout
--generated-at and --repo-commit are always explicit arguments, never
derived from datetime.now() or git rev-parse at run time -- the same
corpus + the same arguments always produce byte-identical site//bundle/
output from generate, and the same bundle + query always produce the same
result from context. This determinism guarantee is scoped to generate
and context specifically: init stamps id-registry.yaml with today's
date as a human-readable authoring hint, which has no bearing on any
corpus's validity or on generate/context output.
Commands
| command | what it does |
|---|---|
init <dir> |
scaffold topics/, observations/, id-registry.yaml, gaps.yaml, README.md, EXAMPLE.md (a worked topic + observation to copy, and the enum reference for every fixed-value field); validate passes immediately on the scaffold as-is (0 observations) |
validate <dir> --repo-commit <sha> [--repo-root <path>] |
full corpus validation, no output written (CI-friendly exit 0/1) |
generate <dir> --generated-at <iso> --repo-commit <sha> [--repo-root <path>] |
validate, then deterministically write site/index.md + bundle/* |
explain <dir> --scope-file <json> --repo-commit <sha> --generated-at <iso> [--repo-root <path>] |
validate the authoritative records, then write explanations/EXP-<id>.json: a non-authoritative (authority: none) list of the claims touching a change scope; see below |
context <dir> --query <json|path> |
select claims from bundle/ for a query (seeds.paths / seeds.topic_ids, optional token_budget); v0 retrieval, see docs/schema.md |
demo |
build a throwaway example corpus, validate it, then break it three ways and validate again -- no arguments, nothing persists |
Explanations (explain)
explain turns a change scope (a lane ImpactScanSnapshot, impact-scan:v1)
into explanations/EXP-<id>.json: the observations whose affected_paths or
repo-internal provenance uri exactly match one of the scope's
candidate_paths, plus the paths nothing covers. It is generated without any
LLM, carries authority: none, and is never the source of truth: once the
corpus changes, validate reports it as stale until you re-run explain
(which overwrites the same file). Hand edits are rejected, and topics /
observations / gaps / id-registry may not reference an explanation. bundle/,
site/ and context never read explanations/.
evidence-docs explain docs/claims \
--scope-file impact-scan.json \
--repo-commit "$(git rev-parse HEAD)" \
--generated-at 2026-08-09T10:30:00Z
# stdout: docs/claims/explanations/EXP-<16 hex>.json
# stderr: created | unchanged | regenerated
--repo-root defaults to the corpus directory itself; a relative
--repo-root is resolved against the corpus directory, not your shell's
current directory.
What's verified, what isn't
See docs/schema.md for the full write-up: the
source_kind allow-list, the three-stage history behind content-digest
verification (format check → worktree hash → declared-commit git blob
hash), why provenance.observed_at must be UTC ISO 8601 with an explicit
offset, why revision_digest excludes observed_at, and -- just as
important -- what is deliberately not checked (statement truthfulness,
affected_paths completeness, whether an author's epistemic_status is
honest).
Case study
Writing evidence-linked docs exposed two missing regression tests — how authoring a claim corpus against a real codebase (agent-cost) surfaced two missing regression tests, both since closed by merged PRs.
Fixtures / examples
fixtures/mini-domain/ is a small synthetic domain (a fictional in-memory
task store) used by the test suite as a runnable example: fixtures/mini-domain/corpus/
is a complete corpus, fixtures/mini-domain/repo/ is the source tree its
provenance points at.
License
MIT, see LICENSE.
日本語での簡単な案内
evidence-docs は、コードベースに関する主張(claim)を「誰が・どのソースを・どの粒度で
裏付けたか」を明示する形で記録し、宣言されたコミット時点の git blob と実際に照合してから
人間向け Markdown と AI 向け context bundle を決定的に生成する CLI ツールです。検証ロジックの
詳細(何を検証し、何を検証しないか)は docs/schema.md を参照してください。
Metadata
Release files for evidence-docs 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| evidence_docs-0.3.0.tar.gz | 57.4 kB | With provenance | Details for evidence_docs-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| evidence_docs-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for evidence_docs-0.3.0-py3-none-any.whl |
Total release size: 99.2 kB
Release files / evidence_docs-0.3.0.tar.gz
| Download URL | evidence_docs-0.3.0.tar.gz |
|---|---|
| Size | 57.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8381335a218780220013966d33d302ce2ff2a1a2c5f31524e85a8ff2d20e0569
|
|
BLAKE2b-256 checksum How to use checksums |
d0b61651ab5efb786756b81d0fd90dcf966f12e1752a2ee89b8fbfd076cab9f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logRelease files / evidence_docs-0.3.0-py3-none-any.whl
| Download URL | evidence_docs-0.3.0-py3-none-any.whl |
|---|---|
| Size | 41.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3610135394e919edfabdd2d492d0c3de98a334c12d5eb75db15986a4ecc405a8
|
|
BLAKE2b-256 checksum How to use checksums |
526843dace3347e1948cf643b0ea5db7c205936933378cd1c9b75d4cf55c4e34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logSecurity for evidence-docs 0.3.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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for evidence_docs-0.3.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 19, 2026.
Transparency logA 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.