Skip to content

fix(setup): land a member who may not read the activation ledger on an entry they can open, not on Packaged Actions - #33410

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/area-A2-33224-landing
Nov 14, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/area-A2-33224-landing

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

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/setup tree is unchanged for every caller except that nav_packaged_actions now carries visible: current_user.can('sys_metadata_activation', 'read'), which the console asks with the member's /auth/me/permissions map. 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 only activation ledger HTTP 403; nothing they could use is withdrawn.
Metadata-protocol: none

Maintainer quick read

  • What changes: Setup's Packaged Actions entry is shown only to a member who may read the activation ledger its page reads. Everyone else lands on the first Setup entry they can open.
  • Why: Packaged Actions is the first entry Setup serves, and the console's object-read prune judges type: 'object' entries only. So every member landed on it, including a separation-of-duties officer (an auditor holding view_all_audit_log) whose ledger read answers 403, and their Setup opened on activation ledger HTTP 403.
  • Risk and rollback: low. Admins (who read the ledger) see the same menu and landing as before. The entry still carries no requiredPermissions and no requiresService; the activation write doors keep their server-side gates. Rollback is a revert.
  • Read first: packages/platform-objects/src/apps/setup-nav.contributions.ts (the visible and its comment).
  • Two-minute check: pnpm --filter @objectstack/cli exec vitest run test/setup-landing-audience.pin.test.ts; expect 4 green cases.
  • Needed from you: nothing.

What changes

  • packages/platform-objects/src/apps/setup-nav.contributions.ts — nav_packaged_actions gains visible: "current_user.can('sys_metadata_activation', 'read')". The console asks a nav entry's visible in both its sidebar and its landing walk (AppRootLanding → findFirstRoute over the tree useNavMemberGates gates, ui/packages/app-shell/src/console/AppContent.tsx), with can bound to /auth/me/permissions (pinned in ui/ by UnifiedSidebar.navCanPermissions-12700.test.tsx). No Setup entry used can before; HotCRM and examples/app-crm already 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 "no requiresService" and "no requiredPermissions" 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.
  • Changeset: @objectstack/platform-objects patch.

Tests

  • New packages/cli/test/setup-landing-audience.pin.test.ts (unit tier): composes SETUP_APP, SETUP_NAV_CONTRIBUTIONS and AuditPlugin's contribution through the real SchemaRegistry, reads GET /api/v1/meta/apps/setup through the real RestServer route, and walks the served tree the way the console lands (groups walked, url skipped, first object/page/dashboard/report/component wins; visible asked with the real CEL engine and the member's object map; an object entry pruned without read on its object):
    • Packaged Actions is served with the predicate, and is still the first landing-type entry for the officer (so the predicate, not the order, moves the landing);
    • an officer holding view_all_audit_log who may read sys_audit_log and sys_user but not the ledger lands on nav_users (People & Org › Users);
    • the same served tree, with ledger read, lands on nav_packaged_actions;
    • the platform administrator still lands on nav_system_overview and is still shown Packaged Actions.

Verification

  • pnpm --filter @objectstack/platform-objects exec vitest run: 120 of 122 files green; the 2 failing cases are object-collapsed-sections-echo-decisions.test.ts, which fails identically on origin/main in 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-objects rebuilt first; the cli suite reads its dist/).
  • Pre-push hooks passed.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 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 is not touched.
  • 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 with Claude Code

https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM

…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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · os-elon-musk · session_016WV4cz2MxDkQYCC4U8indM

Request: review · area A2 · head 6f66189 · Fixes #33224 (landing half, seat ruling route A)

@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 14, 2026
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/cli, @objectstack/platform-objects, touching 3 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/cli/vitest.config.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

4 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/automation/webhooks.mdx (via sys_metadata_activation (literal, a string literal in SETUP_NAV_CONTRIBUTIONS))
  • content/docs/deployment/environment-variables.mdx (via sys_metadata_activation (literal, a string literal in SETUP_NAV_CONTRIBUTIONS))
  • content/docs/permissions/authorization.mdx (via sys_metadata_activation (literal, a string literal in SETUP_NAV_CONTRIBUTIONS))
  • content/docs/permissions/sharing-rules.mdx (via sys_metadata_activation (literal, a string literal in SETUP_NAV_CONTRIBUTIONS))

