# probablyapigeon/society_art_xembra_termux architecture

> Architecture diagram of the GitHub repository probablyapigeon/society_art_xembra_termux, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/probablyapigeon/society_art_xembra_termux
- Repository: https://github.com/probablyapigeon/society_art_xembra_termux

## Overview

XEMBRA is an interactive adaptive-cognition runtime and `.xc` interpreter, with an empirical lab spanning eight stages. The principal workflow is a user command through `run_xembra.py`, which coordinates cognitive cycles and stage-specific experiments, then exposes responses, audio, visual artifacts, or diagnostics. The runtime’s internal layer combines affect, identity, relationship, novelty, goals, thought, and world state. README capabilities are represented, but some subsystem paths are directory-level because their implementations were not sampled; those links are documented rather than inferred from unseen calls.

Main entry points: [`run_xembra.py`](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/run_xembra.py) (Interactive commands), [`society_sim.py`](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/society_sim.py) (Coupled agents), [`xc_engine.py`](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/xc_engine.py) (XC interpreter), [`systems/music.py`](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/systems/music.py) (Music synthesis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and interaction"]
  node_commands["Interactive commands<br/>[run_xembra.py]"]
  node_xc["XC interpreter<br/>[xc_engine.py]"]
  node_xccli["XC parser and evaluator<br/>[xc_cli.py]"]
  node_voice["Voice bridge<br/>[voice_bridge.py]"]
  node_society["Coupled agents<br/>[society_sim.py]"]
  node_legacy["Robot conversation<br/>[XEMBRAROBOT.PY]"]
  node_creature["Creature conversation<br/>[xembra_creature.py]"]
end

subgraph group_cognition["Cognitive state"]
  node_cognition["Cognitive modules"]
  node_identity["Identity state<br/>[identity.py]"]
  node_relationship["Relationship state<br/>[relationship.py]"]
  node_novelty["Novelty memory<br/>[novelty.py]"]
  node_thought["Thought loop<br/>[thought_loop.py]"]
  node_goals["Goal state<br/>[goals.py]"]
  node_world["World scenes<br/>[world_scene.py]"]
end

subgraph group_experiments["Research stages"]
  node_commutator["Operator sweeps<br/>[commutator_test.py]"]
  node_ablation["Memory ablation<br/>[morphogenesis.py]"]
  node_perturb["Perturbation tests<br/>[morphogenesis.py]"]
  node_research["Research diagnostics<br/>[morphogenesis.py]"]
end

subgraph group_media["Audio and visual output"]
  node_music["Music synthesis<br/>[music.py]"]
  node_morph["Art and morphogenesis<br/>[morphogenesis.py]"]
end

node_user(("User"))
node_microphone(("Phone microphone"))
node_audio(("Audio playback"))

node_user -->|"issues commands"| node_commands
node_commands -->|"runs cycles"| node_xc
node_xc -->|"parses and evaluates"| node_xccli
node_commands -->|"routes audio"| node_voice
node_commands -->|"runs society"| node_society
node_commands -->|"runs sweeps"| node_commutator
node_commands -->|"runs ablation"| node_ablation
node_commands -->|"runs benchmarks"| node_perturb
node_commands -->|"shows diagnostics"| node_research
node_commands -->|"requests synthesis"| node_music
node_commands -->|"requests artwork"| node_morph
node_user -.->|"converses with"| node_legacy
node_user -.->|"converses with"| node_creature
node_legacy -->|"uses modules"| node_cognition
node_creature -->|"uses modules"| node_cognition
node_society -->|"creates runtimes"| node_xc
node_society -->|"composes duet"| node_music
node_society -->|"grows lattice"| node_morph
node_society -->|"renders world"| node_world
node_society -->|"updates identity"| node_identity
node_society -->|"updates bond"| node_relationship
node_society -->|"measures novelty"| node_novelty
node_society -->|"uses thoughts"| node_thought
node_society -->|"updates goals"| node_goals
node_voice -->|"records audio"| node_microphone
node_music -->|"plays WAV"| node_audio

click node_commands "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/run_xembra.py"
click node_xc "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/xc_engine.py"
click node_xccli "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/xc_cli.py"
click node_voice "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/voice_bridge.py"
click node_society "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/society_sim.py"
click node_legacy "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/XEMBRAROBOT.PY"
click node_creature "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/xembra_creature.py"
click node_cognition "https://github.com/probablyapigeon/society_art_xembra_termux/tree/main/modules"
click node_identity "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/modules/identity.py"
click node_relationship "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/modules/relationship.py"
click node_novelty "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/modules/novelty.py"
click node_thought "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/modules/thought_loop.py"
click node_goals "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/modules/goals.py"
click node_world "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/modules/world_scene.py"
click node_commutator "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/commutator_test.py"
click node_ablation "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/systems/morphogenesis.py"
click node_perturb "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/systems/morphogenesis.py"
click node_research "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/systems/morphogenesis.py"
click node_music "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/systems/music.py"
click node_morph "https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/systems/morphogenesis.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_commands,node_xc,node_xccli,node_voice,node_society,node_legacy,node_creature,node_user toneBlue
class node_cognition,node_identity,node_relationship,node_novelty,node_thought,node_goals,node_world toneAmber
class node_commutator,node_ablation,node_perturb,node_research toneMint
class node_music,node_morph toneRose
class node_microphone,node_audio toneIndigo
```

## Components

### Runtime and interaction

- [Interactive commands](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/run_xembra.py): `run_xembra.py`
- [XC interpreter](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/xc_engine.py): `xc_engine.py`
- [XC parser and evaluator](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/xc_cli.py): `xc_cli.py`
- [Voice bridge](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/voice_bridge.py): `voice_bridge.py`
- [Coupled agents](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/society_sim.py): `society_sim.py`
- [Robot conversation](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/XEMBRAROBOT.PY): `XEMBRAROBOT.PY`
- [Creature conversation](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/xembra_creature.py): `xembra_creature.py`

### Cognitive state

- [Cognitive modules](https://github.com/probablyapigeon/society_art_xembra_termux/tree/main/modules): `modules`
- [Identity state](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/modules/identity.py): `modules/identity.py`
- [Relationship state](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/modules/relationship.py): `modules/relationship.py`
- [Novelty memory](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/modules/novelty.py): `modules/novelty.py`
- [Thought loop](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/modules/thought_loop.py): `modules/thought_loop.py`
- [Goal state](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/modules/goals.py): `modules/goals.py`
- [World scenes](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/modules/world_scene.py): `modules/world_scene.py`

### Research stages

- [Operator sweeps](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/commutator_test.py): `commutator_test.py`
- [Memory ablation](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/systems/morphogenesis.py): `systems/morphogenesis.py`
- [Perturbation tests](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/systems/morphogenesis.py): `systems/morphogenesis.py`
- [Research diagnostics](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/systems/morphogenesis.py): `systems/morphogenesis.py`

### Audio and visual output

- [Music synthesis](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/systems/music.py): `systems/music.py`
- [Art and morphogenesis](https://github.com/probablyapigeon/society_art_xembra_termux/blob/main/systems/morphogenesis.py): `systems/morphogenesis.py`

### Other components

- **User**
- **Phone microphone**
- **Audio playback**

## Connections

- User → Interactive commands: issues commands (evidence: `README.md`)
- Interactive commands → XC interpreter: runs cycles (evidence: `run_xembra.py`)
- XC interpreter → XC parser and evaluator: parses and evaluates (evidence: `xc_engine.py`)
- Interactive commands → Voice bridge: routes audio (evidence: `run_xembra.py`)
- Interactive commands → Coupled agents: runs society (evidence: `README.md`)
- Interactive commands → Operator sweeps: runs sweeps (evidence: `README.md`)
- Interactive commands → Memory ablation: runs ablation (evidence: `README.md`)
- Interactive commands → Perturbation tests: runs benchmarks (evidence: `README.md`)
- Interactive commands → Research diagnostics: shows diagnostics (evidence: `README.md`)
- Interactive commands → Music synthesis: requests synthesis (evidence: `README.md`)
- Interactive commands → Art and morphogenesis: requests artwork (evidence: `README.md`)
- User → Robot conversation: converses with
- User → Creature conversation: converses with
- Robot conversation → Cognitive modules: uses modules (evidence: `XEMBRAROBOT.PY`)
- Creature conversation → Cognitive modules: uses modules (evidence: `xembra_creature.py`)
- Coupled agents → XC interpreter: creates runtimes (evidence: `society_sim.py`)
- Coupled agents → Music synthesis: composes duet (evidence: `society_sim.py`)
- Coupled agents → Art and morphogenesis: grows lattice (evidence: `society_sim.py`)
- Coupled agents → World scenes: renders world (evidence: `society_sim.py`)
- Coupled agents → Identity state: updates identity (evidence: `society_sim.py`)
- Coupled agents → Relationship state: updates bond (evidence: `society_sim.py`)
- Coupled agents → Novelty memory: measures novelty (evidence: `society_sim.py`)
- Coupled agents → Thought loop: uses thoughts (evidence: `society_sim.py`)
- Coupled agents → Goal state: updates goals (evidence: `society_sim.py`)
- Voice bridge → Phone microphone: records audio
- Music synthesis → Audio playback: plays WAV (evidence: `systems/music.py`)
