refactor(core): simplify v0.23 runtime protocols - #1164
Merged
Conversation
Signed-off-by: phernandez <paul@basicmachines.co>
14 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The v0.23 indexing and semantic-search work added a large Protocol surface so the
portable runtime could serve both Basic Memory and Basic Memory Cloud. A
cross-repository audit found a smaller set of contracts that were unused,
duplicated, mutable despite representing results, or hiding ownership behind an
extra adapter.
This cleanup removes those vestiges before the release without removing any
feature or weakening a capability that Cloud consumes.
What Changed
indexing, relation scheduling, note-file cleanup, and vector synchronization.
VectorSyncBatchResultand kept mutable batchaccounting private to the semantic-vector repository operation.
values can satisfy the same narrow contracts.
reranking, SQLite, pgvector, and Milvus implementations.
and removed the wrapper that previously obscured that responsibility.
.codexruntime state and nested worktrees whileallowlisting a minimal shared
.codex/basic-memory.json.There are no user-visible feature removals.
Implementation Details
src/basic_memory/runtime/vector_sync.pyis now the single portable home forthe vector-sync capability and its immutable batch result. The repository
implementation uses a private accumulator and freezes counts, timings, and
failed entity IDs at the public boundary.
Property-only Protocol members are now read-only properties. Concrete providers
remain structurally compatible, but no longer inherit those Protocols
nominally; this avoids inherited property descriptors conflicting with normal
instance initialization.
LocalStorageFileMetadataSourcenow owns checksum lookup semantics directly. Awrapped
FileNotFoundErrorstill means the file vanished between existence andchecksum checks, while permission and transient I/O errors continue to
propagate.
The shared Codex config contains only the coding profile and canonical
repository identifier. User project mappings and all
.codex/worktreesstateremain machine-local.
Testing
Automated
just fast-check: passed (Ruff fix/format andtytype checking; nineexisting Python 3.14 event-loop deprecation warnings).
BASIC_MEMORY_ENV=test LOGFIRE_IGNORE_NO_CONFIG=1 uv run pytest -q --no-cov tests/index/test_local_schedulers.py tests/index/test_inline_storage_event_processor.py tests/indexing/test_embedding_index_planning.py tests/indexing/test_vector_sync_planning.py tests/repository/test_semantic_vector_sync.py:51 passed.
just doctor: passed the isolated file, database, indexing, vector, search,and status flow.
just fast-test: 4,969 passed and 33 skipped. The only failure was the livepostgres-openaisemantic-quality benchmark, which reached OpenAI andreceived HTTP 429
insufficient_quota.git diff --check: passed.Risks / Follow-ups
not exercise a changed local code path.
SearchRepositorysplit and complete cross-repository frontmatterresult unification are intentionally deferred until after v0.23. They would
expand release risk without simplifying this patch.