Skip to content

Commit 5073c83

Browse files
committed
fix(core): restore LocalProjectIndexRuntimeProvider — it is a real decoupling seam
Commit 9015127 collapsed LocalProjectIndexRuntimeProvider to the concrete LocalProjectIndexRuntimeFactory on the premise it was the sole impl / pure indirection. That premise was wrong: services/initialization.py declares its own matching InitialProjectIndexRuntimeFactory Protocol and passes a value of that type into run_local_project_index_for_project. The structural Protocol was the boundary that let the services layer supply a factory without importing the concrete class from the index layer, so narrowing the parameter to the concrete broke the assignment (ty: Expected LocalProjectIndexRuntimeFactory, found InitialProjectIndexRuntimeFactory). Restore the Protocol and re-type the parameter. Caught by the full-tree ty check (the collapse's per-chunk typecheck did not cover services/). Signed-off-by: phernandez <paul@basicmachines.co>
1 parent 642f2d5 commit 5073c83

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

src/basic_memory/index/local_project.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,18 @@ def total_files(self) -> int:
334334
return len(self.observed_files)
335335

336336

337+
class LocalProjectIndexRuntimeProvider(Protocol):
338+
"""Minimal factory shape needed to run a local project-index request.
339+
340+
A structural seam so callers in higher layers (e.g. services/initialization,
341+
which declares its own matching InitialProjectIndexRuntimeFactory Protocol)
342+
can supply a runtime factory without importing the concrete
343+
LocalProjectIndexRuntimeFactory from this module.
344+
"""
345+
346+
async def runtime_for_project(self, project: Project) -> LocalProjectIndexRuntime: ...
347+
348+
337349
def local_project_embedding_vector_sync(
338350
dependencies: LocalIndexProjectDependencies,
339351
) -> EmbeddingBatchVectorSync | None:
@@ -508,7 +520,7 @@ async def runtime_for_project(self, project: Project) -> LocalProjectIndexRuntim
508520
async def run_local_project_index_for_project(
509521
project: Project,
510522
*,
511-
runtime_factory: LocalProjectIndexRuntimeFactory,
523+
runtime_factory: LocalProjectIndexRuntimeProvider,
512524
force_full: bool = False,
513525
embeddings: bool = True,
514526
) -> ProjectIndexCoordinatorResult:

0 commit comments

Comments
 (0)