Skip to content

Commit 25fedfd

Browse files
fix(approvals): retire approval as a metadata type — flow-node only (ADR-0019) (#1410)
ADR-0019 P4/P5 collapsed approval authoring into Flow (an Approval node, `type: 'approval'`), but a few registrations of `approval` as a *standalone metadata type* were left behind — contradicting metadata-type-schemas.ts, which already dropped it. The result: Studio still rendered an "Approval Processes" nav entry routing to a `metadata/approval` designer for a type with no schema, and /meta/types still surfaced the type. Remove the leftovers and their blast radius: - Drop `approval` from the MetadataTypeSchema enum (spec + metadata-core mirror). - Drop the `Approval Process` descriptor (and its `**/*.approval.ts` loader patterns) from DEFAULT_METADATA_TYPE_REGISTRY. - Remove the hardcoded `nav_approvals` Studio nav item + its 4 hand-maintained locale labels. - Strip the stale `approval` form block from the 4 *.metadata-forms.generated.ts. - Update metadata-plugin.test.ts (drop `approval`; add a guard that it is now rejected as a metadata type). Approval state (sys_approval_request / sys_approval_action, record lock, status mirror) and the Approval *node* config (ApprovalNodeConfigSchema) are unchanged. Verified: build clean (spec, metadata-core, platform-objects); 465 tests pass. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
1 parent 51e35ce commit 25fedfd

12 files changed

Lines changed: 13 additions & 253 deletions

File tree

packages/metadata-core/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const MetadataTypeSchema = z.enum([
2929
'action',
3030
'flow',
3131
'workflow',
32-
'approval',
32+
// ADR-0019: `approval` is a flow node, not a metadata type.
3333
'job',
3434
'agent',
3535
'tool',

packages/platform-objects/src/apps/studio.app.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -215,14 +215,8 @@ export const STUDIO_APP: App = {
215215
params: { type: 'workflow', package: '{active_package}' },
216216
icon: 'zap',
217217
},
218-
{
219-
id: 'nav_approvals',
220-
type: 'component',
221-
label: 'Approval Processes',
222-
componentRef: 'metadata:resource',
223-
params: { type: 'approval', package: '{active_package}' },
224-
icon: 'check-circle',
225-
},
218+
// ADR-0019: no standalone "Approval Processes" nav — approvals are
219+
// authored as Approval nodes inside a Flow (see nav_flows above).
226220
],
227221
},
228222
{

packages/platform-objects/src/apps/translations/en.metadata-forms.generated.ts

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -788,65 +788,6 @@ export const enMetadataForms: NonNullable<TranslationData['metadataForms']> = {
788788
}
789789
}
790790
},
791-
approval: {
792-
label: "Approval Process",
793-
sections: {
794-
basics: {
795-
label: "Basics",
796-
description: "Approval process identity and the object it gates."
797-
},
798-
entry_rules: {
799-
label: "Entry rules",
800-
description: "Who can submit, and what happens to the record while pending."
801-
},
802-
steps: {
803-
label: "Steps",
804-
description: "Ordered approval chain — each step picks the approver and decides routing."
805-
},
806-
escalation_and_outcomes: {
807-
label: "Escalation & outcomes",
808-
description: "SLA, escalation, and post-decision actions."
809-
}
810-
},
811-
fields: {
812-
name: {
813-
helpText: "Unique identifier (snake_case)"
814-
},
815-
label: {
816-
helpText: "Display name (e.g., \"Contract Approval\")"
817-
},
818-
object: {
819-
helpText: "Which object needs approval"
820-
},
821-
active: {
822-
helpText: "Enable/disable this approval process"
823-
},
824-
description: {
825-
helpText: "What gets approved and why"
826-
},
827-
entryCriteria: {
828-
helpText: "CEL expression: users can submit only when this is true"
829-
},
830-
lockRecord: {
831-
helpText: "Lock record from editing while approval is pending"
832-
},
833-
approvalStatusField: {
834-
helpText: "Field name to mirror approval status (e.g., \"approval_status\")"
835-
},
836-
steps: {
837-
helpText: "Approval steps in order — each step defines who approves and what happens"
838-
},
839-
escalation: {
840-
helpText: "Auto-escalate or auto-approve after timeout"
841-
},
842-
onFinalApprove: {
843-
helpText: "Actions when all steps approved (e.g., update status)"
844-
},
845-
onFinalReject: {
846-
helpText: "Actions when rejected (e.g., notify submitter)"
847-
}
848-
}
849-
},
850791
job: {
851792
label: "Background Job"
852793
},

