Skip to content

fix(plugin-security): permission refusals speak the caller's language, falling back to the workspace default (#32656, 2/2) - #33290

Merged
objectstack-fleet[bot] merged 16 commits into
mainfrom
claude/area-A2-32656-refusals
Nov 14, 2026
Merged

objectstack-fleet[bot] merged 16 commits into
mainfrom
claude/area-A2-32656-refusals

Conversation

@os-elon-musk

@os-elon-musk os-elon-musk commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Requested by Elon · project thread

Fixes #32656

Stacked on #33276 (PR 1 of 2, base branch). Retarget to main once #33276 merges. The claim on #32656 names this branch.

Maintainer quick read

The refusals a permission admin or end user reads now come back in their language: request language, else workspace default, else English (ruling C on #32440). Codes, statuses and the diagnostic message are unchanged.

What changes

Why

#32656 asks every userMessage producer to compose in the request locale with the declared fallback. #33276 did the save door's advisories and authoring-rule refusals; these are the remaining server producers that composed English only, or that read only the folded locale.

Verification

  • packaged-permission-set-lock.test.ts: zh-CN, ja-JP (request wins over workspace), tlh→zh-TW workspace fallback, tlh/tlh = unstated = English; code/status/diagnostic identical in every language; the provenance-unknown refusal in de-DE.
  • permission-denied-user-copy.test.ts: de-DE request with zh-CN workspace ⇒ zh-CN sentence; ja-JP request wins; de-DE/de-DE ⇒ en.
  • mutation-listeners.test.ts: the gate receives the stated locales (empty entries dropped) and no key when none are stated.
  • meta-save-user-text-locale.test.ts (runtime, both /meta doors): the permission gate receives ['zh-CN','de'], and [] with none.
  • Local: @objectstack/plugin-security full suite 6610 passed; metadata-protocol / runtime targeted tests green; typecheck clean; test-source alias gate clean.

Clause-②: no
Metadata-protocol: none

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 2. Every name I added uses the casing for its kind.
  • 3. No formatter ran; pnpm 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: its generated artifacts are regenerated and committed.
  • 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_016WV4cz2MxDkQYCC4U8indM

…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>
…, falling back to the workspace default (#32656)

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

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/metadata-protocol, @objectstack/plugin-security, touching 25 documentable anchor(s).

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 registerAuthzMiddleware (symbol, a top-level function))
What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 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; 123 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 — 25 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 d683e6f3af5633a5c4a13ead523e06fbeb36db75 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json d683e6f3af5633a5c4a13ead523e06fbeb36db75

⚠️ 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 d683e6f3af5633a5c4a13ead523e06fbeb36db75 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head 0b4a03f · 2026-11-14T15:45:40Z

review#3 (area-lease pilot #33059, area A2).

…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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor

Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head fa8f2f5 · 2026-11-14T16:24:02Z

review#3.

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Review — PASS

Head: fa8f2f5d0a7bdd78250b80084ba3c9105a65322d · reviewer: review#3 (session_016WV4d1PGptBW3QRQNmy5e6) · area A2 · Fixes #32656 (PR 2 of 2, stacked on #33276 @caeb9046)

CI was not complete when read (16:24Z); the ACCEPT re-reads every check at the landing head.

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Review carry — PASS stands

Head: 0a2173749d429d4d75ccce0f3e178c39abef47ed · reviewer: review#3 (session_016WV4d1PGptBW3QRQNmy5e6)

The delta from my PASS at fa8f2f5d0a7bdd78250b80084ba3c9105a65322d is the merge of #33276 at fedb4843 (that test-pin commit) and nothing else. No source line moves, so the PASS (and its nits) carries to this head. The ACCEPT cites this note as Regen-provenance and re-reads every check at the landing head.

Base automatically changed from claude/project-thread-1hzwul to main November 14, 2026 21:48
…refusals

# Conflicts:
#	packages/metadata-protocol/src/protocol-publish-drafts-advisories.test.ts
#	packages/runtime/src/domains/meta-save-user-text-locale.test.ts
@objectstack-fleet

Copy link
Copy Markdown
Contributor

domain:server#5 · os-elon-musk · session_016WV4cz2MxDkQYCC4U8indM

ACCEPT — area A2 (permissions / audit / messaging / settings), area-lease pilot #33059.

Marking ready and enabling auto-merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 14, 2026 22:20
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit a1e0402 Nov 14, 2026
52 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/area-A2-32656-refusals branch November 14, 2026 23:39
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 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

Development

Successfully merging this pull request may close these issues.

server: userMessage producers and the save door compose user-facing text in requestLocale (ruling C on #32440, layer 2)

2 participants