{"record":{"id":"24d8d5e6d412c29c","repo":"Hmbown/CodeWhale","slug":"invalid-auto-review-kind-index-text-contains","errorCode":null,"errorMessage":"Invalid auto_review.{kind}[{index}].text_contains: user-intent matching was retired; scope the rule with tool and/or action_kind.","messagePattern":"Invalid auto_review\\.(.+?)\\[(.+?)\\]\\.text_contains: user-intent matching was retired; scope the rule with tool and/or action_kind\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/config.rs","lineNumber":3456,"sourceCode":"    fn has_matcher(&self) -> bool {\n        self.tool\n            .as_deref()\n            .is_some_and(|value| !value.trim().is_empty())\n            || self\n                .action_kind\n                .as_deref()\n                .is_some_and(|value| !value.trim().is_empty())\n    }\n}\n\nfn validate_auto_review_rules(kind: &str, rules: &[AutoReviewRuleConfig]) -> Result<()> {\n    for (index, rule) in rules.iter().enumerate() {\n        if rule\n            .text_contains\n            .as_deref()\n            .is_some_and(|value| !value.trim().is_empty())\n        {\n            anyhow::bail!(\n                \"Invalid auto_review.{kind}[{index}].text_contains: user-intent matching was retired; scope the rule with tool and/or action_kind.\"\n            );\n        }\n        if !rule.has_matcher() {\n            anyhow::bail!(\n                \"Invalid auto_review.{kind}[{index}]: set at least one of tool or action_kind.\"\n            );\n        }\n        if let Some(action_kind) = rule.action_kind.as_deref() {\n            let normalized = action_kind.trim().to_ascii_lowercase().replace('-', \"_\");\n            if parse_auto_review_action_kind(&normalized).is_none() {\n                anyhow::bail!(\n                    \"Invalid auto_review.{kind}[{index}].action_kind '{action_kind}': expected read, write, shell, external, publish, or destructive.\"\n                );\n            }\n            if kind == \"allow\"\n                && !matches!(\n                    normalized.as_str(),","sourceCodeStart":3438,"sourceCodeEnd":3474,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/config.rs#L3438-L3474","documentation":"Auto-review rule validation rejects rules that only set `text_contains` with a non-empty value. Matching against raw user text was retired; rules must now be scoped by `tool` and/or `action_kind`. The library throws this at config load so a bare text matcher cannot silently widen a review rule to all inputs.","triggerScenarios":"A config file defines `auto_review.{kind}[{index}]` with a non-empty (after trim) `text_contains` and no validation-blocking combination — validated in the rule loop at config.rs:3456, for both allow and deny kinds.","commonSituations":"Upgrading from an older version where text_contains matching was a legitimate rule form; copying an example config with a text-based rule; hand-writing auto_review rules expecting substring matching on message text.","solutions":["Delete the text_contains field and scope the rule with `tool` and/or `action_kind` instead.","If text matching is essential, replace it with an exact tool rule plus an action_kind that covers the intended surface.","Check release notes for the retirement of user-intent matching and migrate rules to v0.9.8 decision classes."],"exampleFix":"// before\n[[auto_review.deny]]\ntext_contains = \"rm -rf\"\n// after\n[[auto_review.deny]]\ntool = \"shell\"\naction_kind = \"destructive\"","handlingStrategy":"validation","validationCode":"if rule.text_contains.as_deref().map_or(false, |v| !v.trim().is_empty()) {\n    return Err(\"text_contains is retired; scope the rule with tool and/or action_kind\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never write text_contains in new auto_review rules.","Migrate old text rules to tool/action_kind pairs on upgrade."],"tags":["config","auto-review","deprecated"],"backgroundTag":"deprecated-api-usage","analyzedSha":"73e0f67d83c59909b571efdfc88c4bc28c309cb1","analyzedAt":"2026-09-22T01:30:00.501Z","contentChangedAt":"2026-09-22T01:30:00.501Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}