From f6b220fc5c42638c09236f6bb48aac26a02b2329 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 8 Nov 2026 19:25:54 +0000 Subject: [PATCH 1/5] feat(audits): audits.extraPrLabels for every PR the audits open The audits label their PRs with the category label and labels.automated only, so a repo that hands PRs to a response loop by label (foreman's foreman:watch) had no way to include audit PRs. pepper#6103 sat 8 hours with an unanswered Greptile P2 because nothing watched it. Adds an optional audits.extraPrLabels (default []) to the config schema and applies it on PRs, never issues, in audit-architecture, audit-tests, audit-security and audit-deps. Mirrors autoDev.extraPrLabels. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01QNDeh8JQ33LnS9i2uXvUNV --- plugins/audits/references/config-schema.md | 7 +++++++ plugins/audits/skills/audit-architecture/SKILL.md | 11 ++++++++--- plugins/audits/skills/audit-deps/SKILL.md | 5 ++++- plugins/audits/skills/audit-security/SKILL.md | 4 +++- plugins/audits/skills/audit-tests/SKILL.md | 4 +++- plugins/auto-dev/references/config-schema.md | 7 +++++++ plugins/core/references/config-schema.md | 7 +++++++ plugins/deps-flow/references/config-schema.md | 7 +++++++ plugins/journal/references/config-schema.md | 7 +++++++ plugins/repo-ops/references/config-schema.md | 7 +++++++ plugins/research/references/config-schema.md | 7 +++++++ 11 files changed, 67 insertions(+), 6 deletions(-) diff --git a/plugins/audits/references/config-schema.md b/plugins/audits/references/config-schema.md index 45e5ec2..7215278 100644 --- a/plugins/audits/references/config-schema.md +++ b/plugins/audits/references/config-schema.md @@ -108,6 +108,13 @@ Read with whatever is convenient — the `Read` tool, or `jq` for a single value "depsPrCap": 3, // audit-deps: max PRs per run (a batched routine-bump PR counts as one) "depsIssueCap": 5, // audit-deps: max issues per run + // OPTIONAL extra label names applied to every PR (not issue) any audit opens, alongside the + // audit's own category label and labels.automated, wherever those are applied (create, the + // follow-up `gh pr edit`, the REST fallback). Use it for a label that hands the PR to + // downstream automation, e.g. ["foreman:watch"] so a response loop answers its review. + // Each must already exist; the audits never create labels. Default [] if absent. + "extraPrLabels": [], + // audit-architecture: oversized-file line-count threshold, shared across every language // block (Python, TypeScript, and the language-generic fallback). Raise it on a repo with // many large-but-legitimate files rather than let the category flag dozens of files and diff --git a/plugins/audits/skills/audit-architecture/SKILL.md b/plugins/audits/skills/audit-architecture/SKILL.md index fe2449f..20ad42b 100644 --- a/plugins/audits/skills/audit-architecture/SKILL.md +++ b/plugins/audits/skills/audit-architecture/SKILL.md @@ -18,7 +18,7 @@ Before doing anything else, load the repo config (see [`../../references/config- > This repo has no `.claude/maintainerd.json`. Run `/bootstrap` to generate it, then re-run me. Do not guess values or hardcode another repo's settings. -3. Read the keys this skill uses: `config.repo`, `config.defaultBranch`, `config.language`, `config.paths.source`, `config.paths.tests`, `config.paths.skillsDir`, `config.commands.format`/`lint`/`build`/`test`, `config.guidelines.invariants`, `config.guidelines.coding`, `config.labels.architecture`, `config.labels.automated`, `config.audits.prCap`, `config.audits.issueCap`, `config.audits.oversizedLines`, `config.audits.promoteThreshold`, `config.audits.promoteLookbackDays`. Treat any `null` command as *"this repo has no such step — skip it"*. For any key that is **absent**, fall back to the documented default (caps default to 3 PRs / 5 issues; the oversized-files line-count threshold defaults to 500; pattern-promotion defaults to a threshold of 3 within 90 days) and mention the fallback in your run report. +3. Read the keys this skill uses: `config.repo`, `config.defaultBranch`, `config.language`, `config.paths.source`, `config.paths.tests`, `config.paths.skillsDir`, `config.commands.format`/`lint`/`build`/`test`, `config.guidelines.invariants`, `config.guidelines.coding`, `config.labels.architecture`, `config.labels.automated`, `config.audits.extraPrLabels` (default `[]`), `config.audits.prCap`, `config.audits.issueCap`, `config.audits.oversizedLines`, `config.audits.promoteThreshold`, `config.audits.promoteLookbackDays`. Treat any `null` command as *"this repo has no such step — skip it"*. For any key that is **absent**, fall back to the documented default (caps default to 3 PRs / 5 issues; the oversized-files line-count threshold defaults to 500; pattern-promotion defaults to a threshold of 3 within 90 days) and mention the fallback in your run report. Throughout this skill, `config.` refers to a value from that file. In the detection commands below, `config.paths.source` stands for your configured source root (e.g. `src/pepper/` or `src/`) and `config.paths.tests` your test root — substitute the literal value when you run them. @@ -202,6 +202,7 @@ git push -u origin "$SLUG" gh pr create --repo \ --title ": " \ --label --label \ + --label \ --body "$(cat <<'EOF' ## Summary @@ -229,12 +230,16 @@ EOF Match the conventional prefix to the work (`refactor:`, `chore:`, `fix:`). +Repeat `--label` once per entry in `config.audits.extraPrLabels` (omit the line when it is empty). +Those labels go on PRs only, never on the issues in step 6. If `gh` reports one of them does not +exist, do not create it: open the PR without it and name the missing label in the report. + **When GraphQL is blocked**, `gh pr create` is 403. Push the branch the same way, then open the PR with `POST /repos/{owner}/{repo}/pulls` — **Create a PR** in [`../../references/gh-rest-fallbacks.md`](../../references/gh-rest-fallbacks.md). Labels are a separate `POST /issues/{n}/labels` call there, so `config.labels.architecture` and -`config.labels.automated` land a moment after the `opened` webhook rather than with it. For these -two labels that is fine — they are routing labels, not review-gating ones — so create the PR +`config.labels.automated` (and every `config.audits.extraPrLabels` entry) land a moment after the +`opened` webhook rather than with it. For these labels that is fine — they are routing labels, not review-gating ones — so create the PR non-draft and apply them immediately after, and note the ordering in the report. If this repo's labels *do* gate a review bot, take the second branch that reference describes: leave the PR a draft, label it, and stop with the PR URL and the one action a human must take. `gh pr ready` is diff --git a/plugins/audits/skills/audit-deps/SKILL.md b/plugins/audits/skills/audit-deps/SKILL.md index 56ca7b4..f259291 100644 --- a/plugins/audits/skills/audit-deps/SKILL.md +++ b/plugins/audits/skills/audit-deps/SKILL.md @@ -30,6 +30,8 @@ Keys this skill uses: - `config.labels.dependencies` — label applied to every PR/issue this skill opens (default `dependencies`). - `config.labels.automated` — also applied (default `automated`). +- `config.audits.extraPrLabels` — extra labels applied to every PR (not issue) this skill opens + (default `[]`). Each must already exist; never create one. - `config.audits.depsPrCap` / `config.audits.depsIssueCap` — per-run caps (default **3 / 5**). - `config.guidelines.*` — if the repo documents a **dependency or license policy** (an allowed-license allowlist, a "pin exactly / never auto-bump X" rule, a "stay on major N of Y" constraint), honor @@ -155,7 +157,8 @@ Everything else is its **own** unit of work: For every PR: branch `deps--` off `config.defaultBranch`, **delegate to `create-pr` if installed** (else run `config.commands.*` as pre-flight; no `--no-verify`), label -`config.labels.dependencies` + `config.labels.automated`, never auto-merge. Caps default **3 PRs / +`config.labels.dependencies` + `config.labels.automated` plus every `config.audits.extraPrLabels` +entry, never auto-merge. Caps default **3 PRs / 5 issues**; defer overflow to the next run and note it in the report. ### 6. Report diff --git a/plugins/audits/skills/audit-security/SKILL.md b/plugins/audits/skills/audit-security/SKILL.md index 9dbfd94..49efabe 100644 --- a/plugins/audits/skills/audit-security/SKILL.md +++ b/plugins/audits/skills/audit-security/SKILL.md @@ -36,6 +36,7 @@ Before anything else, load the repo config (see - `config.commands.{format,lint,build,test}` — pre-flight gate before any PR (skip `null` ones). - `config.labels.security` — label applied to every PR/issue this skill opens (default `security`). - `config.labels.automated` — also applied (default `automated`). + - `config.audits.extraPrLabels` — extra labels applied to every PR (not issue) this skill opens (default `[]`). Each must already exist; never create one. - `config.audits.securityPrCap` / `config.audits.securityIssueCap` — per-run caps (default **3 / 5**). - `config.audits.promoteThreshold` / `config.audits.promoteLookbackDays` — pattern-promotion knobs (default **3** within **90** days). See step 6. - `config.guidelines.invariants` / `config.guidelines.coding` — **the repo's own security rules.** @@ -174,7 +175,8 @@ Process findings **highest-severity first**. For each: - Branch `sec--` off `config.defaultBranch`. - **Delegate to `create-pr` if installed**; else run `config.commands.{format,lint,build,test}` (skip `null`) as pre-flight before pushing. No `--no-verify`. Never auto-merge. - - Label `config.labels.security` + `config.labels.automated`. For a dependency bump, the PR body + - Label `config.labels.security` + `config.labels.automated`, plus every + `config.audits.extraPrLabels` entry. For a dependency bump, the PR body must name the CVE/GHSA, the version delta, and that tests pass. - **Issue** (counts against `config.audits.securityIssueCap`) otherwise — describe the vuln, its impact, evidence (`file:line`), and a proposed fix; don't write the code. diff --git a/plugins/audits/skills/audit-tests/SKILL.md b/plugins/audits/skills/audit-tests/SKILL.md index 4b530bc..9f23256 100644 --- a/plugins/audits/skills/audit-tests/SKILL.md +++ b/plugins/audits/skills/audit-tests/SKILL.md @@ -32,6 +32,7 @@ Before anything else, load the repo config (see - `config.commands.coverage` — coverage command. **If `null`, skip the coverage-gap category entirely** (don't invent one). - `config.commands.format` / `config.commands.lint` — pre-flight gates (skip any that are `null`). - `config.labels.testQuality` / `config.labels.automated` — labels applied to every PR/issue this skill opens. + - `config.audits.extraPrLabels` — extra labels applied to every PR (not issue) this skill opens (default `[]`). Each must already exist; never create one. - `config.audits.testPrCap` / `config.audits.testIssueCap` — per-run caps (default **2 / 2** if absent; note the fallback in your report). - `config.audits.promoteThreshold` / `config.audits.promoteLookbackDays` — pattern-promotion knobs (default **3** within **90** days if absent). See step 7. - `config.guidelines.testing` — **the repo's own test conventions.** Read this file in full; it holds the repo-specific rules (the DB/fixture pattern, what may and may not be mocked, isolation rules, assertion expectations, redundant framework boilerplate, naming) that this skill checks the suite against. If it's missing or still full of `TODO` markers, say so in your report and proceed with the language-generic checks only. @@ -207,7 +208,8 @@ git push -u origin "$SLUG" gh pr create --repo --base \ --title "test: " \ --body "