refactor(data): restructure content directory for galaxy scale

Replace flat content/districts/ with hierarchical campaign/system/
station/district structure. Path mirrors canonical IDs, enables
glob-based discovery, and is multi-campaign/DLC ready.

- git mv 46 files preserving history
- New metadata: campaign.yaml, system.yaml, station.yaml
- Rewrite content.yaml with glob-based district discovery
- Add campaign, system, station JSON schemas
- Update district schema: hierarchy fields derived from path
- Update npc-profile schema: accept district-scoped IDs
- Add TODO to 17 dialogue/monologue pool files for generator revision
- Update _meta/README.md with new hierarchy documentation

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-12 21:22:23 +01:00
co-authored by Claude Opus 4.6
parent 8cd7ef21ae
commit 9d53869ca7
73 changed files with 196 additions and 36 deletions
+44
View File
@@ -4,3 +4,47 @@ Directories prefixed with `_` are infrastructure, not game content. The server c
- `_meta/` — Infrastructure metadata (this directory)
- `_schema/` — JSON Schema validation files (draft 2020-12)
## Directory Hierarchy
Content is organized hierarchically to match the game universe:
```
content/
content.yaml # Manifest: campaign list, glob discovery patterns
global/ # Cross-campaign shared content (factions, enums, knowledge)
campaigns/
{campaign}/ # e.g., "main"
campaign.yaml
systems/
{system}/ # e.g., "krenn"
system.yaml
stations/
{station}/ # e.g., "sova"
station.yaml
districts/
{district}/ # e.g., "transit"
district.yaml
npcs/
locations/
triangles/
dialogue/
monologue/
routines/
templates/
```
## Canonical ID Derivation
Identity is derived from directory path at load time — no redundant ID fields in YAML.
- **District:** `{system}.{station}.{district}` (e.g., `krenn.sova.transit`)
- **NPC (within district):** `npc:{slug}` (e.g., `npc:kael-davan`)
- **NPC (cross-district):** `npc:{district}.{slug}` (e.g., `npc:transit.kael-davan`)
- **Location:** `{system}.{station}.{district}.location.{slug}`
## Content Discovery
The loader reads `content.yaml` for enabled campaigns and their glob patterns.
District discovery uses `systems/**/districts/*/district.yaml` — no per-district
manifest entry needed. Adding a district = creating a directory with district.yaml.
+22
View File
@@ -0,0 +1,22 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "campaign.schema.json",
"title": "Campaign Metadata",
"description": "Campaign definition file — one per campaign directory (D-003).",
"type": "object",
"required": ["display_name", "description"],
"additionalProperties": false,
"properties": {
"display_name": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string"
},
"version": {
"type": "string",
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$"
}
}
}
+9 -6
View File
@@ -2,15 +2,15 @@
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "district.schema.json",
"title": "District Metadata",
"description": "District definition file — one per district directory (D-036).",
"description": "District definition file — one per district directory (D-036). Identity derived from directory path.",
"type": "object",
"required": ["display_name", "system", "station", "district", "description", "locations", "npc_count"],
"required": ["display_name", "description", "locations", "npc_count"],
"additionalProperties": false,
"properties": {
"canonical_id": {
"type": "string",
"pattern": "^[a-z]+\\.[a-z]+\\.[a-z-]+$",
"description": "Optional — derived from directory path at load time. If present, must match {system}.{station}.{district}."
"description": "Deprecated — derived from directory path at load time. If present, must match {system}.{station}.{district}."
},
"display_name": {
"type": "string",
@@ -18,15 +18,18 @@
},
"system": {
"type": "string",
"pattern": "^[a-z]+$"
"pattern": "^[a-z]+$",
"description": "Deprecated — derived from directory path."
},
"station": {
"type": "string",
"pattern": "^[a-z]+$"
"pattern": "^[a-z]+$",
"description": "Deprecated — derived from directory path."
},
"district": {
"type": "string",
"pattern": "^[a-z-]+$"
"pattern": "^[a-z-]+$",
"description": "Deprecated — derived from directory path."
},
"description": {
"type": "string",
+3 -3
View File
@@ -9,8 +9,8 @@
"properties": {
"canonical_id": {
"type": "string",
"pattern": "^npc:[a-z][a-z0-9-]*$",
"description": "Short-form canonical ID: npc:{slug}"
"pattern": "^npc:([a-z][a-z0-9-]+\\.)?[a-z][a-z0-9-]*$",
"description": "Canonical ID: npc:{slug} (within district) or npc:{district}.{slug} (cross-district)"
},
"display_name": {
"type": "string",
@@ -167,7 +167,7 @@
"properties": {
"target": {
"type": "string",
"pattern": "^npc:[a-z][a-z0-9-]*$"
"pattern": "^npc:([a-z][a-z0-9-]+\\.)?[a-z][a-z0-9-]*$"
},
"kind": {
"type": "string",
+26
View File
@@ -0,0 +1,26 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "station.schema.json",
"title": "Station Metadata",
"description": "Station definition file — one per station directory (D-036).",
"type": "object",
"required": ["display_name"],
"additionalProperties": false,
"properties": {
"display_name": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string"
},
"districts": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]*$"
},
"uniqueItems": true
}
}
}
+26
View File
@@ -0,0 +1,26 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "system.schema.json",
"title": "Star System Metadata",
"description": "System definition file — one per system directory (D-036).",
"type": "object",
"required": ["display_name"],
"additionalProperties": false,
"properties": {
"display_name": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string"
},
"stations": {
"type": "array",
"items": {
"type": "string",
"pattern": "^[a-z][a-z0-9-]*$"
},
"uniqueItems": true
}
}
}
+7
View File
@@ -0,0 +1,7 @@
# Main Campaign metadata (D-003)
display_name: "The Settled Reach"
description: >
The core campaign. Set in a universe of wormhole-connected star systems,
neural lattice technology, and faction-driven politics. Occlusion-based
detective game with combat elements.
version: "0.1.0"
@@ -0,0 +1,2 @@
# TODO: Revise structure when automatic dialogue/monologue generators mature (D-028 Tier 2).
# Dialogue: ring-operative at Maintenance Corridors
@@ -0,0 +1,2 @@
# TODO: Revise structure when automatic dialogue/monologue generators mature (D-028 Tier 2).
# Dialogue: bar-owner at The Last Shift
@@ -0,0 +1,2 @@
# TODO: Revise structure when automatic dialogue/monologue generators mature (D-028 Tier 2).
# Dialogue: bar-regular at The Last Shift
@@ -0,0 +1,2 @@
# TODO: Revise structure when automatic dialogue/monologue generators mature (D-028 Tier 2).
# Dialogue: bartender at The Last Shift
@@ -0,0 +1,2 @@
# TODO: Revise structure when automatic dialogue/monologue generators mature (D-028 Tier 2).
# Dialogue: courier at The Terminal
@@ -0,0 +1,2 @@
# TODO: Revise structure when automatic dialogue/monologue generators mature (D-028 Tier 2).
# Dialogue: dock-worker at The Terminal
@@ -0,0 +1,2 @@
# TODO: Revise structure when automatic dialogue/monologue generators mature (D-028 Tier 2).
# Dialogue: new-hire at The Terminal
@@ -0,0 +1,2 @@
# TODO: Revise structure when automatic dialogue/monologue generators mature (D-028 Tier 2).
# Dialogue: scheduler at The Terminal
@@ -0,0 +1,2 @@
# TODO: Revise structure when automatic dialogue/monologue generators mature (D-028 Tier 2).
# Dialogue: shift-supervisor at The Terminal
@@ -1,10 +1,7 @@
# Sova Transit District metadata (D-036)
# Source of truth for identity: directory path (districts/sova-transit/).
# canonical_id is derived from the path at load time by ContentValidator.
# Identity derived from directory path: campaigns/main/systems/krenn/stations/sova/districts/transit/
# canonical_id: krenn.sova.transit (derived at load time by ContentValidator)
display_name: "Sova Transit District"
system: "krenn"
station: "sova"
district: "transit"
description: >
A 40-year-old prefab-modular-retrofitted freight logistics hub on Station Sova.
Three social sites: The Terminal (logistics hub), The Last Shift (bar),
@@ -0,0 +1,2 @@
# TODO: Revise structure when automatic dialogue/monologue generators mature (D-028 Tier 2).
# Monologue: detective at general
@@ -0,0 +1,2 @@
# TODO: Revise structure when automatic dialogue/monologue generators mature (D-028 Tier 2).
# Monologue: detective at maintenance-corridors
@@ -0,0 +1,2 @@
# TODO: Revise structure when automatic dialogue/monologue generators mature (D-028 Tier 2).
# Monologue: detective at the-last-shift
@@ -0,0 +1,2 @@
# TODO: Revise structure when automatic dialogue/monologue generators mature (D-028 Tier 2).
# Monologue: detective at the-terminal
@@ -0,0 +1,2 @@
# TODO: Revise structure when automatic dialogue/monologue generators mature (D-028 Tier 2).
# Monologue: smuggler at general
@@ -0,0 +1,2 @@
# TODO: Revise structure when automatic dialogue/monologue generators mature (D-028 Tier 2).
# Monologue: smuggler at maintenance-corridors
@@ -0,0 +1,2 @@
# TODO: Revise structure when automatic dialogue/monologue generators mature (D-028 Tier 2).
# Monologue: smuggler at the-last-shift
@@ -0,0 +1,2 @@
# TODO: Revise structure when automatic dialogue/monologue generators mature (D-028 Tier 2).
# Monologue: smuggler at the-terminal
@@ -0,0 +1,7 @@
# Station Sova metadata (D-036)
display_name: "Station Sova"
description: >
A freight logistics station in the Krenn system. 40-year-old prefab-modular
facility serving the span gate's cargo throughput. ~12,000 population.
districts:
- "transit"
@@ -0,0 +1,8 @@
# Krenn System metadata (D-036)
display_name: "Krenn System"
description: >
A mid-tier system connected via the Sova span gate. Industrial economy
centered on freight logistics and lattice component trade. ~2.4M population,
~180 years settled.
stations:
- "sova"
+8 -4
View File
@@ -1,7 +1,11 @@
# Content manifest — The Settled Reach v0.1
# The server reads this first to discover enabled districts and load order.
# The server reads this first to discover campaigns and content layout.
# District discovery uses glob patterns — no per-district listing needed.
version: "0.1.0"
districts:
- id: "sova-transit"
path: "districts/sova-transit"
campaigns:
- id: "main"
path: "campaigns/main"
enabled: true
discovery:
districts: "systems/**/districts/*/district.yaml"
@@ -1 +0,0 @@
# Dialogue: ring-operative at Maintenance Corridors
@@ -1 +0,0 @@
# Dialogue: bar-owner at The Last Shift
@@ -1 +0,0 @@
# Dialogue: bar-regular at The Last Shift
@@ -1 +0,0 @@
# Dialogue: bartender at The Last Shift
@@ -1 +0,0 @@
# Dialogue: courier at The Terminal
@@ -1 +0,0 @@
# Dialogue: dock-worker at The Terminal
@@ -1 +0,0 @@
# Dialogue: new-hire at The Terminal
@@ -1 +0,0 @@
# Dialogue: scheduler at The Terminal
@@ -1 +0,0 @@
# Dialogue: shift-supervisor at The Terminal
@@ -1 +0,0 @@
# Monologue: detective at general
@@ -1 +0,0 @@
# Monologue: detective at maintenance-corridors
@@ -1 +0,0 @@
# Monologue: detective at the-last-shift
@@ -1 +0,0 @@
# Monologue: detective at the-terminal
@@ -1 +0,0 @@
# Monologue: smuggler at general
@@ -1 +0,0 @@
# Monologue: smuggler at maintenance-corridors
@@ -1 +0,0 @@
# Monologue: smuggler at the-last-shift
@@ -1 +0,0 @@
# Monologue: smuggler at the-terminal
-1
View File
@@ -1 +0,0 @@
# Krenn System — regional metadata (D-036)