Skip to content

fix(platform-objects): Create User picks its permission set from a list, and a refused grant says in one line what to pick - #30701

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-w9414q
Nov 6, 2026
Merged

objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-w9414q

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Elon · project thread

domain:server#3 · os-elon-musk · session_016WV4cwFtiPisvhAkegNCLQ

Fixes #30117

Clause-②: no (no new export, error code, accept set or schema key: a platform-objects param uses the existing ActionParamSchema.widget; the refusal keeps 400 VALIDATION_FAILED / reference_not_found, only its sentence changes)
Metadata-protocol: none

维护者速读

  • 改了什么:「新建用户」的「权限集」从只认机器名的空文本框,改成按标签列出权限集的可搜索下拉(widget: 'permission-ref',就是授权表本身用的选择器);Studio 的动作预览也画成下拉,和真实对话框一致。
  • 拒绝提示:原来是一大段开发者说明;现在是一句业务话。输入的是某个权限集的标签时,直接说出它的名称,例如 "'Repair Technician' is the label of the permission set named 'asset_repair_technician': choose it from the list, or enter 'asset_repair_technician'.";同一句话覆盖所有授权路径(Setup 的授权表单与新建用户)。
  • 不变的:依旧只接受名称,不接受标签;拒绝依旧是原子的,不会留下用户;状态码与错误码不变。
  • 边界:只提示调用者能授予的集合;代理上限权限集(MCP agent)从不提示;非租户级管理员先被委托管理闸门拒绝,听不到任何集合名。
  • 先看:grant-permission-set-name.ts 的 grantSetNotInCatalogMessage / setsLabelled,sys-user.object.ts 的 permissionSet 参数,ActionPreview.tsx 的 runtimeWidgetFor。
  • 需要你做的:无,席位在 CI 绿后按落地授权落地。

What changes

  • packages/platform-objects/src/identity/sys-user.object.ts. create_user's inline permissionSet param adds widget: 'permission-ref' and keeps type: 'text': the action dialog (since ui: resolveActionParams and paramToField pass a param widget through, so an action dialog draws the permission-set picker (#30117 slice 2) #30260) draws the grant column's own picker, a searchable list of the permission sets each shown by its label, submitting the chosen set's name. The stale comment "its picker is a widget hint params do not inherit" is retired. The param stays inline, so the dialog never needs plugin-security metadata to open.
  • ui/packages/app-shell/src/views/metadata-admin/previews/ActionPreview.tsx. runtimeWidgetFor now asks paramToField itself (with the authored widget) which widget the dialog draws, instead of resolveParamWidgetType(type), so the preview's answer is authoredWidgetKey(param) ?? resolveParamWidgetType(type), the dialog's expression, by construction (note 6662463937 line 2). A permission-ref answer is mocked as a disabled picker ("Select LABEL"); an unregistered widget name degrades to the type control, as in the dialog. paramToField.ts is not edited.
  • packages/plugins/plugin-security/src/grant-permission-set-name.ts. The shared refusal sentence (grantSetNotInCatalogMessage) is one line:
    • the refused value is one set's label (trimmed, any case): 'Repair Technician' is the label of the permission set named 'asset_repair_technician': choose it from the list, or enter 'asset_repair_technician'.
    • a label several sets carry: they are listed, none is picked;
    • otherwise: There is no permission set named 'xyz': choose one from the list.
      The catalog is listed only on a refusal (setsLabelled); agent ceiling sets (MCP_AGENT_PERMISSION_SETS) are never suggested, the same exclusion the picker makes; a listing that throws leaves the plain sentence and is reported at warn. A label is still never accepted as a name.
  • packages/plugins/plugin-auth/src/admin-user-endpoints.ts. grantRefusal keeps "The permission set was not assigned, so no user was created" and hands the reason on as its own sentence (. instead of : ), so the composed answer reads as two sentences. Status, code, fields and the rollback are unchanged.
  • Changesets, one per package moved, all patch, both declaration lines: @objectstack/platform-objects, @objectstack/plugin-security, @objectstack/plugin-auth, @object-ui/app-shell.

Why

Before (measured at origin/main b77c160a)

