feat(content): migrate line IDs to NPC-scoped namespace (D-035)

Line IDs in all dialogue and monologue pool files renamed from the
old location-scoped format (e.g. the-terminal_d_039) to the new
NPC-scoped format (e.g. kael-davan_d_001) per the D-035 Sprint 15
amendment.

Changes:
- 20 dialogue pool files across 3 locations renamed
- 14 monologue pool files (detective + smuggler) renamed
- Schema descriptions updated in dialogue/monologue schema files
- Authoring style guide and design docs updated with new examples
- Multi-location NPCs (kael-davan, pc-detective, pc-smuggler) given
  globally unique cross-file sequences to satisfy XREF uniqueness check

The location-scoped scheme already caused a collision (the-terminal_d_039
appearing in multiple NPC files) and would not scale to procedurally
generated NPC populations (D-029). Zero content changes — pure ID
substitution.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-23 21:04:43 +01:00
co-authored by Claude Sonnet 4.6
parent 41e3b4a9b3
commit c056ea1a1c
45 changed files with 813 additions and 813 deletions
+17 -17
View File
@@ -157,33 +157,33 @@ All lines in pool
location: the-last-shift
role: dock-worker
lines:
- id: the-last-shift_d_001
- id: kael-davan_d_001
text: "Saved you a seat. Lera's got the spiced rice tonight."
role: dock-worker
access: [insider, peer]
trust: surface
situation: [bar_evening, social, arrival]
mood: [fond]
mood: [warm]
topic: [personal, colleague]
tags: [kael, greeting, phase-1]
- id: the-last-shift_d_010
- id: kael-davan_d_010
text: "Nils wants to talk. Tomorrow, bay side. Said it's about volume."
role: dock-worker
access: [insider]
trust: real
situation: [bar_evening, social]
mood: [concerned]
mood: [anxious]
topic: [danger]
tags: [kael, ring-ops, nils]
- id: the-last-shift_d_012
- id: kael-davan_d_012
text: "Lera knows more than she lets on. She won't say anything — but don't test it."
role: dock-worker
access: [insider]
trust: real
situation: [bar_evening, social, alone]
mood: [concerned]
mood: [anxious]
topic: [colleague, danger]
tags: [kael, ring-ops, lera, caution]
knowledge_grant:
@@ -291,13 +291,13 @@ character: detective
location: the-last-shift
lines:
# Basic atmospheric line — no prerequisites, any visit
- id: the-last-shift_m_d_001
- id: pc-detective_m_d_001
text: "The Last Shift. Only place in this district that doesn't smell like freight lubricant."
trigger: enter_location
tags: [arrival, atmospheric]
# Knowledge-gated observation — requires prior suspicion
- id: the-last-shift_m_d_021
- id: pc-detective_m_d_021
text: "Sera left when Torek arrived. Second time. Different excuse. Same result."
trigger: observe_anomaly
prerequisites:
@@ -308,7 +308,7 @@ lines:
tags: [npc, sera, torek, tell, friend-arc]
# Relationship-gated line — requires person_of_interest status
- id: the-last-shift_m_d_026
- id: pc-detective_m_d_026
text: "Same booth. Same warm smile. Same offer to buy me a drink. Everything except the truth."
trigger: observe_npc
prerequisites:
@@ -326,15 +326,15 @@ lines:
### 5.1 Pattern
```
{location-slug}_{type}_{character?}_{sequence}
{npc-slug}_{type}_{character?}_{sequence}
```
| Segment | Format | Values | Example |
|---------|--------|--------|---------|
| `location-slug` | kebab-case | Matches location directory name, or `general` | `the-last-shift`, `general` |
| `npc-slug` | kebab-case | NPC name in kebab-case. Each NPC has an independent sequence. | `kael-davan`, `dock-worker`, `pc-detective` |
| `type` | single char | `d` = dialogue, `m` = monologue, `e` = environmental (future) | `d`, `m` |
| `character` | single char | `s` = smuggler, `d` = detective. **Monologue only.** | `s`, `d` |
| `sequence` | 3-digit zero-padded | `001``999` | `001`, `042` |
| `sequence` | 3-digit zero-padded | `001``999` per NPC | `001`, `042` |
**General validation regex** (matches both dialogue and monologue IDs):
@@ -342,26 +342,26 @@ lines:
^[a-z0-9-]+_(d|m)(_[a-z])?_\d{3}$
```
- `[a-z0-9-]+`location slug (kebab-case, at least one character)
- `[a-z0-9-]+`npc slug (kebab-case, at least one character)
- `(d|m)` — pool type: `d` for dialogue, `m` for monologue
- `(_[a-z])?` — optional character segment (monologue only): `_s` or `_d`
- `\d{3}` — three-digit zero-padded sequence number
Use the pool-specific regexes in [Section 5.2](#52-regex-patterns) for strict per-type validation. This general regex is useful for quick format checks that accept either type.
> **D-035 deviation note:** D-035 specifies `{template}_{d|m|e}_{###}`. This spec refines that to `{location-slug}_{d|m}_{###}` (dialogue) and `{location-slug}_m_{s|d}_{###}` (monologue) for two reasons: (1) location-slug is more precise than template name and matches the directory hierarchy, and (2) monologue IDs include a character segment (`s`/`d`) to ensure uniqueness across the hard character partition (D-032). All existing authored content already uses this refined format. D-035 should be updated to reflect the implemented convention.
> **D-035 Sprint 15 amendment:** IDs are NPC-scoped, not location-scoped. The old `{location-slug}_{d|m}_{###}` format caused collisions when the same NPC appeared at multiple locations (e.g. `the-terminal_d_039` appeared in multiple NPC files). The new format `{npc-slug}_{d|m}_{###}` gives each NPC an independent 999-line ceiling. Sequence restarts at `_001` per file; IDs are unique within a file.
### 5.2 Regex patterns
| Pool type | Regex | Example |
|-----------|-------|---------|
| Dialogue | `^[a-z][a-z0-9-]*_d_[0-9]{3}$` | `the-last-shift_d_001` |
| Monologue | `^[a-z][a-z0-9-]*_m_[sd]_[0-9]{3}$` | `the-last-shift_m_d_021`, `general_m_s_003` |
| Dialogue | `^[a-z][a-z0-9-]*_d_[0-9]{3}$` | `kael-davan_d_001` |
| Monologue | `^[a-z][a-z0-9-]*_m_[sd]_[0-9]{3}$` | `pc-detective_m_d_021`, `pc-smuggler_m_s_003` |
### 5.3 Uniqueness scope
- IDs must be unique **within a single YAML file**.
- IDs are **not required to be globally unique**location slug + file path provides global uniqueness. The engine uses `(file_path, line_id)` as the composite key.
- IDs are **not required to be globally unique**npc-slug + file path provides global uniqueness. The engine uses `(file_path, line_id)` as the composite key.
- Sequence numbers need not be contiguous. Gaps are expected when lines are removed or reordered.
### 5.4 ID stability
+4 -4
View File
@@ -234,10 +234,10 @@ All schema files live in `content/_schema/`. They use JSON Schema draft 2020-12.
| Content Type | ID Pattern | Example |
|---|---|---|
| Dialogue | `{location_slug}_{d}_{###}` | `the-terminal_d_001` |
| Monologue (smuggler) | `{location_slug}_m_s_{###}` | `the-terminal_m_s_001` |
| Monologue (detective) | `{location_slug}_m_d_{###}` | `the-terminal_m_d_001` |
| Examine | `{location_slug}_{e}_{###}` | `the-terminal_e_001` |
| Dialogue | `{npc-slug}_d_{###}` | `kael-davan_d_001` |
| Monologue (smuggler) | `{npc-slug}_m_s_{###}` | `pc-smuggler_m_s_001` |
| Monologue (detective) | `{npc-slug}_m_d_{###}` | `pc-detective_m_d_001` |
| Examine | `{npc-slug}_{e}_{###}` | `kael-davan_e_001` |
Line IDs are stable. They are never reused, even if a line is deleted. Numbering gaps are expected and acceptable.
+1 -1
View File
@@ -307,7 +307,7 @@ Social positioning in a specific context.
### Full YAML format (engine canonical)
```yaml
- id: transit_m_s_025
- id: pc-smuggler_m_s_025
character: smuggler
text: "Kael keeps checking his lattice. Waiting for a message? Not like him to be jumpy."
trigger: observe_anomaly
+2 -2
View File
@@ -226,7 +226,7 @@ Add `tags: [mirror_moment]` to both sides of every mirror pair so they can be id
```yaml
# Smuggler side — monologue-smuggler.yaml
- id: transit_m_s_044
- id: pc-smuggler_m_s_044
character: smuggler
trigger: observe_npc
prerequisite:
@@ -239,7 +239,7 @@ Add `tags: [mirror_moment]` to both sides of every mirror pair so they can be id
tags: [mirror_moment, mirror_worried_partner]
# Detective side — monologue-detective.yaml
- id: transit_m_d_044
- id: pc-detective_m_d_044
character: detective
trigger: observe_npc
prerequisite:
+7 -7
View File
@@ -359,7 +359,7 @@ skills:
```yaml
# File: districts/{location}/dialogue/{role}-mirror.yaml
- id: "{location}_d_001"
- id: "{npc-slug}_d_001"
text: "Greeting — warm, open, no guardedness"
role: "{role}"
access: ["public"]
@@ -367,7 +367,7 @@ skills:
situation: ["greeting"]
mood: ["warm"]
- id: "{location}_d_002"
- id: "{npc-slug}_d_002"
text: "Sharing worry — direct, no evasion"
role: "{role}"
access: ["public", "insider"]
@@ -375,7 +375,7 @@ skills:
situation: ["worried_inquiry"]
mood: ["anxious"]
- id: "{location}_d_010"
- id: "{npc-slug}_d_010"
text: "Deep emotional vulnerability — peer tier"
role: "{role}"
access: ["peer"]
@@ -385,8 +385,8 @@ skills:
# Monologue content (separate per character, per D-032)
# File: districts/{location}/monologue-smuggler.yaml
- id: "{location}_m_s_001"
# File: districts/{location}/monologue/smuggler/{location}.yaml
- id: "pc-smuggler_m_s_001"
text: "Smuggler feels guilt observing MIRROR's distress"
character: "smuggler"
trigger: "observe_npc"
@@ -394,8 +394,8 @@ skills:
target.known_attributes.name: "{Name}"
target.known_attributes.emotional_state: "worried"
# File: districts/{location}/monologue-detective.yaml
- id: "{location}_m_d_001"
# File: districts/{location}/monologue/detective/{location}.yaml
- id: "pc-detective_m_d_001"
text: "Detective recognizes MIRROR as honest witness"
character: "detective"
trigger: "post_conversation"
+27 -27
View File
@@ -32,7 +32,7 @@ All smuggler openings share:
These lines fire when the smuggler enters The Terminal at session start. 3-4 lines available; engine selects one based on seed variant.
```yaml
- id: transit_m_s_open_001
- id: pc-smuggler_m_s_001
character: smuggler
trigger: enter_location
location: the-terminal
@@ -40,7 +40,7 @@ These lines fire when the smuggler enters The Terminal at session start. 3-4 lin
mood: [content, routine]
tags: [opening_hook, canonical_anchor]
- id: transit_m_s_open_002
- id: pc-smuggler_m_s_002
character: smuggler
trigger: enter_location
location: the-terminal
@@ -48,7 +48,7 @@ These lines fire when the smuggler enters The Terminal at session start. 3-4 lin
mood: [routine, aware]
tags: [opening_hook]
- id: transit_m_s_open_003
- id: pc-smuggler_m_s_003
character: smuggler
trigger: enter_location
location: the-terminal
@@ -56,7 +56,7 @@ These lines fire when the smuggler enters The Terminal at session start. 3-4 lin
mood: [routine, observant]
tags: [opening_hook]
- id: transit_m_s_open_004
- id: pc-smuggler_m_s_004
character: smuggler
trigger: enter_location
location: the-terminal
@@ -70,7 +70,7 @@ These lines fire when the smuggler enters The Terminal at session start. 3-4 lin
These fire when the smuggler sees Kael on the dock floor. Critical FRIEND establishment lines.
```yaml
- id: transit_m_s_open_010
- id: pc-smuggler_m_s_010
character: smuggler
trigger: observe_npc
target: npc:kael-davan
@@ -82,7 +82,7 @@ These fire when the smuggler sees Kael on the dock floor. Critical FRIEND establ
mood: [content, fond]
tags: [opening_hook, friend_phase_1, canonical_anchor]
- id: transit_m_s_open_011
- id: pc-smuggler_m_s_011
character: smuggler
trigger: observe_npc
target: npc:kael-davan
@@ -104,7 +104,7 @@ These fire when the smuggler sees Kael on the dock floor. Critical FRIEND establ
**Operational context line (observe_anomaly — schedule board):**
```yaml
- id: transit_m_s_open_020
- id: pc-smuggler_m_s_020
character: smuggler
trigger: observe_anomaly
location: the-terminal
@@ -131,7 +131,7 @@ Kael greets the smuggler warmly. Asks about the weekend. Makes a dry comment abo
**Absence lines (observe_npc, failed — Kael's station empty):**
```yaml
- id: transit_m_s_open_030
- id: pc-smuggler_m_s_030
character: smuggler
trigger: observe_anomaly
location: the-terminal
@@ -140,7 +140,7 @@ Kael greets the smuggler warmly. Asks about the weekend. Makes a dry comment abo
tags: [opening_hook, variant_b]
notes: "Phase 1 tell: Kael's routine is so established that absence is noted before alarm."
- id: transit_m_s_open_031
- id: pc-smuggler_m_s_031
character: smuggler
trigger: time_idle
location: the-terminal
@@ -169,7 +169,7 @@ Kael arrives slightly disheveled, slightly out of breath. Brief explanation —
**Environmental read lines:**
```yaml
- id: transit_m_s_open_040
- id: pc-smuggler_m_s_040
character: smuggler
trigger: observe_npc
target: npc:voss
@@ -177,7 +177,7 @@ Kael arrives slightly disheveled, slightly out of breath. Brief explanation —
mood: [aware, cautious]
tags: [opening_hook, variant_c]
- id: transit_m_s_open_041
- id: pc-smuggler_m_s_041
character: smuggler
trigger: observe_npc
target: npc:voss
@@ -204,7 +204,7 @@ Kael arrives slightly disheveled, slightly out of breath. Brief explanation —
**Container flag lines:**
```yaml
- id: transit_m_s_open_050
- id: pc-smuggler_m_s_050
character: smuggler
trigger: observe_anomaly
location: the-terminal
@@ -212,7 +212,7 @@ Kael arrives slightly disheveled, slightly out of breath. Brief explanation —
mood: [operational, concerned]
tags: [opening_hook, variant_d]
- id: transit_m_s_open_051
- id: pc-smuggler_m_s_051
character: smuggler
trigger: observe_anomaly
location: the-terminal
@@ -245,7 +245,7 @@ All detective openings share:
Lines that fire when the detective enters their starting location. Selection based on seed variant.
```yaml
- id: transit_m_d_open_001
- id: pc-detective_m_d_001
character: detective
trigger: enter_location
location: the-terminal
@@ -253,7 +253,7 @@ Lines that fire when the detective enters their starting location. Selection bas
mood: [professional, observant]
tags: [opening_hook, canonical_anchor]
- id: transit_m_d_open_002
- id: pc-detective_m_d_002
character: detective
trigger: enter_location
location: the-terminal
@@ -262,7 +262,7 @@ Lines that fire when the detective enters their starting location. Selection bas
tags: [opening_hook, canonical_anchor]
notes: "Companion line to open_001 — these fire in sequence on Variant A/B/C."
- id: transit_m_d_open_003
- id: pc-detective_m_d_003
character: detective
trigger: enter_location
location: the-last-shift
@@ -270,7 +270,7 @@ Lines that fire when the detective enters their starting location. Selection bas
mood: [professional, curious]
tags: [opening_hook, variant_a_bar]
- id: transit_m_d_open_004
- id: pc-detective_m_d_004
character: detective
trigger: enter_location
location: the-terminal
@@ -284,7 +284,7 @@ Lines that fire when the detective enters their starting location. Selection bas
Critical FRIEND establishment for the detective.
```yaml
- id: transit_m_d_open_010
- id: pc-detective_m_d_010
character: detective
trigger: observe_npc
target: npc:sera-venn
@@ -296,7 +296,7 @@ Critical FRIEND establishment for the detective.
mood: [relieved, warm]
tags: [opening_hook, friend_phase_1, canonical_anchor]
- id: transit_m_d_open_011
- id: pc-detective_m_d_011
character: detective
trigger: observe_npc
target: npc:sera-venn
@@ -322,7 +322,7 @@ Critical FRIEND establishment for the detective.
**Bar arrival line:**
```yaml
- id: transit_m_d_open_020
- id: pc-detective_m_d_020
character: detective
trigger: enter_location
location: the-last-shift
@@ -334,7 +334,7 @@ Critical FRIEND establishment for the detective.
**Lera read (public NPC, establishing social texture):**
```yaml
- id: transit_m_d_open_021
- id: pc-detective_m_d_021
character: detective
trigger: observe_npc
target: npc:lera-sessik
@@ -363,7 +363,7 @@ Sera gives a brief district overview — who the regulars are, what the Terminal
**Terminal read line:**
```yaml
- id: transit_m_d_open_030
- id: pc-detective_m_d_030
character: detective
trigger: enter_location
location: the-terminal
@@ -375,7 +375,7 @@ Sera gives a brief district overview — who the regulars are, what the Terminal
**Voss approach (first adversarial NPC):**
```yaml
- id: transit_m_d_open_031
- id: pc-detective_m_d_031
character: detective
trigger: observe_npc
target: npc:voss
@@ -406,7 +406,7 @@ Standard question options: "Thank you, I'll need those." / "Tell me about your s
**Investigative focus line:**
```yaml
- id: transit_m_d_open_040
- id: pc-detective_m_d_040
character: detective
trigger: enter_location
location: the-terminal
@@ -414,7 +414,7 @@ Standard question options: "Thank you, I'll need those." / "Tell me about your s
mood: [analytical, focused]
tags: [opening_hook, variant_c]
- id: transit_m_d_open_041
- id: pc-detective_m_d_041
character: detective
trigger: observe_anomaly
location: the-terminal
@@ -436,7 +436,7 @@ Standard question options: "Thank you, I'll need those." / "Tell me about your s
**Escort read lines:**
```yaml
- id: transit_m_d_open_050
- id: pc-detective_m_d_050
character: detective
trigger: observe_npc
target: npc:torek-lintar
@@ -444,7 +444,7 @@ Standard question options: "Thank you, I'll need those." / "Tell me about your s
mood: [professional, curious]
tags: [opening_hook, variant_d]
- id: transit_m_d_open_051
- id: pc-detective_m_d_051
character: detective
trigger: observe_npc
target: npc:torek-lintar
@@ -188,7 +188,7 @@ XREF ERROR: dialogue location "the-warehouse" not in district
```
XREF ERROR: unknown fact_id "investigation.unknown_fact"
In: campaigns/main/.../dialogue/the-terminal/kael-davan.yaml
Line: the-terminal_d_099
Line: kael-davan_d_099
Canonical fact_ids: 42 defined in content/global/knowledge/
```
@@ -228,7 +228,7 @@ XREF WARNING: npc_count mismatch in transit district
#### Check 8: Dialogue line ID uniqueness within pool
**What:** Each dialogue line has an `id` field (e.g., `the-terminal_d_001`). IDs MUST be unique within each dialogue file.
**What:** Each dialogue line has an `id` field (e.g., `kael-davan_d_001`). IDs MUST be unique within each dialogue file.
**Where:** `content/campaigns/**/dialogue/**/*.yaml``lines[].id`
@@ -236,7 +236,7 @@ XREF WARNING: npc_count mismatch in transit district
**Error format:**
```
XREF ERROR: duplicate dialogue line id "the-terminal_d_015"
XREF ERROR: duplicate dialogue line id "kael-davan_d_015"
In: campaigns/main/.../dialogue/the-terminal/kael-davan.yaml
First occurrence: line 167
Duplicate: line 215