{"record":{"id":"50445b95fb26d170","repo":"zeroclaw-labs/zeroclaw","slug":"refusing-to-write-outside-the-ftl-data-directory","errorCode":null,"errorMessage":"refusing to write outside the FTL data directory","messagePattern":"refusing to write outside the FTL data directory","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/main.rs","lineNumber":3355,"sourceCode":"                        bail!(\"unknown catalog '{name}'; valid: {valid}\");\n                    }\n                }\n            }\n            out\n        }\n    };\n\n    let dest = zeroclaw_config::schema::ftl_locale_dir(&locale)?;\n    std::fs::create_dir_all(&dest).with_context(|| format!(\"creating {}\", dest.display()))?;\n    // Confinement check: the resolved dest must live under the data-dir FTL root.\n    let ftl_root = dest\n        .parent()\n        .map(Path::to_path_buf)\n        .unwrap_or_else(|| dest.clone());\n    let canon_dest = std::fs::canonicalize(&dest).unwrap_or_else(|_| dest.clone());\n    let canon_root = std::fs::canonicalize(&ftl_root).unwrap_or(ftl_root);\n    if !canon_dest.starts_with(&canon_root) {\n        bail!(\"refusing to write outside the FTL data directory\");\n    }\n\n    // Prefer the tag matching this binary; fall back to master.\n    let version = env!(\"CARGO_PKG_VERSION\");\n    let refs = [format!(\"v{version}\"), \"master\".to_string()];\n    let client = reqwest::Client::new();\n    let mut fetched = 0u32;\n\n    for (name, path_tmpl, out_name) in selected {\n        let repo_path = path_tmpl.replace(\"{locale}\", &locale);\n        let mut body: Option<String> = None;\n        for git_ref in &refs {\n            let url = format!(\n                \"https://raw.githubusercontent.com/zeroclaw-labs/zeroclaw/{git_ref}/{repo_path}\"\n            );\n            let resp = client.get(&url).send().await?;\n            if resp.status().is_success() {\n                body = Some(resp.text().await?);","sourceCodeStart":3337,"sourceCodeEnd":3373,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/src/main.rs#L3337-L3373","documentation":"Error \"refusing to write outside the FTL data directory\" thrown in zeroclaw-labs/zeroclaw.","triggerScenarios":"Thrown at src/main.rs:3355 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Write FTL files only inside the designated FTL data directory.","Change the output path to a location within the FTL data directory and retry."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}