@codacy/verity-cli 0.36.1-experimental.4892669 → 0.36.1-experimental.634f7d7
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/CHANGELOG.md +17 -0
- package/bin/verity.js +68 -17
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -64,6 +64,23 @@ installs are untouched.
|
|
|
64
64
|
which is the ordinary case for someone whose first Verity install *is* the
|
|
65
65
|
plugin.
|
|
66
66
|
|
|
67
|
+
## [0.36.1] — 2026-11-13
|
|
68
|
+
|
|
69
|
+
### 🔎 Reviews at a commit and a push cover more, and say what they did not read
|
|
70
|
+
|
|
71
|
+
- **A `git push` or a `git commit` with a pipe or a redirection is reviewed.**
|
|
72
|
+
For example, `git push 2>&1 | tail -5`. Before, Verity could not find the
|
|
73
|
+
target of such a command, and it allowed the command with no review.
|
|
74
|
+
- **A change made only of large files is reviewed.** A file over the size
|
|
75
|
+
limit is not sent whole. The agent review now starts for such a change and
|
|
76
|
+
reads the diff of each file. Before, the change ended with no review and no
|
|
77
|
+
message.
|
|
78
|
+
- **The result names each large file that Verity did not read in full.** When
|
|
79
|
+
the agent review received only a part of a file's diff, the notice says
|
|
80
|
+
"reviewed only in part" and gives the number of characters it received. When
|
|
81
|
+
nothing read the file, the notice says "NOT reviewed". A PASS then covers
|
|
82
|
+
only what was read, and says so.
|
|
83
|
+
|
|
67
84
|
## [0.36.0] — 2026-11-12
|
|
68
85
|
|
|
69
86
|
### 🧠 Curate your project's knowledge from the CLI
|
package/bin/verity.js
CHANGED
|
@@ -15454,7 +15454,7 @@ function pinRefusalMessage(verdict, targetUrl) {
|
|
|
15454
15454
|
// src/lib/cli-version.ts
|
|
15455
15455
|
function cliVersion() {
|
|
15456
15456
|
try {
|
|
15457
|
-
return true ? "0.36.1-experimental.
|
|
15457
|
+
return true ? "0.36.1-experimental.634f7d7" : "dev";
|
|
15458
15458
|
} catch {
|
|
15459
15459
|
return "dev";
|
|
15460
15460
|
}
|
|
@@ -42462,8 +42462,26 @@ function oversizedPaths(codeDelta) {
|
|
|
42462
42462
|
return codeDelta.excluded.filter((e) => e.reason.startsWith("over-file-size-limit")).map((e) => e.path);
|
|
42463
42463
|
}
|
|
42464
42464
|
function unreviewedOversized(codeDelta, agentOutcome) {
|
|
42465
|
-
|
|
42466
|
-
|
|
42465
|
+
return agentConcluded(agentOutcome) ? [] : oversizedPaths(codeDelta);
|
|
42466
|
+
}
|
|
42467
|
+
function agentConcluded(agentOutcome) {
|
|
42468
|
+
return agentOutcome?.kind === "finished" && agentOutcome.response.agent_review.outcome === "concluded";
|
|
42469
|
+
}
|
|
42470
|
+
function cutOversizedDiffs(oversized, given, whole) {
|
|
42471
|
+
const shownOf = new Map(given.map((d) => [d.path, d.diff.length]));
|
|
42472
|
+
const totalOf = new Map(whole.map((d) => [d.path, d.diff.length]));
|
|
42473
|
+
const cut = [];
|
|
42474
|
+
for (const path of oversized) {
|
|
42475
|
+
const shown = shownOf.get(path) ?? 0;
|
|
42476
|
+
const total = totalOf.get(path) ?? null;
|
|
42477
|
+
if (total === null || shown < total) cut.push({ path, shown, total });
|
|
42478
|
+
}
|
|
42479
|
+
return cut;
|
|
42480
|
+
}
|
|
42481
|
+
function partlyReviewedOversized(codeDelta, agentOutcome) {
|
|
42482
|
+
if (!agentConcluded(agentOutcome)) return [];
|
|
42483
|
+
const oversized = new Set(oversizedPaths(codeDelta));
|
|
42484
|
+
return (agentOutcome?.cutDiffs ?? []).filter((d) => oversized.has(d.path));
|
|
42467
42485
|
}
|
|
42468
42486
|
var GUARD_BLOCK_CAP = 2;
|
|
42469
42487
|
var GUARD_ITER_FILE = (0, import_node_path60.join)(VERITY_DIR, ".guard-iteration");
|
|
@@ -42769,11 +42787,14 @@ function startAgentReview(input) {
|
|
|
42769
42787
|
}
|
|
42770
42788
|
};
|
|
42771
42789
|
const sentPaths = input.codeDelta.files.map((f) => f.path);
|
|
42772
|
-
const
|
|
42790
|
+
const oversized = oversizedPaths(input.codeDelta);
|
|
42791
|
+
const diffPaths = [...sentPaths, ...oversized];
|
|
42773
42792
|
const run4 = async () => {
|
|
42774
42793
|
const loaded = await loadCodeMap();
|
|
42775
42794
|
ctx.codeMap = loaded.ok ? loaded.map : null;
|
|
42776
|
-
|
|
42795
|
+
const diffs = await buildAgentDiffs(ctx, diffPaths);
|
|
42796
|
+
const cutDiffs = measureCutDiffs(ctx, oversized, diffs);
|
|
42797
|
+
const outcome = await runAgentReview({
|
|
42777
42798
|
http: http2,
|
|
42778
42799
|
executeTools: makeToolExecutor(ctx),
|
|
42779
42800
|
startedAt: input.hookStartedAt,
|
|
@@ -42786,7 +42807,7 @@ function startAgentReview(input) {
|
|
|
42786
42807
|
stated_intent: input.statedIntent,
|
|
42787
42808
|
changed_files: input.files,
|
|
42788
42809
|
sent_paths: sentPaths,
|
|
42789
|
-
diffs
|
|
42810
|
+
diffs,
|
|
42790
42811
|
repo_context: input.requestBody.repo_context,
|
|
42791
42812
|
static_results: input.requestBody.static_results,
|
|
42792
42813
|
one_shot_chars: input.codeDelta.files.reduce((n2, f) => n2 + f.content.length, 0),
|
|
@@ -42795,9 +42816,16 @@ function startAgentReview(input) {
|
|
|
42795
42816
|
oneShot: input.oneShot.then((r) => r.ok ? { ok: true, response: r.data } : { ok: false }),
|
|
42796
42817
|
sessionId: input.sessionId
|
|
42797
42818
|
});
|
|
42819
|
+
return { ...outcome, cutDiffs: await cutDiffs };
|
|
42798
42820
|
};
|
|
42799
42821
|
return run4().catch((err2) => ({ kind: "failed", reason: String(err2?.message ?? err2) }));
|
|
42800
42822
|
}
|
|
42823
|
+
var WHOLE_DIFF = { perFileChars: Number.MAX_SAFE_INTEGER, totalChars: Number.MAX_SAFE_INTEGER };
|
|
42824
|
+
async function measureCutDiffs(ctx, oversized, given) {
|
|
42825
|
+
if (oversized.length === 0) return [];
|
|
42826
|
+
const whole = await buildAgentDiffs(ctx, oversized, WHOLE_DIFF).catch(() => []);
|
|
42827
|
+
return cutOversizedDiffs(oversized, given, whole);
|
|
42828
|
+
}
|
|
42801
42829
|
function formalOffUnverifiedLine(moment, config) {
|
|
42802
42830
|
if (moment !== "pre-push" || !config.formal_off_unverified) return "";
|
|
42803
42831
|
const setting = formalSetting(config);
|
|
@@ -43108,6 +43136,7 @@ async function runGuard(opts, globals) {
|
|
|
43108
43136
|
}
|
|
43109
43137
|
resetIter(moment);
|
|
43110
43138
|
const unreviewed = unreviewedOversized(codeDelta, agentOutcome);
|
|
43139
|
+
const partial = partlyReviewedOversized(codeDelta, agentOutcome);
|
|
43111
43140
|
const notice = verdictNotice({
|
|
43112
43141
|
decision,
|
|
43113
43142
|
moment,
|
|
@@ -43117,6 +43146,7 @@ async function runGuard(opts, globals) {
|
|
|
43117
43146
|
link: link2,
|
|
43118
43147
|
viewUrl,
|
|
43119
43148
|
unreviewed,
|
|
43149
|
+
partial,
|
|
43120
43150
|
sentFiles: codeDelta.total_files,
|
|
43121
43151
|
narrative: response.assessment?.narrative ?? "",
|
|
43122
43152
|
serious: seriousFindings(response, witnessed)
|
|
@@ -43141,19 +43171,25 @@ ${covDetail}${report}`
|
|
|
43141
43171
|
};
|
|
43142
43172
|
}
|
|
43143
43173
|
const serious = seriousList(ctx.serious ?? [], verb);
|
|
43174
|
+
const unreviewed = ctx.unreviewed ?? [];
|
|
43175
|
+
const n2 = unreviewed.length;
|
|
43176
|
+
const listed = unreviewed.slice(0, UNREVIEWED_LISTED).map((p) => terminalText(p, 300)).join(", ");
|
|
43177
|
+
const more = n2 > UNREVIEWED_LISTED ? `, and ${n2 - UNREVIEWED_LISTED} more` : "";
|
|
43178
|
+
const why = `${n2} changed file(s) are over the size limit, so they are not sent, and the agent review that reads their diff did not conclude: ${listed}${more}.`;
|
|
43179
|
+
const partial = ctx.partial ?? [];
|
|
43180
|
+
const whyPartial = partialWhy(partial);
|
|
43144
43181
|
if (decision === "WARN") {
|
|
43182
|
+
const sizeUser = n2 > 0 ? ` \xB7 ${n2} changed file(s) over the size limit NOT reviewed` : partial.length > 0 ? ` \xB7 ${partial.length} changed file(s) over the size limit reviewed only in part` : "";
|
|
43183
|
+
const sizeAgent = `${n2 > 0 ? `NOT reviewed: ${why} Treat those files as unreviewed.
|
|
43184
|
+
` : ""}${partial.length > 0 ? `Reviewed only in part: ${whyPartial}
|
|
43185
|
+
` : ""}`;
|
|
43145
43186
|
return {
|
|
43146
|
-
user: `\u26A0 Verity ${moment}: WARN \u2014 ${serious.count ? `${serious.count} high-severity finding(s), not blocking` : "proceeding"} (${covLine})${link2}`,
|
|
43187
|
+
user: `\u26A0 Verity ${moment}: WARN \u2014 ${serious.count ? `${serious.count} high-severity finding(s), not blocking` : "proceeding"} (${covLine})${sizeUser}${link2}`,
|
|
43147
43188
|
agent: `Verity ${moment} review: WARN (proceeding).
|
|
43148
|
-
${serious.text}${covDetail}${report}`
|
|
43189
|
+
${sizeAgent}${serious.text}${covDetail}${report}`
|
|
43149
43190
|
};
|
|
43150
43191
|
}
|
|
43151
|
-
|
|
43152
|
-
if (decision === "PASS" && unreviewed.length > 0) {
|
|
43153
|
-
const n2 = unreviewed.length;
|
|
43154
|
-
const listed = unreviewed.slice(0, UNREVIEWED_LISTED).map((p) => terminalText(p, 300)).join(", ");
|
|
43155
|
-
const more = n2 > UNREVIEWED_LISTED ? `, and ${n2 - UNREVIEWED_LISTED} more` : "";
|
|
43156
|
-
const why = `${n2} changed file(s) are over the size limit, so they are not sent, and the agent review that reads their diff did not conclude: ${listed}${more}.`;
|
|
43192
|
+
if (decision === "PASS" && n2 > 0) {
|
|
43157
43193
|
if ((ctx.sentFiles ?? 0) === 0) {
|
|
43158
43194
|
return {
|
|
43159
43195
|
user: `\u26A0 Verity ${moment}: NOT REVIEWED \u2014 ${n2} changed file(s) over the size limit (${covLine})${link2}`,
|
|
@@ -43164,6 +43200,13 @@ ${covDetail}${report}`
|
|
|
43164
43200
|
return {
|
|
43165
43201
|
user: `\u26A0 Verity ${moment}: PASS for the files reviewed \u2014 ${n2} changed file(s) over the size limit NOT reviewed (${covLine})${link2}`,
|
|
43166
43202
|
agent: `Verity ${moment} review: PASS for the files that were sent. NOT reviewed: ${why} Treat those files as unreviewed.
|
|
43203
|
+
${serious.text}${covDetail}${report}`
|
|
43204
|
+
};
|
|
43205
|
+
}
|
|
43206
|
+
if (decision === "PASS" && partial.length > 0) {
|
|
43207
|
+
return {
|
|
43208
|
+
user: `\u26A0 Verity ${moment}: PASS for what was read \u2014 ${partial.length} changed file(s) over the size limit reviewed only in part (${covLine})${link2}`,
|
|
43209
|
+
agent: `Verity ${moment} review: PASS for what was read. Reviewed only in part: ${whyPartial}
|
|
43167
43210
|
${serious.text}${covDetail}${report}`
|
|
43168
43211
|
};
|
|
43169
43212
|
}
|
|
@@ -43182,6 +43225,14 @@ ${covDetail}${report}`
|
|
|
43182
43225
|
}
|
|
43183
43226
|
var SERIOUS_LISTED = 8;
|
|
43184
43227
|
var UNREVIEWED_LISTED = 8;
|
|
43228
|
+
function partialWhy(partial) {
|
|
43229
|
+
if (partial.length === 0) return "";
|
|
43230
|
+
const count2 = (chars) => Math.max(0, Math.trunc(chars)).toLocaleString("en-US");
|
|
43231
|
+
const share = (d) => d.total === null ? `${count2(d.shown)} diff characters received, the total was not measured` : `${count2(d.shown)} of ${count2(d.total)} diff characters received`;
|
|
43232
|
+
const listed = partial.slice(0, UNREVIEWED_LISTED).map((d) => `${terminalText(d.path, 300)} (${share(d)})`).join(", ");
|
|
43233
|
+
const more = partial.length > UNREVIEWED_LISTED ? `, and ${partial.length - UNREVIEWED_LISTED} more` : "";
|
|
43234
|
+
return `${partial.length} changed file(s) are over the size limit, so they are not sent, and the agent review did not receive their whole diff: ${listed}${more}. Treat the rest of each file as unreviewed.`;
|
|
43235
|
+
}
|
|
43185
43236
|
function seriousList(findings, verb) {
|
|
43186
43237
|
if (findings.length === 0) return { count: 0, text: "" };
|
|
43187
43238
|
const lines2 = [`${findings.length} finding(s) at high or critical severity did not block this ${verb}. Check each one: fix it, or tell the user why it does not apply.`];
|
|
@@ -46318,7 +46369,7 @@ async function recordAnswers(ui, momentIds, telemetry, completed) {
|
|
|
46318
46369
|
moments: momentIds,
|
|
46319
46370
|
...telemetry ? { telemetry } : {},
|
|
46320
46371
|
// A failed run also clears an earlier stamp: "done" describes this checkout now.
|
|
46321
|
-
init: completed ? { completed_at: (/* @__PURE__ */ new Date()).toISOString(), cli_version: true ? "0.36.1-experimental.
|
|
46372
|
+
init: completed ? { completed_at: (/* @__PURE__ */ new Date()).toISOString(), cli_version: true ? "0.36.1-experimental.634f7d7" : "dev" } : void 0
|
|
46322
46373
|
});
|
|
46323
46374
|
} catch (err2) {
|
|
46324
46375
|
ui.rail.line(`Could not record the setup answers: ${terminalText(err2.message, 200)}`, "warn");
|
|
@@ -49695,10 +49746,10 @@ function registerLeanCommand(program2) {
|
|
|
49695
49746
|
}
|
|
49696
49747
|
|
|
49697
49748
|
// src/cli.ts
|
|
49698
|
-
program.name("verity").description("CLI for Verity quality gate service").version("0.36.1-experimental.
|
|
49749
|
+
program.name("verity").description("CLI for Verity quality gate service").version("0.36.1-experimental.634f7d7").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) => {
|
|
49699
49750
|
const isTelemetryHelper = actionCommand.name() === "headers" && actionCommand.parent?.name() === "telemetry";
|
|
49700
49751
|
if (!isTelemetryHelper) {
|
|
49701
|
-
installStderrLog(actionCommand.name(), process.argv.slice(2), "0.36.1-experimental.
|
|
49752
|
+
installStderrLog(actionCommand.name(), process.argv.slice(2), "0.36.1-experimental.634f7d7");
|
|
49702
49753
|
}
|
|
49703
49754
|
setUserNamedServiceUrl(program.opts().serviceUrl);
|
|
49704
49755
|
try {
|
package/package.json
CHANGED