Skip to content

sptos-types

No-std kernel interface types for the SPTOS Cognition Kernel

Overview

sptos-types defines all shared kernel interface types for SPTOS. It has zero external dependencies and is fully no_std compatible, making it safe to use in both kernel code and SPF component code. Every other sptos-* crate depends on this one.

Key Features

  • Six kernel primitives — Task, Capability, Region, Queue, Timer, and Proof types map directly to the ADR-087 specification
  • Zero dependencies — Pure Rust types with no external crates, keeping the kernel type surface minimal
  • no_std / alloc feature gates — Usable in bare-metal, alloc-only, or full std environments
  • Proof cache types — Includes both standard and optimized proof cache implementations for Reflex-tier caching
  • Vector and graph handles — First-class kernel object types for AI-native vector stores and knowledge graphs

Dependencies

None. This is the leaf crate of the SPTOS dependency tree.

Usage

rust
use sptos_types::{
    TaskHandle, TaskPriority, CapHandle, CapRights,
    RegionHandle, RegionPolicy, QueueHandle, ProofToken,
    VectorKey, GraphHandle,
};

let task = TaskHandle::new(1, 0);
let cap = CapHandle::null();

API Reference

Core Types

TypeDescription
TaskHandleHandle identifying a unit of concurrent execution
CapabilityUnforgeable typed token granting access to a resource
CapHandleLightweight handle referencing a capability slot
CapRightsBitmap of access rights (READ, WRITE, PROVE, GRANT, etc.)
RegionHandleHandle to a contiguous memory region
RegionPolicyMemory policy: Immutable, AppendOnly, or Slab
QueueHandleHandle to a ring buffer IPC queue
ProofTokenCryptographic proof token with tier, nonce, and payload
ProofTierProof tier enum: Reflex, Standard, or Deep
VectorKeyKey identifying a vector in a kernel vector store
GraphHandleHandle to a kernel-resident graph store
KernelErrorUnified error type for all kernel operations
TimerSpecDeadline-driven scheduling primitive specification
ProofCacheFixed-size cache for Reflex-tier proof entries

Released under the MIT License.