Uh oh!
There was an error while loading. Please reload this page.
docs(pages): fix the component visibility example to read a key EvalUser has - #130
Merged
Merged
Conversation
…ser has
`content/docs/build/interface/pages.mdx:81` gated the sample chart component
with `os.user.profile == 'sales_manager'`. `os.user` is bound by `buildScope`
(`packages/formula/src/stdlib.ts`) to the canonical `EvalUser`, which is
exactly `{ id, name?, email?, positions, isPlatformAdmin?, organizationId? }`
— there is no `profile` key, so the published example could never evaluate to
what it demonstrates. Same defect class as the Tier 1 half of #109.
`positions` is the only membership field on `EvalUser` (ADR-0068 D1, renamed
from `roles` by ADR-0090 D3), and `sales_manager` is verbatim the first entry
under "Good position names" in `packages/spec/src/identity/position.zod.ts`.
The corpus already spells this predicate twice — `reference/cel.mdx:124`
(`'manager' in os.user.positions`, same `os.user` root) and
`build/interface/apps.mdx:110` (`'org_admin' in current_user.positions`) — so
the corrected line matches an established spelling rather than inventing one.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Yaqu7kmKZM3tRPd9Y4xivoos-elon
marked this pull request as ready for review
August 19, 2026 00:39
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#119
One line, in
content/docs/build/interface/pages.mdx:The defect
os.useris bound bybuildScope(packages/formula/src/stdlib.tsonobjectstack@origin/main) to the canonicalEvalUser, and that object is exactly:There is no
profilekey — so the published example was not merely using an old word, it read a key that is never bound, and the predicate could not evaluate to what the example demonstrates. Same defect class as the Tier 1 half of #109, which corrected the equivalent line inreference/cel.mdx.Why this expression, and not a guess
The card was explicit that the corrected expression needs an inference about author intent, so the evidence is set out rather than asserted.
What the example has to demonstrate is fixed by its surroundings. The snippet sits directly above the component property table, and the
visibilityrow in that table reads "CEL visibility predicate". The example's job is to show a component gated on who the signed-in user is. Nothing in the prose teaches a profile concept, or any other identity model — there is no second thing it could be teaching.Exactly one expressible form satisfies that.
positionsis the only membership field onEvalUser(ADR-0068 D1; renamed fromrolesby ADR-0090 D3, whose doc comment records that a singular membership field is deliberately not part of the contract). The docs' own key table already says so:reference/cel.mdx:69documentsos.useras{ id, name, email, positions: string[], organizationId }.The literal was already a position name.
sales_manageris verbatim the first entry under "Good position names" inpackages/spec/src/identity/position.zod.ts. The example did not need a new literal chosen for it; only the access path was wrong.The corpus already spells this predicate, twice.
reference/cel.mdx:124has'manager' in os.user.positions— the sameos.userroot this line uses — andbuild/interface/apps.mdx:110has'org_admin' in current_user.positions. The corrected line matches an established spelling instead of inventing one.os.userwas kept overcurrent_userbecause it is the root the line already used and the aliases are the same object.The competing reading, and why it does not change the answer
profileis not a word the author invented:assignedProfilesis a real page-level key (packages/spec/src/ui/page.zod.ts), and the spec's ownpage.test.tsfixtures spellassignedProfiles: ['admin', 'sales_manager', 'sales_rep']— sosales_managerappears as a profile name too. The author may well have been reaching for that.It does not change the correction, because that reading has no expressible form here. Profiles are not bound into the CEL scope at all, there is no
sys_profileobject anywhere underpackages/, andassignedProfilesgates the whole page, not a component inside a region. Writing the example that way would mean deleting the component-level predicate the property table documents. Both readings of intent therefore converge on the same corrected line — which is what made this a recoverable inference rather than aneeds_decision.Scope
One file, one line. Two things deliberately left alone:
visibility, which ADR-0089 deprecated in favour ofvisibleWhen. Different defect class (a deprecated-but-normalized alias, not an absent key), so it is filed separately asbuild/interface/pages.mdxis the last page teaching the deprecated component keyvisibilityinstead ofvisibleWhen#129 and is not addressed here.pages.zh-Hans.mdxstill carries the old expression. Translations are the translation account's, never hand-edited; the freshness gate treats stale as non-blocking by design.Gates
All run on
4353b8d, Node v22.22.2, in this worktree, with--forceto bypass the shared turbo cache.pnpm install --frozen-lockfilepnpm turbo run type-check --continue --forcepnpm turbo run build --forcepnpm turbo run test --forcenode .github/scripts/check-translations.mjsnode .github/scripts/check-translation-ownership.mjs --actor os-elon --files changed.txtTRANSLATION_BOT_LOGINunset, per #68; 0 translation artifacts touched)node .github/scripts/check-translation-output.mjs --self-testnode .github/scripts/check-translation-output.mjs --files changed.txtMeasured against an
origin/mainbaseline worktree:pages.zh-Hans.mdxalready carried onefencefinding before this change (fence #5). After it, the file still carries exactly one, now reported at fence #3 — the components example. The count is unchanged and the finding is non-blocking.Generated by Claude Code