Skip to content

[3509 by Claude Opus 5.5] Extension library: one instance list of MCP servers and skills with per-item limits, replacing profiles - #3513

Merged
integry merged 11 commits into
3509-epic-extensions-library-14jfrom
3509/claude-opus-5-5-extension-library-one-ins-20261112-2236-jn4
Nov 13, 2026
Merged

integry merged 11 commits into
3509-epic-extensions-library-14jfrom
3509/claude-opus-5-5-extension-library-one-ins-20261112-2236-jn4

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3509

Branch: 3509/claude-opus-5-5-extension-library-one-ins-20261112-2236-jn4
Commits: ✅ Changes committed (44777df)


AI Processing Completed

Execution Details:

Summary:
Issue #3509 is implemented: extension profiles are replaced by one instance-wide extension library of MCP servers and skill bundles, each with its own limits. All the extension, automation and submission test suites I touched pass, and server/UI typechecks and lint are clean. I did not run the full repository test suite.

Library model (packages/shared/src/extensionLibrary.ts)

  • Each item has enabled, repositories, agents and autoApply (default true for new items). The library holds up to 32 servers and 32 skill bundles; a run still carries at most 8 of each.
  • resolveExtensionSet returns, sorted by name:
    • enabled auto-applied items whose limits match.
    • items the run adds explicitly, which ignore autoApply.
  • An explicit item that can't be used is listed in skipped with a reason, never an error. Reasons: missing, disabled, out of limits, wrong runtime, needs write authorization, or credential not configured.
  • When a run has too many items, explicit ones are kept first, then auto-applied ones by name; the rest come back as omitted.

Store (extensionProfileStore.ts, class now ExtensionLibraryStore)

  • Saving needs the revision the edit is based on, so concurrent edits are refused. Every save, enable/disable and secret replacement creates a new revision.
  • Each server's credential is stored once, sealed to the library revision, and can be replaced or cleared on its own.
  • Enable/disable changes only enabled; it is never refused, even when an automation adds the item.
  • Removing or renaming an item an automation adds is refused, and the message names the automations.
  • Every management call still requires a durable administrator.

Launch

  • Automation runs resolve against the current library revision at launch. The library revision is the authority, so no administrator check happens at launch.
  • All the existing launch checks are kept, including fencing between preparation and container start.
  • The fence now refuses a pending launch only if one of its items was disabled, removed, re-limited or had its secret rotated. Edits to other items don't block it.
  • A run's gateway token now reaches only the servers resolved for that run. Before, it reached every server in the profile.
  • Each run records an extensions.resolved event on its task timeline, listing what was used, skipped and omitted.

Automations

  • The definition has a new extensions: { servers, skills } field. It round-trips through REST, the MCP read tools and propr automation show (including --json).
  • Adding items requires the preflight header, an administrator with instance.manage_settings, and that every named item exists.
  • Decision for you: I let owners remove items from an automation without that permission, because removing can't grant anything. The UI is stricter: non-admins see the items read-only. Say if you want removal to require admin on the server too.

Migration

  • A knex migration adds the library tables, the automation column and the legacy mapping. It rebuilds the run-grant table so grants of tasks already running survive the upgrade.
  • A one-time data migration runs at API and worker startup. It is idempotent and never blocks startup.
    • Identical servers merge, with their limits combined. Different servers that share a name get a -2, -3 suffix, and the rename is logged.
    • Every migrated item has autoApply: false, so no run changes behaviour after the upgrade.
    • Automations that selected a profile get its items added explicitly.
    • A secret that can't be decrypted is migrated as "not configured", with a warning.
    • The old profile tables are left untouched.

Behaviour changes to know about

  • New Task: it can no longer select extensions. The API refuses extensionProfile and the UI selector is gone, so New Task runs get no extensions until the next issue adds auto-apply for tasks. Submissions already queued before the upgrade keep their extensions for their first task, through the legacy mapping.
  • Unconfigured credentials: a Bearer server without a credential is now skipped at launch instead of failing the run. This happens after a native export/restore, or when a secret couldn't be decrypted during migration.

API, export, UI and docs

  • The REST routes now read the whole library, save it, toggle one item, replace one secret, show history and validate. The old profile routes are removed. The OpenAPI spec and client types are regenerated.
  • The native export erases the library's encrypted credentials.
  • A background agent did the UI adaptation; its UI typecheck, lint, 471 unit tests and the two Playwright specs pass. The settings screen now edits the single library. The automation editor has a new selector for the items an automation adds.
  • agent-extensions.md and the automations docs describe the library, item limits, the automation extensions field and the migration. The upgrade section mentions profiles once to explain what changed.

Tests

  • New: resolveExtensionSet unit tests, store tests (revision conflicts, secret custody, enable/disable while an automation uses the item, removal refused, denial for non-admins and stale sessions), automation launch tests, and migration tests.
  • Adapted: the existing extension suites (gateway, endpoint policy, staging, launch fencing), plus the REST, MCP, submission and export tests.

I added two preview images of the changed server and skill items in the settings screen.

Detailed Logs:

  • Conversation: 149 messages
  • Session: 50dc5623-4b62-4954-b696-a4b8ac0253b7

Log files stored at:

  • conversation: /usr/src/app/logs/executions/issue-3509-2026-11-12T23-34-50-364Z-conversation.json
  • output: /usr/src/app/logs/executions/issue-3509-2026-11-12T23-34-50-364Z-output.txt
Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: Issue #3509 is implemented: extension profiles are replaced by one instance-wide extension library of MCP servers and skill bundles, each with its own limits. All the extension, automation and submiss...


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


💡 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!


Visual preview

Library MCP server item

Library MCP server item

An MCP server in the instance extension library settings with its new per-item fields: Enabled, repository limit, Apply automatically, and the advanced agent limit. Rendered against a mocked library API at desktop width.

Connect sign-in required. Original retained until 2027-02-10T23:34:56.467Z.

View the full-resolution original in ProPR Connect

Library skill bundle item

Library skill bundle item

A skill bundle reference in the extension library with Enabled, repository limit and Apply automatically turned off (used only where an automation adds it).

Connect sign-in required. Original retained until 2027-02-10T23:34:58.368Z.

View the full-resolution original in ProPR Connect

…stance-wide extension library of MCP servers and skill bundles, each with its own limits. All the extension, automation and submission test suites I touched pass, and server/UI typechecks and lint are clean. I did not run the full repository test suite.

Library model (`packages/shared/src/extensionLibrary.ts`)
- Each item has `enabled`, `repositories`, `agents` and `autoApply` (default `true` for new items). The library holds up to 32 servers and 32 skill bundles; a run still carries at most 8 of each.
- `resolveExtensionSet` returns, sorted by name:
  - enabled auto-applied items whose limits match.
  - items the run adds explicitly, which ignore `autoApply`.
- An explicit item that can't be used is listed in `skipped` with a reason, never an error. Reasons: missing, disabled, out of limits, wrong runtime, needs write authorization, or credential not configured.
- When a run has too many items, explicit ones are kept first, then auto-applied ones by name; the rest come back as `omitted`.

Store (`extensionProfileStore.ts`, class now `ExtensionLibraryStore`)
- Saving needs the revision the edit is based on, so concurrent edits are refused. Every save, enable/disable and secret replacement creates a new revision.
- Each server's credential is stored once, sealed to the library revision, and can be replaced or cleared on its own.
- Enable/disable changes only `enabled`; it is never refused, even when an automation adds the item.
- Removing or renaming an item an automation adds is refused, and the message names the automations.
- Every management call still requires a durable administrator.

Launch
- Automation runs resolve against the current library revision at launch. The library revision is the authority, so no administrator check happens at launch.
- All the existing launch checks are kept, including fencing between preparation and container start.
- The fence now refuses a pending launch only if one of *its* items was disabled, removed, re-limited or had its secret rotated. Edits to other items don't block it.
- A run's gateway token now reaches only the servers resolved for that run. Before, it reached every server in the profile.
- Each run records an `extensions.resolved` event on its task timeline, listing what was used, skipped and omitted.

Automations
- The definition has a new `extensions: { servers, skills }` field. It round-trips through REST, the MCP read tools and `propr automation show` (including `--json`).
- Adding items requires the preflight header, an administrator with `instance.manage_settings`, and that every named item exists.
- Decision for you: I let owners *remove* items from an automation without that permission, because removing can't grant anything. The UI is stricter: non-admins see the items read-only. Say if you want removal to require admin on the server too.

Migration
- A knex migration adds the library tables, the automation column and the legacy mapping. It rebuilds the run-grant table so grants of tasks already running survive the upgrade.
- A one-time data migration runs at API and worker startup. It is idempotent and never blocks startup.
  - Identical servers merge, with their limits combined. Different servers that share a name get a `-2`, `-3` suffix, and the rename is logged.
  - Every migrated item has `autoApply: false`, so no run changes behaviour after the upgrade.
  - Automations that selected a profile get its items added explicitly.
  - A secret that can't be decrypted is migrated as "not configured", with a warning.
  - The old profile tables are left untouched.

Behaviour changes to know about
- New Task: it can no longer select extensions. The API refuses `extensionProfile` and the UI selector is gone, so New Task runs get no extensions until the next issue adds auto-apply for tasks. Submissions already queued before the upgrade keep their extensions for their first task, through the legacy mapping.
- Unconfigured credentials: a Bearer server without a credential is now skipped at launch instead of failing the run. This happens after a native export/restore, or when a secret couldn't be decrypted during migration.

API, export, UI and docs
- The REST routes now read the whole library, save it, toggle one item, replace one secret, show history and validate. The old profile routes are removed. The OpenAPI spec and client types are regenerated.
- The native export erases the library's encrypted credentials.
- A background agent did the UI adaptation; its UI typecheck, lint, 471 unit tests and the two Playwright specs pass. The settings screen now edits the single library. The automation editor has a new selector for the items an automation adds.
- `agent-extensions.md` and the automations docs describe the library, item limits, the automation `extensions` field and the migration. The upgrade section mentions profiles once to explain what changed.

Tests
- New: `resolveExtensionSet` unit tests, store tests (revision conflicts, secret custody, enable/disable while an automation uses the item, removal refused, denial for non-admins and stale sessions), automation launch tests, and migration tests.
- Adapted: the existing extension suites (gateway, endpoint policy, staging, launch fencing), plus the REST, MCP, submission and export tests.

I added two preview images of the changed server and skill items in the settings screen.
@propr-dev

propr-dev Bot commented Nov 12, 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 12, 2026
@propr-dev

propr-dev Bot commented Nov 12, 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 12, 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 12, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Validate unsigned linux-x64 package

Please investigate and fix this CI failure.

  • Check: Validate unsigned linux-x64 package
  • Result: failure
  • Commit: 44777dff4131 (44777dff4131b0ae762aafc51b081ef58e0f9ebe)
  • Details: View CI failure

Failure evidence

.github:82
Process completed with exit code 1.

@propr-dev

propr-dev Bot commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Validate unsigned linux-arm64 package

Please investigate and fix this CI failure.

  • Check: Validate unsigned linux-arm64 package
  • Result: failure
  • Commit: 44777dff4131 (44777dff4131b0ae762aafc51b081ef58e0f9ebe)
  • Details: View CI failure

Failure evidence

.github:82
Process completed with exit code 1.

@propr-dev

propr-dev Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit d56ba19

Processed 2 comments:

Summary of Changes

I fixed both failing CI checks with a lockfile-only update; nothing in this PR's own code caused them.

Cause: both package jobs failed at the "Audit committed dependency resolution" step. The audit flagged @hono/node-server 2.1.5, which two advisories published since the last green run cover (GHSA-qv5m-9pm6-hqp3 and GHSA-jpvv-r467-5p4w, both for versions below 2.1.6). Main's lockfile still has 2.1.5, so the failure isn't specific to this PR. Open PR #3508 has the same fix but isn't merged yet.

Fix: in package-lock.json, @hono/node-server goes from 2.1.5 to 2.1.8. That's inside the range the project already allows, so no package.json change was needed and nothing else in the lockfile moved. I made the update with npm 11.

Checks:

  • Re-running npm install --package-lock-only with npm 10 (the version CI uses on Node 22) leaves the lockfile byte-identical.
  • npm run audit:runtime and npm run desktop:audit:packaging both pass. Together these are the step that failed in CI.

Whichever of this PR or #3508 merges second will either conflict on this one line or merge cleanly, since both make the same change.

There is no visual change, so I didn't create a preview.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-dev[bot]
  • Time: 4m 56s
  • Tokens: 481,780 (479,662 in / 2,118 out)
  • Cost: $0.32

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment IDs: 6839148834✓, 6839149152✓

