Files
settled-reach/content/_schema/routine.schema.json
T
jpmschweitzerandClaude Opus 4.6 ad55dfaa72 feat(data): add content schema definitions
JSON Schema (draft 2020-12) for content validation: district,
location, npc-profile, dialogue-pool, monologue-pool, triangle,
routine, and fact-catalog. NPC schema uses if/then conditional
for FRIEND pattern validation. Implements ticket #386.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 19:48:21 +01:00

104 lines
2.9 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "routine.schema.json",
"title": "NPC Routine Schedules",
"description": "Daily routine schedules — all NPCs in one file per district for cross-NPC validation (D-034).",
"type": "object",
"required": ["district", "schedules"],
"additionalProperties": false,
"properties": {
"district": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]*$",
"description": "District slug this routine file belongs to"
},
"schedules": {
"type": "array",
"items": { "$ref": "#/$defs/npc_schedule" },
"minItems": 1
}
},
"$defs": {
"npc_schedule": {
"type": "object",
"required": ["npc", "entries"],
"additionalProperties": false,
"properties": {
"npc": {
"type": "string",
"pattern": "^npc:[a-z][a-z0-9-]*$",
"description": "NPC short-form canonical ID"
},
"entries": {
"type": "array",
"items": { "$ref": "#/$defs/routine_entry" },
"minItems": 1
},
"deviations": {
"type": "array",
"items": { "$ref": "#/$defs/deviation" },
"description": "Conditional schedule overrides (FRIEND arc staging, etc.)"
}
}
},
"routine_entry": {
"type": "object",
"required": ["phase", "location"],
"additionalProperties": false,
"properties": {
"phase": {
"type": "string",
"enum": ["morning", "afternoon", "evening", "night"],
"description": "Day phase for this entry"
},
"location": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]*$",
"description": "Location slug"
},
"tile": {
"type": "object",
"properties": {
"x": { "type": "integer" },
"y": { "type": "integer" }
},
"required": ["x", "y"],
"description": "Specific tile coordinates within the location"
},
"activity": {
"type": "string",
"description": "What the NPC is doing at this location/time"
}
}
},
"deviation": {
"type": "object",
"required": ["trigger", "location"],
"additionalProperties": false,
"properties": {
"trigger": {
"type": "string",
"description": "Condition that activates this deviation"
},
"phase": {
"type": "string",
"enum": ["morning", "afternoon", "evening", "night"]
},
"location": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]*$"
},
"tile": {
"type": "object",
"properties": {
"x": { "type": "integer" },
"y": { "type": "integer" }
},
"required": ["x", "y"]
},
"activity": { "type": "string" }
}
}
}
}