Skip to content

Commit 4472538

Browse files
committed
docs(app-shell): the catalog switch's comments, README and changeset say what objectstack's ADR-0131 stage 1 changed (objectui#7611)
Stage 1 (objectstack bfc15d27) moved the authorization resolver's deactivation read onto the activation ledger: it reads neither catalog row's `active` column. The catalog switch still writes that row flag (the ledger door for `permission` and `position` is objectstack#15204 stage 2c, not landed), so on a stage-1 framework the switch changes the flag and nothing else. catalog-activation.ts said the resolver still reads the row flag; it now says which half moved and which has not. The changeset and the app-shell README say the same, and the changeset says that a set lists no holders through a position on a framework from before stage 1. The capability exclusion's stated reason (the registry served the package-declared capabilities only) stopped holding when objectstack#22669 declared the platform's capabilities as metadata; catalog-scope.ts, the README and a test comment now name the remaining reason, the follow-up. No code path changes. Claude-Session: https://claude.ai/code/session_01Rerax7QTjKMPCUZxQUtPFR Co-authored-by: Claude <noreply@anthropic.com>
1 parent 47a3631 commit 4472538

5 files changed

Lines changed: 40 additions & 25 deletions

File tree

‎.changeset/7611-setup-catalog-registry.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Setup catalog for positions and permission sets reads the registry. It is bu
88

99
- **The environment scope (`?scope=environment`).** `…/metadata/position` and `…/metadata/permission` with this parameter list every item the registry serves for the type, including the platform's own sets. Without it, the list shows one project package's items, as Studio does. Every link the pages emit keeps the scope: the item links, the create link and the editor's breadcrumb. `ENVIRONMENT_SCOPE_QUERY` is exported for hosts that route their own URLs onto it.
1010
- **Gated for Setup.** A caller without `manage_metadata` gets no create affordance on the list and a read-only editor, and the page says why. Under `single`, the reason is that the platform administrator defines these items and the caller's organization assigns them. Under a wall, it is that the operator defines them for every organization. The generic editor and the permission-set editor now apply this caller gate wherever they render. The metadata door refuses that caller's save anyway; this states the refusal before the click.
11-
- **The active switch.** The catalog list has an active column and an active/inactive filter. The switch writes the catalog row's `active` flag through the data door, which is today's behaviour on the Setup object pages. Only `catalog-activation.ts` reads and writes catalog rows, and it is what changes when the server's activation ledger accepts these types. An item with no catalog row shows a dash with the reason.
12-
- **Holders.** In the environment scope, the permission-set editor shows who holds the set under its definition, and the position editor shows who holds the position. A set's holders are read by name: grants come from the `permission_set` column, and the positions that distribute the set come from the registry's position definitions (`permissionSets`). They are no longer read from `sys_position_permission_set` or `sys_position` rows. A new grant still carries `permission_set_id`, because the server does not accept a grant by name alone yet. A position is assigned by its name.
11+
- **The active switch.** The catalog list has an active column and an active/inactive filter. The switch writes the catalog row's `active` flag through the data door, as the Setup object pages' Activate and Deactivate actions do. On a framework whose authorization resolver reads deactivation from the activation ledger (objectstack's ADR-0131 stage 1 onward), that flag no longer switches a grant off, so there the switch changes the flag and nothing else until the ledger accepts these types. Only `catalog-activation.ts` reads and writes catalog rows, and it is what moves onto the ledger then. An item with no catalog row shows a dash with the reason.
12+
- **Holders.** In the environment scope, the permission-set editor shows who holds the set under its definition, and the position editor shows who holds the position. A set's holders are read by name: grants come from the `permission_set` column, and the positions that distribute the set come from the registry's position definitions (`permissionSets`). They are no longer read from `sys_position_permission_set` or `sys_position` rows, so on a framework from before objectstack's ADR-0131 stage 1, where positions declare no `permissionSets`, a set lists no holders through a position. A new grant still carries `permission_set_id`, because the server does not accept a grant by name alone yet. A position is assigned by its name.
1313
- **The sharing-rule recipient picker lists the `position` registry** through the console's metadata store. It no longer reads `sys_position` rows. Without a metadata store mounted, the `position` kind falls back to the plain text input.
1414
- **The console's `system/roles`, `system/positions` and `system/permissions`** now go to the catalog list, not to the object pages.

‎packages/app-shell/README.md‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,12 @@ family for them: it uses the same metadata-admin list and editors at
504504
The list has an active switch and an active/inactive filter. Both read the
505505
catalog row's `active` flag through `catalog-activation.ts`, which is the only
506506
module on these pages that reads or writes a catalog row. They do so until the
507-
server's activation ledger accepts `permission` and `position`. Capabilities
508-
are not in this scope yet: `GET /api/v1/meta/capability` serves the
509-
capabilities that packages declare, but not the platform's own.
507+
server's activation ledger accepts `permission` and `position`. On a framework
508+
whose authorization resolver already reads deactivation from that ledger
509+
(objectstack's ADR-0131 stage 1 onward), the row flag no longer switches a
510+
grant off, so until the ledger door lands the switch changes the flag and
511+
nothing else. Capabilities are not in this scope yet: the Capabilities page
512+
and the capability picker still read `sys_capability` rows.
510513

511514
### Package-less flows (`/studio/~org/automations`)
512515

‎packages/app-shell/src/views/metadata-admin/catalog-activation.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ describe('catalog-activation (objectui#7611)', () => {
2626
it('offers a switch for permission sets and positions, never for capabilities', () => {
2727
expect(hasCatalogActivation('permission')).toBe(true);
2828
expect(hasCatalogActivation('position')).toBe(true);
29-
// The capability registry is incomplete (it serves package capabilities
30-
// only), so Setup does not list it at all — and has no switch for it.
29+
// Capabilities are not in the Setup catalog scope (objectui#7611's
30+
// follow-up moves them), and ADR-0126 §3 gives a capability no switch.
3131
expect(hasCatalogActivation('capability')).toBe(false);
3232
});
3333

‎packages/app-shell/src/views/metadata-admin/catalog-activation.ts‎

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,31 @@
1010
* ("disable + clone", landed machinery that converges later — §8) and
1111
* pre-charts `position` there: disabling is one `active` bit of
1212
* deployment-level state in the tenant-less activation ledger
13-
* `sys_metadata_activation`, written by the enable/disable doors. Measured on
14-
* objectstack `main` for objectui#7611: the ledger has exactly two write
15-
* doors, `POST /automation/:name/toggle` and
16-
* `POST /actions/_activation/:object/:action`, and each fixes its own
17-
* `metadata_type` (`flow`, `action`), so neither accepts `permission` or
18-
* `position`; and the authorization resolver still reads the row's flag
19-
* (`isRowActive`). Until the server opens a ledger door for the two types and
20-
* moves its consult point onto it, a switch wired to the ledger would flip a
21-
* bit nothing reads.
13+
* `sys_metadata_activation`, written by the enable/disable doors.
2214
*
23-
* So the switch keeps TODAY's behaviour: the row's `active` column through
24-
* the data door, which is exactly what the Setup object pages' Activate and
25-
* Deactivate actions write (`PATCH /api/v1/data/<object>/<id>` with
26-
* `{ active }`). The data door decides who may write it — measured: the
27-
* platform administrator may, an organization administrator is refused.
15+
* The two halves of that move land separately on the server, and this seam
16+
* sits between them:
17+
*
18+
* - **The reader has moved.** From objectstack's ADR-0131 stage 1
19+
* (objectstack#15204) the authorization resolver reads a position's or a
20+
* permission set's deactivation from the ledger only, and reads neither
21+
* catalog row's `active` column. On such a framework the flag this module
22+
* writes no longer switches a grant off (measured for objectui#7611 on a
23+
* stage-1 showcase: a holder's resolved grants were unchanged after the
24+
* switch). On a framework from before stage 1, the resolver reads the row
25+
* flag and the switch takes effect.
26+
* - **The write door has not.** No ledger door accepts `permission` or
27+
* `position` yet: the two that exist, `POST /automation/:name/toggle` and
28+
* `POST /actions/_activation/:object/:action`, each fix their own
29+
* `metadata_type` (`flow`, `action`). The door for these two types is
30+
* objectstack#15204 stage 2c.
31+
*
32+
* So the switch keeps the behaviour of the Setup object pages' Activate and
33+
* Deactivate actions: the row's `active` column through the data door
34+
* (`PATCH /api/v1/data/<object>/<id>` with `{ active }`). The data door
35+
* decides who may write it — measured: the platform administrator may, an
36+
* organization administrator is refused. When the ledger door lands, this
37+
* module moves onto it (objectui#7611's follow-up).
2838
*
2939
* ## Why this is a seam and not a second list
3040
*

‎packages/app-shell/src/views/metadata-admin/catalog-scope.ts‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,12 @@ export function environmentScopeSuffix(search: QueryLike): string {
6060
/**
6161
* The catalog types Setup administers through this scope, with the data
6262
* object that still holds each one's ACTIVE flag (see `catalog-activation.ts`).
63-
* `capability` is deliberately absent: `GET /api/v1/meta/capability` serves the
64-
* package-declared capabilities only, not the platform's own (objectui#7611
65-
* measured 2 of 11 on the showcase), so a Setup page reading it would show
66-
* less than the page it replaces.
63+
* `capability` is absent: the Capabilities page and the capability picker
64+
* still read `sys_capability` rows, and moving them onto the registry is
65+
* objectui#7611's follow-up. (The registry serves the platform's own
66+
* capabilities since objectstack#22669, #15204 stage 6b-1a; before it, it
67+
* served the package-declared ones only.) A capability has no switch either
68+
* (ADR-0126 §3).
6769
*/
6870
export const SETUP_CATALOG_TYPES: Readonly<Record<string, { rowObject: string }>> = {
6971
permission: { rowObject: 'sys_permission_set' },

0 commit comments

Comments
 (0)