fix(kanban): persist pass-loop state on task rows - #63723
Conversation
4405d59 to
df27a63
Compare
teknium1
left a comment
There was a problem hiding this comment.
Thanks for isolating the proposed PASS-loop work. The current main implementation already keeps review-required handoffs sticky (hermes_cli/kanban_db.py:3244-3279) and persists block_recurrences, escalating repeated same-kind blocks to triage (hermes_cli/kanban_db.py:4876-4915).
Problems
hermes_cli/kanban_db.py:3990-4024treats everycompletion_blocked_%event as PASS-loop evidence. On current main, the only such production event iscompletion_blocked_hallucination(hermes_cli/kanban_db.py:4035), which represents phantom created-card IDs, not an unmerged-branch review loop. The candidate predicate can therefore reroute unrelated failures.- The candidate branch changes the established escalation from
triagetoblocked(hermes_cli/kanban_db.py:5951-6007) without a current-main reproduction showing that the existing sticky-block contract is insufficient. Existing coverage verifies that areview-requiredtask remains blocked across dispatcher ticks (tests/hermes_cli/test_kanban_blocked_sticky.py:56-76). _latest_pass_loop_candidate()is invoked insidewrite_txnand can rungit rev-parsewith a 10-second timeout (hermes_cli/kanban_db.py:3945-3977,5939-5945), extending SQLite writer-lock duration.
Suggested changes
- Establish an exact, production-generated event/payload for the claimed loop and test that real path; do not infer it from broad event prefixes and comment text.
- Keep the existing triage contract unless a concrete reproduction warrants a deliberately reviewed policy change.
- Separate the unrelated delivery-state subsystem from this fix.
This is an automated hermes-sweeper review.
| """ | ||
| SELECT id, kind, payload, created_at | ||
| FROM task_events | ||
| WHERE task_id = ? AND kind LIKE 'completion_blocked_%' |
There was a problem hiding this comment.
This prefix accepts completion_blocked_hallucination, which current main emits only for phantom created-card IDs (complete_task at current-main hermes_cli/kanban_db.py:4035). That is not evidence of an unmerged-branch PASS loop; define and query an exact producer/event kind for this signal.
| if _is_review_required_reason(reason): | ||
| pass_loop_task = get_task(conn, task_id) | ||
| if pass_loop_task is not None: | ||
| pass_loop_candidate = _latest_pass_loop_candidate(conn, pass_loop_task) |
There was a problem hiding this comment.
This runs inside the surrounding write_txn; the candidate path calls _pass_loop_branch_head_sha(), which executes git rev-parse with a ten-second timeout. Do not hold the SQLite writer transaction while invoking an external process.
| cur = conn.execute( | ||
| """ | ||
| UPDATE tasks | ||
| SET status = 'blocked', |
There was a problem hiding this comment.
Current main deliberately routes repeated same-kind blocks to triage to force human decision (hermes_cli/kanban_db.py:4876-4915). Keeping this special case blocked changes that established safety contract; retain triage unless a real current-main reproduction demonstrates the need for a different policy.
SummaryThirteen PRs address or reference #59333/#66909: #59367, #59536, and #59645 implement the requested global Related pull requests
Duplicates#59536 and #59645 are later implementations of #59367; #61372 overlaps the review-reblock portion of #58695, while #61366 and #64585 address the same parentless-dependency cause with different terminal states. Suggested consolidationAuthor action: rebase #59367 onto current main while preserving its boolean-rejection tests and validated routing/event behavior; close #59536 and #59645 as duplicates of #59367 despite their keep_open reviews because their visible diffs retain the validation and default-registration defects above, and close #66909 as a duplicate of #59333. Keep #68027 open with its durable-fingerprint, audited-rearm, and automatic-path-guard salvage path; keep #59906, #61366/#64585, and #66632 in separately scoped salvage lanes addressing their recorded reviews, keep #60476 only after re-scoping it away from #59333, narrow #58695 to the review-reblock exemption unless an authorized ordered verdict source is added, retain #61372 only as the closed reference, and have #63723’s author split out a narrowly typed PASS-loop signal after reproducing the current-main gap rather than retaining the wildcard predicate and unsupported routing change. Cross-PR triage: Reviewed 13 pull requests and 2 issues in this complex. Each diff was read against this issue; Assessment working set: 301 kB of PR diffs, 27 kB of issue/PR text, 17 kB of discussion (19 comments), 10 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
Summary
hermes_cli/kanban_db.pytests/hermes_cli/test_kanban_block_kinds.pyandtests/hermes_cli/test_kanban_db.pypacket only935f429d8Scope / packet boundary
This PR is the governed ahmad-fork reland for the canonical PASS-loop core packet only.
Changed files:
hermes_cli/kanban_db.pytests/hermes_cli/test_kanban_block_kinds.pytests/hermes_cli/test_kanban_db.pyExplicitly excluded from this packet:
hermes_cli/config.pyAgent Wikis hunkstools/agentwiki_routing.pytools/web_tools.pyResearch / governance links
t_871aaa57/Users/alimai/.hermes/audits/t_871aaa57/pass-loop-core-upstream-research-2026-07-13.mdt_60619ea0/Users/alimai/.hermes/audits/t_60619ea0/pass-loop-core-reland-review-handoff-2026-07-13.md/Users/alimai/.hermes/audits/t_60619ea0/pass-loop-core-reland-review-addendum-2026-07-13.mdt_72710819/Users/alimai/.hermes/patches/README.mdline 77/Users/alimai/.hermes/patches/hermes-kanban-pass-loop-core-packet-a816df6f3-20260713.patchDuplicate / prior-art check
Checked before opening:
gh pr list --repo NousResearch/hermes-agent --author ahmadashfq --state all --search 'pass_loop_status OR pass loop OR review-required blocked OR completion blocked'#63589, but it is polluted and not safe as the clean packet reference#61372, which is adjacent prior art rather than a duplicate of durable PASS-loop persistencegh search prs 'pass_loop_status repo:NousResearch/hermes-agent' --state open#63589onlygh search issues 'pass_loop_status repo:NousResearch/hermes-agent'This clean PR supersedes the polluted PASS-loop presentation in
#63589for reviewer/governance purposes.Verification
Targeted packet verification on the clean PR worktree:
Results:
256 passed in 16.02sNo Windows footguns found (3 file(s) scanned).{'pass_loop_status': 'halted', 'pass_loop_count': 2, 'reason_code': 'pass-loop-detected'}Repo-wide validation note:
scripts/run_tests.shwas attempted from this clean PR worktree but timed out after 600s with unrelated pre-existing failures outside this packet.origin/mainworktree reproduced the same failure families outside this PR scope:tests/agent/test_anthropic_adapter.pytests/test_live_system_guard_self_test.pytests/tools/test_approval.pytests/tools/test_file_tools.pyPlatforms tested
Governance note
~/.hermes/hermes-agent/mainremains clean and unapplied pending review + founder tap./Users/alimai/.hermes/kanban/boards/fleet-infra/workspaces/t_6346f7ed/pass-loop-core-pr-openon branchfix/kanban-pass-loop-core-pr-t_e17419f0./Users/alimai/.hermes/kanban/boards/fleet-infra/workspaces/t_6346f7ed/pass-loop-core-relandon branchreland/pass-loop-t_60619ea0.