Skip to content

Commit aeb9730

Browse files
committed
docs: rewrite README in plain active voice, drop em dashes repo-wide
1 parent becae6e commit aeb9730

14 files changed

Lines changed: 93 additions & 93 deletions

File tree

README.md

Lines changed: 65 additions & 65 deletions
Large diffs are not rendered by default.

docs/screenshots.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@ freeze --execute "$PB plugins" -o "$OUT/plugins.png" "${FREEZE_OPTS[@]}"
1717
freeze .github/workflows/patchbot-fix-example.yml -o "$OUT/workflow.png" "${FREEZE_OPTS[@]}"
1818

1919
echo "Wrote screenshots to $OUT/"
20-
echo "code-scanning.png and fix-pr.png are captured manually from GitHub see README."
20+
echo "code-scanning.png and fix-pr.png are captured manually from GitHub: see README."

patchbot/agents/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Anthropic API agent: no CLI, no npm/node just `pip install patchbot[api]`.
1+
"""Anthropic API agent: no CLI, no npm/node: just `pip install patchbot[api]`.
22
33
Runs a small tool loop (bash + write_file, scoped to cwd) via the Python
44
SDK's tool runner. Good default for CI: nothing to install but a Python

patchbot/agents/managed.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
"""Claude Managed Agents backend: the fix runs in Anthropic's sandbox, not
2-
on the CI runner. The GitHub token never enters the sandbox repo
2+
on the CI runner. The GitHub token never enters the sandbox: repo
33
clone/push goes through Anthropic's git proxy (`authorization_token`) and
44
PR creation goes through a vaulted GitHub MCP credential.
55
66
Requires `patchbot managed init` to have been run once (see
77
patchbot/managed_setup.py) and its three IDs supplied via `config`:
8-
`agent_id`, `environment_id`, `vault_id` normally read from
8+
`agent_id`, `environment_id`, `vault_id`: normally read from
99
PATCHBOT_MANAGED_AGENT_ID / _ENVIRONMENT_ID / _VAULT_ID.
1010
1111
The caller (fix.py) is responsible for host-side verification after this
12-
returns a session's own claim of success is never the fix gate.
12+
returns: a session's own claim of success is never the fix gate.
1313
"""
1414
from __future__ import annotations
1515

@@ -44,7 +44,7 @@ def run(prompt: str, cwd: str, model: Optional[str] = None, timeout: int = 600,
4444
if not (agent_id and environment_id and vault_id):
4545
raise RuntimeError(
4646
"agent 'managed' requires agent_id/environment_id/vault_id "
47-
"(run `patchbot managed init` first) see README"
47+
"(run `patchbot managed init` first): see README"
4848
)
4949
if not github_token:
5050
raise RuntimeError("agent 'managed' requires GITHUB_TOKEN in the environment")
@@ -71,7 +71,7 @@ def run(prompt: str, cwd: str, model: Optional[str] = None, timeout: int = 600,
7171
session_kwargs["agent"] = {"type": "agent_with_overrides", "id": agent_id, "model": model}
7272

7373
session = client.beta.sessions.create(**session_kwargs)
74-
print(f"[managed] session {session.id} https://platform.claude.com/sessions/{session.id}")
74+
print(f"[managed] session {session.id}: https://platform.claude.com/sessions/{session.id}")
7575

7676
saw_error = False
7777
stop_reason_type = None
@@ -89,5 +89,5 @@ def run(prompt: str, cwd: str, model: Optional[str] = None, timeout: int = 600,
8989
break
9090

9191
# The rescan/test verification that actually gates the PR happens
92-
# host-side in fix.py this is only "did the session run cleanly".
92+
# host-side in fix.py: this is only "did the session run cleanly".
9393
return 1 if saw_error or stop_reason_type == "retries_exhausted" else 0

patchbot/bump.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Tier 0 of the fix loop: a deterministic version bump, no agent involved.
22
3-
Most vulnerable-package fixes are exactly this rewrite the pin, regenerate
3+
Most vulnerable-package fixes are exactly this: rewrite the pin, regenerate
44
the lockfile, done. The agent tiers in fix.py only run when this fails
55
(major bump breaks the build, tests fail, or the package isn't a direct
66
dependency this module knows how to edit).
@@ -27,7 +27,7 @@ def _bump_npm(cwd: Path, name: str, version: str) -> bool:
2727
pattern = re.compile(rf'("{escaped}"\s*:\s*")[^"]*(")')
2828
new_text, count = pattern.subn(rf"\g<1>^{version}\g<2>", text)
2929
if count == 0:
30-
return False # not a direct dependency let the agent tier handle it
30+
return False # not a direct dependency: let the agent tier handle it
3131
_write(manifest, new_text)
3232

3333
if shutil.which("npm") and (cwd / "package-lock.json").exists():
@@ -39,7 +39,7 @@ def _bump_npm(cwd: Path, name: str, version: str) -> bool:
3939
if shutil.which("yarn") and (cwd / "yarn.lock").exists():
4040
result = subprocess.run(["yarn", "install", "--mode", "update-lockfile"], cwd=cwd, capture_output=True)
4141
return result.returncode == 0
42-
return False # no lockfile tool available to regenerate don't leave it stale
42+
return False # no lockfile tool available to regenerate: don't leave it stale
4343

4444

4545
def _bump_pip(cwd: Path, name: str, version: str) -> bool:
@@ -93,7 +93,7 @@ def _bump_cargo(cwd: Path, name: str, version: str) -> bool:
9393
["cargo", "update", "-p", name, "--precise", version], cwd=cwd, capture_output=True,
9494
)
9595
return result.returncode == 0
96-
return True # no lockfile yet the manifest edit alone is the fix
96+
return True # no lockfile yet: the manifest edit alone is the fix
9797

9898

9999
_BUMPERS = {
@@ -107,7 +107,7 @@ def _bump_cargo(cwd: Path, name: str, version: str) -> bool:
107107
def try_bump(cwd: str, ecosystem: str, name: str, target_version: str) -> bool:
108108
"""Attempt the deterministic fix. Returns True if the manifest (and
109109
lockfile, where applicable) were rewritten successfully. False means
110-
"give up cleanly" the caller escalates to the agent tier."""
110+
"give up cleanly": the caller escalates to the agent tier."""
111111
bumper = _BUMPERS.get(ecosystem)
112112
if bumper is None:
113113
return False

