{"record":{"id":"1e07ed5605f9e72a","repo":"Hmbown/CodeWhale","slug":"invalid-auto-review-kind-index-set-at-least","errorCode":null,"errorMessage":"Invalid auto_review.{kind}[{index}]: set at least one of tool or action_kind.","messagePattern":"Invalid auto_review\\.(.+?)\\[(.+?)\\]: set at least one of tool or action_kind\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tui/src/config.rs","lineNumber":3461,"sourceCode":"                .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(),\n                    \"read\" | \"write\" | \"shell\" | \"external\" | \"publish\" | \"destructive\"\n                )\n            {\n                anyhow::bail!(\n                    \"Invalid auto_review.allow[{index}].action_kind '{action_kind}': this retired narrow kind cannot safely widen to a v0.9.8 decision class; replace it with an exact tool rule or a current action_kind.\"","sourceCodeStart":3443,"sourceCodeEnd":3479,"githubUrl":"https://github.com/Hmbown/CodeWhale/blob/73e0f67d83c59909b571efdfc88c4bc28c309cb1/crates/tui/src/config.rs#L3443-L3479","documentation":"Auto-review rule validation requires every rule to carry at least one matcher: `tool` or `action_kind`. A rule with neither (and no accepted text_contains) would match everything, which is treated as a config error. Thrown during config validation in the rule loop at config.rs:3461.","triggerScenarios":"An `auto_review.{kind}` rule entry (allow or deny) is present in config but has an empty/absent `tool` and `action_kind` (and text_contains is empty or retired), so `rule.has_matcher()` returns false.","commonSituations":"Adding an empty `[[auto_review.allow]]` table placeholder; a commented-out or typo'd matcher key (e.g. `actions_kind`) leaving the rule with no matchers; TOML tools emitting an empty table for a rule.","solutions":["Set `tool` to the exact tool name the rule targets (e.g. tool = \"shell\").","Or set `action_kind` to one of read, write, shell, external, publish, destructive.","Remove the rule entirely if it was a placeholder."],"exampleFix":"// before\n[[auto_review.allow]]\n# nothing set\n// after\n[[auto_review.allow]]\ntool = \"read_file\"","handlingStrategy":"validation","validationCode":"if rule.tool.is_none() && rule.action_kind.is_none() {\n    return Err(\"auto_review rule needs at least one of tool or action_kind\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Every [[auto_review.*]] table must set tool or action_kind — never commit empty rule tables.","Check for typo'd keys when a rule unexpectedly has no matchers."],"tags":["config","auto-review","validation"],"backgroundTag":"missing-required-config-field","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"}