fix(database): make title-word policy explicitly backend-only - #1062
Conversation
Updates to Preview Branch (codex/chat-supabase-rls-title-words-0ef3) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
Warning Review limit reached
Next review available in:2 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds an explicit service-role-only RLS policy for ChangesDocument title words backend policy
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/supabase-schema.test.ts`:
- Around line 1451-1468: Strengthen the test for public.document_title_words to
validate the complete policy and ACL state in both schema and migration
fixtures, not just expected substrings. Reuse the existing SQL replay mechanism
to inspect the resulting table policies and grants, and ensure no public, anon,
or authenticated policy or access remains alongside the service_role policy.
Remove the migration-only forbidden-role check once equivalent validation covers
both fixtures.
🪄 Autofix (Beta)
✅ Autofix completed
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 0e9c14b5-9366-4072-af8a-6f810ea5b174
📒 Files selected for processing (5)
docs/db-maintenance.mdsupabase/drift-manifest.jsonsupabase/migrations/20260722110000_explicit_document_title_words_backend_policy.sqlsupabase/schema.sqltests/supabase-schema.test.ts
Uh oh!
There was an error while loading. Please reload this page.
Note Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it. Fixes Applied SuccessfullyFixed 1 file(s) based on 1 unresolved review comment. Files modified:
Commit: The changes have been pushed to the Time taken: |
Fixed 1 file(s) based on 1 unresolved review comment. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
Uh oh!
There was an error while loading. Please reload this page.
Summary
service_role-only RLS policy forpublic.document_title_wordswhile retaining revoked privileges forpublic,anon, andauthenticated.RAG impact: no retrieval behaviour change — the corrector SQL, trigger logic, ranking, and public-title scope are unchanged; this only makes the existing backend-only RLS posture explicit.
Verification
npm run verify:pr-localnpm run drift:manifestservice_role.npm run verify:ui— not run; no UI, routing, styling, or browser behavior changed.npm run verify:release— not run; this is not a release operation.npm run eval:retrieval:quality— not run; retrieval behavior is unchanged and the command is live/provider-backed.npm run check:production-readiness— not run; it is provider-backed and no live Supabase interaction was authorized.Risk and rollout
service_role; browser roles still have neither table privileges nor a matching policy.document title words service role all; the prior fail-closed ACL/RLS posture remains, but the advisor finding would return.Clinical Governance Preflight
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes
Summary by CodeRabbit