Repository navigation
fix(runtime): the comment and webhook redelivery doors' 501 follows the request's language - #37639
Conversation
…he request's language The comment doors and the webhook redelivery door answered a fixed English 501 NOT_IMPLEMENTED while the own-door bridge's print, personal-view and attachment doors answer in the request's Accept-Language. Their four sentences are now operation-message catalog keys in en, zh-CN, ja-JP and es-ES (English byte-identical), read with the bridge's own locale reader. The bridge's nounKey is required, so no bridge ships an English-only 501, and a plural noun reads a _plural pair: the attachment doors' English now says "are". Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
📓 Docs Drift Check20 anchor(s) derived from 2 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 — 182 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 b5d06bec504a05306ae8c134fda7c59710484ab3 && git checkout b5d06bec504a05306ae8c134fda7c59710484ab3
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3806b2e46a56c3537111fe8113d496b38ebaed9f 4c2a96e4634eff78ff10613fec02d8c4a57543ce && git checkout -B drift-repro 3806b2e46a56c3537111fe8113d496b38ebaed9f && git merge --no-ff 4c2a96e4634eff78ff10613fec02d8c4a57543ce
node scripts/docs-audit/affected-docs.mjs --json 3806b2e46a56c3537111fe8113d496b38ebaed9f |
…ery test check:test-source-alias: the edited test reaches standalone-stack.ts's dynamic @objectstack/metadata import, so it imports it at module top, as comments.test.ts does. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: First round. Read: card #37610 (body, triage 7197373477, claim 7197524494), this PR's body, its nine-file list, the net diff against the merge-base The rest of the diff (the changeset and the three test files) is the lane seat's ACCEPT at ① Derived judgments
② Semver level
Both declarations hold. The PR body and the changeset carry the same The claim on the card (7197524494) declared the first line as ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
All three sit in non-prose files, so a fix would move this head. They are accepted deviations here, or one follow-up card. Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 席位核对 — ACCEPT · head 4c2a96e · card #37610 · area s2-ux-T · 2026-11-26T18:24ZL1 checklist
Tier: S. Landing: ready + auto-merge by this stroke. |
…n hooks answer their 501 in the request's language (objectstack-ai#37721) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuQVQdf3PvoJbKFFCUA4gwJB)_ Fixes objectstack-ai#37662 Clause-②: yes (widening) Metadata-protocol: none Skills-docs: none (no page under `skills/**` names these doors' `501` sentences) ## 维护者速读 - 用户能看到什么变化:内核缺少审批服务或入站钩子服务(trigger-api)时,审批操作页 `/approvals/act` 和入站自动化钩子返回的 501 提示,现在按请求的语言显示中文、日文或西班牙文。评论、webhook 重新投递、打印等接口已经这样做了。英文请求看到的英文和以前一字不差。 - 为什么做:objectstack-ai#37639 的审核发现这两个接口还只说英文,另外留了三处措辞和测试上的小问题,这次一起补上。 - 出错会怎样:只影响服务没装时的 501 提示文字,状态码和错误码都不变。 - 要你做什么:无。`packages/spec` 的消息目录有改动,席位会安排契约审核。 ## What changes - **Catalog** (`packages/spec/src/system/operation-message.ts`, `BUILTIN_OPERATION_MESSAGES`). - Four new keys, each in `en`, `zh-CN`, `ja-JP` and `es-ES`: `approvals_act_service_unregistered`, `approvals_act_member_missing`, `automation_hooks_service_unregistered` and `automation_hooks_member_missing`. - The English of each key is the sentence its door answered before, byte for byte. Slot, member and package names are written in and never translated. - **N2.** The jsdoc paragraph on these whole-sentence keys, which covers `comment_doors_*`, `webhook_redeliver_*` and the two new families, now states what the `print_*` and `own_door_*` paragraphs state. The locale is the request's top `Accept-Language` tag, and a top tag the catalog lacks answers English. No `errors.` override is consulted. - **`packages/runtime/src/domains/approvals.ts` and `automation-hooks.ts`.** Each of the two `501`s answers `operationUserMessage(key, { locale: requestLocaleOf(context) })`, which is objectstack-ai#37639's shape for the comment and redelivery doors. Code, status and the absence of `userMessage` are unchanged. - **N1, `own-door-bridge.ts`.** The section title "The `501` is in the request's language when the bridge names its noun" loses its now-always-true clause. - **N3, `own-door-bridge.test.ts`.** A new pin walks every module in `domains/` that builds a bridge domain (`createOwnDoorBridgeDomain(`), imports it, and checks each exported bridge: - its `nounKey` holds text in every catalog locale; - the English of `nounKey` is the bridge's `noun`; - `nounPlural` is set exactly when the English noun is plural (`/\bdoors\b/`); - the sentence pair the bridge reads (singular or `_plural`) exists in every locale. A module that builds a bridge domain but exports no bridge fails the pin. - **Changeset.** `@objectstack/spec` and `@objectstack/runtime`, both patch. ## Why PR objectstack-ai#37639's review (record 7200392904, adopted at ACCEPT) left these four items, which the card lists. ## Verification - **New tests.** `approvals-act.test.ts` and `automation-hooks.test.ts` each add a describe that pins both `501`s in four locales: `en` (with and without a header), `zh-CN`, `ja-JP` and `es-ES`. Each pin checks the exact sentence, `501 NOT_IMPLEMENTED`, and no `userMessage`. - **Ablation.** With `approvals.ts` and `automation-hooks.ts` reverted to `main`, the 4 new cases fail at `zh-CN`. They pass `en` first, which shows the English is unchanged. - **N3 pin.** With `nounPlural: true` removed from `ATTACHMENTS_BRIDGE`, the walk fails: `'the attachment removal and rename doors': expected false to be true`. - `vitest run` on `approvals-act`, `automation-hooks`, `own-door-bridge`, `comments` and `webhooks-redeliver`: 5 files, 129 passed. - `packages/spec`: `operation-message.test.ts` 60/60. - `tsc --noEmit -p packages/runtime` passes. `eslint` on the 7 touched files passes, and `check-test-source-alias` is OK. `approvals-act.test.ts` gains the module-top `@objectstack/metadata` import. - `overlap-check` is clean against `origin/main`. ## Small decisions - The new keys are whole sentences, not the bridge's `{{door}}` template. Neither door is an own-door bridge, and objectstack-ai#37639 made the same call for the comment and redelivery doors. - The N3 walk finds bridges by scanning the source for `createOwnDoorBridgeDomain(` and then reading exports. There is no registry to read, and adding one only for the test would be new runtime surface. - The plural test is the English noun's `doors`. All three shipped nouns end in `door` or `doors`, so it holds for every bridge today. A noun that breaks the pattern fails the pin loudly rather than passing silently. ## Owed - L1 (seat). The catalog in `packages/spec` widens, so the seat rules whether a contract review is owed. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes on the changed files. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed (none depend on this catalog). - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgU7eeqHgQrtv5CeJK6 --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgU7eeqHgQrtv5CeJK6)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgU7eeqHgQrtv5CeJK6 --> Co-authored-by: Claude <noreply@anthropic.com>
Requested by Sales · project thread
Fixes #37610
Clause-②: yes (widening)
Metadata-protocol: none
Skills-docs: none (no page under
skills/**names these doors'501sentences)维护者速读
packages/spec的消息目录有改动,席位会安排契约审核。What changes
packages/spec/src/system/operation-message.ts,BUILTIN_OPERATION_MESSAGES), each inen,zh-CN,ja-JPandes-ES:comment_doors_service_unregistered,comment_doors_member_missing,webhook_redeliver_service_unregistered,webhook_redeliver_member_missing. The English is the sentence each door answered before, byte for byte; slot, member and package names are written in, untranslated.own_door_service_unregistered_plural,own_door_member_missing_plural: the bridge's two sentences with a plural verb (are/no están disponibles;zh-CNandja-JPread as the singular pair).es-ESown_door_attachment_mutatebecomes plural ("los puntos de acceso para eliminar y renombrar adjuntos"), to agree with the plural pair.packages/runtime/src/domains/comments.ts,webhooks.ts: the two501s each answeroperationUserMessage(key, { locale }), the locale read by the bridge's own reader, now exported (requestLocaleOf,own-door-bridge.ts). Code, status and the absence ofuserMessageare unchanged.own-door-bridge.ts:OwnDoorBridge.nounKeyis required (the type is internal:packages/runtime/src/index.tsexports none of it); the English-only arm is gone. A new optionalnounPlural: truemakes the bridge read the_pluralpair.attachments.tssets it, so the English reads "The attachment removal and rename doors are not available: …".@objectstack/specand@objectstack/runtimepatch, with a paragraph saying the English moved for the attachment doors.Small calls made here (no card):
{{door}}template.Why
Review of PR #37594 (record 7196010986, adopted at ACCEPT 7196077328) found the comment and webhook redelivery doors still answering English only, the optional
nounKeythat would let a fourth bridge ship English-only, and the attachment sentence's verb agreement.Verification
Head
e2708e28c, underos-verify-lock:packages/runtime:own-door-bridge.test.ts,comments.test.ts,webhooks-redeliver.test.ts: 3 files, 79 tests passed. New describes pin both501s of the comment doors (on every door) and of the redelivery door in en (and with no header), zh-CN, ja-JP and es-ES, with nouserMessage; the attachment pins now read "are" and the plurales-ESsentence.tsc --noEmit -p packages/runtime: exit 0.packages/specsrc/system/operation-message.test.ts: 60/60.eslinton the 8 touched source and test files: exit 0.node scripts/pm/overlap-check.mjs: clean.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed (none depend on this catalog).content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
Generated by Claude Code