Skip to content

feat(approvals): annotate approver value + escalateTo as typed references#1414

Merged
xuyushun441-sys merged 1 commit into
mainfrom
feat/approval-xref-pickers
May 31, 2026
Merged

feat(approvals): annotate approver value + escalateTo as typed references#1414
xuyushun441-sys merged 1 commit into
mainfrom
feat/approval-xref-pickers

Conversation

@xuyushun441-sys
Copy link
Copy Markdown
Contributor

Summary

Adds xRef annotations to two Approval-node config strings so the Studio flow designer renders pickers instead of free text (ADR-0018 §configSchema), mirroring the approvalStatusField annotation already on main.

  • approvers[].value — a polymorphic reference (kindFrom: 'type'): the concrete picker follows the sibling type column (user / role / team / department / queue), or an object-field picker resolved from the flow's $trigger object when type is field. manager and any unmapped value carry no value and stay free text.
  • escalation.escalateTo — a role reference (the common case); free text is still accepted for a specific user id.

Both fold the annotation and description into a single .meta() so neither is dropped from the published z.toJSONSchema config contract.

Scope

One file (packages/spec/src/automation/approval.zod.ts), 28+/2−. Branched off current origin/main; structurally identical to the existing approvalStatusField .meta({ description, xRef }).

Companion

Consumed by objectui PR objectstack-ai/objectui#1424 (polymorphic reference pickers). The frontend degrades gracefully without these annotations.

Test plan

  • Verified (isolated tsx probe) that all three xRef annotations survive z.toJSONSchema(ApprovalNodeConfigSchema, { io: 'input' }) with their descriptions preserved.
  • objectui adapter unit tests assert the published shape → reference fields/columns (12/12).

…nces

Adds `xRef` annotations to two Approval-node config strings so the Studio
flow designer renders pickers instead of free text (ADR-0018 §configSchema),
mirroring the existing `approvalStatusField` annotation:

- `approvers[].value` — a *polymorphic* reference (`kindFrom: 'type'`): the
  concrete picker follows the sibling `type` column (user / role / team /
  department / queue), or an object-field picker resolved from the flow's
  `$trigger` object when `type` is `field`. `manager` and any unmapped value
  carry no `value` and stay free text.
- `escalation.escalateTo` — a `role` reference (the common case); free text is
  still accepted for a specific user id.

Both fold the annotation and description into a single `.meta()` so neither is
dropped from the published `z.toJSONSchema` config contract. Consumed by the
companion objectui PR's reference pickers.
@vercel
Copy link
Copy Markdown

vercel Bot commented May 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Building Building Preview, Comment May 31, 2026 2:18pm

Request Review

@xuyushun441-sys xuyushun441-sys merged commit 7be028a into main May 31, 2026
10 of 11 checks passed
@xuyushun441-sys xuyushun441-sys deleted the feat/approval-xref-pickers branch May 31, 2026 14:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants