feat(memory): state-keyed repo-map reuse via L3 presence check; embed entries on fresh scan
- Add existsByTurnIdPrefix(prefix) to L3MemoryStore interface; implemented in InMemoryL3MemoryStore (mutex-guarded) and TurboVecL3MemoryStore (metadata map). All test fakes (TrackingL3MemoryStore, CapturingStore) updated. - Introduce RepoMapIndexerPort interface; RepoMapIndexer implements it. Allows injection of test doubles without framework overhead. - ProjectMemoryService.indexAndRecord: reads latest WorkspaceStateObservedEvent from event store (invariant #9 — recorded fact, not re-probe); skips scan+embed when L3 already holds entries for "repomap:<root>:<stateKey>"; passes stateKey to RepoMapComputedEvent; embeds each scanned entry after append; per-entry failures warn-logged (CancellationException rethrown). - Tests: InMemoryL3MemoryStoreTest +2 cases; new ProjectMemoryServiceReuseTest covers same-key skip, changed-key re-index, no-observation always-reindex, and embedding turnId tag verification.
This commit is contained in:
+3
@@ -43,6 +43,9 @@ class TurboVecL3MemoryStore(private val config: TurboVecSidecarConfig) : Rehydra
|
||||
metadata[entry.id] = entry
|
||||
}
|
||||
|
||||
override suspend fun existsByTurnIdPrefix(prefix: String): Boolean =
|
||||
metadata.values.any { it.turnId.startsWith(prefix) }
|
||||
|
||||
override suspend fun query(query: L3Query): List<L3Hit> {
|
||||
val request = SidecarRequest(
|
||||
op = "search",
|
||||
|
||||
Reference in New Issue
Block a user