aKode fase 5: rinomina interna (crate akode-*, akode-rs/, akode-cli/, binario akode, AKODE_*, ~/.akode, snapshot)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
andrea.difonzo
2026-11-11 11:06:46 +01:00
parent df99318392
commit 86e7c72e5f
10383 changed files with 749164 additions and 749170 deletions

View File

@@ -0,0 +1,28 @@
//! Resolves the host's symlink opt-out from its already-loaded user config.
use crate::ConfigLayerSource;
use crate::ConfigLayerStack;
use akode_utils_absolute_path::AbsolutePathBuf;
/// Returns the opted-in home without consulting project config or rereading config files.
pub fn allowed_symlinked_codex_home(
config_layer_stack: &ConfigLayerStack,
codex_home: &AbsolutePathBuf,
) -> Option<AbsolutePathBuf> {
let enabled = config_layer_stack
.layers_low_to_high()
.find(|layer| matches!(layer.name, ConfigLayerSource::User { profile: None, .. }))?
.config
.get("allow_symlinked_codex_home")?
.as_bool()?;
if !enabled {
return None;
}
// Preserve a configured alias only when lexical normalization did not change its target.
let alias = std::env::var_os("AKODE_HOME")
.filter(|path| !path.is_empty())
.and_then(|path| AbsolutePathBuf::from_absolute_path(path).ok())
.filter(|path| path.canonicalize().ok().as_ref() == Some(codex_home));
Some(alias.unwrap_or_else(|| codex_home.clone()))
}