ralph-review 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ralph-review",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Orchestrating coding agents for code review, verification and fixing via the ralph loop.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -240,7 +240,6 @@ export function Dashboard({ projectPath, branch, refreshInterval = 1000 }: Dashb
240
240
  findings={state.findings}
241
241
  storedFindings={state.storedFindings}
242
242
  selectedFindingIds={state.selectedFindingIds}
243
- selectedFindings={state.selectedFindings}
244
243
  fixResults={state.fixResults}
245
244
  unresolvedSelectedFindings={state.unresolvedSelectedFindings}
246
245
  auditRegressionFindings={state.auditRegressionFindings}
@@ -25,7 +25,6 @@ interface DetailPaneProps {
25
25
  findings: Finding[];
26
26
  storedFindings: StoredFinding[];
27
27
  selectedFindingIds: FindingId[];
28
- selectedFindings: StoredFinding[];
29
28
  fixResults: FindingFixResult[];
30
29
  unresolvedSelectedFindings: StoredFinding[];
31
30
  auditRegressionFindings: StoredFinding[];
@@ -53,7 +52,6 @@ export function DetailPane({
53
52
  findings,
54
53
  storedFindings,
55
54
  selectedFindingIds,
56
- selectedFindings,
57
55
  fixResults,
58
56
  unresolvedSelectedFindings,
59
57
  auditRegressionFindings,
@@ -112,7 +110,6 @@ export function DetailPane({
112
110
  findings={findings}
113
111
  storedFindings={storedFindings}
114
112
  selectedFindingIds={selectedFindingIds}
115
- selectedFindings={selectedFindings}
116
113
  fixResults={fixResults}
117
114
  unresolvedSelectedFindings={unresolvedSelectedFindings}
118
115
  auditRegressionFindings={auditRegressionFindings}
@@ -30,6 +30,7 @@ import {
30
30
  FindingsList,
31
31
  FixList,
32
32
  SectionHeader,
33
+ SelectableStoredFindingsList,
33
34
  SkippedList,
34
35
  StoredFindingsList,
35
36
  toSingleLine,
@@ -42,7 +43,6 @@ interface SessionDetailViewProps {
42
43
  findings: Finding[];
43
44
  storedFindings: StoredFinding[];
44
45
  selectedFindingIds: FindingId[];
45
- selectedFindings: StoredFinding[];
46
46
  fixResults: FindingFixResult[];
47
47
  unresolvedSelectedFindings: StoredFinding[];
48
48
  auditRegressionFindings: StoredFinding[];
@@ -157,7 +157,6 @@ export function SessionDetailView({
157
157
  findings,
158
158
  storedFindings,
159
159
  selectedFindingIds,
160
- selectedFindings,
161
160
  fixResults,
162
161
  unresolvedSelectedFindings,
163
162
  auditRegressionFindings,
@@ -255,12 +254,6 @@ export function SessionDetailView({
255
254
  session.selectedFindingIds && session.selectedFindingIds.length > 0
256
255
  ? session.selectedFindingIds
257
256
  : selectedFindingIds;
258
- const workflowSelectedFindings =
259
- selectedFindings.length > 0
260
- ? selectedFindings
261
- : workflowSelectedIds
262
- .map((findingId) => workflowFindingsById.get(findingId))
263
- .filter((finding): finding is StoredFinding => finding !== undefined);
264
257
  const workflowUnresolvedFindings =
265
258
  unresolvedSelectedFindings.length > 0
266
259
  ? unresolvedSelectedFindings
@@ -334,10 +327,24 @@ export function SessionDetailView({
334
327
  {batchFirstMode ? (
335
328
  <>
336
329
  <box flexDirection="column" flexBasis={0} flexGrow={5} minHeight={0}>
337
- <SectionHeader title="Findings inventory" count={batchDisplayFindings.length} />
330
+ <SectionHeader
331
+ title="Findings"
332
+ count={batchDisplayFindings.length}
333
+ suffix={
334
+ workflowSelectedIds.length > 0 ? (
335
+ <span fg={TUI_COLORS.text.dim}> · {workflowSelectedIds.length} selected</span>
336
+ ) : undefined
337
+ }
338
+ />
338
339
  <box flexGrow={1} minHeight={0}>
339
340
  {inventoryFindings.length > 0 ? (
340
- <StoredFindingsList findings={inventoryFindings} height="100%" focused={focused} />
341
+ <SelectableStoredFindingsList
342
+ findings={inventoryFindings}
343
+ selectedFindingIds={workflowSelectedIds}
344
+ height="100%"
345
+ focused={focused}
346
+ selectedFirst
347
+ />
341
348
  ) : showingCodex ? (
342
349
  <CodexReviewDisplay text={displayCodexText ?? ""} height="100%" focused={focused} />
343
350
  ) : (
@@ -346,15 +353,6 @@ export function SessionDetailView({
346
353
  </box>
347
354
  </box>
348
355
 
349
- {workflowSelectedFindings.length > 0 && (
350
- <box flexDirection="column" flexBasis={0} flexGrow={2} minHeight={0}>
351
- <SectionHeader title="Selected findings" count={workflowSelectedFindings.length} />
352
- <box flexGrow={1} minHeight={0}>
353
- <StoredFindingsList findings={workflowSelectedFindings} height="100%" />
354
- </box>
355
- </box>
356
- )}
357
-
358
356
  {fixResults.length > 0 && (
359
357
  <box flexDirection="column" flexBasis={0} flexGrow={2} minHeight={0}>
360
358
  <SectionHeader title="Fix results" count={fixResults.length} />
@@ -1,4 +1,8 @@
1
- import type { FindingFixResult, StoredFinding } from "@/lib/review-workflow/findings/types";
1
+ import type {
2
+ FindingFixResult,
3
+ FindingId,
4
+ StoredFinding,
5
+ } from "@/lib/review-workflow/findings/types";
2
6
  import { storedFindingToFinding } from "@/lib/review-workflow/presentation";
3
7
  import { formatFindingTitleForDisplay } from "@/lib/tui/sessions/finding-title";
4
8
  import { PriorityText } from "@/lib/tui/sessions/priority-text";
@@ -40,12 +44,14 @@ export function FindingsList({
40
44
  height = 8,
41
45
  focused = false,
42
46
  scrollable = true,
47
+ showBody = false,
43
48
  showConfidence = false,
44
49
  }: {
45
50
  findings: Finding[];
46
51
  height?: BoxHeight;
47
52
  focused?: boolean;
48
53
  scrollable?: boolean;
54
+ showBody?: boolean;
49
55
  showConfidence?: boolean;
50
56
  }) {
51
57
  if (findings.length === 0) {
@@ -63,6 +69,7 @@ export function FindingsList({
63
69
 
64
70
  return (
65
71
  <box key={key} flexDirection="column">
72
+ {showBody && index > 0 && <text> </text>}
66
73
  <box flexDirection="row">
67
74
  <text>
68
75
  <PriorityText priority={finding.priority} />
@@ -72,6 +79,14 @@ export function FindingsList({
72
79
  {toSingleLine(formatFindingTitleForDisplay(finding.title))}
73
80
  </text>
74
81
  </box>
82
+ {showBody && (
83
+ <>
84
+ <text> </text>
85
+ <text fg={TUI_COLORS.text.secondary} paddingLeft={5} wrapMode="word">
86
+ {finding.body.trim()}
87
+ </text>
88
+ </>
89
+ )}
75
90
  {showConfidence && (
76
91
  <text fg={TUI_COLORS.text.dim} paddingLeft={5} wrapMode="none">
77
92
  Confidence: {formatConfidenceScore(finding.confidence_score)}
@@ -100,12 +115,14 @@ export function StoredFindingsList({
100
115
  height = 8,
101
116
  focused = false,
102
117
  scrollable = true,
118
+ showBody = false,
103
119
  showConfidence = false,
104
120
  }: {
105
121
  findings: StoredFinding[];
106
122
  height?: BoxHeight;
107
123
  focused?: boolean;
108
124
  scrollable?: boolean;
125
+ showBody?: boolean;
109
126
  showConfidence?: boolean;
110
127
  }) {
111
128
  return (
@@ -114,11 +131,79 @@ export function StoredFindingsList({
114
131
  height={height}
115
132
  focused={focused}
116
133
  scrollable={scrollable}
134
+ showBody={showBody}
117
135
  showConfidence={showConfidence}
118
136
  />
119
137
  );
120
138
  }
121
139
 
140
+ export function SelectableStoredFindingsList({
141
+ findings,
142
+ selectedFindingIds,
143
+ height = 8,
144
+ focused = false,
145
+ scrollable = true,
146
+ selectedFirst = false,
147
+ }: {
148
+ findings: StoredFinding[];
149
+ selectedFindingIds: FindingId[];
150
+ height?: BoxHeight;
151
+ focused?: boolean;
152
+ scrollable?: boolean;
153
+ selectedFirst?: boolean;
154
+ }) {
155
+ if (findings.length === 0) {
156
+ return (
157
+ <text fg={TUI_COLORS.text.dim} paddingLeft={2}>
158
+ None yet
159
+ </text>
160
+ );
161
+ }
162
+
163
+ const selectedIdSet = new Set(selectedFindingIds);
164
+ const displayFindings = selectedFirst
165
+ ? [
166
+ ...findings.filter((finding) => selectedIdSet.has(finding.id)),
167
+ ...findings.filter((finding) => !selectedIdSet.has(finding.id)),
168
+ ]
169
+ : findings;
170
+
171
+ const content = displayFindings.map((finding) => {
172
+ const isSelected = selectedIdSet.has(finding.id);
173
+ const lineRange = `${finding.startLine}-${finding.endLine}`;
174
+
175
+ return (
176
+ <box key={finding.id} flexDirection="column">
177
+ <box flexDirection="row" gap={1}>
178
+ <text fg={isSelected ? TUI_COLORS.status.success : TUI_COLORS.text.dim}>
179
+ {isSelected ? "◉" : "◎"}
180
+ </text>
181
+ <text>
182
+ <PriorityText priority={finding.priority} />
183
+ </text>
184
+ <text fg={TUI_COLORS.text.dim}>▸</text>
185
+ <text fg={TUI_COLORS.text.secondary} wrapMode="none">
186
+ {toSingleLine(formatFindingTitleForDisplay(finding.title))}
187
+ </text>
188
+ </box>
189
+ <text fg={TUI_COLORS.text.dim} paddingLeft={7} wrapMode="none">
190
+ {toSingleLine(finding.filePath)}:{lineRange}
191
+ </text>
192
+ </box>
193
+ );
194
+ });
195
+
196
+ if (!scrollable) {
197
+ return <box paddingLeft={2}>{content}</box>;
198
+ }
199
+
200
+ return (
201
+ <scrollbox paddingLeft={2} height={height} focused={focused}>
202
+ {content}
203
+ </scrollbox>
204
+ );
205
+ }
206
+
122
207
  export function FixList({
123
208
  fixes,
124
209
  showFiles,
@@ -453,7 +453,12 @@ export function SessionDetailPane({
453
453
  <text fg={TUI_COLORS.text.secondary} paddingLeft={2}>
454
454
  {entry.findings.length} issues found
455
455
  </text>
456
- <StoredFindingsList findings={entry.findings} scrollable={false} showConfidence />
456
+ <StoredFindingsList
457
+ findings={entry.findings}
458
+ scrollable={false}
459
+ showBody
460
+ showConfidence
461
+ />
457
462
  </WorkflowSection>
458
463
  ))}
459
464
 
@@ -29,7 +29,6 @@ interface WorkspaceProps {
29
29
  findings: Finding[];
30
30
  storedFindings: StoredFinding[];
31
31
  selectedFindingIds: FindingId[];
32
- selectedFindings: StoredFinding[];
33
32
  fixResults: FindingFixResult[];
34
33
  unresolvedSelectedFindings: StoredFinding[];
35
34
  auditRegressionFindings: StoredFinding[];
@@ -61,7 +60,6 @@ export function Workspace({
61
60
  findings,
62
61
  storedFindings,
63
62
  selectedFindingIds,
64
- selectedFindings,
65
63
  fixResults,
66
64
  unresolvedSelectedFindings,
67
65
  auditRegressionFindings,
@@ -103,7 +101,6 @@ export function Workspace({
103
101
  findings={findings}
104
102
  storedFindings={storedFindings}
105
103
  selectedFindingIds={selectedFindingIds}
106
- selectedFindings={selectedFindings}
107
104
  fixResults={fixResults}
108
105
  unresolvedSelectedFindings={unresolvedSelectedFindings}
109
106
  auditRegressionFindings={auditRegressionFindings}