Repository navigation
[3543 by Claude Opus 5.5] Plugins: installation state, settings, token connections, permissions and REST API - #3564
Conversation
… 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.
|
/ultrafix goal=8 max=10 |
|
🔄 Ultrafix loop started (goal: 8/10, max cycles: 10) First action:
|
|
✅ AI Code Review Complete requested by @propr-ultrafix Posted 1 review: |
🔍 AI Code Review — codex:gpt-6-astraOverall EvaluationThe 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 blockersNo merge blockers. SuggestionsThese are optional follow-ups and are not sent to S1: 🟢 Package the registry for deployment
S2: 🟢 Define settings upgrade handling
S3: 🟢 Distinguish unexpected server failures
ScoreThe 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
Copy and edit to choose records from this review: 🤖 Review by ProPR |
|
ℹ️ 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. |
AI Implementation Summary
Closes #3543
Branch:
3543/claude-opus-5-5-plugins-installation-stat-20261114-0440-cg9Commits: ✅ 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-onlylist_pluginsandget_plugintools. 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
plugin_installations,plugin_secretsand an append-onlyplugin_audit. The store ispackages/core/src/plugins/pluginStore.ts.tokenandsigning_secretvalues 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.oauthconnections reportnot_connected.enableBlockers) while a required setting, a required token connection or a package-server secret acknowledgement is missing.instance.manage_settingsand 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.packages/api/pluginRouteRegistry.ts, sorouteRegistry.tsdoesn't grow. OpenAPI schemas and route docs are added, and the spec and client types are regenerated.list_pluginsreturns compact rows andget_pluginthe full read. Both are documented indocs/mcp.mdanddocs/mcp-coverage.md.docs/docs/features/plugins.mdhas a new "Installing a plugin" section covering the install flow, connections, permissions and upgrades.Choices the issue left open
tokenconnection 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.X-ProPR-Plugins: 1header, like the extension library. Clearing a connection is aPUTwith{ "value": null }. Uninstalling is aPOSTthat must repeat the plugin id as confirmation.{ error }like the extension routes, not the newer error envelope. The shared permission guard already answers in that shape.Decision for you: the production Docker images don't include the
packages/pluginsfolder, and I didn't add@propr/pluginsas 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, addpackages/pluginsto 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:
d3bc3870-c662-42bf-be52-26f988641843Log files stored at:
/usr/src/app/logs/executions/issue-3543-2026-11-14T05-03-21-001Z-conversation.json/usr/src/app/logs/executions/issue-3543-2026-11-14T05-03-21-001Z-output.txtLatest Conversation Messages
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!