Skip to main content

fallow_output/
audit_routing.rs

1//! Audit reviewer-routing output contracts.
2
3use serde::Serialize;
4
5/// One routed unit with its experts and bus-factor flag.
6#[derive(Debug, Clone, Serialize)]
7#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
8pub struct RoutingUnit {
9    /// Root-relative path of the changed file.
10    pub file: String,
11    /// The routed expert(s): the CODEOWNERS declared owner when present, else the
12    /// top git-blame / recency contributor; empty when no signal is available.
13    pub expert: Vec<String>,
14    /// Whether the only qualified owner is a single contributor (bus-factor-1):
15    /// a knowledge-concentration risk worth a second reviewer.
16    #[serde(default, skip_serializing_if = "std::ops::Not::not")]
17    pub bus_factor_one: bool,
18}
19
20/// The full routing section: one unit per changed source file with a routable
21/// signal. Files with no ownership signal are omitted (no noise).
22#[derive(Debug, Clone, Default, Serialize)]
23#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
24pub struct RoutingFacts {
25    /// Per-changed-file routing units, sorted by file path.
26    pub units: Vec<RoutingUnit>,
27}