@jphutchins/code-review 0.1.0-alpha.55 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jphutchins/code-review",
3
- "version": "0.1.0-alpha.55",
3
+ "version": "0.1.0-alpha.56",
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",
@@ -10,7 +10,7 @@
10
10
  <%~ it.findingsPointer %>
11
11
  <% } -%>
12
12
 
13
- ### <%= it.verdictBadge(it.findings.verdict) %>
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
- ### 🔗 Systemic problems
48
+ ## 🔗 Systemic problems
49
49
 
50
50
  <% it.systemic.forEach(function(s) { -%>
51
- #### <%= it.severityEmoji(s.severity) %> (<%= s.severity %>) <%= s.title %><% if (s.id) { %> (<% if (s.code_url) { %>[`<%= s.id %>`](<%~ s.code_url %>)<% } else { %>`<%= s.id %>`<% } %>)<% } %> · confidence <%= it.formatConfidence(s.confidence) %>
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) { -%>
@@ -93,7 +100,7 @@
93
100
  <% } %>
94
101
 
95
102
  <% if (it.strays.length > 0) { %>
96
- ### <% 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' %><% } %>
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,7 +110,8 @@ _<%= it.unanchoredCount %> finding<%= it.unanchoredCount === 1 ? '' : 's' %> bel
103
110
  <% } %>
104
111
 
105
112
  <% it.strays.forEach(function(f) { -%>
106
- #### <%= it.severityEmoji(f.severity) %> (<%= f.severity %>) `<%= f.path %>:<%= f.rangeLabel %><% if (f.side) { %> (<%= f.side %>)<% } %>` — <%= f.title %><% if (f.id) { %> (<% if (f.code_url) { %>[`<%= f.id %>`](<%~ f.code_url %>)<% } else { %>`<%= f.id %>`<% } %>)<% } %> · confidence <%= it.formatConfidence(f.confidence) %> · likelihood <%= it.formatConfidence(f.likelihood) %>
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_<% } %>
@@ -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
- > [!TIP]
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.id) { %> (<% if (n.codeUrl) { %>[`<%= n.id %>`](<%~ n.codeUrl %>)<% } else { %>`<%= n.id %>`<% } %>)<% } %> _(m = <%= n.m %>)_
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 + ')' : '') %>