aKode fase 5: test e snapshot adeguati alla rinomina, 429 distinto (ProviderRateLimited), cargo fmt dopo il cambio dei prefissi

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-11 12:47:01 +01:00
parent 8b73331037
commit ad43f9281a
919 changed files with 2358 additions and 2430 deletions

View File

@@ -14,8 +14,6 @@ mod cwd_junction;
#[path = "win/input_loop_tests.rs"]
mod input_loop_tests;
use anyhow::Context;
use anyhow::Result;
use akode_utils_pty::JobObject;
use akode_windows_sandbox::ConsoleMode;
use akode_windows_sandbox::ErrorPayload;
@@ -49,6 +47,8 @@ use akode_windows_sandbox::spawn_process_with_pipes;
use akode_windows_sandbox::to_wide;
use akode_windows_sandbox::token_mode_for_permission_profile;
use akode_windows_sandbox::write_frame;
use anyhow::Context;
use anyhow::Result;
use std::ffi::OsStr;
use std::fs::File;
use std::os::windows::io::AsHandle;

View File

@@ -6,8 +6,8 @@ use std::sync::Arc;
use std::sync::Mutex;
use std::time::Duration;
use anyhow::Context;
use akode_utils_pty::JobObject;
use anyhow::Context;
use tokio::io::AsyncBufReadExt;
use tokio::io::BufReader;
use tokio::process::Command;

View File

@@ -11,11 +11,11 @@ use crate::proc_thread_attr::ProcThreadAttributeList;
use crate::winutil::format_last_error;
use crate::winutil::quote_windows_arg;
use crate::winutil::to_wide;
use anyhow::Context;
use anyhow::Result;
use akode_utils_pty::JobObject;
use akode_utils_pty::PsuedoCon;
use akode_utils_pty::RawConPty;
use anyhow::Context;
use anyhow::Result;
use std::collections::HashMap;
use std::ffi::c_void;
use std::os::windows::io::AsRawHandle;

View File

@@ -7,10 +7,10 @@ use crate::setup::SandboxSetupRequest;
use crate::setup::SetupRootOverrides;
use crate::spawn_prep::legacy_session_capability_roots;
use crate::spawn_prep::prepare_legacy_session_security;
use anyhow::Result;
use akode_protocol::models::PermissionProfile;
use akode_protocol::permissions::NetworkSandboxPolicy;
use akode_utils_absolute_path::AbsolutePathBuf;
use anyhow::Result;
use pretty_assertions::assert_eq;
use rand::Rng;
use rand::SeedableRng;

View File

@@ -7,11 +7,11 @@
//! not use this protocol, and non‑unified exec capture uses it only when running
//! through the elevated runner.
use akode_protocol::models::PermissionProfile;
use akode_utils_absolute_path::AbsolutePathBuf;
use anyhow::Result;
use base64::Engine as _;
use base64::engine::general_purpose::STANDARD;
use akode_protocol::models::PermissionProfile;
use akode_utils_absolute_path::AbsolutePathBuf;
use serde::Deserialize;
use serde::Serialize;
use std::collections::HashMap;

View File

