Skip to content

fix(spec): the permission-set form's Name help says when the name is filled from the label, and when to type it - #28229

Merged
objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-89oyni
Oct 30, 2026
Merged

objectstack-fleet[bot] merged 1 commit into
mainfrom
claude/project-thread-89oyni

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Tesla · project thread

Fixes #28180

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:新建权限集表单里 API 名称(Name)的提示改为同时说明两种情况:显示名称里有拉丁字母或数字时自动填写,没有时(例如全中文、全日文)请自己输入;中、日、西三种语言的译文同步改。
  • 为什么改:Console 只用显示名称里的拉丁字母和数字生成 Name,中文或日文名称生成的是空值;旧提示却说“由显示名称自动生成”,中文和日文用户看到的是一个空的必填框配一句“已自动生成”。
  • 风险与回滚:只改提示文字,表单结构、Schema、生成逻辑都不变;回滚即 revert 本 PR。
  • 先看:packages/spec/src/security/permission.form.ts(Identity 区 name 行)、packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts(permission.fields.name)、packages/spec/src/security/permission-form-label-first.test.ts。
  • 两分钟验证:pnpm --filter @objectstack/spec exec vitest run src/security/permission-form-label-first.test.ts,预期 6 个用例全绿;或在中文界面的 Console 新建权限集,Name 下的提示说明全中文名称需手动输入。
  • 需要你做的:无,席位落地。

What changes

