{"record":{"id":"6429acbe711805be","repo":"BigPizzaV3/CodexPlusPlus","slug":"error-6429ac","errorCode":null,"errorMessage":"主题包只能包含唯一一层主题目录","messagePattern":"主题包只能包含唯一一层主题目录","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_package.rs","lineNumber":862,"sourceCode":"    let prefix = if root_files {\n        if content_entries.iter().any(|(name, _)| name.contains('/')) {\n            bail!(\"主题包文件必须全部位于根目录或唯一一层主题目录\");\n        }\n        None\n    } else {\n        let prefix = content_entries[0]\n            .0\n            .split_once('/')\n            .map(|(prefix, _)| prefix)\n            .context(\"主题包顶级目录无效\")?;\n        if prefix.is_empty()\n            || content_entries.iter().any(|(name, _)| {\n                name.split_once('/').is_none_or(|(candidate, file)| {\n                    candidate != prefix || file.is_empty() || file.contains('/')\n                })\n            })\n        {\n            bail!(\"主题包只能包含唯一一层主题目录\");\n        }\n        Some(format!(\"{prefix}/\"))\n    };\n\n    let mut files = std::collections::BTreeMap::new();\n    for (name, content) in content_entries {\n        let normalized = prefix\n            .as_deref()\n            .and_then(|prefix| name.strip_prefix(prefix))\n            .unwrap_or(&name)\n            .to_string();\n        if files.insert(normalized.clone(), content).is_some() {\n            bail!(\"主题包包含重复文件：{normalized}\");\n        }\n    }\n    Ok(files)\n}\n","sourceCodeStart":844,"sourceCodeEnd":880,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_package.rs#L844-L880","documentation":"Layout guard in normalize_package_entries: entries live under directories but not a single consistent one — either the derived prefix is empty, some entries lack the prefix, or a file sits deeper than one level below it. Only one flat top-level theme directory is allowed.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_package.rs:862 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Put every file inside one named theme directory, one level deep","Remove extra nesting levels and unrelated top-level folders"],"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-14T00:17:10.932Z"}