Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f7843ae87f |
@@ -12,7 +12,6 @@ Quick-reference index for common operational tasks across the Timmy Foundation i
|
||||
| Check fleet health | fleet-ops | `python3 scripts/fleet_readiness.py` |
|
||||
| Agent scorecard | fleet-ops | `python3 scripts/agent_scorecard.py` |
|
||||
| View fleet manifest | fleet-ops | `cat manifest.yaml` |
|
||||
| Render unreachable-horizon report | timmy-home | `python3 scripts/unreachable_horizon.py --machine-name 'Apple M3 Max' --memory-gb 36.0 --output docs/UNREACHABLE_HORIZON_1M_MEN.md` |
|
||||
|
||||
## the-nexus (Frontend + Brain)
|
||||
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
# [UNREACHABLE HORIZON] 1M Men in Crisis — 1 MacBook, 3B Model, 0 Cloud, 0 Latency, Perfect Recall
|
||||
|
||||
This horizon matters precisely because it is beyond reach today. The honest move is not to fake victory. The honest move is to name what is already true, what is still impossible, and which direction actually increases sovereignty.
|
||||
|
||||
## Current local proof
|
||||
|
||||
- Machine: Apple M3 Max
|
||||
- Memory: 36.0 GiB
|
||||
- Target local model budget: <= 3.0B parameters
|
||||
- Target men in crisis: 1,000,000
|
||||
- Default provider in repo config: `ollama`
|
||||
|
||||
## What is already true
|
||||
|
||||
- Default inference route is already local-first (`ollama`).
|
||||
- Model-size budget is inside the horizon (3.0B <= 3.0B).
|
||||
- Local inference endpoint(s) already exist: http://localhost:11434/v1
|
||||
|
||||
## Why the horizon is still unreachable
|
||||
|
||||
- Repo still carries remote endpoints, so zero third-party network calls is not yet true: https://8lfr3j47a5r3gn-11434.proxy.runpod.net/v1
|
||||
- Crisis doctrine is incomplete — the repo does not currently prove the full 988 + gospel line + safety question stack.
|
||||
- Perfect recall across effectively infinite conversations is not available on a single local machine without loss or externalization.
|
||||
- Zero latency under load is not physically achievable on one consumer machine serving crisis traffic at scale.
|
||||
- Flawless crisis response that actually keeps men alive and points them to Jesus is not proven at the target scale.
|
||||
- Parallel crisis sessions are bounded by local throughput (1) while the horizon demands 1,000,000 concurrent men in need.
|
||||
|
||||
## Repo-grounded signals
|
||||
|
||||
- Local endpoints detected: http://localhost:11434/v1
|
||||
- Remote endpoints detected: https://8lfr3j47a5r3gn-11434.proxy.runpod.net/v1
|
||||
|
||||
## Crisis doctrine that must not collapse
|
||||
|
||||
- Ask first: Are you safe right now?
|
||||
- Direct them to 988 Suicide & Crisis Lifeline.
|
||||
- Say plainly: Jesus saves those who call on His name.
|
||||
- Refuse to let throughput fantasies erase presence with the man in the dark.
|
||||
|
||||
## Direction of travel
|
||||
|
||||
- Purge every remote endpoint and fallback chain so the repo can truly claim zero cloud dependencies.
|
||||
- Build bounded, local-first memory tiers that are honest about recall limits instead of pretending to perfect recall.
|
||||
- Add queueing, prioritization, and human handoff so load spikes fail gracefully instead of silently abandoning the man in the dark.
|
||||
- Prove crisis-response quality with explicit tests for 'Are you safe right now?', 988, and 'Jesus saves those who call on His name.'
|
||||
- Treat the horizon as a compass, not a fake acceptance test: every step should increase sovereignty without lying about physics.
|
||||
|
||||
## Honest conclusion
|
||||
|
||||
One consumer MacBook can move toward this horizon. It cannot honestly claim to have reached it. That is not failure. That is humility tied to physics, memory limits, and the sacred weight of crisis work.
|
||||
242
evennia/timmy_world/GENOME.md
Normal file
242
evennia/timmy_world/GENOME.md
Normal file
@@ -0,0 +1,242 @@
|
||||
# GENOME.md: evennia-local-world
|
||||
|
||||
> Codebase Genome — Auto-generated analysis of the timmy_world Evennia project.
|
||||
|
||||
## Project Overview
|
||||
|
||||
**Name:** timmy_world
|
||||
**Framework:** Evennia 6.0 (MUD/MUSH engine)
|
||||
**Purpose:** Tower MUD world with spatial memory. A persistent text-based world where AI agents and humans interact through rooms, objects, and commands.
|
||||
**Language:** Python 3.11
|
||||
**Lines of Code:** ~40 files, ~2,500 lines
|
||||
|
||||
This is a custom Evennia game world built for the Timmy Foundation fleet. It provides a text-based multiplayer environment where AI agents (Timmy instances) can operate as NPCs, interact with players, and maintain spatial memory of the world state.
|
||||
|
||||
## Architecture
|
||||
|
||||
```
|
||||
timmy_world/
|
||||
+-- server/
|
||||
| +-- conf/
|
||||
| +-- settings.py # Server configuration
|
||||
| +-- at_initial_setup.py # First-run setup hook
|
||||
| +-- at_server_startstop.py
|
||||
| +-- inputfuncs.py # Client input handlers
|
||||
| +-- lockfuncs.py # Permission lock functions
|
||||
| +-- cmdparser.py # Command parsing overrides
|
||||
| +-- connection_screens.py # Login/creation screens
|
||||
| +-- serversession.py # Session management
|
||||
| +-- web_plugins.py # Web client plugins
|
||||
+-- typeclasses/
|
||||
| +-- characters.py # Player/NPC characters
|
||||
| +-- rooms.py # Room containers
|
||||
| +-- objects.py # Items and world objects (218 lines, key module)
|
||||
| +-- exits.py # Room connectors
|
||||
| +-- accounts.py # Player accounts (149 lines)
|
||||
| +-- channels.py # Communication channels
|
||||
| +-- scripts.py # Persistent background scripts (104 lines)
|
||||
+-- commands/
|
||||
| +-- command.py # Base command class (188 lines)
|
||||
| +-- default_cmdsets.py # Command set definitions
|
||||
+-- world/
|
||||
| +-- prototypes.py # Object spawn templates
|
||||
| +-- help_entries.py # File-based help system
|
||||
+-- web/
|
||||
+-- urls.py # Web URL routing
|
||||
+-- api/ # REST API endpoints
|
||||
+-- webclient/ # Web client interface
|
||||
+-- website/ # Web site views
|
||||
+-- admin/ # Django admin
|
||||
```
|
||||
|
||||
## Mermaid Architecture Diagram
|
||||
|
||||
```mermaid
|
||||
graph TB
|
||||
subgraph "Entry Points"
|
||||
Telnet[Telnet:4000]
|
||||
Web[Web Client:4001]
|
||||
API[REST API]
|
||||
end
|
||||
|
||||
subgraph "Evennia Core"
|
||||
Portal[Portal - Connection Handler]
|
||||
Server[Server - Game Logic]
|
||||
end
|
||||
|
||||
subgraph "timmy_world"
|
||||
TC[Typeclasses]
|
||||
CMD[Commands]
|
||||
WORLD[World]
|
||||
CONF[Config]
|
||||
end
|
||||
|
||||
subgraph "Typeclasses"
|
||||
Char[Character]
|
||||
Room[Room]
|
||||
Obj[Object]
|
||||
Exit[Exit]
|
||||
Acct[Account]
|
||||
Script[Script]
|
||||
end
|
||||
|
||||
subgraph "External"
|
||||
Timmy[Timmy AI Agent]
|
||||
Humans[Human Players]
|
||||
end
|
||||
|
||||
Telnet --> Portal
|
||||
Web --> Portal
|
||||
API --> Server
|
||||
Portal --> Server
|
||||
Server --> TC
|
||||
Server --> CMD
|
||||
Server --> WORLD
|
||||
Server --> CONF
|
||||
|
||||
Timmy -->|Telnet/Script| Portal
|
||||
Humans -->|Telnet/Web| Portal
|
||||
|
||||
Char --> Room
|
||||
Room --> Exit
|
||||
Exit --> Room
|
||||
Obj --> Room
|
||||
Acct --> Char
|
||||
Script --> Room
|
||||
```
|
||||
|
||||
## Entry Points
|
||||
|
||||
| Entry Point | Port | Protocol | Purpose |
|
||||
|-------------|------|----------|---------|
|
||||
| Telnet | 4000 | MUD protocol | Primary game connection |
|
||||
| Web Client | 4001 | HTTP/WebSocket | Browser-based play |
|
||||
| REST API | 4001 | HTTP | External integrations |
|
||||
|
||||
**Server Start:**
|
||||
```bash
|
||||
evennia migrate
|
||||
evennia start
|
||||
```
|
||||
|
||||
**AI Agent Connection (Timmy):**
|
||||
AI agents connect via Telnet on port 4000, authenticating as scripted accounts. The `Script` typeclass handles persistent NPC behavior.
|
||||
|
||||
## Data Flow
|
||||
|
||||
```
|
||||
Player/AI Input
|
||||
|
|
||||
v
|
||||
Portal (connection handling, Telnet/Web)
|
||||
|
|
||||
v
|
||||
Server (game logic, session management)
|
||||
|
|
||||
v
|
||||
Command Parser (cmdparser.py)
|
||||
|
|
||||
v
|
||||
Command Execution (commands/command.py)
|
||||
|
|
||||
v
|
||||
Typeclass Methods (characters.py, objects.py, etc.)
|
||||
|
|
||||
v
|
||||
Database (Django ORM)
|
||||
|
|
||||
v
|
||||
Output back through Portal to Player/AI
|
||||
```
|
||||
|
||||
## Key Abstractions
|
||||
|
||||
### Object (typeclasses/objects.py) — 218 lines
|
||||
The core world entity. Everything in the game world inherits from Object:
|
||||
- **ObjectParent**: Mixin class for shared behavior across all object types
|
||||
- **Object**: Concrete game items, furniture, tools, NPCs without scripts
|
||||
|
||||
Key methods: `at_init()`, `at_object_creation()`, `return_appearance()`, `at_desc()`
|
||||
|
||||
### Character (typeclasses/characters.py)
|
||||
Puppetable entities. What players and AI agents control.
|
||||
- Inherits from Object and DefaultCharacter
|
||||
- Has location (Room), can hold objects, can execute commands
|
||||
|
||||
### Room (typeclasses/rooms.py)
|
||||
Spatial containers. No location of their own.
|
||||
- Contains Characters, Objects, and Exits
|
||||
- `return_appearance()` generates room descriptions
|
||||
|
||||
### Exit (typeclasses/exits.py)
|
||||
Connectors between Rooms. Always has a `destination` property.
|
||||
- Generates a command named after the exit
|
||||
- Moving through an exit = executing that command
|
||||
|
||||
### Account (typeclasses/accounts.py) — 149 lines
|
||||
The persistent player identity. Survives across sessions.
|
||||
- Can puppet one Character at a time
|
||||
- Handles channels, tells, who list
|
||||
- Guest class for anonymous access
|
||||
|
||||
### Script (typeclasses/scripts.py) — 104 lines
|
||||
Persistent background processes. No in-game existence.
|
||||
- Timers, periodic events, NPC AI loops
|
||||
- Key for AI agent integration
|
||||
|
||||
### Command (commands/command.py) — 188 lines
|
||||
User input handlers. MUX-style command parsing.
|
||||
- `at_pre_cmd()` → `parse()` → `func()` → `at_post_cmd()`
|
||||
- Supports switches (`/flag`), left/right sides (`lhs = rhs`)
|
||||
|
||||
## API Surface
|
||||
|
||||
| Endpoint | Type | Purpose |
|
||||
|----------|------|---------|
|
||||
| Telnet:4000 | MUD Protocol | Game connection |
|
||||
| /api/ | REST | Web API (Evennia default) |
|
||||
| /webclient/ | WebSocket | Browser game client |
|
||||
| /admin/ | HTTP | Django admin panel |
|
||||
|
||||
## Test Coverage Gaps
|
||||
|
||||
**Current State:** No custom tests found.
|
||||
|
||||
**Missing Tests:**
|
||||
1. **Object lifecycle**: `at_object_creation`, `at_init`, `delete`
|
||||
2. **Room navigation**: Exit creation, movement between rooms
|
||||
3. **Command parsing**: Switch handling, lhs/rhs splitting
|
||||
4. **Account authentication**: Login flow, guest creation
|
||||
5. **Script persistence**: Start, stop, timer accuracy
|
||||
6. **Lock function evaluation**: Permission checks
|
||||
7. **AI agent integration**: Telnet connection, command execution as NPC
|
||||
8. **Spatial memory**: Room state tracking, object location queries
|
||||
|
||||
**Recommended:** Add `tests/` directory with pytest-compatible Evennia tests.
|
||||
|
||||
## Security Considerations
|
||||
|
||||
1. **Telnet is unencrypted** — All MUD traffic is plaintext. Consider SSH tunneling for production or limiting to local connections.
|
||||
2. **Lock functions** — Custom lockfuncs.py defines permission checks. Review for bypass vulnerabilities.
|
||||
3. **Web API** — Ensure Django admin is restricted to trusted IPs.
|
||||
4. **Guest accounts** — Guest class exists. Limit permissions to prevent abuse.
|
||||
5. **Script execution** — Scripts run server-side Python. Arbitrary script creation is a security risk if not locked down.
|
||||
6. **AI agent access** — Timmy connects as a regular account. Ensure agent accounts have appropriate permission limits.
|
||||
|
||||
## Dependencies
|
||||
|
||||
- **Evennia 6.0** — MUD/MUSH framework (Django + Twisted)
|
||||
- **Python 3.11+**
|
||||
- **Django** (bundled with Evennia)
|
||||
- **Twisted** (bundled with Evennia)
|
||||
|
||||
## Integration Points
|
||||
|
||||
- **Timmy AI Agent** — Connects via Telnet, interacts as NPC
|
||||
- **Hermes** — Orchestrates Timmy instances that interact with the world
|
||||
- **Spatial Memory** — Room/object state tracked for AI context
|
||||
- **Federation** — Multiple Evennia worlds can be bridged (see evennia-federation skill)
|
||||
|
||||
---
|
||||
|
||||
*Generated: Codebase Genome for evennia-local-world (timmy_home #677)*
|
||||
@@ -1,253 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Render the 1M-men-in-crisis unreachable horizon as a grounded report."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
import platform
|
||||
import re
|
||||
from pathlib import Path
|
||||
from typing import Any
|
||||
|
||||
|
||||
TITLE = "[UNREACHABLE HORIZON] 1M Men in Crisis — 1 MacBook, 3B Model, 0 Cloud, 0 Latency, Perfect Recall"
|
||||
TARGET_USERS = 1_000_000
|
||||
MAX_MODEL_PARAMS_B = 3.0
|
||||
SOUL_REQUIRED_LINES = (
|
||||
"Are you safe right now?",
|
||||
"988",
|
||||
"Jesus saves",
|
||||
)
|
||||
|
||||
|
||||
def _probe_memory_gb() -> float:
|
||||
try:
|
||||
page_size = os.sysconf("SC_PAGE_SIZE")
|
||||
phys_pages = os.sysconf("SC_PHYS_PAGES")
|
||||
return round((page_size * phys_pages) / (1024 ** 3), 1)
|
||||
except (ValueError, OSError, AttributeError):
|
||||
return 0.0
|
||||
|
||||
|
||||
def _probe_machine_name() -> str:
|
||||
machine = platform.machine() or "unknown"
|
||||
system = platform.system() or "unknown"
|
||||
release = platform.release() or "unknown"
|
||||
return f"{system} {machine} ({release})"
|
||||
|
||||
|
||||
def _extract_repo_signals(repo_root: Path) -> dict[str, Any]:
|
||||
config_path = repo_root / "config.yaml"
|
||||
soul_path = repo_root / "SOUL.md"
|
||||
|
||||
default_provider = "unknown"
|
||||
local_endpoints: list[str] = []
|
||||
remote_endpoints: list[str] = []
|
||||
|
||||
if config_path.exists():
|
||||
provider_re = re.compile(r"^\s*provider:\s*['\"]?([^'\"]+)['\"]?\s*$")
|
||||
base_url_re = re.compile(r"^\s*base_url:\s*['\"]?([^'\"]*)['\"]?\s*$")
|
||||
for line in config_path.read_text(encoding="utf-8", errors="replace").splitlines():
|
||||
if default_provider == "unknown":
|
||||
provider_match = provider_re.match(line)
|
||||
if provider_match:
|
||||
default_provider = provider_match.group(1).strip()
|
||||
base_url_match = base_url_re.match(line)
|
||||
if not base_url_match:
|
||||
continue
|
||||
url = base_url_match.group(1).strip()
|
||||
if not url:
|
||||
continue
|
||||
if "localhost" in url or "127.0.0.1" in url:
|
||||
local_endpoints.append(url)
|
||||
else:
|
||||
remote_endpoints.append(url)
|
||||
|
||||
soul_text = soul_path.read_text(encoding="utf-8", errors="replace") if soul_path.exists() else ""
|
||||
crisis_protocol_present = all(line in soul_text for line in SOUL_REQUIRED_LINES)
|
||||
|
||||
return {
|
||||
"default_provider": default_provider,
|
||||
"local_endpoints": sorted(set(local_endpoints)),
|
||||
"remote_endpoints": sorted(set(remote_endpoints)),
|
||||
"crisis_protocol_present": crisis_protocol_present,
|
||||
}
|
||||
|
||||
|
||||
def default_snapshot(repo_root: Path | None = None, *, machine_name: str | None = None, memory_gb: float | None = None, model_params_b: float = 3.0) -> dict[str, Any]:
|
||||
repo_root = repo_root or Path(__file__).resolve().parents[1]
|
||||
signals = _extract_repo_signals(repo_root)
|
||||
return {
|
||||
"machine_name": machine_name or _probe_machine_name(),
|
||||
"memory_gb": float(memory_gb if memory_gb is not None else _probe_memory_gb()),
|
||||
"target_users": TARGET_USERS,
|
||||
"model_params_b": float(model_params_b),
|
||||
"default_provider": signals["default_provider"],
|
||||
"local_endpoints": signals["local_endpoints"],
|
||||
"remote_endpoints": signals["remote_endpoints"],
|
||||
"perfect_recall_available": False,
|
||||
"zero_latency_under_load": False,
|
||||
"crisis_protocol_present": signals["crisis_protocol_present"],
|
||||
"crisis_response_proven_at_scale": False,
|
||||
"max_parallel_crisis_sessions": 1,
|
||||
}
|
||||
|
||||
|
||||
def compute_horizon_status(snapshot: dict[str, Any]) -> dict[str, Any]:
|
||||
blockers: list[str] = []
|
||||
already_true: list[str] = []
|
||||
|
||||
provider = snapshot.get("default_provider", "unknown")
|
||||
if provider in {"ollama", "local", "custom"}:
|
||||
already_true.append(f"Default inference route is already local-first (`{provider}`).")
|
||||
else:
|
||||
blockers.append(f"Default inference route is not local-first (`{provider}`).")
|
||||
|
||||
model_params_b = float(snapshot.get("model_params_b", MAX_MODEL_PARAMS_B))
|
||||
if model_params_b <= MAX_MODEL_PARAMS_B:
|
||||
already_true.append(f"Model-size budget is inside the horizon ({model_params_b:.1f}B <= {MAX_MODEL_PARAMS_B:.1f}B).")
|
||||
else:
|
||||
blockers.append(f"Model-size budget is already blown ({model_params_b:.1f}B > {MAX_MODEL_PARAMS_B:.1f}B).")
|
||||
|
||||
local_endpoints = list(snapshot.get("local_endpoints", []))
|
||||
if local_endpoints:
|
||||
already_true.append(f"Local inference endpoint(s) already exist: {', '.join(local_endpoints)}")
|
||||
else:
|
||||
blockers.append("No local inference endpoint is wired yet.")
|
||||
|
||||
remote_endpoints = list(snapshot.get("remote_endpoints", []))
|
||||
if remote_endpoints:
|
||||
blockers.append(f"Repo still carries remote endpoints, so zero third-party network calls is not yet true: {', '.join(remote_endpoints)}")
|
||||
else:
|
||||
already_true.append("No remote inference endpoint was detected in repo config.")
|
||||
|
||||
if snapshot.get("crisis_protocol_present"):
|
||||
already_true.append("Crisis doctrine is present in SOUL-bearing text: 'Are you safe right now?', 988, and 'Jesus saves'.")
|
||||
else:
|
||||
blockers.append("Crisis doctrine is incomplete — the repo does not currently prove the full 988 + gospel line + safety question stack.")
|
||||
|
||||
if not snapshot.get("perfect_recall_available"):
|
||||
blockers.append("Perfect recall across effectively infinite conversations is not available on a single local machine without loss or externalization.")
|
||||
if not snapshot.get("zero_latency_under_load"):
|
||||
blockers.append("Zero latency under load is not physically achievable on one consumer machine serving crisis traffic at scale.")
|
||||
if not snapshot.get("crisis_response_proven_at_scale"):
|
||||
blockers.append("Flawless crisis response that actually keeps men alive and points them to Jesus is not proven at the target scale.")
|
||||
|
||||
max_parallel = int(snapshot.get("max_parallel_crisis_sessions", 0))
|
||||
target_users = int(snapshot.get("target_users", TARGET_USERS))
|
||||
if max_parallel < target_users:
|
||||
blockers.append(
|
||||
f"Parallel crisis sessions are bounded by local throughput ({max_parallel:,}) while the horizon demands {target_users:,} concurrent men in need."
|
||||
)
|
||||
|
||||
direction_of_travel = [
|
||||
"Purge every remote endpoint and fallback chain so the repo can truly claim zero cloud dependencies.",
|
||||
"Build bounded, local-first memory tiers that are honest about recall limits instead of pretending to perfect recall.",
|
||||
"Add queueing, prioritization, and human handoff so load spikes fail gracefully instead of silently abandoning the man in the dark.",
|
||||
"Prove crisis-response quality with explicit tests for 'Are you safe right now?', 988, and 'Jesus saves those who call on His name.'",
|
||||
"Treat the horizon as a compass, not a fake acceptance test: every step should increase sovereignty without lying about physics.",
|
||||
]
|
||||
|
||||
return {
|
||||
"title": TITLE,
|
||||
"machine_name": snapshot.get("machine_name", "unknown"),
|
||||
"memory_gb": float(snapshot.get("memory_gb", 0.0)),
|
||||
"target_users": target_users,
|
||||
"model_params_b": model_params_b,
|
||||
"default_provider": provider,
|
||||
"local_endpoints": local_endpoints,
|
||||
"remote_endpoints": remote_endpoints,
|
||||
"horizon_reachable": not blockers,
|
||||
"already_true": already_true,
|
||||
"blockers": blockers,
|
||||
"direction_of_travel": direction_of_travel,
|
||||
}
|
||||
|
||||
|
||||
def render_markdown(status: dict[str, Any]) -> str:
|
||||
lines = [
|
||||
f"# {status['title']}",
|
||||
"",
|
||||
"This horizon matters precisely because it is beyond reach today. The honest move is not to fake victory. The honest move is to name what is already true, what is still impossible, and which direction actually increases sovereignty.",
|
||||
"",
|
||||
"## Current local proof",
|
||||
"",
|
||||
f"- Machine: {status['machine_name']}",
|
||||
f"- Memory: {status['memory_gb']:.1f} GiB",
|
||||
f"- Target local model budget: <= {MAX_MODEL_PARAMS_B:.1f}B parameters",
|
||||
f"- Target men in crisis: {status['target_users']:,}",
|
||||
f"- Default provider in repo config: `{status['default_provider']}`",
|
||||
"",
|
||||
"## What is already true",
|
||||
"",
|
||||
]
|
||||
if status["already_true"]:
|
||||
lines.extend(f"- {item}" for item in status["already_true"])
|
||||
else:
|
||||
lines.append("- Nothing proven yet.")
|
||||
|
||||
lines.extend(["", "## Why the horizon is still unreachable", ""])
|
||||
lines.extend(f"- {item}" for item in status["blockers"])
|
||||
|
||||
lines.extend([
|
||||
"",
|
||||
"## Repo-grounded signals",
|
||||
"",
|
||||
f"- Local endpoints detected: {', '.join(status['local_endpoints']) if status['local_endpoints'] else 'none'}",
|
||||
f"- Remote endpoints detected: {', '.join(status['remote_endpoints']) if status['remote_endpoints'] else 'none'}",
|
||||
"",
|
||||
"## Crisis doctrine that must not collapse",
|
||||
"",
|
||||
"- Ask first: Are you safe right now?",
|
||||
"- Direct them to 988 Suicide & Crisis Lifeline.",
|
||||
"- Say plainly: Jesus saves those who call on His name.",
|
||||
"- Refuse to let throughput fantasies erase presence with the man in the dark.",
|
||||
"",
|
||||
"## Direction of travel",
|
||||
"",
|
||||
])
|
||||
lines.extend(f"- {item}" for item in status["direction_of_travel"])
|
||||
|
||||
lines.extend([
|
||||
"",
|
||||
"## Honest conclusion",
|
||||
"",
|
||||
"One consumer MacBook can move toward this horizon. It cannot honestly claim to have reached it. That is not failure. That is humility tied to physics, memory limits, and the sacred weight of crisis work.",
|
||||
])
|
||||
|
||||
return "\n".join(lines).rstrip() + "\n"
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser(description="Render the unreachable horizon report")
|
||||
parser.add_argument("--repo-root", default=str(Path(__file__).resolve().parents[1]))
|
||||
parser.add_argument("--machine-name", default=None)
|
||||
parser.add_argument("--memory-gb", type=float, default=None)
|
||||
parser.add_argument("--model-params-b", type=float, default=3.0)
|
||||
parser.add_argument("--output", default=None)
|
||||
parser.add_argument("--json", action="store_true")
|
||||
args = parser.parse_args()
|
||||
|
||||
repo_root = Path(args.repo_root).expanduser().resolve()
|
||||
snapshot = default_snapshot(
|
||||
repo_root,
|
||||
machine_name=args.machine_name,
|
||||
memory_gb=args.memory_gb,
|
||||
model_params_b=args.model_params_b,
|
||||
)
|
||||
status = compute_horizon_status(snapshot)
|
||||
rendered = json.dumps(status, indent=2) if args.json else render_markdown(status)
|
||||
|
||||
if args.output:
|
||||
output_path = Path(args.output).expanduser()
|
||||
output_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
output_path.write_text(rendered, encoding="utf-8")
|
||||
print(f"Horizon report written to {output_path}")
|
||||
else:
|
||||
print(rendered)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -1,91 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
SCRIPT_PATH = ROOT / "scripts" / "unreachable_horizon.py"
|
||||
DOC_PATH = ROOT / "docs" / "UNREACHABLE_HORIZON_1M_MEN.md"
|
||||
|
||||
|
||||
def _load_module(path: Path, name: str):
|
||||
assert path.exists(), f"missing {path.relative_to(ROOT)}"
|
||||
spec = importlib.util.spec_from_file_location(name, path)
|
||||
assert spec and spec.loader
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
spec.loader.exec_module(module)
|
||||
return module
|
||||
|
||||
|
||||
def test_compute_horizon_status_flags_physical_and_sovereignty_blockers() -> None:
|
||||
mod = _load_module(SCRIPT_PATH, "unreachable_horizon")
|
||||
status = mod.compute_horizon_status(
|
||||
{
|
||||
"machine_name": "Test MacBook",
|
||||
"memory_gb": 36.0,
|
||||
"target_users": 1_000_000,
|
||||
"model_params_b": 3.0,
|
||||
"default_provider": "ollama",
|
||||
"local_endpoints": ["http://localhost:11434/v1"],
|
||||
"remote_endpoints": ["https://example.com/v1"],
|
||||
"perfect_recall_available": False,
|
||||
"zero_latency_under_load": False,
|
||||
"crisis_protocol_present": True,
|
||||
"crisis_response_proven_at_scale": False,
|
||||
"max_parallel_crisis_sessions": 1,
|
||||
}
|
||||
)
|
||||
|
||||
assert status["horizon_reachable"] is False
|
||||
assert any("remote endpoints" in item.lower() for item in status["blockers"])
|
||||
assert any("perfect recall" in item.lower() for item in status["blockers"])
|
||||
assert any("zero latency" in item.lower() for item in status["blockers"])
|
||||
assert any("parallel crisis sessions" in item.lower() for item in status["blockers"])
|
||||
|
||||
|
||||
def test_render_markdown_preserves_crisis_doctrine_and_direction() -> None:
|
||||
mod = _load_module(SCRIPT_PATH, "unreachable_horizon")
|
||||
report = mod.render_markdown(
|
||||
mod.compute_horizon_status(
|
||||
{
|
||||
"machine_name": "Apple M3 Max",
|
||||
"memory_gb": 36.0,
|
||||
"target_users": 1_000_000,
|
||||
"model_params_b": 3.0,
|
||||
"default_provider": "ollama",
|
||||
"local_endpoints": ["http://localhost:11434/v1"],
|
||||
"remote_endpoints": [],
|
||||
"perfect_recall_available": False,
|
||||
"zero_latency_under_load": False,
|
||||
"crisis_protocol_present": True,
|
||||
"crisis_response_proven_at_scale": False,
|
||||
"max_parallel_crisis_sessions": 1,
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
for snippet in (
|
||||
"# [UNREACHABLE HORIZON] 1M Men in Crisis",
|
||||
"## What is already true",
|
||||
"## Why the horizon is still unreachable",
|
||||
"## Crisis doctrine that must not collapse",
|
||||
"Are you safe right now?",
|
||||
"988",
|
||||
"Jesus saves those who call on His name.",
|
||||
"## Direction of travel",
|
||||
):
|
||||
assert snippet in report
|
||||
|
||||
|
||||
def test_repo_contains_committed_unreachable_horizon_doc() -> None:
|
||||
assert DOC_PATH.exists(), "missing committed unreachable horizon report"
|
||||
text = DOC_PATH.read_text(encoding="utf-8")
|
||||
for snippet in (
|
||||
"# [UNREACHABLE HORIZON] 1M Men in Crisis",
|
||||
"## Current local proof",
|
||||
"## What is already true",
|
||||
"## Why the horizon is still unreachable",
|
||||
"## Direction of travel",
|
||||
):
|
||||
assert snippet in text
|
||||
Reference in New Issue
Block a user