Skip to content

Manifest capability omission silently breaks whole-extension activation (CI green, package ships broken) #103

Closed

Description

@unbraind

Summary

When an extension's manifest.json capabilities array omits a capability that the extension code actually uses (e.g. the code calls api.registerPreflight(...) but "preflight" is not declared), the SDK gates the register* call and the entire extension silently fails to activate — none of its commands, importers, hooks, etc. work. Crucially, npm test/CI stay green and npm publish succeeds, so a completely non-functional package can ship undetected.

Real-world impact

pm-github@2026.6.2 shipped with a manifest missing "preflight" while index.ts calls registerPreflight. Result: the published package failed activation entirely (extension_activate_failed) — import/export/sync/all commands were dead — yet CI was green and the version published normally. The failure is only visible via pm extension --doctor --detail deep.

Repro

  1. An extension whose activate() calls e.g. api.registerPreflight(...) (or registerSearchProvider, registerItemFields, …).
  2. Omit the corresponding token from manifest.json capabilities.
  3. pm install <ext> → install/build/test all succeed.
  4. Run any of the extension's commands → "Unknown command" / silent no-op. pm extension --doctor --detail deep shows activation_status_totals: failed:1.

Suggested fixes (any of)

  • Load-time error: when a register* call is gated out by a missing capability, surface a clear error/warning naming the offending call and the capability to add — instead of silently dropping activation.
  • release:check/pack-time lint: cross-check register* calls against declared capabilities and fail the build on mismatch. This would have caught the regression before publish.
  • At minimum, make the doctor failure non-silent on a normal command invocation.

Found while functionally testing the pm extension ecosystem against pm-cli 2026.5.31.

Activity

  1. unbraind commented on Jul 11, 2026

    @unbraind
    OwnerAuthor

    pm tracker item:

    • pm-e9ut — SDK extension hook context and manifest capability guardrails
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions