altimate-receipts 0.11.0 → 0.13.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.
- package/dist/{chunk-RIY4BTDX.js → chunk-55AJDHKF.js} +2 -2
- package/dist/{chunk-TG5QGFHQ.js → chunk-G3YX5FUS.js} +57 -5
- package/dist/chunk-G3YX5FUS.js.map +1 -0
- package/dist/{chunk-7HNNVNNT.js → chunk-WANHGYFY.js} +55 -15
- package/dist/chunk-WANHGYFY.js.map +1 -0
- package/dist/cli.js +10 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/mcp/server.js +2 -2
- package/package.json +1 -1
- package/schema/agent-execution-receipt-v1.json +17 -0
- package/dist/chunk-7HNNVNNT.js.map +0 -1
- package/dist/chunk-TG5QGFHQ.js.map +0 -1
- /package/dist/{chunk-RIY4BTDX.js.map → chunk-55AJDHKF.js.map} +0 -0
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
loadSession,
|
|
8
8
|
selectSummary,
|
|
9
9
|
upsertSection
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-G3YX5FUS.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-
|
|
262
|
+
//# sourceMappingURL=chunk-55AJDHKF.js.map
|
|
@@ -2727,7 +2727,11 @@ function deriveFindings(sum) {
|
|
|
2727
2727
|
id: `destructive-${sp.spanId}`,
|
|
2728
2728
|
severity: "critical",
|
|
2729
2729
|
title: snippet ? `Destructive op: ${snippet}${times}` : `Destructive operation ran: ${sp.name}${times}`,
|
|
2730
|
-
|
|
2730
|
+
// M89 — scope-frame the largest noise bucket: a destructive op is a command the
|
|
2731
|
+
// agent RAN (in its workspace / against infra), not an edit to a reviewed file —
|
|
2732
|
+
// say so, and show the FULL command (not a 44-char title fragment) so the reviewer
|
|
2733
|
+
// can verify what ran. R2: mechanism + "confirm it was intended", never a verdict.
|
|
2734
|
+
detail: `The agent ran \`${truncateClause(clause, 200)}\` during the session \u2014 a command it executed, not an edit to a file in this PR. It's irreversible${sp.status === "error" ? " (it errored)" : ""}${count > 1 ? ` and ran ${count}\xD7` : ""} \u2014 confirm it was intended (e.g. a scratch/sandbox target), not a mistake on real data.`,
|
|
2731
2735
|
impactLabel: "data-loss risk",
|
|
2732
2736
|
confidence: 1,
|
|
2733
2737
|
score: scoreOf("critical", 1, 1),
|
|
@@ -3196,6 +3200,48 @@ function sha256Hex(data) {
|
|
|
3196
3200
|
// src/receipt/build.ts
|
|
3197
3201
|
import { basename } from "path";
|
|
3198
3202
|
|
|
3203
|
+
// src/findings/coverageClass.ts
|
|
3204
|
+
var GENERATED_PATTERNS = [
|
|
3205
|
+
// build / output / dependency directories (any depth)
|
|
3206
|
+
/(?:^|\/)(?:dist|build|out|target|node_modules|__pycache__|\.next|\.turbo|\.nuxt|coverage|vendor)\//,
|
|
3207
|
+
// lockfiles (regenerated, never hand-authored line-by-line)
|
|
3208
|
+
/(?:^|\/)(?:package-lock\.json|yarn\.lock|pnpm-lock\.yaml|poetry\.lock|Cargo\.lock|composer\.lock|Gemfile\.lock|go\.sum|flake\.lock|uv\.lock)$/,
|
|
3209
|
+
/\.lock$/,
|
|
3210
|
+
// snapshot + generated-code markers
|
|
3211
|
+
/\.snap$/,
|
|
3212
|
+
/\.generated\.[a-z0-9]+$/i,
|
|
3213
|
+
/(?:^|\/)[^/]*\.(?:pb|pb2)\.[a-z]+$/i,
|
|
3214
|
+
// *.pb.go / *.pb.py
|
|
3215
|
+
/_pb2(?:_grpc)?\.py$/,
|
|
3216
|
+
// protobuf python
|
|
3217
|
+
/\.g\.dart$/,
|
|
3218
|
+
// dart codegen
|
|
3219
|
+
/\.min\.(?:js|css)$/
|
|
3220
|
+
// minified bundles
|
|
3221
|
+
];
|
|
3222
|
+
function classifyUncovered(path2, extraGenerated = []) {
|
|
3223
|
+
const p = path2.replace(/^\.\//, "");
|
|
3224
|
+
if (GENERATED_PATTERNS.some((re) => re.test(p)) || extraGenerated.some((re) => re.test(p))) {
|
|
3225
|
+
return "generated";
|
|
3226
|
+
}
|
|
3227
|
+
return "unwitnessed";
|
|
3228
|
+
}
|
|
3229
|
+
function globsToRegexes(globs) {
|
|
3230
|
+
if (!globs?.length) {
|
|
3231
|
+
return [];
|
|
3232
|
+
}
|
|
3233
|
+
const out = [];
|
|
3234
|
+
for (const raw of globs) {
|
|
3235
|
+
const g = raw.trim();
|
|
3236
|
+
if (!g) {
|
|
3237
|
+
continue;
|
|
3238
|
+
}
|
|
3239
|
+
const body = g.replace(/[.+^${}()|[\]\\]/g, "\\$&").split("**").map((seg) => seg.replace(/\*/g, "[^/]*")).join(".*");
|
|
3240
|
+
out.push(new RegExp(`(?:^|/)${body}$`));
|
|
3241
|
+
}
|
|
3242
|
+
return out;
|
|
3243
|
+
}
|
|
3244
|
+
|
|
3199
3245
|
// src/findings/testMetrics.ts
|
|
3200
3246
|
var intAfter = (line, re) => {
|
|
3201
3247
|
const m = line.match(re);
|
|
@@ -3405,12 +3451,17 @@ function deriveEvidence(session, sum, scope) {
|
|
|
3405
3451
|
}
|
|
3406
3452
|
}
|
|
3407
3453
|
let coveredFiles;
|
|
3454
|
+
let coverageGaps;
|
|
3408
3455
|
if (scope?.kind === "diff" && scope.files?.length) {
|
|
3409
3456
|
const touched = tools.filter((s) => isEditTool(s.name) || isReadTool(s.name)).map((s) => filePathOf(s.input)).filter((f) => !!f);
|
|
3410
3457
|
const cmdTexts = commandSpans.map((s) => commandOf(s.input)).filter(Boolean);
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
).
|
|
3458
|
+
const isCovered = (f) => touched.some((t) => samePath(t, f)) || cmdTexts.some((c) => commandMentionsFile(c, [f]));
|
|
3459
|
+
coveredFiles = scope.files.filter(isCovered).length;
|
|
3460
|
+
const uncovered = [...scope.files].filter((f) => !isCovered(f)).sort();
|
|
3461
|
+
if (uncovered.length) {
|
|
3462
|
+
const extra = globsToRegexes(scope.generatedGlobs);
|
|
3463
|
+
coverageGaps = uncovered.slice(0, 30).map((path2) => ({ path: path2, kind: classifyUncovered(path2, extra) }));
|
|
3464
|
+
}
|
|
3414
3465
|
}
|
|
3415
3466
|
const tk = session.totals.tokens;
|
|
3416
3467
|
return {
|
|
@@ -3420,6 +3471,7 @@ function deriveEvidence(session, sum, scope) {
|
|
|
3420
3471
|
reads,
|
|
3421
3472
|
destructiveOps: sum.destructiveCount,
|
|
3422
3473
|
...coveredFiles != null ? { coveredFiles } : {},
|
|
3474
|
+
...coverageGaps ? { coverageGaps } : {},
|
|
3423
3475
|
testsRan,
|
|
3424
3476
|
...sum.diffCostUsd != null ? {
|
|
3425
3477
|
// sub-cent costs keep 4dp — 2dp rounding recorded $0.004 work as $0.00
|
|
@@ -5163,4 +5215,4 @@ export {
|
|
|
5163
5215
|
redact,
|
|
5164
5216
|
redactReceipt
|
|
5165
5217
|
};
|
|
5166
|
-
//# sourceMappingURL=chunk-
|
|
5218
|
+
//# sourceMappingURL=chunk-G3YX5FUS.js.map
|