feat(grid-agent): enforce central action policy (#120)
Some checks failed
CI / rust-skia (Rust only) (push) Successful in 2m44s
CI / required (push) Failing after 2m42s

This commit is contained in:
2026-08-17 21:18:52 +00:00
parent a46bc42a8f
commit e3b9d575f9
13 changed files with 3288 additions and 33 deletions

View File

@@ -2,12 +2,13 @@ use std::collections::BTreeSet;
use std::fs;
use std::path::{Path, PathBuf};
const ALLOWED_DEPENDENCIES: [&str; 7] = [
const ALLOWED_DEPENDENCIES: [&str; 8] = [
"libremetaverse",
"libremetaverse-types",
"reqwest",
"serde",
"serde_json",
"sha2",
"tokio",
"url",
];
@@ -45,7 +46,7 @@ fn runtime_source_has_no_subprocess_or_native_abi_escape_hatch() {
let mut files = Vec::with_capacity(8);
collect_rust_files(&source, &mut files);
assert!(
files.len() <= 8,
files.len() <= 10,
"source-file count needs a reviewed bound update"
);
for path in files {
@@ -76,6 +77,15 @@ fn runtime_source_has_no_subprocess_or_native_abi_escape_hatch() {
}
}
#[test]
fn world_backend_requires_the_opaque_policy_authorization() {
let root = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let backend = fs::read_to_string(root.join("src/backend.rs")).expect("backend source");
assert!(backend.contains("action: AuthorizedAction"));
assert!(!backend.contains("call: ProposedToolCall"));
assert!(!backend.contains("decision: PolicyDecision"));
}
fn collect_rust_files(directory: &Path, output: &mut Vec<PathBuf>) {
for entry in fs::read_dir(directory).expect("read source directory") {
let path = entry.expect("source entry").path();