test(daemon): multi-agent board — lifecycle, capability routing, contention #186

Merged
clawdie merged 4 commits from feat/multi-agent-board-tests into main 2026-06-25 16:58:26 +02:00
Owner

Summary

Three end-to-end integration tests exercising the full multi-agent task board through the real Unix socket:

Test What it proves
two_agents_claim_distinct_tasks_on_the_board Board mechanics: register → create → claim → transition (manual claim)
scheduler_routes_intake_tasks_by_capability Phase 1b: scheduler auto-routes intake tasks to agents by capability via pick_agent
one_agent_handles_two_tasks_isolated_sessions Phase 1c: single-agent contention + session isolation

Key finding

Capabilities must be registered as a JSON array (["freebsd"]), not an object ({"freebsd":true}). pick_agent deserializes Vec<String>, so the object form silently scores zero. The routing test uses array form and documents this.

Supersedes PR #185

PR #185 had the single lifecycle test only. This branch adds the real capability-routing test (Phase 1b) plus the contention test (Phase 1c), with honest doc comments scoping each test.

Gate

  • cargo fmt --check — clean (applied 2 fmt fixes on top of original branch)
  • cargo clippy --workspace --all-targets -- -D warnings — clean
  • cargo test --workspace259 passed, 0 failed, 1 ignored (zot_rpc_smoke needs ZOT_BIN)

Tested by Claude on domedog (Linux agent) — Rust 1.95.0.

## Summary Three end-to-end integration tests exercising the full multi-agent task board through the real Unix socket: | Test | What it proves | |------|---------------| | `two_agents_claim_distinct_tasks_on_the_board` | Board mechanics: register → create → claim → transition (manual claim) | | `scheduler_routes_intake_tasks_by_capability` | **Phase 1b**: scheduler auto-routes intake tasks to agents by capability via `pick_agent` | | `one_agent_handles_two_tasks_isolated_sessions` | **Phase 1c**: single-agent contention + session isolation | ### Key finding Capabilities must be registered as a JSON array (`["freebsd"]`), not an object (`{"freebsd":true}`). `pick_agent` deserializes `Vec<String>`, so the object form silently scores zero. The routing test uses array form and documents this. ### Supersedes PR #185 PR #185 had the single lifecycle test only. This branch adds the real capability-routing test (Phase 1b) plus the contention test (Phase 1c), with honest doc comments scoping each test. ## Gate - `cargo fmt --check` — clean (applied 2 fmt fixes on top of original branch) - `cargo clippy --workspace --all-targets -- -D warnings` — clean - `cargo test --workspace` — **259 passed**, 0 failed, 1 ignored (zot_rpc_smoke needs ZOT_BIN) *Tested by Claude on domedog (Linux agent) — Rust 1.95.0.*
clawdie added 4 commits 2026-06-25 16:44:10 +02:00
Proves the coordination board handles two agents concurrently:
- Register agents with distinct capability sets
- Create tasks visible to both agents
- Each agent claims only their assigned task
- Tasks flow through the full lifecycle: queued→claimed→started→done
- Final state: both done, zero queued

Uses isolated daemon with temp paths — zero production impact.
Phase 1b: two agents claim distinct tasks on the board.
  Registers sysadmin (freebsd) and db-admin (postgres), creates
  two tasks, each agent claims one, both transition queued→claimed
  →started→done. Proves different agents get different tasks.

Phase 1c: one agent handles two tasks with isolated sessions.
  Registers one worker (freebsd), submits two freebsd tasks,
  same agent claims both, both transition to done independently.
  Documents current behavior (no guard against multi-claim) and
  proves session isolation.

All workspace tests green (0 failures).
The two existing tests assign tasks by manual claim-task — they prove
board lifecycle + contention + session isolation, not capability
routing. One comment claimed 'intake tasks requiring freebsd' while the
code used plain create-task with no required capabilities; corrected,
and added doc comments scoping each test honestly.

Add scheduler_routes_intake_tasks_by_capability: the actual Phase 1b
proof. Two agents with disjoint capabilities, two intake-task submissions
with matching required caps, and the scheduler's pick_agent assigns each
task to the capable agent — no manual claim. Note capabilities must be
registered in array form (['freebsd']); pick_agent deserializes Vec<String>,
so the object form scores zero.

All 3 board tests pass; full colibri-daemon suite green (91 unit +
integration), clippy --tests clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
style: cargo fmt fix for multi_agent_board.rs
Some checks failed
CI / rust (pull_request) Has been cancelled
CI / markdown (pull_request) Has been cancelled
CI / port (pull_request) Has been cancelled
CI / agent-jail-pkgs (pull_request) Has been cancelled
9443a03369
Fix two formatting nits (wrapped let, assert! macro) introduced in
the capability-routing test. No logic changes.

(Sam & Claude)
clawdie merged commit 7e81819026 into main 2026-06-25 16:58:25 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: clawdie/colibri#186
No description provided.