main this PR
create_user.params.permissionSet { type: 'text' }, no widget { type: 'text', widget: 'permission-ref' }
dialog control text box (ActionParamDialog.test.tsx CONTROL cell, #30260) permission-set picker (same file, picker cell)
Studio preview control text box (runtimeWidgetFor → resolveParamWidgetType('text')) disabled picker, data-testid="action-preview-permission-ref"
refusal for 'Repair Technician' (Create User) The permission set was not assigned, so no user was created: Permission Set: no permission set is named 'Repair Technician'. sys_user_permission_set.permission_set takes the machine name of a permission set in the security catalog (a package's set, a built-in, or one saved through the metadata door), never a record id: write the name of an existing permission set, or declare the set first. The permission set was not assigned, so no user was created. 'Repair Technician' is the label of the permission set named 'asset_repair_technician': choose it from the list, or enter 'asset_repair_technician'.
user created on refusal no no

Who the picker lists

permission-ref lists GET /api/v1/meta/permission minus the agent ceiling sets; it is not filtered per caller. Create User is visible only to a platform administrator (current_user.isPlatformAdmin), a tenant-level administrator whom the ADR-0090 D12 gate admits for every set except the agent ceilings, which the picker leaves out. So for this action's audience the listed sets are the grantable sets. The picker does not narrow per delegate on other surfaces; that is the picker's existing behaviour and not changed here.

The suggestion stays inside the caller's grant reach

The name check runs only after the D12 gate admitted the write. An organization administrator or a delegate naming a value the catalog does not hold is refused by the gate itself (delegated-admin-gate.test.ts, "not in the security catalog"), and a caller who administers nothing is refused 403 too, so neither hears a set name. Past the gate stand only tenant-level administrators. Pinned below.

Verification

Tests added or changed (all green locally):

  • plugin-security grant-permission-set-name.test.ts, new describe "the refusal says, in one line, what to pick instead" (7 cells, real ObjectQL + SQL driver + SecurityPlugin): plain sentence with no developer vocabulary; label → name; case/space-insensitive match; shared label lists both; agent ceiling never suggested; caller refused by the D12 gate hears no set name (403, nothing stored); unlistable catalog still refuses with the plain sentence and warns. Every cell asserts nothing is stored. File: 23 passed.
  • plugin-auth admin-user-endpoints.test.ts: the refusal's composed message, fields and rollback; the param pin adds widget: 'permission-ref'. 99 passed.
  • platform-objects sys-user-create-user-email-required.test.ts, new top-level describe pinning the param on the SOURCE (plugin-auth's pin reads the built dist, see ablation B2). 6 passed.
  • ui ActionDesigner.paramVocabulary.test.tsx, new top-level describe (4 cells): the dialog's adapter answers permission-ref; the preview draws the picker; CONTROL without widget is a text box; an unregistered widget degrades to the text box. 23 passed.
  • qa/dogfood create-user-permission-set.dogfood.test.ts (real showcase boot, real route): G2 pins the composed message; new G4 sends the label Showcase Contributor and gets 400 naming showcase_contributor, zero users. 4 passed.

Ablations (old behaviour put back, red seen, restored):

  • A1 old developer sentence: 6 of the new plugin-security cells red (Received: "Permission Set: no permission set is named 'qa_nowhere'. sys_user_permission_set.permission_set takes the machine name …").
  • A2 no label lookup: the 3 label cells and the unlistable-catalog warn cell red (Received: "There is no permission set named 'QA Alpha': choose one from the list.").
  • A3 agent ceiling not excluded: the agent cell red (Received: "'QA Agent Reader' is the label of the permission set named 'mcp_agent_data_read': …").
  • A4 reach cell run with a tenant-admin caller: red (the suggestion appears), so the cell measures the gate's ordering.
  • B1 old : joiner: plugin-auth refusal cell red.
  • B2 widget removed from the param: plugin-auth stays green (it reads @objectstack/platform-objects dist), which is why the source pin C1 exists; C1 red (- "widget": "permission-ref").
  • D1 preview ignores widget: the preview picker cell red (Unable to find an element by: [data-testid="action-preview-permission-ref"]).

Gates (head b5c69de7): node scripts/pm/dispatch-gates.mjs --ran reconciles 71 derived families: 70 run, all exit 0; 1 NOT MEASURED, node scripts/check-plugin-teardown-shape.mjs --self-test exit 3 (its positive control is pinned to commit 621a4876, unreachable in this shallow clone; checker-health only). Also exit 0: pnpm lint; typecheck and test for @objectstack/platform-objects, @objectstack/plugin-security, @objectstack/plugin-auth. Record: gates-ran-b5c69de7.txt in the seat's project folder.

Skills-docs: none owed by this diff. git grep -n "create_user\|permissionSet" -- skills has no hit; content/docs/** has no copy of the refusal sentence. content/docs/permissions/authentication.mdx ("Create a User Directly") documents create-user without the optional permissionSet at all, a gap that predates this PR; follow-up candidate.

Deviations

  • File surface: packages/qa/dogfood/test/create-user-permission-set.dogfood.test.ts (test-only, outside the order's list), accepted by the seat for the end-to-end label case.
  • The refusal names a set's name when the refused value is a set's label (a catalog list read on the refusal path only), beyond rewording; the seat asked that the suggestion stay inside the caller's grant reach, pinned above.
  • ActionPreview mocks permission-ref as a picker, one key past the eight PARAM_TYPE_OPTS the preview's mock vocabulary covered, because a text box there would still contradict the dialog.
  • Full pnpm test across the monorepo was not run; the four moved packages' suites, the ui previews/designer suites and the dogfood file were.

Acceptance notes

  • The result dialog's Permission Set row still shows the granted set's name, not its label (resultDialog.fields path permissionSet); not in the card's ask.
  • A translated label (for example a zh-CN label) is not matched by the suggestion: the catalog's label is the source string.
  • ui/packages/app-shell/src/views/metadata-admin/AssignedUsersSection.test.tsx mocks a server message with the old wording as its fixture; it pins that the form shows the server's words, whatever they are, so it is left as is.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (not touched)
  • 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: n/a.
  • 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 by Claude Code

…st, and a refused grant says in one line what to pick

- create_user's permissionSet param declares widget: 'permission-ref', so the
  action dialog draws the grant column's picker (sets listed by label, the
  name submitted); the stale "params do not inherit" comment is retired.
- Studio's ActionPreview asks paramToField which widget the dialog draws, so
  an authored widget previews as the dialog draws it.
- plugin-security's shared grant refusal is one business line; when the
  refused value is a set's label it names that set's name (agent ceiling
  sets never suggested). plugin-auth's Create User prefix keeps "no user was
  created" and hands the reason on as its own sentence.

Claude-Session: https://claude.ai/code/session_016WV4cwFtiPisvhAkegNCLQ
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 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

6 anchor(s) derived from 3 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
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 63 of 221 client-bound route-ledger rows — the other 158 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 158: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 55 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 103 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 — 30 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 ab44ec94b0362bafdf5f610b1d121655cd39a5fa → packageMentionDocs.

Which tree this was computed on

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

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

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

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#3 · os-elon-musk · session_016WV4cytQjG9X1CrCgytUM5

ACCEPT · #30117 · 2026-11-06T00:11Z · Head-sha: d2c87c847b27345cabccba07a6076fc1caac716c

席位核对

  1. Shape: 13 files, +354/−27: create_user's permissionSet param gets widget: 'permission-ref' (sys-user.object.ts); grant-permission-set-name.ts builds the refusal through grantSetNotInCatalogMessage(value, labelledAs), naming the set's name when the caller typed its label, and lists only setsLabelled (MCP agent sets excluded); admin-user-endpoints.ts joins the two sentences with ". "; Studio's ActionPreview.tsx renders the param through paramToField(resolved).type with a permission-ref mock; four patch changesets; pins in plugin-security, plugin-auth, platform-objects, the ui designer test and a dogfood route test. Diff read at this head; the last commit is a plain merge of origin/main with no conflict and none of this PR's files touched by main.
  2. Premise, measured: the refusal keeps 400 VALIDATION_FAILED / reference_not_found and still creates no user; only the sentence and the hint list change. permission-ref is an existing ActionParamSchema.widget value, so Clause-②: no and Metadata-protocol: none hold (no new export, code, accept set or schema key).
  3. Gates: 71 derived at b5c69de7: 70 exit 0, 1 exit 3 NOT MEASURED (check-plugin-teardown-shape --self-test, positive control pinned to a commit unreachable in a shallow clone; checker-health only). After the main merge the dev re-ran install, rebuild, check:i18n and the touched packages' tests (plugin-security 23, plugin-auth 99, platform-objects identity 474, ui designer 23, dogfood 4), all green. Check-runs on this head: 56 success, 8 skipped, 0 failed; the PR-body guard is green on the re-posted claim.
  4. Accepted deviations / corrections: the PR body's gate line names head b5c69de7; the merge commit moves no file of this PR, so the reading carries.
  5. Out of scope: content/docs/permissions/authentication.mdx ("Create a User Directly") never documented the optional permissionSet; this gap predates the PR and is a docs follow-up candidate, not owed here. Skills-docs: none holds (no skills/** hit).
  6. Landing: check-governed-merges --pr 30701: NOT governed, 381 lines. Ordinary queue landing by this seat now: ready + auto-merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 6, 2026 00:12
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 6, 2026
Merged via the queue into main with commit 8fed00f Nov 6, 2026
65 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-w9414q branch November 6, 2026 00: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.

Create User: the permission set is a free text box that only accepts the machine name

1 participant