fix: harden kanban sqlite write failures - #31952
Open
ryandidurlabs wants to merge 2 commits into
Open
Conversation
Add dispatcher lease coordination, corrupt DB detection, safer reconciliation, and Kanban regression coverage.\n\nTask: t_a0e3aea4
3 tasks
teknium1
reviewed
Jul 13, 2026
teknium1
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the detailed failure coverage. The stale-connection preflight remains relevant: current main's write_txn() still proceeds directly to BEGIN IMMEDIATE at hermes_cli/kanban_db.py:2319, although rollback masking is already handled at lines 2322-2330.
Problems
tests/hermes_cli/test_kanban_core_functionality.py:3487-3496adds exact default-value assertions (120,3,4). These are change-detector tests rather than behavioral contracts.- The PR's dispatcher lease at
gateway/run.py:5361-5371overlaps a later architecture: current main uses the board-scoped dispatch lock inhermes_cli/kanban_db.py:7222-7237, and watcher code now lives ingateway/kanban_watchers.py.
Suggested changes
- Port the stale-write validation narrowly onto current
write_txn()while retaining its current retry/rollback behavior. - Split the lease, reconciliation, gateway filtering, and default changes from the SQLite-write fix; replace the exact-default tests with invariants.
Automated hermes-sweeper review.
| interval = kanban.get("dispatch_interval_seconds") | ||
| assert isinstance(interval, (int, float)) and interval >= 1, ( | ||
| f"dispatch_interval_seconds must be a positive number, got {interval!r}" | ||
| assert interval == 120, ( |
Contributor
There was a problem hiding this comment.
This exact default-value assertion is a change-detector test: an intentional future cadence adjustment fails CI without proving a broken behavior. Please test the configuration invariant or parser/dispatcher behavior instead.
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
cannot rollback - no transaction is activeBEGIN IMMEDIATETest 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 --checkand diff static scan cleanOperational 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.