{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "ai.stravica.knowledge.research/cost.schema.json",
  "title": "Research deep-mode run-cost report",
  "description": "cost.json at sessions/<sessionId>/cost.json — the finaliser's run-cost report from budget.spent()/total (deep-mode only; arch doc §4.2 phase 8). Absent for normal/light sessions. Validator: src/store/cost.mjs.",
  "type": "object",
  "additionalProperties": false,
  "required": ["agentCalls", "outputTokensSpent", "wallClockMinutes", "budgetTotal"],
  "properties": {
    "agentCalls": { "type": "integer", "minimum": 0, "description": "Number of agent() calls the run made." },
    "outputTokensSpent": { "type": "integer", "minimum": 0, "description": "Output tokens spent (budget.spent())." },
    "wallClockMinutes": { "type": "number", "minimum": 0, "description": "Wall-clock duration in minutes (may be fractional)." },
    "budgetTotal": {
      "type": ["integer", "null"],
      "minimum": 0,
      "description": "The token target passed by the harness (budget.total), or null when no target was set (arch §4.7)."
    }
  }
}
