{"record":{"id":"6df7aa06b7f9b6a7","repo":"xai-org/grok-build","slug":"manifest-validation-failed-e","errorCode":null,"errorMessage":"Manifest validation failed: {e}","messagePattern":"Manifest validation failed: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/codegen/xai-grok-pager/src/plugin_cmd.rs","lineNumber":689,"sourceCode":"    if let Ok(ManifestLoadResult::Found(manifest)) = load_manifest(&repo.path) {\n        if let Some(ref desc) = manifest.description {\n            println!(\"  description: {desc}\");\n        }\n        print_component_summary(&manifest, &repo.path);\n    }\n    Ok(())\n}\n\nfn cmd_validate(path: &str) -> Result<()> {\n    let root = PathBuf::from(path);\n    if !root.is_dir() {\n        bail!(\"Not a directory: {path}\");\n    }\n    match load_manifest(&root) {\n        Ok(ManifestLoadResult::Found(manifest)) => {\n            manifest\n                .validate()\n                .map_err(|e| anyhow::anyhow!(\"Manifest validation failed: {e}\"))?;\n            println!(\"Plugin manifest is valid.\");\n            println!(\"  name: {}\", manifest.name);\n            if let Some(ref v) = manifest.version {\n                println!(\"  version: {v}\");\n            }\n            if let Some(ref d) = manifest.description {\n                println!(\"  description: {d}\");\n            }\n            print_component_summary(&manifest, &root);\n            Ok(())\n        }\n        Ok(ManifestLoadResult::NotFound) => {\n            println!(\n                \"No plugin.json found. Grok discovers skills, agents, and hooks \\\n                 automatically from standard directories. A manifest is only needed \\\n                 for custom paths or metadata.\"\n            );\n            Ok(())","sourceCodeStart":671,"sourceCodeEnd":707,"githubUrl":"https://github.com/xai-org/grok-build/blob/bc7f02eddd3d84085849dc19ed216f11c23b0571/crates/codegen/xai-grok-pager/src/plugin_cmd.rs#L671-L707","documentation":"`grok plugin validate <path>` loads the plugin's plugin.json manifest and calls `manifest.validate()`. Any rule violation (invalid name, missing/wrong fields, bad format) is surfaced as \"Manifest validation failed\". It means the manifest exists but does not satisfy the plugin schema requirements.","triggerScenarios":"Calling `grok plugin validate <dir>` where plugin.json parses (ManifestLoadResult::Found) but `Manifest::validate()` returns an error — e.g. invalid `name` characters, missing required field, malformed version, empty description constraints.","commonSituations":"Hand-editing plugin.json and introducing invalid values; scaffolding a plugin manually instead of via a template; schema requirements tightened by a newer grok version so an older manifest no longer validates.","solutions":["Read the `{e}` detail in the message — it names the exact failing rule — and fix that field in plugin.json","Run `grok plugin validate <dir>` again after each fix to iterate","Regenerate the manifest from a current plugin template/scaffold if unsure of the expected schema","Check whether a recent grok upgrade changed manifest requirements"],"exampleFix":"// before (plugin.json)\n{ \"name\": \"My Plugin!\" }\n// after\n{ \"name\": \"my-plugin\", \"version\": \"0.1.0\", \"description\": \"...\" }","handlingStrategy":"validation","validationCode":"// pre-check manifest fields before calling validate\nlet m: serde_json::Value = serde_json::from_str(&std::fs::read_to_string(\"plugin.json\")?)?;\nassert!(!m[\"name\"].as_str().unwrap_or_default().is_empty(), \"name required\");\nassert!(m[\"name\"].as_str().map_or(false, |n| n.chars().all(|c| c.is_ascii_lowercase() || c == '-' || c.is_ascii_digit())), \"name must be kebab-case\");","typeGuard":null,"tryCatchPattern":"match manifest.validate() {\n    Ok(()) => println!(\"valid\"),\n    Err(e) => eprintln!(\"manifest invalid: {e}; fix plugin.json and re-run grok plugin validate\"),\n}","preventionTips":["Run `grok plugin validate` in CI for every plugin change","Generate manifests from the official template instead of hand-writing them","Re-validate after every grok upgrade in case schema rules tightened"],"tags":["manifest","validation","plugin"],"backgroundTag":"schema-validation-failed","analyzedSha":"bc7f02eddd3d84085849dc19ed216f11c23b0571","analyzedAt":"2026-08-31T04:59:42.031Z","schemaVersion":2},"datasetVersion":"2026-08-31T09:17:48.483Z"}