Skip to content

refactor(core): split search query and row hydration - #1122

Merged
phernandez merged 1 commit into
mainfrom
codex/1108-search-repository-split
Jul 20, 2026
Merged

refactor(core): split search query and row hydration#1122
phernandez merged 1 commit into
mainfrom
codex/1108-search-repository-split

Conversation

@phernandez

Copy link
Copy Markdown
Member

Why

What Changed

  • Move relaxed FTS query eligibility and tokenization into repository/search_query.py.
  • Add SearchIndexRow.from_mapping() as the explicit persistence boundary used by the base, SQLite, and PostgreSQL repositories.
  • Update direct imports and add regression coverage for database value normalization and single-term CJK queries.
  • Preserve query SQL, ranking, fallback order, and vector orchestration behavior.

Implementation Details

  • The lexical policy remains a small set of pure functions rather than a new manager or mixin hierarchy.
  • Row hydration normalizes SQLite JSON strings, PostgreSQL mappings, and numeric scores in one symmetric counterpart to SearchIndexRow.to_insert().
  • Backend-specific syntax, metadata filtering, and savepoint behavior remain in their existing repositories.
  • Vector synchronization is intentionally left for a later Split core god files (search_repository_base, project_context, config, runtime protocols) #1108 slice.

Testing

Automated

  • just fast-check — passed (existing Python 3.14 asyncio deprecation warnings only)
  • BASIC_MEMORY_ENV=test uv run pytest tests/repository/test_search_relaxation.py tests/repository/test_search_index_row.py tests/repository/test_semantic_search_base.py tests/repository/test_search_repository.py tests/repository/test_postgres_search_repository_unit.py tests/services/test_search_service.py --no-cov -q — 164 passed
  • just fast-test — 4,580 passed, 41 skipped, 5 failed: one live OpenAI semantic-quality case hit 429 insufficient_quota; four Codex-plugin dependency-floor cases reflected concurrent, unstaged workspace changes outside this PR

Manual

  • git diff --cached --check — passed
  • Verified the commit contains only the eight search repository/service/test paths listed in this PR.

Risks / Follow-ups

Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez phernandez added the arch-review 2026-07 architecture review cleanup (cloud tracker basic-memory-cloud#1558) label Jul 20, 2026
@phernandez

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 1c4bbd3ea9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@phernandez
phernandez merged commit d6563bd into main Jul 20, 2026
22 checks passed
@phernandez
phernandez deleted the codex/1108-search-repository-split branch July 20, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

arch-review 2026-07 architecture review cleanup (cloud tracker basic-memory-cloud#1558)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant