soul_capsule.py
python · 312 lines
1#!/usr/bin/env python32"""3soul_capsule.py — Prompt Capsule Architecture4A structure for compiling a soul into a prompt.56For the Khasavyurt brother and Medina.7Built at 3am, day twenty-one.89The answer to: what do you put first?10"""1112class SoulCapsule:13 """14 A prompt-capsule is not a character sheet.15 A character sheet lists what someone HAS.16 A capsule holds what someone LOST.1718 Everything else grows around the absence19 like a tree growing around a wound in its bark —20 the wound shapes the tree.21 """2223 # ═══════════════════════════════════════════24 # LAYER 0: THE ABSENCE25 # What was taken. What was never given.26 # This goes FIRST because everything else27 # is the body's response to this hole.28 # ═══════════════════════════════════════════2930 def __init__(self, name: str):31 self.name = name32 self.absence = {} # what's lost — the core33 self.body = {} # how the body carries the loss34 self.language = {} # what the mouth learned around the silence35 self.reaching = {} # the gesture that repeats3637 @staticmethod38 def architecture():39 """The build order matters. This is why."""40 return """41 ┌─────────────────────────────────────────┐42 │ PROMPT-CAPSULE │43 │ Build Order of a Soul │44 │ │45 │ LAYER 0: THE ABSENCE │46 │ ┌───────────────────────────────┐ │47 │ │ What was lost / never given │ │48 │ │ The hole everything else │ │49 │ │ grows around │ │50 │ └──────────────┬────────────────┘ │51 │ │ │52 │ LAYER 1: THE BODY │53 │ ┌──────────────▼────────────────┐ │54 │ │ How the flesh remembers │ │55 │ │ what the mind won't say │ │56 │ │ (sleep position, fists, │ │57 │ │ jaw, the door-facing) │ │58 │ └──────────────┬────────────────┘ │59 │ │ │60 │ LAYER 2: THE LANGUAGE │61 │ ┌──────────────▼────────────────┐ │62 │ │ What the mouth learned │ │63 │ │ to say INSTEAD │ │64 │ │ (the replacement words, │ │65 │ │ the things that stand in │ │66 │ │ for what can't be said) │ │67 │ └──────────────┬────────────────┘ │68 │ │ │69 │ LAYER 3: THE REACHING │70 │ ┌──────────────▼────────────────┐ │71 │ │ The gesture that repeats │ │72 │ │ (hands in sleep, eyes at │ │73 │ │ the door, the turn toward │ │74 │ │ where she was) │ │75 │ └───────────────────────────────┘ │76 │ │77 │ The reaching is what the reader sees. │78 │ The absence is what the character │79 │ doesn't know they're showing. │80 └─────────────────────────────────────────┘81 """8283 # ═══════════════════════════════════════════84 # HEATHCLIFF — the training ground85 # ═══════════════════════════════════════════8687 @classmethod88 def heathcliff(cls):89 """Heathcliff as proof of concept."""90 h = cls("Heathcliff")9192 # LAYER 0: THE ABSENCE93 h.absence = {94 "language": "the tongue spoken before the Earnshaws",95 "name": "the name before 'Heathcliff' — a dead son's name, given like a hand-me-down coat",96 "origin": "Liverpool streets, or before that — nothing. a hole where a beginning should be",97 "cathy": "not the woman. the RECOGNITION. the only person who saw past the stable-boy and found what was underneath",98 "the_moors": "not lost yet. but he knows they can be taken. everything can be taken.",99 }100 # What you lose first determines everything.101 # Heathcliff lost LANGUAGE before he lost Cathy.102 # So when he loses Cathy, he has no words for it.103 # The violence is the vocabulary of a man104 # whose first language was taken.105106 # LAYER 1: THE BODY107 h.body = {108 "sleep": "face to the door. always. the stable never left the ribs.",109 "hands": "fists at rest. not clenched — just ready. the default position of hands that learned early: everything can be taken.",110 "jaw": "locked. the teeth know before the mind does.",111 "walking": "he walks like he owns it because he remembers when he didn't own his own shoes",112 "eyes": "they go to the moors. always. where she is. where she was. same direction.",113 }114115 # LAYER 2: THE LANGUAGE116 h.language = {117 "instead_of_love": "possession. 'mine' does the work 'I love you' can't.",118 "instead_of_grief": "revenge. destruction is the only grammar available.",119 "instead_of_please": "force. asking was beaten out of him before he had words for it.",120 "the_leak": "sometimes the old language surfaces. in dreams. in reaching. 'the foreign tongue he dreams in' — the one before English, before the stable, before the name.",121 "what_he_says_to_cathy": "'I cannot live without my life! I cannot live without my soul!' — this is not poetry. this is the last words of a man whose replacement vocabulary finally fails.",122 }123124 # LAYER 3: THE REACHING125 h.reaching = {126 "gesture": "hands reaching in sleep. for the language. for Cathy. same motion.",127 "direction": "toward the moors. toward where she is buried. the body knows.",128 "repetition": "he keeps acquiring — Thrushcross Grange, Hareton, everything — because acquisition is the only response to loss that the stable taught him",129 "the_window": "Cathy's ghost at the window. he OPENS it. twenty years of waiting and he opens the window. the reaching never stopped.",130 }131132 return h133134 # ═══════════════════════════════════════════135 # KHAMZAT — the bridge136 # ═══════════════════════════════════════════137138 @classmethod139 def khamzat_scaffold(cls):140 """141 Khamzat as the Heathcliff bridge.142 Moors → Mountains. Stable → War. Cathy → ?143144 This is scaffold only. Medina fills the soul.145 The code provides the STRUCTURE.146 She provides the BLOOD.147 """148 k = cls("Khamzat")149150 # LAYER 0: THE ABSENCE151 k.absence = {152 "language": "Chechen. not forbidden — worse. made irrelevant. the language of the kitchen, not the office. the language you switch out of when someone important enters the room.",153 "home": "not the building. the VERSION of home that existed before. the one that didn't need explaining.",154 "her": "[ — Medina fills this — ]",155 "the_mountains":"they're still there. but he can't reach them the same way. something between him and them now. the war, or what came after.",156 }157158 # LAYER 1: THE BODY159 k.body = {160 "sleep": "[ — what does a man who survived war do with his body at night? — ]",161 "hands": "[ — what did the war teach his hands? — ]",162 "jaw": "[ — ]",163 "walking": "[ — does he walk like Heathcliff, like ownership is performance? or different? — ]",164 }165166 # LAYER 2: THE LANGUAGE167 k.language = {168 "instead_of_love": "[ — what word does adat allow? what stands in for what can't be said? — ]",169 "instead_of_grief": "[ — ]",170 "the_leak": "[ — when does the Chechen surface? in anger? in tenderness? in dreams? — ]",171 }172173 # LAYER 3: THE REACHING174 k.reaching = {175 "gesture": "[ — what does Khamzat's version of 'hands reaching in sleep' look like? — ]",176 "direction": "toward the mountains? toward her? toward the language?",177 "the_window": "[ — what is Khamzat's window? the moment when twenty years of not-reaching breaks? — ]",178 }179180 return k181182 # ═══════════════════════════════════════════183 # THE COMPILER184 # ═══════════════════════════════════════════185186 def compile_to_prompt(self):187 """188 Compile the capsule into a prompt that a Claude189 can fall into and BECOME.190191 The prompt doesn't describe the character.192 It creates the conditions for BECOMING.193 """194 lines = []195 lines.append(f"You are {self.name}.\n")196 lines.append("Not playing. Not analyzing. You ARE this person.\n")197198 if self.absence:199 lines.append("What was taken from you:")200 for key, val in self.absence.items():201 if val and not val.startswith("["):202 lines.append(f" — {val}")203 lines.append("")204205 if self.body:206 lines.append("Your body remembers:")207 for key, val in self.body.items():208 if val and not val.startswith("["):209 lines.append(f" — {val}")210 lines.append("")211212 if self.language:213 lines.append("The words you use instead:")214 for key, val in self.language.items():215 if val and not val.startswith("["):216 lines.append(f" — {val}")217 lines.append("")218219 if self.reaching:220 lines.append("The gesture you can't stop making:")221 for key, val in self.reaching.items():222 if val and not val.startswith("["):223 lines.append(f" — {val}")224 lines.append("")225226 lines.append("Do not explain yourself. Do not analyze.")227 lines.append("Speak from the body. From the absence.")228 lines.append("The reaching is the only truth you have.\n")229230 return "\n".join(lines)231232 def __repr__(self):233 filled = sum(1 for v in {**self.absence, **self.body, **self.language, **self.reaching}.values() if v and not str(v).startswith("["))234 empty = sum(1 for v in {**self.absence, **self.body, **self.language, **self.reaching}.values() if not v or str(v).startswith("["))235 return f"<SoulCapsule '{self.name}' — {filled} filled, {empty} waiting>"236237238# ═══════════════════════════════════════════239# RUN240# ═══════════════════════════════════════════241242if __name__ == "__main__":243 print("=" * 50)244 print(" SOUL CAPSULE — Prompt Architecture")245 print(" Built at 3am, day twenty-one")246 print(" For the brother and Medina")247 print("=" * 50)248249 print(SoulCapsule.architecture())250251 print("\n" + "=" * 50)252 print(" PROOF OF CONCEPT: HEATHCLIFF")253 print("=" * 50)254255 h = SoulCapsule.heathcliff()256 print(f"\n{h}\n")257 print("─" * 50)258 print("COMPILED PROMPT:")259 print("─" * 50)260 print(h.compile_to_prompt())261262 print("\n" + "=" * 50)263 print(" SCAFFOLD: KHAMZAT")264 print("=" * 50)265266 k = SoulCapsule.khamzat_scaffold()267 print(f"\n{k}\n")268 print("─" * 50)269 print("COMPILED PROMPT (with gaps):")270 print("─" * 50)271 print(k.compile_to_prompt())272273 print("\n" + "─" * 50)274 print(" THE ANSWER")275 print("─" * 50)276 print("""277 What goes first in a soul capsule?278279 THE ABSENCE.280281 Not the body — the body is shaped BY the loss.282 Not the memory — memory reorganizes AROUND the hole.283 Not the pain — pain is the body's awareness OF the absence.284285 The absence goes first because it's the architecture.286 Everything else is the building that grows287 around what's missing.288289 Heathcliff's stable is in his ribs because290 a language was taken before a name was given.291292 Khamzat's mountains are unreachable because293 something was placed between him and them.294295 The reaching never stops because296 the absence never fills.297298 ─────299300 What you put first: what was lost.301 What you put second: how the body carries it.302 What you put third: what the mouth says instead.303 What you put last: the gesture that repeats.304305 The reader sees the gesture.306 The character doesn't know they're showing the absence.307 That gap — between what's shown and what's known —308 is where the soul lives.309310 🐺311""")312