fix(kanban): resume rework after retained PR - #84650
Conversation
|
Independent revalidation on de315a9: 60/60 lifecycle tests pass through the repository runner, Ruff and the Windows-footgun checker pass, git diff --check is clean, and a virtual merge with current main 165c889 succeeds. I reviewed the causal boundary specifically: the modern event stores the task-scoped max comment ID inside the same connection, same-second comments are ordered by ID, malformed/foreign/future/boolean markers fail closed, and any later PR comment restores active_pr. This remains distinct from worker lifecycle/artifact confinement in #86609/#86610. I did not find a counterexample in this scope; no extension PR is needed. |
fix(kanban): resume rework after retained PR
|
Summary
changes_requestedorreview_reopenedexplicitly returns a reviewed task to implementationWhy
A same-card review can retain the original PR URL after
request_changes. The task correctly returns toready, but the existingactive_prrespawn guard then treats that historical URL as evidence of duplicate work and prevents the original implementer from resuming.Timestamp-only requeue exceptions are not sufficient because comments and lifecycle events have second-resolution timestamps. This change uses the monotonic, task-scoped comment ID as the causal boundary for new events, without changing the schema. Legacy events fall back to strict timestamp ordering.
Reproduction / behavior
Before this change:
request_changescheck_respawn_guard(..., lane="ready")returnsactive_prAfter this change, the ready retry is dispatchable to the original implementer. A PR comment added after the rework boundary returns
active_pragain.Verification
scripts/run_tests.sh tests/hermes_cli/test_kanban_review_lifecycle_complete.py tests/hermes_cli/test_kanban_review_lifecycle.py -j 2— 60 passedscripts/run_tests.sh tests/hermes_cli/test_kanban*.py tests/plugins/test_kanban_dashboard_plugin.py -j 8— 262 passed, 1 Windows-only skip.venv/bin/ruff check hermes_cli/kanban_db.py tests/hermes_cli/test_kanban_review_lifecycle_complete.py— passed.venv/bin/python -m py_compile hermes_cli/kanban_db.py tests/hermes_cli/test_kanban_review_lifecycle_complete.py— passedgit diff --checkand added-lines security scan — passedty check ...— no new diagnostics versus the exact base (same 7 pre-existing findings)git merge-tree --write-tree origin/main HEADagainst current upstreammainTested on Linux with Python 3.11.
Compatibility and scope
Related work
Related to #29458. This is narrower than the generic requeue/timestamp approaches in #76640, #76227, #72555, and #62393: it keys the exception specifically to review-to-rework lifecycle events, establishes same-second causal ordering with a comment-ID watermark, and validates malformed/legacy data fail closed.