Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8cb89ac
feat(approvals): platform_admin approver type, one address slot admit…
claude Nov 16, 2026
9756cbb
test(approvals): pins for the platform_admin approver type; docs
claude Nov 16, 2026
bce4f48
chore(changeset): platform_admin approver type
claude Nov 16, 2026
084419d
fix(lint): export the platform_admin save-door rule id; tighten the pins
claude Nov 16, 2026
dc6720f
docs(spec): regenerate the approval reference for platform_admin
claude Nov 16, 2026
ae34714
test(approvals): narrow the pin helper to an opened request so the fi…
claude Nov 16, 2026
21dd241
Merge remote-tracking branch 'origin/main' into claude/area-A5b-34218
claude Nov 16, 2026
5282972
fix(approvals): withhold the tenant-admin override from a request hol…
claude Nov 16, 2026
fe397d9
Merge remote-tracking branch 'origin/main' into claude/area-A5b-34218
claude Nov 16, 2026
cffa4a4
refactor(approvals): read the platform slot on a slate from approver-…
claude Nov 16, 2026
0a0baff
fix(approvals): judge the platform slot on the resolved slate and on …
claude Nov 16, 2026
c91d0ad
test(approvals): pin the platform slot on directory rows and SLA hand…
claude Nov 16, 2026
563ce51
Merge remote-tracking branch 'origin/main' into claude/area-A5b-34218
claude Nov 16, 2026
3cb0ec9
chore(approvals): state the platform slot rules at rule level in name…
claude Nov 16, 2026
ba113a3
refactor(approvals): read the system caller once in the slot hand-off
claude Nov 16, 2026
f514098
Merge remote-tracking branch 'origin/main' into claude/area-A5b-34218
claude Nov 16, 2026
275b45c
fix(approvals): judge the platform slot on the slate every door reads…
claude Nov 16, 2026
f1a021e
fix(approvals): honour the platform slot only on a request a platform…
claude Nov 16, 2026
5c86710
docs(approvals): state where the platform slot rule holds and which r…
claude Nov 16, 2026
611bd23
Merge remote-tracking branch 'origin/main' into claude/area-A5b-34218
claude Nov 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .changeset/34218-platform-admin-approver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
'@objectstack/spec': minor
'@objectstack/plugin-approvals': minor
'@objectstack/lint': minor
---

feat(approvals): a `platform_admin` approver type routes a step to the platform administrators, from the deployment's own packaged flows only

Clause-②: yes (widening)
Metadata-protocol: added

The widening: `ApproverType` accepts a new member, `platform_admin`, which takes no `value`. Nothing accepted before is refused. The narrowing that comes with it applies only to the new member: it is refused outside the running body of a `source: 'code'` package's flow.

`{ type: 'platform_admin' }` on an approval node addresses the deployment's platform administrators: the people `hasPlatformAdminStanding` answers yes for, which covers a holder of the cross-tenant `admin_full_access` grant and a verified account whose email `OS_PLATFORM_OWNER_EMAIL` declares.

- The step opens on ONE address slot, `platform_admin:*`, that names no person. Nobody is enumerated, nobody is notified, and the slot grants no record read. `onEmptyApprovers` does not treat the slate as empty.
- At the inbox and at every decision, the server asks whether the caller has platform-administrator standing at that moment, from the stored rows and never from the session's posture. A caller who has it decides as an ordinary approver, and the decision records the person (`actor_id`) and the slot (`acted_as`). A revoked administrator cannot decide, also on a request opened before the revocation. An organization administrator takes no slot. The #3424 tenant-admin override is withheld from a request whose slate holds `platform_admin:*`, including a mixed slate: an override decides the whole request, so the guard covers the whole request. Its ordinary approvers still decide as usual. The platform-admin override is unchanged.
- Only the `platform_admin` approver type opens the slot, on the slate as the decision, override and inbox doors read it: no other way a slate is resolved or later rewritten opens it. A request records, when it opens, that a `platform_admin` step opened its slot, and the doors honour the slot only on a request that carries that record. Moving the slot to someone else needs the platform's own standing, the platform-admin override, or the system.
- The new member is accepted only in the running body of a flow shipped by a package the deployment registers in code (registry `source: 'code'`, or a residual owner a code door recorded). The origin is answered for the body whose step is being opened, in every run state. Anywhere else the node refuses to open, fails closed and writes nothing: a flow authored in the environment, an environment override of a packaged flow, and a marketplace or authored package's flow. The runtime save door refuses an active flow naming it with `approval-approver-platform-admin-authored`. `os lint` knows the type and refuses nothing, because it cannot know which door will register a package. No designer offers the type.

