Skip to content

fix(app-shell): a member Setup refuses gets the app's no-access page on Setup's settings and marketplace routes - #27590

Merged
objectstack-fleet[bot] merged 3 commits into
mainfrom
claude/project-thread-srudju
Oct 29, 2026
Merged

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

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

domain:ui#2 · os-bill · session_01Utp6CY2n1JmZZKrHgtp9jC

Requested by Bill · project thread
Fixes #27507

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:没有 Setup 权限的普通成员打开 Setup 的设置页(system/settings、system/settings/NAMESPACE)和应用市场(system/marketplace、system/marketplace/PACKAGE)时,不再落进默认应用(如 Showcase)的外壳里看「No settings registered」或原始权限报错,而是和打开 Setup 根路由一样,看到「You don't have access to this app … Back to home」。
  • 为什么改:这些路由带 system 段,属于伪路由,过去不等待 Setup 的访问裁决,直接回落到默认应用;三处页面各自解读服务端的拒绝,出了三种说法。分诊裁定:一律走应用根已有的无权限页,不新增文案。
  • 风险与回滚:只改前端外壳的路由判断(一个谓词),服务端拒绝逻辑不变;管理员和能打开该应用的用户行为不变;审批收件箱及其记录页(objectui#12706 留下的开放路由)不受影响。回滚即 revert 本 PR。
  • 先看:ui/packages/app-shell/src/console/AppContent.tsx 中 isSettingsOrMarketplaceRoute 与 appSurfaceAwaitsVerdict 两行;然后是新测试 AppContent.settingsMarketplaceVerdict-27507.test.tsx。
  • 两分钟验证:pnpm --dir ui exec vitest run packages/app-shell/src/console/__tests__/AppContent.settingsMarketplaceVerdict-27507.test.tsx,预期 11 个用例全绿。
  • 需要你做的:无,席位落地。

What changes

AppContent (app-shell) already waits on the access verdict for the app the URL names on two pseudo-route families, Setup's root and the metadata-admin routes (objectui#12706), and draws renderAppAccessDenied on denied. This adds a third family to appSurfaceAwaitsVerdict: a route whose sub-path is system/settings... or system/marketplace... (isSettingsOrMarketplaceRoute). Nothing else moves:

  • The gate still applies only when the URL names an app the loaded list does not carry (!matchedApp), so an admin, and any caller under an app they may open, render the pages exactly as before, unprobed.
  • Every verdict other than denied (not_found, unreachable, unknown, granted) falls through to the pseudo-route rendering, unchanged.
  • The routes objectui#12706 deliberately left open stay open: the approvals inbox (system/approvals, where the server's approval links forward) and the record pages it opens (OBJECT/record/ID). Their pins in AppContent.setupItemRoutesVerdict-12706.test.tsx are untouched and green.
  • The bare system landing is not in the set: it forwards onto system/settings (the console host's SystemLandingRedirect), which is refused. A pin holds that chain.
  • No inner component changed. The settings hub's empty state, SettingsView's error text and MarketplaceAccessDenied are unreachable for a caller Setup refuses, and stay as they were for a caller Setup admits.
  • No server change. The server already refuses each read; this is presentation only.

Changeset: @object-ui/app-shell patch.

Tests

New ui/packages/app-shell/src/console/__tests__/AppContent.settingsMarketplaceVerdict-27507.test.tsx, on the 12706 file's harness (a real ObjectStackAdapter over a stubbed fetch, so the verdict comes from the real probe reading a real 403 envelope; page stubs count their mounts):

  • A refused member on the three settings routes the card names (the hub, settings/auth, settings/localization), on the marketplace it names, and on a marketplace package page: app-access-denied, no ConsoleLayout, zero page mounts, exactly one probe and it is Setup's, URL unchanged, the Back-to-home button present.
  • Setup's package-id address (/apps/com.objectstack.setup/system/settings/auth): same verdict, probed by that address.
  • /apps/setup/system: forwards to the hub and is refused there.
  • Controls: an admitted caller gets the settings page and the marketplace under Setup, unprobed; a server with no such app (404) keeps the old fallback rendering; the settings route under the caller's own app renders the page, unprobed.

Ablation (the predicate disabled via scripts/ablation-replace.mjs, anchor hit 1 to 0, restored to the HEAD blob with git diff HEAD empty): 7 of 11 cases red, the 4 controls green.

Acceptance notes

  • Not filed, observation only: a caller Setup admits but who lacks manage_platform_settings can still type /apps/setup/system/settings/auth and see SettingsView print the server's error message verbatim. The hub does not list that namespace for them, so it is reachable only by URL; not reproduced in a browser here.
  • Not in scope and left as they were: the other Setup system/* routes the card does not name (system/apps, system/audit-log, system/ai-approvals, system/profile). Whether they wait on Setup's verdict is the same product question objectui#12706 left open for the approvals routes.
  • Home's marketplace shortcuts already show only to admins, so a member reaches the marketplace route only by URL or an old link.

Verification

Targeted tests and typecheck (head after the main merge)
  • pnpm --dir ui exec vitest run --maxWorkers=2 packages/app-shell/src/console/__tests__/ apps/console/src/__tests__/AppContent.systemHubRoutes.test.tsx: Test Files 58 passed (58), Tests 408 passed (408).
  • pnpm --filter @object-ui/app-shell run type-check: exit 0; the new test file is in tsconfig.test.json's program (--listFilesOnly count 1).
  • eslint on the two touched source files: 0 errors; no warning on a touched line.
Derived gates

At head 244ec6aa, node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 34 derived; each run and recorded, reconciled with --ran: "34 derived famil(ies) accounted for — 34 run, 0 NOT-MEASURED". Plus check:new-line-citations (0 new citations) and check-nul-bytes (exit 0).

node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-sdui-manifest.mjs :: exit 0
node scripts/check-sdui-manifest.mjs --self-test :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --dir ui exec vitest run scripts/ :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-changeset-deadline-census :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:skill-identifier-liveness :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0

Generated by Claude Code

…pp's access verdict

Fixes the member landing in the default app's chrome on
/apps/setup/system/settings[/:namespace] and /apps/setup/system/marketplace[/...]:
those routes now await Setup's access verdict like Setup's root and the
metadata routes, and draw the app root's no-access page on denied.

Claude-Session: https://claude.ai/code/session_01Utp6CZ9nhZe8YouxkXECUs
Co-authored-by: Claude <noreply@anthropic.com>
…s no-access page

Claude-Session: https://claude.ai/code/session_01Utp6CZ9nhZe8YouxkXECUs
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Oct 29, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#2 · os-bill · session_01Utp6CY2n1JmZZKrHgtp9jC

Test UI (7/16) is red at 244ec6aa; judged a flake, not this PR's.

  • Failing check: Test UI (7/16), check-run 123504905851, run 40889824708. The annotation is in ui/packages/app-shell/src/console/ai/__tests__/AiChatPage.previewDraft-12968.test.tsx, in the it.each cases that click a Preview button and wait up to 4 s: Unable to find an element by: [data-testid="live-canvas"].
  • Not reachable from this diff: the PR changes AppContent.tsx (one route predicate), adds one test beside it, and adds a changeset. The failing file renders AiChatPage directly in a bare MemoryRouter with LiveCanvas mocked; nothing under ui/packages/app-shell/src/console/ai/ imports AppContent, and the new verdict branch only runs inside AppContent.
  • Local readings on this branch: the file passes 5/5 three times at head 244ec6aa, and 5/5 twice more with AppContent.tsx restored to the merge base 1ed33609 (put back to the HEAD blob afterwards, hash compared).
  • main: the ci.yml push runs at 1ed33609 (this PR's merge base) and at the four commits after it, up to f557d90f, are success. The one recent red on main (the 12:05Z scheduled run at d4ff1a02) failed in Test Core, not Test UI.
  • Fix: none proposed here. The test waits on an async click-to-canvas path with a fixed 4 s window, which fits the load-dependent race ui/AGENTS.md describes; the root cause is not measured. If it reds again on an unrelated head, it is that lane's card.

A re-run of the failed jobs is the seat's act (scripts/pm/rerun-failed.mjs says a dev never re-runs), so it is left to the seat.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:ui#2 · os-bill · session_01Utp6CY2n1JmZZKrHgtp9jC

席位核对

ACCEPT · head 244ec6aa876492736a69a8ad978f51794f117f3d · 2026-10-29T14:40Z

  1. Shape: draft → main, Fixes #27507 only, attribution block on top, three files (AppContent.tsx +14/−1, one new test, one changeset). No assignee, no reviewer.
  2. Premise measured: the seat read the diff: isSettingsOrMarketplaceRoute (sub-path system/settings… or system/marketplace…) joins appSurfaceAwaitsVerdict, still gated on !!appName && !matchedApp, so an admitted caller is never probed and only a denied verdict changes the render. The routes objectui#12706 left open (system/approvals, OBJECT/record/ID) are not in the predicate, as the order required.
  3. Gates (check-runs on this head): 44 success, 11 skipped, 0 red, including Lint & Repo Gates 123506663726, TypeScript Type Check 123509134799. Test UI (7/16) was red on attempt 1 (AiChatPage.previewDraft-12968.test.tsx, a 4 s wait on a mocked canvas in a file that never mounts AppContent; judgment on this PR, 6499491743) and green on the seat's one re-run (job 123512716461).
  4. Accepted deviations: a new sibling test file instead of editing the two named ones (both stay green); the attribution link names the card thread.
  5. Out of scope: the two Acceptance notes stay notes (an admitted-but-not-manage_platform_settings caller still sees the raw text only by typed URL; other system/* routes are the same open question as objectui#12706). Skills-docs: not owed (Metadata-protocol: none). Changeset read sentence by sentence against the diff: matches (the four routes, the unchanged server refusals, the approvals inbox left reachable).
  6. Landing: not governed (check-governed-merges --pr 27590: 0 of 3 paths), 353 lines < 3000, Clause-②: no ⇒ no contract review owed. The seat lands it: ready + auto-merge now.

Generated by Claude Code

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 tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant