[/]patchward
how it works

One finding. One bounded patch. Three gates, recorded.

Patchward opens draft pull requests with a recorded verification receipt. That is the invariant — it holds on every run, in every environment. What follows is the mechanism that produces it.

stage 1 · scan

Five scanners run in parallel, on your machine.

Static analysis runs inside a Docker sandbox with default-deny network egress. Each scanner is an independent input lane; their findings converge on a single SARIF normalization point so that everything downstream reasons about one format, not five.

semgrep+bandit+pip-audit+trivy+eslint→sarif
stage 2 · triage & fix

One finding at a time. Never a sweep.

Normalized findings are triaged by severity, then handed to fix generation one at a time. The patch is written against a single finding with declared line bounds — so the review surface stays small enough that a human can actually check it.

These two stages call the Anthropic API and read repository file contents to do their work. That crossing point is documented in full on/data-boundary — it is a design choice, stated plainly, not a footnote.

stage 3 · verify

Three gates, in order, every run.

A patch that fails a gate is discarded and never reaches a pull request. Gate 3 has two legitimate exits, and both are drawn here with equal weight — see/verification for the receipt itself.

gate 1the scanner re-runs; the flagged rule must no longer fire
gate 2the diff must fall entirely inside the finding's declared line bounds
gate 3Runs against your real test suite in the normal (CLI-delivered) case. On the hosted webhook path, when no test runner is present, Gate 3 skips and the PR discloses this explicitly rather than proceeding silently or failing the whole fix.
✓ pass

exit A — your suite ran and passed

– skipped

exit B — no runner present, disclosed in the PR

stage 4 · deliver

A draft PR on its own branch. Never your main.

Every mutation lands on a dedicated branch. Worst-case rollback is onegit branch -D.

branch convention
patchward/fix-<finding-id>
run it

Install once. Point it at a repository.

uv tool install patchward

requires python >=3.12

Where this stops short is written down, not implied — see/limits, and every number quoted on this page in /facts.