Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
f86ae20
feat: add image generation metadata re-stamp script
BigSimmo Jul 8, 2026
bac1752
chore: reconcile ingestion RPC execute privileges, schema.sql and dri…
BigSimmo Jul 9, 2026
9216187
ci: add db-reset-verify and dependency-review workflows
BigSimmo Jul 9, 2026
83b437e
ci: remove dependency-review workflow because repository is private w…
BigSimmo Jul 9, 2026
1eee7d8
Merge origin/main into claude/llm-pipeline-review
Copilot Jul 9, 2026
50adfd5
Merge remote-tracking branch 'origin/claude/llm-pipeline-review' into…
Copilot Jul 9, 2026
6b7e581
📝 CodeRabbit Chat: Simplify code implementation (#434)
coderabbitai[bot] Jul 9, 2026
7efedc2
fix(db): rename duplicate migration version 20260708160000 to unique …
BigSimmo Jul 9, 2026
24314db
fix: run prettier on 19 files to fix CI format:check failure (#436)
Copilot Jul 9, 2026
def4753
fix: address PR 433 review comments
cursoragent Jul 9, 2026
255ca67
fix: address follow-up PR 433 review comments
cursoragent Jul 9, 2026
e811cc1
fix: address PR 433 review blockers
BigSimmo Jul 9, 2026
553eac9
fix: address PR 433 review comments on image re-stamp and eval forcing
cursoragent Jul 9, 2026
d831252
Merge origin/main into claude/llm-pipeline-review
Copilot Jul 9, 2026
7449ebf
Merge remote-tracking branch 'origin/claude/llm-pipeline-review' into…
BigSimmo Jul 9, 2026
a76fc39
Merge remote-tracking branch 'origin/claude/llm-pipeline-review' into…
BigSimmo Jul 9, 2026
6a90516
fix: restore neutralized 160000 migration for Supabase Preview parity
BigSimmo Jul 9, 2026
e1b5407
ci: keep supabase cache save non-blocking
BigSimmo Jul 9, 2026
6c06307
Merge remote-tracking branch 'origin/claude/llm-pipeline-review' into…
BigSimmo Jul 9, 2026
93c70e3
ci: run migration verification before docker image cache save
Copilot Jul 9, 2026
c424845
fix: address registry corpus review comments
BigSimmo Jul 9, 2026
75ad728
Finish RAG registry re-embed and quality routing (#438)
BigSimmo Jul 9, 2026
3e64189
docs: codify review and branch cleanup workflow
BigSimmo Jul 9, 2026
009e85c
Merge remote-tracking branch 'origin/claude/llm-pipeline-review' into…
BigSimmo Jul 9, 2026
c4ce648
chore: initial plan — resolving merge conflicts with main
Copilot Jul 9, 2026
284cee3
merge: resolve conflicts with main — keep registry re-embed hooks and…
Copilot Jul 9, 2026
2587b67
fix: apply prettier formatting to fix CI format:check failure
Copilot Jul 9, 2026
9d44bc4
Update src/lib/rag-extractive-answer.ts
BigSimmo Jul 9, 2026
6e30c0f
Merge branch 'main' into claude/llm-pipeline-review
BigSimmo Jul 9, 2026
8827d6f
Update src/lib/rag-extractive-answer.ts
BigSimmo Jul 9, 2026
335f708
fix: remove spurious closing braces in rag-extractive-answer.ts
Copilot Jul 9, 2026
af6da30
Fix PR 443 review findings and restore CI verify gate.
BigSimmo Jul 9, 2026
2254be3
placeholder - resolving merge conflicts
Copilot Jul 9, 2026
30ca69a
fix: resolve merge conflicts with origin/main
Copilot Jul 9, 2026
c718b1e
fix: address code review findings from merge conflict resolution
Copilot Jul 9, 2026
1c7d542
Merge branch 'main' into claude/llm-pipeline-review
BigSimmo Jul 9, 2026
632e904
fix: record PR 443 review follow-ups (#448)
BigSimmo Jul 9, 2026
c97f79f
Potential fix for pull request finding
BigSimmo Jul 9, 2026
a7d1d2d
Potential fix for pull request finding
BigSimmo Jul 9, 2026
4958168
Potential fix for pull request finding
BigSimmo Jul 9, 2026
6186b89
fix: format docs/branch-review-ledger.md to pass Prettier check
Copilot Jul 9, 2026
76516e3
Merge branch 'main' into claude/llm-pipeline-review
BigSimmo Jul 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/live-drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ env:
SUPABASE_PROJECT_REF: sjrfecxgysukkwxsowpy
SUPABASE_PROJECT_NAME: Clinical KB Database
NEXT_PUBLIC_SUPABASE_PUBLISHABLE_KEY: placeholder-ci-anon-key
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}

jobs:
live-drift:
Expand All @@ -34,6 +33,8 @@ jobs:
persist-credentials: false

- name: Preflight required secrets
env:
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}
run: |
missing=""
[ -z "$SUPABASE_SERVICE_ROLE_KEY" ] && missing="$missing SUPABASE_SERVICE_ROLE_KEY"
Expand All @@ -54,6 +55,10 @@ jobs:

- name: Guard Supabase project identity
run: npm run check:supabase-project
env:
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}

- name: Compare live schema drift
run: npm run check:drift
env:
SUPABASE_SERVICE_ROLE_KEY: ${{ secrets.SUPABASE_SERVICE_ROLE_KEY }}
9 changes: 6 additions & 3 deletions docs/branch-review-ledger.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Use this ledger to prevent repeated branch and PR reviews when the reviewed HEAD

## Review Records

| Date | Branch or ref | Reviewed HEAD | Scope | Outcome | Checks |
| ---------- | -------------- | --------------------------------------- | -------------- | ------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| 2026-07-09 | example/branch | abc1234567890abcdef1234567890abcdef1234 | branch-cleanup | Example: already merged into `main`; no unique patch content. | `git log --right-only --cherry-pick main...example/branch`; `git diff --name-status main...example/branch` |
| Date | Branch or ref | Reviewed HEAD | Scope | Outcome | Checks |
| ---------- | -------------------------- | ---------------------------------------- | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| 2026-07-09 | example/branch | abc1234567890abcdef1234567890abcdef1234 | branch-cleanup | Example: already merged into `main`; no unique patch content. | `git log --right-only --cherry-pick main...example/branch`; `git diff --name-status main...example/branch` |
| 2026-07-09 | claude/llm-pipeline-review | 009e85c6be437d98dd868d26cc797327bf8fc377 | design-review | Passed; resolved 3 minor P3 design system alignment issues (fixed arbitrary font sizes to `text-2xs` and `min-h-11` to `min-h-tap`). | `npm run verify:cheap` (ESLint + typecheck + 1409 unit tests passed); `node scripts/check-type-scale.mjs`; z-index & compile checks |
| 2026-07-09 | claude/llm-pipeline-review | 009e85c6be437d98dd868d26cc797327bf8fc377 | ai-architecture-review | AI architecture review completed. Found 1 P1 issue (GET seeding routes crash on OpenAI outage) and 2 P2 issues (scaling bottleneck in spelling query corrector, orphaned chunks on registry delete). All 1409 tests passed. | `git diff origin/main...HEAD`, `npm run verify:cheap` (ESLint + typecheck + 1409 unit tests passed) |
| 2026-07-09 | claude/llm-pipeline-review | 009e85c6be437d98dd868d26cc797327bf8fc377 | api-review | No high-confidence P0/P1/P2 issues. Identified minor validation sequence and parameter bounds checks (P3). | `npm run verify:cheap` (TypeScript typecheck, ESLint, and isolated Vitest runs on medications-route, rag-answer-fallback, and rag-cache-invalidation) |
5 changes: 3 additions & 2 deletions docs/rag-hybrid-findings-and-todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,9 @@ denied to set parameter`)** — the RC11 blocker. The only method hosted allows
(`00000000-0000-0000-0000-000000000000`) correctly found zero rows. `--list-owners` found the real
registry owner `4f1b3c19-3c39-4597-b9df-168c8e6007ff` with 739 eligible rows; guarded write with
`RAG_REGISTRY_CORPUS_EMBEDDING=true --write --confirm` upserted 739 synthetic registry corpus
chunks. Post-write retrieval eval passed with `document_recall_at_5=1`, `content_recall_at_5=1`,
`top_k_hit_rate=1`, `force_embedding_failure_count=0`, `failed_cases=[]`. Post-write
chunks. Ran `npm run eval:retrieval:quality -- --force-embedding`: passed with
`document_recall_at_5=1`, `content_recall_at_5=1`, `top_k_hit_rate=1`,
`force_embedding_failure_count=0`, `failed_cases=[]`. Post-write
`eval:quality -- --rag-only` completed under budget; invented-term controls still refused and
numeric grounding failure rate was `0`. Remaining blockers are not registry regressions:
citation failure rate `0.0227` and RAG latency thresholds (`p95=44847ms`; route p95 extractive
Expand Down
3 changes: 1 addition & 2 deletions scripts/check-m13-migration.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { loadEnvConfig } from "@next/env";

import { createAdminClient } from "@/lib/supabase/admin";

loadEnvConfig(process.cwd());

const M13_HEALTH_MARKER = "commit_document_index_generation.preserve_legacy_artifacts_migration";
Expand All @@ -19,6 +17,7 @@ function missingMarkers(data: unknown) {
}

async function main() {
const { createAdminClient } = await import("@/lib/supabase/admin");
const supabase = createAdminClient();
const { data, error } = await supabase.rpc("search_schema_health");
if (error) {
Expand Down
9 changes: 9 additions & 0 deletions scripts/embed-registry-records.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type Args = {
listOwners: boolean;
};

/** Parse args. */
function parseArgs(argv: string[]): Args {
const args: Args = {
ownerId: process.env.LOCAL_NO_AUTH_OWNER_ID,
Expand Down Expand Up @@ -60,17 +61,20 @@ function parseArgs(argv: string[]): Args {
return args;
}

/** Load admin client. */
async function loadAdminClient() {
const { createAdminClient } = await import("@/lib/supabase/admin");
return createAdminClient();
}

/** Registry kinds. */
function registryKinds(kind: EmbedKind): RegistryRecordKind[] {
if (kind === "all") return ["service", "form"];
if (kind === "service" || kind === "form") return [kind];
return [];
}

/** Load registry rows. */
async function loadRegistryRows(supabase: Awaited<ReturnType<typeof loadAdminClient>>, args: Args, ownerId: string) {
const kinds = registryKinds(args.kind);
if (kinds.length === 0) return [] as RegistryRecordRow[];
Expand All @@ -81,6 +85,7 @@ async function loadRegistryRows(supabase: Awaited<ReturnType<typeof loadAdminCli
return (data ?? []) as RegistryRecordRow[];
}

/** Load medication rows. */
async function loadMedicationRows(supabase: Awaited<ReturnType<typeof loadAdminClient>>, args: Args, ownerId: string) {
if (args.kind !== "all" && args.kind !== "medication") return [] as MedicationRecordRow[];
let query = supabase.from("medication_records").select("*").eq("owner_id", ownerId);
Expand All @@ -90,6 +95,7 @@ async function loadMedicationRows(supabase: Awaited<ReturnType<typeof loadAdminC
return (data ?? []) as MedicationRecordRow[];
}

/** Load differential rows. */
async function loadDifferentialRows(
supabase: Awaited<ReturnType<typeof loadAdminClient>>,
args: Args,
Expand All @@ -111,6 +117,7 @@ type OwnerCounts = {
differential: number;
};

/** Ensure owner count. */
function ensureOwnerCount(counts: Map<string, OwnerCounts>, ownerId: string) {
let count = counts.get(ownerId);
if (!count) {
Expand All @@ -120,6 +127,7 @@ function ensureOwnerCount(counts: Map<string, OwnerCounts>, ownerId: string) {
return count;
}

/** List eligible owner counts. */
async function listEligibleOwnerCounts(supabase: Awaited<ReturnType<typeof loadAdminClient>>) {
const counts = new Map<string, OwnerCounts>();

Expand Down Expand Up @@ -187,6 +195,7 @@ async function listEligibleOwnerCounts(supabase: Awaited<ReturnType<typeof loadA
});
}

/** Main. */
async function main() {
const args = parseArgs(process.argv.slice(2));
const supabase = await loadAdminClient();
Expand Down
6 changes: 3 additions & 3 deletions src/components/clinical-dashboard/source-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export function SourceActionRow({
}) {
return (
<div className={cn("flex flex-wrap gap-2", divider && "border-t border-[color:var(--border)] pt-3")}>
<Link href={viewerHref} className={cn(primaryControl, "min-h-11 px-4 text-xs")}>
<Link href={viewerHref} className={cn(primaryControl, "min-h-tap px-4 text-xs")}>
<FileText className="h-4 w-4" />
Open source
</Link>
Expand All @@ -53,7 +53,7 @@ export function SourceActionRow({
<span className="hidden sm:inline">Add scope</span>
</button>
{imageCount > 0 && (
<span className={cn(metadataPill, "min-h-11 rounded-lg px-3")}>
<span className={cn(metadataPill, "min-h-tap rounded-lg px-3")}>
{imageCount} indexed image{imageCount === 1 ? "" : "s"}
</span>
)}
Expand Down Expand Up @@ -124,7 +124,7 @@ export function SourcePassageLinks({
href={sourceResultHref(source)}
className={cn(
compact ? metadataPill : floatingControl,
"min-h-11 gap-1.5 px-2.5 text-2xs sm:min-h-9 sm:px-3",
"min-h-tap gap-1.5 px-2.5 text-2xs sm:min-h-9 sm:px-3",
)}
title={`${source.title} · page ${source.page_number ?? "n/a"} · chunk ${source.chunk_index}`}
aria-label={`Open source passage #${index + 1}`}
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/form-detail-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ export function FormDetailPage({ form }: { form: FormRecord }) {
<span
key={chip.label ?? `form-chip-${index}`}
className={cn(
"inline-flex min-h-6 items-center gap-1.5 rounded-full border px-2 text-[0.68rem] font-bold uppercase leading-none sm:min-h-7 sm:px-2.5 sm:text-xs",
"inline-flex min-h-6 items-center gap-1.5 rounded-full border px-2 text-2xs font-bold uppercase leading-none sm:min-h-7 sm:px-2.5 sm:text-xs",
chipToneClass(chip.tone),
)}
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/ui-primitives.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const chatActionRow =
export const chatMicroAction =
"inline-flex min-h-tap min-w-tap items-center justify-center gap-1.5 rounded-md px-2 text-xs font-semibold text-[color:var(--text-muted)] transition hover:bg-[color:var(--clinical-accent-soft)] hover:text-[color:var(--clinical-accent)] focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[color:var(--focus)] disabled:cursor-not-allowed disabled:opacity-50";
export const sourceCapsule =
"source-capsule-hover focus-ring-premium inline-flex min-h-tap items-center gap-1 rounded-md border border-[color:var(--border)] bg-[color-mix(in_srgb,var(--clinical-accent-soft)_55%,var(--surface))] px-2 text-[11px] font-medium text-[color:var(--clinical-accent)] transition hover:border-[color:var(--clinical-accent-border)] sm:px-2.5";
"source-capsule-hover focus-ring-premium inline-flex min-h-tap items-center gap-1 rounded-md border border-[color:var(--border)] bg-[color-mix(in_srgb,var(--clinical-accent-soft)_55%,var(--surface))] px-2 text-2xs font-medium text-[color:var(--clinical-accent)] transition hover:border-[color:var(--clinical-accent-border)] sm:px-2.5";
export const sourceCapsuleCountBadge =
"nums inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full bg-[color:var(--surface-raised)] px-1.5 text-2xs font-semibold text-[color:var(--clinical-accent)] shadow-[var(--shadow-inset)]";
export const evidenceRow =
Expand Down
Loading
Loading