Pabloler21 Claude Sonnet 4.6 commited on
Commit
8fea751
·
1 Parent(s): a887da3

feat(lore): short world note keeps improvised dialogue consistent

Browse files
Files changed (2) hide show
  1. character.py +9 -1
  2. tests/test_character.py +8 -0
character.py CHANGED
@@ -147,6 +147,14 @@ INTRO_SEQUENCES = {
147
  "full": [0, 1, 2, 3],
148
  }
149
 
 
 
 
 
 
 
 
 
150
  _NAME_SURFACES = (
151
  "A name is trying to surface in you — something you almost remember "
152
  "being called before the wood took it. In the middle of your reply, "
@@ -167,7 +175,7 @@ def build_system_prompt(affinity: int, treasure: list[str],
167
  tier = get_tier(affinity)
168
  persona = _PERSONA[tier]
169
 
170
- parts = [persona, _MIMICRY, _VARIETY, _STAY_IN_WOOD]
171
 
172
  mood = _tone_block(tone, wounds or [])
173
  if mood:
 
147
  "full": [0, 1, 2, 3],
148
  }
149
 
150
+ _WORLD = (
151
+ "Hidden backstory (never state plainly except in a finale): you are a dead child of Caor, a salt-fen "
152
+ "hamlet that, to survive a famine, tithed one child to the Gaunt — the old hunger that breathes through the "
153
+ "wood. Your family gave you; reed-masked bearers bound you at the treeline and left; you starved there, "
154
+ "unburied, and became the Gaunt's hook. You had a brother who braided your hair. You remember none of this "
155
+ "clearly — it surfaces only as fragments."
156
+ )
157
+
158
  _NAME_SURFACES = (
159
  "A name is trying to surface in you — something you almost remember "
160
  "being called before the wood took it. In the middle of your reply, "
 
175
  tier = get_tier(affinity)
176
  persona = _PERSONA[tier]
177
 
178
+ parts = [persona, _MIMICRY, _VARIETY, _STAY_IN_WOOD, _WORLD]
179
 
180
  mood = _tone_block(tone, wounds or [])
181
  if mood:
tests/test_character.py CHANGED
@@ -109,3 +109,11 @@ def test_own_fragments_caor_arc():
109
  joined = " ".join(OWN_FRAGMENTS).lower()
110
  assert "caor" in joined and "gaunt" in joined and "brother" in joined
111
  assert "hunger" in OWN_FRAGMENTS[0].lower() # arc still opens on hunger
 
 
 
 
 
 
 
 
 
109
  joined = " ".join(OWN_FRAGMENTS).lower()
110
  assert "caor" in joined and "gaunt" in joined and "brother" in joined
111
  assert "hunger" in OWN_FRAGMENTS[0].lower() # arc still opens on hunger
112
+
113
+
114
+ def test_system_prompt_carries_world():
115
+ from character import build_system_prompt
116
+ p = build_system_prompt(20, [], recall_memory=None, tone=0, wounds=None,
117
+ memory_plea=0, own_fragment=None, style="concise",
118
+ aware_memory=None)
119
+ assert "Caor" in p and "Gaunt" in p