# Overview

## Definition

Coherence is the Capacity that lets Kiduna:

1. define a legitimate desired state for a Realm, Ally, Actor, Avatar, interaction, or relationship;
2. collect permissioned observations about a named dimension in a named context;
3. estimate current state with confidence and provenance;
4. compare that estimate with a target, tolerance range, and absolute boundaries;
5. explain drift without turning difference into fault;
6. choose the least forceful response permitted by evidence, policy, Authority, Permissions, Consent, and entity type;
7. record the outcome and recalibrate when evidence shows the system was wrong.

Coherence is not a universal moral score. It is contextual alignment with an authorized purpose and desired state inside higher-order constraints.

## Minimum Coherence binding

Every Realm, Ally, Actor, and Avatar MUST resolve to this minimum binding at runtime:

```json
{
  "entity": { "type": "ally", "id": "ally.rowan" },
  "profileRef": "coherence-profile://ally.rowan/base@3",
  "policyRefs": ["coherence-policy://kiduna/constitutional@1"],
  "stateRef": "coherence-state://ally.rowan/current",
  "sentinelRef": "sentinel://realm.kinship/general@2",
  "authorityRef": "permission://source.david/manage-ally-rowan-coherence@4",
  "consentRef": "consent://source.david/ally-observation@2",
  "visibility": "source-and-authorized-realm",
  "version": "3"
}
```

The binding may inherit profiles and policies. It may not omit the system constitutional policy, its effective authority, or its visibility/Consent rule.

## The decisive comparison

For each dimension the system calculates three independent values:

- **Target distance:** `observed - targetPoint`. This explains direction and magnitude relative to the intended center.
- **Band drift:** signed distance from the nearest edge of the tolerance interval; zero while inside. Response zones use this value.
- **Boundary risk:** distance to or passage beyond an absolute boundary on the underlying scale. A legitimate high target does not neutralize a boundary.

Example: Directness target `+20`, tolerance `+5…+35`, observed `+47`.

- target distance: `+27`;
- band drift: `+12`;
- boundary status: clear if the high-side boundary begins at `+85`.

The system may recommend more listening because the reading is outside the configured range. It MUST NOT call `+47` inherently unhealthy, and it MUST NOT pull the entity toward zero.

## Entity contract

| Entity | What Coherence expresses | Maximum ordinary automatic response |
|---|---|---|
| Realm | Governed culture, operating norms, decision posture, relationship expectations, and boundaries | Aggregate pattern notice, facilitation, or policy-gated reversible moderation; never an averaged personality or automatic constitutional change |
| Ally | Intended reasoning and interaction tendencies | Prompt/context modulation and reversible behavioral correction inside Source/Realm authority |
| Actor | Execution posture, tool behavior, persistence, delegation, stopping, and escalation | Preflight constrain/deny, scope reduction, pause, or reversible quarantine under explicit policy |
| Avatar | Source-chosen representation and situational aspiration | Drafting, representation, questions, optional feedback, and coaching; never covert control of the Source |

## Runtime shape

One Sentinel service supports five scopes: system, Realm, entity, interaction, and relationship. Scope bindings are not automatically separate autonomous agents. The system scope enforces non-overridable boundaries; local scopes evaluate authorized profiles and policies.

The deterministic loop is:

`event → authorize observation → minimize evidence → measure → update state → resolve effective profile/policy → assess target drift and boundary risk → select least-forceful permitted response → execute or propose → record → obtain outcome → recalibrate`

See `SENTINELS.md`, `RUNTIME-ARCHITECTURE.md`, and `API-AND-EVENTS.md` for implementation detail.

