feat: schema tracking, SHA256 integrity, identity UUID fix, 3-angle face match, cuts table, trace stranger_id
This commit is contained in:
@@ -82,14 +82,14 @@ fn load_checksums(scripts_dir: &PathBuf) -> HashMap<String, String> {
|
||||
}
|
||||
|
||||
pub fn validate_python_env() -> Result<()> {
|
||||
let manifest = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
||||
let venv_python = manifest.join("venv").join("bin").join("python");
|
||||
let python_path = std::env::var("MOMENTRY_PYTHON_PATH")
|
||||
.unwrap_or_else(|_| "/opt/homebrew/bin/python3.11".to_string());
|
||||
let venv_python = PathBuf::from(&python_path);
|
||||
|
||||
if !venv_python.exists() {
|
||||
anyhow::bail!(
|
||||
"Python venv not found at {:?}\n\
|
||||
Run: /opt/homebrew/bin/python3.11 -m venv venv",
|
||||
venv_python
|
||||
"Python not found at {} (set MOMENTRY_PYTHON_PATH env var)",
|
||||
python_path
|
||||
);
|
||||
}
|
||||
|
||||
@@ -109,9 +109,14 @@ pub fn validate_python_env() -> Result<()> {
|
||||
tracing::warn!("Expected Python 3.11, got: {}", version.trim());
|
||||
}
|
||||
|
||||
let script_path = manifest.join("scripts");
|
||||
let scripts_dir = std::env::var("MOMENTRY_SCRIPTS_DIR")
|
||||
.unwrap_or_else(|_| {
|
||||
let manifest = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
||||
manifest.join("scripts").to_string_lossy().to_string()
|
||||
});
|
||||
let script_path = PathBuf::from(&scripts_dir);
|
||||
if !script_path.exists() {
|
||||
anyhow::bail!("Scripts directory not found at {:?}", script_path);
|
||||
anyhow::bail!("Scripts directory not found at {}", scripts_dir);
|
||||
}
|
||||
|
||||
tracing::info!("Python environment validated successfully");
|
||||
@@ -126,27 +131,37 @@ pub struct PythonExecutor {
|
||||
|
||||
impl PythonExecutor {
|
||||
pub fn new() -> Result<Self> {
|
||||
let manifest = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
||||
let venv_python = manifest.join("venv").join("bin").join("python");
|
||||
let scripts_dir = manifest.join("scripts");
|
||||
let python_path = std::env::var("MOMENTRY_PYTHON_PATH")
|
||||
.unwrap_or_else(|_| "/opt/homebrew/bin/python3.11".to_string());
|
||||
let scripts_dir = std::env::var("MOMENTRY_SCRIPTS_DIR")
|
||||
.unwrap_or_else(|_| {
|
||||
let manifest = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
||||
manifest.join("scripts").to_string_lossy().to_string()
|
||||
});
|
||||
|
||||
let venv_python = PathBuf::from(&python_path);
|
||||
let scripts_path = PathBuf::from(&scripts_dir);
|
||||
|
||||
if !venv_python.exists() {
|
||||
anyhow::bail!(
|
||||
"Python venv not found at {:?}. Run: /opt/homebrew/bin/python3.11 -m venv venv",
|
||||
venv_python
|
||||
"Python not found at {} (set MOMENTRY_PYTHON_PATH env var)",
|
||||
python_path
|
||||
);
|
||||
}
|
||||
|
||||
if !scripts_dir.exists() {
|
||||
anyhow::bail!("Scripts directory not found at {:?}", scripts_dir);
|
||||
if !scripts_path.exists() {
|
||||
anyhow::bail!(
|
||||
"Scripts directory not found at {} (set MOMENTRY_SCRIPTS_DIR env var)",
|
||||
scripts_dir
|
||||
);
|
||||
}
|
||||
|
||||
// Load SHA256 checksums manifest
|
||||
let checksums = load_checksums(&scripts_dir);
|
||||
let checksums = load_checksums(&scripts_path);
|
||||
|
||||
Ok(Self {
|
||||
venv_python,
|
||||
scripts_dir,
|
||||
scripts_dir: scripts_path,
|
||||
checksums,
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user