admin and Claude Sonnet 4.6
b9ab94c9da
feat: API key settings page — store ANTHROPIC/VOYAGE keys in DB with admin UI
...
- Migration: app_settings table with admin-only RLS (ANTHROPIC_API_KEY, VOYAGE_API_KEY)
- lib/settings.ts: getApiKey() reads DB first, falls back to env var
- lib/claude/client.ts: factory createAnthropicClient(apiKey) replaces singleton
- lib/claude/embed.ts: optional apiKey param, falls back to env
- 3 Claude AI routes + similar route: fetch key from settings before calling AI
- incidents/route.ts: fire-and-forget embed reads VOYAGE key from settings
- GET/POST /api/settings: admin-only masked key management endpoint
- /hse/settings page + ApiKeyForm client component
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01FFDuBhMKvoWjrWT3ZnGmmr
2026-07-11 17:46:40 +08:00
admin and Claude Sonnet 4.6
c07bdb77ad
fix: RLS guard in match_incidents + try/catch around AI/embed calls
...
- Add new migration 20260711000013_match_incidents_auth_guard.sql that
replaces match_incidents with an inline auth guard: callers without
hse/admin role receive PGRST301 Forbidden, closing the SECURITY
DEFINER RLS bypass.
- Wrap anthropic.messages.create() in try/catch returning 503 in all
four AI routes: quality-check, triage-suggest, rca-draft, similar.
- Wrap JSON.parse(inc.embedding) and embedText() in similar/route.ts
in a shared try/catch returning 503 Embedding service unavailable.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01FFDuBhMKvoWjrWT3ZnGmmr
2026-07-11 16:48:20 +08:00
admin and Claude Sonnet 4.6
10e71969dd
feat: AI RCA draft assistant in investigation form
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01FFDuBhMKvoWjrWT3ZnGmmr
2026-07-11 16:35:12 +08:00
admin and Claude Sonnet 4.6
547cc6e817
feat: pgvector similar-incident retrieval + SimilarIncidentsPanel
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01FFDuBhMKvoWjrWT3ZnGmmr
2026-07-11 16:31:02 +08:00
admin and Claude Sonnet 4.6
f10fa071f9
feat: AI triage suggestion — severity + DOSH flags pre-fill
...
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01FFDuBhMKvoWjrWT3ZnGmmr
2026-07-11 16:27:29 +08:00
admin and Claude Opus 4.8
54332d0297
feat: JKKP 6/7 PDF generation via pdf-lib, download from incident detail
...
Also excludes node_modules.nosync from vitest test discovery to fix pre-existing bleed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01FFDuBhMKvoWjrWT3ZnGmmr
2026-07-11 15:24:18 +08:00
admin and Claude Opus 4.8
63cb28f520
feat: investigation workspace — 5-Why/fishbone RCA, transitions triaged→investigating→capa_pending
...
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01FFDuBhMKvoWjrWT3ZnGmmr
2026-07-11 15:14:27 +08:00
admin and Claude Opus 4.8
e55c5284a7
feat: triage panel — severity + DOSH checklist, transitions reported→triaged
...
Also excludes node_modules.nosync from tsconfig to fix pre-existing TS type check bleed.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com >
Claude-Session: https://claude.ai/code/session_01FFDuBhMKvoWjrWT3ZnGmmr
2026-07-11 15:12:35 +08:00
admin
3f8da5bd91
feat: incident report form, API route, middleware shared-route + redirect
2026-07-10 13:19:45 +08:00