How griffins2005/town-simulator works
Eidolon Society Lab is a browser-driven town simulation. The main workflow seats residents at the table, starts the town, then advances agent decisions into validated actions and visible town changes. Distinct stages include roster and strategy setup, perception and reasoning, action validation, economic and institutional consequences, and observation/analytics. The graph also shows memory and recording as internal layers, plus the optional Groq strategy path and the separate council match. Some links rely on README statements or SOURCE INDEX references; unsampled implementation details are not inferred.
Main entry points: live_server.py Live server · engine.py Tick engine · lineup.py Seated lineup · actions.py Action validation
Components 26
Lab interface
- Browser client
lab/live_shared.js - Live server
lab/live_server.py
Roster and strategy
- Seated lineup
roster/lineup.py - Agent catalog
roster/catalog.py - Strategy language
roster/code.py - Resident behavior
roster/play.py - Description translator
roster/translate.py
Simulation runtime
- Town factory
town/town_factory.py - World state
town/world.py - Agent state
town/agent.py - Tick engine
town/engine.py - Decision making
town/decision.py - Action validation
town/actions.py - Agent memory
town/memory.py
Town systems
- Economy
town/economy.py - Governance
town/governance.py - Faith institutions
town/faith.py - Inventions
town/inventions.py - Crises and shocks
town/chaos.py
Records and analytics
- Tick recorder
town/recorder.py - Town analytics
town/analytics.py - Save and restore
town/checkpoint.py
Optional modes
- LLM decider
llm/llm_decider.py - Flood match
council/match.py
Other components
- Player
- Groq service
Connections 27
- Player → Browser client: seats residents
- Browser client → Live server: sends controls
- Live server → Seated lineup: starts town
lab/live_server.py - Seated lineup → Agent catalog: loads agents
roster/lineup.py - Seated lineup → Strategy language: uses rules
roster/lineup.py - Seated lineup → Resident behavior: runs town life
roster/lineup.py - Seated lineup → Town factory: builds residents
roster/lineup.py - Resident behavior → Tick engine: advances town
roster/play.py - Live server → Description translator: translates descriptions
lab/live_server.py - Description translator → Groq service: requests strategy
- Description translator → LLM decider: uses model name
roster/translate.py - Town factory → World state: creates world
town/town_factory.py - Town factory → Agent state: creates agents
town/town_factory.py - Tick engine → Decision making: requests intents
town/engine.py - Tick engine → Action validation: executes intents
town/engine.py - Tick engine → Agent memory: records outcomes
town/engine.py - Action validation → Economy: applies trade and work
town/actions.py - Action validation → Governance: applies votes and laws
town/actions.py - Action validation → Faith institutions: applies worship
town/actions.py - Action validation → Inventions: validates inventions
town/actions.py - Tick engine → Crises and shocks: runs crisis hooks
town/chaos.py - Tick engine → Tick recorder: records frames
town/recorder.py - Live server → Tick recorder: serves event stream
lab/live_server.py - Live server → Town analytics: serves charts
- Live server → Save and restore: handles save controls
lab/live_server.py - LLM decider → Groq service: requests completions
- Player → Flood match: runs separate match