Files
imeai-aKode/akode-rs/windows-sandbox-rs/src/setup_acl_error.rs
andrea.difonzo 7c1c6dfa8d 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>
2026-11-17 12:37:52 +01:00

44 lines
1.3 KiB
Rust

//! Preserve native ACL failure causes in both refresh summaries and setup logs.
//! Recording a diagnostic never changes whether a failed ACL operation is fatal.
use anyhow::Error;
use anyhow::Result;
use std::path::Path;
pub(crate) enum WriteAclOperation {
Check,
Grant,
Deny,
}
pub(crate) fn record_acl_failure(
errors: &mut Vec<String>,
operation: WriteAclOperation,
path: &Path,
error: &Error,
write_log: impl FnOnce(&str) -> Result<()>,
) -> Result<()> {
let detail = format!("{}: {error:#}", path.display());
let (summary, log) = match operation {
WriteAclOperation::Check => (
format!("write ACE check failed on {detail}"),
format!("write ACE check failed on {detail}; continuing"),
),
WriteAclOperation::Grant => (
format!("write ACE failed on {detail}"),
format!("write ACE grant failed on {detail}"),
),
WriteAclOperation::Deny => (
format!("deny ACE failed on {detail}"),
format!("deny ACE failed on {detail}"),
),
};
// Retain the ACL failure even if writing its individual log line fails.
errors.push(summary);
write_log(&log)
}
#[cfg(test)]
#[path = "setup_acl_error_tests.rs"]
mod tests;