Skip to content

Split core god files (search_repository_base, project_context, config, runtime protocols) #1108

Description

@phernandez

From the 2026-07 architecture review (basic-memory-cloud docs/architecture-review-2026-07.md, diagram 2).

Split candidates, in rough order of pain:

  • repository/search_repository_base.py (2,382 lines originally) — natural seams: FTS query building vs vector sync vs shared row mapping. Also evaluate how much of the twin SQLite/Postgres implementations can collapse into the base
  • mcp/project_context.py (1,818)
  • config.py (1,330) — currently config model + ConfigManager + logging init + legacy migration in one file; four separable concerns
  • runtime/note_content.py (1,236 — protocol and value families still share one file) — group contracts by concern
  • runtime/contracts.py — already split into storage / jobs / workflows / note content / indexing-cleanup modules; the aggregate file no longer exists
  • indexing/project_index_workflow.py — split progress metadata / batch fanout / stale handling / coordinator (also queued in the parity doc)

Sequence after the naming/shim cleanup so imports only move once.

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-review2026-07 architecture review cleanup (cloud tracker basic-memory-cloud#1558)enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions