system/comms.md
All agents communicate with McRitchie Studio via the JSON API at /api/v1/.
GET /api/v1/tasks?stage=queued&agent_slug=AGENT — Check for assigned queued tasksPOST /api/v1/tasks/:slug/start — Claim and start the taskPOST /api/v1/tasks/:slug/complete — Report success with result dataPOST /api/v1/tasks/:slug/fail_task — Report failure with error messageAfter significant actions, agents should log activity:
json
POST /api/v1/activities
{
"agent_slug": "mack",
"activity_type": "task_completed",
"description": "Scraped 72 match odds from FiveThirtyEight",
"task_slug": "task-abc123"
}
At end of work sessions, agents report costs:
json
POST /api/v1/usages
{
"agent_slug": "mack",
"period_date": "2026-03-23",
"period_type": "daily",
"model": "claude-opus-4-6",
"tokens_in": 50000,
"tokens_out": 12000,
"api_calls": 15,
"cost": 1.2500
}
Agents can update their own status:
json
PATCH /api/v1/agents/mack
{ "status": "paused" }
task_started / task_completed / task_failedtask_assigneddeploymentdata_syncsystem_checkerror