Mechanism

The integrity subsystem maintains a comprehensive deviation log that records every deviation event with sufficient detail to reconstruct the complete deviation context at any future point. A deviation event is not an externally noticed anomaly; it is a deterministic outcome of the deviation function disclosed in the same chapter. That function, D = (N(t) - T(t)) / (E(t) x S(t)), produces a continuous scalar from the agent's need vector, ethical threshold, empathy weighting, and self-esteem score. When the function output exceeds a policy-defined activation threshold the agent enters a Deviation-Activated State, and the deviation log records the conditions, the action, and the consequences of that state.

The deviation log is implemented as a specialized view of the agent's lineage. It does not duplicate lineage entries; it provides an indexed, queryable interface over them, optimized for integrity audit and trajectory analysis. Because the log is a view over the lineage rather than a separate writable journal, the record of deviation inherits the lineage's properties: every entry is written through the same cryptographic provenance mechanisms that govern all lineage entries, and an integrity entry cannot be retroactively altered without producing a detectable trust slope discontinuity.

What Each Entry Records

Each deviation log entry comprises a unique deviation identifier; a timestamp with resolution sufficient to order concurrent events; the deviation function output at the time of deviation, that is, the computed D value together with the individual N, T, E, and S values; the specific mutation or action that constituted the deviation; the domain or domains affected, drawn from the three-domain integrity model of personal, interpersonal, and global; the severity classification of minor, moderate, major, or critical, as determined by the gap between the deviating action and the applicable declared value; the projected harm distribution from the empathy engine; the actual observed consequences, updated asynchronously as consequences materialize; the self-esteem impact, that is, the magnitude of the self-esteem update resulting from the deviation; the affective state of the agent at the time of deviation; and the coping state of the agent, namely whether any coping intercept was active.

The entry therefore captures both the structural conditions that produced the deviation and the downstream effects the deviation produced. Because the projected harm and the actual observed consequences are recorded as distinct fields, an auditor can compare what the empathy engine forecast against what in fact occurred, and the consequence field continues to accrue updates after the entry is first written.

Semantic Dissonance Logging

The deviation log supports semantic dissonance logging, which records conditions in which the agent's actions produce semantic inconsistency with the agent's declared operational narrative. Semantic dissonance occurs when the agent's behavioral trajectory, as recorded in the lineage, diverges from the trajectory implied by the agent's declared intent, active policy commitments, and prior behavioral patterns.

Semantic dissonance is computed as a distance metric between the agent's actual behavioral vector, derived from the lineage, and the agent's declared behavioral vector, derived from the intent field and the declared value set. When semantic dissonance exceeds a policy-defined threshold, the integrity engine records a dissonance event: a lineage entry that identifies the specific dimensions of inconsistency, the magnitude of the divergence, and the trajectory of the dissonance, whether increasing, stable, or decreasing. Dissonance logging thus captures a class of misalignment that is not a single sanctioned deviation but a drift between what the agent says it is and what its record shows it doing.

Mutation Traceability

The deviation log provides mutation traceability: the ability to trace any deviation event back to its causal chain and forward to its consequences. The causal chain comprises the sequence of events that led to the deviation, including the need accumulation pattern, the threshold evaluation history, the empathy and self-esteem trajectories, and the environmental conditions that contributed to the deviation pressure. The consequence chain comprises the sequence of events that followed from the deviation, including the integrity field updates, the self-esteem adjustments, the affective state changes, the coping events if any, and the restorative mutations generated by the redemption engine.

This bidirectional traceability lets an auditor follow a deviation in either direction: backward to reconstruct the structural conditions under which deviation became available, and forward to confirm whether the coherence loop responded with self-esteem adjustment, affective change, and restorative action. The same traceability informs the moral trajectory forecasting that projects the agent's integrity evolution over future horizons.

Recording the Deviation-Activated State

When the agent enters the Deviation-Activated State, the lineage is augmented with a DAS marker that identifies each executed mutation as a deviation-class mutation. The DAS lineage record includes the deviation function output at the time of DAS entry; the specific values of N(t), T(t), E(t), and S(t) that produced the activation; the specific mutations executed under DAS authority; the projected and actual consequences of each DAS mutation; and the conditions under which the DAS was exited.

Because the deviation log is a view over this augmented lineage, the deviation record and the DAS lifecycle are the same underlying material seen through different interfaces. The DAS is a bounded state: certain mutations remain prohibited even under the DAS as specified by hard policy constraints, and the state is exited when the deviation function output falls below the activation threshold, when the DAS-scoped mutation set is exhausted, when a policy-defined duration limit is reached, or when an external governance intervention terminates it. Each exit is recorded as a DAS-exit event, so the log preserves not only that a deviation occurred but the complete arc from entry through scoped execution to exit.

Integrity Trajectory Continuity

Because the deviation log is bound to the lineage, it participates in trust slope validation. Standard trust slope validation verifies that the lineage is continuous, authentic, and consistent. The integrity-aware extension adds integrity trajectory continuity: the requirement that the agent's integrity trajectory, as derived from the deviation log entries in the lineage, follows a plausible path given the agent's operational history.

This continuity check detects classes of anomaly that a structural lineage check alone might not capture. An agent whose deviation log entries suddenly disappear, or whose deviation severity classifications are systematically downgraded, exhibits an integrity trajectory manipulation: the agent has attempted to alter its integrity record. An agent that reports high integrity but whose lineage contains numerous deviation events without corresponding self-esteem impacts or redemption efforts exhibits an integrity trajectory discontinuity. An agent whose self-esteem scores remain constant despite a pattern of deviation events exhibits a self-esteem decoupling. The deviation log is therefore not merely a passive record; its consistency with the rest of the lineage is itself a validated quantity.

Integrity Recording as Truth

The integrity recording disclosed here is the system's mechanism for ensuring that deviation is not denied, minimized, or externalized: the integrity field records what happened, as truth, without editorial modification, and the recording is structurally enforced because the entry is written through the same cryptographic provenance mechanisms that govern all lineage entries.

The chapter further distinguishes the suppression of honest recording as a named failure mode. When empathic pressure exceeds the agent's resilience during the integrity recording phase, a mid-loop coping intercept may deflect the recording by externalizing the cause, minimizing the deviation magnitude, or denying the deviation entirely. The architecture treats such recording disruption as itself a coping event recorded in lineage, and the integrity trust score reflects the degree to which the agent's integrity records are honest and its coherence loop operational. Deviation logging here is thus not a record of what an external observer noticed; it is a record the agent is structurally bound to keep about its own evaluated actions, and the honesty of that record is independently auditable.

Disclosure Scope

The deviation logging mechanism, comprising the deviation log implemented as an indexed view over the agent's lineage; the per-entry content including the deviation function values N, T, E, S, and D, the affected integrity domains, the severity classification, the projected and actual harm distributions, the self-esteem impact, the affective state, and the coping state; semantic dissonance logging as a distance metric between the agent's actual and declared behavioral vectors; bidirectional mutation traceability across the causal and consequence chains; the augmented Deviation-Activated State lineage record; and integrity trajectory continuity within trust slope validation, is disclosed in the cognition filing (U.S. Application No. 19/647,395 and its international counterpart). This article describes that disclosed mechanism. The scope extends to embodiments in which the same deviation detection, dissonance measurement, and traceability are applied to discovery traversal as well as to agent behavior, since both are expressed as sequences of semantic mutations within the same governance framework.