Enable implicit phase-memory activation on every warden command.

Load coordination memory by default via ensure_memory_context on app bootstrap
and route/access flows; invalidate cache after episode writes. WARDEN_MEMORY=0
remains the opt-out. Document that warden memory activate is optional only.
This commit is contained in:
2026-07-03 00:49:36 +02:00
parent 04929e7981
commit 120de64bcb
6 changed files with 129 additions and 13 deletions

View File

@@ -126,4 +126,18 @@ def test_memory_disabled_skips_recording(monkeypatch) -> None:
def test_default_store_path_uses_xdg(monkeypatch) -> None:
monkeypatch.delenv("WARDEN_MEMORY_STORE", raising=False)
assert str(store_path()).endswith("warden/memory")
assert str(store_path()).endswith("warden/memory")
def test_route_find_implicitly_activates_memory_without_explicit_command(tmp_path, monkeypatch) -> None:
from warden.memory import ensure_memory_context
monkeypatch.setenv("WARDEN_MEMORY_STORE", str(tmp_path / "memory"))
monkeypatch.delenv("WARDEN_AGENT_ID", raising=False)
result = runner.invoke(app, ["route", "find", "ssh tunnel", "--json"])
assert result.exit_code == 0
activation = ensure_memory_context(need="ssh tunnel", implicit=True)
assert activation is not None
assert activation.get("implicit") is True
assert status()["episode_count"] >= 1