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 actuators
PRIMITIVE 01

Context-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.

RUST · ccf-core
// 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
GATE CONDITION
// Both must be true:
instant_coherence  > personality.min_instant
context_coherence  > personality.min_context

// If either fails → ShyObserver
// If both pass → evaluate SocialPhase
PRIMITIVE 02

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.

PRIMITIVE 03

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

The seven pillars of CCF

1
Context-keyed accumulation
Coherence is tracked independently per context key — a composite of sensor readings hashed to a 32-bit identifier. Each context has its own accumulator.
2
Dual-threshold gate
The minimum gate requires both instantaneous coherence (short-run) and context coherence (long-run) to simultaneously exceed per-personality thresholds.
3
Min-cut graph boundary
A Stoer–Wagner min-cut algorithm partitions the context graph into two regions. Trust in one partition exerts bounded, decaying influence on the other.
4
Manifold-constrained mixing
Sinkhorn–Knopp projection constrains the coherence manifold so that cross-context influence cannot violate doubly-stochastic balance.
5
Personality modulation
A Personality struct holds bounded floats (0–1) for warmth, reactivity, and caution. These scale thresholds without ever overriding the gate.
6
Deterministic hashing
ContextKey hashes are deterministic across restarts via FNV-1a over a fixed-length float vector — no randomness, fully reproducible.
7
no_std, no heap
The entire framework compiles to wasm32-wasip1 and thumbv7em-none-eabihf. No heap allocator required. It runs on a $50 mBot2.