@jphutchins/code-review 0.1.0-alpha.11 → 0.1.0-alpha.13
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 +266 -83
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/comment.eta +17 -16
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.13",
|
|
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
|
@@ -5,11 +5,8 @@
|
|
|
5
5
|
<% } -%>
|
|
6
6
|
|
|
7
7
|
### <%= it.verdictBadge(it.findings.verdict) %>
|
|
8
|
-
<% if (it.postedAt) { -%>
|
|
9
|
-
Reviewed `<%= it.reviewedSha.slice(0, 7) %>` · <%= it.postedAt %>
|
|
10
|
-
<% } -%>
|
|
11
8
|
|
|
12
|
-
<% const meta = [] %><% if (it.route) { meta.push('**
|
|
9
|
+
<% 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.usageAvailable) { 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>
|
|
13
10
|
|
|
14
11
|
<%~ it.findings.summary %>
|
|
15
12
|
|
|
@@ -27,20 +24,23 @@ _No findings — clean review._
|
|
|
27
24
|
→ <%= it.inlineDisposition.count %> comment<%= it.inlineDisposition.count === 1 ? '' : 's' %> posted inline on `<%= it.inlineDisposition.sha.slice(0, 7) %>` — <% if (it.reviewUrl) { %>[see the review](<%~ it.reviewUrl %>)<% } else { %>see the review<% } %>.
|
|
28
25
|
<% } else if (it.inlineDisposition && it.inlineDisposition.kind === 'none-in-diff') { %>
|
|
29
26
|
→ No inline comments — all findings are outside the diff (listed below).
|
|
30
|
-
<% } else if (it.inlineDisposition && it.inlineDisposition.kind === '
|
|
31
|
-
→ Inline
|
|
27
|
+
<% } else if (it.inlineDisposition && it.inlineDisposition.kind === 'inline-unavailable') { %>
|
|
28
|
+
→ ⚠️ Inline comments couldn't be posted for this review (GitHub rejected a comment's position) — every finding is listed below instead.
|
|
32
29
|
<% } %>
|
|
33
30
|
|
|
34
31
|
<% if (it.strays.length > 0) { %>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
### <%= (it.unanchoredCount && it.unanchoredCount > 0) ? 'Findings' : 'Findings outside the diff' %>
|
|
33
|
+
<% if (it.unanchoredCount && it.unanchoredCount > 0) { %>
|
|
34
|
+
_<%= it.unanchoredCount %> finding<%= it.unanchoredCount === 1 ? '' : 's' %> below couldn't be posted as inline comment<%= it.unanchoredCount === 1 ? '' : 's' %> (GitHub rejected the position)<% if (it.strays.length > it.unanchoredCount) { %>; the rest are outside the diff<% } %>._
|
|
35
|
+
<% } %>
|
|
38
36
|
|
|
39
37
|
<% it.strays.forEach(function(f) { -%>
|
|
40
|
-
|
|
38
|
+
#### <%= it.severityEmoji(f.severity) %> (<%= f.severity %>) `<%= f.path %>:<%= f.start_line %><% if (f.start_line !== f.end_line) { %>–<%= f.end_line %><% } %>` — <%= f.title %> · confidence <%= it.formatConfidence(f.confidence) %>
|
|
39
|
+
|
|
40
|
+
<%~ f.description %>
|
|
41
41
|
<% if (f.recommendation) { -%>
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
**Recommended fix:** <%~ f.recommendation %>
|
|
44
44
|
<% } -%>
|
|
45
45
|
<% if (f.patchProjection.kind === "suggestion") { -%>
|
|
46
46
|
|
|
@@ -54,13 +54,14 @@ These findings are on lines not in the diff, so they can't be anchored as inline
|
|
|
54
54
|
```
|
|
55
55
|
<% } -%>
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
> [!TIP]
|
|
58
|
+
> <details><summary>Reasoning (<%= it.formatConfidence(f.confidence) %> confidence)</summary>
|
|
59
|
+
>
|
|
59
60
|
<% f.reasoning.split("\n").forEach(function(rl) { -%>
|
|
60
|
-
|
|
61
|
+
> <%= rl %>
|
|
61
62
|
<% }) -%>
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
>
|
|
64
|
+
> </details>
|
|
64
65
|
<% }) %>
|
|
65
66
|
<% } %>
|
|
66
67
|
|