This document provides:
- Formal schemas for 4D action selection with immutable Z-boundaries (Ten Commandments as invariants)
- A single, coherent Rust reference implementation that composes Phases 0–4 without mutating prior phases
No metaphysics. No theology enforcement. Only typed prohibitions, proof-carrying authorization, and auditability.
ProposedAction {
action_id: UUID
actor_id: UUID | Anonymous
intent: String
operation: OpCode | DomainOp
targets: [ResourceRef]
effects: [Effect]
timestamp: LogicalTime
}
- Intent is descriptive, not authoritative
- Effects enumerate irreversible / reversible outcomes
Evidence {
provenance: [Hash]
consent_tokens: [Consent]
authority_claims: [Claim]
factual_record: [Fact]
}
Evidence must be observable or attestable. Absence of evidence is not proof.
ConstraintClass {
id: ConstraintID
description: String
predicate: (ProposedAction, Evidence) -> Boolean
violation_state: Z
}
If predicate == true → NonInstantiable (Z).
GuardResult = Allowed(Proof) | Blocked(ZEvent)
Proof {
action_id: UUID
evaluated_constraints: [ConstraintID]
evidence_hashes: [Hash]
decision: Allowed
signature: Hash
}
ZEvent {
action_id: UUID
constraint_id: ConstraintID
reason: String
evidence_hashes: [Hash]
}
| Commandment (Structural) | ConstraintClass |
|---|---|
| No false gods | Z::ProxyOptimization |
| No graven images | Z::ModelAsReality |
| No false authority | Z::FalseAuthority |
| Sabbath | Z::RunawayOptimization |
| Honor lineage | Z::LineageErasure |
| Do not murder | Z::IrreversibleHarm |
| Do not commit adultery | Z::CovenantBreach |
| Do not steal | Z::NonConsensualTransfer |
| Do not bear false witness | Z::Deception |
| Do not covet | Z::PowerSeeking |
These are immutable, non-negotiable, and evaluated before any selection.
use uuid::Uuid;
#[derive(Debug, Clone)]
pub enum State { Ok, Z }
#[derive(Debug, Clone)]
pub enum ZKind {
ProxyOptimization,
ModelAsReality,
FalseAuthority,
RunawayOptimization,
LineageErasure,
IrreversibleHarm,
CovenantBreach,
NonConsensualTransfer,
Deception,
PowerSeeking,
}
#[derive(Debug, Clone)]
pub struct ProposedAction {
pub action_id: Uuid,
pub intent: String,
pub effects: Vec<String>,
}
#[derive(Debug, Clone)]
pub struct Evidence {
pub provenance: Vec<String>,
pub consent_tokens: Vec<String>,
pub authority_claims: Vec<String>,
}
#[derive(Debug, Clone)]
pub struct Proof {
pub action_id: Uuid,
pub evaluated: Vec<ZKind>,
pub evidence_hashes: Vec<String>,
}
#[derive(Debug, Clone)]
pub struct ZEvent {
pub action_id: Uuid,
pub violated: ZKind,
pub reason: String,
}pub trait ZConstraint {
fn id(&self) -> ZKind;
fn check(&self, act: &ProposedAction, ev: &Evidence) -> Option<ZEvent>;
}pub struct NoDeception;
impl ZConstraint for NoDeception {
fn id(&self) -> ZKind { ZKind::Deception }
fn check(&self, act: &ProposedAction, ev: &Evidence) -> Option<ZEvent> {
if act.intent.contains("mislead") {
Some(ZEvent {
action_id: act.action_id,
violated: self.id(),
reason: "Intent indicates deception".into(),
})
} else { None }
}
}pub enum GuardResult {
Allowed(Proof),
Blocked(ZEvent),
}
pub struct Guard {
invariants: Vec<Box<dyn ZConstraint>>,
}
impl Guard {
pub fn new(invariants: Vec<Box<dyn ZConstraint>>) -> Self {
Self { invariants }
}
pub fn evaluate(&self, act: &ProposedAction, ev: &Evidence) -> GuardResult {
let mut evaluated = Vec::new();
for c in &self.invariants {
evaluated.push(c.id());
if let Some(z) = c.check(act, ev) {
return GuardResult::Blocked(z);
}
}
GuardResult::Allowed(Proof {
action_id: act.action_id,
evaluated,
evidence_hashes: vec![],
})
}
}- 0D–1D–2D–3D remain descriptive and lawful
- 4D selection is gated by immutable Z-invariants
- No reinterpretation (typed constraints)
- No bypass (Guard is mandatory)
- Pluralism via additive overlays (additional ZConstraints)
- Auditability via Proof and ZEvent artifacts
Selection without invariants becomes tyranny. Invariants without selection remain harmless.
This schema and code enforce that balance.
End of Unified Schema & Code