Repository navigation
fix(plugin-approvals): the no-approver decide refusal and a multi-slot submitter notice read in the reader's language - #36846
Conversation
…age as userMessage; the notice names several slots inline Claude-Session: https://claude.ai/code/session_01WGufziH9MVhWYLVCiw5eXB Co-Authored-By: Claude <noreply@anthropic.com>
…ide refusal Claude-Session: https://claude.ai/code/session_01WGufziH9MVhWYLVCiw5eXB Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufziH9MVhWYLVCiw5eXB Co-Authored-By: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 22 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 dc3dc14d5f1680d517d9195a6606c20d665b05cb && git checkout dc3dc14d5f1680d517d9195a6606c20d665b05cb
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5c2e34cdb2b436f356ebba523e284e239f6ea351 a6c6666adee23afc20e585b0cc95a3fea78c0ed1 && git checkout -B drift-repro 5c2e34cdb2b436f356ebba523e284e239f6ea351 && git merge --no-ff a6c6666adee23afc20e585b0cc95a3fea78c0ed1
node scripts/docs-audit/affected-docs.mjs --json 5c2e34cdb2b436f356ebba523e284e239f6ea351
|
|
repo:objectstack#3 · os-support-ai · session_01WGufziwMkZG34d69p8BHb4 Contract-review-claim: session_01WGufziwMkZG34d69p8BHb4 · head 869d5de · 2026-11-24T04:56Z |
|
repo:objectstack#3 · os-support-ai · session_01WGufziwMkZG34d69p8BHb4 席位核对 — REWORK · repo:objectstack#3 · head 869d5de · 2026-11-24T04:59ZL1: REWORK Checklist
FindingsS1 (should-fix) —
Nits:
Landing notesAfter the fix: the delta L1 and the L2 record on the same head, then the area lands. |
…Message as a widening Claude-Session: https://claude.ai/code/session_01WGufziH9MVhWYLVCiw5eXB Co-Authored-By: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-support-ai · session_01WGufziwMkZG34d69p8BHb4 Contract reviewServed-tier: Inputs read: card #36463 (body and all four comments: triage 7080090045, unlock 7107672290, claim 7121106831, dev report 7122061191), the PR #36846 body and file list (13 files), the net diff ① Derived judgments
② Semver level
③ Boundary flags
Findings: F1 must-fix, F2 should-fix. Because of F1 the verdict is FAIL. Once F1 and F2 are fixed, only the declaration text and the changeset front matter change. The original reviewer then reads that delta. Implemented-by: VERDICT: FAIL |
…nged Claude-Session: https://claude.ai/code/session_01WGufziH9MVhWYLVCiw5eXB Co-Authored-By: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-support-ai · session_01WGufziwMkZG34d69p8BHb4 Contract-review-claim: session_01WGufziwMkZG34d69p8BHb4 · head a6c6666 · 2026-11-24T05:05Z |
|
repo:objectstack#3 · os-support-ai · session_01WGufziwMkZG34d69p8BHb4 席位核对 — ACCEPT · repo:objectstack#3 · head a6c6666 · 2026-11-24T05:06ZL1: ACCEPT (delta, after REWORK 7122520696 at 869d5de) Delta read
FindingsMust-fix: none. Should-fix: none. Nits N1 and N2 from the first round are with the seat as carrier-card requests (7122552986). Landing notesNot governed (626 lines). The area lands once this ACCEPT, a PASS contract-review record on this head, and a green CI are all in place. |
|
repo:objectstack#3 · os-support-ai · session_01WGufziwMkZG34d69p8BHb4 Contract reviewServed-tier: Delta round on the previous record for head 869d5de (F1 and F2). Inputs read:
Nothing was built, run or re-run. ① Derived judgmentsThe code is unchanged, so round 1's J1 to J7 stand as judged.
② Semver level
③ Boundary flags
F1 and F2 are closed. F3 and F4 leave correctness and the contract untouched, so this is the final round. Both can be accepted as recorded deviations or fixed in prose alone. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufziH9MVhWYLVCiw5eXB Landing · 2026-11-24T05:30Z · ACCEPT 7122641847 (L1-b, delta after REWORK 7122520696) at head a6c6666
State: ready + auto-merge (area ux-D, not governed, ≤3000 lines). |
Requested by Yibo Wang · project thread
Fixes #36463
Clause-②: yes (widening)
Metadata-protocol: none
repo:objectstack#3 · os-support-ai · session_01WGufziH9MVhWYLVCiw5eXB
维护者速读
Widened door response (Clause-②)
The approvals routes (
packages/rest/src/approvals-routes.ts, all nine that sharehandleApprovalError) now carry a markeduserMessageat the top level of their flat{ code, error }refusal body on any mapped row whose thrown error is marked, the same member #34619 added forRESUME_FAILEDon this door and thatApiErrorSchemaalready declares and@objectstack/clientalready lifts. Producers today: the two self-approve decide refusals, both on the403 FORBIDDENrow (excludeSubmitter, and the override self-approve kept under maintainer ruling 2026-11-17 option B). The member is absent when no producer marked one, so every other refusal body is byte-identical. Additive, soyes (widening), patch,Metadata-protocol: none(precedents #34619, #35811; L1 S1 7122520696).Census
type: 'api'actionapproval_approve. Its failure text is read byrefusalEnvelopeMessageinui/packages/app-shell/src/utils/flowResponse.ts, throughapiActionRefusalResult. Both callers use it: theapiHandlerinuseConsoleActionRuntimeand the one inRecordDetailView. Before this PR it read onlyerror.userMessageof the ADR-0112 envelope. The approvals door answers the flat{ code, error }body, so the toast showed the Englisherror.humanizeErrorinui/apps/console/src/pages/system/ApprovalsInboxPage.tsx, called byinlineApprove. It answered everyFORBIDDENwith the generic "You are not allowed to perform this action.", so the remedy was lost.userMessageon the thrown error. The plugin already does this inlockedError(lifecycle-hooks.ts) andsnapshotQueryRefusal(payload-predicate-guard.ts). The approvals mapper carries it at the top level of its flat body, the member itsRESUME_FAILEDstranded envelope already uses foruserMessage.@objectstack/clientliftsuserMessagefrom that member too (errorBody?.userMessage ?? errorBody?.error?.userMessage). Where this differs from the dispatch: thedeclaredUserMessageblock aroundrecognisedRefusalrelays an engine resume refusal. It is not a producer of approvals' own refusal text, so it was not the pattern used here.excludeSubmitterand the override self-approve now throw through one local helper,refuseOwnApproval. It keeps themessagebyte for byte (the existing English pins are unchanged and green) and setsuserMessagefromsubmitterRefusalUserMessage(no-approver-note.ts). That text uses the decider'sreaderLabels(context).sentence, with the position labels from the samenotePositionLabelsread. If the decider asked in no language, or the pack lacks one of the sentences, the whole text is English and names no user id. It is never half one language and half the other.NotificationTextRenderer.render). It resolves a keyed param witht(key, locale)and no params, so a hole holds one text or one hole-free key. One list param cannot carry translated clauses, and the plugin cannot compose a list per reader, because the emit does not know the recipient's locale. This falsifies the dispatch's flatten-into-one-param route as stated. The route taken flattens the list into the sentence instead.approvalNoApproverHoldingSlots2to…Slots8are derived in every pack from that pack's ownapprovalNoApproverHolding,approvalNoApproverSlotandapprovalNoApproverSlotSeparator. Each slot is a keyedtypeN/valueNpair, the single-slot shape repeated. Nothing is translated twice, the messaging contract does not move, and the notice reads exactly what the timeline reads for the same slate (pinned for every pack and every size 2 to 8).localizeRoutingNotes) uses the samenoApproverWhocomposition, throughnoApproverNoteText(note, labels.sentence, …). It already renders any number of slots in the reader's language and is not touched.What changes
packages/plugins/plugin-approvals/src/translations/messages.ts:approvalDecideRefusedSubmitterExcluded,…OverrideOwnRequest,…AnotherApprover,…OverrideAnotherApproverand…OverrideWithdraw, in all eleven packs;approvalNoApproverHoldingSlotsNsentences, built inslotListSentencesand added to every shipped locale bywithSlotLists;NO_APPROVER_NOTICE_MAX_SLOTS = 8.no-approver-note.ts:noApproverNoticespells 2 to 8 slots inline (sharedslotParams). It addssubmitterRefusalUserMessage.approval-service.ts: the two decide refusals go throughrefuseOwnApproval. Behaviour is unchanged: both still refuse, with the same Englishmessage.packages/rest/src/approvals-routes.ts:handleApprovalErroraddsuserMessage(read once throughdeclaredUserMessage) to every mapped row when the producer marked one. An unmarked refusal gets exactly the body it had before.ui/packages/app-shell/src/utils/flowResponse.ts:refusalBodyUserMessagereads the envelope'serror.userMessage, else a flat body's top-leveluserMessage. These are the two members the client lifts, through one predicate.ui/apps/console/src/pages/system/ApprovalsInboxPage.tsx:humanizeErrorshows a marked refusal first..changeset/36463-no-approver-text-in-reader-language.md, patch for@objectstack/plugin-approvals,@objectstack/rest,@object-ui/consoleand@object-ui/app-shell(private, inert).Prior rulings that govern the edited lines (check-prior-rulings over the touched files; quoted as they stand in the tree):
[Maintainer ruling 2026-11-17, option B]on the override refusal: "The Approval routed to an empty position permanently locks the record (no admin override, no recovery) #3424 override never approves a request its actor submitted, whateverexcludeSubmittersays." Kept exactly. Only the language of its text changes.ApiErrorSchema.userMessage(packages/spec/src/api/contract.zod.ts), "ruling record 6819749037, option C: text addressed to the end user comes back in the request's language, composed where it is produced". TheuserMessageis composed in the service, in the decider's language, withenas the last rung.[#13807, maintainer ruling 2026-09-04 batch #37]stranded envelope and the code-anchored prefix strip ("converged here by the 2026-08-31 ruling") are not changed. The stranded spread still comes last.First reads (by risk)
packages/plugins/plugin-approvals/src/no-approver-note.ts:submitterRefusalUserMessage(the all-or-nothing English fallback) and the multi-slot arm ofnoApproverNotice.packages/plugins/plugin-approvals/src/translations/messages.ts:slotListSentences, and the change ofenMessagesinto the authored set plus the derived set.ui/packages/app-shell/src/utils/flowResponse.ts:refusalBodyUserMessage. It is shared by everytype: 'api'action, so the top-level read is gated by the samedeclaredUserMessagepredicate.Tests
no-approver-note.test.ts:who;exclude-submitter.integration.test.ts: each refusal carries the zh-CNuserMessagewhile itsmessagekeeps the English byte for byte; a decider with no locale gets English that names no id; the control (another approver on the slate) gets the English "another approver" text.admin-rescue-named-slate.integration.test.ts: a two-slot submitter notice goes through the realNotificationTextRenderer, entirely Chinese in zh-CN, in Japanese for ja-JP, and with the English literal body unchanged.rest-approvals-wire-codes.test.ts:403 FORBIDDENwithuserMessageat the top level,ApiErrorSchemaparse green; control: unmarked and blank markings add no member.flowLaunch.preDispatchRefusal-36390.test.tsx: a flat approvals refusal's top-leveluserMessageis the toast, through a realActionRunner; control: an unmarked or blank one shows theerror.ApprovalsInboxPage.inlineActionsVisible-34587.test.tsx: the inline Approve's failure toast is the marked text; control: the generic line.Acceptance notes
@objectstack/service-messaging, which is outside this card's surface. 8 is a declared constant, and the derived sentences cost one bundle entry per size per pack.messages.approvalNoApproverHoldingdoes not reach the derived…SlotsNsentences. Those are their own catalog keys and can be overridden the same way.Verification
Two-minute check:
pnpm --filter @objectstack/plugin-approvals exec vitest run --maxWorkers=2 src/no-approver-note.test.ts. Expect every test to pass, including "a zh-CN decider reads each refusal entirely in Chinese, the position by its label".Local readings at 869d5de
@objectstack/plugin-approvals^...,@objectstack/rest^...): lock VERDICT command-exit 0.pnpm --filter @objectstack/plugin-approvals --filter @objectstack/rest typecheck: VERDICT command-exit 0 (both includecheck:test-typecheck).@objectstack/plugin-approvalsvitest: Test Files 127 passed (127), Tests 1899 passed (1899).@objectstack/restvitest: Test Files 433 passed (433), Tests 9114 passed, 376 skipped (9490).pnpm --dir ui exec vitest runon the two touched UI test files: Test Files 2 passed, Tests 17 passed.pnpm --dir ui exec vitest run scripts/: Test Files 172 passed, 2 skipped (174).pnpm check:new-line-citations(ui): 0 new, exit 0.pnpm check:i18n: OK, 10 packages, all bundles in sync, exit 0 (after its declared prerequisite build).dispatch-gates.mjs --commands, 78 commands): 76 exit 0, 2 exit 3 (PREREQUISITE NOT MET, so NOT MEASURED):check-plugin-teardown-shape --self-test(shallow checkout) andcheck:dual-build-cjs-loads(needs a full workspace build).--ranwith exit codes: "78 derived famil(ies) accounted for — 76 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)".type-checkof@object-ui/app-shelland@object-ui/console. Locally every error is TS2307 module-not-found for unbuilt@object-ui/*declarations, with none in the touched files. CIType Check UIis the reading.scripts/ablation-replace.mjswith the restore proven bygit diff HEADempty and blob equal to HEAD:userMessagespread deleted:rest-approvals-wire-codes1 failed / 15 passed;err.userMessageassignment voided:exclude-submitter2 failed / 23 passed.overlap-check --branch=HEAD: VERDICT clean exit 0.Generated by Claude Code