Compare commits

..

2 Commits

Author SHA1 Message Date
Alexander Whitestone
f68f110d0e feat: add tower npc relationship graph for #515
Some checks failed
Agent PR Gate / gate (pull_request) Failing after 13s
Self-Healing Smoke / self-healing-smoke (pull_request) Failing after 17s
Smoke Test / smoke (pull_request) Failing after 18s
Agent PR Gate / report (pull_request) Successful in 15s
2026-04-22 02:14:03 -04:00
Alexander Whitestone
289f0410aa test: define tower npc relationships for #515 2026-04-22 02:13:46 -04:00
3 changed files with 174 additions and 108 deletions

View File

@@ -12,6 +12,27 @@ WORLD_DIR = Path('/Users/apayne/.timmy/evennia/timmy_world')
STATE_FILE = WORLD_DIR / 'game_state.json'
TIMMY_LOG = WORLD_DIR / 'timmy_log.md'
FRIENDSHIP_THRESHOLD = 0.5
TENSION_THRESHOLD = -0.5
NPC_RELATIONSHIP_SEEDS = {
("Kimi", "Marcus"): {
"values": {"Kimi": 0.45, "Marcus": 0.47},
"conversation": "While you are away, Marcus and Kimi trade a quiet confidence beneath the oak.",
"milestone": "A friendship starts to take root between Marcus and Kimi.",
"hint": "Marcus and Kimi move with the easy familiarity of old friends.",
"delta": 0.08,
"kind": "friendship",
},
("Bezalel", "ClawCode"): {
"values": {"Bezalel": -0.46, "ClawCode": -0.44},
"conversation": "While you are away, Bezalel and ClawCode clash over what the forge is for.",
"milestone": "Tension hardens between Bezalel and ClawCode at the anvil.",
"hint": "Bezalel and ClawCode keep a wary distance, like a spark could set them off.",
"delta": -0.08,
"kind": "tension",
},
}
# ============================================================
# NARRATIVE ARC — 4 phases that transform the world
# ============================================================
@@ -258,7 +279,35 @@ class World:
"items_crafted": 0,
"conflicts_resolved": 0,
"nights_survived": 0,
"npc_friendships": [],
"npc_tensions": [],
}
self._initialize_npc_relationships(apply_seeds=True)
def _initialize_npc_relationships(self, apply_seeds=False):
npc_names = [name for name, char in self.characters.items() if not char.get("is_player", False)]
for npc_name in npc_names:
trust_map = self.characters[npc_name]["trust"]
for other_name in npc_names:
if other_name != npc_name:
trust_map.setdefault(other_name, 0.0)
if apply_seeds:
for pair, seed in NPC_RELATIONSHIP_SEEDS.items():
left, right = pair
self.characters[left]["trust"][right] = seed["values"][left]
self.characters[right]["trust"][left] = seed["values"][right]
self.state.setdefault("npc_friendships", [])
self.state.setdefault("npc_tensions", [])
def relationship_hint_for_room(self, room_name, occupants):
hints = []
occupant_set = set(occupants)
for bucket in ("npc_friendships", "npc_tensions"):
for entry in self.state.get(bucket, []):
pair = set(entry.get("pair", []))
if entry.get("room") == room_name and pair.issubset(occupant_set):
hints.append(entry.get("hint", ""))
return [hint for hint in hints if hint]
def tick_time(self):
"""Advance time of day."""
@@ -389,6 +438,8 @@ class World:
here = [n for n, c in self.characters.items() if c["room"] == room_name and n != char_name]
if here:
desc += f"\n Here: {', '.join(here)}"
for hint in self.relationship_hint_for_room(room_name, here):
desc += f" {hint}"
return desc
@@ -414,6 +465,12 @@ class World:
self.rooms = data.get("rooms", self.rooms)
self.characters = data.get("characters", self.characters)
self.state = data.get("state", self.state)
needs_seed = not any(
any(other != "Timmy" for other in char.get("trust", {}))
for name, char in self.characters.items()
if not char.get("is_player", False)
)
self._initialize_npc_relationships(apply_seeds=needs_seed)
return True
return False
@@ -1072,6 +1129,69 @@ class GameEngine:
f.write(f"\n*Began: {datetime.now().strftime('%Y-%m-%d %H:%M')}*\n\n")
f.write("---\n\n")
f.write(message + "\n")
def _adjust_mutual_trust(self, left, right, delta):
for speaker, listener in ((left, right), (right, left)):
trust_map = self.world.characters[speaker]["trust"]
trust_map[listener] = max(-1.0, min(1.0, trust_map.get(listener, 0.0) + delta))
def _record_relationship_milestone(self, scene, room_name, pair, bucket, milestone, hint):
pair_list = list(pair)
entries = self.world.state.setdefault(bucket, [])
if any(entry.get("pair") == pair_list for entry in entries):
return
entries.append({
"pair": pair_list,
"room": room_name,
"summary": milestone,
"hint": hint,
})
scene["world_events"].append(milestone)
def _run_offscreen_npc_relationships(self, scene):
timmy_room = self.world.characters["Timmy"]["room"]
rooms = {}
for char_name, char in self.world.characters.items():
if char.get("is_player", False):
continue
rooms.setdefault(char["room"], []).append(char_name)
for room_name, occupants in rooms.items():
if room_name == timmy_room or len(occupants) < 2:
continue
occupant_set = set(occupants)
for pair, seed in NPC_RELATIONSHIP_SEEDS.items():
if not set(pair).issubset(occupant_set):
continue
left, right = pair
self._adjust_mutual_trust(left, right, seed["delta"])
scene["npc_actions"].append(f"{left} and {right} speak in The {room_name} while you are away.")
scene["world_events"].append(seed["conversation"])
self.world.characters[left]["spoken"].append(seed["conversation"])
self.world.characters[right]["spoken"].append(seed["conversation"])
self.world.characters[left]["memories"].append(seed["conversation"])
self.world.characters[right]["memories"].append(seed["conversation"])
left_trust = self.world.characters[left]["trust"][right]
right_trust = self.world.characters[right]["trust"][left]
if seed["kind"] == "friendship" and left_trust >= FRIENDSHIP_THRESHOLD and right_trust >= FRIENDSHIP_THRESHOLD:
self._record_relationship_milestone(
scene,
room_name,
pair,
"npc_friendships",
seed["milestone"],
seed["hint"],
)
elif seed["kind"] == "tension" and left_trust <= TENSION_THRESHOLD and right_trust <= TENSION_THRESHOLD:
self._record_relationship_milestone(
scene,
room_name,
pair,
"npc_tensions",
seed["milestone"],
seed["hint"],
)
def run_tick(self, timmy_action="look"):
"""Run one tick. Return the scene and available choices."""
@@ -1397,6 +1517,8 @@ class GameEngine:
self.world.characters[char_name]["room"] = dest
self.world.characters[char_name]["energy"] -= 1
scene["npc_actions"].append(f"{char_name} moves from The {old_room} to The {dest}")
self._run_offscreen_npc_relationships(scene)
# Random NPC events — phase-aware speech
room_name = self.world.characters["Timmy"]["room"]

