totemheart 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. package/README.md +177 -122
  2. package/package.json +10 -1
  3. package/src/Totemheart.js +2578 -15
  4. package/src/behavior/AffectAlignmentMonitor.js +66 -0
  5. package/src/behavior/AudienceDesign.js +43 -0
  6. package/src/behavior/BlushSlipEngine.js +90 -0
  7. package/src/behavior/ConversationalRepair.js +50 -0
  8. package/src/behavior/CreativeModeSwitch.js +47 -0
  9. package/src/behavior/EffortWithholding.js +51 -0
  10. package/src/behavior/HumanDiscourseShaper.js +87 -0
  11. package/src/behavior/MeaningfulSilence.js +36 -0
  12. package/src/behavior/PolitenessShutdown.js +58 -0
  13. package/src/behavior/PostConflictCooling.js +54 -0
  14. package/src/behavior/RegulationStrategySelector.js +109 -0
  15. package/src/behavior/SelfHandicapping.js +38 -0
  16. package/src/behavior/StyleMimicry.js +26 -0
  17. package/src/cognition/AmusementEngine.js +73 -0
  18. package/src/cognition/AnticipatedRegretEngine.js +48 -0
  19. package/src/cognition/AweSystem.js +37 -0
  20. package/src/cognition/ChildlikeMode.js +189 -0
  21. package/src/cognition/ChillsEngine.js +93 -0
  22. package/src/cognition/CognitiveDissonance.js +65 -0
  23. package/src/cognition/ConservationWithdrawal.js +70 -0
  24. package/src/cognition/ControllabilityEstimate.js +60 -1
  25. package/src/cognition/CravingTrace.js +70 -0
  26. package/src/cognition/DefenseMechanisms.js +13 -6
  27. package/src/cognition/DesireEngine.js +133 -0
  28. package/src/cognition/DriftDiffusionModel.js +70 -0
  29. package/src/cognition/EmotionalForecasting.js +76 -0
  30. package/src/cognition/EmotionalImmuneSystem.js +68 -0
  31. package/src/cognition/EmotionalOntology.js +19 -1
  32. package/src/cognition/EnergyBudget.js +68 -0
  33. package/src/cognition/EpisodicFutureSimulation.js +57 -0
  34. package/src/cognition/GlobalWorkspace.js +57 -0
  35. package/src/cognition/GoalHierarchyManager.js +77 -0
  36. package/src/cognition/HabitVsGoalSystem.js +86 -0
  37. package/src/cognition/HickHymanLaw.js +35 -0
  38. package/src/cognition/HopeDisappointmentSystem.js +76 -0
  39. package/src/cognition/IdealSelfDiscrepancy.js +54 -0
  40. package/src/cognition/InhibitoryControlPool.js +65 -0
  41. package/src/cognition/InsightGenerator.js +98 -0
  42. package/src/cognition/IntuitionEngine.js +343 -0
  43. package/src/cognition/MeaningMakingEngine.js +69 -0
  44. package/src/cognition/MetaEmotionLayer.js +67 -0
  45. package/src/cognition/MetacognitiveConfidence.js +52 -0
  46. package/src/cognition/MoralLicensing.js +53 -0
  47. package/src/cognition/MortalitySalience.js +57 -0
  48. package/src/cognition/NormativeExpectationField.js +52 -0
  49. package/src/cognition/OntogenicDevelopment.js +68 -0
  50. package/src/cognition/PercentageOfAssets.js +60 -0
  51. package/src/cognition/PredictiveProcessingCore.js +105 -0
  52. package/src/cognition/ProspectiveMemorySystem.js +73 -0
  53. package/src/cognition/PsychologicalDistanceScaler.js +41 -0
  54. package/src/cognition/ReactanceEngine.js +45 -0
  55. package/src/cognition/ReliefEngine.js +50 -0
  56. package/src/cognition/RuminationVsReflectionSwitch.js +41 -0
  57. package/src/cognition/SchemaAssimilationAccommodation.js +60 -0
  58. package/src/cognition/SelfDistancingSpeech.js +57 -0
  59. package/src/cognition/SignalDetectionTheory.js +106 -0
  60. package/src/cognition/StevensPowerLaw.js +61 -0
  61. package/src/cognition/SubconsciousEngine.js +112 -0
  62. package/src/cognition/SuperegoMonitor.js +54 -0
  63. package/src/cognition/TemporalDiscountingEngine.js +51 -0
  64. package/src/cognition/TemptationField.js +50 -0
  65. package/src/cognition/TipOfTongue.js +104 -0
  66. package/src/cognition/ValueHierarchy.js +26 -0
  67. package/src/cognition/WeberFechnerLaw.js +33 -0
  68. package/src/cognition/WorkingMemoryBuffer.js +72 -0
  69. package/src/cognition/YieldController.js +40 -0
  70. package/src/core/BoredomSystem.js +229 -0
  71. package/src/core/DualProcessController.js +75 -0
  72. package/src/core/EmotionSpace.js +3 -0
  73. package/src/core/FrikiEngine.js +276 -0
  74. package/src/core/GlobalMoodAbatement.js +64 -0
  75. package/src/core/HomeostaticFeelingGenerator.js +70 -0
  76. package/src/core/MoralInjury.js +41 -3
  77. package/src/core/Personality.js +26 -15
  78. package/src/core/PrimaryDrives.js +175 -0
  79. package/src/core/SelfDeterminationNeeds.js +89 -0
  80. package/src/economics/ClassicalConditioning.js +41 -0
  81. package/src/economics/FramingEffect.js +52 -0
  82. package/src/embodiment/InteroceptiveAwarenessGain.js +53 -0
  83. package/src/embodiment/InteroceptivePredictionError.js +13 -4
  84. package/src/embodiment/SomaticActivationSystem.js +71 -0
  85. package/src/embodiment/SomaticMarkerNetwork.js +78 -0
  86. package/src/index.js +2 -0
  87. package/src/neurochemistry/HappinessEngine.js +142 -0
  88. package/src/neurochemistry/SleepQualityCoupler.js +48 -0
  89. package/src/neurochemistry/StressInoculationMemory.js +49 -0
  90. package/src/social/AffiliationThermostat.js +53 -0
  91. package/src/social/BetrayalTraumaTrace.js +120 -0
  92. package/src/social/ColonyDynamics.js +91 -0
  93. package/src/social/ComparisonLevelAlternatives.js +62 -0
  94. package/src/social/ConsolationEfficacy.js +50 -0
  95. package/src/social/ContemptDetector.js +56 -0
  96. package/src/social/CulturalScriptLibrary.js +107 -0
  97. package/src/social/DemandWithdrawLoop.js +56 -0
  98. package/src/social/DreamEngine.js +164 -0
  99. package/src/social/EgoCalibrationSuite.js +63 -0
  100. package/src/social/ElevationSystem.js +31 -0
  101. package/src/social/EmbarrassmentEngine.js +53 -0
  102. package/src/social/EmpathicAccuracySystem.js +46 -0
  103. package/src/social/EmpathyCompassion.js +60 -0
  104. package/src/social/EndogenousOpioidSystem.js +65 -0
  105. package/src/social/FaceThreatSensitivity.js +50 -0
  106. package/src/social/FlirtationEngine.js +74 -0
  107. package/src/social/GhostingDetector.js +59 -0
  108. package/src/social/GratitudeEngine.js +29 -0
  109. package/src/social/GriefEngine.js +300 -0
  110. package/src/social/GrudgeSystem.js +107 -0
  111. package/src/social/IdentityThreatMonitor.js +28 -0
  112. package/src/social/JealousyTriangle.js +42 -0
  113. package/src/social/LegacyMemory.js +101 -0
  114. package/src/social/LonelinessEngine.js +68 -0
  115. package/src/social/LoveHateEngine.js +14 -0
  116. package/src/social/LoyaltyConflictResolver.js +54 -0
  117. package/src/social/MoralDisgust.js +63 -0
  118. package/src/social/MultiAgentSocialGraph.js +105 -0
  119. package/src/social/NarrativeSelfEngine.js +99 -0
  120. package/src/social/NightmareEngine.js +88 -0
  121. package/src/social/OstracismDetector.js +53 -0
  122. package/src/social/OxytocinSystem.js +73 -0
  123. package/src/social/PainSocialOverlap.js +19 -0
  124. package/src/social/PowerDynamicsEngine.js +118 -0
  125. package/src/social/PrestigeSystem.js +63 -0
  126. package/src/social/ReciprocityClassifier.js +107 -0
  127. package/src/social/ReflectedGlory.js +43 -0
  128. package/src/social/RelationalAfterglow.js +59 -0
  129. package/src/social/RelationalMemoryCatalog.js +523 -0
  130. package/src/social/ResidualAnnoyanceTrace.js +50 -0
  131. package/src/social/RoleIdentitySalience.js +85 -0
  132. package/src/social/SecretMaintenanceSystem.js +94 -0
  133. package/src/social/SelfCompassionVsAttack.js +48 -0
  134. package/src/social/SelfPresentationManager.js +59 -0
  135. package/src/social/SharedRelationalCulture.js +88 -0
  136. package/src/social/SocialDiscomfort.js +48 -0
  137. package/src/social/SocialReferenceFrame.js +31 -0
  138. package/src/social/SourceMonitoring.js +45 -0
  139. package/src/social/StatusEnvy.js +44 -0
  140. package/src/social/TraumaCascadeEngine.js +266 -0
  141. package/src/social/YearningEngine.js +216 -0
  142. package/src/version.js +1 -1
package/README.md CHANGED
@@ -4,14 +4,30 @@
4
4
 
