From cac2044d78d9d9ef3751dc5b85e8fbc38a74e696 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mihailo=20Joki=C4=87?= Date: Sat, 7 Nov 2026 22:51:11 +0100 Subject: [PATCH] Print finding IDs in review text output Fix context, fix prompts, session prompts and local re-verification all take a finding ID, but only --json showed it. Text output now prints the ID under each finding. --- README.md | 2 ++ src/render.rs | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 25b8097..56114c5 100644 --- a/README.md +++ b/README.md @@ -148,3 +148,5 @@ A successful read is not a verdict: `PENDING`, `UNAVAILABLE` and `NOT_VERIFIED` retain their meaning. Only the server's recorded re-verification establishes a fix. Reads need `reviews:read`; verification also needs `reviews:request` and current repository write access. For unpushed local changes, use `review --verify`. +`review` and `findings` print each finding's ID in text output, so `fix context`, +`fix-prompt` and `review --verify` need no `--json` first. diff --git a/src/render.rs b/src/render.rs index 4c4578b..44e748f 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) { @@ -269,6 +271,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")]);