{"record":{"id":"cdbd4ebac269feea","repo":"zeroclaw-labs/zeroclaw","slug":"entry-path-includes-and-excludes-the-same-argume","errorCode":null,"errorMessage":"{entry_path} includes and excludes the same argument '{field}'","messagePattern":"(.+?) includes and excludes the same argument '(.+?)'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-config/src/schema.rs","lineNumber":15551,"sourceCode":"                    exclude,\n                    ..\n                } => {\n                    if tool.is_empty() || tool.trim() != tool {\n                        anyhow::bail!(\n                            \"{entry_path}.tool must be a non-empty exact tool name without surrounding whitespace\"\n                        );\n                    }\n                    if !tools.insert(tool.as_str()) {\n                        anyhow::bail!(\"{entry_path}.tool duplicates the rule for tool '{tool}'\");\n                    }\n\n                    let included =\n                        validate_stream_tool_argument_names(&entry_path, \"include\", include)?;\n                    let excluded =\n                        validate_stream_tool_argument_names(&entry_path, \"exclude\", exclude)?;\n                    for field in &excluded {\n                        if included.contains(*field) {\n                            anyhow::bail!(\n                                \"{entry_path} includes and excludes the same argument '{field}'\"\n                            );\n                        }\n                    }\n                }\n            }\n        }\n\n        Ok(())\n    }\n}\n\nimpl ChannelConfig for MatrixConfig {\n    fn name() -> &'static str {\n        \"Matrix\"\n    }\n    fn desc() -> &'static str {\n        \"self-hosted chat\"","sourceCodeStart":15533,"sourceCodeEnd":15569,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-config/src/schema.rs#L15533-L15569","documentation":"In a `stream_tool_arguments` tool rule, `include` adds argument fields after the `base` set is chosen and `exclude` removes fields from it. An argument appearing in both lists is contradictory (add and remove the same field), so the validator rejects the overlap to make the intended rendered set unambiguous.","triggerScenarios":"A rule like `{ tool = \"mock_tool\", base = \"all\", include = [\"token\"], exclude = [\"token\"] }`; merging an include list and an exclude list that were authored separately and happen to share a field name.","commonSituations":"Copy-pasting field names between the include and exclude arrays while iterating on redaction policy; intending `base = \"all\"` minus a field but also adding the field to include by habit; typos that duplicate a field across both lists.","solutions":["Decide whether the field should be shown, then remove it from the other list.","If the intent is 'everything except X', drop the `include` entry and keep `base = \"all\"` plus `exclude = [\"X\"]`.","If the intent is 'base plus X', remove X from `exclude`."],"exampleFix":"# before\n{ tool = \"mock_tool\", base = \"all\", include = [\"token\"], exclude = [\"token\"] }\n\n# after\n{ tool = \"mock_tool\", base = \"all\", exclude = [\"token\"] }","handlingStrategy":"validation","validationCode":"if let StreamToolArgumentEntry::Tool { include, exclude, .. } = entry {\n    let overlap: Vec<_> = include.iter().filter(|f| exclude.contains(f)).collect();\n    if !overlap.is_empty() {\n        anyhow::bail!(\"fields both included and excluded: {overlap:?}\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Express 'all except X' as base = \"all\" + exclude, never as include+exclude of X.","Keep include and exclude lists disjoint by construction (derive one from the other).","Review both lists together whenever you add a field to either."],"tags":["matrix","streaming","config","conflicting-values","tool-arguments"],"backgroundTag":"conflicting-config-values","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}