fix(rag/db/hub): Core RAG, Security Definer hardening, DB functions, and Developer Hub (PR Group 2) - #2477
Conversation
Remaining Lucide size={15} and 1px shadow spreads were blocking the
token contract. Map those to named tokens, drop unused v2 line-height
companions, and record leftover Hazard 2/3 items in FIX-GUIDE.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com> # Conflicts: # src/components/therapy-compass/therapy-card.tsx
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Keep quoted contract numbers in lockstep with the baseline JSON, and replace nested brief-duration ternaries plus leftover Lucide size={16} on screens this sweep already touched.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…rings, bare doc guard, and developer freshness
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_ffff6640-99c4-48fc-bd8c-0ec35234526b) |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
CI triageCI failed on this PR. Automated classification of the 2 failed job(s):
Compared with main CI run #14542 (success). That run's conclusion is an aggregate and did not exercise Classification is evidence routing, not permission to ignore a failure. Exact quarantined Playwright identities remain governed by the flake ledger. |
|
Recreating the ephemeral Supabase preview so the migrations replay in timestamp order after the older migration arrived from main. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_d04095bb-abc3-43d0-98e1-e09cca2f04ad) |
|
Updates to Preview Branch (core_rag_security_hub) ↗︎
Tasks are run on every commit but only new migration files are pushed.
❌ Branch Error • Mon, 31 Aug 2026 04:45:45 UTC View logs for this Workflow Run ↗︎. |
|
Updates to Preview Branch (core_rag_security_hub) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
…0260831100000 (#2493) live-drift has been red since 2026-08-25 and its sole unexpected finding on the 2026-09-01 run was a def_hash mismatch on public.correct_clinical_query_terms(text,real): manifest e2356565 vs live 2ebaf978. The cause is a mirror gap, not a live-database problem. Migration 20260831100000 (PR #2477) redefined the function with a duplicated `and length(canonical) between 4 and 40` predicate in the canonical UNION branch, and supabase/schema.sql was never updated to match — it was still byte-identical to the earlier 20260828000000 form. The drift manifest is generated by replaying schema.sql into the pinned Postgres image, so the manifest and live disagreed even though live is exactly what the applied migration created. Codify live rather than write a migration: auto-deploy is ON, and a migration would push a change to a live clinical-search function in production for a cosmetic reason. Proven offline, with no live access: after this edit the regenerated manifest reports def_hash 2ebaf978b69f3de0c47d9d0924419c74 for that signature — exactly the live value the failing run reported. Regeneration moved that one entry and nothing else across 96 functions, 43 tables, 222 indexes, 53 policies, 207 constraints and 26 triggers. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Summary
SECURITY DEFINERsearch paths while keeping grants and owner scope constrained.Detailed changes
pg_tempin the search paths forset_owner_id_from_auth_uid,correct_clinical_query_terms, andcreate_uploaded_document_with_ingestion_job.purge_expired_rag_response_cacheoverload and retains the bounded(p_limit integer DEFAULT 1000)overload.Verification
npm run check:migration-role— passed.npm run check:function-grants— passed; all 36 publicSECURITY DEFINERfunctions remain revoked fromPUBLICandanon.npm run check:owner-scope— passed; 60 API files clean against 26 owner-scoped tables.npm run drift:manifest— scratch PostgreSQL replay completed and regenerated the manifest for the current schema.npm run eval:rag:adversarial:offline— passed; 24 fixture cases and 25 regression-harness tests.npm run test -- tests/drift-detection.test.ts tests/rag-extractive-procedural-artifact.test.ts tests/answer-responsiveness-gate.test.ts tests/extractive-answer-formatting.test.ts— 4 files and 205 tests passed.npm run eval:rag:offline— 26 files and 628 offline RAG tests passed.npm run verify:pr-local— partial: runtime, lock parity, formatting, repository/docs/ledger checks, lint, and typecheck passed; the full unit phase passed 930 files and 11,679 tests, then failed six unchangedclaude-cloud-profile.test.tsassertions because this Windows host resolvesbashto the WSL shim. The affected test and script are byte-identical toorigin/main; build and later stages were not reached.UI verification not run: existing PR-head CI passed Production UI critical and all three Production UI shards; the repair diff itself is non-UI.
Live provider, production-readiness, live retrieval evaluation, and live Supabase drift checks were not run; they remain approval-gated.
Risk and rollout
Clinical Governance Preflight
Clinical KB Database(sjrfecxgysukkwxsowpy)Notes
20260828000000followed by20260831100000. Closing/reopening the PR recreated the preview, and a fresh-head status refresh replaced the stale removed-preview check with a passing preview check.