From c9047fbf26fc568e106d1cb4b76991373d082876 Mon Sep 17 00:00:00 2001 From: Joel-macmini Date: Sat, 2 May 2026 17:24:26 -0400 Subject: [PATCH] fix(kanban): anchor board to default Hermes root, not active profile `kanban_db_path()` and `workspaces_root()` resolved their paths via `get_hermes_home()`, which under `hermes -p ` points at `profiles//`. Each profile silently wrote to its own private `kanban.db`, contradicting both the module docstring ("profile-agnostic on purpose") and the docs ("shared across all your Hermes profiles"). Switch both helpers to `get_default_hermes_root()`, which already handles standard / Docker / profile-mode layouts (hermes_constants.py:71-107). Fixes #18442. Co-Authored-By: Claude Opus 4.7 (1M context) --- hermes_cli/kanban_db.py | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/hermes_cli/kanban_db.py b/hermes_cli/kanban_db.py index 1e8be214fb36..33828289006f 100644 --- a/hermes_cli/kanban_db.py +++ b/hermes_cli/kanban_db.py @@ -1,8 +1,13 @@ """SQLite-backed Kanban board for multi-profile collaboration. -The board lives at ``$HERMES_HOME/kanban.db`` (profile-agnostic on purpose: -multiple profiles on the same machine all see the same board, which IS the -coordination primitive). +The board lives at the *default* Hermes root (``~/.hermes/kanban.db`` in +standard installs, ``$HERMES_HOME/kanban.db`` in Docker / custom roots) — +profile-agnostic on purpose: multiple profiles on the same machine all see +the same board, which IS the coordination primitive. The path is resolved +via ``get_default_hermes_root()``, NOT ``get_hermes_home()``, so that a +worker running under ``hermes -p `` (HERMES_HOME pointed at +``profiles/``) still reaches the shared host-level board instead of a +private per-profile DB. See issue #18442. Schema is intentionally small: tasks, task_links, task_comments, task_events. The ``workspace_kind`` field decouples coordination from git @@ -62,15 +67,26 @@ # --------------------------------------------------------------------------- def kanban_db_path() -> Path: - """Return the path to ``kanban.db`` inside the active HERMES_HOME.""" - from hermes_constants import get_hermes_home - return get_hermes_home() / "kanban.db" + """Return the path to the shared host-level ``kanban.db``. + + Resolved against the *default* Hermes root rather than the active + profile's HERMES_HOME, so that a worker spawned under + ``hermes -p `` reaches the same board as the dispatcher and the + other profiles on the host. See issue #18442. + """ + from hermes_constants import get_default_hermes_root + return get_default_hermes_root() / "kanban.db" def workspaces_root() -> Path: - """Return the directory under which ``scratch`` workspaces are created.""" - from hermes_constants import get_hermes_home - return get_hermes_home() / "kanban" / "workspaces" + """Return the directory under which ``scratch`` workspaces are created. + + Anchored at the default Hermes root for the same reason as + :func:`kanban_db_path` -- workspace paths are absolute and shared across + profiles, so they must not be created under a profile-private root. + """ + from hermes_constants import get_default_hermes_root + return get_default_hermes_root() / "kanban" / "workspaces" # ---------------------------------------------------------------------------