{"record":{"id":"f0febdba7403b69a","repo":"BigPizzaV3/CodexPlusPlus","slug":"error-f0febd","errorCode":null,"errorMessage":"市场主题配置与清单身份不一致","messagePattern":"市场主题配置与清单身份不一致","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_market.rs","lineNumber":137,"sourceCode":") -> anyhow::Result<DreamSkinThemeSummary> {\n    install_market_theme_from_base(state_dir, theme, DEFAULT_MARKET_RAW_BASE_URL).await\n}\n\npub async fn install_market_theme_from_base(\n    state_dir: &Path,\n    theme: &DreamSkinMarketTheme,\n    raw_base_url: &str,\n) -> anyhow::Result<DreamSkinThemeSummary> {\n    validate_market_theme(theme)?;\n    let client = market_http_client()?;\n    let theme_url = market_asset_url(raw_base_url, &theme.theme)?;\n    let image_url = market_asset_url(raw_base_url, &theme.image)?;\n    let theme_bytes = download_limited(&client, &theme_url, MARKET_THEME_LIMIT).await?;\n    verify_sha256(&theme_bytes, &theme.theme_sha256, \"主题配置\")?;\n    let config: DreamSkinThemeConfig =\n        serde_json::from_slice(&theme_bytes).context(\"市场主题配置不是有效 JSON\")?;\n    if config.id != theme.id || config.name != theme.name {\n        bail!(\"市场主题配置与清单身份不一致\");\n    }\n\n    let image_bytes = download_limited(&client, &image_url, MARKET_IMAGE_LIMIT).await?;\n    verify_sha256(&image_bytes, &theme.image_sha256, \"主题图片\")?;\n    let extension =\n        detect_image_extension(&image_bytes).context(\"市场主题图片格式无效或不受支持\")?;\n    let download_path = market_download_path(state_dir, &theme.id, extension)?;\n    crate::settings::atomic_write(&download_path, &image_bytes)\n        .with_context(|| format!(\"无法暂存市场主题图片 {}\", download_path.display()))?;\n\n    let draft = DreamSkinThemeDraft {\n        config,\n        image_path: download_path.to_string_lossy().into_owned(),\n        builtin: false,\n    };\n    let installed = crate::dream_skin_library::save_dream_skin_theme(state_dir, &draft);\n    let _ = std::fs::remove_file(&download_path);\n    let installed = installed?;","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/f2074595a281bc057525c748175c8eb9805b0673/crates/codex-plus-core/src/dream_skin_market.rs#L119-L155","documentation":"Integrity guard raised during market theme installation: the downloaded theme.json's identity (id/version) does not match the market manifest entry, or its theme id is invalid. install_market_theme_from_base refuses to install a theme whose on-disk identity diverges from what the manifest advertised, preventing mislabeled or spoofed installs.","triggerScenarios":"Thrown at crates/codex-plus-core/src/dream_skin_market.rs:137 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Refresh the market manifest and retry the install","Report the theme as mislabeled to the market maintainer","Verify the theme.json id matches the manifest entry's id"],"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"}