Core Rule: Technology must support human judgment rather than replace it.
StateOS is a privacy-first, calm human capability platform designed to strengthen human agency, attention, and autonomic self-regulation through real-time protocol execution.
Unlike traditional platforms designed to maximize engagement and screen time, StateOS operates under a "Calm Before Stimulation" visual and interaction model. It intercepts physiological stress cascades within the Recovery Window (0.5 to 4 seconds) to prevent external stressors from forcing the user into a reactive survival identity.
StateOS code and data models derive directly from the Engineering Documentation Program (EDP):
- SOS-001: StateOS Constitution & Foundational Charter
- SOS-201: UX & Design System Engineering Manual
- SOS-301: AI & Intelligence Architecture Manual
- SOS-401: Software Engineering & State Engine Manual
- StateOS Domain Model (SDM) &
stateos-pydantic-schemas.py
| Layer | Technology |
|---|---|
| Client Application | React Native (Expo) + TypeScript (Strict Mode) |
| State & Navigation | Zustand + React Navigation (8-Module Tab Shell + Stack) |
| Design System | SOS-201 W3C DTCG Tokens (Deep Obsidian #0A0A0B, Sovereign Gold #E2C48D, Coherence Cyan #88C3FF) |
| Local Database | SQLite via Drizzle ORM (expo-sqlite) |
| Schema Validation | Zod (client-side enforcement of ADR-MM-0009, 0010, 0011) |
| Haptic Feedback | expo-haptics |
The platform enforces the 3-Interaction Navigation Invariant (IA-SPEC-001): the user can reach and initiate any primary somatic protocol within at most 2 taps from the Home launchpad.
The 8 primary navigation modules are:
Home(/home) — Launchpad, daily state overview, AI recommendations, fast-access CTAs.State(/state) — Real-time 250Hz autonomic telemetry (HRV, respiratory rate) & 6 capability domains.Protocols(/protocols) — Categorized library of guided somatic interventions.Journal(/journal) — Encrypted post-session reflections and observations.Insights(/insights) — Recovery velocity trends and completion efficiency metrics.AI Coach(/coach) — Conversational metacognitive co-pilot.Profile(/profile) — Signature Identity statement, core values, identity anchors.Settings(/settings) — Data encryption, zero-trust sovereignty, and Crypto-Tombstone controls.
Protocols are structured somatic micro-interventions organized across 8 core categories:
- Attention: e.g., Single-Point Focus Lock
- Recovery: e.g., Resonant Breathing (5.5 bpm pacing, 10.9s cycle per SOS-401 §3.3)
- Transition: e.g., Context Boundary Reset
- Preparation: e.g., Pre-Performance Prime
- Reflection: e.g., Daily State Review
- Learning: e.g., Somatic Concept Anchor
- Identity Reinforcement: e.g., Signature Identity Lock
- Performance: e.g., Peak State Activation
The Protocol Player (ProtocolPlayerScreen.tsx) features an animated visual breathing pacer, haptic cues, step-by-step sequence execution, and post-session reflection logging with 1–5 star efficacy scoring.
Every somatic execution instance is governed by a 7-state non-deterministic transition matrix (ADR-MM-0010):
[CREATED] ──► [INITIATED] ──► [ACTIVE] ────► [COMPLETED] ──► [ARCHIVED]
│ ▲ │
▼ │ ▼
[PAUSED] ───► [TIMED_OUT] ──► [ARCHIVED]
-
Monotonic Optimistic Concurrency Control (INV-007): Every transition must increment
version_idsequentially ($Version_{n+1} = Version_n + 1$ ). -
Illegal Transition Interception: Regressive pathways (e.g.
COMPLETED → ACTIVEorARCHIVED → ACTIVE) trigger a typedStateTransitionError.
The AI Coach functions as a calm, non-authoritative systems co-pilot adhering strictly to SOS-301:
-
0.7 Confidence Gate: Recommendations with confidence
$< 0.7$ automatically degrade toFALLBACK_NEUTRAL_INQUIRYwith a null protocol URN. -
Non-Diagnostic Invariant (NDI-001): Intercepts clinical diagnostic terms (
anxiety,depression,panic,adhd,clinical,disorder,diagnose). - Agency Protection: Prohibits authoritative phrasing or automated decision-making on behalf of the user.
In compliance with zero-trust privacy:
- Personal data payloads are encrypted using AES-256-GCM with per-identity Data Encryption Keys (DEKs).
- Crypto-Tombstoning: Destroying the identity Key Encryption Key (KEK) irreversibly sets encrypted personal attributes to computational
NULLwhile preserving system audit graph topology.
- Node.js: v18+ (v25.6 tested)
- npm: v9+ (v11.8 tested)
cd stateos
npm install# Start Expo dev server
npm run start
# Run on Android
npm run android
# Run on iOS (macOS required)
npm run iosRun the complete engineering invariant test suite (Session FSM, OCC, AI Guardrails, Crypto-Tombstoning):
npx tsx tests/verify-stateos.tsExpected Output:
--- Initiating StateOS Engineering Verification Suite ---
[1] Testing Session FSM Transition Matrix...
✅ PASS: Valid transition CREATED → INITIATED succeeded
✅ PASS: Valid transition INITIATED → ACTIVE succeeded
✅ PASS: Valid transition ACTIVE → PAUSED succeeded
...
✅ ALL STATEOS SPRINT 1 ENGINEERING INVARIANTS VERIFIED.
To run the system-wide repository validator across documentation, schemas, and DDLs:
cd ../stateos-v1
$env:PYTHONIOENCODING="utf-8"
python stateos-validator-v2.pyThis project is licensed under the MIT License — see the LICENSE file for details.