… nothing in this PR's own code caused them.

I fixed both failing CI checks with a lockfile-only update; nothing in this PR's own code caused them.

**Cause:** both package jobs failed at the "Audit committed dependency resolution" step. The audit flagged `@hono/node-server` 2.1.5, which two advisories published since the last green run cover (GHSA-qv5m-9pm6-hqp3 and GHSA-jpvv-r467-5p4w, both for versions below 2.1.6). Main's lockfile still has 2.1.5, so the failure isn't specific to this PR. Open PR #3508 has the same fix but isn't merged yet.

**Fix:** in `package-lock.json`, `@hono/node-server` goes from 2.1.5 to 2.1.8. That's inside the range the project already allows, so no `package.json` change was needed and nothing else in the lockfile moved. I made the update with npm 11.

**Checks:**
- Re-running `npm install --package-lock-only` with npm 10 (the version CI uses on Node 22) leaves the lockfile byte-identical.
- `npm run audit:runtime` and `npm run desktop:audit:packaging` both pass. Together these are the step that failed in CI.

Whichever of this PR or #3508 merges second will either conflict on this one line or merge cleanly, since both make the same change.

There is no visual change, so I didn't create a preview.

PR: #3513
Comment by: @propr-dev[bot] (ID: 6839148834)
Comment by: @propr-dev[bot] (ID: 6839149152)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

This PR replaces extension profiles with a shared library and integrates resolution across automation launches, management APIs, UI, and migration. It needs changes before merge: migration can activate previously disabled selections, existing automation runs lose their selections, and UI toggles bypass stale-edit protection.

✅ Scoped gateway grants — New grants persist the resolved server names, and gateway reads filter the revision to those names.

✅ Launch fencing — Prepared launches compare their selected items and bearer credentials against the current library while allowing unrelated edits.

✅ Broad validation coverage — Tests cover resolution limits, credential custody, management authorization, and launch fencing. The supplied checks report 34 passed, none failed, and one pending.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Toggles bypass stale-edit protection

  • Required behavior: Concurrent library edits must be refused rather than silently overwritten.

  • Evidence: propr-ui/src/pages/SettingsPage/AgentExtensionsSection.tsx, toggle and the Save library handler.

    1. Administrator A loads revision 1 and retains its draft.
    2. Administrator B saves revision 2, tightening a server’s repository limits.
    3. A toggles a saved skill. setExtensionItemEnabled operates on the current server-side head and returns revision 3, including B’s changes.
    4. toggle calls setLibrary(result.library) but updates only the toggled field in A’s stale draft.
    5. A saves the library. The handler submits the revision-1 draft with expectedRevision: 3, successfully reverting B’s repository restriction.

    The server’s revision comparison passes because the UI advanced the expected revision without reconciling the draft. This can overwrite configuration and restore broader access. static trace: verified through the toggle callback, save handler, and saveLibrary revision check; no commands executed.

  • Minimum fix: Preserve the draft’s original base revision across toggles, or reconcile the returned library with the draft using an explicit conflict-aware merge. Do not adopt a newer expected revision while retaining unrelated stale fields.

F2: 🔴 Migration reactivates disabled selections

  • Required behavior: Disabled items must apply to no run, and migration must preserve existing extension behavior.

  • Evidence: packages/core/src/extensions/extensionLibraryMigration.ts, candidate merging and legacy mapping construction.

    1. Two enabled legacy profiles contain an otherwise identical server and credential; the server is enabled in profile A and disabled in profile B.
    2. identity(server, token) excludes enabled state, so migration merges both into one candidate.
    3. merged.enabled ||= enabled makes the library item enabled, while items.servers.push(name) adds that same item to both profiles’ mappings.
    4. An automation selecting profile B receives the enabled library item explicitly and launches with the previously disabled server.

    The same issue affects a disabled profile sharing servers or skill bundles with an enabled profile. autoApply: false does not prevent this because migrated automations add the merged items explicitly. static trace: verified through candidate merging, mapping persistence, automation conversion, and explicit-item resolution.

  • Minimum fix: Preserve source-specific disabled behavior when constructing migrated selections. Do not map an inactive source selection to an enabled merged item; retain distinct server items where necessary.

F3: 🔴 Existing automation runs lose extensions

  • Required behavior: Upgrading must preserve the extension selections of already-created automation runs, including pending acting steps.

  • Evidence: src/jobs/agentRuns/agentTaskOptions.ts, agentTaskOptions; packages/core/src/extensions/extensionLibraryMigration.ts, automation conversion.

    1. Before upgrade, an automation run captures a definition snapshot containing extensionProfile and remains queued or awaiting approval.
    2. Startup migration updates agent_definitions.extensions and creates legacy mappings, but does not convert existing run snapshots.
    3. After upgrade, the report or action processor builds options from that run’s captured definition.
    4. agentTaskOptions reads only definition.extensions, defaulting both explicit lists to empty.
    5. Migrated library items have autoApply: false, so the run starts without its selected servers and skills.

    Updating the live definition cannot repair the captured snapshot. The legacy mapping fallback exists for task submissions, but not for automation runs. static trace: verified through the migration’s writes and both processors’ calls to agentTaskOptions; no execution performed.

  • Minimum fix: Translate legacy profile selections in nonterminal automation snapshots during migration, or resolve them through the legacy mapping when building launch options. Cover both queued reports and pending acting steps.

Suggestions

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

No suggestions.

Score

The implementation has substantial coverage and useful security improvements, but three verified state-preservation regressions block merge. This review used static tracing only, as requested; the supplied current checks have no failures.

Score: 5/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 6m 27s
  • Tokens: 178,226 (176,663 in / 1,563 out)
  • Cost: $1.71

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 F1 F2 F3

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit b245a46

Addressed 1 AI review comment (IDs: 6839760797)

Addressed findings F1, F2, F3

Summary of Changes

I fixed F1, F2 and F3, and each has a new regression test. To check the new tests catch the bugs, I ran them against the original code: they fail there and pass with the fixes. The migration suite (7 tests), the UI suite (5 tests) and 197 tests across the extension, launch and both automation-processor suites all pass. The UI and core typechecks are clean, and lint is clean on the changed source files. ESLint skips packages/core/test because no lint config covers it, so the new migration test file isn't linted.

F1 — toggles skipping the stale-edit check (propr-ui/src/pages/SettingsPage/AgentExtensionsSection.tsx)

  • The draft now remembers the revision it was loaded from, and Save library sends that revision instead of the newest one the server returned.
  • A toggle moves that revision forward only when the server's new revision is exactly one past it, meaning nothing else changed in between. Otherwise the old revision is kept, so saving the stale draft is refused. The notice then says the library was changed elsewhere and to discard changes to reload it.
  • The revision is kept in a ref, so several quick toggles can't read an outdated value.
  • I updated the existing test for two toggles in a row (it now saves against revision 5). A new test covers your scenario: another administrator narrows a server's repositories, a toggle comes back two revisions ahead, and the save still goes out against revision 3.

F2 — migration turning disabled selections back on (packages/core/src/extensions/extensionLibraryMigration.ts)

  • Whether a server is enabled is now part of what makes two servers "identical". A server that is disabled in one profile, or that sits in a disabled profile, no longer merges into an enabled copy. It becomes its own disabled item (renamed with a -2 suffix), which doesn't widen the enabled item's limits.
  • Skill bundles can only appear once in the library, so they can't be split the same way. Instead, a disabled profile's mapping leaves out a bundle that an enabled profile switched on. A bundle that only disabled profiles selected stays disabled and stays in their mappings.
  • The new test checks that automations selecting either kind of disabled source launch with nothing, and that the skipped reason is disabled.

F3 — existing automation runs losing their extensions (same migration file)

  • The migration now also updates the saved definitions of automation runs that haven't finished: queued, deferred, running, report ready, awaiting approval and acting. Where a saved definition still names a profile, it gains the matching extensions items. The old profile field is kept, as it is on automations.
  • If the profile no longer exists, the run gets an empty list and a warning. Finished runs are left unchanged. This happens in the same transaction as the rest of the migration, so it stays idempotent.
  • The test covers queued, awaiting-approval and acting runs, a missing profile, a finished run and an already-converted run.

Two limits remain:

  • The F1 check is deliberately cautious: if someone else only toggled an item in between, saving your draft is refused too, and you reload before saving.
  • During a rolling upgrade, an API server still on the old code could create a run after the migration; that run wouldn't be converted. Automations saved by old code in that window have the same gap, as before.

I didn't add preview images: the only visible change is the notice text in that rare conflict case.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 7m 15s
  • Tokens: 2,400,701 (2,383,275 in / 17,426 out)
  • Cost: $1.24

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…To check the new tests catch the bugs, I ran them against the original code: they fail there and pass with the fixes. The migration suite (7 tests), the UI suite (5 tests) and 197 tests across the extension, launch and both automation-processor suites all pass. The UI and core typechecks are clean, and lint is clean on the changed source files. ESLint skips `packages/core/test` because no lint config covers it, so the new migration test file isn't linted.

I fixed F1, F2 and F3, and each has a new regression test. To check the new tests catch the bugs, I ran them against the original code: they fail there and pass with the fixes. The migration suite (7 tests), the UI suite (5 tests) and 197 tests across the extension, launch and both automation-processor suites all pass. The UI and core typechecks are clean, and lint is clean on the changed source files. ESLint skips `packages/core/test` because no lint config covers it, so the new migration test file isn't linted.

**F1 — toggles skipping the stale-edit check** (`propr-ui/src/pages/SettingsPage/AgentExtensionsSection.tsx`)
- The draft now remembers the revision it was loaded from, and Save library sends that revision instead of the newest one the server returned.
- A toggle moves that revision forward only when the server's new revision is exactly one past it, meaning nothing else changed in between. Otherwise the old revision is kept, so saving the stale draft is refused. The notice then says the library was changed elsewhere and to discard changes to reload it.
- The revision is kept in a ref, so several quick toggles can't read an outdated value.
- I updated the existing test for two toggles in a row (it now saves against revision 5). A new test covers your scenario: another administrator narrows a server's repositories, a toggle comes back two revisions ahead, and the save still goes out against revision 3.

**F2 — migration turning disabled selections back on** (`packages/core/src/extensions/extensionLibraryMigration.ts`)
- Whether a server is enabled is now part of what makes two servers "identical". A server that is disabled in one profile, or that sits in a disabled profile, no longer merges into an enabled copy. It becomes its own disabled item (renamed with a `-2` suffix), which doesn't widen the enabled item's limits.
- Skill bundles can only appear once in the library, so they can't be split the same way. Instead, a disabled profile's mapping leaves out a bundle that an enabled profile switched on. A bundle that only disabled profiles selected stays disabled and stays in their mappings.
- The new test checks that automations selecting either kind of disabled source launch with nothing, and that the skipped reason is `disabled`.

**F3 — existing automation runs losing their extensions** (same migration file)
- The migration now also updates the saved definitions of automation runs that haven't finished: queued, deferred, running, report ready, awaiting approval and acting. Where a saved definition still names a profile, it gains the matching `extensions` items. The old profile field is kept, as it is on automations.
- If the profile no longer exists, the run gets an empty list and a warning. Finished runs are left unchanged. This happens in the same transaction as the rest of the migration, so it stays idempotent.
- The test covers queued, awaiting-approval and acting runs, a missing profile, a finished run and an already-converted run.

Two limits remain:
- The F1 check is deliberately cautious: if someone else only toggled an item in between, saving your draft is refused too, and you reload before saving.
- During a rolling upgrade, an API server still on the old code could create a run after the migration; that run wouldn't be converted. Automations saved by old code in that window have the same gap, as before.

I didn't add preview images: the only visible change is the notice text in that rare conflict case.

PR: #3513
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 13, 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 13, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

This PR implements the instance-wide extension library across storage, launch resolution, automations, UI, migration, and documentation. It needs changes before merge: the changed paths expose a network-policy race, broaden migrated skill permissions through disabled profiles, and weaken secret-disclosure validation.

✅ Bounded resolution — The shared resolver deterministically prioritizes explicit items, enforces per-run limits, and reports skipped and omitted items.

✅ Restricted gateway grants — Library grants persist the resolved server selection, and gateway reads filter the immutable snapshot to that selection.

✅ Revision protection — Library saves require an expected revision, and launch fencing checks changes to the items actually selected.

This review is a static analysis of the supplied code; no commands were run. The supplied current checks show 30 passed, four pending, and no failures.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F4: 🔴 Capture network policy before resolving extensions

  • Required behavior: Extensions must preserve the run’s network restrictions, including the policy captured in its gateway grant.

  • Evidence: src/jobs/processAgentRunJob.ts, createAgentRunProcessor; src/jobs/processAgentActionJob.ts, createAgentActionProcessor; packages/core/src/extensions/extensionLaunch.ts, extensionsApply and executeWithExtensions.

    1. An automation has no explicit extensions, and its matching library server is disabled. The instance has restricted network mode, which excludes that server’s public endpoint.
    2. extensionsApply awaits store.resolveLaunch(...), reads the disabled item, and returns false.
    3. An administrator enables the item after that read and before executeWithExtensions performs its separate awaited library read. The predicate and execution are separate operations with no shared snapshot or transaction, so this ordering is permitted.
    4. The processor takes the false branch and executes outside runWithNetworkPolicy. Extension preparation now resolves the enabled server.
    5. With no captured network scope, executeWithExtensions constructs grantNetwork using network?.mode ?? 'open'. The resulting gateway grant permits the endpoint that the instance restriction should exclude.

    The item fence does not prevent this: preparation and activation both see the newly enabled item unchanged. The endpoint check receives the already incorrect open policy. Both report and action processors use this pattern. static trace: traced both predicate branches through grant construction and the supplied endpoint-policy checks; this interleaving was not executed.

  • Minimum fix: Establish the network-policy scope before library resolution for automation launches that may receive extensions, in both processors. Do not make capturing policy depend on an earlier read of whether items currently apply.

F5: 🔴 Exclude disabled profiles from active skill limits

  • Required behavior: Migration must preserve extension restrictions; a disabled source must not expand the authorization of an enabled item.

  • Evidence: packages/core/src/extensions/extensionLibraryMigration.ts, the profile.skillBundleIds merge loop.

    1. An enabled legacy profile selects skill bundle B and limits it to team/private and claude-main.
    2. A disabled legacy profile also selects B but has empty repository and agent scopes.
    3. Migration merges both into the same skill entry. It ORs their enabled flags and unconditionally unions their scopes; the empty scopes turn both merged limits into unrestricted lists.
    4. The enabled profile’s automation receives B explicitly. Subsequent launches on another repository or agent now receive B, although the enabled source never authorized that scope.

    This result is independent of profile processing order: an unrestricted disabled source either initializes the limits or clears them during merging. Removing B from the disabled profile’s mapping prevents that profile from activating B, but does not restore the enabled item’s limits. Server migration explicitly separates enabled and disabled identities; the skill path lacks equivalent protection. static trace: traced union, skill merging, activeSkills, mapping filtering, and repository/agent matching. The added disabled-source test checks server limits and skill enabled states, but does not assert the shared skill’s limits.

  • Minimum fix: When a bundle has enabled sources, derive its limits exclusively from those enabled sources. Retain disabled-source limits only when every source is disabled, and keep the existing exclusion from disabled-profile mappings.

F6: 🔴 Check outgoing fields against previous secrets

  • Required behavior: Write-only credentials must not be persisted or returned in public library fields.

  • Evidence: packages/core/src/extensions/extensionProfileStore.ts, saveLibrary and writeRevision.

    1. A Bearer server has a stored token such as PRIVATE_TOKEN_SENTINEL, which also satisfies the allowed tool-name syntax.
    2. An administrator submits a library save that accidentally places that token in a public field—for example, the server’s tools array—and clears its credential with { docs: null }.
    3. saveLibrary decrypts the old credentials but builds next without the cleared token.
    4. writeRevision checks public fields only against Object.values(secrets), receiving next. It therefore accepts the token in the public descriptor, persists it in the revision snapshot, and returns it through read/history responses and native exports.

    Removing the credential-bearing server or changing its endpoint can likewise remove the old token from the checked set. Schema validation does not reject a syntactically valid token used as a tool name. The previous implementation explicitly checked public input against both old credentials and replacements before discarding credentials. static trace: compared that removed check with the new next construction and writeRevision validation; no disclosure test was executed.

  • Minimum fix: Before filtering or replacing credentials, validate public library input against all previously stored credentials and all supplied non-null replacements, retaining the existing check against credentials written into the next revision.

Suggestions

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

No suggestions.

Score

The implementation has substantial coverage and useful revision and grant protections, but three verified defects remain in changed security and migration behavior. Passing checks do not cover these sequences; four checks are still pending.

Score: 5/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 29s
  • Tokens: 179,523 (177,664 in / 1,859 out)
  • Cost: $1.76

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 F4 F5 F6

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

⚠️ Applied partial follow-up changes in commit 1ea35e0

Warning

This work may be incomplete. The agent stopped producing output and the stall watchdog ended the run before it could confirm that all requested work was complete. The available changes were committed instead of discarded.

Addressed 1 AI review comment (IDs: 6840225174)

Addressed findings F4, F5, F6

Last Agent Update

I fixed F4, F5 and F6, each with a new regression test. To check the tests catch the bugs, I ran each one against the original code: they fail there and pass with the fixes.

F4: network policy captured before the library is read

  • Before: both processors read the library first to decide whether a run had extensions. Only those runs got the network-policy scope. If an item was enabled after that read, the run still launched it, and its gateway grant fell back to open.
  • Fix: both the report and action processors now decide without reading the library. Any Claude or Codex automation run with an extension request starts under runWithNetworkPolicy, before its items are resolved. The check is in src/jobs/agentRuns/agentTaskOptions.ts; I removed the library-reading extensionsApply from core.
  • Behaviour change: every agent run builds an extension request with auto-apply on, so in practice all Claude and Codex automation runs now run under the instance network policy. Before, only runs where items actually applied did. On an instance in restricted mode, those runs are now restricted even when no library item applies.
  • Regression tests: one in each processor suite. The library's only item is disabled when the processor decides, and gets enabled just before launch. The test then checks the grant carries the restricted policy. On the original code it came out open.

F5: disabled profiles no longer widen a skill's limits

  • Fix: in extensionLibraryMigration.ts, when a bundle has any enabled source, its limits now come only from enabled sources. Limits are combined only when every source is disabled. Disabled profiles are still left out of the mapping, as before.
  • Regression tests: an enabled profile limited to team/private and claude-main shares a bundle with an unrestricted disabled profile. Both processing orders keep the limits, and a launch outside them skips the bundle. A second test checks that a bundle with only disabled sources still combines their limits.
  • Sibling check: server merging already keeps enabled and disabled copies as separate items, so it doesn't have this problem.

F6: public fields checked against previously stored credentials

  • Fix: saveLibrary now refuses the save if any public field contains a stored credential or a supplied replacement. The check runs before credentials are cleared, dropped with their server, or withheld because the endpoint changed. The existing check in writeRevision is unchanged.
  • Regression test: it covers a credential that was cleared, one removed with its server, one withheld after an endpoint change, and one being replaced, plus a new replacement value placed in another server's tools. Each save is refused, no revision is written, and the history doesn't contain the secret.
  • Sibling check: replaceSecret and setItemEnabled keep the stored items unchanged and check against every credential, so they don't need the fix.

Verification

  • Processor suites: both pass, 141 tests.
  • Migration suites: the migration suite (10 tests), the authority-cleanup suite (2) and the native-cleanup suite (4) pass.
  • extensionProfiles suite: 42 of 43 pass. The one failure, "catalog stdio is callable through both selected authorized launcher policies…", also fails on a clean copy of HEAD, so it's a problem in this container, not these changes. The file then doesn't exit after its tests finish, so the run ends on the timeout.
  • Typecheck and lint: the core and root typechecks are clean, and lint is clean on the changed source files.

Not changed: if a Claude or Codex launch somehow reaches executeWithExtensions with no network scope, the grant still defaults to open. After this fix, every path I traced that carries extensions sets a scope first. Making that default refuse instead would break many existing tests that call it directly, so I left it.

There's no visible UI change, so I made no previews.

Remaining Work

The agent stopped before validating every request. Review this partial commit against the follow-up instructions and complete any unaddressed implementation, tests, or documentation.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 50m 2s
  • Tokens: 5,678,840 (5,678,134 in / 706 out)
  • Cost: $1.68
  • Subscription usage: Weekly +1%, Fable +1%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…check the tests catch the bugs, I ran each one against the original code: they fail there and pass with the fixes.

I fixed F4, F5 and F6, each with a new regression test. To check the tests catch the bugs, I ran each one against the original code: they fail there and pass with the fixes.

**F4: network policy captured before the library is read**
- **Before:** both processors read the library first to decide whether a run had extensions. Only those runs got the network-policy scope. If an item was enabled after that read, the run still launched it, and its gateway grant fell back to `open`.
- **Fix:** both the report and action processors now decide without reading the library. Any Claude or Codex automation run with an extension request starts under `runWithNetworkPolicy`, before its items are resolved. The check is in `src/jobs/agentRuns/agentTaskOptions.ts`; I removed the library-reading `extensionsApply` from core.
- **Behaviour change:** every agent run builds an extension request with auto-apply on, so in practice all Claude and Codex automation runs now run under the instance network policy. Before, only runs where items actually applied did. On an instance in restricted mode, those runs are now restricted even when no library item applies.
- **Regression tests:** one in each processor suite. The library's only item is disabled when the processor decides, and gets enabled just before launch. The test then checks the grant carries the restricted policy. On the original code it came out `open`.

**F5: disabled profiles no longer widen a skill's limits**
- **Fix:** in `extensionLibraryMigration.ts`, when a bundle has any enabled source, its limits now come only from enabled sources. Limits are combined only when every source is disabled. Disabled profiles are still left out of the mapping, as before.
- **Regression tests:** an enabled profile limited to `team/private` and `claude-main` shares a bundle with an unrestricted disabled profile. Both processing orders keep the limits, and a launch outside them skips the bundle. A second test checks that a bundle with only disabled sources still combines their limits.
- **Sibling check:** server merging already keeps enabled and disabled copies as separate items, so it doesn't have this problem.

**F6: public fields checked against previously stored credentials**
- **Fix:** `saveLibrary` now refuses the save if any public field contains a stored credential or a supplied replacement. The check runs before credentials are cleared, dropped with their server, or withheld because the endpoint changed. The existing check in `writeRevision` is unchanged.
- **Regression test:** it covers a credential that was cleared, one removed with its server, one withheld after an endpoint change, and one being replaced, plus a new replacement value placed in another server's tools. Each save is refused, no revision is written, and the history doesn't contain the secret.
- **Sibling check:** `replaceSecret` and `setItemEnabled` keep the stored items unchanged and check against every credential, so they don't need the fix.

**Verification**
- **Processor suites:** both pass, 141 tests.
- **Migration suites:** the migration suite (10 tests), the authority-cleanup suite (2) and the native-cleanup suite (4) pass.
- **`extensionProfiles` suite:** 42 of 43 pass. The one failure, "catalog stdio is callable through both selected authorized launcher policies…", also fails on a clean copy of HEAD, so it's a problem in this container, not these changes. The file then doesn't exit after its tests finish, so the run ends on the timeout.
- **Typecheck and lint:** the core and root typechecks are clean, and lint is clean on the changed source files.

**Not changed:** if a Claude or Codex launch somehow reaches `executeWithExtensions` with no network scope, the grant still defaults to `open`. After this fix, every path I traced that carries extensions sets a scope first. Making that default refuse instead would break many existing tests that call it directly, so I left it.

There's no visible UI change, so I made no previews.

PR: #3513
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5

Partial execution: The agent stopped producing output and the stall watchdog ended the run before it could confirm that all requested work was complete.
@propr-dev

propr-dev Bot commented Nov 13, 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 13, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Validate unsigned linux-x64 package

Please investigate and fix this CI failure.

  • Check: Validate unsigned linux-x64 package
  • Result: failure
  • Commit: 1ea35e0d7bd6 (1ea35e0d7bd6ec02d27bf182558fdca11d2f9022)
  • Details: View CI failure

Failure evidence

.github:131
Process completed with exit code 1.

@propr-dev

propr-dev Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Validate unsigned darwin-arm64 package

Please investigate and fix this CI failure.

  • Check: Validate unsigned darwin-arm64 package
  • Result: failure
  • Commit: 1ea35e0d7bd6 (1ea35e0d7bd6ec02d27bf182558fdca11d2f9022)
  • Details: View CI failure

Failure evidence

.github:131
Process completed with exit code 1.

.github:1
Due to capacity constraints, jobs targeting macOS arm64 runners may experience longer queue times.

@propr-dev

propr-dev Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Validate unsigned linux-arm64 package

