Repository navigation
fix(claude-ops): refuse to downgrade in plugins sync and document marketplace remove - #3936
Merged
Merged
Conversation
kyle-sexton
marked this pull request as ready for review
September 7, 2026 15:00
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…ketplace remove fleet-state.sh compares direction: a catalog version parsed to a numeric triple that is lower than the installed one is a proven downgrade, withheld from update-candidates-user and the new update-candidates-project and named by the new downgrade-candidates selector. sync sweeps only the guarded selectors, reports withheld ids under Action needed with the likely cause, takes --allow-downgrade as the explicit opt-in, classifies every old/new pair by direction in Step 6 so a backward move renders under Downgraded: and never Updated:, snapshots the catalog before each Step 1 refresh and diffs consecutive snapshots to name the interval a catalog moved backward, and no longer widens to installed-user on a failed refresh. converge blocks its update-to-highest strategy when the catalog is below the highest installed scope. gotchas.md, sync.md and scope-semantics.md state that marketplace remove with plugins still installed deletes every install record at every scope, each plugin's CLAUDE_PLUGIN_DATA directory including this skill's run journal, and the marketplace's settings entries, with no --keep-data on that subcommand; verified against the CLI bundle, the plugin-marketplaces and plugins-reference pages, and --help on 2026-09-07 (Claude Code 2.1.263, win32). Closes #3930 Closes #3931 Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01QKEaVqVaeGnNeFq14sc6pW
kyle-sexton
force-pushed
the
fix/plugins-sync-downgrade-guard
branch
from
September 7, 2026 15:05
706a34f to
d5b6ea0
Compare
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01QKEaVqVaeGnNeFq14sc6pW
kyle-sexton
added a commit
that referenced
this pull request
Sep 7, 2026
…pshot (#3938) Closes #3937 ## Summary The catalog-regression check added to the `plugins` skill in 0.44.0 diffs consecutive run-journal snapshots and names the first interval in which a marketplace catalog moved backward. The earliest snapshot in that chain, `pre-refresh.<mp>.json`, was written by `sync.md`'s Step 1 in the same code fence as `claude plugin marketplace update`. The `audit` action runs the same algorithm with every mutating call replaced by a prediction, so the skill read Step 1 as wholly mutating and said so outright: Step 3's `audit` bullet stated "Step 1 never runs", and the run journal's `audit` paragraph listed only Steps 2-5 among the reports an `audit` run writes. An `audit` run's regression check therefore started at `pre` and lost its first interval, the one that isolates the refresh point. The snapshot is a read, taken through the read-only `fleet-state.sh`. `audit` legitimately declines only the `claude plugin marketplace update` call beside it. ## Fix Prose only; no script changed. - **`context/sync.md` Step 1** splits its one code fence in two, each labelled: the snapshot is a read both actions take, the refresh is the `sync`-only mutation that `audit` renders as `would run:`. The rationale paragraph now states what a regression in the `pre-refresh` to `pre` interval means per action: under `sync` this run's own refresh pulling a source that moved backward, under `audit` the catalog changing under the run, since that run issued no refresh. - **Step 3's `audit` bullet** now reads "Step 1's refresh never runs (its snapshot is a read and is still taken)" instead of "Step 1 never runs". - **The "Run journal" section**: the `pre-refresh.<mp>.json` table row, the file-list paragraph, the catalog-regression bullet, and the `audit` scratch-directory paragraph now read for both actions, and place the scratch `run_dir`'s creation before Step 1 rather than before Step 2. - **`SKILL.md`**: the action table row ("every mutating CLI call replaced with a prediction; the reads those calls sit beside still run") and the "Action: audit" section, which now states the Step 1 snapshot is taken and why, and describes the scratch directory the same way. - **`evals/evals.json`**: eval 2, `audit-issues-zero-mutating-calls`, gains an expectation that the response still takes the pre-refresh snapshot before declining the refresh, with its `expected_output` amended to match. `fleet-state.test.sh` gains no case: no script changed, and its only `sync.md` mention is a comment. The behaviour under test is prose the model executes, which is what the eval covers. Out of scope and deliberately untouched: the downgrade guard's own logic, and the version parser's three-component ceiling being framed only as a prerelease-suffix case. ## Verification Rebased onto `main` at 90cd27d after `fad23dfeb` took 0.44.1; this change is 0.44.2. Both commits are signature-verified. - `check-skill.sh plugins` (skill-quality's static contract gate): `PASS — 0 errors, 1 warning(s)`. The warning is the pre-existing 200-line soft target (SKILL.md is 419 lines against a 500 hard cap; it was 413 before this change). Its internal probes reported `markdownlint clean` and passed all three bundled script suites: `fleet-state.test.sh`, `cache-content-check.test.sh`, `normalize-enabled-plugins.test.sh`. - `fleet-state.test.sh` standalone, the one suite `affected-tests.sh --explain` attributes to `sync.md`: `90 cases, 0 failed`. - `check-evals-quality.sh`: `PASS (0 warning(s) across 1 file(s))`. The evals file also validates against the bundled `evals.schema.json`. - `markdownlint-cli2` over the three changed markdown files: `Summary: 0 issues in 0 files`. - `check-changelog-parity.sh` in all four modes: `--check`, `--check-bump origin/main`, `--check-preserved origin/main` (184 headings compared), `--check-order` (93 changelogs). All pass. - `check-purged-em-dashes.sh --check`: 98 declared paths, 130 files scanned, no em dashes. - A separate fresh-context verifier subagent audited the committed diff blind to the reasoning that produced it, against pass/fail criteria: does `audit` now take the snapshot, does it still issue zero mutating calls, is the first interval available in both actions, does the committed prose match the (unchanged) scripts, and do the repo's conventions hold. Verdict: PASS on all eight criteria, no must-fix items. Its nice-to-haves are folded into the second commit. No `claude plugin` mutating command was run at any point in producing this change. ## Related Refs #3930 (the downgrade guard's originating report) and #3936 (the PR that added the guard and this snapshot chain). --------- Co-authored-by: Claude Opus 5 (1M context) <[email protected]> Co-authored-by: Cursor Agent <[email protected]> Co-authored-by: ksextonmelodic <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3930
Closes #3931
Summary
/claude-ops:plugins syncselected update candidates on string inequality and calledclaude plugin updateunconditionally, so a marketplace catalog that read lower than the installed versions rolled the whole fleet back and the report printed the rollback underUpdated:. Separately, the skill presented its run journal under${CLAUDE_PLUGIN_DATA}as a recovery source without saying thatclaude plugin marketplace removedeletes it along with every install record for the marketplace.Fix
fleet-state.shcompares direction with a numericmajor.minor.patchtriple. A catalog version lower than installed is a proven downgrade, withheld fromupdate-candidates-userand the newupdate-candidates-project, and named by the newdowngrade-candidatesselector (id\tscope\tinstalled\tcatalog). Null, unparseable, and tied versions stay fail-open candidates, as before.sync: Steps 2 and 3 sweep only the guarded selectors; withheld ids go underAction neededwith the likely cause (a marketplace source that moved backward);--allow-downgradeis the explicit opt-in; Step 6 classifies every old/new pair by direction so a backward move renders under the newDowngraded:row and neverUpdated:, including for fail-open ids the CLI still touched; Step 1 savespre-refresh.<mp>.jsonbefore each refresh and Step 6 diffscatalog_versionsacross consecutive snapshots to name the first interval a catalog moved backward; a failed refresh no longer widens the sweep to unguardedinstalled-user;auditpredictsWould withhold.converge: the update-to-highest strategy is BLOCKED when the catalog is below the highest installed scope (plugin updateinstalls the catalog version, not the sibling scope's).gotchas.mdgains a section stating thatmarketplace remove, with plugins still installed, deletes every install record at every scope, each plugin'sCLAUDE_PLUGIN_DATAdirectory (this skill'splugins-sync/runs/included), and the marketplace'senabledPlugins/pluginConfigsentries, with no--keep-dataon that subcommand; the settings map is a recovery source only where something outside Claude Code holds it.sync.mdstates the journal's durability boundary;scope-semantics.mdseparates its post-uninstallobservation from the still-installed case. Four-part verification record included.claude-ops0.43.0 -> 0.44.0, CHANGELOG entry, one new eval case.Verification
fleet-state.test.sh: 90 cases, 240 assertions, 0 failed (86 cases before). New cases cover catalog lower / higher / null / unparseable / prerelease tie,update-candidates-project,downgrade-candidates,--fromfor all three, required-field rejection, and the selector error text.update-candidates-useremits nothing,downgrade-candidatesemits the id with both versions; with catalog 0.44.0 the reverse. Mutation check: inverting the compare fails 8 cases.marketplace removeclaims come from the CLI bundle (2.1.263; same strings in 2.1.260 and 2.1.261), theplugin-marketplacesandplugins-referencepages fetched 2026-09-07, and--helpoutput. No mutatingclaude plugincommand was run.shellcheck -x,shfmt -d, markdownlint-cli2 (0 issues),check-purged-em-dashes.sh --check,check-changelog-parity.sh --check --check-bump origin/main,check-changed-skills.sh origin/main(plugins: PASS), evals schema validation (check-jsonschema) andcheck-evals-quality.sh: all pass.affected-tests.sh --runselects ~155 suites via the version bump;fleet-state.test.shpasses inside it, and the failures seen locally are Windows symlink/fixture-git environment failures in unrelated plugins.Related
current-projectis unchanged (it names a set);installed-userstays in the script but is no longer part of the sync algorithm; the compare reads three numeric components only, stated as a ceiling in the script comment.🤖 Generated with Claude Code
https://claude.ai/code/session_01QKEaVqVaeGnNeFq14sc6pW