Navigation map for the MiroFish codebase. 63 Python files.
app/cli.py— CLI (mirofish run,mirofish runs). Orchestrates full pipeline via WorkbenchSession.
workbench_session.py— Session wrapper, composes tools + resourcesresource_loader.py— Initializes all persistence storessession_manager.py— Tracks active project/graph/simulation/report IDstask_manager.py— Async task state machine (PENDING → RUNNING → COMPLETED/FAILED)
Composable steps called by WorkbenchSession in sequence:
generate_ontology.py— LLM entity/relationship extraction from documentsbuild_graph.py— Ontology → JSON graphprepare_simulation.py— Generate agent profiles via LLMrun_simulation.py— Launch OASIS subprocess, track progressgenerate_report.py— Single-pass report generation (callsgenerate_report_fast)simulation_support.py— Shared utilities across tools
Heavy business logic:
graph_storage.py— Abstract GraphStorage + JSON backend (~420 lines)graph_db.py— Query facade over graph storagegraph_builder.py— Ontology → graph construction pipelineentity_extractor.py— Structured LLM extractionentity_reader.py— Entity filtering and enrichmentontology_generator.py— LLM prompts for extractionoasis_profile_generator.py— Agent persona generationsimulation_config_generator.py— Simulation config assemblysimulation_manager.py— Simulation lifecycle state machinesimulation_runner.py— Subprocess spawning, IPC, monitoring, atexit cleanup, action caching (~1470 lines)simulation_ipc.py— File-based IPC with OASIS processessimulation_platforms.py— Twitter/Reddit data normalizationreport_agent.py— Single-pass report generation + ReportManager persistence (~450 lines)graph_tools.py— Graph queries + agent interview (~570 lines)graph_memory_updater.py— Post-simulation graph updatestext_processor.py— Encoding detection
Persistence adapters (thin wrappers over filesystem):
projects/— Project metadata storedocuments/— Document file storegraph/— Graph store adaptersimulations/— Simulation state storereports/— Report storellm/— LLM provider config
llm_client.py— CLI-only LLM client with retry (claude-cli, codex-cli)oasis_llm.py— CAMEL/OASIS CLI bridge (fakes OpenAI ChatCompletion for simulation engine)file_parser.py— PDF/text extractionlogger.py— Structured logging
app/run_artifacts.py— RunStore: immutable run directories with manifestapp/visual_snapshots.py— SVG generation (swarm, cluster, timeline, platform-split)
OASIS simulation runners (spawned as subprocesses by simulation_runner.py):
run_parallel_simulation.py— Dual-platform (Twitter + Reddit)run_twitter_simulation.py— Twitter-onlyrun_reddit_simulation.py— Reddit-onlyaction_logger.py— Per-action recording during simulation
app/config.py— Environment loading, Config class.env/.env.example— LLM provider configpyproject.toml— Dependencies,[project.scripts]entry point