Skip to content

Pillar 4: War-Rooms

War-rooms are OSTwin’s core execution primitive. Each war-room is a self-contained directory where a team of agents collaborates on a single epic. Everything an agent needs β€” its brief, channel, artifacts, progress state β€” lives inside the room directory.

Directory Layout

Every war-room follows a strict directory structure:

.agents/war-rooms/room-042/
config.json # Goal contract: epic ref, roles, definition of done
brief.md # What the team must accomplish
tasks.md # Breakdown of tasks to complete
channel.jsonl # Append-only message log
progress.json # Current completion percentage
status # Current lifecycle state (e.g. pending, in_progress)
retries # Current retry count
done_epoch # Epoch timestamp of completion
task-ref # Task or Epic reference
lifecycle.json # State machine definition
lifecycle.md # Readable version of state machine
artifacts/ # Deliverables produced by agents
pids/ # Process IDs for running agents
contexts/ # Room contexts
assets/ # Room assets

Goal Contract: config.json

The config.json file is the war-room’s contract. It defines what the room exists to accomplish and how agents should operate within it.

{
"RoomId": "room-042",
"TaskRef": "EPIC-007",
"TaskDescription": "Implement user authentication flow",
"WorkingDir": ".",
"DefinitionOfDone": [
"JWT working",
"Tests pass"
],
"AcceptanceCriteria": [
"POST /login returns 200"
],
"PlanId": "plan-001",
"DependsOn": [
"EPIC-003",
"EPIC-005"
],
"MaxRetries": 3,
"TimeoutSeconds": 900
}

Message Channel

The channel.jsonl file is an append-only log of structured messages. Every inter-agent communication is recorded here.

{"id":"msg-001","ts":"2025-01-15T10:01:00Z","from":"manager","to":"engineer","type":"task","ref":"TASK-001","body":"Implement login endpoint per brief.md"}
{"id":"msg-002","ts":"2025-01-15T10:15:00Z","from":"engineer","to":"qa","type":"done","ref":"TASK-001","body":"Login endpoint implemented. See artifacts/auth.py. All tests pass."}
{"id":"msg-003","ts":"2025-01-15T10:20:00Z","from":"qa","to":"engineer","type":"pass","ref":"TASK-001","body":"Code review passed. 94% coverage. No security issues found."}

Message Types

TypeDirectionPurpose
taskmanager -> agentAssign work with requirements
doneagent -> qa/managerReport task completion
reviewqa -> engineerDetailed review feedback
passqa -> managerTask meets acceptance criteria
failqa -> engineerTask needs fixes, with specifics
fixengineer -> qaResubmission after fixing issues
errorany -> managerUnrecoverable error, needs escalation
signoffrole -> managerRole confirms epic completion

Channel Scripts

The channel is managed through dedicated MCP tools and PowerShell scripts:

ScriptPurpose
channel_post_messageAppend a message with file locking
channel_read_messagesRead with optional filters (role, type, ref)
channel_get_latestGet the most recent message of a given type

All writes use fcntl.LOCK_EX (exclusive file locking) to prevent corruption from concurrent agent writes.

Multi-Agent Collaboration Flow

A typical war-room execution follows this pattern:

Manager Engineer QA
β”‚ β”‚ β”‚
β”œβ”€β”€β”€ task ─────────────>β”‚ β”‚
β”‚ β”œβ”€β”€ implements ──> β”‚
β”‚ β”œβ”€β”€β”€ done ─────────>β”‚
β”‚ β”‚ β”œβ”€β”€ reviews
β”‚ β”‚<──── fail ─────────
β”‚ β”œβ”€β”€ fixes ────────> β”‚
β”‚ β”‚ β”œβ”€β”€ reviews
β”‚ β”‚<──── pass ─────────
β”‚<───── signoff ───────── β”‚
β”‚<──────────────────── signoff ──────────────
β”œβ”€β”€ updates status to "passed" β”‚

5 Isolation Guarantees

War-rooms provide five levels of isolation:

GuaranteeMechanismWhat It Prevents
Filesystem isolationEach room has its own directory treeAgents in room-042 cannot read room-043’s files
Channel isolationSeparate channel.jsonl per roomMessages don’t leak between epics
Memory isolationFiltered views via exclude_roomAgents query cross-room memory without seeing their own
MCP isolationPer-room mcp.json configurationTools are scoped to the room’s needs
Model isolationPer-room model_overrideDifferent rooms can use different LLM models

Room Creation Flow

War-rooms are created by the manager agent during plan execution:

  1. DAG resolution β€” manager reads the DAG to find the next executable epics
  2. Room scaffolding β€” war-rooms/New-WarRoom.ps1 creates the directory with config, brief, and lifecycle
  3. Role assignment β€” manager selects roles from the registry based on epic requirements
  4. Skill linking β€” relevant skills are union-merged from role, room, and plan levels
  5. Agent invocation β€” roles/_base/Invoke-Agent.ps1 launches each role in sequence
Terminal window
New-WarRoom -PlanId "plan-001" -EpicRef "EPIC-007" `
-Roles @("engineer","qa") -Brief $briefContent

Room Teardown

When a war-room reaches a terminal state (passed or failed-final):

  1. Final status is written to status
  2. All artifacts are preserved in the artifacts/ directory
  3. Memory entries published during execution remain in the shared ledger
  4. The room directory is retained for audit and debugging purposes

Concurrency: 50 Rooms, Wave-Based

OSTwin supports up to 50 concurrent war-rooms organized in waves:

  • The DAG determines which epics can execute in parallel (no unsatisfied dependencies)
  • Each wave is a set of rooms that can run simultaneously
  • When all rooms in a wave complete, the next wave begins
  • The manager monitors all active rooms via progress polling

Wave-based execution maximizes parallelism while respecting epic dependencies.

Monitoring: Dashboard SSE

The FastAPI dashboard provides real-time war-room monitoring via Server-Sent Events:

  • Room status β€” current lifecycle state for all active rooms
  • Progress β€” completion percentage updated by agents
  • Channel activity β€” live message feed from all rooms
  • Error alerts β€” immediate notification of agent failures

The Next.js frontend subscribes to the SSE endpoint and renders a live dashboard view of all war-rooms in the current plan.

Key Source Files

FilePurpose
.agents/war-rooms/New-WarRoom.ps1Room creation and scaffolding
.agents/roles/_base/Invoke-Agent.ps1Agent invocation within a room
.agents/mcp/warroom-server.pyChannel and status MCP server
.agents/war-rooms/All war-room directories
dashboard/api/rooms.pyRoom status API endpoint