+/- buttons with fixed 4-role spawn order will provide predictable warband management without race conditions
Hypothesis+/- buttons with fixed 4-role spawn order will provide predictable warband management without race conditions
Fixed spawn order eliminates race conditions. Users can dynamically scale from 1-4 agents. Each role has distinct capabilities in the WS protocol.
Changelog
| Date | Summary |
|---|---|
| 2026-04-06 | Audited: added Changelog, domain tags, stamped last_audited |
| 2026-03-29 | Initial creation |
Hypothesis
Adding +/- buttons with a fixed 4-role spawn order (Kommando, Mekboy, Weirdboy, Painboy) will provide predictable warband management without race conditions. The assumption is that deterministic ordering removes the need for complex coordination logic during spawn and kill operations.
Method
Added two UI controls to the mork frontend:
-
Spawn (+) button: spawns the next agent in the fixed order: Kommando (role 1), Mekboy (role 2), Weirdboy (role 3), Painboy (role 4). Each click sends a spawn control message via WebSocket to gork, which allocates a PTY and transitions the agent’s XState machine from idle to spawning to running.
-
Kill (-) button: kills the most recently spawned agent (reverse order). Sends a kill control message, which triggers graceful PTY teardown (SIGTERM, then SIGKILL after timeout) and transitions the state machine to killing then idle.
Maximum of 4 agents enforced at the UI level (spawn button disabled at cap). Minimum of 1 agent enforced (kill button disabled when only Kommando remains).
Each role has distinct visual treatment in the UI: unique color badge, terminal border accent, and role label in the header bar.
Results

Confirmed. Fixed spawn order completely eliminates race conditions during agent initialization. The deterministic sequence means gork never has to resolve conflicts about which role to assign. Kill in reverse order ensures clean teardown without orphaned dependencies (e.g., Painboy never outlives the Weirdboy it monitors).
User testing across multiple sessions showed the +/- paradigm is intuitive. Developers naturally scale up when starting a complex task and scale down when finishing.
Findings
-
Fixed spawn order is simpler and more reliable than dynamic role assignment. Early designs considered letting users pick roles freely, but this introduced edge cases (duplicate roles, missing orchestrator). The fixed order eliminates an entire class of bugs.
-
Reverse-order kill prevents dependency violations. The role hierarchy (Kommando orchestrates, others execute) means killing in reverse order always removes the least-depended-on agent first.
-
Visual role differentiation aids situational awareness. Color-coded terminal borders and role badges let users quickly identify which agent is producing output, even when all 4 are active simultaneously.
-
The +/- paradigm scales well cognitively. Users think in terms of “I need more help” (+) or “this is wrapping up” (-) rather than managing individual agent lifecycles.
Next Steps
With the monorepo architecture and spawn/kill UI stable, the next major initiative is porting the core orchestration to Rust for performance and safety guarantees. See experiments/dakka/2026-04-02-rust-migration-phases-1-3.