Skip to content

Commit b57ef8b

Browse files
committed
Rename package/CLI from patchwork to autopatch
1 parent 96d3285 commit b57ef8b

27 files changed

Lines changed: 81 additions & 81 deletions

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# patchwork
1+
# autopatch
22

33
Bring-your-own-scanner, bring-your-own-feed vulnerability scanning, with
44
Claude Code / Codex opening the fix PR.
@@ -25,13 +25,13 @@ pip install -e .
2525
## Quickstart
2626

2727
```
28-
patchwork scan # table report, uses OSV by default
29-
patchwork scan --format sarif -o out.sarif
30-
patchwork fix --agent claude --dry-run # print the fix prompt, make no changes
31-
patchwork fix --agent claude --pr # open PRs for real (needs `claude` + `gh` on PATH)
28+
autopatch scan # table report, uses OSV by default
29+
autopatch scan --format sarif -o out.sarif
30+
autopatch fix --agent claude --dry-run # print the fix prompt, make no changes
31+
autopatch fix --agent claude --pr # open PRs for real (needs `claude` + `gh` on PATH)
3232
```
3333

34-
## Config (`patchwork.toml`)
34+
## Config (`autopatch.toml`)
3535

3636
```toml
3737
[inventory]
@@ -92,21 +92,21 @@ path = "./our-advisories.json"
9292
## Writing a plugin
9393

9494
Register a scanner, feed, or agent from your own pip package via entry points —
95-
no fork of patchwork required:
95+
no fork of autopatch required:
9696

9797
```toml
9898
# your_package/pyproject.toml
99-
[project.entry-points."patchwork.scanners"]
99+
[project.entry-points."autopatch.scanners"]
100100
mytool = "your_package.scanner:run" # def run(cwd: str, config: dict) -> list[Finding]
101101

102-
[project.entry-points."patchwork.feeds"]
102+
[project.entry-points."autopatch.feeds"]
103103
myfeed = "your_package.feed" # module with match(packages, config) -> list[Finding]
104104