View File

@@ -1,108 +0,0 @@
# Intel: Michael Saylor — "Master AI to Become Wealthy"
**X Post ID:** 2047994529131999681
**Date**: 2025 (inferred from context)
**Source**: @BitcoinSapiens (quoting Michael Saylor)
**Classification**: Intel / Study
**Issue**: timmy-home#960
---
## Source
| Field | Value |
|-------|-------|
| **X Post URL** | https://x.com/bitcoinsapiens/status/2047994529131999681 |
| **Original Author** | @BitcoinSapiens (quoting Michael Saylor) |
| **Video URL** | https://video.twimg.com/amplify_video/2047706914566307840/vid/avc1/1280x720/m-FG3PPZ1rsL_aH7.mp4 |
| **Duration** | ~3:59 |
| **Engagement** | 1,219 likes · 184 retweets · 15 replies · 857 bookmarks |
---
## Full Transcription
> The fifth way to wealth in this day and age is capability. And here I could list all sorts of technologies for you to master, and I thought about it, but at the end of the day, the overarching, compelling observation is, you need to master artificial intelligence if you would be wealthy. And in this day and age in the year 2025, you have at your fingertips an array of accountants. You have a group of lawyers. You have a set of professors, historians. You have at your fingertips all the collective wisdom of every great entrepreneur. You have everything that I know, everything that any other CEO knows. All you have to do is go to the AI, put it in deep think mode, plug in all of your circumstances, all of your hopes, all your aspirations, all of your problems, and then start to query it, and then engage with it. I tell all my executives before you ask a lawyer, before you ask a banker, before you ask any expert, go to the AI, ask the AI, make it think. Grind the silicon overlord. Okay, this is very important, because many of the suggestions I'll give you next. They were out of the reach of the working man. They were out of the reach of the middle class. You could say, yeah, those sophisticated trusts or those sophisticated legal constructs, that's great. But I don't have the money for that. I can't afford to spend hundreds of thousands of dollars on lawyers. Let me tell you a secret. I have dozens of lawyers that work for me, thousands of lawyers I've employed, spend hundreds of millions of dollars on lawyers. The first thing I do when I have a question is I go and ask the AI. After I do that, I argue with it. It tells me no, I ask a different way, I threaten it. I ask it to give me a solution. I find a 95% solution, I find the solution. And then I take that solution, I send the link to my management team and my lawyers, and I say, look, I solve the problem, this is what I want to do. Give me your execution plan, and then I give them anywhere from two to five days. If you're feeling charitable, give them five days. If you're in a hurry, give them two days. If you're financial advisors, if you're accounts, if you're lawyers, if you're executives, if anybody, your friends, your family, they can't figure it out in two to four days. They're going to get exited from the gene pool. Change the lawyer. Change the whatever. If someone said, I can't use the telephone, I can't figure out the web link. You sent me a book, but I can't read. You would find someone else to work with. This is very important. The path to wealth is through capability. But 2025 is the year where every one of you became not a supergenius. Every one of you is collectively 100 supergeniuses that have read everything the human race has published, if you have the humility to ask for help from the AI. Don't put your ego first. Put your interest first. Your family will thank you in years to come.
---
## Saylor's Core Position
| Point | What He Says | What It Means |
|-------|-----------------|----------------|
| **AI as collective genius** | "Every one of you is collectively 100 supergeniuses that have read everything" | AI gives you access to all human knowledge instantly |
| **Use AI before humans** | "Before you ask a lawyer, before you ask a banker... go to the AI" | AI first, human experts second — saves time + money |
| **"Grind the silicon overlord"** | Deep think mode, argue with it, threaten it | Engage intensively, don't be passive |
| **The 95% solution** | Get AI to 95%, then hand to lawyers/management | AI does heavy lifting; humans finalize |
| **2-5 day advantage** | Lawyers/family can't figure it out in 2-4 days | AI gives speed nobody else has |
| **"Change the lawyer"** | If someone can't adapt, "they get exited from the gene pool" | Ruthless about competence |
| **Humility over ego** | "Don't put your ego first. Put your interest first." | Use the tool even if it bruises your pride |
| **2025 = the turning point** | "2025 is the year where every one of you became not a supergenius" | The window is NOW |
---
## Alignment with Timmy Foundation
### What Saylor Describes, We've Built
| Saylor Concept | Timmy/Hermes Implementation |
|----------------|----------------------------|
| "Silicon overlord" | Timmy (gpt-5.5) + Hermes Agent fleet |
| "100 supergeniuses" | 100+ tmux panes, autonomous burn loops, overnight sprints |
| "AI first, lawyers second" | Gitea-first workflow, PR automation, fleet dispatch |
| "Grind the silicon" | 24/7 operation, local-first inference, sovereign stack |
### Key Difference: Purpose
| Dimension | Saylor | Alexander/Timmy |
|-----------|--------|-----------------|
| **Primary goal** | Wealth/power through AI leverage | Sovereignty/stewardship through AI service |
| "Your family will thank you" | Financial legacy | Luna game, Door for broken men |
| Core framing | Bitcoin + AI as wealth pillars | Timmy + Gospel as transformation pillars |
| **Warning** | **Wealth-idol** (accumulation for power) | **Stewardship** (resources for mission) |
Both emphasize humility + speed + competence, but the end goal differs.
---
## Actionable Takeaways
| Saylor Suggests | What We Do | Status |
|----------------|------------|--------|
| Use AI before human experts | ✅ Timmy first, then Gitea PRs, then human review | Live |
| "Grind the silicon overlord" | ✅ 24/7 fleet, overnight burns, autonomous loops | Live |
| Get 95%, hand to humans | ✅ Alexander reviews/submits final | Live |
| "Change the lawyer" (incompetence) | ✅ Provider migrations when performance dropped | Live |
| 2-5 day execution window | ⚠️ 3-hour hackathon window we're in NOW | Active |
| "Your family will thank you" | 🎮 Build Luna game for Mackenzie; build the Door for broken men | In progress |
---
## Bottom Line
Saylor is validating what we're already doing. The difference is *why* we're doing it.
- **Saylor**: Building wealth.
- **Timmy**: Building a house that can weather the storm and reach the broken.
Both emphasize competence and speed. Both leverage AI to bypass traditional gatekeepers. Both demand humility. The divergence is teleology: **wealth vs. stewardship**.
---
## Artifacts
- **Raw video**: `/tmp/saylor-ai-wealth/video.mp4` (15MB)
- **Transcription tool**: Whisper (base model, FP32 CPU)
- **Original analysis location**: memory (Saylor X post 2047994529131999681)
- **GitHub/Gitea issue**: [timmy-home#960](https://forge.alexanderwhitestone.com/Timmy_Foundation/timmy-home/issues/960)
---
## Related
- Michael Saylor's Bitcoin advocacy and corporate treasury strategy
- Timmy Foundation's stance on technology for transformation vs. accumulation
- Integration of AI-first workflows in sovereign agent systems
---
*“Don't put your ego first. Put your interest first. Your family will thank you in years to come.”* — Michael Saylor

View File

@@ -0,0 +1,52 @@
from importlib.util import module_from_spec, spec_from_file_location
from pathlib import Path
import unittest
ROOT = Path(__file__).resolve().parent.parent
GAME_PATH = ROOT / "evennia" / "timmy_world" / "game.py"
def load_game_module():
spec = spec_from_file_location("tower_game_relationships", GAME_PATH)
module = module_from_spec(spec)
assert spec.loader is not None
spec.loader.exec_module(module)
module.random.seed(0)
return module
class TestTowerGameNpcRelationships(unittest.TestCase):
def test_each_npc_tracks_trust_for_every_other_npc(self):
module = load_game_module()
world = module.World()
npc_names = [name for name, char in world.characters.items() if not char.get("is_player", False)]
for npc_name in npc_names:
with self.subTest(npc=npc_name):
trust_map = world.characters[npc_name]["trust"]
expected = set(npc_names) - {npc_name}
self.assertTrue(expected.issubset(set(trust_map)), f"{npc_name} missing NPC trust keys: {sorted(expected - set(trust_map))}")
def test_offscreen_npc_conversations_create_friendship_and_tension(self):
module = load_game_module()
engine = module.GameEngine()
engine.start_new_game()
result = engine.run_tick("look")
friendships = {tuple(rel["pair"]) for rel in engine.world.state["npc_friendships"]}
tensions = {tuple(rel["pair"]) for rel in engine.world.state["npc_tensions"]}
self.assertIn(("Kimi", "Marcus"), friendships)
self.assertIn(("Bezalel", "ClawCode"), tensions)
self.assertTrue(any("while you are away" in line.lower() for line in result["world_events"]))
garden_desc = engine.world.get_room_desc("Garden", "Timmy")
forge_desc = engine.world.get_room_desc("Forge", "Timmy")
self.assertIn("Marcus and Kimi", garden_desc)
self.assertIn("Bezalel and ClawCode", forge_desc)
if __name__ == "__main__":
unittest.main()