Treating a blank load() as unindexable defeated the feature it was meant to protect: four of the eleven historical dockets hold 1-2 comments with no text at all, so none of them could ever be marked complete and ~130k items would be re-listed on every run. An item with no text is a finished state, not a failure. Stamp it into index_state with content_hash='' / chunk_count=0 and its fingerprint — the empty hash cannot collide with a real sha256 — so the next run fingerprint-skips it without a load, and it no longer blocks its docket's completion. Text appearing later changes the fingerprint and the item is embedded normally. Only a ref that loaded *with* text and chunked to nothing stays unindexable and blocks index_docket_state; the embed/write path already aborts the whole run on error. The index_state upsert both callers need is now _record_state().
6.7 KiB
6.7 KiB