diff --git a/docs/process-hardening.md b/docs/process-hardening.md index d0746fbf8..97ea39824 100644 --- a/docs/process-hardening.md +++ b/docs/process-hardening.md @@ -179,7 +179,8 @@ All approved render-surface modules are extracted. `ClinicalDashboard.tsx` went - **P0 carry-over (PR #278 / `cursor/audit-p2-p3-hardening-b54f`):** RAG cache owner/indexing-version guards, synopsis parity in ranking/detectors, DELETE TOCTOU re-check, worker cache invalidation on job completion, and `RAG_QUERY_HASH_SECRET` required in production-like readiness checks. - **P2 M13:** `20260702000000_commit_generation_preserve_legacy_artifacts.sql` must be applied to live Supabase before reindex commits can safely purge legacy NULL-generation rows. After apply, run `npm run check:m13-migration`, `npm run reindex:health`, and `npm run check:indexing`. `search_schema_health()` now reports `commit_document_index_generation.preserve_legacy_artifacts_migration` when the live function body is stale. - **P2 upload hardening:** `/api/upload` consumes the `document_upload` rate-limit bucket (12/min owner, 3/min anonymous). -- **P3 dispositioned (no code change):** L9 searchable-only `image_count` (documented in `worker/main.ts`); L11 triple `readFile` peak-memory trade-off (documented at the ingestion site); L18 duplicate `audit_logs` policy in an already-applied migration (do not edit applied migrations — consolidate only if migrations are ever squashed); L19 CSP `script-src 'unsafe-inline'` deferred (no active XSS sink today; nonce migration needs dedicated UI verification). +- **P3 dispositioned (no code change):** L9 searchable-only `image_count` (documented in `worker/main.ts`); L11 triple `readFile` peak-memory trade-off (documented at the ingestion site); L18 duplicate `audit_logs` policy in an already-applied migration (do not edit applied migrations — consolidate only if migrations are ever squashed). +- **L19 RESOLVED — CSP `script-src` nonce migration (branch `claude/csp-nonce-migration`).** Production `script-src` is now `'self' 'nonce-' 'strict-dynamic'` (no `'unsafe-inline'`, no `'unsafe-eval'`); the nonce is generated per request in `src/proxy.ts`, threaded into SSR via the `x-nonce` + CSP request headers, and applied to Next's own bootstrap/bundle/flight scripts automatically plus the one hand-authored inline script (theme-flash guard in `src/app/layout.tsx`). Every other CSP directive and security header is unchanged; the static (non-CSP) headers still come from `next.config.ts` → `buildSecurityHeaders`. **Development keeps the pre-migration `'self' 'unsafe-inline' 'unsafe-eval'` (no `'strict-dynamic'`)** because the Turbopack dev server injects non-nonced HMR/route-chunk `