docs: per-module READMEs (run vs library) + root navigation hub
ci / JVM build + tests (pull_request) Failing after 54s
ci / JVM build + tests (pull_request) Failing after 54s
Every subproject now has README.md:
- 3 runnable modules (:standalone, :agentik-cli, :agentik-tui):
quickstart, env table, parameters, known limits
- 11 library modules: what it is, which problem solves, how to
wire it in, where versions live
Root README.md is the navigation hub (Quickstart, Modules table,
publish + CI/CD notes).
Also: ci.yml prunes the :memory-vector -x excludes now that
text-embedding-kmp artifacts are published to caffeine.
518 tests green.
Verified publish pipeline: :proto:publish to caffeine produces
pom.module + per-target klibs + sources for all 9 KMP targets.
🤖 Generated with [opencode]
This commit is contained in:
+39
-26
@@ -1,42 +1,55 @@
|
||||
# :storage-inmemory — `pw.binom.agentik.storage.inmemory`
|
||||
# `:storage-inmemory` — in-memory реализация `:storage-core` (KMP, jvm + native)
|
||||
|
||||
**In-memory реализация всех 4 сторов из `:storage-core`.**
|
||||
Без платформенного IO, KMP-таргеты полностью. Тред-безопасна через `Mutex`.
|
||||
## Что это
|
||||
|
||||
## Какую проблему решает
|
||||
In-memory реализация `MessageStore / WorkingMemoryStore /
|
||||
ConversationStore / ReflectionStore`. Все структуры держит в
|
||||
`ConcurrentHashMap` + `MutableList`, фолотится на RAM
|
||||
(никаких файлов).
|
||||
|
||||
- **Тесты** — мгновенный setup/teardown, нет файловой системы, нет JDBC,
|
||||
детерминированное состояние.
|
||||
- **Embedded-сценарии** (Android ART, iOS) где SQLDelight native-драйвер пока
|
||||
недоступен или избыточен.
|
||||
- **Отладка** — можно в рантайме дампить `MessageStore.listByConversation()` и
|
||||
смотреть что попало в working memory без sqlite3 CLI.
|
||||
Решает: дешёвая тестовая среда без поднятия SQLite. Позволяет
|
||||
прогонять `ChatAgentTest` за миллисекунды и держать сценарии
|
||||
детерминированными.
|
||||
|
||||
Семантика **полностью совпадает** с `:storage-sqlite`: один и тот же контракт
|
||||
`:storage-core`, одинаковые `AutoCloseable`, одинаковая тред-безопасность.
|
||||
## Где используется
|
||||
|
||||
## Подключение
|
||||
- В тестах `:standalone` (`AbstractITTest`).
|
||||
- В Android-имплементации (in-memory + Android-database микс).
|
||||
- В любых юнит-тестах на агенте.
|
||||
|
||||
## Как подключить
|
||||
|
||||
```kotlin
|
||||
commonMain {
|
||||
implementation("pw.binom.agentik:storage-inmemory:$version")
|
||||
commonMain.dependencies {
|
||||
api("pw.binom.agentik:storage-inmemory:0.1.0")
|
||||
api("pw.binom.agentik:storage-core:0.1.0")
|
||||
}
|
||||
|
||||
// Использование
|
||||
val bundle = InMemoryStorageBundle(clock = Clock.System)
|
||||
val conv = bundle.conversations.upsert(Conversation(id = "test", title = "demo", createdAt = now))
|
||||
bundle.messages.append(message = UserMessage("hi"), conversationId = conv.id, workingMemoryIndex = 0)
|
||||
val storage = InMemoryStorageSystem()
|
||||
val messages: MessageStore = storage.messages
|
||||
val working: WorkingMemoryStore = storage.working
|
||||
```
|
||||
|
||||
## Где смотреть версии
|
||||
## Версии
|
||||
|
||||
- `version` из `gradle.properties` (`version=0.1.0`)
|
||||
- релизы: `https://git.binom.pw/subochev/agentik/releases`
|
||||
`gradle/libs.versions.toml` → `[versions] agentik-storage-inmemory`.
|
||||
|
||||
## Сборка
|
||||
## Тесты
|
||||
|
||||
```bash
|
||||
./gradlew :storage-inmemory:build
|
||||
```
|
||||
./gradlew :storage-inmemory:allTests
|
||||
```
|
||||
|
||||
KMP-таргеты — полный набор. Зависимости — только `:storage-core`.
|
||||
Покрывают (через общие contract-tests): round-trip, paged flow,
|
||||
concurrent appends, working-memory replay, очистку.
|
||||
|
||||
## Чего здесь НЕТ
|
||||
|
||||
- Никакого persistence. Перезапуск процесса — данные пропали.
|
||||
Это нормально для тестов и Android in-memory.
|
||||
|
||||
## Текущий статус
|
||||
|
||||
Используется продакшеном (в режиме тестов). Контракт-совместима
|
||||
с `:storage-sqlite` 1:1 — переключение `AGENTIK_STORAGE_BACKEND=memory`
|
||||
в `:standalone`.
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ class InMemoryConversationStoreTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `rename updates title and updatedAt, returns new updatedAt`() = runTest {
|
||||
fun `rename updates title and updatedAt returns new updatedAt`() = runTest {
|
||||
val store = InMemoryConversationStore()
|
||||
val t0 = Instant.parse("2026-09-15T10:00:00Z")
|
||||
store.upsert(ConversationRecord("c1", null, false, t0, t0))
|
||||
|
||||
Reference in New Issue
Block a user