[lore 1/7] repo scaffold and core types#1
Merged
Conversation
Bootstraps the mathomhaus/lore Go module with the type surface every later quest in the v0.1.1 series builds on: - go.mod at module path github.com/mathomhaus/lore, Go 1.23 minimum, no external dependencies yet (interfaces and reference impls land in subsequent quests). - pkg/lore/doc.go: package doc explaining library scope (no CLI, no MCP server, no service) and the three pluggable interfaces (Store, Embedder, VectorStore) that compose a Retriever and an optional Ingester. - pkg/lore/kind.go: Kind typed string with the eight canonical constants (decision, principle, procedure, reference, explanation, observation, research, idea), AllKinds, and Validate that wraps ErrInvalidKind. - pkg/lore/errors.go: sentinel errors (ErrNotFound, ErrDuplicate, ErrInvalidKind, ErrInvalidArgument, ErrConflict, ErrUnsupported, ErrClosed) intended to be wrapped with fmt.Errorf %w. - pkg/lore/lore.go: Entry, Edge, SearchHit, ListOpts, SearchOpts. Each field documents nullable and slice semantics so Store implementations can persist them consistently. - README.md: positioning paragraph, install hint, pre-v1.0 stability disclaimer, attribution to mathomhaus/guild, link to the spec doc. - .gitignore tuned for Go projects. - .github/workflows/ci.yml: matrix on go 1.23 and 1.24 across Ubuntu and macOS, runs go vet, go build, and go test -race -count=1. Tests cover Kind validation (canonical and rejected inputs), AllKinds size and membership, sentinel-error distinctness and wrap-preservation, and zero-value sanity for the public structs.
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
Bootstraps
mathomhaus/lorewith the type surface every later quest in thev0.1.1 series builds on. Library-only scope: no CLI, no MCP server, no
service.
go.modat module pathgithub.com/mathomhaus/lore, Go 1.23 minimum, noexternal dependencies yet (interfaces and reference impls land in
subsequent quests, which is when OpenTelemetry and modernc.org/sqlite
enter the require block).
pkg/lore/doc.go: package doc that frames the library scope and the threepluggable interfaces (
Store,Embedder,VectorStore) that compose aRetrieverand an optionalIngester.pkg/lore/kind.go:Kindtyped string with the eight canonical constants(
decision,principle,procedure,reference,explanation,observation,research,idea),AllKinds(), andValidate()thatwraps
ErrInvalidKind.pkg/lore/errors.go: sentinel errors (ErrNotFound,ErrDuplicate,ErrInvalidKind,ErrInvalidArgument,ErrConflict,ErrUnsupported,ErrClosed). Distinct so callers canerrors.Iswithout ambiguity.pkg/lore/lore.go:Entry,Edge,SearchHit,ListOpts,SearchOpts.Each field documents nullable / slice / map semantics so
Storeimplementations can persist them consistently.
README.md: positioning paragraph, install hint, pre-v1.0 stabilitydisclaimer, attribution to
mathomhaus/guild, link to the spec..gitignoretuned for Go..github/workflows/ci.yml: matrix on Go 1.23 and 1.24 across Ubuntu andmacOS, runs
go vet,go build, andgo test -race -count=1.Acceptance criteria addressed
go.modatgithub.com/mathomhaus/lore, Go 1.23+gh repo create).gitignorefor Go projectsattribution to
mathomhaus/guild, link to spec docpkg/lore/lore.go:Entry,Edge,SearchHit, common opts typespkg/lore/kind.go:Kindtyped string + 8 canonical constants +Validate()pkg/lore/errors.go: sentinel errors usingerrors.Newandfmt.Errorfwrap-friendlypkg/lore/doc.go: package-level godoc explaining scope and the threeswap points
.github/workflows/ci.yml: Go matrix 1.23+, runs vet, test, buildquest-1-scaffold, PR openedTest plan
go vet ./...cleango build ./...cleango test -race -count=1 ./...passes (16 tests, including 8canonical-kind subtests)
gofmt -l .reports no diffsNotes
go.moddeliberately has norequireblock at this point. Addingunused deps (OpenTelemetry, etc.) just to satisfy a future need would be
scrubbed by
go mod tidy. They land in quest 2 (sqlite) and quest 3 (BGE)when actually imported.
note about "5 kinds for fork-and-strip speed" is moot here since this is
a clean rewrite, not a fork.
errors.gois hand-written soerrors.Isandfmt.Errorf("%w")workcleanly across all callers; tests prove distinctness and wrap behavior.