Skip to content

Phase 4b: Table-drive config and extract VectorStore cleanup#160

Merged
gvonness-apolitical merged 2 commits intomainfrom
refactor/phase-4b-config-vectorstore
Mar 13, 2026
Merged

Phase 4b: Table-drive config and extract VectorStore cleanup#160
gvonness-apolitical merged 2 commits intomainfrom
refactor/phase-4b-config-vectorstore

Conversation

@gvonness-apolitical
Copy link
Copy Markdown
Contributor

Summary

  • config/loader.ts: Replace ~230 lines of repetitive boilerplate in loadEnvConfig() and toRuntimeConfig() with declarative mapping tables (ENV_MAPPINGS, CONFIG_MAPPINGS) and generic applicators. Tables serve as self-documenting config reference.
  • vector-store-cleanup.ts: Extract DB cleanup logic (removeVectorsAndRelated, findExpiredVectorIds, findOldestVectorIds) into a standalone module. VectorStore class reduced from 733 → 665 lines. Public API unchanged.

Test plan

  • npm run build:server passes
  • npm test — 2559 tests pass (121 files)
  • npm run lint — 0 errors, 0 warnings
  • npm run format:check — all files compliant
  • All 79 config tests pass
  • All 18 vector-store cleanup tests pass

Replace ~230 lines of repetitive field-by-field boilerplate with
declarative ENV_MAPPINGS (29 entries) and CONFIG_MAPPINGS (26 entries)
tables plus generic applicator functions. Tables serve as self-
documenting config mapping reference.
Move DB cleanup logic (removeVectorsAndRelated, findExpiredVectorIds,
findOldestVectorIds) to vector-store-cleanup.ts. VectorStore class
reduced from 733 to 665 lines. Public API unchanged.
@gvonness-apolitical gvonness-apolitical merged commit ec4c334 into main Mar 13, 2026
3 checks passed
@gvonness-apolitical gvonness-apolitical deleted the refactor/phase-4b-config-vectorstore branch March 13, 2026 18:22
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