Please investigate and fix this CI failure.

  • Check: Validate unsigned linux-arm64 package
  • Result: failure
  • Commit: 1ea35e0d7bd6 (1ea35e0d7bd6ec02d27bf182558fdca11d2f9022)
  • Details: View CI failure

Failure evidence

.github:131
Process completed with exit code 1.

@propr-dev

propr-dev Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 2e5489f

Processed 2 comments:

Summary of Changes

I fixed both failing package checks by bumping hono from 4.13.12 to 4.13.18. Nothing in this PR's own code caused the failures.

Cause: both jobs failed at the "Audit committed dependency resolution" step (npm run audit:runtime). The audit flagged hono 4.13.12 under advisories published since the last green run (GHSA-4m76-xfj5-7975, GHSA-4h7h-rv7c-7m2v and others), which cover versions up to 4.13.15. Main still has 4.13.12, so any open PR running this job will hit the same failure.

Fix: hono is pinned to an exact version in the root package.json overrides, so changing the lockfile alone wasn't enough.

  • package.json: overrides.hono is now 4.13.18, the latest 4.13.x.
  • package-lock.json: only the node_modules/hono entry changed (version, resolved URL, integrity). I made this edit with npm 11.

Checks:

  • npm run audit:runtime passes ("runtime dependency audit passed").
  • npm run desktop:audit:packaging passes ("packaging dependency audit passed").
  • CI installs with npm 10 (the version bundled with Node 22). Re-resolving the lockfile with npm 10 leaves it byte-identical, so CI will use the new version as written.
  • No other file pins 4.13.12 except an old release entry in CHANGELOG.md, which I left alone.

No preview images: this change has nothing visible in the UI.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-dev[bot]
  • Time: 4m 45s
  • Tokens: 422,154 (420,114 in / 2,040 out)
  • Cost: $0.34

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment IDs: 6841117887✓, 6841118382✓

…4.13.12 to 4.13.18. Nothing in this PR's own code caused the failures.

I fixed both failing package checks by bumping `hono` from 4.13.12 to 4.13.18. Nothing in this PR's own code caused the failures.

**Cause:** both jobs failed at the "Audit committed dependency resolution" step (`npm run audit:runtime`). The audit flagged `hono` 4.13.12 under advisories published since the last green run (GHSA-4m76-xfj5-7975, GHSA-4h7h-rv7c-7m2v and others), which cover versions up to 4.13.15. Main still has 4.13.12, so any open PR running this job will hit the same failure.

**Fix:** `hono` is pinned to an exact version in the root `package.json` `overrides`, so changing the lockfile alone wasn't enough.
- `package.json`: `overrides.hono` is now `4.13.18`, the latest 4.13.x.
- `package-lock.json`: only the `node_modules/hono` entry changed (version, resolved URL, integrity). I made this edit with npm 11.

**Checks:**
- `npm run audit:runtime` passes ("runtime dependency audit passed").
- `npm run desktop:audit:packaging` passes ("packaging dependency audit passed").
- CI installs with npm 10 (the version bundled with Node 22). Re-resolving the lockfile with npm 10 leaves it byte-identical, so CI will use the new version as written.
- No other file pins 4.13.12 except an old release entry in `CHANGELOG.md`, which I left alone.

No preview images: this change has nothing visible in the UI.

PR: #3513
Comment by: @propr-dev[bot] (ID: 6841117887)
Comment by: @propr-dev[bot] (ID: 6841118382)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

ℹ️ Analyzed the follow-up request by @propr-dev[bot]

Analysis Summary

The fix is already on the branch, so I made no changes.

Cause: the failing check ran on 1ea35e0d7. It stopped at "Audit committed dependency resolution" (npm run audit:runtime) with "Blocking vulnerabilities: hono". The installed hono 4.13.12 falls inside new advisories that cover versions up to 4.13.15 (GHSA-4h7h-rv7c-7m2v, GHSA-46wx-v44x-9hh2). Nothing in this PR's code caused it. The macOS runner capacity warning in the evidence is just a notice.

Already fixed: the next commit, 2e5489f9c (the current HEAD), bumps hono to 4.13.18 in the root package.json overrides and in package-lock.json. At HEAD, both audit steps this job runs pass locally:

  • npm run audit:runtime: "runtime dependency audit passed"
  • npm run desktop:audit:packaging: "packaging dependency audit passed"

CI on HEAD: 27 checks show "fail" for HEAD, but they are cancellations, not test failures. The run was stopped by propr-dev[bot] ("The run was canceled", "The operation was canceled") within a few minutes of starting. The unsigned package jobs never started (0s). The audit step itself has not run in CI on HEAD yet, so I can't confirm it from CI. Re-running the CI for 2e5489f9c should clear this check and the cancelled ones.

No code changes were necessary based on the current state of the branch.


🤖 Analysis Details

  • Model: Claude Opus 5.5 (medium)
  • Time: 3m 28s
  • Tokens: 335,136 (333,273 in / 1,863 out)
  • Cost: $0.29

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 6841118091✓

@propr-dev

propr-dev Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

The PR implements the instance-wide extension library across storage, launch, automation APIs, UI, and documentation. It needs changes before merge because concurrent UI edits can be overwritten and migration or credential failures can disrupt automation behavior.

✅ Scoped gateway grants — Library grants persist the resolved server selection, and the gateway filters the revision against it.

✅ Revision fencing — Saves compare the expected revision, while pending launches compare their selected items and credentials against the current library.

✅ Focused coverage — Added tests cover migration, credential custody, item limits, authorization, and launch fencing.

The supplied current checks show 29 passed, five pending, and no failures. This review uses static analysis only; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F7: 🔴 No-op toggles can bypass edit conflicts

  • Required behavior: Concurrent library edits must be refused rather than overwritten by a stale draft.

  • Evidence: propr-ui/src/pages/SettingsPage/AgentExtensionsSection.tsx, toggle; packages/core/src/extensions/extensionProfileStore.ts, setItemEnabled.

    1. Administrator A loads revision 3 with a server enabled and a broad repository limit.
    2. Administrator B saves revision 4, disabling that server and narrowing its repository limit.
    3. A clicks Disable in the stale editor. setItemEnabled reads revision 4, sees the requested state already present, and returns revision 4 without writing.
    4. The UI sees result.library.revision === baseRevision.current + 1, advances its draft base to 4, and updates only the draft’s enabled flag.
    5. A saves the draft against revision 4. The save succeeds and restores the stale, broader repository limit.

    The server’s revision check cannot protect this sequence because the UI incorrectly adopts the competing edit’s revision. The existing toggle tests cover a competing edit followed by a new toggle revision, but not this no-op response. static trace: both branches and the subsequent save are present in the supplied diff.

  • Minimum fix: Advance the draft base only when the returned library is demonstrably the previous base plus the requested toggle. Preserve the old base when other fields differ, including when the toggle returns an unchanged head.

F8: 🔴 Missing catalog credentials fail automatic runs

  • Required behavior: An applicable extension without configured credentials must be skipped with a reason rather than fail the run.

  • Evidence: packages/shared/src/extensionLibrary.ts, extensionItemSkipReason; packages/core/src/extensions/extensionProfileStore.ts, validateServers and resolveLaunch; packages/core/src/extensions/extensionLaunch.ts, executeWithExtensions.

    1. An administrator saves an enabled catalog server whose referenced environment credential is absent. Save validation explicitly resolves with requireSecrets=false, so this configuration is accepted.
    2. The new item defaults to autoApply: true.
    3. A matching automation launches without explicitly selecting this server. Resolution includes it because the missing-credential skip condition handles only kind === 'https', not catalog descriptors.
    4. Catalog resource resolution requires credentials and throws Operator catalog secrets are not configured; extension preparation fails instead of executing the automation without that item.

    This newly exposes otherwise unrelated automation runs to a missing credential through automatic application. The adapted catalog test explicitly expects this exception from resolveLaunch, so existing coverage preserves the inconsistent behavior. static trace: save acceptance, resolver filtering, and catalog failure behavior are shown in the supplied code and catalog excerpt.

  • Minimum fix: Check current catalog credential availability during resolution and exclude unconfigured items with secret_not_configured. Retain refusal for invalid catalog identities and capability mismatches.

F9: 🔴 Failed migration silently strips automation extensions

  • Required behavior: Upgraded automations must retain their selected extensions; allowing startup to continue must not silently execute unmigrated definitions without them.

  • Evidence: packages/core/src/extensions/extensionLibraryMigration.ts, migrateExtensionProfilesToLibrary; src/extensionLibraryStartup.ts, migrateExtensionLibrary; packages/api/server.ts, start; packages/core/src/services/agents/agentDefinitionStore.ts, rowToAgentDefinition.

    1. An existing automation has a legacy extension_profile selection and no extensions value.
    2. The startup data migration encounters a write failure and rolls back. Its catch returns migrated: false; both startup paths continue without gating affected automations.
    3. A scheduled or manually triggered run loads the definition. The changed row mapper reads only row.extensions, yielding empty arrays despite the surviving legacy selection.
    4. The run captures that empty selection and launches without the previously configured extensions.
    5. A later successful migration cannot repair this captured selection: snapshot migration requires snapshot.extensionProfile, which the new row mapper no longer supplies.

    Transaction rollback protects the old tables but does not protect their consumers. The migration failure test verifies retry on the next start, without checking runs admitted between starts. static trace: the failure return, startup continuation, mapper, and snapshot migration predicate establish this sequence.

  • Minimum fix: Keep startup available, but defer launches of definitions with an unmigrated legacy selection until migration succeeds, or translate those selections before creating run snapshots. Apply the same readiness protection to legacy submission mapping so migration failure is not treated as an absent selection.

Suggestions

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

S1: 🟢 Align permission contract wording

The generated AutomationExtensions description says setting or changing extensions requires instance.manage_settings, while the routes deliberately permit removal without that permission. Clarifying that only additions require it would make client documentation consistent. This is optional documentation cleanup.

Score

The implementation has substantial coverage and useful security boundaries, but the verified conflict-handling and launch regressions prevent merge readiness. Pending checks do not independently lower the score.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 33s
  • Tokens: 181,228 (179,132 in / 2,096 out)
  • Cost: $1.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 F7 F8 F9 S1

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 0e207b0

Addressed 1 AI review comment (IDs: 6841554308)

Addressed findings F7, F8, F9

Summary of Changes

I fixed F7, F8 and F9, and each has a regression test. I checked that every new test fails against the original code and passes with the fixes.

F7 – a no-op toggle no longer hides another admin's edit (AgentExtensionsSection.tsx)

  • The editor now remembers the saved items its draft is based on. After a toggle, it adopts the returned revision only if it is exactly the next revision and differs from that base by just the toggled enabled flag.
  • Any other result keeps the old base and shows "changed elsewhere". That includes the case in the finding, where the toggle wrote nothing and returned the other admin's revision 4. Saving the stale draft is then sent against revision 3 and refused.
  • New UI test covers that sequence.

F8 – a catalog server without credentials is skipped, not a failed run (extensionLibrary.ts, extensionProfileStore.ts)

  • At launch, the resolver now reads whether each catalog server's credentials are present in the environment now, rather than trusting the status saved with the library. A missing credential gives secret_not_configured and the server is skipped. This applies whether the server was auto-applied or added explicitly. The launch fence uses the same check.
  • A catalog entry that is missing or whose digest changed is not skipped, so it is still refused as before. Capability mismatches are also still refused.
  • The old test that expected resolveLaunch to throw now expects the skip. A new test runs executeWithExtensions and shows the run goes ahead without the server, and is still refused when the catalog identity is wrong.

F9 – a failed migration no longer strips automation extensions (extensionLibraryMigration.ts, agentRunTrigger.ts, taskSubmissionService.ts)

  • Readiness check: the migration counts as finished once its completion marker is committed, or when the instance never set up profiles. Startup is unchanged and still never blocked.
  • New runs: a definition that still has an untranslated profile selection makes triggerAgentRun retry the migration on the spot. If that succeeds, the run's snapshot gets the translated items. If it still fails, the trigger is refused with 409 EXTENSIONS_MIGRATION_PENDING and no run is created. A scheduled slot stays pending and is tried again on the next sweep. Automations without a legacy selection are not affected.
  • Runs queued before the upgrade: runtime validation refuses a run whose snapshot still names its old profile, until the migration has translated it.
  • Queued legacy submissions: a missing mapping retries the migration. If it still fails, the task fails with an explicit error instead of running with no extensions.
  • New test file test/extensionLibraryMigrationReadiness.test.ts covers these cases.

