Skip to content

fix(kanban): route unblock through dependency gate#22372

Closed
SimbaKingjoe wants to merge 1 commit into
NousResearch:mainfrom
SimbaKingjoe:fix/kanban-unblock-dependency-gate
Closed

fix(kanban): route unblock through dependency gate#22372
SimbaKingjoe wants to merge 1 commit into
NousResearch:mainfrom
SimbaKingjoe:fix/kanban-unblock-dependency-gate

Conversation

@SimbaKingjoe

@SimbaKingjoe SimbaKingjoe commented May 9, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Routes the unblock_task path through the same dependency gate that guards todo → ready. Previously unblock_task jumped directly to ready, which was the only path that could land a task in ready without verifying all parents are terminal (done or archived). Now it sets the task to todo and calls recompute_ready, which re-evaluates the parent-completion check.

This also naturally handles the case where parents were archived while the task was blocked — recompute_ready treats archived as terminal (superset of done), so the task still promotes correctly.

Related Issue

Fixes #22375

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • hermes_cli/kanban_db.pyunblock_task: transition blocked → todo instead of blocked → ready, then call recompute_ready(conn) outside the write txn (same pattern as complete_task)
  • tests/hermes_cli/test_kanban_core_functionality.py — 4 new tests covering the unblock dependency gate

How to Test

  1. Run pytest tests/hermes_cli/test_kanban_core_functionality.py -k "unblock" -v
  2. All 7 tests pass: 3 existing + 4 new (unblock with parents done, parents not done, parent archived, no parents)
  3. Full kanban suite: pytest tests/hermes_cli/test_kanban_core_functionality.py tests/hermes_cli/test_kanban_db.py -q — 213 passed

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run tests and all pass
  • I've added tests for my changes
  • I've tested on my platform: macOS 15.2

Documentation & Housekeeping

  • I've updated relevant documentation — N/A
  • I've updated cli-config.yaml.example — N/A
  • I've updated CONTRIBUTING.md or AGENTS.md — N/A
  • I've considered cross-platform impact — N/A
  • I've updated tool descriptions/schemas — N/A

unblock_task no longer jumps directly to ready. It sets the task to
todo and calls recompute_ready, so the same parent-dependency gate
that guards todo→ready (all parents done/archived) is re-evaluated.

This closes the only bypass that could land a task in ready without
passing the parent-completion check, and naturally handles the case
where parents were archived while the task was blocked.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cli CLI entry point, hermes_cli/, setup wizard labels May 9, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Closing as redundant. Issue #22375 was fixed on main via commit cda20ee ("fix(kanban): gate claim + unblock on parent completion") on May 9 — the existing fix re-evaluates parent completion inline in unblock_task and also adds a claim_task chokepoint check (defense in depth: any racy writer that lands a task in ready with undone parents gets demoted back to todo at claim time).

One note on your design call: you mentioned recompute_ready treats archived as terminal-equivalent, but on current main both recompute_ready and the new unblock_task gate require parent status == 'done' exactly, so an archived parent would block dependent children. That's a separate semantic question — happy to look at it as its own issue if you'd like to argue the case for treating archived as success-equivalent for dependency gating.

Thanks for the report and the work, @SimbaKingjoe!

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 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.

[Bug]: unblock_task bypasses parent-dependency gate

3 participants