@elyracode/doctor 0.9.56 → 0.9.58
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/extensions/checks.ts +57 -14
- package/extensions/index.ts +4 -6
- package/extensions/probes.ts +1 -1
- package/package.json +1 -1
package/extensions/checks.ts
CHANGED
|
@@ -33,10 +33,18 @@ export function checkSecurityAudit(cwd: string): Finding[] {
|
|
|
33
33
|
const moderate = vulns.moderate ?? 0;
|
|
34
34
|
const low = vulns.low ?? 0;
|
|
35
35
|
if (critical > 0) {
|
|
36
|
-
findings.push({
|
|
36
|
+
findings.push({
|
|
37
|
+
severity: "error",
|
|
38
|
+
category: "Security",
|
|
39
|
+
message: `${critical} critical/high npm vulnerabilities found`,
|
|
40
|
+
});
|
|
37
41
|
}
|
|
38
42
|
if (moderate > 0) {
|
|
39
|
-
findings.push({
|
|
43
|
+
findings.push({
|
|
44
|
+
severity: "warning",
|
|
45
|
+
category: "Security",
|
|
46
|
+
message: `${moderate} moderate npm vulnerabilities found`,
|
|
47
|
+
});
|
|
40
48
|
}
|
|
41
49
|
if (low > 0) {
|
|
42
50
|
findings.push({ severity: "info", category: "Security", message: `${low} low npm vulnerabilities found` });
|
|
@@ -50,7 +58,11 @@ export function checkSecurityAudit(cwd: string): Finding[] {
|
|
|
50
58
|
encoding: "utf-8",
|
|
51
59
|
});
|
|
52
60
|
if (result.includes('"critical"') || result.includes('"high"')) {
|
|
53
|
-
findings.push({
|
|
61
|
+
findings.push({
|
|
62
|
+
severity: "error",
|
|
63
|
+
category: "Security",
|
|
64
|
+
message: "npm security vulnerabilities detected. Run `npm audit` for details.",
|
|
65
|
+
});
|
|
54
66
|
}
|
|
55
67
|
} catch {
|
|
56
68
|
// Skip if npm audit fails entirely
|
|
@@ -68,7 +80,11 @@ export function checkSecurityAudit(cwd: string): Finding[] {
|
|
|
68
80
|
});
|
|
69
81
|
} catch (error) {
|
|
70
82
|
if (error && typeof error === "object" && "status" in error && (error as { status: unknown }).status !== 0) {
|
|
71
|
-
findings.push({
|
|
83
|
+
findings.push({
|
|
84
|
+
severity: "warning",
|
|
85
|
+
category: "Security",
|
|
86
|
+
message: "Composer security vulnerabilities detected. Run `composer audit` for details.",
|
|
87
|
+
});
|
|
72
88
|
}
|
|
73
89
|
}
|
|
74
90
|
}
|
|
@@ -95,7 +111,11 @@ export function checkOutdatedDeps(cwd: string): Finding[] {
|
|
|
95
111
|
const outdated = JSON.parse(result || "{}");
|
|
96
112
|
const count = Object.keys(outdated).length;
|
|
97
113
|
if (count > 10) {
|
|
98
|
-
findings.push({
|
|
114
|
+
findings.push({
|
|
115
|
+
severity: "warning",
|
|
116
|
+
category: "Dependencies",
|
|
117
|
+
message: `${count} outdated npm packages. Run \`npm outdated\` for details.`,
|
|
118
|
+
});
|
|
99
119
|
} else if (count > 0) {
|
|
100
120
|
findings.push({ severity: "info", category: "Dependencies", message: `${count} outdated npm packages` });
|
|
101
121
|
} else {
|
|
@@ -119,7 +139,11 @@ export function checkEnvFile(cwd: string): Finding[] {
|
|
|
119
139
|
if (!existsSync(examplePath)) return findings;
|
|
120
140
|
|
|
121
141
|
if (!existsSync(envPath)) {
|
|
122
|
-
findings.push({
|
|
142
|
+
findings.push({
|
|
143
|
+
severity: "error",
|
|
144
|
+
category: "Configuration",
|
|
145
|
+
message: ".env file is missing (but .env.example exists)",
|
|
146
|
+
});
|
|
123
147
|
return findings;
|
|
124
148
|
}
|
|
125
149
|
|
|
@@ -159,7 +183,10 @@ export function checkCodeDebt(cwd: string): Finding[] {
|
|
|
159
183
|
"grep -rn --include='*.php' --include='*.ts' --include='*.tsx' --include='*.js' --include='*.jsx' --include='*.vue' --include='*.blade.php' -E '(TODO|FIXME|HACK|XXX|WORKAROUND):?' . 2>/dev/null | head -100 || true",
|
|
160
184
|
{ cwd, timeout: 15000, encoding: "utf-8" },
|
|
161
185
|
);
|
|
162
|
-
const lines = result
|
|
186
|
+
const lines = result
|
|
187
|
+
.trim()
|
|
188
|
+
.split("\n")
|
|
189
|
+
.filter((l) => l.length > 0);
|
|
163
190
|
if (lines.length > 0) {
|
|
164
191
|
const todoCount = lines.filter((l) => /TODO/i.test(l)).length;
|
|
165
192
|
const fixmeCount = lines.filter((l) => /FIXME/i.test(l)).length;
|
|
@@ -194,7 +221,14 @@ export function checkLargeFiles(cwd: string): Finding[] {
|
|
|
194
221
|
if (depth > 5) return;
|
|
195
222
|
try {
|
|
196
223
|
for (const entry of readdirSync(dir)) {
|
|
197
|
-
if (
|
|
224
|
+
if (
|
|
225
|
+
entry.startsWith(".") ||
|
|
226
|
+
entry === "node_modules" ||
|
|
227
|
+
entry === "vendor" ||
|
|
228
|
+
entry === "dist" ||
|
|
229
|
+
entry === "build"
|
|
230
|
+
)
|
|
231
|
+
continue;
|
|
198
232
|
const fullPath = join(dir, entry);
|
|
199
233
|
const stat = statSync(fullPath);
|
|
200
234
|
if (stat.isDirectory()) {
|
|
@@ -239,15 +273,26 @@ export function checkGitStatus(cwd: string): Finding[] {
|
|
|
239
273
|
|
|
240
274
|
try {
|
|
241
275
|
const status = execSync("git status --porcelain 2>/dev/null", { cwd, timeout: 10000, encoding: "utf-8" });
|
|
242
|
-
const lines = status
|
|
276
|
+
const lines = status
|
|
277
|
+
.trim()
|
|
278
|
+
.split("\n")
|
|
279
|
+
.filter((l) => l.length > 0);
|
|
243
280
|
const untracked = lines.filter((l) => l.startsWith("??")).length;
|
|
244
281
|
const modified = lines.filter((l) => !l.startsWith("??")).length;
|
|
245
282
|
|
|
246
283
|
if (modified > 0) {
|
|
247
|
-
findings.push({
|
|
284
|
+
findings.push({
|
|
285
|
+
severity: "info",
|
|
286
|
+
category: "Git",
|
|
287
|
+
message: `${modified} uncommitted change${modified > 1 ? "s" : ""}`,
|
|
288
|
+
});
|
|
248
289
|
}
|
|
249
290
|
if (untracked > 0) {
|
|
250
|
-
findings.push({
|
|
291
|
+
findings.push({
|
|
292
|
+
severity: "info",
|
|
293
|
+
category: "Git",
|
|
294
|
+
message: `${untracked} untracked file${untracked > 1 ? "s" : ""}`,
|
|
295
|
+
});
|
|
251
296
|
}
|
|
252
297
|
if (modified === 0 && untracked === 0) {
|
|
253
298
|
findings.push({ severity: "info", category: "Git", message: "Working tree clean" });
|
|
@@ -280,9 +325,7 @@ export function checkProjectEssentials(cwd: string): Finding[] {
|
|
|
280
325
|
|
|
281
326
|
// Node-specific
|
|
282
327
|
if (existsSync(join(cwd, "package.json"))) {
|
|
283
|
-
checks.push(
|
|
284
|
-
{ file: "tsconfig.json", label: "TypeScript config", severity: "info" },
|
|
285
|
-
);
|
|
328
|
+
checks.push({ file: "tsconfig.json", label: "TypeScript config", severity: "info" });
|
|
286
329
|
}
|
|
287
330
|
|
|
288
331
|
for (const check of checks) {
|
package/extensions/index.ts
CHANGED
|
@@ -19,18 +19,16 @@ export default function (elyra: ExtensionAPI): void {
|
|
|
19
19
|
if (healMode) {
|
|
20
20
|
const actionable = findings.filter((f) => f.severity === "error" || f.severity === "warning");
|
|
21
21
|
if (actionable.length === 0) {
|
|
22
|
-
elyra.sendUserMessage(
|
|
23
|
-
`Health check complete. No issues to fix.\n\n${report}`,
|
|
24
|
-
);
|
|
22
|
+
elyra.sendUserMessage(`Health check complete. No issues to fix.\n\n${report}`);
|
|
25
23
|
return;
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
const healInstructions = formatHealInstructions(actionable);
|
|
29
27
|
elyra.sendUserMessage(
|
|
30
28
|
`Health check found ${actionable.length} issue${actionable.length > 1 ? "s" : ""} to fix. ` +
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
`Work through each one systematically. For each issue: analyze it, fix it if possible, and report what you did.\n\n` +
|
|
30
|
+
`${report}\n\n` +
|
|
31
|
+
`## Auto-Heal Instructions\n\n${healInstructions}`,
|
|
34
32
|
);
|
|
35
33
|
} else {
|
|
36
34
|
elyra.sendUserMessage(
|
package/extensions/probes.ts
CHANGED
|
@@ -10,10 +10,10 @@ export {
|
|
|
10
10
|
evaluateThinkingClaims,
|
|
11
11
|
formatProbeReport,
|
|
12
12
|
MODELS_PER_PROVIDER,
|
|
13
|
-
pickReasoningLevel,
|
|
14
13
|
type ProbeOptions,
|
|
15
14
|
type ProbeReport,
|
|
16
15
|
type ProbeResult,
|
|
16
|
+
pickReasoningLevel,
|
|
17
17
|
runModelProbes,
|
|
18
18
|
selectModelsForProvider,
|
|
19
19
|
type ThinkingObservation,
|
package/package.json
CHANGED