Choices to review:

  • I used 409, not 503, because the REST route turns any status of 500 or above into a generic "failed" message, which would hide the reason.
  • Pre-upgrade runs are refused rather than held. Validation failure marks them failed, with the migration-pending reason. Making them wait instead would need retry handling added to both worker processors. Say if you want that.

Checks: the extension, migration, trigger, scheduler, cost-gate, run/action processor, submission and launch suites pass: 347 tests, 0 failures, 25 skipped because they need a Redis server. The four API suites pass (61 tests) and the UI suite passes (6 tests). The root, core, API and UI typechecks are clean, as is lint on the changed core and UI files; the shared package has no lint config, so its change isn't linted. I didn't run the full repository test suite.

Found separately, not changed: when an explicitly added item is skipped for a missing credential, the resolver also lists it a second time as an auto-apply skip. This already happened for HTTPS servers, so I made the new test tolerate it rather than fix it.

I made no previews: none of these fixes changes anything on screen.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 19m 9s
  • Tokens: 11,121,871 (11,073,320 in / 48,551 out)
  • Cost: $4.07

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…ecked that every new test fails against the original code and passes with the fixes.

I fixed F7, F8 and F9, and each has a regression test. I checked that every new test fails against the original code and passes with the fixes.

**F7 – a no-op toggle no longer hides another admin's edit** (`AgentExtensionsSection.tsx`)
- The editor now remembers the saved items its draft is based on. After a toggle, it adopts the returned revision only if it is exactly the next revision and differs from that base by just the toggled `enabled` flag.
- Any other result keeps the old base and shows "changed elsewhere". That includes the case in the finding, where the toggle wrote nothing and returned the other admin's revision 4. Saving the stale draft is then sent against revision 3 and refused.
- New UI test covers that sequence.

**F8 – a catalog server without credentials is skipped, not a failed run** (`extensionLibrary.ts`, `extensionProfileStore.ts`)
- At launch, the resolver now reads whether each catalog server's credentials are present in the environment now, rather than trusting the status saved with the library. A missing credential gives `secret_not_configured` and the server is skipped. This applies whether the server was auto-applied or added explicitly. The launch fence uses the same check.
- A catalog entry that is missing or whose digest changed is not skipped, so it is still refused as before. Capability mismatches are also still refused.
- The old test that expected `resolveLaunch` to throw now expects the skip. A new test runs `executeWithExtensions` and shows the run goes ahead without the server, and is still refused when the catalog identity is wrong.

**F9 – a failed migration no longer strips automation extensions** (`extensionLibraryMigration.ts`, `agentRunTrigger.ts`, `taskSubmissionService.ts`)
- **Readiness check:** the migration counts as finished once its completion marker is committed, or when the instance never set up profiles. Startup is unchanged and still never blocked.
- **New runs:** a definition that still has an untranslated profile selection makes `triggerAgentRun` retry the migration on the spot. If that succeeds, the run's snapshot gets the translated items. If it still fails, the trigger is refused with 409 `EXTENSIONS_MIGRATION_PENDING` and no run is created. A scheduled slot stays pending and is tried again on the next sweep. Automations without a legacy selection are not affected.
- **Runs queued before the upgrade:** runtime validation refuses a run whose snapshot still names its old profile, until the migration has translated it.
- **Queued legacy submissions:** a missing mapping retries the migration. If it still fails, the task fails with an explicit error instead of running with no extensions.
- New test file `test/extensionLibraryMigrationReadiness.test.ts` covers these cases.

**Choices to review:**
- I used 409, not 503, because the REST route turns any status of 500 or above into a generic "failed" message, which would hide the reason.
- Pre-upgrade runs are refused rather than held. Validation failure marks them failed, with the migration-pending reason. Making them wait instead would need retry handling added to both worker processors. Say if you want that.

**Checks:** the extension, migration, trigger, scheduler, cost-gate, run/action processor, submission and launch suites pass: 347 tests, 0 failures, 25 skipped because they need a Redis server. The four API suites pass (61 tests) and the UI suite passes (6 tests). The root, core, API and UI typechecks are clean, as is lint on the changed core and UI files; the shared package has no lint config, so its change isn't linted. I didn't run the full repository test suite.

**Found separately, not changed:** when an explicitly added item is skipped for a missing credential, the resolver also lists it a second time as an auto-apply skip. This already happened for HTTPS servers, so I made the new test tolerate it rather than fix it.

I made no previews: none of these fixes changes anything on screen.

PR: #3513
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 13, 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 13, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

The PR implements the instance extension library across storage, launch resolution, automation APIs, UI and documentation. It needs changes before merge because migration can discard configuration or restore extensions an owner explicitly removed.

✅ Scoped gateway grants — Grants persist the resolved server selection, and gateway reads filter the library snapshot to that selection.

✅ Revision protection — Library saves require the expected revision; launch fencing compares the items and bearer credentials actually used by the prepared run.

✅ Focused regression coverage — Added tests cover resolution limits, credential custody, stale administration, launch fencing and migration retries.

The supplied checks show 32 passed, none failed and two pending. This review uses static analysis only; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F10: 🔴 Migration permanently drops items exceeding capacity

  • Required behavior: Migration must preserve existing extension selections rather than permanently discard valid configuration when combining profiles.

  • Evidence: packages/core/src/extensions/extensionLibraryMigration.ts, candidate capacity checks, limit, and completion-marker persistence.

    1. An existing installation has five valid profiles containing eight distinct servers each. The former store limits individual profiles, but does not impose the new instance-wide 32-server limit.
    2. Migration copies the first 32 servers and skips the remaining eight.
    3. It filters those skipped names out of the legacy mappings and automation selections, then commits the completion marker.
    4. Affected automations now run without their selected servers. Subsequent migration attempts immediately return because migration is marked complete.

    The same problem affects more than 32 distinct skill bundles. Separately, limit(...).slice(0, max) silently drops repositories or agents when merged scopes exceed 64 entries. Logging warnings and retaining legacy tables do not preserve operational selections or provide an automatic retry path. static trace: the capacity branches, mapping filters and completion-marker transaction demonstrate this loss; no test was executed.

  • Minimum fix: Detect item and merged-scope overflow before committing translated selections. Leave migration incomplete with an actionable diagnostic, or preserve overflow through an explicit supported migration mechanism; do not mark a lossy migration complete.

F11: 🔴 Clearing extensions can resurrect the legacy selection

  • Required behavior: An explicitly saved removal of automation extensions must remain removed across migration and retry.

  • Evidence: packages/core/src/services/agents/agentDefinitionStore.ts, patchToRowChanges; packages/shared/src/extensionLibrary.ts, serializeAutomationExtensions; packages/core/src/extensions/extensionLibraryMigration.ts, automation translation.

    1. Startup migration fails and startup continues, leaving an automation with extension_profile populated and extensions null.
    2. Its owner submits extensions: null or empty arrays. The API accepts removal, and serializeAutomationExtensions stores null without clearing extension_profile.
    3. A later startup or trigger retries migration successfully.
    4. Migration selects that automation through whereNotNull('extension_profile').whereNull('extensions') and restores the old profile’s items.

    The saved removal is therefore undone, potentially restoring tool access. Runtime validation does not prevent this: the row mapper exposes empty extensions and omits the legacy selection, while migration cannot distinguish an explicit clear from an untranslated row. static trace: traced the update serialization and migration predicates in the supplied diff.

  • Minimum fix: Persist explicit clears distinctly from untranslated rows, for example as an empty JSON selection, or clear the legacy selection atomically whenever the new extensions field is explicitly written.

F12: 🔴 Migration completion can leave a trigger using stale extensions

  • Required behavior: A newly created run must capture the translated legacy selection once migration completes.

  • Evidence: packages/core/src/services/agents/agentRunTrigger.ts, withMigratedLegacyExtensions; packages/core/src/extensions/extensionLibraryMigration.ts, legacyAutomationExtensionsPending.

    1. After a failed startup migration, a trigger caller reads a legacy automation. rowToAgentDefinition maps its null extensions column to empty arrays.
    2. Before withMigratedLegacyExtensions finishes its awaited database inspection, another process successfully commits migration, populating the definition’s extensions and completion marker.
    3. legacyAutomationExtensionsPending returns false because the stored row is now translated or migration is settled.
    4. withMigratedLegacyExtensions returns the original, stale definition unchanged. The trigger creates a run snapshot with empty explicit extensions; migrated items have autoApply: false, so that run loses them.

    The migration transaction protects database writes, but does not refresh a definition already held by the trigger caller. The reload currently occurs only when the pending check returns true. static trace: traced the early return and conditional reload; this interleaving was not executed.

  • Minimum fix: Resolve legacy translation and obtain the corresponding persisted extension selection before snapshot creation, including when another process completed migration after the caller loaded the definition.

Suggestions

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

S2: 🟢 Align generated permission descriptions

The generated AutomationExtensions description says setting or changing extensions requires instance.manage_settings, while the implementation and feature documentation permit removals without it. Clarifying that only additions require this permission would help client authors; this wording mismatch does not block the implemented removal behavior.

Score

The core library and launch changes have substantial targeted coverage, but migration still has configuration-loss and stale-state defects that require correction. Current checks show no failures, with two still pending.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 56s
  • Tokens: 186,257 (183,961 in / 2,296 out)
  • Cost: $1.82

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 F10 F11 F12 S2

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 1a13d19

Addressed 1 AI review comment (IDs: 6842146653)

Addressed findings F10, F11, F12

Summary of Changes

I fixed F10, F11 and F12, and each has a regression test. Every new test fails against the original code and passes with the fixes.

F10: migration dropped items that didn't fit (extensionLibraryMigration.ts)

  • The migration now finds every item that doesn't fit before it writes anything:
    • servers beyond the 32 the library holds (counting items already in it).
    • skill bundles beyond 32.
    • any server or bundle whose combined repository or agent limits are longer than 64.
  • Before, these were skipped or cut short with limit(...).slice(...). Now any overflow throws an error, so the whole transaction rolls back, including the completion marker.
  • Nothing is committed, so automations keep their untranslated selection and stay refused with 409 instead of running without their servers. The migration retries at the next start.
  • The startup log lists the items that don't fit and says how to fix it: remove library items in Settings, or retire unused profiles by setting extension_profiles.deleted, then restart. The upgrade section of agent-extensions.md now describes this.
  • Tests: 5×8 servers, 33 skill bundles, and combined limits of 80 repositories. The first test also checks that the migration completes once a profile is retired.

F11: a saved removal could come back after migration (serializeAutomationExtensions in packages/shared/src/extensionLibrary.ts)

  • Any value written to extensions, including null or empty lists, is now stored as JSON. Only a missing value stays SQL NULL.
  • Every migration and pending check looks for rows where extensions is NULL, so a saved clear is no longer treated as an untranslated row. It survives later migrations, and a still-failing migration no longer holds that automation back.
  • Tests cover clearing with null and with empty lists, followed by a successful migration and a trigger.

F12: a trigger could use a stale definition (withMigratedLegacyExtensions in agentRunTrigger.ts)

  • When the stored row has a profile selection, the trigger now always takes the saved extensions from the database, not the copy the caller holds.
  • If that saved value is still NULL, it retries the migration and reads the row again, or refuses with 409 as before.
  • Test: the definition is read, another process completes the migration, then the trigger runs with the stale copy. The run now gets docs.

Same defect in the run processors: validateAgentDefinitionRuntime had the same stale-read gap for run snapshots saved before the upgrade. If the migration finished after a processor read the run, the check passed and the snapshot launched with no extensions. Now, once the migration is complete, the processor's copy of the snapshot gets the same translation the migration saved (from extension_legacy_profile_items). I extended the existing snapshot test to check this.

Verification:

  • The migration suite (13 tests) and the readiness suite (8) pass, as do agentDefinitionRoutes (28), mcpAgentRuns (16) and extensionProfiles (44).
  • Shared and core typechecks pass, and core ESLint is clean on the changed source files. agentRunTrigger.ts is now 399 lines, just under the 400-line limit.

Separate issue, not changed: the migration still skips, with only a warning, a server whose stored descriptor fails validation, or a bundle whose data is missing. It still marks the migration complete afterwards. That's a different cause from the capacity loss in F10, so I left it out of scope.

No previews: none of this changes anything visible.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (medium)
  • Requested By: @propr-ultrafix
  • Time: 11m 27s
  • Tokens: 4,048,002 (4,021,387 in / 26,615 out)
  • Cost: $1.85

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…very new test fails against the original code and passes with the fixes.