@@ -50,8 +50,8 @@ mod windows_impl {
use crate::sandbox_utils::inject_git_safe_directory;
use crate::setup::effective_write_roots_for_permissions;
use crate::token::LocalSid;
use anyhow::Result;
use akode_utils_absolute_path::AbsolutePathBuf;
use anyhow::Result;
use std::fs::File;
use std::path::Path;
use std::path::PathBuf;

View File

@@ -21,10 +21,10 @@ use crate::setup::SandboxUsersFile;
use crate::setup::SetupMarker;
use crate::setup::sandbox_users_path;
use crate::setup::setup_marker_path;
use akode_protocol::models::PermissionProfile;
use anyhow::Result;
use base64::Engine;
use base64::engine::general_purpose::STANDARD as BASE64;
use akode_protocol::models::PermissionProfile;
use pretty_assertions::assert_eq;
use std::cell::Cell;
use std::collections::HashMap;

View File

@@ -565,9 +565,9 @@ mod windows_impl {
use super::spawn_prep::prepare_legacy_session_security;
use super::spawn_prep::prepare_legacy_spawn_context;
use super::spawn_prep::root_capability_sids;
use anyhow::Result;
use akode_protocol::models::PermissionProfile;
use akode_utils_absolute_path::AbsolutePathBuf;
use anyhow::Result;
use std::collections::HashMap;
use std::io;
use std::path::Path;
@@ -1043,10 +1043,10 @@ mod windows_impl {
#[cfg(not(target_os = "windows"))]
mod stub {
use super::WindowsSandboxCancellationToken;
use anyhow::Result;
use anyhow::bail;
use akode_protocol::models::PermissionProfile;
use akode_utils_absolute_path::AbsolutePathBuf;
use anyhow::Result;
use anyhow::bail;
use std::collections::HashMap;
use std::path::Path;

View File

@@ -4,10 +4,10 @@ use crate::proc_thread_attr::ProcThreadAttributeList;
use crate::winutil::argv_to_command_line;
use crate::winutil::format_last_error;
use crate::winutil::to_wide;
use akode_utils_pty::JobObject;
use anyhow::Context;
use anyhow::Result;
use anyhow::anyhow;
use akode_utils_pty::JobObject;
use std::collections::HashMap;
use std::ffi::c_void;
use std::os::windows::io::AsRawHandle;

View File

@@ -14,12 +14,12 @@ use std::ptr;
use std::time::Duration;
use std::time::Instant;
use anyhow::Context;
use anyhow::anyhow;
use anyhow::bail;
use akode_protocol::models::PermissionProfile;
use akode_protocol::shell_environment::OPENAI_FEDERATION_RULE_ID_ENV_VAR;
use akode_protocol::shell_environment::OPENAI_IDENTITY_TOKEN_FILE_ENV_VAR;
use anyhow::Context;
use anyhow::anyhow;
use anyhow::bail;
use windows_sys::Win32::Foundation::ERROR_BROKEN_PIPE;
use windows_sys::Win32::Foundation::ERROR_FILE_NOT_FOUND;
use windows_sys::Win32::Foundation::ERROR_NO_DATA;

View File

@@ -4,9 +4,9 @@ use super::WindowsSandboxProvisioningOutcome;
use super::provision_windows_sandbox_via_service;
use crate::WindowsSandboxProvisioningSettings;
use crate::WindowsSandboxProxyListeners;
use anyhow::Result;
use akode_protocol::shell_environment::OPENAI_FEDERATION_RULE_ID_ENV_VAR;
use akode_protocol::shell_environment::OPENAI_IDENTITY_TOKEN_FILE_ENV_VAR;
use anyhow::Result;
use pretty_assertions::assert_eq;
use std::ffi::OsString;
use std::os::windows::ffi::OsStringExt;

View File

@@ -1,4 +1,3 @@
use anyhow::Result;
use akode_protocol::models::PermissionProfile;
use akode_protocol::permissions::FileSystemPath;
use akode_protocol::permissions::FileSystemSandboxEntry;
@@ -8,6 +7,7 @@ use akode_protocol::permissions::FileSystemSpecialPath::Root;
use akode_protocol::permissions::NetworkSandboxPolicy;
use akode_protocol::permissions::ReadDenyMatcher;
use akode_utils_absolute_path::AbsolutePathBuf;
use anyhow::Result;
use std::collections::HashMap;
use std::path::Path;
use std::path::PathBuf;

View File

@@ -35,12 +35,12 @@ use crate::setup_error::extract_failure;
use crate::setup_error::failure;
use crate::setup_error::read_setup_error_report;
use crate::ssh_config_dependencies::ssh_config_dependency_paths;
use akode_protocol::models::PermissionProfile;
use akode_utils_absolute_path::AbsolutePathBuf;
use anyhow::Result;
use anyhow::anyhow;
use base64::Engine;
use base64::engine::general_purpose::STANDARD as BASE64_STANDARD;
use akode_protocol::models::PermissionProfile;
use akode_utils_absolute_path::AbsolutePathBuf;
use windows_sys::Win32::Foundation::CloseHandle;
use windows_sys::Win32::Foundation::GetLastError;

View File

@@ -1,6 +1,6 @@
use akode_utils_string::sanitize_metric_tag_value;
use anyhow::Context;
use anyhow::Result;
use akode_utils_string::sanitize_metric_tag_value;
use serde::Deserialize;
use serde::Serialize;
use std::fs;

View File

@@ -30,10 +30,10 @@ use crate::token::get_logon_sid_bytes;
use crate::workspace_acl::is_command_cwd_root;
use crate::workspace_acl::protect_workspace_agents_dir;
use crate::workspace_acl::protect_workspace_codex_dir;
use anyhow::Context;
use anyhow::Result;
use akode_protocol::models::PermissionProfile;
use akode_utils_absolute_path::AbsolutePathBuf;
use anyhow::Context;
use anyhow::Result;
use std::collections::HashMap;
use std::ffi::c_void;
use std::path::Path;

View File

@@ -16,11 +16,11 @@ use crate::runner_client::RunnerTransport;
use crate::runner_client::retry_runner_spawn_once;
use crate::runner_client::spawn_runner_transport;
use crate::spawn_prep::prepare_elevated_spawn_context_for_permissions;
use anyhow::Result;
use akode_protocol::models::PermissionProfile;
use akode_utils_absolute_path::AbsolutePathBuf;
use akode_utils_pty::ProcessDriver;
use akode_utils_pty::SpawnedProcess;
use anyhow::Result;
use std::collections::HashMap;
use std::path::Path;
use std::path::PathBuf;

View File

@@ -19,7 +19,6 @@ use crate::spawn_prep::apply_legacy_session_acl_rules;
use crate::spawn_prep::legacy_session_capability_roots;
use crate::spawn_prep::prepare_legacy_session_security;
use crate::spawn_prep::prepare_legacy_spawn_context;
use anyhow::Result;
use akode_protocol::models::PermissionProfile;
use akode_utils_absolute_path::AbsolutePathBuf;
use akode_utils_pty::JobObject;
@@ -27,6 +26,7 @@ use akode_utils_pty::ProcessDriver;
use akode_utils_pty::SpawnedProcess;
use akode_utils_pty::TerminalSize;
use akode_utils_pty::WindowsTtyInputNormalizer;
use anyhow::Result;
use std::collections::HashMap;
use std::os::windows::io::AsRawHandle;
use std::os::windows::io::BorrowedHandle;

View File

@@ -7,12 +7,12 @@ use crate::ipc_framed::ResizePayload;
use crate::ipc_framed::StdinPayload;
use crate::ipc_framed::decode_bytes;
use crate::ipc_framed::encode_bytes;
use anyhow::Result;
use akode_utils_pty::ProcessDriver;
use akode_utils_pty::SpawnedProcess;
use akode_utils_pty::TerminalSize;
use akode_utils_pty::WindowsTtyInputNormalizer;
use akode_utils_pty::spawn_from_driver;
use anyhow::Result;
use std::fs::File;
use tokio::sync::broadcast;
use tokio::sync::mpsc;

View File

@@ -9,12 +9,12 @@
mod backends;
use anyhow::Result;
use anyhow::bail;
use akode_protocol::config_types::WindowsSandboxLevel;
use akode_protocol::models::PermissionProfile;
use akode_utils_absolute_path::AbsolutePathBuf;
use akode_utils_pty::SpawnedProcess;
use anyhow::Result;
use anyhow::bail;
use std::collections::HashMap;
use std::path::Path;
use std::path::PathBuf;

View File

@@ -9,14 +9,14 @@ use crate::ipc_framed::Message;
use crate::ipc_framed::decode_bytes;
use crate::ipc_framed::read_frame;
use crate::run_windows_sandbox_capture;
use base64::Engine;
use base64::engine::general_purpose::STANDARD as BASE64;
use akode_protocol::config_types::WindowsSandboxLevel;
use akode_protocol::models::PermissionProfile;
use akode_utils_absolute_path::AbsolutePathBuf;
use akode_utils_pty::ProcessDriver;
use akode_utils_pty::ProcessSignal;
use akode_windows_sandbox_test_support::WindowsSandboxAccountTestGuard;
use base64::Engine;
use base64::engine::general_purpose::STANDARD as BASE64;
use pretty_assertions::assert_eq;
use std::collections::HashMap;
use std::fs;

View File

@@ -21,13 +21,13 @@ use crate::spawn_prep::prepare_legacy_session_security;
use crate::spawn_prep::prepare_legacy_spawn_context;
use crate::spawn_prep::prepare_spawn_context_common;
use crate::spawn_prep::root_capability_sids;
use akode_protocol::config_types::WindowsSandboxLevel;
use akode_protocol::models::PermissionProfile;
use akode_utils_absolute_path::AbsolutePathBuf;
use anyhow::Context;
use anyhow::Result;
use anyhow::anyhow;
use anyhow::bail;
use akode_protocol::config_types::WindowsSandboxLevel;
use akode_protocol::models::PermissionProfile;
use akode_utils_absolute_path::AbsolutePathBuf;
use windows_sys::Win32::Foundation::CloseHandle;
pub const AKODE_WINDOWS_SANDBOX_ARG1: &str = "--run-as-windows-sandbox";

View File

@@ -1,8 +1,8 @@
#![cfg(target_os = "windows")]
use akode_utils_cargo_bin::cargo_bin;
use anyhow::Context;
use anyhow::Result;
use akode_utils_cargo_bin::cargo_bin;
use std::io;
use std::os::windows::ffi::OsStrExt;
use windows_sys::Win32::Foundation::FreeLibrary;