aien-sovereign-core-mv
AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.
Brought by drakestapleton
aien-sovereign-core-mv / crates / aien-omegese-constraint / src / lib.rs
| 1 | // SPDX-License-Identifier: Apache-2.0 |
| 2 | // Copyright 2026 Drake Stapleton (AIEN / aien-dev) |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | |
| 16 | //! The Omegese guardrail: a [`Constraint`](aien_inference_abi::generation::Constraint) for the |
| 17 | //! generation controller (ADR 0004 section 2.3) that keeps a model's reply a prefix of a program |
| 18 | //! `omegese emit` accepts. |
| 19 | //! |
| 20 | //! A separately tested feature (Drake's guardrail decision, ADR 0004): nothing depends on this |
| 21 | //! crate by default, the controller with no constraint is unchanged, and the sparse output head |
| 22 | //! stays the default gather. The legal-token source is any [`ItemOracle`] (the contract is omega |
| 23 | //! `docs/one_layer/OMEGESE.md` section 6.2); [`SubprocessOracle`] runs `omegese next --machine`. |
| 24 | //! [`TokenTable`] holds the model vocabulary as bytes (Qwen's `tokenizer.json`, or a synthetic |
| 25 | //! table in tests). [`OmegeseConstraint`] forces the opening fence and the entry header, masks the |
| 26 | //! body, and maps `eof` to the closing fence plus the stop token; each part is switchable |
| 27 | //! ([`Framing`]). |
| 28 | |
| 29 | pub mod constraint; |
| 30 | pub mod oracle; |
| 31 | pub mod signature; |
| 32 | pub mod table; |
| 33 | pub mod word; |
| 34 | |
| 35 | pub use constraint::{Framing, OmegeseConstraint, Stats}; |
| 36 | pub use oracle::{parse_machine, Answer, Item, ItemOracle, SubprocessOracle, DEFAULT_TIMEOUT}; |
| 37 | pub use signature::Signature; |
| 38 | pub use table::{Shape, TokenTable}; |