Use it

Run it in a minute.

macOSgituvno API key
  1. Clone

    macOS with git and uv. The first run also downloads Relate's source once.

    terminal
    git clone https://github.com/Namans12/patch-precedent.git
    cd patch-precedent
  2. Run the demo

    Replays every patch against the real upstream tests and explains the result. About 45 seconds.

    terminal
    uv run patch-precedent demo all
  3. 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.

    terminal
    uv run patch-precedent explain fixtures/installer/token-header.patch
  4. Give your agent the graph

    One read-only tool, precedent_for_patch. Run the demo first so it can return observed results.

    .mcp.json
    {
      "mcpServers": {
        "precedent": {
          "command": "uv",
          "args": ["run", "--project", "<path-to-patch-precedent>",
                   "--quiet", "patch-precedent", "mcp"]
        }
      }
    }
    or in one line
    claude mcp add --scope project precedent -- uv run --project <path-to-patch-precedent> --quiet patch-precedent mcp
  5. Relate's own MCP server

    optional, macOS arm64

    Raw Cypher over the same graph. Point it at a copy of the store.

    terminal
    uv run patch-precedent fetch-relate-cli
    <path printed above> serve --mcp stdio --read-only --database <copy of data/precedent.rl>
  6. Re-score the published evaluation

    offline, no usage

    Rebuilds RESULTS.md byte for byte from the committed transcripts.

    terminal
    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 ...
CommandDoesExit codes
build-storeBuild the Relate store from the evidence directory0 ok
demo all | installer | releaseReplay patches and explain results0 ok, 2 inconclusive or input missing, 3 mismatch, 4 no upstream
explain PATCH_FILEShow the decision chain for a diff0 ok, 2 missing patch file or store
mcpServe the read-only MCP tool0 ok, 2 missing store
verify-storeCheck the store matches its evidence0 match, 1 differs or missing
scan-citationsRe-scan ADR mentions upstream0 ok, 4 no upstream
fetch-relate-cliDownload and verify the pinned relate CLI0 ok, 4 download failed
eval runRun the agent evaluation0 ok, 2 refused, 4 no upstream
eval score | reportRe-score or re-render a results directory0 ok, 2 results directory missing
site [build | record]Build the static website or record the demo runbuild: 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