Skip to content

Multi-profile embedding serving, FTS deprecation cleanup, doctor --fix#114

Merged
jsilvanus merged 7 commits into
mainfrom
claude/remaining-track-plan-pnye8c
Jun 24, 2026
Merged

Multi-profile embedding serving, FTS deprecation cleanup, doctor --fix#114
jsilvanus merged 7 commits into
mainfrom
claude/remaining-track-plan-pnye8c

Conversation

@jsilvanus

Copy link
Copy Markdown
Owner

Summary

  • Phase 128 — Multi-profile embedding serving: repos.profile_name column (schema v32) pins an embedding profile (speed/balanced/quality) at first index per repo; buildProfileProviderMap resolves per-repo provider pairs on the server (src/server/routes/remote.ts), with ephemeral (non-persisted) jobs falling back to a default profile.
  • Deprecate gitsema index backfill-fts in favor of gitsema index rebuild-fts — no pre-Phase-11 index databases remain in active use, so rebuild-fts (re-syncing blob_fts from already-stored content) now covers all FTS maintenance. backfill-fts keeps working as a hidden, deprecated alias.
  • Add gitsema index doctor --fix: auto-repairs missing FTS5 content (via backfillFts()) and orphan embeddings (via runGarbageCollection()) when index doctor detects them, then re-reports index health — no need to chain index rebuild-fts/index gc manually.
  • Cleanup pass (/simplify): dedup the profile-name validation regex (PROFILE_NAME_RE, now exported from profiles.ts and reused in remoteIndex.ts/remote.ts instead of three copy-pasted literals); drop a redundant FTS rebuild call in doctor.ts --fix (backfillFts() already writes blob_fts directly); factor the duplicated FTS/orphan-count print logic into printFtsAndOrphanCounts().
  • Docs updated: README.md, CLAUDE.md, docs/parity.md, docs/features.md, docs/PLAN.md (Phase 128 deviations + new Phase 131), docs/deprecations.md, docs/feature-ideas.md (two findings deferred from the simplify pass — fix-registry generalization for doctor --fix, and ephemeral-job profile-routing parity).
  • Changesets added for both user-facing changes (multi-profile serving, doctor --fix).

Test plan

  • pnpm build — clean
  • pnpm test — 1333 passed, 22 skipped (114/116 files, 2 skipped)
  • New integration test tests/integration/doctorFix.integration.test.ts covers --fix backfilling FTS content and re-reporting health
  • New unit tests tests/embeddingProfiles.test.ts, expanded tests/remoteIndexPersistence.test.ts cover profile resolution/persistence
  • CI green on all matrix jobs (including Windows)

Generated by Claude Code

claude added 4 commits June 23, 2026 18:39
gitsema tools serve can now host several named embedding profiles at
once. Repos pin to a profile forever at first index via
remote-index --profile; servers with no profiles configured behave
exactly as before. Adds schema v32 (repos.profile_name), profile
routing/conflict handling on POST /remote/index, and gitsema repos info.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XaRDTbabmfzyo6EXzB53LD
No index database predating Phase 11 remains in active use, so the
Git-refetch behavior backfill-fts provided is no longer needed.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XaRDTbabmfzyo6EXzB53LD
…eddings

Folds the manual fixes doctor already recommends (index rebuild-fts /
index backfill-fts / index gc) into a single --fix flag that runs them
when the corresponding issue is detected and re-reports health.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XaRDTbabmfzyo6EXzB53LD
- Export PROFILE_NAME_RE from profiles.ts and reuse it in remoteIndex.ts
  and server/routes/remote.ts instead of duplicating the regex literal.
- doctor.ts: remove the now-redundant rebuildFts() call after
  backfillFts() (which already inserts directly into blob_fts), and
  factor the FTS/orphan-embedding print logic into a shared
  printFtsAndOrphanCounts() helper used for both the initial and
  post-fix reports.
- Update docs/PLAN.md Phase 131 and the doctor-fix-flag changeset to
  match the simplified --fix behavior.
- Document two skipped /simplify findings (doctor --fix generalization
  into a fix registry; ephemeral remote-index job profile routing
  parity) in docs/feature-ideas.md.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XaRDTbabmfzyo6EXzB53LD
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

…tion test

afterAll's rmSync of the temp repo dir can hit a transient lock from the
git subprocesses spawned in beforeAll on Windows runners — same pattern
already handled in profileFirstRun.test.ts. Cleanup is best-effort, not
test-critical, so swallow the error instead of failing the suite.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XaRDTbabmfzyo6EXzB53LD
jsilvanus and others added 2 commits June 24, 2026 09:11
Fix Windows EBUSY flake in doctorFix integration test
Runs `pnpm install` at the start of every Claude Code on the web session
(gated on $CLAUDE_CODE_REMOTE so it's a no-op locally), so tests/build
work without a manual install step. Unignore .claude/hooks/ and
.claude/settings.json so they ship with the repo.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Claude-Session: https://claude.ai/code/session_01XaRDTbabmfzyo6EXzB53LD
@jsilvanus jsilvanus merged commit a1ee7db into main Jun 24, 2026
4 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.

2 participants