Skip to content

fix(policy): remove dead PolicyEffect::AllowIf variant#1883

Merged
bug-ops merged 2 commits intomainfrom
1871-policy-allowif-dead-code
Mar 15, 2026
Merged

fix(policy): remove dead PolicyEffect::AllowIf variant#1883
bug-ops merged 2 commits intomainfrom
1871-policy-allowif-dead-code

Conversation

@bug-ops
Copy link
Copy Markdown
Owner

@bug-ops bug-ops commented Mar 15, 2026

Summary

  • Removes PolicyEffect::AllowIf from crates/zeph-tools/src/policy.rs — the variant was introduced in PR feat(security): declarative policy compiler for tool call authorization #1870 but evaluated identically to Allow in the policy engine (deny-wins loop uses rule.effect != PolicyEffect::Deny)
  • Updates the inline comment in evaluate() from "allow/allow_if" to "allow"
  • Documents the breaking change in CHANGELOG.md under [Unreleased]

Test plan

  • cargo +nightly fmt --check — passed
  • cargo clippy --workspace --features full -- -D warnings — 0 warnings
  • cargo nextest run --workspace --features full --lib --bins — 5968 passed

Closes #1871

bug-ops added 2 commits March 15, 2026 23:06
The variant was declared in PR #1870 but evaluated identically to Allow
in the policy engine (deny-wins check: `rule.effect != Deny`). This made
it misleading for users writing TOML policy rules.

Remove AllowIf and update the inline comment in the evaluator. Conditions
on allow rules are already expressed via rule fields (tool_matcher, params,
trust, etc.) — no separate variant is needed.

Closes #1871
@github-actions github-actions bot added documentation Improvements or additions to documentation rust Rust code changes bug Something isn't working size/XS Extra small PR (1-10 lines) labels Mar 15, 2026
@bug-ops bug-ops enabled auto-merge (squash) March 15, 2026 22:08
@bug-ops bug-ops merged commit fa763fd into main Mar 15, 2026
20 checks passed
@bug-ops bug-ops deleted the 1871-policy-allowif-dead-code branch March 15, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation rust Rust code changes size/XS Extra small PR (1-10 lines)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(policy): PolicyEffect::AllowIf variant is declared but behaves as Allow

1 participant