Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/page-guidance-stops-prescribing-assignedprofiles.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
"@objectstack/spec": minor
---

fix(spec): `PageSchema`'s rejection guidance stops prescribing `assignedProfiles` as a page gate (#16929)

The two wrong-layer prescriptions `PageSchema` hands an author at parse time both ended by pointing at `assignedProfiles`: the `visibleWhen` pointer said "or gate the page with `assignedProfiles`", and the `permissions` pointer said "reach it through `assignedProfiles`". Neither is true. `assignedProfiles` gates nothing.

Measured 2026-09-10 on `origin/main` `e1eee43beb` and objectui `3fbdd4a2d`: `assignedProfiles` has **zero readers** in this repo — every one of its 25 matching files is a declaration, a generated artifact, prose, a `CHANGELOG`, the liveness ledger, or this schema's own round-trip test — and **zero readers** in objectui, whose three hits are a docs table row and two type/zod declarations. Lit controls in the same sweeps (`visibleWhen` 308 files, `PageSchema` 94 files in objectui; `visibleWhen` 168 files here) prove the instrument fired; a fabricated dark control read 0 in both. The key is also named for the concept **ADR-0090 D2** removed, which `security/permission.zod.ts` states to authors three times over.

Prescribing it was Prime Directive #10's exact prohibition — advertising a capability the runtime does not deliver — delivered to the author in the error that is supposed to be teaching them the correct spelling. Both prescriptions now say only what the platform actually does: put `visibleWhen` on the component inside a region, and gate the DATA a page shows with the object's permission sets.

**Nothing about what `PageSchema` accepts changes.** `assignedProfiles` remains an authorable key with its declaration untouched, and the `profiles:` / `assignedTo:` alias entries are untouched. Both channels edited here fire only from the `unrecognized_keys` path, so every key involved is rejected before this change and rejected after it, with identical `issue.code` and identical `path` — only the human-readable text moves. The key's own disposition (keep, rename, or remove) needs a ruling and stays open on #16929.
21 changes: 19 additions & 2 deletions packages/spec/src/ui/page.zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,25 @@ export const PageSchema = lazySchema(() => strictObject({
route: '`route` is not a page key — a page is routed by its `name` (lowercase snake_case). Rename the page rather than declaring a path.',
path: '`path` is not a page key — a page is routed by its `name` (lowercase snake_case).',
url: '`url` is not a page key — a page is routed by its `name`. To link OUT to an address, use a navigation node on the app.',
visibleWhen: 'page-level conditional rendering does not exist — put `visibleWhen` on the COMPONENT inside a region, or gate the page with `assignedProfiles`',
permissions: 'a page is not permission-gated by a field — reach it through `assignedProfiles`, and gate the DATA it shows with the object\'s permission sets (which is what actually protects the records)',
// ⛔ Neither prescription below may name `assignedProfiles` as the way to gate
// a page. The key is still authorable on this schema — nothing here changes what
// the schema accepts — but it gates NOTHING, so prescribing it handed the author
// a capability the runtime does not deliver, at parse time, which is Prime
// Directive #10's exact prohibition. Measured 2026-09-10: zero readers in this
// repo (every hit is a declaration, a generated artifact, prose, or this
// schema's own round-trip test) and zero readers in objectui at `3fbdd4a2d`
// (three hits — a docs table row, `packages/types/src/layout.ts` and
// `packages/types/src/zod/layout.zod.ts` — every one a declaration; lit controls
// `visibleWhen` 308 files and `PageSchema` 94 files prove the instrument fired).
// `liveness/page.json` still grades it `live` on the strength of an objectui
// bridge at `react/src/spec-bridge/bridges/page.ts` — a path that does not exist
// in that repo, while two sibling citations in the same ledger file resolve.
// It is also named for the concept ADR-0090 D2 removed, which
// `security/permission.zod.ts` states to authors three times over.
// ⛔ The key's own disposition (keep / rename / remove) needs a ruling and is
// tracked in #16929; this correction deliberately does not pre-empt it.
visibleWhen: 'page-level conditional rendering does not exist — put `visibleWhen` on the COMPONENT inside a region',
permissions: 'a page is not permission-gated by a field — gate the DATA it shows with the object\'s permission sets (which is what actually protects the records)',
},
}, {
name: SnakeCaseIdentifierSchema.describe('Page unique name (lowercase snake_case)'),
Expand Down
Loading