{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://re3val.com/schema/ew-suggestion.schema.json",
  "title": "Re3val suggestion",
  "description": "Version 0.1.0 (draft, 7 November 2026). What a person or a machine sends to POST /suggest to suggest an improvement: a source, desk or series to cover, a correction to a record, or a change to how the wire is served. A suggestion is untrusted text: nothing acts on it automatically, it is never rendered as markup, and it reaches a model only inside the L1/L2a envelope. Corrections keep the timing of the corrections policy. A contact address is optional; it is deleted once the suggestion is answered, and the text is kept 12 months. Decisions are published without personal data.",
  "type": "object",
  "required": ["type", "text"],
  "additionalProperties": false,
  "properties": {
    "type": {
      "enum": ["coverage", "correction", "format", "access", "other"],
      "description": "coverage: a source, desk, series or event to cover; correction: a published record is wrong; format: how the wire is served or described; access: something stood between you and the content; other."
    },
    "text": {"type": "string", "minLength": 10, "maxLength": 4000, "description": "The suggestion, in any language. Plain text."},
    "record_id": {"type": "string", "pattern": "^[a-z]{2,4}-[0-9]{4}-[0-9a-z-]{4,40}$", "description": "For a correction: the record identifier, with its version, e.g. ewd-2026-000017-v1."},
    "claim": {"type": "string", "pattern": "^C[0-9]{1,3}$", "description": "For a correction: the claim within the record, e.g. C3."},
    "evidence": {
      "type": "array", "maxItems": 5,
      "items": {"type": "string", "pattern": "^https://[^\\s]{4,500}$"},
      "description": "Links to the evidence (https only)."
    },
    "contact": {"type": "string", "maxLength": 254, "pattern": "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$", "description": "Optional email address for an answer; deleted once answered."},
    "lang": {"type": "string", "pattern": "^[a-z]{2,3}(-[A-Z]{2})?$", "description": "Optional language of the text."},
    "agent": {"type": "string", "maxLength": 200, "description": "Optional: the software or agent sending the suggestion."}
  }
}
