Skip to content

fix(plugin): refresh stale OMP catalog and report blocked OMP updates - #853

Merged
runkids merged 7 commits into
runkids:mainfrom
salmonumbrella:fix/omp-stale-catalog-851
Nov 12, 2026
Merged

runkids merged 7 commits into
runkids:mainfrom
salmonumbrella:fix/omp-stale-catalog-851

Conversation

@salmonumbrella

@salmonumbrella salmonumbrella commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)
  • Approved feature or large change (the linked issue has the approved label)

Summary

An OMP install into a marketplace that was already registered used OMP's cached catalog, so OMP recorded an older version than the binding. The next update then could not find the cache to remove, and update --all skipped it with exit 0.

  • Catalog refresh on install: when the marketplace is already registered, an OMP install now runs omp plugin marketplace update <market> first, as update already did.
  • Removal follows OMP's registry: if OMP's installed_plugins.json has an entry for the binding, removal uses that entry's version and cache path, but only after checking scope, version, and that installPath is the expected safe cache path. Shared caches are kept as before.
  • Interrupted cleanup: the pending receipt stores the OMP version being removed (ompRemovalVersion, optional field). A retry removes that version and keeps the reviewed binding version. An update that would install a sourced OMP binding with a pending removal for the same binding and store goes through the refresh path again.
  • Failures are visible under --all: a blocked OMP refresh is no longer turned into a silent skipped. Failed changes carry failed: true in the plan JSON, show as failed in the CLI preview and Web UI, and make --dry-run exit nonzero. Healthy changes in the same batch still apply.
  • Docs for skillshare plugin (English and translations) and the OMP notes are updated to match.

Linked Issue

Issue #851 (closing line below).

Testing

Coverage includes TestOMPStaleCatalogRecovery, TestOMPMismatchedNativeVersionRemoval, TestOMPRemovalRejectsUnverifiedNativeIdentity, TestPluginUpdateAllDryRunReportsFailures (text and JSON), the imported OMP update --all preview/apply assertions in TestOMPImportOfAPackagePluginIsRefusedWithItsReason, and TestPluginUpdateAllDryRunReportsOMPFailure.

The complete PR diff and feedback delta were read; two independent blind source reviews found no confirmed issue in 73bcbc6b35d8369745df34ef134206ce229ffd1a. Upstream CI on that head: Test run 43154959356 passed its unit job (including context, Herdr, formatting and vet), Ubuntu integration, Windows and redteam; Nix run 43154959476 passed. macOS integration and Docker-offline also passed; Docker-online and redteam-signal were skipped by the workflow. This covers the make check steps through the workflow's context check, formatting, vet, Herdr tests, Go unit tests and integration tests. No local suite was run. Real-OMP execution and the website build remain unrun; runbook steps 4 and 5 now give explicit procedures and expected output for differing-version removal and an unverifiable batch target.

The requested new Codex review was refused because the GitHub reviewer account reached its usage limit. No roborev-ci workflow or check is exposed for this PR; no local replacement was run.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — equivalent CI steps passed on this head; see Testing
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

Closes #851

Refresh owned marketplace catalogs before reuse and validate the native cache identity when removing an installation. Preserve that identity through interrupted cleanup and report blocked batch updates as failures so retries remain safe and visible.
Keep native removal identity separate from reviewed receipts so interrupted cleanup can retry safely. Expose isolated failures in previews and dry-run exit status while allowing healthy targets to proceed.
Retry matching pending removals before reinstalling after registry-first interruption, and clarify isolated failure reporting. Strengthen recovery fixtures and restore accurate installation guidance.
Use the cached marketplace entry for native install version and source so the stale catalog regression exercises the real version-to-cache relationship.
Require catalog refresh before reinstalling from an owned marketplace and assert isolated failures when native OMP ownership cannot be verified, while healthy targets update.
@salmonumbrella
salmonumbrella marked this pull request as ready for review November 11, 2026 10:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-12T04:28:31.933064Z
We couldn’t complete this review. Comment @codex review to try again.
73bcbc6 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@runkids runkids left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the thorough fix. All three asks from #851 are covered: install refreshes an already-registered catalog, removal follows the verified registry entry, and a blocked refresh under update --all --json now fails with a non-zero exit. CI is green. A few things to address before merge (details inline where they anchor to the diff):

