Skip to content

fix(kanban): count board list entries through read-only DB paths - #83337

Open
alexgunsberg wants to merge 3 commits into
NousResearch:mainfrom
alexgunsberg:fix/kanban-board-counts-readonly
Open

fix(kanban): count board list entries through read-only DB paths#83337
alexgunsberg wants to merge 3 commits into
NousResearch:mainfrom
alexgunsberg:fix/kanban-board-counts-readonly

Conversation

@alexgunsberg

Copy link
Copy Markdown

Summary

  • count each listed board through its explicit metadata db_path
  • open count projections with SQLite mode=ro instead of the migration/write initializer
  • preserve delegated read-only board listing and avoid HERMES_KANBAN_DB pinning every row to one database

Root cause

hermes kanban boards list called kb.connect_closing(), which initializes/migrates the schema. Delegated child contexts correctly reject that mutation, but the helper swallowed the exception and rendered populated boards as empty. A worker DB pin could also make every row count the same database.

Verification

  • uv run --with pytest pytest tests/hermes_cli/test_kanban_boards.py -q — 23 passed
  • uv run --with ruff ruff check hermes_cli/kanban.py tests/hermes_cli/test_kanban_boards.py — passed
  • git diff --check — passed
  • live delegated-context readback showed distinct populated counts for academic, hermes-infra, High ROI, and Suomen boards

Hermes DGX Maintainer added 3 commits August 10, 2026 12:32
Keep named boards on physical paths so worker pins cannot collapse the
registry, but still treat an override outside boards/<slug>/ as a
legitimate default-board DB relocation.
@Enough1122

Copy link
Copy Markdown
Contributor

AI code review — automated review for reference, author can ignore or act on any point.

fix(kanban): count board list entries through read-only DB paths

  1. _board_task_counts (hermes_cli/kanban.py) opens the DB with ?mode=ro, bypassing kb.connect()'s schema migration. A board whose schema drifted (e.g. missing status column) now silently returns {} — indistinguishable from an empty board in the boards list output. Consider returning a schema-readable flag (or a None count) so an unreadable board is visible instead of reported as zero.
  2. boards list --json now exposes absolute filesystem paths via db_path — minor info disclosure for dashboard consumers; consider gating the field behind a verbose flag or documenting it as operator-only.
  3. The switch from row-factory dict access to tuple unpacking (status, count) is correct for a raw sqlite3 connection (no row_factory), and the WAL-mode read-only open is safe for concurrent readers. The HERMES_KANBAN_DB relocation-vs-pin disambiguation in _board_list_db_path is well-reasoned and well-tested.

@alt-glitch alt-glitch added type/bug Something isn't working comp/cron Cron scheduler and job management P3 Low — cosmetic, nice to have labels Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cron Cron scheduler and job management P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants