@jphutchins/code-review 0.1.0-alpha.61 → 0.1.0-alpha.62

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.61",
3
+ "version": "0.1.0-alpha.62",
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",
@@ -1,5 +1,5 @@
1
1
  {
2
- "_comment": "USD per 1,000,000 tokens. PRICES DRIFT — keep _updated current. cost = sum over models of (input*in + output*out + cache_read*cache_read + cache_write*cache_write) / 1e6. A model's value is EITHER a flat all-day price OR a { \"slots\": [...] } set of UTC time-of-day slots for peak/off-peak pricing (issue #170), optionally with a \"weekend_slots\" partition for a provider that prices weekends differently (issue #216) — see schema/prices.schema.json, whose field descriptions are the spec: each slot is a half-open [utc_from, utc_to) UTC window, a slot whose utc_to <= utc_from wraps past midnight, and a model's slots must partition the 24h day with no gap or overlap. The CLI's vendor_cost_usd is vendor-priced and will be wrong for non-Anthropic backends; recompute from this map using the `models` array in the abstract result envelope (SPEC §6.1). Fill the zeros from your provider's pricing page.",
2
+ "_comment": "USD per 1,000,000 tokens. PRICES DRIFT — keep _updated current. cost = sum over models of (input*in + output*out + cache_read*cache_read + cache_write*cache_write) / 1e6. A model's value is EITHER a flat all-day price OR a { \"slots\": [...] } set of UTC time-of-day slots for peak/off-peak pricing (issue #170), optionally with a \"weekend_slots\" partition for a provider that prices weekends differently (issue #216) — see schema/prices.schema.json, whose field descriptions are the spec: each slot is a half-open [utc_from, utc_to) UTC window, a slot whose utc_to <= utc_from wraps past midnight, and a model's slots must partition the 24h day with no gap or overlap. The CLI's vendor_cost_usd is vendor-priced and will be wrong for non-Anthropic backends; recompute from this map using the `models` array in the abstract result envelope (SPEC §6.1). Fill the zeros from your provider's pricing page, then set _updated to the day you verified them — the staleness warn keys on it.",
3
3
  "_updated": "2026-07-03",
4
4
  "_unit": "USD per 1M tokens",
5
5
  "models": {
@@ -12,7 +12,7 @@
12
12
 
13
13
  ## <%= it.verdictBadge(it.findings.verdict) %>
14
14
 
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>
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, it.costProvenance)) } else { meta.push('_usage unavailable_') } %><sub><%~ meta.join(' · ') %></sub>
16
16
  <% if (!it.incomplete) { -%>
17
17
  <% if (it.roundsSummary) { -%>
18
18
  <sub><%~ it.roundsSummary %></sub>
@@ -229,9 +229,19 @@ All <%= it.testReport.total %> tests passed.
229
229
  > | Model | Input | Output | Cache read | Cache write | Cost |
230
230
  > |---|--:|--:|--:|--:|--:|
231
231
  <% it.costReport.lines.forEach(function(l) { -%>
232
- > | <%= l.model %> | <%= it.formatTokens(l.inputTokens) %> | <%= it.formatTokens(l.outputTokens) %> | <%= it.formatTokens(l.cacheReadTokens) %> | <%= it.formatTokens(l.cacheWriteTokens) %> | <%= it.formatCost(l.costUSD) %> |
232
+ > | <%= l.model %> | <%= it.formatTokens(l.inputTokens) %> | <%= it.formatTokens(l.outputTokens) %> | <%= it.formatTokens(l.cacheReadTokens) %> | <%= it.formatTokens(l.cacheWriteTokens) %> | <%= it.formatCost(l.costUSD, l.known ? 'complete' : 'unknown') %> |
233
233
  <% }) -%>
234
- > | **Total** | **<%= it.formatTokens(it.costReport.totalInputTokens) %>** | **<%= it.formatTokens(it.costReport.totalOutputTokens) %>** | **<%= it.formatTokens(it.costReport.totalCacheReadTokens) %>** | **<%= it.formatTokens(it.costReport.totalCacheWriteTokens) %>** | **<%= it.formatCost(it.costReport.totalCostUSD) %>** |
234
+ > | **Total** | **<%= it.formatTokens(it.costReport.totalInputTokens) %>** | **<%= it.formatTokens(it.costReport.totalOutputTokens) %>** | **<%= it.formatTokens(it.costReport.totalCacheReadTokens) %>** | **<%= it.formatTokens(it.costReport.totalCacheWriteTokens) %>** | **<%= it.formatCost(it.costReport.totalCostUSD, it.costProvenance) %>** |
235
+ <% if (it.pricesProvided) { -%>
236
+ <% if (it.stampValid) { -%>
237
+ > Prices snapshot `_updated` <%= it.pricesUpdatedAt %>.
238
+ <% } else { -%>
239
+ > `_updated` is not a parseable ISO date — the staleness check is skipped.
240
+ <% } -%>
241
+ <% } -%>
242
+ <% if (it.pricesProvided && it.costProvenance !== 'complete') { -%>
243
+ > N/A rows: models missing from this price map, or slots that do not cover the run instant — check the run log for the slot warning.
244
+ <% } -%>
235
245
  <% } else if (it.usageAvailable) { -%>
236
246
  > No per-model usage was recorded for this run.
237
247
  <% } else { -%>