packages/platform-objects/src/apps/translations/en.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ export const en: TranslationData = {
123123
group_automation: { label: 'Automation' },
124124
nav_flows: { label: 'Flows' },
125125
nav_workflows: { label: 'Workflow Rules' },
126-
nav_approvals: { label: 'Approval Processes' },
127126
group_ai: { label: 'AI' },
128127
nav_agents: { label: 'Agents' },
129128
nav_tools: { label: 'Tools' },

packages/platform-objects/src/apps/translations/es-ES.metadata-forms.generated.ts

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -788,65 +788,6 @@ export const esESMetadataForms: NonNullable<TranslationData['metadataForms']> =
788788
}
789789
}
790790
},
791-
approval: {
792-
label: "Proceso de aprobación",
793-
sections: {
794-
basics: {
795-
label: "Aspectos básicos",
796-
description: "Identidad del proceso de aprobación y el objeto que controla."
797-
},
798-
entry_rules: {
799-
label: "Reglas de entrada",
800-
description: "Quién puede enviar y qué ocurre con el registro mientras está pendiente."
801-
},
802-
steps: {
803-
label: "Pasos",
804-
description: "Cadena de aprobación ordenada — cada paso elige aprobador y decide el enrutado."
805-
},
806-
escalation_and_outcomes: {
807-
label: "Escalado y resultados",
808-
description: "SLA, escalado y acciones posteriores a la decisión."
809-
}
810-
},
811-
fields: {
812-
name: {
813-
helpText: "Identificador único (snake_case)"
814-
},
815-
label: {
816-
helpText: "Nombre mostrado (p. ej., \"Contract Approval\")"
817-
},
818-
object: {
819-
helpText: "Qué objeto necesita aprobación"
820-
},
821-
active: {
822-
helpText: "Activa/desactiva este proceso de aprobación"
823-
},
824-
description: {
825-
helpText: "Qué se aprueba y por qué"
826-
},
827-
entryCriteria: {
828-
helpText: "Expresión CEL: los usuarios solo pueden enviar cuando esto sea true"
829-
},
830-
lockRecord: {
831-
helpText: "Bloquea la edición del registro mientras la aprobación está pendiente"
832-
},
833-
approvalStatusField: {
834-
helpText: "Nombre de campo para reflejar el estado de aprobación (p. ej., \"approval_status\")"
835-
},
836-
steps: {
837-
helpText: "Pasos de aprobación en orden — cada paso define quién aprueba y qué ocurre"
838-
},
839-
escalation: {
840-
helpText: "Escala o aprueba automáticamente tras el tiempo de espera"
841-
},
842-
onFinalApprove: {
843-
helpText: "Acciones cuando todos los pasos se aprueban (p. ej., actualizar estado)"
844-
},
845-
onFinalReject: {
846-
helpText: "Acciones al rechazar (p. ej., notificar al remitente)"
847-
}
848-
}
849-
},
850791
job: {
851792
label: "Trabajo en segundo plano"
852793
},

