Skip to content

docs(spec): state the RLS using grammar by what pushes down, not by a count (#6919) - #7444

Merged
os-help merged 1 commit into
mainfrom
claude/issue-6919-rls-tsdoc-grammar
Aug 10, 2026
Merged

docs(spec): state the RLS using grammar by what pushes down, not by a count (#6919)#7444
os-help merged 1 commit into
mainfrom
claude/issue-6919-rls-tsdoc-grammar

Conversation

@os-help

@os-help os-help commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

Fixes #6919

PM-relayed draft (spec-surface seat, session session_016R9de1FqP7NvwKvqXi92Gh): the implementing dev — dedicated cloud session session_016XdGuLGuJaDfQidXjbU7wJ (claude-opus-5, recorded in the claim thread on #6919) — pushed this branch at 10:51Z but was seeded without GitHub API tooling, so it could not open the PR or post its report itself. The PM opened this draft on its behalf. The implementation and everything below are the dev's, from the pushed commit's message (2bf7801); the PM wrote none of the code.

The TSDoc block above RowLevelSecurityPolicySchema's using property still claimed "Exactly four forms compile" and "no support for ... comparison operators other than =". That contradicted the .describe() on the SAME property (corrected in #6762 / PR #6918) and it contradicted the compiler.

Measured against isSupportedRlsExpression (@objectstack/formula, src/rls-predicate.ts) at 07383fe: != and the full ordering comparisons, in over a current_user.* array AND over an inline CEL list literal, string startsWith/endsWith/contains, &&, ||, parenthesised grouping, and a bare true all lower to a filter and enforce. SQL AND/OR/NOT, NOT IN, IS NULL, LIKE, regex, arithmetic, subqueries, cross-object traversal and a bare truthy field all fail closed.

Rewritten in terms of the forms that push down, with no count anywhere — replacing "four" with the current number would be the same defect. Canonical CEL leads; the SQL spelling is stated as the deprecated transitional bridge it is (sqlPredicateToCel, ADR-0058 D1), covering only === and INin. The ⚠️ STALE marker PR #6918 parked on the block is removed with the rewrite. The property's five @example strings, all SQL dialect, are now CEL.

Two boundaries the old prose got wrong in the permissive direction are now explicit, both silent fail-closed traps: SQL's parenthesised value list does not survive the bridge (status IN ('draft', 'pending') fails closed, where status in ['draft', 'pending'] lowers), and ! negates a parenthesised comparison but cannot negate a bare field.

Adds rls-predicate-grammar-docs.pin.test.ts: the file states this grammar on three faces — the published module docblock line, the property TSDoc, and the property's .describe() — and nothing compared them, which is how the same under-statement drifted twice. The pin holds all three to one story: no face may re-assert a fixed-count or closed-set grammar, all must keep stating the fail-closed contract, and the two operator-listing faces must name the same operator set. Scope is the claim shape, not the wording.

No generated output changes: gen:docs never renders property-level TSDoc, so check:docs reports all 231 files still in sync.

Verification-evidence status (PM note): the dev's local run transcripts (including the pin's mutate→red→revert proof required by the dispatch) remain inside the dev session and were not transportable through its available tools; they have been requested via the session's resume channel. Acceptance will rest on this PR's own CI (the pin runs in Test Core; the docblock faces compile under Type Check) plus PM review of the pin's assertions, with any recovered transcript appended to the #6919 thread.


Generated by Claude Code

… a count (#6919)

The TSDoc block above `RowLevelSecurityPolicySchema`'s `using` property still
claimed "Exactly four forms compile" and "no support for ... comparison
operators other than `=`". That contradicted the `.describe()` on the SAME
property (corrected in #6762 / PR #6918) and it contradicted the compiler.

Measured against `isSupportedRlsExpression` (`@objectstack/formula`,
`src/rls-predicate.ts`) at 07383fe: `!=` and the full ordering comparisons,
`in` over a `current_user.*` array AND over an inline CEL list literal, string
`startsWith`/`endsWith`/`contains`, `&&`, `||`, parenthesised grouping, and a
bare `true` all lower to a filter and enforce. SQL `AND`/`OR`/`NOT`, `NOT IN`,
`IS NULL`, `LIKE`, regex, arithmetic, subqueries, cross-object traversal and a
bare truthy field all fail closed.

Rewritten in terms of the forms that push down, with no count anywhere —
replacing "four" with the current number would be the same defect. Canonical
CEL leads; the SQL spelling is stated as the deprecated transitional bridge it
is (`sqlPredicateToCel`, ADR-0058 D1), covering only `=` -> `==` and
`IN` -> `in`. The `⚠️ STALE` marker PR #6918 parked on the block is removed
with the rewrite. The property's five `@example` strings, all SQL dialect, are
now CEL.

Two boundaries the old prose got wrong in the permissive direction are now
explicit, both silent fail-closed traps: SQL's parenthesised value list does
not survive the bridge (`status IN ('draft', 'pending')` fails closed, where
`status in ['draft', 'pending']` lowers), and `!` negates a parenthesised
comparison but cannot negate a bare field.

Adds `rls-predicate-grammar-docs.pin.test.ts`: the file states this grammar on
three faces — the published module docblock line, the property TSDoc, and the
property's `.describe()` — and nothing compared them, which is how the same
under-statement drifted twice. The pin holds all three to one story: no face
may re-assert a fixed-count or closed-set grammar, all must keep stating the
fail-closed contract, and the two operator-listing faces must name the same
operator set. Scope is the claim shape, not the wording.

No generated output changes: `gen:docs` never renders property-level TSDoc, so
`check:docs` reports all 231 files still in sync.

Fixes #6919

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016XdGuLGuJaDfQidXjbU7wJ
@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Aug 10, 2026 12:01pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/spec.

106 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/ai/agents.mdx (via @objectstack/spec)
  • content/docs/ai/skills-reference.mdx (via @objectstack/spec)
  • content/docs/ai/skills.mdx (via @objectstack/spec)
  • content/docs/api/client-sdk.mdx (via @objectstack/spec)
  • content/docs/api/environment-routing.mdx (via @objectstack/spec)
  • content/docs/api/error-catalog.mdx (via @objectstack/spec)
  • content/docs/api/error-handling-client.mdx (via @objectstack/spec)
  • content/docs/api/error-handling-server.mdx (via @objectstack/spec)
  • content/docs/api/index.mdx (via @objectstack/spec)
  • content/docs/automation/approvals.mdx (via @objectstack/spec)
  • content/docs/automation/connectors.mdx (via @objectstack/spec)
  • content/docs/automation/flows.mdx (via @objectstack/spec)
  • content/docs/automation/hook-bodies.mdx (via packages/spec)
  • content/docs/automation/hooks.mdx (via @objectstack/spec)
  • content/docs/automation/index.mdx (via @objectstack/spec)
  • content/docs/automation/webhooks.mdx (via @objectstack/spec)
  • content/docs/automation/workflows.mdx (via @objectstack/spec)
  • content/docs/concepts/architecture.mdx (via @objectstack/spec)
  • content/docs/concepts/design-principles.mdx (via packages/spec)
  • content/docs/concepts/index.mdx (via @objectstack/spec)
  • content/docs/concepts/metadata-driven.mdx (via @objectstack/spec)
  • content/docs/concepts/metadata-lifecycle.mdx (via packages/spec)
  • content/docs/concepts/north-star.mdx (via @objectstack/spec)
  • content/docs/data-modeling/analytics.mdx (via @objectstack/spec)
  • content/docs/data-modeling/drivers.mdx (via @objectstack/spec)
  • content/docs/data-modeling/external-datasources.mdx (via @objectstack/spec)
  • content/docs/data-modeling/field-types.mdx (via @objectstack/spec)
  • content/docs/data-modeling/fields.mdx (via @objectstack/spec)
  • content/docs/data-modeling/formulas.mdx (via @objectstack/spec)
  • content/docs/data-modeling/index.mdx (via @objectstack/spec)
  • content/docs/data-modeling/objects.mdx (via @objectstack/spec)
  • content/docs/data-modeling/queries.mdx (via @objectstack/spec)
  • content/docs/data-modeling/schema-design.mdx (via @objectstack/spec)
  • content/docs/data-modeling/seed-data.mdx (via @objectstack/spec)
  • content/docs/data-modeling/validation-rules.mdx (via @objectstack/spec)
  • content/docs/data-modeling/validation.mdx (via @objectstack/spec)
  • content/docs/deployment/cli.mdx (via @objectstack/spec)
  • content/docs/deployment/tenancy-modes.mdx (via @objectstack/spec)
  • content/docs/deployment/troubleshooting.mdx (via @objectstack/spec)
  • content/docs/deployment/validating-metadata.mdx (via @objectstack/spec)
  • content/docs/getting-started/build-with-claude-code.mdx (via @objectstack/spec)
  • content/docs/getting-started/common-patterns.mdx (via @objectstack/spec)
  • content/docs/getting-started/examples.mdx (via @objectstack/spec)
  • content/docs/getting-started/quick-reference.mdx (via @objectstack/spec)
  • content/docs/getting-started/quick-start.mdx (via @objectstack/spec)
  • content/docs/getting-started/your-first-project.mdx (via @objectstack/spec)
  • content/docs/kernel/cluster.mdx (via @objectstack/spec)
  • content/docs/kernel/contracts/auth-service.mdx (via packages/spec)
  • content/docs/kernel/contracts/cache-service.mdx (via packages/spec)
  • content/docs/kernel/contracts/data-engine.mdx (via @objectstack/spec)
  • content/docs/kernel/contracts/index.mdx (via @objectstack/spec)
  • content/docs/kernel/contracts/metadata-service.mdx (via packages/spec)
  • content/docs/kernel/contracts/storage-service.mdx (via @objectstack/spec)
  • content/docs/kernel/index.mdx (via packages/spec)
  • content/docs/kernel/runtime-services/data-service.mdx (via @objectstack/spec)
  • content/docs/kernel/runtime-services/email-service.mdx (via packages/spec)
  • content/docs/kernel/runtime-services/examples.mdx (via @objectstack/spec)
  • content/docs/kernel/runtime-services/index.mdx (via packages/spec)
  • content/docs/kernel/runtime-services/queue-service.mdx (via packages/spec)
  • content/docs/kernel/runtime-services/sharing-service.mdx (via @objectstack/spec)
  • content/docs/kernel/runtime-services/sms-service.mdx (via packages/spec)
  • content/docs/kernel/runtime-services/storage-service.mdx (via @objectstack/spec)
  • content/docs/kernel/services-checklist.mdx (via @objectstack/spec)
  • content/docs/kernel/services.mdx (via @objectstack/spec)
  • content/docs/permissions/authorization.mdx (via @objectstack/spec)
  • content/docs/permissions/permission-sets.mdx (via @objectstack/spec)
  • content/docs/permissions/permissions-matrix.mdx (via @objectstack/spec)
  • content/docs/permissions/positions.mdx (via @objectstack/spec)
  • content/docs/permissions/rls.mdx (via @objectstack/spec)
  • content/docs/permissions/sharing-rules.mdx (via @objectstack/spec)
  • content/docs/permissions/system-context.mdx (via packages/spec)
  • content/docs/plugins/adding-a-metadata-type.mdx (via @objectstack/spec)
  • content/docs/plugins/development.mdx (via @objectstack/spec)
  • content/docs/plugins/index.mdx (via @objectstack/spec)
  • content/docs/plugins/packages.mdx (via @objectstack/spec)
  • content/docs/protocol/backward-compatibility.mdx (via @objectstack/spec)
  • content/docs/protocol/diagram.mdx (via packages/spec)
  • content/docs/protocol/kernel/config-resolution.mdx (via @objectstack/spec)
  • content/docs/protocol/kernel/http-protocol.mdx (via @objectstack/spec)
  • content/docs/protocol/kernel/i18n-standard.mdx (via @objectstack/spec)
  • content/docs/protocol/kernel/index.mdx (via @objectstack/spec)
  • content/docs/protocol/kernel/lifecycle.mdx (via @objectstack/spec)
  • content/docs/protocol/kernel/plugin-spec.mdx (via @objectstack/spec)
  • content/docs/protocol/knowledge.mdx (via @objectstack/spec)
  • content/docs/protocol/objectql/index.mdx (via @objectstack/spec)
  • content/docs/protocol/objectql/query-syntax.mdx (via @objectstack/spec)
  • content/docs/protocol/objectql/schema.mdx (via @objectstack/spec)
  • content/docs/protocol/objectql/security.mdx (via packages/spec)
  • content/docs/protocol/objectql/state-machine.mdx (via @objectstack/spec)
  • content/docs/protocol/objectui/actions.mdx (via @objectstack/spec)
  • content/docs/protocol/objectui/concept.mdx (via @objectstack/spec)
  • content/docs/protocol/objectui/index.mdx (via @objectstack/spec)
  • content/docs/protocol/objectui/layout-dsl.mdx (via @objectstack/spec)
  • content/docs/protocol/objectui/record-alert.mdx (via @objectstack/spec)
  • content/docs/protocol/objectui/widget-contract.mdx (via @objectstack/spec)
  • content/docs/ui/actions.mdx (via @objectstack/spec)
  • content/docs/ui/apps.mdx (via @objectstack/spec)
  • content/docs/ui/create-vs-edit-form.mdx (via @objectstack/spec)
  • content/docs/ui/dashboards.mdx (via @objectstack/spec)
  • content/docs/ui/field-grouping-and-order.mdx (via @objectstack/spec)
  • content/docs/ui/forms.mdx (via @objectstack/spec)
  • content/docs/ui/index.mdx (via @objectstack/spec)
  • content/docs/ui/public-data-collection.mdx (via @objectstack/spec)
  • content/docs/ui/setup-app.mdx (via @objectstack/spec)
  • content/docs/ui/translations.mdx (via @objectstack/spec)
  • content/docs/ui/views.mdx (via @objectstack/spec)

7 release-owned page(s) also reference the affected code. These are read-only:

  • content/docs/releases/implementation-status.mdx (via @objectstack/spec)
  • content/docs/releases/index.mdx (via @objectstack/spec)
  • content/docs/releases/v12.mdx (via @objectstack/spec)
  • content/docs/releases/v13.mdx (via @objectstack/spec)
  • content/docs/releases/v16.mdx (via @objectstack/spec)
  • content/docs/releases/v17.mdx (via @objectstack/spec)
  • content/docs/releases/v9.mdx (via @objectstack/spec)

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.

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling labels Aug 10, 2026
@os-help
os-help marked this pull request as ready for review August 10, 2026 13:01
@os-help
os-help added this pull request to the merge queue Aug 10, 2026
Merged via the queue into main with commit 8a9c079 Aug 10, 2026
27 checks passed
@os-help
os-help deleted the claude/issue-6919-rls-tsdoc-grammar branch August 10, 2026 13:18
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

Projects

None yet

2 participants