Add must-use authorization decisions and bound authorize helper - #70
Merged
Merged
Conversation
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
hardbyte
force-pushed
the
codex/enforcement-ergonomics
branch
from
September 19, 2026 11:25
11e9e56 to
124ba47
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Awaited authorization decisions could be silently discarded. Add useful
#[must_use]diagnostics toAccessEvaluation,GrantResult, andVetoResult, plusbound.authorize(&invoice).await?for enforcement at application boundaries. Method-level attributes onevaluateandevaluate_byalso warn when their awaited batch results are discarded.authorizereturnsResult<(), AccessError>by delegating directly tocheck(...).await.into_result(). It preserves denial versus indeterminate classification and complete error evidence without adding an evaluator. Documentation explains thatmust_usecatches accidental omissions but still permits deliberate bypass.Validation: formatting, Clippy with warnings denied, workspace build, all-target/all-feature tests, and doctests. Contract tests cover grants, denials, indeterminate outcomes, veto short-circuiting, preserved evidence, and one evaluation per applicable policy. Compile-fail doctests verify discarded awaited decisions fail under
deny(unused_must_use)for all three result types and both batch methods.Closes #68.