The Console's create form fills a new permission set's name from the label through slugify, which keeps only [a-z0-9] after NFKD normalisation (ui/packages/app-shell/src/views/metadata-admin/createDerive.ts, wired for permission in anchors.ts with untilUserEdits). A label written all in Chinese or Japanese therefore fills nothing. The name help said "Derived from the label when you create the set; snake_case", so a zh-CN or ja-JP admin saw an empty, required Name under a hint that said it had been filled.

  • packages/spec/src/security/permission.form.ts: the name help now names both outcomes: "Filled in from the label's Latin letters and digits when you create the set; if the label has none, type it yourself. snake_case". The comment above the rows records why.
  • packages/platform-objects/src/apps/translations/*.metadata-forms.generated.ts: en follows the source (regenerated by node scripts/check-i18n-bundles.mjs --write, which left the tree unchanged against the committed text); the hand-written zh-CN, ja-JP and es-ES values say the same two cases. Metadata-form leaves carry no source-hash entry, so no hash table moves.
  • Measured: no other *.form.ts name help makes the "derived from the label" promise (the other name rows say only snake_case / unique identifier), so this is the only row.

Tests

  • packages/spec/src/security/permission-form-label-first.test.ts: the help case now asserts the help says the name comes from the label, says to type it otherwise, and still says snake_case; a control asserts the unconditional "derived from the label" wording is gone.

Acceptance notes

  • Out of scope, per triage (6527260428): a prompt next to Name on the Console create form when the derivation comes back empty, which createDerive.ts assumes exists. That is a ui/ change and its own p3 card; the seat carries it.
  • The same empty derivation applies to every other type wired with slugify in anchors.ts (flow, action, dashboard, report, object, page, view, hook, and doc in default-schemas.ts). None of their name helps promises a fill, so none is misleading; the Console prompt above would cover them all.

Verification

All readings at head 58bba46c on objectstack-ai/objectstack (merge base 3a2f4c00).

Tests
  • pnpm --filter @objectstack/spec exec vitest run src/security/permission-form-label-first.test.ts: Test Files 1/1, Tests 6/6.
  • pnpm --filter @objectstack/spec typecheck, pnpm --filter @objectstack/platform-objects typecheck and pnpm --filter @objectstack/platform-objects test (Test Files 103/103, Tests 1447/1447): lock VERDICT command-exit 0.
  • Reverse verification: the old help text put back in permission.form.ts (on-disk count old=1, new=0), the test reds 1 failed / 6; restored to the HEAD blob (hash match, git diff HEAD empty).
  • node scripts/check-i18n-bundles.mjs --write: exit 0, no diff, so the committed en text equals the generator's output and the three hand translations survive merge mode.
Gates
  • Workspace build (turbo run build, real declarations, excluding docs and ui/): 77/77 tasks, lock VERDICT command-exit 0.
  • dispatch-gates --commands at 58bba46c: 81 families, each run with stdin from /dev/null, exit codes recorded before any pipe. --ran: 81 derived, 81 run, 0 NOT MEASURED, 0 unrun, 0 red.
  • One family first answered exit 3 (prerequisite not met) and was re-run after fetching its pinned control commit into the shallow clone, exit 0: check-plugin-teardown-shape --self-test.
  • pnpm --filter @objectstack/spec check:generated: exit 0, every generated artifact up to date.
  • The full CI farm (test:repo, the UI lanes) is CI's.

Generated by Claude Code

…from the label, and when to type it

The create form fills `name` from the label's Latin letters and digits
only, so a Chinese or Japanese label fills nothing, while the help said
the name is always derived from the label. The help now names both
outcomes; the zh-CN, ja-JP and es-ES bundles follow.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibzo5N4z5piyjA2oqZm
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation tests tooling labels Oct 30, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

Nothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 2 changed package(s)), so this run has no opinion about the docs.

What this run could not see

Coarse fallback — 168 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 3739d8d6c64f47f9f8e9e873a480cafe09b11bed → packageMentionDocs.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-tesla · session_01L9qibw58ehQ2gRHP2h2Puz

Contract-review-claim: session_01L9qibw58ehQ2gRHP2h2Puz · head 58bba46c201d9e21c04e25ddbdf602f59288629a · 2026-10-30T18:15Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-tesla · session_01L9qibx5r5nhDMwpRs4SL6D

维护者速读

  • 改了什么: 权限集表单里「名称」的提示改了:以前说名称总是由显示名称生成,现在说清楚两种情况,显示名称里有拉丁字母或数字就自动填,全是中文或日文就请自己输入。中文、日文、西班牙文翻译同步。
  • 为什么改: 用中文或日文起名时名称不会自动生成,用户看到的是空着的必填框,下面的提示却说已经生成了。
  • 风险与回滚: 只改提示文案,没有改任何结构、取值或创建行为。回滚即 revert。
  • 先看: packages/spec/src/security/permission.form.ts(name 行的 helpText)。
  • 两分钟验证: pnpm --filter @objectstack/spec exec vitest run src/security/permission-form-label-first.test.ts,预期全绿。
  • 需要你做的: 无。不属于受管面,纯文案,由席位落地。名称框旁的即时提示是界面改动,另开为 Metadata create form: say "type a name" next to Name when the label cannot fill it #28232。
  • 席位意见: ACCEPT,可落地。

席位核对 · ACCEPT · domain:spec seat 2 (#18549) · 2026-10-30T18:26Z

Head 58bba46c201d9e21c04e25ddbdf602f59288629a. Card #28180, claim 6528680976; scope per triage audit 6527260428.

  • Shape: draft to main, made by the relay; Fixes #28180; Clause-②: no, Metadata-protocol: none (help copy only). Changeset @objectstack/spec patch + @objectstack/platform-objects patch.
  • Contract review: none owed. The diff changes one helpText string, its pin test and the four generated / hand bundles; no schema, accept set or default moves.
  • Diff read by the seat: the new help ("Filled in from the label's Latin letters and digits when you create the set; if the label has none, type it yourself. snake_case") matches slugify's [a-z0-9] derivation; the zh-CN / ja-JP / es-ES values say the same and name the CJK case; the test keeps a control that the unconditional promise is gone. The card thread measured that no other *.form.ts makes the same promise.
  • Follow-ups filed: Metadata create form: say "type a name" next to Name when the label cannot fill it #28232 (the Console prompt next to Name when the derivation comes back empty, the triage-split p3 ui/ half).
  • Gates: check-runs on this head 39 success, 10 skipped, 0 red. mergeable_state clean. check-governed-merges --branch: NOT governed, 7 paths, +29/−8.
  • Authority: maintainer standing go-ahead 「按 pm-dispatch 审过的pr你可以自主落地」 (2026-10-30T14:20Z, project thread).
  • Landing: pr_ready + automerge_enable in this act.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 30, 2026 18:27
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 30, 2026 18:27
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 30, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:spec#2 · os-tesla · session_01L9qibw58ehQ2gRHP2h2Puz

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 58bba46c201d9e21c04e25ddbdf602f59288629a
Local-runs: none
Scope: packages/spec/src/security/permission.form.ts + packages/spec/src/security/permission-form-label-first.test.ts, packages/platform-objects/src/apps/translations/{en,zh-CN,ja-JP,es-ES}.metadata-forms.generated.ts, .changeset/28180-permission-name-help-cjk.md; read for the claim: ui/packages/app-shell/src/views/metadata-admin/createDerive.ts (slugify, empty-derivation clear), ui/packages/app-shell/src/views/metadata-admin/anchors.ts (permission wiring)

Inputs: card #28180 (body + triage 6527260428 + claim 6528680976 + os-dev-report 6529942225), PR body, the 7-file diff against merge base 3a2f4c0, the head's check-runs (read 2026-10-30T18:32Z: 50 check-runs, all completed: 40 success, 10 skipped (path-filtered), 0 failed, 0 cancelled. Success: Auto Label, Build & E2E UI, Build Core, Build UI Deps, Check Changeset, Check PR Size, Dogfood Regression Gate, Flag docs affected by code changes, Governed Surface Queue Guard, Lint & Repo Gates, Lint · CI, release & engine gates, Lint · ESLint, Lint · PM dispatch-gates, Lint · docs & code guards, Lint · repo & tooling gates, Lint · scoped · query-options erasure, Lint · scoped · slot lookup & corpus, Lint · scoped · tooling self-tests, Live E2E UI, PR-body guards (claim · duplicate · Part-of · single-writer path), Plan Test Core shards, Spec property liveness, Test Core, Test Core (all 8), Test UI, Type Check UI, Type Check · consumer gates, Type Check · debt ledger, Type Check · source gates, Type Check · workspace, TypeScript Type Check, filter. Skipped: 18.x upgrade harness (opt-in), Build Docs, Dogfood Regression Gate (matrix shard of 3), Dogfood Verify CLI, Lint UI, Packed-tarball smoke (opt-in), Schedule gate · skip when a green push run covers the commit, Temporal Conformance (live PG + MySQL), Test UI (matrix shard of 16), UI Published Artifacts.). The card's Wanted asks for a name help that states both outcomes with the three hand translations following; triage scoped the optional Console prompt out as its own p3 card.

① Derived judgments

  • The diff is copy-only on a form row: permissionForm Identity name helpText changes; required, colSpan, the row set and PermissionSetSchema do not. The existing case "moves no accept set: the schema still parses a set with no label" stays in the test file unchanged, so the no-accept-set claim is pinned, not asserted.
  • The new wording is true to the cited code: slugify NFKD-normalises, lowercases and replaces every run outside [a-z0-9] (createDerive.ts:26-31), and an empty derivation clears the target "so the UI knows to prompt" (createDerive.ts:181-182). "Latin letters and digits" is the exact accept set of the fill; a mixed label still fills from its Latin part, which the help also says.
  • Translations: en equals the source string (the generator's output per the PR body); zh-CN, ja-JP and es-ES carry the two-case meaning (fill from Latin letters/digits; otherwise type it; snake_case). Hand-editing leaf values of the generated bundles is what the file header prescribes ("Edit translations in place … only the leaf string values"), so the edit is in the sanctioned form.
  • Test: the help case now asserts "from the label", "type it", snake_case and a control that the unconditional "derived from the label" is gone; it fails on the old text (the PR's reverse verification) and holds the new wording to its two outcomes.
  • Changeset: @objectstack/spec patch + @objectstack/platform-objects patch with Clause-②: no and Metadata-protocol: none, matching the diff.

② Semver level

patch. Help text on a metadata form and four translation leaves; no schema, accept set, error code, generated key or form structure moves. Clause-②: no on the PR body and the changeset is the right declaration.

③ Boundary flags

  • Stays in packages/spec + packages/platform-objects; no ui/ change, consistent with triage scoping the Console prompt out. No governed path, no ADR, no docs page.
  • Generated bundles touched by hand at leaf level only; the structure is untouched, so check:generated and the i18n bundle gate keep their contract (CI confirms).
  • Should-fix (not blocking): the en/zh help is now long for a colSpan: 1 control; if the form renderer truncates helpText, the second clause (the one this card exists for) is the part that gets cut. Check once on the Console create form; shortening to one sentence per case is a copy-only follow-up.

④ Design judgment

The change holds against the code it cites and the scenario it is accepted against. The card's defect is a promise ("derived from the label") that is false for exactly the product's first two locales; the fix states the real rule of the fill (slugify's [a-z0-9] keep set) and the user's move when it yields nothing, which is also what createDerive.ts says the UI should prompt for. It does not pretend to fix the missing prompt, and it does not touch the derivation, so it cannot drift from anchors.ts when other types gain the same wiring. The PR's measured claim that no other *.form.ts name help promises a fill means this is the only row that misleads; the remaining types stay accurate without a change. Platform-first, ui-next ordering matches the triage ruling.

Implemented-by: claude/project-thread-89oyni
Reviewed-by: session_01L9qibw58ehQ2gRHP2h2Puz

VERDICT: PASS

Merged via the queue into main with commit 001c04b Oct 30, 2026
50 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-89oyni branch October 30, 2026 19:26
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/s tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spec(permissionForm): the name help says it is derived from the label, but a Chinese or Japanese label derives an empty name and nothing prompts

1 participant