{"record":{"id":"18d08cd5a222fc21","repo":"BigPizzaV3/CodexPlusPlus","slug":"manifest-platforms","errorCode":null,"errorMessage":"manifest.platforms 无效","messagePattern":"manifest\\.platforms 无效","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_package.rs","lineNumber":934,"sourceCode":"    }\n    if !valid_semver(&manifest.version) || !valid_semver(&manifest.min_client_version) {\n        bail!(\"manifest 版本号无效\");\n    }\n    if compare_semver(&manifest.min_client_version, \"1.5.12\").is_gt() {\n        bail!(\n            \"主题包需要更新版本的 Dream Skin 协议：{}\",\n            manifest.min_client_version\n        );\n    }\n    if manifest.platforms.is_empty()\n        || manifest.platforms.len() > 2\n        || has_duplicates(&manifest.platforms)\n        || manifest\n            .platforms\n            .iter()\n            .any(|item| !matches!(item.as_str(), \"macos\" | \"windows\"))\n    {\n        bail!(\"manifest.platforms 无效\");\n    }\n    if !manifest.platforms.iter().any(|item| item == platform) {\n        bail!(\"主题包不支持当前平台：{platform}\");\n    }\n    if manifest.capabilities.is_empty()\n        || manifest.capabilities.len() > 3\n        || has_duplicates(&manifest.capabilities)\n        || manifest\n            .capabilities\n            .iter()\n            .any(|item| !matches!(item.as_str(), \"background\" | \"tokens\" | \"safe-css\"))\n        || !manifest.capabilities.iter().any(|item| item == \"safe-css\")\n    {\n        bail!(\"manifest.capabilities 无效或缺少 safe-css 能力\");\n    }\n    if !safe_manifest_text(&manifest.publisher.display_name, 1, 80, false)\n        || manifest.publisher.id.is_empty()\n        || manifest.publisher.id.len() > 64","sourceCodeStart":916,"sourceCodeEnd":952,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_package.rs#L916-L952","documentation":"Thrown by validate_manifest when the platforms array is empty, has more than 2 entries, contains duplicates, or lists anything other than \"macos\"/\"windows\". The offending input is manifest.platforms; this shape guard ensures the platform whitelist is well-formed before the current-platform containment check that follows.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_package.rs:934 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["把 platforms 改为 [\"macos\"]、[\"windows\"] 或两者组合，无重复"],"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"}