Skip to main content

Crate ternsig

Crate ternsig 

Source
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 .rune files.
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§

BuildError
Error returned when building an Engine fails.
ChemicalState
Chemical state for neuromodulator gating.
Engine
The Runes engine — entry point for evaluating programs.
EngineBuilder
Fluent builder for constructing an Engine with registered extensions.
ErrorEntry
A single error catalog entry.
EvalContext
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.
ModuleVersion
Semantic version for a module.
Parser
Recursive descent parser for Runes.
RuneError
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 .rune file.
SymbolId
An interned symbol identifier. Two symbols with the same name have the same SymbolId — identity comparison, not string comparison.
SymbolTable
Interns symbol names to SymbolIds for fast equality checks.
TierAccess
Tier access configuration for a module.

Enums§

AccessLevel
Module access level within a tier.
ConstraintPhase
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}
SignalTemperature
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.
ErrorCatalog
Registry of error codes with message templates.
FoundationClass
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§

RuneResult
Result type for Runes operations.
TernarySignalDeprecated
Deprecated alias for backwards compatibility
VerbResult
Result type for verb invocations.