@jphutchins/code-review 0.1.0-alpha.54 → 0.1.0-alpha.56
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/README.md +2 -2
- package/dist/index.js +919 -200
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/schema/VERSIONING.md +6 -2
- package/schema/findings.schema.json +17 -16
- package/schema/v0.9/findings.schema.json +418 -0
- package/templates/comment.eta +47 -12
package/templates/comment.eta
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<%~ it.findingsPointer %>
|
|
11
11
|
<% } -%>
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## <%= it.verdictBadge(it.findings.verdict) %>
|
|
14
14
|
|
|
15
15
|
<% const meta = [] %><% if (it.postedAt) { meta.push('**Reviewed** `' + it.reviewedSha.slice(0, 7) + '` at ' + it.postedAt) } %><% if (it.route) { meta.push('**route:** ' + it.route) } %><% if (it.effort) { meta.push('**effort:** ' + it.effort) } %><% if (it.hasUsage) { meta.push('**turns:** ' + it.envelope.turns); meta.push('**wall:** ' + it.formatDuration(it.envelope.duration_ms)); meta.push('**models:** ' + it.modelNames); meta.push('**cost:** ' + it.formatCost(it.costReport.totalCostUSD)) } else { meta.push('_usage unavailable_') } %><sub><%~ meta.join(' · ') %></sub>
|
|
16
16
|
<% if (!it.incomplete) { -%>
|
|
@@ -45,15 +45,22 @@
|
|
|
45
45
|
|
|
46
46
|
<% if (!it.incomplete && it.systemic.length > 0) { -%>
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
## 🔗 Systemic problems
|
|
49
49
|
|
|
50
50
|
<% it.systemic.forEach(function(s) { -%>
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
### <%= it.severityEmoji(s.severity) %> (<%= s.severity %>) <%= s.title %>
|
|
52
|
+
<sub>confidence <%= it.formatConfidence(s.confidence) %><% if (s.id) { %> · id <% if (s.code_url) { %>[`<%~ s.id %>`](<%~ s.code_url %>)<% } else { %>`<%~ s.id %>`<% } %><% } %></sub>
|
|
53
|
+
<% const meta = [] %><% if (s.paths && s.paths.length > 0) { meta.push('Affects: ' + s.paths.map(function(p) { return '`' + p + '`' }).join(', ')) } %><% if (s.finding_ids && s.finding_ids.length > 0) { meta.push('Ties together: ' + s.finding_ids.map(function(c) { return '`' + c + '`' }).join(', ')) } %><% if (meta.length > 0) { %>_<%~ meta.join(' · ') %>_<% } %>
|
|
53
54
|
|
|
54
55
|
<%~ s.description %>
|
|
56
|
+
<% if (s.discussionHtml) { -%>
|
|
57
|
+
|
|
58
|
+
<details><summary>💬 Discussion</summary>
|
|
59
|
+
|
|
60
|
+
<%~ s.discussionHtml %>
|
|
61
|
+
</details>
|
|
62
|
+
<% } -%>
|
|
55
63
|
|
|
56
|
-
> [!TIP]
|
|
57
64
|
> <details><summary>Reasoning</summary>
|
|
58
65
|
>
|
|
59
66
|
<% s.reasoning.split("\n").forEach(function(rl) { -%>
|
|
@@ -93,7 +100,7 @@
|
|
|
93
100
|
<% } %>
|
|
94
101
|
|
|
95
102
|
<% if (it.strays.length > 0) { %>
|
|
96
|
-
|
|
103
|
+
## <% if (it.inlineDisposition && (it.inlineDisposition.kind === 'disabled' || it.inlineDisposition.kind === 'whole-document')) { %>Findings<% } else if (it.inlineDisposition && it.inlineDisposition.kind === 'no-envelope') { %>Findings (no inline review — result envelope lost)<% } else { %><%= (it.unanchoredCount && it.unanchoredCount > 0) ? 'Findings' : 'Findings outside the diff' %><% } %>
|
|
97
104
|
<% if (it.inlineDisposition && it.inlineDisposition.kind === 'no-envelope') { %>
|
|
98
105
|
_Every finding is listed below — the inline review could not be built because the result envelope was missing._
|
|
99
106
|
<% } else if (it.inlineDisposition && it.inlineDisposition.kind === 'whole-document') { %>
|
|
@@ -103,16 +110,17 @@ _<%= it.unanchoredCount %> finding<%= it.unanchoredCount === 1 ? '' : 's' %> bel
|
|
|
103
110
|
<% } %>
|
|
104
111
|
|
|
105
112
|
<% it.strays.forEach(function(f) { -%>
|
|
106
|
-
|
|
113
|
+
### <%= it.severityEmoji(f.severity) %> (<%= f.severity %>) `<%= f.path %>:<%= f.rangeLabel %><% if (f.side) { %> (<%= f.side %>)<% } %>` — <%= f.title %>
|
|
114
|
+
<sub>confidence <%= it.formatConfidence(f.confidence) %> · likelihood <%= it.formatConfidence(f.likelihood) %><% if (f.id) { %> · id <% if (f.code_url) { %>[`<%~ f.id %>`](<%~ f.code_url %>)<% } else { %>`<%~ f.id %>`<% } %><% } %></sub>
|
|
107
115
|
<% if (f.permalink) { -%>
|
|
108
116
|
|
|
109
117
|
<%~ f.permalink %><% if (f.permalinkAnchored) { %> · _agent-reported location_<% } %>
|
|
110
118
|
<% } -%>
|
|
111
119
|
|
|
112
120
|
<%~ f.description %>
|
|
113
|
-
<% if (
|
|
121
|
+
<% if (it.sameRootNotes && Object.prototype.hasOwnProperty.call(it.sameRootNotes, f.idKey)) { -%>
|
|
114
122
|
|
|
115
|
-
> ⚠️ <%~ it.sameRootNotes[
|
|
123
|
+
> ⚠️ <%~ it.sameRootNotes[f.idKey] %>
|
|
116
124
|
<% } -%>
|
|
117
125
|
<% if (f.answeredNote) { -%>
|
|
118
126
|
|
|
@@ -133,9 +141,15 @@ _<%= it.unanchoredCount %> finding<%= it.unanchoredCount === 1 ? '' : 's' %> bel
|
|
|
133
141
|
<%~ f.patchProjection.raw %>
|
|
134
142
|
```
|
|
135
143
|
<% } -%>
|
|
144
|
+
<% if (f.discussionHtml) { -%>
|
|
145
|
+
|
|
146
|
+
<details><summary>💬 Discussion</summary>
|
|
147
|
+
|
|
148
|
+
<%~ f.discussionHtml %>
|
|
149
|
+
</details>
|
|
150
|
+
<% } -%>
|
|
136
151
|
|
|
137
|
-
>
|
|
138
|
-
> <details><summary>Reasoning (<%= it.formatConfidence(f.confidence) %> confidence · <%= it.formatConfidence(f.likelihood) %> likelihood)</summary>
|
|
152
|
+
> <details><summary>Reasoning</summary>
|
|
139
153
|
>
|
|
140
154
|
<% f.reasoning.split("\n").forEach(function(rl) { -%>
|
|
141
155
|
> <%= rl %>
|
|
@@ -145,12 +159,33 @@ _<%= it.unanchoredCount %> finding<%= it.unanchoredCount === 1 ? '' : 's' %> bel
|
|
|
145
159
|
<% }) %>
|
|
146
160
|
<% } %>
|
|
147
161
|
|
|
162
|
+
<% if (it.discussionDropped > 0) { %>
|
|
163
|
+
_<%= it.discussionDropped %> discussion thread<%= it.discussionDropped === 1 ? '' : 's' %> not listed<% if ((it.discussionDroppedIds && it.discussionDroppedIds.length > 0) || (it.discussionDroppedSystemicIds && it.discussionDroppedSystemicIds.length > 0) || (it.discussionDroppedOrphanedIds && it.discussionDroppedOrphanedIds.length > 0)) { %> (<% if (it.discussionDroppedIds && it.discussionDroppedIds.length > 0) { %>finding<%= it.discussionDroppedIds.length === 1 ? '' : 's' %> <% it.discussionDroppedIds.forEach(function(id) { %>`<%~ id %>` <% }) %><% if ((it.discussionDroppedSystemicIds && it.discussionDroppedSystemicIds.length > 0) || (it.discussionDroppedOrphanedIds && it.discussionDroppedOrphanedIds.length > 0)) { %>· <% } %><% } %><% if (it.discussionDroppedSystemicIds && it.discussionDroppedSystemicIds.length > 0) { %>systemic<%= it.discussionDroppedSystemicIds.length === 1 ? '' : 's' %> <% it.discussionDroppedSystemicIds.forEach(function(id) { %>`<%~ id %>` <% }) %><% if (it.discussionDroppedOrphanedIds && it.discussionDroppedOrphanedIds.length > 0) { %>· <% } %><% } %><% if (it.discussionDroppedOrphanedIds && it.discussionDroppedOrphanedIds.length > 0) { %>earlier-round<% if (it.discussionDroppedOrphanedIds.length > 1) { %> (×<%= it.discussionDroppedOrphanedIds.length %>)<% } %> <% it.discussionDroppedOrphanedIds.forEach(function(id) { %>`<%~ id %>` <% }) %><% } %>)<% } %><% if (it.discussionDroppedExtra > 0) { %> +<%= it.discussionDroppedExtra %> more<% } %> — the links live on the comment thread._
|
|
164
|
+
<% } %>
|
|
165
|
+
|
|
166
|
+
<% if ((it.orphanedLines && it.orphanedLines.length > 0) || it.orphanedUnresolvable) { %>
|
|
167
|
+
## 💬 Discussions on findings from earlier rounds
|
|
168
|
+
|
|
169
|
+
<% if (it.orphanedUnresolvable && (!it.orphanedLines || it.orphanedLines.length === 0)) { %>
|
|
170
|
+
_Comments naming tokens outside this round's report could not be matched against the prior findings — the prior findings artifact could not be resolved, so whether they name departed findings is unknown._
|
|
171
|
+
<% } else { %>
|
|
172
|
+
<details><summary>Comments naming findings this round no longer reports (fixed or re-id'd) — the conversation stays discoverable.<% if (it.orphanedTotal > it.orphanedLines.length) { %> (showing <%= it.orphanedLines.length %> of <%= it.orphanedTotal %>)<% } %></summary>
|
|
173
|
+
|
|
174
|
+
<% it.orphanedLines.forEach(function(line) { -%>
|
|
175
|
+
<%~ line %>
|
|
176
|
+
<% }) -%>
|
|
177
|
+
|
|
178
|
+
</details>
|
|
179
|
+
<% } %>
|
|
180
|
+
<% } %>
|
|
181
|
+
|
|
148
182
|
<% if (it.suppressedNits && it.suppressedNits.length > 0) { %>
|
|
149
183
|
> [!NOTE]
|
|
150
184
|
> <details><summary>🔇 <%= it.suppressedNits.length %> nit<%= it.suppressedNits.length === 1 ? '' : 's' %> below the visibility floor (confidence × likelihood < <%= it.nitVisibilityFloor %>) — hidden</summary>
|
|
151
185
|
>
|
|
152
186
|
<% it.suppressedNits.forEach(function(n) { -%>
|
|
153
|
-
> - `<%= n.path %>:<%= n.startLine %>` — <%= n.title %><% if (n.
|
|
187
|
+
> - `<%= n.path %>:<%= n.startLine %>` — <%= n.title %><% if (n.id) { %> (<% if (n.codeUrl) { %>[`<%~ n.id %>`](<%~ n.codeUrl %>)<% } else { %>`<%~ n.id %>`<% } %>)<% } %> _(m = <%= n.m %>)_
|
|
188
|
+
<% if (n.discussionHtml) { %><%~ n.discussionHtml %><% } %>
|
|
154
189
|
> <%~ '<!-- code-review:suppressed-nit' %>
|
|
155
190
|
> <%~ 'severity: ' + n.severity %>
|
|
156
191
|
> <%~ 'location: ' + n.path + ':' + n.startLine + '-' + n.endLine + (n.side ? ' (' + n.side + ')' : '') %>
|