5
5
  [![License](https://img.shields.io/badge/license-MIT-blue?style=plastic)](LICENSE)
6
6
  [![Calibration](https://img.shields.io/badge/calibration-citation%20ledger-8a2be2?style=plastic)](CALIBRATION.md)
7
- [![Version](https://img.shields.io/badge/version-0.1.4-a1b858?style=plastic)](package.json)
7
+ [![Version](https://img.shields.io/badge/version-0.1.6-a1b858?style=plastic)](package.json)
8
8
  [![Node](https://img.shields.io/badge/node-%3E%3D18-339933?style=plastic&logo=node.js&logoColor=white)](package.json)
9
- [![Tests](https://img.shields.io/badge/tests-2402%20passing-brightgreen?style=plastic)](test)
10
- [![Mechanisms verified](https://img.shields.io/badge/mechanisms-72%20verified%20%2F%206%20covered%20%2F%200%20failed-brightgreen?style=plastic)](examples/verify-all-mechanisms.js)
9
+ [![Tests](https://img.shields.io/badge/tests-3087%20passing-brightgreen?style=plastic)](test)
10
+ [![Mechanisms verified](https://img.shields.io/badge/mechanisms-94%20verified%20%2F%2017%20covered%20%2F%200%20failed-brightgreen?style=plastic)](examples/verify-all-mechanisms.js)
11
11
 
12
- > The Tests/Mechanisms badges above are static, last updated by hand from a real local `npm test` / `npm run verify` run. There's no CI wired yet to keep them live, so treat them as a snapshot, not a guarantee they still pass on `main`. Two later mechanism rounds (the 10 dynamics upgrades and `LoveHateEngine`) each ship their own dedicated live audit instead of being folded into the `verify` script above: `npm run upgrade-round-mock` (39/39) and `npm run lovehate-mock` (24/24). `npm test` runs [`test/`](test) in full: `regression/` (92, bug-fix guards and basic sanity), `integration/` (245, directed multi-mechanism scenarios, full-pipeline emergency routes crossed through real consecutive turns, exhaustive field-by-field serialization, malformed/hostile-input robustness, concurrent `processInput()` calls, real `OllamaProvider` unreachable-host fallback, non-ES/EN language input, the 18 new relational-friction mechanisms individually, and 8 cross-mechanism scenarios stacking several of them in the same turns — see [`test/integration/cross-mechanism-friction.test.js`](test/integration/cross-mechanism-friction.test.js)), and `property/` (2029, deterministic parameter-grid checks over exact boundaries, combined-extreme OCEAN personality corners, and long-horizon saturation limits including 5000-turn memory/mood-window boundedness — no randomness, same result every run). `npm run test:all` additionally runs `test:plugins` (36 more: 34 per-plugin tests across the 6 official plugins below plus 2 all-6-plugins-at-once cross-integration scenarios in [`test/plugins-cross/`](test/plugins-cross)) — 2402 real tests total.
12
+ > The Tests/Mechanisms badges are static, updated by hand from a real local `npm test` / `npm run verify` run. There's no CI wired up yet, so treat them as a snapshot, not a live guarantee on `main`. `npm test` runs [`test/`](test) in full: `regression/` (92), `integration/` (893, directed and cross-mechanism scenarios, full-pipeline emergency routes, serialization, malformed-input robustness, and per-round dedicated suites, see [`test/integration/`](test/integration)), and `property/` (2029, deterministic boundary/grid checks, no randomness). `npm run test:all` additionally runs `test:plugins` (49 more across the 7 official plugins below plus cross-integration scenarios in [`test/plugins-cross/`](test/plugins-cross)), for 3063 real tests total. Two earlier mechanism rounds also ship their own dedicated live audit outside this count: `npm run upgrade-round-mock` (39/39) and `npm run lovehate-mock` (24/24).
13
13
 
14
- **Totemheart** is a deterministic control kernel for persistent cognition, not a sentiment classifier and not a prompt-engineering trick. It gives an AI a *consistent inner life* across a conversation: personality, mood, memory, stress, and social dynamics that persist and evolve through real control-theory and neuroscience-derived math, instead of every reply being computed from scratch off a mood label. See [What this actually is](#what-this-actually-is) below before you build on top of it.
14
+ **Totemheart** is a deterministic control kernel for persistent cognition and relational behavior, not a sentiment classifier and not a prompt-engineering trick. It gives an agent a consistent, inspectable inner state across a conversation and across days: personality, mood, memory, stress, attachment, desire, and social inference that evolve through control-theory and neuroscience-derived dynamics, instead of recomputing each reply from a mood label. Mechanisms interact in chains (bond, residual chemistry, grief, secrecy, intuition) under sparse activation; subjective experience remains 0% by design. See [What this actually is](#what-this-actually-is) below before you build on top of it.
15
+
16
+ ## Table of Contents
17
+
18
+ - [How this differs from a sentiment-based chatbot layer](#how-this-differs-from-a-sentiment-based-chatbot-layer)
19
+ - [What this actually is](#what-this-actually-is)
20
+ - [Architecture](#architecture)
21
+ - [How coherent is this, really?](#how-coherent-is-this-really)
22
+ - [Human Dynamics That Emerge On Their Own](#human-dynamics-that-emerge-on-their-own)
23
+ - [Per-mechanism grounding](#per-mechanism-grounding)
24
+ - [Prerequisites](#prerequisites)
25
+ - [Installation](#installation)
26
+ - [Usage](#usage)
27
+ - [Wiring it into a real LLM (Claude, GPT, Ollama, anything)](#wiring-it-into-a-real-llm-claude-gpt-ollama-anything)
28
+ - [Real ML instead of heuristics: TransformersProvider](#real-ml-instead-of-heuristics-transformersprovider)
29
+ - [Plugins](#plugins)
30
+ - [License](#license)
15
31
 
16
32
  ## How this differs from a sentiment-based chatbot layer
17
33
 
@@ -35,113 +51,58 @@ What it is *not*: subjective experience. There is no known way to build or verif
35
51
 
36
52
  ## Architecture
37
53
 
38
- Every mechanic is a small, independent class with its own state, one file per mechanic under [`src/`](src).
39
-
40
- ### 🧠 `core/`
41
-
42
- Personality, homeostatic needs, and the PAD (valence/arousal/dominance) state engine everything else reads from and writes to.
43
-
44
- | | | | | |
45
- | --- | --- | --- | --- | --- |
46
- | Personality | CoreBeliefs | Homeostasis | EmotionSpace | MicroEmotions |
47
- | MoodTracker | DecayEngine | HedonicAdaptation | WornPathCache | PipelineResilience |
48
- | AffectEMA | TriggerSentinel | HebbianPlasticity | CommitmentDevice | MoralInjury |
49
- | OpponentProcess | | | | |
50
-
51
- ### 🧩 `cognition/`
52
-
53
- Appraisal and interpretation: how an input gets read, doubted, reframed, or filtered before it becomes a felt reaction.
54
-
55
- | | | | | |
56
- | --- | --- | --- | --- | --- |
57
- | CognitiveDissonance | DefenseMechanisms | DecisionFatigue | AmygdalaHijack | EmotionalOntology |
58
- | SituationalContext | NoveltyDetector | BayesianExpectation | ControllabilityEstimate | FuzzyNormativeCheck |
59
- | Sensitization | Reappraisal | LoadScheduler | SemanticSimilarity | TopicSatiation |
60
- | Intuition | LogicEngine | LifeEventCatalog | AppraisalAgreement | VisualProsody |
61
- | SarcasmDetector | RefractoryPeriod | RemConsolidation | AnticipatoryAffect | MotivationalConflict |
62
- | EgoDepletionBudget | ValueHierarchy | | | |
63
-
64
- ### 🤝 `social/`
65
-
66
- Modeling the other person: trust, reputation, theory of mind, relationship memory, and group dynamics.
67
-
68
- | | | | | |
69
- | --- | --- | --- | --- | --- |
70
- | TheoryOfMind | EmotionalContagion | ChronicContagion | EpisodicMemory | ForgettingCurve |
71
- | Attachment | GuiltEngine | TribalCategorization | ReputationEngine | EgoProjection |
72
- | BystanderEffect | SelfModel | MonteCarloToM | FairnessMonitor | CounterfactualComparison |
73
- | GratitudeEngine | StatusEnvy | EgoConfidence | UncannyValleyDetector | LoveHateEngine |
74
- | GriefEngine | ShameGuiltSplit | RepairProtocol | JealousyTriangle | NostalgiaEngine |
75
- | PainSocialOverlap | IdentityThreatMonitor | SocialBaselineTheory | | |
76
-
77
- ### 🎭 `behavior/`
78
-
79
- How the felt state actually gets expressed: language, suppression, attention, and output-shaping signals for a host LLM.
80
-
81
- | | | | | |
82
- | --- | --- | --- | --- | --- |
83
- | IdleProcessing | LinguisticModulation | RuminationChain | ExpressiveSuppression | ExpressionDirectives |
84
- | LogitBiasBuilder | AttentionFocus | ExpressionDebt | StyleMimicry | |
85
-
86
- ### 🧪 `neurochemistry/`
87
-
88
- Reward, stress, and circadian dynamics driving arousal and motivation over time.
89
-
90
- | | | | | |
91
- | --- | --- | --- | --- | --- |
92
- | DopaminergicEngine | CortisolEngine | CircadianRhythm | ArousalKalmanFilter | SubjectiveTimeEngine |
93
- | SleepPressure | | | | |
54
+ Every mechanic is a small, independent class with its own state, one file per mechanic under [`src/`](src), organized by what kind of psychological work it does.
94
55
 
95
- ### 🫀 `embodiment/`
96
-
97
- Interoception: real math on internal signals standing in for a body Totemheart doesn't have, fed back into cognition only, never rendered.
98
-
99
- | | | | | |
100
- | --- | --- | --- | --- | --- |
101
- | HardwareInteroception | SensoryOverload | InteroceptiveSignals | InteroceptivePredictionError | |
102
-
103
- ### ⚖️ `economics/`
104
-
105
- Behavioral-economics biases applied to how outcomes get weighted and remembered.
106
-
107
- | | | | | |
108
- | --- | --- | --- | --- | --- |
109
- | LossAversion | AnchoringBias | ClassicalConditioning | | |
110
-
111
- ### 🔌 `providers/`
112
-
113
- Pluggable language backends, from a zero-dependency lexicon to a real transformer model.
114
-
115
- | | | | | |
116
- | --- | --- | --- | --- | --- |
117
- | LanguageProvider | HeuristicProvider | OllamaProvider | FunctionProvider | TransformersProvider |
118
-
119
- `npm run verify` ([`examples/verify-all-mechanisms.js`](examples/verify-all-mechanisms.js)): 72 mechanics verified live/direct, 6 covered by other modules, 0 left blank. Citation ledger: [`CALIBRATION.md`](CALIBRATION.md).
120
-
121
- - **`LifeEventCatalog`**: 43/56 entries use the published Life Change Units from the [Holmes & Rahe (1967) SRRS](https://en.wikipedia.org/wiki/Holmes_and_Rahe_stress_scale); the other 13 (acute events the scale doesn't cover) are engineering estimates. Multiple matches in one turn are triangulated into a blended state.
122
- - **`SemanticSimilarity`**: requires an embedding backend (`embedProvider`); falls back to `EmotionalOntology` keyword matching without one.
123
- - **`InteroceptiveSignals`**: real math (derivative, tonic/phasic decomposition, DFT, thermal lag) on internal signals standing in for 4 sensors Totemheart doesn't have (pupil, skin conductance, HRV, flush). Feeds back into cognition only, never rendered.
124
- - **`LoveHateEngine`**: tracks Affinity and Aversion as two SEPARATE per-user accumulators (not one bipolar scale), so a relationship can be genuinely ambivalent instead of averaging out to neutral. Real diminishing returns on Affinity, a self-reinforcing (kindling) slope on Aversion, an asymmetric decay rate (grudges outlast warmth), and a hysteresis-gated rupture/repair cycle that freezes dopaminergic wanting, damages ego health, and opens a real unresolved wound on rupture. See its own file for the full equations and citations.
125
-
126
- ### Internal scheduling
56
+ | | Category | What it covers |
57
+ | --- | --- | --- |
58
+ | 🧠 | State engine | Personality, homeostatic needs, and the core emotional vector everything else reads from and writes to |
59
+ | 🧩 | Appraisal and interpretation | How an input gets read, doubted, reframed, or filtered before it becomes a felt reaction |
60
+ | 🤝 | Modeling the other person | Trust, reputation, theory of mind, relationship memory, and group dynamics |
61
+ | 🎭 | Expression | How the felt state actually gets turned into language, suppression, attention, and output-shaping signals for a host LLM |
62
+ | 🧪 | Reward, stress, and circadian dynamics | Arousal and motivation driven by reward learning, chronic stress, and time of day |
63
+ | 🫀 | Interoception | Real math on internal signals standing in for a body this system doesn't have, fed back into cognition only, never rendered |
64
+ | ⚖️ | Behavioral-economics biases | How outcomes get weighted and remembered |
65
+ | 🔌 | Language backends | Pluggable, from a zero-dependency lexicon to a real transformer model, so the same kernel runs identically whether or not a host wires in a real LLM |
127
66
 
128
- - **`PipelineResilience.safeStep`**: a failing optional stage degrades to a fallback instead of losing the turn.
129
- - **`LoadScheduler`**: an instability reading (cortisol + arousal + fatigue) decides which optional mechanics run.
130
- - **`WornPathCache`**: a repeated (user, input) fingerprint reuses the last appraisal instead of recomputing it.
67
+ `npm run verify` ([`examples/verify-all-mechanisms.js`](examples/verify-all-mechanisms.js)): 91 mechanics verified live/direct, 17 covered by other modules, 0 left blank. Full citation ledger, by theme: [`CALIBRATION.md`](CALIBRATION.md).
131
68
 
132
69
  ## How coherent is this, really?
133
70
 
134
- Short version: **~80-83% with an LLM connected, ~64-68% running standalone on the zero-dependency heuristic path, 0% subjective experience, by design and permanently.** Self-assessed, qualitative estimates of how much of each layer is grounded in real theory/technique vs. own engineering judgment. The headline is not an average of the row values below: it carries an additional discount for integrated-system validation that doesn't exist yet. The +1pt over the previous round reflects the 18 relational-friction mechanisms added in 0.1.3, most of them drawing on real, well-cited, well-matched literature (Miller 1944's actual approach-avoidance model, Litz et al. 2009's actual coinage of "moral injury", Borbély 1982's actual Process S equation implemented near-literally) rather than looser analogies — see the new rows below and `CALIBRATION.md`'s "Relational friction, grief, and moral psychology" section for the full list. Full citation ledger: [`CALIBRATION.md`](CALIBRATION.md).
71
+ Short version: **~79-83% with an LLM connected, ~62-66% running standalone on the zero-dependency heuristic path, 0% subjective experience, by design and permanently.** Self-assessed, qualitative estimates of how much of each layer is grounded in real theory/technique vs. own engineering judgment. This is not an average of the row values below. Multi-day system tests (reunion reactivation, cumulative suspicion, support-vs-isolation recovery, trauma/happiness/intuition chains) now show real, autonomous cross-module chains firing without any single mechanism being named or forced, a small, honest upward revision from the previous baseline; the per-layer scores below remain qualitative and citation-weighted, not a claim of sentience, clinical fidelity, or validation against psychologist judges/real labeled chat data, which still don't exist.
72
+
73
+ Full citation ledger: 📑 [`CALIBRATION.md`](CALIBRATION.md).
135
74
 
136
75
  | Layer | With LLM | Heuristic only | Grounded in |
137
76
  | --- | --- | --- | --- |
138
- | State engine | ~83-86% | same | PID control (anti-windup, dynamic set points), Kalman filtering (now with real interoception-informed measurement noise), allostatic load (McEwen & Stellar 1993), prospect-theory loss aversion, TD reward-prediction-error with eligibility traces (Sutton & Barto), wanting/liking dissociation (Berridge & Robinson 1998) with allostatic-load-driven anhedonia, circumplex/PAD affect space with momentum/hysteresis, Holmes & Rahe life-event severity, the two-process sleep-pressure model (Borbély 1982), the opponent-process a/b dynamic (Solomon & Corbit 1974) |
139
- | Semantic understanding | ~85-88% | ~68-73% | LLM: real language understanding. Heuristic: lexicon + concept-graph matching, keyword-triggered life-event detection, lexical-vs-context incongruence check, mean/variance anomaly detection, confidence-weighted routing between logical and affective reads |
140
- | Expression / output | ~91-94% | ~64-70% | Structured system-prompt injection, coherence validation against prior turns, attachment-weighted style adaptation, a full-state-weighted action-tendency policy, real suppression-cost accrual, cognitive-load-derived output metadata, a real approach-avoidance conflict dampening expression confidence (Miller 1944) |
141
- | Cross-turn continuity | ~93-96% | same | Persistent state serialization, asymmetric trust/reputation tracking, attachment styles with rupture-and-repair (Bartholomew & Horowitz 1991; Gottman & Levenson 1992) now with state-dependent style switching under stress (Mikulincer & Shaver 2016), memory reconsolidation on retrieval (Nader et al. 2000), unresolved-memory flagging with intrusive resurfacing, idle-time-based consolidation, long-horizon memory decay with similarity-triggered reactivation and bittersweet nostalgic reconsolidation (Walker, Skowronski & Thompson 2003), grief as a real decaying-with-waves process (Bonanno 2004; Zisook & Shear 2009), and permanent moral-injury scarring distinct from ordinary dissonance (Litz et al. 2009) |
77
+ | State engine | ~81-84% | same | PID control (anti-windup, dynamic set points), Kalman filtering (now with real interoception-informed measurement noise), allostatic load (McEwen & Stellar 1993), prospect-theory loss aversion, TD reward-prediction-error with eligibility traces (Sutton & Barto), wanting/liking dissociation (Berridge & Robinson 1998) with allostatic-load-driven anhedonia, circumplex/PAD affect space with momentum/hysteresis, Holmes & Rahe life-event severity, the two-process sleep-pressure model (Borbély 1982), the opponent-process a/b dynamic (Solomon & Corbit 1974), a real general attentional-effort budget (Kahneman 1973) distinct from the self-regulation-specific one, plus 0.1.6's hyperbolic discounting (Ainslie 1975) and inhibitory control pool (Hofmann et al. 2012) pulling this row down slightly, and its own-design-heavy "butterflies"/global-mood-abatement additions pulling it down further; `HappinessEngine`, `TraumaCascadeEngine`, and `YearningEngine`/`BoredomSystem`'s new per-user engagement now add real, verified dynamics on top, a small honest nudge upward, though much of the specific combining math there is still own engineering, not literal published constants |
78
+ | Semantic understanding | ~85-88% | ~68-73% | LLM: real language understanding. Heuristic: lexicon + concept-graph matching, keyword-triggered life-event detection, lexical-vs-context incongruence check, mean/variance anomaly detection, confidence-weighted routing between logical and affective reads, cultural-script activation (honor culture: Nisbett & Cohen 1996; self-construal: Markus & Kitayama 1991; reciprocity: Gouldner 1960); 0.1.6's metacognitive-confidence and source-monitoring additions land close to this row's existing average, no meaningful shift |
79
+ | Expression / output | ~86-90% | ~62-68% | Structured system-prompt injection, coherence validation against prior turns, attachment-weighted style adaptation, a full-state-weighted action-tendency policy, real suppression-cost accrual, cognitive-load-derived output metadata, a real approach-avoidance conflict dampening expression confidence (Miller 1944), an active real regulation-strategy selection (Gross 1998) replacing a single fixed suppression pipeline, a real divergent/convergent creative-mode temperature signal (Guilford 1967; Fredrickson 2001); pulled down by 0.1.6's own-design-heavy `BlushSlipEngine` (~28-35%) and `HumanDiscourseShaper`/`PercentageOfAssets` (~40-52%), each real and cited but scoring well below this row's prior average; `ChildlikeMode` genuinely widens the directive space (real suppression/boost signals for tone, discourse, chills) but the state→text wiring itself is still the weak link here, so this row moves down slightly, not up, until that wiring is demonstrated in real chat transcripts, not just debug fields |
80
+ | Cross-turn continuity | ~90-94% | same | Persistent state serialization, asymmetric trust/reputation tracking, attachment styles with rupture-and-repair (Bartholomew & Horowitz 1991; Gottman & Levenson 1992) now with state-dependent style switching under stress (Mikulincer & Shaver 2016), memory reconsolidation on retrieval (Nader et al. 2000), unresolved-memory flagging with intrusive resurfacing, idle-time-based consolidation, long-horizon memory decay with similarity-triggered reactivation and bittersweet nostalgic reconsolidation (Walker, Skowronski & Thompson 2003), grief as a real decaying-with-waves process (Bonanno 2004; Zisook & Shear 2009), permanent moral-injury scarring distinct from ordinary dissonance (Litz et al. 2009) now with a real, effortful redemption arc, a real autobiographical narrative with chapter coherence (McAdams 2001), permanent betrayal-trauma trust thresholds (Freyd 1996), and real cumulative somatic-marker decision bias (Damasio 1994); pulled down by 0.1.6's `RelationalMemoryCatalog`/`GrudgeSystem`/`GhostingDetector`/`FrikiEngine` (~35-50% each) diluting an otherwise very high-scoring row; this is the row the multi-day/multi-round system tests actually exercise (reunion reactivation, ritual/inside-joke reactivation, cumulative suspicion, cross-relationship arcs, co-regulation vs. isolation recovery), genuinely the strongest, most-validated row now |
142
81
  | Subjective experience | **0%** | **0%** | Not a gap to close: no known way to build or verify this in any software |
143
-
144
- The headline stays below the row average because none of these numbers include validation against psychologist judges, regression against real labeled chat data, or real-user testing of whether the integrated pipeline reads as coherent. See `CALIBRATION.md` for what hasn't been empirically validated.
82
+ | **Headline** | **~79-83%** | **~62-66%** | Small, honest upward revision from the previous baseline (~77-81% / ~61-65%), justified by real multi-day system-test validation that didn't exist before (autonomous cross-module chains firing without any mechanism named or forced), not by row count or module count alone; still not an average of the rows above, still discounted for the real integrated-system validation (psychologist judges, labeled chat data, real-user testing) that still doesn't exist |
83
+
84
+ The headline stays below the row average because none of these numbers include validation against psychologist judges, regression against real labeled chat data, or real-user testing of whether the integrated pipeline reads as coherent. See `CALIBRATION.md` for what hasn't been empirically validated. These are still self-assessed qualitative estimates, not a computed weighted average over the per-mechanism table: treat the direction (a small, honest step up this round, from real multi-day system-test validation, not from module count) as the meaningful signal, not the exact digits.
85
+
86
+ ### Human Dynamics That Emerge On Their Own
87
+
88
+ In tests lasting days and weeks, the system doesn't simply label a shift. Human dynamics of connection, absence, doubt, harm, and recovery emerge from the state that persists over time.
89
+
90
+ | Human Dynamics | What is observed over time |
91
+ | --- | --- |
92
+ | Reconnection after a long time | The warmth and weight of past experiences return at first contact, without starting from scratch |
93
+ | Memory triggered by an intimate phrase | A ritual, nickname, or inside joke suddenly reopens memories and emotions |
94
+ | Suspicion that builds up little by little | Repeated small evasions build distrust over time, rather than an instant judgment |
95
+ | Not inventing danger where there is none | Threats do not appear in neutral messages; doubt is reserved for ambiguity |
96
+ | Viewing betrayal differently depending on prior state | The same wound hurts differently if expectations were high or if the bond was already cold |
97
+ | Freezing when there is no way out | Faced with the same hostility, one reacts if escape is possible; if trapped, one freezes more |
98
+ | Healing faster with genuine support | After a blow, containment and validation change mood, stress, and trust; minimizing it isolates |
99
+ | Grieving for someone who is not the partner | One can suffer from an external loss without it meaning a breakup with the partner |
100
+ | Getting tired of the same repeated blow | Identical things lose their impact; new things hurt again |
101
+ | Life in stages | Over a long arc, desire, distance, reconnection, and doubt appear without being manually orchestrated |
102
+ | Desire in "inappropriate" moments | Caring or reconnecting can awaken attraction even if the context is delicate |
103
+ | Love and rejection at the same time | After a strong conflict, attachment and pain can coexist, rather than just one clear feeling |
104
+ | Cooling off without reaching hatred | Initiative and interest drop when there is no longer novelty or pull, even if there is no fight |
105
+ | Illusion that blinds for a while | When things are going very well, it is hard to register the same warning signs |
145
106
 
146
107
  ### Per-mechanism grounding
147
108
 
@@ -158,16 +119,107 @@ The table above scores each functional layer as a whole. This scores ten specifi
158
119
  | Allostatic load / chronic-stress reactivity | ~58-66% | McEwen & Stellar (1993) and McEwen (1998) are real, well-cited theory; translating "wear from chronic stress" into a dynamic PID set point and a reactivity multiplier is its own control-systems engineering, not a reproduction of any measured allostatic-load curve |
159
120
  | Attachment styles + rupture-and-repair | ~50-58% | Bartholomew & Horowitz's (1991) four-category model and the Gottman/Levenson rupture-and-repair literature are real; mapping OCEAN traits onto attachment-style buckets is our own engineering choice, explicitly not a validated psychometric equivalence |
160
121
  | Vaillant defense hierarchy | ~55-63% | Vaillant's (1977) mature/neurotic/immature taxonomy is real, established clinical theory; the ego-health/cortisol-weighted tier-shifting mechanism that picks among them each turn is own design |
161
- | `LoveHateEngine` dual-valence bond field | ~38-46% | The individual pieces it reuses (diminishing-returns accumulation, kindling, asymmetric decay, rupture-and-repair) each draw on real cited work; the specific coupled two-accumulator update equations are our own engineering design end to end, not a reproduction of any published relational model |
162
- | Approach-avoidance conflict (`MotivationalConflict`) | ~68-75% | Miller's (1944) real gradient-conflict model, implemented close to literally (two exponential gradients, steeper avoidance decay, a real crossover/vacillation zone) — the specific decay constants and the expression-confidence dampening it feeds are own tuning |
163
- | Two-process sleep pressure (`SleepPressure`) | ~72-80% | Borbély's (1982) Process S equation implemented directly (saturating exponential rise, exponential fall during a real "sleep" event); the specific rise/fall time constants are own engineering estimates, not measured circadian data |
164
- | Opponent-process after-effect (`OpponentProcess`) | ~65-72% | Solomon & Corbit's (1974) a-process/b-process structure (habituating peak, growing-and-lengthening undershoot with repetition) implemented as its literal qualitative shape; the specific growth-rate constants are own tuning |
165
- | Grief as a decaying-with-waves process (`GriefEngine`) | ~45-52% | The general shape (long-tailed, non-monotonic, punctuated by real intrusive waves) draws on real bereavement research (Bonanno 2004; Zisook & Shear 2009) that explicitly rejects a fixed-stage model — deliberately NOT modeling Kübler-Ross stages, since that theory lacks the empirical support the shape below draws on instead; the power-law exponent and wave-rate constants are own design |
166
- | Shame/guilt split (`ShameGuiltSplit`) | ~60-68% | Tangney & Dearing's (2002) real, well-established distinction (identity-level vs. behavior-level, differing persistence); which real Totemheart signals feed each accumulator and the specific decay-rate ratio are own engineering |
167
- | Moral injury / identity threat (`MoralInjury`, `IdentityThreatMonitor`) | ~55-63% | Litz et al.'s (2009) actual coinage and definition of "moral injury" as distinct from ordinary guilt, and Steele's (1988) self-affirmation/identity-threat theory, both real and well-matched to what's built; the permanence mechanism and severity-threshold/cascade-multiplier math are own design |
168
- | Dynamic value conflict (`ValueHierarchy`) | ~50-58% | Schwartz's (1992) real, cross-culturally validated basic-values structure supplies the value set and the general "competing values create real tension" framing; the specific EMA nudge rule and conflict-scoring formula are own engineering, not a computational model Schwartz specified |
169
-
170
- Every mechanism in this table passed a dedicated live audit: `npm run exhaustive-audit` (25/25) for the first five, `npm run upgrade-round-mock` (39/39) and `npm run lovehate-mock` (24/24) for the LoveHateEngine-and-earlier rows, and [`test/integration/human-friction-mechanisms.test.js`](test/integration/human-friction-mechanisms.test.js) (60/60 directed per-mechanism tests) plus [`test/integration/cross-mechanism-friction.test.js`](test/integration/cross-mechanism-friction.test.js) (8/8 deliberate cross-mechanism scenarios — jealousy colliding with an in-progress repair, three independent dissonance sources stacked on one turn, grief/conflict/depletion together over 25 turns, sleep-pressure/REM/forgetting-curve across a real time gap, a full 18-mechanism soup round-tripped through serialization and still producing coherent output, and more) for the 8 rows added in 0.1.3 — confirming the code does what its own formulas claim, both in isolation and stacked together. That's internal consistency, not psychological validation, and the percentages above already price that distinction in.
122
+ | Dual-valence relational bond field | ~38-46% | The individual pieces it reuses (diminishing-returns accumulation, kindling, asymmetric decay, rupture-and-repair) each draw on real cited work; the specific coupled two-accumulator update equations are our own engineering design end to end, not a reproduction of any published relational model |
123
+ | Approach-avoidance conflict | ~68-75% | Miller's (1944) real gradient-conflict model, implemented close to literally (two exponential gradients, steeper avoidance decay, a real crossover/vacillation zone); the specific decay constants and the expression-confidence dampening it feeds are own tuning |
124
+ | Two-process sleep pressure | ~72-80% | Borbély's (1982) Process S equation implemented directly (saturating exponential rise, exponential fall during a real "sleep" event); the specific rise/fall time constants are own engineering estimates, not measured circadian data |
125
+ | Opponent-process after-effect | ~65-72% | Solomon & Corbit's (1974) a-process/b-process structure (habituating peak, growing-and-lengthening undershoot with repetition) implemented as its literal qualitative shape; the specific growth-rate constants are own tuning |
126
+ | Grief as a decaying-with-waves process | ~45-52% | The general shape (long-tailed, non-monotonic, punctuated by real intrusive waves) draws on real bereavement research (Bonanno 2004; Zisook & Shear 2009) that explicitly rejects a fixed-stage model, deliberately NOT modeling Kübler-Ross stages, since that theory lacks the empirical support the shape below draws on instead; the power-law exponent and wave-rate constants are own design |
127
+ | Shame/guilt split | ~60-68% | Tangney & Dearing's (2002) real, well-established distinction (identity-level vs. behavior-level, differing persistence); which real internal signals feed each accumulator and the specific decay-rate ratio are own engineering |
128
+ | Moral injury / identity threat | ~55-63% | Litz et al.'s (2009) actual coinage and definition of "moral injury" as distinct from ordinary guilt, and Steele's (1988) self-affirmation/identity-threat theory, both real and well-matched to what's built; the permanence mechanism and severity-threshold/cascade-multiplier math are own design |
129
+ | Dynamic value conflict | ~50-58% | Schwartz's (1992) real, cross-culturally validated basic-values structure supplies the value set and the general "competing values create real tension" framing; the specific EMA nudge rule and conflict-scoring formula are own engineering, not a computational model Schwartz specified |
130
+ | Narrative self / chapter coherence | ~48-55% | McAdams' (2001; McAdams & McLean 2013) real narrative-identity framework motivates treating the self as a real, evolving story rather than pure accumulated state; the chapter-theme EMA, coherence formula, and crisis threshold are own engineering, not a computational reproduction of that framework |
131
+ | Developmental staging | ~30-38% | Piaget (1952) and Vygotsky (1978) motivate development as qualitative, experience-driven stage change rather than a clock, an explicit engineering borrowing of that SHAPE; the stage boundaries and per-stage trait modifiers are own tuning, not a claim of literal human-child-development equivalence |
132
+ | Betrayal trauma trace | ~58-65% | Freyd's (1996) actual coinage of "betrayal trauma" as a distinct wound from a trusted source is a real, exact match to this mechanic's trigger condition; the permanence-above-threshold decay shape and trust-threshold formula are own design |
133
+ | Somatic markers | ~55-62% | Damasio's (1994) real somatic-marker hypothesis motivates accumulative gut-feeling bias from past outcomes; the real token-overlap similarity and exponential-decay marker formula are own engineering, not a reproduction of any specific computational somatic-marker model |
134
+ | Regulation strategy selection | ~62-70% | Gross's (1998; Gross & John 2003) real reappraisal-vs-suppression cost/effectiveness taxonomy is well-established; the real argmax cost-benefit selection formula and specific base-cost constants are own engineering |
135
+ | Meta-emotion | ~52-60% | Gottman, Katz & Hooven's (1996) actual coinage of "meta-emotion" (real evaluative beliefs about one's own emotions) is a well-matched real citation; the specific standard-deviation valence formula and Neuroticism-bias multiplier are own design |
136
+ | Cultural scripts | ~40-48% | Real, distinct citations for each script (honor: Nisbett & Cohen 1996; self-construal: Markus & Kitayama 1991; reciprocity: Gouldner 1960), but the token-overlap activation mechanic and the specific weighting constants are own engineering, not a computational model any of those authors specified |
137
+ | Social network graph | ~35-42% | Real, standard social-network-analysis vocabulary (edge weight, coalition: Wasserman & Faust 1994); the specific weighting formula is own engineering end to end, not a reproduction of any published relational-network model |
138
+ | Group emotional contagion | ~50-58% | Barsade's (2002) real "ripple effect" finding (emotion spreads through a GROUP, not just dyadically, and group coherence is itself real and measurable) is a well-matched citation; the specific weighted-average contagion formula and coherence metric are own design |
139
+ | Global workspace competition | ~40-48% | Baars (1988; 2005) and Dehaene & Naccache (2001) are real, foundational consciousness-science theory; a real softmax over candidate saliences is a genuine, literal competition, but it's a deliberately narrow, explicitly-scoped-down engineering analog of "access to the workspace," not a claim of modeling ignition/broadcast dynamics or consciousness itself |
140
+ | Primary-process drives | ~55-63% | Panksepp (1998; Panksepp & Biven 2012) is real, cross-species-evidenced neuroscience for exactly these four systems (SEEKING/CARE/PLAY/PANIC-GRIEF) as distinct; the specific bounded-activation-plus-exponential-decay update rule and which existing internal signals feed each drive are own engineering |
141
+ | Sustained-negativity numbing | ~46-54% | Gilbert (1989; 2009) is real, well-cited theory for defensive numbing under sustained unresolved negative affect; the specific exposure accumulator and saturating dampening curve are own design, and the phenomenon is real but broader in Gilbert's own work than this one narrow accumulator captures |
142
+ | Hyperbolic temporal discounting | ~72-80% | `V=R/(1+kd)` is the literal, standard hyperbolic-discounting formula from the intertemporal-choice literature (Ainslie 1975; Mazur 1987); which internal signals feed the discount rate `k` per turn is own engineering |
143
+ | Inhibitory control pool | ~48-56% | A depletable inhibition resource distinct from ego-depletion/decision-fatigue is a real, debated construct in self-regulation research (Hofmann, Schmeichel & Baddeley 2012); the specific replenishment-vs-cost update rule and failure-probability sigmoid are own design, not measured data |
144
+ | Inequity aversion (fairness) | ~68-75% | `U=x_i-α·max(x_j-x_i,0)-β·max(x_i-x_j,0)` is a literal reproduction of Fehr & Schmidt's (1999) inequity-aversion model, one of the most cited formal models in behavioral economics; wiring it to conversational offers/turns is own integration |
145
+ | Ostracism pain detection | ~55-63% | Williams' (2007, 2009) real "need-threat" ostracism research (exclusion registering as a genuine distinct pain signal) motivates the mechanism; the specific ignore/exclude/inclusion weighting formula is own design |
146
+ | Metacognitive confidence | ~50-58% | Confidence as a function of evidence strength minus conflict is a real, established metacognition construct (Fleming & Lau 2014); the specific sigmoid and which internal signals count as "evidence" vs "conflict" are own engineering |
147
+ | Relational memory catalog (milestones/details/themes, recency/rupture-capped reunion tone, breakup habituation/initiator asymmetry) | ~47-55% | Grounded in real autobiographical-memory research on person-specific, affectively-tagged episodic detail (Conway & Pleydell-Pearce 2000) plus Berntsen & Rubin's (2002) real emotionally-significant-memory-reactivation finding, extended here to a real long-absence reunion, not just a calendar anniversary; Frederick & Loewenstein's (1999) real hedonic-adaptation finding (stronger for pleasant than unpleasant recurring events) grounds why an ordinary positive moment records with less NEW weight once a relationship is established; Sprecher, Felmlee, Metts, Lin & Christopher (1998) and Perilloux & Buss (2008) are real, published findings that a breakup's non-initiator reports more distress than its initiator, whose own reduced projection is grounded in Festinger's (1957) cognitive-dissonance account; a genuinely recent or unrepaired hurt now caps how warm a reunion's tone can read regardless of the lifetime warmth/hurt sum, own engineering closing a real gap the user's own 20-test battery found; the milestone-detection pattern matching, weight formula, decay floor, and specific habituation/rupture-factor constants are own design end to end |
148
+ | Friki Engine (taste, geek intensity, obsession, reveal-gate) | ~35-43% | Interest/hobby intensity as a graded, practiced construct draws loosely on flow and intrinsic-motivation research (Csikszentmihalyi 1990); the geek-level sigmoid, fandom-link propagation, and especially the confidence-gated reveal mechanism have no direct named psychological model behind them, own design |
149
+ | Somatic Activation System ("butterflies") | ~30-38% | The desire/uncertainty coupling driving anticipatory arousal is a real, plausible synthesis of appraisal theory (uncertainty appraisals: Smith & Ellsworth 1985) and approach-motivation literature, but `S=I·A·U^κ` and the ODE `dB/dt=ρS(1-B)-λB` are own formalization with no published equivalent — the phenomenon is real and well-known colloquially, the equations are engineering |
150
+ | Grudge/forgiveness system | ~40-48% | Grudge accumulation and multi-mode forgiveness (transactional/normative/temporal) loosely echoes real forgiveness-psychology typologies (McCullough, Worthington & Rachal 1997); the specific decay/weighting formulas and the never-auto-enacted retribution design are own engineering choices |
151
+ | Human discourse shaper (anti-AI narrative shape) | ~45-52% | Directly operationalizes real, measured findings from Hancock/StoryScope-style corpus comparisons of AI vs human narrative structure (over-explicit theming, high plot tidiness, monotone escalation); which text-generation directives counteract each axis, and by how much, are own engineering with no validated causal test yet that they work |
152
+ | Blush/slip engine (micro text slips) | ~28-35% | Motivated by real disfluency research showing genuine speech errors correlate with anxiety/arousal (Goldman-Eisler 1968); injecting *typed* micro-slips as a stand-in for that vocal phenomenon, the slip-type taxonomy, and the repair-probability formula are own design with no direct textual-disfluency literature this maps onto |
153
+ | Percentage of Assets / sparse layer-family introspection | ~40-48% | The Herfindahl-style concentration math is a real, standard economics tool (Herfindahl 1950; Hirschman 1945) applied honestly to which mechanism families were salient a given turn; it is explicitly introspection only, not a gating layer — the full pipeline still runs unconditionally every turn, so this row scores the honesty of that framing as much as the math itself |
154
+ | Affect alignment monitor (Δ-comparator, bounded correction) | ~45-52% | The Δ-and-bounded-online-correction pattern is a standard, real control-theory technique (proportional error correction); this is deliberately the *only* piece built from the originally-requested "Model Control Plane" spec — real hidden-state reading and activation steering were declined outright because no available backend exposes model internals, and faking that would be exactly the theater this ledger exists to catch |
155
+ | Contempt detection (status + disrespect, dual-gated) | ~62-70% | Gottman & Levenson's (1992) real, well-cited finding that contempt is the strongest single predictor of relational breakdown, plus Ekman & Friesen's (1986) real cross-cultural contempt expression, both a close match to what's built; the dual-gate requiring both status superiority AND accumulated disrespect is own design |
156
+ | Demand-withdraw loop | ~60-68% | Christensen & Heavey's (1990) real, well-replicated demand-withdraw pattern; the specific pressure-accumulation and threshold-crossing formulas are own engineering, not measured couple-conflict data |
157
+ | Face-threat sensitivity (positive/negative face) | ~65-73% | Brown & Levinson's (1987) real, foundational, extensively-cited politeness theory maps closely onto what's built; the specific warmth/autonomy-slack buffering terms are own tuning |
158
+ | Self-presentation management | ~55-63% | Goffman's (1959) real, foundational impression-management framework, plus Jones & Pittman's (1982) real strategy taxonomy; the felt-vs-presented gap formula and its maintenance-cost accrual are own design |
159
+ | Ego calibration (hubris/impostor, one shared axis) | ~68-76% | Kruger & Dunning (1999) and Clance & Imes (1978) are both real, extensively-cited, well-matched findings for the two directions this models; treating them as one shared track-record-vs-self-assessment axis rather than two separate constructs is own engineering |
160
+ | Reactance engine | ~68-75% | Brehm's (1966) psychological reactance theory is real, foundational, and extensively replicated; the specific boomerang-appeal formula is own tuning |
161
+ | Construal-level / psychological distance scaler | ~65-72% | Trope & Liberman's (2010) Construal Level Theory is real, well-established, and directly matches what's built (distance across temporal/spatial/social/hypothetical axes shifting abstraction); combining all four into one scalar distance is own simplification |
162
+ | Moral licensing | ~60-68% | Merritt, Effron & Monin's (2010) real, well-cited moral-licensing finding; the specific credit-accrual-and-partial-spend-down formula is own design |
163
+ | Self-handicapping | ~58-65% | Berglas & Jones' (1978) real, foundational self-handicapping finding; the specific ego-relevance × failure-risk × (1-confidence) product is own formalization |
164
+ | Relational afterglow | ~50-58% | Meltzer et al.'s (2017) real, empirically-measured "sexual afterglow" persistence is the closest real citation, generalized here beyond its original scope to any strong positive relational peak — that generalization itself is own engineering, not the study's own claim |
165
+ | Felt-obligation urgency decay | ~62-70% | Gouldner's (1960) real, foundational norm-of-reciprocity paper explicitly distinguishes debt size from felt urgency, a close match; the specific urgency half-life decay curve is own design |
166
+ | Betrayal reappraisal window | ~55-63% | Finkel et al.'s (2002) real, well-cited finding that a commitment-scaled window exists during which a betrayal's appraisal can still be revised; the specific window-duration formula and in-window trace-reduction magnitude are own tuning |
167
+ | Amusement (incongruity-resolution + benign violation) | ~65-72% | Suls' (1972) real, foundational incongruity-resolution account and McGraw & Warren's (2010) real, well-cited benign-violation theory both directly match what's built — requiring all three of incongruity, resolution, AND benignity; the specific product-of-three formula and repetition-habituation curve are own engineering |
168
+ | Moral disgust (CAD triad, purity leg) | ~65-73% | Rozin, Haidt & McCauley's (1999) real disgust-as-purity-violation account and Haidt's (2003) real, well-established CAD triad hypothesis are a close match to what's built — the previously-missing third leg alongside the codebase's existing contempt/anger coverage; the tolerance-floor and exposure-accumulation formulas are own design |
169
+ | Embarrassment (distinct from shame) | ~62-70% | Miller's (1996) real, foundational embarrassment account and Keltner & Buswell's (1997) real, well-cited appeasement-function finding both directly match what's built (audience-dependent, low-identity-stakes); the specific saturating-audience-size formula and identity-stakes suppression term are own engineering |
170
+ | Mortality salience (Terror Management Theory) | ~68-76% | Greenberg, Pyszczynski & Solomon's (1986) real, extensively-replicated Terror Management Theory is one of the best-validated findings cited anywhere in this table — the real two-phase proximal-suppression/distal-defense SHAPE is the cited finding; the specific delay/fade time constants are own tuning, not measured TMT experimental data |
171
+ | Relief (threat-must-precede-it positive spike) | ~48-56% | Frijda's (1986) real relational-theme taxonomy explicitly names "distress abating" as relief's real, distinct trigger, but the citation is thinner than the other rows here (relief gets one line in Frijda's broader taxonomy, not its own elaborated theory); the requires-prior-real-threat gating and the specific short-spike decay shape are own design end to end |
172
+ | RAGE/FEAR/LUST (3 remaining Panksepp primary-process systems) | ~65-73% | Panksepp (1998) and Panksepp & Biven (2012), already cited for SEEKING/CARE/PLAY/PANIC-GRIEF, are equally real and well-matched for these 3 — this project's own citation ledger had left them explicitly disclosed as missing for several rounds; the specific thwarted-goal/threat/attraction trigger formulas and decay are own engineering, same as the other 4 systems |
173
+ | Prestige (status via freely-conferred respect) | ~63-71% | Cheng, Tracy & Henrich's (2010) real, well-cited finding that dominance and prestige are two distinct real status pathways is a close match to what's built; the specific competence-demonstration-plus-recognition formula and its decay are own design |
174
+ | Framing effects | ~68-76% | Tversky & Kahneman's (1981) real, classic, extensively-replicated framing-effects finding is one of the best-established results in this entire table; deliberately kept introspection-only (does not feed back into emotional state, same discipline `PercentageOfAssets` follows) since auto-detecting real linguistic framing from arbitrary text has no reliable heuristic here — the specific frame-shift magnitude and ambiguity-scaling are own tuning |
175
+ | Ideal-self discrepancy | ~58-66% | Higgins' (1987) real self-discrepancy theory explicitly names this second, dejection-family gap as distinct from the already-modeled ought-self one — a close, direct match; the specific openness-linked aspiration bar and dejection-pressure formula are own engineering |
176
+ | Comparison Level for Alternatives | ~60-68% | Rusbult's (1980) real Investment Model of Commitment is a well-cited, foundational relationship-science finding extending the interdependence theory already cited elsewhere; the specific alternative-quality EMA and commitment-weighting formula are own design |
177
+ | Reflected glory (BIRGing/CORFing) | ~62-70% | Cialdini et al.'s (1976) real, classic, well-replicated field studies are a close match to what's built; the specific dampened-CORFing-relative-to-BIRGing asymmetry (own tuning, not measured from Cialdini's own data) and the publicness-scaling term are own engineering |
178
+ | Dream synthesis | ~50-58% | Domhoff's (2003) real continuity hypothesis and Hobson & McCarley's (1977) real activation-synthesis account are a well-matched, real grounding for "dreams synthesize real stored material, continuous with waking concerns"; the specific deep-sleep threshold, the topic/valence synthesis formula, and especially the unprompted-mention gate (own design end to end, no citation for that part specifically) are own engineering |
179
+ | Subconscious processing | ~60-68% | Kihlstrom's (1987) real cognitive-unconscious framework, Zajonc's (1968) real mere-exposure effect, and Wegner's (1994) real ironic-process theory are all well-established, well-cited, and closely matched to their respective sub-mechanisms; the losing-coalition-residue extension of `GlobalWorkspace` is a direct, real corollary of Dehaene & Naccache's own theory rather than a separate citation; the specific accrual/decay formulas for all three are own engineering |
180
+ | Bereavement grief (third-party loss) | ~65-73% | Shear & Shair's (2005) real attachment-based bereavement-grief account is a close, direct match for the real gap it fills: grief for someone other than the conversational partner, distinct from `GriefEngine.triggerLoss()`'s own relational-rupture-only trigger; the composite-key storage and shared power-law decay are own engineering, not new theory |
181
+ | Ambiguous loss (present but changed) | ~55-63% | Boss's (1999) real, well-cited ambiguous-loss concept is a close match for the real structural claim modeled: no clean boundary means no clean closure; the specific permanent-floor fraction (0.35 of peak) is own tuning, not measured from Boss's own qualitative work |
182
+ | Disenfranchised grief (socially unvalidated loss) | ~55-63% | Doka's (1989) real, coined disenfranchised-grief concept is a close match for the real claim modeled: unwitnessed loss decays slower; the specific social-validation-to-decay-constant scaling is own engineering, not derived from a measured dataset |
183
+ | Conservation-withdrawal (overwhelm-driven shutdown) | ~60-68% | Engel & Schmale's (1972) real, biologically-grounded conservation-withdrawal theory is a well-matched, real citation for sustained-overwhelm passive shutdown and solitude-pull, genuinely distinct from `EmotionalImmuneSystem`'s numbing and `BoredomSystem`'s understimulation; the specific threshold/recovery-rate formula is own tuning |
184
+ | Denial, repression, reaction formation (ego defenses) | ~65-73% | Anna Freud's (1936) real, foundational triad and Vaillant's (1977) real hierarchy, both already grounding the existing `rationalization`/`projection`/`evasion` rows, are equally close matches for these 3; the specific trait-to-weight mappings are own design, not measured from either source |
185
+ | Self-distancing speech (illeism) | ~62-70% | Kross et al.'s (2014) real, foundational finding and Moser et al.'s (2017) real, distinct fMRI/ERP evidence that third-person self-talk regulates emotion without the usual cognitive-control cost are both close, direct matches; the specific gate threshold and boost magnitude are own tuning |
186
+ | Anticipatory grief and prolonged grief disorder | ~62-70% | Rando's (1986) real anticipatory-grief account and Prigerson et al.'s (2021) real, current DSM-5-TR/ICD-11 diagnostic criterion are both well-established, closely-matched citations; the specific dampening fraction and the 6-month default window are own tuning, not measured from either source |
187
+ | Bereavement overload | ~60-68% | Kastenbaum's (1969) real, coined "bereavement overload" concept is a close, direct match for the real 2-part condition modeled (2+ genuinely concurrent griefs past a combined threshold, not one large grief alone); the specific threshold and minimum-concurrent-count are own tuning, not measured from his own clinical writing |
188
+ | Drift Diffusion Model (ambiguous-appraisal deliberation) | ~68-76% | Ratcliff's (1978) real, extensively-replicated Drift Diffusion Model is one of the best-validated sequential-sampling accounts in cognitive psychology; the literal formula (dx = A·dt + c·dW) is implemented directly, only the boundary/noise/step-to-ms conversion constants are own tuning |
189
+ | Signal-detection self-calibration (sarcasm detection) | ~65-73% | Green & Swets' (1966) real, foundational d'/criterion framework and Hautus' (1995) real correction for extreme proportions are both closely matched, standard formulas implemented directly; the specific 2-turn-deferred ground-truth proxy for what counts as a "hit" is own engineering |
190
+ | Hick-Hyman Law (workspace-complexity latency) | ~70-78% | Hick's (1952) and Hyman's (1953) real, classic, well-replicated logarithmic reaction-time law is implemented as its literal formula against GlobalWorkspace's own real coalition count; only the a/b constants (kept in the empirically observed range) are own tuning |
191
+ | Stevens' Power Law (per-kind sensory habituation) | ~65-73% | Stevens' (1957) real, foundational psychophysical law is implemented as its literal formula; the specific exponent-decay rate and floor are own tuning, not measured from Stevens' own data |
192
+ | Weber-Fechner Law (perceived-change-vs-baseline) | ~65-73% | Weber's (1834) and Fechner's (1860) real, classic, foundational psychophysics law is implemented as its literal log-ratio formula against the real pre-turn arousal baseline; the specific floor epsilon and output-scaling bounds are own engineering |
193
+ | Free energy estimate (Gaussian/Laplace closed form) | ~62-70% | Friston, Kilner & Harrison's (2006) real closed-form Gaussian approximation of variational free energy is implemented directly as F ≈ ½·precision·error² on top of the already-existing, already-cited `PredictiveProcessingCore.js`; this is the literal formula, not an approximation of an approximation |
194
+ | Nightmares (REM affect-regulation failure) | ~62-70% | Levin & Nielsen's (2007) real, well-established review frames a nightmare exactly as this module treats it: a real FAILURE mode, not a separate generator; the 4 real sub-signals it combines (amygdala/PFC ratio, unresolved fear, physiological panic, REM-rebound pressure) each reuse an already-existing, already-cited real module rather than re-deriving anything; the specific combining weights and threshold are own design |
195
+ | Oxytocin/vasopressin bonding chemistry | ~62-70% | Carter's (1998) real, foundational neuroendocrine account of attachment is a close, direct match for the real generalized felt-safety/idealization-suppression signal modeled; the specific build/decay rates and the 0.3/0.4 coupling coefficients into hijack threshold and appraisal are own tuning, not measured neurochemical concentrations |
196
+ | Endogenous opioid social-bonding analgesia | ~62-70% | Panksepp's (1998) own real opioid theory of separation distress (already cited for PANIC/GRIEF) and Machin & Dunbar's (2011) real review are both close, direct matches for the real pain-buffering-then-lost mechanism modeled; the specific buffer build/decay rates and the allostatic-load discount are own engineering |
197
+ | Symbolic/conversational jealousy | ~63-71% | White & Mullen's (1989) real jealousy theory, already grounding `evaluate()`'s own trend-comparison pathway, equally supports `computeJealousy()`'s own direct formula (already built, only newly wired); the specific real signal fed into it (max of this turn's own negative desirability and socialReference's relativeUtility) is own engineering |
198
+ | Delayed bereavement drive suppression | ~62-70% | Shear & Shair's (2005) real bereavement account, already cited, supports the real observation that acute grief's incapacitating effects build over days rather than landing instantly; the specific 36h rise constant is own tuning, not measured from a published onset-latency dataset |
199
+ | Composite "current concerns" dream | ~60-68% | Domhoff's (2003) own real repertoire-of-concerns account, already cited, is explicit that dreaming draws on multiple waking threads at once; the real weighted-blend formula and the specific per-source weighting are own engineering, not a reproduction of any published dream-content model |
200
+ | Real loyalty-conflict guilt | ~63-71% | Tangney & Dearing's (2002) real shame/guilt distinction, already cited for `ShameGuiltSplit.js`, is a close, direct match for genuine divided-loyalty guilt; the specific opposing-signs framing fed into `getConflict()` is own engineering, caught and fixed after an empirical test showed the naive same-sign reading under-detected real conflict |
201
+ | Accumulating desire (incentive-salience wanting) | ~63-71% | Berridge & Robinson's (1998) real, foundational incentive-salience account, already cited for DopaminergicEngine's own wanting/liking split, is a close, direct match; the specific saturating-exponential build/satiation formula is own engineering |
202
+ | Temptation under conflict | ~62-70% | Mischel's (1996) real hot/cool systems distinction is a close match for desire-becomes-temptation-under-constraint; reuses already-built real forbiddenness signals rather than inventing new ones, but the specific T=D·P·O combining formula is own design |
203
+ | Craving residual after resisting desire | ~62-70% | Wegner's (1994) real ironic-process theory, already cited for SubconsciousEngine's own topic rebound, is a close match applied to a distinct, desire-scoped real residual; the specific kindling/decay constants are own tuning |
204
+ | Resisting vs. yielding to temptation | ~63-71% | Baumeister et al.'s (1998) real ego-depletion account, already cited for EgoDepletionBudget/InhibitoryControlPool (reused directly here, not duplicated), is a close, direct match; the specific logistic weighting is own engineering |
205
+ | Chills ("escalofrío") peak response | ~62-70% | Maruskin, Thrash & Elliot's (2012) real, foundational chills construct is a close match for a genuinely distinct fast-rise/fast-decay resonance response; the specific 6-channel combining formula and per-cue habituation constants are own engineering |
206
+ | Secret-keeping cost and leak risk | ~63-71% | Slepian, Chun & Mason's (2017) real mind-wandering-cost finding and DePaulo & Kashy's (1998) real white-lie-frequency account are both close, direct matches; the specific cost-accrual and leak-probability logistics are own engineering |
207
+ | Shared relationship idioculture (inside jokes/rituals) | ~60-68% | Bell, Buerkel-Rothfuss & Gore's (1987) real, coined idioculture concept is a close match for jointly-built inside jokes/nicknames/rituals; the specific reinforcement/reactivation formulas are own design |
208
+ | Loneliness (connection-quality deficit) | ~62-70% | Cacioppo & Patrick's (2008) real, foundational loneliness account is a close, direct match for a felt-quality gap genuinely distinct from AffiliationThermostat's own contact-frequency tracking; the specific target/update formula is own engineering |
209
+ | Anticipated regret | ~60-68% | Zeelenberg's (1999) real anticipated-regret account is a close match, genuinely distinct in framing from the already-existing retrospective CounterfactualComparison; the specific yield-dampening formula is own design |
210
+ | Hope and its disappointment crash | ~62-70% | Snyder's (2002) real, well-established componential hope theory is a close match; the crash-scales-with-prior-hope claim is a real, distinct mechanism from ordinary RPE, and the specific evidence/crash formulas are own engineering |
211
+ | Self-compassion vs. self-attack | ~60-68% | Neff's (2003) real self-compassion account is a close match for genuinely different post-failure recovery trajectories; reuses ShameGuiltSplit's own real shame reading, and the specific recovery-multiplier formula is own design |
212
+ | Empathic accuracy (bias vs. accuracy split) | ~58-66% | Ickes' (1997) real empathic-accuracy paradigm is a close match; reuses MonteCarloToM's own real estimate as the biased read, and the specific bias/accuracy formulas are own engineering |
213
+ | Consolation fit (matching support type to need) | ~58-66% | Cutrona & Russell's (1990) real optimal-matching theory of social support is a close match; reuses EmpathyCompassion, and the specific fit/efficacy formula is own design |
214
+ | Sleep-quality coupling to next-day self-control | ~62-70% | Barber & Munz's (2011) real sleep-consistency/self-control finding is a close, direct match; applied to InhibitoryControlPool's own real level right after a real REM sweep, and the specific fragmentation/multiplier formulas are own engineering |
215
+ | Conversational misunderstanding repair | ~63-71% | Schegloff, Jefferson & Sacks' (1977) real, foundational conversation-analysis account of repair is a close, direct match, genuinely scoped narrower than the existing RepairProtocol's rupture-and-apology track; the specific classification thresholds are own tuning |
216
+ | Meaningful silence typing | ~58-66% | Jaworski's (1993) real account that silence carries distinct communicative types is a close match; the specific 4-type argmax classifier over already-computed bond/cooling/contempt/valence/arousal signals is own engineering |
217
+ | Typed intuition / gut-feeling layer, hypervigilance-biased reading | ~56-64% | Kahneman's (2011) real dual-process account and Mischel's (1996) hot/cool systems distinction are close, well-matched grounding for the general fast-hunch-vs-slow-override shape; reuses the already-built real k-NN+entropy hunch (`Intuition.js`) directly; Ozer et al.'s (2003) real hypervigilance-after-trauma finding now biases how an already-real ambiguous cue gets READ (strength, corroboration bar), not only whether the gate opens; the specific lexical-cue-to-prototype matching, bias-delta formulas, threshold-ramp constants, and Beta-style overconfidence tracker are own engineering, not a learned classifier |
218
+ | Threat cascade: entrapment, freeze, fragmented memory, persistence-adjusted lasting trace | ~60-68% | Porges' (1995, 2011) neuroception, Cannon's (1932) mobilization, Nijenhuis & van der Hart's (2011) real entrapment/tonic-immobility distinction, van der Kolk & Fisler's (1995) real fragmented-memory finding, and Herman's (1992) / Ozer et al.'s (2003) real post-event-safety and dissociation-predicts-chronicity findings together closely match what's built, now extended to real decay speed (slower without co-regulation, slower still for high peak severity) and a real scar floor for a poorly-consolidated event; the gate now also opens on a severe ontology concept match (betrayal/threat/humiliation) or real high stakes alone, closing a real gap where a genuinely severe event's own blended appraisal could read less extreme than the matched concept's own severity; reduced to 6 states by explicit design (not the full clinical taxonomy), deliberately gated on genuine extremity; the specific combining formulas, novelty-decay, and threshold constants are own engineering |
219
+ | Subjective well-being and its downstream leverage, soft-ceiling read | ~66-74% | Rutledge et al.'s (2014, PNAS) real, published well-being equation is implemented directly as its literal recursive-EMA equivalent; standard ligand-receptor mass-action kinetics are a real, established pharmacology formula reused honestly as a distinct satiation gate; Fredrickson's (2001) real broaden-and-build theory grounds the forward-feeding into gratitude, prosocial reputation, and stress recovery; the normalized 0..1 read is a real logistic squash (own tuning, Weber-Fechner-consistent diminishing-marginal-sensitivity shape already used elsewhere in this codebase) instead of a hard clamp, so it asymptotes without ever fully pinning at the ceiling; which specific mechanisms receive that leverage is own engineering |
220
+ | Yearning (anhelo) for someone genuinely absent, breakup-initiator-adjusted, real ambient pull during real absence | ~57-66% | Reuses Schultz, Dayan & Montague's (1997) real TD-learning reward-prediction-error formula directly (via the already-built `DopaminergicEngine.computeRPE()`, not a reimplementation) for the anticipation/reality-check cycle; Schacter & Addis's (2007) real constructive-episodic-simulation finding grounds treating an imagined future as a real reward signal; Mikulincer & Shaver's (2007) real attachment-strategy account motivates the anxious/avoidant γ split; Sprecher et al. (1998)/Perilloux & Buss (2008) ground why being left amplifies real pain while Festinger (1957) grounds why having left dampens the real fantasy itself; a real accumulated yearning trace now also measurably amplifies the separate reunion-reactivation mechanism's own boom on actual reunion; the idealization weighting, kindling-trace formula, ambient-absence ramp, and conservative real-lexical-cue-only trigger condition for the message-driven path are own engineering |
221
+ | ChildlikeMode: a real playful stance, not baby-talk | ~54-63% | Panksepp's (1998) real PLAY primary-process account (already cited for `PrimaryDrives.js`); Bowlby (1988)/Ainsworth (1978) real secure-base finding that felt security enables exploratory/playful behavior; Fredrickson's (2001) real broaden-and-build theory (already cited for `HappinessEngine.js`) grounds why positive affect broadens toward play; a real smoothed, persistent per-user activation gates real (never-zeroing) suppression of adult-serious weight, a real play/friki-share boost, and a real hard abort on genuine threat/shame/precisionMode; the specific weight constants, gate threshold, and smoothing/decay rates are own engineering |
222
+ | Per-user engagement/boredom, extending the pre-existing BoredomSystem | ~55-64% | Eastwood, Frischen, Fenske & Smilek's (2012) real boredom-as-unengaged-attention account (the same real citation the pre-existing global `BoredomSystem` already used); Berlyne's (1960) real inverted-U arousal/interest account grounds understimulation; real PartnerPull composes already-tracked bond/desire/yearning/oxytocin/aversion/cooling/betrayal-trace signals into one real "does this person still pull attention" read, with a real hard override so genuine threat is never misread as boredom; the specific weight constants and the non-deterministic novelty-seeking probability are own engineering |
171
223
 
172
224
  ## Prerequisites
173
225
 
@@ -188,7 +240,7 @@ yarn add totemheart
188
240
  ```js
189
241
  import { Totemheart, Personality, VERSION } from 'totemheart'
190
242
 
191
- console.log( VERSION ) // '0.1.4', also available as Totemheart.VERSION and in toJSON().version
243
+ console.log( VERSION ) // '0.1.5', also available as Totemheart.VERSION and in toJSON().version
192
244
 
193
245
  const ai = new Totemheart( {
194
246
  personality: new Personality( { neuroticism: 0.7, agreeableness: 0.3 } ),
@@ -224,6 +276,8 @@ await client.chat.completions.create( {
224
276
 
225
277
  Run `npm run demo` for a full scripted conversation showing decay, hedonic adaptation, dopaminergic surprise, sensory overload, and a generated system prompt in action. Run `npm test` for the mechanic-level test suite. Run `npm run stress-test` ([`examples/full-stress-test.js`](examples/full-stress-test.js)) for a before/after weight trace across a battery of positive/negative/severe shocks, repeated hostility, idle time passing, hardware latency, worn-path caching, and a group/bystander turn. Run `npm run upgrade-round-mock` for the momentum/hysteresis, allostatic-load, wanting/liking, reconsolidation, attachment-style, graded-hijack, Vaillant-defense, expression-policy, resource-allocation, and circadian-coupling round, or `npm run lovehate-mock` for `LoveHateEngine`'s ambivalence, kindling, and rupture-and-repair cycle end to end.
226
278
 
279
+ **Gold-standard regression checks**: `npm run gold-standard-mock` ([`examples/five-emergent-human-tests-mock.js`](examples/five-emergent-human-tests-mock.js)) runs 5 real, multi-week emergent-behavior scenarios end to end (verbal-vs-chemical forgiveness lag, symbolic jealousy from comparison alone, third-party bereavement vs. relational cooling, blush/micro-slips under romantic tension with a strict factual mask, and ex-partner reentry competing against a newer bond). Tests 1 and 5 (forgiveness lag, ex reentry) are the two with the cleanest, most reproducible emergent signal and are the ones worth re-running as a qualitative gold standard before every release, on top of the automated suite above: real bondNet/trust recovering days before oxytocin/opioid do, and a real loyalty conflict with no automatic reset to whichever bond has the higher instantaneous oxytocin reading.
280
+
227
281
  ### Real ML instead of heuristics: `TransformersProvider`
228
282
 
229
283
  `HeuristicProvider` is a hand-written lexicon; `TransformersProvider` runs an actual model trained on [GoEmotions](https://arxiv.org/abs/2005.00547) (28 emotion labels, Reddit-sourced) via [transformers.js](https://huggingface.co/docs/transformers.js): real inference, no API key, no server. It's an optional peer dependency, so it doesn't touch the zero-dependency default:
@@ -242,19 +296,20 @@ The default model (`kamaludeen/multilingual_go_emotions-ONNX`) was chosen becaus
242
296
 
243
297
  ## Plugins
244
298
 
245
- Six official, separately-published packages under [`packages/`](packages), each real and independently tested (34 per-plugin tests + 2 all-6-at-once cross-integration tests in [`test/plugins-cross/`](test/plugins-cross) — none of them share fate with the core suite, `npm test` alone never runs them; use `npm run test:all`). Every plugin is a duck-typed consumer of the core's real, already-documented extension points (`LanguageProvider`'s `analyze()` contract, `EpisodicMemory`'s `adapter` interface, `ExpressionDirectives`' output) — none of them required changing core to build.
299
+ Seven official, separately-published packages under [`packages/`](packages), each real and independently tested (39 per-plugin tests + 10 cross-integration tests in [`test/plugins-cross/`](test/plugins-cross); none of them share fate with the core suite, `npm test` alone never runs them; use `npm run test:all`). Every plugin is a duck-typed consumer of the core's real, already-documented extension points (`LanguageProvider`'s `analyze()` contract, `EpisodicMemory`'s `adapter` interface, `ExpressionDirectives`' output); none of them required changing core to build.
246
300
 
247
301
  | Package | What it is | Real, not simulated |
248
302
  | --- | --- | --- |
249
- | [`@totemheart/provider-openai`](packages/provider-openai) | An OpenAI-compatible chat-completions `LanguageProvider` | Real `fetch` to `/chat/completions`; throws on any failure (missing key, unreachable host, bad status), same resilience contract as the built-in `OllamaProvider` — Totemheart falls back to `HeuristicProvider` transparently |
250
- | [`@totemheart/store-sqlite`](packages/store-sqlite) | A real, on-disk `EpisodicMemory` adapter | Node's built-in `node:sqlite`, zero external dependency; real persistence verified by closing and reopening the database file. **Known, documented limitation**: `EpisodicMemory`'s adapter contract as implemented in core today only routes `store()`/`recall()` through the adapter — `markResolved()`, `getUnresolvedMemories()`, Zeigarnik pressure, and REM-salience all still read the in-memory array, which stays empty when an adapter is set. Verified explicitly in this plugin's own tests, not silently assumed to work |
251
- | [`@totemheart/bridge-tts`](packages/bridge-tts) | Maps real `ExpressionDirectives.getProsodyDirectives()` output onto standard SSML `<prosody>` markup | W3C SSML, not a single vendor's proprietary format — usable as-is with Azure, Amazon Polly, or Google Cloud TTS. No API calls (no credentials this package could honestly claim to have) |
252
- | [`@totemheart/bridge-robotics`](packages/bridge-robotics) | Maps real `getPostureDirectives()`/`getActionTendency()` output onto a generic actuator-command schema and sends it over real HTTP | Genuine network I/O, tested against a real local listener — not a claim of ROS2/vendor-protocol conformance, since there's no real robot here to verify that against |
253
- | [`@totemheart/devtools`](packages/devtools) | A zero-dependency local HTTP dashboard for a running `Totemheart` instance | Real `node:http` server exposing `getEmotionalState()` and the real `ExplainabilityEngine` decision log live, polled by a minimal dashboard page — no `console.log`-only debugging |
254
- | [`@totemheart/audit-kit`](packages/audit-kit) | Reusable cross-mechanism test helpers | Extracted directly from `test/integration/cross-mechanism-friction.test.js` — the same `assertFiniteState`/`driveToRupture`/`noBurst`/`noHijack` helpers this repo uses on itself, packaged for a fork or downstream app to run the same discipline against its own scenarios |
303
+ | [`@totemheart/provider-openai`](packages/provider-openai) | An OpenAI-compatible chat-completions `LanguageProvider` | Real `fetch` to `/chat/completions`; throws on any failure (missing key, unreachable host, bad status), same resilience contract as the built-in `OllamaProvider`; Totemheart falls back to `HeuristicProvider` transparently |
304
+ | [`@totemheart/provider-anthropic`](packages/provider-anthropic) | An Anthropic Messages API `LanguageProvider` | Real `fetch` to `/v1/messages` with `x-api-key`/`anthropic-version` headers; throws on any failure (missing key, unreachable host, bad status), same throw-and-fallback resilience contract as `OllamaProvider`/`OpenAIProvider` |
305
+ | [`@totemheart/store-sqlite`](packages/store-sqlite) | A real, on-disk `EpisodicMemory` adapter | Node's built-in `node:sqlite`, zero external dependency; real persistence verified by closing and reopening the database file. **Known, documented limitation**: `EpisodicMemory`'s adapter contract as implemented in core today only routes `store()`/`recall()` through the adapter; `markResolved()`, `getUnresolvedMemories()`, Zeigarnik pressure, and REM-salience all still read the in-memory array, which stays empty when an adapter is set. Verified explicitly in this plugin's own tests, not silently assumed to work |
306
+ | [`@totemheart/bridge-tts`](packages/bridge-tts) | Maps real `ExpressionDirectives.getProsodyDirectives()` output onto standard SSML `<prosody>` markup | W3C SSML, not a single vendor's proprietary format; usable as-is with Azure, Amazon Polly, or Google Cloud TTS. No API calls (no credentials this package could honestly claim to have) |
307
+ | [`@totemheart/bridge-robotics`](packages/bridge-robotics) | Maps real `getPostureDirectives()`/`getActionTendency()` output onto a generic actuator-command schema and sends it over real HTTP | Genuine network I/O, tested against a real local listener; not a claim of ROS2/vendor-protocol conformance, since there's no real robot here to verify that against |
308
+ | [`@totemheart/devtools`](packages/devtools) | A zero-dependency local HTTP dashboard for a running `Totemheart` instance | Real `node:http` server exposing `getEmotionalState()` and the real `ExplainabilityEngine` decision log live, including every round-3 field (`legacyMemory`, `betrayalTraumaTrace`, `culturalScriptLibrary`, `somaticMarkerNetwork`, `powerDynamicsEngine`, `insightGenerator`, `colony`, `primaryDrives`, `immuneExposure`, `immuneDampening`), polled by a minimal dashboard page, no `console.log`-only debugging |
309
+ | [`@totemheart/audit-kit`](packages/audit-kit) | Reusable cross-mechanism test helpers | Extracted directly from `test/integration/cross-mechanism-friction.test.js`: the same `assertFiniteState`/`driveToRupture`/`noBurst`/`noHijack` helpers this repo uses on itself, packaged for a fork or downstream app to run the same discipline against its own scenarios |
255
310
 
256
311
  ```bash
257
- npm install @totemheart/provider-openai @totemheart/store-sqlite @totemheart/bridge-tts @totemheart/bridge-robotics @totemheart/devtools @totemheart/audit-kit
312
+ npm install @totemheart/provider-openai @totemheart/provider-anthropic @totemheart/store-sqlite @totemheart/bridge-tts @totemheart/bridge-robotics @totemheart/devtools @totemheart/audit-kit
258
313
  ```
259
314
 
260
315
  ## License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "totemheart",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "workspaces": [
5
5
  "packages/*"
6
6
  ],
@@ -22,6 +22,15 @@
22
22
  "exhaustive-audit": "node examples/exhaustive-audit-mock.js",
23
23
  "upgrade-round-mock": "node examples/upgrade-round-mock.js",
24
24
  "lovehate-mock": "node examples/lovehate-mock.js",
25
+ "gold-standard-mock": "node examples/five-emergent-human-tests-mock.js",
26
+ "extreme-scenarios-mock": "node examples/five-extreme-adult-scenarios-mock.js",
27
+ "system-tests-mock": "node examples/five-system-tests-round30-mock.js",
28
+ "intuition-mock": "node examples/intuition-triangulation-mock.js",
29
+ "intuition-calibration-tests": "node examples/intuition-5-calibration-tests.js",
30
+ "trauma-happiness-mock": "node examples/trauma-happiness-emergence-mock.js",
31
+ "system-5-trauma-happiness-intuition": "node examples/trauma-happiness-intuition-5-tests.js",
32
+ "emergence-battery-20": "node examples/emergence-battery-20.js",
33
+ "emergence-battery-childlike-boredom-trauma-20": "node examples/emergence-battery-childlike-boredom-trauma-20.js",
25
34
  "test": "node --test test/regression/*.test.js test/integration/*.test.js test/property/*.test.js",
26
35
  "test:plugins": "for d in packages/*/; do (cd \"$d\" && node --test test/*.test.js) || exit 1; done && node --test test/plugins-cross/*.test.js",
27
36
  "test:all": "npm test && npm run test:plugins"