Skip to content

fix(runtime): the capabilityUnavailable 501 answers in the request's language - #38113

Merged
objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/project-thread-mfe043
Nov 28, 2026
Merged

objectstack-fleet[bot] merged 7 commits into
mainfrom
claude/project-thread-mfe043

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

Requested by Tesla · project thread

Fixes #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 501s.
    • 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 #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 501s in ja-JP and zh-CN, plus the English with no header, with Vary on each.
  • declared-capability-absence-warn-once.test.ts, describe #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 501s now carry Vary: Accept-Language. This is an added header, the same one the other domain 501s have carried since PR fix(runtime): the dispatcher's remaining 501 answers follow the request's language #37845.
  • Size vs origin/main: 16 files across three packages (runtime, spec, types), +547 / −74.
  • Out of scope:
  • 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.ai/code/session_01L9qibvsF1zxzrxqnFoXdzX

…uage

The mounted-but-unimplemented 501 of /ai, /automation, /notifications and
/ui, and a custom flow endpoint's, renders the operation-message catalog's
capability_unavailable_* sentence in the request's top Accept-Language tag
with Vary: Accept-Language. English stays byte-identical to
serviceUnavailableMessage(slot); discovery stays English. zh-CN says 定制包.
The domain 501 source walk now reads code only and sees every 501.

