Content indexer — orchestration, diff, upsert/delete#16
Merged
Conversation
- ContentIndexer (@component, gated on meilisearch.enabled): drives discover -> diff (lastmod vs stored) -> strategy.fetch -> batch upsert, deletes 404s and URLs vanished from discovery; idempotent by stable id, fault-tolerant (SKIP one, continue). streamAllDocuments for bootstrap. - IndexReport(discovered, upserted, unchanged, deleted, skipped). - ContentIndexStore seam (loadState/upsert/delete + StoredDocument) so the orchestration is unit-testable without a live Meilisearch. - MeilisearchContentIndexStore: paged filtered multiSearch (testable parseHits, quote-escaped filter), batched addDocuments + waitForTask, deleteDocument. Upsert uses addDocuments because the library BatchWriter is package-private. - Tests: ContentIndexerTest (in-memory store + stub strategy, all behaviors) + parseHits parsing. 90 tests green. - steps.md; refresh CLAUDE.md. Refs #15
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ContentIndexerorchestrates the ingestion pipeline for one source through theContentSourceStrategyseam: Discover → Diff → Fetch → Extract → Index. It diffs discoveredlastmodagainst the state read from the index, fetches only new/changed items, batch-upserts, and deletes documents that 404 or vanished from discovery. Idempotent by stable id, fault-tolerant per page.streamAllDocumentsprovides a lazy full stream for the bootstrap step (009). This is the reusable engine for specs 009/010.Spec
docs/specs/008-content-indexer/{design,behaviors,steps}.mdChanges
ContentIndexer(indexSource+streamAllDocuments),IndexReportContentIndexStoreseam (+StoredDocument) andMeilisearchContentIndexStore(pagedmultiSearch, batchedaddDocuments+waitForTask,deleteDocument)Deviations (documented in steps.md)
BatchWriteris package-private inspring-services, so upsert usesMeilisearchClient.addDocumentsbatched withwaitForTask.ContentIndexStoreseam (not in the original design) so orchestration is unit-testable without a live Meilisearch.Test coverage
parseHitsparsing. 90 tests total; spec-review and quality-review clean.Closes #15
🤖 Generated with Claude Code