fix(kanban): quarantine corrupt DB backups by fingerprint - #33529
fix(kanban): quarantine corrupt DB backups by fingerprint#33529hanzckernel wants to merge 2 commits into
Conversation
|
Salvaged in PR #33804 (merged as commit Your conceptual approach (content-fingerprint backup naming to make the retry idempotent) was the right call. I shipped a slimmed version focused purely on the disk-amplification bug:
Net diff: +66/-21 across 2 files (was +670/-70 across 5). Live verification before merge:
Tests: 449/449 kanban tests pass. New regression test A few of the things you addressed in this PR overlap with concerns already handled by other recent landings:
Thanks for the careful diagnostic work — the bug repro you described in the PR body was tight enough that I was able to reproduce on current main in ~5 minutes and verify the fix end-to-end. Authorship preserved via co-author trailer; AUTHOR_MAP entry was already in place from your earlier PR #20311. |
What does this PR do?
Stops corrupt Kanban DB backup amplification and tightens gateway handling for quarantined corrupt boards.
When a board DB is corrupt today, repeated gateway ticks / health probes / restarts can keep opening the same malformed DB and keep creating timestamped
*.corrupt.*.bakfiles. This PR makes corrupt backup preservation durable and idempotent for the same DB/WAL/SHM content fingerprint, while still preserving new bytes separately when the corrupt DB or its WAL/SHM sidecars change.It also teaches the embedded gateway dispatcher and ready/review health probes to skip a board already paused for the same corrupt DB fingerprint, so probes do not immediately reopen the same bad board after dispatch paused it.
Related Issue
Refs #30445
Refs #31736
No new issue opened: the remaining problem is covered by those existing Kanban corruption / gateway pressure issues, and this PR is a focused follow-up fix.
Type of Change
Changes Made
hermes_cli/kanban_db.pyexists + size + sha256content, not mtime.fsync+os.replace.gateway/run.pyTests
How to Test
Commands run locally on macOS 26.3.1:
Also ran two independent review passes after the final fixes; both returned no blockers.
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
N/A
Screenshots / Logs
N/A