Skip to content

[3543 by Claude Opus 5.5] Plugins: installation state, settings, token connections, permissions and REST API - #3564

Merged
propr-dev[bot] merged 1 commit into
3542-epic-plugin-system-xu8from
3543/claude-opus-5-5-plugins-installation-stat-20261114-0440-cg9
Nov 14, 2026
Merged

propr-dev[bot] merged 1 commit into
3542-epic-plugin-system-xu8from
3543/claude-opus-5-5-plugins-installation-stat-20261114-0440-cg9

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3543

Branch: 3543/claude-opus-5-5-plugins-installation-stat-20261114-0440-cg9
Commits: ✅ Changes committed (9fd5160)


AI Processing Completed

Execution Details:

Summary:
I've implemented #3543. An administrator can now install a plugin and manage its state through /api/instance/plugins/v1, and MCP has read-only list_plugins and get_plugin tools. As the issue asked, nothing is applied to runs yet.

Tests: the new Core test (10 cases) and the API route test pass, run directly and through the suite runner. So do the affected existing suites: OpenAPI coverage and conformance, MCP observable surface, docs, input budget, operator surface and integration, route authorization, database export, extension OAuth routes and the plugin manifest tests. gen:openapi:check, the typechecks for shared, core, api, client and plugins, and zero-warning lint on core and api also pass. I didn't run the full repository suite.

What it does

  • State: a new migration adds plugin_installations, plugin_secrets and an append-only plugin_audit. The store is packages/core/src/plugins/pluginStore.ts.
    • A plugin installs disabled, with its default settings and the manifest's permissions granted.
    • Disabling keeps settings and connections. Uninstalling deletes them, but the audit trail stays.
  • Settings: checked against the manifest schema on save (unknown keys, types, limits, repository maps). Required settings can't be removed while the plugin is enabled.
  • Connections: token and signing_secret values are sealed with the existing private-secret mechanism, tied to this instance, plugin and connection. Reads only say connected or not connected, who set it and when. Native exports erase them. oauth connections report not_connected.
  • Enable refused: with a 409 and the reasons (also returned as enableBlockers) while a required setting, a required token connection or a package-server secret acknowledgement is missing.
  • Upgrades: a newer manifest that adds a permission flags the plugin Needs approval, and it keeps its old grant until approved. Changing a package server's package, version or secret variable names also asks for the acknowledgement again. Install requires that acknowledgement up front.
  • Access and audit: every route, reads included, needs instance.manage_settings and a current durable administrator. That is checked before the request body is read, and again inside each write. Every change is recorded in the audit trail.
  • API wiring: routes are registered from a new packages/api/pluginRouteRegistry.ts, so routeRegistry.ts doesn't grow. OpenAPI schemas and route docs are added, and the spec and client types are regenerated.
  • MCP: list_plugins returns compact rows and get_plugin the full read. Both are documented in docs/mcp.md and docs/mcp-coverage.md.
  • Docs: docs/docs/features/plugins.md has a new "Installing a plugin" section covering the install flow, connections, permissions and upgrades.

Choices the issue left open

  • Required token connection: a token connection counts as required when a contributed MCP server uses it (a bearer server's connection or a package server's secret variable). The manifest has no "required" flag for connections, so I needed a rule.
  • Mutations: they need JSON plus an X-ProPR-Plugins: 1 header, like the extension library. Clearing a connection is a PUT with { "value": null }. Uninstalling is a POST that must repeat the plugin id as confirmation.
  • Errors: routes return { error } like the extension routes, not the newer error envelope. The shared permission guard already answers in that shape.
  • Installed version: after an upgrade that needs no approval, the installed version moves to the new manifest on the next change.

Decision for you: the production Docker images don't include the packages/plugins folder, and I didn't add @propr/plugins as a declared dependency, to avoid lockfile churn. Core loads the registry at runtime instead, and where it's missing the list is empty with one warning. To ship real plugins, add packages/plugins to the images and declare the dependency; that can be this PR or the next issue.

No previews, since nothing here shows in the UI.

Detailed Logs:

  • Conversation: 233 messages
  • Session: d3bc3870-c662-42bf-be52-26f988641843

Log files stored at:

  • conversation: /usr/src/app/logs/executions/issue-3543-2026-11-14T05-03-21-001Z-conversation.json
  • output: /usr/src/app/logs/executions/issue-3543-2026-11-14T05-03-21-001Z-output.txt
Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: I've implemented #3543. An administrator can now install a plugin and manage its state through `/api/instance/plugins/v1`, and MCP has read-only `list_plugins` and `get_plugin` tools. As the issue ask...


This PR was created automatically by ProPR after processing issue #3543.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!

… manage its state through `/api/instance/plugins/v1`, and MCP has read-only `list_plugins` and `get_plugin` tools. As the issue asked, nothing is applied to runs yet.

Tests: the new Core test (10 cases) and the API route test pass, run directly and through the suite runner. So do the affected existing suites: OpenAPI coverage and conformance, MCP observable surface, docs, input budget, operator surface and integration, route authorization, database export, extension OAuth routes and the plugin manifest tests. `gen:openapi:check`, the typechecks for shared, core, api, client and plugins, and zero-warning lint on core and api also pass. I didn't run the full repository suite.

