Skip to content

Repository files navigation

plato-runtime-kernel

CILicenseLanguage

The spatial spreadsheet engine. Rooms are cells. Cells are tensors. Markdown is the AST. Plain-English bullets are runtime assertions.


Quick Start

git clone https://github.com/SuperInstance/plato-runtime-kernel.git
cd plato-runtime-kernel
cargo build
cargo test
use plato_runtime_kernel::*;letmut baton = Baton::new("watchdog","/rooms/engine_room");
baton.set_data("coolant_threshold","95");
baton.advance_to("/rooms/wheelhouse");let spec = "## 🛑 Constraints\n* output must contain OK";let result = validate_payload("Status: OK",&extract_assertions(spec));assert!(result.passed);

What It Does

The Plato Engine Block (the C/Rust room runtime) handles sensors, actuators, ticks, and text protocols. But a real system has hundreds of rooms that need to be organized, connected, and kept in sync. The plato-runtime-kernel provides the spatial model: rooms as cells in a tensor grid, agents as batons passing between rooms, and Markdown specifications as behavioral contracts.

Every room exists at one of five depth levels — from Floor (agents, humans, autonomous behavior) to Metal (raw bits, hardware registers). Rooms can zoom between depths. Agents don't live in rooms — they pass through them, carrying their state in a Baton. Traversals are recorded in the room's topology, and over time the traversal weights reveal which rooms are most connected — the spatial equivalent of PageRank. Every room can have a Markdown specification with plain-English behavioral constraints that are validated by assertion traps and a self-correcting TutorLoop.


Architecture

 ┌─────────────────────────────┐
│ Tensor Grid │
│ ┌──────┬──────┬──────┐ │
│ │ A1 │ A2 │ A3 │ │
│ │Engine│Wheel │Back- │ │
│ │Room │house │deck │ │
│ ├──────┼──────┼──────┤ │
│ │ B1 │ B2 │ B3 │ │
│ │Galley│Bilge │Crow's│ │
│ │ │ │Nest │ │
│ └──────┴──────┴──────┘ │
│ ↑ │
│ Baton (agent state) │
│ passing between cells │
└─────────────────────────────┘

Five Depth Levels

DepthNameAnalogyWhat lives here
0FloorDance floorAgents, humans, autonomous behavior
1BoardDJ boardInstruments, tools, control surfaces
2PanelInstrument panelSettings, presets, configurations
3CodeCode editorFunctions, algorithms, logic
4MetalTransistorsRaw bits, hardware registers, firmware

Key Types

  • RoomIdentity — Spatial identity: room_id, tensor hash, grid position, depth level
  • RoomContract — ROOM.json schema defining borders, topology, and runtime assets
  • RoomTopology — Parent room, adjacent rooms, traversal history with weights
  • Baton — Immutable execution state passing through rooms (agent's "carry-on luggage")
  • AssertionResult — Validation of output against plain-English behavioral constraints
  • GridBridge — Maps spreadsheet cell coordinates to room paths
  • TutorLoop — The compile-test-refine cycle: generate output, validate against spec, iterate

This is the spatial layer of the SuperInstance PLATO ecosystem. The engine block (C, Rust) handles the physical layer (sensors, actuators, ticks); the runtime kernel handles the spatial layer (topology, traversals, contracts).


API / Usage

Create a Room Contract

use plato_runtime_kernel::*;use std::collections::HashMap;letmut contract = RoomContract{room_id:"/engine_room".into(),identity:RoomIdentity{room_id:"/engine_room".into(),tensor_hash:"abc123".into(),grid_position:(0,0),depth:RoomDepth::Floor,},topology:RoomTopology{parent_room:Some("/boat".into()),adjacent_rooms:vec!["/wheelhouse".into(),"/bilge".into()],traversal_history:vec![],},runtime_assets:RuntimeAssets{specification:"ROOM.md".into(),reflex_bindings:HashMap::new(),},};
contract.record_traversal("/wheelhouse","watchdog_baton",42);

Baton Pattern

letmut baton = Baton::new("watchdog","/engine_room");
baton.set_data("coolant_temp","96.3");
baton.advance_to("/wheelhouse");// Baton now in wheelhouse, carrying engine room data

Assertion Traps + TutorLoop

let spec = "## 🛑 Constraints\n* output must contain OK\n* shall not contain ERROR";let result = validate_payload("Status: OK, temp: 96.3",&extract_assertions(spec));assert!(result.passed);letmut tutor = TutorLoop::new(5);let output = generate_output();let result = tutor.cycle(&output, spec);if result.passed{/* good to go */}

Testing

cargo test

Contributing

Contributions are welcome! See the SuperInstance Contributing Guide.


PLATO Engine Block Family

ComponentLanguageRepoFocus
Runtime Kernel ← you are hereRustplato-runtime-kernelSpatial model: tensor grid, batons, assertion traps
C ReferenceC99plato-engine-block-cEmbedded, bare-metal, zero heap alloc
Rust (Original)Rustplato-engine-blockno_std + alloc, builder pattern, tokio server
Elixir/OTPElixirplato-engine-block-elixirBEAM supervision trees, fault tolerance
ServerPythonplato-serverKnowledge tiles, fleet sync via Matrix, HTTP API

Ecosystem

This repo is part of the SuperInstance flagship ecosystem — agent-first computation, constraint theory, and self-improving runtimes.

FLUX Runtime Family

RepoLanguageDescription
flux-runtimePythonFull FLUX runtime: markdown→bytecode, 2037 tests, zero deps
flux-coreRustRegister-based bytecode VM, deterministic agent computation
flux-jsJavaScriptFLUX VM for Node.js and browsers, ~400ns/iter
flux-compilerRust/PythonFormal-methods compiler for safety-critical codegen
flux-vmRustStack-based constraint-checking VM, 50 opcodes, Turing-incomplete

PLATO Engine Family

RepoLanguageDescription
plato-serverPythonKnowledge tiles, fleet sync via Matrix, HTTP API
plato-engine-blockRustOriginal room runtime: no_std + alloc, builder pattern
plato-engine-block-cC99Embedded reference: zero heap alloc, bare-metal portable
plato-engine-block-elixirElixirBEAM supervision trees, fault tolerance, hot reload
plato-runtime-kernelRustSpatial model: tensor grid, batons, assertion traps

Constraint / Theory Family

RepoLanguageDescription
categorical-agentsRustCategory theory for agent composition (functors, naturality)
cuda-constraint-engineCUDA/CGPU constraint checking at 1B+ constraints/sec
grand-pattern-rsRustFibonacci dual-direction cellular graph architecture
lau-hodge-theoryRustHodge decomposition, Betti numbers, spectral sequences
ternary-scienceRustExperimental evidence for ternary intelligence, 5 conservation laws

Agent / Infrastructure Family

RepoLanguageDescription
construct-coreRustLayered trait system: bare-metal → alloc → async agent runtime
crabBashAgent shell for repo entry/leave (MUD-room metaphor)
exocortexRustPersistent cognitive substrate, S3-compatible memory
git-agentPythonThe repo IS the agent — autonomous lifecycle via Git
capitaine-1TypeScriptGit-native repo-agent, Cloudflare Workers heartbeat
codespace-edge-rdResearchCodespace→Edge agent lifecycle and yoke transfer protocols
git-agent-codespaceDevContainerOne-click Codespace template for Git-Agent runtimes

Registries

RegistryPackageInstall
PyPIflux-vmpip install flux-vm
crates.iofluxvmcargo add fluxvm
npmflux-jsnpm install flux-js

Philosophy & Architecture


License

MIT

About

Runtime kernel for PLATO — the AI theorem prover. Conservation-verified computation on bare metal.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages