Repository navigation
fix(kanban): stop claimed children bypassing new dependencies - #113398
fangliquanflq wants to merge 5 commits into
Conversation
|
Independent verification of this PR on pristine What the change does — confirmed. The new test is red on
The rejection is atomic (raised inside the Regression: refusing a running child breaks the dependency-parking flow. On the PR head: The same test on pristine Freshness: this branch's merge base is older than current Design note (not a defect claim): refusal is the half of #113374 that the maintainer explicitly left open — #111468 (merged 2026-09-15) took the visibility half for the sibling case (a Happy to re-verify any of these numbers after a rebase or a fix — say the word and I'll re-run the same commands. |
|
Thanks for the detailed verification. I addressed each point:
Additional review found and fixed a cross-board ownership gap in the first carve-out. The latest tip binds ownership to Validation with the canonical runner:
|
Salvage follow-up on the cherry-picked #113398 (@fangliquanflq) and #113452 (@JoaoMarcos44) commits, trimmed to the salvage bar and widened to the class. - link: drop the HERMES_KANBAN_BOARD binding on the run-id ownership proof (tools._worker_run_id / kanban._worker_run_id_for). complete/block prove ownership with the same task-scoped run id and never board-bind it; the guarded case is a forged cross-board task-id collision, not a live path. Dropped the two cross-board tests and the duplicate db owner test. - complete: move the open-parents enumeration into kanban_db.unsatisfied_parents next to _parents_satisfied so the tool, the CLI (`hermes kanban complete` printed "unknown id or terminal state" for the same refusal), kanban_show (`unsatisfied_parents`) and diagnostics share one query. - show: new `running_with_open_parents` diagnostic (hermes kanban show / diagnostics / dashboard) for a running card whose parent is not done — the "surface unresolved parents on a running card" ask of #113374. - tests trimmed to invariants; docs for the refusal text, the show field and the diagnostic. Co-authored-by: fangliquanflq <fangliquan@qq.com> Co-authored-by: joaomarcos <joaomarcosdias444@gmail.com>
|
Thanks @fangliquanflq. Your change was salvaged into #114786 with your authorship preserved (cherry-picked); #114786 — fix(kanban): kanban_link refuses a running child and dependency refusals name the open parents (#113374, #113373, salvage #113398, #113452) — is now merged on |
What does this PR do?
Rejects parent links to children that are already running. Previously,
kanban_linkreported success and persisted the edge even though the active child run could not be gated, allowing work that was meant to be serialized to continue concurrently.Symptom
An operator links an unfinished parent to a child after the child has been claimed. The API reports success and records a
linkedevent, but the child remains running.Impact
Operators receive a false success signal and can unintentionally allow concurrent work against resources that the dependency was intended to protect.
Bug Cause
Trigger:
hermes_cli/kanban_db.py:1595/link_tasksreceives a child whose status is alreadyrunning.Causal chain:
running.link_tasksinserts the dependency, but its gating update only changesreadychildren totodo.Why it is wrong: A dependency added after claim cannot retroactively constrain the active run, so persisting it as a successful link misrepresents the state transition.
Working sibling / contrast: When linking before claim, a
readychild is atomically demoted totodo, and the claim path rechecks unfinished parents.Ruled out: This is not a missing claim-time parent check;
claim_taskalready checks_parents_satisfied. The failure occurs only when the link transaction runs after the claim transaction.Fix
Within the same immediate write transaction used to add the edge, reject a
runningchild before inserting the link or emitting events. A regression test verifies the clear error and confirms that no ineffective edge orlinkedevent is recorded.Related Issue
Closes #113374
Type of Change
Changes Made
hermes_cli/kanban_db.py- reject links to running children atomically before persisting the edge.tests/hermes_cli/test_kanban_db.py- cover the claimed-child rejection and absence of misleading link state.How to Test
link_tasksfor the new dependency.child is already runningand no parent edge orlinkedevent exists.scripts/run_tests.sh tests/hermes_cli/test_kanban_db.py -k link_tasks.Checklist
Code
fix(scope):,feat(scope):, etc.)Documentation & Housekeeping
docs/, docstrings) - N/A; the behavior and error are documented by the function contractcli-config.yaml.exampleif I added/changed config keys - N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows - N/AScreenshots / Logs
N/A - covered by the focused database regression test.