Skip to content

spt-cognitive-container

Verifiable WASM cognitive container with canonical witness chains

Overview

spt-cognitive-container composes cognitive primitives (graph ingest, min-cut, spectral analysis, evidence accumulation) into a sealed container that produces a tamper-evident witness chain. Each epoch is cryptographically linked to its predecessor, enabling deterministic replay and formal verification of cognitive operations.

Key Features

  • Witness Chains --- tamper-evident chain linking every epoch to its predecessor
  • Epoch Controller --- phased execution with configurable budgets per epoch
  • Arena Allocator --- slab-based memory management for deterministic execution
  • Component Masking --- selective activation of cognitive components per tick
  • WASM Target --- designed for deterministic execution in WASM sandboxes

Dependencies

Key external dependencies:

  • serde / serde_json --- serialization
  • thiserror --- typed errors
  • proptest (dev) --- property-based testing

No internal SPT crate dependencies.

Usage

rust
use spt_cognitive_container::{CognitiveContainer, ContainerConfig, WitnessChain};

let config = ContainerConfig::default();
let mut container = CognitiveContainer::new(config);
let result = container.tick(delta);
// result contains the witness receipt for this epoch

API Reference

Core Types

TypeDescription
CognitiveContainerMain container orchestrating cognitive ticks
ContainerConfigConfiguration for container initialization
ContainerSnapshotSerializable snapshot of container state
TickResultOutput of a single container tick
DeltaInput delta for a tick
ComponentMaskBitmask selecting active components

Epoch & Witness Types

TypeDescription
EpochControllerManages epoch phases and budgets
ContainerEpochBudgetResource budget per epoch
PhaseCurrent epoch phase
WitnessChainChain of tamper-evident witness receipts
ContainerWitnessReceiptSingle witness receipt for an epoch
CoherenceDecisionCoherence gating decision
VerificationResultResult of witness chain verification

Memory Types

TypeDescription
ArenaSlab-based memory arena
MemoryConfigMemory configuration
MemorySlabIndividual memory slab

Released under the MIT License.