Use it
Run it in a minute.
macOSgituvno API key
-
Clone
macOS with git and uv. The first run also downloads Relate's source once.
git clone https://github.com/Namans12/patch-precedent.git cd patch-precedent
-
Run the demo
Replays every patch against the real upstream tests and explains the result. About 45 seconds.
uv run patch-precedent demo all
-
Explain any patch
Read-only and offline. Works on any diff against Relate at the pinned commit; outside the two curated decisions it shows scanned citations only.
uv run patch-precedent explain fixtures/installer/token-header.patch
-
Give your agent the graph
One read-only tool, precedent_for_patch. Run the demo first so it can return observed results.
{ "mcpServers": { "precedent": { "command": "uv", "args": ["run", "--project", "<path-to-patch-precedent>", "--quiet", "patch-precedent", "mcp"] } } }claude mcp add --scope project precedent -- uv run --project <path-to-patch-precedent> --quiet patch-precedent mcp
-
Relate's own MCP server
optional, macOS arm64Raw Cypher over the same graph. Point it at a copy of the store.
uv run patch-precedent fetch-relate-cli <path printed above> serve --mcp stdio --read-only --database <copy of data/precedent.rl>
-
Re-score the published evaluation
offline, no usageRebuilds RESULTS.md byte for byte from the committed transcripts.
uv run patch-precedent eval score --results eval/results/20261127T040059Z uv run patch-precedent eval report --results eval/results/20261127T040059Z
All commands
uv run patch-precedent ...| Command | Does | Exit codes |
|---|---|---|
build-store | Build the Relate store from the evidence directory | 0 ok |
demo all | installer | release | Replay patches and explain results | 0 ok, 2 inconclusive or input missing, 3 mismatch, 4 no upstream |
explain PATCH_FILE | Show the decision chain for a diff | 0 ok, 2 missing patch file or store |
mcp | Serve the read-only MCP tool | 0 ok, 2 missing store |
verify-store | Check the store matches its evidence | 0 match, 1 differs or missing |
scan-citations | Re-scan ADR mentions upstream | 0 ok, 4 no upstream |
fetch-relate-cli | Download and verify the pinned relate CLI | 0 ok, 4 download failed |
eval run | Run the agent evaluation | 0 ok, 2 refused, 4 no upstream |
eval score | report | Re-score or re-render a results directory | 0 ok, 2 results directory missing |
site [build | record] | Build the static website or record the demo run | build: 0 ok, 2 missing input, bad base URL or refused output path. record: 0 ok, or the demo exit (2, 3, 4); 2 for bad options |