SIGN IN SIGN UP

fix(superpowers): 修 #555 merge 后 codex review 的 3 条 P2 (#556)

* fix(superpowers): address post-merge codex review on #555

- desktop_clear: uninstall the managed plugin before the no-snapshot early
  return — the reconcile endpoint can install it before any apply creates a
  snapshot, so a no-snapshot clear must still remove it
- delete_provider: reconcile after rewriting activeProvider, so deleting the
  active Antigravity provider uninstalls the managed plugin instead of leaving
  it until the next apply self-heals
- superpowers-version-check.yml: make the upstream fetch/parse non-fatal
  (warn-only) so a transient raw.githubusercontent error doesn't fail the job

Refs MOC-277

* fix(superpowers): address codex review on #556 (revert delete reconcile, restructure clear)

- revert the delete_provider reconcile: it reconciled from unapplied registry
  state and could uninstall the plugin while live ~/.codex was still pointed at
  Antigravity. The pre-existing "lingers until next apply" is consistent with the
  unapplied live state and self-heals on the next apply / exit restore.
- desktop_clear: the no-snapshot branch now surfaces an uninstall failure (it is
  the only cleanup there); snapshot-backed clears uninstall AFTER a successful
  restore (not before), so a failed restore never leaves the plugin removed while
  the live Codex config is still Transfer-applied Antigravity.

Refs MOC-277

* fix(superpowers): don't swallow plugin-detection errors in no-snapshot clear

The no-snapshot clear branch gated on is_managed_installed(), which goes through
list_installed().ok()? and reads config.toml — a malformed/unreadable config.toml
turned detection into a false "not installed" and skipped cleanup while the cache
plugin remained. Add managed_cache_present() (direct cache-dir check, no config.toml,
errors propagated) and surface detection failures as 500 instead of no-oping.

Refs MOC-277

* fix(superpowers): use try_exists() in managed_cache_present (propagate stat errors)

Path::exists() returns false on stat errors (e.g. permission denied), swallowing
failures and contradicting the function's no-swallow contract; try_exists()
propagates non-NotFound stat errors so the no-snapshot clear surfaces them.

Refs MOC-277

* fix(superpowers): address codex review #6/#7 (live-state guard + home override)

- desktop_clear no-snapshot branch: guard the superpowers removal — if live
  ~/.codex still points at the local proxy (Transfer-applied Antigravity but the
  snapshot was lost) the config cannot be cleanly restored, so skip removal and
  surface, instead of leaving Antigravity without the constraint plugin
- codex_plugins::resolve_home now delegates to the workspace resolver
  (CODEX_APP_TRANSFER_HOME -> HOME -> USERPROFILE), matching CodexPaths, so plugin
  install/uninstall/cache ops honor the test/isolation home override instead of
  touching the real ~/.codex/plugins

Refs MOC-277

* fix(superpowers): address codex review #8/#9/#10 (config home + authoritative residual guard)

- codex_plugins read_doc/write_doc now derive config.toml from codex_home()
  (override-honoring), not mcp_servers::config_path() — so install/uninstall no
  longer split state (cache under CODEX_APP_TRANSFER_HOME, [plugins.*] in real config)
- desktop_clear no-snapshot live-state guard now uses scan_residual_pollution
  (authoritative high-precision Transfer signatures: known proxy ports / app_home
  catalog / backend-api relay) instead of a bare localhost openai_base_url heuristic.
  This no longer false-positives a user's local provider (Ollama localhost:11434),
  and propagates scan read errors instead of swallowing them to "not applied".

Refs MOC-277

* fix(superpowers): live-config-only Transfer check in no-snapshot clear

The guard used scan_residual_pollution(), which also scans active/recovery
snapshot files; a corrupt recovery snapshot could error the whole scan and block
the clear even when the live config is clean. Read only the live config and run
detect_signatures_in_text() on it (same high-precision signatures), propagating a
live-config read error and treating absence as not-applied.

Refs MOC-277
X
Xinlong Wu committed
b5e2d7d3042ead9272e2aa85c1b3483940857893
Parent: 31e6e5d
Committed by GitHub <noreply@github.com> on 6/28/2026, 10:00:35 AM