Repository navigation
fix(runtime): the dispatcher's remaining 501 answers follow the request's language - #37845
Conversation
…st's language The fixed-English 501s of the auth, i18n, mcp, meta, packages and automation domains, the action and catalog activation doors, the permission-set clone door, the security suggested-binding reopen and share-links now render an operation-message catalog sentence in the request's top Accept-Language tag through catalogNotImplemented, and carry Vary: Accept-Language. Thirty-one sentences and six activation nouns are new catalog keys in en, zh-CN, ja-JP and es-ES; the English is byte-identical to the sentence each door answered before. capabilityUnavailable stays English (its sentence is the discovery remedy by contract), as does the MCP resume door's 501. Each door pins its language case; a source walk refuses any new deps.error(..., 501) outside the two builders. The requestLocaleOf jsdoc and four gate comments left behind by #37813 are corrected. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
…lection in the edited door tests Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj
📓 Docs Drift CheckThis PR changes 2 package(s): 2 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 — 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 02bb318bb50053d3109ab0e3e83afd5d59116e89 && git checkout 02bb318bb50053d3109ab0e3e83afd5d59116e89
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin adb65d1615dc0698d7b52a113831221bbc187d9f b30bbb0ffba65788668c9bbe4fc42dc086504628 && git checkout -B drift-repro adb65d1615dc0698d7b52a113831221bbc187d9f && git merge --no-ff b30bbb0ffba65788668c9bbe4fc42dc086504628
node scripts/docs-audit/affected-docs.mjs --json adb65d1615dc0698d7b52a113831221bbc187d9f
|
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Re-run failed jobs once (seat) · head 3721556 · 2026-11-27T06:44Z Run 45953485693 ( |
…g the save catch unchanged The durability-degradation guard reads the save catch as a seam around saveMetaItem and refused its new early return. The landing's 501 is thrown before any write, so it is now caught around resolveDefaultCloneLanding alone. Every other failure is rethrown to the save catch, which is back to its main-branch form. 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: Read: card #37811 with its three comments, the PR body, the 27-file list, the net diff against ① Derived judgments
② Semver level
Clause-②: the PR body and the changeset both say S1 (should-fix) — the ③ Boundary flagsThe card lists no
The card's other expectations: every one of the 31 sentence keys is asserted by a door test in the diff; Japanese says SQL push-down: the diff adds no query, no id materialisation and no in-app join. Security: no private finding. ④ Design judgment
The domain modules. Each replaced site keeps its condition, its position in the door's order of checks and its status; only the builder changes. The three
No must-fix. One should-fix, S1 above. Nits, none of which changes an answer:
N1 to N5 are left as accepted deviations or a follow-up card: a fix to any of them moves this head. S1's fix moves the head too and takes a delta review. Implemented-by: VERDICT: PASS |
… stay English 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: Delta record on the review of What moved: one commit, ① Derived judgmentsUnchanged: the published catalog gains 37 keys, the accept set does not move, and 31 ② Semver level
Clause-②: the PR body and the changeset now both say S1: closed The changeset also gains the ③ Boundary flagsUnchanged. The follow-up escalated in the earlier record, localizing SQL push-down: nothing to check; the delta touches no code. ④ Design judgmentNo must-fix, no should-fix. N5: closed. The changeset now names the three N1, N2, N3 and N4 stand as written in the earlier record, each a nit with no effect on an answer. They are accepted deviations on this PR and are carried by card #37864. Check-runs on this head: 59 success, 13 skipped, none failed. One Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 席位核对 — ACCEPT · head b30bbb0 · card #37811 · area s2-ux · 2026-11-27T08:11ZL1 checklist
Tier: S. Landing: ready and queued. |
…language (objectstack-ai#38113) repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU <!-- claude-projects-attribution: {"github_login":"os-tesla"} --> _Requested by **Tesla** · [project thread](https://claude.ai/code/project/chan_01AXsQkLFKRdQCqQ3RTr6Jao?thread=cmsg_01AXsQkLFKRdQCqQ3RTr6Jao8HnUewvapJYQ6bivYQ8GJZ)_ Fixes objectstack-ai#37864 repo:objectstack#3 · os-tesla · session_01L9qibvsF1zxzrxqnFoXdzX Clause-②: yes (widening) — `@objectstack/spec` `BUILTIN_OPERATION_MESSAGES` gains `capability_unavailable_install`, `capability_unavailable_unshipped`, `capability_unavailable_ui`, `capability_unavailable_ai` and `capability_unavailable_search` in every locale; `@objectstack/runtime` `HttpDispatcherResult.response` gains the optional, never-written `faultLogMessage` Metadata-protocol: none ## 维护者速读 - 部署里缺少 AI、自动化、通知或界面服务时,用户在中文、日文、西班牙文界面里看到的「功能未实现」提示,现在用自己的语言说明该装什么;以前一律是英文。 - 属于「错误提示跟随用户语言」这条线,接着上一轮把其余未实现提示本地化的工作,把剩下最大的一组英文提示补齐。 - 英文原句、状态码、错误码一个字节都不变,接口发现文档和给运维看的故障日志仍是英文;如果某句译文不准,只是提示措辞问题,可以直接撤回。 - 无 ## What changes - `packages/runtime/src/domains/unavailable.ts`: - `capabilityUnavailable(deps, context, slot)` now renders through `catalogNotImplemented`. The `501` is in the request's top `Accept-Language` tag and carries `Vary: Accept-Language`. - The slot-to-key map lives here; there is no new spec export. `ui`, `ai` and `search` each have a key of their own. Every other slot reads `capability_unavailable_install` with `{{package}}` from `CORE_SERVICE_PROVIDER`, or `capability_unavailable_unshipped` with `{{slot}}`. - `capabilityUnavailableMessage(slot, locale?)` and `capabilityUnavailableMessageFor(context, slot)` give the same sentence as a string. - The docblock says why discovery stays English (seat ruling, option B on the claim). Discovery is a machine-read surface, and a host-level `/discovery` has no request to read a language from. - The operator's fault log stays English (seat ruling at L1-a): - A declared capability absence is logged once per route per process (`logServerFault`), so a localized line would carry the first caller's language for the life of the process. - `capabilityUnavailable` sets the answer's `faultLogMessage` to the English. - `packages/runtime/src/http-dispatcher.ts`: `HttpDispatcherResult.response` gains the optional `faultLogMessage?: string`. Its jsdoc says it is never written to the wire. - `packages/runtime/src/dispatcher-plugin.ts` `sendResultBase` passes `faultLogMessage` to `logServerFault` when it is a string, and `body.error.message` otherwise. - `packages/types/src/server-fault-log.ts`: the docblock for the declared-absence family now says the wire is localized and the log line stays English. - Call sites: the ten in `ai.ts` (1), `automation.ts` (2), `notifications.ts` (6) and `ui.ts` (1) pass the context they already hold. - `packages/runtime/src/endpoint-executor.ts`: - The custom endpoint's flow target answered the same English sentence (`serviceUnavailableMessage('automation')`) at its two `501`s. - Both now answer `automationUnavailableAnswer(ctx)`: the same localized sentence, with `Vary: Accept-Language`. - Taken here by seat ruling on the claim. - `packages/spec/src/system/operation-message.ts`: - Five keys in `en`, `zh-CN`, `ja-JP` and `es-ES`. The English is byte-identical to `serviceUnavailableMessage(slot)`. - A catalog docblock paragraph for the family, including that the fault log does not follow the request. - N3: zh-CN says 「定制包」 in the three sentences that said 「定制软件包」 (four occurrences), the console's term. zh-CN `_ai` reads 「开源框架没有随附的实现」, the wording `_unshipped` uses. - `packages/runtime/src/domains/own-door-bridge.ts` (N1): `requestLocaleOf`'s jsdoc names its two direct callers, `catalog-activation.ts` for the noun and `capabilityUnavailableMessageFor`. - Changeset `37864-capability-unavailable-languages.md`: `@objectstack/runtime`, `@objectstack/spec` and `@objectstack/types`, each at patch. ## Tests - `domain-501-language-37811.test.ts`, the shared harness for domain `501` language pins: - New describe `objectstack-ai#37864 · 3`: - The English of every `CoreServiceName` slot, and of an unknown slot, equals `serviceUnavailableMessage(slot)`. This is the drift half. - The five keys are translated in every locale, with the English placeholders kept. - Every slot renders non-English text in each catalog locale. - `/ai`, `/automation`, `/notifications` and `/ui`, each with no service, answer 501 · `NOT_IMPLEMENTED` · the slot's sentence in en, ja-JP and zh-CN, with `Vary`. The plain request reads the discovery English. - N2: `/mcp/skill` with no MCP server answers `mcp_server_unavailable` in the request's language, with `Vary`. - N4: the source walk now blanks comments, string literals and template literals first. It flags every `501` written in code in a domain module (any call, any wrapper), not only a literal `deps.error(…, 501)`. - `unavailable.ts` leaves the builder set and is walked. - The walker's comment names its two limits: regex literals are not lexed, and only `src/domains/` is walked. - Four reasoned exemptions. Each is matched by the code before the site and must still match exactly one site: - `meta.ts` `deps.errorFromThrown(e, 501)`: the thrown error's own message. - `mcp.ts` `resumeDoorError(…, 501)`: stays English by design. - `permission-set-clone.ts` `{ statusCode: 501, messageKey }`. - `permission-set-clone.ts`: the read-back of that `statusCode`. - A walker self-check pins a parenthesis inside a string, `errorFromThrown`, a wrapper and a template hole. It also pins no hit in strings, comments, `5010` or `x.501`. - `catalog-activation-door.test.ts` (N2, nouns): - The six activation types are read off the door's own shape refusal, and must equal the rows of the new describe. - Each type is flipped through the door with no ledger in en, ja-JP, zh-CN and es-ES. It must answer its `catalog_activation_noun_TYPE` in that language, with `Vary`, and write nothing. - `endpoint-executor.test.ts`: the flow endpoint's two `501`s in ja-JP and zh-CN, plus the English with no header, with `Vary` on each. - `declared-capability-absence-warn-once.test.ts`, describe `objectstack-ai#37864 — a localized 501 still logs its English`: - A ja-JP request, then a plain request, to `GET /notifications` with no messaging service. - The wire answer is Japanese. - The one warn line names `Install @objectstack/service-messaging to enable`. - The body carries no `faultLogMessage`. - The two edited executor and warn-once suites take a module-top `import '@objectstack/metadata'` for `check:test-source-alias`. ## Acceptance notes - The `501`s now carry `Vary: Accept-Language`. This is an added header, the same one the other domain `501`s have carried since PR objectstack-ai#37845. - Size vs `origin/main`: 16 files across three packages (runtime, spec, types), +547 / −74. - Out of scope: - The `501`s outside `src/domains/` that stay fixed English. - The log language of the other objectstack-ai#37845 `501`s. - The "any 501" wording in the walker's jsdoc. - The seat files these as a follow-up card. - Readings at head 6200611 (`origin/main` 93fa911 merged in at d80d5fc; the branch merges with current main with no conflict, and GitHub reports `mergeable_state` clean): - CI: 58 success, 11 skipped, none failed or pending. - runtime: - `test`: `Test Files 655 passed (655)`, `Tests 12370 passed | 25 skipped`. - `tsc --noEmit`: exit 0. - types: - `build`: exit 0. - `test`: `Tests 963 passed (963)`. - `tsc --noEmit`: exit 0. - eslint on the changed `.ts` files: exit 0. - Derived gates (`dispatch-gates --commands`, 94 on this diff): - 93 exit 0. - NOT MEASURED, exit 3 prerequisite: `check-plugin-teardown-shape.mjs --self-test`. - `check:dual-build-cjs-loads` went red once while a sibling run was rebuilding `plugin-approvals` dist, and passed on a re-run. - `check:test-source-alias` went red in CI at f80fc5d on the edited warn-once suite, and passed after the module-top import in 6200611. - Ablations run through `scripts/ablation-replace.mjs`. Each mutated the committed fix and was restored with blob == HEAD and `git diff HEAD` empty: - `capabilityUnavailable` back to a direct `deps.error(…, 501)`: `Tests 5 failed | 47 passed (52)`. - The activation noun rendered in English for es-ES: `6 failed | 95 passed (101)`. - The endpoint's sentence read without the request: `2 failed | 51 passed (53)`. - `capabilityUnavailable` with `faultLogMessage: undefined`: `1 failed | 7 passed (8)`. - `sendResultBase` ignoring `faultLogMessage`: `1 failed | 7 passed (8)`. ## Verification Read first (by risk): 1. `packages/runtime/src/domains/unavailable.ts`: `SLOT_SENTENCE_KEY`, `capabilityUnavailableSentence` and the `faultLogMessage` it sets. 2. `packages/runtime/src/dispatcher-plugin.ts` `sendResultBase`: the log message choice. 3. `packages/spec/src/system/operation-message.ts`: the five `capability_unavailable_*` keys in each locale. 4. `packages/runtime/src/domains/domain-501-language-37811.test.ts`: `codeOnly` and the exemption list. Two-minute check: 1. Run `pnpm --filter @objectstack/runtime exec vitest run src/domains/domain-501-language-37811.test.ts src/declared-capability-absence-warn-once.test.ts`. It shows 52 and 8 passing. 2. On a host with no AI service, run `curl -H 'Accept-Language: zh-CN' HOST/api/v1/ai/models`. It answers the zh-CN sentence with `Vary: Accept-Language`, and the server's warn line stays English. --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L9qibvsF1zxzrxqnFoXdzX --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Sales · project thread
Fixes #37811
Clause-②: yes (widening)
Metadata-protocol: none
Skills-docs: none (no page under
skills/**quotes these 501 sentences or their headers)维护者速读
Vary: Accept-Language响应头。英文句子、状态码和错误码都不变。What changes
Catalog,
packages/spec/src/system/operation-message.ts: 37 new keys, all inen,zh-CN,ja-JPandes-ES. 31 of them are sentences, one per fixed-English501. The other 6 arecatalog_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 review follow-ups of PR #37721: Japanese term for automation in two 501 sentences, locale-fallback jsdoc wording, requestLocaleOf reader list; remaining fixed-English 501s #37737 aligned. A jsdoc paragraph names the keys and how they are read.Doors,
packages/runtime/src/domains/: every one of these501s now answers throughcatalogNotImplemented(own-door-bridge.ts, review follow-ups of PR #37721: Japanese term for automation in two 501 sentences, locale-fallback jsdoc wording, requestLocaleOf reader list; remaining fixed-English 501s #37737), which reads the request's topAccept-Languagetag and addsVary: Accept-Language:auth.ts: 1i18n.ts: 1mcp.ts: 2 (/mcpand the skill door)meta.ts: 5 (layered read, conditional save, save, draft listing, stored migration)packages.ts: 8automation.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: 1catalog-activation.ts: 1 (on/off sentences, with the localized noun)permission-set-clone.ts: 2security.ts: 1share-links.ts: 1The four
actions.ts,catalog-activation.tsandpermission-set-clone.tssites were found when the premise was re-measured; neither the card nor the seat note listed them. The clone landing's501is thrown fromresolveDefaultCloneLanding. 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 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: the
requestLocaleOfjsdoc now says the four non-bridge families, and now these modules, reach it throughcatalogNotImplemented. The four gate comments forapprovals.ts,automation-hooks.ts,comments.tsandwebhooks.tsinscripts/check-route-envelope.mjsnow say their501s go through it. No gate count changes.Pins:
501test gains a[#37811]block beside it, which asserts byte-identical English with no header, the catalog's Japanese underja-JP, and theVary. These are the run lifecycle, connector credential and connection (with the member named), screen read, catalog and action activation, packages and/metaprobes, permission-set clone and/i18ntests.domain-501-language-37811.test.tspins the doors that had no501fixture:/auth,/mcp, the/metalayered read, conditional save and save,/share-links, the/securityreopen, and the/automationrun list, resume and flow clone.deps.error(…, 501), so a new fixed-English501fails there.operation-message.test.tspins that each of the 37 keys is translated in every locale (not an English echo) and keeps exactly the English placeholders.Changeset:
@objectstack/runtimeand@objectstack/specpatch.Small calls made here (no card):
capabilityUnavailable(unavailable.ts, ten call sites inai.ts,automation.ts,notifications.tsandui.ts). Its sentence isserviceUnavailableMessage(slot), the same remedy discovery reports asservices.<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 this501alone would split the two. Localizing both is a discovery-protocol change and out of this card's scope. The answer carries noVary, because its text does not vary.501(mcp.ts,resumeDoorError). It is thrown into the resume tool's error mapping, not answered as an HTTP501envelope, and the calling agent reads it beside that door's other refusals, which are English.meta.ts'serrorFromThrown(e, 501). It forwards the metadata service's own thrown message, so the sentence is not the door's._on,_off), because the verb does not interpolate across languages.Why
Card #37811 is item 5 of #37737, split out by the seat. Comment 7210862044 adds the
capabilityUnavailable,share-links.tsandsecurity.tssites and review N2 of PR #37813.Verification
Head
372155638, plus5e4ea0904(the clone landing's501is caught aroundresolveDefaultCloneLandingalone, so the save catch keeps its main-branch form and the durability-degradation log-level guard passes: red on372155638, exit 0 on5e4ea0904locally;permission-set-clone.test.ts55/55,tscexit 0). CI on5e4ea0904: 58 success, 11 skipped, none failed:packages/runtime:vitest run src/domains, 243 files, 7130 passed, 4 skipped (heada30533a43; the follow-up head only adds a module-topimport '@objectstack/metadata'to five edited tests, and those five re-ran 103/103).packages/spec:src/system/operation-message.test.ts98/98.tsc --noEmit -p packages/runtime: exit 0.eslintonpackages/runtime/src/domains/*.tsand 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 (sharesmeta.tsandpackages.tswith feat(spec,service-knowledge)!: knowledge_source is a governed metadata type with its loader, its registry and two authoring guards #37676, merges cleanly).Claim:/Branch:spelling thatcheck:closing-target-claimreads. Locally, the gate passes against this PR's context.Human Minimum
packages/specholds no runtime logic (catalog strings and comments only).main, one pull request.packages/spectouched: no generated artifact depends on these strings or comments.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj