# probablyapigeon/psychophysical_oscilloscope_lonk architecture

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

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

## Overview

This repository is an offline creature-world simulator with Jarvis and Plink as its interactive agents. The principal path is user input through the launcher into world turns, agent dialogue/actions, and observable state through the Scope and introspection reports. Separate branches cover civilization mechanics, terminal/browser presentation, duet music, and optional YouTube chat. The README documents these capabilities; the graph uses it where source excerpts do not show wiring. Some module-level connections are omitted because their callers were not sampled.

Main entry points: [`run_jarvis.py`](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/run_jarvis.py) (Interactive Launcher), [`dynamiclonk-py-v13-lonks-finally-have-ears-say-command-fixed.py`](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/dynamiclonk-py-v13-lonks-finally-have-ears-say-command-fixed.py) (World Entry Point), [`lonk_live.py`](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/lonk_live.py) (Terminal World View), [`lonk_dialogue.py`](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/lonk_dialogue.py) (Compositional Dialogue)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Interaction"]
  node_launcher["Interactive Launcher<br/>[run_jarvis.py]"]
  node_legacy["World Entry Point"]
end

subgraph group_world["World and Agents"]
  node_worldsim["Civilization Simulation<br/>[lonk_society.py]"]
  node_agent["Lonk Agents"]
  node_dialogue["Compositional Dialogue<br/>[lonk_dialogue.py]"]
  node_semantics["Language Semantics<br/>[lonk_semantics.py]"]
  node_exit["Action Policy"]
  node_xembra["XEMBRA Runtime<br/>[XEMBRAROBOT.PY]"]
  node_reaction["Reaction Selection"]
  node_novelty["Novelty State<br/>[novelty.py]"]
end

subgraph group_insight["State and Insight"]
  node_introspection["Self-Readings"]
  node_telemetry[("Event Telemetry")]
  node_scope["Spinor Scope<br/>[jarvis_scope.py]"]
  node_library["Dialogue Memory<br/>[jarvis_library.py]"]
end

subgraph group_presentation["Views and Music"]
  node_terminal["Terminal World View<br/>[lonk_live.py]"]
  node_map["Room Map<br/>[lonk_map.py]"]
  node_visuals["Visual Helpers<br/>[lonk_visuals.py]"]
  node_browser["Browser Scope<br/>[scope.js]"]
  node_duet["Duet Playback<br/>[jarvis_duet.py]"]
end

subgraph group_integrations["External Integration"]
  node_youtube["YouTube Live Bridge<br/>[lonk_youtube.py]"]
  node_youtubechat(("YouTube Chat"))
end

node_user(("Player"))

node_user -->|"enters commands"| node_launcher
node_launcher -->|"advances turns"| node_worldsim
node_launcher -->|"routes interaction"| node_agent
node_agent -->|"acts in"| node_worldsim
node_agent -->|"uses dialogue"| node_dialogue
node_dialogue -->|"uses semantics"| node_semantics
node_launcher -->|"queries readings"| node_introspection
node_launcher -->|"records events"| node_telemetry
node_launcher -->|"updates scope"| node_scope
node_launcher -->|"loads dialogue"| node_library
node_launcher -->|"renders world"| node_terminal
node_terminal -->|"renders map"| node_map
node_map -->|"uses glyphs"| node_visuals
node_terminal -->|"uses presentation"| node_visuals
node_launcher -->|"opens scope"| node_browser
node_launcher -->|"starts playback"| node_duet
node_agent -->|"reports changes"| node_introspection
node_agent -->|"emits observations"| node_telemetry
node_user -->|"interacts directly"| node_legacy
node_legacy -->|"uses civilization"| node_worldsim
node_legacy -->|"uses dialogue"| node_dialogue
node_legacy -->|"uses semantics"| node_semantics
node_legacy -->|"configures bridge"| node_youtube
node_youtubechat -->|"sends messages"| node_youtube
node_xembra -->|"selects reactions"| node_reaction
node_reaction -.->|"weights novelty"| node_novelty

click node_launcher "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/run_jarvis.py"
click node_legacy "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/dynamiclonk-py-v13-lonks-finally-have-ears-say-command-fixed.py"
click node_worldsim "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/lonk_society.py"
click node_agent "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/dynamiclonk-py-v13-lonks-finally-have-ears-say-command-fixed.py"
click node_dialogue "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/lonk_dialogue.py"
click node_semantics "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/lonk_semantics.py"
click node_exit "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/lonk_exit_policy.py"
click node_xembra "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/xembra_runtime/XEMBRAROBOT.PY"
click node_reaction "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/xembra_runtime/modules/reaction_generator.py"
click node_novelty "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/xembra_runtime/modules/novelty.py"
click node_introspection "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/jarvis_introspection.py"
click node_telemetry "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/jarvis_telemetry.py"
click node_scope "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/jarvis_scope.py"
click node_library "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/jarvis_library.py"
click node_terminal "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/lonk_live.py"
click node_map "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/lonk_map.py"
click node_visuals "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/lonk_visuals.py"
click node_browser "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/jarvis_scope_web/scope.js"
click node_duet "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/jarvis_duet.py"
click node_youtube "https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/lonk_youtube.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_launcher,node_legacy toneBlue
class node_worldsim,node_agent,node_dialogue,node_semantics,node_exit,node_xembra,node_reaction,node_novelty toneAmber
class node_introspection,node_telemetry,node_scope,node_library toneMint
class node_terminal,node_map,node_visuals,node_browser,node_duet toneRose
class node_youtube,node_youtubechat,node_user toneIndigo
```

## Components

### Interaction

- [Interactive Launcher](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/run_jarvis.py): `run_jarvis.py`
- [World Entry Point](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/dynamiclonk-py-v13-lonks-finally-have-ears-say-command-fixed.py): `dynamiclonk-py-v13-lonks-finally-have-ears-say-command-fixed.py`

### World and Agents

- [Civilization Simulation](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/lonk_society.py): `lonk_society.py`
- [Lonk Agents](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/dynamiclonk-py-v13-lonks-finally-have-ears-say-command-fixed.py): `dynamiclonk-py-v13-lonks-finally-have-ears-say-command-fixed.py`
- [Compositional Dialogue](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/lonk_dialogue.py): `lonk_dialogue.py`
- [Language Semantics](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/lonk_semantics.py): `lonk_semantics.py`
- [Action Policy](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/lonk_exit_policy.py): `lonk_exit_policy.py`
- [XEMBRA Runtime](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/xembra_runtime/XEMBRAROBOT.PY): `xembra_runtime/XEMBRAROBOT.PY`
- [Reaction Selection](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/xembra_runtime/modules/reaction_generator.py): `xembra_runtime/modules/reaction_generator.py`
- [Novelty State](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/xembra_runtime/modules/novelty.py): `xembra_runtime/modules/novelty.py`

### State and Insight

- [Self-Readings](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/jarvis_introspection.py): `jarvis_introspection.py`
- [Event Telemetry](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/jarvis_telemetry.py): `jarvis_telemetry.py`
- [Spinor Scope](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/jarvis_scope.py): `jarvis_scope.py`
- [Dialogue Memory](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/jarvis_library.py): `jarvis_library.py`

### Views and Music

- [Terminal World View](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/lonk_live.py): `lonk_live.py`
- [Room Map](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/lonk_map.py): `lonk_map.py`
- [Visual Helpers](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/lonk_visuals.py): `lonk_visuals.py`
- [Browser Scope](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/jarvis_scope_web/scope.js): `jarvis_scope_web/scope.js`
- [Duet Playback](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/jarvis_duet.py): `jarvis_duet.py`

### External Integration

- [YouTube Live Bridge](https://github.com/probablyapigeon/psychophysical_oscilloscope_lonk/blob/main/lonk_youtube.py): `lonk_youtube.py`
- **YouTube Chat**

### Other components

- **Player**

## Connections

- Player → Interactive Launcher: enters commands (evidence: `README.md`)
- Interactive Launcher → Civilization Simulation: advances turns (evidence: `run_jarvis.py`)
- Interactive Launcher → Lonk Agents: routes interaction (evidence: `run_jarvis.py`)
- Lonk Agents → Civilization Simulation: acts in (evidence: `dynamiclonk-py-v13-lonks-finally-have-ears-say-command-fixed.py`)
- Lonk Agents → Compositional Dialogue: uses dialogue (evidence: `dynamiclonk-py-v13-lonks-finally-have-ears-say-command-fixed.py`)
- Compositional Dialogue → Language Semantics: uses semantics (evidence: `lonk_dialogue.py`)
- Interactive Launcher → Self-Readings: queries readings (evidence: `run_jarvis.py`)
- Interactive Launcher → Event Telemetry: records events (evidence: `run_jarvis.py`)
- Interactive Launcher → Spinor Scope: updates scope (evidence: `run_jarvis.py`)
- Interactive Launcher → Dialogue Memory: loads dialogue (evidence: `run_jarvis.py`)
- Interactive Launcher → Terminal World View: renders world (evidence: `README.md`)
- Terminal World View → Room Map: renders map (evidence: `lonk_live.py`)
- Room Map → Visual Helpers: uses glyphs (evidence: `lonk_map.py`)
- Terminal World View → Visual Helpers: uses presentation (evidence: `lonk_live.py`)
- Interactive Launcher → Browser Scope: opens scope (evidence: `README.md`)
- Interactive Launcher → Duet Playback: starts playback (evidence: `README.md`)
- Lonk Agents → Self-Readings: reports changes (evidence: `README.md`)
- Lonk Agents → Event Telemetry: emits observations (evidence: `README.md`)
- Player → World Entry Point: interacts directly (evidence: `README.md`)
- World Entry Point → Civilization Simulation: uses civilization (evidence: `dynamiclonk-py-v13-lonks-finally-have-ears-say-command-fixed.py`)
- World Entry Point → Compositional Dialogue: uses dialogue (evidence: `dynamiclonk-py-v13-lonks-finally-have-ears-say-command-fixed.py`)
- World Entry Point → Language Semantics: uses semantics (evidence: `dynamiclonk-py-v13-lonks-finally-have-ears-say-command-fixed.py`)
- World Entry Point → YouTube Live Bridge: configures bridge (evidence: `README.md`)
- YouTube Chat → YouTube Live Bridge: sends messages (evidence: `README.md`)
- XEMBRA Runtime → Reaction Selection: selects reactions (evidence: `xembra_runtime/XEMBRAROBOT.PY`)
- Reaction Selection → Novelty State: weights novelty
