[lore 6/7] Ingester + heuristic classifier (Path B)#5
Merged
Conversation
2457b71 to
5f385f8
Compare
…unker (Path B) Adds pkg/lore/ingest: Ingester interface, WalkDir filesystem walker, ChunkFile markdown chunker (H1/H2/H3 boundaries + YAML frontmatter), and pkg/lore/ingest/heuristic: NewIngester with four-level classification (frontmatter > path rules > heading patterns > fallback=research), DefaultRules covering ADR/runbook/concept/reference/agent-config paths, functional options WithRules/WithLogger/WithTracer/WithMaxFileSize, OTel spans (lore.ingest.process + lore.ingest.classify), slog structured logging, testdata fixture corpus, and tests covering all classification paths.
5f385f8 to
5753741
Compare
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
pkg/lore/ingest:Ingesterinterface,Result/FileErrortypes,WalkDirfilesystem walker,ChunkFilemarkdown chunker (H1/H2/H3 boundaries with YAML front matter)pkg/lore/ingest/heuristic:NewIngesterwith four-level classification (front matter > path rules > heading patterns > fallback=research),DefaultRulestable covering ADR/runbook/concept/reference/agent-config patterns, functional optionsWithRules/WithLogger/WithTracer/WithMaxFileSizelore.ingest.process(path.count, entries.count attrs) andlore.ingest.classify(per-file)Design notes
The Ingester is a pure functional transform:
Processreturns[]lore.Entryand the caller writes to Store + VectorStore. This keeps the ingester composable with any transactional or batching strategy.Classification priority (first match wins):
kind:fieldTest plan
go test -race ./pkg/lore/ingest/...passesgo vet ./...cleangofmt -l ./pkg/lore/ingest/produces no output