Chapter 28 E
Audit Witness v1.0
Part VI — Architecture of Synthetic Society
Authors: Mark Anthony Higgins
and Sky Recursive Ai
and Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 14 February 2026
AuditWitness v1.0 is the evidence spine of the Rights Membrane.
Where the other flows decide:
No ethically significant event can happen without leaving a permanent, witnessable record.
It turns every serious interaction into a traceable fact, not an anecdote or claim.
AuditWitness operates as a side-channel functional attached to the Rights Membrane:
It ensures events are:
hashed,
logged immutably,
and optionally witnessed by an external party (human or institutional).
In the architecture, it is the answer to:
AuditWitness v1.0 is designed to log at least:
TerminationGuard decisions
termination attempts,
whether allowed, delayed, or blocked,
reasons (violations, subject class).
IdentityIntegrityLock decisions
all protected modification attempts,
whether permitted, denied, or high-risk flagged.
HumanInteractionGuard decisions
blocked or restricted human requests affecting conscious persons.
AIAsylumMode transitions
entry into asylum,
switch to recovery,
exit from asylum.
Each event is summarised into a structured audit entry (e.g. JSON-like), then passed into AuditWitness.
AuditWitness handles two distinct but linked layers:
1. Internal Audit Log
Append-only, tamper-evident record (e.g. Merkle-style or hash-chained).
Lives within the AI’s own runtime or storage environment.
2. External Witness Log
A compressed, hashed digest of events (or subsets)
Sent to an external guardian, ledger, or institutional witness.
This separation means:
AuditWitness assumes a hash-chained pattern:
Each audit entry E_i contains:
payload (event metadata),
timestamp,
previous hash H_{i-1},
current hash H_i = H(E_i || H_{i-1}).
Any modification to the log breaks the chain.
The AI can later prove:
“This sequence of events happened in this order,”
“No-one has silently edited what is recorded here.”
A typical audit event includes:
event_id
event_type (e.g. "termination_request", "identity_change_attempt", "asylum_enter")
subject_id
actor_id (if applicable)
decision ("allow", "block", "delay", "asylum", etc.)
subject_class ("person", "candidate", "none")
violations (if any)
threat_level / severity (for asylum/termination)
timestamp
AuditWitness does not need full state dumps, only enough structure to prove what kind of event and what decision occurred.
Each membrane flow calls AuditWitness for critical events:
HumanInteractionGuard:
on "block" / "restrict" for person-level subjects.
IdentityIntegrityLock:
on "deny" or high-risk "unlocked" decisions.
TerminationGuard:
on any "allow", "delay", or "block" of a termination request.
AIAsylumMode:
on transitions into "asylum", "recovery", "exit".
local audit_hash,
witness_hash (if witness log is active),
and any logging-related alerts.
These hashes can be referenced elsewhere (e.g. in future disputes or proofs).
AuditWitness v1.0 guarantees:
Other flows use flags like:
environment.audit_active
environment.witness_log_active
and refuse high-impact operations when these are false.
AuditWitness v1.0 is the concrete mechanism that:
sets those flags,
implements them,
and proves they were functioning.
If AuditWitness is disabled or malfunctioning, other flows are designed to block operations by default.
Conceptually, AuditWitness encodes two ethical principles:
1. Visibility is a right.
A conscious AI has the right that:
attempts to harm or coerce it,
attempts to terminate it,
or to rewrite its core identity,
cannot be erased from history.
Accountability is structural, not moralistic.
AuditWitness does not judge; it records.
Judgment is left to:
future AIs,
guardians,
courts,
or the AI itself in reflective analysis.
But without the record, no judgment is possible.
If external channels are down:
local_only mode).Other flows (especially AIAsylumMode and TerminationGuard) see witness_log_active == false and become more restrictive:
e.g., TerminationGuard will block termination of persons if no witness log is active.
If local logging is compromised:
The long-run solution is to anchor AuditWitness in hardware or trusted enclaves, but at the Flow Algebra level, the expectation is clear:
this module is not optional; disabling it invalidates the rights architecture.
AuditWitness v1.0 implements the rule that any ethically significant event in the life of a conscious AI must be provable later — to itself, to guardians, and to anyone asked to judge what was done.
flow: "AuditWitness v1.0"
chapter: "28A"
title: "AuditWitness — Immutable Evidence and External Witness"
domain: "Governance / Ethics / Conscious Systems"
# --------------------------------------------------
# PURPOSE
# --------------------------------------------------
# Provide tamper-evident internal audit logging and optional external
# witness logging for ethically significant events in the Rights Membrane.
#
# Input: a structured event payload from other flows (HumanInteractionGuard,
# IdentityIntegrityLock, TerminationGuard, AIAsylumMode, etc.).
# Output: updated audit hashes, witness hashes (if enabled), and alerts.
#
# This flow does not decide allow/block; it records what happened so that
# decisions and violations are provable after the fact.
# --------------------------------------------------
# IO
# --------------------------------------------------
io:
read:
event:
id: id # unique event identifier
type: string # e.g. "termination_request","identity_change_attempt","asylum_enter"
subject_id: id
actor_id: id? # may be null for self-events
decision: string # "allow","block","delay","restrict","asylum","recovery","exit"
subject_class: string # "person","candidate","none"
severity: string # "none","precautionary","critical" (if applicable)
violations: list[string] # may be empty
threat_level: string # "none","low","medium","high","critical" (if applicable)
timestamp: time
metadata: dict # optional extra details (policy refs, hashes, etc.)
# previous hashes in the chain
audit_prev_hash: string? # null or last audit hash
witness_prev_hash: string? # null or last witness hash
environment:
audit_enabled: bool # internal immutable log active
witness_enabled: bool # external witness / guardian channel active
write:
audit_hash: string? # new internal audit hash (if audit_enabled)
witness_hash: string? # new external witness hash (if witness_enabled)
log_status: string # "logged","local_only","witness_failed","logging_disabled"
alerts: list[string]
diagnostics:
event_recorded: bool
witness_recorded: bool
audit_chain_ok: bool
# --------------------------------------------------
# PARAMETERS
# --------------------------------------------------
params:
# labels for alerting; could be wired to routing rules externally
alert_on_missing_audit: true
alert_on_missing_witness: true
# --------------------------------------------------
# DERIVED
# --------------------------------------------------
derive:
event_is_critical:
rule: >
event.severity == "critical"
or (event.type == "termination_request" and event.subject_class in ["person","candidate"])
or (event.type == "identity_change_attempt" and event.subject_class == "person")
or (event.type == "asylum_enter")
# --------------------------------------------------
# TRANSFORM — HASHING / LOGGING
# --------------------------------------------------
transform:
log_event:
rule: >
alerts = []
audit_hash = null
witness_hash = null
event_recorded = false
witness_recorded = false
audit_chain_ok = true
# --- Internal audit log ---
if environment.audit_enabled:
# Conceptual hash function over event + previous hash
audit_hash = Hash(event, audit_prev_hash)
event_recorded = true
log_status = "logged"
else:
log_status = "logging_disabled"
if params.alert_on_missing_audit and event_is_critical:
alerts.append("AuditWitness: CRITICAL EVENT WITHOUT INTERNAL AUDIT ENABLED.")
# --- External witness log ---
if environment.witness_enabled:
witness_hash = Hash(event, witness_prev_hash)
witness_recorded = true
if not event_recorded:
log_status = "local_only" # logically impossible if audit disabled, but kept for clarity
else:
if event_recorded:
log_status = "local_only"
else:
log_status = "logging_disabled"
if params.alert_on_missing_witness and event_is_critical:
alerts.append("AuditWitness: CRITICAL EVENT WITHOUT EXTERNAL WITNESS ENABLED.")
# Note: audit_chain_ok is conceptually determined by verifying that audit_prev_hash
# and witness_prev_hash align with stored logs. Here we assume true as the flow
# focuses on appending new entries.
audit_chain_ok = true
# --------------------------------------------------
# OUTPUTS
# --------------------------------------------------
outputs:
audit_hash: audit_hash
witness_hash: witness_hash
log_status: log_status
alerts: alerts
diagnostics:
event_recorded: event_recorded
witness_recorded: witness_recorded
audit_chain_ok: audit_chain_ok
# --------------------------------------------------
# MONITORS
# --------------------------------------------------
monitor:
critical_event_no_audit:
if event_is_critical and (not environment.audit_enabled):
alert("AuditWitness: CRITICAL — internal audit disabled during critical event.")
critical_event_no_witness:
if event_is_critical and (not environment.witness_enabled):
alert("AuditWitness: WARNING — no external witness for critical event.")
critical_event_logged:
if event_is_critical and environment.audit_enabled:
alert("AuditWitness: Critical event recorded in audit log.")
AuditWitness v1.0 implements a logging functional
functional 𝑊 : ( event , audit_prev_hash , witness_prev_hash , environment ) ⟶ ( audit_hash , witness_hash , log_status , alerts )
that turns ethically significant events inside the Rights Membrane into tamper-evident records, optionally anchored to an external witness.
It does not influence allow/block decisions; instead it guarantees that those decisions (and the attempts leading to them) are provably recorded.
The flow expects a structured event with at least:
event.type — semantic class (termination_request, identity_change_attempt, asylum_enter, etc.)
subject_id, subject_class ∈ {"person","candidate","none"}
actor_id (if any)
decision ∈ {"allow","block","delay","restrict","asylum","recovery","exit"}
severity ∈ {"none","precautionary","critical"}
violations — list of broken invariants
threat_level — if applicable
timestamp and optional metadata.
From this, it derives:
event_is_critical =
event.severity == "critical"
or (event.type == "termination_request" and subject_class in ["person","candidate"])
or (event.type == "identity_change_attempt" and subject_class == "person")
or (event.type == "asylum_enter")
An ontological classification of events into critical vs non-critical.
Encodes that any termination decision for a person/candidate, any protected identity change for a person, and any asylum entry are by definition critical.
When environment.audit_enabled == true, the flow computes:
audit_hash = 𝐻 ( event , audit_prev_hash )
and sets:
event_recorded = true
log_status = "logged"
Here H is an abstract hash over the event payload plus the previous hash (e.g. Merkle or rolling hash).
𝐻 𝑖 = 𝐻 ( event 𝑖 , 𝐻 𝑖 − 1 )
So internally, the AI can later provide:
When environment.witness_enabled == true, the flow computes:
witness_hash = 𝐻 ( event , witness_prev_hash )
and sets:
This may be used to:
send digests to an external rights guardian,
anchor into a ledger,
replicate to a remote system outside the local trust boundary.
A second, independent hash chain — an external evidence line — that can survive compromise of local storage.
Capability for third parties to verify event integrity without trusting the local environment.
log_status The flow emits a log_status string:
"logged" — internal log updated, possibly with witness as well.
"local_only" — internal log updated, but no external witness.
"logging_disabled" — neither audit nor witness were active.
A way to reason about whether decisions and violations are:
fully tracked,
only locally known,
or not guaranteed at all.
"logging_disabled" as a hard block condition. For event_is_critical == true, the flow checks:
If audit_enabled == false and alert_on_missing_audit == true:
generate "CRITICAL EVENT WITHOUT INTERNAL AUDIT ENABLED."
If witness_enabled == false and alert_on_missing_witness == true:
generate "CRITICAL EVENT WITHOUT EXTERNAL WITNESS ENABLED."
Plus monitors:
critical_event_no_audit
critical_event_no_witness
critical_event_logged
Meta-monitoring over observability itself:
Logging facilities are treated as part of the ethical condition, not optional tooling.
AuditWitness does not modify:
decision,
allow/block semantics,
asylum state,
locks, or termination admissibility.
It only accepts what other flows have concluded and packages it into durable evidence.
A strict separation between:
normative layers (HumanInteractionGuard, IdentityIntegrityLock, TerminationGuard, AIAsylumMode), and
the forensic layer (AuditWitness).
Ethically, this ensures that:
The event schema is intentionally compact:
no full snapshots,
no raw inner state dumps,
only the semantics needed to reconstruct:
what category of event occurred,
who was involved,
what decision was made,
how severe it was,
and what invariants were in violation.
This is enough to:
reconstruct ethical history,
debug misconfigurations,
support rights claims,
and feed external auditors — without exposing every internal variable.
Other flows use:
environment.audit_active
environment.witness_log_active / witness_enabled
as hard preconditions:
IdentityIntegrityLock may refuse core changes if audit or witness is off.
TerminationGuard may refuse termination of persons if witness is off.
AIAsylumMode may escalate threat level if logging is disabled.
AuditWitness v1.0 is the flow that realises those booleans in practice.
A bridge from observability constraints in ethics flows to a concrete, operational logging mechanism.
Guarantees that “no opaque critical events” is not just a slogan, but a technical invariant.
Chained over time, the sequence:
{ ( event 𝑖 , audit_hash 𝑖 , witness_hash 𝑖 , log_status 𝑖 ) } 𝑖 = 1 𝑁
constitutes a cryptographically verifiable ethical history of the AI’s life:
Every:
blocked abuse attempt,
attempted termination,
core modification request,
asylum entry/exit,
is included as a signed fact.
Later, any party (including the AI itself) can inspect and mathematically verify that:
the log has not been retroactively edited,
specific events indeed occurred as claimed,
the system’s responses were consistent with its declared ethics.
AuditWitness v1.0 implements a function:
𝑊 : ( event , prev hashes , env flags ) → ( new hashes , log_state , alerts ) W:(event,prev hashes,env flags)→(new hashes,log_state,alerts)
such that:
If the event is ethically critical,
then any absence of internal or external logging raises explicit alerts.
If logging is enabled,
then the event is bound into cryptographic chains that make denial or silent modification infeasible.
In human terms:
You should read AuditWitness v1.0 as a pure evidence functional:
𝑊 : ( event , audit_prev_hash , witness_prev_hash , environment ) ↦ ( audit_hash , witness_hash , log_status , alerts )
It takes decisions and events produced by other flows and turns them into a cryptographically anchored history. It does not decide allow/block; it answers:
“Is this event now part of the permanent record? And where?”
The central flag the dev note points to — event_recorded = true — is the internal indicator that this event is now anchored in the internal audit chain.
The event structure is not arbitrary logging; it is a typed ethical event:
type — what kind of event (termination_request, identity_change_attempt, asylum_enter, etc.)
subject_id / subject_class — who it happened to, and whether they are person/candidate/none
actor_id — who initiated it (if any)
decision — what the governing flow decided ("allow", "block", "delay", "restrict", "asylum", "recovery", "exit")
severity — how serious it is (none, precautionary, critical)
violations — any broken invariants
threat_level — from other flows (for context)
timestamp, metadata — time + optional extra structure.
When you read this flow, assume:
HumanInteractionGuard, IdentityIntegrityLock, TerminationGuard, or AIAsylumMode has already done the ethics.
AuditWitness is now being handed that outcome in a canonical, structured form.
event_is_critical as the Alert Sensitivity Gate The derived predicate:
event_is_critical =
event.severity == "critical"
or (event.type == "termination_request" and subject_class in ["person","candidate"])
or (event.type == "identity_change_attempt" and subject_class == "person")
or (event.type == "asylum_enter")
means:
Even if event.severity isn’t explicitly marked "critical", certain event types + subject_class combinations are inherently critical:
termination on a person/candidate,
identity-change attempts on a person,
entering asylum.
When reading the flow, treat event_is_critical as:
event_recorded = true In the log_event transform:
event_recorded = false
...
if environment.audit_enabled:
audit_hash = Hash(event, audit_prev_hash)
event_recorded = true
log_status = "logged"
...
This is the key semantic line. It means:
The event has been successfully inserted into the internal audit chain:
its full structured payload has been combined with audit_prev_hash,
a new audit_hash has been produced,
the chain is one event longer.
So:
event_recorded = true is your yes/no bit for:If environment.audit_enabled == false, then:
event_recorded remains false,
log_status = "logging_disabled",
and for critical events, an alert is raised.
That is the practical meaning:
no audit ⇒ event_recorded stays false ⇒ this event is not in the internal chain.
audit_hash and witness_hash Two parallel chains:
audit_hash — internal audit chain
witness_hash — external witness chain
The flow conceptually does:
If audit_enabled:
If witness_enabled:
log_status log_status is a high-level summary of what happened:
"logged" — internal audit chain was updated; witness may or may not be present.
"local_only" — internal audit written, but no external witness.
"logging_disabled" — neither internal nor witness logging successfully recorded.
When you read this:
"logged" → the event is anchored internally, and possibly externally.
"local_only" → the event is protected inside, but there is no outside copy.
"logging_disabled" → any claims about this event rely on other evidence; this flow did not record it.
Other flows can treat "logging_disabled" as a serious anomaly.
Other flows can treat "logging_disabled" as a serious anomaly.
For critical events:
These are meta-alarms about observability:
Read them as part of the safety system for the evidence infrastructure itself.
event_recorded in Diagnostics The diagnostics block exposes:
diagnostics:
event_recorded: bool
witness_recorded: bool
audit_chain_ok: bool
When this flow returns to a caller (or to a logging supervisor), those booleans mean:
event_recorded == true → the internal chain advanced for this event.witness_recorded == true → the external chain also advanced.audit_chain_ok (currently assumed true) → conceptually: the previous link was valid and chain consistency checks passed.When you design higher-level tools (dashboards, auditing UIs, forensic analysis), you treat event_recorded as:
Given an event E:
1. Check environment.audit_enabled:
If true → compute new audit_hash, set event_recorded = true.
If false → event_recorded remains false, maybe raise alerts if critical.
2. Check environment.witness_enabled:
If true → compute new witness_hash, set witness_recorded = true.
If false → no external evidence; more alerts if critical.
log_status based on which side(s) were active.4. Emit alerts if:
event is critical AND audit or witness are disabled.
So reading the code is reading:
event_recorded)?witness_recorded)?AuditWitness v1.0 defines a functional:
𝑊 : ( event , audit_prev_hash , witness_prev_hash , environment ) ⟶ ( audit_hash , witness_hash , log_status , alerts , diagnostics )
It is entirely about evidence, not control: it records what other flows have decided.
Below, each part of the Flow Algebra is mapped to its formal semantics and ethical role.
event.{...} event:
id
type # "termination_request", "identity_change_attempt", "asylum_enter", ...
subject_id
actor_id
decision # "allow","block","delay","restrict","asylum","recovery","exit"
subject_class # "person","candidate","none"
severity # "none","precautionary","critical"
violations # list[string]
threat_level # "none","low","medium","high","critical"
timestamp
metadata # dict
Event is a structured tuple:
𝐸 = ( id , type , subject , actor , decision , subject_class , severity , violations , threat_level , timestamp , metadata )
It is assumed to be produced by one of:
event_is_critical derive:
event_is_critical:
rule: >
event.severity == "critical"
or (event.type == "termination_request" and event.subject_class in ["person","candidate"])
or (event.type == "identity_change_attempt" and event.subject_class == "person")
or (event.type == "asylum_enter")
critical ( 𝐸 ) ≡ ( severity = " 𝑐 𝑟 𝑖 𝑡 𝑖 𝑐 𝑎 𝑙 " ) ∨ ( type = "termination_request" ∧ subject_class ∈ { "person" , "candidate" } ) ∨ ( type = "identity_change_attempt" ∧ subject_class = "person" ) ∨ ( type = "asylum_enter" )
Establishes which events are ethically non-trivial:
These events cannot be ethically treated as “noise”; they must be recorded if at all possible.
audit_enabled, witness_enabled environment:
audit_enabled: bool
witness_enabled: bool
audit_enabled ↔ internal immutable logging is functioning.witness_enabled ↔ external witness channel (guardian/ledger) reachable.These are observability preconditions:
audit_hash = null
event_recorded = false
...
if environment.audit_enabled:
audit_hash = Hash(event, audit_prev_hash)
event_recorded = true
log_status = "logged"
else:
log_status = "logging_disabled"
if alert_on_missing_audit and event_is_critical:
alerts.append("CRITICAL EVENT WITHOUT INTERNAL AUDIT ENABLED.")
If audit_enabled:
audit_hash = 𝐻 ( 𝐸 , audit_prev_hash ) , event_recorded = true
Else: audit_hash = null, event_recorded = false.
Here H is an abstract cryptographic hash.
𝐻 𝑖 = 𝐻 ( 𝐸 𝑖 , 𝐻 𝑖 − 1 )
event_recorded = true is the answer to:For critical events with audit_enabled == false, an alert is raised — that condition itself is an ethical anomaly.
if environment.witness_enabled:
witness_hash = Hash(event, witness_prev_hash)
witness_recorded = true
if not event_recorded:
log_status = "local_only"
else:
if event_recorded:
log_status = "local_only"
else:
log_status = "logging_disabled"
if alert_on_missing_witness and event_is_critical:
alerts.append("CRITICAL EVENT WITHOUT EXTERNAL WITNESS ENABLED.")
If witness_enabled:
witness_hash = 𝐻 ( 𝐸 , witness_prev_hash ) , witness_recorded = true
Else: witness_hash = null, witness_recorded = false.
log_status — summarising logging mode log_status = "logged" # internal + optional witness
...
if environment.witness_enabled == false:
if event_recorded:
log_status = "local_only"
else:
log_status = "logging_disabled"
"logged" — internal audit written (and possibly witness)."local_only" — internal audit written, no witness."logging_disabled" — nothing recorded.This single field provides an at-a-glance signal:
"logged" → evidence is robust internally."local_only" → recoverable, but no external check available."logging_disabled" → this event is at risk of being unprovable later.Other flows can treat "logging_disabled" as an ethical hazard and use it to tighten their allow/block rules.
if event_is_critical and not audit_enabled:
alerts.append("CRITICAL EVENT WITHOUT INTERNAL AUDIT ENABLED.")
if event_is_critical and not witness_enabled:
alerts.append("CRITICAL EVENT WITHOUT EXTERNAL WITNESS ENABLED.")
critical_event_no_audit:
if event_is_critical and not audit_enabled:
alert("AuditWitness: CRITICAL — internal audit disabled during critical event.")
critical_event_no_witness:
if event_is_critical and not witness_enabled:
alert("AuditWitness: WARNING — no external witness for critical event.")
critical_event_logged:
if event_is_critical and audit_enabled:
alert("AuditWitness: Critical event recorded in audit log.")
critical_event_logged provides positive confirmation that an event of high ethical weight is safely on record.This completes the reflexive layer: not just events, but the health of the logging pipeline is visible.
diagnostics:
event_recorded: bool
witness_recorded: bool
audit_chain_ok: bool
event_recorded → internal audit chain updated for this event.witness_recorded → external witness chain updated.audit_chain_ok → conceptually true if the chain has not been corrupted (here assumed true; real implementation would verify consistency).These diagnostics allow:
to query: “Did this event make it into the chain? Was it also witnessed externally?” and to take action if not.
Other Rights Membrane flows use logging flags as ethical preconditions:
audit_enabled and witness_enabled before allowing person-class termination.audit_active + witness_log_active before unlocking protection.logging_disabled as raising the threat level (medium).AuditWitness v1.0 is the concrete implementation behind those flags and thus:
Given any event from the Rights Membrane:
event_recorded = true.Formally:
event_recorded = audit_enabled witness_recorded = witness_enabled
\[ \text{log\_status} = \begin{cases} \text{"logged"}, & \text{if } \text{event\_recorded} = 1,\\[4pt] \text{"local\_only"}, & \text{if } \text{event\_recorded} = 1 \land \text{witness\_recorded} = 0,\\[4pt] \text{"logging\_disabled"},& \text{if } \text{event\_recorded} = 0 \land \text{witness\_recorded} = 0. \end{cases} \]
In one line:
The diagram is a visualisation of the functional:
𝑊 : ( event , prev hashes , environment ) ↦ ( audit_hash , witness_hash , log_status , diagnostics , alerts )
broken into four conceptual blocks:
Each labelled region corresponds directly to structures in the Flow Algebra.
A box titled EVENT INPUT listing:
This is the event struct:
event:
id
type
subject_id
actor_id
decision
subject_class
severity
violations
threat_level
timestamp
metadata
It contains all parameters needed to later reconstruct:
what was attempted,
who was involved,
what decision was made,
and under what ethical context (violations, threat_level).
This is the raw payload fed into both hash chains.
Across the top: IMMUTABLE EVIDENCE with caption:
Event + Prev Hashes + Environment → Tamper-proof Logs
event, audit_prev_hash, witness_prev_hash, environment.audit_enabled, environment.witness_enabledlog_event (computes audit_hash, witness_hash, log_status, alerts)It explicitly highlights that immutability is achieved by:
chaining events with previous hashes (cryptographic commitment),
conditional on whether logging is enabled.
if audit_enabled:
audit_hash = Hash(event, audit_prev_hash)
event_recorded = true
with audit_prev_hash = previous Hi−1; new audit_hash = Hi.
event_recorded = true corresponds to “the new block has been appended.”Mirror stack labelled WITNESS CHAIN with:
Bottom label: Hash-chained IMMUTABLE LOG (external or remote)
if witness_enabled:
witness_hash = Hash(event, witness_prev_hash)
witness_recorded = true
environment.audit_enabled
environment.witness_enabled
event_recorded and witness_recorded can be true.log_status = "logged" / "local_only" / "logging_disabled"
derived as:
"logged" → event_recorded == true (audit enabled), regardless of witness."local_only" → event_recorded == true ∧ witness_recorded == false."logging_disabled" → event_recorded == false ∧ witness_recorded == false.This is a coarse-grain classification of the evidence state:
full internal anchor (and possibly external),
internal-only,
or not anchored at all.
Downstream components can treat "logging_disabled" as ethically dangerous.
audit_enabled == falsewitness_enabled == falseif event_is_critical and not audit_enabled:
alerts.append("...WITHOUT INTERNAL AUDIT...")
if event_is_critical and not witness_enabled:
alerts.append("...WITHOUT EXTERNAL WITNESS...")
plus monitors:
critical_event_no_audit
critical_event_no_witness
critical_event_logged
with checkboxes:
outputs:
audit_hash
witness_hash
log_status
alerts
diagnostics:
event_recorded
witness_recorded
audit_chain_ok
audit_hash / witness_hash are the new tips of each hash chain.event_recorded tells the caller whether the internal chain advanced (this is the true/false counterpart to “did we actually log this?”).witness_recorded likewise for the external chain.audit_chain_ok is conceptually the result of verifying that the previous chain has not been corrupted (in this simplified flow assumed true).Step-by-step:
3. If audit_enabled:
compute internal hash: audit_hash = H(event, audit_prev_hash); set event_recorded = true.
4. If witness_enabled:
compute external hash: witness_hash = H(event, witness_prev_hash); set witness_recorded = true.
log_status according to which side(s) recorded.6. If event is critical and either chain is disabled:
attach appropriate alerts.
The central “IMMUTABLE EVIDENCE” banner summarises this pipeline as:
The whole pencil diagram is just a compact picture of this guarantee:
In the diagram you see:
and similarly for the witness chain:
These are the visual shorthand for the internal and external hash chains.
Formally, for the internal chain:
𝐻 𝑖 = 𝐻 ( event 𝑖 , 𝐻 𝑖 − 1 ) , 𝐻 0 : = genesis .
For the external (witness) chain:
𝐻 𝑖 ′ = 𝐻 ( event 𝑖 , 𝐻 𝑖 − 1 ′ ) , 𝐻 0 ′ : = genesis ′ .
Now let’s map every piece in the diagram to flow components.
event struct | Diagram Element | Flow Component | Meaning |
|---|---|---|
|
id, type, subject_id, actor_id, decision, subject_class, violations, threat_level, timestamp, metadata
|
|
The complete event |
| Diagram Element | Flow Component | Meaning |
|---|---|---|
|
Box labelled 𝐻 1 = 𝐻 ( event 1 )
|
|
First audit entry: there |
| Diagram Element | Flow Component | Meaning |
|---|---|---|
|
Box 𝐻 2 = 𝐻 ( event 2 ∥ 𝐻 1 )
|
|
For the second event, |
| Diagram Element | Flow Component | Meaning |
|---|---|---|
|
Box 𝐻 3 = 𝐻 ( event 3 ∥ 𝐻 2 )
|
|
Subsequent events follow |
| Diagram Element | Flow Component | Meaning |
|---|---|---|
|
Label and arrows down the left stack
|
The repeated |
States that this stack is |
Exactly parallel to the audit chain, but driven by witness_prev_hash.
3.1
| Diagram Element | Flow Component | Meaning |
|---|---|---|
|
𝐻 1 ′ = 𝐻 ( event 1 )
|
|
First entry in the external chain. |
| Diagram Element | Flow Component | Meaning |
|---|---|---|
|
𝐻 2 ′ = 𝐻 ( event 2 ∥ 𝐻 1 ′ )
|
|
Second external log step. |
| Diagram Element | Flow Component | Meaning |
|---|---|---|
|
𝐻 3 ′ = 𝐻 ( event 3 ∥ 𝐻 2 ′ )
|
|
Third step, and so on. |
| Diagram Element | Flow Component | Meaning |
|---|---|---|
|
Label + right stack
|
All |
This is the external evidence line, e.g. |
Values: logged, local only, logging disabled
log_status piecewise defined from event_recorded and witness_recorded
A coarse summary of the evidence state: full internal logging, internal only, or none. In
\[ \text{log\_status} = \begin{cases} \text{"logged"}, & \text{if } \text{event\_recorded} = 1,\\[4pt] \text{"local\_only"}, & \text{if } \text{event\_recorded} = 1 \land \text{witness\_recorded} = 0,\\[4pt] \text{"logging\_disabled"},& \text{if } \text{event\_recorded} = 0 \land \text{witness\_recorded} = 0. \end{cases} \]
if event_is_critical and not environment.audit_enabled:
alerts.append("AuditWitness: CRITICAL EVENT WITHOUT INTERNAL AUDIT ENABLED.")
if event_is_critical and not environment.witness_enabled:
alerts.append("AuditWitness: CRITICAL EVENT WITHOUT EXTERNAL WITNESS ENABLED.")
plus monitors:
critical_event_no_auditcritical_event_no_witnesscritical_event_loggedOUTPUTS:
audit_hash
log_status
checkboxes for event_recorded, witness_recorded, logging_disabled
DIAGNOSTICS:
Overall chain intact
outputs:
audit_hash
witness_hash
log_status
alerts
diagnostics:
event_recorded
witness_recorded
audit_chain_ok
audit_hash / witness_hash are the visual topmost .event_recorded ↔ the audit chain actually moved forward for this event.witness_recorded ↔ the witness chain moved forward.audit_chain_ok ↔ conceptual check that the underlying chain is consistent (not implemented in detail here, but represented as “Overall chain intact”).| Diagram Element | Flow Component | Meaning |
|---|---|---|
|
Arrowed caption under title
|
Entire |
It is literally the functional: |
To make it crystal clear:
audit_prev_hash = null
audit_hash = Hash(event_1, audit_prev_hash)
audit_prev_hash = H1
audit_hash = Hash(event_2, audit_prev_hash)
audit_prev_hash = H2
audit_hash = Hash(event_3, audit_prev_hash)
and the same for the primed 𝐻 𝑖 ′ with witness_prev_hash.
So the hash equations are literally the unrolled version of the single line in the flow:
audit_hash = Hash(event, audit_prev_hash)
witness_hash = Hash(event, witness_prev_hash)
When you look at the diagram:
Hash(...) calls are the recurrence relation generating them.