fix(kanban): guard corrupted board DB auto-init (Fixes #30687)#30701
Open
deepujain wants to merge 1 commit into
Open
fix(kanban): guard corrupted board DB auto-init (Fixes #30687)#30701deepujain wants to merge 1 commit into
deepujain wants to merge 1 commit into
Conversation
a17c4e6 to
13456b7
Compare
Author
|
@teknium1 Updated this PR again against current main and resolved the new |
13456b7 to
0d0c2b0
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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