{"record":{"id":"7c1a00f4b0f9eb28","repo":"BigPizzaV3/CodexPlusPlus","slug":"dreamskin-7c1a00","errorCode":null,"errorMessage":"DreamSkin 社区主题元数据无效：{}","messagePattern":"DreamSkin 社区主题元数据无效：(.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codex-plus-core/src/dream_skin_community.rs","lineNumber":309,"sourceCode":"        .chars()\n        .filter(|character| !unsafe_format_character(*character))\n        .collect::<String>()\n        .trim()\n        .to_string()\n}\n\nfn validate_community_theme(theme: &DreamSkinCommunityTheme) -> anyhow::Result<()> {\n    validate_version_id(&theme.id)?;\n    if !safe_text(&theme.theme_id, 80)\n        || !safe_text(&theme.name, 120)\n        || !safe_text(&theme.author_display_name, 120)\n        || !safe_text(&theme.license, 80)\n        || !valid_semver(&theme.version)\n        || theme.package_bytes == 0\n        || theme.package_bytes > PACKAGE_BYTES_LIMIT\n        || !valid_sha256(&theme.package_sha256)\n    {\n        bail!(\"DreamSkin 社区主题元数据无效：{}\", theme.id);\n    }\n    Ok(())\n}\n\nfn validate_version_id(value: &str) -> anyhow::Result<()> {\n    let Some(suffix) = value.strip_prefix(\"ver_\") else {\n        bail!(\"DreamSkin 主题版本 ID 无效\");\n    };\n    if !(8..=64).contains(&suffix.len())\n        || !suffix\n            .bytes()\n            .all(|byte| byte.is_ascii_lowercase() || byte.is_ascii_digit())\n    {\n        bail!(\"DreamSkin 主题版本 ID 无效\");\n    }\n    Ok(())\n}\n","sourceCodeStart":291,"sourceCodeEnd":327,"githubUrl":"https://github.com/BigPizzaV3/CodexPlusPlus/blob/b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6/crates/codex-plus-core/src/dream_skin_community.rs#L291-L327","documentation":"validate_community_theme checks each DreamSkin community theme's metadata fields: safe (bounded, non-empty) display/license text, a valid semver version, nonzero package_bytes within the 32 MiB limit, and a valid sha256 hex digest. If any field fails, it bails naming the offending theme id. It is the filter used when normalizing the community catalog and before installing a theme.","triggerScenarios":"install_community_theme with metadata whose license/display text is empty or too long, version is not semver, package_bytes is 0 or > PACKAGE_BYTES_LIMIT, or package_sha256 is not a valid digest; or a catalog item failing these checks during normalize_and_filter_catalog.","commonSituations":"Upstream API returns a newly added theme with placeholder metadata (empty license, version like \"1.0\"); the service omits package_sha256 for large packages; a broken publish pipeline stores 0 package_bytes.","solutions":["Inspect the theme's metadata for the reported id and identify which field fails the checks (version format, sha256, sizes, text bounds).","Refresh the catalog from the service; the invalid item is normally skipped/filtered rather than fatal for the whole catalog.","Upgrade the theme's publish metadata upstream: valid semver version, correct package_bytes, and a full sha256 hex string.","If you construct metadata manually (e.g. in tests or scripts), fill all required fields within limits before calling install."],"exampleFix":"// before\nlet theme = DreamSkinCommunityTheme { version: \"1.0\".into(), package_sha256: \"\".into(), .. };\n// after\nlet theme = DreamSkinCommunityTheme { version: \"1.0.0\".into(), package_sha256: \"9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08\".into(), .. };","handlingStrategy":"validation","validationCode":"// Rust\nfn theme_meta_plausible(t: &DreamSkinCommunityTheme) -> bool {\n    !t.id.is_empty() && !t.license.trim().is_empty() && t.license.len() <= 80\n        && t.version.split('.').filter(|p| !p.is_empty() && p.chars().all(|c| c.is_ascii_digit())).count() >= 2\n        && t.package_bytes > 0 && t.package_bytes <= 32 * 1024 * 1024\n        && t.package_sha256.len() == 64 && t.package_sha256.bytes().all(|b| b.is_ascii_hexdigit())\n}","typeGuard":null,"tryCatchPattern":"// Rust\nfor theme in catalog.items {\n    if let Err(e) = install_community_theme(state_dir, &theme).await {\n        if e.to_string().contains(\"元数据无效\") { skipped.push(theme.id); continue; }\n        return Err(e);\n    }\n}","preventionTips":["Filter catalog items through validate-style checks before install loops","Refresh the catalog when an item fails validation","Publish themes with full semver versions and sha256 digests"],"tags":["validation","schema","metadata"],"backgroundTag":"schema-validation-failed","analyzedSha":"b1ed92e5e4a2d74095d4b8db5af43cef7acba9c6","analyzedAt":"2026-09-19T23:35:21.129Z","contentChangedAt":"2026-09-19T23:35:21.129Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}