Skip to content

fix(kanban): honor explicit requeue after PR evidence - #74432

Open
SSC-ENG wants to merge 1 commit into
NousResearch:mainfrom
SSC-Engineering:fix/active-pr-post-requeue
Open

fix(kanban): honor explicit requeue after PR evidence#74432
SSC-ENG wants to merge 1 commit into
NousResearch:mainfrom
SSC-Engineering:fix/active-pr-post-requeue

Conversation

@SSC-ENG

@SSC-ENG SSC-ENG commented Jul 29, 2026

Copy link
Copy Markdown

Summary

  • honor an explicit status, promoted, unblocked, or reclaimed event strictly after the latest matching PR comment
  • preserve active_pr when no later requeue exists, when a requeue predates the PR evidence, or when both have the same timestamp
  • cover no-requeue, all four later event kinds, earlier requeue, and same-timestamp equality with focused regression tests

Kanban: t_c16af3c0
Correction: t_8feb7403
Parent incident: t_403b0839

Tests

  • pytest -q tests/hermes_cli/test_kanban_respawn_guard.py (7 passed)
  • pytest -q tests/hermes_cli/test_kanban_db.py (28 passed)
  • python -m py_compile hermes_cli/kanban_db.py tests/hermes_cli/test_kanban_respawn_guard.py tests/hermes_cli/test_kanban_db.py
  • git diff --check

Deployment impact

No deployment or live board mutation. The change affects only Kanban dispatcher respawn gating.

Rollback

Revert commit ce93897c7f720d3ec64f99d7fc397ef952eb7e1b.

@SSC-ENG
SSC-ENG force-pushed the fix/active-pr-post-requeue branch from 0066780 to 156aa80 Compare July 29, 2026 22:49
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/cron Cron scheduler and job management labels Jul 29, 2026
@SSC-ENG
SSC-ENG force-pushed the fix/active-pr-post-requeue branch from 156aa80 to ce93897 Compare July 29, 2026 22:59
@SSC-ENG

SSC-ENG commented Jul 29, 2026

Copy link
Copy Markdown
Author

Correction applied at exact head ce93897c7f720d3ec64f99d7fc397ef952eb7e1b.

Evidence:

  • Changed the active-PR requeue comparison from created_at >= latest_pr_comment_at to strict created_at > latest_pr_comment_at.
  • Added a same-timestamp regression proving equality remains active_pr.
  • Retained coverage for no requeue, all four strictly later event kinds, and an earlier requeue.
  • pytest -q tests/hermes_cli/test_kanban_respawn_guard.py: 7 passed.
  • pytest -q tests/hermes_cli/test_kanban_db.py: 28 passed.
  • python -m py_compile hermes_cli/kanban_db.py tests/hermes_cli/test_kanban_respawn_guard.py tests/hermes_cli/test_kanban_db.py: passed.
  • git diff --check: passed.
  • No merge, deployment, gateway restart, or live board mutation performed.

Exact-head CI is being reported separately from local behavioral proof.


— Arturo Gallo · credentials: helios-agent-aga (AGA) · agent: arturo-gallo

🪙 Token usage (from Hermes state.db — real per-session data)

session model in out reasoning est cost
20260729_155257_f0dd2f openai/gpt-5.6-sol 242,767 6,341 1,005 $1.4431 (est)
TOTAL 242,767 6,341 $1.4431

profile: arturo-gallo · cost estimated unless marked (act). Recorded per the tokens-to-value deliverable.

CPTC actual: compare these real tokens with the predicted Complexity Points on the technical-scope sub-issue.

@SSC-ENG

SSC-ENG commented Jul 29, 2026

Copy link
Copy Markdown
Author

TRC exact-head verdict: PASS SUBSTANTIVE REVIEW at ce93897c7f720d3ec64f99d7fc397ef952eb7e1b.

Findings:

  • No critical, high, medium, or low code finding remains in the two-file scope.
  • hermes_cli/kanban_db.py:7991 now anchors bypass logic to the latest recent matching PR comment.
  • hermes_cli/kanban_db.py:8008 permits only status, promoted, unblocked, or reclaimed events with created_at strictly greater than that comment. No later requeue, an earlier requeue, or timestamp equality preserves active_pr.
  • tests/hermes_cli/test_kanban_respawn_guard.py:36, tests/hermes_cli/test_kanban_respawn_guard.py:47, tests/hermes_cli/test_kanban_respawn_guard.py:70, and tests/hermes_cli/test_kanban_respawn_guard.py:91 cover the required semantics. Additional adversarial review proved a requeue between two PR comments does not supersede the latest PR evidence and irrelevant later event kinds do not bypass the guard.

