{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://grokit.liftthesparks.com/grokit-record.schema.json",
  "title": "GROK'it portable diagnostic record",
  "description": "Version 1.0.0. A diagnostic that can leave GROK'it. Plain JSON, readable without GROK'it, printable as Markdown. License: MIT (see the code shelf page). Distilled fields first; depth fields are optional.",
  "type": "object",
  "required": ["schema", "reference", "problem", "facts", "tests", "unknown", "road", "act", "receipt"],
  "properties": {
    "schema": { "const": "grokit-record/1" },
    "reference": { "type": "string", "pattern": "^GK-[2-9A-HJKMNP-Z]{5}$", "description": "The GK reference given at intake." },
    "problem": {
      "type": "object", "required": ["brought", "found"],
      "properties": {
        "brought": { "type": "string", "description": "What you brought, in your words." },
        "found": { "type": "string", "description": "What is actually wrong, in one plain sentence." }
      }
    },
    "facts": {
      "type": "object", "required": ["known"],
      "properties": {
        "known": { "type": "array", "items": { "type": "string" }, "description": "Shown by a source or a test." },
        "assumed": { "type": "array", "items": { "type": "string" }, "description": "Believed, not yet shown." }
      }
    },
    "sources": {
      "type": "array",
      "items": { "type": "object", "required": ["what"], "properties": { "what": { "type": "string" }, "where": { "type": "string" }, "seen": { "type": "string", "format": "date-time" } } }
    },
    "tests": {
      "type": "array",
      "items": { "type": "object", "required": ["check", "result"], "properties": { "check": { "type": "string" }, "would_disprove": { "type": "string" }, "result": { "type": "string" } } }
    },
    "failed_line": { "type": "string", "description": "Where it breaks, or the likeliest failure." },
    "unknown": { "type": "array", "items": { "type": "string" } },
    "working_position": { "type": "string", "description": "The current best explanation, held until a test changes it." },
    "road": { "type": "array", "items": { "type": "object", "required": ["step"], "properties": { "step": { "type": "string" }, "needs": { "type": "string" }, "who": { "type": "string" } } } },
    "act": { "type": "string", "description": "The first act on the road." },
    "diy": { "type": "array", "items": { "type": "string" }, "description": "What you can do yourself." },
    "implementation": { "type": "string", "description": "What further implementation would require, quoted before any more work." },
    "receipt": {
      "type": "object", "required": ["status", "date"],
      "properties": {
        "status": { "enum": ["received", "reviewing", "needs-something", "response-sent", "closed"] },
        "date": { "type": "string", "format": "date-time" },
        "wuqi": { "type": "number" }
      }
    }
  },
  "examples": [{
    "schema": "grokit-record/1",
    "reference": "GK-SAMP2",
    "problem": { "brought": "SYNTHETIC EXAMPLE. Contact form says sent, nothing arrives.", "found": "The form's mail sender is not authorized for the domain, so receiving servers drop it." },
    "facts": { "known": ["Form returns success.", "No message in inbox or spam."], "assumed": ["Nothing changed on the form itself."] },
    "sources": [{ "what": "Domain mail policy record", "where": "DNS" }],
    "tests": [{ "check": "Send one test and read the receiving server's verdict", "would_disprove": "Message arrives with authentication passing", "result": "Rejected: sender not authorized" }],
    "unknown": ["When the sending service last changed."],
    "road": [{ "step": "Authorize the form's sender in the domain's mail policy", "needs": "DNS access", "who": "domain owner" }, { "step": "Send one test and confirm arrival", "who": "anyone" }],
    "act": "Add the sending service to the domain's mail policy.",
    "receipt": { "status": "closed", "date": "2026-11-07T00:00:00Z", "wuqi": 144 }
  }]
}
