Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-sovereign-core-mv/patches/2233402bcf18739a # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers ## GitHub aien-dev/aien-sovereign-core-mv#140 (code only) closed derived `2233402bcf18739a` #140 Imported from GitHub aien-dev/aien-sovereign-core-mv#140 (code only) GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed). Base `06da469ce189ef3e3666b8d4dcef8e1ef6f7fa6d` · Head `11ebbdb4b1f52f2fe78d6d5ca6de104f0c91e7df` ### Apply it ``` git checkout -b patch-2233402bcf18739a 06da469ce189ef3e3666b8d4dcef8e1ef6f7fa6d curl -fsSL https://interplane.io/drakestapleton/aien-sovereign-core-mv/patches/2233402bcf18739a.patch | git am ``` Raw patch (mbox) · Diff ### Provenance This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record: ``` github-import 1 aien-dev/aien-sovereign-core-mv 140 11ebbdb4b1f52f2fe78d6d5ca6de104f0c91e7df ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"aien-sovereign-core-mv","number":140,"url":"https://github.com/aien-dev/aien-sovereign-core-mv/pull/140","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:05Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/.github/workflows/crumb-visible-conformance.yml b/.github/workflows/crumb-visible-conformance.yml new file mode 100644 index 00000000..db87764b --- /dev/null +++ b/.github/workflows/crumb-visible-conformance.yml @@ -0,0 +1,51 @@ +name: CRB1 conformance + +# Migration seam 1: the Rust reference reader (crates/crumbs) must pass the +# shared CRB1 corpus in aien-protocols specs/crumb-visible with zero +# differences. The corpus is pinned by commit; bump the pin when the +# contract corpus changes. + +"on": + push: + branches: [main] + paths: + - "crates/crumbs/**" + - ".github/workflows/crumb-visible-conformance.yml" + pull_request: + branches: [main] + paths: + - "crates/crumbs/**" + - ".github/workflows/crumb-visible-conformance.yml" + workflow_dispatch: + +permissions: + contents: read + +jobs: + crb1-rust: + name: CRB1 conformance (impl=rust) + runs-on: ubuntu-latest + steps: + - name: Checkout Source + uses: actions/checkout@v4 + + - name: Checkout pinned CRB1 contract corpus + uses: actions/checkout@v4 + with: + repository: aien-dev/aien-protocols + ref: b50c00d737fa5c57ea7280e2aa4b0354ff166cf5 + path: crb1-protocols + + - name: Setup Sibling Dependencies + run: | + mkdir -p ../aien-protocols + cp -r crb1-protocols/* ../aien-protocols/ + + - name: Install Stable Rust Toolchain + uses: dtolnay/rust-toolchain@stable + + - name: Run shared corpus through the Rust reader + env: + CRB1_VECTORS: ${{ github.workspace }}/crb1-protocols/specs/crumb-visible/vectors + CRB1_REQUIRE: "1" + run: cargo test -p crumbs --test visible_conformance -- --nocapture diff --git a/crates/crumbs/tests/visible_conformance.rs b/crates/crumbs/tests/visible_conformance.rs new file mode 100644 index 00000000..efd3079f --- /dev/null +++ b/crates/crumbs/tests/visible_conformance.rs @@ -0,0 +1,106 @@ +//! CRB1 shared conformance: the Rust reference reader against the +//! language-neutral corpus in aien-protocols (specs/crumb-visible). +//! +//! Every vector listed in `expected.txt` is decoded with +//! `VisibleCrumb::from_bytes`; the outcome is printed in the contract's line +//! format and compared byte for byte. Refusals are compared by the contract's +//! numbered code, mapped here at the edge so no Rust type crosses the contract. +//! +//! Corpus location: `$CRB1_VECTORS`, else the sibling checkout +//! `../aien-protocols/specs/crumb-visible/vectors` next to this repository. +//! When the corpus is absent the test reports NOT_RUN, unless +//! `CRB1_REQUIRE=1` (set by the dedicated CI job), in which case it fails. + +use crumbs::visible::{VisibleCrumb, VisibleError}; +use std::path::PathBuf; + +/// Contract refusal codes (CRUMB_READER_CONTRACT.md, section "Refusal codes"). +fn contract_code(e: VisibleError) -> i32 { + match e { + VisibleError::Magic => -1, + VisibleError::Version => -2, + VisibleError::Shape => -3, + VisibleError::Lane => -4, + VisibleError::Length => -5, + VisibleError::NonCanonical => -6, + } +} + +/// Contract outcome line (without the leading file name). +fn outcome(bytes: &[u8]) -> String { + let c = match VisibleCrumb::from_bytes(bytes) { + Ok(c) => c, + Err(e) => return format!("refuse {}", contract_code(e)), + }; + let mut line = format!( + "ok enc={} in={}x{} out={}x{} n={}", + c.encoding as u8, + c.in_arity, + c.in_lane_bytes, + c.out_arity, + c.out_lane_bytes, + c.examples.len() + ); + if let Some(b) = c.budget { + line.push_str(&format!( + " budget={},{},{},{}", + b.max_candidates, b.max_depth, b.max_oracle_queries, b.max_program_ops + )); + } + for (i, o) in c.values() { + line.push_str(" |"); + for v in i { + line.push_str(&format!(" {v}")); + } + line.push_str(" ->"); + for v in o { + line.push_str(&format!(" {v}")); + } + } + line +} + +fn corpus_dir() -> PathBuf { + match std::env::var_os("CRB1_VECTORS") { + Some(d) => PathBuf::from(d), + None => PathBuf::from(env!("CARGO_MANIFEST_DIR")) + .join("../../../aien-protocols/specs/crumb-visible/vectors"), + } +} + +#[test] +fn crumb_visible_v1_conformance() { + let dir = corpus_dir(); + let manifest = dir.join("expected.txt"); + let Ok(text) = std::fs::read_to_string(&manifest) else { + let required = std::env::var("CRB1_REQUIRE").is_ok_and(|v| v == "1"); + println!( + "CRUMB_VISIBLE_V1_CONFORMANCE impl=rust NOT_RUN (no corpus at {})", + manifest.display() + ); + assert!(!required, "CRB1_REQUIRE=1 but the corpus is missing"); + return; + }; + let (mut pass, mut fail) = (0usize, 0usize); + for line in text.lines() { + if line.is_empty() || line.starts_with('#') { + continue; + } + let (name, want) = line + .split_once(' ') + .expect("manifest line: "); + let bytes = std::fs::read(dir.join(name)).expect("vector file listed in manifest"); + // Determinism: two decodes of the same bytes give the same line. + let got = outcome(&bytes); + assert_eq!(got, outcome(&bytes), "non-deterministic outcome for {name}"); + if got == want { + pass += 1; + } else { + fail += 1; + println!("MISMATCH {name}\n want: {want}\n got: {got}"); + } + } + println!("CRUMB_VISIBLE_V1_CONFORMANCE impl=rust pass={pass} fail={fail}"); + assert!(pass > 0, "empty corpus"); + assert_eq!(fail, 0); +} ```