{"record":{"id":"2fcaad2a8b75de58","repo":"Hmbown/CodeWhale","slug":"allowlisted-read-only-executable-program-was-n","errorCode":null,"errorMessage":"allowlisted read-only executable {program:?} was not found at a canonical path outside the workspace","messagePattern":"allowlisted read-only executable (.+?) was not found at a canonical path outside the workspace","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/tools/shell.rs","lineNumber":3925,"sourceCode":"        for name in &names {\n            let candidate = directory.join(name);\n            if !candidate.is_file() {\n                continue;\n            }\n            #[cfg(unix)]\n            {\n                use std::os::unix::fs::PermissionsExt as _;\n                if candidate.metadata()?.permissions().mode() & 0o111 == 0 {\n                    continue;\n                }\n            }\n            let resolved = candidate.canonicalize()?;\n            if resolved.is_absolute() && !resolved.starts_with(&workspace) {\n                return Ok(resolved);\n            }\n        }\n    }\n    Err(anyhow!(\n        \"allowlisted read-only executable {program:?} was not found at a canonical path outside the workspace\"\n    ))\n}\n\nfn remove_readonly_redirect_env(cmd: &mut Command, env: &HashMap<String, String>) {\n    if env.get(READONLY_ENV_MARKER).map(String::as_str) != Some(\"1\") {\n        return;\n    }\n    cmd.env_remove(READONLY_ENV_MARKER);\n    let removals = cmd\n        .get_envs()\n        .filter_map(|(key, _)| {\n            let upper = key.to_string_lossy().to_ascii_uppercase();\n            let guarded = upper.starts_with(\"GIT_\")\n                || upper.starts_with(\"GH_\")\n                || upper.starts_with(\"GITHUB_\");\n            let safe = matches!(\n                upper.as_str(),","sourceCodeStart":3907,"sourceCodeEnd":3943,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/tools/shell.rs#L3907-L3943","documentation":"Terminal error from the allowlisted read-only executable resolver: every candidate binary matching the searched names was either missing, non-executable, or canonicalized to a path inside the workspace. The resolver walks trusted directories looking for a canonical path strictly outside the workspace root; failure means no safe external binary was found for the allowlisted program.","triggerScenarios":"Thrown at crates/tui/src/tools/shell.rs:3925 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install the {program} binary in a standard system directory (e.g. /usr/local/bin) with the executable bit set","Verify the binary is not only present inside the workspace — workspace-local copies are deliberately rejected","Check PATH-adjacent trusted directories the resolver scans actually contain the program"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0c42157ee52f9d55af2b506d71b46249910f77d3","analyzedAt":"2026-08-20T21:50:45.477Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}