Skip to content
36 changes: 36 additions & 0 deletions .changeset/39058-setup-plugin-items-new-groups.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
'@objectstack/plugin-approvals': patch
'@objectstack/plugin-audit': patch
'@objectstack/plugin-auth': patch
'@objectstack/plugin-security': patch
'@objectstack/plugin-sharing': patch
'@objectstack/plugin-webhooks': patch
'@objectstack/service-messaging': patch
'@objectstack/service-knowledge': patch
'@objectstack/service-datasource': patch
'@objectstack/service-settings': patch
'@objectstack/cloud-connection': patch
'@objectstack/mcp': patch
---

Setup entries contributed by capability packages name the new group ids; the Approvals Inbox leaves Setup

Clause-②: no
Metadata-protocol: none

Setup's navigation was regrouped into ten groups (#39050). The entries these packages contribute now name the new group ids directly, so a boot carrying them draws no `nav_contribution_group_renamed` notice. Where a retired group was split, each entry names the group the regrouping put it in:

- **Access & Sharing:** Position Holders and Permission Set Assignment (`@objectstack/plugin-security`, formerly in People & Organization) after Positions and Permissions, then Sharing Rules and Record Shares (`@objectstack/plugin-sharing`).
- **Apps & AI:** Browse Marketplace (`@objectstack/cloud-connection`) right after Installed Apps; Knowledge and Knowledge Sync Status (`@objectstack/service-knowledge`) before AI Model Service; Connect an AI Assistant (`@objectstack/mcp`) last.
- **Routing & Approvals:** Requests, Action History and Delegations (`@objectstack/plugin-approvals`), then Assignment Rules, Queues and Queue Members (`@objectstack/plugin-sharing`). Moving these three does not change who sees them. Each already carries the `manage_platform_settings` gate that Routing & Approvals requires, so a Setup user without that permission was not shown them before and is not shown them now.
- **Audit & Data:** the Audit Log (`@objectstack/plugin-audit`) first.
- **Company Settings:** Branding (`@objectstack/service-settings`) first.
- **Notifications:** Notification Templates first and Notification Preferences after the email and SMS channels (`@objectstack/service-messaging`).
- **Login & Security:** SSO Providers and SCIM Credentials (`@objectstack/plugin-auth`), when wired.
- **Integrations & Developer:** Datasources (`@objectstack/service-datasource`), Cloud Connection (`@objectstack/cloud-connection`), Webhooks and HTTP Deliveries (`@objectstack/plugin-webhooks`), Slack (`@objectstack/service-messaging`).

Connect an AI Assistant keeps its Setup audience: it sat in a group gated on `manage_platform_settings`, and Apps & AI carries no gate, so the entry now carries that gate itself. A Setup user without `manage_platform_settings` still does not see it; everyone keeps the Account app's entry.

The Approvals Inbox entry (`nav_approvals_inbox`) is no longer in Setup. It opened the caller's own approval inbox, the page the personal app's inbox opens; Setup keeps the administrator's entries (Requests, Action History, Delegations). A request opened from Requests is its record page, where the decision is taken. The inbox's own address is unchanged.