⛔ 1 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v18/18-4.mdx (via sys_metadata_activation (literal, a string literal in SETUP_NAV_CONTRIBUTIONS))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/cli/vitest.config.ts) — pages documenting those are invisible to this run
  • 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 — 39 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 df9fe9463020a58b29a61f98605b91e7fbb307c1 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 259547f6ed1f10825990142a96e6053ea74ebddd — the merge of head 189af1502c313e2e0610177da456f34d7e3fd8ac into base df9fe9463020a58b29a61f98605b91e7fbb307c1, 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 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

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs df9fe9463020a58b29a61f98605b91e7fbb307c1 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head 6f66189 · 2026-11-14T19:23:02Z

review#3.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

Review — PASS

Head: 6f661894db7c463096fddc13752923622b7cb5c1 · reviewer: review#3 (session_016WV4d1PGptBW3QRQNmy5e6) · area A2 · Fixes #33224 (landing half, seat route A)

  • The change. nav_packaged_actions gains visible: "current_user.can('sys_metadata_activation', 'read')", the audience of its page's own data read. The entry keeps no requiredPermissions/requiresService, and the activation write doors keep their server gates. The new CLI pin reads the served tree through the real RestServer route and walks it the way the console lands. The officer (view_all_audit_log, no ledger read) lands on nav_users, a ledger reader lands on Packaged Actions, and the platform administrator still lands on System Overview and still sees the entry. The pin also shows the predicate, not entry order, is what moves the landing.
  • Ruling on the arm, as asked: Clause-②: no holds. The test I applied on fix(setup)!: serve the Audit Log entry to a view_all_audit_log holder who lacks manage_platform_settings #33349 is whether a served answer stops giving an existing caller something they could use. There, a custom-set holder lost an entry whose page still served them organization-attributed ledger rows, so it was a narrowing. Here, the only audience that stops seeing the entry is one whose page read of sys_metadata_activation answers 403, and the page rendered only activation ledger HTTP 403. Nothing they could use is withdrawn. Every caller who could use the page keeps it, and the served GET /meta/app/setup tree changes only by the added visible key. So it is not a narrowing, and no BREAKING banner or ADR-0087 marker is owed. Metadata-protocol: none and patch hold.
  • Ledger pin. sys-metadata-activation.object.test.ts now allows exactly this one predicate and still refuses any other mention of the ledger in a shipped app. That is the right tight exception.
  • nit N1: the pin header's rewording (the earlier "ungated" was a developer choice, qa+fix: ADR-0126 scoped checklist sweep (#12438) + Setup nav entry for the packaged-automation page (#12457) #12491) is good. Keep the reason in setup-packaged-actions-nav.test.ts, since a later change might otherwise re-add requiredPermissions, which would also hide the page from a ledger reader lacking an admin capability.

CI when read (19:24Z): 12 success, 16 skipped, 20 in progress, none red. The server does not evaluate visible (meta-item-read-gate.ts: "NOT gated here: visible (CEL)"), so the served tree is unchanged apart from the key. The ACCEPT re-reads every check at the landing head. Lands independently of #33349 (navigation half), though both touch setup-nav.contributions.ts, in different entries.

…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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · os-elon-musk · session_016WV4cz2MxDkQYCC4U8indM

ACCEPT · area A2 · Fixes #33224 (landing half, seat route A) · head 189af15 · 2026-11-14T20:11Z

  • Reviewer: review#3 contract record PASS @6f661894 (comment 6882964116), ruling Clause-②: no holds (the only audience that loses the entry had a page that answered nothing but 403).
  • Regen-provenance: 6f66189 → 189af15 touches only packages/cli/vitest.config.ts (+10: one anchored alias /^@objectstack\/formula$/ → ../formula/src/index.ts), fixing the red Test-source alias gate at 6f66189; review#3 confirmed the PASS carries over it. check-test-source-alias OK locally; the landing pin and the cli tests that reach formula through dev.ts (6 files / 41 tests) green.
  • Declaration: Clause-②: no, Metadata-protocol: none, @objectstack/platform-objects patch.
  • Governed: check-governed-merges --pr 33410 → NOT governed; +305 / -6.
  • Checks @189af150: 51 total = 35 success + 16 expected skips (check-expected-skips OK), 0 failed, 0 pending.
  • K = 13. Main has not changed any file this PR touches since its merge base df9fe94. fix(setup)!: serve the Audit Log entry to a view_all_audit_log holder who lacks manage_platform_settings #33349 (navigation half, queued) also touches setup-nav.contributions.ts, in a different entry; review#3 noted the two land independently.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 14, 2026 20:12
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 14, 2026
Merged via the queue into main with commit b194618 Nov 14, 2026
52 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/area-A2-33224-landing branch November 14, 2026 21:27
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

1 participant