feat(grid-agent): add embodied behavior controller (#125)
Some checks failed
CI / rust-skia (Rust only) (push) Successful in 2m42s
CI / required (push) Failing after 2m40s

This commit is contained in:
2026-08-18 00:26:24 +00:00
parent 3a0ead7eb5
commit 058ed10005
11 changed files with 2607 additions and 22 deletions

View File

@@ -43,10 +43,10 @@ fn package_has_only_reviewed_rust_dependencies_and_no_build_script() {
#[test]
fn runtime_source_has_no_subprocess_or_native_abi_escape_hatch() {
let source = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("src");
let mut files = Vec::with_capacity(18);
let mut files = Vec::with_capacity(20);
collect_rust_files(&source, &mut files);
assert!(
files.len() <= 18,
files.len() <= 20,
"source-file count needs a reviewed bound update"
);
for path in files {
@@ -116,6 +116,37 @@ fn live_session_adapter_reuses_native_lifecycle_and_messaging_managers() {
assert!(!backend.contains("reqwest"));
}
#[test]
fn embodied_adapter_uses_only_reviewed_high_level_native_movement() {
let root = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
let backend = fs::read_to_string(root.join("src/backend.rs")).expect("backend source");
for required in [
".movement\n .turn_toward(",
".auto_pilot_local(",
".auto_pilot_cancel()",
".get_parcel_local_id(",
".sit()",
".stand()",
] {
assert!(
backend.contains(required),
"missing native embodiment mapping {required}"
);
}
let behavior = fs::read_to_string(root.join("src/behavior.rs")).expect("behavior source");
for forbidden in [
"Teleport(",
"TouchObject(",
"set_agent_controls(",
"FollowAvatar(",
] {
assert!(
!behavior.contains(forbidden),
"model-facing behavior contains forbidden primitive {forbidden}"
);
}
}
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();