altimate-receipts 0.11.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-TG5QGFHQ.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-RIY4BTDX.js.map
262
+ //# sourceMappingURL=chunk-D4RJFPLT.js.map
@@ -3196,6 +3196,48 @@ function sha256Hex(data) {
3196
3196
  // src/receipt/build.ts
3197
3197
  import { basename } from "path";
3198
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
+
3199
3241
  // src/findings/testMetrics.ts
3200
3242
  var intAfter = (line, re) => {
3201
3243
  const m = line.match(re);
@@ -3405,12 +3447,17 @@ function deriveEvidence(session, sum, scope) {
3405
3447
  }
3406
3448
  }
3407
3449
  let coveredFiles;
3450
+ let coverageGaps;
3408
3451
  if (scope?.kind === "diff" && scope.files?.length) {
3409
3452
  const touched = tools.filter((s) => isEditTool(s.name) || isReadTool(s.name)).map((s) => filePathOf(s.input)).filter((f) => !!f);
3410
3453
  const cmdTexts = commandSpans.map((s) => commandOf(s.input)).filter(Boolean);
3411
- coveredFiles = scope.files.filter(
3412
- (f) => touched.some((t) => samePath(t, f)) || cmdTexts.some((c) => commandMentionsFile(c, [f]))
3413
- ).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
+ }
3414
3461
  }
3415
3462
  const tk = session.totals.tokens;
3416
3463
  return {
@@ -3420,6 +3467,7 @@ function deriveEvidence(session, sum, scope) {
3420
3467
  reads,
3421
3468
  destructiveOps: sum.destructiveCount,
3422
3469
  ...coveredFiles != null ? { coveredFiles } : {},
3470
+ ...coverageGaps ? { coverageGaps } : {},
3423
3471
  testsRan,
3424
3472
  ...sum.diffCostUsd != null ? {
3425
3473
  // sub-cent costs keep 4dp — 2dp rounding recorded $0.004 work as $0.00
@@ -5163,4 +5211,4 @@ export {
5163
5211
  redact,
5164
5212
  redactReceipt
5165
5213
  };
5166
- //# sourceMappingURL=chunk-TG5QGFHQ.js.map
5214
+ //# sourceMappingURL=chunk-EY3FFYN6.js.map