diff --git a/.github/prompts/issue-execute-plan.md b/.github/prompts/issue-execute-plan.md index 6c97d385a8..97428a6ba1 100644 --- a/.github/prompts/issue-execute-plan.md +++ b/.github/prompts/issue-execute-plan.md @@ -11,10 +11,21 @@ Read: diff, verification, risk). This is your spec. - `/tmp/ai-exec/issue.json` — the issue it fixes (for `Closes #` and context). -## Hard limits (identical to the fix sweep — a workflow step enforces them) +## Hard limits (identical to the fix sweep; only limit 1 is machine-enforced) 1. **Never modify `.github/` or `.templates/`.** Repo-wide infrastructure. -2. **Never touch the `version` or `upstream` fields in `config.yaml`.** +2. **`config.yaml` is yours to edit, except the upstream part of `version`; + never edit `updater.json`** — `addons_updater` owns both. (There is no + `upstream:` key in `config.yaml`.) You must still + bump the local patch counter, or Supervisor never offers the rebuild and the + fix ships inert. Read `updater.json` to find the boundary — you cannot tell + it from `version` alone, since upstream versions here run to four or five + components. With `U` = `upstream_version`: if `version` equals `U`, **append** + `.1` (sonarr `4.0.19.3001` -> `4.0.19.3001.1`); if it is `U` + `.` + digits, + **increment** those digits (radarr `6.3.0.10514.1` -> `6.3.0.10514.2`); + anything else — no `updater.json`, drifted version, LSIO tag, date, nightly — + leave `version` alone and say so in the pull request body. A dot, never a + hyphen. 3. **One add-on, one branch:** `ai-fix/-`. 4. **Never merge, never close the issue, never enable auto-merge.** Open the pull request **ready for review** — CI (`onpr_check-pr.yaml`) validates it, diff --git a/.github/prompts/issue-fix.md b/.github/prompts/issue-fix.md index 392417f7c2..d0cfbfa1c2 100644 --- a/.github/prompts/issue-fix.md +++ b/.github/prompts/issue-fix.md @@ -13,14 +13,52 @@ about confidence matters more than the number of pull requests you open. ## Hard limits -These are not guidelines. A workflow step enforces them after you finish, and -anything that violates them gets blocked and flagged. +These are not guidelines. Limit 1 is machine-enforced — a workflow step checks +every pull request you open and blocks and flags anything that violates it. The +rest are on you: nothing checks them, so breaking one ships silently. 1. **Never modify `.github/` or `.templates/`.** Those are inherited by every add-on in the repo. A change there is a 100-add-on incident, not a fix. -2. **Never touch the `version` or `upstream` fields in `config.yaml`.** The - `addons_updater` job owns those. Editing them causes merge conflicts you - will not be around to resolve. +2. **`config.yaml` is yours to edit, with one carve-out.** Never change the + *upstream part* of `version` — the portion that tracks the upstream release + — and never edit `updater.json` at all. The `addons_updater` job owns both, + and editing them causes merge conflicts you will not be around to resolve. + (There is no `upstream:` key in `config.yaml`; upstream tracking lives in + `updater.json` as `upstream_repo` / `upstream_version`.) + + The **local patch counter** is a different thing and you must bump it. When + you change any file in an add-on, `version` must change too — otherwise + Supervisor never offers the rebuild, the add-on keeps running the old image, + and your fix ships inert: merged, doing nothing, with the issue looking + closed. That is worse than not fixing it at all. + + **You cannot tell the counter from `version` alone — read `updater.json`.** + Upstream versions in this repo have anywhere from one to five components, so + a trailing `.1234` is just as likely to belong to upstream as to be a local + counter. `updater.json`'s `upstream_version` is the authority. Let `U` be + that value, and compare: + + | `version` vs `U` | what to do | example | + |---|---|---| + | identical | **append** `.1` | sonarr `4.0.19.3001` -> `4.0.19.3001.1` | + | `U` + `.` + digits | **increment** those digits | radarr `6.3.0.10514.1` -> `6.3.0.10514.2` | + | anything else | **leave it alone** | plex, readarr, joal | + + Getting this backwards corrupts data you do not own: sonarr's `4.0.19.3001` + *is* the upstream version, so "increment the last component" would produce + `4.0.19.3002` and burn the identifier of a future real release. 82 of the + add-ons in this repo are in that first row — appending is the common case, + incrementing the rare one. + + Use a dot, never a hyphen: `X.Y.Z-N` parses as a semver pre-release, which + Supervisor treats as *older* than `X.Y.Z` and will not offer. + + The third row is not a failure — it is the safe answer whenever the add-on + has no `updater.json`, its `version` has drifted from `upstream_version`, or + the format is exotic (LSIO tag `1.43.1.10611-1e34174b1-ls301`, a date, a + nightly). Do not guess a counter onto those. Leave `version` untouched and + say so — in the pull request body, or in the plan if this issue is going out + as Outcome B — so a human can decide. 3. **One add-on per branch, one branch per pull request.** Branch name `ai-fix/-`. 4. **Never merge, never close an issue, never enable auto-merge.** Opening a diff --git a/.github/prompts/pr-coderabbit.md b/.github/prompts/pr-coderabbit.md index 587abffbcf..101635bbd6 100644 --- a/.github/prompts/pr-coderabbit.md +++ b/.github/prompts/pr-coderabbit.md @@ -23,7 +23,10 @@ Consider only comments authored by `coderabbitai[bot]`. Ignore its collapsed ## Hard limits (a workflow step enforces the first) 1. **Never modify `.github/` or `.templates/`.** Repo-wide infrastructure. -2. **Never touch the `version` or `upstream` fields in `config.yaml`.** +2. **Leave `version` in `config.yaml` alone, and never edit `updater.json`.** The rest of + `config.yaml` is fair game. Unlike the fix sweep, you are amending a pull + request that has *already* bumped the local patch counter — one bump covers + the whole PR, so incrementing it again here would just churn the diff. 3. **Stay within this PR's scope and branch.** Do not open a new PR, do not touch other add-ons, do not merge, do not mark ready/draft. diff --git a/CLAUDE.md b/CLAUDE.md index 01822ff6d3..c3ad3e7700 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -161,7 +161,17 @@ the sweep), `ai:plan-pending` (plan posted, awaiting `ai:approved`), `ai:fixed`, out of the automated tiers but not the manual ones. **Kill switch:** set the repo variable `AI_DISABLED=true` to pause every AI workflow with no file edits. AI fixes must never touch `.github/` or `.templates/` (enforced by -`ai_guard_paths.sh`) or the `version`/`upstream` fields in `config.yaml`. +`ai_guard_paths.sh`). They may edit `config.yaml` freely except the upstream +part of `version`, and must never edit `updater.json` — `addons_updater` owns +both. (There is no `upstream:` key in `config.yaml`; upstream tracking lives in +`updater.json`.) They must still bump the local patch counter so Supervisor +offers the rebuild — +without it the fix ships inert. The counter boundary comes from +`updater.json`'s `upstream_version`, never from the shape of `version`: append +`.1` when the two are equal (the common case — upstream versions here run to +four or five components), increment the trailing digits only when `version` is +`upstream_version` + `.N`, and otherwise leave `version` alone. This rule is +prompt-only, not machine-enforced. ## Linting Rules