105-
[project.entry-points."patchwork.agents"]
105+
[project.entry-points."autopatch.agents"]
106106
myagent = "your_package.agent" # module with run(prompt: str, cwd: str) -> int
107107
```
108108

109-
`patchwork plugins` lists everything currently registered.
109+
`autopatch plugins` lists everything currently registered.
110110

111111
## GitHub Actions
112112

action.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: patchwork
1+
name: autopatch
22
description: Bring-your-own-scanner, bring-your-own-feed vulnerability scanning with agent-driven auto-fix PRs.
33
branding:
44
icon: shield
@@ -9,14 +9,14 @@ inputs:
99
description: Directory to scan
1010
default: "."
1111
config:
12-
description: Path to patchwork.toml
12+
description: Path to autopatch.toml
1313
required: false
1414
fail-on:
1515
description: Minimum severity that fails the job (critical|high|medium|low|none)
1616
default: "high"
1717
sarif-output:
1818
description: Path to write the SARIF report
19-
default: "patchwork.sarif"
19+
default: "autopatch.sarif"
2020
upload-sarif:
2121
description: Upload the SARIF report to GitHub Code Scanning
2222
default: "true"
@@ -38,7 +38,7 @@ runs:
3838
with:
3939
python-version: "3.12"
4040

41-
- name: Install patchwork
41+
- name: Install autopatch
4242
shell: bash
4343
run: pip install "${{ github.action_path }}[yaml]"
4444

@@ -59,7 +59,7 @@ runs:
5959
set +e
6060
ARGS="${{ inputs.path }}"
6161
[ -n "${{ inputs.config }}" ] && ARGS="$ARGS --config ${{ inputs.config }}"
62-
patchwork scan $ARGS --format sarif -o "${{ inputs.sarif-output }}" --fail-on "${{ inputs.fail-on }}"
62+
autopatch scan $ARGS --format sarif -o "${{ inputs.sarif-output }}" --fail-on "${{ inputs.fail-on }}"
6363
echo "exit_code=$?" >> "$GITHUB_OUTPUT"
6464
6565
- name: Upload SARIF
@@ -74,7 +74,7 @@ runs:
7474
run: |
7575
ARGS="${{ inputs.path }}"
7676
[ -n "${{ inputs.config }}" ] && ARGS="$ARGS --config ${{ inputs.config }}"
77-
patchwork fix $ARGS --agent "${{ inputs.agent }}" --max "${{ inputs.max-prs }}" --pr
77+
autopatch fix $ARGS --agent "${{ inputs.agent }}" --max "${{ inputs.max-prs }}" --pr
7878
7979
- name: Fail on findings
8080
if: steps.scan.outputs.exit_code != '0'
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from __future__ import annotations
22

3-
from patchwork.registry import load_plugins
4-
from patchwork.agents import claude, codex
3+
from autopatch.registry import load_plugins
4+
from autopatch.agents import claude, codex
55

66
BUILTIN = {"claude": claude, "codex": codex}
77

88

99
def get(name: str):
10-
plugins = load_plugins("patchwork.agents", BUILTIN)
10+
plugins = load_plugins("autopatch.agents", BUILTIN)
1111
module = plugins.get(name)
1212
if module is None:
1313
raise ValueError(f"unknown agent: {name!r} (available: {sorted(plugins)})")

patchwork/cli.py renamed to autopatch/cli.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
import sys
55
from pathlib import Path
66

7-
from patchwork import inventory, feeds, scanners, report, fix
8-
from patchwork.config import Config
9-
from patchwork.registry import load_plugins
7+
from autopatch import inventory, feeds, scanners, report, fix
8+
from autopatch.config import Config
9+
from autopatch.registry import load_plugins
1010

1111

1212
def _collect_findings(cfg: Config, cwd: str):
1313
packages = inventory.collect(cfg.paths, cfg.sbom)
1414
findings = feeds.match_all(packages, cfg.feeds)
1515
findings.extend(scanners.run_all(cwd, cfg.scanners))
16-
from patchwork.models import dedupe
16+
from autopatch.models import dedupe
1717
findings = dedupe(findings)
1818
return [f for f in findings if f.id not in cfg.ignore]
1919

@@ -61,30 +61,30 @@ def cmd_fix(args) -> int:
6161

6262

6363
def cmd_plugins(args) -> int:
64-
from patchwork.feeds import BUILTIN as feed_builtins
65-
from patchwork.scanners import BUILTIN as scanner_builtins
66-
from patchwork.agents import BUILTIN as agent_builtins
67-
print("feeds: ", sorted(load_plugins("patchwork.feeds", feed_builtins)))
68-
print("scanners:", sorted(load_plugins("patchwork.scanners", scanner_builtins)))
69-
print("agents: ", sorted(load_plugins("patchwork.agents", agent_builtins)))
64+
from autopatch.feeds import BUILTIN as feed_builtins
65+
from autopatch.scanners import BUILTIN as scanner_builtins
66+
from autopatch.agents import BUILTIN as agent_builtins
67+
print("feeds: ", sorted(load_plugins("autopatch.feeds", feed_builtins)))
68+
print("scanners:", sorted(load_plugins("autopatch.scanners", scanner_builtins)))
69+
print("agents: ", sorted(load_plugins("autopatch.agents", agent_builtins)))
7070
return 0
7171

7272

7373
def build_parser() -> argparse.ArgumentParser:
74-
parser = argparse.ArgumentParser(prog="patchwork")
74+
parser = argparse.ArgumentParser(prog="autopatch")
7575
sub = parser.add_subparsers(dest="command", required=True)
7676

7777
scan = sub.add_parser("scan", help="scan for vulnerable packages")
7878
scan.add_argument("paths", nargs="*", default=["."])
79-
scan.add_argument("--config", help="path to patchwork.toml")
79+
scan.add_argument("--config", help="path to autopatch.toml")
8080
scan.add_argument("--format", choices=sorted(report.FORMATS), default="table")
8181
scan.add_argument("-o", "--output", help="write report to a file instead of stdout")
8282
scan.add_argument("--fail-on", choices=["critical", "high", "medium", "low", "none"])
8383
scan.set_defaults(func=cmd_scan)
8484

8585
fix_p = sub.add_parser("fix", help="open fix PRs for vulnerable packages via a coding agent")
8686
fix_p.add_argument("paths", nargs="*", default=["."])
87-
fix_p.add_argument("--config", help="path to patchwork.toml")
87+
fix_p.add_argument("--config", help="path to autopatch.toml")
8888
fix_p.add_argument("--agent", choices=["claude", "codex"])
8989
fix_p.add_argument("--max", type=int, help="max packages to fix in this run")
9090
fix_p.add_argument("--pr", action="store_true", help="push the branch and open a PR (needs gh)")
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""patchwork.toml loader. CLI flags always win over file config."""
1+
"""autopatch.toml loader. CLI flags always win over file config."""
22
from __future__ import annotations
33

44
import tomllib
@@ -22,7 +22,7 @@ class Config:
2222
@classmethod
2323
def load(cls, path: Optional[str]) -> "Config":
2424
cfg = cls()
25-
toml_path = Path(path) if path else Path("patchwork.toml")
25+
toml_path = Path(path) if path else Path("autopatch.toml")
2626
if not toml_path.exists():
2727
return cfg
2828
data = tomllib.loads(toml_path.read_text(encoding="utf-8"))
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
from typing import List
44

5-
from patchwork.models import Finding, Package, dedupe
6-
from patchwork.registry import load_plugins
7-
from patchwork.feeds import osv, file as file_feed
5+
from autopatch.models import Finding, Package, dedupe
6+
from autopatch.registry import load_plugins
7+
from autopatch.feeds import osv, file as file_feed
88

99
BUILTIN = {"osv": osv, "file": file_feed, "url": file_feed}
1010

1111

1212
def match_all(packages: List[Package], feeds_config: dict) -> List[Finding]:
1313
"""Run every configured feed and return the deduplicated union of findings."""
14-
plugins = load_plugins("patchwork.feeds", BUILTIN)
14+
plugins = load_plugins("autopatch.feeds", BUILTIN)
1515
findings: List[Finding] = []
1616
for name, cfg in feeds_config.items():
1717
cfg = dict(cfg or {})
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
from pathlib import Path
1212
from typing import List
1313

14-
from patchwork.models import Finding, Package
15-
from patchwork.versions import fixed_versions_for, in_range
16-
from patchwork.feeds.osv import classify_severity, summary_of, url_for, _ECOSYSTEM_MAP
14+
from autopatch.models import Finding, Package
15+
from autopatch.versions import fixed_versions_for, in_range
16+
from autopatch.feeds.osv import classify_severity, summary_of, url_for, _ECOSYSTEM_MAP
1717

1818

1919
def _load(source: str) -> list:

0 commit comments

Comments
 (0)