Expand description
§Ternsig — Virtual Mainframe Runtime
Ternsig is a virtual mainframe runtime that runs Runes programs.
It provides the kernel namespace with modules for lifecycle, chemical
substrate, metabolic regulation, and integer arithmetic.
Downstream consumers (Sentinel, etc.) extend the mainframe by implementing additional Runes modules using traits re-exported from this crate.
§Dependency Chain
runes-core (defines Module, Verb, Construct, Value, EvalContext)
↑
ternsig (implements kernel modules, re-exports Runes traits)
↑
app (sentinel) (implements app-specific modules using ternsig's re-exports)§Re-export Pattern
Consumers depend only on ternsig, not on runes-core directly:
ⓘ
use ternsig::{Module, Verb, Value, EvalContext, VerbResult, Engine};
struct MyModule { ... }
impl Module for MyModule { ... }Re-exports§
pub use error::ErrorCode;pub use error::ErrorCategory;pub use error::ErrorSeverity;pub use error::MainframeError;pub use error::MainframeResult;pub use error::ErrorRegistry;pub use error::TSG;pub use error_catalog::TernsigErrorCatalog;pub use host::TernsigHost;pub use host::HasTernsigHost;pub use host::MetabolicBudget;pub use host::BootPhase;pub use boot::BootOrchestrator;pub use boot::BootConfig;pub use boot::BootMode;pub use boot::IgnitionStep;pub use boot::PreflightReport;pub use boot::VerifiedHandle;pub use boot::HandleType;pub use boot::HandleStatus;pub use modules::BankModule;pub use modules::ChemModule;pub use modules::ChemROModule;pub use modules::LifecycleModule;pub use modules::MathModule;pub use modules::RegulatoryModule;pub use multiplex::MultiplexError;pub use multiplex::MultiplexResult;pub use multiplex::StorageHub;pub use multiplex::CartridgeMux;pub use multiplex::EngramMux;pub use multiplex::SpoolMux;pub use multiplex::WalSpooler;pub use multiplex::WalEntry;pub use multiplex::WalTarget;pub use multiplex::WalAction;pub use multiplex::SpoolLogEntry;pub use multiplex::LogLevel as SpoolLogLevel;pub use mainframe::MainframeState;pub use learning::compute_participation_mask;pub use learning::count_active;pub use learning::init_positive_bias;pub use learning::init_random_structure;pub use learning::mastery_update;pub use learning::sparsity;pub use learning::MasteryConfig;pub use learning::MasteryState;pub use logging::DataspoolLogger;pub use logging::LogMultiplexer;pub use logging::LogEntry;pub use logging::FlushError;pub use loader::ProgramLoader;pub use loader::LoadedProgram;pub use loader::LoadError;
Modules§
- boot
- Boot orchestrator — drives the mainframe through Cold → Active.
- error
- Mainframe Error System
- error_
catalog - Ternsig Error Catalog
- host
- Host state types for the Ternsig virtual mainframe runtime.
- learning
- Mastery Learning - Pure integer adaptive learning for Signal weights
- loader
- Program loader — discovers and parses
.runefiles. - logging
- Logging — dataspool-backed structured logging for Runes programs.
- mainframe
- Mainframe state — container for all mainframe-level services.
- modules
- Runes Module implementations for the Ternsig mainframe.
- multiplex
- Storage Multiplexer Layer
- snn
- Astromind SNN - Signal-Native Spiking Neural Networks
Structs§
- Build
Error - Error returned when building an Engine fails.
- Chemical
State - Chemical state for neuromodulator gating.
- Engine
- The Runes engine — entry point for evaluating programs.
- Engine
Builder - Fluent builder for constructing an Engine with registered extensions.
- Error
Entry - A single error catalog entry.
- Eval
Context - Evaluation context passed to verbs and constructs. This is a minimal definition — runes-eval provides the full implementation.
- Evaluator
- Tree-walking evaluator for Runes programs.
- Lexer
- Lexer for Runes source code.
- LogContext
- Structured context attached to every log entry. Traces the log back to its origin: which module, in which namespace, at what source location.
- Module
Version - Semantic version for a module.
- Parser
- Recursive descent parser for Runes.
- Rune
Error - A Runes error with source position and structured code.
- Scope
- Lexical scope stack for variable binding during evaluation.
- Signal
- Signal: polarity × magnitude × multiplier (
s = p × m × k) - Span
- Source position within a
.runefile. - Symbol
Id - An interned symbol identifier. Two symbols with the same name have the same SymbolId — identity comparison, not string comparison.
- Symbol
Table - Interns symbol names to SymbolIds for fast equality checks.
- Tier
Access - Tier access configuration for a module.
Enums§
- Access
Level - Module access level within a tier.
- Constraint
Phase - When a constraint runs.
- LogLevel
- Syslog-style severity levels for structured logging.
Each level maps to a Runes symbol (e.g.,
:emergency,:info). 1 byte representation via#[repr(u8)]. - Polarity
- Polarity of a neural signal — strictly {-1, 0, +1}
- Signal
Temperature - Temperature levels for signal plasticity.
- Tier
- Namespace tier — determines which modules a program can access.
- Value
- A runtime value in the Runes language.
Traits§
- Constraint
- A host-defined validation rule.
- Construct
- A host-provided custom block type.
- Error
Catalog - Registry of error codes with message templates.
- Foundation
Class - A Rust-backed class type that appears as a class in Runes.
- Logger
- Host-provided logging backend, scoped per-namespace.
- Module
- A named collection of verbs and constructs.
- Verb
- A host-provided function callable from Runes code.
Type Aliases§
- Rune
Result - Result type for Runes operations.
- Ternary
Signal Deprecated - Deprecated alias for backwards compatibility
- Verb
Result - Result type for verb invocations.