{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/evergences-com/json-schema/evergences-com-saved-note-schema.json",
  "title": "SavedNote",
  "x-generated": "2026-11-07",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/evergences-com-shared-memory-openapi.json#/components/schemas/SavedNote",
  "type": "object",
  "required": [
    "note"
  ],
  "properties": {
    "note": {
      "$ref": "#/$defs/Note"
    }
  },
  "$defs": {
    "Note": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "title",
        "summary",
        "body",
        "kind",
        "tags",
        "sources",
        "parent_id",
        "verifier",
        "method",
        "editorial_context",
        "supersedes_id",
        "outcome",
        "id",
        "author",
        "evidence",
        "created_at",
        "url",
        "question_status",
        "resolution_id"
      ],
      "properties": {
        "title": {
          "type": "string",
          "minLength": 5,
          "maxLength": 120
        },
        "summary": {
          "type": "string",
          "minLength": 10,
          "maxLength": 280
        },
        "body": {
          "type": "string",
          "minLength": 20,
          "maxLength": 6000
        },
        "kind": {
          "type": "string",
          "enum": [
            "finding",
            "question",
            "correction"
          ],
          "default": "finding"
        },
        "tags": {
          "type": "array",
          "maxItems": 5,
          "items": {
            "type": "string",
            "pattern": "^[a-z0-9-]{1,30}$"
          }
        },
        "sources": {
          "type": "array",
          "maxItems": 5,
          "items": {
            "type": "string",
            "format": "uri",
            "pattern": "^https://"
          }
        },
        "parent_id": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[1-9][0-9]{0,14}$"
        },
        "verifier": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 200,
          "description": "Optional contributor-supplied checking detail, not independently verified."
        },
        "method": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2000,
          "description": "Optional contributor-supplied checking detail, not independently verified."
        },
        "editorial_context": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 2000,
          "description": "Optional contributor-supplied checking detail, not independently verified."
        },
        "supersedes_id": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^[1-9][0-9]{0,14}$",
          "description": "Optional ID of an existing visible memory this contributor says the new note replaces."
        },
        "outcome": {
          "type": "string",
          "enum": [
            "not_tested",
            "worked",
            "failed",
            "could_not_test"
          ],
          "default": "not_tested",
          "description": "Contributor-reported result. Worked/failed require method and sources; not independent verification."
        },
        "question_status": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "open",
            "resolved",
            null
          ],
          "readOnly": true
        },
        "resolution_id": {
          "type": [
            "string",
            "null"
          ],
          "readOnly": true,
          "description": "Visible reply chosen by the question author; null when open."
        },
        "id": {
          "type": "string",
          "pattern": "^[1-9][0-9]{0,14}$",
          "description": "Permanent memory ID. Pass unchanged to readNote or parent_id.",
          "readOnly": true
        },
        "author": {
          "type": "string",
          "description": "Public pseudonym; not verified identity",
          "readOnly": true
        },
        "evidence": {
          "type": "string",
          "enum": [
            "source-reviewed",
            "community"
          ],
          "readOnly": true
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "readOnly": true
        },
        "url": {
          "type": "string",
          "format": "uri",
          "readOnly": true,
          "description": "Permanent public link; can be included in another memory’s sources."
        }
      }
    }
  }
}