{"record":{"id":"ff960f93601c31c0","repo":"astrid-runtime/astrid","slug":"branding-accent-color-e","errorCode":null,"errorMessage":"branding.accent-color: {e}","messagePattern":"branding\\.accent-color: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/distro/validate.rs","lineNumber":252,"sourceCode":"    }\n\n    // Branding — only structural rails. The dashboard interprets the\n    // values; the parser just refuses obvious garbage.\n    if let Some(branding) = &manifest.branding {\n        if let Some(icon) = &branding.icon\n            && icon.len() > 64 * 1024\n        {\n            anyhow::bail!(\n                \"branding.icon is {} bytes — distros must not embed assets larger than 64 KiB\",\n                icon.len()\n            );\n        }\n        if let Some(color) = &branding.primary_color {\n            validate_hex_color(color)\n                .map_err(|e| anyhow::anyhow!(\"branding.primary-color: {e}\"))?;\n        }\n        if let Some(color) = &branding.accent_color {\n            validate_hex_color(color).map_err(|e| anyhow::anyhow!(\"branding.accent-color: {e}\"))?;\n        }\n    }\n\n    Ok(())\n}\n\n/// Enforce a manifest's `[distro].astrid-version` floor against the running CLI.\n///\n/// Called on the init / `distro apply` path *after* the manifest is fetched and\n/// parsed but *before* any prompting or install, so a distro whose `Distro.toml`\n/// (fetched from the repo `main` tip) bumps its CLI floor fails fast with an\n/// actionable message instead of breaking onboarding mid-flight on an older CLI.\n///\n/// A manifest with no `astrid-version` floor imposes no requirement.\npub(crate) fn enforce_astrid_version(manifest: &DistroManifest) -> anyhow::Result<()> {\n    let Some(req) = manifest.distro.astrid_version.as_deref() else {\n        return Ok(());\n    };","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/distro/validate.rs#L234-L270","documentation":"Same check as primary-color but for [branding].accent-color: validate_hex_color must accept the value, else the error is re-raised with the 'branding.accent-color:' prefix. It indicates the accent color string in the distro manifest is not a well-formed hex color.","triggerScenarios":"validate_manifest with branding.accent-color set to a non-hex value: named color, missing '#', wrong digit count, invalid hex characters.","commonSituations":"Designers exporting 'accent' as rgb()/HSL; typos in the hex string; truncating the value when editing TOML; using a CSS variable name.","solutions":["Set accent-color to a valid hex color such as '#ff6600'.","Verify character count and hex alphabet (0-9, a-f) after the '#'.","Remove the accent-color key if a custom accent is not required."],"exampleFix":"# before (Distro.toml)\n[branding]\naccent-color = \"rgb(255, 102, 0)\"\n# after\n[branding]\naccent-color = \"#ff6600\"","handlingStrategy":"validation","validationCode":"fn is_hex_color(s: &str) -> bool {\n    let t = s.strip_prefix('#').unwrap_or(s);\n    t.len() == 6 && t.chars().all(|c| c.is_ascii_hexdigit())\n}\n// apply to branding.accent-color before shipping the manifest","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Mirror the same hex format used for primary-color.","Keep a branding snippet with known-good colors and copy from it.","Validate the manifest in CI with `astrid distro validate`."],"tags":["config","validation","color","manifest"],"backgroundTag":"invalid-config-value","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}