@codacy/verity-cli 0.34.0-experimental.8b93a3c → 0.34.0-experimental.92a1040
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/bin/verity.js +51 -97
- package/package.json +1 -1
package/bin/verity.js
CHANGED
|
@@ -17940,7 +17940,7 @@ function registerHooksCommands(program2) {
|
|
|
17940
17940
|
}
|
|
17941
17941
|
|
|
17942
17942
|
// src/commands/intent.ts
|
|
17943
|
-
var
|
|
17943
|
+
var import_node_crypto9 = require("node:crypto");
|
|
17944
17944
|
|
|
17945
17945
|
// src/lib/conversation-buffer.ts
|
|
17946
17946
|
var import_promises5 = require("node:fs/promises");
|
|
@@ -20544,7 +20544,7 @@ Body content (\u22648KB). Use [[node-id]] wikilinks for cross-references.
|
|
|
20544
20544
|
|
|
20545
20545
|
// src/lib/dossier-session.ts
|
|
20546
20546
|
var import_node_fs26 = require("node:fs");
|
|
20547
|
-
var
|
|
20547
|
+
var import_node_crypto8 = require("node:crypto");
|
|
20548
20548
|
var import_node_path22 = require("node:path");
|
|
20549
20549
|
|
|
20550
20550
|
// src/lib/pending-repeat.ts
|
|
@@ -20621,7 +20621,6 @@ function isRepeatOfAny(text, priorFingerprints, threshold = REPEAT_THRESHOLD) {
|
|
|
20621
20621
|
}
|
|
20622
20622
|
|
|
20623
20623
|
// src/lib/dossier/bounds.ts
|
|
20624
|
-
var import_node_crypto5 = require("node:crypto");
|
|
20625
20624
|
var MAX_LINE_BYTES = 4096;
|
|
20626
20625
|
var MAX_GOAL_CHARS = 2e3;
|
|
20627
20626
|
var GOAL_KEEP = 8;
|
|
@@ -20633,17 +20632,10 @@ var NOT_MINE_CAP = 300;
|
|
|
20633
20632
|
var STATEMENTS_OPEN_CAP = 40;
|
|
20634
20633
|
var COMMANDS_CAP = 12;
|
|
20635
20634
|
var DIVERGENCE_CAP = 10;
|
|
20636
|
-
var
|
|
20637
|
-
var DIVERGENCE_KEYS_PER_LINE = 200;
|
|
20635
|
+
var DIVERGENCE_SEEN_CAP = 300;
|
|
20638
20636
|
function divergenceKey(path, hash) {
|
|
20639
20637
|
return `${path}@${hash ?? "unknown"}`;
|
|
20640
20638
|
}
|
|
20641
|
-
function packedDivergenceDigest(key) {
|
|
20642
|
-
return (0, import_node_crypto5.createHash)("sha256").update(key).digest("hex").slice(0, 12);
|
|
20643
|
-
}
|
|
20644
|
-
function packedDivergenceKey(digest) {
|
|
20645
|
-
return `#${digest}`;
|
|
20646
|
-
}
|
|
20647
20639
|
var MARKS_CAP = 50;
|
|
20648
20640
|
var ROTATE_BYTES = 1048576;
|
|
20649
20641
|
var ROTATE_KEEP = 2;
|
|
@@ -20657,7 +20649,7 @@ function statementAnchorKey(file, patternId) {
|
|
|
20657
20649
|
}
|
|
20658
20650
|
|
|
20659
20651
|
// src/lib/dossier/log.ts
|
|
20660
|
-
var
|
|
20652
|
+
var import_node_crypto5 = require("node:crypto");
|
|
20661
20653
|
var import_node_fs22 = require("node:fs");
|
|
20662
20654
|
var import_node_path20 = require("node:path");
|
|
20663
20655
|
var CRC_TABLE = (() => {
|
|
@@ -20699,7 +20691,7 @@ function nextSeq() {
|
|
|
20699
20691
|
function encodeEvent(ev) {
|
|
20700
20692
|
const full = {
|
|
20701
20693
|
v: 1,
|
|
20702
|
-
id: (0,
|
|
20694
|
+
id: (0, import_node_crypto5.randomBytes)(4).toString("hex"),
|
|
20703
20695
|
...ev
|
|
20704
20696
|
};
|
|
20705
20697
|
let body2 = JSON.stringify(full);
|
|
@@ -20770,7 +20762,7 @@ function rotateIfNeeded2(d) {
|
|
|
20770
20762
|
}
|
|
20771
20763
|
|
|
20772
20764
|
// src/lib/dossier/fold-dossier.ts
|
|
20773
|
-
var
|
|
20765
|
+
var import_node_crypto6 = require("node:crypto");
|
|
20774
20766
|
var import_node_fs23 = require("node:fs");
|
|
20775
20767
|
var import_node_path21 = require("node:path");
|
|
20776
20768
|
var EMPTY_CAPABILITIES = () => ({
|
|
@@ -20862,7 +20854,7 @@ function reduce(state, events, now) {
|
|
|
20862
20854
|
state.meta.seq = Math.max(state.meta.seq, ev.seq);
|
|
20863
20855
|
switch (ev.k) {
|
|
20864
20856
|
case "goal": {
|
|
20865
|
-
const hash = (0,
|
|
20857
|
+
const hash = (0, import_node_crypto6.createHash)("sha256").update(ev.text).digest("hex").slice(0, 16);
|
|
20866
20858
|
const prev = state.goal[state.goal.length - 1];
|
|
20867
20859
|
if (prev && prev.hash === hash) {
|
|
20868
20860
|
prev.repeats = (prev.repeats ?? 0) + 1;
|
|
@@ -20990,13 +20982,12 @@ function reduce(state, events, now) {
|
|
|
20990
20982
|
break;
|
|
20991
20983
|
}
|
|
20992
20984
|
case "divergence": {
|
|
20985
|
+
state.divergence.counts[ev.kind] = (state.divergence.counts[ev.kind] ?? 0) + 1;
|
|
20993
20986
|
state.divergence.events.push({ kind: ev.kind, path: ev.path, at: ev.at });
|
|
20994
|
-
const
|
|
20995
|
-
|
|
20996
|
-
if (seenDivergence.has(key)) continue;
|
|
20987
|
+
const key = divergenceKey(ev.path, ev.hash ?? null);
|
|
20988
|
+
if (!seenDivergence.has(key)) {
|
|
20997
20989
|
seenDivergence.add(key);
|
|
20998
|
-
state.divergence.seen.push(key);
|
|
20999
|
-
state.divergence.counts[ev.kind] = (state.divergence.counts[ev.kind] ?? 0) + 1;
|
|
20990
|
+
if (state.divergence.seen.length < DIVERGENCE_SEEN_CAP) state.divergence.seen.push(key);
|
|
21000
20991
|
}
|
|
21001
20992
|
break;
|
|
21002
20993
|
}
|
|
@@ -21303,14 +21294,14 @@ function assessContinuity(i2) {
|
|
|
21303
21294
|
}
|
|
21304
21295
|
|
|
21305
21296
|
// src/lib/dossier/reanchor.ts
|
|
21306
|
-
var
|
|
21297
|
+
var import_node_crypto7 = require("node:crypto");
|
|
21307
21298
|
var import_node_fs25 = require("node:fs");
|
|
21308
21299
|
function lineSha(text) {
|
|
21309
|
-
return (0,
|
|
21300
|
+
return (0, import_node_crypto7.createHash)("sha256").update(text.trim()).digest("hex").slice(0, HASH_WIDTH);
|
|
21310
21301
|
}
|
|
21311
21302
|
function fileHash(path) {
|
|
21312
21303
|
try {
|
|
21313
|
-
return (0,
|
|
21304
|
+
return (0, import_node_crypto7.createHash)("sha256").update((0, import_node_fs25.readFileSync)(path)).digest("hex").slice(0, HASH_WIDTH);
|
|
21314
21305
|
} catch {
|
|
21315
21306
|
return null;
|
|
21316
21307
|
}
|
|
@@ -21807,7 +21798,7 @@ function recordTurn(d, t) {
|
|
|
21807
21798
|
// Identity is the COMMAND, not its category — otherwise `npm test -- a` and
|
|
21808
21799
|
// `npm test -- b` are one row and the streak counts two different commands
|
|
21809
21800
|
// as a run of one.
|
|
21810
|
-
cmd_hash: (0,
|
|
21801
|
+
cmd_hash: (0, import_node_crypto8.createHash)("sha256").update(c.head || c.class).digest("hex").slice(0, 12),
|
|
21811
21802
|
head: c.head || c.class,
|
|
21812
21803
|
status: toStatus(c.last_status)
|
|
21813
21804
|
});
|
|
@@ -21825,23 +21816,10 @@ function recordTurn(d, t) {
|
|
|
21825
21816
|
}
|
|
21826
21817
|
}
|
|
21827
21818
|
const seenDivergence = t.known?.divergence ?? /* @__PURE__ */ new Set();
|
|
21828
|
-
const fresh = [];
|
|
21829
21819
|
for (const u of t.unobserved) {
|
|
21830
21820
|
const hash = fileHash((0, import_node_path22.join)(root, u.p));
|
|
21831
|
-
|
|
21832
|
-
|
|
21833
|
-
if (seenDivergence.has(key) || seenDivergence.has(packedDivergenceKey(digest))) continue;
|
|
21834
|
-
fresh.push({ path: u.p, hash, digest });
|
|
21835
|
-
}
|
|
21836
|
-
if (fresh.length > DIVERGENCE_BULK_AT) {
|
|
21837
|
-
for (let i2 = 0; i2 < fresh.length; i2 += DIVERGENCE_KEYS_PER_LINE) {
|
|
21838
|
-
const slice2 = fresh.slice(i2, i2 + DIVERGENCE_KEYS_PER_LINE);
|
|
21839
|
-
appendEvent(d, { k: "divergence", kind: "external_mutation", path: slice2[0].path, keys: slice2.map((f) => f.digest) });
|
|
21840
|
-
}
|
|
21841
|
-
} else {
|
|
21842
|
-
for (const f of fresh) {
|
|
21843
|
-
appendEvent(d, { k: "divergence", kind: "external_mutation", path: f.path, hash: f.hash });
|
|
21844
|
-
}
|
|
21821
|
+
if (seenDivergence.has(divergenceKey(u.p, hash))) continue;
|
|
21822
|
+
appendEvent(d, { k: "divergence", kind: "external_mutation", path: u.p, hash });
|
|
21845
21823
|
}
|
|
21846
21824
|
const newCompactions = (t.compactions ?? 0) - (t.known?.compactions ?? 0);
|
|
21847
21825
|
for (let i2 = 0; i2 < newCompactions; i2++) {
|
|
@@ -22106,7 +22084,7 @@ async function fireClassify(prompt, sessionId, globals) {
|
|
|
22106
22084
|
logEvent("classify_skipped", { reason: "no_service_url", detail: urlResult.error });
|
|
22107
22085
|
return;
|
|
22108
22086
|
}
|
|
22109
|
-
const promptHash = (0,
|
|
22087
|
+
const promptHash = (0, import_node_crypto9.createHash)("sha256").update(prompt).digest("hex");
|
|
22110
22088
|
const result = await apiRequest({
|
|
22111
22089
|
method: "POST",
|
|
22112
22090
|
path: "/classify-task",
|
|
@@ -22150,7 +22128,7 @@ var import_node_path26 = require("node:path");
|
|
|
22150
22128
|
// src/lib/baseline.ts
|
|
22151
22129
|
var import_node_fs28 = require("node:fs");
|
|
22152
22130
|
var import_node_path25 = require("node:path");
|
|
22153
|
-
var
|
|
22131
|
+
var import_node_crypto10 = require("node:crypto");
|
|
22154
22132
|
|
|
22155
22133
|
// src/lib/snapshot.ts
|
|
22156
22134
|
var import_node_fs27 = require("node:fs");
|
|
@@ -22419,7 +22397,7 @@ var MIRROR_MAX_BYTES = 2 * 1024 * 1024;
|
|
|
22419
22397
|
var DEFAULT_SESSION_KEY = "_default";
|
|
22420
22398
|
function sessionKey(sessionId) {
|
|
22421
22399
|
if (!sessionId) return DEFAULT_SESSION_KEY;
|
|
22422
|
-
return (0,
|
|
22400
|
+
return (0, import_node_crypto10.createHash)("sha256").update(sessionId).digest("hex").slice(0, 16);
|
|
22423
22401
|
}
|
|
22424
22402
|
function sessionDir(key) {
|
|
22425
22403
|
return (0, import_node_path25.join)(projectPath(BASELINE_DIR), key);
|
|
@@ -24339,10 +24317,10 @@ var import_node_fs38 = require("node:fs");
|
|
|
24339
24317
|
|
|
24340
24318
|
// src/lib/debounce.ts
|
|
24341
24319
|
var import_node_fs37 = require("node:fs");
|
|
24342
|
-
var
|
|
24320
|
+
var import_node_crypto11 = require("node:crypto");
|
|
24343
24321
|
function scopedFile(base, sessionId) {
|
|
24344
24322
|
if (!sessionId) return base;
|
|
24345
|
-
return `${base}.${(0,
|
|
24323
|
+
return `${base}.${(0, import_node_crypto11.createHash)("sha1").update(sessionId).digest("hex").slice(0, 12)}`;
|
|
24346
24324
|
}
|
|
24347
24325
|
function checkDebounce(debounceSeconds = DEBOUNCE_SECONDS, sessionId) {
|
|
24348
24326
|
const file = scopedFile(DEBOUNCE_FILE, sessionId);
|
|
@@ -24383,7 +24361,7 @@ function checkMtime(files, bypassForRecentCommits, sessionId) {
|
|
|
24383
24361
|
return "No files modified since last analysis";
|
|
24384
24362
|
}
|
|
24385
24363
|
function computeContentHash(files) {
|
|
24386
|
-
const hash = (0,
|
|
24364
|
+
const hash = (0, import_node_crypto11.createHash)("sha1");
|
|
24387
24365
|
const sorted = [...files].sort();
|
|
24388
24366
|
for (const f of sorted) {
|
|
24389
24367
|
const resolved = resolveFile(f) ?? f;
|
|
@@ -27095,7 +27073,7 @@ function channelSilence(input) {
|
|
|
27095
27073
|
// src/lib/cli-version.ts
|
|
27096
27074
|
function cliVersion() {
|
|
27097
27075
|
try {
|
|
27098
|
-
return true ? "0.34.0-experimental.
|
|
27076
|
+
return true ? "0.34.0-experimental.92a1040" : "dev";
|
|
27099
27077
|
} catch {
|
|
27100
27078
|
return "dev";
|
|
27101
27079
|
}
|
|
@@ -28563,7 +28541,7 @@ async function contextFiles(run4) {
|
|
|
28563
28541
|
}
|
|
28564
28542
|
|
|
28565
28543
|
// src/lib/code/index.ts
|
|
28566
|
-
var
|
|
28544
|
+
var import_node_crypto12 = require("node:crypto");
|
|
28567
28545
|
|
|
28568
28546
|
// src/lib/code/languages.ts
|
|
28569
28547
|
var JS_LIKE = {
|
|
@@ -30341,7 +30319,7 @@ function byPath(fns, name2) {
|
|
|
30341
30319
|
function makeCodeMap(rt) {
|
|
30342
30320
|
const cache = /* @__PURE__ */ new Map();
|
|
30343
30321
|
const outline = (path, content, deadlineAt = Date.now() + DEFAULT_PARSE_MS) => {
|
|
30344
|
-
const key = `${path}\0${(0,
|
|
30322
|
+
const key = `${path}\0${(0, import_node_crypto12.createHash)("sha1").update(content).digest("hex")}`;
|
|
30345
30323
|
const hit = cache.get(key);
|
|
30346
30324
|
if (hit) return { source: "tree-sitter", value: hit, elapsedMs: 0 };
|
|
30347
30325
|
let r;
|
|
@@ -31710,22 +31688,6 @@ async function workingMemory(run4) {
|
|
|
31710
31688
|
Object.assign(run4, { incrementReport, memory: memory2, memorySession, reachability });
|
|
31711
31689
|
}
|
|
31712
31690
|
|
|
31713
|
-
// src/lib/payload-bounds.ts
|
|
31714
|
-
var MAX_WIRE_PATHS = 500;
|
|
31715
|
-
function boundPaths(paths, first, max = MAX_WIRE_PATHS) {
|
|
31716
|
-
if (paths.length <= max) return [...paths];
|
|
31717
|
-
const present = new Set(paths);
|
|
31718
|
-
const kept = /* @__PURE__ */ new Set();
|
|
31719
|
-
const out2 = [];
|
|
31720
|
-
for (const p of [...first, ...paths]) {
|
|
31721
|
-
if (out2.length >= max) break;
|
|
31722
|
-
if (!present.has(p) || kept.has(p)) continue;
|
|
31723
|
-
kept.add(p);
|
|
31724
|
-
out2.push(p);
|
|
31725
|
-
}
|
|
31726
|
-
return out2;
|
|
31727
|
-
}
|
|
31728
|
-
|
|
31729
31691
|
// src/lib/note-budget.ts
|
|
31730
31692
|
var import_node_fs49 = require("node:fs");
|
|
31731
31693
|
var ADVISORY_BUDGET = { PASS: 1, WARN: 2 };
|
|
@@ -31840,7 +31802,6 @@ async function buildRequest(run4) {
|
|
|
31840
31802
|
(conversation?.prompts?.length ?? 0) > 0
|
|
31841
31803
|
);
|
|
31842
31804
|
const noteConfirmation = peekNoteOutcome();
|
|
31843
|
-
const unobserved = foldResult?.unobserved ?? [];
|
|
31844
31805
|
const excludedByReason = {};
|
|
31845
31806
|
for (const e of codeDelta.excluded ?? []) {
|
|
31846
31807
|
excludedByReason[e.reason] = (excludedByReason[e.reason] ?? 0) + 1;
|
|
@@ -31885,9 +31846,7 @@ async function buildRequest(run4) {
|
|
|
31885
31846
|
coverage_telemetry: coverageTelemetry,
|
|
31886
31847
|
static_results: staticResults,
|
|
31887
31848
|
code_delta: codeDelta,
|
|
31888
|
-
|
|
31889
|
-
// full count is `coverage_telemetry.for_review`. VRT-242.
|
|
31890
|
-
changed_files: boundPaths(allForReview, codeDelta.files.map((f) => f.path)),
|
|
31849
|
+
changed_files: allForReview,
|
|
31891
31850
|
standard_version: "latest",
|
|
31892
31851
|
analysis_mode: analysisMode,
|
|
31893
31852
|
plan_only: analysisMode === "plan",
|
|
@@ -31938,9 +31897,7 @@ async function buildRequest(run4) {
|
|
|
31938
31897
|
// `hash_at_last_verdict` is frozen at each verdict and `hash_now` tracks
|
|
31939
31898
|
// disk, so their inequality IS "changed since we last spoke".
|
|
31940
31899
|
authored_since_verdict: memorySession ? foldDossier(memorySession.d).authored_all.filter((a) => a.hash_now !== a.hash_at_last_verdict).map((a) => a.path) : [],
|
|
31941
|
-
|
|
31942
|
-
unobserved: unobserved.slice(0, MAX_WIRE_PATHS),
|
|
31943
|
-
...unobserved.length > MAX_WIRE_PATHS && { unobserved_total: unobserved.length },
|
|
31900
|
+
unobserved: foldResult?.unobserved ?? [],
|
|
31944
31901
|
commands: foldResult?.commands ?? [],
|
|
31945
31902
|
tools: foldResult?.tools ?? [],
|
|
31946
31903
|
tasks: foldResult?.tasks ?? [],
|
|
@@ -32104,11 +32061,11 @@ async function buildRequest(run4) {
|
|
|
32104
32061
|
|
|
32105
32062
|
// src/lib/offline.ts
|
|
32106
32063
|
var import_node_fs50 = require("node:fs");
|
|
32107
|
-
var
|
|
32064
|
+
var import_node_crypto13 = require("node:crypto");
|
|
32108
32065
|
function cacheRequest(body2) {
|
|
32109
32066
|
try {
|
|
32110
32067
|
(0, import_node_fs50.mkdirSync)(CACHE_DIR, { recursive: true });
|
|
32111
|
-
const suffix = (0,
|
|
32068
|
+
const suffix = (0, import_node_crypto13.randomBytes)(4).toString("hex");
|
|
32112
32069
|
const filename = `pending-${Math.floor(Date.now() / 1e3)}-${suffix}.json`;
|
|
32113
32070
|
(0, import_node_fs50.writeFileSync)(`${CACHE_DIR}/${filename}`, JSON.stringify(redactRequest(body2)));
|
|
32114
32071
|
} catch {
|
|
@@ -32151,10 +32108,8 @@ function buildOfflineFallback(reason, staticResults) {
|
|
|
32151
32108
|
}
|
|
32152
32109
|
|
|
32153
32110
|
// src/lib/retry.ts
|
|
32154
|
-
var WORKER_RESOURCE_LIMIT = 546;
|
|
32155
32111
|
function shouldWarmRetryAnalyze(result) {
|
|
32156
32112
|
if (result.ok) return false;
|
|
32157
|
-
if (result.http_status === WORKER_RESOURCE_LIMIT) return false;
|
|
32158
32113
|
if (result.category === "network" || result.category === "timeout") return true;
|
|
32159
32114
|
if (result.category === "http_5xx") return true;
|
|
32160
32115
|
if (result.category === "invalid_json" && (result.http_status ?? 0) >= 500) return true;
|
|
@@ -32164,7 +32119,7 @@ function shouldWarmRetryAnalyze(result) {
|
|
|
32164
32119
|
// src/commands/analyze/phases/12-transmit.ts
|
|
32165
32120
|
async function transmit(run4) {
|
|
32166
32121
|
const { globals } = run4;
|
|
32167
|
-
const { requestBody, serviceUrl, staticResults, token } = run4;
|
|
32122
|
+
const { codeDelta, requestBody, serviceUrl, staticResults, token } = run4;
|
|
32168
32123
|
const ANALYZE_TIMEOUT_MS = 1e5;
|
|
32169
32124
|
let result = await analyzeRequest({
|
|
32170
32125
|
serviceUrl,
|
|
@@ -32201,12 +32156,11 @@ async function transmit(run4) {
|
|
|
32201
32156
|
}
|
|
32202
32157
|
if (!result.ok) {
|
|
32203
32158
|
cacheRequest(requestBody);
|
|
32204
|
-
const sentKb = () => Math.round(Buffer.byteLength(JSON.stringify(requestBody)) / 1024);
|
|
32205
32159
|
let message;
|
|
32206
32160
|
if (result.http_status === 413) {
|
|
32207
|
-
|
|
32208
|
-
|
|
32209
|
-
message = `Verity:
|
|
32161
|
+
const totalBytes = codeDelta.files.reduce((sum, f) => sum + f.content.length, 0);
|
|
32162
|
+
const kb = Math.round(totalBytes / 1024);
|
|
32163
|
+
message = `Verity: request rejected \u2014 payload too large (${kb}KB over the 190KB cap). Commit or stash pre-existing changes, or run with --mode skip if you didn't intend to submit code this turn.`;
|
|
32210
32164
|
} else if (result.category === "network" || result.category === "timeout") {
|
|
32211
32165
|
message = `Verity offline \u2014 ${result.error}`;
|
|
32212
32166
|
} else if (result.error.startsWith("STALE_VERIFICATION")) {
|
|
@@ -33507,7 +33461,7 @@ async function runAgentReview(options) {
|
|
|
33507
33461
|
|
|
33508
33462
|
// src/lib/prove/auto.ts
|
|
33509
33463
|
var import_node_path44 = require("node:path");
|
|
33510
|
-
var
|
|
33464
|
+
var import_node_crypto18 = require("node:crypto");
|
|
33511
33465
|
|
|
33512
33466
|
// src/lib/prove/signals.ts
|
|
33513
33467
|
var DEFAULT_SINCE = "180 days ago";
|
|
@@ -35243,7 +35197,7 @@ var import_node_path42 = require("node:path");
|
|
|
35243
35197
|
|
|
35244
35198
|
// src/lib/prove/safe-write.ts
|
|
35245
35199
|
var import_node_fs56 = require("node:fs");
|
|
35246
|
-
var
|
|
35200
|
+
var import_node_crypto14 = require("node:crypto");
|
|
35247
35201
|
var import_node_path41 = require("node:path");
|
|
35248
35202
|
var SafeWriteError = class extends Error {
|
|
35249
35203
|
constructor(reason, path) {
|
|
@@ -35304,7 +35258,7 @@ function writeFileInRootNoFollow(root, rel, content) {
|
|
|
35304
35258
|
} catch {
|
|
35305
35259
|
throw new SafeWriteError("unwritable", root);
|
|
35306
35260
|
}
|
|
35307
|
-
const tmp = (0, import_node_path41.join)(dir, `.${(0, import_node_path41.basename)(dest)}.${(0,
|
|
35261
|
+
const tmp = (0, import_node_path41.join)(dir, `.${(0, import_node_path41.basename)(dest)}.${(0, import_node_crypto14.randomBytes)(6).toString("hex")}.tmp`);
|
|
35308
35262
|
let fd;
|
|
35309
35263
|
try {
|
|
35310
35264
|
fd = (0, import_node_fs56.openSync)(tmp, import_node_fs56.constants.O_WRONLY | import_node_fs56.constants.O_CREAT | import_node_fs56.constants.O_EXCL | NOFOLLOW2, 420);
|
|
@@ -35706,7 +35660,7 @@ function existsNoFollow(abs) {
|
|
|
35706
35660
|
}
|
|
35707
35661
|
|
|
35708
35662
|
// src/lib/prove/report.ts
|
|
35709
|
-
var
|
|
35663
|
+
var import_node_crypto15 = require("node:crypto");
|
|
35710
35664
|
var IDENT2 = /^[A-Za-z0-9_][A-Za-z0-9_.-]{0,63}$/;
|
|
35711
35665
|
var SHA256 = /^(sha256:)?[0-9a-f]{64}$/;
|
|
35712
35666
|
var KINDS2 = /* @__PURE__ */ new Set(["structural", "intent"]);
|
|
@@ -35854,7 +35808,7 @@ function sha256InRoot(root, file) {
|
|
|
35854
35808
|
const opened = openRegularInRoot(root, file);
|
|
35855
35809
|
if (!opened.ok) return null;
|
|
35856
35810
|
try {
|
|
35857
|
-
return (0,
|
|
35811
|
+
return (0, import_node_crypto15.createHash)("sha256").update(readOpened(opened.fd, opened.size)).digest("hex");
|
|
35858
35812
|
} catch {
|
|
35859
35813
|
return null;
|
|
35860
35814
|
}
|
|
@@ -36189,7 +36143,7 @@ function mergeFormalFindings(response, outcome, pushedFiles) {
|
|
|
36189
36143
|
}
|
|
36190
36144
|
|
|
36191
36145
|
// src/lib/prove/scalpel.ts
|
|
36192
|
-
var
|
|
36146
|
+
var import_node_crypto16 = require("node:crypto");
|
|
36193
36147
|
var ARITHMETIC = /Math\.(?:round|floor|ceil|trunc)\(|\bround\(|\bdivmod\(|[\w)\]]\s*(?:\*|\/(?!\/)|%)\s*[\w(]/;
|
|
36194
36148
|
function functionHazard(numbered2) {
|
|
36195
36149
|
const sites = effectSites(numbered2);
|
|
@@ -36219,7 +36173,7 @@ function semanticFingerprint(numbered2) {
|
|
|
36219
36173
|
if (LOG_LINE.test(t)) continue;
|
|
36220
36174
|
kept.push(t.replace(/\s+/g, " "));
|
|
36221
36175
|
}
|
|
36222
|
-
return (0,
|
|
36176
|
+
return (0, import_node_crypto16.createHash)("sha256").update(kept.join("\n")).digest("hex");
|
|
36223
36177
|
}
|
|
36224
36178
|
function readVerified(root, now = Date.now()) {
|
|
36225
36179
|
const read2 = readRegularFileInRoot(root, VERIFIED_FILE, 256 * 1024);
|
|
@@ -36242,9 +36196,9 @@ function recordVerified(root, rec, now = Date.now()) {
|
|
|
36242
36196
|
}
|
|
36243
36197
|
|
|
36244
36198
|
// src/lib/prove/context.ts
|
|
36245
|
-
var
|
|
36199
|
+
var import_node_crypto17 = require("node:crypto");
|
|
36246
36200
|
var CONTEXT_BUDGET_MS = 2e3;
|
|
36247
|
-
var sha256 = (s) => (0,
|
|
36201
|
+
var sha256 = (s) => (0, import_node_crypto17.createHash)("sha256").update(s).digest("hex");
|
|
36248
36202
|
var TEST_PATH4 = /(^|\/)(tests?|__tests__|spec)\/|\.(test|spec)\.[a-z]+$/;
|
|
36249
36203
|
function slice(content, f, maxLines) {
|
|
36250
36204
|
const all = content.split("\n");
|
|
@@ -36433,7 +36387,7 @@ function workingTreeReader(root) {
|
|
|
36433
36387
|
};
|
|
36434
36388
|
}
|
|
36435
36389
|
function sha256Of(content) {
|
|
36436
|
-
return (0,
|
|
36390
|
+
return (0, import_node_crypto18.createHash)("sha256").update(content).digest("hex");
|
|
36437
36391
|
}
|
|
36438
36392
|
function defaultDeps(opts) {
|
|
36439
36393
|
const env = opts.env ?? process.env;
|
|
@@ -37766,7 +37720,7 @@ function registerIgnoreCommand(program2) {
|
|
|
37766
37720
|
}
|
|
37767
37721
|
|
|
37768
37722
|
// src/commands/waive.ts
|
|
37769
|
-
var
|
|
37723
|
+
var import_node_crypto19 = require("node:crypto");
|
|
37770
37724
|
var import_node_fs60 = require("node:fs");
|
|
37771
37725
|
function registerWaiveCommand(program2) {
|
|
37772
37726
|
program2.command("waive <pattern-id>").description("Record an accepted-risk disposition for an open finding (voids when the file changes)").option("--file <path>", "File the finding is anchored to, REPO-RELATIVE (recommended \u2014 narrows the waive)").requiredOption("--reason <text>", "The human disposition this records (reviewer finding, ADR, \u2026)").action(async (patternId, opts) => {
|
|
@@ -37796,7 +37750,7 @@ function registerWaiveCommand(program2) {
|
|
|
37796
37750
|
if (opts.file) {
|
|
37797
37751
|
body2.file = opts.file;
|
|
37798
37752
|
try {
|
|
37799
|
-
body2.file_sha256 = (0,
|
|
37753
|
+
body2.file_sha256 = (0, import_node_crypto19.createHash)("sha256").update((0, import_node_fs60.readFileSync)(opts.file)).digest("hex");
|
|
37800
37754
|
} catch {
|
|
37801
37755
|
printError(`Cannot read ${opts.file} \u2014 run from the repo root, or omit --file to waive by pattern.`);
|
|
37802
37756
|
process.exit(1);
|
|
@@ -38827,7 +38781,7 @@ async function promptMultiSelect(question, choices, fallback) {
|
|
|
38827
38781
|
|
|
38828
38782
|
// src/lib/prove/lean-install.ts
|
|
38829
38783
|
var import_node_fs63 = require("node:fs");
|
|
38830
|
-
var
|
|
38784
|
+
var import_node_crypto20 = require("node:crypto");
|
|
38831
38785
|
var import_node_child_process18 = require("node:child_process");
|
|
38832
38786
|
var import_node_os10 = require("node:os");
|
|
38833
38787
|
var import_node_path47 = require("node:path");
|
|
@@ -38865,7 +38819,7 @@ function expectedSha256(asset, version = pinnedVersion()) {
|
|
|
38865
38819
|
}
|
|
38866
38820
|
function sha256File(path) {
|
|
38867
38821
|
return new Promise((resolve8, reject) => {
|
|
38868
|
-
const hash = (0,
|
|
38822
|
+
const hash = (0, import_node_crypto20.createHash)("sha256");
|
|
38869
38823
|
(0, import_node_fs63.createReadStream)(path).on("data", (chunk) => hash.update(chunk)).on("end", () => resolve8(hash.digest("hex"))).on("error", reject);
|
|
38870
38824
|
});
|
|
38871
38825
|
}
|
|
@@ -39978,7 +39932,7 @@ function registerInitCommand(program2) {
|
|
|
39978
39932
|
...telemetryChoice ? { telemetry: telemetryChoice } : {},
|
|
39979
39933
|
init: {
|
|
39980
39934
|
completed_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
39981
|
-
cli_version: true ? "0.34.0-experimental.
|
|
39935
|
+
cli_version: true ? "0.34.0-experimental.92a1040" : "dev"
|
|
39982
39936
|
}
|
|
39983
39937
|
});
|
|
39984
39938
|
} catch (err2) {
|
|
@@ -41451,8 +41405,8 @@ function registerLeanCommand(program2) {
|
|
|
41451
41405
|
}
|
|
41452
41406
|
|
|
41453
41407
|
// src/cli.ts
|
|
41454
|
-
program.name("verity").description("CLI for Verity quality gate service").version("0.34.0-experimental.
|
|
41455
|
-
installStderrLog(actionCommand.name(), process.argv.slice(2), "0.34.0-experimental.
|
|
41408
|
+
program.name("verity").description("CLI for Verity quality gate service").version("0.34.0-experimental.92a1040").option("--token <token>", "Override authentication token").option("--service-url <url>", "Override service URL").option("--verbose", "Log HTTP requests/responses to stderr").hook("preAction", async (_thisCommand, actionCommand) => {
|
|
41409
|
+
installStderrLog(actionCommand.name(), process.argv.slice(2), "0.34.0-experimental.92a1040");
|
|
41456
41410
|
setUserNamedServiceUrl(program.opts().serviceUrl);
|
|
41457
41411
|
try {
|
|
41458
41412
|
await foldLegacyLocalCredential();
|
package/package.json
CHANGED