fix(kanban): require tool evidence before worker completion - #32940
fix(kanban): require tool evidence before worker completion#32940LeonSGP43 wants to merge 1 commit into
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for addressing the fabricated-completion path. The underlying gap remains on current main: tools/kanban_tools.py:626-632 completes a dispatcher worker without a non-kanban tool-evidence check.
Problems
- The new gate reads
SessionDB.get_messages()intools/kanban_tools.py:511-513. Those rows are durable history only (hermes_state.py:4016-4026); the agent flushes its in-memory messages through_persist_sessionatrun_agent.py:1678-1695, whose current call sites are after the CLI run returns. Therefore a valid live sequence such asread_filefollowed bykanban_completeis not yet visible to this query and would be auto-blocked. - The new tests seed
SessionDBbefore directly calling_handle_complete, so they do not cover that live ordering.
Suggested changes
- Source evidence from active-run tool activity, or explicitly persist it before evaluating the completion gate.
- Add an end-to-end same-run non-kanban-tool → completion test, alongside the no-tool-call rejection case.
Automated hermes-sweeper review.
| try: | ||
| kb, conn = _connect(board=board) | ||
| try: | ||
| if os.environ.get("HERMES_KANBAN_TASK") == tid: |
There was a problem hiding this comment.
This gate reads only persisted session rows, but the current agent flushes its in-memory tool-call messages via _persist_session after the CLI run returns (run_agent.py:1678-1695; call sites are in cli.py). A normal worker's read_file followed by kanban_complete in the same run therefore has no durable evidence yet and will be auto-blocked. Please source active-run activity or persist it before evaluating this gate.
|
I prepared a tested follow-up directly on this PR's author branch rather than opening a competing upstream PR:
It changes Kanban completion proof from tool-call intent to successful material execution evidence, with a metadata-only current-run receipt in Verification: 19 targeted Kanban, 24 Codex projector, and 58 Codex app-server session tests passed; Ruff, The separate product decision about a reasoning-only/no-tool completion exception remains intentionally with maintainers. |
|
Current-main refresh, kept separate from every other Kanban fix.
The bug still reproduced on that base: a worker could complete its card after emitting a tool-call intention without any successful material result. The refreshed patch records metadata-only evidence only after successful real Hermes/Codex tool completion, binds it to the current run, and leaves the card in flight on a protocol violation. Verification on the exact commit: RED reproduction observed; 13 focused tests passed; 123 tests across the touched files passed; the complete Kanban matrix passed with 509 passed, 0 failed, 1 Windows-only skip. Ruff, compileall, and This supersedes my older author-branch follow-up |
Summary
kanban_completewithout any prior non-kanban_*tool calls in their recorded sessionprotocol_violationevent for that path so operators can distinguish fabricated completion from an ordinary blockCloses #32746
Local proof
uv run --frozen --extra dev pytest tests/tools/test_kanban_tools.py -quv run --frozen --extra dev ruff check hermes_cli/kanban_db.py tools/kanban_tools.py tests/tools/test_kanban_tools.pygit diff --checkNotes
NousResearch/hermes-agentreturned 403 forLeonSGP43, so this PR is opened from the fork branch