No action needed: nothing an app author writes changes.
14 changes: 8 additions & 6 deletions packages/cli/test/connect-agent-both-halves-wire.pin.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,12 +259,12 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', (
const allowedIds = navIds(setupAllowed.body?.item);
expect(allowedIds).toContain('nav_connect_agent');
// [#39053] System Overview is Setup's pinned first entry, outside every
// group. `group_overview` retired with no successor group, so the MCP
// entry its bundle still aims there is relocated to the top level (with
// the missing-group diagnostic) until the bundle names its new group.
// group. [#39058] `group_overview` retired with no successor group; the
// MCP bundle now names `group_apps_ai`, so its entry is no longer
// relocated to the top level (read in the group below).
const topIds = ((setupAllowed.body?.item?.navigation ?? []) as AnyRec[]).map((n) => String(n?.id));
expect(topIds[0]).toBe('nav_system_overview');
expect(topIds).toContain('nav_connect_agent');
expect(topIds).not.toContain('nav_connect_agent');
// The Setup tree the platform admin is served BY THIS COMPOSITION:
// platform-objects' own contributions plus the MCP one. No total is
// pinned here: the entry count moves with ordinary development
Expand All @@ -276,8 +276,10 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', (
// and this harness composes platform-objects and the MCP bundle alone.
expect(allowedIds).toContain('nav_packages');
// Apps & AI as this composition serves it: Installed Apps, then AI
// Model Service (#39057).
expect(groupChildren(setupAllowed.body?.item, 'group_apps_ai')).toEqual(['nav_packages', 'nav_settings_ai']);
// Model Service (#39057), then Connect an AI Assistant, the MCP
// bundle's Setup half (#39058, priority 400 after the platform's 300).
expect(groupChildren(setupAllowed.body?.item, 'group_apps_ai'))
.toEqual(['nav_packages', 'nav_settings_ai', 'nav_connect_agent']);
expect(allowedIds).toContain('nav_public_forms');
// #37087 — the id is Setup's alone now: Studio's entry of the same id
// is retired with the console page it opened (`developer:public-forms`).
Expand Down
74 changes: 47 additions & 27 deletions packages/cli/test/setup-integrations-order.pin.test.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
//
// The MERGED-ORDER pin for Setup → Integrations.
// The MERGED-ORDER pin for Setup → Integrations & Developer.
//
// ---------------------------------------------------------------------------
// What this pins
// ---------------------------------------------------------------------------
// `SETUP_APP` declares `group_integrations_dev` as an empty anchor (ADR-0029 D7),
// answering for the retired `group_integrations` through `renamedFrom` (#39053);
// every entry in it is contributed at runtime by the package that owns the
// capability, and `SchemaRegistry.applyNavContributions` orders the
// contributions by their `priority`, lowest first. Today that reads:
// answering for the retired `group_integrations` through `renamedFrom` (#39053).
// The platform contributes its own entries at the group's edges (API Keys and
// OAuth Applications at 100, Public Forms at 500, `setup-nav.contributions.ts`);
// every entry between them is contributed at runtime by the package that owns
// the capability, and `SchemaRegistry.applyNavContributions` orders the
// contributions by their `priority`, lowest first. Since #39058 placed each
// contributor in the regrouped Setup, the capability entries read:
//
// Webhooks / HTTP Deliveries `@objectstack/plugin-webhooks`
// Datasources `@objectstack/service-datasource`
// Cloud Connection `@objectstack/cloud-connection`
// Webhooks / HTTP Deliveries `@objectstack/plugin-webhooks`
// Connector Credentials `@objectstack/service-automation`
// Connector Connections `@objectstack/service-automation` (same contribution)
// Slack `@objectstack/service-messaging` (with connector-slack composed)
// Cloud Connection `@objectstack/cloud-connection`
//
// Each contributor states the group's other priorities in its own header so
// that its number sorts where it means to — and nothing held those headers to
Expand All @@ -28,10 +31,17 @@
// had moved, as long as nobody re-ran the arithmetic. What the file does state
// is the ORDER of the ids, which is the user-visible fact under protection.
//
// The first two contributors share one priority, so the fold's stable sort
// leaves their relative order to registration order, which belongs to the
// composition root's plugin list and not to any priority. That tier is pinned
// as a set; every tier boundary is pinned as an order.
// Each contributor holds a priority of its own, so every tier boundary is
// pinned as an order. Inside a tier (one contribution's items) the ids are
// compared as a set, as before #39058, when two contributors shared one
// priority and the fold's stable sort left them to registration order.
//
// The contributions are matched by the group they NAME, read as the served
// anchor or one of its `renamedFrom` ids off `SETUP_APP`: `service-automation`
// still names the retired `group_integrations` until its own one-line move
// (#39058, after PR #39144), and this pin orders its entries either way. Whether
// an id is retired is `checkNavContributionGroupRenames`' question, not this
// file's.
//
// ---------------------------------------------------------------------------
// Why it lives in `packages/cli/test/`
Expand Down Expand Up @@ -62,23 +72,27 @@ import { SLACK_SETUP_UI_BUNDLE } from '@objectstack/service-messaging';

type AnyRec = Record<string, any>;

const GROUP = 'group_integrations';
// [#39053] The served anchor. `group_integrations` retired into it through
// `renamedFrom`, together with `group_advanced`, so the served group holds the
// entries of BOTH retired ids until each contributor names the new id. This pin
// orders the ones contributed under `GROUP`, read in the served group.
// [#39053] The served anchor, and the ids it answers for through `renamedFrom`.
const SERVED_GROUP = 'group_integrations_dev';
const ANCHOR = (SETUP_APP.navigation ?? []).find((item: AnyRec) => item?.id === SERVED_GROUP) as AnyRec | undefined;
const GROUP_IDS: ReadonlySet<string> = new Set([SERVED_GROUP, ...((ANCHOR?.renamedFrom as string[] | undefined) ?? [])]);
const PLATFORM = '@objectstack/platform-objects';

