Skip to content

Consolidate _v2/_v2_external DI provider triplication; stop reading ConfigManager below the composition root #1109

Description

@phernandez

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

Two mid-migration artifacts in the DI layer:

  1. deps/services.py carries a get_X / get_X_v2 / get_X_v2_external triplication for most services (file, entity, search, context, directory, link, markdown, entity-parser) — roughly 3x the DI surface, with many _v2 variants marked # pragma: no cover. Finish the v1 -> v2 / internal-id -> external-id migration and collapse each triple to one provider.

  2. ConfigManager() is still read below the composition root (deps/config.py:20, deps/db.py, the create_search_repository() fallback), contradicting the ApiContainer design of "only the composition root reads ConfigManager". Inject config from the container instead.

Acceptance: one provider per service; ConfigManager constructed only in composition roots (api/mcp/cli containers).

Metadata

Metadata

Assignees

No one assigned

    Labels

    arch-review2026-07 architecture review cleanup (cloud tracker basic-memory-cloud#1558)bugSomething isn't workingcloudBasic Memory ClouddocumentationImprovements or additions to documentationduplicateThis issue or pull request already existsenhancementNew feature or requestquestionFurther information is requested

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions