Skip to content

feat: production-ready polish#53

Merged
botirk38 merged 2 commits into
masterfrom
devin/1779660184-production-ready
May 24, 2026
Merged

feat: production-ready polish#53
botirk38 merged 2 commits into
masterfrom
devin/1779660184-production-ready

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Production-readiness improvements in a single PR. No API changes to Cache[K,V] itself.

New features:

  • providers/local/ -- hash-based embedding provider for testing without API keys. Deterministic FNV hashing, L2-normalised. New options.WithLocalProvider option.
  • examples/basic/ -- runnable example using the local provider.
  • Makefile -- make test, make test-race, make bench, make lint, make check.

Architecture cleanup:

  • Deleted errors/ package. Sentinel errors moved to owning packages: ErrClosed/ErrZeroKey/ErrInvalidN in root, ErrNilBackend/ErrNilProvider/ErrNilComparator in options/.
  • Fixed CONTRIBUTING.md reference to types.CacheBackend (now types.Backend).

Test coverage:

  • backends/inmemory/backend_test.go -- CRUD, eviction, overwrite, flush, interface compliance for LRU/LFU/FIFO.
  • backends/inmemory/bench_test.go -- Set/Get/Keys benchmarks for all three backends.
  • cache_bench_test.go -- Set/Get/Lookup/TopMatches benchmarks at the cache level.
  • providers/local/local_test.go -- determinism, dimensions, normalisation, batch.

Documentation:

  • Rewrote root README.md -- concise, no emojis, accurate API reference (sync-only).
  • Added README.md (human docs) and AGENTS.md (agent instructions) to every module: types, options, backends, backends/inmemory, backends/remote, providers, providers/openai, providers/local, similarity, chunker, tokenizer.
  • Updated root CLAUDE.md and AGENTS.md -- fixed import paths (botirk38), documented current architecture and error conventions.

Review & Testing Checklist for Human

  • Verify the errors/ package deletion doesn't break any downstream code you have outside this repo that imported github.com/botirk38/semanticcache/errors
  • Run go run ./examples/basic/ to confirm the example works
  • Spot-check a few module READMEs and AGENTS.md files for accuracy
  • Run make check (builds, tests with race detector, vet, fmt)

Notes

  • The local provider vectors are NOT semantically meaningful -- they're for testing the plumbing only.
  • The errors/ package removal is a breaking change for anyone who imported it directly. Since this is pre-1.0 and you confirmed no backward compat is needed, this is intentional.
  • Net change: +1538 / -616 lines across 39 files.

Link to Devin session: https://app.devin.ai/sessions/1ffef0a58ad440e9aa7f1b64e537a98f
Requested by: @botirk38

- Add local hash-based embedding provider (providers/local/) for testing
  without API keys. Deterministic FNV hashing, L2-normalised, with
  WithLocalProvider option.

- Remove centralized errors/ package. Move sentinel errors to owning
  packages: ErrClosed/ErrZeroKey/ErrInvalidN in root package,
  ErrNilBackend/ErrNilProvider/ErrNilComparator in options package.

- Add comprehensive backend tests (backends/inmemory/backend_test.go):
  CRUD, eviction, overwrite, flush, interface compliance checks for all
  three backends (LRU, LFU, FIFO).

- Add benchmarks: backend Set/Get/Keys benchmarks, cache-level Set/Get/
  Lookup/TopMatches benchmarks.

- Rewrite README.md: concise, no emojis, accurate API reference matching
  current architecture (sync-only, no async docs).

- Add README.md and AGENTS.md to every module: types, options, backends,
  backends/inmemory, backends/remote, providers, providers/openai,
  providers/local, similarity, chunker, tokenizer.

- Update root CLAUDE.md and AGENTS.md: fix import paths (botirk38 not
  botirkhaltaev), document current architecture and error conventions.

- Fix CONTRIBUTING.md: types.CacheBackend -> types.Backend.

- Add Makefile with test, test-race, bench, vet, fmt, lint, build, check.

- Add example program (examples/basic/) using local provider.

Co-Authored-By: Botir Khaltaev <btrghstk@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Co-Authored-By: Botir Khaltaev <btrghstk@gmail.com>
@botirk38 botirk38 merged commit 61cf17a into master May 24, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant