SIGMOS: Sigma Modular Operating Spec
A next-generation Domain-Specific Language (DSL) designed to define, orchestrate, and execute AI-native, composable, reactive, and multimodal systems.
๐ Features
- Declarative-first: Express what should happen, not how
- Typed & Validated: Strong types, constraint logic, schema compliance
- AI-Native: Prompts, LLM inference, dynamic generation as first-class citizens
- Composable: Modular specs, reusable patterns, namespaced imports
- Extensible: Plugin-based architecture with secure runtime extensions
- Reactive: Trigger-based, event-driven, lifecycle-aware
- Secure: Field permissioning, trusted imports, deterministic evaluation
๐ Project Structure
sigmos/
โโโ crates/
โ โโโ core/ # Grammar, AST, parser
โ โโโ runtime/ # Evaluation engine
โ โโโ cli/ # CLI binary
โ โโโ plugins/ # Official plugins (mcp, rest, etc.)
โ โโโ transpiler/ # Export formats (json, yaml, etc.)
โโโ docs/
โโโ examples/
โโโ spec/ # DSL EBNF, version log
โโโ registry/ # Plugin manifest JSON
โโโ tests/
๐ ๏ธ Installation
# Clone the repository git clone https://github.com/copyleftdev/sigmos.git cd sigmos # Build the project cargo build --release # Install the CLI cargo install --path crates/cli
๐ Quick Start
Basic Specification
spec "Agent" v1.0 {
description: "Defines an AI Agent with LLM prompt capabilities."
inputs:
name: string
tone: enum("friendly", "hostile")
api_key: string { secret: true }
computed:
greeting: -> "Hello, I'm {{name}}, and I'm {{tone}}."
events:
on_create(agent): mcp.call("mission.begin", {
auth: ref("api_key"),
payload: { id: agent.name }
})
constraints:
assert name != ""
ensure tone in ["friendly", "hostile"]
lifecycle:
before: validate
after: log("agent init complete")
}
CLI Usage
# Validate a specification sigmos validate spec.sigmos # Run a specification sigmos run spec.sigmos # Transpile to JSON sigmos transpile spec.sigmos --to json # Describe a specification sigmos describe spec.sigmos
๐งช Development
Prerequisites
- Rust 1.70+
- Cargo
Building
# Check all crates cargo check --workspace # Run tests cargo test --workspace # Run with all features cargo test --workspace --all-features
Code Quality
This project enforces strict code quality standards:
- Zero unsafe code: All code must be memory-safe
- Clippy clean: No warnings allowed
- Formatted:
cargo fmtenforced - Documented: All public APIs have doc comments with examples
- Tested: Comprehensive test coverage including doctests
# Format code cargo fmt # Run lints cargo clippy --workspace --all-targets --all-features -- -D warnings # Test documentation cargo test --workspace --doc
๐๏ธ Architecture
Core Components
sigmos-core: PEG grammar, AST definitions, parser implementationsigmos-runtime: Async execution engine, event handling, lifecycle managementsigmos-cli: Command-line interface with rich error reportingsigmos-plugins: Plugin system and official plugin implementationssigmos-transpiler: Export to JSON, YAML, TOML formats
Type System
SIGMOS features a rich type system with:
- Primitive types:
string,int,float,bool,null - Generic types:
list<T>,map<K,V> - Custom types via
types {}blocks - Constraint validation and type checking
Plugin System
Extend SIGMOS with custom functionality:
- Secure sandboxed execution
- Signature verification
- Runtime registration
- Async plugin methods
๐ค Contributing
- Fork the repository
- Create a feature branch
- Make your changes following the code rules
- Ensure all tests pass and code is formatted
- Submit a pull request
Code Rules
- Idiomatic Rust: Zero unsafe, strict ownership model
- Highly Modular: Decoupled, trait-oriented design
- Extensive Docstrings: Every public item documented with examples
- Property-based Testing: Use
proptestfor comprehensive testing - Strong Typing: Avoid stringly-typed code, use newtypes
๐ License
Licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE)
- MIT License (LICENSE-MIT)
at your option.
๐ Acknowledgments
SIGMOS is designed for the builders of what comes next - a future-proof DSL for orchestrating cognition, automation, and intelligence across AI-native systems.
SIGMOS: The modular operating specification for the AI era.
