Skip to content

fix(runtime): a 501 answered in the request's language says it varies by Accept-Language, and the inbound automation hooks' Japanese 501 says 自動化 - #37813

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-gvxx96-37737
Nov 27, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/project-thread-gvxx96-37737

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Sales · project thread

Fixes #37737

Clause-②: no
Metadata-protocol: none
Skills-docs: none (no page under skills/** quotes these 501 sentences or their headers)

维护者速读

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 501s 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 501s (auth, i18n, mcp, automation, meta, packages, about 26 sentences) are card runtime: localize the remaining fixed-English 501 refusals (about 26 sentences across auth, i18n, mcp, meta, packages and automation) #37811, Blocked-by: #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 501s 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 A localized 404 RECORD_NOT_FOUND is cacheable by default but carries no Vary: Accept-Language #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 #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

  • 1. Schemas start as Zod; packages/spec holds no runtime logic (catalog strings and comments only).
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; lint passes.
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: no generated artifact depends on these strings or comments.
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj


Generated by Claude Code

… by Accept-Language, and the inbound automation hooks' Japanese 501 says 自動化

The localized 501s (the own-door bridge, the comment doors, webhook
redelivery, the approval action-page door, the inbound automation hooks)
now answer through one helper that adds Vary: Accept-Language: a 501 is
cacheable by default, so a shared cache could otherwise serve one
reader's language to the next.

Also: the two ja-JP automation_hooks sentences say 受信自動化フック, the
platform's Japanese term; the catalog jsdoc states how a request's tag is
matched (es-MX → es-ES, zh/zh-TW → zh-CN, ja → ja-JP); requestLocaleOf's
jsdoc names its four reader families; the bridge walk also finds a module
that calls handleOwnDoorBridgeRequest directly, and every bridge noun
must end in door/doors so its plurality is read off the word.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation protocol:system tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 27, 2026
@github-actions

github-actions Bot commented Nov 27, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

20 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
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 182 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 44ccf94a409362dbb3c16fc2f03b321d4e91b797 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from d1e154884bcb9e32cbc473b6e3f1f297fc746b05 — the merge of head 620499a87efcac52eb3f6c413a7c30a2c3268041 into base 44ccf94a409362dbb3c16fc2f03b321d4e91b797, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin d1e154884bcb9e32cbc473b6e3f1f297fc746b05 && git checkout d1e154884bcb9e32cbc473b6e3f1f297fc746b05
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 44ccf94a409362dbb3c16fc2f03b321d4e91b797 620499a87efcac52eb3f6c413a7c30a2c3268041 && git checkout -B drift-repro 44ccf94a409362dbb3c16fc2f03b321d4e91b797 && git merge --no-ff 620499a87efcac52eb3f6c413a7c30a2c3268041

node scripts/docs-audit/affected-docs.mjs --json 44ccf94a409362dbb3c16fc2f03b321d4e91b797

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

…ridge.ts's one hand-built answer

check-route-envelope counts response object literals per domain module;
localizedNotImplemented spreads deps.error's envelope and adds
Vary: Accept-Language, which deps.error cannot express.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Re-run failed jobs once (seat) · head 620499a · 2026-11-27T05:03Z

Run 45941124060 failed only Test UI (12/16) (job 140317738176). The seat judges it a flake, so it re-runs the failed jobs once, after the run completes. A second failure counts as real.

  • The failing case. ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.flowCanvasChip-11665.test.tsx:164, the zh case, asserts the caption text synchronously right after findByTestId returns the element. It read the API name nightly_digest where the flow label 「每日摘要」 was expected: the label had not loaded yet. The title assertion two lines below is already wrapped in waitFor; the text one is not. The shard ran 676 s.
  • The diff does not reach it. This PR changes four packages/runtime domain modules and the own-door bridge, two ja-JP automation_hooks sentences and jsdoc in the spec operation-message catalogue, and scripts/check-route-envelope.mjs. It touches no ui/ file, no flow label and no zh text.
  • The same shard passes elsewhere. Test UI (12/16) succeeded on five other PR runs between 04:25Z and 04:44Z (45939372720, 45939318286, 45939067986, 45938828346, 45937997053). The file's four cases also passed 3 of 3 times locally on this head.

The race goes to a small card of its own.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 620499a87efcac52eb3f6c413a7c30a2c3268041
Local-runs: none
Scope: packages/spec/src/system/operation-message.ts + packages/runtime/src/domains/own-door-bridge.ts, packages/runtime/src/domains/approvals.ts, packages/runtime/src/domains/automation-hooks.ts, packages/runtime/src/domains/comments.ts, packages/runtime/src/domains/webhooks.ts, packages/runtime/src/domains/own-door-bridge.test.ts, packages/runtime/src/domains/automation-hooks.test.ts, scripts/check-route-envelope.mjs

Inputs read: card #37737 (body and both comments), PR #37813 (body, 13 files, net diff against main), and the check-runs on this head: 58 success, 11 skipped, none failed. Test UI (12/16) is green after the one re-run the seat recorded on the PR. Code outside the diff was read on origin/main at c826e8a15; none of the touched files changed on main since the PR's base 44ccf94a4.

The rest of the diff is the lane seat's ACCEPT at TIER_DEFAULT: the changeset and the three other test files (approvals-act.test.ts, comments.test.ts and webhooks-redeliver.test.ts).

① Derived judgments

  • Wire: ten 501 answers gain Vary: Accept-Language. Right. These are the bridge's two and the eight of the comment, webhook-redelivery, approval action-page and inbound-hook doors. Status, code and body are unchanged. On main these ten are the only 501s whose sentence follows the request's language (every requestLocaleOf reader in packages/runtime), so "every door that answers a localized 501 answers through this" holds.
  • The header reaches the client. Right. Both senders copy response.headers: packages/adapters/hono/src/index.ts:846 and packages/runtime/src/dispatcher-plugin.ts:485. Hono 4.13.18's cors appends Vary: Origin after the handler, and the compression middleware appends Accept-Encoding to an existing Vary, so neither member replaces the other.
  • The header is complete. Right. requestLocaleOf reads Accept-Language and nothing else, and the header is sent on the English answer too.
  • Two ja-JP sentences change (受信オートメーションフック to 受信自動化フック). Right. No other file on main uses オートメーション; the ui/packages/i18n and platform-objects Japanese bundles say 自動化. The English is untouched.
  • No package export changes. Right. localizedNotImplemented and catalogNotImplemented are exported from own-door-bridge.ts, which packages/runtime/src/index.ts does not re-export.
  • The gate row own-door-bridge.ts goes from handBuilt: 0 to 1 with a note. Right. It is the gate's own kind 1 (deps.error takes no headers), and the four door modules stay at 0.
  • The noun pin tightens to /\bdoors?$/, and the plural flag to /\bdoors$/. Right. The three shipped nouns pass, and a plural noun spelled another way now fails.
  • Fixes #37737. Items 1 to 4 are delivered in the tree. Item 5 is card runtime: localize the remaining fixed-English 501 refusals (about 26 sentences across auth, i18n, mcp, meta, packages and automation) #37811 (open, Blocked-by: #37737). Item 6 is delivered for the 501s only; see S1.

② Semver level

@objectstack/runtime patch and @objectstack/spec patch match what the diff publishes: one response header on existing 501 answers, two catalog strings, and doc comments. Metadata-protocol: none is right, because nothing an author can write changes. Clause-②: no is right: no accept set moves, no export is added to a package entry point, and the header adds no field a client must send or parse. Both lines are in the PR body and the changeset. Check Changeset is green.

③ Boundary flags

  • Dev flag "Vary goes only on the 501s, not on the whole envelope". The call holds for the ten 501s. Its stated premise does not hold for the rest, and it is escalated as S1.
  • Dev flag "item 4 is closed by widening". Answered: the walk and the pin are both wider in the tree. See N3 for what the walk still cannot see.
  • open_questions. The PR body carries none.
  • SQL push-down. The diff reads and writes no data, so there is nothing to push down.

④ Design judgment

packages/spec/src/system/operation-message.ts (hits). The two rewritten jsdoc passages agree with the resolver on main. The catalog holds en, zh-CN, ja-JP and es-ES. Read through resolveLocaleAmong (i18n-resolver.ts:678): es-MX reaches es-ES at step 5, zh and ja reach zh-CN and ja-JP at step 3, zh-TW finds no Traditional key at step 3 and reaches zh-CN at step 5, and fr or de match nothing, so operationUserMessage drops the locale and the renderer answers English. The print door reads the same way (print-routes.ts:321, then operationUserMessage), so "as the print door's is" is true. The first consumer of the ja-JP strings is automation-hooks.ts through catalogNotImplemented, and automation-hooks.test.ts pins both sentences per language.

Implementing files. localizedNotImplemented spreads deps.error's envelope and adds the one header; catalogNotImplemented renders the key exactly as each door did before (operationUserMessage(key, { locale: requestLocaleOf(context) })). The eight call sites pass the same keys as before, so no sentence moves. The noun jsdoc and the test agree. I tried to break it four ways and none held: a host Vary being overwritten (see ①), an English answer without the header (pinned), a non-localized answer gaining it (the miss and the 500s still go through deps.routeNotFound and deps.error), and a door bypassing the helper (none on main).

S1 (should-fix) — Item 6 of the card closes on a premise the tree contradicts. The card asks to decide Vary for "every refusal localized this way". The PR decides "only the 501s", because "the other localized refusals (403, 409, …) are not" cacheable by default. A 404 is cacheable by default too (RFC 9110 §15.1 lists 404, 405, 410, 414 and 501), and main ships one: 404 RECORD_NOT_FOUND carries a userMessage in the caller's language (record_not_found, packages/core/src/utils/record-not-found.ts:75), and GET /data/:object/:id raises it (packages/metadata-protocol/src/protocol-data-crud.ts:1016). The caller's locale is the request's Accept-Language first. That answer carries no Vary, and Fixes #37737 closes the only card that tracks it. The code on this head is right as far as it goes, so the fix is on the prose faces and does not move the head: file a follow-up card for the localized 404, correct the sentence in the PR body, and record on card #37737 that item 6 is answered for the 501s and continues on that card.

N1 (nit) — Card #37737 has no comment that records the split of item 5. The split is readable only from #37811's body, and the card's claim comment still lists the item 5 doors in its file surface. A one-line comment on the card fixes it.

N2 (nit) — The new requestLocaleOf jsdoc names comments.ts, webhooks.ts, approvals.ts and automation-hooks.ts as modules that read it, and this same diff removes the import from all four. They now reach it through catalogNotImplemented. The four gate comments in scripts/check-route-envelope.mjs for those modules likewise still say their 501s go through deps.error. Both are comments in code, so I leave them as an accepted deviation, to be corrected when #37811 next touches these files.

N3 (nit) — The walk's comment says a new bridge is held to the rules "whichever way it is mounted". It finds a module by the two call spellings inside packages/runtime/src/domains/, so an aliased import, or a bridge built in another directory, is not walked. Accepted deviation: no such bridge exists on main.

Note for #37811, not a finding on this head: the fixed-English 501s on main also include capabilityUnavailable (unavailable.ts, ten call sites in ai.ts, automation.ts, notifications.ts and ui.ts), share-links.ts:184 and security.ts:208. That card's table names none of the three.

Implemented-by: claude/project-thread-gvxx96-37737
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 620499a87efcac52eb3f6c413a7c30a2c3268041
Local-runs: none
Scope: packages/spec/src/system/operation-message.ts + packages/runtime/src/domains/own-door-bridge.ts, packages/runtime/src/domains/approvals.ts, packages/runtime/src/domains/automation-hooks.ts, packages/runtime/src/domains/comments.ts, packages/runtime/src/domains/webhooks.ts, packages/runtime/src/domains/own-door-bridge.test.ts, packages/runtime/src/domains/automation-hooks.test.ts, scripts/check-route-envelope.mjs

Delta review of record 7210823764 on the same head. The head has not moved, so sections ①, ② and ④'s reading of the tree stand as that record wrote them. This round judges only the fixes made on the prose faces, each re-read from the platform: the PR body, card #37737's new comment 7210847585, the new card #37828, and comment 7210862044 on #37811.

Check-runs on this head: 60 success, 13 skipped, none failed. The PR body edit re-ran PR-body guards and Check Changeset, and both are green on the edited body.

① Derived judgments

Unchanged from record 7210823764: every derived judgment was named right, and the tree is the same. Fixes #37737 now holds against the card as its comments stand: items 1 to 4 are in the tree, item 5 is on #37811, and item 6 is answered for the ten 501s with its remainder on #37828.

② Semver level

Unchanged. The changeset is not touched. Clause-②: no and Metadata-protocol: none are still on the PR body's line starts after the edit.

③ Boundary flags

  • Dev flag "Vary goes only on the 501s". Answered. The PR body now says the header goes on the ten request-localized 501s only, and that the localized 404 RECORD_NOT_FOUND of GET /data/:object/:id is cacheable by default, is not covered here, and is tracked by A localized 404 RECORD_NOT_FOUND is cacheable by default but carries no Vary: Accept-Language #37828. The sentence that called the other localized refusals not cacheable is gone.
  • Dev flag "item 4 is closed by widening". Answered in record 7210823764; unchanged.
  • open_questions. The PR body still carries none.
  • SQL push-down. Nothing to push down; the diff is the same.

④ Design judgment

S1: closed. All three parts of the fix are on the platform, and none moved the head.

N1: closed. The same comment records that item 5 is split off to #37811 and that the item 5 doors in the claim's file surface are not part of this PR.

N2: accepted deviation, now carried. Comment 7210862044 on #37811 names both stale comments (the requestLocaleOf reader list and the four gate comments in scripts/check-route-envelope.mjs) for correction when that card touches the files. The same comment adds the three fixed-English 501 sites my note listed.

N3: accepted deviation, unchanged. No bridge on main is mounted in a way the walk misses.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-gvxx96-37737
Reviewed-by: session_01L6bhgV6i8jfWwSXjpWJrjA

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

席位核对 — ACCEPT · head 620499a · card #37737 · area s2-ux · 2026-11-27T05:46Z

L1 checklist

Tier: S. Landing: ready + auto-merge by this stroke.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 27, 2026 05:46
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 27, 2026
Merged via the queue into main with commit 54dc93a Nov 27, 2026
117 of 119 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-gvxx96-37737 branch November 27, 2026 06:14
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:system size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants