RESEARCH · Evulgare · NOT OFFICIAL EVIULON DOCTRINE

Python Autonomous Defense Kernel: Deterministic Authority, Runtime Assurance, Evidence-Locked Execution, and Attested Recovery for Evulgare

Research section 2 of 6

A fundamental tenet of the Evulgare defense kernel is that the loss of network connection does not create operational authority [DOCUMENTED FIRST-PARTY CLAIM]. When communications degrade or fail entirely, the node transitions through explicit states: from CONNECTED to DEGRADED, and subsequently to PARTITIONED.
If the node possesses pre-computed, cryptographically signed authority bounds that cover partitioned operations, it may enter a LOCALLY_AUTHORIZED state. However, the system strictly enforces the principle that successful local execution does not prove legitimate execution [OBSERVED PUBLIC FACT]. If the time bounds of the local authority expire, the node enters DEFENSIVE_ISOLATION. When connectivity is eventually restored, the system transitions to RECONCILIATION_REQUIRED rather than immediately resuming nominal operations, as the restored connection does not automatically restore authority without quorum review [ENGINEERING INFERENCE].

2.9 Recovery and Reconstitution

Recovery mechanisms must not overwrite or delete historical evidence of a compromise. Instead, recovery must append a new reconstitution state to the event log [PROPOSED REQUIREMENT]. This process relies on a trusted recovery root utilizing the Device Identifier Composition Engine (DICE) standard7.
The DICE architecture derives a Compound Device Identifier (CDI) based on the foundational hardware and firmware configuration, creating an unforgeable cryptographic attestation of the baseline state8. To reconstitute, the kernel verifies the accepted baseline digest, confirms the validity of the key epoch, and explicitly excludes any revoked credentials. Unresolved defeaters and the exact state of the compromised predecessor are preserved in the immutable append-log for subsequent forensic analysis [ENGINEERING INFERENCE].

2.10 Python Implementation Details

The implementation strictly relies on native Python 3.13.14 features to ensure extreme stability without external C-bindings where possible. Standard library dataclasses with frozen=True are selected over third-party libraries like Pydantic for the core domain to eliminate parsing overhead and guarantee immutability without dependency drift [PROPOSED REQUIREMENT]. SQLAlchemy is utilized strictly via event listeners, persisting domain events into MySQL but never executing business logic [IMPLEMENTATION OPTION].
Serialization relies on strict canonical JSON. To guarantee reproducibility, dictionaries are serialized with sort_keys=True and zero whitespace separators (separators=(',', ':')), ensuring that identical state records yield identical SHA-256 digests across any architecture [ENGINEERING INFERENCE]. Flask blueprints define isolated API schemas protected by strict Content-Type enforcement and CSRF protections. Error envelopes are structurally opaque to external users, returning standardized error_id references without leaking stack traces or internal topological data.

2.11 Testing

Testing this kernel extends far beyond standard unit tests. Deterministic replay tests form the core validation loop: executing the sequence of recorded events from tick zero must mathematically guarantee the recreation of the exact terminal state [PROPOSED REQUIREMENT]. Metamorphic testing evaluates the Datalog engine by presenting logically equivalent but syntactically distinct policy bundles to ensure the reference monitor reaches identical denial or allowance conclusions. Hash-chain tests validate that evidence supersession logic properly invalidates prior keys. Fault injection and mutation testing (e.g., modifying frozen fields via memory manipulation, or passing floats to integer-only bounds) ensure the Simplex DM correctly defaults to a DENY_COMMAND null-sink upon detecting typed protocol violations [ENGINEERING INFERENCE].

3. Required Deliverables Matrix

The following deliverables fulfill the exhaustive specifications requested for the Evulgare reference architecture.

3.1 Complete Python Package Architecture (Deliverable 3)

Directory Path Description Access Boundary
/evulgare_kernel/domain/ Pure Python 3.13.14; defines frozen state, authorities, and event reducers. No HTTP, No SQL, No System Clock
/evulgare_kernel/policy/ Datalog engine implementation (e.g., pyDatalog wrappers)10. Domain read-only access
/evulgare_kernel/infrastructure/ SQLAlchemy models, DICE attestation bindings8, and external integrations. Mutable state boundary
/evulgare_kernel/api/ Flask 3 Blueprints, WSGI entry point, cPanel Passenger mounting logic. External network interface
/evulgare_kernel/tests/ Metamorphic, deterministic replay, and mutation testing suites. CI/CD pipeline

3.2 Module Dependency Graph (Deliverable 4)

Diagram 1: Architectural Dependency Graph

Code snippet
graph TD
API[api/ Flask Blueprints] --> INFRA[infrastructure/ SQLAlchemy]
API --> DOMAIN[domain/ Core Logic]
INFRA --> DOMAIN
DOMAIN --> POLICY[policy/ Datalog Rules]
POLICY --> DOMAIN
DOMAIN --> RA[runtime_assurance/ Simplex DM]
RA --> EV[evidence/ Hash Chains]
RA --> AUTH[authority/ Conjunctive Limits]
AUTH --> COMP[compartments/ Isolation]

3.3 Domain-Class Catalog (Deliverable 5)

Class Name Module Immutability Functional Description
AuthorityToken authority.py Frozen Represents bounded, conjunctive permissions and deterministic time boundaries.
EvidenceEnvelope evidence.py Frozen Wraps cryptographically chained synthetic telemetry and source reliability parameters.
SimplexDM runtime_assurance.py Mutable Decision Module managing transitions between Advanced and Baseline controllers14.
UncertaintyVector uncertainty.py Frozen Distinct tensors for aleatoric noise and epistemic model shifts.
RecoveryBaseline recovery.py Frozen Represents the DICE-attested known-good hardware/software state8.

3.4 Function and Protocol Catalog (Deliverable 6)

Protocol / Function Signature Purpose Determinism Guarantee
TransitionRule: (State, Event) -> State Event-sourcing reducer function. Pure function; no side effects.
verify_attestation(envelope, key) -> bool Validates DICE baseline signatures7. Cryptographic verification only.
evaluate_policy(token, action) -> bool Datalog constraint solver query10. Terminates definitively; no infinite recursion.
enforce_simplex(ac_cmd, lbc_cmd) -> cmd Barrier-certified multiplexer5. Defaults to LBC on execution timeout.
canonical_hash(dataclass) -> str SHA-256 digest of canonicalized JSON. Sorted keys, zero whitespace formatting.

3.5 Schema Definitions (Deliverables 7-13)

Authority-Artifact Schema (Deliverable 7)

Field Data Type Constraint Description
artifact_id String Monotonic UUIDv7 Unique identifier for the signed authority.
issuer_uai String SHA-256 Digest Institutional owner of the permission.
purpose_digest String SHA-256 Digest Explicitly bounds action legality to a declared objective.
subdelegation_limit Integer ![][image1] Maximum depth of derivative authority; attenuates at each step.
time_bounds Tuple[int, int] Monotonic Ticks Deterministic start and expiration ticks.

Policy-Bundle Schema (Deliverable 8)

Element Specification Mechanism
bundle_id String Version tracking for policy rollbacks.
datalog_rules Text Block Executable logic constraints (e.g., permitted(X) <= role(X, R)15).
signature Ed25519 Cryptographic proof of institutional provenance.

Evidence-Record Schema (Deliverable 9)

Field Data Type Description
custody_chain List[str] Cryptographic identifiers of all systems handling the data.
source_reliability Scaled Integer Heuristic metric of physical hardware quality (e.g., 0-1000).
supersession_pointer String Reference to updated evidence invalidating this specific record.

Event-Record Schema (Deliverable 10)

Field Data Type Description
seq_id Integer Strictly increasing integer dictating temporal order.
event_type String Canonical domain action mapping (e.g., AUTHORITY_REVOKED).
prior_digest String SHA-256 hash of seq_id - 1 establishing the append-only chain.

Proof-Condition Schema (Deliverable 11)

