feat: storage.base_path configurable para aislar datos de runtime

Añade BasePath a StorageCfg y resolveDataBase() en runtime.go para
centralizar la resolucion del directorio base de datos del agente.

Prioridad: config storage.base_path > $AGENTS_DATA_DIR/<id> > agents/<id>/data

Esto permite mover los datos de runtime fuera del arbol del proyecto,
evitando que herramientas de desarrollo lean bases de datos, logs o
crypto stores por accidente.

Los paths de memory.db y knowledge.db ahora usan el base resuelto.
Los configs existentes no se rompen (fallback al path original).

Tareas 1.1 y 1.2 del issue 0019.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 19:49:02 +00:00
parent b4db953211
commit 536fa0bc54
2 changed files with 23 additions and 5 deletions
+4 -3
View File
@@ -413,9 +413,10 @@ type QueueCfg struct {
// ── Storage ───────────────────────────────────────────────────────────────
type StorageCfg struct {
State StateStorageCfg `yaml:"state"`
Cache CacheStorageCfg `yaml:"cache"`
History HistoryStorageCfg `yaml:"history"`
BasePath string `yaml:"base_path"` // root for all data; default $AGENTS_DATA_DIR/<id> or agents/<id>/data
State StateStorageCfg `yaml:"state"`
Cache CacheStorageCfg `yaml:"cache"`
History HistoryStorageCfg `yaml:"history"`
}
type StateStorageCfg struct {