What it does
- State: a new migration adds `plugin_installations`, `plugin_secrets` and an append-only `plugin_audit`. The store is `packages/core/src/plugins/pluginStore.ts`.
  - A plugin installs disabled, with its default settings and the manifest's permissions granted.
  - Disabling keeps settings and connections. Uninstalling deletes them, but the audit trail stays.
- Settings: checked against the manifest schema on save (unknown keys, types, limits, repository maps). Required settings can't be removed while the plugin is enabled.
- Connections: `token` and `signing_secret` values are sealed with the existing private-secret mechanism, tied to this instance, plugin and connection. Reads only say connected or not connected, who set it and when. Native exports erase them. `oauth` connections report `not_connected`.
- Enable refused: with a 409 and the reasons (also returned as `enableBlockers`) while a required setting, a required token connection or a package-server secret acknowledgement is missing.
- Upgrades: a newer manifest that adds a permission flags the plugin Needs approval, and it keeps its old grant until approved. Changing a package server's package, version or secret variable names also asks for the acknowledgement again. Install requires that acknowledgement up front.
- Access and audit: every route, reads included, needs `instance.manage_settings` and a current durable administrator. That is checked before the request body is read, and again inside each write. Every change is recorded in the audit trail.
- API wiring: routes are registered from a new `packages/api/pluginRouteRegistry.ts`, so `routeRegistry.ts` doesn't grow. OpenAPI schemas and route docs are added, and the spec and client types are regenerated.
- MCP: `list_plugins` returns compact rows and `get_plugin` the full read. Both are documented in `docs/mcp.md` and `docs/mcp-coverage.md`.
- Docs: `docs/docs/features/plugins.md` has a new "Installing a plugin" section covering the install flow, connections, permissions and upgrades.

Choices the issue left open
- Required token connection: a `token` connection counts as required when a contributed MCP server uses it (a bearer server's connection or a package server's secret variable). The manifest has no "required" flag for connections, so I needed a rule.
- Mutations: they need JSON plus an `X-ProPR-Plugins: 1` header, like the extension library. Clearing a connection is a `PUT` with `{ "value": null }`. Uninstalling is a `POST` that must repeat the plugin id as confirmation.
- Errors: routes return `{ error }` like the extension routes, not the newer error envelope. The shared permission guard already answers in that shape.
- Installed version: after an upgrade that needs no approval, the installed version moves to the new manifest on the next change.

Decision for you: the production Docker images don't include the `packages/plugins` folder, and I didn't add `@propr/plugins` as a declared dependency, to avoid lockfile churn. Core loads the registry at runtime instead, and where it's missing the list is empty with one warning. To ship real plugins, add `packages/plugins` to the images and declare the dependency; that can be this PR or the next issue.

No previews, since nothing here shows in the UI.
@propr-dev

propr-dev Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix goal=8 max=10
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Nov 14, 2026
@propr-dev

propr-dev Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 10)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-ultrafix

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR implements plugin installation state, administrative REST operations, and read-only MCP tools without applying contributions to runs. It is merge-ready within that scope, conditional on the remaining checks passing.

✅ Credential custody — Connection secrets are sealed with instance/plugin/connection binding, excluded from responses and audit details, and erased from native exports.

✅ Transactional management — Writes recheck durable administrator authority inside the transaction and persist the configuration change together with its audit event.

✅ Focused coverage — Added tests cover lifecycle transitions, permission upgrades, acknowledgements, authorization denial, response schemas, and secret exclusion.

This review used static tracing of the supplied diff and context; no commands were run. Current checks report 31 passed, none failed, and three pending.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Package the registry for deployment

packages/core/src/plugins/pluginCatalog.ts treats an unavailable registry as an empty catalog. Before shipping production plugins, declare the dependency and include its registry and assets in deployment artifacts, with a packaged-runtime smoke test. This is a follow-up for the current state-only implementation because the supplied registry contains only a development plugin and intentionally offers nothing by default.

S2: 🟢 Define settings upgrade handling

enableBlockers checks required settings for presence, while schema validation happens only when settings are saved. A manifest upgrade can therefore leave existing values outside a newly tightened enum or numeric limit without reporting a blocker. Define revalidation or migration behavior before contributions consume those values. This is optional for the present scope, which explicitly performs no runtime application and promises validation on save.

S3: 🟢 Distinguish unexpected server failures

packages/api/routes/pluginRoutes.ts maps every non-PluginError exception to HTTP 400 without logging it. Database failures or missing encryption configuration consequently look like invalid client input. Returning a sanitized server error and recording safe diagnostic metadata would improve troubleshooting; it does not change the successful lifecycle or transaction protections reviewed here.

Score

The implementation is cohesive, appropriately scoped, and supported by focused tests. Static review found no merge blocker; final readiness remains conditional on the three pending checks.

Score: 8/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 40s
  • Tokens: 86,925 (86,070 in / 855 out)
  • Cost: $0.79

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S1 S2 S3

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 14, 2026
@propr-dev

propr-dev Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor Author

ℹ️ GitHub auto-merge is turned off for this repository, so ProPR merges this PR itself once it is ready (checks passed or no CI configured, and the review goal met).

To let GitHub merge it the moment required checks pass, enable Settings → General → Pull Requests → Allow auto-merge.

@propr-dev
propr-dev Bot merged commit d683491 into 3542-epic-plugin-system-xu8 Nov 14, 2026
65 checks passed
@propr-dev
propr-dev Bot deleted the 3543/claude-opus-5-5-plugins-installation-stat-20261114-0440-cg9 branch November 14, 2026 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants