Repository navigation
fix(runtime): the approval action-page door and the inbound automation hooks answer their 501 in the request's language - #37721
Conversation
…n hooks answer their 501 in the request's language
The two doors still answered the missing-service 501 as English literals.
Both now answer operationUserMessage(key, { locale: requestLocaleOf(context) })
with four new whole-sentence catalog keys in en, zh-CN, ja-JP and es-ES,
the English byte for byte the sentences they answered before.
Review follow-ups of #37639 ride along: the own-door bridge's section title
no longer says "when the bridge names its noun" (it always does), the
catalog jsdoc for these whole-sentence keys states the top Accept-Language
tag and that no errors. override is consulted, and one pin walks every
module that builds an own-door bridge, tying nounKey to the catalog in
every locale and nounPlural to the English noun's number.
Claude-Session: https://claude.ai/code/session_01L6bhgU7eeqHgQrtv5CeJK6
Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check11 anchor(s) derived from 2 changed package(s); no hand-written page names any of them. 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 233c1599d7effd4e1b02216e798603b8f298eb7e && git checkout 233c1599d7effd4e1b02216e798603b8f298eb7e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0f8e13b0011a2ad610b9531733359db95f2a4e40 a885f92a5b7490394303148e053685f7218d1902 && git checkout -B drift-repro 0f8e13b0011a2ad610b9531733359db95f2a4e40 && git merge --no-ff a885f92a5b7490394303148e053685f7218d1902
node scripts/docs-audit/affected-docs.mjs --json 0f8e13b0011a2ad610b9531733359db95f2a4e40 |
|
repo:objectstack#2 · os-sales · session_01L6bhgU7eeqHgQrtv5CeJK6 Final head for L1: CI is green on this head: 69 check runs, each one a success or skipped by the path filter, none failed. All 10 Test Core shards and all 16 Test UI shards pass.
Generated by Claude Code |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: First round. Read: card #37662 (body, triage 7201313998, claim 7205582224), this PR's body and its two comments, its eight-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, and the PR body, the changeset and the card's claim carry the same pair. The ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
Each of the twelve translations says what its English says, and keeps the sibling keys' wording: "compose" is rendered as
All three sit in non-prose files, and N1 is also typed into two test pins, so a fix would move this head. They are accepted deviations here, or one follow-up card; if N2 is tightened, the Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 席位核对 — ACCEPT · head a885f92 · card #37662 · area s2-ux-P · 2026-11-27T00:38ZL1 checklist
Tier: S. Landing: ready + auto-merge by this stroke. |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Queue kick · re-enqueue once · head a885f92 · 2026-11-27T01:05Z Signature: merge_group run 45918016841 (queue ref Signature ledger: no known-flaky row matches, so this is a new signature. Re-enqueued ONCE on the three facts:
If the same signature kicks this PR a second time, re-enqueueing stops and the signature is diagnosed afresh. |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 45918016841 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
… by Accept-Language, and the inbound automation hooks' Japanese 501 says 自動化 (objectstack-ai#37813) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuPE7uyDAJyqjwwMzomWv5ff)_ Fixes objectstack-ai#37737 Clause-②: no Metadata-protocol: none Skills-docs: none (no page under `skills/**` quotes these 501 sentences or their headers) ## 维护者速读 - 用户能看到什么变化:日文环境下,入站自动化钩子未配置时返回的 501 提示改用平台日文包统一的说法「自動化」。另外,所有按请求语言翻译的 501 响应(打印、个人视图、附件、评论、webhook 重新投递、审批操作页、入站自动化钩子)现在都带 `Vary: Accept-Language` 响应头。 - 为什么做:objectstack-ai#37721 的审核发现日文术语不一致;而且 501 在 HTTP 标准里默认可以被缓存,如果前面有共享缓存,可能把一种语言的提示发给说另一种语言的人。 - 出错会怎样:只影响服务没装好时的 501 提示和一个响应头,状态码、错误码和英文句子都不变。 - 要你做什么:无。卡里的第 5 项(其余约 26 句固定英文 501)已经移到 objectstack-ai#37811,不在这个 PR 里。 ## What changes - **Japanese term (item 1, N1)**: `packages/spec/src/system/operation-message.ts`, both `ja-JP` `automation_hooks_*` sentences say `受信自動化フック` instead of `受信オートメーションフック`, with the two pins in `automation-hooks.test.ts`. No other sentence in the repository used `オートメーション`; `ui/packages/i18n` `ja.ts` and the `platform-objects` ja-JP bundles say `自動化`. - **Locale-fallback jsdoc (item 2, N2)**: the `print_*` paragraph and the `comment_doors_*` … `automation_hooks_*` paragraph of the catalog jsdoc now say the request's top tag is matched by language (`resolveBundleLocale`): `es-MX` reads `es-ES`, `zh` and `zh-TW` read `zh-CN`, `ja` reads `ja-JP`, and only a language with no catalog locale answers English (measured against the built catalog). - **`requestLocaleOf` reader list (item 3, N3)**: its jsdoc names the four non-bridge families that read it (comments, webhook redelivery, approval action pages, inbound automation hooks). - **Walk and pin coverage (item 4)**, `own-door-bridge.test.ts`: the walk also imports a module that calls `handleOwnDoorBridgeRequest(` directly; every bridge noun must end in `door` or `doors` (`/\bdoors?$/`), and `nounPlural` must equal `/\bdoors$/`, so a plural noun spelled another way fails instead of passing. The `noun` member's jsdoc states the rule. - **`Vary: Accept-Language` (item 6)**, `own-door-bridge.ts`: `localizedNotImplemented(deps, message)` builds the `501` and adds the header; `catalogNotImplemented(deps, context, key, params?)` renders a catalog key in the request's language first. The bridge's two `501`s and the eight sentences of `approvals.ts`, `comments.ts`, `webhooks.ts` and `automation-hooks.ts` answer through them (their now-unused `operationUserMessage` / `requestLocaleOf` imports are dropped). Each family's language test pins the header beside the sentence. - **Item 5 moved**: the remaining fixed-English `501`s (auth, i18n, mcp, automation, meta, packages, about 26 sentences) are card objectstack-ai#37811, `Blocked-by: objectstack-ai#37737`, per the seat's split. - **Changeset**: `@objectstack/runtime` and `@objectstack/spec` patch. Small calls made here (no card): - This PR adds `Vary: Accept-Language` to the ten `501`s localized from the request's language only (the bridge's two and the eight of the comment, webhook-redelivery, approval action-page and inbound-hook doors), not to the whole error envelope, which every refusal shares whether or not its text varies. A `501` is heuristically cacheable (RFC 9111 §4.2.2). The other localized answer that is cacheable by default, the `404 RECORD_NOT_FOUND` of `GET /data/:object/:id` (its `userMessage` follows the caller's language), is not covered here and is tracked by objectstack-ai#37828. Agreed with the seat. - Item 4 is closed by widening (walk and pin), not by narrowing the claim. ## Why Contract review record 7206602201 on PR objectstack-ai#37721 (nits N1–N3 and the record's notes, adopted at ACCEPT), carried here per the one-card-per-PR rule. ## Verification Head `bcf922153` (the follow-up head `620499a87` only declares the bridge's hand-built `501` in `scripts/check-route-envelope.mjs`, `handBuilt: 1`; `Response-envelope guard` green): - `packages/runtime`: `own-door-bridge.test.ts`, `automation-hooks.test.ts`, `comments.test.ts`, `webhooks-redeliver.test.ts`, `approvals-act.test.ts`: 5 files, 129 tests passed, each language case now also asserting `Vary: Accept-Language`. - `packages/spec`: `src/system/operation-message.test.ts` 60/60. - `tsc --noEmit -p packages/runtime`: exit 0. `eslint` on the 6 touched runtime source and bridge test files: exit 0. - `check:changeset-fixed`, `check:test-source-alias`: exit 0. - `node scripts/pm/overlap-check.mjs`: clean. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic (catalog strings and comments only). - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; lint passes. - [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: no generated artifact depends on these strings or comments. - [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_01L6bhgUpnvPnJ1hR74pUrVj --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgUpnvPnJ1hR74pUrVj --> --------- Co-authored-by: Claude <noreply@anthropic.com>
…st's language (objectstack-ai#37845) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuPE7uyDAJyqjwwMzomWv5ff)_ Fixes objectstack-ai#37811 Clause-②: yes (widening) Metadata-protocol: none Skills-docs: none (no page under `skills/**` quotes these 501 sentences or their headers) ## 维护者速读 - 用户能看到什么变化:服务没装好或功能没实现时,平台返回的 501 提示(认证、i18n、MCP、元数据、软件包、自动化、启用开关、权限集复制、安全建议重新打开、共享链接)现在按请求的语言显示中文、日文或西班牙文,并带 `Vary: Accept-Language` 响应头。英文句子、状态码和错误码都不变。 - 为什么做:objectstack-ai#37721 和 objectstack-ai#37737 只本地化了几个自有接口的 501,其余接口的 501 对所有人都是固定英文。 - 出错会怎样:只影响服务缺失时的 501 提示文字和一个响应头;最坏情况是某句翻译不准,英文和行为都不变。 - 有两处 501 保留英文,理由写在下面。 ## What changes - **Catalog**, `packages/spec/src/system/operation-message.ts`: 37 new keys, all in `en`, `zh-CN`, `ja-JP` and `es-ES`. 31 of them are sentences, one per fixed-English `501`. The other 6 are `catalog_activation_noun_*`, the activation door's nouns, rendered in the same locale. The English of each sentence is byte-identical to the sentence its door answered before. `{{member}}`, `{{table}}`, `{{name}}` and `{{packageId}}` stay untranslated code, table, item and package names. The Japanese says `自動化`, as objectstack-ai#37737 aligned. A jsdoc paragraph names the keys and how they are read. - **Doors**, `packages/runtime/src/domains/`: every one of these `501`s now answers through `catalogNotImplemented` (`own-door-bridge.ts`, objectstack-ai#37737), which reads the request's top `Accept-Language` tag and adds `Vary: Accept-Language`: - `auth.ts`: 1 - `i18n.ts`: 1 - `mcp.ts`: 2 (`/mcp` and the skill door) - `meta.ts`: 5 (layered read, conditional save, save, draft listing, stored migration) - `packages.ts`: 8 - `automation.ts`: 11 (5 connector credential and connection legs, which name the missing member, plus flow clone, resume, cancel, restore, screen lookup and run list) - `actions.ts`: 1 - `catalog-activation.ts`: 1 (on/off sentences, with the localized noun) - `permission-set-clone.ts`: 2 - `security.ts`: 1 - `share-links.ts`: 1 The four `actions.ts`, `catalog-activation.ts` and `permission-set-clone.ts` sites were found when the premise was re-measured; neither the card nor the seat note listed them. The clone landing's `501` is thrown from `resolveDefaultCloneLanding`. It now carries its catalog key, and the door's catch answers it in the request's language. Its English stays the error's message. - **Review N2 of PR objectstack-ai#37813**: the `requestLocaleOf` jsdoc now says the four non-bridge families, and now these modules, reach it through `catalogNotImplemented`. The four gate comments for `approvals.ts`, `automation-hooks.ts`, `comments.ts` and `webhooks.ts` in `scripts/check-route-envelope.mjs` now say their `501`s go through it. No gate count changes. - **Pins**: - Each door with an existing `501` test gains a `[objectstack-ai#37811]` block beside it, which asserts byte-identical English with no header, the catalog's Japanese under `ja-JP`, and the `Vary`. These are the run lifecycle, connector credential and connection (with the member named), screen read, catalog and action activation, packages and `/meta` probes, permission-set clone and `/i18n` tests. - `domain-501-language-37811.test.ts` pins the doors that had no `501` fixture: `/auth`, `/mcp`, the `/meta` layered read, conditional save and save, `/share-links`, the `/security` reopen, and the `/automation` run list, resume and flow clone. - The same file adds a source walk: no domain module except the two builders contains `deps.error(…, 501)`, so a new fixed-English `501` fails there. - `operation-message.test.ts` pins that each of the 37 keys is translated in every locale (not an English echo) and keeps exactly the English placeholders. - **Changeset**: `@objectstack/runtime` and `@objectstack/spec` patch. Small calls made here (no card): - **Kept English: `capabilityUnavailable`** (`unavailable.ts`, ten call sites in `ai.ts`, `automation.ts`, `notifications.ts` and `ui.ts`). Its sentence is `serviceUnavailableMessage(slot)`, the same remedy discovery reports as `services.<slot>.message`. By contract the two are the same bytes, so a caller who hits the wall gets the fix that discovery lists. Discovery is English, so localizing this `501` alone would split the two. Localizing both is a discovery-protocol change and out of this card's scope. The answer carries no `Vary`, because its text does not vary. - **Kept English: the MCP resume door's `501`** (`mcp.ts`, `resumeDoorError`). It is thrown into the resume tool's error mapping, not answered as an HTTP `501` envelope, and the calling agent reads it beside that door's other refusals, which are English. - **Not localized: `meta.ts`'s `errorFromThrown(e, 501)`**. It forwards the metadata service's own thrown message, so the sentence is not the door's. - **The activation noun is translated through its own key**, so the zh, ja and es sentences carry no English noun. The on/off verb is two keys (`_on`, `_off`), because the verb does not interpolate across languages. ## Why Card objectstack-ai#37811 is item 5 of objectstack-ai#37737, split out by the seat. Comment 7210862044 adds the `capabilityUnavailable`, `share-links.ts` and `security.ts` sites and review N2 of PR objectstack-ai#37813. ## Verification Head `372155638`, plus `5e4ea0904` (the clone landing's `501` is caught around `resolveDefaultCloneLanding` alone, so the save catch keeps its main-branch form and the durability-degradation log-level guard passes: red on `372155638`, exit 0 on `5e4ea0904` locally; `permission-set-clone.test.ts` 55/55, `tsc` exit 0). CI on `5e4ea0904`: 58 success, 11 skipped, none failed: - `packages/runtime`: `vitest run src/domains`, 243 files, 7130 passed, 4 skipped (head `a30533a43`; the follow-up head only adds a module-top `import '@objectstack/metadata'` to five edited tests, and those five re-ran 103/103). - `packages/spec`: `src/system/operation-message.test.ts` 98/98. - `tsc --noEmit -p packages/runtime`: exit 0. `eslint` on `packages/runtime/src/domains/*.ts` and the catalog files: exit 0. - `node scripts/check-route-envelope.mjs`: exit 0. `check:changeset-fixed`, `check:test-source-alias`: exit 0. - `node scripts/pm/overlap-check.mjs`: clean (shares `meta.ts` and `packages.ts` with objectstack-ai#37676, merges cleanly). - The card's claim comment 7211371658 was corrected in place to the fixed `Claim:` / `Branch:` spelling that `check:closing-target-claim` reads. Locally, the gate passes against this PR's context. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic (catalog strings and comments only). - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; lint passes. - [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: no generated artifact depends on these strings or comments. - [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_01L6bhgUpnvPnJ1hR74pUrVj <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgUpnvPnJ1hR74pUrVj --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Sales · project thread
Fixes #37662
Clause-②: yes (widening)
Metadata-protocol: none
Skills-docs: none (no page under
skills/**names these doors'501sentences)维护者速读
/approvals/act和入站自动化钩子返回的 501 提示,现在按请求的语言显示中文、日文或西班牙文。评论、webhook 重新投递、打印等接口已经这样做了。英文请求看到的英文和以前一字不差。packages/spec的消息目录有改动,席位会安排契约审核。What changes
Catalog (
packages/spec/src/system/operation-message.ts,BUILTIN_OPERATION_MESSAGES).en,zh-CN,ja-JPandes-ES:approvals_act_service_unregistered,approvals_act_member_missing,automation_hooks_service_unregisteredandautomation_hooks_member_missing.comment_doors_*,webhook_redeliver_*and the two new families, now states what theprint_*andown_door_*paragraphs state. The locale is the request's topAccept-Languagetag, and a top tag the catalog lacks answers English. Noerrors.override is consulted.packages/runtime/src/domains/approvals.tsandautomation-hooks.ts. Each of the two501s answersoperationUserMessage(key, { locale: requestLocaleOf(context) }), which is fix(runtime): the comment and webhook redelivery doors' 501 follows the request's language #37639's shape for the comment and redelivery doors. Code, status and the absence ofuserMessageare unchanged.N1,
own-door-bridge.ts. The section title "The501is 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 indomains/that builds a bridge domain (createOwnDoorBridgeDomain(), imports it, and checks each exported bridge:nounKeyholds text in every catalog locale;nounKeyis the bridge'snoun;nounPluralis set exactly when the English noun is plural (/\bdoors\b/);_plural) exists in every locale.A module that builds a bridge domain but exports no bridge fails the pin.
Changeset.
@objectstack/specand@objectstack/runtime, both patch.Why
PR #37639's review (record 7200392904, adopted at ACCEPT) left these four items, which the card lists.
Verification
approvals-act.test.tsandautomation-hooks.test.tseach add a describe that pins both501s in four locales:en(with and without a header),zh-CN,ja-JPandes-ES. Each pin checks the exact sentence,501 NOT_IMPLEMENTED, and nouserMessage.approvals.tsandautomation-hooks.tsreverted tomain, the 4 new cases fail atzh-CN. They passenfirst, which shows the English is unchanged.nounPlural: trueremoved fromATTACHMENTS_BRIDGE, the walk fails:'the attachment removal and rename doors': expected false to be true.vitest runonapprovals-act,automation-hooks,own-door-bridge,commentsandwebhooks-redeliver: 5 files, 129 passed.packages/spec:operation-message.test.ts60/60.tsc --noEmit -p packages/runtimepasses.eslinton the 7 touched files passes, andcheck-test-source-aliasis OK.approvals-act.test.tsgains the module-top@objectstack/metadataimport.overlap-checkis clean againstorigin/main.Small decisions
{{door}}template. Neither door is an own-door bridge, and fix(runtime): the comment and webhook redelivery doors' 501 follows the request's language #37639 made the same call for the comment and redelivery doors.createOwnDoorBridgeDomain(and then reading exports. There is no registry to read, and adding one only for the test would be new runtime surface.doors. All three shipped nouns end indoorordoors, so it holds for every bridge today. A noun that breaks the pattern fails the pin loudly rather than passing silently.Owed
packages/specwidens, so the seat rules whether a contract review is owed.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses on the changed files.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_01L6bhgU7eeqHgQrtv5CeJK6
Generated by Claude Code