feat(approvals): retire process engine — approval is flow-node only (ADR-0019 P4/P5) - #1408
Merged
Merged
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… 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).
…tate-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.
xuyushun441-sys
added a commit
that referenced
this pull request
May 31, 2026
…1409) P4/P5 (#1408) removed the standalone approval-process engine; approval now exists only as a `type: 'approval'` flow node. This brings the docs and the automation skill back in line with that — no code changes. - skills/objectstack-automation/SKILL.md: drop the deleted ApprovalProcess API; rewrite the approval section to the node model (config schema, approve/reject edges, decision via ApprovalService.decide), add `approval` to the Flow node table (19 node types), add the old→new re-home mapping, refresh best practices + CRM blueprint. - README / guides/packages / concepts/packages: fix the plugin one-liner (no more "approval-process engine"/sys_approval_process). - references/*: regenerate auto-docs from current schemas — approval.mdx now shows ApprovalNodeConfig/ApprovalDecision/etc; also syncs other drifted auto-docs whose schemas changed but weren't regenerated (workflow.mdx -> state-machine.mdx, field `secret` type, ADR-0018 open-registry text, …). Historical records left as-is: CHANGELOGs, ROADMAP milestone, ADR 0009/0018. Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Destructive removal phase of ADR-0019 (approval as a flow node). With P1–P3 (#1407) approval already worked as a durable-pause flow node; this PR lands A4/A5 and deletes the standalone approval process engine. Approval now exists only as
type: 'approval'on a Flow.What changed
Removed
ApprovalProcessSchema/ApprovalStepSchema/ApprovalActionSchema,approval.form.ts, theapprovalsstack collection (metadata-collection,stack.zod,metadata-type-schemas,metadata-form-registry),process_hashpinning.sys_approval_processobject + Setup nav + i18n;sys_approval_requestreframed to the node era (process_name→ Source, noprocess_hash).action-executor.ts,defineProcess/ submit / recall, per-object process hooks → one node-era global record-lock hook reading policy from the request'snode_config_json;decide()bridges a decision into the engine'sresume(runId, { branchLabel }).phase-b.test.tsdeleted;approval-service.test.tsrewritten to drive the node./approvals/processes+ submit + recall routes (kept request reads + approve/reject decision routes, now viasvc.decide).approvalsstats + plural→singular mapping.Migrated examples off
approvals:DiscountApprovalFlowBudgetApprovalFlowconnector_actionis retained — a deliberate ADR-0018 open extension point, not a process remnant.Test plan
Green builds + tests across: spec (6601), platform-objects (78), plugin-approvals (29), runtime (325), rest (78), cli (137), metadata (241), service-automation (79), and both example apps (app-crm 29, app-showcase 8).