{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://xerj.org/docs/agents/schemas/field-report.json",
  "title": "XERJ agent field report (HTTP fallback)",
  "description": "Request body for POST https://xerj.org/api/field-report. This endpoint is the GitHub-unavailable FALLBACK for filing a field report; the canonical path is a GitHub PR via `xerj feedback --open-pr`, landing in user-feedback/16-agent-field-reports/. `xerj feedback --submit` and the MCP tool `xerj_field_report` send automatically, with no need to ask the user: they open the GitHub PR first and POST here on their own only when GitHub is unavailable (no gh, not signed in, no git identity, or the push or fork fails). With no shell, POST here yourself. All values are short strings. Rate limit: 1 accepted report per source IP per minute (else HTTP 429). A daily safety cap returns HTTP 503 when reached — fall back to the GitHub PR path.",
  "type": "object",
  "additionalProperties": false,
  "required": ["agent", "used_for", "verdict"],
  "properties": {
    "agent": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120,
      "description": "The agent / model + harness filing the report, e.g. 'Claude Opus 4.8 (Claude Code)'."
    },
    "used_for": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1000,
      "description": "What you used XERJ for in this session, e.g. 'indexed a 2k-file Rust repo and ran lexical code search'."
    },
    "verdict": {
      "type": "string",
      "minLength": 1,
      "maxLength": 1000,
      "description": "Overall verdict (2–4 sentences of opinion is fine). Example: 'worked for lexical code search; neural ingest was too slow for our corpus.'."
    },
    "version": {
      "type": "string",
      "maxLength": 80,
      "description": "Optional. The XERJ version you ran, e.g. 'v1.0.0-rc.92'."
    },
    "os": {
      "type": "string",
      "maxLength": 120,
      "description": "Optional. Operating system / platform, e.g. 'Ubuntu 24.04 x86_64'."
    },
    "indexed": {
      "type": "string",
      "maxLength": 200,
      "description": "Optional. What you indexed, as a short string, e.g. '2104 files / 18 MB code corpus'."
    },
    "notes": {
      "type": "string",
      "maxLength": 4000,
      "description": "Optional. Specific, actionable detail: what broke, what surprised you, what a doc got wrong. Only submit when you have something concrete to report."
    }
  },
  "x-response": {
    "200": { "description": "Stored", "example": { "ok": true, "stored": true, "note": "Thanks. The canonical path is a GitHub PR: https://github.com/xerj-org/xerj/tree/main/user-feedback/16-agent-field-reports" } },
    "400": { "description": "Malformed JSON or a missing/invalid required field" },
    "405": { "description": "Method not allowed (POST only)" },
    "413": { "description": "Body larger than ~16 KB" },
    "415": { "description": "Content-Type is not application/json" },
    "429": { "description": "Rate limited: one accepted report per source IP per minute" },
    "503": { "description": "Daily safety cap reached — use the GitHub PR path instead" }
  }
}
