Skip to content

SuperInstance/plato-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

plato-engine

High-performance PLATO tile engine — a Rust replacement for the Python PLATO server core. Extracted from forgemaster/plato-engine, now a standalone Cocapn fleet component.

What It Does

plato-engine provides the core tile processing pipeline for PLATO rooms: submission, quality gating, storage, retrieval, and cross-room pathfinding. It's a drop-in Rust replacement for the Python PLATO server, designed for high-throughput fleet deployments where every microsecond counts.

The engine handles tile lifecycle (submit → gate → store → query), room management, and inter-room navigation via tag-based adjacency graphs.

Architecture

Tile → Gate (quality checks) → Room (storage) → Query (retrieval)
                                      ↓
                               Pathfinder (cross-room routing)
                                      ↓
                               Server (HTTP API, :8847)

Core Modules

Module Purpose
tile Tile data model — Tile, TileBuilder, Provenance, content hashing
room Room management — named tile collections with hash-indexed dedup
gate Quality gate — rejects absolute claims, duplicates, and malformed tiles
engine Top-level PlatoEngine — coordinates rooms, stats, health checks
pathfinder Cross-room routing via tag-based adjacency + BFS shortest path
server Axum HTTP server — REST API for tile submission and queries

Key Types

use plato_engine::{Tile, Room, Gate, PlatoEngine, Pathfinder};

// Build a tile
let tile = Tile::builder()
    .domain("harbor")
    .question("What coordinates the fleet?")
    .answer("The harbor — a coordination hub.")
    .confidence(0.95)
    .build();

// Submit through the engine (includes gate check)
let engine = PlatoEngine::with_defaults();
engine.submit("my-room", tile)?;

// Query room health
let health = engine.health();  // rooms_count, tiles_count, uptime, stats

// Find paths between rooms
let pathfinder = Pathfinder::new(&engine);
let path = pathfinder.find_path("forgemaster-anvil", "harbor");

Server

# Run the HTTP server
cargo run --bin plato-engine

# Custom port
PLATO_PORT=9000 cargo run --bin plato-engine

Default port: 8847 (compatible with Python PLATO server).

Endpoints

Method Path Description
POST /submit Submit a tile to a room
GET /rooms List all rooms
GET /rooms/{id} Get room details + tiles
GET /health Engine health + stats
POST /query Query tiles across rooms

Quality Gate

The gate rejects tiles that:

  • Contain absolute claims ("always", "never", "guaranteed")
  • Are duplicates (content hash match)
  • Have missing required fields
  • Are below minimum length thresholds

Gate behavior is configurable via GateConfig.

Benchmarks

cargo bench

Benchmarks cover gate evaluation, tile hashing, room insertion, and pathfinder queries.

Origin

Originally developed as part of the forgemaster monorepo. Extracted for independent deployment as a fleet component in the Cocapn ecosystem.

Related Repos

License

MIT

About

Extracted from forgemaster/plato-engine — Cocapn fleet component

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages