tpt-foundryos

Rust

Safety-critical, fault-tolerant process control for lunar ISRU chemical refineries — a Rust workspace with a formally-verified no_std safety domain and a std control domain (digital twin, feed-forward control, native EtherCAT/OPC-UA).

0 stars0 forks0 watchers6 open issues

Languages

Rust99.1%Just0.9%
README

TPT-FoundryOS

CI License MSRV

Autonomous ISRU chemical plant control: a safety-critical, fault-tolerant process control system for lunar regolith/ice-processing refineries.

FoundryOS replaces traditional SCADA with a Safety-by-Design architecture split into two domains:

  • Safety Domain (no_std, formally-verified): hardware-level override authority. Runs on physically separate PLC hardware from the control domain and communicates only over EtherCAT frames.
  • Control Domain (std): yield optimization, feed-forward thermal control, and a permanent digital-twin physics engine.

See ARCHITECTURE.md for the dependency graph and domain boundaries, and SAFETY.md for the proven-vs-tested-vs-assumed invariant summary.

Quickstart

Prerequisites

  • Rust 1.81+ (MSRV). Install via rustup.
  • Target (for no_std crates): rustup target add thumbv7em-none-eabihf
  • Optional: cargo-deny, cargo-audit, cargo-semver-checks, cargo-fuzz for development tooling (see CONTRIBUTING.md for install steps).

Build and test

cargo build --workspace
cargo test  --workspace

Run the in-process supervisor (simulated hardware backend) end-to-end:

cargo run -p foundryos-supervisor

Or use the CLI with a configuration file:

cargo run -p foundryos-cli -- --config examples/plant.toml run

Hello world (zero-dependency safety check)

cargo run --example hello_safety

This runs a single safety-core::evaluate() call with hardcoded sensor values — no IO traits, no sim-plant, no twin. The simplest possible integration test.

Examples

Each crate has runnable examples in its examples/ directory:

ExampleCrateDescription
hello_safetyfoundryos-safety-coreZero-dep safety evaluation
run_plantfoundryos-sim-plantDrive the simulated plant
vetofoundryos-arbiterSafety veto blocks a command
predictfoundryos-digital-twinTwin forecasts a trajectory
round_tripfoundryos-opcuaSecure-channel sign+verify
loopbackfoundryos-ethercatSoftware slave PDO exchange

Crate layout

CrateDomainPurpose
foundryos-unitsSafetySI unit newtypes with checked arithmetic
foundryos-typesSharedTagId, Timestamp, DTOs
foundryos-safety-coreSafetyFormally-verifiable safety state machine
foundryos-safety-plcSafetyEmbedded runtime harness
foundryos-io-coreSharedTransport-agnostic IO trait boundary
foundryos-physicsControlThermodynamics/reaction-kinetics model
foundryos-sim-plantControlPermanent simulated hardware backend
foundryos-digital-twinControlForward-prediction physics engine
foundryos-control-coreControlCommand/telemetry vocabulary + scheduler
foundryos-control-feedforwardControlFeed-forward controller
foundryos-arbiterBridgecontrol→safety→IO arbitration
foundryos-ethercatProtocolNative EtherCAT master
foundryos-opcuaProtocolNative OPC-UA binary transport
foundryos-configToolingTOML configuration for tags/limits/setpoints
foundryos-supervisorCompositionRunning process + OPC-UA server host
foundryos-cliToolingOperator CLI for supervisor management

Maturity disclaimer

This is pre-1.0 research/engineering code. The simulated hardware backend is a permanent, first-class part of the architecture (no real lunar hardware exists), not demo scaffolding. Formal verification is limited to foundryos-safety-core via Creusot (see SAFETY.md). Do not deploy against real plant hardware without an independent safety case.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.