diff --git a/README.md b/README.md index 40c2e74..86063c3 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,8 @@ The CLI prints the request ID before it sends anything and never repeats the req ## Fix verification and agent sessions +`review` and `findings` print each finding’s ID in text output for use with `fix context`, `fix-prompt`, and `review --verify`. + ```sh proofline fix list --repo owner/repository --pr 42 proofline fix context FINDING_ID diff --git a/src/render.rs b/src/render.rs index a804c3b..6448aca 100644 --- a/src/render.rs +++ b/src/render.rs @@ -39,6 +39,8 @@ fn finding(out: &mut Vec, finding: &Finding) { if let Some(remediation) = &finding.remediation { out.push(format!(" fix: {}", one_line(remediation))); } + // fix and session commands take this ID, so text output must not need --json + out.push(format!(" id: {}", finding.id)); } fn assessment(out: &mut Vec, assessment: &Assessment) { @@ -283,6 +285,18 @@ mod tests { assert!(places.is_sorted(), "{text}"); } + #[test] + fn each_finding_prints_the_id_that_fix_commands_take() { + let mut item = finding("SERIOUS", "lost order"); + item.id = uuid::Uuid::from_u128(0x0123_4567_89ab_cdef_0123_4567_89ab_cdef); + let detail = sample("COMPLETED", vec![item]); + let text = review(&detail, None, &url()); + assert!( + text.contains(" id: 01234567-89ab-cdef-0123-456789abcdef\n"), + "{text}" + ); + } + #[test] fn model_text_cannot_drive_the_terminal() { let detail = sample("COMPLETED", vec![finding("SERIOUS", "x\u{1b}[2J\ny")]);