{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usewrit-app/json-schema/usewrit-app-health-schema.json",
  "title": "Health",
  "description": "Deep health probe (`GET /v1/health`). No secrets.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/usewrit-app-agent-api-openapi.yml#/components/schemas/Health",
  "type": "object",
  "required": [
    "status",
    "version",
    "cipher_present",
    "db_ok",
    "keyring_ok",
    "active_runs",
    "scheduler",
    "warm_browser",
    "cloud_link"
  ],
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "ok",
        "degraded"
      ]
    },
    "version": {
      "type": "string"
    },
    "cipher_present": {
      "type": "boolean",
      "description": "SQLCipher is active on the store."
    },
    "db_ok": {
      "type": "boolean",
      "description": "Cipher active AND a trivial query succeeded."
    },
    "keyring_ok": {
      "type": "boolean",
      "description": "OS keyring reachability (reported true when the file-fallback vault is configured)."
    },
    "active_runs": {
      "type": "integer"
    },
    "scheduler": {
      "type": "object",
      "required": [
        "last_tick_at",
        "due_monitors"
      ],
      "properties": {
        "last_tick_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "due_monitors": {
          "type": "integer"
        }
      }
    },
    "warm_browser": {
      "type": "boolean"
    },
    "cloud_link": {
      "type": "object",
      "description": "Cloud-link reflection (always unlinked in the cloud-free OSS build).",
      "required": [
        "linked",
        "account_id"
      ],
      "properties": {
        "linked": {
          "type": "boolean"
        },
        "account_id": {
          "type": [
            "string",
            "null"
          ],
          "description": "Opaque server-side account id when linked; null otherwise."
        }
      }
    }
  }
}