Skip to main content

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. Given two places - a site and an app - what both state, and where they differ. 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
  • A page you publish but cannot build (since 0.17.0): every page you publish but cannot build - a site on a hosted CMS - still states the source's facts, read live; a copy held by reading until it can be built. wherefore check published
  • 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
  • Docs from each release (since 0.19.0): the docs ship inside each release as data - start, commands, configuration, checks and proofs, reporting - held to the code by the engine's tests, so a client renders the docs of the release it pins and nothing describes a release it does not run
  • Tell us (since 0.12.0): feedback for the engine's makers - a bug, a question or a request, one topic each - with a title and the words, the release, the corpus's shape and the output given, nothing private; opened as an issue, or shown, or a link for the person to send. wherefore report --title TITLE WORDS ... [--from FILE] [--show | --link]
  • Releases that reach every client (since 0.8.0): when the engine ships, every repository that pins it finds the release itself: a workflow wherefore init writes watches PyPI, moves the pin, rebuilds, and opens a draft pull request whose checks say what it still has to describe - no token from the engine's makers, no list of clients
  • Scan any number of repositories at once (since 0.13.0): point the scan at your site, your app, your backend and your docs together: every place is tagged with where it came from, and the scan says what they state in common and where any two disagree - drift between teams, with nothing installed
  • The scan says what it read (since 0.16.0): beside the result, what each place contributed - how many files of each kind, and the kinds seen and not read; an app's own words, read out of its source; a table set apart from the stale copies; and the colours a site states, with the ones within a shade of each other, before any brand is declared
  • Drift, on the map (since 0.20.0): every value said by hand in two or more files that no source holds, named with its files and counted; fails when more drift than wherefore.json allows, and asks for the allowance to come down when fewer do. wherefore check drift

The principles it enforces

  1. A fact exists in exactly one place. Everything else is generated from it or checked against it.
  2. The build is deterministic. Nothing in the build path calls a model.
  3. Fail loudly. A change the build cannot handle stops it; nothing improvises.
  4. A check is not trusted until it has been shown to fail.
  5. 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. Given two places - a site and an app - what both state, and where they differ
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 check published                                                             # every page you publish but cannot build - a site on a hosted CMS - still states the source's facts, read live; a copy held by reading until it can be built
wherefore check drift                                                                 # every value said by hand in two or more files that no source holds, named with its files and counted; fails when more drift than wherefore.json allows, and asks for the allowance to come down when fewer do
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
wherefore report --title TITLE WORDS ... [--from FILE] [--show | --link]              # feedback for the engine's makers - a bug, a question or a request, one topic each - with a title and the words, the release, the corpus's shape and the output given, nothing private; opened as an issue, or shown, or a link for the person to send

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.20.1

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

Source distribution (sdist)

Source distribution for wherefore-build 0.20.1
File Size Uploaded Provenance Actions
wherefore_build-0.20.1.tar.gz 216.9 kB With provenance Details for wherefore_build-0.20.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wherefore-build 0.20.1
File Interpreter ABI Platform Actions
wherefore_build-0.20.1-py3-none-any.whl Python 3 none any Details for wherefore_build-0.20.1-py3-none-any.whl

Total release size: 391.0 kB

Release files / wherefore_build-0.20.1.tar.gz

Download URL wherefore_build-0.20.1.tar.gz
Size 216.9 kB
Tags Source
SHA-256 checksum
How to use checksums
be88630fba813069df63cdd2903a844f27734f1c67c236e2513e9d178cfef497
BLAKE2b-256 checksum
How to use checksums
aba1d74af766308ae042e019b1dab890f30d1d6f3d7732ec4a5005036af97192
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 6, 2026.

Transparency log

Release files / wherefore_build-0.20.1-py3-none-any.whl

Download URL wherefore_build-0.20.1-py3-none-any.whl
Size 174.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0e83f8779c1cd1e35f071ebd0dd87fd9d2bff6b8f4924fde2b97bdf48bbd951b
BLAKE2b-256 checksum
How to use checksums
68333893e491f358f23cb9fec64ff7687aff376fda1a4b6a5d0f7d9c87a85f56
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 6, 2026.

Transparency log

Security for wherefore-build 0.20.1

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.

Select from 2 files

Attestation for wherefore_build-0.20.1.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 6, 2026.

Transparency log

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.20.1 This release

2 release files Full 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