{"record":{"id":"2fc1ac3f4d6758e9","repo":"Hmbown/CodeWhale","slug":"project-scope-config-must-not-be-a-symlink","errorCode":null,"errorMessage":"project-scope config must not be a symlink","messagePattern":"project-scope config must not be a symlink","errorType":"validation","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"crates/tui/src/lib.rs","lineNumber":9613,"sourceCode":"\n    if table.contains_key(\"instructions\") {\n        eprintln!(\n            \"warning: project-scope `instructions` is ignored — \\\n             configure instruction files from user config instead. \\\n             (See #417.)\"\n        );\n    }\n}\n\nfn read_project_config_file(path: &Path) -> io::Result<Option<String>> {\n    let metadata = match std::fs::symlink_metadata(path) {\n        Ok(metadata) => metadata,\n        Err(err) if err.kind() == io::ErrorKind::NotFound => return Ok(None),\n        Err(err) => return Err(err),\n    };\n    let file_type = metadata.file_type();\n    if file_type.is_symlink() {\n        return Err(io::Error::new(\n            io::ErrorKind::InvalidInput,\n            \"project-scope config must not be a symlink\",\n        ));\n    }\n    if !file_type.is_file() {\n        return Ok(None);\n    }\n\n    let mut file = open_project_config_file(path)?;\n    let mut raw = String::new();\n    file.read_to_string(&mut raw)?;\n    Ok(Some(raw))\n}\n\n#[cfg(unix)]\nfn open_project_config_file(path: &Path) -> io::Result<std::fs::File> {\n    use std::os::unix::fs::OpenOptionsExt;\n","sourceCodeStart":9595,"sourceCodeEnd":9631,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/0c42157ee52f9d55af2b506d71b46249910f77d3/crates/tui/src/lib.rs#L9595-L9631","documentation":"Symlink guard in read_project_config_file: symlink_metadata reports the project-scope config file is a symlink, so its contents are refused. Project config is security-sensitive and must be a regular file within the repo rather than a link that could redirect outside it.","triggerScenarios":"Thrown at crates/tui/src/lib.rs:9613 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Replace the symlink with a regular file containing the intended config.","Commit the real config file rather than a link so project-scope settings load.","Check checkout/tooling behavior that converted the config into a symlink."],"exampleFix":null,"handlingStrategy":"validation","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"}