{"record":{"id":"777dc4cd586df950","repo":"Hmbown/CodeWhale","slug":"bundle-at-source-has-schema-version-this-build-understands","errorCode":null,"errorMessage":"bundle at {source} has schema_version {}; this build understands {BUNDLE_SCHEMA_VERSION}","messagePattern":"bundle at (.+?) has schema_version (.+?); this build understands (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/config_bundles.rs","lineNumber":237,"sourceCode":"    let mut path = Vec::new();\n    NoDuplicates { path: &mut path }\n        .deserialize(&mut deserializer)\n        .map_err(|error| anyhow::anyhow!(\"{error}\"))?;\n    deserializer\n        .end()\n        .map_err(|error| anyhow::anyhow!(\"{error}\"))?;\n    Ok(())\n}\n\nfn validate_bundle(bundle: &PortableBundle, source: &str) -> Result<()> {\n    if bundle.kind != BUNDLE_KIND {\n        bail!(\n            \"bundle at {source} has kind {:?}; expected {BUNDLE_KIND:?}\",\n            bundle.kind\n        );\n    }\n    if bundle.schema_version != BUNDLE_SCHEMA_VERSION {\n        bail!(\n            \"bundle at {source} has schema_version {}; this build understands {BUNDLE_SCHEMA_VERSION}\",\n            bundle.schema_version\n        );\n    }\n    Ok(())\n}\n\n// ---------------------------------------------------------------------------\n// Secret rejection\n// ---------------------------------------------------------------------------\n\n/// One rejected entry: the dotted key path and the reason. Values are never\n/// included — the reason and path are all a reviewer needs.\n#[derive(Debug, Clone, PartialEq, Eq)]\npub struct RejectedEntry {\n    pub key: String,\n    pub reason: String,\n}","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/config_bundles.rs#L219-L255","documentation":"The bundle's `schema_version` field is a version this build does not understand (`BUNDLE_SCHEMA_VERSION`). The CLI refuses any bundle whose schema version is not exactly the one it supports, because field semantics may change across versions. Raised by `validate_bundle` immediately after the kind check during bundle parsing/import.","triggerScenarios":"Importing a bundle exported by a newer codewhale release (higher schema_version) or an older one (lower schema_version) into this build.","commonSituations":"Upgrading the CLI and then importing bundles generated by the previous release; sharing bundles between machines with different codewhale versions; a stale bundle checked into a repo before a schema bump.","solutions":["Upgrade the codewhale CLI to a build whose BUNDLE_SCHEMA_VERSION matches the bundle, then re-run the import.","Re-export the bundle with the current CLI version so schema_version matches.","If you must use an older bundle, migrate its contents manually to the current schema (bump schema_version and adjust changed fields)."],"exampleFix":"// before (bundle.json)\n{ \"kind\": \"...\", \"schema_version\": 3, ... }\n// after (schema this build understands)\n{ \"kind\": \"...\", \"schema_version\": 2, ... }  // or upgrade the CLI instead","handlingStrategy":"validation","validationCode":"let v: serde_json::Value = serde_json::from_str(&text)?;\nmatch v.get(\"schema_version\").and_then(|s| s.as_u64()) {\n    Some(n) if n == SUPPORTED_SCHEMA_VERSION => Ok(()),\n    other => Err(format!(\"bundle schema_version {other:?} unsupported; this build understands {SUPPORTED_SCHEMA_VERSION}\")),\n}","typeGuard":"fn has_supported_schema(v: &serde_json::Value, supported: u64) -> bool {\n    v.get(\"schema_version\").and_then(|s| s.as_u64()) == Some(supported)\n}","tryCatchPattern":null,"preventionTips":["Pin team members to compatible CLI versions when sharing bundles.","Re-export bundles after every CLI upgrade.","Check schema_version in the bundle header before distributing it."],"tags":["config-bundle","schema-version","version-mismatch"],"backgroundTag":"schema-validation-failed","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T16:17:23.217Z"}