Skip to main content

check_request

Function check_request 

Source
pub fn check_request(request: &AnalysisRequest) -> Result<(), ExecError>
Expand description

The preflight every backend shares: explicit consent, denied egress, a read-only worktree, and a well-formed analyzer id.

It lives outside the trait so the guarantees are stated once and cannot drift between backends — a subprocess backend that forgot the consent check would otherwise be a one-line omission.

§Errors

Returns ExecError::ConsentRequired, ExecError::UnsupportedNetworkPolicy, ExecError::WorktreeNotReadOnly, or ExecError::InvalidAnalyzerId — the last when the analyzer id is not 1..=rto_graph::MAX_ANALYZER_ID characters of lowercase [a-z0-9._-].