[feat-024] Backfill script: wipe-and-reinsert for idempotency

↗ view on GitHub · Nick Whitehouse · 2026-05-07 · 9d98a18e

Without the wipe, re-running the script crashes on
(document_id, chunk_index) unique-constraint violations whenever a
prior run partially landed chunks for a doc. Match the worker's
processEmbedDocumentItem semantics so the script is safe to re-run
on any state.

Also bumps the chunkedSet query past supabase-js's 1000-row default
since document_chunks easily exceeds that on a real review.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Repository nwhitehouse/mike
Author Nick Whitehouse <nick.whitehouse@mccarthyfinch.com>
Authored
Parents dbf18a87
Stats 1 file changed , +11 , -1
Part of RAG chat over tabular-review docs (pgvector embeddings)

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-9d98a18e.md from inside the repo you want the change in.

⬇ Download capture-commit-9d98a18e.md