1. Imported OMP plugins now fail every update --all (correctness) — see inline on service.go.

2. Translations out of sync (website/i18n/{ja,ko,zh-Hans,zh-Hant}/.../reference/commands/plugin.md)

  • The bullet matching English plugin.md ~L502-504 still says an update skips an unreachable target: ja:300, ko:226, zh-Hans:328-329, zh-Hant:323. The English now says it reports a failed target, continues healthy ones, and that a dry run exits non-zero with failed: true in JSON.
  • Instead, each locale gained a new dry-run paragraph near L52-57 that English does not have at that position, so the structure no longer mirrors the English page. Please move it into that bullet.
  • All four also miss the clause "even if the binding version differs" in the OMP removal requirements.

3. Test gaps

  • No test covers update --all with an imported (source-less) OMP binding — the case in (1).
  • The dry-run failure test uses a Claude binding; no dry-run case exercises an OMP failure.

4. E2E runbook — ai_docs/tests/omp_plugins_removal_runbook.md only gained a sentence in the intro. Since this hasn't been run against a real omp, please add steps and expected output for (a) removal when the native registry version differs from the binding, and (b) update --all reporting the unverifiable OMP target as failed while other targets update.

5. PR checklist — "reviewed every line" and "make check passing" are unticked, and the body says the tests weren't verified locally. CI now passes; please tick them once you've confirmed, per CONTRIBUTING.md's AI-assisted contributions section.

