patchdrill 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # PatchDrill
2
2
 
3
+ **English** · [한국어](README.ko.md) · [日本語](README.ja.md) · [中文](README.zh.md)
4
+
3
5
  [![CI](https://github.com/seungdori/patchdrill/actions/workflows/ci.yml/badge.svg)](https://github.com/seungdori/patchdrill/actions/workflows/ci.yml)
4
6
  ![deterministic](https://img.shields.io/badge/deterministic-yes-2ea44f)
5
7
  ![runs offline](https://img.shields.io/badge/runs-offline-2ea44f)
@@ -23,14 +25,14 @@ PatchDrill is the **deterministic proof layer between code review and CI** for A
23
25
  - **Leaked secrets** — `.env` files, private keys, and token-shaped strings added in the patch
24
26
  - **Prompt injection** — instructions slipped into `AGENTS.md`, issue templates, and docs an agent will read
25
27
  - **Workflow escalation** — broad token writes, `pull_request_target`, OIDC exchange, `secrets: inherit`, unpinned actions, remote-script pipes
26
- - **Missing proof** — source changed with no test changed; required checks planned but never run
28
+ - **Missing proof** — source changed with no matching test change; required checks planned but never run
27
29
  - **Dependency drift** — manifest changes with no matching lockfile (and lockfile drift with no manifest intent)
28
30
  - **The verification it implies** — the actual commands for the *changed* packages + downstream dependents across ~25 ecosystems, not just root-level defaults
29
31
 
30
- > **Built for teams merging AI-/agent-authored PRs who can't eyeball every diff anymore.** Run it locally in 30 seconds — no config, no CI changes, no API key:
32
+ > **Built for teams that merge AI- and agent-authored PRs faster than they can eyeball every diff.** Run it locally in 30 seconds — no config, no CI changes, no API key:
31
33
  >
32
34
  > ```bash
33
- > npx --yes github:seungdori/patchdrill demo --scenario risky-agent-pr
35
+ > npx --yes patchdrill demo --scenario risky-agent-pr
34
36
  > ```
35
37
 
36
38
  Output is a portable **Proof Pack** — Markdown, JSON, SARIF, a self-contained HTML dashboard, and a hash-stamped evidence manifest — that a human, a CI gate, an auditor, or a frontier model can all inspect. Run it in your language with `--locale ko|ja|zh`.
@@ -40,7 +42,7 @@ Output is a portable **Proof Pack** — Markdown, JSON, SARIF, a self-contained
40
42
  Generate a risky AI-agent PR scenario without needing a git repository:
41
43
 
42
44
  ```bash
43
- npx --yes github:seungdori/patchdrill demo --scenario risky-agent-pr --output patchdrill-risky-demo
45
+ npx --yes patchdrill demo --scenario risky-agent-pr --output patchdrill-risky-demo
44
46
  ```
45
47
 
46
48
  Then inspect the reviewer-facing artifacts:
@@ -53,7 +55,7 @@ open patchdrill-risky-demo/patchdrill-demo.html
53
55
  PatchDrill should show a privileged workflow boundary, secret-looking content, package lifecycle script risk, and the verification plan a reviewer should ask for before merge.
54
56
 
55
57
  ```bash
56
- npx --yes github:seungdori/patchdrill scan --base origin/main --run \
58
+ npx --yes patchdrill scan --base origin/main --run \
57
59
  --evidence patchdrill-evidence.json \
58
60
  --summary-markdown patchdrill-summary.md \
59
61
  --markdown patchdrill-report.md \
@@ -62,22 +64,22 @@ npx --yes github:seungdori/patchdrill scan --base origin/main --run \
62
64
  --html patchdrill-dashboard.html \
63
65
  --fail-on high \
64
66
  --max-risk 69
65
- npx --yes github:seungdori/patchdrill verify --evidence patchdrill-evidence.json
67
+ npx --yes patchdrill verify --evidence patchdrill-evidence.json
66
68
  ```
67
69
 
68
- ## Why Star It
70
+ ## Why PatchDrill
69
71
 
70
- - Makes AI-era PRs reviewable without asking another model to be the source of truth.
71
- - Builds a Proof Pack for each patch: Markdown for humans, JSON for bots with required structured verification status, SARIF for GitHub code scanning, a self-contained HTML dashboard, compact PR summaries, and a later-verifiable audit manifest with report, artifact, and command-output hashes.
72
+ - Makes AI-written PRs reviewable without trusting another model to be the final word.
73
+ - Builds a Proof Pack for each patch: Markdown for humans, JSON for bots (including a required structured verification status), SARIF for GitHub code scanning, a self-contained HTML dashboard, compact PR summaries, and a later-verifiable audit manifest with report, artifact, and command-output hashes.
72
74
  - Works locally first and in CI later. `scan` never mutates the repository, and commands only run when `--run` is set.
73
- - Flags the review surfaces that routinely hide regressions: auth, billing, migrations, secrets, CI workflow supply chain, package automation scripts, infra, lockfiles, large diffs, prompt-injection content, missing test changes, and required checks that were planned but not run.
74
- - Infers reviewable commands from the patch instead of only running root-level defaults.
75
+ - Flags the parts of a diff where regressions usually slip through: auth, billing, migrations, secrets, CI workflows and their supply chain, package automation scripts, infra, lockfiles, large diffs, prompt-injection content, missing test changes, and required checks that were planned but never run.
76
+ - Infers which commands to run from the patch itself, instead of just falling back to root-level defaults.
75
77
  - Works with the tools you already have: git, npm, pnpm, yarn, bun, pytest, Django, FastAPI, cargo, Go, Maven, Gradle, Spring Boot, Android Gradle, Ruby, Rails, RSpec, PHP, Composer, Laravel, dotnet, ASP.NET Core, Swift, Xcode, Terraform, Docker, Kubernetes, Helm, Bazel, and Buck2.
76
78
  - Supports policy-as-code through `.patchdrill.yml`, including default, regulated, and agentic starter packs.
77
79
  - Ships with serious open-source security posture: CodeQL, OpenSSF Scorecard, Dependabot, strict tests, and package dry-run verification.
78
- - Understands Node, Cargo, Go, and Pants workspaces, plus nested Python projects, nested Cargo and Go workspaces, Turborepo, and Nx, targeting changed packages plus downstream dependents instead of blindly running only root-level commands.
80
+ - Understands Node, Cargo, Go, and Pants workspaces plus nested Python projects, nested Cargo and Go workspaces, Turborepo, and Nx so it targets the packages you actually changed and the ones that depend on them.
79
81
  - Includes first-party stack fixtures for Node/Turborepo, Next.js, Python, uv-managed Python, Django, FastAPI, Rails, PHP/Composer, Terraform, Docker/Compose, Kubernetes/Helm/Kustomize, Java/Maven/Gradle, Spring Boot Maven/Gradle, Android Gradle, .NET, ASP.NET Core, SwiftPM, Xcode, Bazel, Buck2, Pants, Cargo, and Go repository shapes.
80
- - Explains package.json, pyproject.toml, requirements.txt, NuGet PackageReference and central PackageVersion files, Maven pom.xml, Gradle build files and version catalogs, Gemfile, composer.json, go.mod, Cargo.toml, npm package-lock, pnpm-lock, yarn.lock, bun.lock, go.sum, Cargo.lock, poetry.lock, uv.lock, Pipfile.lock, Gemfile.lock, and composer.lock dependency additions, removals, and version updates instead of only saying "lockfile changed."
82
+ - Explains dependency manifest and lockfile changes what was added, removed, or bumped across package.json, go.mod, Cargo.toml, pyproject.toml, and a dozen-plus other formats instead of only saying "lockfile changed." (See [Dependency Review](#dependency-review) for the full file list.)
81
83
  - Flags dependency proof gaps such as manifest-only dependency changes or lockfile-only resolution drift.
82
84
  - Adds CODEOWNERS owner hints to changed files so reviewers can see the responsible teams.
83
85
  - Includes launch-friendly case studies, a public stack coverage matrix, and per-command verification status so teams can evaluate what evidence PatchDrill actually emits.
@@ -139,26 +141,26 @@ Run with --run to execute required verification commands. Add --run-optional to
139
141
 
140
142
  ## Install
141
143
 
142
- Run it instantly with no install, straight from GitHub:
144
+ Run it instantly with no install it is published on [npm](https://www.npmjs.com/package/patchdrill):
143
145
 
144
146
  ```bash
145
- npx --yes github:seungdori/patchdrill scan --base origin/main
147
+ npx --yes patchdrill scan --base origin/main
146
148
  ```
147
149
 
148
- Once the npm package is published, the same works without the `github:` prefix:
150
+ Or install it globally:
149
151
 
150
152
  ```bash
151
- npx patchdrill scan --base origin/main
153
+ npm install -g patchdrill
154
+ patchdrill scan --base origin/main
152
155
  ```
153
156
 
154
- Or install the published package globally:
157
+ To run the latest unreleased build straight from source, use the `github:` prefix instead:
155
158
 
156
159
  ```bash
157
- npm install -g patchdrill
158
- patchdrill scan --base origin/main
160
+ npx --yes github:seungdori/patchdrill scan --base origin/main
159
161
  ```
160
162
 
161
- The examples below use `patchdrill` for readability. Replace it with `npx --yes github:seungdori/patchdrill` when running directly from this repository.
163
+ The examples below use `patchdrill` for readability.
162
164
 
163
165
  ## Quickstart
164
166
 
@@ -174,7 +176,7 @@ Try the failure case that shows what PatchDrill catches in an agent-authored PR:
174
176
  patchdrill demo --scenario risky-agent-pr --output patchdrill-risky-demo
175
177
  ```
176
178
 
177
- Diagnose what PatchDrill can infer from your repository before changing CI:
179
+ See what PatchDrill can infer about your repo before you change CI:
178
180
 
179
181
  ```bash
180
182
  patchdrill doctor
@@ -246,12 +248,6 @@ patchdrill release-check --format json
246
248
 
247
249
  The release workflow also runs required PatchDrill verification, generates a local Proof Pack smoke bundle, and verifies its evidence manifest before `npm pack --dry-run`.
248
250
 
249
- For automation:
250
-
251
- ```bash
252
- patchdrill release-check --format json
253
- ```
254
-
255
251
  Regenerate an evidence manifest after final artifact post-processing:
256
252
 
257
253
  ```bash
@@ -398,7 +394,7 @@ PatchDrill detects project shape from repo manifests:
398
394
  | Pants | `pants.toml` | `pants --changed-since=HEAD --changed-dependents=transitive test` |
399
395
  | GitHub Actions | `.github/workflows/*` | workflow diff review |
400
396
 
401
- For Node workspaces, PatchDrill detects `package.json` workspaces and `pnpm-workspace.yaml`, then emits package-scoped commands such as `pnpm --filter @acme/api run test` or `npm --workspace @acme/api run build` for directly changed packages and downstream dependents. When `turbo.json` or `nx.json` is present, it plans native task-runner commands such as `pnpm exec turbo run test --filter=@acme/api` or `npx nx run api:test`. See [docs/MONOREPOS.md](docs/MONOREPOS.md).
397
+ For Node workspaces, PatchDrill detects `package.json` workspaces and `pnpm-workspace.yaml`, then emits package-scoped commands such as `pnpm --filter @acme/api run test` or `npm --workspace @acme/api run build` for directly changed packages and downstream dependents. When `turbo.json` or `nx.json` is present, PatchDrill plans native task-runner commands such as `pnpm exec turbo run test --filter=@acme/api` or `npx nx run api:test`. See [docs/MONOREPOS.md](docs/MONOREPOS.md).
402
398
 
403
399
  For nested Python projects, PatchDrill treats each discovered `pyproject.toml`, `uv.lock`, `requirements.txt`, or `manage.py` package root as its own verification scope, so a monorepo can plan `cd packages/pine-engine && uv run pytest` instead of incorrectly collapsing every Python change into a root command.
404
400
 
@@ -436,7 +432,7 @@ The risk model is intentionally explainable. Every score increase is represented
436
432
 
437
433
  See [docs/RULE_CATALOG.md](docs/RULE_CATALOG.md) for the built-in rule IDs and what each one means.
438
434
 
439
- ## Policy-As-Code
435
+ ## Policy-as-Code
440
436
 
441
437
  PatchDrill reads `.patchdrill.yml`, `.patchdrill.yaml`, or `.patchdrill.json` from the repository root.
442
438
 
@@ -572,17 +568,17 @@ PatchDrill also summarizes `package.json` script additions, removals, and update
572
568
  ## Roadmap
573
569
 
574
570
  - Broader first-party fixture coverage for common open-source stacks.
575
- - More native affected-task integrations beyond Turborepo, Nx, Pants, Cargo, Go, Bazel, and Buck workspaces.
571
+ - More native affected-task integrations beyond Turborepo, Nx, Pants, Cargo, Go, Bazel, and Buck2 workspaces.
576
572
  - Local TUI for interactively accepting or rejecting inferred verification commands.
577
573
  - Optional LLM summary mode that never replaces deterministic findings.
578
574
 
579
575
  ## FAQ
580
576
 
581
- **Is this an AI tool?** No. PatchDrill makes **zero model calls**, needs no API key, and runs fully offline. The same diff in produces a byte-identical Proof Pack out (it honors `SOURCE_DATE_EPOCH`). It is the deterministic layer that exists *because* AI writes code now — not another AI.
577
+ **Is this an AI tool?** No. PatchDrill makes **zero model calls**, needs no API key, and runs fully offline. Feed it the same diff and you get a byte-identical Proof Pack back (it honors `SOURCE_DATE_EPOCH`). It is the deterministic layer that exists *because* AI writes code now — not another AI.
582
578
 
583
579
  **Isn't this just a linter or SAST?** No. A linter checks code against fixed rules; SAST matches known vulnerability patterns. PatchDrill infers what verification *this specific diff* implies and reports the proof that *should* exist but doesn't — including required checks that were planned but never run. No linter or SAST tracks that gap.
584
580
 
585
- **Is it another CI gate I have to add?** It doesn't have to be. Run it locally in 30 seconds with no config (`npx --yes github:seungdori/patchdrill demo`). It maps what your existing review and CI should each cover for a diff; `scan` never mutates your repo and commands run only with `--run`.
581
+ **Is it another CI gate I have to add?** It doesn't have to be. Run it locally in 30 seconds with no config (`npx --yes patchdrill demo`). It maps what your existing review and CI should each cover for a diff; `scan` never mutates your repo and commands run only with `--run`.
586
582
 
587
583
  **Does it phone home?** No network calls, no telemetry, no account. Your source never leaves your checkout.
588
584