@codacy/verity-cli 0.32.1-experimental.f2cf829 → 0.32.1
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 +4 -1
- package/bin/verity.js +59 -40
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -47,7 +47,10 @@ installs are untouched.
|
|
|
47
47
|
- **A repository can no longer switch the gate off by shipping a file.**
|
|
48
48
|
Ownership was claimed by `.verity/.plugin-active`, a file inside the project,
|
|
49
49
|
and one naming any directory that happened to exist disabled every hook there.
|
|
50
|
-
An install Claude Code cannot vouch for is ignored
|
|
50
|
+
An install Claude Code cannot vouch for is ignored — and "vouch" now means
|
|
51
|
+
*for this checkout*: the cache path a real install lives at is predictable, so
|
|
52
|
+
a marker naming a plugin installed for **somebody else's project** used to be
|
|
53
|
+
believed here.
|
|
51
54
|
- **A plugin installed from a local marketplace directory is recognised.**
|
|
52
55
|
Claude Code runs a marketplace served from a directory out of that directory
|
|
53
56
|
while recording the cache copy it made, so the two paths disagreed and a live,
|
package/bin/verity.js
CHANGED
|
@@ -10509,7 +10509,7 @@ var SECURITY_PATTERNS = [
|
|
|
10509
10509
|
/Dockerfile/
|
|
10510
10510
|
];
|
|
10511
10511
|
var PROD_SERVICE_URL = "https://ofcamwrjwrkazqvdchko.supabase.co/functions/v1";
|
|
10512
|
-
var DEFAULT_SERVICE_URL = "
|
|
10512
|
+
var DEFAULT_SERVICE_URL = "".length > 0 ? "" : PROD_SERVICE_URL;
|
|
10513
10513
|
var GITHUB_CLIENT_ID = "Iv23li88HxAi3ZrbYzWh";
|
|
10514
10514
|
var GITHUB_DEVICE_CODE_URL = "https://github.com/login/device/code";
|
|
10515
10515
|
var GITHUB_ACCESS_TOKEN_URL = "https://github.com/login/oauth/access_token";
|
|
@@ -12927,18 +12927,27 @@ function realpathOr(p) {
|
|
|
12927
12927
|
function isWithin(want, dir) {
|
|
12928
12928
|
return want === dir || want.startsWith(dir + import_node_path7.sep);
|
|
12929
12929
|
}
|
|
12930
|
+
function entryAppliesHere(entry, here) {
|
|
12931
|
+
const e = entry;
|
|
12932
|
+
const scope2 = typeof e?.scope === "string" ? e.scope : "user";
|
|
12933
|
+
if (scope2 === "user") return true;
|
|
12934
|
+
const forProject = typeof e?.projectPath === "string" ? realpathOr(e.projectPath) : "";
|
|
12935
|
+
return forProject === here;
|
|
12936
|
+
}
|
|
12930
12937
|
function registrySays(pluginRoot) {
|
|
12931
12938
|
const plugins = readJsonFile((0, import_node_path7.join)(claudeConfigDir(), "plugins", "installed_plugins.json"))?.plugins;
|
|
12932
12939
|
if (!plugins || typeof plugins !== "object") return "unverified";
|
|
12933
12940
|
const want = (0, import_node_path7.resolve)(pluginRoot);
|
|
12941
|
+
const here = realpathOr(repoRoot());
|
|
12934
12942
|
const markets = marketplaceLocations();
|
|
12935
12943
|
for (const [key, value] of Object.entries(plugins)) {
|
|
12936
12944
|
const at = key.lastIndexOf("@");
|
|
12937
12945
|
const source = at > 0 ? markets.get(key.slice(at + 1)) : void 0;
|
|
12938
|
-
const
|
|
12946
|
+
const applicable = (Array.isArray(value) ? value : []).filter((entry) => entryAppliesHere(entry, here));
|
|
12947
|
+
const claims = applicable.some((entry) => {
|
|
12939
12948
|
const installPath = entry?.installPath;
|
|
12940
12949
|
return typeof installPath === "string" && (0, import_node_path7.resolve)(installPath) === want;
|
|
12941
|
-
}) || source !== void 0 && isWithin(want, source);
|
|
12950
|
+
}) || source !== void 0 && applicable.length > 0 && isWithin(want, source);
|
|
12942
12951
|
if (claims) {
|
|
12943
12952
|
if (enabledPluginSetting(key) === false) return "gone";
|
|
12944
12953
|
return (0, import_node_fs6.existsSync)(pluginRoot) ? "live" : "gone";
|
|
@@ -12998,11 +13007,7 @@ function registeredVerityPlugin() {
|
|
|
12998
13007
|
const e = entry;
|
|
12999
13008
|
const installPath = typeof e.installPath === "string" ? e.installPath : "";
|
|
13000
13009
|
if (!installPath || !(0, import_node_fs6.existsSync)(installPath)) continue;
|
|
13001
|
-
|
|
13002
|
-
if (scope2 !== "user") {
|
|
13003
|
-
const forProject = typeof e.projectPath === "string" ? realpathOr(e.projectPath) : "";
|
|
13004
|
-
if (forProject !== here) continue;
|
|
13005
|
-
}
|
|
13010
|
+
if (!entryAppliesHere(entry, here)) continue;
|
|
13006
13011
|
return { pluginRoot: installPath, version: typeof e.version === "string" ? e.version : null };
|
|
13007
13012
|
}
|
|
13008
13013
|
}
|
|
@@ -20867,7 +20872,7 @@ function channelSilence(input) {
|
|
|
20867
20872
|
// src/lib/cli-version.ts
|
|
20868
20873
|
function cliVersion() {
|
|
20869
20874
|
try {
|
|
20870
|
-
return true ? "0.32.1
|
|
20875
|
+
return true ? "0.32.1" : "dev";
|
|
20871
20876
|
} catch {
|
|
20872
20877
|
return "dev";
|
|
20873
20878
|
}
|
|
@@ -24615,36 +24620,50 @@ async function runGuard(opts, globals) {
|
|
|
24615
24620
|
process.exit(2);
|
|
24616
24621
|
}
|
|
24617
24622
|
resetIter(moment);
|
|
24623
|
+
const notice = verdictNotice({
|
|
24624
|
+
decision,
|
|
24625
|
+
moment,
|
|
24626
|
+
verb,
|
|
24627
|
+
covLine,
|
|
24628
|
+
covDetail,
|
|
24629
|
+
link,
|
|
24630
|
+
viewUrl,
|
|
24631
|
+
narrative: response.assessment?.narrative ?? ""
|
|
24632
|
+
});
|
|
24633
|
+
emitAllowNotice(notice.user, notice.agent);
|
|
24634
|
+
}
|
|
24635
|
+
function verdictNotice(ctx) {
|
|
24636
|
+
const { moment, verb, covLine, covDetail, link, viewUrl } = ctx;
|
|
24637
|
+
const decision = ctx.decision ?? "(unrecognised)";
|
|
24638
|
+
const report = viewUrl ? `
|
|
24639
|
+
Report: ${viewUrl}` : "";
|
|
24618
24640
|
if (decision === "FAIL") {
|
|
24619
|
-
const narrative =
|
|
24620
|
-
|
|
24621
|
-
`\u26A0 Verity ${moment}: the ${verb} may not match its stated purpose \u2014 proceeding (${covLine})${link}`,
|
|
24622
|
-
`Verity ${moment}: intent-alignment WARNING (not blocked).${narrative ? " " + narrative : ""}
|
|
24623
|
-
${covDetail}${
|
|
24624
|
-
|
|
24625
|
-
|
|
24626
|
-
|
|
24627
|
-
|
|
24628
|
-
`\u26A0 Verity ${moment}: WARN \u2014 proceeding (${covLine})${link}`,
|
|
24629
|
-
`Verity ${moment} review: WARN (proceeding).
|
|
24630
|
-
${covDetail}${
|
|
24631
|
-
|
|
24632
|
-
|
|
24633
|
-
|
|
24634
|
-
|
|
24635
|
-
`\u2713 Verity ${moment}: PASS (${covLine})${link}`,
|
|
24636
|
-
`Verity ${moment} review: PASS.
|
|
24637
|
-
${covDetail}${
|
|
24638
|
-
|
|
24639
|
-
);
|
|
24640
|
-
} else {
|
|
24641
|
-
emitAllowNotice(
|
|
24642
|
-
`\u26A0 Verity ${moment}: no verdict came back \u2014 ${verb === "commit" ? "committed" : "pushed"} WITHOUT a usable review (${covLine})${link}`,
|
|
24643
|
-
`Verity ${moment}: the service answered with no recognisable gate decision (${decision}); the ${verb} was allowed, but nothing reviewed it. Treat this as unreviewed, not as a pass.
|
|
24644
|
-
${covDetail}${viewUrl ? `
|
|
24645
|
-
Report: ${viewUrl}` : ""}`
|
|
24646
|
-
);
|
|
24641
|
+
const narrative = ctx.narrative ?? "";
|
|
24642
|
+
return {
|
|
24643
|
+
user: `\u26A0 Verity ${moment}: the ${verb} may not match its stated purpose \u2014 proceeding (${covLine})${link}`,
|
|
24644
|
+
agent: `Verity ${moment}: intent-alignment WARNING (not blocked).${narrative ? " " + narrative : ""}
|
|
24645
|
+
${covDetail}${report}`
|
|
24646
|
+
};
|
|
24647
|
+
}
|
|
24648
|
+
if (decision === "WARN") {
|
|
24649
|
+
return {
|
|
24650
|
+
user: `\u26A0 Verity ${moment}: WARN \u2014 proceeding (${covLine})${link}`,
|
|
24651
|
+
agent: `Verity ${moment} review: WARN (proceeding).
|
|
24652
|
+
${covDetail}${report}`
|
|
24653
|
+
};
|
|
24654
|
+
}
|
|
24655
|
+
if (decision === "PASS") {
|
|
24656
|
+
return {
|
|
24657
|
+
user: `\u2713 Verity ${moment}: PASS (${covLine})${link}`,
|
|
24658
|
+
agent: `Verity ${moment} review: PASS.
|
|
24659
|
+
${covDetail}${report}`
|
|
24660
|
+
};
|
|
24647
24661
|
}
|
|
24662
|
+
return {
|
|
24663
|
+
user: `\u26A0 Verity ${moment}: no verdict came back \u2014 ${verb === "commit" ? "committed" : "pushed"} WITHOUT a usable review (${covLine})${link}`,
|
|
24664
|
+
agent: `Verity ${moment}: the service answered with no recognisable gate decision (${decision}); the ${verb} was allowed, but nothing reviewed it. Treat this as unreviewed, not as a pass.
|
|
24665
|
+
${covDetail}${report}`
|
|
24666
|
+
};
|
|
24648
24667
|
}
|
|
24649
24668
|
function writeBlockMessage(moment, response, covDetail) {
|
|
24650
24669
|
const label2 = moment === "pre-commit" ? "pre-commit" : "pre-push";
|
|
@@ -26667,7 +26686,7 @@ function registerInitCommand(program2) {
|
|
|
26667
26686
|
...telemetryChoice ? { telemetry: telemetryChoice } : {},
|
|
26668
26687
|
init: {
|
|
26669
26688
|
completed_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
26670
|
-
cli_version: true ? "0.32.1
|
|
26689
|
+
cli_version: true ? "0.32.1" : "dev"
|
|
26671
26690
|
}
|
|
26672
26691
|
});
|
|
26673
26692
|
} catch (err) {
|
|
@@ -27347,8 +27366,8 @@ function registerTelemetryCommands(program2) {
|
|
|
27347
27366
|
}
|
|
27348
27367
|
|
|
27349
27368
|
// src/cli.ts
|
|
27350
|
-
program.name("verity").description("CLI for Verity quality gate service").version("0.32.1
|
|
27351
|
-
installStderrLog(actionCommand.name(), process.argv.slice(2), "0.32.1
|
|
27369
|
+
program.name("verity").description("CLI for Verity quality gate service").version("0.32.1").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) => {
|
|
27370
|
+
installStderrLog(actionCommand.name(), process.argv.slice(2), "0.32.1");
|
|
27352
27371
|
setUserNamedServiceUrl(program.opts().serviceUrl);
|
|
27353
27372
|
try {
|
|
27354
27373
|
await foldLegacyLocalCredential();
|