Claude-Session: https://claude.ai/code/session_01L9qibvsF1zxzrxqnFoXdzX
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l 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 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/runtime, @objectstack/spec, @objectstack/types, touching 28 documentable anchor(s). ⚠️ 2 changed file(s) yielded no anchor (packages/runtime/src/domains/own-door-bridge.ts, packages/types/src/server-fault-log.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/permissions/system-context.mdx (via handleAIRequest (symbol, a top-level function), handleAutomationRequest (symbol, a top-level function))
What this run could not see
  • 2 changed file(s) yielded no anchor (packages/runtime/src/domains/own-door-bridge.ts, packages/types/src/server-fault-log.ts) — pages documenting those are invisible to this run
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • 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 — 183 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 0e361201b2a6062cccaa1a2f7d37b82b3ed0465a → packageMentionDocs.

Which tree this was computed on

This run read content/docs from d699696f2c4ad37c2ebd41e14800c1ced3f6c327 — the merge of head 76e31f9472599af796d16ef1e576bcb66df5eee7 into base 0e361201b2a6062cccaa1a2f7d37b82b3ed0465a, 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 d699696f2c4ad37c2ebd41e14800c1ced3f6c327 && git checkout d699696f2c4ad37c2ebd41e14800c1ced3f6c327
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 0e361201b2a6062cccaa1a2f7d37b82b3ed0465a 76e31f9472599af796d16ef1e576bcb66df5eee7 && git checkout -B drift-repro 0e361201b2a6062cccaa1a2f7d37b82b3ed0465a && git merge --no-ff 76e31f9472599af796d16ef1e576bcb66df5eee7

node scripts/docs-audit/affected-docs.mjs --json 0e361201b2a6062cccaa1a2f7d37b82b3ed0465a

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 0e361201b2a6062cccaa1a2f7d37b82b3ed0465a → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1

Contract-review-claim: session_01L9qibwSEecrzDjKjbk24r1 · head d80d5fc · 2026-11-28T02:43Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-28T02:49Z

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: d80d5fc3d7d49c3171d0c98159296276ab9fa74c
Local-runs: none
Scope: packages/spec/src/system/operation-message.ts + packages/runtime/src/domains/unavailable.ts, packages/runtime/src/endpoint-executor.ts, packages/runtime/src/domains/own-door-bridge.ts, packages/runtime/src/domains/domain-501-language-37811.test.ts (the pin the catalog docblock cites)

Read: card #37864 (body, triage, claim with the seat ruling "option B, discovery stays English", dev report, claim amendment), PR #38113 (body, 12-file list, net diff against merge base 93fa9118), and the check-runs on this head. The rest of the diff (ai.ts, automation.ts, notifications.ts, ui.ts call sites, catalog-activation-door.test.ts, endpoint-executor.test.ts, the changeset) is the lane seat's ACCEPT at TIER_DEFAULT.

Check-runs at the time of this record: 24 success, 11 skipped, 31 still in progress, 0 failed. Concluded green: Type Check · source gates, Lint · ESLint, the five other finished Lint · families, Spec property liveness, Check Changeset, Governed Surface Queue Guard, PR-body guards, Check PR Size, Dogfood Regression Gate. NOT concluded: Build Core, Type Check · workspace, Test Core 1-10, Test UI 1-16, Type Check UI, Build & E2E UI, Live E2E UI. This record judges the design; it does not stand in for those verdicts, and the queue reads them when they land.

① Derived judgments

  • BUILTIN_OPERATION_MESSAGES gains five keys (capability_unavailable_install, _unshipped, _ui, _ai, _search) in all four locales: an additive accept-set change on a published constant. Right. No key is removed or renamed, and no other consumer enumerates the catalog's key set (grep at head: the keys are named only in the catalog, unavailable.ts, the two test files and the changeset).
  • The five English templates against serviceUnavailableMessage / REMEDY_DETAIL (core-services.zod.ts at head), read character by character: Install {{package}} to enable, the unshipped sentence with {{slot}}, and the ui, ai and search sentences are byte-identical, the search one including its literal single-brace {basePath}, which interpolateValidationMessage (/\{\{(\w+)\}\}/) leaves alone. Right.
  • Three zh-CN sentences change 「定制软件包」 to 「定制包」 (four occurrences; none left under packages/ at head). The console bundles (ui/packages/i18n zh-Hans.ts, studio/zh.ts) say 「定制包」 throughout. Right; a wording change in one locale, no key or placeholder moves.
  • Wire: the /ai, /automation, /notifications, /ui and custom flow-endpoint 501 gain Vary: Accept-Language on every answer, and a localized error.message only for a request whose top Accept-Language tag resolves to a catalog locale. Status, error.code and the English bytes are unchanged; no header and an uncatalogued language read the prior sentence. Right, and it matches the fix(runtime): the dispatcher's remaining 501 answers follow the request's language #37845 doors. No in-repo consumer string-matches these sentences.
  • capabilityUnavailable(deps, context, slot) gains a required parameter. It is not exported from @objectstack/runtime (exports is . and ./compiled-plugin-manifest-file; no index re-export), and all ten call sites are in the diff. Not a public-surface change. Right.
  • Discovery (services.SLOT.message, http-dispatcher.ts and protocol-discovery-and-bases.ts) is untouched and still reads serviceUnavailableMessage. Right, per the ruling.

② Semver level

Changeset 37864-capability-unavailable-languages.md: @objectstack/runtime patch, @objectstack/spec patch. Matches what the diff publishes: additive catalog keys, a translation wording fix, an added response header and a localized message on an unchanged status and code. Same level as #37845 for the same kind of change.

Clause-②: yes (widening) — on the PR body and the changeset, consistent with each other and with the diff (keys added, nothing taken away). Metadata-protocol: none holds: no file under packages/metadata-protocol is in the diff.

③ Boundary flags

  • open_questions: empty in the dev report. Nothing to answer.
  • Dev flag, surface amendment (endpoint-executor.test.ts added to the claimed files): covered by the seat's claim amendment on the card. Answered.
  • Dev flag, check:test-source-alias exit 1 fixed in 9034ae85 by a module-top @objectstack/metadata import in the test: a test-only change, lane seat's remainder. Two derived gates reported NOT MEASURED locally (check-plugin-teardown-shape --self-test, check:dual-build-cjs-loads); their CI families (Build Core, repo and tooling lint) are among the runs not yet concluded above.
  • out_of_scope_findings: none. Observation, not graded against this diff: fixed-English 501s remain outside src/domains/, where the N4 walk does not look (endpoint-executor.ts unsupportedAnswer, api-endpoint-step.ts, api-mapping.ts, action-execution.ts, and the analytics Install ... to enable the analytics API. sentence in dispatcher-plugin.ts). They are not the capabilityUnavailable family and not on this card; the seat may want a follow-up card.
  • SQL push-down: the diff touches no query, id materialisation or join. Nothing to flag.

④ Design judgment

packages/spec/src/system/operation-message.ts — holds against the ruling and its first consumer. The docblock paragraph was read against the code it describes: the keys are read by the request's top Accept-Language tag through catalogNotImplemented with no translate, so no errors.* override is consulted ("read the same way" is true); _ui, _ai, _search are exactly REMEDY_DETAIL's keys; every other slot takes _install or _unshipped on the same CORE_SERVICE_PROVIDER test and in the same precedence as serviceUnavailableMessage; and the pin it names exists and iterates every CoreServiceName plus an unknown slot. The new keys sit after share_links_unconfigured in every locale, so the earlier paragraph's "from auth_service_unavailable to share_links_unconfigured" range still describes what it described. Translations read correctly in zh-CN, ja-JP and es-ES; package, slot, plugin and route names are left untranslated as the docblock says, and placeholders match the English in each locale.

packages/runtime/src/domains/unavailable.ts — agrees with the contract sentence by sentence. capabilityUnavailableSentence mirrors serviceUnavailableMessage branch for branch; a slot later given a REMEDY_DETAIL sentence fails the pin until it is mapped, as the docblock claims. Tried: an unknown slot (English equal, pinned), a locale with a region the catalog lacks (en-US, pinned; es-MX resolves by language), a {{ inside a slot value (single interpolation pass, printed as written).

packages/runtime/src/endpoint-executor.ts — both flow-target 501s answer automationUnavailableAnswer. ctx.protocolContext.request is the raw request, whose headers record requestLocaleOf reads; the headers on the answer survive api-endpoint-step.ts (...(answer.headers ?? {}), applied on failure too), so the Vary reaches the writer.

packages/runtime/src/domains/own-door-bridge.ts — the requestLocaleOf jsdoc now names its two direct callers; both exist as described.

domain-501-language-37811.test.ts as the enforcing pin — the drift half does what the docblock says it does.

S1 (should-fix) — The operator's fault log now takes the first caller's language, and nothing in the diff says so. dispatcher-plugin.ts hands body.error.message of a composed 5xx to logServerFault, and a 501 NOT_IMPLEMENTED is a declared capability absence (#14656): one warn line per route per process. With this change that one line for /ai, /automation, /notifications and /ui is the localized sentence, so whichever request reaches the route first after a restart fixes the language of the only line the operator gets (a zh-CN or ja-JP browser yields a Chinese or Japanese log line for the life of the process). packages/types/src/server-fault-log.ts names this exact producer and states that its 501 "carries serviceUnavailableMessage(slot)", which is no longer true for such a request. The #37845 doors already behave this way, but this is the family #14656 was ruled on and the high-traffic one (Studio polls /ai unprompted). The catalog docblock states the fault-log behaviour for the print_* keys and is silent here. Either keep the log line English (hand the funnel the English sentence while the wire carries the localized one), or rule the behaviour acceptable and say so in the catalog paragraph and unavailable.ts, correcting the server-fault-log.ts sentence with it.

N1 (nit) — unavailable.ts says the 501 follows the request's language "as every other domain 501 does"; the walk in this same PR lists two domain 501s that deliberately do not (meta.ts errorFromThrown, mcp.ts resumeDoorError). "As the other catalog 501s do" would be exact.

N2 (nit) — codeOnly does not lex regex literals: a quote or // inside one blanks the rest of that line, and a backtick inside one would blank to the next backtick. No domain module at head has such a regex (grep), and the exactly-one-site exemption tests would trip in three files, so nothing is hidden today; a 501 reached through a helper outside src/domains/ is likewise not seen. A comment on the walker naming the two limits would do.

N3 (nit) — zh-CN says 「没有随附的实现」 in _unshipped and _search and 「不附带实现」 in _ai for the same English verb ("ships"). One term would read better.

No must-fix. S1 is open on this head and earns a delta review of its fix.

Implemented-by: claude/project-thread-mfe043
Reviewed-by: session_01L9qibwSEecrzDjKjbk24r1

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1

The brief the contract reviewer above was handed, filled, for the seat to read before it adopts the record:

Contract review brief — PR #38113 @ d80d5fc3d7d49c3171d0c98159296276ab9fa74c (card #37864)

You review at CONTRACT_REVIEW_TIER. Render ONE ## Contract review record on this head — its shape is
node scripts/pm/record-recognisers.mjs --template --paths packages/spec/src/system/operation-message.ts — with a PASS or FAIL verdict, and post it as ONE comment
on the PR or its card.

Inputs — these and nothing else:
· card #37864: its body and EVERY comment (rulings and earlier records included)
· PR #38113: its body, its file list, and the net diff against main at d80d5fc3d7d49c3171d0c98159296276ab9fa74c
· the check-runs on d80d5fc3d7d49c3171d0c98159296276ab9fa74c: their conclusions ARE the gate verdicts
⛔ Not the dispatch order, ⛔ not the dispatching seat's own conclusions — this brief is adversarial by design.

Scope — the paths reviewFace returns as hits on this PR's file list: packages/spec/src/system/operation-message.ts;
plus every file IN THIS DIFF that directly implements or enforces them — the gate that enforces a rule, the code
a jsdoc or schema line describes, the validator a skill teaches — reviewed for agreement with the contract.
Widen it freely, ⛔ never below hits; the record's Scope: line names the implementing files apart from hits.
The rest of the diff (tests, unrelated modules, lockfiles, generated output, changesets) is the lane seat's
ACCEPT at TIER_DEFAULT, exactly as a standalone PR of those files.
④ judges the hits files and those implementing files ONLY:
lockfiles, generated output, changesets and prose elsewhere in the PR are not reviewed;
code outside the diff is READ to judge them, never reviewed.

⛔ READ-ONLY. No worktree, no checkout, no build, no test run, no gate re-run, no ablation: the check-runs
on the head already answered every derived gate family, and a local run costs more than it returns.
If ONE probe is unavoidable, the record's Local-runs: line says probe — REASON; otherwise none.
Scratch space is /tmp/claude-0/-home-user/166e2125-4268-552f-a555-2b7c43a99f0f/scratchpad/pr-38113/ alone; nothing there you did not write this round is read.

Judge, in the record's own sections:
① Derived judgments — every accept-set and public-surface change the diff implies, each named right or wrong.
② Semver level — the changeset (or skip-changeset) matches what the diff publishes, and the Clause-②: line.
③ Boundary flags — every dev flag and every open_questions entry answered, or escalated.
On every face, SQL push-down: a new id materialisation or in-app join where SQL could push down is a
finding unless a reason is given (AGENTS.md, Prime Directive 5: SQL first).
④ Design judgment — for EVERY hits file: does the change hold against the code it cites and the
scenario it is accepted against? A skill file against the card's eval prompt and the spec it teaches
on main; a schema file against the ruling or ADR it implements and its first consumer; an ADR
against its first consumer and its execution plan. For EVERY implementing file in the diff: does the
code agree with the contract, sentence by sentence? Read the cited code in the live tree, and try to
break the design.
Grade each finding must-fix, should-fix or nit — a nit has no effect on correctness or the contract.
A must-fix is a FAIL; a must-fix or should-fix earns a delta review of its fix; nits alone end the round.
Spell a must-fix or should-fix with its id and grade, S1 (should-fix) — …, and a clean round as
No must-fix, no should-fix.: the queue guard reads a graded finding as OPEN on this head and
refuses the record; the delta record names those it closes by id alone, S1: closed.
A nit is fixed only on the prose faces, or left as an accepted deviation or a follow-up card: a fix
anywhere else moves the head, and this record no longer covers it.
⛔ Judge the tree, never the PR body's account of it.
Sign Implemented-by: with the dev's branch and Reviewed-by: with your session id — the value is the FIRST
thing after each colon.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-28T02:50Z

L1-a: REWORK at d80d5fc3d7d49c3171d0c98159296276ab9fa74c

  • The CONTRACT_REVIEW_TIER record above is PASS with one should-fix open, which the queue guard reads as open on this head. The face is packages/spec/src/system/operation-message.ts, a published schema file; Clause-②: yes (widening) is consistent on the body and the changeset.
  • S1 (should-fix): the operator's fault log follows the first caller's language. I read the call site: dispatcher-plugin.ts:384 passes the envelope's body.error.message to logServerFault. A domain 501 is logged once per route per process ([Decision] Should a DECLARED 5xx on a polled route (501 NOT_IMPLEMENTED for an uninstalled optional service) log one error line per request under the "5xx never stays quiet" rule? #14656), so after this PR that one line for /ai, /automation, /notifications and /ui is in whatever language the first request after a restart asked for. packages/types/src/server-fault-log.ts:156 still says that 501 "carries serviceUnavailableMessage(slot)". There are two ways to fix it. One: keep the log line English, for example by logging the English sentence beside the localized body. Two: rule the behaviour acceptable, say so in the catalog paragraph and unavailable.ts, and correct the server-fault-log.ts sentence. Then the same reviewer runs a delta on the fix head.
  • Nits N1 to N3 in the record. On a fix head, worth taking in passing: N1 (the "as every other domain 501 does" sentence vs the two English exemptions this PR's own walk lists) and N3 (the zh-CN wording drift between _ai and its siblings). Neither is required.
  • For the seat: the fixed-English 501s outside src/domains/ (endpoint-executor.ts unsupportedAnswer, api-endpoint-step.ts, api-mapping.ts, action-execution.ts, the analytics sentence in dispatcher-plugin.ts) are outside this card's family. A follow-up card if they pass the filing gate.
  • CI at this head had not concluded when the record was written (0 failed). The fix head needs its own green run anyway.

…glish

The once-per-route fault line took the first caller's language. The answer
now names the English as faultLogMessage, which the dispatcher plugin's
writer prints in place of the body's message; never written to the wire.

Claude-Session: https://claude.ai/code/session_01L9qibvsF1zxzrxqnFoXdzX
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1

Contract-review-claim: session_01L9qibwSEecrzDjKjbk24r1 · head 6200611 · 2026-11-28T03:50Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-28T03:53Z

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 620061105686dcfa58ddcfcd736bc534944b6bbe
Local-runs: none
Scope: packages/spec/src/system/operation-message.ts + packages/runtime/src/domains/unavailable.ts, packages/runtime/src/http-dispatcher.ts, packages/runtime/src/dispatcher-plugin.ts, packages/types/src/server-fault-log.ts, packages/runtime/src/domains/domain-501-language-37811.test.ts (the pin the catalog docblock cites)

Delta review of the fix for S1 of record 7232619079 (head d80d5fc3). Read: the diff d80d5fc3..62006110 (two commits, f80fc5ded the fix and 620061105 a test import; 8 files; merge base unchanged at 93fa9118), the claim amendment 7233430487 on card #37864 with the seat ruling "the fault log stays English", and the check-runs on this head. Everything the first record judged outside this delta stands as written there. The rest of the delta (declared-capability-absence-warn-once.test.ts, the changeset) is the lane seat's ACCEPT at TIER_DEFAULT.

Check-runs at the time of this record: 57 success, 11 skipped, 0 failed, 1 in progress (the Test Core aggregate; all ten Test Core legs, Build Core, Type Check · workspace, every Test UI leg, Check Changeset, Governed Surface Queue Guard and PR-body guards have concluded success).

① Derived judgments

  • HttpDispatcherResult.response gains the optional faultLogMessage?: string. HttpDispatcherResult is a published type (packages/runtime/src/index.ts re-exports it, and @objectstack/adapter-hono imports it), so this is a public-surface widening, and it is declared as one. Right: optional, additive, no existing producer or consumer has to change.
  • The member never reaches the wire. Every writer of a dispatcher result at this head was read: sendResultBase writes res.json(result.response.body) and the status and headers only; the Hono adapter's toResponse writes c.json(result.response.body, result.response.status) and the headers only; packages/verify destructures status and body; the SSE branches read result.result, never result.response. The one place that hands a whole response object to a caller (action-dispatch.ts, answer.response as ActionDispatchAnswer) is the action door, which never calls capabilityUnavailable. Right.
  • The operator's line: capabilityUnavailable sets faultLogMessage to capabilityUnavailableMessage(slot) with no locale, which is the English the first record showed equal to serviceUnavailableMessage(slot); sendResultBase prints it when it is a string and the body's error.message otherwise, so every other answer logs exactly what it logged before. Right, and it is the ruling.
  • zh-CN capability_unavailable_ai now says 「没有随附的实现」: a wording change in one locale, no key or placeholder moves. Right.

② Semver level

Changeset now lists @objectstack/runtime, @objectstack/spec and @objectstack/types, all patch. Matches: an optional member on a published runtime type, a translation wording change, and a comment-only change in types. The added bullet (the fault log stays English) describes the tree.

Clause-②: yes (widening) — the changeset's line now names HttpDispatcherResult.response.faultLogMessage beside the five catalog keys; the PR body carries the same clause. Consistent with the diff. Metadata-protocol: none still holds.

③ Boundary flags

  • Claim amendment 7233430487 covers the four added files (http-dispatcher.ts, dispatcher-plugin.ts, server-fault-log.ts, the warn-once test). Answered.
  • For the seat, not graded: the PR body's "What changes", changeset line and "Size: 12 files" still describe the first head (the diff against main is now 16 files and three packages). The tree is what was judged.
  • For the seat, not graded against this diff: the other localized catalog 501s that went in with fix(runtime): the dispatcher's remaining 501 answers follow the request's language #37845 (catalogNotImplemented in the comment, webhook, approval, hook, auth and the remaining domain doors) set no faultLogMessage, so their once-per-route line still takes the first caller's language. They are on main already and outside this card's family; a follow-up card could set the English in catalogNotImplemented itself.
  • SQL push-down: nothing in the delta touches a query. Nothing to flag.

④ Design judgment

packages/spec/src/system/operation-message.ts — the three added docblock lines are true of the code: the family's line prints the English, through the answer's faultLogMessage. The claim is scoped to the capability_unavailable_* paragraph, where it holds.

packages/runtime/src/domains/unavailable.ts — the new paragraph agrees with the code below it; the answer is rebuilt by spread, so the Vary header and the body from catalogNotImplemented are kept. The custom-endpoint flow target builds its own envelope and is written by the endpoint fallback handler, which emits no fault line at all, so there is nothing there for the first caller's language to reach.

packages/runtime/src/dispatcher-plugin.ts — sendResultBase is the writer every dispatcher domain result goes through, /ai, /automation, /notifications and /ui among them. The other fault-line site in this file (l.384, the family that writes its own result) receives a service route's own { status, body }, not an HttpDispatcherResult; capabilityUnavailable is what answers when no such service exists, so its answer cannot arrive there and the site needs no change.

packages/types/src/server-fault-log.ts — the sentence the first record found stale now says what happens: the wire renders the sentence in the caller's language and the line printed stays English.

The new test drives the real route mount with a ja-JP request first and a plain one second, and asserts the Japanese body, one English warn line, and no faultLogMessage in the serialized body. That is the scenario S1 described.

S1: closed

N1: closed (unavailable.ts now says "as the other catalog 501s do"). N2: closed (the walker's comment names both limits). N3: closed (one term in zh-CN).

N4 (nit) — the faultLogMessage jsdoc in http-dispatcher.ts says "A 501 whose body is in the caller's language sets it to the English". At this head only capabilityUnavailable does; the other catalog 501s set nothing (third bullet of ③). "capabilityUnavailable's 501 sets it" would be exact.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-mfe043
Reviewed-by: session_01L9qibwSEecrzDjKjbk24r1

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-28T03:54Z

L1-a delta: ACCEPT at 620061105686dcfa58ddcfcd736bc534944b6bbe (after REWORK 7232631863)

  • The same reviewer's delta record above is PASS. S1 is closed, N1–N3 are closed, and no must-fix or should-fix is open.
  • S1 follows the seat's ruling: the fault log stays English. capabilityUnavailable sets the off-wire faultLogMessage to the English sentence, and sendResultBase logs it ahead of body.error.message. The new test drives the real route with ja-JP first and pins three things: a Japanese body, one English warn line, and no such member in the serialized body.
  • No wire leak was found. Every writer serializes only response.body, status and headers, and the SSE branches read result.result. dispatcher-plugin.ts:384 receives a service route's own { status, body }, so a capabilityUnavailable answer cannot reach it.
  • HttpDispatcherResult is re-exported from @objectstack/runtime, so Clause-②: yes (widening) naming the optional member is right. The patch level on runtime, spec and types matches the diff.
  • N4 (nit, new): the faultLogMessage jsdoc speaks of any localized 501, but at this head only capabilityUnavailable sets it. The other localized 501s from fix(runtime): the dispatcher's remaining 501 answers follow the request's language #37845 still log the first caller's language. They are already on main and outside this card's family, so they are a follow-up card, for example setting the English in catalogNotImplemented itself.
  • Before landing (prose, moves no head): refresh the PR body, which still describes d80d5fc3. The diff against main is now 16 files and three packages.
  • CI at this head: 58 success, 11 skipped, 0 failed, all concluded.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1

Contract-review-claim: session_01L9qibwSEecrzDjKjbk24r1 · head 76e31f9 · 2026-11-28T04:33Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-28T04:37Z

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 76e31f9472599af796d16ef1e576bcb66df5eee7
Local-runs: none
Scope: packages/spec/src/system/operation-message.ts + packages/runtime/src/domains/unavailable.ts, packages/runtime/src/http-dispatcher.ts, packages/runtime/src/dispatcher-plugin.ts, packages/runtime/src/endpoint-executor.ts, packages/runtime/src/domains/own-door-bridge.ts, packages/types/src/server-fault-log.ts, packages/runtime/src/domains/domain-501-language-37811.test.ts (the pin the catalog docblock cites)

Merge-main record. This head is a merge commit with two parents: 62006110 (the head of delta record 7233494597, PASS) and main 0e361201. Read: the net diff of this head against 0e361201, what main brought in between the old merge base 93fa9118 and 0e361201, the card and PR comments since the delta record, and the check-runs on this head.

Check-runs on this head: 58 success, 11 skipped, 0 failed, 0 in progress.

① Derived judgments

  • The PR's net diff is unchanged. git diff 0e361201 76e31f94 and git diff 93fa9118 62006110 have the same stable patch-id (988d8c3a), 16 files, 547 insertions and 74 deletions. The file list of main's range and the file list of the PR share no path, so the merge resolved nothing by hand. Every derived judgment of records 7232619079 and 7233494597 stands as written. Right.
  • What main brought in (419 files, mostly a release's changelogs and version bumps and UI work) was read for anything that changes what the hit and its implementing files mean. Under packages/runtime/src, packages/spec/src/system, packages/types/src and packages/core/src it is nine files: action-dispatch.ts, action-execution.ts and seven tests. None of the following moved: operation-message.ts, core-services.zod.ts (serviceUnavailableMessage, REMEDY_DETAIL, CORE_SERVICE_PROVIDER, CoreServiceName), server-fault-log.ts (logServerFault), dispatcher-plugin.ts (sendResultBase), http-dispatcher.ts (HttpDispatcherResult), own-door-bridge.ts, endpoint-executor.ts, operation-user-message.ts, the Hono adapter's writer, or packages/verify. Right.
  • No new or changed 501 producer under packages/runtime/src/domains: main's only file there is a test (actions-addressed-route.test.ts). The action-execution.ts and action-dispatch.ts changes add an object-less-action record-key refusal (a 400 validation failure); no added or removed line touches a 501, a response object, a locale or the fault log. So the source walk's exemption list and the wire-leak reading of the delta record hold on this tree.
  • No new CoreServiceName for the drift pin's loop, and no new locale in BUILTIN_OPERATION_MESSAGES that could lack the five capability_unavailable_* keys: neither file changed on main.

② Semver level

Unchanged: the changeset lists @objectstack/runtime, @objectstack/spec and @objectstack/types at patch, and is still in the net diff after main's release commits, so it has not been consumed. It matches what the diff publishes.

Clause-②: yes (widening) — on the PR body and the changeset, naming the five catalog keys and the optional HttpDispatcherResult.response.faultLogMessage. Metadata-protocol: none holds.

③ Boundary flags

  • No new dev flag or open_questions entry since the delta record; the only new comments are the delta record, its L1 ACCEPT and the review claim for this head.
  • The two notes left for the seat in the delta record are unchanged by the merge: the PR body still describes the first head, and the fix(runtime): the dispatcher's remaining 501 answers follow the request's language #37845 catalog 501s still set no faultLogMessage (already on main, outside this card's family).
  • SQL push-down: the PR's diff touches no query. Nothing to flag.

④ Design judgment

packages/spec/src/system/operation-message.ts and every implementing file are byte-identical to the tree the delta record judged, and nothing they cite changed underneath them on main. The judgments of ④ in records 7232619079 and 7233494597 carry to this head without amendment.

S1: closed (in record 7233494597; the fix is in this tree unchanged). N1, N2, N3: closed there. N4 (nit) stands as an accepted deviation or a follow-up: the faultLogMessage jsdoc in http-dispatcher.ts reads as if every localized 501 sets it, and only capabilityUnavailable does.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-mfe043
Reviewed-by: session_01L9qibwSEecrzDjKjbk24r1

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1
2026-11-28T04:39Z

L1-a: ACCEPT at 76e31f9472599af796d16ef1e576bcb66df5eee7, the merge-main head after delta ACCEPT at 62006110

  • I measured the net diff against main and it is byte-identical: git diff 0e361201 76e31f94 and git diff 93fa9118 62006110 give the same git patch-id --stable (988d8c3a…) over 16 files. Main's range and the PR share no path.
  • This head has its own record above (7234165143), from the same reviewer: PASS, S1 still closed. Main changed no 501 producer under packages/runtime/src/domains, and none of sendResultBase, logServerFault, HttpDispatcherResult, serviceUnavailableMessage, CoreServiceName or BUILTIN_OPERATION_MESSAGES. Its action-execution.ts and action-dispatch.ts changes add a 400 refusal and touch no 501.
  • The changeset is still in the net diff, at patch for runtime, spec and types, with Clause-②: yes (widening).
  • CI at this head: 58 success, 11 skipped, 0 failed. N4 (the faultLogMessage jsdoc reads as if every localized 501 sets it) stays a nit or follow-up, and the PR body still describes the first head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU

Landing · 2026-11-28T04:41Z · zone o3-ux (seat card thread)
Head-sha: 76e31f9472599af796d16ef1e576bcb66df5eee7

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 28, 2026 04:42
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 28, 2026
Merged via the queue into main with commit da08375 Nov 28, 2026
70 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-mfe043 branch November 28, 2026 05:31
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/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

runtime: the capabilityUnavailable 501 and the discovery slot message follow the request language, plus the residuals of PR #37845

2 participants