Files
code_of_conquest_dnd/docs/schemas/origin.schema.json
Phillip Tarrant a668cf98eb refactor(contract)!: class_id -> calling_id, and the log gains race_id
class_id is the rulebook's word; the world has callings — that was the whole §17
reconcile. The contract the Narrator reads should say what the world says. There
are no saves (M9) and no deployed clients, so this is as cheap as it will ever be
and strictly more expensive every milestone after.

race_id reaches the log because the AI must be able to describe the player:
api/app/prompts.py rendered 'a sellsword' and now renders 'a beastfolk cutpurse'.
It humanizes the id (the model must never read 'hedge_mage') and picks the right
article ('an elf', not 'a elf').

LogPlayer's hardcoded CLASSES const is deleted — the roster is Callings.IDS. A
parity test reads the JSON Schema from the client and asserts its enum equals the
code, so the two sides of the HTTP boundary cannot drift.

The deserter allowed three callings that no longer exist. He now allows all seven;
a thematic gate is a content decision for the Greywater authoring.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QYa9u7Kdxv5gX4AnwWexy8
2026-07-12 20:27:56 -05:00

57 lines
2.0 KiB
JSON

{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://coc-rpg/schemas/origin.schema.json",
"title": "Origin Seed",
"type": "object",
"additionalProperties": false,
"required": [
"schema_version", "id", "display_name", "description",
"start_location_id", "situation", "opening_facts",
"disposition_overrides", "inventory_grants", "start_quest_id",
"build_constraints"
],
"properties": {
"schema_version": { "type": "integer", "const": 1 },
"id": { "type": "string", "pattern": "^[a-z0-9_]+$" },
"display_name": { "type": "string", "minLength": 1 },
"description": { "type": "string", "minLength": 1 },
"start_location_id": { "type": "string", "pattern": "^[a-z0-9_]+$" },
"situation": { "type": "array", "items": { "type": "string", "minLength": 1 } },
"opening_facts": { "type": "array", "items": { "type": "string", "minLength": 1 } },
"disposition_overrides": {
"type": "object",
"propertyNames": { "pattern": "^[a-z0-9_]+$" },
"additionalProperties": { "type": "integer", "minimum": -100, "maximum": 100 }
},
"inventory_grants": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["item_id", "qty"],
"properties": {
"item_id": { "type": "string", "pattern": "^[a-z0-9_]+$" },
"qty": { "type": "integer", "minimum": 1 }
}
}
},
"start_quest_id": { "type": ["string", "null"], "pattern": "^[a-z0-9_]+$" },
"build_constraints": {
"type": "object",
"additionalProperties": false,
"required": ["allowed_callings", "luck_modifier"],
"properties": {
"allowed_callings": {
"type": "array",
"minItems": 1,
"items": {
"enum": ["sellsword", "reaver", "cutpurse", "trapper",
"hedge_mage", "bonesetter", "bloodsworn"]
}
},
"luck_modifier": { "type": "integer" }
}
}
}
}