crev_data/proof/review/
mod.rs1use crate::level::Level;
2pub use code::*;
3use derive_builder::Builder;
4pub use package::Draft;
5pub use package::*;
6use serde::{Deserialize, Serialize};
7use std::default::Default;
8
9pub mod code;
10pub mod package;
11
12#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialOrd, Ord, PartialEq, Eq, Default)]
13#[serde(rename_all = "lowercase")]
14pub enum Rating {
15 #[serde(alias = "dangerous")] Negative,
17 #[default]
18 Neutral,
19 Positive,
20 Strong,
21}
22
23#[derive(Clone, Debug, Serialize, Deserialize, Builder, PartialEq, Eq)]
25pub struct Review {
26 #[builder(default = "Default::default()")]
27 pub thoroughness: Level,
28 #[builder(default = "Default::default()")]
29 pub understanding: Level,
30 #[builder(default = "Default::default()")]
31 pub rating: Rating,
32}
33
34impl Default for Review {
35 fn default() -> Self {
36 Review::new_none()
37 }
38}
39
40#[derive(Clone, Debug, Serialize, Deserialize)]
46pub struct LlmAgentInfo {
47 pub model: String,
49 #[serde(
51 skip_serializing_if = "Option::is_none",
52 default,
53 rename = "model-version"
54 )]
55 pub model_version: Option<String>,
56 #[serde(rename = "human-guided", default)]
59 pub human_guided: bool,
60}
61
62impl Review {
63 #[must_use]
64 pub fn new_positive() -> Self {
65 Review {
66 thoroughness: Level::Low,
67 understanding: Level::Medium,
68 rating: Rating::Positive,
69 }
70 }
71
72 #[must_use]
73 pub fn new_negative() -> Self {
74 Review {
75 thoroughness: Level::Low,
76 understanding: Level::Medium,
77 rating: Rating::Negative,
78 }
79 }
80 #[must_use]
81 pub fn new_none() -> Self {
82 Review {
83 thoroughness: Level::None,
84 understanding: Level::None,
85 rating: Rating::Neutral,
86 }
87 }
88
89 #[must_use]
90 pub fn is_none(&self) -> bool {
91 *self == Self::new_none()
92 }
93}