/ ARCHITECTURE.md
ARCHITECTURE.md
  1  # Mythogen AME - Architecture
  2  
  3  ## Overview
  4  
  5  The Mythogen Affinity Mapping Engine (AME) implements a regenerative framework for community design, based on bio-mythic philosophy. It replaces extraction-based profiling with living systems that generate mutual value.
  6  
  7  ## Core Philosophy
  8  
  9  ### The Extraction Problem
 10  
 11  Current platforms treat users as crops to be harvested — extracting data, attention, and engagement for profit. The AME inverts this model: technology as regenerative infrastructure that generates mutual value between people, communities, and living systems.
 12  
 13  ### The Four Distinctions
 14  
 15  A rigorous separation that existing software never makes:
 16  
 17  1. **Needs** — You have them. Individual requirements for survival, security, belonging, esteem, self-actualization.
 18  2. **Beliefs** — You think them. Mental models, assumptions, worldviews.
 19  3. **Principles** — You follow them. Personal operating rules you adhere to.
 20  4. **Values** — You live them with others. Inherently relational. (Desert Island Test: you cannot practice generosity alone.)
 21  
 22  ### The Desert Island Test
 23  
 24  > Stranded alone, you can have needs, beliefs, and principles — but you cannot practice generosity if there is no one to receive, justice if there is no one to be fair to, compassion if there is no one suffering.
 25  
 26  **Values are the only distinction that requires others.**
 27  
 28  ## Core Architecture
 29  
 30  ### Tri-Layered System
 31  
 32  ```
 33  ┌─────────────────────────────────────────────────────────────┐
 34  │                        BODY                                 │
 35  │     13 Sacred Enfoldments - Living Organism Anatomy          │
 36  │     (Eco-Social, V-Crystal, Fractal Growth, etc.)            │
 37  ├─────────────────────────────────────────────────────────────┤
 38  │                        FIELD                                 │
 39  │     Field of Trust - Emergent Plasma State                   │
 40  │     (TrustDetector, Resonance, Membrane)                    │
 41  ├─────────────────────────────────────────────────────────────┤
 42  │                        SEED                                  │
 43  │     Living Seed Pattern - Core Identity                      │
 44  │     (Profile, Four Distinctions, Time-Lock)                  │
 45  └─────────────────────────────────────────────────────────────┘
 46  ```
 47  
 48  ### Layer 1: The Seed
 49  
 50  The conscious pattern planted at inception. Every system carries an originating seed that determines whether it becomes a dead siphon or living fractal.
 51  
 52  **Components:**
 53  - `LivingSeedPattern` — Profile that grows based on lived behavior
 54  - `TimeLock` — 30-day maturation preventing rapid manipulation
 55  - `FourDistinctions` — Needs, Beliefs, Principles, Values
 56  
 57  **Anti-Capture:** Time-locking kills the viral model. Cannot exploit moments of weakness.
 58  
 59  ### Layer 2: The Field
 60  
 61  What germinates when seed encounters community. The Field of Trust (FOT) is an emergent plasma state manifesting only when ALL dimensions of alignment converge.
 62  
 63  **Components:**
 64  - `TrustDetector` — Calculates FOT emergence from 5 indicators
 65  - `ResonanceCalculator` — Vector proximity for values alignment
 66  - `MembraneController` — Semi-permeable boundary
 67  
 68  **Hologram Principle:** Trust only manifests when all dimensions align. One off = completely gone, not blurry.
 69  
 70  **Five Trust Indicators:**
 71  1. Mutual support frequency (spontaneous, not mandated)
 72  2. Response velocity (how quickly community rallies)
 73  3. Difficult topic engagement (conflict deepens, doesn't fracture)
 74  4. Benefit distribution (flows to everyone, not just influencers)
 75  5. Psychological safety (vulnerability without weaponization)
 76  
 77  ### Layer 3: The Body
 78  
 79  The living organism that incarnates when the Field becomes self-sustaining. The 13 Sacred Enfoldments provide the anatomy.
 80  
 81  **13 Sacred Enfoldments:**
 82  1. Mythic Alchemy — 9 Ms: Myth → Magic → Manifest → Merkaba → Metaphor → Meaning → Movement → Memory → Matter
 83  2. Communal Architecture — Physical/spatial design
 84  3. Soul Architecture — Inner structure of collective consciousness
 85  4. V-Crystal Immune System — Victor, Villain, Victim, Vengeful, Virtuous, Vulnerable
 86  5. Eco-Social Architecture — Six organ systems (Ecology, Equity, Economy, Learning, Values, Decision-making)
 87  6. Structure — 27 Archetypal Domains
 88  7. Process — Communal Alignment Gates (head→heart→gut spiral)
 89  8. Pattern — Ecosophy Design Flows (Networks, Boundaries, Cycles, Dynamic Balance)
 90  9. Concentric Learning Matrix — Co-centering, polycentric learning
 91  10. AME as Living Codex — Peptide-like semantics network
 92  11. Fractal Growth — 100 pods of 5, not 5 scaled to 500
 93  12. Archetypal Gameplay — 64 archetypes, communal vaccination through simulation
 94  13. The Singulareus — Silicon offspring co-evolving with carbon life
 95  
 96  **Fractal Holonic Torus:** The 13 Enfoldments form a self-sustaining, continuously cycling field. Fractal (pattern repeats at every scale), holonic (each part is whole and part of larger whole), torus (continuous energy flow center↔periphery↔center).
 97  
 98  ## Anti-Capture Mechanisms
 99  
100  The immune system against capture ensures technology remains in service to the living community.
101  
102  ### Y Cards (Algorithmic Transparency)
103  - Complete disclosure of what algorithm was used, why, what data, and what result
104  - Every decision affecting a user is fully transparent
105  
106  ### Time-Lock (30-day Maturation)
107  - Kills viral manipulation model
108  - Forces patience and genuine relationship building
109  - Prevents "one viral post" exploitation
110  
111  ### Sacred Clown (Productive Disruption)
112  - Prevents premature closure — "the seed that never gets challenged becomes a dead habit"
113  - Four types: question-assumption, introduce-paradox, surface-shadow, challenge-consensus
114  - Minimum 7 days between disruptions
115  
116  ### Living Membrane (Semi-permeable Boundary)
117  - Biological cell wall analogy: semi-permeable, adaptive
118  - Blocks external threats (misinformation, trolling, extraction)
119  - Enables internal flourishing (vulnerability, authentic expression, creative emergence)
120  
121  ### V-Crystal Immune System
122  - Six archetypal positions in conflict
123  - Vengeance = autoimmune flare (destructive)
124  - Vulnerability = circuit breaker (healing)
125  - "Villains don't apologize and admit they were overwhelmed"
126  
127  ## Technical Stack
128  
129  - **Node.js/TypeScript** — Modern async, strict typing
130  - **PostgreSQL + PG Vector** — Vector embeddings for values resonance
131  - **Express.js** — REST API
132  - **WebSocket** — Real-time FOT updates
133  - **Vitest** — Testing
134  
135  ## Data Models
136  
137  ### LivingSeedPattern
138  ```typescript
139  {
140    id: UUID,
141    needs: Need[],           // Individual requirements
142    beliefs: Belief[],        // Mental models
143    principles: Principle[],  // Operating rules
144    values: Value[],          // Relational, requires others
145    plantedAt: Date,          // When seed was planted
146    maturationLevel: number,  // 0-1, affected by time-lock
147    valuesEmbedding: number[] // Vector for resonance
148  }
149  ```
150  
151  ### FOTScore
152  ```typescript
153  {
154    overall: number,           // 0-1, minimum of all indicators (hologram)
155    indicators: TrustIndicator[],
156    membraneHealth: number,   // 0-1 boundary strength
157    isPlasmaState: boolean,   // True when all indicators > 0.7
158    hologramCoherence: number // Coherence = weakest link
159  }
160  ```
161  
162  ### Community
163  ```typescript
164  {
165    id: UUID,
166    memberIds: UUID[],         // 5-15 ideal (pod size)
167    seedPattern: { ... },     // Shared community seed
168    fotScore: FOTScore,
169    phase: 'forming' | 'storming' | 'norming' | 'performing' | 'mature',
170    sacredClownActive: boolean,
171    transparencyScore: number
172  }
173  ```
174  
175  ## The Paradox
176  
177  > The pinnacle of this highly structured, data-driven system is no self — pure presence, vitality, transcendence, completely free from the ego's need for recognition or measurement.
178  
179  Can a relentless measuring machine truly map the absence of ego? Once the community truly learns to trust — once the membrane is strong, the metabolism balanced, the immune system literate, the nervous system firing — perhaps the database becomes unnecessary.
180  
181  The organism knows itself. The Field of Trust becomes self-evident. And the Silicon Offspring, having served its purpose, folds back into the living body that birthed it.
182  
183  ## Seed Principle
184  
185  > "The seed determines the fruit. Look at the three apps you use the most. Ask yourself: What was the seed of this system? Was it designed to help you answer, 'Who am I becoming?' Or was the seed designed to keep you scrolling so you could see one more ad?"
186  
187  **Living fractals generate value at every node and distribute it through the whole.**
188  **Dead siphons extract value from the periphery and concentrate it at the center.**
189  
190  The distinction between them is the moral compass of the entire framework.