{"record":{"id":"730c99e826f3312b","repo":"BigPizzaV3/CodexPlusPlus","slug":"manifest-files-license-txt","errorCode":null,"errorMessage":"manifest.files 的 LICENSE.txt 与包内容不一致","messagePattern":"manifest\\.files 的 LICENSE\\.txt 与包内容不一致","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_package.rs","lineNumber":1140,"sourceCode":"            \"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\n        && value.len() <= 32\n        && parts.iter().all(|part| {\n            !part.is_empty()","sourceCodeStart":1122,"sourceCodeEnd":1158,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_package.rs#L1122-L1158","documentation":"Thrown by validate_manifest_files when a LICENSE.txt entry is declared in manifest.files but its recorded hash/size does not match the LICENSE.txt bytes actually present in the package. The offending input is the LICENSE.txt manifest entry vs. the extracted license content; the declared and actual license text disagree.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_package.rs:1140 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["修改 LICENSE.txt 后同步更新 manifest 中的大小与 SHA-256","或从 files 清单中移除 LICENSE.txt 条目"],"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"}