Repository navigation
Description
Problem
Today an administrator must first create an extension profile bound to repositories and agents, then add MCP servers and skills inside it. Profiles can overlap, the same server may be configured (with its secret) in several profiles, and it is unclear which profile a run will use.
Target model
- Library: one instance-wide list of items. An item is an MCP server (
httpsorcatalog, same fields as today) or a skill bundle reference. Server names are unique across the library. - Each item has:
enabled: deactivates the item without removing it. A disabled item keeps its whole configuration, its limits and its stored secret, applies to no run, and can be re-enabled at any time. Disabling is never refused, including when an automation adds the item explicitly (the automation then runs without it and the item is reported as skipped).repositories: optional list ofowner/repo; empty means every repositoryagents: optional list of agent aliases; empty means every agent (shown as an advanced option in the UI)autoApply: boolean, defaulttruefor new items. When false the item is used only where it is added explicitly (an automation's additional extensions).
- No profiles. The profile entity is removed. An automation definition instead carries
extensions: { servers: string[], skills: string[] }: library server names and skill bundle ids added to that automation on top of whatever applies automatically. - The library has one revision stream (every save or secret replacement creates a new library revision with timestamp and administrator actor, as profile revisions do today). Secrets are bound to the library, so a server's credential is stored once.
This issue delivers the data model, store, REST API, the automation field and the migration. It does not yet auto-apply to issue tasks and pull request follow-ups (next issue) and does not rework the settings screen (third issue), but the existing screens must keep working or be adapted minimally so nothing is broken in between.
Requirements
- Shared contract (
packages/shared/src/extensionProfiles.ts): schemas and types for library items and the library revision, and a pure functionresolveExtensionSet(library, { repository, agentAlias, runtime, additional?: { servers, skills } }). It returns the servers and skill bundles that apply, in a deterministic order (by name):- items with
autoApply: truethat are enabled and whoserepositoriesandagentslimits match, plus - items named in
additionalthat are enabled and whose limits match (these ignoreautoApply).
Anadditionalentry that names a missing, disabled or non-matching item is reported in askippedlist with a reason and is not an error. Library limits: up to 32 servers and 32 skill bundles. The per-run limits stay 8 servers and 8 bundles: when a resolved set exceeds them, explicitly added items take priority, then auto-applied items by name, and the items left out are returned so callers can report them.
- items with
- Store (
packages/core/src/extensions/extensionProfileStore.ts): read/save the library with optimistic concurrency on its revision; per-item secret replacement; a single-item enable/disable operation that changes onlyenabled(new library revision, secret untouched). Removing or renaming a library item that an automation adds explicitly is refused with a message naming the automations. Keepauthorize(durable administrator withinstance.manage_settings) for every management call. - Automations: add the
extensionsfield to the automation definition contract (packages/shared/src/automationDefinitions.ts), store, REST, MCP automation tools and CLI where the definition is read or written; replace theextensionProfileselection. Saving an automation validates that every named item exists; setting or changing the field requires the same administrator permission that selecting a profile requires today. - Launch:
executeWithExtensions(packages/core/src/extensions/extensionLaunch.ts) resolves throughresolveExtensionSetagainst the current library revision at launch. In this issue only automation runs use it (auto-applied items plus the automation's additional items); issue tasks follow in the next issue. All existing launch checks stay: capability policy, endpoint policy, catalog digest check, write servers only with the run's write authorization (automation action phases keep their explicit phase policy), grant creation and revocation, skill digest verification and staging, and fencing between launch preparation and container start. The authority for a launch is the library revision (saved only by an administrator); no selecting administrator is required at launch, and the revision's audit actor is recorded as provenance. - REST API under
/api/instance/extensions/v1: read library + skill bundles + operator catalog in one call; save library; enable/disable one item; existing skill import, validate and tool discovery routes keep working. Remove the profile routes once nothing calls them. Updatepackages/api/openapischemas and regenerate the spec and client types. - Migration of existing data (application-level, idempotent, run at startup, safe to re-run):
- Every server and skill of every existing profile becomes a library item. Its
repositoriesandagentscome from the profile's scopes.autoApplyis false for all migrated items so the upgrade changes no run's behaviour. - Identical servers appearing in several profiles (same kind, url or catalog id, tools, capability) merge into one item whose limits are the union; if any source profile had an empty scope the merged limit is empty. Different servers that share a name get a deterministic suffix and the rename is logged.
- Each automation that selected a profile gets
extensionslisting that profile's (possibly renamed) items, so it launches with the same servers and skills as before. - Queued New Task submissions that still carry a profile selection keep working for their initial task: keep a small legacy mapping from old profile id to the migrated item names for this purpose.
- Encrypted Bearer tokens are re-bound to the library. If a secret cannot be decrypted (wrong key root), the item is migrated with the secret marked not configured and a warning is logged; migration never aborts startup.
- Old tables stay readable until the migration reports success; do not drop data in this issue.
- Every server and skill of every existing profile becomes a library item. Its
- Native database export / restore rules stay equivalent: the public library is exported, encrypted credentials are erased, run grants removed.
Out of scope
Auto-apply for issue tasks and PR follow-ups, labels, New Task changes, the settings screen rework, OAuth sign-in.
Acceptance criteria
- Unit tests for
resolveExtensionSet: no limits; repository limit; agent limit; disabled item;autoApplyfalse excluded unless added explicitly; explicit item that is missing, disabled or out of limits lands inskipped; over-limit truncation with explicit items kept first; deterministic order. - Store tests: revision conflict; secret stored once and write-only; disabling and re-enabling an item keeps its configuration and secret and is allowed while an automation adds it; removing an item an automation adds is refused; non-administrator and stale-session denial still hold.
- Automation tests: definition round-trips
extensionsthrough REST, MCP and CLI; a run launches with auto-applied plus additional items; an automation whose added item is disabled launches without it and reports it skipped; an automation with neither launches without extensions. - Migration tests: two profiles sharing an identical server merge; name collision renamed; scopes become item limits; all migrated items have
autoApplyfalse; an automation bound to an old profile launches with the same servers and skills; a queued submission with a profile selection still launches; undecryptable secret handled; re-running the migration changes nothing. - Existing extension tests (gateway, endpoint policy, staging, launch fencing) pass, adapted only where the selection shape changed.
- OpenAPI spec and generated client types are regenerated; OpenAPI coverage and conformance, MCP docs and observable-surface tests pass.
docs/docs/features/agent-extensions.mdand the automations docs describe the library, item limits,enabled,autoApply, additional extensions on automations, and the migration. No profile wording remains.
Implementation
- Shared: new schemas/types and
resolveExtensionSetinpackages/shared/src/extensionProfiles.ts(split into a second file if it grows); keepEXTENSION_LIMITSfor per-run limits and add library limits. Automation contract inpackages/shared/src/automationDefinitions.ts. - DB: new knex migration adding library tables (
extension_library_revisionsholding the item list JSON and encrypted secrets, bound toextension_instance_identity), the automationextensionscolumn, and the legacy profile mapping. Followpackages/core/src/db/migrations/20261013210000_extension_profiles.jsfor conventions. - Core store: rework
ExtensionProfileStoreinto a library store with read/save, single-item enable/disable, secret custody re-bound to instance + library revision, and a launch assertion that resolves through the library without an actor. - Automations:
packages/core/src/services/agents/agentDefinitionStore.ts,agentRunTrigger.ts,packages/api/routes/automationDefinitionRoutes.ts,src/jobs/agentRuns/agentTaskOptions.ts,src/jobs/processAgentRunJob.ts,src/jobs/processAgentActionJob.ts, MCP automation definition tools and CLI. - Data migration module run at API/worker startup behind an idempotency marker; reuse
privateSecrets.tsfor decrypt/re-encrypt. - API:
packages/api/routes/extensionProfileRoutes.tsand route registration inpackages/api/server.ts; OpenAPI schemas;npm run gen:openapi. - Minimal UI adaptation in
propr-ui/src/api/extensionProfilesApi.ts,AgentExtensionsSection.tsx,ExtensionProfileSelector.tsxand the automation editor so current screens still load and save (full redesign is a later issue). - Tests in
packages/core/test,packages/shared/test,packages/api/test, following the existing extension tests.
Notes
Security invariants that must not weaken: secrets never leave Core in readable form; write-capability servers need the run's explicit write authorization; catalog digest mismatch fails closed; launch fencing against disable, deletion and secret rotation. ProPR runs on SQLite only: do not add code or tests for other databases. Read docs/docs/features/agent-extensions.md first.
Activity
propr-dev commentedon Nov 12, 2026
🤖 AI processing has started for this issue using claude agent with claude-opus-5-5 model.
I'll analyze the problem and work on a solution. This may take a few minutes.
Processing Details:
claudeclaude-opus-5-53509/claude-opus-5-5-extension-library-one-ins-20261112-2236-jn43509-epic-extensions-library-14jissue-3509-20261112-2236-claude-opus-5-5-jn4🔍 Track Task Execution
Issue #3509 is implemented: extension profiles are replaced by one in…