mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-29 05:11:19 -08:00
Add the Review Loop: unattended review-and-fix rounds in the desktop app and in loop phases
AI Assisted
This commit is contained in:
1 parent
d6a28b5dc8
commit
57567d7a0b
71 files changed
+11331
-443
No files matched your search
@@ -32,10 +32,42 @@ pub struct Assumption {
|
||||
pub note: String,
|
||||
}
|
||||
|
||||
/// Which loop wrote an entry. Entries saved before the Review Loop existed
|
||||
/// carry no kind and read as `Implementation`.
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "lowercase")]
|
||||
pub enum EntryKind {
|
||||
#[default]
|
||||
Implementation,
|
||||
Review,
|
||||
}
|
||||
|
||||
/// One round of a Review Loop, as its entry keeps it.
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(default, rename_all = "camelCase")]
|
||||
pub struct RoundEntry {
|
||||
pub n: u32,
|
||||
pub critical: u32,
|
||||
pub warning: u32,
|
||||
pub suggestion: u32,
|
||||
pub fixed: Vec<String>,
|
||||
pub left_open: Vec<String>,
|
||||
pub commit: Option<String>,
|
||||
pub tests: String,
|
||||
pub started: String,
|
||||
pub ended: String,
|
||||
/// "Balanced" and so on, or empty for an agent run as launched.
|
||||
pub strength: String,
|
||||
pub retried: bool,
|
||||
}
|
||||
|
||||
/// One thing that happened to a phase, in the order it happened.
|
||||
#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[serde(default, rename_all = "camelCase")]
|
||||
pub struct ReportEntry {
|
||||
pub kind: EntryKind,
|
||||
/// A Review Loop's rounds, in order; empty for an Implementation Loop phase.
|
||||
pub rounds: Vec<RoundEntry>,
|
||||
pub at: String,
|
||||
pub phase: u32,
|
||||
pub name: String,
|
||||
@@ -298,6 +330,23 @@ fn entry_markdown(md: &mut String, e: &ReportEntry) {
|
||||
if e.retries > 0 {
|
||||
md.push_str(&format!("- Retries: {}\n", e.retries));
|
||||
}
|
||||
if let Some(last) = e.rounds.last() {
|
||||
md.push_str(&format!(
|
||||
"- Extra review rounds: {} (left after: {} Critical, {} Warning)\n",
|
||||
e.rounds.len(),
|
||||
last.critical,
|
||||
last.warning
|
||||
));
|
||||
for round in &e.rounds {
|
||||
md.push_str(&format!(
|
||||
" - Round {}: {} Critical, {} Warning found, {} fixed\n",
|
||||
round.n,
|
||||
round.critical,
|
||||
round.warning,
|
||||
round.fixed.len()
|
||||
));
|
||||
}
|
||||
}
|
||||
if !e.warnings.is_empty() {
|
||||
let notes: Vec<String> = e.warnings.iter().map(|w| cell(w)).collect();
|
||||
md.push_str(&format!("- Warnings: {}\n", notes.join("; ")));
|
||||
|
||||
Reference in new issue
Block a user