session: honor --shards-dir for qa_db so viz sees session writes

This commit is contained in:
russell@unturf.com 2026-06-03 17:26:28 -04:00
parent d36cdea5de
commit 2b085383db
No known key found for this signature in database

View file

@ -7774,7 +7774,14 @@ def _session_repl(args: argparse.Namespace, sess) -> int:
from arborist.qa.client import OpenAICompatibleClient
client = OpenAICompatibleClient(base_url=endpoint)
qa_db = Path.home() / ".arborist" / "qa.db"
# Honor --shards-dir like other commands (cli line ~550-555). Without
# this, session-driven providence_cache writes land in ~/.arborist/
# qa.db while the viz reads <shards-dir>/qa.db — session cache_keys
# never surface in the Merkle Command Center.
if getattr(args, "global_shards_dir", None):
qa_db = Path(args.global_shards_dir) / "qa.db"
else:
qa_db = Path.home() / ".arborist" / "qa.db"
qa_db.parent.mkdir(parents=True, exist_ok=True)
policy = {"answer_mode": args.answer_mode}