{"record":{"id":"3cd7716dd42df7c9","repo":"BigPizzaV3/CodexPlusPlus","slug":"manifest-files-3cd771","errorCode":null,"errorMessage":"manifest.files 缺少必需文件","messagePattern":"manifest\\.files 缺少必需文件","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_package.rs","lineNumber":1137,"sourceCode":"        let expected_media_type = match file.path.as_str() {\n            \"theme.json\" => \"application/json\",\n            \"theme.css\" => \"text/css\",\n            \"background.webp\" => \"image/webp\",\n            \"background.jpg\" => \"image/jpeg\",\n            \"background.png\" => \"image/png\",\n            \"LICENSE.txt\" => \"text/plain\",\n            _ => \"\",\n        };\n        if file.media_type != expected_media_type {\n            bail!(\"manifest.files 的 mediaType 不匹配：{}\", file.path);\n        }\n        let actual = format!(\"{:x}\", Sha256::digest(bytes));\n        if file.bytes != bytes.len() || !actual.eq_ignore_ascii_case(&file.sha256) {\n            bail!(\"manifest.files 的 SHA-256 或大小不匹配：{}\", file.path);\n        }\n    }\n    if !seen.contains(\"theme.json\") || !seen.contains(\"theme.css\") || !seen.contains(image_name) {\n        bail!(\"manifest.files 缺少必需文件\");\n    }\n    if seen.contains(\"LICENSE.txt\") != license_bytes.is_some() {\n        bail!(\"manifest.files 的 LICENSE.txt 与包内容不一致\");\n    }\n    Ok(())\n}\n\nfn valid_theme_id(value: &str) -> bool {\n    let mut chars = value.chars();\n    chars.next().is_some_and(|c| c.is_ascii_alphanumeric())\n        && value\n            .chars()\n            .all(|c| c.is_ascii_lowercase() || c.is_ascii_digit() || matches!(c, '-' | '.'))\n}\n\nfn valid_semver(value: &str) -> bool {\n    let parts = value.split('.').collect::<Vec<_>>();\n    parts.len() == 3","sourceCodeStart":1119,"sourceCodeEnd":1155,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_package.rs#L1119-L1155","documentation":"Thrown by validate_manifest_files after the per-file loop when the seen-paths set is missing one of the mandatory package files (theme.json, theme.css, or the background image). The offending input is manifest.files as a whole: the inventory may be internally consistent but incomplete, so the package cannot be installed.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_package.rs:1137 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["在 files 中补全所有必需文件的条目（路径、大小、SHA-256、mediaType）"],"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"}