Skip to content

fix(kanban): call recompute_ready after unlink_tasks (salvage #22646)#22669

Merged
teknium1 merged 2 commits into
mainfrom
salvage/pr-22646
May 9, 2026
Merged

fix(kanban): call recompute_ready after unlink_tasks (salvage #22646)#22669
teknium1 merged 2 commits into
mainfrom
salvage/pr-22646

Conversation

@teknium1

@teknium1 teknium1 commented May 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Salvage of #22646unlink_tasks now triggers recompute_ready so tasks unblock when their last incomplete dependency is removed.

Root cause

hermes_cli/kanban_db.py::unlink_tasks deleted from task_links but never called recompute_ready, so children whose last blocker was unlinked stayed in todo forever. Sibling functions complete_task and unblock_task already call recompute_ready after their write txn.

Changes

  • hermes_cli/kanban_db.py: capture rowcount inside the write_txn, then call recompute_ready(conn) outside the txn when a link was actually removed.
  • tests/hermes_cli/test_kanban_db.py: regression test (3-task graph A done, C running, B blocked on both → unlink C→B → B must be ready).

Validation

  • New test passes; reverting the fix makes it fail with the exact symptom from the issue.

Closes #22459 via salvage.

wesleysimplicio and others added 2 commits May 9, 2026 08:58
…ency

Problem:
unlink_tasks() removes a parent→child dependency edge but does not trigger
recompute_ready().  A child whose last blocking parent is unlinked stays
stuck in 'todo' indefinitely — it only promotes to 'ready' on the next
dispatcher tick or a manual 'hermes kanban recompute'.  For CLI-only users
without a dispatcher, the child is permanently stuck.

Root cause:
complete_task() and unblock_task() both call recompute_ready() after their
write transaction so downstream children are evaluated immediately.
unlink_tasks() was missing this call — removing a dependency is
semantically equivalent to completing one, so the same recompute is needed.

Fix:
Capture the rowcount result before the write_txn exits, then call
recompute_ready(conn) outside the transaction when a row was actually
deleted (so the child sees the updated task_links state).

Tests:
Added test_unlink_tasks_triggers_recompute_ready in
tests/hermes_cli/test_kanban_db.py: creates parent A (done) + parent C
(running), child B with both parents (todo), unlinks C→B, asserts B is
ready immediately.  Stash-verified: FAILS without fix (child stays todo),
PASSES with fix.
62/62 tests green in tests/hermes_cli/test_kanban_db.py.

Closes #22459.
@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: salvage/pr-22646 vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 7889 on HEAD, 7887 on base (🆕 +2)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 4174 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@teknium1 teknium1 merged commit 0d98007 into main May 9, 2026
17 of 18 checks passed
@teknium1 teknium1 deleted the salvage/pr-22646 branch May 9, 2026 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: unlink_tasks does not trigger recompute_ready — tasks stuck in todo without dispatcher

2 participants