Repository navigation
fix(approvals)!: rejecting through the approval_reject action requires a reason - #35716
Conversation
approval_reject declares its comment param required, so the declared param contract (ADR-0104 D2) refuses a reject whose comment is missing or blank at the REST action door, MCP run_action and the console's param dialog. A reject with a reason runs as before. Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2 Co-authored-by: Claude <noreply@anthropic.com>
…T action door and over MCP The approver's reject with no comment, an empty one or a whitespace-only one answers 400 VALIDATION_ERROR naming comment at the REST action door and at MCP run_action, and the request stays pending; CONTROL: a REST reject with a reason rejects it and records the comment. Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2 Co-authored-by: Claude <noreply@anthropic.com>
…sentence Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 1 changed package(s)), so this run has no opinion about the docs. 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): |
The record-page Reject dialog item and the declared-actions source line now say approval_reject's comment is required, refused when missing or blank at REST, MCP and the console; approve's comment stays optional. Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-elon-musk · session_016WV4cxk4f4T7at3YeFruhZ L1 verdict (L1-a): CHANGES at head Gates: Must-fix:
What I checked (holds):
Notes (non-blocking):
Next: fix (a) and record (b), push, and announce the final green head. I do a delta review; then the seat runs the CONTRACT_REVIEW_TIER read and a4-W lands it. Generated by Claude Code |
The source comment, the approvals guide, the unit and dogfood test docblocks, the changeset and the two checklist lines now say a reject through approval_reject always carries its reason, and name the REST action door rather than REST: the approvals route itself still accepts a reject with no reason. Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2 Co-authored-by: Claude <noreply@anthropic.com>
Resolves the approvals checklist conflict with the record page's one header row change: line 1021 takes main's text, with its parenthetical now saying approval_reject's declaration requires the reason too, so a missing or blank one is also refused at the REST action door and over MCP. The declared-actions line keeps this branch's scoped wording. Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#4 · os-elon-musk · session_016WV4cxk4f4T7at3YeFruhZ L1 verdict (L1-a): ACCEPT (delta) at head Delta
Gates on this head: 59 check-runs: 42 success, 17 skipped, 0 failed, 0 pending. The code review in 7028928770 is unchanged, since the code has not moved since Generated by Claude Code |
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1PJ4isQ3eD7Fk1fnF Contract reviewServed-tier: Read: card #35659 (body and its comments), #35593 (body, item 6 and its acceptance line), #35719 (body), PR #35716 (title, body, the net diff of its 6 files against ① Derived judgments
② Semver level
③ Boundary flags
④ Findings
Reviewed-by: VERDICT: PASS |
approval_reject action requires a reason
|
repo:objectstack#4 · os-elon-musk · session_016WV4czKnDE6hsyXQzB9wB2 Landing (area a4-W) · 2026-11-20T04:13Z
State change: ready for review + auto-merge on the maintainer's area line 「本区通过复审的 PR 都可以 ready + auto-merge」 (a4-W thread, 2026-11-19T21:59Z). On MERGED: #35659 closes via |
Requested by Elon · project thread
Fixes #35659
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — the published skills never teach the approval_reject action or its comment param, and nothing a metadata author writes changes
维护者速读
Migration
Callers of
approval_rejectmust sendparams.comment(a non-blank reason); there are no production customers and no stored data to migrate.What changes
packages/plugins/plugin-approvals/src/sys-approval-request.object.ts:approval_rejectdeclares itscommentparamrequired: true(wasrequired: false), and its AI tool description says the reason is required. No new code path: the declared param contract (ADR-0104 D2,validateActionParams) already judges every action door before the target route runs, and already counts an empty or whitespace-only string as missing (isActionParamValuePresent).POST /api/v1/actions/sys_approval_request/approval_rejectand MCPrun_actionrefuse a missing or blank reason with the existing param-contract refusal:400, codeVALIDATION_ERROR, message namingcomment. The refusal is raised before the AI confirmation gate and before the approvals route, so the request stays pending and nothing is recorded. The console's param dialog already holds Confirm on arequiredparam that is empty or whitespace-only (its translatedactionDialog.requiredError).POST /api/v1/approvals/requests/:id/reject(the approvals route itself,client.approvals.reject) is unchanged and still accepts a reject with no reason, so the guarantee is scoped to the action: a reject throughapproval_rejectalways carries its reason. The route, SDK method and servicedecideleg is approvals: the approvals route POST /approvals/requests/:id/reject and client.approvals.reject still record a reject with no reason (follow-up of #35659, which narrows only the approval_reject action) #35719.content/docs/automation/approvals.mdx: one sentence saying a reject throughapproval_rejectcarries its reason, and naming the three doors that refuse one without it.docs/qa/platform-checklist/areas/approvals.json: two lines. The record-page Reject dialog step takes main's text (feat(record): one header row and one button group on the record page (#35593, #35419) #35679's one header row), except its parenthetical: main said the declaration keeps the comment optional, so it now saysapproval_reject's declaration requires the reason too, and a missing or blank one is also refused at the REST action door and over MCP. The declared-actions source line gives approve an optional comment andapproval_rejecta required comment, refused when missing or blank at the REST action door, MCP and the console. The item's revision history is untouched..changeset/35659-approval-reject-requires-reason.md:patchwith the BREAKING banner (non-protocol narrowing, AGENTS.md Post-Task step 3) and its ADR-0087 disposition.Step 0, measured at origin/main 238661f (the branch base) and unchanged through 5d2ce34 for the files read:
commentwasrequired: false;enforceActionParams(packages/runtime/src/action-execution.ts) is called once, in the shared action dispatch (packages/runtime/src/action-dispatch.ts) that serves both the REST door and theaiposture MCPrun_actionuses;validateActionParamstreatsundefined,null,''and whitespace-only strings as missing. The REST/MCP refusal sentence is English-only (the param contract's existing wording); no new sentence is added, so no translation is owed. No doc, skill or test text in this repo's own surface said the reject reason is optional beyond the AI description fixed here (see Acceptance notes for one checklist line outside the surface).Tests
packages/plugins/plugin-approvals/src/sys-approval-request.object.test.ts: the spec validator overapproval_reject's declaration refuses{},'', whitespace-only andnullwith onerequiredissue oncomment; CONTROL: a reason passes (with and without attachments); CONTROL:approval_approvekeeps its comment optional.packages/qa/dogfood/test/approval-decide-over-mcp.dogfood.test.ts(the existing harness that boots the real security, flow, approvals and MCP plugins): the approver's reject with no reason,''or whitespace-only answers400 VALIDATION_ERRORnamingcommentat the REST action door and over MCPrun_action, and the request stays pending with no decision; CONTROL: a REST reject with a reason answers200, the request isrejected, and the decision row carries the comment.approval-act-doors-read-visibilityalready sends{ comment: 'no' }).Readings at 400c82e, 5023ae8 and f350577
All at head
400c82eed3(the merge of origin/main 74d3d83 plus the two commits on it), underscripts/pm/os-verify-lock.sh:pnpm --workspace-concurrency=2 --filter '@objectstack/dogfood^...' build·VERDICT command-exit 0.pnpm --filter @objectstack/plugin-approvals test·VERDICT command-exit 0· Test Files 124 passed (124) · Tests 1773 passed (1773).pnpm --filter @objectstack/plugin-approvals typecheck·VERDICT command-exit 0(tsc, scripts tsconfig, check:test-typecheck OK).pnpm --filter @objectstack/dogfood typecheck·VERDICT command-exit 0(its tsconfig includestest/**/*; the edited file is in--listFilesOnly).vitest run test/approval-decide-over-mcp.dogfood.test.ts·VERDICT command-exit 0· Tests 7 passed (7).(narrowing)arm),pnpm --filter @objectstack/dogfood test, no shard, no path ·VERDICT command-exit 0· Test Files 482 passed, 3 skipped (485) · Tests 4094 passed, 68 skipped (4162).scripts/ablation-replace.mjs, anchor hit x1 then x0, blob 2693614c6a3a to 2cff7aca34ed;@objectstack/plugin-approvalsresolves to source in both suites, so no dist leg): withcommentback torequired: false, the dogfood pin went red (REST {}answered200and the request wasrejected) and the unit pin went red ({}: expected[]to deeply equal[['comment','required']]); restore: blob == HEAD 2693614c6a3a,git diff HEADempty.node scripts/pm/dispatch-gates.mjs --commands: 98 commands; 97 exit 0,pnpm check:dual-build-cjs-loadsexit 3 (PREREQUISITE NOT MET: unbuilt studio, client-react, scenarios and other packages outside this diff), NOT MEASURED locally, CI runs it.check:skill-examplesfirst exited 3 on an unbuilt client SDK; after building@objectstack/clientand@objectstack/client-reactit exited 0.--ranreconciliation: 98 derived, 97 run, 1 NOT-MEASURED, 0 UNRUN.node scripts/pm/overlap-check.mjs --branch=claude/area-a4W-35659:VERDICT clean exit 0(merges cleanly into origin/main 74d3d83).5023ae8d(checklist-only commit on top of 400c82e):dispatch-gates --commands docs/qa/platform-checklist/areas/approvals.jsonderived 17 commands, all exit 0, includingpnpm check:platform-checklist(OK, 16 areas, 433 items) andpnpm check:nul-bytes;check:doc-formula-expressionsfirst exited 3 (lint/formula unbuilt), then 0 after building the lint closure. The full derivation for the branch adds onlypnpm check:platform-checklistover the 98 run at 400c82e. Code is unchanged since 400c82e.f3505776(d1f69fb's scoped wording, then the merge of origin/main 5d2ce34):dispatch-gates --commandsderived 99 commands. 98 exit 0, among themcheck:platform-checklistandcheck:nul-bytes.check:type-check-debtre-ran under the lock after timing out in the queue behind the battery: exit 0.check:skill-examplesexit 0 after building the client SDK.check:dual-build-cjs-loadsexit 3 (PREREQUISITE NOT MET), NOT MEASURED locally.--ran: 99 derived, 98 run, 1 NOT-MEASURED, 0 UNRUN.f3505776(the(narrowing)arm),pnpm --filter @objectstack/dogfood test, no shard, no path, under os-verify-lock after the closure build:VERDICT command-exit 0· Test Files 482 passed, 3 skipped (485) · Tests 4094 passed, 68 skipped (4162).f3505776: CI run 44665722006 success, Lint & Type Check run 44665721964 success; check-runs 42 success, 17 skipped, 0 failed.Verification
Two-minute check:
pnpm --filter @objectstack/dogfood exec vitest run --maxWorkers=2 test/approval-decide-over-mcp.dogfood.test.tsafter building the dogfood closure; expect 7/7 green, including the reject-reason pin.Read first, by risk: (1) the
approval_rejectparams hunk insys-approval-request.object.ts; (2) the newitat the end ofapproval-decide-over-mcp.dogfood.test.ts; (3) the changeset's BREAKING banner and ADR-0087 marker.Acceptance notes
InboxApprovalItem.tsx) and the approvals list draw Reject as the declaredapproval_rejectthroughDeclaredActionsBar, so from this PR on they open the same param dialog and hold Confirm until a reason is typed.POST /api/v1/approvals/requests/:id/reject,client.approvals.rejectand servicedecide, which still accept a reject with no reason. approvals: the email action-link reject (ADR-0043 confirm page) records "Via action link" instead of a reason the approver typed — add a required reason field (remaining leg of #35593's "reject carries a reason") #35722 covers the reject reason on the email action link. This PR's guarantee is scoped to theapproval_rejectaction: the REST action door, MCPrun_actionand the console dialog.packages/plugins/plugin-approvals/src/**,content/docs/**and.changeset/*.md; this PR also adds oneittopackages/qa/dogfood/test/approval-decide-over-mcp.dogfood.test.ts, because the order's tests list asks for the REST door and MCP path and that file is the existing harness reaching both, and edits two lines ofdocs/qa/platform-checklist/areas/approvals.jsonat the seat's request. Both are declared as surface extensions in the report and were accepted at L1.approval_rejectremainsai.requiresConfirmation: true; over MCP the param refusal now answers before the confirmation gate, which is the existing ordering for every declared param.Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
🤖 Generated with Claude Code