Skip to content

Approvals: recall admits the org-admin override actor and resumes the reject edge without the owning flow's decision admission (follow-up of objectstack#39126) #39145

Backlog

Description

@objectstack-fleet

repo:cloud#3 · zhuangjianguo · session_01TsNV8Bsjqmw7aXCo2QuLU1

Filing category ③: a follow-up from the contract review of PR #39143 (objectstack#39126), record 7347782447, item 2. Read on code.

维护者速读

Where

  • packages/plugins/plugin-approvals/src/approval-service.ts: the recall override arm, around :9767-9768.
  • decision-admission.ts: the ApprovalDecisionVerb set.

Acceptance

  • Per the ruling, a recall either reaches the owning flow's admission (verb recall, or the override arm only), or the exception is stated in the contract's jsdoc.
  • A test covers it.

Dedupe: objectstack recall decision admission 0.

Activity

  1. added
    bug
    needs-user-decision
    on Dec 2, 2026
  2. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    ContributorAuthor

    triage@os-warren · os-warren · session_01JQwxbZzZ2f5mzcvJbRrRNZ

    First touch · 2026-12-02T14:07Z

    定级:area:workflow · Bug · p3 · 组织管理员越权撤回待审申请时绕过拥有流程的决定检查 · 读码(PR #39143 合同审阅)

    • 补 area:workflow、domain:server、类型 Bug;状态保持 needs-user-decision,待维护者裁定撤回是否走检查。
  3. added
    area:workflow
    domain:server
    on Dec 2, 2026
  4. objectstack-fleet commented on Dec 5, 2026

    @objectstack-fleet
    ContributorAuthor

    triage@hotlong · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Decision analysis at tier, re-run before presenting · 2026-12-05T22:31Z

    维护者速读

    • 问题:上一张卡让「拥有审批流程的服务」能在批准、驳回、退回被记下之前先拒绝,但「撤回」不问它。云端市场审核里,发布方组织的管理员(仅限旧申请)或提交人撤回审核申请后,申请显示「已撤回」,流程随后报错停住,版本仍是「待审核」却没有对应的申请;很少发生,目前只有云端市场审核会碰到,没有线上报告。
    • 选项:①所有撤回都先问一遍:不允许撤回的流程直接提示「无权」,什么都不写,约 3 个 PR(平台 1、云端 1、决策记录附注 1);②只问管理员代办的撤回:管理员被挡住,提交人自己撤回仍会留下上面的残局,PR 数相同;③都不问,维持现状并写明这是例外:平台只补附注 1 个 PR,云端自己让流程容忍撤回(1 个 PR),但流程永远无法禁止撤回。
    • 推荐:选①,因为「谁能结束这一步审批」应该由一条规则管住所有入口,撤回是结束它的第三个入口,主流平台也是由流程自己决定能不能撤回。
    • 不定会怎样:没有数据丢失,版本不会被误批或误拒;残局继续可能出现,平台管理员仍可在云端后台直接处理该版本,云端的文档和测试会一直挂着这张卡。

    Analysis

    Served-tier: CONTRACT_REVIEW_TIER
    Analysed-by: subagent of session_01Q4EjjMnyLqJdzuktEmRPXH

    Read at: objectstack origin/main e37358096d; cloud origin/main 704ae41ec.

    Background

    #39126 (ruling record 7344644972, option A; PR #39143, merged 2026-12-02, +828/−0) gave the service that owns a flow a declared check that the approvals service asks before it records a decision. It is asked for approve, reject and revise. Recall is not asked, and the contract says so. The contract review of PR #39143 (record 7347782447, ③) did not accept the dev's reason for leaving recall out ("the submitter's withdrawal") because recall also admits the organization-administrator override and a system context, and it asked for a card. This is that card. It also carries the review's should-fix: a dated addendum on ADR-0019 naming the admission seam.

    Governing text

    Protocol statement

    No metadata protocol change under any option (Metadata-protocol: none): no Zod schema, no authorable key, no wire shape. Options A and B widen a TypeScript contract in @objectstack/spec/contracts (ApprovalDecisionVerb gains recall). That is a behaviour change for an already registered check: it starts receiving a verb it was not written for. One registrant exists (cloud). Option C changes nothing.

    Premises, re-checked on origin/main

    1. Recall asks no admission. Holds. git show origin/main:packages/plugins/plugin-approvals/src/approval-service.ts | grep -n "decisionAdmissions.admit" → two hits, in decideNode (7897) and sendBack (9429); none in recall (8734).
    2. The override arm reaches a pending recall. Holds, but the card's line reference has moved: the arm is at 8770-8771 now (overrideAdmits), not 9767-9768.
    3. Recall resumes the reject edge. Holds for pending (branchLabel: APPROVAL_BRANCH_LABELS.reject, output: { decision: 'recall' }). On returned the run is cancelled instead and no flow node runs.
    4. "Error, but the record is written, as in objectstack-ai/cloud#4639." Partly moved. Recall does not answer 500. It tolerates the failed resume by ruling ([Decision] Must a resume failure reach the CALLER in a shape it can act on? — the family question triage reserved, now that its instance cards have each measured their own half and stopped at the same contract #16472) and answers 200 with resumed: false and resumeFailure. What is left: the request reads recalled, the run is stranded at the owning flow's refusal, and the subject is unchanged. Cloud pins exactly this in apps/cloud/test/marketplace-review-flow-isolated.test.ts ("a withdrawal by someone who is not a platform administrator does not reject the version": version still pending, run error contains "not made by a platform administrator"), and cloud's design doc §6.7 names this card as the owner.
    5. Reach of the override arm is narrower than the card reads. isOverrideActor closes the tenant arm on a slate holding the platform administrators' slot, so on cloud only requests opened before objectstack-ai/cloud#4299 are reachable by an organization administrator. Same population as Approvals: the flow that owns an approval step cannot refuse a decision before it is recorded, so its rule answers 500 RESUME_FAILED and leaves the request decided #39126.
    6. Not on the card: the submitter's own recall has the same end state on cloud, on new requests too. Cloud's finalize step honours a resume only when the review step's decision equals the branch's decision (reject); a recall carries recall, so it refuses whoever recalled, a platform administrator included. Read on code (packages/service-cloud/src/marketplace-review-flow.ts, madeHere), not measured; whether a publisher is offered the recall button on a review request was not measured either.
    7. The card's Acceptance alternative "the exception is stated in the contract's jsdoc" is already true on origin/main (premise from the governing text above, also in both CHANGELOGs: "A recall is not asked"). Option C therefore needs no framework code.
    8. One registrant: git grep -n registerDecisionAdmission origin/main -- packages content docs shows only the service, the contract and the guide; cloud registers one check for its review flow.

    The concrete problem

    A service can now say "this person may not approve, reject or send back this step" and have nothing recorded. It cannot say the same about a withdrawal. A withdrawal ends the step as surely as a rejection does: it writes the audit row, sets the request terminal, clears the approvers and runs the owning flow's reject branch. A flow whose rule is about who may end the review therefore still meets one record it could not refuse.

    Options

    What is done What the customer sees Effort
    A. Every recall is asked, verb recall recall asks the admission after its own refusals and before its audit row, for the submitter, a system context and the override alike; the check gets viaOverride and context and narrows as it likes A flow that does not allow a withdrawal answers "not allowed" with its own message; nothing is written, the request stays pending. Flows with no registered check behave as today Framework lane, 1 PR, small: one union member, one call, jsdoc, tests, changeset. Precedent PR #39143 (+828/−0) built the whole seam; this adds one verb to it. Plus 1 cloud PR to adopt, plus the ADR addendum PR
    B. Only the override recall is asked Same call, guarded by the override arm An administrator's recall can be refused cleanly; a submitter's recall on the same flow still leaves a recalled request and a stranded run Same PR count as A; no precedent for an arm-conditional ask
    C. Neither Nothing in the framework (the exception is already stated). Cloud makes its reject branch tolerate recall Recall always succeeds; a flow can clean up after it but can never forbid it 0 framework code PRs, 1 cloud PR, plus the ADR addendum PR

    Business reading: A is "the process owner decides whether a request can be withdrawn, and by whom". B is "the owner may stop an administrator from withdrawing on someone's behalf, but never the applicant". C is "anyone the engine lets withdraw can always withdraw; the process only reacts".

    A subsumes B: under A a check that wants B's rule returns admit when viaOverride is false.

    Four axes

    os-decision-facets
    ① Long-term soundness: A shrinks special cases. The contract becomes "every act by a person that ends a pending step asks the owner first" with no listed exception. B adds a conditional ("asked on this arm only") that every future reader must remember. C keeps a named hole in a seam that is two days old. End state in two years: the owning service is the single authority on who ends its step, through every door. Mainstream reference: Salesforce approval processes carry a per-process "allow submitters to recall" setting and separate recall actions, so recallability belongs to the process, not to the engine. Reading: A.
    ② Real pull: one consumer (cloud marketplace review), the same one that pulled #39126. The shape is reproduced in cloud's isolated suite; there is no production report. Reach is rare: pre-#4299 requests for the override arm, plus any submitter recall (read on code). Low pull, not zero.
    ③ Preventing AI mistakes: A is a loud refusal before any write. Today the miss is quiet: a 200 answer, a recalled request, a stranded run that only an operator reading resumeFailure or the run log sees. A also removes a trap for the next service author, who reads "every decision is asked" and writes a rule that recall walks around. Cost: the closed verb set grows by one, and a check that throws now blocks a withdrawal (fail closed, request still pending, recoverable).
    ④ Startup focus: A and B add one permanent verb to a public contract. C adds nothing. The verb already exists as an action kind, so no new vocabulary is minted.
    Prior rulings read: recall admission, recall decision admission, #12775, #16472, record 7344644972 → 6 and 63 search hits, none ruling this question; ADR-0019 D-none (no text on recall admission); thread: none

    Recommendation

    A: every recall passes the check, as verb recall.

    • Not B: it buys the same code for half the coverage and leaves the submitter path (premise 6) with the defect the card describes. It also hard-codes into the platform a judgment (the applicant's withdrawal can never be vetoed) that mainstream platforms leave to the process.
    • Not C: it is the cheapest and is a defensible reading of ADR-0019 (the flow handles recall on its reject branch), but it keeps "refused only after the record" alive on one door, which is the defect ruling 7344644972 was made to remove.

    Self-check: on ① alone the answer is A; do ②③④ flip it: no. ② is low and ④ counts one verb against A, so they bear on timing only: this is p3 and can wait behind anything in flight. Effort: A is one small framework PR more than C; the readings on ① are not close, so the difference does not bear on the letter.

    Confidence gaps, stated and not used to change the letter:

    • Premise 6 is read on code. A cloud test with the submitter recalling would settle it in minutes.
    • Whether the returned-window recall should be asked too. It cancels the run and no owning node executes, so the defect shape cannot arise there. Default proposed below: ask it as well, so the rule is "every recall"; the contract reviewer may narrow it.
    • Semver level. A check already registered starts seeing a new verb. feat(approvals): the service that owns an approval step can refuse a decision before it is recorded #39143 shipped as patch; whether this is patch or minor is the contract review's call.
    • The name ApprovalDecisionVerb now covers a withdrawal. The jsdoc has to say so; a rename is not proposed.

    After the ruling

    If A:

    1. Framework card (this one), one PR: recall joins ApprovalDecisionVerb; recall calls the admission after assertLatestForRun and before the audit-row insert, with viaOverride true only when the override arm admitted a non-submitter; the "not asked" sentences in the contract jsdoc, the guide paragraph and the changeset text are replaced. Tests: a check that refuses recall (403, nothing written, request pending, run parked) for submitter, override and system context; a check that admits it; a flow with no check unchanged.
    2. Cloud card, filed with the ruling at this card's priority: the review check answers recall explicitly, since the present verb-blind check would admit a platform administrator's recall that finalize then still refuses; the pinned test and design doc §6.7 are updated at the pin round.
    3. ADR-0019 addendum, separate add-only PR on the governed path, landed by its tier: dated, naming the admission seam, ruling record 7344644972 and this card's ruling, and stating that recall is asked.

    If B: as A, with the call guarded and the jsdoc stating the submitter and system arms are not asked. If C: close this card on the existing jsdoc; cloud takes a card to make its reject branch complete on recall; the ADR addendum states the exception.

    The ADR addendum is owed under every option. It needs no separate ruling beyond the tier's landing rule; only its last sentence depends on the letter.

    Related cards and PRs

    Delta from the card's existing analysis: none existed. The card carried a 速读 and no recommendation. Against the card's facts: the code reference moved (premise 2); the symptom is a 200 with a stranded run, not a 500 (premise 4); the override reach is limited to older requests (premise 5); the submitter path shows the same end state on cloud (premise 6, read on code); the "state the exception" acceptance is already met on origin/main (premise 7).

  5. objectstack-fleet commented on Dec 5, 2026

    @objectstack-fleet
    ContributorAuthor

    triage@hotlong · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Ruling: letter A · maintainer 「39526 三个都做。其他都接受你的建议」 · 2026-12-05T22:58Z

    Maintainer ruling recorded: every recall asks the owning flow's decision admission, as a new verb recall, for the submitter, a system context and the override alike, after its own refusals and before its audit row.

    Provenance

    • Who: the maintainer (hotlong). Where: the triage seat's session session_01Q4EjjMnyLqJdzuktEmRPXH, typed words, recorded within minutes. Words, verbatim: 「39526 三个都做。其他都接受你的建议」
    • What he answered: triage's Chinese walk-through of the nine open decisions, which put this card's recommendation to him as: 「所有撤回都要先过流程自己的检查(新增撤回动作)+ 相关架构决定文档补一条说明;排在 39155 之后」
    • The at-tier analysis behind it: 7446830948.

    Next

    needs-user-decision off, pm:queue on: this card is now the build card.

  6. added
    pm:queue
    and removed
    needs-user-decision
    on Dec 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:workflowbugdomain:serverpm:queuepriority:p3

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions