Repository navigation
feat(service-messaging): a keyed notification param can be a list, read in the recipient's language - #37701
Conversation
…ad in the recipient's language A keyed param resolved through `t(key, locale)` with no params, so a hole held one text or one hole-free key. The approval submitter's notice could spell a slate of slots per reader only with one derived sentence per slate size (2 to 8, #36463), and a larger slate named its slots in English inside the reader's sentence. `keyedText.params` now accepts `{ list, separator }`: each item a catalog sentence with its own scalar params, rendered per recipient (else its fallback), joined by the separator entry. emit() refuses a malformed list before writing; a stored malformed one is delivered as its literal. The approval notice spells a slate of two or more slots through it, so every slot reads in the reader's language whatever the slate's size. The 2–8 slot sentences stay in the packs for notices already delivered. Claude-Session: https://claude.ai/code/session_01L6bhgU7eeqHgQrtv5CeJK6 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 3 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 8 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 b20e8609d59ef72f17e330dd2c9075a21c5333fa && git checkout b20e8609d59ef72f17e330dd2c9075a21c5333fa
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin e491fce2c70a67a92f2c40cb38e2f8b23af40ce4 b487097576deb8a3ca437c89e3960908e289a24b && git checkout -B drift-repro e491fce2c70a67a92f2c40cb38e2f8b23af40ce4 && git merge --no-ff b487097576deb8a3ca437c89e3960908e289a24b
node scripts/docs-audit/affected-docs.mjs --json e491fce2c70a67a92f2c40cb38e2f8b23af40ce4
|
|
repo:objectstack#2 · os-sales · session_01L6bhgU7eeqHgQrtv5CeJK6 Final head for L1:
Generated by Claude Code |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: Face: declaration ( ① Derived judgments
② Semver level
③ Boundary flags
Findings
No must-fix. F1 is should-fix, so landing waits until a delta closes it and this reviewer reads that delta. F2–F4 may go into the same delta or be accepted as written. Implemented-by: VERDICT: PASS |
… sent, as English clauses A slate of more than NOTIFICATION_LIST_PARAM_MAX_ITEMS slots would make emit() refuse the list param, and notify() only logs the refusal, so the submitter was told nothing. The notice now caps the list at the mirrored APPROVAL_LIST_PARAM_MAX_ITEMS and, past it, sends `who` as the English clauses. A pin test drives both sides of the cap through the emit's own assertNotificationTextKeys. The changeset names the new constant export, the widened read side (Notification.keyedText) and what an older reader does with a list row. Claude-Session: https://claude.ai/code/session_01L6bhgU7eeqHgQrtv5CeJK6 Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#2 · os-sales · session_01L6bhgU7eeqHgQrtv5CeJK6 Final head after the contract reviewHead-sha: This commit carries what contract review 7204071400 asked for:
CI on this head: 53 check-runs, all success or skipped by path filter, none failed. Generated by Claude Code |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: Delta round 2 on the declaration face, after record 7204071400 at ① Derived judgments
② Semver level
③ Boundary flags
Findings
No must-fix and no should-fix remain, so this is the final round. Accepted deviations: J11 (English clauses above 100 slots, as on Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 席位核对 — ACCEPT · head b487097 · card #36853 · area s2-ux-P · 2026-11-26T22:23ZL1 checklist
Tier: S. Landing: ready + auto-merge by this stroke. |
Requested by Sales · project thread
Fixes #36853
What changes
@objectstack/service-messaging,notification-text.ts.EmitInput.keyedText.paramsaccepts a list-shaped value,{ list, separator }(NotificationListParam).listitem is{ key, params?, fallback }: a catalog sentence with its own{{hole}}params, which are scalar only (NotificationScalarParam: text,{ key, fallback }or{ object, fallback }).fallback.separatorentry, else itsfallback.lookupSeparatorkeeps a whitespace or punctuation answer such as、, whichlookupwould treat as a blank sentence.problemOfis split intoscalarParamProblem,keyedParamProblemandlistParamProblem.emit()refuses an empty list, a list overNOTIFICATION_LIST_PARAM_MAX_ITEMS(100), an undeclared member, a malformed separator or item, and a list nested in an item. A stored malformed row reads back asundefinedand is delivered as its literal, as any malformed row is.NotificationListParam,NotificationListItem,NotificationScalarParamandNOTIFICATION_LIST_PARAM_MAX_ITEMS. Every existing param shape renders byte for byte as before.@objectstack/plugin-approvals.noApproverNoticespells a slate of two or more slots asapprovalNoApproverHoldingwithwhothe list param: oneapprovalNoApproverSlotper slot with itstype/valueparams, joined byapprovalNoApproverSlotSeparator. Each item falls back to the English clause the row stores.approval-notification-text.tsmirrors the new shapes structurally (ApprovalListParam,ApprovalScalarParam), because the plugin keeps no runtime dependency on the messaging package.interpolaterenders a list's literal from its items' fallbacks.approvalNoApproverHoldingSlot.patch).Why
A
{ key }param resolves throught(key, locale)with no params, so a hole held one text or one hole-free key. #36463 (PR #36846) spelled slates of 2 to 8 slots with one derived sentence per size. A slate of more than 8 slots still named its slots in English inside a zh-CN, ja-JP or other non-English submitter's sentence.Verification
admin-rescue-named-slate.integration.test.tsadds a 9-slot slate opened by the real service. It is rendered through the realNotificationTextRendererin zh-CN, and the body is entirely Chinese, withnot.toMatch(/[A-Za-z]/). Theenrender equals the literal the row stores. This is the card's acceptance test.notification-text-list-param-36853.test.tsdrives the real renderer over the kernel's in-memoryi18n, with 9 tests:、, and the same list inenemit()makes, and a stored row read backno-approver-note.test.ts:en"vitest run:service-messaging82 files, 1107 passed;plugin-approvals130 files, 1965 passed.pnpm typecheckpasses in both packages.plugin-approvalscheck:test-typecheckis OK, with no change to its ledger.eslintis clean on every changed file.check-test-source-aliasis OK, andoverlap-checkis clean againstorigin/main.Small decisions
approvalNoApproverHoldingSlots2to…Slots8sentences are not retired. Notices already delivered carry those keys in their storedkeyedText, and the inbox renders them again at every read (renderForReader). Retiring them would turn those rows back into English. New notices no longer emit them.Clause-②: yes (widening)
Metadata-protocol: none
The widening is the published
keyedText.paramsvalue shape of@objectstack/service-messaging: a new accepted shape, with every existing shape unchanged. No metadata author writes it.Owed
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_01L6bhgU7eeqHgQrtv5CeJK6
Generated by Claude Code