Nothing to migrate.
56 changes: 52 additions & 4 deletions content/docs/automation/approvals.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,10 @@ Only `approvers` is required on the node; everything else has a default
(`behavior: 'first_response'`, `lockRecord: true`, `maxRevisions: 3`).

Approver entries resolve by kind — `position`, `user`, `field`, `manager`,
`team`, `department`, `org_membership_level`, `queue`, and `expression`
(described in the [callout above](#3-the-approval-node) and in
[Dynamic approvers](#dynamic-approvers-3447)); `org_membership_level` is the
`team`, `department`, `org_membership_level`, `queue`, `expression` and
`platform_admin` (described in the [callout above](#3-the-approval-node) and in
[Dynamic approvers](#dynamic-approvers-3447), and `platform_admin` in
[Routing to the platform administrators](#platform-admin-approvers)); `org_membership_level` is the
one that silently resolves to nobody when it's mistaken for a business
hierarchy. A `queue` entry names an ownership queue by its machine name — one
an installed app declares, or one of the organization's own — and resolves to
Expand All @@ -448,6 +449,51 @@ A `position` or `queue` name is not checked when the flow is saved: positions an
queues are runtime data an administrator adds and removes, so a name nobody holds
yet saves, and it is resolved when the run reaches the node.

#### Routing to the platform administrators [#platform-admin-approvers]

`{ type: 'platform_admin' }` routes the step to the deployment's **platform
administrators**: the people with platform-administrator standing, which is a
cross-tenant `admin_full_access` grant or a verified account whose email the
deployment declares in `OS_PLATFORM_OWNER_EMAIL`. It takes no `value` and no
`organization`.

- **One slot, nobody listed.** The request opens on one slot,
`platform_admin:*`, that names no person. At every inbox read and every
decision, the server asks whether the caller has platform-administrator
standing at that moment. A caller who has it sees the request under
"My Pending" and decides it as an ordinary approver, and the decision records
that person. A caller whose standing was revoked cannot decide it, even if
the request opened before the revocation. An organization administrator
neither takes the slot nor overrides the request: the tenant admin override
below is withheld from any request whose slate holds `platform_admin:*`,
including a mixed slate that also names ordinary approvers. An override
decides the whole request, so a mixed slate is withheld whole, and its
ordinary approvers still decide it as usual. The platform admin override is
unchanged.
- **Only this type opens the slot.** The rule holds on the slate as the
decision, override and inbox doors read it: however else a slate is resolved
or later rewritten, the slot is not opened through it. A request records,
when it opens, that a `platform_admin` step opened its slot, and the doors
honour the slot only on a request that carries that record. Moving the slot
to someone else takes a platform administrator, the platform admin override,
or the system.
- **Nobody is told.** The slot names no person, so opening the request sends
no notification, and the slot grants no read of the record. The request does
not count as an empty slate, so `onEmptyApprovers` never replaces it with
the organization's administrators.
- **Only the deployment's own packaged flows may use it.** The approval node
opens on this type only when the flow body it runs ships in a package the
deployment registers in code (registry `source: 'code'`). The origin is
answered for the body whose step is being opened, in every run state. Anywhere else, the
node fails with a `FORBIDDEN:` error that says why, and writes no request.
That covers a flow authored in the deployment, an environment override of a
packaged flow, and a flow from a package installed from the marketplace or
created in the deployment. Saving an active flow that names the type, in
Studio or through `/meta`, is refused with
`approval-approver-platform-admin-authored`. `os lint` accepts the type. It
cannot know which door will register the package it reads. No designer
offers the type.

What an entry that resolves to nobody leaves on the slate depends on its kind:

- **A person entry** (`manager`, `field`) adds no slot. Nor does a `queue`
Expand Down Expand Up @@ -907,7 +953,9 @@ then — and for a `team` or `department` literal, always — no concrete user c
act, and (with `lockRecord`) the record stays locked. A **platform admin**
(`admin_full_access`) or **tenant admin** (`organization_admin`, org-scoped) may
act on any `pending` request — **approve, reject, reassign** it to a real
approver, or **recall** it — releasing the lock. An admin decision is
approver, or **recall** it — releasing the lock. The one exception is a
request whose slate holds the platform administrators' slot: a tenant admin
cannot override it ([Routing to the platform administrators](#platform-admin-approvers)). An admin decision is
authoritative: it finalizes the node even under `unanimous`/`quorum`/`per_group`,
and is audited under the admin's own id. Prefer a guaranteed-staffed fallback
approver so the set is never empty in the first place.
Expand Down
9 changes: 5 additions & 4 deletions content/docs/references/automation/approval.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const result = ApprovalDecision.parse(data);

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **type** | `Enum<'manager' \| 'position' \| 'department' \| 'team' \| 'queue' \| 'field' \| 'expression' \| 'org_membership_level' \| 'role' \| 'user'>` | ✅ | How this step finds its approvers. Prefer a role in the organization (manager, position, department, team) over one named person, who may leave or not exist in another environment. A manager step only finds someone once an administrator has recorded each user's manager in the user directory; until then it finds nobody and the request follows the node's `onEmptyApprovers` policy. `os lint` reports that at authoring time as `approval-approvers-may-resolve-empty`, and `os explain approval-approvers-may-resolve-empty` carries the ways to fill the directory in and the full remedy; the Approvals guide states the same remedy in prose. |
| **type** | `Enum<'manager' \| 'position' \| 'department' \| 'team' \| 'queue' \| 'field' \| 'expression' \| 'org_membership_level' \| 'role' \| 'user' \| 'platform_admin'>` | ✅ | How this step finds its approvers. Prefer a role in the organization (manager, position, department, team) over one named person, who may leave or not exist in another environment. A manager step only finds someone once an administrator has recorded each user's manager in the user directory; until then it finds nobody and the request follows the node's `onEmptyApprovers` policy. `os lint` reports that at authoring time as `approval-approvers-may-resolve-empty`, and `os explain approval-approvers-may-resolve-empty` carries the ways to fill the directory in and the full remedy; the Approvals guide states the same remedy in prose. The platform administrators type is for a deployment's own packaged flows only: a flow saved here cannot use it, and an approval step that names it anywhere else does not open. |
| **value** | `string` | optional | Who exactly, for the chosen type: the user, membership tier, position, team, department or queue, or the record field that holds the approver. Leave it empty for a manager step. For an expression step, write the CEL expression that returns the approvers; it may read `current.*`, `trigger.*` and `vars.*`. |
| **resolveAs** | `Enum<'user' \| 'department' \| 'position' \| 'team'>` | optional | Expression steps only: what the expression's results name. By default each result is a person; choose departments, positions or teams to make all their members approvers. |
| **group** | `string` | optional | Group name for one-from-each-group sign-off: approvers with the same name form one group, and the step needs approval from every group (e.g. "legal", "finance"). Read only when approvers combine per group. |
Expand Down Expand Up @@ -84,7 +84,7 @@ const result = ApprovalDecision.parse(data);

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **type** | `Enum<'manager' \| 'position' \| 'department' \| 'team' \| 'queue' \| 'field' \| …>` | ✅ | How this step finds its approvers. Prefer a role in the organization (manager, position, department, team) over one named person, who may leave or not exist in another environment. A manager step only finds someone once an administrator has recorded each user's manager in the user directory; until then it finds nobody and the request follows the node's `onEmptyApprovers` policy. `os lint` reports that at authoring time as `approval-approvers-may-resolve-empty`, and `os explain approval-approvers-may-resolve-empty` carries the ways to fill the directory in and the full remedy; the Approvals guide states the same remedy in prose. |
| **type** | `Enum<'manager' \| 'position' \| 'department' \| 'team' \| 'queue' \| 'field' \| …>` | ✅ | How this step finds its approvers. Prefer a role in the organization (manager, position, department, team) over one named person, who may leave or not exist in another environment. A manager step only finds someone once an administrator has recorded each user's manager in the user directory; until then it finds nobody and the request follows the node's `onEmptyApprovers` policy. `os lint` reports that at authoring time as `approval-approvers-may-resolve-empty`, and `os explain approval-approvers-may-resolve-empty` carries the ways to fill the directory in and the full remedy; the Approvals guide states the same remedy in prose. The platform administrators type is for a deployment's own packaged flows only: a flow saved here cannot use it, and an approval step that names it anywhere else does not open. |
| **value** | `string` | optional | Who exactly, for the chosen type: the user, membership tier, position, team, department or queue, or the record field that holds the approver. Leave it empty for a manager step. For an expression step, write the CEL expression that returns the approvers; it may read `current.*`, `trigger.*` and `vars.*`. |
| **resolveAs** | `Enum<'user' \| 'department' \| 'position' \| 'team'>` | optional | Expression steps only: what the expression's results name. By default each result is a person; choose departments, positions or teams to make all their members approvers. |
| **group** | `string` | optional | Group name for one-from-each-group sign-off: approvers with the same name form one group, and the step needs approval from every group (e.g. "legal", "finance"). Read only when approvers combine per group. |
Expand All @@ -94,7 +94,7 @@ const result = ApprovalDecision.parse(data);

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **type** | `Enum<'manager' \| 'position' \| 'department' \| 'team' \| 'queue' \| 'field' \| …>` | ✅ | How this step finds its approvers. Prefer a role in the organization (manager, position, department, team) over one named person, who may leave or not exist in another environment. A manager step only finds someone once an administrator has recorded each user's manager in the user directory; until then it finds nobody and the request follows the node's `onEmptyApprovers` policy. `os lint` reports that at authoring time as `approval-approvers-may-resolve-empty`, and `os explain approval-approvers-may-resolve-empty` carries the ways to fill the directory in and the full remedy; the Approvals guide states the same remedy in prose. |
| **type** | `Enum<'manager' \| 'position' \| 'department' \| 'team' \| 'queue' \| 'field' \| …>` | ✅ | How this step finds its approvers. Prefer a role in the organization (manager, position, department, team) over one named person, who may leave or not exist in another environment. A manager step only finds someone once an administrator has recorded each user's manager in the user directory; until then it finds nobody and the request follows the node's `onEmptyApprovers` policy. `os lint` reports that at authoring time as `approval-approvers-may-resolve-empty`, and `os explain approval-approvers-may-resolve-empty` carries the ways to fill the directory in and the full remedy; the Approvals guide states the same remedy in prose. The platform administrators type is for a deployment's own packaged flows only: a flow saved here cannot use it, and an approval step that names it anywhere else does not open. |
| **value** | `string` | optional | Who exactly, for the chosen type: the user, membership tier, position, team, department or queue, or the record field that holds the approver. Leave it empty for a manager step. For an expression step, write the CEL expression that returns the approvers; it may read `current.*`, `trigger.*` and `vars.*`. |
| **resolveAs** | `Enum<'user' \| 'department' \| 'position' \| 'team'>` | optional | Expression steps only: what the expression's results name. By default each result is a person; choose departments, positions or teams to make all their members approvers. |
| **group** | `string` | optional | Group name for one-from-each-group sign-off: approvers with the same name form one group, and the step needs approval from every group (e.g. "legal", "finance"). Read only when approvers combine per group. |
Expand Down Expand Up @@ -125,7 +125,7 @@ const result = ApprovalDecision.parse(data);

## ApproverType

How this step finds its approvers. Prefer a role in the organization (manager, position, department, team) over one named person, who may leave or not exist in another environment. A manager step only finds someone once an administrator has recorded each user's manager in the user directory; until then it finds nobody and the request follows the node's `onEmptyApprovers` policy. `os lint` reports that at authoring time as `approval-approvers-may-resolve-empty`, and `os explain approval-approvers-may-resolve-empty` carries the ways to fill the directory in and the full remedy; the Approvals guide states the same remedy in prose.
How this step finds its approvers. Prefer a role in the organization (manager, position, department, team) over one named person, who may leave or not exist in another environment. A manager step only finds someone once an administrator has recorded each user's manager in the user directory; until then it finds nobody and the request follows the node's `onEmptyApprovers` policy. `os lint` reports that at authoring time as `approval-approvers-may-resolve-empty`, and `os explain approval-approvers-may-resolve-empty` carries the ways to fill the directory in and the full remedy; the Approvals guide states the same remedy in prose. The platform administrators type is for a deployment's own packaged flows only: a flow saved here cannot use it, and an approval step that names it anywhere else does not open.

### Allowed Values

Expand All @@ -139,6 +139,7 @@ How this step finds its approvers. Prefer a role in the organization (manager, p
* `org_membership_level`
* `role`
* `user`
* `platform_admin`


---
Expand Down
11 changes: 10 additions & 1 deletion packages/lint/src/authoring-rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,12 @@ export interface AuthoringRuleContext {
* authored shape the build judges (`stripInjectedSystemColumns`); and it
* leaves out a label group every member of which already shared the label on
* the target without the written entry, a clash the entry did not create.
*
* `validateApprovalApprovers` reads its presence only, as
* `validateEmailTemplateHoleGrammar` does: a flow written at the publish door is authored in the
* deployment, never a package's own code, so a `platform_admin` approver in
* it is refused there; the CLI commands read a package's source and cannot
* know which door will register it, so they refuse nothing.
*/
runtimeWriteType?: string;
/**
Expand Down Expand Up @@ -1638,7 +1644,10 @@ export const AUTHORING_RULES: readonly AuthoringRule[] = [
// `approver.value` is just a string to Zod. It is not just a string here.
surfaces: CLI_AND_RUNTIME,
runtimeTypes: ['flow'],
run: (stack) => validateApprovalApprovers(stack),
// At the runtime door a flow is authored in the deployment, so a
// `platform_admin` approver in it is refused there (`atSaveDoor`, read off
// `runtimeWriteType`'s presence; see that field).
run: (stack, ctx) => validateApprovalApprovers(stack, { atSaveDoor: ctx.runtimeWriteType !== undefined }),
},
// ADR-0079 — `titleFormat` is retired in favour of `nameField`, and the
// ruling of record on #29007 (6574393684, letter B) refuses it: an object
Expand Down
3 changes: 2 additions & 1 deletion packages/lint/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,9 @@ export {
APPROVAL_EXPRESSION_NO_EMPTY_POLICY,
APPROVAL_DECISION_OUTPUTS_RESERVED,
APPROVAL_APPROVER_CROSS_ORG_UNSUPPORTED,
APPROVAL_APPROVER_PLATFORM_ADMIN_AUTHORED,
} from './validate-approval-approvers.js';
export type { ApprovalApproverFinding, ApprovalApproverSeverity } from './validate-approval-approvers.js';
export type { ApprovalApproverFinding, ApprovalApproverSeverity, ValidateApprovalApproversOptions } from './validate-approval-approvers.js';

export {
validateAssignmentRules,
Expand Down
Loading
Loading