/** A capability package's contribution into the served group (the platform's own edges excluded). */
const isCapabilityEntry = ({ packageId, contribution }: { packageId: string; contribution: AnyRec }): boolean =>
packageId !== PLATFORM && GROUP_IDS.has(String(contribution.group));

/**
* The group, in the order an administrator reads it. Each inner array is one
* priority tier; ids inside a tier are compared as a set (see the header).
*/
const EXPECTED_TIERS: readonly (readonly string[])[] = [
['nav_webhooks', 'nav_http_deliveries', 'nav_datasources'],
['nav_datasources'],
['nav_cloud_connection'],
['nav_webhooks', 'nav_http_deliveries'],
// One contribution carries both, in this order (ADR-0143 D5 added the second).
['nav_connector_credentials', 'nav_connector_connections'],
['nav_slack'],
['nav_cloud_connection'],
];

/**
Expand Down Expand Up @@ -110,17 +124,17 @@ async function setupContributions(): Promise<Array<{ packageId: string; contribu
const sources: Array<[string, AnyRec[]]> = [
['@objectstack/plugin-webhooks', await manifestsRegisteredBy(new WebhookOutboxPlugin({ autoEnqueue: false }))],
['@objectstack/service-datasource', await manifestsRegisteredBy(new DatasourceAdminServicePlugin({}) as any)],
// Still read although it no longer contributes here: Connect an AI
// Assistant sits in `group_overview` (#30895), and the "nothing
// Still read although it does not contribute here: Connect an AI
// Assistant sits in `group_apps_ai` (#39058), and the "nothing
// contributes into the group that this pin does not order" check below
// reds if it moves back.
// reds if it moves into this one.
['@objectstack/mcp', [CONNECT_AGENT_UI_BUNDLE as AnyRec]],
['@objectstack/service-automation', [CONNECTOR_CREDENTIALS_UI_BUNDLE as AnyRec]],
['@objectstack/service-messaging', [SLACK_SETUP_UI_BUNDLE as AnyRec]],
['@objectstack/cloud-connection', [CLOUD_CONNECTION_UI_BUNDLE as AnyRec]],
];
const out: Array<{ packageId: string; contribution: AnyRec }> = SETUP_NAV_CONTRIBUTIONS.map((contribution) => ({
packageId: '@objectstack/platform-objects',
packageId: PLATFORM,
contribution: contribution as AnyRec,
}));
for (const [packageId, manifests] of sources) {
Expand All @@ -140,21 +154,26 @@ function groupChildren(app: AnyRec | undefined, groupId: string): string[] {
}

describe('Setup → Integrations: the merged order follows each contributor\'s priority', () => {
it('serves the four contributors in priority order, read from the contributions themselves', async () => {
it('serves the five capability contributors in priority order, read from the contributions themselves', async () => {
const contributions = await setupContributions();

// `structuredClone`: `registerApp` writes the `_lock` envelope onto
// what it is handed (ADR-0010 §3.7); the module constant stays clean.
const registry = new SchemaRegistry({ multiTenant: false, collisionPolicy: 'error' });
(registry as AnyRec).logLevel = 'silent';
registry.registerApp(structuredClone(SETUP_APP), '@objectstack/platform-objects');
registry.registerApp(structuredClone(SETUP_APP), PLATFORM);
for (const { packageId, contribution } of contributions) {
registry.registerAppNavContribution(contribution as any, packageId);
}

// The anchor is read, not assumed: a missing anchor would leave no alias
// set, and a contributor still naming a retired id would drop out of both
// checks below instead of being ordered by them.
expect(ANCHOR, `SETUP_APP declares ${SERVED_GROUP}`).toBeDefined();

const underGroup = new Set(
contributions
.filter(({ contribution }) => contribution.group === GROUP)
.filter(isCapabilityEntry)
.flatMap(({ contribution }) => (contribution.items ?? []).map((item: AnyRec) => String(item.id))),
);
const merged = groupChildren(registry.getApp('setup'), SERVED_GROUP).filter((id) => underGroup.has(id));
Expand All @@ -172,8 +191,9 @@ describe('Setup → Integrations: the merged order follows each contributor\'s p
// that carries it — and to that contribution's package, so a red names
// who moved.
const declared = new Map<string, { priority: number; packageId: string }>();
for (const { packageId, contribution } of contributions) {
if (contribution.group !== GROUP) continue;
for (const entry of contributions) {
if (!isCapabilityEntry(entry)) continue;
const { packageId, contribution } = entry;
for (const item of contribution.items ?? []) {
declared.set(String(item.id), { priority: contribution.priority, packageId });
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
* - managed: no `cloud_connection_settings` page and no
* `nav_cloud_connection` entry anywhere in Setup's tree;
* - not managed: the page is served and the entry sits in
* `group_integrations`, not `group_apps`, declaring
* `group_integrations_dev`, not `group_apps_ai`, declaring
* `manage_platform_settings` on itself (ruling 乙, #25119).
* Both readings carry a lit control in the same composition: a page and a
* contributed `group_apps` entry that ARE served, so "absent" is read off a
* contributed `group_apps_ai` entry that ARE served, so "absent" is read off a
* listing that carries plugin metadata, not off an empty one.
* - The three connection-changing doors — `POST /bind/start`,
* `POST /bind/poll` and `POST /unbind` — driven through the routes the
Expand Down Expand Up @@ -91,8 +91,8 @@ const SETUP_SHELL = {
name: 'setup',
label: 'Setup',
navigation: [
{ id: 'group_apps', type: 'group', label: 'Apps', children: [] },
{ id: 'group_integrations', type: 'group', label: 'Integrations', children: [] },
{ id: 'group_apps_ai', type: 'group', label: 'Apps & AI', children: [] },
{ id: 'group_integrations_dev', type: 'group', label: 'Integrations & Developer', children: [] },
],
}],
pages: [CONTROL_PAGE],
Expand Down Expand Up @@ -144,7 +144,7 @@ function makeRawApp() {

/**
* A real kernel carrying the Setup shell and the marketplace browse bundle (the
* contributed `group_apps` control), with the plugin booted to `kernel:ready`
* contributed `group_apps_ai` control), with the plugin booted to `kernel:ready`
* against that kernel's own `manifest` service. `serviceKey` is the plugin's
* `controlPlaneApiKey`; left `undefined`, the plugin reads `OS_CLOUD_API_KEY`.
*/
Expand Down Expand Up @@ -215,7 +215,7 @@ describe('platform-managed runtime — no Setup page, no nav entry (ruling 甲)'

const navigation = await setupNavigation(protocol);
// Control: the read reaches contributed entries.
expect(groupIds(navigation, 'group_apps')).toContain('nav_marketplace_browse');
expect(groupIds(navigation, 'group_apps_ai')).toContain('nav_marketplace_browse');
expect(allNavIds(navigation)).not.toContain('nav_cloud_connection');
});

