fix: keep initially blocked kanban cards sticky - #60100
Conversation
Duplicate of #34735 — same fix: emit a |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused fix. The premise is still present on current main: create_task() sets task_status = "blocked" for initial_status="blocked" at hermes_cli/kanban_db.py:2585, but emits only created at hermes_cli/kanban_db.py:2670-2684. _has_sticky_block() requires a blocked/unblocked event (hermes_cli/kanban_db.py:3273-3279), so recompute_ready() can promote the card (hermes_cli/kanban_db.py:3317-3365).
Problems
- The new event records
"recurrences": 1, but the task row retains the schema defaultblock_recurrences = 0(hermes_cli/kanban_db.py:1173-1179). The loop-breaker reads that persisted field when a task is re-blocked (hermes_cli/kanban_db.py:4808-4818,4873-4876), so the event audit payload and state machine disagree.
Suggested changes
- Initialize the persisted recurrence state consistently and cover unblock → re-block, or omit
recurrencesfrom the creation event payload.
Automated hermes-sweeper review.
| "kind": None, | ||
| "recurrences": 1, | ||
| }, | ||
| ) |
There was a problem hiding this comment.
block_recurrences remains at the task schema default of 0, while block_task() later reads that column to calculate re-block loops. Either initialize the task row consistently or omit this event-only recurrences value so the lifecycle audit does not claim state the loop breaker cannot see.
|
Closing this in favour of #34735, the earliest open canonical PR for the same create-time sticky-block fix. Our local deployment independently reproduced the defect and confirmed that emitting a Thanks for the triage and review. |
Summary
blockedevent when a Kanban task is created withinitial_status="blocked"recompute_ready()from silently promoting create-time blocked cards toready--initial-status blockeddriftRoot cause
create_task(..., initial_status="blocked")insertedstatus="blocked"but only emitted acreatedevent._has_sticky_block()distinguishes human/ops blocks from transient blocks by looking for latestblocked/unblockedevents, so create-time blocked cards looked non-sticky and were auto-promoted.Test plan
uv run --with pytest --with pytest-xdist python -m pytest tests/hermes_cli/test_kanban_blocked_sticky.py::test_initial_status_blocked_is_not_auto_promoted_by_recompute_ready tests/hermes_cli/test_kanban_blocked_sticky.py tests/hermes_cli/test_kanban_db.py::test_recompute_ready_skips_tasks_at_failure_limit -q -n 0Result:
8 passed.