Repository navigation
fix(plugin-approvals): an expression approver id that names no account adds no phantom slot - #27926
Conversation
…t no longer opens a slot An `expression` approver resolved as users (`resolveAs: 'user'`, the default) now asks the same `namesNoAccount` predicate the `field` branch asks: an id no account carries warns "expanded to nobody" and adds no slot, so an emptied slate reaches the node's onEmptyApprovers. A failed directory read keeps the slot; a dead out-of-office delegate routes back to the id. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czYgbnZDQp3qTKCWae
📓 Docs Drift Check1 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 6 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 1094deee484df08cfe1df4f4f7de062220aa9a63 && git checkout 1094deee484df08cfe1df4f4f7de062220aa9a63
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin d4064cc159ce0804091278eb964d8da8e05dec87 188c4d0fa760dbc884bdcad1be74fc7a9a092d81 && git checkout -B drift-repro d4064cc159ce0804091278eb964d8da8e05dec87 && git merge --no-ff 188c4d0fa760dbc884bdcad1be74fc7a9a092d81
node scripts/docs-audit/affected-docs.mjs --json d4064cc159ce0804091278eb964d8da8e05dec87 |
|
domain:server#3 · os-elon-musk · session_016WV4czuTWNgKR22fKv7jia Seat ACCEPT · PR #27926 · head
|
Requested by Elon · project thread
Fixes #27879
维护者速读
expression,默认按用户解析)时,如果算出的 id 没有对应账号,不再生成一个没人能处理的空槽位。user和field两条路径已经在 fix(plugin-approvals): a user approver naming no account expands to nobody and takes onEmptyApprovers #27749、fix(plugin-approvals): a field approver id or an out-of-office delegate that names no account adds no phantom slot #27852 修好,表达式这条兄弟路径还会让审批单卡在一个不存在的人身上,节点的兜底策略也不触发。plugin-approvals的表达式审批人展开,复用 fix(plugin-approvals): a field approver id or an out-of-office delegate that names no account adds no phantom slot #27852 的同一个判定;目录读取失败时保留原槽位。回滚即还原这一个提交。approval-service.ts里resolveExpressionApprovers的resolveAs === 'user'分支。pnpm --filter @objectstack/plugin-approvals exec vitest run src/approval-service.test.ts -t 27879,5 条用例全绿。What changes
expressionwithresolveAs: 'user'(resolveExpressionApprovers): each id the expression yields now takes fix(plugin-approvals): a field approver id or an out-of-office delegate that names no account adds no phantom slot #27852'sfieldtreatment. It is a slot only when an account carries it, asked through the same privatenamesNoAccountpredicate (reused, not copied). An id no account carries logs the shared "expanded to nobody" warning (naming the id and the expression source), adds no slot, and a slate it empties reaches the node'sonEmptyApprovers. A failed directory read keeps the slot. Out-of-office delegation keeps fix(plugin-approvals): a field approver id or an out-of-office delegate that names no account adds no phantom slot #27852's fallback: a dead delegate routes back to the expression's id.resolveAs: department / position / team) are untouched.Why
#27397 and #27752 closed the phantom-slot path for
userandfieldapprovers. Theexpressionbranch still handed an id no account carries straight to the slate: the request opened on a slot nobody could take, with no warning and noonEmptyApprovers.Verification
mainfirst: of the 5 new cases, 2 were red (the warning/no-slot case and the emptied-slate fallback case), and the 3 pins (live ids quiet, failed read keeps the slot, dead delegate falls back to the id) were green.plugin-approvalsfull suite: 105 files, 1352 tests pass. Five existing cases routed expression slots to ids their test double's directory did not carry (old_reviewer,u3,u4,u6,u7,u8). Their fixtures now staff those accounts, test-only, as fix(plugin-approvals): a field approver id or an out-of-office delegate that names no account adds no phantom slot #27852 did forfield.dispatch-gates --commandsfamily pluspnpm lint: reported on the card thread.Clause-②: no
Metadata-protocol: none
Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4czYgbnZDQp3qTKCWae