feat(spec+approvals+lint): approver value bindings, retire queue authoring (#3508)#3536
Merged
Merged
Conversation
…oring (#3508) The designer's approver Value cell silently degraded to free text because it sourced user/team/department candidates from the metadata registry (GET /api/v1/meta/:type), which lists no records. Declare the contract once in the spec so every designer sources it right: - spec: export APPROVER_VALUE_BINDINGS (per-type value sourcing — record lookup objects + committed field, closed enum, auto, trigger-field, unsupported), ORG_MEMBERSHIP_LEVELS, and NON_AUTHORABLE_APPROVER_TYPES; publish 'queue' in xEnumDeprecated (declared-but-unenforced: the engine has no queue branch, the slot resolves to nobody) and map 'manager' in the value xRef so designers can render its auto-resolved state. - plugin-approvals: warn when a stored queue approver is skipped at resolution time instead of dying silently into the 'queue:<id>' literal. - lint: new approval-approver-type-unsupported warning, data-driven from APPROVER_VALUE_BINDINGS, so authoring a queue approver is called out at publish time (declared != enforced, Prime Directive #10). Queue still parses — stored flows keep loading and rendering for the deprecation window. Designer-side record lookups land in objectui. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GzRYYvxLHqzrqG2EceDKFm
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
# Conflicts: # packages/spec/src/automation/approval.zod.ts
Contributor
📓 Docs Drift CheckThis PR changes 3 package(s): 104 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…ed (#3508) The approver `value` description no longer advertises queue; regenerate the generated reference page to match, and say plainly in the approvals guide that a queue approver parses but resolves to nobody. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GzRYYvxLHqzrqG2EceDKFm
os-zhuang
marked this pull request as ready for review
July 27, 2026 06:22
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.
框架侧落地 #3508(设计器侧改动在 objectui 同名分支 PR)。
问题
流程设计器里审批节点 Approvers → Value 退化为纯手填:控件把
user/team/department等接到了元数据注册表端点(GET /api/v1/meta/:type),而这些处理人是数据记录(sys_user/sys_team/sys_business_unit),注册表里列不出来,候选恒空。另外queue类型在引擎里没有解析分支(resolveApproverSpec无 queue 分支,落到死值queue:<id>),是"已声明未实现"。改动
spec(
packages/spec/src/automation/approval.zod.ts)——把「注册表 vs 数据记录」的分流规则写进契约:APPROVER_VALUE_BINDINGS:逐类型声明 Value 的数据来源与存值 ——user→sys_user(id)、team→sys_team(id)、department→sys_business_unit(id,不是 sys_department)、position→sys_position(存机器名 name,与引擎sys_user_position.position按名路由一致、跨环境可移植)、org_membership_level→闭合枚举、manager→运行时自动解析、field→触发对象字段、queue→unsupported。satisfies保证与ApproverType枚举完备对齐(新增枚举成员不声明绑定即编译错)。NON_AUTHORABLE_APPROVER_TYPES(= 弃用拼写 +queue),经xEnumDeprecated发布 —— 设计器下拉不再提供queue,存量行仍解析、仍渲染(与role同机制,弃用窗口内不破坏)。plugin-sharing 早已用同样方式退役其未实现的queuerecipient,平台口径一致。xRef.map补manager: 'manager',设计器可渲染「自动解析」态。plugin-approvals(
approval-service.ts):queue审批人在解析时落死值前输出logger.warn,静默死槽至少对运维可见。lint(
validate-approval-approvers.ts):approval-approver-type-unsupported(warning),数据驱动自APPROVER_VALUE_BINDINGS(source === 'unsupported'),发布/authoring 时点名「声明未实现」的审批人类型(Prime Directive chore: version packages #10/Add comprehensive test suite for Zod schema validation #12:declared ≠ enforced,在生产者侧大声报错)。为什么 queue 选弃用而不是补实现
正确的 queue-as-approver 语义是「组内任一成员认领后处理」(参照 Salesforce queue approver / ServiceNow group approval),需要 queue 实体 + 成员表 + claim 动作 + 审批槽位改造,且应与 sharing 的 queue recipient 一起设计成平台级 ownership-queue,不宜在审批里单独造一个。在那之前提供该选项就是宣传引擎不兑现的能力。
测试
packages/spec全量 258 文件 / 6885 用例通过(含新增:bindings 完备性、逐绑定与引擎语义对齐、xEnumDeprecated 含 role+queue、xRef map 含 manager/queue)。plugin-approvals136 用例通过(含新增:queue spec 落死值 + warn)。packages/lint24 文件 / 327 用例通过(含新增 unsupported 规则用例;原「queue 静默通过」用例按新行为更新)。验收对照(issue #3508)
Closes 无(保持 #3508 打开直至 objectui 侧合并)。
🤖 Generated with Claude Code
https://claude.ai/code/session_01GzRYYvxLHqzrqG2EceDKFm
Generated by Claude Code