Pabloler21 Claude Sonnet 4.6 commited on
Commit
a39d3fb
·
1 Parent(s): 22712d6

feat(intro): condensed tester teaching card so the short arc explains the loop

Browse files
Files changed (3) hide show
  1. app.py +2 -1
  2. character.py +7 -1
  3. tests/test_character.py +6 -4
app.py CHANGED
@@ -258,13 +258,14 @@ _INTRO_IMAGES = [
258
  _img_uri("assets/intro_keeps.webp"),
259
  _img_uri("assets/intro_waiting.webp"),
260
  _img_uri("assets/intro_meeting.webp"),
 
261
  ]
262
  # Per-card focal point for the 16:10 cover-crop (CSS background-position).
263
  # Card order matches INTRO_CARDS: threshold, keeps, waiting, meeting.
264
  # Per-card focal point for the 16:10 cover-crop (CSS background-position).
265
  # Raised so each subject sits high and the dialogue box covers emptier area.
266
  # Card order matches INTRO_CARDS: threshold, keeps, waiting, meeting.
267
- _INTRO_POS = ["center 72%", "center 38%", "center 38%", "center 20%"]
268
  _TICK_URI = f"data:audio/wav;base64,{base64.b64encode(type_tick_wav_bytes()).decode()}"
269
 
270
 
 
258
  _img_uri("assets/intro_keeps.webp"),
259
  _img_uri("assets/intro_waiting.webp"),
260
  _img_uri("assets/intro_meeting.webp"),
261
+ _img_uri("assets/intro_waiting.webp"), # 4 — tester condensed card (reuses the waiting art)
262
  ]
263
  # Per-card focal point for the 16:10 cover-crop (CSS background-position).
264
  # Card order matches INTRO_CARDS: threshold, keeps, waiting, meeting.
265
  # Per-card focal point for the 16:10 cover-crop (CSS background-position).
266
  # Raised so each subject sits high and the dialogue box covers emptier area.
267
  # Card order matches INTRO_CARDS: threshold, keeps, waiting, meeting.
268
+ _INTRO_POS = ["center 72%", "center 38%", "center 38%", "center 20%", "center 38%"] # idx 4 reuses the waiting focal point
269
  _TICK_URI = f"data:audio/wav;base64,{base64.b64encode(type_tick_wav_bytes()).decode()}"
270
 
271
 
character.py CHANGED
@@ -139,11 +139,17 @@ INTRO_CARDS = [
139
  "taken, if you offer them.",
140
  "Now it lifts its head, as if it heard you breathe. A thin hand reaches out "
141
  "of the white.",
 
 
 
 
 
 
142
  ]
143
 
144
  # Which cards each mode shows. Tester = arrival + meeting; Full = all four.
145
  INTRO_SEQUENCES = {
146
- "tester": [0, 3],
147
  "full": [0, 1, 2, 3],
148
  }
149
 
 
139
  "taken, if you offer them.",
140
  "Now it lifts its head, as if it heard you breathe. A thin hand reaches out "
141
  "of the white.",
142
+ # 4 — tester-only condensed card: fuses the rule (a memory spoken aloud
143
+ # endures) with what waits (the memoryless thing that keeps what you offer),
144
+ # so the short arc still teaches the loop before the meeting.
145
+ "The wood keeps nothing it is given - coins, names, the dead. Only a memory "
146
+ "spoken aloud endures here. And something as empty as you has learned to "
147
+ "keep the ones you offer it.",
148
  ]
149
 
150
  # Which cards each mode shows. Tester = arrival + meeting; Full = all four.
151
  INTRO_SEQUENCES = {
152
+ "tester": [0, 4, 3],
153
  "full": [0, 1, 2, 3],
154
  }
155
 
tests/test_character.py CHANGED
@@ -2,15 +2,17 @@ from character import INTRO_CARDS, INTRO_SEQUENCES, build_system_prompt
2
 
3
 
4
  def test_intro_cards_and_sequences():
5
- # four lore beats, all non-empty English strings
6
- assert len(INTRO_CARDS) == 4
7
  assert all(isinstance(c, str) and c.strip() for c in INTRO_CARDS)
8
- # tester is the short 2-card arc, full is the 4-card arc
9
- assert INTRO_SEQUENCES["tester"] == [0, 3]
10
  assert INTRO_SEQUENCES["full"] == [0, 1, 2, 3]
11
  # every index points at a real card
12
  for seq in INTRO_SEQUENCES.values():
13
  assert all(0 <= i < len(INTRO_CARDS) for i in seq)
 
 
14
 
15
 
16
  class TestMimicry:
 
2
 
3
 
4
  def test_intro_cards_and_sequences():
5
+ # four lore beats + a tester-only condensed teaching card (index 4)
6
+ assert len(INTRO_CARDS) == 5
7
  assert all(isinstance(c, str) and c.strip() for c in INTRO_CARDS)
8
+ # tester is the short 3-card arc, full is the 4-card arc
9
+ assert INTRO_SEQUENCES["tester"] == [0, 4, 3]
10
  assert INTRO_SEQUENCES["full"] == [0, 1, 2, 3]
11
  # every index points at a real card
12
  for seq in INTRO_SEQUENCES.values():
13
  assert all(0 <= i < len(INTRO_CARDS) for i in seq)
14
+ # the short tester arc must still teach the loop — a card that names "memory"
15
+ assert any("memory" in INTRO_CARDS[i].lower() for i in INTRO_SEQUENCES["tester"])
16
 
17
 
18
  class TestMimicry: