fix(kanban): guard corrupted board DB auto-init (Fixes #30687) - #30701
fix(kanban): guard corrupted board DB auto-init (Fixes #30687)#30701deepujain wants to merge 1 commit into
Conversation
a17c4e6 to
13456b7
Compare
|
@teknium1 Updated this PR again against current main and resolved the new |
13456b7 to
0d0c2b0
Compare
|
@teknium1 Follow-up after seven quiet days. This PR still has no visible checks, assignee, requested reviewer, or human review. GitHub reports it as mergeable. Focused validation from the refreshed branch: |
|
Thanks for addressing a real Kanban data-loss scenario. This is now redundant with the corruption guard already merged on main.
Automated hermes-sweeper review. |
Summary
Fixes #30687.
Kanban command startup still auto-initializes the DB so fresh installs work, but that same path was unsafe for an existing board whose DB had been truncated or replaced with a schema-less SQLite file. In that case
connect()could create the full schema and let commands continue against an empty board.This change adds a DB-open guard before schema creation:
taskstable fail beforeCREATE TABLE IF NOT EXISTShermes kanban initandcreate_board()pass an explicitallow_recreateflag, so deliberate initialization still worksThe check also catches the risky alternate/top-level DB case: an existing current board plus an empty
HERMES_KANBAN_DBtarget no longer becomes a new empty board by accident.Tests
scripts/run_tests.sh tests/hermes_cli/test_kanban_db.py tests/hermes_cli/test_kanban_boards.py/Users/dejain/nvidia/oss/hermes-agent/.venv/bin/ruff check hermes_cli/kanban.py hermes_cli/kanban_db.py tests/hermes_cli/test_kanban_db.py tests/hermes_cli/test_kanban_boards.pyNotes