{"record":{"id":"e140f7c6f4e446e8","repo":"BloopAI/vibe-kanban","slug":"default-profiles-v3-json-is-invalid","errorCode":null,"errorMessage":"Default profiles v3 JSON is invalid","messagePattern":"Default profiles v3 JSON is invalid","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/executors/src/profile.rs","lineNumber":467,"sourceCode":"            }\n\n            // Ensure configuration names don't conflict with reserved words\n            for config_name in profile.configurations.keys() {\n                if config_name.starts_with(\"__\") {\n                    return Err(ProfileError::Validation(format!(\n                        \"Configuration name '{config_name}' is reserved (starts with '__')\"\n                    )));\n                }\n            }\n        }\n        Ok(())\n    }\n\n    /// Load from the new v3 defaults\n    pub fn from_defaults() -> Self {\n        serde_json::from_str(DEFAULT_PROFILES_JSON).unwrap_or_else(|e| {\n            tracing::error!(\"Failed to parse embedded default_profiles.json: {}\", e);\n            panic!(\"Default profiles v3 JSON is invalid\")\n        })\n    }\n\n    pub fn get_coding_agent(&self, executor_profile_id: &ExecutorProfileId) -> Option<CodingAgent> {\n        self.executors\n            .get(&executor_profile_id.executor)\n            .and_then(|executor| {\n                executor.get_variant(\n                    &executor_profile_id\n                        .variant\n                        .clone()\n                        .unwrap_or(\"DEFAULT\".to_string()),\n                )\n            })\n            .cloned()\n    }\n\n    pub fn get_coding_agent_or_default(","sourceCodeStart":449,"sourceCodeEnd":485,"githubUrl":"https://github.com/BloopAI/vibe-kanban/blob/4deb7eca8f381f7cbc1f9d15515a9ab8f8009053/crates/executors/src/profile.rs#L449-L485","documentation":"ExecutorProfiles::from_defaults parses the embedded DEFAULT_PROFILES_JSON constant with serde_json; if the embedded v3 profiles JSON fails to deserialize it logs the serde error and panics with 'Default profiles v3 JSON is invalid'. This is a build-time-invariant check: the compiled-in profile data must always be valid, so a panic here means the shipped binary's embedded asset is broken.","triggerScenarios":"Calling ExecutorProfiles::from_defaults() when DEFAULT_PROFILES_JSON (embedded default_profiles.json) fails serde deserialization — schema drift between the ProfileVariants struct and the JSON, or a corrupted/empty embedded asset.","commonSituations":"A code change added/renamed a field in ProfileVariants without regenerating default_profiles.json; a build script packaged a stale or truncated asset; hand-edited profiles JSON that no longer matches the serde types.","solutions":["Read the preceding tracing::error! log line — it contains the exact serde error and field path.","Regenerate or fix the embedded default_profiles.json so it matches the current ProfileVariants schema, then rebuild.","Validate the JSON offline: `serde_json::from_str::<ExecutorProfiles>(DEFAULT_PROFILES_JSON)` in a unit test to catch drift at CI time.","If the asset is packaged at build time, confirm the build script/embed path points at the correct, non-truncated file."],"exampleFix":"// before\npanic!(\"Default profiles v3 JSON is invalid\")\n// after (test to catch it earlier)\n#[test]\nfn default_profiles_parse() {\n    serde_json::from_str::<ExecutorProfiles>(DEFAULT_PROFILES_JSON).unwrap();\n}","handlingStrategy":"validation","validationCode":"// CI unit test\n#[test]\nfn embedded_default_profiles_are_valid() {\n    serde_json::from_str::<ExecutorProfiles>(DEFAULT_PROFILES_JSON)\n        .expect(\"embedded default_profiles.json must match ProfileVariants schema\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep a unit test that parses DEFAULT_PROFILES_JSON so schema drift fails CI before release","Regenerate default_profiles.json whenever ProfileVariants fields change","Never hand-edit the embedded JSON without validating against the Rust types"],"tags":["rust","panic","serde","embedded-assets"],"backgroundTag":"schema-validation-failed","analyzedSha":"4deb7eca8f381f7cbc1f9d15515a9ab8f8009053","analyzedAt":"2026-08-29T09:24:13.446Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}