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-proof / 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 | //! aien-proof: the shared test board for the hive. |
| 17 | //! |
| 18 | //! Every test job is fingerprinted from its command, toolchain, and the exact |
| 19 | //! contents of its inputs. A passing run leaves a stamp; any later request with |
| 20 | //! the same fingerprint, from any agent or worktree, replays the stamp instead of |
| 21 | //! running. An identical job already in flight is joined, never duplicated. |
| 22 | //! Real runs pass a CPU slot gate, a free-memory gate, and (for GPU jobs) an |
| 23 | //! exclusive GPU key. Every real run, pass or fail, is sealed into a BLAKE3 |
| 24 | //! hash-chained ledger using the Crumb ledger event format (RFC-0001 section 8), |
| 25 | //! with the run's full output as the payload. |
| 26 | |
| 27 | pub mod board; |
| 28 | pub mod chain; |
| 29 | pub mod evidence; |
| 30 | pub mod fingerprint; |
| 31 | pub mod formal; |
| 32 | pub mod gate; |
| 33 | pub mod import; |
| 34 | pub mod lease; |
| 35 | pub mod ledger; |
| 36 | pub mod ledger_bind; |
| 37 | pub mod lock; |
| 38 | pub mod store_assert; |
| 39 | pub mod workspace; |
| 40 | |
| 41 | #[cfg(test)] |
| 42 | pub(crate) mod testutil { |
| 43 | use std::path::PathBuf; |
| 44 | use std::sync::atomic::{AtomicUsize, Ordering}; |
| 45 | |
| 46 | static N: AtomicUsize = AtomicUsize::new(0); |
| 47 | |
| 48 | pub fn temp_dir(tag: &str) -> PathBuf { |
| 49 | loop { |
| 50 | let n = N.fetch_add(1, Ordering::SeqCst); |
| 51 | let dir = |
| 52 | std::env::temp_dir().join(format!("aien-proof-{tag}-{}-{n}", std::process::id())); |
| 53 | match std::fs::create_dir(&dir) { |
| 54 | Ok(()) => return dir, |
| 55 | Err(error) if error.kind() == std::io::ErrorKind::AlreadyExists => continue, |
| 56 | Err(error) => panic!("cannot create test directory: {error}"), |
| 57 | } |
| 58 | } |
| 59 | } |
| 60 | } |