Commit 047602e
feat(approvals): retire process engine — approval is flow-node only (ADR-0019 P4/P5) (#1408)
* feat(approvals): remove process-driven engine; approval is flow-node only (ADR-0019 P4/P5)
Destructive removal of the standalone approval *process* engine. After ADR-0019
P1-P3 made approval work as a durable-pause flow node, this lands A4/A5: the
process model is gone and approval exists only as `type: 'approval'` on a Flow.
Removed:
- spec: ApprovalProcessSchema/Step/Action, approval.form.ts, `approvals` stack
collection (metadata-collection, stack.zod, metadata-type-schemas,
metadata-form-registry), process_hash pinning
- platform-objects: sys_approval_process object + nav + i18n; reframed
sys_approval_request to node-era (process_name -> Source, no process_hash)
- plugin-approvals: action-executor.ts, process defineProcess/submit/recall,
per-object process hooks -> single node-era global record-lock hook;
decide() bridges decision -> engine resume; phase-b.test deleted,
approval-service.test rewritten to drive the node
- rest: /approvals/processes + submit + recall routes (kept request reads +
approve/reject decision routes wired to svc.decide)
- runtime: app-plugin process seeder
- cli/metadata: `approvals` stats + plural mapping
Migrated examples off `approvals:` to approval-node flows:
- app-crm: DiscountApprovalFlow
- app-showcase: BudgetApprovalFlow
connector_action is retained as a deliberate ADR-0018 open extension point.
Green: spec/platform-objects/plugin-approvals/runtime/rest/cli/metadata/
service-automation + app-crm/app-showcase.
* refactor(approvals): single decision path + give CRM example a mirror field
Self-review follow-ups on the P4/P5 removal:
- Drop decideApprovalNode (approval-node.ts) — it duplicated the resume
orchestration now owned by the contract entrypoint ApprovalService.decide().
Migrated approval-node.test.ts to drive decide() via attachAutomation, and
removed the now-unused export. One decision/resume path, not two.
- Add a readonly approval_status select to crm_opportunity so the Discount
Approval flow's approvalStatusField mirror has a real target (the mirror is
try/caught, so before this it silently no-op'd in the example).
* test(objectql): migrate stale workflow fixture in metadata sweep to state-machine shape
The metadata-validation-sweep workflow fixture still used the legacy
workflow-rule shape (objectName/triggerType/criteria); `workflow` maps to
StateMachineSchema (id/initial/states) since the workflow→state-machine
migration, so the valid fixture failed validation. Updated it to a minimal
valid state machine. Pre-existing failure surfaced by Test Core; unrelated to
the approval node work but fixed here to keep CI green.
---------
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>1 parent c94827d commit 047602e
48 files changed
Lines changed: 794 additions & 3053 deletions
File tree
- docs/adr
- examples
- app-crm
- src
- approvals
- flows
- objects
- app-showcase
- src
- approvals
- flows
- test
- packages
- cli/src/utils
- metadata/src
- objectql/src
- platform-objects
- scripts
- src
- apps
- translations
- audit
- plugins/plugin-approvals/src
- rest/src
- runtime/src
- spec/src
- automation
- contracts
- data
- kernel
- system
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
150 | 155 | | |
151 | 156 | | |
152 | 157 | | |
153 | 158 | | |
154 | 159 | | |
155 | 160 | | |
156 | | - | |
| 161 | + | |
| 162 | + | |
157 | 163 | | |
158 | 164 | | |
159 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
| |||
105 | 104 | | |
106 | 105 | | |
107 | 106 | | |
108 | | - | |
109 | 107 | | |
110 | 108 | | |
111 | 109 | | |
| |||
Lines changed: 0 additions & 36 deletions
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | | - | |
| 11 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
59 | 72 | | |
60 | 73 | | |
61 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
85 | 84 | | |
86 | 85 | | |
87 | 86 | | |
88 | | - | |
89 | 87 | | |
90 | 88 | | |
91 | 89 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
70 | | - | |
| 70 | + | |
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| |||
0 commit comments