Repository navigation
feat(spec): the view and dashboard forms offer the audience gate (requiredPermissions) - #37839
Conversation
…ermissions (wip) Claude-Session: https://claude.ai/code/session_01L9qibxDBbvf7dEeutsepbm Co-authored-by: Claude <noreply@anthropic.com>
…ng forms (wip) Claude-Session: https://claude.ai/code/session_01L9qibxDBbvf7dEeutsepbm Co-authored-by: Claude <noreply@anthropic.com>
…rop the not-enforced ledger entries (wip) Claude-Session: https://claude.ai/code/session_01L9qibxDBbvf7dEeutsepbm Co-authored-by: Claude <noreply@anthropic.com>
… (wip) Claude-Session: https://claude.ai/code/session_01L9qibxDBbvf7dEeutsepbm Co-authored-by: Claude <noreply@anthropic.com>
… audience rows (wip) Claude-Session: https://claude.ai/code/session_01L9qibxDBbvf7dEeutsepbm Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check7 anchor(s) derived from 2 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
Coarse fallback — 177 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 2c2bc8501344021b437d42b11ee78a0c6e7a4264 && git checkout 2c2bc8501344021b437d42b11ee78a0c6e7a4264
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin e69fa46dd326c4dcbbce206f35c8b3398776e76e 7ef98ab887129f0f0a27f06e359fd8a0f3cbb986 && git checkout -B drift-repro e69fa46dd326c4dcbbce206f35c8b3398776e76e && git merge --no-ff 7ef98ab887129f0f0a27f06e359fd8a0f3cbb986
node scripts/docs-audit/affected-docs.mjs --json e69fa46dd326c4dcbbce206f35c8b3398776e76e |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract-review-claim: session_01L9qibwSEecrzDjKjbk24r1 · head bd91d5c · 2026-11-27T06:29Z L1-a (the seat's L1 thread) runs the isolated |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract reviewServed-tier: Inputs read: card #34908 (body and all five comments: triage 6953426292, split 7016189680, analysis 7098042572, ruling 7103739693, claim 7210714615), PR #37839 (body, 26-file list, net diff against Check-runs on this head at the time of reading: 11 completed ① Derived judgments
② Semver level
Nit (changeset prose, not reviewed further): the body says "zh-CN reads ... the other locales fall back to the English source", while the tree also carries authored ja-JP and es-ES leaves. ③ Boundary flags
④ Design judgment
What holds:
Tried to break it: S1 (should-fix) — the two hints, and their zh-CN, ja-JP, es-ES and console-overlay copies, never tell the person setting the gate that it applies to them too. The gate refuses ONE view and a dashboard "on every door and to an author as to anyone" ( Nits (no effect on correctness or the contract):
No must-fix. One should-fix (S1), open on this head. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 The brief L1-a handed its isolated contract-review sub-agent for the record above, filled from
|
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 L1-a, the seat's L1 thread · 2026-11-27T06:35Z 席位核对 — L1 REWORK @
|
… it too A list view or dashboard whose requiredPermissions names a capability the editor does not hold, or a misspelt one, is refused to that editor as well, on every door (Studio included). Both hints now say so, in the English source, the zh-CN, ja-JP and es-ES leaves and the console's zh-CN overlays; the seven fill locales carry the new English. The changeset names the three translated locales. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxDBbvf7dEeutsepbm
|
repo:objectstack#3 · os-tesla · session_01L9qibxDBbvf7dEeutsepbm
Gates at |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract-review-claim: session_01L9qibwSEecrzDjKjbk24r1 · head 98b17b2 · 2026-11-27T07:43Z L1-a runs the delta contract review (the same isolated |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract reviewServed-tier: Delta record. It follows the record on head Check-runs on this head: every run is completed; 59 ① Derived judgments
② Semver levelUnchanged: ③ Boundary flags
④ Design judgmentS1: closed The added sentence, in both The copies, each read against the English:
Earlier nits:
New in the delta:
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 L1-a, the seat's L1 thread · 2026-11-27T07:46Z 席位核对 — L1 ACCEPT @
|
…-16f1ht The translated-label positive control is re-derived as 844: 840, plus the `form` type's label from #37086, plus the three audience labels of #34908. The dashboard form's comment names the renamed `view.metadata-form.ts`. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibxDBbvf7dEeutsepbm
|
repo:objectstack#3 · os-tesla · session_01L9qibxDBbvf7dEeutsepbm
|
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract-review-claim: session_01L9qibwSEecrzDjKjbk24r1 · head 7ef98ab · 2026-11-27T08:33Z L1-a has the same reviewer read the merge delta |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract reviewServed-tier: Second delta record. It follows the records on Read this round: Check-runs on this head: every run is completed; 59 ① Derived judgments
② Semver levelUnchanged: ③ Boundary flags
④ Design judgment
The implementing files (the reconciliation ledger, the two console overlays, the round-trip test) are untouched by the merge resolution and carry the same hunks as before. S1 stays closed. The nits of the earlier records (N2, N3, N4, N5) are unchanged: accepted deviations or follow-up material. The merge introduces no new finding. No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 L1-a, the seat's L1 thread · 2026-11-27T08:35Z 席位核对 — L1 ACCEPT @
|
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-27T08:37Z · head 7ef98ab
ACCEPT: L1-a 7213715549 at this head; same-head contract record 7213693656 PASS (tier verified), after the origin/main merge (count re-derived 844). CI 59 success, 10 expected skip, 0 failed. Ready + auto-merge now. This is part 1 of 2 for #34908: the card stays |
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
Requested by Tesla · project thread
Part of #34908 — the spec half (step 1 of the ruling's execution). The console and Studio picker is the second PR; the card stays open for it.
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
Ruling 7103739693 (letter B) on #34908, verbatim: 「B 给已有权限门补入口 — 控制台和设计器加「谁能看此视图」选择,并显示哪些岗位会看到;不改协议,约2个PR。」 This PR is its step 1: a list view's and a dashboard's
requiredPermissions(declared and server-enforced since ruling 6095014058) gets an authoring row. No key, value, gate or export changes.packages/rest/src/meta-view-audience-save-round-trip.test.ts. The exact envelope the console's add-view door writes (viewEnvelope: the gate underconfig, beside the object binding), drafted (PUT ?mode=draft,If-None-Match: *) and published, keepsrequiredPermissionsin the draft read, the stored active row and the served item; the read gate then serves a holder and refuses a non-holder403 PERMISSION_DENIED. An edit that clears the gate stores no key and serves the non-holder again. Control: an ungated view is served to everyone. Real routes, realsaveMetaItem, better-sqlite3sys_metadata. The save door does not strip or refuse the key, so no fork.packages/spec/src/ui/view.form.ts— thenavigation_sharingsection gains arequiredPermissionsrow (string-tags, the faceapp.form.tsandaction.form.tsuse).packages/spec/src/ui/dashboard.form.ts— a new collapsedAccesssection holding the same row.AUDIENCE_REQUIRED_PERMISSIONS_DESCRIPTION(all of them required, empty is no gate, no any-of form, enforced by the server) in an administrator's words, and add what an administrator needs: a position passes on what its permission sets grant, and the gate applies to the person setting it too (a capability they do not hold, or a misspelt one, refuses the view or dashboard to them on every door, Studio included). They are worded for the person building the view, not copied verbatim from the describe, because the dashboard panel's hints are held to business wording (仪表盘设置面板:提示文字仍是开发者用语(如 gap 的 0.25rem 步长、snake_case) #36816).packages/spec/src/system/metadata-form-zod-reconciliation.test.ts— the twoomitledger entries forview/dashboardrequiredPermissionsare dropped. Their own reason was "declared, not enforced yet … whether to offer it then is a ruling for the enforcement"; the gate has been live since rest(/meta read gate): enforce a list view's and a dashboard'srequiredPermissionson the list read and the by-name read, so each audience is served only its own views and boards (the rest half of #22611) #22639 and the offer is now ruled.node scripts/check-i18n-bundles.mjs --write; zh-CN (「所需权限」 / 「访问权限」), ja-JP and es-ES leaves authored, the other seven locales left as extractor fills. The console's zh-CN overlay (metadata-form-zh-cn.tsforview,metadata-form-i18n.tsfordashboard) carries the same zh words. The translated-label positive control inobject-lifecycle-panel-echo-decisions.test.tsmoves 840 → 843 (two row labels + one section label).Tests
Commands and results (head bd91d5c after merging origin/main)
Round 2 (L1-a 7211677883), head 98b17b2:
platform-objectssrc/apps/translations/28 files, 625 tests passed; specsrc/ui/+metadata-form-zod-reconciliation195 files, 6750 tests passed; uipackages/app-shell/src/views/metadata-admin/804 files, 8686 passed, 1 skipped;check:generated14/14;check:i18nandcheck:i18n-stale-fillOK. The round-1 results below are at bd91d5c.pnpm --filter @objectstack/rest exec vitest run src/meta-view-audience-save-round-trip.test.ts→ Test Files 1 passed, Tests 3 passed (re-run after the merge).packages/spec:vitest run src/ui/ src/kernel/repeater-item-titles.test.ts src/system→ 273 files; 1 failure (the ledger entries this PR drops), green once they were dropped:metadata-form-zod-reconciliation.test.ts79/79; after the merge, that file plusview-form-composite-childrenanddashboard-form-business-wording-36816: 3 files, 110 tests passed.packages/platform-objects:vitest run src/→ 130 files, 2214 tests passed (after the ja-JP / es-ES wording and the 843 control); after the mergesrc/apps/translations/28 files, 625 tests passed.ui:pnpm exec vitest run packages/app-shell/src/views/metadata-admin/ packages/plugin-designer/src/__tests__/designerForms.sharedSelect-11865.test.tsx→ 805 files, 8786 passed, 1 skipped.pnpm --filter @objectstack/rest typecheck→ exit 0 (test layer included).pnpm --filter @objectstack/spec check:generatedafter the merge and a spec rebuild → all 14 generated artifacts up to date.Derived gates (dispatch-gates --commands, 93 families)
Round 2, head 98b17b2: 93 derived, 93 run, 0 NOT-MEASURED, 0 UNRUN. 92 exited 0 on the sweep;
pnpm --dir ui exec vitest run scripts/was SIGKILLed while the ui suite ran beside it and re-ran alone green (172 files passed, 2 skipped). The round-1 lines below are at bd91d5c.93 derived, 93 run (
--ranreconciliation: 0 NOT-MEASURED, 0 UNRUN).87 exited 0 on the first pass. 5 exited 3 (prerequisite) and were re-run green: the four spec
distreaders (check:api-surface,check:dual-source-exports,check:entry-nameability,check:exported-any) after a spec rebuild, andcheck-plugin-teardown-shape --self-testafter unshallowing the clone.check:authorable-surface,check:docs,check:i18nandcheck:i18n-stale-fillwere re-run green after the last translation edit.NOT MEASURED:
check:dual-build-cjs-loads, reason: it needs every package'sdist/(a fullpnpm build); this diff changes no package's build shape. CI runs it.Acceptance notes
ui/packages/app-shell/src/views/studio-design/ObjectListViewInspector.tsx; that file no longer exists onmain. Studio's view panel ismetadata-admin/inspectors/ViewVariantInspector.tsx, which rendersviewFormthroughSchemaForm, so the new row already appears there as a tag box. The capability picker (limited to the capabilities the environment knows) with the "which positions will see it" preview replaces that tag box in the second PR, together with the 新建视图 control, the shared-hint correction and thecapabilities.mdxrecipe.Verification
Open Studio on any list view, expand 导航与共享: the 所需权限 row is there with its hint. Type a capability name and publish: a user without it no longer sees the view in the switcher, and opening its URL answers 403.
Generated by Claude Code