fleetreach_core/outcome.rs
1use serde::{Deserialize, Serialize};
2
3use crate::RepoId;
4
5/// Per-repo scan status. A repo we could not read is `Errored` and the run
6/// continues — but it forces a non-clean exit (§8): you cannot assert
7/// "fleet-clean" over a repo you never read.
8#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
9pub struct RepoOutcome {
10 pub repo: RepoId,
11 #[serde(flatten)]
12 pub status: ScanStatus,
13}
14
15/// Serializes with a `status` tag and the variant fields inlined, e.g.
16/// `{ "repo": "core-lib", "status": "scanned", "vulns": 2, "warnings": 1 }`.
17#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
18#[serde(tag = "status", rename_all = "lowercase")]
19pub enum ScanStatus {
20 Scanned { vulns: usize, warnings: usize },
21 Errored { reason: String },
22}