Technical overview
This is math, not design
CCF doesn't script social behaviour — it lets it emerge from three mathematical primitives applied to raw sensor data. No training, no personality presets, no hand-tuned state machines.
The pipeline
Sensors (6 dimensions)
│
▼ SensorVocabulary::to_feature_vec()
ContextKey<V, N> ←── FNV-1a hash (deterministic)
│
▼ CoherenceField::positive_interaction()
CoherenceAccumulator (per context)
│ dual EMA: short-run + long-run
▼ CoherenceField::effective_coherence()
instantaneous_coherence + context_coherence
│
▼ Personality thresholds (gate check)
SocialPhase → LED tint, motor scale, voice tone
│
▼ MinCutBoundary (Stoer–Wagner)
Context graph partitioned → cross-context mixing bounded
│
▼ SinkhornKnopp projection
Manifold constraint satisfied → output to actuatorsContext-keyed accumulators
Each sensor reading produces a context key — a 32-bit hash of the normalised feature vector. The system maintains a separate CoherenceAccumulator per key, tracking two exponential moving averages: a fast short-run EMA and a slow long-run EMA.
This means coherence earned in the kitchen at evening time is stored under a different key than coherence earned in the hallway at morning time. Context specificity is structural, not programmed.
// Positive interaction observed
field.positive_interaction(
&key, // ContextKey<V, N>
&personality,
tick, // u64 timestamp
false, // alone?
);
// Read current coherence
let c = field.context_coherence(&key);
// → 0.0 .. 1.0// Both must be true: instant_coherence > personality.min_instant context_coherence > personality.min_context // If either fails → ShyObserver // If both pass → evaluate SocialPhase
The minimum gate
The gate acts as a logical AND on two independent coherence readings. A sudden warm stimulus can raise instantaneous coherence, but cannot pass the gate without a matching long-run context baseline.
This is why a robot won't immediately trust a stranger who is being unusually nice — the long-run accumulator simply hasn't built up yet. Social reserve is the default, not a programmed rule.
Graph min-cut boundary
CCF maintains a graph where contexts are nodes and edges are weighted by cosine similarity of their feature vectors. The Stoer–Wagner algorithm finds the minimum cut — the weakest boundary between two groups of contexts.
Kitchen trust crosses the cut boundary and warms the hallway — a little. The cross-context influence is proportional to the cut weight, then constrained by Sinkhorn–Knopp projection to stay on the doubly-stochastic manifold.
Architecture