MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / print_report

Function print_report

atomic-cli/src/commands/triage/output.rs:24–147  ·  view source on GitHub ↗

Render the report to stdout as the bounded human dashboard.

(report: &TriageReport)

Source from the content-addressed store, hash-verified

22
23/// Render the report to stdout as the bounded human dashboard.
24pub fn print_report(report: &TriageReport) {
25 let merkle_short: String = report.inputs.view_merkle.chars().take(8).collect();
26
27 // Verdict banner.
28 let verdict_label = match report.verdict {
29 Verdict::Ready => info("READY").to_string(),
30 Verdict::Blocked => emphasis(crate::output::error("BLOCKED")).to_string(),
31 Verdict::Stale => crate::output::warning("STALE").to_string(),
32 };
33 println!(
34 "{} {} \u{2192} {} {} ({}, {} change{})",
35 emphasis("triage"),
36 report.inputs.feature,
37 report.inputs.target,
38 verdict_label,
39 hint(&format!("merkle {merkle_short}")),
40 report.summary.changes,
41 if report.summary.changes == 1 { "" } else { "s" },
42 );
43
44 // Summary line.
45 println!(
46 " criteria {} met \u{00b7} {} unmet findings {} block \u{00b7} {} warn \u{00b7} {} info",
47 report.summary.criteria_met,
48 report.summary.criteria_unmet,
49 report.summary.findings_block,
50 report.summary.findings_warn,
51 report.summary.findings_info,
52 );
53
54 // Findings (already severity-sorted block → warn → info).
55 if !report.findings.is_empty() {
56 println!("\n{}", emphasis("Findings"));
57 for f in &report.findings {
58 println!(" {}", finding_line(f));
59 }
60 }
61
62 // Per-intent compact view with its criteria as ✓/✗.
63 if !report.intents.is_empty() {
64 println!("\n{}", emphasis("Intents"));
65 for intent in &report.intents {
66 let conform = if intent.conforms {
67 info("conforms").to_string()
68 } else {
69 crate::output::error(format!("{} violation(s)", intent.gate_violations.len()))
70 .to_string()
71 };
72 println!(" {} [{}]", emphasis(&intent.id), conform);
73 if let Some(reviewer) = &intent.reviewed_by {
74 println!(" {}", info(&format!("reviewed by {reviewer}")));
75 }
76 for c in &intent.criteria {
77 let mark = if c.status == "met" {
78 info("\u{2713}").to_string()
79 } else {
80 crate::output::error("\u{2717}").to_string()
81 };

Callers 1

runMethod · 0.85

Calls 7

infoFunction · 0.85
emphasisFunction · 0.85
errorFunction · 0.85
warningFunction · 0.85
hintFunction · 0.85
diff_stat_countsFunction · 0.85
is_emptyMethod · 0.45

Tested by

no test coverage detected