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
GitHub aien-dev/aien-sovereign-core-mv#450 (code only)
Apply it
git checkout -b patch-76313ef9e03ff96e f9264552aea3ed36b472a386a336190b80bd4e09 curl -fsSL https://interplane.io/drakestapleton/aien-sovereign-core-mv/patches/76313ef9e03ff96e.patch | git am
Provenance
github-import 1
aien-dev/aien-sovereign-core-mv
450
6533bab6194414e8bcebc9bd76f0e800af8739cc
{"kind":"github-import","owner":"aien-dev","repo":"aien-sovereign-core-mv","number":450,"url":"https://github.com/aien-dev/aien-sovereign-core-mv/pull/450","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:37:13Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/.crumb b/.crumb index b010b5f0..233f19c7 100644 --- a/.crumb +++ b/.crumb @@ -119,14 +119,14 @@ } ], "children_root": "sha256:51934dfd49549a190cb949b997750b0a98ff7bd0edbfdb204d24b56f6bd6f1e5", - "compiled_at": "2026-10-11T20:45:48Z", + "compiled_at": "2026-10-11T21:00:13Z", "compiler": "crumb-compile/1", - "digest": "sha256:94df7dbfac12c4e3e618e0c19e0b0b5596e67146b3d0ab738f87ea883f1412d6", + "digest": "sha256:ac491df3f8ea3b2b7b79ee5af21ffb4698ae9aa989828b79e56bf4e68a3ea8f1", "evidence_files": 187, "evidence_root": "sha256:27ee0353cb4d4aae2b7dbce2bfe0d9f4ef2a94cd7a4555b84684d59372503280", "files": 3856, - "generated_at_commit": "22632a56c52fca6ddef14ae0b0890ea69a194e1e", - "source_tree": "sha256:5c8d3b6e20f4ab3a9166aa5af10bef43ded0526c8b525b6a3cf6f0ad88f66209" + "generated_at_commit": "53b8db441ccacf1de6f8a73a17e5f7a68f16d493", + "source_tree": "sha256:e4167decad666a3f0193df9ebac36de29f3c808620ac35068a5744c453ff94a7" } }, "history": [], diff --git a/tools/aien-test/docs/LOCAL_VERIFICATION.md b/tools/aien-test/docs/LOCAL_VERIFICATION.md index e9277641..fd768fb3 100644 --- a/tools/aien-test/docs/LOCAL_VERIFICATION.md +++ b/tools/aien-test/docs/LOCAL_VERIFICATION.md @@ -235,7 +235,8 @@ say PASS), `failure` when the bundle or the plan says FAIL, `error` otherwise; the description names the bundle path. When `gh` cannot reach GitHub the status is queued as `outbox/<seq>.<repo>.<sha>.json`, where `<seq>` is a 20-digit number that only grows, and the journal says `publication: -pending`. Every later round replays the outbox first, in queue order; the +pending`. Every later round of a loop started with `--github` replays the +outbox first, in queue order (a loop without `--github` leaves it queued); the first status GitHub refuses stops the replay, so a newer status never overtakes an older one. A newer status for the same head replaces the queued one and moves to the end. A file that is not a status is renamed to `*.bad` @@ -248,6 +249,28 @@ that has no bundle yet, then sleeps `--poll` seconds. `--iterations N` bounds the rounds (tests). Trigger names that are not a plain repository name and a 40-hex commit are ignored. +What starts a run, and what does not (checked 2026-10-11 on the Spark): + +| trigger | how | covers today | +|---|---|---| +| operator | `aien-local-ci trigger <repo> <sha>` writes `trigger/<repo>.<sha>`; `aien-local-ci once` runs in the foreground | any repository with a trusted clone | +| Forgejo push | `tools/aien-local-ci/forgejo-webhook.sh install <repo>` puts a post-receive hook in the Forgejo bare repository; a push there writes the trigger file, no network involved | installed for `aien-sovereign-core` only; Forgejo holds no copy of omega, aienos, physics or aien-architecture, and the copies it holds stopped at September commits because nothing pushes to them | +| GitHub poll | the loop started with `--github` (`aien-local-ci start --github`) lists open pull request heads and `main` of every `--repos` entry each round | all nine repositories, but it also posts the `AIEN Verification (Spark)` status, so it is off until the operator switches it on | + +So a loop started without `--github` never picks up a new pull request head +or a new `main` commit by itself: someone has to write a trigger (or push to +Forgejo). Merging a pull request on GitHub does not wake it. + +`--jobs host=N,qemu=M` and `--no-cache` apply to the runs the worker starts, +as they do for `aien-test test`. `--no-cache` runs every selected gate again +(a head with sibling checkouts never uses the cache anyway). `--jobs host=1` +runs one host gate at a time: omega's gates share one checkout's `build/` +and pin clones, and on main 771af52 ten of them failed from parallel races +("Text file busy" on `build/omegatool`, concurrent clones of +`build/pins/aienos-src`); its operator runs use +`aien-local-ci once omega <sha> --operator --jobs host=1` until the gates or +a per-repository pool setting make them safe in parallel. + ## verify-bundle and the vacuous PASS `aien-test verify-bundle` (the GitHub thin gate's command) prints and exits diff --git a/tools/aien-test/src/main.rs b/tools/aien-test/src/main.rs index 0f5e8c63..41f449fc 100644 --- a/tools/aien-test/src/main.rs +++ b/tools/aien-test/src/main.rs @@ -555,6 +555,8 @@ fn cmd_worker(cli: &Cli) -> i32 { cfg.poll = Duration::from_secs(cli.poll.unwrap_or(30)); cfg.repos = cli.repos.clone(); cfg.operator = cli.operator; + cfg.jobs = cli.jobs; + cfg.no_cache = cli.no_cache; cfg.hardware_identity = cli.hardware_identity.clone().unwrap_or_default(); if let Some((repo, sha)) = &cli.once { return match worker::run_once(&cfg, repo, sha) { diff --git a/tools/aien-test/src/worker.rs b/tools/aien-test/src/worker.rs index 5a0a51ec..0af3a473 100644 --- a/tools/aien-test/src/worker.rs +++ b/tools/aien-test/src/worker.rs @@ -20,7 +20,8 @@ //! the commit status `AIEN Verification (Spark)` is posted: success only on //! PASS, failure on FAIL, error otherwise. When GitHub cannot be reached the //! status goes to the outbox, the journal says `publication: pending`, and the -//! next successful contact flushes it. GitHub being down is never a local +//! next round of a loop started with `--github` flushes it (a loop without +//! `--github` leaves it queued). GitHub being down is never a local //! failure. use crate::bundle; @@ -28,7 +29,7 @@ use crate::evidence::{canonical, canonical_digest, sha256_hex, utc_string}; use crate::graph; use crate::plan::{self, Known, Section}; use crate::process; -use crate::resources::Hardware; +use crate::resources::{Hardware, JobsSpec}; use crate::runner::{self, CacheNote, Options}; use crate::sandbox::Sandbox; use crate::verdict::Verdict; @@ -224,6 +225,12 @@ pub struct Config { /// read-only sibling checkouts a repository's gates reach as `../<dir>`. /// None: no siblings. pub siblings: Option<PathBuf>, + /// `--jobs host=N,qemu=M` for the runs this worker starts (None: the + /// machine defaults). An operator run of a repository whose gates share + /// one checkout uses `--jobs host=1`. + pub jobs: JobsSpec, + /// `--no-cache`: run every selected gate, reuse no receipt. + pub no_cache: bool, } impl Config { @@ -247,6 +254,8 @@ impl Config { wt_tool: None, mirror_root: PathBuf::from(MIRROR_ROOT), siblings: None, + jobs: JobsSpec::default(), + no_cache: false, } } @@ -783,7 +792,8 @@ fn run_in_worktree( let mut opts = Options::new(evidence_dir.clone()); opts.sandbox = cfg.sandbox; opts.cargo_target_dir = target_dir_for(cfg, repo, on_main); - if fresh { + opts.pool_sizes = opts.pool_sizes.with(cfg.jobs); + if fresh || cfg.no_cache { opts.no_cache = true; } let mut known: BTreeMap<String, Known> = BTreeMap::new(); @@ -1266,7 +1276,14 @@ pub fn run_loop(cfg: &Config, iterations: Option<u64>) -> usize { loop { round += 1; cfg.state.beat("-", "-", "poll"); - let (posted, pending) = flush_outbox(cfg); + // Posting is the operator's choice (--github). A loop without it leaves + // queued statuses where they are, so `aien-local-ci start` after an + // offline --github run never posts them behind the operator's back. + let (posted, pending) = if cfg.github { + flush_outbox(cfg) + } else { + (0, outbox_files(&cfg.state).len()) + }; if posted + pending > 0 { println!("OUTBOX posted={posted} pending={pending}"); } diff --git a/tools/aien-test/tests/local_ci.rs b/tools/aien-test/tests/local_ci.rs index 87034793..035df6d6 100644 --- a/tools/aien-test/tests/local_ci.rs +++ b/tools/aien-test/tests/local_ci.rs @@ -585,6 +585,84 @@ fn github_down_queues_then_flushes() { .contains("flushed from outbox")); } +#[test] +fn loop_without_github_keeps_the_outbox() { + // A status queued while GitHub was down must not be posted by a loop that + // was started without --github (`aien-local-ci start`): posting is the + // operator's choice, made with --github. + let w = world(); + let fake = w.state.root.join("fake-gh"); + let log = w.state.root.join("gh.log"); + let down = w.state.root.join("gh.down"); + fs::create_dir_all(&w.state.root).unwrap(); + fs::write( + &fake, + format!( + "#!/bin/sh\nif [ -e {} ]; then echo 'connect: network unreachable' >&2; exit 1; fi\necho \"$@\" >> {}\nexit 0\n", + down.display(), + log.display() + ), + ) + .unwrap(); + fs::set_permissions(&fake, fs::Permissions::from_mode(0o755)).unwrap(); + fs::write(&down, "").unwrap(); + let mut cfg = w.config(); + cfg.github = true; + cfg.gh = fake.display().to_string(); + let s = worker::run_once(&cfg, REPO, &w.head).expect("worker"); + assert_eq!(s.publication, "pending"); + assert_eq!(worker::outbox_files(&w.state).len(), 1); + // GitHub is back, but this loop runs without --github: nothing is posted. + fs::remove_file(&down).unwrap(); + cfg.github = false; + worker::run_loop(&cfg, Some(1)); + assert_eq!(worker::outbox_files(&w.state).len(), 1); + assert!(!log.exists(), "{:?}", fs::read_to_string(&log)); + // With --github the same loop drains it. + cfg.github = true; + cfg.repos = Vec::new(); + worker::run_loop(&cfg, Some(1)); + assert!(worker::outbox_files(&w.state).is_empty()); + assert!(fs::read_to_string(&log) + .unwrap() + .contains(&format!("statuses/{}", w.head))); +} + +#[test] +fn worker_no_cache_reruns_every_gate() { + // The same head twice: the second run reuses the receipt; with + // `--no-cache` (cfg.no_cache) it runs the gate again. + let w = world(); + let mut cfg = w.config(); + let first = worker::run_once(&cfg, REPO, &w.head).expect("worker"); + assert!( + first.gates.iter().any(|(g, st, _)| g == "A" && st == "run"), + "{:?}", + first.gates + ); + let again = worker::run_once(&cfg, REPO, &w.head).expect("worker"); + assert!( + again + .gates + .iter() + .any(|(g, st, _)| g == "A" && st == "cached"), + "{:?}", + again.gates + ); + cfg.no_cache = true; + cfg.jobs = aien_test::resources::JobsSpec { + host: Some(1), + qemu: None, + }; + let fresh = worker::run_once(&cfg, REPO, &w.head).expect("worker"); + assert!( + fresh.gates.iter().any(|(g, st, _)| g == "A" && st == "run"), + "{:?}", + fresh.gates + ); + assert_eq!(fresh.verdict, Verdict::Pass, "{}", fresh.reason); +} + #[test] fn trigger_file_is_served_by_the_loop() { let w = world();