Skip to content

fix(kanban): refuse corrupt db auto-init#30707

Closed
NickLarcombe wants to merge 1 commit into
NousResearch:mainfrom
NickLarcombe:fix/kanban-refuse-corrupt-db
Closed

fix(kanban): refuse corrupt db auto-init#30707
NickLarcombe wants to merge 1 commit into
NousResearch:mainfrom
NickLarcombe:fix/kanban-refuse-corrupt-db

Conversation

@NickLarcombe

Copy link
Copy Markdown
Contributor

Summary

  • add a fail-closed integrity guard before Kanban schema bootstrap for existing non-empty DB files
  • preserve corrupt DB bytes with timestamped backups (including WAL/SHM sidecars best-effort) instead of silently recreating an empty board
  • keep transient SQLite lock/busy failures out of the corruption path so healthy locked DBs do not get spurious .corrupt backups

Fixes #30687

Test plan

  • python -m pytest tests/hermes_cli/test_kanban_db.py tests/hermes_cli/test_kanban_boards.py tests/hermes_cli/test_kanban_specify_db.py tests/gateway/test_kanban_notifier.py -q -o 'addopts='
  • python -m ruff check hermes_cli/kanban_db.py tests/hermes_cli/test_kanban_db.py
  • git diff --check

Review

  • Implemented with Claude Code
  • Claude Code final review: PASS

@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have labels May 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #30701 — both fix #30687 with the same approach (integrity guard on existing kanban DB before schema bootstrap). #30701 was submitted first.

@teknium1

Copy link
Copy Markdown
Contributor

Salvaged onto current main as #30862 and merged (commit c4b8f5e). Your commit was cherry-picked with your authorship preserved, the existing header validator is kept ahead of the new integrity guard so both layers cooperate, and the corrupt-db backup writes were hardened to satisfy CodeQL path-injection analysis. Verified end-to-end against the exact malformed-pages corruption shape reported in the Discord thread — the guard catches it where the header check passes, preserves the corrupt bytes to a timestamped .bak, and raises KanbanDbCorruptError from connect(). Thanks!

@teknium1 teknium1 closed this May 23, 2026
Gpapas pushed a commit to Gpapas/hermes-agent that referenced this pull request May 23, 2026
exosyphon pushed a commit to exosyphon/hermes-agent that referenced this pull request May 24, 2026
sahilm-ti pushed a commit to sahilm-ti/hermes-agent that referenced this pull request May 25, 2026
sahilm-ti pushed a commit to sahilm-ti/hermes-agent that referenced this pull request May 25, 2026
mathias3 pushed a commit to mathias3/hermes-agent that referenced this pull request May 28, 2026
Bryce-huang pushed a commit to wbkunlun/hermes-agent that referenced this pull request May 29, 2026
mosaiq-systems pushed a commit to mosaiq-systems/hermes-agent that referenced this pull request May 29, 2026
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
Seven74AI pushed a commit to Seven74AI/hermes-agent that referenced this pull request Jun 13, 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 duplicate This issue or pull request already exists 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.

Kanban: corrupted board DB + empty top-level DB → silent recreation with total data loss

3 participants