{"record":{"id":"56fbf655fd9ea2a4","repo":"jdx/mise","slug":"removed-workspace-project-id-cannot-define-oth","errorCode":null,"errorMessage":"removed workspace project {id:?} cannot define other overrides","messagePattern":"removed workspace project (.+?) cannot define other overrides","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/workspace.rs","lineNumber":1159,"sourceCode":"        attach_suggestion(&mut task.suggestions.provenance.outputs);\n    }\n    if task.suggestions.cache.is_some() {\n        attach_suggestion(&mut task.suggestions.provenance.cache);\n    }\n    if task.suggestions.depends.is_some() {\n        attach_suggestion(&mut task.suggestions.provenance.depends);\n    }\n}\n\nfn validate_override(id: &ProjectId, config: &WorkspaceProjectOverride) -> Result<()> {\n    if config.remove\n        && (config.root.is_some()\n            || config.metadata.is_some()\n            || config.depends.is_some()\n            || !config.depends_add.is_empty()\n            || !config.depends_remove.is_empty())\n    {\n        bail!(\"removed workspace project {id:?} cannot define other overrides\");\n    }\n    if let Some(dependency) = config\n        .depends_add\n        .intersection(&config.depends_remove)\n        .next()\n    {\n        bail!(\"workspace project {id:?} cannot both add and remove dependency {dependency:?}\");\n    }\n    Ok(())\n}\n\nfn parse_dependency_ids(\n    project_id: &ProjectId,\n    field: &str,\n    dependencies: &BTreeSet<String>,\n) -> Result<BTreeSet<ProjectId>> {\n    dependencies\n        .iter()","sourceCodeStart":1141,"sourceCodeEnd":1177,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/task/workspace.rs#L1141-L1177","documentation":"Each [monorepo.projects.\"<id>\"] override in mise.toml is either a removal or a modification — not both. validate_override() rejects an entry that sets remove = true alongside any of root, metadata, depends, depends_add, or depends_remove, because a removed project (and all its edges) cannot meaningfully carry other configuration.","triggerScenarios":"A mise.toml entry combining remove = true with e.g. depends_add, root, or metadata; copy-pasting an existing override block and adding remove = true without deleting the other keys; YAML/TOML merge tools layering a removal onto a base config that already defined depends.","commonSituations":"Trying to 'remove and recreate' a project in one entry; nested config layering (mise.toml + mise.local.toml) where an override merges with a base that has other fields; misunderstanding that removal implies edge cleanup is automatic so no depends adjustments are needed.","solutions":["Keep the removal entry to remove = true only; delete root/metadata/depends/depends_add/depends_remove from it","If you meant to redefine the project, drop remove = true and keep the other fields","If config layering merged the keys, move the removal to the outermost file or ensure entries don't overlap"],"exampleFix":"# before (mise.toml)\n[monorepo.projects.\"cargo:legacy\"]\nremove = true\nroot = \"crates/legacy\"\ndepends_remove = [\"cargo:shared\"]\n\n# after\n[monorepo.projects.\"cargo:legacy\"]\nremove = true","handlingStrategy":"validation","validationCode":"for (raw_id, cfg) in &overrides {\n    if cfg.remove\n        && (cfg.root.is_some() || cfg.metadata.is_some() || cfg.depends.is_some()\n            || !cfg.depends_add.is_empty() || !cfg.depends_remove.is_empty())\n    {\n        return Err(eyre::eyre!(\"entry {raw_id}: remove cannot be combined with other override fields\"));\n    }\n}","typeGuard":"fn is_pure_removal(cfg: &WorkspaceProjectOverride) -> bool {\n    !(cfg.remove\n        && (cfg.root.is_some() || cfg.metadata.is_some() || cfg.depends.is_some()\n            || !cfg.depends_add.is_empty() || !cfg.depends_remove.is_empty()))\n}","tryCatchPattern":null,"preventionTips":["Keep removal entries minimal: one key, remove = true","When generating overrides programmatically, skip serialization of unset fields so removals never inherit defaults","Review merged config layers (mise.local.toml) so a removal doesn't land on an entry that already defines depends/root"],"tags":["rust","mise","workspace","config-validation","toml"],"backgroundTag":"mutually-exclusive-config-fields","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}