Source strategy — ContentSourceStrategy + WebsiteSourceStrategy#14
Merged
Conversation
- ContentSourceStrategy interface (type/discover/fetch) — the seam the
indexer depends on.
- FetchOutcome(Result{INDEX,UNCHANGED,DELETE,SKIP}, document) — widens the
design's fetch return so non-happy paths are first-class.
- WebsiteSourceStrategy: discover -> SitemapCrawler; fetch maps PageFetcher
FetchResult (304->UNCHANGED, 404->DELETE, error->SKIP, OK->extract->INDEX,
empty->SKIP) and builds the ContentDocument (lastmod = discovery marker).
- SourceStrategyRegistry: indexes injected strategies by type(), clear error
for unknown types, fail-fast on duplicates; future git strategy auto-discovered.
- Tests: registry (test doubles) + WebsiteSourceStrategy with real
collaborators via MockRestServiceServer. 77 tests green.
- steps.md; refresh CLAUDE.md.
Refs #13
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
Introduces the
ContentSourceStrategyseam that decouples the indexer from how a source type is discovered/fetched, plusWebsiteSourceStrategycomposingSitemapCrawler(004) +PageFetcher(005) +ContentExtractor(006).SourceStrategyRegistryselects the strategy byContentSource.type(), so a futuregitstrategy (spec 016) plugs in as a bean with no indexer change. No orchestration/diff/indexing yet (spec 008).Spec
docs/specs/007-source-strategy/{design,behaviors,steps}.mdChanges
ContentSourceStrategyinterface (type/discover/fetch)FetchOutcome(INDEX/UNCHANGED/DELETE/SKIP+ optional document) — widens the design's fetch return so non-happy paths are first-classWebsiteSourceStrategy— mapsFetchResult→FetchOutcome, builds theContentDocumentSourceStrategyRegistry— type-indexed selection, fail-fast on unknown/duplicate typesTest coverage
WebsiteSourceStrategytested with real collaborators viaMockRestServiceServer(no mocks). 77 tests total; spec-review and quality-review clean.Closes #13
🤖 Generated with Claude Code