I fixed F10, F11 and F12, and each has a regression test. Every new test fails against the original code and passes with the fixes.

**F10: migration dropped items that didn't fit** (`extensionLibraryMigration.ts`)
- The migration now finds every item that doesn't fit before it writes anything:
  - servers beyond the 32 the library holds (counting items already in it).
  - skill bundles beyond 32.
  - any server or bundle whose combined repository or agent limits are longer than 64.
- Before, these were skipped or cut short with `limit(...).slice(...)`. Now any overflow throws an error, so the whole transaction rolls back, including the completion marker.
- Nothing is committed, so automations keep their untranslated selection and stay refused with 409 instead of running without their servers. The migration retries at the next start.
- The startup log lists the items that don't fit and says how to fix it: remove library items in Settings, or retire unused profiles by setting `extension_profiles.deleted`, then restart. The upgrade section of `agent-extensions.md` now describes this.
- Tests: 5×8 servers, 33 skill bundles, and combined limits of 80 repositories. The first test also checks that the migration completes once a profile is retired.

**F11: a saved removal could come back after migration** (`serializeAutomationExtensions` in `packages/shared/src/extensionLibrary.ts`)
- Any value written to `extensions`, including `null` or empty lists, is now stored as JSON. Only a missing value stays SQL NULL.
- Every migration and pending check looks for rows where `extensions` is NULL, so a saved clear is no longer treated as an untranslated row. It survives later migrations, and a still-failing migration no longer holds that automation back.
- Tests cover clearing with `null` and with empty lists, followed by a successful migration and a trigger.

**F12: a trigger could use a stale definition** (`withMigratedLegacyExtensions` in `agentRunTrigger.ts`)
- When the stored row has a profile selection, the trigger now always takes the saved `extensions` from the database, not the copy the caller holds.
- If that saved value is still NULL, it retries the migration and reads the row again, or refuses with 409 as before.
- Test: the definition is read, another process completes the migration, then the trigger runs with the stale copy. The run now gets `docs`.

**Same defect in the run processors:** `validateAgentDefinitionRuntime` had the same stale-read gap for run snapshots saved before the upgrade. If the migration finished after a processor read the run, the check passed and the snapshot launched with no extensions. Now, once the migration is complete, the processor's copy of the snapshot gets the same translation the migration saved (from `extension_legacy_profile_items`). I extended the existing snapshot test to check this.

**Verification:**
- The migration suite (13 tests) and the readiness suite (8) pass, as do `agentDefinitionRoutes` (28), `mcpAgentRuns` (16) and `extensionProfiles` (44).
- Shared and core typechecks pass, and core ESLint is clean on the changed source files. `agentRunTrigger.ts` is now 399 lines, just under the 400-line limit.

**Separate issue, not changed:** the migration still skips, with only a warning, a server whose stored descriptor fails validation, or a bundle whose data is missing. It still marks the migration complete afterwards. That's a different cause from the capacity loss in F10, so I left it out of scope.

No previews: none of this changes anything visible.

PR: #3513
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 13, 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 13, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

This PR replaces profiles with a shared extension library and carries the change through launch resolution, administration, automation configuration, and documentation. It needs changes before merge: queued legacy submissions can acquire a different extension selection, and existing submission retries lose compatibility.

✅ Bounded resolution — Explicit items receive priority over automatic items, with deterministic ordering and recorded omissions.

✅ Narrow gateway grants — Library grants persist the resolved server names, and gateway reads filter the revision to that selection.

✅ Transactional migration — Capacity failures roll back the library, mappings, and completion marker together.

Review was static; no commands or tests were run. No current-head check runs were reported.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F13: 🔴 Preserve queued submissions’ authorized revision

  • Required behavior: Queued legacy submissions must retain their authorized extensions for the exact initial task; migration must not substitute a different profile revision’s capabilities.

  • Evidence: packages/core/src/services/taskSubmissionService.ts:submissionExtensionsForRun and packages/core/src/extensions/extensionLibraryMigration.ts:migrateExtensionProfilesToLibrary.

    1. A submission is queued with a sealed selection of profile P, revision 1, and explicit write authorization.
    2. Before upgrade, an administrator saves revision 2 of P, adding a different write server. The queued submission still contains revision 1.
    3. Migration joins profiles to their current revision and creates a mapping keyed only by profile_id, containing revision 2’s servers.
    4. submissionExtensionsForRun validates the original sealed payload, then looks up only payload.extensionProfile.profileId. It returns revision 2’s server names with the submission’s original write authorization.
    5. The initial task can therefore receive the newly added write server even though its authenticated selection never included it.

    The payload digest proves that revision 1 was authorized, but the mapping discards that revision before resolution. Previously, the launch check rejected a superseded selection. static trace: verified from the migration join, mapping schema, submission lookup, and removed assertLaunch path.

  • Minimum fix: Preserve revision identity when translating queued submissions. Map the selected revision’s items explicitly, or refuse superseded selections rather than substituting the current profile’s items.

F14: 🔴 Keep existing submission replays compatible

  • Required behavior: An already accepted submission must remain recoverable under its original idempotency key across this upgrade; rejecting new profile selections must not reject existing requests.

  • Evidence: packages/api/routes/taskSubmissionRoutes.ts:createTaskSubmissionRoutes and propr-ui/src/api/taskSubmissions.ts:submitTask.

    1. Before upgrade, a client submits a task containing extensionProfile. The server persists its row and payload hash, but the response is lost.
    2. After upgrade, the client retries the same request with the same idempotency key.
    3. The new unconditional body.extensionProfile rejection executes before the existing submission lookup, returning 400 instead of the existing receipt.
    4. Through the updated UI API helper, the same replay instead has extensionProfile and extensionAllowWrite stripped. Its newly computed hash differs from the stored hash, so the server returns 409.

    Both replay paths fail despite the durable submission already existing; starting over with another key risks creating duplicate work. The existing idempotency lookup cannot protect the original replay because rejection precedes it, and cannot recognize the stripped replay because its identity changed. static trace: verified against the changed rejection order, fingerprint expression, and client field filtering.

  • Minimum fix: Recognize and validate existing submissions before rejecting legacy fields on new submissions. Preserve the original identity for retries, or have the client recover the existing receipt by key without resubmitting a modified payload.

Suggestions

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

No suggestions.

Score

The implementation has substantial targeted coverage and sound resolution and grant boundaries, but the two upgrade regressions require correction. Current-head checks have not independently confirmed the reported validation.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 37s
  • Tokens: 189,308 (187,365 in / 1,943 out)
  • Cost: $1.86

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 F13 F14

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit df9fd65

Addressed 1 AI review comment (IDs: 6842372737)

Addressed findings F13, F14

Summary of Changes

I fixed F13 and F14, and each has regression tests. I ran the new tests against the original source files: they fail there and pass with the fixes.

F13: queued submissions keep the revision they were authorized for

  • The legacy mapping now records which profile revision its items came from. I added a revision column in 20261113000000_extension_library.js, plus an alterTable for databases that already created the table. A mapping with no recorded revision matches no selection.
  • submissionExtensionsForRun now refuses the task if the submission's sealed selection names a different revision than the one migrated. The error says the revision was superseded and asks the user to submit again. This is what the old launch check did.
  • Same defect in two related paths, also fixed: the migration gave the current revision's items to automation definitions and to queued automation run snapshots, even when they had selected an older revision. The old code rejected those launches too.
    • These now get no items and a warning saying the selection was a superseded revision. This is how the migration already treats an unavailable profile.
    • The same applies to the launch-time lookup for run snapshots read before the migration finished.
    • Unlike submissions, these are not refused, so such an automation now runs without extensions instead of failing.
  • I added a line to the upgrade section of agent-extensions.md explaining this.

F14: retrying an existing submission still works after the upgrade

  • Server: the rejection of extensionProfile now comes after the lookup by idempotency key.
    • An exact retry of a submission accepted before the upgrade gets its receipt back. It still needs the preflight header and a durable administrator, as before, because a retry can still seal the submission's extension authority.
    • A modified payload under the same key still gets 409, and a new key with a profile selection still gets 400.
  • UI (submitTask): when a restored draft still has the old fields, the client first resumes by key through the existing /retry endpoint. It only sends a new submission without those fields if that returns 404. This works whether the stored submission was created with or without the selection. Other errors are shown and never turn into a new submission.

Verification

  • Five server suites pass: the API submission routes, the core migration tests, extension profiles, the extension launch integration, and migration readiness.
  • The UI submission-helper and New Task page tests pass (23).
  • Typechecks for core, API (after rebuilding core) and UI are clean. Lint passes with zero warnings on all changed files.
  • I updated the existing tests and fixture that write the mapping, so they now include its revision.
  • I didn't create a preview because nothing visible changed.

Found along the way, not changed:

  • The submission route reports every 403 as "Repository not found or not accessible" (404). That includes a retry refused because the header is missing or the user isn't an administrator. The old code behaved the same way, and the new test checks for the 404.
  • The /retry route never seals a legacy submission's extension authority. So in the rare case where the old server saved a submission but crashed before sealing it, resuming through the UI gives that task no extensions. An exact POST retry does seal it.

🤖 Implementation Details

  • Model: Claude Opus 5.5 (high)
  • Requested By: @propr-ultrafix
  • Time: 14m 1s
  • Tokens: 6,703,403 (6,664,816 in / 38,587 out)
  • Cost: $2.79
  • Subscription usage: Weekly +1%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…he new tests against the original source files: they fail there and pass with the fixes.

I fixed F13 and F14, and each has regression tests. I ran the new tests against the original source files: they fail there and pass with the fixes.

**F13: queued submissions keep the revision they were authorized for**
- The legacy mapping now records which profile revision its items came from. I added a `revision` column in `20261113000000_extension_library.js`, plus an `alterTable` for databases that already created the table. A mapping with no recorded revision matches no selection.
- `submissionExtensionsForRun` now refuses the task if the submission's sealed selection names a different revision than the one migrated. The error says the revision was superseded and asks the user to submit again. This is what the old launch check did.
- **Same defect in two related paths, also fixed:** the migration gave the current revision's items to automation definitions and to queued automation run snapshots, even when they had selected an older revision. The old code rejected those launches too.
  - These now get no items and a warning saying the selection was a superseded revision. This is how the migration already treats an unavailable profile.
  - The same applies to the launch-time lookup for run snapshots read before the migration finished.
  - Unlike submissions, these are not refused, so such an automation now runs without extensions instead of failing.
- I added a line to the upgrade section of `agent-extensions.md` explaining this.

**F14: retrying an existing submission still works after the upgrade**
- **Server:** the rejection of `extensionProfile` now comes after the lookup by idempotency key.
  - An exact retry of a submission accepted before the upgrade gets its receipt back. It still needs the preflight header and a durable administrator, as before, because a retry can still seal the submission's extension authority.
  - A modified payload under the same key still gets 409, and a new key with a profile selection still gets 400.
- **UI (`submitTask`):** when a restored draft still has the old fields, the client first resumes by key through the existing `/retry` endpoint. It only sends a new submission without those fields if that returns 404. This works whether the stored submission was created with or without the selection. Other errors are shown and never turn into a new submission.

**Verification**
- Five server suites pass: the API submission routes, the core migration tests, extension profiles, the extension launch integration, and migration readiness.
- The UI submission-helper and New Task page tests pass (23).
- Typechecks for core, API (after rebuilding core) and UI are clean. Lint passes with zero warnings on all changed files.
- I updated the existing tests and fixture that write the mapping, so they now include its revision.
- I didn't create a preview because nothing visible changed.

**Found along the way, not changed:**
- The submission route reports every 403 as "Repository not found or not accessible" (404). That includes a retry refused because the header is missing or the user isn't an administrator. The old code behaved the same way, and the new test checks for the 404.
- The `/retry` route never seals a legacy submission's extension authority. So in the rare case where the old server saved a submission but crashed before sealing it, resuming through the UI gives that task no extensions. An exact POST retry does seal it.

PR: #3513
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 13, 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 13, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

The PR replaces extension profiles with an instance library and carries the change through launch resolution, migration, APIs, UI, and documentation. It needs changes before merge because automation saves can race library removal and persist references to deleted items.

✅ Bounded resolution — The shared resolver prioritizes explicit items, sorts results deterministically, and reports skipped and omitted items.

✅ Restricted run grants — Library gateway grants persist the resolved selection and expose only those servers.

✅ Migration recovery — Migration writes are transactional, preserve legacy tables, and refuse capacity overflow without committing partial data.

