Repository navigation
fix(setup): land a member who may not read the activation ledger on an entry they can open, not on Packaged Actions - #33410
Conversation
…ce of its page's ledger read
The entry now carries visible: current_user.can('sys_metadata_activation', 'read'),
so a member who may not read the activation ledger is neither shown it nor
landed on it; Setup opens on the first entry they can use instead of a 403 page.
Pins the predicate, rewords the pin header with the reason, and adds a composed
landing pin over the served Setup tree.
Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
Co-Authored-By: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 4 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 39 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 259547f6ed1f10825990142a96e6053ea74ebddd && git checkout 259547f6ed1f10825990142a96e6053ea74ebddd
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin df9fe9463020a58b29a61f98605b91e7fbb307c1 189af1502c313e2e0610177da456f34d7e3fd8ac && git checkout -B drift-repro df9fe9463020a58b29a61f98605b91e7fbb307c1 && git merge --no-ff 189af1502c313e2e0610177da456f34d7e3fd8ac
node scripts/docs-audit/affected-docs.mjs --json df9fe9463020a58b29a61f98605b91e7fbb307c1
|
|
Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head 6f66189 · 2026-11-14T19:23:02Z review#3. |
Review — PASSHead:
CI when read (19:24Z): 12 success, 16 skipped, 20 in progress, none red. The server does not evaluate |
…ng pin The landing pin asks the entry's visible with the formula CEL engine; check:test-source-alias requires that import to resolve to the checkout's source, as its neighbours do. Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM Co-Authored-By: Claude <noreply@anthropic.com>
|
domain:server#5 · os-elon-musk · session_016WV4cz2MxDkQYCC4U8indM ACCEPT · area A2 · Fixes #33224 (landing half, seat route A) · head 189af15 · 2026-11-14T20:11Z
|
Requested by Elon · project thread
Fixes #33224 — the Setup landing half (the navigation half is #33349). Route A, as the seat ruled.
Clause-②: no — the served
GET /meta/app/setuptree is unchanged for every caller except thatnav_packaged_actionsnow carriesvisible: current_user.can('sys_metadata_activation', 'read'), which the console asks with the member's/auth/me/permissionsmap. A member who may read the ledger is shown the entry and lands as before (the platform administrator still lands on System Overview). A member who may not read it stops being shown an entry whose page rendered onlyactivation ledger HTTP 403; nothing they could use is withdrawn.Metadata-protocol: none
Maintainer quick read
type: 'object'entries only. So every member landed on it, including a separation-of-duties officer (an auditor holdingview_all_audit_log) whose ledger read answers 403, and their Setup opened onactivation ledger HTTP 403.requiredPermissionsand norequiresService; the activation write doors keep their server-side gates. Rollback is a revert.packages/platform-objects/src/apps/setup-nav.contributions.ts(thevisibleand its comment).pnpm --filter @objectstack/cli exec vitest run test/setup-landing-audience.pin.test.ts; expect 4 green cases.What changes
packages/platform-objects/src/apps/setup-nav.contributions.ts—nav_packaged_actionsgainsvisible: "current_user.can('sys_metadata_activation', 'read')". The console asks a nav entry'svisiblein both its sidebar and its landing walk (AppRootLanding→findFirstRouteover the treeuseNavMemberGatesgates,ui/packages/app-shell/src/console/AppContent.tsx), withcanbound to/auth/me/permissions(pinned in ui/ byUnifiedSidebar.navCanPermissions-12700.test.tsx). No Setup entry usedcanbefore; HotCRM andexamples/app-crmalready do.packages/platform-objects/src/apps/setup-packaged-actions-nav.test.ts— the pin header no longer calls the entry deliberately ungated. It says the earlier "no audience" was a developer choice (qa+fix: ADR-0126 scoped checklist sweep (#12438) + Setup nav entry for the packaged-automation page (#12457) #12491), not a ruling, and why the entry now carries the ledger-read audience. A new case pins the predicate exactly. The "norequiresService" and "norequiredPermissions" cases stay, with their reasons.packages/platform-objects/src/system/sys-metadata-activation.object.test.ts— the "no shipped app or nav names the ledger" pin now allows exactly this one predicate (a permission question no row changes) and still refuses any other mention.@objectstack/platform-objectspatch.Tests
packages/cli/test/setup-landing-audience.pin.test.ts(unit tier): composesSETUP_APP,SETUP_NAV_CONTRIBUTIONSandAuditPlugin's contribution through the realSchemaRegistry, readsGET /api/v1/meta/apps/setupthrough the realRestServerroute, and walks the served tree the way the console lands (groups walked,urlskipped, firstobject/page/dashboard/report/componentwins;visibleasked with the real CEL engine and the member's object map; anobjectentry pruned without read on its object):view_all_audit_logwho may readsys_audit_logandsys_userbut not the ledger lands onnav_users(People & Org › Users);nav_packaged_actions;nav_system_overviewand is still shown Packaged Actions.Verification
pnpm --filter @objectstack/platform-objects exec vitest run: 120 of 122 files green; the 2 failing cases areobject-collapsed-sections-echo-decisions.test.ts, which fails identically onorigin/mainin this worktree (stale local build), so not this change.packages/cli:setup-landing-audience,console-page-nav-entries,setup-integrations-order,i18n-contributed-nav-coverage,translation-contributed-nav-validate-door: 5 files / 22 tests passed (platform-objectsrebuilt first; the cli suite reads itsdist/).Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/specis not touched.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM