Hmbown/CodeWhale · error

Invalid auto_review.allow

Error message

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.

What it means

For `auto_review.allow` rules specifically, action_kind is further restricted to the current v0.9.8 decision classes (read, write, shell, external, publish, destructive). Retired narrow kinds that fail this whitelist are rejected because allowing on them cannot safely widen to a decision class. This only applies to the `allow` kind; deny rules may accept the retired kinds.

Solutions

  1. Replace the retired narrow kind with a current action_kind from the whitelist.
  2. Or express the narrow permission as an exact `tool` rule instead of an action_kind.
  3. Consult the v0.9.8 migration notes mapping retired kinds to decision classes.

Example fix

// before
[[auto_review.allow]]
action_kind = "file_read"
// after
[[auto_review.allow]]
action_kind = "read"
Defensive patterns

Strategy: validation

Validate before calling

const ALLOW_KINDS: [&str; 6] = ["read","write","shell","external","publish","destructive"];
if rule_kind == "allow" && !ALLOW_KINDS.contains(&norm_action_kind.as_str()) {
    return Err("allow rules require a current v0.9.8 action_kind or an exact tool rule");
}

Prevention

When it happens

Trigger: An `auto_review.allow` rule sets action_kind to a value that parses (passes error 813's check) but is not in the read/write/shell/external/publish/destructive whitelist — i.e. a retired narrow kind, at config.rs:3478.

Common situations: Migrating a pre-v0.9.8 allowlist that used narrow retired kinds (e.g. per-command kinds); allowing on a kind the new permission model cannot represent safely; copying old deny-rule kinds into allow rules.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@73e0f67d83 (2026-09-22). Data as JSON: /api/errors/e70c042ab92c6bce. Report an issue: GitHub.

Appendix: source

Thrown at crates/tui/src/config.rs:3478

        if !rule.has_matcher() {
            anyhow::bail!(
                "Invalid auto_review.{kind}[{index}]: set at least one of tool or action_kind."
            );
        }
        if let Some(action_kind) = rule.action_kind.as_deref() {
            let normalized = action_kind.trim().to_ascii_lowercase().replace('-', "_");
            if parse_auto_review_action_kind(&normalized).is_none() {
                anyhow::bail!(
                    "Invalid auto_review.{kind}[{index}].action_kind '{action_kind}': expected read, write, shell, external, publish, or destructive."
                );
            }
            if kind == "allow"
                && !matches!(
                    normalized.as_str(),
                    "read" | "write" | "shell" | "external" | "publish" | "destructive"
                )
            {
                anyhow::bail!(
                    "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."
                );
            }
        }
    }
    Ok(())
}

fn parse_auto_review_action_kind(raw: &str) -> Option<crate::tui::auto_review::ToolActionKind> {
    match raw.trim().to_ascii_lowercase().replace('-', "_").as_str() {
        "read" | "mcp_read" => Some(crate::tui::auto_review::ToolActionKind::Read),
        "write" => Some(crate::tui::auto_review::ToolActionKind::Write),
        "shell" => Some(crate::tui::auto_review::ToolActionKind::Shell),
        "external" | "network" | "git" | "mcp_action" | "browser" | "unknown" => {
            Some(crate::tui::auto_review::ToolActionKind::External)
        }
        "publish" => Some(crate::tui::auto_review::ToolActionKind::Publish),
        "destructive" | "secret" => Some(crate::tui::auto_review::ToolActionKind::Destructive),

View on GitHub (pinned to 73e0f67d83)