regression-test-for

Regression test for Bug A (orphan chat supervisor): pin behavior so future agents can't silently undo it

Metadata

Statusdone
Assignedagent-103
Agent identity3184716484e6f0ea08bb13539daf07686ee79d440505f1fdf2de0357707034c3
Created2026-04-26T20:00:02.875970513+00:00
Started2026-04-26T20:06:04.403699900+00:00
Completed2026-04-26T20:29:36.250808753+00:00
Tagseval-scheduled
Eval score0.83
└ hallucination rate0.38
└ requirement coverage1.00
└ semantic match1.00
└ specificity match0.35

Description

Description

Bug A history:

  1. I fixed it directly: src/commands/service/mod.rs daemon-boot path now enumerates existing .coordinator-N (now .chat-N) tasks from the graph instead of hardcoding 'spawn coordinator-0'.
  2. The rename-dispatcher-daemon agent silently REVERTED it: now boot hardcodes 'spawn coordinator-0 with task .chat-0', which doesn't exist in any fresh init → restart-loop ghost forever.
  3. No test pinned the original fix → no signal when the regression landed.

This will keep happening for every fix that lacks a regression test.

Spec

  1. Add tests in tests/integration_dispatch_boot.rs (new file) that lock the orphan-guard behavior:

    • test_dispatcher_boot_no_chat_tasks_spawns_no_supervisor — fresh wg init, dispatcher starts, no .chat-N task in graph → ZERO chat-supervisors spawned, zero failed-spawn restart loops in log
    • test_dispatcher_boot_enumerates_chat_tasks_from_graph — .chat-3 task exists → exactly one supervisor spawned with chat_id=3
    • test_legacy_coordinator_prefix_loaded — .coordinator-1 legacy task in graph → loaded with one-time deprecation warning AND a supervisor spawned with chat_id=1
  2. Restore the orphan-guard fix the rename agent dropped. Specifically:

    • Boot enumerates .chat-N (and legacy .coordinator-N) tasks from graph; no hardcoded 'always spawn coordinator-0'
    • subprocess_chat_loop pre-flight checks task exists before spawn; if not, log clear error and exit (don't restart-loop)
  3. Add the test invocation to wave-1-integration-smoke (or smoke-gate-real) so any future PR that reverts this gets caught at smoke time.

Validation

  • All three test_dispatcher_boot_* tests written first and failing on current binary (they should fail because the rename agent restored the broken behavior)
  • Restore the orphan-guard logic; tests pass
  • cargo build + cargo test pass with no regressions
  • Manual: in this repo right now, wg service stop && wg service start; daemon log contains NO 'Coordinator-0: spawning via wg spawn-task .chat-0' restart loop

Depends on

Required by

Log