feat(WARDEN-WP-0020): worker drafts real route answers in dry-run (T3 groundwork)

build_plans now computes the concrete routing answer for each route_answer action
in-process (reuses the catalog; read-only, no subprocess/network) and render_plans
shows it as a `draft:` line. The dry-run demonstrates the actual answer the executor
(T3) will send, not just an intent. RuleBrain stays the default; the llm-connect brain
(T2) is gated on llm-connect being operational + its /execute contract.

230 tests, lint clean. Live dry-run verified against the real inbox.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-29 22:42:54 +02:00
parent 706674d784
commit 4287eccc80
2 changed files with 45 additions and 2 deletions

View File

@@ -92,6 +92,13 @@ def test_safe_reply_passes_guardrail():
# --- rendering ---------------------------------------------------------------
def test_build_plans_attaches_route_answer():
# The npm question resolves against the real catalog → a concrete drafted answer.
[plan] = build_plans([_msg(subject="where do I get an npm token?")], RuleBrain())
assert plan.actions and plan.actions[0].kind == "route_answer"
assert plan.actions[0].payload.get("answer") # non-empty computed answer
def test_render_empty():
assert "inbox empty" in render_plans([])