Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .design-sync/NOTES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# design-sync notes — Clinical KB
# design-sync notes — PsychSift

**Day-to-day:** run `node scripts/design-sync.mjs` from the repo root. That installs the
gitignored `.ds-sync` toolchain and compiles CSS into `.design-sync/.cache/compiled.css`.
Expand Down
2 changes: 1 addition & 1 deletion .design-sync/conventions.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Clinical KB — build conventions
# PsychSift — build conventions

> The system of record is `docs/design-system/` (SPEC · TOKENS · COMPONENTS · DECISIONS ·
> GATES). This file is the designer-facing build idiom; where it disagrees with that set,
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ For Codex-specific productivity shortcuts and operating rules, see [`docs/agents

## Repository productivity skills

Automatically apply repo-local skills under `.agents/skills/` when their descriptions match the user's request. Run `npm run skills` for the validated catalog of 35 canonical skills. `npm run check:skills` verifies those skills, their compatibility aliases, and the Claude, Cursor, and Clinical KB plugin skill surfaces. The older long names remain compatibility aliases and must not be counted as unique skills.
Automatically apply repo-local skills under `.agents/skills/` when their descriptions match the user's request. Run `npm run skills` for the validated catalog of 35 canonical skills. `npm run check:skills` verifies those skills, their compatibility aliases, and the Claude, Cursor, and PsychSift plugin skill surfaces. The older long names remain compatibility aliases and must not be counted as unique skills.

The foundational orchestration skills are:

Expand Down
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@AGENTS.md

# Clinical KB — orientation for AI assistants
# PsychSift — orientation for AI assistants

Private, local-first medical guideline RAG knowledge base for a psychiatrist in Perth,
Australia. Clinical reference documents are uploaded to private Supabase Storage, indexed
Expand Down
2 changes: 1 addition & 1 deletion CONTEXT.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Structured content from the selected mode's repository-owned catalogue, carrying
_Avoid_: Model knowledge, database truth

**Indexed Evidence**:
Retrieved excerpts from authorised documents already indexed by Clinical KB.
Retrieved excerpts from authorised documents already indexed by PsychSift.
_Avoid_: Uploaded truth, internal authority

**External Authority Evidence**:
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
# Clinical KB app tier (Next.js). See docs/deployment-architecture.md.
# PsychSift app tier (Next.js). See docs/deployment-architecture.md.
#
# The repo is engine-strict (Node 24.x / npm 11.x via .npmrc + preinstall
# guard), so every stage pins the same Node 24 base image. The build stage
Expand Down Expand Up @@ -96,8 +96,8 @@ COPY package.json next.config.ts ./
USER node
EXPOSE 3000
LABEL org.opencontainers.image.source="https://github.com/BigSimmo/Database"
LABEL org.opencontainers.image.title="Clinical KB app tier"
LABEL org.opencontainers.image.description="Next.js 16 app tier for the Clinical KB medical guideline RAG knowledge base"
LABEL org.opencontainers.image.title="PsychSift app tier"
LABEL org.opencontainers.image.description="Next.js 16 app tier for the PsychSift medical guideline RAG knowledge base"
LABEL org.opencontainers.image.licenses="UNLICENSED"
STOPSIGNAL SIGTERM
# /api/health is the app's own ops health route.
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile.worker
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# syntax=docker/dockerfile:1
# Clinical KB ingestion worker (Node pipeline + Python OCR stack).
# PsychSift ingestion worker (Node pipeline + Python OCR stack).
# See docs/deployment-architecture.md for why the worker ships as a
# container instead of completing the edge-agent migration.
#
Expand Down Expand Up @@ -109,8 +109,8 @@ USER node
# before the image is promoted. It never calls Supabase/OpenAI or claims jobs.
RUN node dist/worker/validate-runtime.mjs
LABEL org.opencontainers.image.source="https://github.com/BigSimmo/Database"
LABEL org.opencontainers.image.title="Clinical KB ingestion worker"
LABEL org.opencontainers.image.description="Node + Python OCR ingestion worker for the Clinical KB medical guideline RAG knowledge base"
LABEL org.opencontainers.image.title="PsychSift ingestion worker"
LABEL org.opencontainers.image.description="Node + Python OCR ingestion worker for the PsychSift medical guideline RAG knowledge base"
LABEL org.opencontainers.image.licenses="UNLICENSED"
STOPSIGNAL SIGTERM
# Long-poll worker; WORKER_* env vars control claim batch size, concurrency,
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ This prohibition includes, without limitation:
trade mark, confidentiality, or proprietary-rights notice.

No patent, design, trade mark, trade-secret, or other non-copyright licence is
granted by this notice. Use of the names "BigSimmo", "Database", "Clinical KB",
granted by this notice. Use of the names "BigSimmo", "Database", "PsychSift", "Clinical KB",
or any associated branding must not imply endorsement, affiliation, or origin.

4. GitHub, third-party licences, and mandatory legal rights
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Clinical KB
# PsychSift

Local-first medical guideline RAG knowledge base for a psychiatrist in Perth,
Australia. The app uploads private clinical reference documents to Supabase
Expand Down Expand Up @@ -100,7 +100,7 @@ For chat-driven work, use:
npm run ensure
```

This checks whether Clinical KB is already running, verifies the local server
This checks whether PsychSift is already running, verifies the local server
belongs to this project, and starts the dev server in the background if needed.
When you say `run` in this chat, Codex should use this command and return the
printed URL.
Expand Down Expand Up @@ -170,7 +170,7 @@ advisors, and docs lookup — not as a replacement for committed migrations.

Defaults in `.cursor/mcp.json`:

- `project_ref=sjrfecxgysukkwxsowpy` — scoped to the live Clinical KB project
- `project_ref=sjrfecxgysukkwxsowpy` — scoped to the live `Clinical KB Database` Supabase project
only
- `read_only=true` — safer default for exploration and reviews

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Security Policy

Clinical KB (`psychiatry.tools`) is a private, single-maintainer clinical reference
PsychSift (`psychiatry.tools`) is a private, single-maintainer clinical reference
application that handles private guideline documents and grounded answer generation.
Security reports are taken seriously and handled privately.

Expand Down
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Clinical KB Documentation Index
# PsychSift Documentation Index

Curated map of the load-bearing docs under `docs/` (not an exhaustive listing of every
file). Categories distinguish **maintained** documents (keep these current when behavior
Expand Down
2 changes: 1 addition & 1 deletion docs/clinical-badge-system-guide.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Clinical Badge System Guide

This guide defines the badge, chip, and compact label system for Clinical KB. Use it as context for future UI, medication, source, document, evidence, answer, and labelling tasks.
This guide defines the badge, chip, and compact label system for PsychSift. Use it as context for future UI, medication, source, document, evidence, answer, and labelling tasks.

This document is governance only. It does not grant approval to apply badges across clinical content. Apply this system to a content area only when that area is explicitly approved for redesign or labelling work.

Expand Down
2 changes: 1 addition & 1 deletion docs/clinical-governance.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Clinical Governance Workstream

Clinical KB is currently a source-backed clinical reference prototype. Before production clinical use, complete and record the following governance decisions.
PsychSift is currently a source-backed clinical reference prototype. Before production clinical use, complete and record the following governance decisions.

## Deployment Classification

Expand Down
8 changes: 4 additions & 4 deletions docs/codebase-index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Clinical KB — Codebase Index
# PsychSift — Codebase Index

Structured map for AI agents and onboarding. For live routes, see `docs/site-map.md` (`npm run docs:update` / `sitemap:check`). For agent rules and verification gates, see `AGENTS.md`; for test execution and flake policy, see `docs/testing.md`.

Expand Down Expand Up @@ -36,7 +36,7 @@ Smaller top-level directories that are easy to miss:

| Path | Purpose |
| ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `caring-contacts/` | Isolated Caring Contacts module migrations and local database-test runner. These migrations are deliberately separate from `supabase/migrations/` and must never target the Clinical KB project. |
| `caring-contacts/` | Isolated Caring Contacts module migrations and local database-test runner. These migrations are deliberately separate from `supabase/migrations/` and must never target the `Clinical KB Database` Supabase project. |
| `data/` | Committed clinical **snapshot exports** loaded at runtime by `src/lib/` (differentials, forms, medications, services, specifiers). Regenerate via the matching `scripts/import-*-export.ts` / `build-*-index.mjs`; do not hand-edit. Distinct from `src/data/`, which holds hand-authored static content. |
| `eval/` | Isolated evaluation labs, outside the product/runtime dependency graph. `eval/docling/` is the sandboxed, dispatch-only Docling extraction benchmark (own hashed Python lock + venvs, egress-blocked Docker run, synthetic fixtures + hostile corpus, aggregate-only reports; `docs/rag-improvement/README.md` §B3) |
| `eslint-rules/` | Repo-specific lint rules enforced by `npm run lint` (button wiring, hardcoded hex, type/icon scale, z-index ladder) |
Expand Down Expand Up @@ -211,7 +211,7 @@ relative imports within its directory, provides deny-by-default team-scoped perm
privacy-safe audit records, and is exercised against both in-memory and local Postgres
repositories. `src/lib/caring-contacts-server/` is the server-side seam for the demo session
and optional separate database connection. It must fail closed in production and must never
connect to the Clinical KB Supabase project. The standalone `src/app/caring-contacts/` workspace
connect to the `Clinical KB Database` Supabase project. The standalone `src/app/caring-contacts/` workspace
is noindex, visibly marked synthetic, and has a single inbound entry from the Tools catalogue.

Inside the workspace, `src/components/caring-contacts/workspace/shell.tsx` owns the whole
Expand Down Expand Up @@ -447,7 +447,7 @@ sequenceDiagram
API-->>U: response (cached in rag_response_cache)
```

### Clinical KB surface
### PsychSift surface

- 15 app modes with unified search shell
- Documents mode: browse indexed guidelines, search, scope, and inspect cited answers; document uploads remain in the administrator backend
Expand Down
10 changes: 5 additions & 5 deletions docs/codex-prompt-playbook.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Codex Prompt Playbook

This playbook contains copy/paste prompts for common Clinical KB work. The
This playbook contains copy/paste prompts for common PsychSift work. The
prompts are written for this repository, not for a generic Next.js project.

Before using any prompt, keep these project defaults in mind:
Expand Down Expand Up @@ -80,7 +80,7 @@ builds, commits, pushes, or cleanup unless I explicitly approve.
Use this instead of asking for a guessed localhost URL.

```text
Run the Clinical KB app safely.
Run the PsychSift app safely.

Follow AGENTS.md local-server safety. Execute npm run ensure, let it choose the
project-specific URL, verify the server identity through the repo helper, and
Expand Down Expand Up @@ -661,7 +661,7 @@ Do not modify files unless I explicitly ask for fixes after the review.
## 23. OpenAI Cookbook Review For This Repo

Use this when you want a fresh pass over current OpenAI Cookbook patterns before
changing the Clinical KB RAG, answer, ingestion, eval, or prompt stack.
changing the PsychSift RAG, answer, ingestion, eval, or prompt stack.

```text
Review the current OpenAI Cookbook and recommend what should be adopted in this
Expand Down Expand Up @@ -800,7 +800,7 @@ Use this for image-heavy PDFs, tables, forms, diagrams, medication charts, or
source pages where text-only retrieval may miss important evidence.

```text
Review multimodal/visual evidence support for this Clinical KB workflow.
Review multimodal/visual evidence support for this PsychSift workflow.

Start read-only and offline. Inspect:
- src/lib/visual-intelligence.ts
Expand Down Expand Up @@ -830,7 +830,7 @@ Use this when prompt injection, off-topic questions, unsafe clinical confidence,
or unsupported output could reach users.

```text
Review and harden Clinical KB RAG guardrails.
Review and harden PsychSift RAG guardrails.

Focus on both input and output guardrails:
- prompt injection and jailbreak attempts inside user queries or retrieved text
Expand Down
2 changes: 1 addition & 1 deletion docs/deployment-architecture.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Deployment Architecture

Decision record for the production topology of Clinical KB. Written 2026-07-06,
Decision record for the production topology of PsychSift. Written 2026-07-06,
revised 2026-07-12 when the app went live on Railway. Companion documents:
`docs/observability-slos.md` (SLOs + eval canary) and `docs/audit/capacity-review.md`
(load model, first bottleneck, soak test).
Expand Down
2 changes: 1 addition & 1 deletion docs/design-system-contract.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Design System Contract & Standards

This document specifies the blocking design system token rules, touch/tap target standards, and enforcement mechanisms for the Clinical KB application.
This document specifies the blocking design system token rules, touch/tap target standards, and enforcement mechanisms for the PsychSift application.

---

Expand Down
2 changes: 1 addition & 1 deletion docs/design-system.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Clinical KB Design System — the front door
# PsychSift Design System — the front door

> **Superseded as spec (31 July 2026).** The system of record is now
> [`docs/design-system/`](./design-system/README.md) — SPEC, TOKENS, COMPONENTS, DECISIONS,
Expand Down
2 changes: 1 addition & 1 deletion docs/design-system/ADOPTION.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Clinical KB design system — ADOPTION
# PsychSift design system — ADOPTION

**The committed ownership and disposition contract for every production surface.** The source
of truth is `adoption-contract.json`; the generated manifest and marked tables in this document
Expand Down
2 changes: 1 addition & 1 deletion docs/design-system/COMPONENTS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Clinical KB design system — COMPONENTS
# PsychSift design system — COMPONENTS

**The public component contracts, their local publication state, and the remaining
specifications.** Prop shapes are normative contracts; token references are roles only —
Expand Down
2 changes: 1 addition & 1 deletion docs/design-system/DECISIONS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Clinical KB design system — DECISIONS
# PsychSift design system — DECISIONS

**The six conflicts resolved — what was chosen, what was rejected, and why — plus the
clinical Q&A that shaped the component specs, the assumptions register, and the blocked
Expand Down
2 changes: 1 addition & 1 deletion docs/design-system/FIX-GUIDE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Clinical KB design system — Hazard 1–2 fix guide
# PsychSift design system — Hazard 1–2 fix guide

Single appendix for the closed Hazard 1–2 sweep. **Rules and roles stay in SPEC / TOKENS /
GATES; this file only records dispositions.** A Documented row is not a licence to change
Expand Down
2 changes: 1 addition & 1 deletion docs/design-system/GATES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Clinical KB design system — GATES
# PsychSift design system — GATES

**Every rule paired with the check that enforces it.** Labels: **implemented-blocking**
(runs in `verify:cheap`/CI and fails the build) · **implemented-partial** (a real check
Expand Down
2 changes: 1 addition & 1 deletion docs/design-system/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Clinical KB design system — document set
# PsychSift design system — document set

The system of record for the v2 design system. **Rules and roles live here; values live
only in the token files.** Source-of-truth ranking: `AGENTS.md` → `ckb-v2-tokens.css` →
Expand Down
2 changes: 1 addition & 1 deletion docs/design-system/SPEC.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Clinical KB design system — SPEC
# PsychSift design system — SPEC

**The complete design system: roles, rules, rationale. Never values.** Token values live in
`src/app/ckb-v2-tokens.css` (branch copy) and `src/app/globals.css` (live layer) only — a value
Expand Down
2 changes: 1 addition & 1 deletion docs/design-system/TOKENS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Clinical KB design system — TOKENS
# PsychSift design system — TOKENS

**The reconciled token inventory (conflict C1 resolved): every role, its winning name, its
owner, and what it replaces. Never values** — values live only in the owner file named per
Expand Down
2 changes: 1 addition & 1 deletion docs/observability-slos.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Observability & SLOs

Service-level objectives for the Clinical KB answer pipeline, the alert
Service-level objectives for the PsychSift answer pipeline, the alert
thresholds attached to them, and the weekly production eval canary that turns
the golden eval into a standing guard. Written 2026-07-06.

Expand Down
2 changes: 1 addition & 1 deletion docs/performance.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Performance and Web Vitals Baselines

This document outlines performance benchmarks, layout stability strategies, and Core Web Vitals baselines for the Clinical KB application.
This document outlines performance benchmarks, layout stability strategies, and Core Web Vitals baselines for the PsychSift application.

---

Expand Down
Loading
Loading