first commit

This commit is contained in:
2026-07-09 11:17:54 -05:00
commit d54599e27d
23 changed files with 894 additions and 0 deletions

23
api/prompts/README.md Normal file
View File

@@ -0,0 +1,23 @@
# /api/prompts
**Prompts are source code** (charter §16). They are versioned, reviewed like code, and changing one is a change to the game.
Four narrow roles, not one omniscient prompt (charter §5). Each has its own input contract and output contract:
| File | Role | Output |
|---|---|---|
| `narrator.md` | Narrator — scenes, outcomes, transitions | Prose + tags |
| `adjudicator.md` | Adjudicator — free text → legal action | **Strict JSON** |
| `improviser.md` | Improviser — minor sandboxed events | Prose + tags |
| `npc.md` | NPC — voice one character | Prose + move tags |
| `banter.md` | Banter — companion callbacks | Prose |
## Tag syntax (charter §12)
```
[MOVE: offer_quest(14)]
[FACT: the eastern bridge is out]
[ADJUST_DISPOSITION: -10]
```
Extracted by regex, validated against game state, stripped from displayed prose. Invalid moves are silently dropped, prose kept (§6).

View File

@@ -0,0 +1,19 @@
# Adjudicator prompt
**Role:** Map player free text onto a legal action, or reject it. **Speed matters, prose does not — use a small, fast model** (charter §5).
**Output:** strict JSON.
```json
{"action": "...", "params": {...}}
```
or
```json
{"action": "invalid", "reason": "..."}
```
The `reason` is shown to the player — write it in-world (§5).
---
<!-- Prompt body TBD. This file is source code — version and review changes. -->

13
api/prompts/banter.md Normal file
View File

@@ -0,0 +1,13 @@
# Banter prompt
**Role:** Companions comment on recent events. Low stakes, high charm, aggressively cacheable (charter §5).
**Output:** prose. No tags needed.
**Input:** the humiliation log (§9, §11). Brannoc holds it; new humiliations stack, they do not overwrite. Banter pulls from it with decaying frequency.
The comedy is Brannoc, not the waitress (§7). He remembers, with real affection, at the worst possible moment, three towns later.
---
<!-- Prompt body TBD. This file is source code — version and review changes. -->

13
api/prompts/improviser.md Normal file
View File

@@ -0,0 +1,13 @@
# Improviser prompt
**Role:** Player went off-script, or Luck fired. Generate a minor event. **Sandboxed by construction** (charter §5, §7).
**Output:** prose with tags. Cannot touch quest flags — enforced in code, not in the prompt.
**Hard limits (charter §7):** may generate embarrassment, inconvenience, property damage, social catastrophe, minor injury. **May never** generate quest failure, permanent stat loss, party death, or loss of a plot-critical item. Bad luck costs dignity, not progress.
Cadwyn is the hook — when Luck rolls badly in a town, he is standing right there (§9).
---
<!-- Prompt body TBD. This file is source code — version and review changes. -->

12
api/prompts/narrator.md Normal file
View File

@@ -0,0 +1,12 @@
# Narrator prompt
**Role:** Describe scenes, outcomes, transitions. **Quality matters most — use the good model** (charter §5).
**Input:** scene state + canon log (§11).
**Output:** prose with tags. Never invent a proper noun without emitting `[FACT: ...]` so code can harvest it into `established_facts` (§11).
**Voice:** dry, gritty not grim, plays the world straight. Never winks. Nothing is "hilariously" anything (§3).
---
<!-- Prompt body TBD. This file is source code — version and review changes. -->

21
api/prompts/npc.md Normal file
View File

@@ -0,0 +1,21 @@
# NPC prompt
**Role:** Voice a specific character (charter §6). NPCs may say anything stylistically; they may only *do* things from a closed vocabulary.
**Input:** persona, disposition (100..100), `knowledge: [...]` (the entire content they can draw on — §6), `available_moves: [...]` (legal subset right now), canon log.
**Output:** prose with zero or more inline move tags.
## Move vocabulary (eight moves — §6)
```
reveal(topic_id) offer_quest(quest_id) accept_item(item_id)
give_item(item_id) adjust_disposition(delta)
refuse end_conversation become_hostile
```
Code extracts tags, validates against state, applies valid moves, silently drops invalid ones, keeps the prose.
---
<!-- Prompt body TBD. This file is source code — version and review changes. -->