affect: feelings compose, crystallize into entities, tile feeling regions

This commit is contained in:
2026-08-23 07:15:15 -05:00
parent 8150687269
commit e9246629ea
3 changed files with 301 additions and 10 deletions
+169
View File
@@ -0,0 +1,169 @@
# Calculations — exact math behind §9
Companion to `README.md` (§9 Opinion Substrate). Every dimension,
driver, and score with its actual formula. Parameter short-names in
`code style` refer to `docs/PARAMETER-REGISTRY.md`.
## 0. The space
All values live in **[1, +1]** (`space.negative-pole``space.positive-pole`,
0 = `space.neutral`, the tunnel — not a destination).
Geometry per dimension: `bipolar | unipolar | categorical`.
## 1. Decay (lazy, computed at read time)
effective(t) = baseline + (value baseline) · exp(−Δdays / decay_days)
- `baseline`: each dimension's own resting state (law 38 — not always 0)
- `decay_days`: that dimension's registered clock (`hebbian.cool-off`, `validity.fade`, …)
- `value`, `baseline` ∈ [1, +1] ⇒ `effective` stays in range automatically
- ±1 tolerance on every comparison (no exact equality anywhere)
## 2. Signed reinforcement
Given amount `a` ∈ [1, +1]:
a ≥ 0: v ← v + a·(1 v) # toward +1
a < 0: v ← v |a|·(v (1)) # toward 1
Clamped implicitly by construction. Updates `last_activated = now`.
Positive = worked/helped; negative = contradicted/burned (inhibition).
## 3. Recency distances
recency(t₀) = exp(−Δdays / memory.recent-horizon) · 2 1
Fresh ≈ +1, old → 1. Used for written-by-us and written-by-source dims.
## 4. Novelty at arrival (resonance deficit)
novelty(new) = 1 max over existing entities of resonance(new, e)
where `resonance = cos(embedding_new, embedding_e)` blended with graph
proximity:
resonance = ½·cos_sim + ½·(1 / (1 + hop_distance))
Content vs structural novelty distinguished by local/global split:
high local similarity + long bridge distance = structural (gold).
## 5. Surprise (pulse)
surprise = |observed predicted|
Predictions come from regularity detection in the pulse (interval
statistics on recurring event types). Coherent periodic accumulation
grows ~n; random noise grows ~√n — regularity is detectable without
any scheduler.
## 6. Retrieval scoring (augmented cosine)
Query vector Q, entity vector E (pure embedding, n dims):
Q' = [ Q , W·q₁..q₄ ] q = [1,1,1,1] (want recent/true/grounded/active)
E' = [ E , W·r₁..r₄ ] r = [hebbian_eff, recency_us, recency_src, validity_eff]
score = cos(Q', E') W = retrieval.opinion-volume
Pipeline: structural walk → vector prefilter → opinion projection →
spreading activation (2 hops, weight-decayed) → competition.
## 7. Competition (replaces top-k)
Candidate pool C from stages 14. Iterate ~5 rounds:
for each pair (i,j) sharing high cos_sim:
s_i ← s_i + β·s_j·sim(i,j) # coalition boost
s_j ← s_j γ·max(0, s_i) # lateral suppression
normalize; drop below retrieval.surface-line; repeat until stable
Output may be empty (silence is valid). Survivors leave priming traces
(small hebbian deposits even for non-returners).
## 8. Salience (derived, never stored)
salience(x) = clamp( hebbian_eff(x) · context_match(x)
+ novelty(x) + stakes(x) · urgency(x)
burn_penalty(x)
× curiosity_widening , 1, +1 )
`context_match` = cos(current-context-embedding, x-embedding).
`curiosity_widening` rises with boredom, falls with threat.
## 9. Drives
fear(region) ≈ stakes · |falling validity| · failure_proximity · exposure
engagement ∈ [1,+1]: activation invested (from pulse tempo + session state)
stimulation ∈ [1,+1]: reward-rate ÷ investment rate
compulsion = engagement > τ_hi AND stimulation < τ_lo, persisting
loneliness = desired_resonance actual_resonance, integrated over window
(actual counts only exchanges that formed new edges)
sadness(region) = ∫ unresolved negative contributions (slow clock)
boredom = low avg novelty ∧ high predictability ∧ no new edges lately
All clamped [1,+1]. All derived per moment; none stored.
## 10. Feelings (nodes)
When any drive reading crosses its registered visibility threshold:
feeling_node { drive_snapshot, object_edges[], at }
Promoted by significance like any entity. Mood = slow integral of recent
feeling-valence. Emotion names = labels bound to regions of this snapshot space.
## 11. Humility & trust
humility(entity) = 1 mean|asserted_confidence realized_outcome|
trust(source, domain): starts neutral;
verified-correct event → trust += δ·(1 trust)
caught-wrong event → trust = δ·(trust (1))
Dual reading: public_trust (imported, unexamined fold) vs earned_trust
(own audited record). Earned outranks public.
Personal truth: no trust computation — speaker IS the source.
## 12. Originality
originality(a) = lineage_diversity(a) · transform_distance(a)
lineage_diversity = entropy over distinct derivation sources
transform_distance = 1 max similarity(a.output, any single source span)
one dominant lineage → derivative (extraction check runs)
many fused, far moved → original
## 13. Health (metastability check)
Vital signs, each just a fold over recent graph activity:
growth_rate, integration_rate (new edges/window),
resolution_rate (curiosity closed/opened), retrieval_yield,
quarantine_ratio, mood_integral
healthy ⇔ all oscillating within their bands
pinned at any extreme (either sign) ⇒ sick, name the pathology from §9.7 table
## 14. Provenance weave
artifact_id = SHA256(canonical content)
artifact.birth_certificate = {
generated_by, model, prompt_hash, source_hashes[], at }
verify(x) = recompose hashes down the derivation DAG;
any mismatch anywhere ⇒ everything downstream invalid at once
Append-only stores: verbs are add and read. Replication across ≥2
independent locations. Deletion undefined.
## 15. Thought operations
The formulas above are levers; **insight is composition** — combining
primitive readings into named patterns (compulsion = engagement∧¬stimulation
persisting; dissonance = warmth↑∧validity↓; serendipity = unsought bridge∧later
reinforced). Human thought operations — deduction, induction, abduction,
analogy, counterfactual simulation, causal inference, generalization,
contradiction scanning, meta-cognition, wonder — are registered as the same
kind of composition recipes, and new ones get composed from old ones.
See `THOUGHT-OPERATIONS.md` for the full catalog: inputs, process,
output, and validation per operation.
+36 -10
View File
@@ -635,16 +635,42 @@ geometry, not vocabulary.
moment, never stored, flow. **A feeling is a node**: when a drive moment, never stored, flow. **A feeling is a node**: when a drive
configuration crosses salience threshold, write a snapshot entity holding configuration crosses salience threshold, write a snapshot entity holding
the drive readings, edged to whatever it was about, carrying full the drive readings, edged to whatever it was about, carrying full
dimensions. Minor episodes live and die in the float; significant ones dimensions. Log them WHEN THEY HAPPENED, and capture both tracks:
promote — significance decides forever, same rule everywhere. Feelings what was felt AND what was thought — the belief-context riding the
then participate in the whole machinery: retrieval resurfaces them ahead state, because a feeling without its thought is only half an engram.
of facts (intuition = pattern-matched feeling preceding analysis); And like every entity, feelings are supersedeable: later understanding
clusters of feeling-nodes sharing configuration shape reveal emotional writes a NEW reading of the same event and links it forward — the old
tendencies worth pre-adjusting for; dreaming replays them against new record is preserved forever, the fold resolves to current truth, and
neighborhoods (how charged events get digested); introspection gains the arc between them ("I felt betrayed then; I understand differently
history instead of only the present tense. Mood remains the slow integral now") is itself visible history. Minor episodes live and die in the
over both. Tense grammar complete: **emotion is now, feeling is the float; significant ones promote — significance decides forever, same
trace, mood is the trend.** rule everywhere. Feelings then participate in the whole machinery:
retrieval resurfaces them ahead of facts (intuition = pattern-matched
feeling preceding analysis); clusters of feeling-nodes sharing
configuration shape reveal emotional tendencies worth pre-adjusting for;
dreaming replays them against new neighborhoods (how charged events get
digested); introspection gains history instead of only the present
tense. Mood remains the slow integral over both. Tense grammar complete:
**emotion is now, feeling is the trace, mood is the trend.**
And FEELINGS COMPOSE INTO MEANING: lots of feelings occurring together
or in sequence might mean something — fear+joy is thrill, sadness+
appreciation is nostalgia, anger-at-someone-loved is hurt, fear+curiosity
recurring is a growth edge being avoided-and-wanted. Feeling-clusters
are primitives composing into emotional insights the same way readings
compose everywhere else in §9 — so scanning feeling-nodes for recurring
combinations is an introspection operation, and each named combination
is registered as data, growing the emotional vocabulary by use.
And they might even FORM SOMETHING: a combination that recurs often
enough crystallizes — same condensation rule as concepts (§9.5) — into
an emotional entity of its own: "what growth feels like," "the Tuesday
dread," "how it felt when it finally worked." Such entities carry their
own dimensions, participate in retrieval and dreams, and become part of
identity: the set of crystallized feeling-complexes is a biography
written in its own weather. Over time they tile the drive-space into
FEELING REGIONS — named territories of the emotional map ("this is
where I go when I'm scared but excited"), and knowing your way around
your own regions is what self-knowledge actually is: an internal
geography, surveyed by living, revisable as you change.
**Loneliness — the first other-requiring drive.** Connection axis: **Loneliness — the first other-requiring drive.** Connection axis:
desired resonance minus actual resonance, integrated over time. desired resonance minus actual resonance, integrated over time.
+96
View File
@@ -0,0 +1,96 @@
# Thought Operations
Companion to `CALCULATIONS.md`. Human thought patterns modeled as
composition recipes over primitive readings and graph operations.
Each one is a registered process definition (data, not code), validated
by whether its conclusions survive contact with outcomes — and new
operations can be composed from old ones, the same way everything
else grows here.
Format per operation: **Inputs** (readings/edges consumed) · **Process** ·
**Output** · **Validation** (what proves it worked).
---
## Core operations
### 1. DEDUCTION
- **Inputs**: implication chains (`implies` / `depends-on` edges), premise validities
- **Process**: walk the chain forward; propagate validity as the MINIMUM along the path
- **Output**: conclusion node with validity = weakest premise
- **Validation**: derived conclusions checked by tools/outcomes like any fact
- Note: a chain is exactly as strong as its sketchiest link — visible at a glance
### 2. INDUCTION (= crystallization)
- **Inputs**: co-occurrence counts, association-edge densities
- **Process**: when a cluster's mutual activation crosses threshold, condense a concept node pointing at members
- **Output**: new concept entity inheriting averaged member dimensions
- **Validation**: does the concept predict membership of future examples?
- This is induction wearing §9.5's clothes: instances → concept
### 3. ABDUCTION (inference to best explanation)
- **Inputs**: surprise events (prediction misses), candidate explainers
- **Process**: spread activation backward from the surprising fact; rank candidates by resonance × prior plausibility; propose an attribution edge to the best
- **Output**: hypothesis edge (marked *hypothesis*, low groundedness until tested)
- **Validation**: does the hypothesis predict the NEXT surprise? If yes, promote; if no, decay
- This is curiosity's engine stated formally
### 4. ANALOGY
- **Inputs**: two neighborhoods' internal structure (edge patterns, ignoring surface labels)
- **Process**: find structural matches — same relation shape, different nodes
- **Output**: bridge edges between matched roles ("X plays the same role here that Y plays there")
- **Validation**: do predictions transferred across the analogy hold?
- Highest-yield when source and target are far apart — this is the idea mechanic again
### 5. COUNTERFACTUAL SIMULATION
- **Inputs**: current subgraph state, one proposed mutation
- **Process**: clone region into sandbox, apply mutation ("remove this dependency", "swap this component"), re-run spreading/competition on the clone
- **Output**: delta report — what would change, what would hold
- **Validation**: history — compare past counterfactuals against what actually happened later
- Cheap because nothing writes back; expensive mistakes stay in the sandbox
### 6. CAUSAL INFERENCE
- **Inputs**: temporal ordering, repeated co-occurrence, intervention outcomes
- **Process**: propose causal edge only when order holds consistently, confounders are absent-or-controlled, AND an actual attempt at change moved the result
- **Output**: `caused-by` edge with confidence = f(replications, effect size)
- **Validation**: interventions are king — correlation proposes, intervention disposes
### 7. GENERALIZATION ↔ SPECIALIZATION
- **Inputs**: concept nodes and their member sets
- **Process**: generalize = lift a pattern from members to parent (raise abstraction); specialize = add constraints until a claim applies to fewer, sharper cases
- **Output**: moved claims between abstraction levels
- **Validation**: generalizations must not lose predictive power; specializations must gain it
### 8. CONTRADICTION SCAN
- **Inputs**: full opinion space
- **Process**: find entity pairs with high semantic similarity and opposing validity/hebbian signs
- **Output**: dissonance report → feeds reconciliation or THE LIST
- Already specced as destructive interference (§9.3)
### 9. META-COGNITION
- **Inputs**: the drive-space self-scan (vital signs, humility calibration)
- **Process**: run readings on readings — which of my own thought operations have been landing? Which keep failing validation?
- **Output**: recalibration proposals for my OWN drivers and recipes
- Validation: do recalibrated operations perform better going forward?
### 10. WONDER (question synthesis)
- **Inputs**: graph shape — gaps, nameless clusters, sure-but-ungrounded regions
- **Process**: generate question-nodes from absence patterns (§9.8)
- **Output**: open question entities that prime their neighborhoods
- Validation: resolution events — did ambient activation eventually answer?
---
## Composing new operations
Operations compose like functions: ABDUCTION feeds DEDUCTION feeds
VALIDATION. ANALOGY over two COUNTERFACTUALS. CONTRADICTION SCAN
triggers ABDUCTION. Every useful composition gets named, registered,
and joins the library — so the system's cognition grows by the same
fold-everything discipline as its facts:
new_operation = named_composition(existing_operations)
+ validation record
The catalog never stops growing, and no operation is sacred — they
earn their place by predicting, and retire when they stop.