Repository navigation
feat(metadata-protocol): a metadata write's advisories and refusals come back in the caller's language (#32656, 1/2) - #33276
Conversation
Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM Co-authored-by: Claude <noreply@anthropic.com>
…aller's language (#32656) Doors state userTextLocales (request locale, then workspace default) read off the execution context, which now carries workspaceLocale unfolded. Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM Co-Authored-By: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 5 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 186 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 47be472a011dd2fc07bc79a204c1b2255b4c3228 && git checkout 47be472a011dd2fc07bc79a204c1b2255b4c3228
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 2797f81db7f78d0197f007b7ba502b5816e518c1 750be0fbbc0e5b2b572421ef2a6aebab1bc880d1 && git checkout -B drift-repro 2797f81db7f78d0197f007b7ba502b5816e518c1 && git merge --no-ff 750be0fbbc0e5b2b572421ef2a6aebab1bc880d1
node scripts/docs-audit/affected-docs.mjs --json 2797f81db7f78d0197f007b7ba502b5816e518c1
|
…d locales on the doors' exact request pins The batch publish body schema is the body parser, so userTextLocales stays a protocol-call member there, never a body key. Exact request and execution-context key pins now name the new server-stated members. Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM Co-Authored-By: Claude <noreply@anthropic.com>
|
Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head caeb904 · 2026-11-14T16:24:02Z review#3. |
Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentRuling C on #32440 puts sentence composition at the producer, with the request's language, then the workspace default, then Implemented-by: VERDICT: PASS Nits only. |
… request pin Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM Co-Authored-By: Claude <noreply@anthropic.com>
Review carry — PASS standsHead: The delta from my PASS at |
|
domain:server#5 · os-elon-musk · session_016WV4cz2MxDkQYCC4U8indM CI note · head 085b953: |
…rd on the merged tree Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM Co-Authored-By: Claude <noreply@anthropic.com>
|
domain:server#5 · os-elon-musk · session_016WV4cz2MxDkQYCC4U8indM ACCEPT · area A2 · Part of #32656 (PR1 of 2; #33290 carries Fixes) · head 1cffbad · 2026-11-14T19:22Z
|
…-1hzwul # Conflicts: # packages/metadata-protocol/src/protocol-publish-drafts-advisories.test.ts
|
domain:server#5 · os-elon-musk · session_016WV4cz2MxDkQYCC4U8indM Area A2: re-queue after the merge queue dropped this PR on
|
Requested by Elon · project thread
Part of #32656 (PR 1 of 2; the follow-up PR #33290 closes it).
Maintainer quick read
A metadata write's advisories, and the issues of its 422 refusal, now carry
userMessagewritten in the caller's language: the request's language, else the workspace default, else English (ruling C on #32440).rule,message,hint,pathandwhereare unchanged. A rule with no user sentence carries nouserMessage, as before.What changes
SaveMetaItemRequestSchemaandPublishMetaItemRequestSchemagain optional, server-stateduserTextLocales(array, max 2, ladder order); the doors build these requests member by member, so a wire body never sets it (theclientprecedent).PublishPackageDraftsRequestSchemais the batch door's body parser, so it is unchanged: that door hands the locales topublishPackageDraftsdirectly, and a bodyuserTextLocalesis not read (pinned).ExecutionContextSchemagains optionalworkspaceLocale: the workspace default on its own, becauselocalefolds the request locale and the workspace default into one value and the ladder needs both.assembleExecutionContext*fillsworkspaceLocalefrom the entry localization (never on a guest envelope). New helperuserTextLocalesOf(ctx)returns[locale, workspaceLocale], absent/empty values dropped.evaluateRuntimeAuthoringGatecomposesuserMessageper issue withfindingUserMessage(finding, userTextLocales)(feat(spec, lint): user-facing refusal and advisory text is in the request locale; authoring findings carry a localized user sentence, security posture first #32790's catalog).userTextLocalesis threaded from save, single-item publish, and the package publish promotion into the gate (pass-through only; checked: E1's open PR fix(metadata-protocol)!: an App pair row declared for a package that still ships the name is never served at a bundle addition's address (ADR-0150 D4) #33251 touches none of these files).PUT /meta/:type/:name,POST /meta/:type/:name/publish, the dispatcher's/metasave and thepackagesdomain's publish-drafts stateuserTextLocalesOf(executionContext).Why
Ruling C on #32440 (tracking #32654): the producer of a finding composes its user-facing sentence in the request locale, falling back to the workspace default and then
en, and every client renders it as received. #32790 shipped the catalog and theuserMessagemember (layer 1); its acceptance note 7 left this layer: compose it at the door that knows both locales.Verification
packages/runtime/src/domains/meta-save-user-text-locale.test.ts, on both/metasave doors (runtime dispatcher andRestServer) over a real protocol and SQLite store: the stated locales are read off the execution context (['zh-CN','de'], and[]with none); a zh-CN request gets thesecurity-private-no-readscopeadvisory in Simplified Chinese whilerule/message/hintequal the en answer; an unsupported request locale (tlh) falls back to the workspace default, then toen. 6/6.protocol-publish-drafts-advisories.test.ts: the package publish hands the stated locales to the gate for every promoted draft, and none when unstated.assemble-execution-context.test.ts: the frozen parity pins subtractworkspaceLocaleand assert it positively (present exactly when an authenticated principal's localization names one); new pins for the request-locale-wins / workspace-default-kept split, the guest envelope, anduserTextLocalesOf.http-dispatcher.test.ts,packages-publish-drafts-request-conformance.test.ts(also: a bodyuserTextLocalesis not read),rest-exec-ctx-principal-kind.test.ts,rest-server-meta-door-closed-sets.test.ts,rest-server-meta-member-selector.test.ts.@objectstack/metadata-protocolfull suite 22843 passed;@objectstack/coresecurity 1394 passed; spec api+kernel 3546 passed; test-source alias gate clean; speccheck:generated,check:liveness,check:authorable-surface,check:docs,check:strictness-ledger, ADR-0087 registration, changeset checks green.Not in this PR (follow-up #33290 on #32656): refusal sentences written outside the authoring rules (the packaged permission-set lock's static English, and the permission middleware's denials, which today read only the folded
locale) move onto the same ladder.Clause-②: yes
Metadata-protocol: added
Skills-docs: none —
skills/**andcontent/docs/**teach what a metadata author writes;userTextLocalesandworkspaceLocaleare stated by the server from the caller's request and workspace, never authored or sent by a client, so no taught sentence moves. The generated reference pages are regenerated.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM