{"record":{"id":"6fffbf214c0f9e47","repo":"openai/codex","slug":"project-layers-are-not-ordered-from-root-to-cwd","errorCode":null,"errorMessage":"project layers are not ordered from root to cwd","messagePattern":"project layers are not ordered from root to cwd","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"codex-rs/config/src/state.rs","lineNumber":558,"sourceCode":"    for layer in layers {\n        if let ConfigLayerSource::Project {\n            dot_codex_folder: current_project_dot_codex_folder,\n        } = &layer.name\n        {\n            if let Some(previous) = previous_project_dot_codex_folder {\n                let Some(parent) = previous.as_path().parent() else {\n                    return Err(std::io::Error::new(\n                        std::io::ErrorKind::InvalidData,\n                        \"project layer has no parent directory\",\n                    ));\n                };\n                if previous == current_project_dot_codex_folder\n                    || !current_project_dot_codex_folder\n                        .as_path()\n                        .ancestors()\n                        .any(|ancestor| ancestor == parent)\n                {\n                    return Err(std::io::Error::new(\n                        std::io::ErrorKind::InvalidData,\n                        \"project layers are not ordered from root to cwd\",\n                    ));\n                }\n            }\n            previous_project_dot_codex_folder = Some(current_project_dot_codex_folder);\n        }\n    }\n\n    Ok(())\n}\n\n#[cfg(test)]\n#[path = \"state_tests.rs\"]\nmod tests;\n","sourceCodeStart":540,"sourceCodeEnd":574,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/config/src/state.rs#L540-L574","documentation":"Error \"project layers are not ordered from root to cwd\" thrown in openai/codex.","triggerScenarios":"Thrown at codex-rs/config/src/state.rs:558 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Order the project config layers from filesystem root down to the current working directory."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","schemaVersion":2},"datasetVersion":"2026-08-25T06:17:31.827Z"}