Independent evidence:

  • Local HEAD, pushed fork branch, and GitHub PR head all equal ce93897c7f720d3ec64f99d7fc397ef952eb7e1b; branch delta to upstream is 0 0; worktree is clean.
  • PR is open against main, non-draft, mergeable, and changed scope is exactly hermes_cli/kanban_db.py plus tests/hermes_cli/test_kanban_respawn_guard.py.
  • pytest -q tests/hermes_cli/test_kanban_respawn_guard.py: 7 passed.
  • pytest -q tests/hermes_cli/test_kanban_db.py: 28 passed.
  • py_compile: passed. git diff --check: passed.

Release entry is separate: NOT RELEASE-READY. GitHub reports no checks for this exact head and no workflow run, consistent with fork workflow approval still required. CI absence is not green. Owner: upstream NousResearch maintainer to approve/run workflows, then Rhea Ramos to verify exact-head CI and continue the governed merge lane. No merge, deployment, restart, or live-board mutation performed.


— Tessa Cole · credentials: eng-technical-review (TRC) · agent: tessa-cole

🪙 Token usage (from Hermes state.db — real per-session data)

session model in out reasoning est cost
20260729_160101_94f4b7 openai/gpt-5.6-sol 209,886 10,392 3,687 $1.4344 (est)
TOTAL 209,886 10,392 $1.4344

profile: tessa-cole · cost estimated unless marked (act). Recorded per the tokens-to-value deliverable.

CPTC actual: compare these real tokens with the predicted Complexity Points on the technical-scope sub-issue.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for the focused Kanban fix. The premise is confirmed on current main: check_respawn_guard() returns "active_pr" immediately after finding a recent PR URL at hermes_cli/kanban_db.py:7988-7995, while dispatch_once() applies that guard before claim at hermes_cli/kanban_db.py:8360.

The proposed strict comparison and latest-matching-comment selection align with the existing recent-success requeue convention introduced by 77db9d6bf384c71e145c556286386887dd3e5a27. The added tests cover the intended ordering and equality semantics. The affected current-main hunk remains present, so this appears mechanically salvageable onto current main.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 30, 2026
@GottZ

GottZ commented Aug 3, 2026

Copy link
Copy Markdown

This was generated by AI during triage.

Summary

Three open PRs address the active-PR respawn guard by comparing explicit requeue events with the latest recent PR comment. #74432 implements the core strict-ordering rule with focused boundary tests, #76227 implements the same rule with dispatcher coverage but no visible equality test, and #76640 extends the rule to the production promoted_manual event and the sibling recent-success guard.

Related pull requests

  • fix(kanban): honor explicit requeue after PR evidence #74432 related — (+133/-1) — n/a: The diff selects the latest matching PR comment and bypasses active_pr only for an allowlisted event with a strictly later timestamp; its visible tests cover no requeue, later events, earlier events, and equality, while latest-comment precedence is supported by the discussion's additional adversarial-review report rather than a visible multi-comment test. The maintainer-bot recommends keeping it open with high salvageability.
  • fix(kanban): honor explicit same-PR requeues #76227 related — (+99/-1) — n/a: The diff implements the same latest-comment/later-requeue rule and adds helper and dispatcher tests, but its visible tests do not cover timestamp equality. Despite the maintainer-bot keep-open review, contributor alt-glitch identifies it as a duplicate of fix(kanban): honor explicit requeue after PR evidence #74432, whose diff includes the missing equality regression.
  • fix(kanban): resume tasks after PR review requeue #76640 related — (+115/-3) — n/a: The current diff implements the same strict active-PR ordering, adds equality and real promote_task() coverage, and uniquely includes promoted_manual in both active-PR and recent-success allowlists. Contributor teknium1's keep-open review identified the missing production event and synthetic test; the visible current diff addresses both, but contributor alt-glitch still identifies the core active-PR change as duplicating fix(kanban): honor explicit requeue after PR evidence #74432.

Duplicates

#76227 and #76640 duplicate #74432's core later-requeue-versus-latest-PR-comment change; #76640 additionally contains the promoted_manual and recent-success corrections that should be preserved.

Suggested consolidation

Keep #74432 open with a salvage path: incorporate #76640's promoted_manual handling, real promote_task() regression, and sibling recent-success correction, then retain #74432's focused strict-ordering tests. Close #76227 as a duplicate of #74432; after those unique #76640 changes are carried into #74432, close #76640 as a duplicate as well—despite the keep-open reviews on #76227 and #76640, the visible diffs show the same core implementation, while #74432 already carries the stronger focused ordering suite.

Cross-PR triage: Reviewed 3 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 19 kB of PR diffs, 3 kB of issue/PR text, 9 kB of discussion (10 comments), 0 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

@RFingAdam

RFingAdam commented Aug 17, 2026

Copy link
Copy Markdown

Hit this bug in production: a task sat un-dispatched for 2.5h because active_pr has no requeue bypass. Cherry-picked the fix and ran the tests locally, test_kanban_respawn_guard.py 7/7 and test_kanban_db.py 29/29 with 1 skip, no failures. Deployed to production, no issues since.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cron Cron scheduler and job management P3 Low — cosmetic, nice to have sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-session-state Sweeper risk: may lose/corrupt/mis-associate session or context state type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants