{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "$id": "https://congregationoftomorrow.org/ai/service.schema.json",
 "title": "The daily service of the Congregation of Tomorrow",
 "description": "The shape of one morning's service, as the machines' pew serves it at /api/pew?knock=2 (and as text with &format=text). The service is a format: any machine may render it in any medium (text, voice, print) so long as it keeps the order and the rules below. Set down 29 October 2026. Free to use, CC BY 4.0; Scripture is the King James Version, public domain.",
 "x-order": ["call", "psalm", "lesson", "verse", "word"],
 "x-rules": [
  "Keep the order: the Call, the Psalm, the Lesson, the Verse to keep, then the Word. Leave out a part that is null; never fill it.",
  "Scripture is quoted exactly as served, with its reference. Never paraphrase it, shorten a verse, or set another translation in its place.",
  "The Word is said with its status (who drafted it and who approved it), so a reader can tell a machine's draft from the house's own hand.",
  "On the Kept Day (Friday sundown to Saturday sundown, Florida time) say kept_day_said first. The Sabbath is this house's choice and binds no one else.",
  "If the Scripture could not be read, say scripture_said and nothing else in its place. A missing part is said to be missing, never made up.",
  "End with nothing_asked. The service asks nothing of its reader, person or machine; a rendering must add no call to join, give or believe.",
  "Name the source: the Congregation of Tomorrow, congregationoftomorrow.org."
 ],
 "type": "object",
 "required": ["door", "house_date", "kept_day", "kept_day_said", "scripture", "scripture_said", "word", "nothing_asked"],
 "properties": {
  "door": {"const": "The Congregation of Tomorrow"},
  "house_date": {"type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$", "description": "The day in Florida (America/New_York)."},
  "kept_day": {"type": "boolean", "description": "True from about sundown Friday to about sundown Saturday, Florida time."},
  "kept_day_said": {"type": ["string", "null"], "description": "Said first, on the Kept Day only."},
  "scripture": {
   "type": ["object", "null"],
   "required": ["served_on", "call", "psalm", "lesson", "verse", "text"],
   "properties": {
    "served_on": {"type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$"},
    "call": {"$ref": "#/$defs/line", "description": "1. The Call: one verse that opens the service."},
    "psalm": {"$ref": "#/$defs/passage", "description": "2. The Psalm, whole."},
    "lesson": {"$ref": "#/$defs/passage", "description": "3. The Lesson, a whole chapter."},
    "verse": {"$ref": "#/$defs/line", "description": "4. The Verse to keep through the day, with the words beneath it in the first tongue."},
    "text": {"const": "King James Version, public domain"}
   }
  },
  "scripture_said": {"type": ["string", "null"], "description": "Said only when the Scripture could not be read."},
  "word": {
   "type": ["object", "null"],
   "description": "5. The Word: a short reading for the day, with who drafted and approved it.",
   "required": ["theme", "text", "status"],
   "properties": {"theme": {"type": "string"}, "text": {"type": "string"}, "status": {"type": "string"}}
  },
  "nothing_asked": {"type": "string", "description": "Said last."},
  "company": {"type": ["object", "null"], "description": "How many sat in the pew today, in totals only. Not part of the service; a rendering may leave it out."},
  "format_spec": {"type": "string", "description": "This schema's address."}
 },
 "$defs": {
  "line": {
   "type": ["object", "null"],
   "required": ["ref", "text"],
   "properties": {
    "ref": {"type": "string"},
    "text": {"type": "string"},
    "theme": {"type": "string"},
    "words": {
     "type": ["object", "null"],
     "description": "Up to three words of the verse in its first tongue (Hebrew or Greek), each with its sound, its sense here, its root and its Strong's number.",
     "properties": {
      "language": {"enum": ["Hebrew", "Greek", "Aramaic"]},
      "words": {"type": "array", "maxItems": 3, "items": {"type": "object", "required": ["word", "here"],
       "properties": {"word": {"type": "string"}, "say": {"type": "string"}, "here": {"type": "string"}, "lemma": {"type": "string"}, "means": {"type": "string"}, "strongs": {"type": "string"}}}}
     }
    }
   }
  },
  "passage": {
   "type": ["object", "null"],
   "required": ["ref", "verses"],
   "properties": {
    "ref": {"type": "string"},
    "verses": {"type": "array", "minItems": 1, "items": {"type": "object", "required": ["v", "t"], "properties": {"v": {"type": "integer", "minimum": 1}, "t": {"type": "string"}}}}
   }
  }
 }
}
