{"record":{"id":"98698a2f4537230b","repo":"BigPizzaV3/CodexPlusPlus","slug":"manifest-files-98698a","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":1108,"sourceCode":"    css_bytes: &[u8],\n    image_name: &str,\n    image_bytes: &[u8],\n    license_bytes: Option<&[u8]>,\n) -> anyhow::Result<()> {\n    let mut seen = HashSet::new();\n    for file in &manifest.files {\n        if !seen.insert(file.path.as_str())\n            || !ALLOWED_FILES.contains(&file.path.as_str())\n            || matches!(file.path.as_str(), \"manifest.json\" | \"manifest.sig\")\n            || file.bytes == 0\n            || file.bytes > file_limit(&file.path)\n            || file.sha256.len() != 64\n            || !file\n                .sha256\n                .bytes()\n                .all(|b| b.is_ascii_digit() || (b'a'..=b'f').contains(&b))\n        {\n            bail!(\"manifest.files 包含无效条目\");\n        }\n        let bytes = match file.path.as_str() {\n            \"manifest.json\" => manifest_bytes,\n            \"theme.json\" => theme_bytes,\n            \"theme.css\" => css_bytes,\n            path if path == image_name => image_bytes,\n            \"LICENSE.txt\" => license_bytes.context(\"manifest 声明了 LICENSE.txt 但包内缺失\")?,\n            \"manifest.sig\" => continue,\n            _ => continue,\n        };\n        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            _ => \"\",","sourceCodeStart":1090,"sourceCodeEnd":1126,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_package.rs#L1090-L1126","documentation":"Thrown by validate_manifest_files when a manifest.files entry fails its structural whitelist: duplicate path, path outside ALLOWED_FILES, a reserved manifest.json/manifest.sig entry declared in files, zero bytes, size above file_limit(path), or a sha256 that is not 64 hex chars. The offending input is the individual manifest.files entry being iterated; this is the inventory sanity pass before content hashing.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_package.rs:1108 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["删除重复或非法路径条目","把 bytes 改为真实文件大小","用小写 64 位十六进制 SHA-256 重新计算"],"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"}