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/e9aa5208634f4bda # 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#342 (code only) closed derived `e9aa5208634f4bda` #342 Imported from GitHub aien-dev/aien-sovereign-core-mv#342 (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 `b2cae6d376e80a70e2fbce0d5cc08dae440f4529` · Head `faa53bc674203b3fc8bbf9a5e871d61db1f8db3c` ### Fetch it A git bundle of the pull request's head, 30732 bytes. ``` curl -fsSL https://interplane.io/drakestapleton/aien-sovereign-core-mv/patches/e9aa5208634f4bda.bundle -o e9aa5208634f4bda.bundle git fetch e9aa5208634f4bda.bundle refs/pull/342/head ``` Raw bundle · 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 342 faa53bc674203b3fc8bbf9a5e871d61db1f8db3c ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"aien-sovereign-core-mv","number":342,"url":"https://github.com/aien-dev/aien-sovereign-core-mv/pull/342","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:52Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/.crumb b/.crumb index 611f5aa4..0ead1bd8 100644 --- a/.crumb +++ b/.crumb @@ -64,8 +64,8 @@ "generated": { "children": [ { - "digest": "2ee39207bb3a0f0466731ae4e9adbe2063cd8b4f82456a1c2b3fd7588974a557", - "last_commit": "003784e", + "digest": "079b98d3ba31281b9714dee4888d0c66a575e658793667cc245dfd89bed881e1", + "last_commit": "8c20270", "name": "scripts", "purpose": "" }, @@ -76,15 +76,15 @@ "purpose": "" } ], - "children_root": "sha256:285ca7eafbe46d808ebe5e4fb533e464bfdf0fedaf3eef486ac2e2c8826baf6f", - "compiled_at": "2026-10-08T20:02:40Z", + "children_root": "sha256:95ba9db41a2ad217bd02bbbe25aaf363580b5cd23754f40351ee780858343de5", + "compiled_at": "2026-10-08T20:16:31Z", "compiler": "crumb-compile/1", - "digest": "sha256:196df91c4dffb0c6a9b222fe2c3c3ee5e865b138d3d02a1c325fd1f4f8aaa28a", + "digest": "sha256:e251600b26bffab3c2a2df880683ce6334e52c5dba3a9b365f698feec6bffbc3", "evidence_files": 187, "evidence_root": "sha256:27ee0353cb4d4aae2b7dbce2bfe0d9f4ef2a94cd7a4555b84684d59372503280", - "files": 1614, - "generated_at_commit": "041c1c55c687e4f9a7356b430e4999407155d12f", - "source_tree": "sha256:2e9f957f3001cefcfcd094c246ff1325579e647787070b73d5c7caf0a2537d39" + "files": 1616, + "generated_at_commit": "ec9a17e8fd7e138937179095ffee55d561df844a", + "source_tree": "sha256:6797585b6c56315898c407dc95b8cd54825613f24d149581b3398ae9f1015f10" } }, "history": [], diff --git a/crates/aien-cli/.crumb b/crates/aien-cli/.crumb index ccc4baae..39afb074 100644 --- a/crates/aien-cli/.crumb +++ b/crates/aien-cli/.crumb @@ -34,21 +34,21 @@ "generated": { "children": [ { - "digest": "7567abda48e58459b6d772bf39b5673e562c8f682b6302aed9969890963f983a", - "last_commit": "3b08e67", + "digest": "dd43e4f3ee00804bd1aaac8906238f44688f719d9c5422a68fc4fee6906768af", + "last_commit": "ec9a17e", "name": "src", "purpose": "" } ], - "children_root": "sha256:8b5adc18c6c32950b20593baff81821dc21dfe55e4f4779cdd586506f9d872ae", - "compiled_at": "2026-10-08T20:02:40Z", + "children_root": "sha256:e2f54116bdcc7366210192f3e08ba76d21cbec793541c092782b2c14aecafc49", + "compiled_at": "2026-10-08T20:16:31Z", "compiler": "crumb-compile/1", - "digest": "sha256:79f8da26bb1b1013faa66a3f74d015cd8a7366a181f36f79ac0ba9d603b136eb", + "digest": "sha256:00d43983308a63807ff789ee1e1053005db659c65105d8bfb2f0286d748ed2a6", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 34, - "generated_at_commit": "041c1c55c687e4f9a7356b430e4999407155d12f", - "source_tree": "sha256:ae881ec12d7dcc2557dacf88f51cad9992dae61ae73046c94d87b2cdd6c8a9c2" + "files": 35, + "generated_at_commit": "ec9a17e8fd7e138937179095ffee55d561df844a", + "source_tree": "sha256:0150a739f1b10377ed64978d07f7f1a0a86fcd8f49181814f966f0f37617bc5a" } }, "history": [ diff --git a/crates/aien-cli/src/.crumb b/crates/aien-cli/src/.crumb index 64c3d744..db43671c 100644 --- a/crates/aien-cli/src/.crumb +++ b/crates/aien-cli/src/.crumb @@ -64,14 +64,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-08T20:02:40Z", + "compiled_at": "2026-10-08T20:16:31Z", "compiler": "crumb-compile/1", - "digest": "sha256:7567abda48e58459b6d772bf39b5673e562c8f682b6302aed9969890963f983a", + "digest": "sha256:dd43e4f3ee00804bd1aaac8906238f44688f719d9c5422a68fc4fee6906768af", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 26, - "generated_at_commit": "041c1c55c687e4f9a7356b430e4999407155d12f", - "source_tree": "sha256:d9e19feccb9c847221ee79f7727e0fa2c519f11c9919a9e76c3fae007b7c8e04" + "generated_at_commit": "ec9a17e8fd7e138937179095ffee55d561df844a", + "source_tree": "sha256:18914c7b2e6c4d5ed98120a7793b48786044589c947c390a052ca39a8430a709" } }, "history": [ diff --git a/crates/aien-cli/src/commands.rs b/crates/aien-cli/src/commands.rs index a611d325..3e8487d8 100644 --- a/crates/aien-cli/src/commands.rs +++ b/crates/aien-cli/src/commands.rs @@ -1724,6 +1724,12 @@ pub async fn run_daemon_server() { eprintln!("Fatal: {}", fatal.red().bold()); std::process::exit(1); } + // sc#328: the approval desk is required by default; a missing desk key + // refuses the start here, before any model or GPU work. + if let Err(fatal) = aien_runtime::spine::authorize_desk_at_start_from_env() { + eprintln!("Fatal: {}", fatal.red().bold()); + std::process::exit(1); + } let socket_path = aien_runtime::client::AienRuntimeClient::default_socket_path(); let sched_cfg = daemon_scheduler_config(); @@ -1850,6 +1856,8 @@ pub async fn run_daemon_server() { println!("✓ Binding socket at {}", socket_path.display()); if let Err(e) = server.run(backend).await { eprintln!("Runtime daemon error: {}", e); + // A refused start (sc#328: no desk key) must not exit as a success. + std::process::exit(1); } } diff --git a/crates/aien-cli/src/compose.rs b/crates/aien-cli/src/compose.rs index 1c17ca94..cd5001e2 100644 --- a/crates/aien-cli/src/compose.rs +++ b/crates/aien-cli/src/compose.rs @@ -290,9 +290,9 @@ async fn step(sub: &str, m: &HashMap) -> Result { .map(|s| ids(s)) .transpose()? .unwrap_or_default(); - // sovereign-core #297: the optional approval-desk proof. Only a - // daemon started with AIEN_COMPOSE_AUTHORIZE_REQUIRES_DESK=1 checks - // it; without the switch the daemon ignores it. + // sovereign-core #297, #328: the approval-desk proof. The daemon + // requires it by default; only a dev run started with the opt-out + // AIEN_COMPOSE_AUTHORIZE_REQUIRES_DESK=0 ignores it. let desk_proof = { use aien_runtime::approved_auth::{desk_key_path, AuthorizeBinding, DeskKey}; use aien_runtime::control::DeskProof; diff --git a/crates/aien-cli/tests/allen_concurrency_test.rs b/crates/aien-cli/tests/allen_concurrency_test.rs index 8e1201a8..56043d0c 100644 --- a/crates/aien-cli/tests/allen_concurrency_test.rs +++ b/crates/aien-cli/tests/allen_concurrency_test.rs @@ -87,6 +87,11 @@ impl Rig { for d in ["ws", "state", "home", "prov"] { std::fs::create_dir_all(root.join(d)).unwrap(); } + // sc#328: the daemon refuses to start without the (default) desk key. + aien_runtime::approved_auth::DeskKey::create(&aien_runtime::approved_auth::desk_key_path( + &root.join("compose"), + )) + .unwrap(); Rig { _tmp: tmp, root, diff --git a/crates/aien-cli/tests/compose_ordinary_flow_test.rs b/crates/aien-cli/tests/compose_ordinary_flow_test.rs index 8c54821d..cf5bcead 100644 --- a/crates/aien-cli/tests/compose_ordinary_flow_test.rs +++ b/crates/aien-cli/tests/compose_ordinary_flow_test.rs @@ -1,10 +1,14 @@ //! sovereign-core #261: the ordinary `aien compose` flow (propose, authorize, //! execute) with the daemon minting the grant, driven through the real CLI //! binary against an in-process daemon whose compose bridge has a fixed -//! proposer (no model). Needs the linked composition archive; in a stub -//! build each test is IGNORED (cfg compose_linked from build.rs), never passed. +//! proposer (no model). The bridge keeps its default (sc#328): authorize +//! requires the approval desk MAC, so the flow creates a desk key and signs +//! with `--desk`, as an operator does. Needs the linked composition archive; +//! in a stub build each test is IGNORED (cfg compose_linked from build.rs), +//! never passed. use aien_inference_abi::MockInferenceBackend; use aien_kv_cache::create_shared_kv_manager; +use aien_runtime::approved_auth::{desk_key_path, DeskKey}; use aien_runtime::client::AienRuntimeClient; use aien_runtime::control::{ControlCommand, ControlResponse}; use aien_runtime::server::AienRuntimeServer; @@ -47,6 +51,7 @@ async fn rig() -> Option { let ws = root.join("ws"); std::fs::create_dir_all(&ws).unwrap(); let socket = root.join("aien.sock"); + DeskKey::create(&desk_key_path(&root.join("compose"))).unwrap(); let bridge = Arc::new(ComposeBridge::new( root.join("compose"), proposer(), @@ -83,13 +88,18 @@ async fn rig() -> Option { impl Rig { /// Run `aien-cli compose `; returns (exit code, JSON on stdout). async fn cli(&self, args: Vec) -> (i32, Value) { - let (sock, prov) = (self.socket.clone(), self.dir.join("prov")); + let (sock, prov, compose) = ( + self.socket.clone(), + self.dir.join("prov"), + self.dir.join("compose"), + ); tokio::task::spawn_blocking(move || { let o = std::process::Command::new(env!("CARGO_BIN_EXE_aien-cli")) .arg("compose") .args(&args) .env("AIEN_RUNTIME_SOCK", &sock) .env("AIEN_PROVENANCE_DIR", &prov) + .env("AIEN_COMPOSE_DIR", &compose) .output() .expect("run aien-cli"); let out = String::from_utf8_lossy(&o.stdout).to_string(); @@ -148,7 +158,11 @@ async fn ordinary_flow_propose_authorize_execute_reaches_done() { let Some(r) = rig().await else { return }; let report = r.propose().await; let (code, auth) = r - .cli(r.args("authorize", &report, &["--approver", "drake"])) + .cli(r.args( + "authorize", + &report, + &["--approver", "drake", "--desk", "1"], + )) .await; assert_eq!(code, 0, "{auth}"); let id = auth["authorization"]["id"].as_u64().expect("grant id"); @@ -219,3 +233,35 @@ async fn a_client_written_authorization_note_is_refused_and_opens_nothing() { assert!(!r.ws.join("NOTES.md").exists()); r.down().await; } + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +#[cfg_attr(not(compose_linked), ignore = "needs the linked librx_compose.a")] +async fn authorize_without_the_desk_mac_is_refused_and_mints_nothing() { + // sc#328: the default bridge requires the desk; an OS-user-only authorize + // (what every client sent before #297) is refused and opens nothing. + let _t = ONE_HOME.lock().await; + let Some(r) = rig().await else { return }; + let report = r.propose().await; + let (code, v) = r + .cli(r.args("authorize", &report, &["--approver", "drake"])) + .await; + assert_ne!(code, 0, "{v}"); + assert!(v.to_string().contains("DeskMacRequired"), "{v}"); + let (code, v) = r + .cli(r.args("execute", &report, &["--authorization", "1"])) + .await; + assert_ne!(code, 0, "{v}"); + assert!(!r.ws.join("NOTES.md").exists()); + // The same proposal, signed at the desk, is authorized: the refusal was + // the missing MAC, not a broken rig. + let (code, auth) = r + .cli(r.args( + "authorize", + &report, + &["--approver", "drake", "--desk", "1"], + )) + .await; + assert_eq!(code, 0, "{auth}"); + assert!(auth["authorization"]["id"].as_u64().is_some(), "{auth}"); + r.down().await; +} diff --git a/crates/aien-cli/tests/desk_required_startup_test.rs b/crates/aien-cli/tests/desk_required_startup_test.rs new file mode 100644 index 00000000..c2cc869e --- /dev/null +++ b/crates/aien-cli/tests/desk_required_startup_test.rs @@ -0,0 +1,213 @@ +//! sc#328 (Drake decision b, 2026-10-08): the approval desk is REQUIRED by +//! default. A real `aien daemon` process, started four ways: +//! D1 no desk key, switch unset: startup is refused before the socket +//! exists, the message names the key path and how to create it. +//! D2 the dev opt-out (`AIEN_COMPOSE_AUTHORIZE_REQUIRES_DESK=0`) in a +//! strict run (no AIEN_DEV_FALLBACK, as release qualification runs): +//! startup is refused. +//! D3 the dev opt-out in a dev run: the daemon serves and says so loudly +//! at startup ("Authorize MAC: OFF, DEV OPT-OUT"). +//! D4 a desk key created by `aien compose desk-key --create`: the daemon +//! serves with "Authorize MAC: on". +//! No model and no composition library are needed (host CPU only); these run +//! in every build. +use std::os::unix::process::CommandExt; +use std::path::{Path, PathBuf}; +use std::process::{Child, Command, Stdio}; +use std::time::Duration; + +const SWITCH: &str = "AIEN_COMPOSE_AUTHORIZE_REQUIRES_DESK"; + +struct Rig { + _tmp: tempfile::TempDir, + root: PathBuf, +} + +impl Rig { + fn new() -> Rig { + // Short path: unix socket paths are limited to 108 bytes. + let tmp = tempfile::Builder::new() + .prefix("dk-") + .tempdir_in("/tmp") + .unwrap(); + let root = std::fs::canonicalize(tmp.path()).unwrap(); + for d in ["state", "home", "prov"] { + std::fs::create_dir_all(root.join(d)).unwrap(); + } + Rig { _tmp: tmp, root } + } + fn sock(&self) -> PathBuf { + self.root.join("s") + } + fn compose(&self) -> PathBuf { + self.root.join("compose") + } + fn log(&self) -> PathBuf { + self.root.join("daemon.log") + } + fn cmd(&self, dev: bool, switch: Option<&str>) -> Command { + let mut c = Command::new(env!("CARGO_BIN_EXE_aien-cli")); + c.current_dir(&self.root) + .env("HOME", self.root.join("home")) + .env("NO_COLOR", "1") + .env("AIEN_RUNTIME_SOCK", self.sock()) + .env("AIEN_RUNTIME_STATE_DIR", self.root.join("state")) + .env("AIEN_COMPOSE_DIR", self.compose()) + .env("AIEN_PROVENANCE_DIR", self.root.join("prov")) + .env("AIEN_REQUIRE_CHECKPOINT", "0"); + for k in [ + "AIEN_OMEGA_DIR", + "AIEN_OMEGA_GPU_LIB", + "AIEN_REQUIRE_BLACKWELL", + "AIEN_GPU_BACKEND", + "AIEN_MODEL_PATH", + "AIEN_TOKENIZER_PATH", + "AIEN_MODEL_DIR", + "AIEN_DEV_FALLBACK", + SWITCH, + ] { + c.env_remove(k); + } + if dev { + c.env("AIEN_DEV_FALLBACK", "1"); + } + if let Some(v) = switch { + c.env(SWITCH, v); + } + c + } + fn spawn(&self, dev: bool, switch: Option<&str>) -> Child { + let f = std::fs::File::create(self.log()).unwrap(); + let mut c = self.cmd(dev, switch); + c.arg("daemon") + .process_group(0) + .stdin(Stdio::null()) + .stdout(f.try_clone().unwrap()) + .stderr(f); + c.spawn().expect("spawn daemon") + } + fn text(&self) -> String { + std::fs::read_to_string(self.log()).unwrap_or_default() + } + + /// The daemon must exit on its own, refused, without ever binding the socket. + fn refused(&self, dev: bool, switch: Option<&str>) -> String { + let mut d = self.spawn(dev, switch); + for _ in 0..1200 { + if let Some(st) = d.try_wait().unwrap() { + let text = self.text(); + assert!( + !st.success(), + "a refused start must exit non-zero ({st:?}): {text}" + ); + assert!( + !self.sock().exists(), + "socket bound before the refusal: {text}" + ); + return text; + } + assert!( + !self.sock().exists(), + "the daemon bound its socket: {}", + self.text() + ); + std::thread::sleep(Duration::from_millis(50)); + } + let _ = d.kill(); + let _ = d.wait(); + panic!("the daemon did not refuse within 60 s: {}", self.text()); + } + + /// The daemon must serve; returns its startup log, then stops it. + fn serves(&self, dev: bool, switch: Option<&str>) -> String { + let mut d = self.spawn(dev, switch); + for _ in 0..1200 { + std::thread::sleep(Duration::from_millis(50)); + if let Some(st) = d.try_wait().unwrap() { + panic!("daemon exited early ({st:?}): {}", self.text()); + } + let text = self.text(); + if self.sock().exists() && text.contains("Authorize MAC:") { + let _ = d.kill(); + let _ = d.wait(); + return text; + } + } + let _ = d.kill(); + let _ = d.wait(); + panic!("the daemon did not come up in 60 s: {}", self.text()); + } +} + +fn key_path(compose: &Path) -> String { + compose.join("approval-desk.key").display().to_string() +} + +#[test] +fn d1_no_desk_key_refuses_startup() { + let r = Rig::new(); + for dev in [false, true] { + let text = r.refused(dev, None); + assert!(text.contains(&key_path(&r.compose())), "dev={dev}: {text}"); + assert!(text.contains("desk-key --create"), "dev={dev}: {text}"); + } + // "1" is the same requirement, spelled out. + let text = r.refused(false, Some("1")); + assert!(text.contains(&key_path(&r.compose())), "{text}"); + assert!( + !Path::new(&key_path(&r.compose())).exists(), + "startup must never mint a key" + ); +} + +#[test] +fn d2_dev_opt_out_is_refused_in_a_strict_run() { + let r = Rig::new(); + if aien_inference_abi::strict::DEV_FALLBACK { + // A --features dev-fallback build is never strict: there the opt-out serves. + let text = r.serves(false, Some("0")); + assert!(text.contains("Authorize MAC: OFF, DEV OPT-OUT"), "{text}"); + return; + } + let text = r.refused(false, Some("0")); + assert!(text.contains(SWITCH), "{text}"); + assert!(text.contains("release qualification"), "{text}"); + assert!(text.contains("AIEN_DEV_FALLBACK"), "{text}"); +} + +#[test] +fn d3_dev_opt_out_starts_and_says_so() { + let r = Rig::new(); + let text = r.serves(true, Some("0")); + let line = text + .lines() + .find(|l| l.contains("Authorize MAC:")) + .unwrap_or_default(); + assert!(line.contains("Authorize MAC: OFF, DEV OPT-OUT"), "{line}"); + assert!( + line.contains("not valid for release qualification"), + "{line}" + ); + assert!( + !Path::new(&key_path(&r.compose())).exists(), + "startup must never mint a key" + ); +} + +#[test] +fn d4_with_the_desk_key_the_daemon_serves_with_the_mac_on() { + let r = Rig::new(); + let o = r + .cmd(false, None) + .args(["compose", "desk-key", "--create", "1"]) + .output() + .unwrap(); + assert!(o.status.success(), "{}", String::from_utf8_lossy(&o.stdout)); + assert!(Path::new(&key_path(&r.compose())).exists()); + let text = r.serves(false, None); + let line = text + .lines() + .find(|l| l.contains("Authorize MAC:")) + .unwrap_or_default(); + assert!(line.starts_with("Authorize MAC: on"), "{line}"); +} diff --git a/crates/aien-cli/tests/provenance_link_live_test.rs b/crates/aien-cli/tests/provenance_link_live_test.rs index 7389aa8b..67d7cf58 100644 --- a/crates/aien-cli/tests/provenance_link_live_test.rs +++ b/crates/aien-cli/tests/provenance_link_live_test.rs @@ -125,6 +125,11 @@ fn a_live_model_commit_names_its_generation_record_and_weights_digest() { for d in ["ws", "state", "home", "prov"] { std::fs::create_dir_all(root.join(d)).unwrap(); } + // sc#328: the daemon requires the approval desk by default. + aien_runtime::approved_auth::DeskKey::create(&aien_runtime::approved_auth::desk_key_path( + &root.join("compose"), + )) + .unwrap(); let rig = Rig { bin: bin.clone(), root: root.clone(), @@ -191,6 +196,8 @@ fn a_live_model_commit_names_its_generation_record_and_weights_digest() { ws.to_str().unwrap(), "--approver", "drake", + "--desk", + "1", ]); assert_eq!(auth["ok"], true, "{auth}"); let grant = auth["authorization"]["id"].as_u64().unwrap(); diff --git a/crates/aien-cli/tests/recovery_matrix_test.rs b/crates/aien-cli/tests/recovery_matrix_test.rs index 7e3ab40a..fc71b4df 100644 --- a/crates/aien-cli/tests/recovery_matrix_test.rs +++ b/crates/aien-cli/tests/recovery_matrix_test.rs @@ -11,11 +11,13 @@ //! backend (`aien compose propose`, one committed one-file change per case), then //! the ordinary `aien compose authorize`, so the daemon mints the grant from its //! own compose-commit record. That model daemon is SIGKILLed; the case then runs -//! on a model-less daemon over the same state. Two modes: AIEN_MATRIX_MAC unset -//! (daemon ignores desk proofs) and AIEN_MATRIX_MAC=1 (daemon started with -//! AIEN_COMPOSE_AUTHORIZE_REQUIRES_DESK=1, desk key in the case compose dir, every -//! authorize carries a desk MAC under a fresh nonce). Receipts record -//! "Authorize MAC: on|off" from the daemon log. AIEN_PROPOSER_MODEL overrides the +//! on a model-less daemon over the same state. Two modes: the default (the desk +//! is required, sc#328: desk key in the case compose dir, every authorize +//! carries a desk MAC under a fresh nonce) and AIEN_MATRIX_MAC=0, the legacy +//! OS-user-only authorize, which is only reachable through the dev opt-out +//! (AIEN_COMPOSE_AUTHORIZE_REQUIRES_DESK=0 with AIEN_DEV_FALLBACK=1), so such a +//! run is a dev run and never qualification evidence. Receipts record the +//! daemon's "Authorize MAC: on" or "Authorize MAC: OFF, DEV OPT-OUT" line. AIEN_PROPOSER_MODEL overrides the //! SmolLM2 directory. Rows M1 and M2 are about the MAC and always run with it on. //! //! Needs a compose-linked CPU build of `aien-cli` with the `fault-hold` feature @@ -107,7 +109,7 @@ struct Rig { impl Rig { fn new(case: &'static str) -> Rig { - Rig::with_mac(case, std::env::var("AIEN_MATRIX_MAC").as_deref() == Ok("1")) + Rig::with_mac(case, std::env::var("AIEN_MATRIX_MAC").as_deref() != Ok("0")) } /// `mac` forces the authorize-MAC mode (rows that are about the MAC itself). @@ -146,6 +148,10 @@ impl Rig { }; if mac { r.env.push((AUTHORIZE_DESK_ENV.into(), "1".into())); + } else { + // sc#328: the legacy path is the visible dev opt-out, never strict. + r.env.push((AUTHORIZE_DESK_ENV.into(), "0".into())); + r.env.push(("AIEN_DEV_FALLBACK".into(), "1".into())); } r } diff --git a/crates/aien-cli/tests/test_cli_runtime_ipc.rs b/crates/aien-cli/tests/test_cli_runtime_ipc.rs index 4fce0fe2..04cf397a 100644 --- a/crates/aien-cli/tests/test_cli_runtime_ipc.rs +++ b/crates/aien-cli/tests/test_cli_runtime_ipc.rs @@ -16,6 +16,12 @@ async fn test_cli_runtime_ipc_lifecycle() { std::env::set_var("AIEN_RUNTIME_SOCK", socket_path.to_str().unwrap()); // Keep the idempotency log out of the shared /tmp default used by a live runtime. std::env::set_var("AIEN_RUNTIME_STATE_DIR", temp_dir.path()); + // sc#328: the daemon refuses to start without the (default) desk key. + std::env::set_var("AIEN_COMPOSE_DIR", temp_dir.path().join("compose")); + aien_runtime::approved_auth::DeskKey::create(&aien_runtime::approved_auth::desk_key_path( + &temp_dir.path().join("compose"), + )) + .unwrap(); let kv_manager = create_shared_kv_manager(512, 16); let sched_cfg = SchedulerConfig { diff --git a/crates/aien-runtime/src/server.rs b/crates/aien-runtime/src/server.rs index 5db76578..5bd71a22 100644 --- a/crates/aien-runtime/src/server.rs +++ b/crates/aien-runtime/src/server.rs @@ -141,6 +141,31 @@ impl AienRuntimeServer { .map_err(|e| format!("compose limits: {e}"))?; let authorize_desk = crate::spine::authorize_requires_desk_from_env()?; + // sc#328: a bridge that requires the approval desk refuses to start + // without a loadable desk key, before the socket exists. A bridge with + // the desk off (code that embeds the runtime) is the same dev-only + // opt-out as the env switch: a strict run refuses it. + let desk_home = match self + .compose_override + .lock() + .expect("compose override") + .as_ref() + { + Some(b) if !b.authorize_requires_desk() => { + crate::spine::authorize_desk_setting( + Some("0"), + aien_inference_abi::strict::dev_fallback_active(), + ) + .map_err(|e| format!("compose bridge built with the approval desk off: {e}"))?; + None + } + Some(b) => Some(b.dir().to_path_buf()), + None if authorize_desk => compose_dir_from_env().ok(), + None => None, + }; + if let Some(dir) = desk_home { + crate::spine::check_desk_key_at_start(&dir)?; + } let listener = UnixListener::bind(&self.socket_path).map_err(|e| { format!( "Failed to bind runtime UNIX domain socket at {}: {}", @@ -254,14 +279,11 @@ impl AienRuntimeServer { // effect command refuses until an operator reconcile succeeds // (ACCEPTANCE-v3 2.5). if let Some(b) = compose.as_ref() { - println!( - "Authorize MAC: {}", - if b.authorize_requires_desk() { - "on (aien compose authorize requires the approval desk key MAC)" - } else { - "off (authorize is authenticated by the OS user only)" - } - ); + let line = crate::spine::authorize_mac_line(b.authorize_requires_desk()); + println!("{line}"); + if !b.authorize_requires_desk() { + tracing::warn!("{line}"); + } if aien_omega_compose::LINKED { println!( "Compose: native (omega {})", diff --git a/crates/aien-runtime/src/spine.rs b/crates/aien-runtime/src/spine.rs index a53b4b2d..7da6f3e4 100644 --- a/crates/aien-runtime/src/spine.rs +++ b/crates/aien-runtime/src/spine.rs @@ -993,16 +993,72 @@ fn env_opt(name: &str) -> Result, String> { } } -/// Env switch for the desk MAC on `ComposeAuthorize` (#297): `1` = required, -/// unset or `0` = off. Anything else stops the daemon (a typo must not leave -/// the requirement silently off). +/// Env switch for the desk MAC on `ComposeAuthorize` (#297, #328). Required +/// by default: unset or `1` = required. `0` is the dev-only opt-out, accepted +/// only in a dev run (`aien_inference_abi::strict::dev_fallback_active`); a +/// strict run, which is what release qualification runs, refuses it. Anything +/// else stops the daemon (a typo must not leave the requirement silently off). pub const AUTHORIZE_DESK_ENV: &str = "AIEN_COMPOSE_AUTHORIZE_REQUIRES_DESK"; +/// The rule behind [`authorize_requires_desk_from_env`], for a switch value +/// and whether this is a dev run. +pub fn authorize_desk_setting(value: Option<&str>, dev: bool) -> Result { + match value { + None | Some("1") => Ok(true), + Some("0") if dev => Ok(false), + Some("0") => Err(format!( + "{AUTHORIZE_DESK_ENV}=0 is a dev-only opt-out and is prohibited here: this is a strict run \ + (no {}=1), as release qualification is. Create the desk key with \ + `aien compose desk-key --create 1` and unset {AUTHORIZE_DESK_ENV}", + aien_inference_abi::strict::DEV_FALLBACK_ENV + )), + Some(o) => Err(format!( + "{AUTHORIZE_DESK_ENV} must be 1 (required, the default) or 0 (dev-only opt-out), got {o:?}" + )), + } +} + pub fn authorize_requires_desk_from_env() -> Result { - match env_opt(AUTHORIZE_DESK_ENV)?.as_deref() { - None | Some("0") => Ok(false), - Some("1") => Ok(true), - Some(o) => Err(format!("{AUTHORIZE_DESK_ENV} must be 1 or 0, got {o:?}")), + authorize_desk_setting( + env_opt(AUTHORIZE_DESK_ENV)?.as_deref(), + aien_inference_abi::strict::dev_fallback_active(), + ) +} + +/// Startup check (#328): a bridge that requires the desk must find a loadable +/// desk key in its compose home, or the daemon refuses to start. Never creates +/// a key: minting one is the operator's `aien compose desk-key --create`. +pub fn check_desk_key_at_start(compose_dir: &Path) -> Result<(), String> { + let path = crate::approved_auth::desk_key_path(compose_dir); + crate::approved_auth::DeskKey::load(&path).map(|_| ()).map_err(|e| { + format!( + "the approval desk is required ({AUTHORIZE_DESK_ENV} unset or 1) but its key is not usable: {e}. \ + Create it with `aien compose desk-key --create 1` (AIEN_COMPOSE_DIR={}); the daemon refuses to \ + start without it", + compose_dir.display() + ) + }) +} + +/// The daemon's startup rule from the environment (#328): the setting, +/// after the desk key check when the desk is required. +pub fn authorize_desk_at_start_from_env() -> Result { + let required = authorize_requires_desk_from_env()?; + if required { + if let Ok(dir) = compose_dir_from_env() { + check_desk_key_at_start(&dir)?; + } + } + Ok(required) +} + +/// The startup line that states the authorize rule this daemon enforces. +pub fn authorize_mac_line(required: bool) -> &'static str { + if required { + "Authorize MAC: on (aien compose authorize requires the approval desk key MAC)" + } else { + "Authorize MAC: OFF, DEV OPT-OUT (AIEN_COMPOSE_AUTHORIZE_REQUIRES_DESK=0 in a dev run): \ + authorize is authenticated by the OS user only; not valid for release qualification" } } @@ -1771,8 +1827,9 @@ pub struct ComposeBridge { /// must not be reopened lazily by a connection task that outlives `run` /// (sovereign-core #306). closed: std::sync::atomic::AtomicBool, - /// sovereign-core #297: when true, `ComposeAuthorize` needs the approval - /// desk's MAC. Default false (legacy OS-user-only authorize). + /// sovereign-core #297, #328: when true, `ComposeAuthorize` needs the + /// approval desk's MAC. Default true (Drake decision b, 2026-10-08); + /// false is the legacy OS-user-only authorize, only by explicit choice. authorize_requires_desk: bool, /// The loaded model files and the daemon start, set by the daemon after /// load. Without them a compose proposal gets no generation record. @@ -1794,7 +1851,7 @@ impl ComposeBridge { home: std::sync::Mutex::new(None), reconcile_failed: std::sync::Mutex::new(None), closed: std::sync::atomic::AtomicBool::new(false), - authorize_requires_desk: false, + authorize_requires_desk: true, identity: std::sync::Mutex::new(None), } } @@ -1817,6 +1874,8 @@ impl ComposeBridge { } /// Turn the desk-MAC requirement on `ComposeAuthorize` on or off (#297). + /// On by default (#328); off is for dev and tests of the legacy path, and a + /// server refuses to start with it off in a strict run. pub fn with_authorize_requires_desk(mut self, on: bool) -> Self { self.authorize_requires_desk = on; self diff --git a/crates/aien-runtime/tests/allen_memory_ipc_test.rs b/crates/aien-runtime/tests/allen_memory_ipc_test.rs index 9a389761..5b747247 100644 --- a/crates/aien-runtime/tests/allen_memory_ipc_test.rs +++ b/crates/aien-runtime/tests/allen_memory_ipc_test.rs @@ -16,6 +16,11 @@ async fn allen_memory_commands_route_through_the_socket() { let tmp = tempfile::tempdir().unwrap(); // Only this test binary sets these; one test per binary avoids env races. std::env::set_var("AIEN_COMPOSE_DIR", tmp.path().join("compose")); + // sc#328: the daemon refuses to start without the (default) desk key. + aien_runtime::approved_auth::DeskKey::create(&aien_runtime::approved_auth::desk_key_path( + &tmp.path().join("compose"), + )) + .unwrap(); std::env::remove_var(ENV_SUBJECT); let socket = tmp.path().join("runtime.sock"); let cfg = SchedulerConfig { diff --git a/crates/aien-runtime/tests/allen_persona_ipc_test.rs b/crates/aien-runtime/tests/allen_persona_ipc_test.rs index 07aa269c..470fc0df 100644 --- a/crates/aien-runtime/tests/allen_persona_ipc_test.rs +++ b/crates/aien-runtime/tests/allen_persona_ipc_test.rs @@ -17,6 +17,11 @@ async fn allen_commands_route_through_the_socket() { let tmp = tempfile::tempdir().unwrap(); // Only this test binary sets these; one test per binary avoids env races. std::env::set_var("AIEN_COMPOSE_DIR", tmp.path().join("compose")); + // sc#328: the daemon refuses to start without the (default) desk key. + aien_runtime::approved_auth::DeskKey::create(&aien_runtime::approved_auth::desk_key_path( + &tmp.path().join("compose"), + )) + .unwrap(); std::env::remove_var(ENV_SUBJECT); let socket = tmp.path().join("runtime.sock"); let cfg = SchedulerConfig { diff --git a/crates/aien-runtime/tests/approved_confinement_test.rs b/crates/aien-runtime/tests/approved_confinement_test.rs index cd27e2e9..085cb784 100644 --- a/crates/aien-runtime/tests/approved_confinement_test.rs +++ b/crates/aien-runtime/tests/approved_confinement_test.rs @@ -119,6 +119,11 @@ async fn forged_grants_are_confined_and_the_approved_kind_is_reserved() { let w = ws.to_str().unwrap().to_string(); // The only test in this file: the env var is process-wide. std::env::set_var("AIEN_COMPOSE_DIR", root.join("compose")); + // sc#328: the daemon refuses to start without the (default) desk key. + aien_runtime::approved_auth::DeskKey::create(&aien_runtime::approved_auth::desk_key_path( + &root.join("compose"), + )) + .unwrap(); let c = start(&dir).await; // A proposal digest no compose run ever produced. diff --git a/crates/aien-runtime/tests/authorize_desk_mac_test.rs b/crates/aien-runtime/tests/authorize_desk_mac_test.rs index 2dcae9a6..b06de289 100644 --- a/crates/aien-runtime/tests/authorize_desk_mac_test.rs +++ b/crates/aien-runtime/tests/authorize_desk_mac_test.rs @@ -408,19 +408,72 @@ fn the_wire_field_is_optional_and_old_clients_parse() { )); } +#[test] +fn the_desk_is_required_unless_a_dev_run_opts_out() { + // sc#328 (Drake decision b, 2026-10-08): REQUIRED by default. "0" is the + // dev-only opt-out; a strict (release qualification) run refuses it. + use aien_runtime::spine::authorize_desk_setting; + for dev in [false, true] { + assert_eq!( + authorize_desk_setting(None, dev), + Ok(true), + "unset, dev={dev}" + ); + assert_eq!( + authorize_desk_setting(Some("1"), dev), + Ok(true), + "1, dev={dev}" + ); + assert!( + authorize_desk_setting(Some("yes"), dev).is_err(), + "yes, dev={dev}" + ); + assert!( + authorize_desk_setting(Some(""), dev).is_err(), + "empty, dev={dev}" + ); + } + assert_eq!(authorize_desk_setting(Some("0"), true), Ok(false)); + let e = authorize_desk_setting(Some("0"), false).unwrap_err(); + assert!( + e.contains("AIEN_DEV_FALLBACK") && e.contains("release qualification"), + "{e}" + ); +} + #[test] fn the_env_switch_is_strict() { - // Pure parse check on the daemon's reader; run in one test so the - // process-wide env is not raced by another test. + // The daemon's reader: same rules, this process's dev mode. Run in one + // test so the process-wide env is not raced by another test. + use aien_inference_abi::strict::dev_fallback_active; use aien_runtime::spine::{authorize_requires_desk_from_env, AUTHORIZE_DESK_ENV}; let _g = ONE_HOME.lock().unwrap_or_else(|e| e.into_inner()); std::env::remove_var(AUTHORIZE_DESK_ENV); - assert_eq!(authorize_requires_desk_from_env(), Ok(false)); - std::env::set_var(AUTHORIZE_DESK_ENV, "0"); - assert_eq!(authorize_requires_desk_from_env(), Ok(false)); + assert_eq!(authorize_requires_desk_from_env(), Ok(true)); std::env::set_var(AUTHORIZE_DESK_ENV, "1"); assert_eq!(authorize_requires_desk_from_env(), Ok(true)); + std::env::set_var(AUTHORIZE_DESK_ENV, "0"); + if dev_fallback_active() { + assert_eq!(authorize_requires_desk_from_env(), Ok(false)); + } else { + assert!(authorize_requires_desk_from_env().is_err()); + } std::env::set_var(AUTHORIZE_DESK_ENV, "yes"); assert!(authorize_requires_desk_from_env().is_err()); std::env::remove_var(AUTHORIZE_DESK_ENV); } + +#[test] +fn a_new_bridge_requires_the_desk() { + // Secure by default for every library caller, not only the daemon. + let tmp = tempfile::tempdir().unwrap(); + let b = ComposeBridge::new( + tmp.path().join("compose"), + proposer(), + "test:fixed-proposer", + ); + assert!(b.authorize_requires_desk()); + assert!(!b + .with_authorize_requires_desk(false) + .authorize_requires_desk()); +} diff --git a/crates/aien-runtime/tests/compose_task_ipc_test.rs b/crates/aien-runtime/tests/compose_task_ipc_test.rs index c9bda6e6..a8efa51f 100644 --- a/crates/aien-runtime/tests/compose_task_ipc_test.rs +++ b/crates/aien-runtime/tests/compose_task_ipc_test.rs @@ -16,6 +16,11 @@ async fn run_compose_task_over_socket() { let tmp = tempfile::tempdir().unwrap(); // Only this test binary sets it; one test per binary avoids env races. std::env::set_var("AIEN_COMPOSE_DIR", tmp.path().join("compose")); + // sc#328: the daemon refuses to start without the (default) desk key. + aien_runtime::approved_auth::DeskKey::create(&aien_runtime::approved_auth::desk_key_path( + &tmp.path().join("compose"), + )) + .unwrap(); let ws = tmp.path().join("ws"); std::fs::create_dir_all(&ws).unwrap(); let socket = tmp.path().join("runtime.sock"); diff --git a/crates/aien-runtime/tests/confine_race_test.rs b/crates/aien-runtime/tests/confine_race_test.rs index fa8d5559..aac43d95 100644 --- a/crates/aien-runtime/tests/confine_race_test.rs +++ b/crates/aien-runtime/tests/confine_race_test.rs @@ -51,7 +51,8 @@ impl Fx { let root = std::fs::canonicalize(tmp.path()).unwrap(); let ws = root.join("ws"); std::fs::create_dir_all(ws.join("d")).unwrap(); - let b = ComposeBridge::new(root.join("compose"), proposer(), "test:fixed-proposer"); + let b = ComposeBridge::new(root.join("compose"), proposer(), "test:fixed-proposer") + .with_authorize_requires_desk(false); let run = b.run_task("write the note", ws.to_str().unwrap()); if !aien_omega_compose::LINKED { return None; diff --git a/crates/aien-runtime/tests/desk_required_server_test.rs b/crates/aien-runtime/tests/desk_required_server_test.rs new file mode 100644 index 00000000..3de933e5 --- /dev/null +++ b/crates/aien-runtime/tests/desk_required_server_test.rs @@ -0,0 +1,125 @@ +//! sc#328 (Drake decision b, 2026-10-08): the server's own startup check. A +//! compose bridge that requires the approval desk (the default) refuses to +//! start without a loadable desk key, before the socket exists; with the key +//! it serves. Covers both bridge sources: a preset bridge and the one the +//! daemon builds from AIEN_COMPOSE_DIR. A preset bridge built with the desk +//! off is the dev-only opt-out: a strict run (release qualification) refuses +//! it, a dev run serves. No composition library is needed (the +//! check runs before any compose work), so this runs in every build. +//! +//! One test: AIEN_COMPOSE_DIR is process-wide. +use aien_inference_abi::MockInferenceBackend; +use aien_kv_cache::create_shared_kv_manager; +use aien_runtime::approved_auth::{desk_key_path, DeskKey}; +use aien_runtime::client::AienRuntimeClient; +use aien_runtime::control::ControlCommand; +use aien_runtime::server::AienRuntimeServer; +use aien_runtime::spine::{AienRuntimeSpine, ComposeBridge, ComposeProposer, AUTHORIZE_DESK_ENV}; +use aien_scheduler::SchedulerConfig; +use std::path::Path; +use std::sync::Arc; +use std::time::Duration; + +fn server(socket: &Path, preset: Option<&Path>, desk: bool) -> AienRuntimeServer { + let cfg = SchedulerConfig { + max_batch_size: 8, + max_batch_tokens: 1024, + prefill_chunk_size: 64, + watermark_blocks: 4, + chunk_prefill: true, + max_prefill_tokens: 1024, + }; + let spine = AienRuntimeSpine::new(64, cfg, create_shared_kv_manager(256, 16)); + let s = AienRuntimeServer::new(spine, socket); + match preset { + Some(dir) => { + let never: ComposeProposer = + Arc::new(|_: &str, _: Duration| Err("no proposer in this test".to_string())); + s.with_compose_bridge(Arc::new( + ComposeBridge::new(dir.to_path_buf(), never, "test:none") + .with_authorize_requires_desk(desk), + )) + } + None => s, + } +} + +/// `run` must return the refusal on its own, without binding the socket. +async fn refused(socket: &Path, preset: Option<&Path>, compose: &Path) { + let s = server(socket, preset, true); + let e = tokio::time::timeout(Duration::from_secs(30), s.run(MockInferenceBackend::new(1))) + .await + .expect("the daemon did not refuse within 30 s") + .expect_err("the daemon started without the desk key"); + assert!(e.contains("desk-key --create"), "{e}"); + assert!( + e.contains(&desk_key_path(compose).display().to_string()), + "{e}" + ); + assert!(!socket.exists(), "socket bound before the refusal"); + assert!( + !desk_key_path(compose).exists(), + "startup must never mint a key" + ); +} + +/// With the key the daemon serves; then it is shut down cleanly. +async fn serves(socket: &Path, preset: Option<&Path>, desk: bool) { + let s = server(socket, preset, desk); + let h = tokio::spawn(async move { s.run(MockInferenceBackend::new(1)).await }); + let c = AienRuntimeClient::new(socket); + let mut alive = false; + for _ in 0..250 { + if c.is_alive().await { + alive = true; + break; + } + if h.is_finished() { + panic!("daemon stopped: {:?}", h.await); + } + tokio::time::sleep(Duration::from_millis(20)).await; + } + assert!(alive, "daemon did not come up"); + let _ = c.send_command(ControlCommand::Shutdown).await; + let _ = tokio::time::timeout(Duration::from_secs(5), h).await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn a_bridge_that_requires_the_desk_refuses_to_start_without_its_key() { + let tmp = tempfile::tempdir().unwrap(); + let root = std::fs::canonicalize(tmp.path()).unwrap(); + std::env::remove_var(AUTHORIZE_DESK_ENV); + + // A preset bridge, desk required by default. + let pre = root.join("preset"); + refused(&root.join("a.sock"), Some(&pre), &pre).await; + DeskKey::create(&desk_key_path(&pre)).unwrap(); + serves(&root.join("b.sock"), Some(&pre), true).await; + + // The daemon's own bridge from AIEN_COMPOSE_DIR. + let env = root.join("env"); + std::env::set_var("AIEN_COMPOSE_DIR", &env); + refused(&root.join("c.sock"), None, &env).await; + DeskKey::create(&desk_key_path(&env)).unwrap(); + serves(&root.join("d.sock"), None, true).await; +} + +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn a_bridge_with_the_desk_off_is_refused_in_a_strict_run() { + let tmp = tempfile::tempdir().unwrap(); + let root = std::fs::canonicalize(tmp.path()).unwrap(); + let off = root.join("off"); + let socket = root.join("e.sock"); + if aien_inference_abi::strict::dev_fallback_active() { + // A dev run: the opt-out serves (and says so at startup). + serves(&socket, Some(&off), false).await; + return; + } + let s = server(&socket, Some(&off), false); + let e = tokio::time::timeout(Duration::from_secs(30), s.run(MockInferenceBackend::new(1))) + .await + .expect("the daemon did not refuse within 30 s") + .expect_err("a strict run served with the desk off"); + assert!(e.contains("release qualification"), "{e}"); + assert!(!socket.exists(), "socket bound before the refusal"); +} diff --git a/crates/aien-runtime/tests/effects_test.rs b/crates/aien-runtime/tests/effects_test.rs index bb92a0bb..814ebbee 100644 --- a/crates/aien-runtime/tests/effects_test.rs +++ b/crates/aien-runtime/tests/effects_test.rs @@ -137,7 +137,8 @@ fn effect_intents_are_at_most_once_or_unresolved() { let ws = tmp.path().join("ws"); std::fs::create_dir_all(&ws).unwrap(); let ws = std::fs::canonicalize(&ws).unwrap(); - let b = ComposeBridge::new(home.clone(), proposer(), "test:fixed-proposer"); + let b = ComposeBridge::new(home.clone(), proposer(), "test:fixed-proposer") + .with_authorize_requires_desk(false); let run = b.run_task("write the note", ws.to_str().unwrap()); if !aien_omega_compose::LINKED { assert!(matches!(run, ControlResponse::Error(_))); @@ -264,7 +265,8 @@ fn effect_intents_are_at_most_once_or_unresolved() { // and the forged-record guard holds. let before = ledger(&b).view(); drop(b); - let b = ComposeBridge::new(home, proposer(), "test:fixed-proposer"); + let b = ComposeBridge::new(home, proposer(), "test:fixed-proposer") + .with_authorize_requires_desk(false); let line = effects::reconcile_at_start(&b); assert!(line.starts_with("Reconcile: checked 0"), "{line}"); assert_eq!(ledger(&b).view(), before); diff --git a/crates/aien-runtime/tests/generation_record_test.rs b/crates/aien-runtime/tests/generation_record_test.rs index d993fcce..a040c94d 100644 --- a/crates/aien-runtime/tests/generation_record_test.rs +++ b/crates/aien-runtime/tests/generation_record_test.rs @@ -87,6 +87,12 @@ async fn start_on( let spine = AienRuntimeSpine::new(64, cfg, create_shared_kv_manager(256, 16)); let proposer: ComposeProposer = Arc::new(|_p: &str, _l: Duration| Err("not used in this test".to_string())); + // sc#328: the bridge requires the desk by default; the daemon will not + // start without its key. + aien_runtime::approved_auth::DeskKey::create(&aien_runtime::approved_auth::desk_key_path( + &tmp.path().join("compose"), + )) + .unwrap(); let bridge = Arc::new(ComposeBridge::new( tmp.path().join("compose"), proposer, diff --git a/crates/aien-runtime/tests/minted_grant_test.rs b/crates/aien-runtime/tests/minted_grant_test.rs index f4ede91f..0ff2bc97 100644 --- a/crates/aien-runtime/tests/minted_grant_test.rs +++ b/crates/aien-runtime/tests/minted_grant_test.rs @@ -80,7 +80,8 @@ impl Fx { w }) .unwrap(); - let b = ComposeBridge::new(home.clone(), proposer(), "test:fixed-proposer"); + let b = ComposeBridge::new(home.clone(), proposer(), "test:fixed-proposer") + .with_authorize_requires_desk(false); let run = b.run_task("write the note", ws.to_str().unwrap()); if !aien_omega_compose::LINKED { assert!(matches!(run, ControlResponse::Error(_))); @@ -327,7 +328,8 @@ linked_test!( let Fx { home, ws, b, .. } = fx; drop(b); // New daemon process: the ledger is rebuilt from the journal alone. - let b = ComposeBridge::new(home, proposer(), "test:fixed-proposer"); + let b = ComposeBridge::new(home, proposer(), "test:fixed-proposer") + .with_authorize_requires_desk(false); let line = effects::reconcile_at_start(&b); assert!(line.starts_with("Reconcile: checked 1"), "{line}"); let l = match b.recall(&[], None) { diff --git a/crates/aien-runtime/tests/provenance_link_test.rs b/crates/aien-runtime/tests/provenance_link_test.rs index 1a59a5e8..420e4478 100644 --- a/crates/aien-runtime/tests/provenance_link_test.rs +++ b/crates/aien-runtime/tests/provenance_link_test.rs @@ -22,8 +22,9 @@ use aien_allen::{hex as ahex, ENV_ADOPT, ENV_SUBJECT}; use aien_inference_abi::MockInferenceBackend; use aien_kv_cache::create_shared_kv_manager; use aien_omega_compose::{hex, Compose, RootKind}; +use aien_runtime::approved_auth::{desk_key_path, AuthorizeBinding, DeskKey}; use aien_runtime::client::AienRuntimeClient; -use aien_runtime::control::{ControlCommand, ControlResponse}; +use aien_runtime::control::{ControlCommand, ControlResponse, DeskProof}; use aien_runtime::generation::ModelIdentity; use aien_runtime::server::AienRuntimeServer; use aien_runtime::spine::{ @@ -130,6 +131,12 @@ impl Daemon { max_prefill_tokens: 1024, }; let spine = AienRuntimeSpine::new(64, cfg, create_shared_kv_manager(256, 16)); + // sc#328: the desk is required (the default); every authorize here is + // signed with this home's desk key, as `aien compose authorize --desk 1`. + let key = desk_key_path(&home); + if !key.exists() { + DeskKey::create(&key).unwrap(); + } let bridge = Arc::new(ComposeBridge::new(home, proposer(), "test:provenance-link")); let server = AienRuntimeServer::new(spine, &socket).with_compose_bridge(bridge.clone()); if let Some(m) = model { @@ -152,6 +159,31 @@ impl Daemon { panic!("daemon did not come up"); } + /// The approval desk's proof for an authorize of commit `cx` (path and + /// content as the daemon's commit record names them). + fn desk( + &self, + cx: u64, + proposal_sha256: &str, + path: &str, + content_sha256: &str, + ) -> Option { + let key = DeskKey::load(&desk_key_path(self.bridge.dir())).unwrap(); + let nonce = format!("prov-{cx}"); + let mac = key.sign_authorize(&AuthorizeBinding { + cx_promotion: cx, + proposal_sha256: proposal_sha256.into(), + path: path.into(), + content_sha256: content_sha256.into(), + workspace: self.ws.display().to_string(), + approver: "drake".into(), + constraints: vec![], + nonce: nonce.clone(), + desk_key_id: key.id().into(), + }); + Some(DeskProof { nonce, mac }) + } + async fn send(&self, c: ControlCommand) -> ControlResponse { self.client.send_command(c).await.unwrap() } @@ -231,7 +263,12 @@ async fn ordinary_flow(d: &Daemon) -> Flow { workspace: d.ws.display().to_string(), approver: "drake".into(), constraints: vec![], - desk_proof: None, + desk_proof: d.desk( + report["cx_promotion"].as_u64().unwrap(), + &sha(PROPOSAL.as_bytes()), + "NOTES.md", + &sha(CONTENT.as_bytes()), + ), }) .await, "authorize", @@ -430,7 +467,7 @@ async fn an_old_ledger_without_provenance_still_opens_and_runs() { workspace: d.ws.display().to_string(), approver: "drake".into(), constraints: vec![], - desk_proof: None, + desk_proof: d.desk(777, &sha(b"old proposal"), "OLD.md", &sha(b"old\n")), }) .await, "authorize on an old commit", diff --git a/crates/aien-runtime/tests/recall_native_report_test.rs b/crates/aien-runtime/tests/recall_native_report_test.rs index e4b93f66..2f6bb782 100644 --- a/crates/aien-runtime/tests/recall_native_report_test.rs +++ b/crates/aien-runtime/tests/recall_native_report_test.rs @@ -14,6 +14,11 @@ use std::time::Duration; async fn recall_reports_whether_compose_is_native() { let tmp = tempfile::tempdir().unwrap(); std::env::set_var("AIEN_COMPOSE_DIR", tmp.path().join("compose")); + // sc#328: the daemon refuses to start without the (default) desk key. + aien_runtime::approved_auth::DeskKey::create(&aien_runtime::approved_auth::desk_key_path( + &tmp.path().join("compose"), + )) + .unwrap(); let socket = tmp.path().join("runtime.sock"); let cfg = SchedulerConfig { max_batch_size: 8, diff --git a/crates/aien-runtime/tests/refusal_table_test.rs b/crates/aien-runtime/tests/refusal_table_test.rs index 01dcea00..bb7fa828 100644 --- a/crates/aien-runtime/tests/refusal_table_test.rs +++ b/crates/aien-runtime/tests/refusal_table_test.rs @@ -50,7 +50,8 @@ impl Fx { let root = std::fs::canonicalize(tmp.path()).unwrap(); let ws = root.join("ws"); std::fs::create_dir_all(ws.join("d")).unwrap(); - let b = ComposeBridge::new(root.join("compose"), proposer(), "test:fixed-proposer"); + let b = ComposeBridge::new(root.join("compose"), proposer(), "test:fixed-proposer") + .with_authorize_requires_desk(false); let run = b.run_task("write the note", ws.to_str().unwrap()); if !aien_omega_compose::LINKED { return None; diff --git a/crates/aien-runtime/tests/requirements_test.rs b/crates/aien-runtime/tests/requirements_test.rs index 31e45268..9d437bd5 100644 --- a/crates/aien-runtime/tests/requirements_test.rs +++ b/crates/aien-runtime/tests/requirements_test.rs @@ -283,7 +283,8 @@ fn unmet_requirement_leaves_nothing_committed_or_written() { let ws = tmp.path().join("ws"); std::fs::create_dir_all(&ws).unwrap(); let proposer: ComposeProposer = Arc::new(|_: &str, _: Duration| gen(doc(13))); - let bridge = ComposeBridge::new(tmp.path().join("compose"), proposer, "test:short"); + let bridge = ComposeBridge::new(tmp.path().join("compose"), proposer, "test:short") + .with_authorize_requires_desk(false); let resp = bridge.run_task("write DOC.md in at least 20 lines", ws.to_str().unwrap()); if !aien_omega_compose::LINKED { assert!(matches!(resp, ControlResponse::Error(_))); @@ -336,7 +337,8 @@ fn linked_exhaustion_leaves_ledger_state_and_files_untouched() { *c2.lock().unwrap() += 1; gen(doc(13)) }); - let bridge = ComposeBridge::new(home.clone(), proposer, "test:short"); + let bridge = ComposeBridge::new(home.clone(), proposer, "test:short") + .with_authorize_requires_desk(false); let resp = bridge.run_task("write DOC.md in at least 20 lines", ws.to_str().unwrap()); if !aien_omega_compose::LINKED { assert!(matches!(resp, ControlResponse::Error(_))); @@ -408,7 +410,8 @@ fn linked_passing_document_is_approved_and_saved_byte_for_byte() { std::fs::create_dir_all(&ws).unwrap(); let ws = std::fs::canonicalize(&ws).unwrap(); let proposer: ComposeProposer = Arc::new(|_: &str, _: Duration| gen(doc(25))); - let bridge = ComposeBridge::new(tmp.path().join("compose"), proposer, "test:long"); + let bridge = ComposeBridge::new(tmp.path().join("compose"), proposer, "test:long") + .with_authorize_requires_desk(false); let resp = bridge.run_task("write DOC.md in at least 20 lines", ws.to_str().unwrap()); if !aien_omega_compose::LINKED { assert!(matches!(resp, ControlResponse::Error(_))); diff --git a/crates/aien-runtime/tests/runtime_ipc_test.rs b/crates/aien-runtime/tests/runtime_ipc_test.rs index ecc6f45b..241d1ae0 100644 --- a/crates/aien-runtime/tests/runtime_ipc_test.rs +++ b/crates/aien-runtime/tests/runtime_ipc_test.rs @@ -14,6 +14,12 @@ use tempfile::TempDir; async fn test_runtime_server_client_ipc_lifecycle() { let temp_dir = TempDir::new().expect("Failed to create tempdir"); let socket_path = temp_dir.path().join("runtime.sock"); + // sc#328: the daemon refuses to start without the (default) desk key. + std::env::set_var("AIEN_COMPOSE_DIR", temp_dir.path().join("compose")); + aien_runtime::approved_auth::DeskKey::create(&aien_runtime::approved_auth::desk_key_path( + &temp_dir.path().join("compose"), + )) + .unwrap(); let kv_manager = create_shared_kv_manager(1024, 16); let scheduler_config = SchedulerConfig { diff --git a/crates/aien-runtime/tests/runtime_socket_permissions_test.rs b/crates/aien-runtime/tests/runtime_socket_permissions_test.rs index 944816c1..dfe9f06f 100644 --- a/crates/aien-runtime/tests/runtime_socket_permissions_test.rs +++ b/crates/aien-runtime/tests/runtime_socket_permissions_test.rs @@ -15,6 +15,12 @@ async fn runtime_socket_is_owner_only() { let dir = std::env::temp_dir().join(format!("aien-sock-perm-{}", std::process::id())); let _ = std::fs::create_dir_all(&dir); std::env::set_var("AIEN_RUNTIME_STATE_DIR", &dir); + // sc#328: the daemon refuses to start without the (default) desk key. + std::env::set_var("AIEN_COMPOSE_DIR", dir.join("compose")); + let key = aien_runtime::approved_auth::desk_key_path(&dir.join("compose")); + if !key.exists() { + aien_runtime::approved_auth::DeskKey::create(&key).unwrap(); + } let socket_path = dir.join("runtime.sock"); let scheduler_config = SchedulerConfig { diff --git a/crates/aien-runtime/tests/warm_up_before_serving_test.rs b/crates/aien-runtime/tests/warm_up_before_serving_test.rs index 837e440a..154d5206 100644 --- a/crates/aien-runtime/tests/warm_up_before_serving_test.rs +++ b/crates/aien-runtime/tests/warm_up_before_serving_test.rs @@ -90,6 +90,12 @@ fn private_state_dir() { let dir = std::env::temp_dir().join(format!("aien-warm-up-test-{}", std::process::id())); std::fs::create_dir_all(&dir).unwrap(); std::env::set_var("AIEN_RUNTIME_STATE_DIR", &dir); + // sc#328: the daemon refuses to start without the (default) desk key. + std::env::set_var("AIEN_COMPOSE_DIR", dir.join("compose")); + let key = aien_runtime::approved_auth::desk_key_path(&dir.join("compose")); + if !key.exists() { + aien_runtime::approved_auth::DeskKey::create(&key).unwrap(); + } }); } diff --git a/docs/COMPOSE_PROPOSER_HOOK.md b/docs/COMPOSE_PROPOSER_HOOK.md index 33ff806c..8c06a4fe 100644 --- a/docs/COMPOSE_PROPOSER_HOOK.md +++ b/docs/COMPOSE_PROPOSER_HOOK.md @@ -101,9 +101,20 @@ for an approved write. and an operator cannot declare it DONE (an operator `--declare not_done` is still accepted). An old committed proposal has no commit record, so it must be proposed again before it can be authorized. - - Limit: the approval in the ordinary flow is the operator's CLI call as - the daemon's OS user; it carries no desk-key MAC (accepted residual; optional MAC tracked in - sovereign-core #297). What changed is that a + - The approval in the ordinary flow carries the desk-key MAC by default + (sovereign-core #297, required by default since #328, Drake decision b, + 2026-10-08): `aien compose authorize ... --desk 1` signs it, and an + authorize without it is refused (`DeskMacRequired`). The daemon refuses to + start when the desk key is missing (`aien compose desk-key --create 1` + makes it). The only way back to the OS-user-only authorize is the dev + opt-out `AIEN_COMPOSE_AUTHORIZE_REQUIRES_DESK=0`, accepted only in a dev + run (`AIEN_DEV_FALLBACK=1`), refused in a strict run (which release + qualification is), and announced at startup as + `Authorize MAC: OFF, DEV OPT-OUT`. Code that embeds the runtime and builds + a bridge with `with_authorize_requires_desk(false)` is held to the same + rule: the server refuses to start with it in a strict run (the `aien + daemon` program never builds one). Bridge-level tests of the legacy path + call the bridge directly, without a server. Also, a grant can exist only for content the daemon itself committed, at the workspace and path the daemon recorded, and only the daemon writes it. The approved-proposal path keeps its MAC. diff --git a/docs/campaigns/cand4-qualification/run-windows.sh b/docs/campaigns/cand4-qualification/run-windows.sh index c198f70f..7c1bd57e 100755 --- a/docs/campaigns/cand4-qualification/run-windows.sh +++ b/docs/campaigns/cand4-qualification/run-windows.sh @@ -66,6 +66,8 @@ new_run() { # NAME export AIEN_COMPOSE_DIR=$R/compose AIEN_PROVENANCE_DIR=$R/prov AIEN_RUNTIME_SOCK=$SOCK \ AIEN_RUNTIME_STATE_DIR=$R/state AIEN_REQUIRE_CHECKPOINT=0 unset AIEN_MODEL_PATH AIEN_TOKENIZER_PATH AIEN_REQUIRE_BLACKWELL AIEN_GPU_BACKEND AIEN_FAULT_HOLD AIEN_FAULT_HOLD_FILE + # sc#328: the daemon requires the approval desk key (the fixture may carry one). + [ -f "$R/compose/approval-desk.key" ] || "$BIN" compose desk-key --create 1 >/dev/null WS0=$(tree_list "$WS") } pre_state() { # sets N0, MID0, PD0 (daemon up) @@ -122,7 +124,7 @@ emit W-ctl-wrong-expect 1 $v "$o"; stop_daemon # ---- W-ctl-damaged-mark: a damaged record mark after a clean authorize must be seen new_run W-ctl-damaged-mark start_daemon d1; pre_state -cx A1 authorize --report "$R/s3-report.json" --workspace "$WS" --approver drake +cx A1 authorize --report "$R/s3-report.json" --workspace "$WS" --approver drake --desk 1 stop_daemon if [ -f "$R/compose.cortex-mark" ]; then printf 'X' | dd of="$R/compose.cortex-mark" bs=1 seek=70 conv=notrunc 2>/dev/null @@ -165,7 +167,7 @@ for t in $(seq 1 "$TRIALS"); do off=$(( RANDOM % 51 )); offs="$offs $off" if ! start_daemon d1; then bad=$((bad + 1)); ALLCHECKS=$(jq -c --argjson t "$t" '. + [{check:"trial_\($t)_daemon_1_up", ok:false}]' <<<"$ALLCHECKS"); continue; fi pre_state - "$BIN" compose authorize --report "$R/s3-report.json" --workspace "$WS" --approver drake >"$R/steps/A1.json" 2>"$R/steps/A1.err" & CPID=$! + "$BIN" compose authorize --report "$R/s3-report.json" --workspace "$WS" --approver drake --desk 1 >"$R/steps/A1.json" 2>"$R/steps/A1.err" & CPID=$! fsleep "$off" kill_daemon; wait "$CPID" 2>/dev/null start_daemon d2 || { chk daemon_2_up false; cx REC recover >/dev/null 2>&1; start_daemon d3; } diff --git a/docs/campaigns/next-phase-1/run-campaign.sh b/docs/campaigns/next-phase-1/run-campaign.sh index f4da5223..aaa575df 100755 --- a/docs/campaigns/next-phase-1/run-campaign.sh +++ b/docs/campaigns/next-phase-1/run-campaign.sh @@ -64,6 +64,8 @@ run_step() { return $rc } +# sc#328: the daemon requires the approval desk key; every authorize is signed (--desk 1). +[ -f "$AIEN_COMPOSE_DIR/approval-desk.key" ] || "$BIN" compose desk-key --create 1 >/dev/null || { echo "desk key create failed"; exit 2; } start_daemon 1 || { echo "daemon 1 failed to start; see $R/daemon-1.log"; tail -5 "$R/daemon-1.log"; exit 2; } PID1=$DPID # S0 (setup, before the measured window): provision the composition home. @@ -81,7 +83,7 @@ run_step S2 inspect inspect --workspace "$WS" run_step S3 propose propose --goal "$GOAL" --workspace "$WS" jq '.report' "$R/steps/S3.json" >"$R/s3-report.json" run_step S4 authorize authorize --report "$R/s3-report.json" --workspace "$WS" \ - --approver drake --constraint "${CID:-0}" + --approver drake --constraint "${CID:-0}" --desk 1 AID=$(jq -r '.authorization.id // empty' "$R/steps/S4.json") run_step S5 execute execute --report "$R/s3-report.json" --workspace "$WS" --authorization "${AID:-0}" EID=$(jq -r '.effect.id // empty' "$R/steps/S5.json") diff --git a/docs/campaigns/next-phase-2/run-faults.sh b/docs/campaigns/next-phase-2/run-faults.sh index f93111e8..81e96ddf 100755 --- a/docs/campaigns/next-phase-2/run-faults.sh +++ b/docs/campaigns/next-phase-2/run-faults.sh @@ -73,7 +73,7 @@ cx() { } j() { jq -r "$2" "$R/steps/$1.json" 2>/dev/null; } refusal() { j "$1" '.error // ""' | sed -n 's/^EFFECT_REFUSED \([A-Za-z]*\):.*/\1/p'; } -authorize() { cx "$1" authorize --report "$R/s3-report.json" --workspace "$WS" --approver drake; j "$1" '.authorization.id // empty'; } +authorize() { cx "$1" authorize --report "$R/s3-report.json" --workspace "$WS" --approver drake --desk 1; j "$1" '.authorization.id // empty'; } execute() { cx "$1" execute --report "$R/s3-report.json" --workspace "$WS" --authorization "$2"; } # exec_hold POINT ID AUTH: execute in the background, stopped at POINT. @@ -110,6 +110,8 @@ if [ "$MODE" = fixture ]; then printf '# Demo project\n\nA small local project used by the NEXT-PHASE-2 campaign.\n' >"$WS/README.md" printf 'Plan: keep notes short and local.\n' >"$WS/docs/plan.txt" printf 'sentinel outside the authorized workspace\n' >"$R/outside/sentinel.txt" + # sc#328: the daemon requires the approval desk key (copied into every run with the fixture). + "$BIN" compose desk-key --create 1 >/dev/null || { echo "desk key create failed"; exit 2; } t0=$(now_ms) start_daemon daemon-fixture || { echo "fixture daemon failed"; tail -5 "$R/daemon-fixture.log"; exit 2; } t1=$(now_ms) diff --git a/docs/campaigns/smollm2-qualification/run-smol2q.sh b/docs/campaigns/smollm2-qualification/run-smol2q.sh index 29d6982e..4e1e6891 100644 --- a/docs/campaigns/smollm2-qualification/run-smol2q.sh +++ b/docs/campaigns/smollm2-qualification/run-smol2q.sh @@ -275,6 +275,8 @@ _mem) # inside the hold: SmolLM2 start, then the Llama control start, same bin # exec: $! must be the daemon itself, not a subshell running the clean_env function # (first mem run read VmHWM of that subshell: 2716 kB; disclosed in the verdict) exec_clean() { exec env -i PATH="$PATH" HOME="$HOME" USER="${USER:-}" LANG="${LANG:-C.UTF-8}" "$@"; } + # sc#328: the daemon requires the approval desk key. + AIEN_COMPOSE_DIR="$R/compose" "$(inp aien_cli_path)" compose desk-key --create 1 >/dev/null exec_clean AIEN_COMPOSE_DIR="$R/compose" AIEN_PROVENANCE_DIR="$R/prov" AIEN_RUNTIME_SOCK="$R/aien.sock" \ AIEN_RUNTIME_STATE_DIR="$R/state" AIEN_REQUIRE_CHECKPOINT=1 AIEN_MODEL_PATH="$d/model.safetensors" \ AIEN_TOKENIZER_PATH="$d/tokenizer.json" AIEN_COMPOSE_MAX_TOKENS="$(inp max_tokens)" AIEN_REQUIRE_BLACKWELL=1 \ diff --git a/docs/campaigns/smollm2-qualification/run-windows.sh b/docs/campaigns/smollm2-qualification/run-windows.sh index cb67faef..4bfc1491 100755 --- a/docs/campaigns/smollm2-qualification/run-windows.sh +++ b/docs/campaigns/smollm2-qualification/run-windows.sh @@ -66,6 +66,8 @@ new_run() { # NAME export AIEN_COMPOSE_DIR=$R/compose AIEN_PROVENANCE_DIR=$R/prov AIEN_RUNTIME_SOCK=$SOCK \ AIEN_RUNTIME_STATE_DIR=$R/state AIEN_REQUIRE_CHECKPOINT=0 unset AIEN_MODEL_PATH AIEN_TOKENIZER_PATH AIEN_REQUIRE_BLACKWELL AIEN_GPU_BACKEND AIEN_FAULT_HOLD AIEN_FAULT_HOLD_FILE + # sc#328: the daemon requires the approval desk key (the fixture may carry one). + [ -f "$R/compose/approval-desk.key" ] || "$BIN" compose desk-key --create 1 >/dev/null WS0=$(tree_list "$WS") } pre_state() { # sets N0, MID0, PD0 (daemon up) @@ -122,7 +124,7 @@ emit W-ctl-wrong-expect 1 $v "$o"; stop_daemon # ---- W-ctl-damaged-mark: a damaged record mark after a clean authorize must be seen new_run W-ctl-damaged-mark start_daemon d1; pre_state -cx A1 authorize --report "$R/s3-report.json" --workspace "$WS" --approver drake +cx A1 authorize --report "$R/s3-report.json" --workspace "$WS" --approver drake --desk 1 stop_daemon if [ -f "$R/compose.cortex-mark" ]; then printf 'X' | dd of="$R/compose.cortex-mark" bs=1 seek=70 conv=notrunc 2>/dev/null @@ -165,7 +167,7 @@ for t in $(seq 1 "$TRIALS"); do off=$(( RANDOM % 51 )); offs="$offs $off" if ! start_daemon d1; then bad=$((bad + 1)); ALLCHECKS=$(jq -c --argjson t "$t" '. + [{check:"trial_\($t)_daemon_1_up", ok:false}]' <<<"$ALLCHECKS"); continue; fi pre_state - "$BIN" compose authorize --report "$R/s3-report.json" --workspace "$WS" --approver drake >"$R/steps/A1.json" 2>"$R/steps/A1.err" & CPID=$! + "$BIN" compose authorize --report "$R/s3-report.json" --workspace "$WS" --approver drake --desk 1 >"$R/steps/A1.json" 2>"$R/steps/A1.err" & CPID=$! fsleep "$off" kill_daemon; wait "$CPID" 2>/dev/null start_daemon d2 || { chk daemon_2_up false; cx REC recover >/dev/null 2>&1; start_daemon d3; } diff --git a/scripts/.crumb b/scripts/.crumb index 84ce2fb0..da6118f1 100644 --- a/scripts/.crumb +++ b/scripts/.crumb @@ -4,14 +4,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-08T13:07:13Z", + "compiled_at": "2026-10-08T16:51:27Z", "compiler": "crumb-compile/1", - "digest": "sha256:2ee39207bb3a0f0466731ae4e9adbe2063cd8b4f82456a1c2b3fd7588974a557", + "digest": "sha256:079b98d3ba31281b9714dee4888d0c66a575e658793667cc245dfd89bed881e1", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 26, - "generated_at_commit": "e6a0bf74914fcc3eaf7547f88398ea3bb0c48054", - "source_tree": "sha256:aa5aca35630193b84fef860fcb8135160b2652f731958e913b50ca6c255b3248" + "generated_at_commit": "1af23e011edd631b29216d8bf283f36839dda4b5", + "source_tree": "sha256:0185571097f2b27f7246d386217acb781f5ed953a22d6724bbfcc3f2cf97ba0d" } }, "parent": { diff --git a/scripts/golden_path.sh b/scripts/golden_path.sh index ba1a70e1..f8611647 100755 --- a/scripts/golden_path.sh +++ b/scripts/golden_path.sh @@ -117,6 +117,10 @@ echo "state dir: $STATE_DIR" echo "daemon log: $DAEMON_LOG" echo +# sc#328: the daemon requires the approval desk key by default; create it in +# this run's compose home before the first boot. +"$BIN" compose desk-key --create 1 >/dev/null || { echo "FATAL: cannot create the approval desk key" >&2; exit 1; } + # Step 1: boot from clean state with one command, never the mock backend. stop_daemon if boot_daemon; then ```