altimate-receipts 0.10.0 → 0.12.0

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.
@@ -7,7 +7,7 @@ import {
7
7
  loadSession,
8
8
  selectSummary,
9
9
  upsertSection
10
- } from "./chunk-63E3RZHD.js";
10
+ } from "./chunk-EY3FFYN6.js";
11
11
 
12
12
  // src/report/sessions.ts
13
13
  async function deriveTargets(opts) {
@@ -259,4 +259,4 @@ export {
259
259
  renderTrends,
260
260
  upsertTrendsSection
261
261
  };
262
- //# sourceMappingURL=chunk-JE6HSACL.js.map
262
+ //# sourceMappingURL=chunk-D4RJFPLT.js.map
@@ -2707,9 +2707,7 @@ function deriveFindings(sum) {
2707
2707
  }
2708
2708
  }
2709
2709
  }
2710
- const destructiveCmd = (sp) => typeof sp.input === "object" && sp.input ? String(
2711
- sp.input.command ?? sp.input.query ?? ""
2712
- ) : String(sp.input ?? "");
2710
+ const destructiveCmd = (sp) => commandOf(sp.input);
2713
2711
  const destructiveGroups = /* @__PURE__ */ new Map();
2714
2712
  for (const sp of sum.spans.filter((s) => s.destructive)) {
2715
2713
  const cmd = destructiveCmd(sp);
@@ -2724,7 +2722,7 @@ function deriveFindings(sum) {
2724
2722
  }
2725
2723
  for (const { first: sp, clause, count } of [...destructiveGroups.values()].slice(0, 3)) {
2726
2724
  const times = count > 1 ? ` \xD7${count}` : "";
2727
- const snippet = clause.slice(0, 44);
2725
+ const snippet = truncateClause(clause, 44);
2728
2726
  findings.push({
2729
2727
  id: `destructive-${sp.spanId}`,
2730
2728
  severity: "critical",
@@ -2855,6 +2853,14 @@ function deriveFindings(sum) {
2855
2853
  minor: deduped.filter((f) => f.confidence < 0.5)
2856
2854
  };
2857
2855
  }
2856
+ function truncateClause(s, limit) {
2857
+ if (s.length <= limit) {
2858
+ return s;
2859
+ }
2860
+ const head = s.slice(0, limit);
2861
+ const lastSpace = head.lastIndexOf(" ");
2862
+ return `${(lastSpace > 0 ? head.slice(0, lastSpace) : head).trimEnd()}\u2026`;
2863
+ }
2858
2864
 
2859
2865
  // src/findings/grade.ts
2860
2866
  function gradeLetter(main) {
@@ -3190,6 +3196,48 @@ function sha256Hex(data) {
3190
3196
  // src/receipt/build.ts
3191
3197
  import { basename } from "path";
3192
3198
 
3199
+ // src/findings/coverageClass.ts
3200
+ var GENERATED_PATTERNS = [
3201
+ // build / output / dependency directories (any depth)
3202
+ /(?:^|\/)(?:dist|build|out|target|node_modules|__pycache__|\.next|\.turbo|\.nuxt|coverage|vendor)\//,
3203
+ // lockfiles (regenerated, never hand-authored line-by-line)
3204
+ /(?:^|\/)(?:package-lock\.json|yarn\.lock|pnpm-lock\.yaml|poetry\.lock|Cargo\.lock|composer\.lock|Gemfile\.lock|go\.sum|flake\.lock|uv\.lock)$/,
3205
+ /\.lock$/,
3206
+ // snapshot + generated-code markers
3207
+ /\.snap$/,
3208
+ /\.generated\.[a-z0-9]+$/i,
3209
+ /(?:^|\/)[^/]*\.(?:pb|pb2)\.[a-z]+$/i,
3210
+ // *.pb.go / *.pb.py
3211
+ /_pb2(?:_grpc)?\.py$/,
3212
+ // protobuf python
3213
+ /\.g\.dart$/,
3214
+ // dart codegen
3215
+ /\.min\.(?:js|css)$/
3216
+ // minified bundles
3217
+ ];
3218
+ function classifyUncovered(path2, extraGenerated = []) {
3219
+ const p = path2.replace(/^\.\//, "");
3220
+ if (GENERATED_PATTERNS.some((re) => re.test(p)) || extraGenerated.some((re) => re.test(p))) {
3221
+ return "generated";
3222
+ }
3223
+ return "unwitnessed";
3224
+ }
3225
+ function globsToRegexes(globs) {
3226
+ if (!globs?.length) {
3227
+ return [];
3228
+ }
3229
+ const out = [];
3230
+ for (const raw of globs) {
3231
+ const g = raw.trim();
3232
+ if (!g) {
3233
+ continue;
3234
+ }
3235
+ const body = g.replace(/[.+^${}()|[\]\\]/g, "\\$&").split("**").map((seg) => seg.replace(/\*/g, "[^/]*")).join(".*");
3236
+ out.push(new RegExp(`(?:^|/)${body}$`));
3237
+ }
3238
+ return out;
3239
+ }
3240
+
3193
3241
  // src/findings/testMetrics.ts
3194
3242
  var intAfter = (line, re) => {
3195
3243
  const m = line.match(re);
@@ -3281,6 +3329,7 @@ var LABEL = {
3281
3329
  "ran-tests": "Ran the tests"
3282
3330
  };
3283
3331
  var STATUS_ICON = { PASS: "\u2705", UNVERIFIED: "\u2B1C" };
3332
+ var STATUS_WORD = { PASS: "confirmed", UNVERIFIED: "UNVERIFIED" };
3284
3333
  function deriveClaims(finalText, testsRan, findingIds) {
3285
3334
  const rows = [];
3286
3335
  if (CLAIMS_COMMITTED.test(finalText)) {
@@ -3302,7 +3351,9 @@ function deriveClaims(finalText, testsRan, findingIds) {
3302
3351
  }
3303
3352
  function renderLedger(rows) {
3304
3353
  if (!rows.length) return "";
3305
- const body = rows.map((r) => `| ${LABEL[r.kind]} | ${STATUS_ICON[r.status]} ${r.status} | ${r.evidence} |`).join("\n");
3354
+ const body = rows.map(
3355
+ (r) => `| ${LABEL[r.kind]} | ${STATUS_ICON[r.status]} ${STATUS_WORD[r.status]} | ${r.evidence} |`
3356
+ ).join("\n");
3306
3357
  return [
3307
3358
  "### \u{1F9FE} Claim ledger \u2014 what the summary said vs the transcript",
3308
3359
  "",
@@ -3310,7 +3361,7 @@ function renderLedger(rows) {
3310
3361
  "| :-- | :-- | :-- |",
3311
3362
  body,
3312
3363
  "",
3313
- "<sub>Only the agent's literal, mechanically-checkable claims appear. \u2705 PASS = confirmed in the transcript \xB7 \u2B1C UNVERIFIED = could not confirm (never a judgement that it's false). Deterministic \xB7 0 model calls \xB7 evidence, not judgement.</sub>"
3364
+ "<sub>Only the agent's literal, mechanically-checkable claims appear. \u2705 confirmed = the claim is borne out by the transcript (e.g. a test command ran \u2014 NOT that tests passed) \xB7 \u2B1C UNVERIFIED = could not confirm (never a judgement that it's false). Deterministic \xB7 0 model calls \xB7 evidence, not judgement.</sub>"
3314
3365
  ].join("\n");
3315
3366
  }
3316
3367
 
@@ -3396,12 +3447,17 @@ function deriveEvidence(session, sum, scope) {
3396
3447
  }
3397
3448
  }
3398
3449
  let coveredFiles;
3450
+ let coverageGaps;
3399
3451
  if (scope?.kind === "diff" && scope.files?.length) {
3400
3452
  const touched = tools.filter((s) => isEditTool(s.name) || isReadTool(s.name)).map((s) => filePathOf(s.input)).filter((f) => !!f);
3401
3453
  const cmdTexts = commandSpans.map((s) => commandOf(s.input)).filter(Boolean);
3402
- coveredFiles = scope.files.filter(
3403
- (f) => touched.some((t) => samePath(t, f)) || cmdTexts.some((c) => commandMentionsFile(c, [f]))
3404
- ).length;
3454
+ const isCovered = (f) => touched.some((t) => samePath(t, f)) || cmdTexts.some((c) => commandMentionsFile(c, [f]));
3455
+ coveredFiles = scope.files.filter(isCovered).length;
3456
+ const uncovered = [...scope.files].filter((f) => !isCovered(f)).sort();
3457
+ if (uncovered.length) {
3458
+ const extra = globsToRegexes(scope.generatedGlobs);
3459
+ coverageGaps = uncovered.slice(0, 30).map((path2) => ({ path: path2, kind: classifyUncovered(path2, extra) }));
3460
+ }
3405
3461
  }
3406
3462
  const tk = session.totals.tokens;
3407
3463
  return {
@@ -3411,6 +3467,7 @@ function deriveEvidence(session, sum, scope) {
3411
3467
  reads,
3412
3468
  destructiveOps: sum.destructiveCount,
3413
3469
  ...coveredFiles != null ? { coveredFiles } : {},
3470
+ ...coverageGaps ? { coverageGaps } : {},
3414
3471
  testsRan,
3415
3472
  ...sum.diffCostUsd != null ? {
3416
3473
  // sub-cent costs keep 4dp — 2dp rounding recorded $0.004 work as $0.00
@@ -5154,4 +5211,4 @@ export {
5154
5211
  redact,
5155
5212
  redactReceipt
5156
5213
  };
5157
- //# sourceMappingURL=chunk-63E3RZHD.js.map
5214
+ //# sourceMappingURL=chunk-EY3FFYN6.js.map