Skip to content

refactor(core): extract semantic vector synchronization#1129

Merged
phernandez merged 1 commit into
mainfrom
codex-1108-vector-sync-extraction
Jul 21, 2026
Merged

refactor(core): extract semantic vector synchronization#1129
phernandez merged 1 commit into
mainfrom
codex-1108-vector-sync-extraction

Conversation

@phernandez

Copy link
Copy Markdown
Member

Why

What Changed

  • Moved vector synchronization planning, prepare-window reads, per-entity preparation, embedding flushes, finalization, and telemetry into semantic_vector_sync.py.
  • Reduced search_repository_base.py from 2,058 lines to 1,213 lines while keeping its public and backend override surface as thin delegates.
  • Preserved compatibility exports for vector sync result/state types, telemetry/time monkeypatch seams, and configurable shard/window constants.
  • Added focused edge-case tests for empty, deferred, failed, oversized, stale, and incomplete synchronization paths.

Implementation Details

  • The new module owns the synchronization data classes and typed phase functions; SearchRepositoryBase continues to expose the existing methods so SQLite/Postgres overrides and caller imports do not change.
  • Internal orchestration deliberately calls repository delegate methods for prepare, flush, finalize, logging, and persistence hooks. This retains backend specialization and existing test override behavior.
  • Shard size and SQLite prepare-window limits remain re-exported through the base module and are passed into the extracted planners, preserving the old monkeypatch/configuration seam.
  • This PR is intentionally behavior-preserving. It does not implement Indexing consolidation: unify vector planners, clarify reindex mechanisms, micro-batching #1110's planner unification or transaction batching; that work should build on this settled boundary.

Testing

Automated

  • just fast-check: passed (ruff, formatting, and type checking; only existing Python 3.14 deprecation warnings).
  • Focused semantic suite with extracted-module coverage: 135 passed, 23 skipped; semantic_vector_sync.py reached 100% line coverage.
  • just fast-test: 552 passed, 2 skipped, 1,262 deselected.
  • just package-check: passed all Claude Code, Codex, skill, Hermes, and OpenClaw package checks.

Manual

  • just doctor: passed the end-to-end local write, index, semantic vector sync, search, and status flow.

Risks / Follow-ups

Part of #1108.

Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez
phernandez merged commit 699bdec into main Jul 21, 2026
22 checks passed
@phernandez
phernandez deleted the codex-1108-vector-sync-extraction branch July 21, 2026 04:49
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