feat(tui): add per-severity finding counts to queue, review, and tasks views#671
feat(tui): add per-severity finding counts to queue, review, and tasks views#671cpcloud wants to merge 17 commits intoroborev-dev:mainfrom
Conversation
…ew output Refactors hasSeverityLabel into a shared classifySeverityLine helper that recognises critical/high/medium/low/info labels; CountFindings uses it to return per-bucket counts (high=critical+high, medium, low=low+info) while hasSeverityLabel remains a thin wrapper that excludes info-only output from the fail verdict, preserving existing ParseVerdict behaviour. Also tightens isLegendEntry to stop scanning at non-legend section headers (e.g. "Findings:") so findings below a legend block are correctly counted.
Add high_count, medium_count, low_count columns to the reviews table schema and a migration that adds them to existing databases. BackfillFindingCounts uses CountFindings to populate the columns for legacy rows where all three are zero and output is non-empty; idempotent across restarts.
roborev: Combined Review (
|
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
- HIGH from roborev-ci: make finding count columns nullable in both
SQLite and Postgres v13 schemas. NULL means "not yet parsed", 0
means "parsed and zero findings". The backfill now filters on
IS NULL and writes {h, m, l} unconditionally, so clean parsed
reviews stop matching the predicate after one pass instead of
being re-scanned on every daemon startup. SELECT sites that read
into int wrap the columns in COALESCE(..., 0) so legacy NULLs
don't fail Scan.
- Lint (testifylint): use assert.Len and assert.Contains in
severity_badge_test.go.
- Windows test failure in TestCountJobStats_FindingAggregation:
pass rA.RootPath instead of "/tmp/repo-a" so the filter matches
the absolute path that GetOrCreateRepo stored after filepath.Abs
+ ToSlash on Windows.
roborev: Combined Review (
|
Adds targeted unit tests to lift coverage on PR roborev-dev#671: - derefOrZero(nil) returns 0 (the previously uncovered branch). - migrateColumnConfig backfills 'findings' into a custom TaskColumnOrder (after 'parent' or appended), and leaves an already-migrated TaskColumnOrder alone.
roborev: Combined Review (
|
Drop the H/M/L letters from the in-row badge — they were doubling up with the column header and the colour already encodes severity. Slashes render in the same dim grey as zero counts so non-zero values pop in red/yellow/blue. Plain-text width drops from 8 to 5 for typical single-digit counts; the column header 'Findings' (still 8 chars) keeps the column from getting too narrow.
roborev: Combined Review (
|
|
Demo of the new Queue view — status header aggregates findings across visible jobs ( Review detail — header line shows |
Pushes patch coverage on PR roborev-dev#671 by exercising paths that the prior suite skipped: - TestPostgresMigration_FindingCounts (postgres-tagged): bootstraps a v12 schema, seeds a review, runs EnsureSchema to migrate to v13, asserts pre-existing rows have NULL counts, and verifies UpsertReview + PullReviews handle the new columns end-to-end (including the COALESCE on legacy NULLs). - Embeds postgres_v12.sql in the migration test helper so future v12 -> N migrations can start there. - Pins the existing TestPostgresMigration_SkipReasonAndClassify to v11 explicitly; the old pgSchemaVersion-1 form silently broke when the schema bumped to v13 because no v12 schema was embedded. - TestBackfillFindingCounts_PartialNull, _SkipsEmptyOutput, and _ClearsSyncedAt: cover the OR branch of the IS NULL predicate, the output != '' guard, and the synced_at = NULL re-queue.
roborev: Combined Review (
|
|
I wonder if the high/medium/low distinction survives language changes (e.g. if someone asks for the results to be in German) |
|
Good question, I doubt it. Seems like to account for that there would have to be a deeper refactor to have agents produce structured output with English-based JSON keys, and construct the TUI/UX from that instead of the current approach. I think this would be a backwards compatible change, only internals would see the JSON for now. |
|
I'll get clanking on that, and we can wait on this PR until that is in. |
|
Well, basically most of the supported review agent CLIs do not support anything like This PR can be closed out if we think it's too fragile or specific to English-output review text. |
|
i think we can keep it in draft until we come up with a better design |


Summary
CountFindingshelper that extracts high/medium/low counts from review output (critical+high → H, medium → M, low+info → L) and persist them as new columns on thereviewstable in both SQLite and PostgreSQL (Postgres bumped to schema v13).Findingscolumn in the queue table (toggleable, persisted in column config), aggregateFindings: H<n> M<n> L<n>line in queue status header, finding badges in the review detail header, and parent-review counts in the tasks view.derefOrZerohelper.JobStatscarries finding counts soroborev statusreflects them;ReviewJobcarries both own and parent counts so the tasks view can display the parent review's findings without a second fetch.