Skip to content

fix: harden kanban sqlite write failures#31952

Open
ryandidurlabs wants to merge 2 commits into
NousResearch:mainfrom
ryandidurlabs:cody/kanban-sqlite-hardening-t_15acb1eb
Open

fix: harden kanban sqlite write failures#31952
ryandidurlabs wants to merge 2 commits into
NousResearch:mainfrom
ryandidurlabs:cody/kanban-sqlite-hardening-t_15acb1eb

Conversation

@ryandidurlabs

Copy link
Copy Markdown

Summary

  • preserve the original SQLite write/dispatcher lease error when rollback also fails, instead of masking disk I/O failures with cannot rollback - no transaction is active
  • reject writes on stale connections when the main DB path is missing, zero-byte, or structurally truncated/malformed before BEGIN IMMEDIATE
  • treat zero-byte DBs with durable board-state markers and zero-task DBs with dependent Kanban rows as corrupt/inconsistent instead of silently reinitializing empty boards
  • escape zero-byte backup-marker glob patterns for unusual explicit DB filenames

Test plan

  • env -u HERMES_KANBAN_DB -u HERMES_KANBAN_BOARD -u HERMES_KANBAN_WORKSPACES_ROOT -u HERMES_KANBAN_TASK -u HERMES_KANBAN_WORKSPACE -u HERMES_KANBAN_RUN_ID -u HERMES_KANBAN_CLAIM_LOCK python -m pytest tests/hermes_cli/test_kanban_db.py -q (182 passed)
  • env -u HERMES_KANBAN_DB -u HERMES_KANBAN_BOARD -u HERMES_KANBAN_WORKSPACES_ROOT -u HERMES_KANBAN_TASK -u HERMES_KANBAN_WORKSPACE -u HERMES_KANBAN_RUN_ID -u HERMES_KANBAN_CLAIM_LOCK python -m pytest tests/hermes_cli/test_kanban_db.py tests/hermes_cli/test_kanban_diagnostics.py tests/hermes_cli/test_kanban_db_init.py tests/hermes_cli/test_kanban_boards.py tests/hermes_cli/test_kanban_core_functionality.py tests/hermes_cli/test_kanban_cli.py tests/tools/test_kanban_tools.py -q (588 passed, 1 existing discord audioop deprecation warning)
  • python -m ruff check .
  • git diff --check and diff static scan clean
  • independent Cody subagent review passed with no security concerns or blocking logic errors

Operational note

After review/merge, restart or roll out the Hermes gateway/dispatcher process so long-lived dispatcher instances pick up this code. Kanban child task t_8322370b tracks that operational rollout.

Add dispatcher lease coordination, corrupt DB detection, safer reconciliation, and Kanban regression coverage.\n\nTask: t_a0e3aea4
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard labels May 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard 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.

2 participants