Condition ID Evaluated Logic Evidence Required
INV_01_PASS Technical feasibility ![][image2] governance completion11. Proof of institutional and legal review gates.
INV_02_PASS Lifecycle gates are strictly conjunctive11. All parameter states evaluated simultaneously.
INV_03_PASS Contested interpretations remain visible11. Absence of overriding un-reviewed authority.

Compartment Schema (Deliverable 12)

Field Data Type Enforcement Rule
workload_id String Binds compartment access to specific runtime processes.
retention_ticks Integer Triggers mandatory cryptographic shredding of data upon expiry.
correlation_group String Defines tags for isolated compromise propagation tracking.

Recovery-Baseline Schema (Deliverable 13)

Property Validation Mechanism Description
firmware_digest DICE CDI Attestation Validates hardware root of trust8.
software_sbom SHA-256 Manifest Lock Verifies exact Python 3.13.14 package dependencies.
key_epoch Monotonic Integer Permanently rejects revoked legacy credentials.

3.6 State Machines (Deliverables 14-17)

Diagram 2: Deterministic Runtime State Machine (Deliverable 14)

Code snippet
stateDiagram-v2
[*] --> NOMINAL_REQUEST
NOMINAL_REQUEST --> DM_EVALUATION
DM_EVALUATION --> APPLIED_DEFENSIVE_ACTION : Authority or Safety Violation
DM_EVALUATION --> AC_EXECUTION : Bounds Validated
APPLIED_DEFENSIVE_ACTION --> LBC_EXECUTION : Transfer to Baseline
LBC_EXECUTION --> RESTORE_ATTESTED_BASELINE : Unrecoverable
LBC_EXECUTION --> CONTINUE_OBSERVATION : Synchronized

Diagram 3: Authority State Machine (Deliverable 15)

Code snippet
stateDiagram-v2
[*] --> PROPOSED
PROPOSED --> ISSUED : Institutional Signing
ISSUED --> CURRENT : Tick Boundaries Reached
CURRENT --> SUSPENDED : Uncertainty Violation
CURRENT --> RECONCILIATION_REQUIRED : Evidence Conflict
CURRENT --> EXPIRING : Grace Period Entry
CURRENT --> REVOKED : Explicit Override
EXPIRING --> EXPIRED
SUSPENDED --> CURRENT : Re-attestation
RECONCILIATION_REQUIRED --> CURRENT : Quorum Review
REVOKED --> HISTORICAL
EXPIRED --> HISTORICAL

Diagram 4: Lost-Link State Machine (Deliverable 16)

Code snippet
stateDiagram-v2
CONNECTED --> DEGRADED : Latency > Threshold
DEGRADED --> PARTITIONED : Heartbeat Timeout
PARTITIONED --> LOCALLY_AUTHORIZED : Pre-computed Bounds Exist
LOCALLY_AUTHORIZED --> AUTHORITY_EXPIRING : Time Bound Approaching
AUTHORITY_EXPIRING --> DEFENSIVE_ISOLATION : Time Expired
PARTITIONED --> INTEGRITY_HOLD : Conflicting Sensor Data
DEFENSIVE_ISOLATION --> RECONCILIATION_REQUIRED : Connection Restored
INTEGRITY_HOLD --> RECONCILIATION_REQUIRED : Connection Restored
RECONCILIATION_REQUIRED --> CONNECTED : Authority Re-issued

Diagram 5: Recovery State Machine (Deliverable 17)

Code snippet
stateDiagram-v2
[*] --> PRESERVE_COMPROMISED_PREDECESSOR
PRESERVE_COMPROMISED_PREDECESSOR --> LOAD_BASELINE_DIGEST
LOAD_BASELINE_DIGEST --> VERIFY_DICE_ATTESTATION
VERIFY_DICE_ATTESTATION --> RECONCILE_EVIDENCE
RECONCILE_EVIDENCE --> REISSUE_AUTHORITY
REISSUE_AUTHORITY --> NOMINAL_OPERATIONS

3.7 Core Logic and Threat Constraints (Deliverables 18-20)

Source: Evulgare/Python Autonomous Defense Architecture.md · SHA-256: c6743e5dc63b1639d2c30c24104ea4e479b974526a3e8284a4ebe461ecc2b544