-
Notifications
You must be signed in to change notification settings - Fork 0
feat(ops): eval-canary liveness probe + Supabase advisor triage docs (DB easy wins) #1009
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Database maintenance notes (Supabase `Clinical KB Database`) | ||
|
|
||
| Live project `sjrfecxgysukkwxsowpy`. This file records advisor snapshots and the standing | ||
| disposition for each finding class, so routine advisor output does not get re-triaged from | ||
| scratch (or "fixed" against design intent). All live mutations remain confirmation-required | ||
| (`AGENTS.md` — API and provider confirmation boundary). | ||
|
|
||
| ## Advisor snapshot — 2026-07-20 (read-only, user-authorized) | ||
|
|
||
| ### Security: 1 INFO — by design, do not fix | ||
|
|
||
| - `rls_enabled_no_policy` on `public.document_title_words`: **deliberate fail-closed | ||
| pattern** — RLS enabled, zero policies, all client roles revoked, service-role-only grants | ||
| (`supabase/schema.sql`, the `enable row level security` block for this table; a schema | ||
| comment was deliberately skipped to avoid drift-manifest churn — this entry is the record). | ||
| Adding policies would be a regression. Expected to reappear in every future advisor run. | ||
|
|
||
| Everything else clean: no RLS-disabled tables, no exposed SECURITY DEFINER functions (the | ||
| `check:function-grants` guard enforces this offline on every PR), no auth misconfigurations | ||
| beyond the note below. | ||
|
|
||
| ### Performance: ~33 INFO "unused index" + 1 Auth note — TRIAGE LIST, not a delete list | ||
|
|
||
| `unused_index` findings need interpretation before any action, and several are protected: | ||
|
|
||
| | Class | Examples | Disposition | | ||
| | ---------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| | **Retrieval-surface indexes** | `document_chunks_content_trgm_idx`, `documents_title_trgm_idx`, `document_labels_label_trgm_idx`, `document_summaries_summary_trgm_idx`, `document_index_units_heading_path_idx` | **RAG-protected — do not drop without the full protocol** (`docs/rag-behaviour/safeguards.md`). "Unused" can mean the planner satisfies fast-path queries another way today; dropping changes the retrieval search space and needs a canary pair. | | ||
| | **Owner-scoped indexes on the single-tenant corpus** | `*_owner_id_idx`, `*_owner_*_idx` on registry/audit/eval/summary tables | Live corpus is all-public (`owner_id` NULL), so owner-scoped paths never execute — but the multi-tenant design intends them. Keep unless multi-tenancy is formally abandoned. | | ||
| | **Operational/rare-path indexes** | rate-limit buckets, cleanup jobs, ingestion stages, `rag_query_misses_aliases_idx`, feedback/approval tables | Genuinely droppable candidates, but the benefit is negligible at this corpus size (write amplification on low-write tables). Revisit only if write latency or storage becomes a measured problem. | | ||
|
|
||
| Standing rule: unused-index removal is a considered maintenance task with its own migration + | ||
| replay + (for retrieval tables) canary pair — never a bulk advisor-driven sweep. | ||
|
|
||
| - `auth_db_connections_absolute`: Auth server pinned at 10 connections instead of a | ||
| percentage strategy. Only matters when resizing the instance; auth load here is tiny | ||
| (magic-link/OAuth only). Revisit at the next instance-size change (dashboard config — | ||
| confirmation-required). | ||
|
|
||
| ## Telemetry retention — open decision (2026-07-20) | ||
|
|
||
| `rag_queries` / `rag_retrieval_logs` telemetry grows with live and eval traffic. | ||
| `npm run purge:query-logs` exists (owner-scoped, `--older-than-days`, `--dry-run`, | ||
| fails loudly on unknown flags) but is **scheduled nowhere** — retention is currently manual | ||
| and unbounded. Wiring a schedule is deliberately NOT done unilaterally because it is a | ||
| recurring live-deletion job needing an explicit policy: which owner scope, what retention | ||
| window (script default 90 days), and where it runs (a small weekly workflow with the | ||
| service-role secret is the natural home). Decision recorded here when made. | ||
|
|
||
| ## Cross-references | ||
|
|
||
| - Weekly eval canary + liveness probe: `docs/observability-slos.md` §3 (the `static-pr` job | ||
| warns when the last completed canary is > 8 days old — added when #923 moved the canary | ||
| from daily to weekly cadence, where a dropped Sunday fire would otherwise go unnoticed for | ||
| a week; a suspected 2026-07-20 drop turned out to be a mis-read — the Sunday 2026-07-19 | ||
| slot fired and succeeded, and Monday 2026-07-20 has no slot under the weekly cron). | ||
| - RAG-protected surfaces and change protocol: `docs/rag-behaviour/safeguards.md`. | ||
| - Hybrid RPC health: `search_schema_health()` execution smoke + `npm run check:indexing`. |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.