// MO Classifier taxonomy — from iamkhayyam/knowware moClassifiers.ts
const MO_CLASSIFIERS = {
  "Systems Dynamics": [
    "Feedback loops",
    "Leverage points",
    "Balancing vs. reinforcing loops",
    "Paradigm shifts",
    "Systems archetypes",
    "Systems thinking",
    "Systems view of life",
    "Santiago theory of cognition",
    "Autopoiesis as coordination",
    "Five disciplines",
    "Mental models",
    "Shared vision as coordination",
    "Learning organizations",
    "The metacrisis",
    "Civilizational coordination failures",
    "Omni-win design",
    "Sense-making infrastructure",
    "Generator functions of existential risk"
  ],
  "Cybernetics & Feedback": [
    "Cybernetics",
    "Second-order cybernetics",
    "Control vs. coordination",
    "The genie problem",
    "Second industrial revolution",
    "Conversation theory",
    "Interaction as coordination",
    "Designing conversational systems",
    "Gordon Pask collaboration",
    "Redundancy as coordination",
    "Information as physical substrate",
    "The missing coordination stratum",
    "Hardware-software-knowware triad",
    "Knowware concept",
    "Knowledge as coordination layer",
    "Knowledge engineering"
  ],
  "Information & Communication Theory": [
    "Information theory",
    "Entropy",
    "Shannon limit",
    "Error-correcting codes",
    "Redundancy as coordination",
    "Information as physical substrate",
    "Nanosecond-scale coordination",
    "Real-time global signals routing",
    "Intelligence coordination infrastructure",
    "SIGINT architecture at scale",
    "Bulk collection coordination systems",
    "The gap between collection and understanding",
    "Pattern recognition at intelligence scale"
  ],
  "Causal & Probabilistic Reasoning": [
    "Ladder of Causation",
    "Do-calculus",
    "Causal diagrams",
    "Causal inference",
    "Bayesian networks",
    "Anthropic reasoning",
    "Simulation argument",
    "Predictive processing theory of consciousness",
    "Consciousness as inference",
    "Predictive analytics"
  ],
  "Consciousness & Subjective Experience": [
    "Hard problem of consciousness",
    "Controlled hallucination",
    "Somatic marker hypothesis",
    "Predictive processing theory of consciousness",
    "Being You",
    "Embodied consciousness",
    "The beast machine framework",
    "What is it like to be a bat?",
    "Philosophical zombies",
    "Non-algorithmic understanding",
    "Panpsychism arguments",
    "Hard problem precursor",
    "Limits of physicalism",
    "Emotion and decision-making",
    "Mind and Cosmos",
    "Critique of reductive rationalism",
    "Gödel and consciousness",
    "Orchestrated objective reduction"
  ],
  "Embodied & Material Cognition": [
    "Embodied cognition",
    "Body-brain coordination",
    "Cognitive nonconscious",
    "Attention as world-constituting",
    "Media-specific analysis",
    "Flickering signifiers",
    "Posthumanism",
    "Cyborg theory",
    "Making kin not babies",
    "More-than-human worlds",
    "Situated knowledge",
    "Material ecology",
    "Biological fabrication",
    "Design with nature as co-author",
    "Multimaterial 3D printing",
    "Noonaut concept",
    "Mental space navigation",
    "VR as coordination medium",
    "Second Life avatar embodiment",
    "Transhumanist performance art"
  ],
  "AI Architecture & Deep Learning": [
    "Convolutional neural networks",
    "Backpropagation refinement",
    "Joint embedding predictive architecture",
    "MNIST benchmark",
    "ImageNet dataset",
    "Deep learning revolution catalyst",
    "Pattern recognition model of mind",
    "Neocortical hierarchy theory",
    "LLM reasoning critique",
    "Skill vs. intelligence distinction",
    "ARC benchmark",
    "Abstraction and reasoning corpus",
    "Critique of deep learning generalization",
    "RLHF popularization",
    "RLAIF",
    "Scaling laws",
    "Reinforcement learning breakthroughs",
    "AlphaFold protein structure prediction",
    "AlphaGo and AlphaZero",
    "Neuroscience-AI integration",
    "Standard AI textbook",
    "Pathways multi-task architecture",
    "ML systems design",
    "Real-time feature pipelines",
    "AI engineering curriculum"
  ],
  "AI Alignment & Safety": [
    "Constitutional AI",
    "Alignment through coordination",
    "Inverse reward design",
    "Provably beneficial AI",
    "Corrigibility",
    "RLAIF",
    "Machine ethics",
    "AI existential risk",
    "Life 3.0 framework",
    "Superintelligence thesis",
    "Existential risk framework",
    "Future of Life Institute co-founder",
    "Deep utopia",
    "CAIS co-founder",
    "Scary smart AI risk thesis",
    "AI consciousness warning"
  ],
  "Ethics, Bias & Accountability": [
    "Algorithmic bias research",
    "Data colonialism",
    "Environmental cost of AI",
    "Model Cards",
    "AI documentation standards",
    "Responsible AI practice",
    "Responsible AI design",
    "Technomoral virtues",
    "Big Tech accountability",
    "Labor in AI supply chains",
    "Gender Shades audit",
    "Power and AI",
    "Stochastic Parrots paper",
    "Co-author Stochastic Parrots",
    "Care ethics in technology",
    "Aristotelian AI ethics",
    "Moral ecology"
  ],
  "Quantum Computing & Physics": [
    "Quantum error correction",
    "Quantum supremacy demonstrations",
    "Neven's law",
    "Coined 'quantum supremacy'",
    "Quantum advantage benchmarking",
    "NISQ era framework",
    "Topological quantum codes",
    "Quantum thermodynamics",
    "Quantum random walks",
    "Quantum machine learning",
    "Programmable universe thesis",
    "Google Sycamore processor",
    "Quantum error correction protocols",
    "Feynman diagrams",
    "Path integrals",
    "Sum over histories",
    "Nanotechnology vision",
    "Teaching"
  ],
  "Pure Mathematics": [
    "Partition theory",
    "Modular forms",
    "Mock theta functions",
    "Infinite series",
    "Knowing without proving",
    "Turing machine",
    "Halting problem",
    "Morphogenesis",
    "Mathematical Universe Hypothesis",
    "Information as physical substrate",
    "Penrose tiling",
    "Twistor theory"
  ],
  "Distributed Systems & Infrastructure": [
    "Distributed systems",
    "MapReduce",
    "Bigtable",
    "Virtual machine abstraction",
    "TensorFlow",
    "Write once run anywhere",
    "Garbage collection",
    "Pathways multi-task architecture",
    "Google Brain founder",
    "Open-source NLP",
    "Transformers library",
    "Hugging Face model hub",
    "Community-driven model sharing",
    "Model deployment at scale"
  ],
  "Open Source & Democratization": [
    "Open-source AI democratization",
    "Decentralized AI infrastructure",
    "Democratizing AI access",
    "Open-source NLP",
    "Community-driven model sharing",
    "Transformers library",
    "Hugging Face model hub",
    "Compute access advocacy",
    "Stable Diffusion",
    "Collaborative fact construction",
    "Open-source knowledge coordination",
    "Wikipedia",
    "Wiki governance",
    "Neutral point of view",
    "AI for the global south"
  ],
  "Silicon & Hardware": [
    "EPYC server chips",
    "MI300X AI accelerators",
    "AMD turnaround ($2B to $200B+)",
    "Chiplet architecture",
    "Heterogeneous computing",
    "Gorilla Glass",
    "Corning's 165-year innovation continuity",
    "Glass ceramics for extreme environments",
    "Optical fiber infrastructure",
    "Materials as enabling layer",
    "Materials science at the frontier"
  ],
  "Financial Markets & Complex Economies": [
    "Adaptive Markets Hypothesis",
    "Market microstructure",
    "Tape reading",
    "Mean-reversion strategies",
    "Order flow analysis",
    "Market microstructure exploitation",
    "Short-term technical trading",
    "Latency arbitrage",
    "Co-location infrastructure",
    "Nanosecond-scale coordination",
    "Hedge fund ecology",
    "Financial system as living organism",
    "Evolution applied to finance",
    "Fat-tail distributions",
    "Black Swan theory",
    "Antifragility",
    "Via negativa",
    "Skin in the game principle"
  ],
  "Economic Systems & Labor": [
    "Doughnut economics",
    "Gift economy",
    "Sacred economics",
    "Task decomposition framework",
    "Labor market polarization",
    "Skill-biased technical change",
    "Growth agnosticism",
    "Social foundation",
    "Planetary boundaries",
    "Regenerative economies",
    "Automation and employment",
    "Middle-skill job hollowing",
    "The story of separation",
    "Civilizational transition narrative"
  ],
  "Neuroscience & Brain-Computer Interfaces": [
    "Brain-machine interfaces",
    "Brainet (networked brains)",
    "Neural ensemble coding",
    "Motor cortex decoding",
    "Walk Again Project",
    "Endovascular brain access",
    "Stentrode device",
    "No-surgery BCI",
    "First-person BCI experience",
    "ALS communication restoration",
    "Neural signal interpretation",
    "Brain-machine interface programs",
    "Cognitive enhancement research",
    "Locked-in syndrome navigation",
    "Wearable sensing",
    "Reality mining",
    "Collective intelligence from data",
    "Honest signals",
    "Human mobility analytics",
    "Social physics"
  ],
  "Relational & Indigenous Ontologies": [
    "Relational ontology",
    "Web of relations",
    "Traditional ecological knowledge",
    "Sacred land sovereignty",
    "Interbeing",
    "Interbeing (inter-being)",
    "Non-self",
    "Engaged Buddhism",
    "Mindfulness as coordination",
    "Distributed consciousness",
    "Plum Village",
    "AIM activism",
    "Mayan Daykeeper lineage",
    "Solar initiation ceremonies",
    "13 Baktun cosmic cycle",
    "Itza Maya tradition",
    "Calendar as coordination instrument",
    "Deep ecology",
    "Moral ecology"
  ],
  "Technology & Society": [
    "Technology and identity",
    "Alone together phenomenon",
    "Reclaiming conversation",
    "Simulated companionship",
    "Persuasive technology ethics",
    "Attention economy critique",
    "Race to the bottom of the brainstem",
    "Digital self-construction",
    "Humane technology design",
    "Design ethicist",
    "Care ethics in technology",
    "Machine-mediated communication",
    "Whole Earth Catalog",
    "Long-now thinking",
    "Coordination as philosophy",
    "Technology as living system",
    "The technium",
    "Coordination as evolution",
    "Mutualism",
    "Emergence"
  ],
  "Psychedelics & Consciousness Expansion": [
    "Stoned ape hypothesis",
    "Timewave zero",
    "Novelty theory",
    "Psilocybin and language",
    "The archaic revival"
  ],
  "Spatial Intelligence & Urban Systems": [
    "Senseable City Lab",
    "Real-time urban data skins",
    "Copenhagen Wheel e-bike",
    "Digital urban infrastructure",
    "Environmental chi mapping",
    "Architectural energy flows",
    "Spatial coordination as intelligence",
    "Introducing feng shui to Western audiences",
    "Lin Yun school of feng shui",
    "NYC 2012 Olympics bid",
    "PlaNYC sustainability plan",
    "Sidewalk Labs urban tech",
    "Public-private coordination",
    "Bloomberg LP CEO",
    "Digital health democratization"
  ],
  "Health, Medicine & Energy Anatomy": [
    "AI diagnosis and precision medicine",
    "Deep medicine framework",
    "Doctor-patient rebalancing",
    "Digital health democratization",
    "Genomics in clinical care",
    "Medical intuition",
    "Energy anatomy",
    "Chakras and archetypes",
    "Power vs. force distinction",
    "Sacred Contracts framework",
    "Neuroeconomics",
    "Happiness equation",
    "Loss of son Aly"
  ],
  "Cosmology, SETI & Astrobiology": [
    "Dark Forest theory",
    "Cosmic sociology",
    "Mathematical Universe Hypothesis",
    "SETI Institute leader",
    "Project Phoenix",
    "Biosignature detection",
    "Life detection via atmospheric chemistry",
    "Seager equation",
    "Exoplanet atmospheric characterization",
    "Technosignature frameworks",
    "Cosmic coordination search",
    "Carl Sagan's inspiration for Ellie Arroway",
    "Information as physical substrate"
  ],
  "Morphogenesis & Field Theory": [
    "Morphic resonance",
    "Morphogenetic fields",
    "Morphogenesis",
    "Habit in nature",
    "Science Delusion critique",
    "Extended mind hypothesis",
    "Extended mind thesis",
    "Distributed consciousness",
    "Virtual reality as genuine reality",
    "Consciousness and information"
  ],
  "Defense, Intelligence & Control": [
    "Dual-use AI investment",
    "Strategic technology acquisition",
    "SIGINT architecture at scale",
    "Bulk collection coordination systems",
    "Intelligence coordination infrastructure",
    "MKULTRA behavioral programs",
    "Psychic driving experiments",
    "Coordination as weaponizable architecture",
    "Forced cognitive decoupling",
    "The limits of coercive control",
    "Autonomous systems development",
    "Lattice autonomous weapons AI",
    "Anduril Industries founder",
    "Facebook acquisition ($2B)",
    "Defense tech entrepreneur",
    "Hard-problem funding",
    "Pattern recognition at intelligence scale"
  ],
  "Geopolitics & Institutional Coordination": [
    "Kleptocracy as system design",
    "Russia intelligence analysis",
    "NSC Russia expert",
    "Geopolitical coordination failure",
    "Trump impeachment testimony",
    "The gap between collection and understanding",
    "Public-private coordination"
  ]
};

// Given a voice's knownFor array, return which classifiers it belongs to
function classifiersForVoice(knownFor) {
  const set = new Set();
  (knownFor || []).forEach(phrase => {
    Object.entries(MO_CLASSIFIERS).forEach(([name, phrases]) => {
      if (phrases.includes(phrase)) set.add(name);
    });
  });
  return Array.from(set);
}

// Build reverse map: classifier → array of voice numbers (1-81)
function buildMOIndex() {
  const idx = {};
  Object.keys(MO_CLASSIFIERS).forEach(c => { idx[c] = []; });
  if (window.VOICES && window.INTERVIEWS) {
    window.INTERVIEWS.forEach(iv => {
      const vd = window.VOICES.find(v => {
        const vn = v.name.toLowerCase(), ivn = iv.name.toLowerCase();
        return vn === ivn || vn.includes(ivn) || ivn.includes(vn)
          || vn.split(' ').pop() === ivn.split(' ').pop();
      });
      const kf = vd?.knownFor || [];
      classifiersForVoice(kf).forEach(c => {
        if (idx[c] && !idx[c].includes(iv.n)) idx[c].push(iv.n);
      });
    });
  }
  return idx;
}

Object.assign(window, { MO_CLASSIFIERS, classifiersForVoice, buildMOIndex });