Cleanup suggestions are inline and optional.

}
if r.isolatesTargets() && c.Action == "blocked" {
c.Action, c.batchError = "skip", true
c.Action, c.Failed = "skip", true

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regression: imported OMP plugins now make every update --all fail.

The removed special case also covered plugins.error.ompNativeDestructive, which is not a blocked refresh but a by-design "never upgrade without a reviewed source" outcome.

Scenario: skillshare plugin import --from omp demo@team (binding has Source == ""), then skillshare plugin update --all -g:

  • checkOrUpdate returns the change unchanged as update for a source-less binding (L842-852).
  • ompGuard blocks it with ompNativeDestructive (omp.go:164-166).
  • Here it becomes skip + Failed, and lifecycle.go:152 records a failure → exit 1 on every run.

For the hourly update --all job from #851 that is a permanent false failure, and the docs say imported code is simply never upgraded. Suggest keeping the skip for the source-less ompNativeDestructive case and only surfacing ompRefresh blocks as failures, plus a test for an imported OMP binding under update --all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 73bcbc6b35d8369745df34ef134206ce229ffd1a. Source-less OMP updates already have an intentional skip, but native upgrade capability was checked before reaching it. The fix avoids that probe for imported OMP updates while preserving host errors and sourced-refresh failures.

TestOMPImportOfAPackagePluginIsRefusedWithItsReason now previews and applies update --all with an imported binding and unavailable native upgrade support, asserting a non-failing skip and no native mutation. TestPluginUpdateAllDryRunReportsOMPFailure separately checks that an OMP failure remains visible in JSON and returns an error. Current-head upstream CI is the runtime gate; no local suite was run.

if c.Action == "remove" || c.Action == "uninstall" || c.Action == "forget" {
local := d.state.Bindings[c.Name][c.Target]
reviewedVersion := c.Binding.Version
if local.Pending != nil && (local.Pending.Action == "remove" || local.Pending.Action == "forget" || local.Pending.Action == "uninstall") && local.Pending.Store == s.storeIdentity(c.Target) && local.Pending.Binding.ID == c.Binding.ID && local.Pending.OMPRemovalVersion != "" {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (optional): this pending-removal predicate duplicates L564, and the two copies already differ (this one adds OMPRemovalVersion != ""). A small helper, e.g. pendingRemoval(local, target, id) *receipt, would keep preview and prepare in step.

Also, mutating c.Binding.Version and restoring it after prepareOMPRemoval works today, but an early return added in between would leak the native version into the reviewed binding/receipt. Passing the removal version to prepareOMPRemoval explicitly would avoid that.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. I left this optional extraction unchanged in the focused feedback commit 73bcbc6b35d8369745df34ef134206ce229ffd1a; the pending-removal and version-restoration paths retain their existing regression coverage. The correctness fix is limited to the imported-update capability probe, with the requested tests, translations and runbook steps alongside it.

}
e := entries[0]
v := e.Version
if e.Scope != scope || v == "" || filepath.Base(v) != v || strings.ContainsAny(v, "\\/\r\n\x00") || !filepath.IsAbs(e.InstallPath) || filepath.Clean(e.InstallPath) != ompCachePath(cacheRoot, b.ID, v) || ompSafePath(e.InstallPath) != nil {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit (optional): the version-safety check (v != "" && filepath.Base(v) == v && !strings.ContainsAny(v, ...)) now appears three times (L104, here, and omp_cache.go:86). A validOMPVersion helper would keep them from drifting, and splitting this long condition would make each rejection reason distinguishable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I deferred the optional version-helper extraction in 73bcbc6b35d8369745df34ef134206ce229ffd1a to keep the feedback fix small. The existing version/path rejection checks remain intact; TestOMPRemovalRejectsUnverifiedNativeIdentity covers unsafe versions, scope/path mismatches and duplicate entries.

Use native OMP 18.6.1 or later and an inert plugin to verify scoped removal, retained
shared cache used by an invisible project, and reinstall into a new cache
identity. No Agent session, extension code or real user configuration is used.
identity. A scope-matching native registry version may differ from the recorded binding when its cache path is verified. An unverifiable batch update reports failure while continuing other targets. No Agent session, extension code or real user configuration is used.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This states the new behaviours but adds no steps or expected output for them. See point 4 in the review summary.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added concrete scenarios in 73bcbc6b35d8369745df34ef134206ce229ffd1a: step 4 constructs a native registry/cache version different from the recorded binding, previews and removes it, and checks that both caches remain. Step 5 makes an OMP runtime destination unverifiable, then checks that dry-run and apply exit nonzero, JSON reports the failed OMP target, a healthy Cursor target updates, and the OMP registry stays unchanged. Both scenarios include expected output and assertions. The real-OMP runbook has not been executed.

Imported plugins have no reviewed source to upgrade, so requiring native upgrade capability makes a safe batch skip fail unnecessarily. Cover that case and OMP dry-run failures, and align translations and native verification runbook with the failure and removal behavior.
@salmonumbrella

Copy link
Copy Markdown
Contributor Author

@codex review

The maintainer feedback fix is pushed as 73bcbc6b35d8369745df34ef134206ce229ffd1a. Imported OMP updates skip the native upgrade capability probe; the imported-batch and OMP dry-run regressions are included. All four plugin reference translations now match the English failure bullet and binding-version clause, and the native runbook has explicit mismatch-removal and failed-batch scenarios with expected output. Two independent blind source reviews found no confirmed issues in this delta. Upstream CI for this head is pending; the checklist will be updated after verifying it. The real-OMP runbook remains unexecuted.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@runkids runkids left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed 73bcbc6: all five points from the previous review are addressed. Merging; two small doc follow-ups (runbook Pass Criteria for steps 4-5, and the "present registry entry" nuance in the four plugin.md translations) will be handled separately.

@runkids
runkids merged commit caa107b into runkids:main Nov 12, 2026
9 checks passed
runkids added a commit that referenced this pull request Nov 12, 2026
#873)

* fix(plugin): verify native support only for changes that run a command

prepareChange probed native command support before applying the
intentional skip rules. When the probe failed under update --all, the
change was marked as a failed target, so the later skip never applied.
An imported Grok plugin always hit this: Grok updates require native
trust, so every update --all exited nonzero even though Grok plugins are
documented as updated natively. #853 patched the same ordering for
imported OMP plugins only.

Run the probe after the skip rules instead, so a skipped change is never
verified, and drop the OMP-specific exemption it made redundant. Host
errors and changes that do run a native command still fail as before.

* docs(plugin): align OMP removal wording and runbook pass criteria

The translated plugin references said OMP removal requires a
scope-matching native registration. English, and the code, only require
that a registration match when one is present; a retry after native
uninstall proceeds from the retained cache. The runbook's Pass Criteria
also did not cover the two scenarios #853 added as steps 4 and 5.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OMP install into an already-registered marketplace records a stale catalog version, then every update is blocked (and skipped silently under --all)

2 participants