{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://helloorigo.com/trust/pocket-thought-list-v1.schema.json",
  "$comment": "Accepted by the user on 2026-10-08 for issue #946, together with the import contract and ADR-0024 amendment; runtime conformance is exercised by issue #946's shared synthetic corpus. UUID uniqueness, UTF-8 byte limits, calendar validity, and persistence rules additionally require the import contract.",
  "title": "Pocket Chronicle Thought List v1",
  "description": "Source-only import candidates. Supplied capture provenance and historical dates are assertions, not observations made by the importing phone. Optional materialKind declares synthetic/test content independently of imported origin; absence is unspecified, never proof of human authorship.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "format",
    "version",
    "records"
  ],
  "properties": {
    "format": {
      "const": "com.helloorigo.pocket-chronicle.thought-list"
    },
    "version": {
      "type": "integer",
      "const": 1
    },
    "records": {
      "type": "array",
      "maxItems": 1000,
      "items": {
        "$ref": "#/$defs/record"
      }
    }
  },
  "$defs": {
    "uuid": {
      "type": "string",
      "format": "uuid",
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
      "not": {
        "const": "00000000-0000-0000-0000-000000000000"
      }
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-5][0-9]\\.[0-9]{3}Z$",
      "description": "A valid Gregorian UTC timestamp, years 0001–9999, exactly three fractional digits. No leap seconds or timezone offsets."
    },
    "record": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "content",
        "captureSource",
        "sourceCapturedAt",
        "createdAt",
        "sourceSchemaVersion"
      ],
      "properties": {
        "id": {
          "$ref": "#/$defs/uuid"
        },
        "content": {
          "type": "string",
          "minLength": 1,
          "maxLength": 65536,
          "pattern": "[^\\u0009-\\u000d\\u0020\\u0085\\u00a0\\u1680\\u2000-\\u200a\\u2028\\u2029\\u202f\\u205f\\u3000]",
          "description": "Exact accepted Unicode text with at least one character outside Unicode White_Space. A separate UTF-8 byte-count check enforces the 65,536-byte limit; maxLength alone does not."
        },
        "captureSource": {
          "type": "string",
          "enum": [
            "typed_text",
            "voice_transcript"
          ],
          "description": "Supplied original articulation category, not a claim this phone observed typing, speech, or transcript approval. Synthetic examples are not evidence of human authorship."
        },
        "sourceCapturedAt": {
          "$ref": "#/$defs/timestamp"
        },
        "createdAt": {
          "$ref": "#/$defs/timestamp"
        },
        "sourceSchemaVersion": {
          "type": "integer",
          "const": 1
        },
        "materialKind": {
          "type": "string",
          "enum": [
            "unspecified",
            "synthetic"
          ],
          "description": "Optional declared source-material metadata, separate from captureSource and import origin. synthetic means explicitly designated generated/test content; unspecified or omission supplies no material-kind assertion. The importer does not infer authorship or synthetic status."
        }
      }
    }
  }
}