packages/platform-objects/src/apps/translations/es-ES.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ export const esES: TranslationData = {
100100
group_automation: { label: 'Automatización' },
101101
nav_flows: { label: 'Flujos' },
102102
nav_workflows: { label: 'Reglas de flujo de trabajo' },
103-
nav_approvals: { label: 'Procesos de aprobación' },
104103
group_ai: { label: 'IA' },
105104
nav_agents: { label: 'Agentes' },
106105
nav_tools: { label: 'Herramientas' },

packages/platform-objects/src/apps/translations/ja-JP.metadata-forms.generated.ts

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -788,65 +788,6 @@ export const jaJPMetadataForms: NonNullable<TranslationData['metadataForms']> =
788788
}
789789
}
790790
},
791-
approval: {
792-
label: "承認プロセス",
793-
sections: {
794-
basics: {
795-
label: "基本",
796-
description: "承認プロセス ID と対象オブジェクト。"
797-
},
798-
entry_rules: {
799-
label: "エントリールール",
800-
description: "送信可能者と保留中レコードの動作。"
801-
},
802-
steps: {
803-
label: "ステップ",
804-
description: "順序付き承認チェーン — 各ステップで承認者とルーティングを決定。"
805-
},
806-
escalation_and_outcomes: {
807-
label: "エスカレーションと結果",
808-
description: "SLA、エスカレーション、決定後アクション。"
809-
}
810-
},
811-
fields: {
812-
name: {
813-
helpText: "一意識別子(snake_case)"
814-
},
815-
label: {
816-
helpText: "表示名(例: \"Contract Approval\")"
817-
},
818-
object: {
819-
helpText: "承認が必要なオブジェクト"
820-
},
821-
active: {
822-
helpText: "この承認プロセスの有効/無効"
823-
},
824-
description: {
825-
helpText: "承認対象と理由"
826-
},
827-
entryCriteria: {
828-
helpText: "CEL 式: これが true の場合のみユーザーが送信可能"
829-
},
830-
lockRecord: {
831-
helpText: "承認保留中はレコード編集をロック"
832-
},
833-
approvalStatusField: {
834-
helpText: "承認状態を反映するフィールド名(例: \"approval_status\")"
835-
},
836-
steps: {
837-
helpText: "順序付き承認ステップ — 各ステップで承認者と処理を定義"
838-
},
839-
escalation: {
840-
helpText: "タイムアウト後に自動エスカレーションまたは自動承認"
841-
},
842-
onFinalApprove: {
843-
helpText: "全ステップ承認時のアクション(例: ステータス更新)"
844-
},
845-
onFinalReject: {
846-
helpText: "却下時のアクション(例: 申請者へ通知)"
847-
}
848-
}
849-
},
850791
job: {
851792
label: "バックグラウンドジョブ"
852793
},

packages/platform-objects/src/apps/translations/ja-JP.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ export const jaJP: TranslationData = {
100100
group_automation: { label: '自動化' },
101101
nav_flows: { label: 'フロー' },
102102
nav_workflows: { label: 'ワークフロールール' },
103-
nav_approvals: { label: '承認プロセス' },
104103
group_ai: { label: 'AI' },
105104
nav_agents: { label: 'エージェント' },
106105
nav_tools: { label: 'ツール' },

packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -788,65 +788,6 @@ export const zhCNMetadataForms: NonNullable<TranslationData['metadataForms']> =
788788
}
789789
}
790790
},
791-
approval: {
792-
label: "审批流",
793-
sections: {
794-
basics: {
795-
label: "基础信息",
796-
description: "名称与目标对象"
797-
},
798-
entry_rules: {
799-
label: "进入规则",
800-
description: "何时进入审批"
801-
},
802-
steps: {
803-
label: "审批步骤",
804-
description: "逐级审批配置"
805-
},
806-
escalation_and_outcomes: {
807-
label: "升级与结果",
808-
description: "超时升级与最终处理"
809-
}
810-
},
811-
fields: {
812-
name: {
813-
helpText: "唯一标识符(snake_case)"
814-
},
815-
label: {
816-
helpText: "显示名(如:\"合同审批\")"
817-
},
818-
object: {
819-
helpText: "需要审批的对象"
820-
},
821-
active: {
822-
helpText: "启用或禁用此审批流"
823-
},
824-
description: {
825-
helpText: "审批的对象与原因"
826-
},
827-
entryCriteria: {
828-
helpText: "CEL 表达式:满足时用户可提交"
829-
},
830-
lockRecord: {
831-
helpText: "审批待处理期间锁定记录,禁止编辑"
832-
},
833-
approvalStatusField: {
834-
helpText: "用于镜像审批状态的字段名(如 \"approval_status\")"
835-
},
836-
steps: {
837-
helpText: "按顺序排列的审批步骤——每一步定义由谁审批以及结果"
838-
},
839-
escalation: {
840-
helpText: "超时后自动升级或自动通过"
841-
},
842-
onFinalApprove: {
843-
helpText: "所有步骤通过后的动作(如更新状态)"
844-
},
845-
onFinalReject: {
846-
helpText: "被拒绝后的动作(如通知提交人)"
847-
}
848-
}
849-
},
850791
job: {
851792
label: "后台作业"
852793
},

packages/platform-objects/src/apps/translations/zh-CN.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ export const zhCN: TranslationData = {
100100
group_automation: { label: '自动化' },
101101
nav_flows: { label: '流程' },
102102
nav_workflows: { label: '工作流规则' },
103-
nav_approvals: { label: '审批流程' },
104103
group_ai: { label: 'AI' },
105104
nav_agents: { label: '智能体' },
106105
nav_tools: { label: '工具' },

0 commit comments

Comments
 (0)