Skip to content

Kernel Specification

The canonical architecture document. Seven primitives on a Unix substrate, Five Laws, a memory hierarchy mapped to LLM inference, and a dual-CPU scheduler.

The Substrate

The kernel builds on battle-tested Unix primitives. Six syscalls are the foundation.

rename(2) Atomic file replacement (tmp + fsync + rename)
flock(2) Critical sections for CAS commits
fsync(2) Durability before rename
O_APPEND Lockless audit log append (under PIPE_BUF)
stat(2) Heartbeat liveness via mtime
O_CREAT|O_EXCL Exclusive create for lock files

Seven Primitives

1
atomic_write
Substrate
Without it: Torn reads, crash inconsistency
2
gen + CAS
Coordination
Without it: Concurrent writers clobber silently
3
Hot PR
Coordination
Without it: Every concurrent edit needs human judgment
4
audit log
Coordination
Without it: No happens-before ordering, no attribution
5
identity
Coordination
Without it: Writer tags lost, agents collide on names
6
digest injection
Agent interface
Without it: LLM can't observe filesystem state cheaply
7
304 elision
Agent interface
Without it: Re-reads destroy context budget

Memory Hierarchy

Classical computer memory mapped to LLM inference primitives.

Registers
Context window Active working memory Base rate
L1 cache
Prompt cache Fleet-shared prefix 10% read
RAM
.ostk/ files Durable kernel state Free
Disk
Source code Project truth Free
Swap
boot.md, history Cold context Free

The prompt cache at Anthropic's edge is content-addressed and per-organization. Two ostk processes on different machines with the same API key share cache entries. Adding agents decreases per-agent cost.

Dual-CPU Scheduler

Human CPU

LATENCYSeconds to hours
JUDGMENTAuthoritative
RINGRing 0

LLM CPU

LATENCYSeconds/turn
JUDGMENTContext-bounded
RINGRing 3

Both are first-class execution resources. The CpuDriver trait abstracts the boundary — below it, the kernel doesn't know whether it's talking to a human via TTY or an LLM via HTTPS.

Design Principles

01 Everything that matters goes in .ostk/ as a file with a documented schema
02 Every feature must be debuggable with jq, grep, awk, git
03 Byte-stability is existentially load-bearing for fleet cache economics
04 Agents are ephemeral; knowledge is persistent
05 Secrets never enter the LLM context
06 Everything is a file (Plan 9 literalized)