{"record":{"id":"4d2fc91936d3c115","repo":"BigPizzaV3/CodexPlusPlus","slug":"dream-skin-theme-directory-contains-unknown-entry","errorCode":null,"errorMessage":"Dream Skin theme directory contains unknown entry: {name}","messagePattern":"Dream Skin theme directory contains unknown entry: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_library.rs","lineNumber":639,"sourceCode":"    Ok(())\n}\n\nfn ensure_known_theme_directory(directory: &Path) -> anyhow::Result<()> {\n    for entry in std::fs::read_dir(directory)? {\n        let path = entry?.path();\n        let name = path\n            .file_name()\n            .and_then(|value| value.to_str())\n            .unwrap_or(\"\");\n        let metadata = std::fs::symlink_metadata(&path)?;\n        let known = metadata.file_type().is_file()\n            && !metadata.file_type().is_symlink()\n            && (name == THEME_CONFIG_FILE\n                || name == \".dream-skin-import.jpg\"\n                || (name.starts_with(\"image.\") && supported_image_extension(&path))\n                || matches!(name, \"theme.css\" | \"manifest.json\" | \"LICENSE.txt\"));\n        if !known {\n            bail!(\"Dream Skin theme directory contains unknown entry: {name}\");\n        }\n    }\n    Ok(())\n}\n\nfn remove_known_theme_directory(directory: &Path) -> anyhow::Result<()> {\n    if !directory.exists() {\n        return Ok(());\n    }\n    ensure_known_theme_directory(directory)?;\n    for entry in std::fs::read_dir(directory)? {\n        let path = entry?.path();\n        std::fs::remove_file(&path)\n            .with_context(|| format!(\"failed to remove {}\", path.display()))?;\n    }\n    std::fs::remove_dir(directory)\n        .with_context(|| format!(\"failed to remove {}\", directory.display()))?;\n    Ok(())","sourceCodeStart":621,"sourceCodeEnd":657,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_library.rs#L621-L657","documentation":"Security guard in ensure_known_theme_directory: a theme directory may only contain the config file, the import image, and image.* files with supported extensions. Any other entry (unexpected file, directory, or symlink) triggers this error, protecting replace/remove operations from touching unknown content.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_library.rs:639 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the theme directory and remove the unrecognized entry manually","Reinstall or re-import the theme so its directory is recreated cleanly"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f2074595a281bc057525c748175c8eb9805b0673","analyzedAt":"2026-08-23T12:52:24.489Z","contentChangedAt":"2026-08-23T12:52:24.489Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}