@codacy/verity-cli 0.27.2-experimental.76115e4 → 0.27.2-experimental.ad71767
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 +35 -126
- package/package.json +1 -1
package/bin/verity.js
CHANGED
|
@@ -11827,7 +11827,7 @@ function registerHooksCommands(program2) {
|
|
|
11827
11827
|
}
|
|
11828
11828
|
|
|
11829
11829
|
// src/commands/intent.ts
|
|
11830
|
-
var
|
|
11830
|
+
var import_node_crypto3 = require("node:crypto");
|
|
11831
11831
|
|
|
11832
11832
|
// src/lib/conversation-buffer.ts
|
|
11833
11833
|
var import_promises6 = require("node:fs/promises");
|
|
@@ -11946,19 +11946,6 @@ function getRecentCommitMessages() {
|
|
|
11946
11946
|
}
|
|
11947
11947
|
}
|
|
11948
11948
|
|
|
11949
|
-
// src/lib/context-identity.ts
|
|
11950
|
-
var import_node_crypto2 = require("node:crypto");
|
|
11951
|
-
function contextIdentity(token, sessionId) {
|
|
11952
|
-
const t = (token ?? "").trim();
|
|
11953
|
-
const s = (sessionId ?? "").trim();
|
|
11954
|
-
const userKey = t.length > 0 ? (0, import_node_crypto2.createHash)("sha256").update(t).digest("hex").slice(0, 12) : "anon";
|
|
11955
|
-
const sessionKey2 = s.length > 0 ? (0, import_node_crypto2.createHash)("sha256").update(s).digest("hex").slice(0, 16) : "_default";
|
|
11956
|
-
return { userKey, sessionKey: sessionKey2, bucket: `${userKey}/${sessionKey2}` };
|
|
11957
|
-
}
|
|
11958
|
-
function sessionScopeKey(token, sessionId) {
|
|
11959
|
-
return contextIdentity(token, sessionId).bucket;
|
|
11960
|
-
}
|
|
11961
|
-
|
|
11962
11949
|
// src/lib/task-context-buffer.ts
|
|
11963
11950
|
var import_promises7 = require("node:fs/promises");
|
|
11964
11951
|
var import_node_fs4 = require("node:fs");
|
|
@@ -12246,7 +12233,7 @@ async function retrieveForInjection(promptText, taskFiles = [], budgetTokens = D
|
|
|
12246
12233
|
var import_promises9 = require("node:fs/promises");
|
|
12247
12234
|
var import_node_fs6 = require("node:fs");
|
|
12248
12235
|
var import_node_path9 = require("node:path");
|
|
12249
|
-
var
|
|
12236
|
+
var import_node_crypto2 = require("node:crypto");
|
|
12250
12237
|
|
|
12251
12238
|
// src/lib/glob-match.ts
|
|
12252
12239
|
function globToRegex(glob) {
|
|
@@ -12344,7 +12331,7 @@ async function buildManifest() {
|
|
|
12344
12331
|
const fullPath = (0, import_node_path9.join)(memoryDir2(), filePath);
|
|
12345
12332
|
try {
|
|
12346
12333
|
const content = await (0, import_promises9.readFile)(fullPath, "utf-8");
|
|
12347
|
-
const hash = (0,
|
|
12334
|
+
const hash = (0, import_node_crypto2.createHash)("sha256").update(content).digest("hex").slice(0, 16);
|
|
12348
12335
|
nodes.push({ path: filePath, content_hash: `sha256:${hash}` });
|
|
12349
12336
|
} catch {
|
|
12350
12337
|
}
|
|
@@ -12355,7 +12342,7 @@ async function buildManifest() {
|
|
|
12355
12342
|
let indexHash = null;
|
|
12356
12343
|
try {
|
|
12357
12344
|
const indexContent = await (0, import_promises9.readFile)((0, import_node_path9.join)(memoryDir2(), "index.md"), "utf-8");
|
|
12358
|
-
indexHash = `sha256:${(0,
|
|
12345
|
+
indexHash = `sha256:${(0, import_node_crypto2.createHash)("sha256").update(indexContent).digest("hex").slice(0, 16)}`;
|
|
12359
12346
|
} catch {
|
|
12360
12347
|
}
|
|
12361
12348
|
let logLength = 0;
|
|
@@ -12367,7 +12354,7 @@ async function buildManifest() {
|
|
|
12367
12354
|
return { schema_version: 1, nodes, index_hash: indexHash, log_length: logLength };
|
|
12368
12355
|
}
|
|
12369
12356
|
function hashContent(content) {
|
|
12370
|
-
return `sha256:${(0,
|
|
12357
|
+
return `sha256:${(0, import_node_crypto2.createHash)("sha256").update(content).digest("hex").slice(0, 16)}`;
|
|
12371
12358
|
}
|
|
12372
12359
|
async function readOnDiskNodes() {
|
|
12373
12360
|
const out = /* @__PURE__ */ new Map();
|
|
@@ -12812,10 +12799,7 @@ function registerIntentCommands(program2) {
|
|
|
12812
12799
|
if (!prompt) {
|
|
12813
12800
|
process.exit(0);
|
|
12814
12801
|
}
|
|
12815
|
-
|
|
12816
|
-
const scopeToken = authForScope.ok ? authForScope.data.token : void 0;
|
|
12817
|
-
const scopeSession = event.session_id || process.env.CLAUDE_SESSION_ID || "";
|
|
12818
|
-
await appendToConversationBuffer(prompt, sessionScopeKey(scopeToken, scopeSession));
|
|
12802
|
+
await appendToConversationBuffer(prompt, event.session_id ?? "");
|
|
12819
12803
|
try {
|
|
12820
12804
|
await ensureMemoryDir();
|
|
12821
12805
|
const injection = await retrieveForInjection(prompt);
|
|
@@ -12857,7 +12841,7 @@ async function fireClassify(prompt, sessionId) {
|
|
|
12857
12841
|
logEvent("classify_skipped", { reason: "no_service_url", detail: urlResult.error });
|
|
12858
12842
|
return;
|
|
12859
12843
|
}
|
|
12860
|
-
const promptHash = (0,
|
|
12844
|
+
const promptHash = (0, import_node_crypto3.createHash)("sha256").update(prompt).digest("hex");
|
|
12861
12845
|
const result = await apiRequest({
|
|
12862
12846
|
method: "POST",
|
|
12863
12847
|
path: "/classify-task",
|
|
@@ -13515,10 +13499,10 @@ function collectCodeDelta(files, opts) {
|
|
|
13515
13499
|
|
|
13516
13500
|
// src/lib/debounce.ts
|
|
13517
13501
|
var import_node_fs9 = require("node:fs");
|
|
13518
|
-
var
|
|
13502
|
+
var import_node_crypto4 = require("node:crypto");
|
|
13519
13503
|
function scopedFile(base, sessionId) {
|
|
13520
13504
|
if (!sessionId) return base;
|
|
13521
|
-
return `${base}.${(0,
|
|
13505
|
+
return `${base}.${(0, import_node_crypto4.createHash)("sha1").update(sessionId).digest("hex").slice(0, 12)}`;
|
|
13522
13506
|
}
|
|
13523
13507
|
function checkDebounce(debounceSeconds = DEBOUNCE_SECONDS, sessionId) {
|
|
13524
13508
|
const file = scopedFile(DEBOUNCE_FILE, sessionId);
|
|
@@ -13559,7 +13543,7 @@ function checkMtime(files, bypassForRecentCommits, sessionId) {
|
|
|
13559
13543
|
return "No files modified since last analysis";
|
|
13560
13544
|
}
|
|
13561
13545
|
function computeContentHash(files) {
|
|
13562
|
-
const hash = (0,
|
|
13546
|
+
const hash = (0, import_node_crypto4.createHash)("sha1");
|
|
13563
13547
|
const sorted = [...files].sort();
|
|
13564
13548
|
for (const f of sorted) {
|
|
13565
13549
|
const resolved = resolveFile(f) ?? f;
|
|
@@ -13947,14 +13931,14 @@ function cleanStaleSnapshots(dir, keepSet) {
|
|
|
13947
13931
|
// src/lib/baseline.ts
|
|
13948
13932
|
var import_node_fs13 = require("node:fs");
|
|
13949
13933
|
var import_node_path13 = require("node:path");
|
|
13950
|
-
var
|
|
13934
|
+
var import_node_crypto5 = require("node:crypto");
|
|
13951
13935
|
var BASELINE_VERSION = 1;
|
|
13952
13936
|
var BASELINE_TTL_MS = 7 * 24 * 60 * 60 * 1e3;
|
|
13953
13937
|
var MIRROR_MAX_BYTES = 2 * 1024 * 1024;
|
|
13954
13938
|
var DEFAULT_SESSION_KEY = "_default";
|
|
13955
13939
|
function sessionKey(sessionId) {
|
|
13956
13940
|
if (!sessionId) return DEFAULT_SESSION_KEY;
|
|
13957
|
-
return (0,
|
|
13941
|
+
return (0, import_node_crypto5.createHash)("sha256").update(sessionId).digest("hex").slice(0, 16);
|
|
13958
13942
|
}
|
|
13959
13943
|
function sessionDir(key) {
|
|
13960
13944
|
return (0, import_node_path13.join)(projectPath(BASELINE_DIR), key);
|
|
@@ -14136,57 +14120,13 @@ function pruneOldBaselines() {
|
|
|
14136
14120
|
}
|
|
14137
14121
|
}
|
|
14138
14122
|
|
|
14139
|
-
// src/lib/task-context.ts
|
|
14140
|
-
var import_node_child_process9 = require("node:child_process");
|
|
14141
|
-
var CLOSING_RE = /\b(close[sd]?|fix(?:e[sd])?|resolve[sd]?)\b[\s:]*#(\d+)/i;
|
|
14142
|
-
var BRANCH_RE = /(?:^|[/_-])(?:issue|gh|fix)[-_/]?(\d+)\b/i;
|
|
14143
|
-
function parseLinkedIssue(sources) {
|
|
14144
|
-
for (const c of sources.commits ?? []) {
|
|
14145
|
-
const m = CLOSING_RE.exec(c);
|
|
14146
|
-
if (m) return { issue: parseInt(m[2], 10), via: `commit:${m[1].toLowerCase()}` };
|
|
14147
|
-
}
|
|
14148
|
-
if (sources.branch) {
|
|
14149
|
-
const m = BRANCH_RE.exec(sources.branch);
|
|
14150
|
-
if (m) return { issue: parseInt(m[1], 10), via: "branch" };
|
|
14151
|
-
}
|
|
14152
|
-
return null;
|
|
14153
|
-
}
|
|
14154
|
-
function safeExec(cmd, timeout) {
|
|
14155
|
-
try {
|
|
14156
|
-
return (0, import_node_child_process9.execSync)(cmd, { encoding: "utf8", stdio: ["ignore", "pipe", "ignore"], timeout }).trim();
|
|
14157
|
-
} catch {
|
|
14158
|
-
return "";
|
|
14159
|
-
}
|
|
14160
|
-
}
|
|
14161
|
-
function defaultGhFetch(issue) {
|
|
14162
|
-
const raw = safeExec(`gh issue view ${issue} --json title,body`, 5e3);
|
|
14163
|
-
if (!raw) return null;
|
|
14164
|
-
try {
|
|
14165
|
-
const j = JSON.parse(raw);
|
|
14166
|
-
return j.title ? { title: j.title, body: j.body ?? "" } : null;
|
|
14167
|
-
} catch {
|
|
14168
|
-
return null;
|
|
14169
|
-
}
|
|
14170
|
-
}
|
|
14171
|
-
function resolveTaskContext(opts) {
|
|
14172
|
-
const branch = opts?.branch ?? safeExec("git rev-parse --abbrev-ref HEAD", 3e3);
|
|
14173
|
-
const commits = opts?.commits ?? safeExec("git log -5 --format=%s%n%b", 3e3).split("\n").map((l) => l.trim()).filter(Boolean);
|
|
14174
|
-
const linked = parseLinkedIssue({ branch, commits });
|
|
14175
|
-
if (!linked) return null;
|
|
14176
|
-
const issue = (opts?.ghFetch ?? defaultGhFetch)(linked.issue);
|
|
14177
|
-
if (!issue) return null;
|
|
14178
|
-
const body = (issue.body ?? "").slice(0, 4e3).trim();
|
|
14179
|
-
const goal = `[#${linked.issue}] ${issue.title}${body ? "\n\n" + body : ""}`;
|
|
14180
|
-
return { number: linked.issue, title: issue.title, goal, via: linked.via };
|
|
14181
|
-
}
|
|
14182
|
-
|
|
14183
14123
|
// src/lib/offline.ts
|
|
14184
14124
|
var import_node_fs14 = require("node:fs");
|
|
14185
|
-
var
|
|
14125
|
+
var import_node_crypto6 = require("node:crypto");
|
|
14186
14126
|
function cacheRequest(body) {
|
|
14187
14127
|
try {
|
|
14188
14128
|
(0, import_node_fs14.mkdirSync)(CACHE_DIR, { recursive: true });
|
|
14189
|
-
const suffix = (0,
|
|
14129
|
+
const suffix = (0, import_node_crypto6.randomBytes)(4).toString("hex");
|
|
14190
14130
|
const filename = `pending-${Math.floor(Date.now() / 1e3)}-${suffix}.json`;
|
|
14191
14131
|
(0, import_node_fs14.writeFileSync)(`${CACHE_DIR}/${filename}`, JSON.stringify(body));
|
|
14192
14132
|
} catch {
|
|
@@ -14391,24 +14331,6 @@ function detectAnalysisMode(noFilesChanged, assistantResponse, conversationPromp
|
|
|
14391
14331
|
}
|
|
14392
14332
|
return "standard";
|
|
14393
14333
|
}
|
|
14394
|
-
var FILE_MUTATE_RE = /(?:^|[\s|&;(`])(?:sed\s+-i|perl\s+-i|awk\b|tee\b|dd\b|cp\b|mv\b|ln\b|install\b|touch\b|patch\b|git\s+(?:apply|am)\b|cargo\s+build|go\s+generate|make\b|--write\b|--fix\b|--in-place\b)|>>?(?![&>])/i;
|
|
14395
|
-
var GIT_PLUMBING_RE = /^\s*git\s+(?:merge|rebase|stash|cherry-pick|revert|pull|fetch|checkout|switch|reset|restore|clean)\b/i;
|
|
14396
|
-
var READ_ONLY_RE = /^\s*(?:git\s+(?:status|diff|log|show|branch|remote|config|rev-parse|ls-files|blame|describe)|ls|cat|head|tail|less|grep|rg|find|pwd|echo|printf|wc|which|type|tree|stat|file|env|printenv|date|whoami)\b/i;
|
|
14397
|
-
var CHAIN_RE = /&&|\|\||;|\$\(|\x60/;
|
|
14398
|
-
function hasNonEditAuthorship(actionSummary, sessionAuthoredCode) {
|
|
14399
|
-
if (!actionSummary) return sessionAuthoredCode;
|
|
14400
|
-
if ((actionSummary.subagents ?? 0) > 0) return true;
|
|
14401
|
-
if (Object.keys(actionSummary.tool_counts ?? {}).some((t) => t.startsWith("mcp__"))) return true;
|
|
14402
|
-
const commands = actionSummary.commands ?? [];
|
|
14403
|
-
if (commands.some((c) => FILE_MUTATE_RE.test(c))) return true;
|
|
14404
|
-
if (sessionAuthoredCode) {
|
|
14405
|
-
const allSafe = commands.length > 0 && commands.every(
|
|
14406
|
-
(c) => !CHAIN_RE.test(c) && (GIT_PLUMBING_RE.test(c) || READ_ONLY_RE.test(c))
|
|
14407
|
-
);
|
|
14408
|
-
if (!allSafe) return true;
|
|
14409
|
-
}
|
|
14410
|
-
return false;
|
|
14411
|
-
}
|
|
14412
14334
|
function scopeToAuthored(files, actionSummary) {
|
|
14413
14335
|
if (!actionSummary) return { files, signal: "no-transcript" };
|
|
14414
14336
|
const touched = [...actionSummary.files_edited ?? [], ...actionSummary.files_created ?? []];
|
|
@@ -14617,7 +14539,6 @@ function buildSummary(lines) {
|
|
|
14617
14539
|
searches++;
|
|
14618
14540
|
break;
|
|
14619
14541
|
case "Agent":
|
|
14620
|
-
case "Task":
|
|
14621
14542
|
subagents++;
|
|
14622
14543
|
break;
|
|
14623
14544
|
case "WebFetch":
|
|
@@ -15097,10 +15018,7 @@ async function runAnalyze(opts, globals) {
|
|
|
15097
15018
|
}
|
|
15098
15019
|
const { assistantMessage: assistantResponse, stopReason, transcriptPath, sessionId } = await readStopHookStdin();
|
|
15099
15020
|
const actionSummary = transcriptPath ? await extractActionSummary(transcriptPath) : null;
|
|
15100
|
-
const
|
|
15101
|
-
const scopeToken = tokenResult.ok ? tokenResult.data.token : void 0;
|
|
15102
|
-
const rawSessionId = sessionId || process.env.CLAUDE_SESSION_ID || void 0;
|
|
15103
|
-
const baselineSessionId = sessionScopeKey(scopeToken, rawSessionId);
|
|
15021
|
+
const baselineSessionId = sessionId || process.env.CLAUDE_SESSION_ID || void 0;
|
|
15104
15022
|
const baseline = readBaseline(baselineSessionId);
|
|
15105
15023
|
if (baseline) {
|
|
15106
15024
|
logEvent("baseline_loaded", {
|
|
@@ -15118,7 +15036,7 @@ async function runAnalyze(opts, globals) {
|
|
|
15118
15036
|
passAndExit("No analyzable files changed");
|
|
15119
15037
|
}
|
|
15120
15038
|
const allForReview = Array.from(/* @__PURE__ */ new Set([...analyzable, ...reviewable]));
|
|
15121
|
-
const conversation = await readAndClearConversationBuffer(
|
|
15039
|
+
const conversation = await readAndClearConversationBuffer(sessionId ?? void 0);
|
|
15122
15040
|
const specs = discoverSpecs();
|
|
15123
15041
|
const plans = discoverPlans();
|
|
15124
15042
|
const latestPrompt = conversation?.prompts?.[conversation.prompts.length - 1]?.prompt ?? "";
|
|
@@ -15132,6 +15050,7 @@ async function runAnalyze(opts, globals) {
|
|
|
15132
15050
|
if (isReflectionQuestion(assistantResponse) && !agentAuthoredCodeThisTurn) {
|
|
15133
15051
|
passAndExit("Reflection-prompt turn \u2014 skipping analysis");
|
|
15134
15052
|
}
|
|
15053
|
+
const tokenResult = await resolveToken(globals.token);
|
|
15135
15054
|
const urlResult = await resolveServiceUrl(globals.serviceUrl);
|
|
15136
15055
|
if (!tokenResult.ok || !urlResult.ok) {
|
|
15137
15056
|
localOnlyAndExit(runLocalStatic(analyzable, securityFiles, baseline, !!opts.skipStatic));
|
|
@@ -15226,7 +15145,7 @@ async function runAnalyze(opts, globals) {
|
|
|
15226
15145
|
contentHash = hashResult.hash;
|
|
15227
15146
|
if (analysisMode !== "plan") {
|
|
15228
15147
|
const scoped = scopeToAuthored(allForReview, actionSummary);
|
|
15229
|
-
if (scoped.signal === "none-authored" &&
|
|
15148
|
+
if (scoped.signal === "none-authored" && (actionSummary?.subagents ?? 0) === 0) {
|
|
15230
15149
|
passAndExit("No agent-authored code this turn \u2014 working-tree changes were not authored by this session");
|
|
15231
15150
|
}
|
|
15232
15151
|
const baseForReview = scoped.signal === "authored" && scoped.files.length > 0 ? scoped.files : allForReview;
|
|
@@ -15359,10 +15278,7 @@ async function runAnalyze(opts, globals) {
|
|
|
15359
15278
|
if (snapshotResult.has_snapshots && snapshotResult.diffs.length > 0) {
|
|
15360
15279
|
requestBody.snapshot_diffs = snapshotResult.diffs;
|
|
15361
15280
|
}
|
|
15362
|
-
const
|
|
15363
|
-
const explicitlyAutonomous = /^(1|true|yes|on)$/i.test(process.env.VERITY_AUTONOMOUS ?? "") || !!process.env.CI || !!process.env.GITHUB_ACTIONS;
|
|
15364
|
-
const w4Task = noHumanPrompt && explicitlyAutonomous ? resolveTaskContext() : null;
|
|
15365
|
-
const hasIntent = (conversation?.prompts?.length ?? 0) > 0 || specs.length > 0 || plans.length > 0 || !!assistantResponse || !!w4Task;
|
|
15281
|
+
const hasIntent = (conversation?.prompts?.length ?? 0) > 0 || specs.length > 0 || plans.length > 0 || !!assistantResponse;
|
|
15366
15282
|
if (hasIntent) {
|
|
15367
15283
|
const intentContext = {};
|
|
15368
15284
|
if (conversation && conversation.prompts.length > 0) {
|
|
@@ -15377,10 +15293,6 @@ async function runAnalyze(opts, globals) {
|
|
|
15377
15293
|
intentContext.recent_commits = conversation.recent_commits;
|
|
15378
15294
|
}
|
|
15379
15295
|
}
|
|
15380
|
-
if (w4Task && !intentContext.user_prompt) {
|
|
15381
|
-
intentContext.user_prompt = w4Task.goal;
|
|
15382
|
-
logEvent("w4_issue_anchor", { issue: w4Task.number, via: w4Task.via });
|
|
15383
|
-
}
|
|
15384
15296
|
if (assistantResponse) {
|
|
15385
15297
|
const cap = analysisMode === "plan" ? MAX_ASSISTANT_RESPONSE_CHARS_PLAN : MAX_ASSISTANT_RESPONSE_CHARS_DEFAULT;
|
|
15386
15298
|
intentContext.assistant_response = assistantResponse.length > cap ? assistantResponse.slice(0, cap) : assistantResponse;
|
|
@@ -15673,10 +15585,7 @@ function registerBaselineCommands(program2) {
|
|
|
15673
15585
|
}
|
|
15674
15586
|
}
|
|
15675
15587
|
}
|
|
15676
|
-
const
|
|
15677
|
-
const scopeToken = authForScope.ok ? authForScope.data.token : void 0;
|
|
15678
|
-
const scopeSession = sessionId || process.env.CLAUDE_SESSION_ID || void 0;
|
|
15679
|
-
const result = captureBaseline({ sessionId: sessionScopeKey(scopeToken, scopeSession), source });
|
|
15588
|
+
const result = captureBaseline({ sessionId, source });
|
|
15680
15589
|
logEvent("baseline_capture", {
|
|
15681
15590
|
created: result.created,
|
|
15682
15591
|
source: source ?? null,
|
|
@@ -16122,20 +16031,20 @@ function writeBlockMessage(moment, response) {
|
|
|
16122
16031
|
var import_node_fs24 = require("node:fs");
|
|
16123
16032
|
var import_promises13 = require("node:fs/promises");
|
|
16124
16033
|
var import_node_path19 = require("node:path");
|
|
16125
|
-
var
|
|
16034
|
+
var import_node_child_process10 = require("node:child_process");
|
|
16126
16035
|
var readline2 = __toESM(require("node:readline/promises"));
|
|
16127
16036
|
|
|
16128
16037
|
// src/commands/migrate.ts
|
|
16129
16038
|
var import_node_fs23 = require("node:fs");
|
|
16130
16039
|
var import_node_path18 = require("node:path");
|
|
16131
|
-
var
|
|
16040
|
+
var import_node_child_process9 = require("node:child_process");
|
|
16132
16041
|
var LEGACY_NPM_PACKAGE = "@codacy/gate-cli";
|
|
16133
16042
|
function defaultNpmRemover(pkg) {
|
|
16134
|
-
(0,
|
|
16043
|
+
(0, import_node_child_process9.execSync)(`npm rm -g ${pkg}`, { stdio: "pipe", timeout: 12e4 });
|
|
16135
16044
|
}
|
|
16136
16045
|
function isGitTracked(cwd, relPath) {
|
|
16137
16046
|
try {
|
|
16138
|
-
(0,
|
|
16047
|
+
(0, import_node_child_process9.execSync)(`git ls-files --error-unmatch ${relPath}`, { cwd, stdio: "pipe" });
|
|
16139
16048
|
return true;
|
|
16140
16049
|
} catch {
|
|
16141
16050
|
return false;
|
|
@@ -16143,7 +16052,7 @@ function isGitTracked(cwd, relPath) {
|
|
|
16143
16052
|
}
|
|
16144
16053
|
function isGitRepo(cwd) {
|
|
16145
16054
|
try {
|
|
16146
|
-
(0,
|
|
16055
|
+
(0, import_node_child_process9.execSync)("git rev-parse --is-inside-work-tree", { cwd, stdio: "pipe" });
|
|
16147
16056
|
return true;
|
|
16148
16057
|
} catch {
|
|
16149
16058
|
return false;
|
|
@@ -16182,7 +16091,7 @@ function migrateProjectDirRename(root, gateDir, verityDir, actions) {
|
|
|
16182
16091
|
);
|
|
16183
16092
|
}
|
|
16184
16093
|
try {
|
|
16185
|
-
(0,
|
|
16094
|
+
(0, import_node_child_process9.execSync)("git mv .gate .verity", { cwd: root, stdio: "pipe" });
|
|
16186
16095
|
actions.push("Moved .gate/ \u2192 .verity/ (git mv, staged)");
|
|
16187
16096
|
moved = true;
|
|
16188
16097
|
} catch {
|
|
@@ -16261,7 +16170,7 @@ function migrateStandardFile(root, actions) {
|
|
|
16261
16170
|
let moved = false;
|
|
16262
16171
|
if (isGitRepo(root) && isGitTracked(root, "GATE.md")) {
|
|
16263
16172
|
try {
|
|
16264
|
-
(0,
|
|
16173
|
+
(0, import_node_child_process9.execSync)("git mv GATE.md VERITY.md", { cwd: root, stdio: "pipe" });
|
|
16265
16174
|
moved = true;
|
|
16266
16175
|
} catch {
|
|
16267
16176
|
}
|
|
@@ -16317,7 +16226,7 @@ function readFileSyncSafe(path) {
|
|
|
16317
16226
|
}
|
|
16318
16227
|
function hasStagedChanges(root) {
|
|
16319
16228
|
try {
|
|
16320
|
-
(0,
|
|
16229
|
+
(0, import_node_child_process9.execSync)("git diff --cached --quiet", { cwd: root, stdio: "pipe" });
|
|
16321
16230
|
return false;
|
|
16322
16231
|
} catch {
|
|
16323
16232
|
return true;
|
|
@@ -16436,7 +16345,7 @@ async function runOptionalAuth(serviceUrl) {
|
|
|
16436
16345
|
}
|
|
16437
16346
|
let remote = "";
|
|
16438
16347
|
try {
|
|
16439
|
-
remote = (0,
|
|
16348
|
+
remote = (0, import_node_child_process10.execSync)("git remote get-url origin", { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }).trim();
|
|
16440
16349
|
} catch {
|
|
16441
16350
|
}
|
|
16442
16351
|
const localOnlyNote = () => {
|
|
@@ -16532,30 +16441,30 @@ function registerInitCommand(program2) {
|
|
|
16532
16441
|
}
|
|
16533
16442
|
printInfo(` Node.js ${nodeVersion} \u2713`);
|
|
16534
16443
|
try {
|
|
16535
|
-
const gitVersion = (0,
|
|
16444
|
+
const gitVersion = (0, import_node_child_process10.execSync)("git --version", { encoding: "utf-8" }).trim();
|
|
16536
16445
|
printInfo(` ${gitVersion} \u2713`);
|
|
16537
16446
|
} catch {
|
|
16538
16447
|
printError("git is required but not installed. Install from https://git-scm.com");
|
|
16539
16448
|
process.exit(1);
|
|
16540
16449
|
}
|
|
16541
16450
|
try {
|
|
16542
|
-
(0,
|
|
16451
|
+
(0, import_node_child_process10.execSync)("which claude", { encoding: "utf-8" });
|
|
16543
16452
|
printInfo(" Claude Code \u2713");
|
|
16544
16453
|
} catch {
|
|
16545
16454
|
printWarn(" Claude Code not found \u2014 hooks will be configured but need Claude Code to run.");
|
|
16546
16455
|
}
|
|
16547
16456
|
try {
|
|
16548
|
-
(0,
|
|
16457
|
+
(0, import_node_child_process10.execSync)("which codacy-analysis", { encoding: "utf-8", stdio: "pipe" });
|
|
16549
16458
|
printInfo(" @codacy/analysis-cli \u2713");
|
|
16550
16459
|
} catch {
|
|
16551
16460
|
printInfo(" Installing @codacy/analysis-cli...");
|
|
16552
16461
|
try {
|
|
16553
|
-
(0,
|
|
16462
|
+
(0, import_node_child_process10.execSync)("npm install -g @codacy/analysis-cli", { encoding: "utf-8", stdio: "pipe", timeout: 12e4 });
|
|
16554
16463
|
printInfo(" @codacy/analysis-cli installed \u2713");
|
|
16555
16464
|
} catch {
|
|
16556
16465
|
try {
|
|
16557
16466
|
printWarn(" Retrying with sudo...");
|
|
16558
|
-
(0,
|
|
16467
|
+
(0, import_node_child_process10.execSync)("sudo npm install -g @codacy/analysis-cli", { encoding: "utf-8", stdio: "inherit", timeout: 12e4 });
|
|
16559
16468
|
printInfo(" @codacy/analysis-cli installed \u2713");
|
|
16560
16469
|
} catch {
|
|
16561
16470
|
printWarn(" Could not install @codacy/analysis-cli automatically.");
|
|
@@ -17373,7 +17282,7 @@ function registerTelemetryCommands(program2) {
|
|
|
17373
17282
|
}
|
|
17374
17283
|
|
|
17375
17284
|
// src/cli.ts
|
|
17376
|
-
program.name("verity").description("CLI for Verity quality gate service").version("0.27.2-experimental.
|
|
17285
|
+
program.name("verity").description("CLI for Verity quality gate service").version("0.27.2-experimental.ad71767").option("--token <token>", "Override authentication token").option("--service-url <url>", "Override service URL").option("--verbose", "Log HTTP requests/responses to stderr");
|
|
17377
17286
|
registerAuthCommands(program);
|
|
17378
17287
|
registerLoginCommand(program);
|
|
17379
17288
|
registerHooksCommands(program);
|