Wherefore
Your company, compiled.
Code has one source of truth: change it once, and everything built from it follows. Everything else a company makes - the website, the docs, the pricing page, the app's own words - is a copy of a copy, kept by hand, and it drifts.
Wherefore gives everything else what code has. Say each fact once. Generate every asset from it. Anything left stale stops the change before it ships. AI writes the rules; the build never improvises.
A hardware company, compiled from one spec file
Wherefore was built alongside Chaotic Pendulums, a small hardware company started to test the idea on something with more surface area than software. If one source can hold machined parts, physics, suppliers and a storefront, it can hold your app, website and docs. How it is built.
What it does
- Scan (since 0.3.0): where each stated value appears, and where the copies disagree; needs no setup.
wherefore scan PATH|URL ... - Start a corpus (since 0.1.0): write a wherefore.json that declares nothing yet.
wherefore init [DIR] - The gate (since 0.1.0): every tracked file classified, every generated one current; puts the tree back unless --keep.
wherefore gate [--keep],wherefore gate --restamp GROUP - The build (since 0.1.0): the roll: every generator - a Python script or any command - twice, compared with what is committed, and the results left in place.
wherefore build,wherefore list - What builds what (since 0.7.0): what builds what: run every generator once, trace what each reads and writes, and draw it as one self-contained page (and JSON) - changing nothing.
wherefore graph [--html PATH] [--json PATH|-] [--theme CSS ...] [--home URL [WORDS]] - Proofs (since 0.1.0): run the client's proofs, one at a time, in place.
wherefore prove [SCRIPT ...] - Retired facts (since 0.1.0): nothing a person reads still claims a retired value or phrase.
wherefore check retired - Reach (since 0.1.0): every fact, moved one at a time, reaches what it should.
wherefore check reach - Claims (since 0.1.0): every claim says only what its rule allows.
wherefore check claims - Derived from elsewhere (since 0.5.0): every copy taken from elsewhere still matches where it was taken from, read there now.
wherefore check upstream - One palette (since 0.10.0): every colour anywhere is one the brand's source holds, or the file says, with why, whose colours they are.
wherefore check palette - The pre-push hook (since 0.1.0): a pre-push hook: no push leaves the corpus stale.
wherefore hook install,wherefore hook pre-push - The skill, for Claude Code and Codex (since 0.2.0): teaches your coding agent the rules, and starts a corpus with you: one fact, end to end. One skill, written where each agent reads it, and held to the release
The principles it enforces
- A fact exists in exactly one place. Everything else is generated from it or checked against it.
- The build is deterministic. Nothing in the build path calls a model.
- Fail loudly. A change the build cannot handle stops it; nothing improvises.
- A check is not trusted until it has been shown to fail.
- Sources versus outputs. Every tracked file is generated, authored or captured. Generated files are never hand-edited, and a capture is stamped with what it was made from.
Install
pip install wherefore-build # Python 3.10+, standard library only
uv tool install wherefore-build # or, as a command of its own
pipx install wherefore-build # the same, with pipx
pip install 'wherefore-build[pictures,xlsx]' # for picture and workbook comparison
It needs Python 3.10 or later and nothing else. Your project can be in any
language: Wherefore reads and checks files, whatever made them. With no Python
on the machine, uv tool install fetches one. A generator is a Python script
by default, or any command - a Node build, a shell script, a CAD export -
declared with run and held exactly as strictly.
The distribution is wherefore-build, because wherefore on PyPI is another
project's. What you import and what you type are wherefore.
Use
pip install -e . # from a checkout of this repository
pip install -e '.[pictures,xlsx]' # with picture and workbook comparison
wherefore scan PATH|URL ... # where each stated value appears, and where the copies disagree; needs no setup
wherefore init [DIR] # write a wherefore.json that declares nothing yet
wherefore gate [--keep] # every tracked file classified, every generated one current; puts the tree back unless --keep
wherefore gate --restamp GROUP # record a re-made capture against its sources
wherefore build # the roll: every generator - a Python script or any command - twice, compared with what is committed, and the results left in place
wherefore list # run every generator once and say what each wrote
wherefore graph [--html PATH] [--json PATH|-] [--theme CSS ...] [--home URL [WORDS]] # what builds what: run every generator once, trace what each reads and writes, and draw it as one self-contained page (and JSON) - changing nothing
wherefore prove [SCRIPT ...] # run the client's proofs, one at a time, in place
wherefore check retired # nothing a person reads still claims a retired value or phrase
wherefore check reach # every fact, moved one at a time, reaches what it should
wherefore check claims # every claim says only what its rule allows
wherefore check upstream # every copy taken from elsewhere still matches where it was taken from, read there now
wherefore check palette # every colour anywhere is one the brand's source holds, or the file says, with why, whose colours they are
wherefore hook install # a pre-push hook: no push leaves the corpus stale
wherefore hook pre-push # what the installed hook runs before a push; not for typing
See what builds what. wherefore graph runs every generator once, records
what each reads and writes, and draws the chain as one self-contained page:
sources, the scripts that read them, and everything they make - choose any file
to see where it comes from, or any source to see what changes with it. It puts
the tree back as it found it.
Start with a scan. wherefore scan needs no setup and no wherefore.json:
point it at a built site, a docs folder or a live address, and it reports every
value the company states more than one way - "start your {} day free trial", 14
in three places and 30 in one. Each is a fact to say once, in a source, and
build every copy from; the rest of Wherefore is how.
A client describes its corpus in wherefore.json: its sources, its generators
in order, its inventory of authored and captured files, and every exception to
byte-identity. Every exemption carries a why, and the engine refuses an entry
that has none. tests/fixture/ is a complete, fictional example.
A client that configures the engine in Python instead, in the scripts its
proofs plant faults into, names those scripts in entry, and each command runs
the client's own script exactly as its CI does. The engine refuses a command
that is handed over and configured in wherefore.json as well, because that is
one fact in two places. Chaotic Pendulums is that kind of client.
This repository
| path | what |
|---|---|
src/wherefore/ |
the engine |
tests/fixture/ |
Fernhollow Kettles, a fictional company the engine proves itself against |
proofs/ |
the engine's proofs: each breaks the fixture one way and requires the right failure, in the right words |
tests/ |
unit tests, and test_phase5.py: the fixture compiled from its sources alone |
tools/moved/ |
the exact edits that turned each pendulum original into an engine module; verify.py re-runs them |
src/wherefore/skills/wherefore/ |
the skill, shipped in the package: how a coding agent works in a corpus (SKILL.md) and starts one (start.md). A corpus's own copies are generated from the release it pins, by the wherefore.skill generator wherefore init declares: .claude/skills/wherefore/ for Claude Code and .agents/skills/wherefore/ for Codex, the same files in the open Agent Skills format |
CHANGELOG.md |
every release, newest first; a client upgrades only by moving its pin |
src/wherefore/releases.json |
every release again, as data - version, date, a title, a sentence and a picture of it working - for the company's changelog page; tests/test_releases.py holds it to CHANGELOG.md and runs the newest picture again |
corpus/, wherefore.json |
this repository as a client of its own engine: the README's generator, the corpus's checks and their proofs |
docs/README.template.md |
the README's text; the README is generated from it, src/wherefore/commands.json and src/wherefore/principles.json |
requirements-engine.txt |
the previous release, which judges this repository's own corpus |
LICENSE |
Apache-2.0 |
CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md |
how to work on the engine and contribute to it, how everyone taking part behaves, and how to report a vulnerability |
PUBLISHING.md |
how a release reaches PyPI, and what this repository's history leaves out |
python3 -m unittest discover tests
for p in proofs/*_proof.py; do python3 "$p" || exit 1; done
Licence
Apache-2.0 (LICENSE). The package is published as wherefore-build; what you
import and what you type are wherefore.
Metadata
Release files for wherefore-build 0.11.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 |
|---|---|---|---|---|
| wherefore_build-0.11.0.tar.gz | 158.1 kB | With provenance | Details for wherefore_build-0.11.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wherefore_build-0.11.0-py3-none-any.whl | Python 3 | none | any | Details for wherefore_build-0.11.0-py3-none-any.whl |
Total release size: 286.4 kB
Release files / wherefore_build-0.11.0.tar.gz
| Download URL | wherefore_build-0.11.0.tar.gz |
|---|---|
| Size | 158.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
036e0a8279856bba113e47370bc3e519f80edce5315a4c54376bb47c027a28a8
|
|
BLAKE2b-256 checksum How to use checksums |
12f7a701dd19d42b3ac1e7f1727f34f305c7b82524c7e3c769ba8129238e9349
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 5, 2026.
Transparency logRelease files / wherefore_build-0.11.0-py3-none-any.whl
| Download URL | wherefore_build-0.11.0-py3-none-any.whl |
|---|---|
| Size | 128.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4a17de08ae9c37297c1871c36d245d9fdb4784d56d5ad4f9423a0c00fc7ba72f
|
|
BLAKE2b-256 checksum How to use checksums |
16ff2a43c76d66aa179ffd455111129d033d93c3675985555368240620e3188c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 5, 2026.
Transparency logSecurity for wherefore-build 0.11.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 wherefore_build-0.11.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 Nov 5, 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.