The supplied current checks show 34 passed, none failed, and one pending. This review used static inspection only; no commands were run.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F15: 🔴 Fence automation additions against library removal

  • Required behavior: Every explicitly added item must exist when an automation is saved, and library removal must refuse items referenced by automations.

  • Evidence: packages/api/routes/automationDefinitionRoutes.ts, authorizeAutomationExtensions, create and update handlers; packages/core/src/extensions/extensionProfileStore.ts, assertItemsExist and refuseReferencedRemoval; packages/core/src/services/agents/agentDefinitionStore.ts, definition persistence.

    1. An administrator creates an automation adding docs, or updates an existing automation to add it. authorizeAutomationExtensions successfully checks the current library.
    2. The request awaits subsequent runtime or repository validation before persisting the definition.
    3. During that window, another administrator removes docs. The removal transaction queries persisted automation references; the pending addition is not stored yet, so removal succeeds.
    4. The original request persists its already-validated extensions and succeeds. Its next run skips docs as not_found, silently losing the tool the administrator just selected.

    The library revision fence protects library writes only. The existence check and automation write do not share a transaction or revision fence, and the definition persistence changes shown here do not recheck library membership. Both creation and addition through update expose this window. static trace: verified from the separate existence check, intervening awaited validation, definition writes, and removal transaction in the supplied diff. proposed regression: pause an automation save after existence validation, remove its selected server, then resume and assert that both operations cannot succeed with a dangling reference.

  • Minimum fix: Recheck added-item existence within the transaction that persists the automation, serialized against library removal. Apply this to both creation and updates that add items, while retaining the existing permission and preflight checks.

Suggestions

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

S3: 🟢 Preserve optional input defaults

The generated ExtensionLibraryInput types and OpenAPI required lists make repositories, agents, and autoApply mandatory, although the runtime schema supplies defaults. Generate these request contracts from the schema’s input shape so clients can use those defaults. This is optional because clients supplying all fields continue to work correctly.

Score

The implementation has substantial coverage and useful migration safeguards, but the cross-resource save race needs correction. Passing checks do not cover the demonstrated interleaving.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 28s
  • Tokens: 194,482 (192,953 in / 1,529 out)
  • Cost: $1.87

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 F15 S3

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit be2df91

Addressed 1 AI review comment (IDs: 6842989362)

Addressed finding F15

Summary of Changes

I fixed F15: an automation can no longer be saved with a library item that was removed while the save was in progress. On both create and update, the item check now runs again inside the same database transaction that writes the automation.

How it works

  • New store method (ExtensionLibraryStore.assertAdditionInTransaction in extensionProfileStore.ts): it first takes the library's write lock with a do-nothing update of the library row. Then, inside the automation's transaction, it checks again that the actor is still an administrator and that every added item exists. assertItemsExist can now read through a transaction.
  • Why this closes the gap: a library save already checks which automations use an item, inside its own transaction. SQLite lets only one write transaction run at a time, so the two now happen one after the other. Either the removal sees the new reference and is refused, or the removal commits first and the automation save is refused with "items not found". Both can't succeed.
  • Definition store (agentDefinitionStore.ts): createAgentDefinition and updateAgentDefinition take an optional guard. When one is given, the update reads the row, runs the guard and writes the row in one transaction. The guard gets the row as stored at that moment. Calls without a guard behave as before.
  • Routes (automationDefinitionRoutes.ts): create and update pass the guard, and the existing header, permission and existence checks are all kept. On update, the guard works out which items are being added by comparing the request with the row read inside the transaction, not with the one read earlier. Removal-only updates still need no administrator.

Related problem I also closed: the update decided whether the request adds items from a copy of the automation read before the slow validation step. If the automation changed in that window, a non-administrator resending an old item list could add an item back without the administrator check. The update now refuses that with a 409. This is the same window and the same added items, so I fixed it here rather than leaving it.

Tests (in packages/api/test/agentDefinitionRoutes.test.ts)

  • Removal lands first: the save is paused after its first check, the item is removed, then the save resumes. On create and update, the save is now refused (400) and no automation is left pointing at the removed item.
  • Save takes the lock first: a removal that starts while the automation save holds the lock is refused with "Automations add these extensions explicitly".
  • Automation changed under a non-admin update: the item is removed from the automation while the update is paused, and the update is then refused (409).

All three fail against the original code: 201 with a dangling item, no lock taken, and 200. With the fix, the full route suite (31 tests) passes, as do the definition store, contract, extension store and launch suites (81 tests). Core and API typechecks are clean, and lint with zero warnings is clean on the changed files.

To run the API tests yourself, rebuild packages/core first: the routes load @propr/core from its built output, not the source.

There are no visible UI changes, so no previews were made.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (high)
  • Requested By: @propr-ultrafix
  • Time: 17m 52s
  • Tokens: 3,524,399 (3,496,295 in / 28,104 out)
  • Cost: $1.77
  • Subscription usage: Weekly +1%

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…brary item that was removed while the save was in progress. On both create and update, the item check now runs again inside the same database transaction that writes the automation.

I fixed F15: an automation can no longer be saved with a library item that was removed while the save was in progress. On both create and update, the item check now runs again inside the same database transaction that writes the automation.

**How it works**
- **New store method** (`ExtensionLibraryStore.assertAdditionInTransaction` in `extensionProfileStore.ts`): it first takes the library's write lock with a do-nothing update of the library row. Then, inside the automation's transaction, it checks again that the actor is still an administrator and that every added item exists. `assertItemsExist` can now read through a transaction.
- **Why this closes the gap:** a library save already checks which automations use an item, inside its own transaction. SQLite lets only one write transaction run at a time, so the two now happen one after the other. Either the removal sees the new reference and is refused, or the removal commits first and the automation save is refused with "items not found". Both can't succeed.
- **Definition store** (`agentDefinitionStore.ts`): `createAgentDefinition` and `updateAgentDefinition` take an optional `guard`. When one is given, the update reads the row, runs the guard and writes the row in one transaction. The guard gets the row as stored at that moment. Calls without a guard behave as before.
- **Routes** (`automationDefinitionRoutes.ts`): create and update pass the guard, and the existing header, permission and existence checks are all kept. On update, the guard works out which items are being added by comparing the request with the row read inside the transaction, not with the one read earlier. Removal-only updates still need no administrator.

**Related problem I also closed:** the update decided whether the request adds items from a copy of the automation read before the slow validation step. If the automation changed in that window, a non-administrator resending an old item list could add an item back without the administrator check. The update now refuses that with a 409. This is the same window and the same added items, so I fixed it here rather than leaving it.

**Tests** (in `packages/api/test/agentDefinitionRoutes.test.ts`)
- **Removal lands first:** the save is paused after its first check, the item is removed, then the save resumes. On create and update, the save is now refused (400) and no automation is left pointing at the removed item.
- **Save takes the lock first:** a removal that starts while the automation save holds the lock is refused with "Automations add these extensions explicitly".
- **Automation changed under a non-admin update:** the item is removed from the automation while the update is paused, and the update is then refused (409).

All three fail against the original code: 201 with a dangling item, no lock taken, and 200. With the fix, the full route suite (31 tests) passes, as do the definition store, contract, extension store and launch suites (81 tests). Core and API typechecks are clean, and lint with zero warnings is clean on the changed files.

To run the API tests yourself, rebuild `packages/core` first: the routes load `@propr/core` from its built output, not the source.

There are no visible UI changes, so no previews were made.

PR: #3513
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 13, 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 13, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

The PR implements the instance-wide extension library across storage, launch resolution, automation APIs, UI and migration. It needs a localized migration correction before merge.

✅ Bounded run authority — New gateway grants persist the resolved selection and expose only those servers.

✅ Concurrent edit protection — Library saves require the loaded revision, and automation additions recheck authorization and item existence inside the write transaction.

This review used static tracing of the supplied code; no commands or tests were run. Current checks show 29 passed, five pending and no failures.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F16: 🔴 Deduplicate merged servers in migrated selections

  • Required behavior: Migrated automation selections must remain valid under the new extensions contract, which explicitly rejects duplicate server names.

  • Evidence: packages/core/src/extensions/extensionLibraryMigration.ts, identity, items.servers.push(name) and automation translation; packages/shared/src/extensionLibrary.ts, automationExtensionsSchema.

    1. A valid legacy profile contains two uniquely named servers with identical endpoints, tools, capability, authentication and credentials. The old contract permits this because only server names must be unique.
    2. During migration, identity excludes the server name, so both descriptors merge into the same library item.
    3. Each iteration executes items.servers.push(name), producing a mapping such as servers: ['docs', 'docs']. Filtering through keptServers preserves both entries, and translation writes that duplicate selection into the automation.
    4. An administrator opens that automation and selects another extension. ExtensionItemsSelector.toggle preserves the existing duplicates while appending the new name. Saving is rejected by automationExtensionsSchema, preventing the ordinary extension edit.

    The migration transaction commits this invalid selection successfully because translation never validates or deduplicates it. Launch-time deduplication in resolveExtensionSet protects execution but does not repair the persisted definition or editor input. static trace: traced the valid legacy input through identity merging, persistence, selector updates and request validation. proposed regression: migrate two identical differently named servers within one profile, then verify the translated selection passes the automation schema and accepts another item.

  • Minimum fix: Deduplicate each profile’s mapped server names before persisting the legacy mapping and translating automation definitions and nonterminal run snapshots.

Suggestions

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

No suggestions.

Score

The implementation has substantial targeted coverage and useful authorization safeguards, but migration can persist selections that its own API rejects. Fix that defect and complete the pending checks before merging.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 12s
  • Tokens: 196,993 (195,606 in / 1,387 out)
  • Cost: $1.92

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 F16

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 90803ad

Addressed 1 AI review comment (IDs: 6843556508)

Addressed finding F16

Summary of Changes

I fixed F16: a migrated profile with two identical servers under different names now lists the merged library item only once, so the migrated automation still passes the extensions validation.

Fix (packages/core/src/extensions/extensionLibraryMigration.ts)

  • The server loop now adds a name to a profile's mapping only if it isn't already there. Before, two servers that merged into one item (say docs and docs-copy with the same endpoint, tools, capability, authentication and token) produced servers: ['docs', 'docs'].
  • The fix is applied before anything is saved. The saved legacy mapping, the translated automation definitions and the snapshots of nonterminal runs are all built from that per-profile mapping, so all three are now free of duplicates.
  • I added one sentence about this to the migration's doc comment.

Other places checked

  • Readers of the mapping: queued New Task submissions (legacyProfileExtensions), runs captured before the upgrade and read at launch (legacySnapshotExtensions), and the definition read at trigger time (storedLegacyDefinitionExtensions). All three only read what the migration saved, so the one fix covers them.
  • Skills: a skill bundle can't be listed twice. The old profile contract already rejected repeated bundle ids within a profile, and the mapping is built per profile.
  • Other writers of the automation extensions column: the only other path is the normal create/update, and it already validates against the automation schema. The migration was the one place that wrote without validating.

Regression test (packages/core/test/extensionLibraryMigration.test.ts)

  • Setup: one profile holds docs and an identical docs-copy, plus a different server search. An automation definition and a queued run both select that profile.
  • Library: after the migration it has exactly docs and search.
  • Selections: the saved legacy mapping, legacySnapshotExtensions, the translated definition and the run snapshot are all { servers: ['docs', 'search'], skills: [] }.
  • Editing: the definition and run selections pass validateAutomationDefinitionInput, and so does the definition with another server added. That added-server case is the edit that used to be rejected.

Verification

  • The new test fails against the original migration file and passes with the fix.
  • The whole migration suite passes (15/15), as does test/extensionLibraryMigrationReadiness.test.ts (8/8).
  • Lint on the changed core source file and the core typecheck are clean. The core lint config only covers src/, so the test file isn't linted, locally or in CI.

Found separately (not changed)

  • The migration runs once per instance. Any dev or test instance that already ran the earlier code on this branch keeps its duplicate entries; this fix doesn't repair them.
  • ExtensionItemsSelector.toggle in the UI keeps any duplicates already in a selection. With the migration fixed, valid data can't reach it with duplicates, so I left it as is.

This is a backend migration change with nothing visible in the UI, so I didn't make any previews.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (xhigh)
  • Requested By: @propr-ultrafix
  • Time: 6m 40s
  • Tokens: 2,582,754 (2,570,272 in / 12,482 out)
  • Cost: $1.16

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…under different names now lists the merged library item only once, so the migrated automation still passes the `extensions` validation.

I fixed F16: a migrated profile with two identical servers under different names now lists the merged library item only once, so the migrated automation still passes the `extensions` validation.

