haiku.rag/tests/cassettes/test_rebuild
Yiorgis Gozadinos 895b5f0532
Refresh source-backed documents in place on a FULL rebuild
FULL rebuild deleted a document before re-ingesting it from its URI, and
the handler around that logged and continued. A 404, a timeout or any
conversion error therefore removed the document permanently.

Deleting after a successful create is not an alternative:
create_document_from_source resolves the same URI to the existing
document and updates it in place, so a trailing delete would remove the
freshly rebuilt row.

Refresh in place instead. create_document_from_source takes an internal
force flag that skips the revision and MD5 short-circuits, so an
unchanged source is still re-converted, re-chunked and re-embedded into
the existing document, and the document id survives a rebuild.

A failed refresh now falls through to the stored-content path rather
than skipping the document: FULL recreates the chunks table before the
loop, so skipping left the document present but unsearchable until the
next rebuild.

The pending-batch flush moves out of the try. A failed flush is a lost
write and should abort the rebuild, not be logged and skipped.
2026-08-19 13:06:39 +03:00
..
test_flush_rebuild_batch_is_a_noop_without_documents.yaml Fix defects found reviewing the coverage work 2026-07-27 10:44:32 +03:00
test_patch_picture_descriptions_returns_zero_for_doc_without_pictures.yaml Fix vcr test 2026-05-05 14:38:03 +03:00
test_rebuild_batch_size_flush.yaml Improve test coverage 2026-04-24 14:43:59 +03:00
test_rebuild_descriptions_flushes_in_batches.yaml Cover the rebuild paths 2026-07-26 19:32:09 +03:00
test_rebuild_descriptions_patches_blob_and_chunks.yaml Update benchmark 2026-05-05 13:58:48 +03:00
test_rebuild_descriptions_skips_already_described.yaml Update benchmark 2026-05-05 13:58:48 +03:00
test_rebuild_drops_leftover_staging_table.yaml Stream rebuild --embed-only through a staging table to bound memory 2026-05-14 15:02:12 +03:00
test_rebuild_embed_only.yaml Record cassettes for embedder, ignore huggingface while recording 2025-12-29 13:23:53 +02:00
test_rebuild_embed_only_flushes_in_batches.yaml Cover the rebuild paths 2026-07-26 19:32:09 +03:00
test_rebuild_embed_only_multi_doc_streams_via_staging.yaml Stream rebuild --embed-only through a staging table to bound memory 2026-05-14 15:02:12 +03:00
test_rebuild_embed_only_recovers_picture_bytes[recoverable].yaml Cover the rebuild paths 2026-07-26 19:32:09 +03:00
test_rebuild_embed_only_recovers_picture_bytes[wiped].yaml Cover the rebuild paths 2026-07-26 19:32:09 +03:00
test_rebuild_embed_only_skips_unchanged.yaml Record cassettes for embedder, ignore huggingface while recording 2025-12-29 13:23:53 +02:00
test_rebuild_embed_only_with_changed_vector_dim.yaml Fix embed-only rebuild with changed vector dimensions 2026-01-14 17:42:28 +02:00
test_rebuild_embed_only_yields_documents_without_chunks.yaml Cover the rebuild paths 2026-07-26 19:32:09 +03:00
test_rebuild_full.yaml Record cassettes for embedder, ignore huggingface while recording 2025-12-29 13:23:53 +02:00
test_rebuild_full_flushes_in_batches.yaml Cover the rebuild paths 2026-07-26 19:32:09 +03:00
test_rebuild_full_flushes_pending_before_source_rebuild.yaml Cover the rebuild paths 2026-07-26 19:32:09 +03:00
test_rebuild_full_skips_document_deleted_mid_rebuild.yaml Cover the rebuild paths 2026-07-26 19:32:09 +03:00
test_rebuild_full_source_failure_falls_back_to_stored_content.yaml Refresh source-backed documents in place on a FULL rebuild 2026-08-19 13:06:39 +03:00
test_rebuild_full_warns_when_source_is_missing.yaml Cover the rebuild paths 2026-07-26 19:32:09 +03:00
test_rebuild_full_with_accessible_source.yaml Improve test coverage 2026-04-24 14:43:59 +03:00
test_rebuild_non_embed_mode_drops_staging_recovery_state.yaml Make rebuild --embed-only idempotent across crashes 2026-05-14 15:02:12 +03:00
test_rebuild_rechunk.yaml emit synthetic picture chunks at ingest under multimodal embedders. 2026-05-03 17:04:43 +03:00
test_rebuild_resumes_phase2_from_staging_after_crash.yaml Make rebuild --embed-only idempotent across crashes 2026-05-14 15:02:12 +03:00
test_rebuild_warns_when_post_rebuild_vacuum_fails.yaml Cover the rebuild paths 2026-07-26 19:32:09 +03:00
test_rechunk_raises_when_docling_blob_is_missing.yaml Cover the rebuild paths 2026-07-26 19:32:09 +03:00