{"record":{"id":"a05c4c2df5b18b77","repo":"Hmbown/CodeWhale","slug":"project-requires-a-workspace-config-is-the-user-global","errorCode":null,"errorMessage":"--project requires a workspace config ({} is the user-global document)","messagePattern":"--project requires a workspace config \\((.+?) is the user-global document\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/cli/src/config_bundles.rs","lineNumber":684,"sourceCode":"    Global,\n    /// The workspace-scoped config (`<repo>/.codewhale/config.toml`).\n    Project,\n}\n\nimpl BundleScope {\n    #[must_use]\n    pub fn label(self) -> &'static str {\n        match self {\n            Self::Global => \"global\",\n            Self::Project => \"project\",\n        }\n    }\n}\n\nfn validate_scope_target(scope: BundleScope, target: &Path) -> Result<()> {\n    let workspace_scoped = codewhale_config::config_path_is_workspace_scoped(target);\n    match (scope, workspace_scoped) {\n        (BundleScope::Project, false) => bail!(\n            \"--project requires a workspace config ({} is the user-global document)\",\n            target.display()\n        ),\n        (BundleScope::Global, true) => bail!(\n            \"global bundle operations cannot target workspace config {}; rerun with --project or select the user-global config\",\n            target.display()\n        ),\n        _ => {}\n    }\n    Ok(())\n}\n\n// ---------------------------------------------------------------------------\n// Path safety\n// ---------------------------------------------------------------------------\n\n/// Resolve `candidate` inside `base_dir`, refusing traversal and symlink\n/// escapes. Returns the resolved path or an error naming the refusal — the","sourceCodeStart":666,"sourceCodeEnd":702,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/cli/src/config_bundles.rs#L666-L702","documentation":"A bundle operation was invoked with `--project` scope, but the config file the command targets is the user-global document, not a workspace-scoped one. `validate_scope_target` checks `config_path_is_workspace_scoped` and refuses project-scope operations against the global config, since project bundles can only be applied to a workspace config.","triggerScenarios":"Running `codewhale config bundle import --project` (or export) while the resolved config path is the user-global config — e.g. no workspace config exists in the project or the command was run outside a workspace with an explicit global config path.","commonSituations":"Running the command in a directory without a `.codewhale` workspace config; passing the global config path explicitly; a typo in `--config` pointing at the user-global file.","solutions":["Create a workspace config in the project (or run the command from a directory that has one) and retry with `--project`.","Drop `--project` and let the operation run in the default (global) scope.","Fix the `--config` path so it points at the workspace config file instead of the user-global document."],"exampleFix":"// before\ncodewhale config bundle import --project ~/codewhale/config.json bundle.zip\n// after\ncodewhale config bundle import --project .codewhale/config.json bundle.zip","handlingStrategy":"validation","validationCode":"if args.project && !codewhale_config::config_path_is_workspace_scoped(&config_path) {\n    eprintln!(\"--project requires a workspace config; {} is the user-global document\", config_path.display());\n    std::process::exit(2);\n}","typeGuard":"fn is_workspace_scoped(p: &std::path::Path) -> bool {\n    codewhale_config::config_path_is_workspace_scoped(p)\n}","tryCatchPattern":null,"preventionTips":["Run project-scope bundle commands from a directory that contains a workspace config.","Wrap common invocations in a script that picks scope based on the config path.","Double-check any explicit `--config` path before combining it with `--project`."],"tags":["cli","config-scope","project-vs-global"],"backgroundTag":"invalid-cli-argument","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-22T06:17:15.046Z"}