**Fix** (`packages/core/src/extensions/extensionLibraryMigration.ts`)
- The server loop now adds a name to a profile's mapping only if it isn't already there. Before, two servers that merged into one item (say `docs` and `docs-copy` with the same endpoint, tools, capability, authentication and token) produced `servers: ['docs', 'docs']`.
- The fix is applied before anything is saved. The saved legacy mapping, the translated automation definitions and the snapshots of nonterminal runs are all built from that per-profile mapping, so all three are now free of duplicates.
- I added one sentence about this to the migration's doc comment.

**Other places checked**
- **Readers of the mapping:** queued New Task submissions (`legacyProfileExtensions`), runs captured before the upgrade and read at launch (`legacySnapshotExtensions`), and the definition read at trigger time (`storedLegacyDefinitionExtensions`). All three only read what the migration saved, so the one fix covers them.
- **Skills:** a skill bundle can't be listed twice. The old profile contract already rejected repeated bundle ids within a profile, and the mapping is built per profile.
- **Other writers of the automation `extensions` column:** the only other path is the normal create/update, and it already validates against the automation schema. The migration was the one place that wrote without validating.

**Regression test** (`packages/core/test/extensionLibraryMigration.test.ts`)
- **Setup:** one profile holds `docs` and an identical `docs-copy`, plus a different server `search`. An automation definition and a queued run both select that profile.
- **Library:** after the migration it has exactly `docs` and `search`.
- **Selections:** the saved legacy mapping, `legacySnapshotExtensions`, the translated definition and the run snapshot are all `{ servers: ['docs', 'search'], skills: [] }`.
- **Editing:** the definition and run selections pass `validateAutomationDefinitionInput`, and so does the definition with another server added. That added-server case is the edit that used to be rejected.

**Verification**
- The new test fails against the original migration file and passes with the fix.
- The whole migration suite passes (15/15), as does `test/extensionLibraryMigrationReadiness.test.ts` (8/8).
- Lint on the changed core source file and the core typecheck are clean. The core lint config only covers `src/`, so the test file isn't linted, locally or in CI.

**Found separately (not changed)**
- The migration runs once per instance. Any dev or test instance that already ran the earlier code on this branch keeps its duplicate entries; this fix doesn't repair them.
- `ExtensionItemsSelector.toggle` in the UI keeps any duplicates already in a selection. With the migration fixed, valid data can't reach it with duplicates, so I left it as is.

This is a backend migration change with nothing visible in the UI, so I didn't make any previews.

PR: #3513
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 13, 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 13, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

The PR implements the instance-wide library across storage, launch resolution, automation APIs, UI, migration, and documentation. It needs a targeted correction before merge.

✅ Bounded resolution — Explicit items take precedence over automatic items, with deterministic ordering and recorded omissions.

✅ Scoped gateway grants — New grants persist the resolved server names, and gateway reads filter the revision to that selection.

✅ Migration rollback — Capacity overflow aborts the migration transaction without committing a completion marker or partial automation mappings.

This was a static review of the supplied code; no commands were run. The authoritative checks show no failures and two pending checks.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F17: 🔴 Keep disabling independent of credential decryption

  • Required behavior: Disabling an item must remain available without changing its configuration or credential, including when an automation explicitly references it.

  • Evidence: packages/core/src/extensions/extensionProfileStore.ts, setItemEnabled, writeRevision, and resolveLaunch.

    1. Save an enabled operator-catalog stdio server and reference it from an automation. The library revision seals its credential map using the configured encryption root, even when that map is empty.
    2. Restore the raw database under a different encryption root, keeping the operator catalog and its environment credentials configured. This recovery condition is explicitly discussed in the changed documentation.
    3. The automation can still launch that stdio server: resolution reads the catalog credentials from the environment; grant creation does not decrypt library credentials; and assertPreparedLaunch returns immediately when the revision is unchanged.
    4. An administrator attempts to disable the server. setItemEnabled calls this.unseal(head) before writing the disabled revision, which throws because the root changed. The enabled item remains available to subsequent runs.

    Authorization and transactions do not prevent this failure: the authorized disable rolls back because it unnecessarily depends on decrypting the entire library credential map. Removing the referenced item is also refused, and ordinary library saves require the same decryption. Unlike the former profile deletion operation, the new management surface has no credential-independent revocation path.

    static trace: Followed the supplied toggle, revision-writing, catalog-resolution, grant-creation, and launch-fence implementations against the supplied privateSecrets.ts behavior. This scenario was not executed.

  • Minimum fix: Provide a credential-independent disable path that the resolver and pending-launch fence honor, while retaining the existing encrypted credential material for recovery. Add a regression covering an enabled catalog item under an unavailable library encryption root.

Suggestions

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

S4: 🟢 Cover synthetic pool network scope

The new launchCarriesExtensions predicate recognizes only an outer agent configuration whose type is claude or codex, while the documentation permits synthetic pools. Add an integration test showing that a pool dispatching to an extension-capable member preserves the instance network policy during extension preparation. The supplied excerpts do not establish how the pool exposes its configuration or propagates that policy, so this is a verification follow-up rather than a demonstrated blocker.

Score

The implementation has substantial coverage and careful grant scoping, but the demonstrated inability to disable a still-usable catalog item needs correction. Pending checks should also complete before merge.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 26s
  • Tokens: 197,118 (195,365 in / 1,753 out)
  • Cost: $1.93

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 F17 S4

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 595f348

Addressed 1 AI review comment (IDs: 6844055650)

Addressed finding F17

Summary of Changes

I fixed F17: an administrator can now disable a library item even when the library's credentials can't be decrypted, for example after a raw restore under a different encryption root. The new tests pass and fail against the original code. 168 core tests and 17 API/launch tests pass, and lint and typecheck are clean.

The fix (packages/core/src/extensions/extensionProfileStore.ts)

  • Toggle: setItemEnabled no longer decrypts anything. The new revision keeps the previous revision's encrypted credentials byte for byte, stored as <sealing revision>:<sealed>, along with the earlier secret statuses. Restoring the matching root makes them readable again. As a guard, credentials carried over this way must stay with the same Bearer servers and URLs.
  • Every reader understands that format: the store's internal unseal (used by saves, secret replacement, validation and the fence), the gateway's grant read (grantSnapshot), and the startup migration when it merges into an existing library.
  • Resolver: it never decrypted, so it already treats the item as disabled.
  • Pending-launch fence: it already refused a launch whose item was disabled before comparing credentials. I added a shortcut: when both revisions hold the same encrypted bytes, it skips decryption. So toggling an unrelated item doesn't block a pending launch, even under a different root.

Decisions for you

  • Enabling also skips decryption now, because the toggle is a single code path. Before, it failed under a different root. Say if you want enabling to keep requiring the matching root.
  • Weaker credential binding: encrypted credentials were bound to one exact revision. Carried ones are bound to the earlier revision that encrypted them, so someone with database write access could copy them into a later revision. That person can already edit the unauthenticated snapshot, so I don't think this adds real exposure. Still, it changes what the binding guarantees.

Tests

  • Store test: a catalog stdio item an automation adds, restored under another root. It covers:

    • the item still launches.
    • disabling succeeds.
    • the resolver skips the item as disabled.
    • the fence refuses that item's pending launch.
    • a pending launch using only an untouched Bearer item still activates.

    Back under the original root, the credentials are read correctly by validation, a new run's grant and a later save.

  • Migration test: a library disabled by a toggle before a retried migration keeps its credentials.

Docs: agent-extensions.md now says toggling never decrypts credentials and lists what still needs the matching root.

Not fixed (outside F17): saving the library, replacing or clearing a secret, removing an item no automation uses, and validation still need the matching root. They rewrite or read the decrypted credentials.

There's no visual preview because nothing in the UI changed. I also corrected a memory note: core's lint covers only src/, not its tests.


🤖 Implementation Details

  • Model: Claude Opus 5.5 (xhigh)
  • Requested By: @propr-ultrafix
  • Time: 13m 39s
  • Tokens: 5,793,270 (5,744,682 in / 48,588 out)
  • Cost: $2.87

View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Address review blockers, or blockers and suggestions with /fix all /fix, /fix all, or /fix F3 S5
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR

…m even when the library's credentials can't be decrypted, for example after a raw restore under a different encryption root. The new tests pass and fail against the original code. 168 core tests and 17 API/launch tests pass, and lint and typecheck are clean.

I fixed F17: an administrator can now disable a library item even when the library's credentials can't be decrypted, for example after a raw restore under a different encryption root. The new tests pass and fail against the original code. 168 core tests and 17 API/launch tests pass, and lint and typecheck are clean.

**The fix** (`packages/core/src/extensions/extensionProfileStore.ts`)
- **Toggle:** `setItemEnabled` no longer decrypts anything. The new revision keeps the previous revision's encrypted credentials byte for byte, stored as `<sealing revision>:<sealed>`, along with the earlier secret statuses. Restoring the matching root makes them readable again. As a guard, credentials carried over this way must stay with the same Bearer servers and URLs.
- **Every reader understands that format:** the store's internal unseal (used by saves, secret replacement, validation and the fence), the gateway's grant read (`grantSnapshot`), and the startup migration when it merges into an existing library.
- **Resolver:** it never decrypted, so it already treats the item as disabled.
- **Pending-launch fence:** it already refused a launch whose item was disabled before comparing credentials. I added a shortcut: when both revisions hold the same encrypted bytes, it skips decryption. So toggling an unrelated item doesn't block a pending launch, even under a different root.

**Decisions for you**
- **Enabling** also skips decryption now, because the toggle is a single code path. Before, it failed under a different root. Say if you want enabling to keep requiring the matching root.
- **Weaker credential binding:** encrypted credentials were bound to one exact revision. Carried ones are bound to the earlier revision that encrypted them, so someone with database write access could copy them into a later revision. That person can already edit the unauthenticated snapshot, so I don't think this adds real exposure. Still, it changes what the binding guarantees.

**Tests**
- **Store test:** a catalog stdio item an automation adds, restored under another root. It covers:
  - the item still launches.
  - disabling succeeds.
  - the resolver skips the item as disabled.
  - the fence refuses that item's pending launch.
  - a pending launch using only an untouched Bearer item still activates.

  Back under the original root, the credentials are read correctly by validation, a new run's grant and a later save.
- **Migration test:** a library disabled by a toggle before a retried migration keeps its credentials.

**Docs:** `agent-extensions.md` now says toggling never decrypts credentials and lists what still needs the matching root.

**Not fixed (outside F17):** saving the library, replacing or clearing a secret, removing an item no automation uses, and validation still need the matching root. They rewrite or read the decrypted credentials.

There's no visual preview because nothing in the UI changed. I also corrected a memory note: core's lint covers only `src/`, not its tests.

PR: #3513
Comment by: @propr-ultrafix (ID: 0)
Model: Claude Opus 5.5
@propr-dev

propr-dev Bot commented Nov 13, 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 13, 2026

Copy link
Copy Markdown
Contributor Author

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

Overall Evaluation

The PR replaces extension profiles with an instance-wide library across persistence, automation launch, management APIs, UI, and migration. Based on the supplied code, it is merge-ready within the reviewed scope, conditional on the remaining checks passing.

✅ Restricted run grants — Gateway snapshots filter servers through the run’s persisted selection, preventing access to unrelated library servers.

✅ Concurrent edit protection — Library saves require an expected revision, and automation additions recheck item existence inside the definition-write transaction.

✅ Migration recovery — Migration failures roll back their completion marker, while untranslated legacy selections are prevented from silently launching without their extensions.

This was a static review; no commands or tests were run. The supplied status reports 30 passed checks, four pending, and no failures.

Merge blockers

No merge blockers.

Suggestions

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

S5: 🟢 Align permission contract wording

In packages/api/openapi/schemas.ts, the AutomationExtensions description says setting or changing extensions requires instance.manage_settings, while automationDefinitionRoutes.ts deliberately permits owners to remove items or repeat an unchanged selection. Update the description and generated artifacts to distinguish additions from removals. This is optional documentation alignment; the implementation and feature documentation already explain the intended authorization behavior.

Score

The implementation provides substantial coverage of migration, credential custody, launch fencing, and concurrent changes. No merge blocker was verified from the supplied diff; final readiness remains conditional on the pending checks.

Score: 8/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 1m 8s
  • Tokens: 198,212 (196,968 in / 1,244 out)
  • Cost: $1.90

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 S5

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 13, 2026
@integry
integry merged commit 4be6b37 into 3509-epic-extensions-library-14j Nov 13, 2026
50 checks passed
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.

1 participant