Rinomina: crate akode-*, cartelle akode-rs/ e akode-cli/, binario akode, ~/.akode, AKODE_* (A)
Riapplica la fase 5 di aKode (86e7c72e) sulla base ripulita:
- crate codex-* -> akode-*, codex-rs -> akode-rs, codex-cli -> akode-cli, binario e ausiliari akode;
- ~/.codex -> ~/.akode, CODEX_HOME -> AKODE_HOME, variabili CODEX_* -> AKODE_*, .codex/ -> .akode/ di progetto;
nessun fallback a ~/.codex o a CODEX_*;
- testi per l'utente "Codex" -> "aKode"; testi verso il modello e istruzioni di sistema invariati;
- snapshot insta rinominati (non ancora rigenerati).
I conflitti con la base ripulita sono stati risolti riapplicando la rinomina ai file senza le
funzioni di imeAI (script di mappa dei token per file).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
92
akode-rs/tui/src/windows_sandbox_tests.rs
Normal file
92
akode-rs/tui/src/windows_sandbox_tests.rs
Normal file
@@ -0,0 +1,92 @@
|
||||
use super::*;
|
||||
use akode_app_server_protocol::WindowsSandboxSetupMode::Elevated;
|
||||
use akode_app_server_protocol::WindowsSandboxSetupMode::Unelevated;
|
||||
use pretty_assertions::assert_eq;
|
||||
use serde_json::json;
|
||||
|
||||
#[test]
|
||||
fn windows_sandbox_server_policy_controls_setup_choices() {
|
||||
for (configured, allowed, mode, expected) in [
|
||||
(
|
||||
Some("unelevated"),
|
||||
serde_json::Value::Null,
|
||||
Some(Unelevated),
|
||||
(true, true, false, true),
|
||||
),
|
||||
(
|
||||
Some("unelevated"),
|
||||
json!(["elevated"]),
|
||||
Some(Elevated),
|
||||
(true, false, true, true),
|
||||
),
|
||||
(
|
||||
None,
|
||||
json!(["unelevated", "elevated"]),
|
||||
Some(Elevated),
|
||||
(true, true, true, true),
|
||||
),
|
||||
(
|
||||
None,
|
||||
json!(["unelevated"]),
|
||||
Some(Unelevated),
|
||||
(false, true, false, true),
|
||||
),
|
||||
(
|
||||
Some("unelevated"),
|
||||
json!([]),
|
||||
None,
|
||||
(false, false, false, false),
|
||||
),
|
||||
(
|
||||
Some("mxc"),
|
||||
json!(["elevated"]),
|
||||
None,
|
||||
(true, false, false, true),
|
||||
),
|
||||
] {
|
||||
let config = serde_json::from_value(json!({
|
||||
"config": {
|
||||
"windows": {"sandbox": configured},
|
||||
"features": {"elevated_windows_sandbox": configured == Some("mxc")}
|
||||
},
|
||||
"origins": {}
|
||||
}))
|
||||
.unwrap();
|
||||
let requirements = serde_json::from_value(json!({
|
||||
"requirements": {"allowedWindowsSandboxImplementations": allowed}
|
||||
}))
|
||||
.unwrap();
|
||||
let state = WindowsSandboxConfig::from_responses(&config, requirements);
|
||||
assert_eq!(state.mode, mode);
|
||||
assert_eq!(
|
||||
(
|
||||
state.allows(Elevated),
|
||||
state.allows(Unelevated),
|
||||
state.requires_elevated(),
|
||||
state.is_enabled(),
|
||||
),
|
||||
expected
|
||||
);
|
||||
}
|
||||
for (key, mode) in [
|
||||
("elevated_windows_sandbox", Elevated),
|
||||
("experimental_windows_sandbox", Unelevated),
|
||||
("enable_experimental_windows_sandbox", Unelevated),
|
||||
] {
|
||||
for (explicit, expected) in [(None, mode), (Some("elevated"), Elevated)] {
|
||||
let config = serde_json::from_value(json!({
|
||||
"config": {"windows": {"sandbox": explicit}, "features": {key: true}},
|
||||
"origins": {}
|
||||
}))
|
||||
.unwrap();
|
||||
let requirements = serde_json::from_value(json!({"requirements": null})).unwrap();
|
||||
assert_eq!(
|
||||
WindowsSandboxConfig::from_responses(&config, requirements).mode,
|
||||
Some(expected)
|
||||
);
|
||||
}
|
||||
}
|
||||
let unknown = WindowsSandboxConfig::default();
|
||||
assert!(!unknown.allows(Elevated));
|
||||
assert!(!unknown.allows(Unelevated));
|
||||
}
|
||||
Reference in New Issue
Block a user