pub enum Refusal {
ChecksFailed {
failed: Vec<String>,
records: Vec<CheckRecord>,
},
Rejected {
reason: String,
},
AuthorFailed {
code: String,
diagnostics: Option<String>,
},
PolicyViolation {
reason: String,
},
SetupFailed {
step: String,
reason: String,
},
Interrupted,
TimedOut {
after_secs: u64,
},
NoChange,
SelfApproval {
actor: ActorId,
},
}Expand description
Why a gate refused.
ChecksFailed carries the check records rather than only the names. A run
that fails is exactly when the evidence matters most, so the refusal itself
holds it and a caller cannot record the outcome without it.
Variants§
ChecksFailed
One or more required checks failed. Named so the reason is legible.
Rejected
The reviewer rejected the change.
AuthorFailed
The authoring agent could not run, and left nothing behind.
Distinct from a rejection: nothing was judged. A vendor that hit a rate limit or an expired credential and a vendor that considered the task and declined it are the same empty diff, and only one of them is about the change. Its own words are carried so the difference is legible.
PolicyViolation
The change touched paths the project’s policy does not allow.
SetupFailed
The worktree could not be made ready to work in.
Nothing was judged and nothing was written: the environment was not there. Reporting it as a failed check would say the change was rejected, which is the confusion this variant exists to end.
Interrupted
The operator stopped the run.
Not a judgement on the change at all — nobody finished looking at it.
TimedOut
The authoring agent outlived the ceiling and was killed.
Not a rejection and not a crash: nothing was judged, and the change was never finished. Reporting it as either would blame the work for the clock.
NoChange
The authoring agent ran cleanly and changed nothing.
A legitimate answer to a task — the work was already done, or the agent judged that nothing was needed — and not one a reviewer can rule on: it would be handed an empty diff and asked what it thinks of it.
SelfApproval
The reviewer and the author are the same identity.