@jphutchins/code-review 0.1.0-alpha.55 → 0.1.0-alpha.57
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/dist/index.js +551 -81
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/comment.eta +46 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jphutchins/code-review",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.57",
|
|
4
4
|
"description": "Deterministic commenter for agentic PR review — gather, render, inline, post, adapt, extract, cost, validate, print-schema",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
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
|
-
|
|
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>
|
|
52
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) { -%>
|
|
@@ -71,7 +78,8 @@
|
|
|
71
78
|
> [!WARNING]
|
|
72
79
|
> **Unverified — no failing-job logs were available.** This route reads the failing CI job's log to
|
|
73
80
|
> name the failure; none could be staged for this run, so every finding below was reasoned from the
|
|
74
|
-
> diff
|
|
81
|
+
> diff or from local reproduction of the checks. Treat them as hypotheses until the failing log is
|
|
82
|
+
> checked.
|
|
75
83
|
|
|
76
84
|
<% } %>
|
|
77
85
|
|
|
@@ -93,7 +101,7 @@
|
|
|
93
101
|
<% } %>
|
|
94
102
|
|
|
95
103
|
<% if (it.strays.length > 0) { %>
|
|
96
|
-
|
|
104
|
+
## <% 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
105
|
<% if (it.inlineDisposition && it.inlineDisposition.kind === 'no-envelope') { %>
|
|
98
106
|
_Every finding is listed below — the inline review could not be built because the result envelope was missing._
|
|
99
107
|
<% } else if (it.inlineDisposition && it.inlineDisposition.kind === 'whole-document') { %>
|
|
@@ -103,7 +111,8 @@ _<%= it.unanchoredCount %> finding<%= it.unanchoredCount === 1 ? '' : 's' %> bel
|
|
|
103
111
|
<% } %>
|
|
104
112
|
|
|
105
113
|
<% it.strays.forEach(function(f) { -%>
|
|
106
|
-
|
|
114
|
+
### <%= it.severityEmoji(f.severity) %> (<%= f.severity %>) `<%= f.path %>:<%= f.rangeLabel %><% if (f.side) { %> (<%= f.side %>)<% } %>` — <%= f.title %>
|
|
115
|
+
<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
116
|
<% if (f.permalink) { -%>
|
|
108
117
|
|
|
109
118
|
<%~ f.permalink %><% if (f.permalinkAnchored) { %> · _agent-reported location_<% } %>
|
|
@@ -133,9 +142,15 @@ _<%= it.unanchoredCount %> finding<%= it.unanchoredCount === 1 ? '' : 's' %> bel
|
|
|
133
142
|
<%~ f.patchProjection.raw %>
|
|
134
143
|
```
|
|
135
144
|
<% } -%>
|
|
145
|
+
<% if (f.discussionHtml) { -%>
|
|
146
|
+
|
|
147
|
+
<details><summary>💬 Discussion</summary>
|
|
148
|
+
|
|
149
|
+
<%~ f.discussionHtml %>
|
|
150
|
+
</details>
|
|
151
|
+
<% } -%>
|
|
136
152
|
|
|
137
|
-
>
|
|
138
|
-
> <details><summary>Reasoning (<%= it.formatConfidence(f.confidence) %> confidence · <%= it.formatConfidence(f.likelihood) %> likelihood)</summary>
|
|
153
|
+
> <details><summary>Reasoning</summary>
|
|
139
154
|
>
|
|
140
155
|
<% f.reasoning.split("\n").forEach(function(rl) { -%>
|
|
141
156
|
> <%= rl %>
|
|
@@ -145,12 +160,33 @@ _<%= it.unanchoredCount %> finding<%= it.unanchoredCount === 1 ? '' : 's' %> bel
|
|
|
145
160
|
<% }) %>
|
|
146
161
|
<% } %>
|
|
147
162
|
|
|
163
|
+
<% if (it.discussionDropped > 0) { %>
|
|
164
|
+
_<%= 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._
|
|
165
|
+
<% } %>
|
|
166
|
+
|
|
167
|
+
<% if ((it.orphanedLines && it.orphanedLines.length > 0) || it.orphanedUnresolvable) { %>
|
|
168
|
+
## 💬 Discussions on findings from earlier rounds
|
|
169
|
+
|
|
170
|
+
<% if (it.orphanedUnresolvable && (!it.orphanedLines || it.orphanedLines.length === 0)) { %>
|
|
171
|
+
_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._
|
|
172
|
+
<% } else { %>
|
|
173
|
+
<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>
|
|
174
|
+
|
|
175
|
+
<% it.orphanedLines.forEach(function(line) { -%>
|
|
176
|
+
<%~ line %>
|
|
177
|
+
<% }) -%>
|
|
178
|
+
|
|
179
|
+
</details>
|
|
180
|
+
<% } %>
|
|
181
|
+
<% } %>
|
|
182
|
+
|
|
148
183
|
<% if (it.suppressedNits && it.suppressedNits.length > 0) { %>
|
|
149
184
|
> [!NOTE]
|
|
150
185
|
> <details><summary>🔇 <%= it.suppressedNits.length %> nit<%= it.suppressedNits.length === 1 ? '' : 's' %> below the visibility floor (confidence × likelihood < <%= it.nitVisibilityFloor %>) — hidden</summary>
|
|
151
186
|
>
|
|
152
187
|
<% it.suppressedNits.forEach(function(n) { -%>
|
|
153
|
-
> - `<%= n.path %>:<%= n.startLine %>` — <%= n.title %><% if (n.id) { %> (<% if (n.codeUrl) { %>[
|
|
188
|
+
> - `<%= n.path %>:<%= n.startLine %>` — <%= n.title %><% if (n.id) { %> (<% if (n.codeUrl) { %>[`<%~ n.id %>`](<%~ n.codeUrl %>)<% } else { %>`<%~ n.id %>`<% } %>)<% } %> _(m = <%= n.m %>)_
|
|
189
|
+
<% if (n.discussionHtml) { %><%~ n.discussionHtml %><% } %>
|
|
154
190
|
> <%~ '<!-- code-review:suppressed-nit' %>
|
|
155
191
|
> <%~ 'severity: ' + n.severity %>
|
|
156
192
|
> <%~ 'location: ' + n.path + ':' + n.startLine + '-' + n.endLine + (n.side ? ' (' + n.side + ')' : '') %>
|