Expand All @@ -226,7 +226,7 @@ describe('platform-managed runtime — no Setup page, no nav entry (ruling 甲)'
expect(pages).toContain('control_settings');
expect(pages).not.toContain('cloud_connection_settings');
const navigation = await setupNavigation(protocol);
expect(groupIds(navigation, 'group_apps')).toContain('nav_marketplace_browse');
expect(groupIds(navigation, 'group_apps_ai')).toContain('nav_marketplace_browse');
expect(allNavIds(navigation)).not.toContain('nav_cloud_connection');
});

Expand All @@ -236,18 +236,18 @@ describe('platform-managed runtime — no Setup page, no nav entry (ruling 甲)'
expect(lines.filter((l) => l.includes('platform-managed'))).toHaveLength(1);
});

it('not managed: the page is served and the entry sits in group_integrations, not group_apps', async () => {
it('not managed: the page is served and the entry sits in group_integrations_dev, not group_apps_ai', async () => {
const { protocol } = await composeRegistration(undefined);
const pages = await servedPageNames(protocol);
expect(pages).toContain('cloud_connection_settings');

const navigation = await setupNavigation(protocol);
expect(groupIds(navigation, 'group_integrations')).toEqual(['nav_cloud_connection']);
expect(groupIds(navigation, 'group_integrations_dev')).toEqual(['nav_cloud_connection']);
// Ruling 乙 (#25119): the entry carries the doors' rule on itself, as served.
const entry = (navigation.find((g) => g?.id === 'group_integrations')?.children as Bag[])
const entry = (navigation.find((g) => g?.id === 'group_integrations_dev')?.children as Bag[])
.find((i) => i?.id === 'nav_cloud_connection');
expect(entry?.requiredPermissions).toEqual(['manage_platform_settings']);
const apps = groupIds(navigation, 'group_apps');
const apps = groupIds(navigation, 'group_apps_ai');
expect(apps).toContain('nav_marketplace_browse');
expect(apps).not.toContain('nav_cloud_connection');
// Exactly one entry by that id in the whole tree: moved, not copied.
Expand Down
Loading
Loading