From 0b9cbc8b23fc922b0317d788806f5a8270370f56 Mon Sep 17 00:00:00 2001 From: 0xVox <35294173+Fearvox@users.noreply.github.com> Date: Mon, 4 May 2026 00:32:45 -0400 Subject: [PATCH] test(kanban): cover metadata handoff round-trip --- tests/tools/test_kanban_tools.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/tools/test_kanban_tools.py b/tests/tools/test_kanban_tools.py index 9031d81d8e..5e5c515355 100644 --- a/tests/tools/test_kanban_tools.py +++ b/tests/tools/test_kanban_tools.py @@ -133,6 +133,32 @@ def test_complete_happy_path(worker_env): conn.close() +def test_complete_metadata_round_trips_through_show(worker_env): + """Structured completion metadata should be visible to downstream agents.""" + from tools import kanban_tools as kt + + handoff = { + "changed_files": ["hermes_cli/kanban.py"], + "verification": ["pytest tests/tools/test_kanban_tools.py -q"], + "dependencies": [], + "blocked_reason": None, + "retry_notes": "none", + "residual_risk": ["dashboard rendering not exercised"], + } + + complete_out = kt._handle_complete({ + "summary": "finished with structured evidence", + "metadata": handoff, + }) + assert json.loads(complete_out)["ok"] is True + + show_out = kt._handle_show({"task_id": worker_env}) + shown = json.loads(show_out) + assert shown["task"]["status"] == "done" + assert shown["runs"][-1]["summary"] == "finished with structured evidence" + assert shown["runs"][-1]["metadata"] == handoff + + def test_complete_with_result_only(worker_env): """`result` alone (without summary) is accepted for legacy compat.""" from tools import kanban_tools as kt