patchbot/feeds/file.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
Accepts either a bare list of OSV vuln records or `{"vulns": [...]}`
44
(OSV's own bulk export shape), so a user's private feed needs no custom
5-
parser just OSV-format JSON.
5+
parser: just OSV-format JSON.
66
"""
77
from __future__ import annotations
88

patchbot/feeds/osv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""OSV.dev feed the default, always-on threat feed.
1+
"""OSV.dev feed: the default, always-on threat feed.
22
33
Batch-query adapted from prismor's supplychain/scoring/osv_lookup.py:
44
querybatch returns id+modified only, so full details (severity, summary,

patchbot/fix.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
"""Tiered fix loop: one branch + one PR per vulnerable package.
22
33
Tier 0 (patchbot.bump) tries a deterministic version bump + lockfile
4-
regen first no agent involved, mirrors what Dependabot already does well.
4+
regen first: no agent involved, mirrors what Dependabot already does well.
55
Only when that fails to clear the advisory (or fails a configured
66
test_cmd) does the configured agent get a turn, with the failure itself as
77
its brief rather than the original vague "go fix this" task.
88
9-
Sequential by design (`--max` caps how many packages get a PR per run)
9+
Sequential by design (`--max` caps how many packages get a PR per run) -
1010
concurrent agents editing the same working tree would race on git state.
1111
"""
1212
from __future__ import annotations
@@ -21,7 +21,7 @@
2121
from patchbot.versions import version_gte
2222

2323
# Files an agent is allowed to have touched. Anything outside this stays
24-
# clean a CI-hosted agent has a shell, and a diff that reaches outside
24+
# clean: a CI-hosted agent has a shell, and a diff that reaches outside
2525
# the dependency surface (CI config, dotfiles, .git internals) is rejected
2626
# rather than shipped in a PR.
2727
_DISALLOWED_PREFIXES = (".github/", ".git/", ".gitlab-ci", ".circleci/")
@@ -109,7 +109,7 @@ def _diff_allowed(cwd: str) -> bool:
109109

110110
def _verify(cwd: str, ecosystem: str, name: str, target_version: Optional[str],
111111
original_version: str, test_cmd: Optional[str]) -> tuple:
112-
"""Returns (ok, detail) detail is empty on success, or a failure
112+
"""Returns (ok, detail): detail is empty on success, or a failure
113113
summary suitable for handing to the next tier as its prompt."""
114114
new_version = _rescan_version(cwd, ecosystem, name)
115115
if target_version:
@@ -176,7 +176,7 @@ def run(
176176
if bumped else bump_prompt
177177
)
178178
if agent_name == "managed":
179-
# The session edits a remote clone, not `cwd` push what we
179+
# The session edits a remote clone, not `cwd`: push what we
180180
# have so far so it exists to check out, then pull its result
181181
# back before verifying locally.
182182
_git(["add", "-A"], cwd)

patchbot/inventory/lockfiles.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Manifest and lockfile parsers.
22
3-
Ported from prismor's prismor/runtime/deps.py trimmed to pure functions
3+
Ported from prismor's prismor/runtime/deps.py: trimmed to pure functions
44
that return Package objects instead of dicts, since patchbot has no
55
policy-feed correlation step of its own.
66
"""
@@ -209,7 +209,7 @@ def collect(workspace: Path) -> List[Package]:
209209
JS ecosystems resolve through lockfiles (npm/pnpm/yarn all merge into
210210
one flat name->version map, unioned since they're all the "npm" OSV
211211
ecosystem). Other ecosystems are read straight off the manifest since
212-
patchbot doesn't parse poetry.lock/Cargo.lock/go.sum see README for
212+
patchbot doesn't parse poetry.lock/Cargo.lock/go.sum: see README for
213213
the CycloneDX SBOM path if you need transitive deps there.
214214
"""
215215
packages: List[Package] = []

patchbot/managed_setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""One-time setup and scheduling for the `managed` (Claude Managed Agents)
2-
fix backend. Not part of the per-fix hot path `patchbot managed init`
2+
fix backend. Not part of the per-fix hot path: `patchbot managed init`
33
creates the Agent/Environment/Vault once; `patchbot managed deploy` sets up
44
a cron-scheduled session that scans + fixes without any CI at all.
55
"""

0 commit comments

Comments
 (0)