Skip to content

Commit eb8895f

Browse files
fix(setup): capability Setup entries name the new group ids (#39058) (#39202)
Part of #39058 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:管理员打开“设置”时,各功能包提供的入口直接落在新的十个分组里;“审批中心”入口离开设置;“连接 AI 助手”移到“应用与 AI”分组,仍只对有平台设置权限的管理员可见。 - 为什么做:属于“设置导航重组”专题,替每位打开设置的管理员消除入口靠旧分组名转接的告警和错位。 - 出错会怎样:最坏是某个入口排位或分组不对,或“连接 AI 助手”对管理员的可见范围变化;只改导航贡献,可直接撤回。 - 要你做什么:无。“权限集”已裁 A(不回到设置,由“岗位与权限”承接,搜索别名随 #39204 补上)。“分派规则、队列、队列成员”移入需平台设置权限的分组,可见范围不变(三项本就各自要求该权限)。 ## What changes Every Setup entry a capability package contributes from the claimed files now names its new group id (epic #39050, ruling D1), so these packages draw no `nav_contribution_group_renamed` notice on boot. Where a retired group was split, each entry names its group explicitly: | Package | Entry ids | Group | Priority | |---|---|---|---| | plugin-approvals | nav_approval_requests, nav_approval_actions, nav_approval_delegations | group_routing_approvals | 100 | | plugin-sharing | nav_assignment_rules, nav_queues, nav_queue_members | group_routing_approvals | 200 | | plugin-sharing | nav_sharing_rules, nav_record_shares | group_access_sharing | 200 | | plugin-security | nav_position_holders, nav_permission_set_assignment | group_access_sharing | 150 | | plugin-audit | audit log | group_audit_data | 100 | | plugin-auth | SSO providers, SCIM credentials (when wired) | group_login_security | 200 | | plugin-webhooks | webhooks, HTTP deliveries | group_integrations_dev | 115 | | service-datasource | datasources | group_integrations_dev | 105 | | cloud-connection | cloud connection | group_integrations_dev | 110 | | service-messaging | Slack | group_integrations_dev | 140 | | service-messaging | notification templates / preferences | group_notifications | 100 / 300 | | service-settings | branding | group_company | 100 | | cloud-connection | nav_marketplace_browse | group_apps_ai | 150 | | service-knowledge | knowledge settings / sync states | group_apps_ai | 250 / 251 | | mcp | nav_connect_agent | group_apps_ai | 400 | - **mcp `nav_connect_agent` keeps its audience.** It used to sit in `group_overview`, which was gated on `manage_platform_settings`; `group_apps_ai` is ungated, so the item now carries `requiredPermissions: ['manage_platform_settings']` itself (exported as `CONNECT_AGENT_SETUP_CAPABILITY` from `connect-ui.ts`, not added to the barrel). The Account app's entry stays ungated. - **Ruling D2: `nav_approvals_inbox` leaves Setup** (removed from the approvals plugin's contribution). The request link was checked: the `sys_approval_request` record page carries the `record:approval_decision` panel, so a request opened from Requests is already the decision surface, and the inbox's own `?request=ID` address is untouched. No link is missing, so nothing outside this surface was needed. - Placements not spelled out in the epic table, and my calls: SSO/SCIM go to Login & Security, knowledge to Apps & AI (before AI Model Service), queue members to Routing & Approvals with the queues. ## Tests - New per-card files, `setup-nav-groups-39058.test.ts`, beside the plugin-sharing, plugin-webhooks, service-messaging, service-datasource and cloud-connection contributions. Each one runs the real `SchemaRegistry` fold over `SETUP_APP` and `SETUP_NAV_CONTRIBUTIONS`. It asserts that `checkNavContributionGroupRenames` returns nothing for the package, and it pins where each entry lands in the merged group. - The other packages already had a harness file for their nav contribution. Per ruling 6583487846, the `#39058` pin went into that file as a top-level describe, and the file's existing assertions were retargeted to the new groups: - plugin-approvals: includes a D2 describe saying the inbox is not a Setup entry. - plugin-audit - plugin-auth (SCIM) - plugin-security (people-org assignment) - service-knowledge - service-settings: the branding test now asserts exactly what group_company holds; the old assertion was vacuous. - mcp - **mcp gate pin, with ablation.** `connect-agent-account-nav.test.ts` serves the merged Setup app through RestServer `GET /api/v1/meta/:type/:name` over a fixture shell. - A caller holding only `setup.access` sees the control entry alone. - A caller with `manage_platform_settings` also sees `nav_connect_agent`. - Ablation: I deleted the `requiredPermissions` line and 3 tests went red: the entry shape, the "cannot widen" test, and the wire test where the setup.access-only caller was served the entry. The positive case stayed green. I restored the line with `git checkout HEAD --` and `git diff HEAD` came back empty. ## Acceptance notes This is `Part of`, not `Fixes`, because of what is left: 1. **Carve-out.** `service-automation/src/connector-credentials-ui.ts` (PR #39144) still spells `group_integrations`. It is the only retired-group-id notice left on a composed boot of every first-party package (`nav_connector_credentials`, `nav_connector_connections` → `group_integrations_dev`). Suggested priority: 120, between webhooks at 115 and Slack at 140. 2. **Pins and test configs, granted by claim amendment 7362031530 and fixed in f4d7a5e.** - The wire pin reads `nav_connect_agent` in `group_apps_ai` after Installed Apps and AI Model Service, and pins it absent from the top level. - The order pin is keyed on `group_integrations_dev` plus the ids in its `renamedFrom`, and pins the 7 ids in five tiers: datasources 105, cloud connection 110, webhooks and HTTP deliveries 115, connector credentials and connections 120, Slack 140. - The mcp and service-datasource vitest configs declare `env: { OS_REGISTRY_LOG: 'warn' }`. service-datasource gets the anchored `@objectstack/platform-objects/apps` alias; mcp gets an anchored `@objectstack/objectql` alias instead, because its tests never import platform-objects. 3. **Labels that need the translation bundles** in `packages/platform-objects/src/apps/translations` (outside the surface): - 应用市场: today 浏览应用市场 / Browse Marketplace. - 品牌外观: today Branding. - 审批委派: today 审批委派(外出) / Delegations (OOO). - The four English renames #39057 deferred here: Position Members, Permission Set Grants, Sharing Details, Work Queues. - The `nav_approvals_inbox` translation keys are now dead. Their tombstone row also belongs to that change. - These land on card #39204. 4. **Platform-owned, not plugin, so reported only:** - 概览 is `nav_system_overview`, owned by the platform shell. - 权限集: this PR keeps `nav_permission_sets` retired as on main. The maintainer ruled A on analysis 7362174445 (ruling recorded on #39058): it is carried by 岗位与权限, and its search alias rides #39204. 5. **Visible count.** With every capability installed and collapsed groups closed, the count is 29: the top entry plus users_org 7, access_sharing 5, apps_ai 6, routing_approvals 6 and audit_data 4. It is 28 when the org-scoping service is absent. Against the table: - +`nav_organization`, which #39057 kept. - +queue members. - −权限集. - The two knowledge entries sit where the cloud-only AI employee/usage entries would. 6. Stale comments that still name retired groups, all outside the claimed surface, listed and not fixed: `cloud-connection-plugin.ts:51`, service-datasource `admin-routes.ts:281` and `README.md:73` name `group_integrations`; `cli/scripts/check-app-nav-i18n.mjs:447` and `:607` name `group_overview` (its lines 510–536 are self-test fixtures and need no change). 7. **Routing entries keep their audience.** Assignment Rules, Queues and Queue Members move from the ungated Access & Sharing group into Routing & Approvals, which is gated on `manage_platform_settings`. Each entry already carried that gate itself at the merge base, so a Setup user with `setup.access` but without `manage_platform_settings` was not served them before and is not now. Measured through the meta read gate's app filter over the Setup fold at the merge base and at head, with an ungated control that does serve them. The changeset says so (94850f2). No gate was added or removed. ## Verification Two-minute check: `pnpm --filter @objectstack/mcp exec vitest run --maxWorkers=2 src/connect-agent-account-nav.test.ts`. Expect 10 tests, all passing. Then delete the `requiredPermissions` line in `connect-ui.ts` and rerun; three tests go red. Read first: 1. `packages/mcp/src/connect-ui.ts`, the setup contribution hunk. This is the gate. 2. `packages/plugins/plugin-approvals/src/approvals-plugin.ts`. This is the D2 removal. 3. `packages/plugins/plugin-sharing/src/sharing-plugin.ts`. This is the split across two groups. The two blocks below are on head 17ff8c3; the last two are on the patch-round heads f4d7a5e and 94850f2. <details><summary>Package suites (full, under os-verify-lock)</summary> - plugin-approvals: 148 files, 2366 tests passed - plugin-audit: 118 files, 1966 tests passed - plugin-sharing: 81 files, 1776 passed, 11 skipped - plugin-webhooks: 28 files, 324 passed - cloud-connection: 1376 passed - mcp: 89 files, 1661 passed - service-knowledge 55/55, service-settings 16, service-messaging 9, service-datasource 1, plugin-auth scim 7/7, plugin-security nav 6/6. plugin-auth and plugin-security were narrowed to their nav files; their full suites are owed to CI. - Typecheck passed for all 12 packages. - Cross-package checks: platform-objects `src/apps` 955/955; objectql protocol-meta and registry-nav-contributions 107; qa/dogfood platform-app-object-entry-views 57; `check:app-nav-i18n` OK. </details> <details><summary>Derived gates on 17ff8c3 (dispatch-gates --commands, 83 families)</summary> - 78 exited 0. - Red, outside the surface (see Acceptance notes 2): `check:registry-log-declared` exit 1, `check:test-source-alias` exit 1. - NOT MEASURED, owed to CI: - `check:dual-build-cjs-loads` exit 3: PREREQUISITE NOT MET, because 42 workspace packages lack `dist`. - `check:query-options-erasure` and `check:type-check-debt`: killed at my 240s per-gate cap on the shared box (exit 124). - `dispatch-gates --ran` reconciled: 83 derived, 80 run, 3 NOT-MEASURED. - The real dev boot was refused by `check-dev-prereqs` because the workspace is not built, so boot diagnostics were measured by a composed registry fold instead (Acceptance notes 1 and 5). </details> <details><summary>Derived gates on 94850f2 (86 families)</summary> - 85 exited 0, including `check:registry-log-declared`, `check:test-source-alias`, `check:query-options-erasure`, the changeset gates and `check:dual-build-cjs-loads`. - `check:type-check-debt` exit 3, PREREQUISITE NOT MET (lock contention); measured exit 0 on f4d7a5e, and CI `Type Check · debt ledger` is green on 94850f2. - `dispatch-gates --ran`: 86 derived, 85 run, 1 NOT-MEASURED, 0 UNRUN. - PR check-runs on 94850f2: 39 success, 18 skipped, no red. </details> <details><summary>Patch rounds on f4d7a5e and 94850f2</summary> - cli pins: 2 files, 3 tests passed. - service-datasource full suite: 76 files, 1318 passed. - cloud-connection nav pin 2 passed; plugin-auth scim nav 7 passed. - The mcp full suite and the plugin-sharing nav pin were NOT MEASURED locally after lock queue time-outs; CI Test Core 12/12 is green on both heads. - 94850f2 changes only the changeset (one audience sentence). </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01QSeKYnrQ7UMtHofKQVjcH2 <!-- signed: repo:objectstack@os-justin · os-justin · session_01QSeKYnrQ7UMtHofKQVjcH2 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 2b06762 commit eb8895f

35 files changed

Lines changed: 1053 additions & 219 deletions
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
'@objectstack/plugin-approvals': patch
3+
'@objectstack/plugin-audit': patch
4+
'@objectstack/plugin-auth': patch
5+
'@objectstack/plugin-security': patch
6+
'@objectstack/plugin-sharing': patch
7+
'@objectstack/plugin-webhooks': patch
8+
'@objectstack/service-messaging': patch
9+
'@objectstack/service-knowledge': patch
10+
'@objectstack/service-datasource': patch
11+
'@objectstack/service-settings': patch
12+
'@objectstack/cloud-connection': patch
13+
'@objectstack/mcp': patch
14+
---
15+
16+
Setup entries contributed by capability packages name the new group ids; the Approvals Inbox leaves Setup
17+
18+
Clause-②: no
19+
Metadata-protocol: none
20+
21+
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:
22+
23+
- **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`).
24+
- **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.
25+
- **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.
26+
- **Audit & Data:** the Audit Log (`@objectstack/plugin-audit`) first.
27+
- **Company Settings:** Branding (`@objectstack/service-settings`) first.
28+
- **Notifications:** Notification Templates first and Notification Preferences after the email and SMS channels (`@objectstack/service-messaging`).
29+
- **Login & Security:** SSO Providers and SCIM Credentials (`@objectstack/plugin-auth`), when wired.
30+
- **Integrations & Developer:** Datasources (`@objectstack/service-datasource`), Cloud Connection (`@objectstack/cloud-connection`), Webhooks and HTTP Deliveries (`@objectstack/plugin-webhooks`), Slack (`@objectstack/service-messaging`).
31+
32+
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.
33+
34+
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.
35+
36+
No action needed: nothing an app author writes changes.

‎packages/cli/test/connect-agent-both-halves-wire.pin.test.ts‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,12 +259,12 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', (
259259
const allowedIds = navIds(setupAllowed.body?.item);
260260
expect(allowedIds).toContain('nav_connect_agent');
261261
// [#39053] System Overview is Setup's pinned first entry, outside every
262-
// group. `group_overview` retired with no successor group, so the MCP
263-
// entry its bundle still aims there is relocated to the top level (with
264-
// the missing-group diagnostic) until the bundle names its new group.
262+
// group. [#39058] `group_overview` retired with no successor group; the
263+
// MCP bundle now names `group_apps_ai`, so its entry is no longer
264+
// relocated to the top level (read in the group below).
265265
const topIds = ((setupAllowed.body?.item?.navigation ?? []) as AnyRec[]).map((n) => String(n?.id));
266266
expect(topIds[0]).toBe('nav_system_overview');
267-
expect(topIds).toContain('nav_connect_agent');
267+
expect(topIds).not.toContain('nav_connect_agent');
268268
// The Setup tree the platform admin is served BY THIS COMPOSITION:
269269
// platform-objects' own contributions plus the MCP one. No total is
270270
// pinned here: the entry count moves with ordinary development
@@ -276,8 +276,10 @@ describe('#17647 — Connect-an-Agent visibility: BOTH halves, over the wire', (
276276
// and this harness composes platform-objects and the MCP bundle alone.
277277
expect(allowedIds).toContain('nav_packages');
278278
// Apps & AI as this composition serves it: Installed Apps, then AI
279-
// Model Service (#39057).
280-
expect(groupChildren(setupAllowed.body?.item, 'group_apps_ai')).toEqual(['nav_packages', 'nav_settings_ai']);
279+
// Model Service (#39057), then Connect an AI Assistant, the MCP
280+
// bundle's Setup half (#39058, priority 400 after the platform's 300).
281+
expect(groupChildren(setupAllowed.body?.item, 'group_apps_ai'))
282+
.toEqual(['nav_packages', 'nav_settings_ai', 'nav_connect_agent']);
281283
expect(allowedIds).toContain('nav_public_forms');
282284
// #37087 — the id is Setup's alone now: Studio's entry of the same id
283285
// is retired with the console page it opened (`developer:public-forms`).

‎packages/cli/test/setup-integrations-order.pin.test.ts‎

Lines changed: 47 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
22
//
3-
// The MERGED-ORDER pin for Setup → Integrations.
3+
// The MERGED-ORDER pin for Setup → Integrations & Developer.
44
//
55
// ---------------------------------------------------------------------------
66
// What this pins
77
// ---------------------------------------------------------------------------
88
// `SETUP_APP` declares `group_integrations_dev` as an empty anchor (ADR-0029 D7),
9-
// answering for the retired `group_integrations` through `renamedFrom` (#39053);
10-
// every entry in it is contributed at runtime by the package that owns the
11-
// capability, and `SchemaRegistry.applyNavContributions` orders the
12-
// contributions by their `priority`, lowest first. Today that reads:
9+
// answering for the retired `group_integrations` through `renamedFrom` (#39053).
10+
// The platform contributes its own entries at the group's edges (API Keys and
11+
// OAuth Applications at 100, Public Forms at 500, `setup-nav.contributions.ts`);
12+
// every entry between them is contributed at runtime by the package that owns
13+
// the capability, and `SchemaRegistry.applyNavContributions` orders the
14+
// contributions by their `priority`, lowest first. Since #39058 placed each
15+
// contributor in the regrouped Setup, the capability entries read:
1316
//
14-
// Webhooks / HTTP Deliveries `@objectstack/plugin-webhooks`
1517
// Datasources `@objectstack/service-datasource`
18+
// Cloud Connection `@objectstack/cloud-connection`
19+
// Webhooks / HTTP Deliveries `@objectstack/plugin-webhooks`
1620
// Connector Credentials `@objectstack/service-automation`
1721
// Connector Connections `@objectstack/service-automation` (same contribution)
1822
// Slack `@objectstack/service-messaging` (with connector-slack composed)
19-
// Cloud Connection `@objectstack/cloud-connection`
2023
//
2124
// Each contributor states the group's other priorities in its own header so
2225
// that its number sorts where it means to — and nothing held those headers to
@@ -28,10 +31,17 @@
2831
// had moved, as long as nobody re-ran the arithmetic. What the file does state
2932
// is the ORDER of the ids, which is the user-visible fact under protection.
3033
//
31-
// The first two contributors share one priority, so the fold's stable sort
32-
// leaves their relative order to registration order, which belongs to the
33-
// composition root's plugin list and not to any priority. That tier is pinned
34-
// as a set; every tier boundary is pinned as an order.
34+
// Each contributor holds a priority of its own, so every tier boundary is
35+
// pinned as an order. Inside a tier (one contribution's items) the ids are
36+
// compared as a set, as before #39058, when two contributors shared one
37+
// priority and the fold's stable sort left them to registration order.
38+
//
39+
// The contributions are matched by the group they NAME, read as the served
40+
// anchor or one of its `renamedFrom` ids off `SETUP_APP`: `service-automation`
41+
// still names the retired `group_integrations` until its own one-line move
42+
// (#39058, after PR #39144), and this pin orders its entries either way. Whether
43+
// an id is retired is `checkNavContributionGroupRenames`' question, not this
44+
// file's.
3545
//
3646
// ---------------------------------------------------------------------------
3747
// Why it lives in `packages/cli/test/`
@@ -62,23 +72,27 @@ import { SLACK_SETUP_UI_BUNDLE } from '@objectstack/service-messaging';
6272

6373
type AnyRec = Record<string, any>;
6474

65-
const GROUP = 'group_integrations';
66-
// [#39053] The served anchor. `group_integrations` retired into it through
67-
// `renamedFrom`, together with `group_advanced`, so the served group holds the
68-
// entries of BOTH retired ids until each contributor names the new id. This pin
69-
// orders the ones contributed under `GROUP`, read in the served group.
75+
// [#39053] The served anchor, and the ids it answers for through `renamedFrom`.
7076
const SERVED_GROUP = 'group_integrations_dev';
77+
const ANCHOR = (SETUP_APP.navigation ?? []).find((item: AnyRec) => item?.id === SERVED_GROUP) as AnyRec | undefined;
78+
const GROUP_IDS: ReadonlySet<string> = new Set([SERVED_GROUP, ...((ANCHOR?.renamedFrom as string[] | undefined) ?? [])]);
79+
const PLATFORM = '@objectstack/platform-objects';
80+
81+
/** A capability package's contribution into the served group (the platform's own edges excluded). */
82+
const isCapabilityEntry = ({ packageId, contribution }: { packageId: string; contribution: AnyRec }): boolean =>
83+
packageId !== PLATFORM && GROUP_IDS.has(String(contribution.group));
7184

7285
/**
7386
* The group, in the order an administrator reads it. Each inner array is one
7487
* priority tier; ids inside a tier are compared as a set (see the header).
7588
*/
7689
const EXPECTED_TIERS: readonly (readonly string[])[] = [
77-
['nav_webhooks', 'nav_http_deliveries', 'nav_datasources'],
90+
['nav_datasources'],
91+
['nav_cloud_connection'],
92+
['nav_webhooks', 'nav_http_deliveries'],
7893
// One contribution carries both, in this order (ADR-0143 D5 added the second).
7994
['nav_connector_credentials', 'nav_connector_connections'],
8095
['nav_slack'],
81-
['nav_cloud_connection'],
8296
];
8397

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

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

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

169+
// The anchor is read, not assumed: a missing anchor would leave no alias
170+
// set, and a contributor still naming a retired id would drop out of both
171+
// checks below instead of being ordered by them.
172+
expect(ANCHOR, `SETUP_APP declares ${SERVED_GROUP}`).toBeDefined();
173+
155174
const underGroup = new Set(
156175
contributions
157-
.filter(({ contribution }) => contribution.group === GROUP)
176+
.filter(isCapabilityEntry)
158177
.flatMap(({ contribution }) => (contribution.items ?? []).map((item: AnyRec) => String(item.id))),
159178
);
160179
const merged = groupChildren(registry.getApp('setup'), SERVED_GROUP).filter((id) => underGroup.has(id));
@@ -172,8 +191,9 @@ describe('Setup → Integrations: the merged order follows each contributor\'s p
172191
// that carries it — and to that contribution's package, so a red names
173192
// who moved.
174193
const declared = new Map<string, { priority: number; packageId: string }>();
175-
for (const { packageId, contribution } of contributions) {
176-
if (contribution.group !== GROUP) continue;
194+
for (const entry of contributions) {
195+
if (!isCapabilityEntry(entry)) continue;
196+
const { packageId, contribution } = entry;
177197
for (const item of contribution.items ?? []) {
178198
declared.set(String(item.id), { priority: contribution.priority, packageId });
179199
}

‎packages/cloud-connection/src/cloud-connection-platform-managed.pin.test.ts‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
* - managed: no `cloud_connection_settings` page and no
2121
* `nav_cloud_connection` entry anywhere in Setup's tree;
2222
* - not managed: the page is served and the entry sits in
23-
* `group_integrations`, not `group_apps`, declaring
23+
* `group_integrations_dev`, not `group_apps_ai`, declaring
2424
* `manage_platform_settings` on itself (ruling 乙, #25119).
2525
* Both readings carry a lit control in the same composition: a page and a
26-
* contributed `group_apps` entry that ARE served, so "absent" is read off a
26+
* contributed `group_apps_ai` entry that ARE served, so "absent" is read off a
2727
* listing that carries plugin metadata, not off an empty one.
2828
* - The three connection-changing doors — `POST /bind/start`,
2929
* `POST /bind/poll` and `POST /unbind` — driven through the routes the
@@ -91,8 +91,8 @@ const SETUP_SHELL = {
9191
name: 'setup',
9292
label: 'Setup',
9393
navigation: [
94-
{ id: 'group_apps', type: 'group', label: 'Apps', children: [] },
95-
{ id: 'group_integrations', type: 'group', label: 'Integrations', children: [] },
94+
{ id: 'group_apps_ai', type: 'group', label: 'Apps & AI', children: [] },
95+
{ id: 'group_integrations_dev', type: 'group', label: 'Integrations & Developer', children: [] },
9696
],
9797
}],
9898
pages: [CONTROL_PAGE],
@@ -144,7 +144,7 @@ function makeRawApp() {
144144

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

216216
const navigation = await setupNavigation(protocol);
217217
// Control: the read reaches contributed entries.
218-
expect(groupIds(navigation, 'group_apps')).toContain('nav_marketplace_browse');
218+
expect(groupIds(navigation, 'group_apps_ai')).toContain('nav_marketplace_browse');
219219
expect(allNavIds(navigation)).not.toContain('nav_cloud_connection');
220220
});
221221

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

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

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

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

0 commit comments

Comments
 (0)