@neuralaxis/vibedoctor 0.1.1 → 0.1.3

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.
Files changed (75) hide show
  1. package/README.md +219 -290
  2. package/dist/adapters/biome.d.ts +1 -1
  3. package/dist/adapters/biome.js +7 -4
  4. package/dist/adapters/coveragePy.js +3 -0
  5. package/dist/adapters/customDeadChain.d.ts +2 -1
  6. package/dist/adapters/customDeadChain.js +100 -8
  7. package/dist/adapters/customLeftovers.js +33 -10
  8. package/dist/adapters/deptry.js +21 -2
  9. package/dist/adapters/index.d.ts +3 -0
  10. package/dist/adapters/index.js +7 -1
  11. package/dist/adapters/jscpd.d.ts +1 -0
  12. package/dist/adapters/jscpd.js +10 -1
  13. package/dist/adapters/knip.js +29 -4
  14. package/dist/adapters/lizard.d.ts +1 -1
  15. package/dist/adapters/lizard.js +51 -2
  16. package/dist/adapters/osvScanner.js +14 -2
  17. package/dist/adapters/presidio.d.ts +2 -0
  18. package/dist/adapters/presidio.js +158 -0
  19. package/dist/adapters/privacyDetector.d.ts +10 -0
  20. package/dist/adapters/privacyDetector.js +600 -0
  21. package/dist/adapters/ruff.d.ts +1 -1
  22. package/dist/adapters/ruff.js +4 -1
  23. package/dist/adapters/semgrep.d.ts +1 -1
  24. package/dist/adapters/semgrep.js +17 -3
  25. package/dist/adapters/shared.d.ts +1 -0
  26. package/dist/adapters/shared.js +22 -0
  27. package/dist/adapters/telemetryDetector.d.ts +2 -0
  28. package/dist/adapters/telemetryDetector.js +118 -0
  29. package/dist/adapters/tsc.js +43 -18
  30. package/dist/adapters/vulture.d.ts +1 -1
  31. package/dist/adapters/vulture.js +25 -6
  32. package/dist/agentPack/generateAgentPack.d.ts +7 -0
  33. package/dist/agentPack/generateAgentPack.js +89 -1
  34. package/dist/agentPack/templates/index.js +21 -15
  35. package/dist/agentPack/templates/skills.js +57 -4
  36. package/dist/cli/commands/agent.d.ts +5 -0
  37. package/dist/cli/commands/agent.js +10 -0
  38. package/dist/cli/commands/agentPlan.js +9 -1
  39. package/dist/cli/commands/init.js +50 -17
  40. package/dist/cli/commands/privacyReview.d.ts +9 -0
  41. package/dist/cli/commands/privacyReview.js +304 -0
  42. package/dist/cli/commands/scan.d.ts +1 -1
  43. package/dist/cli/commands/scan.js +31 -1
  44. package/dist/cli/commands/setup.js +16 -1
  45. package/dist/cli/commands/tool.d.ts +4 -0
  46. package/dist/cli/commands/tool.js +11 -0
  47. package/dist/cli/index.js +36 -0
  48. package/dist/core/config.d.ts +29 -0
  49. package/dist/core/config.js +142 -5
  50. package/dist/core/engine.d.ts +35 -1
  51. package/dist/core/engine.js +204 -36
  52. package/dist/core/finding.d.ts +16 -2
  53. package/dist/core/finding.js +5 -0
  54. package/dist/core/paths.js +5 -0
  55. package/dist/core/privacyReview.d.ts +51 -0
  56. package/dist/core/privacyReview.js +94 -0
  57. package/dist/core/projectDetector.d.ts +1 -1
  58. package/dist/core/projectDetector.js +34 -12
  59. package/dist/core/scanPlanner.js +4 -0
  60. package/dist/core/scoring.js +6 -0
  61. package/dist/core/toolRunner.d.ts +1 -0
  62. package/dist/core/toolRunner.js +73 -11
  63. package/dist/index.d.ts +2 -0
  64. package/dist/index.js +5 -0
  65. package/dist/mcp/tools/shared.d.ts +1 -1
  66. package/dist/mcp/tools/shared.js +8 -1
  67. package/dist/reporters/agent.js +8 -0
  68. package/dist/reporters/html.js +12 -8
  69. package/dist/reporters/json.js +5 -5
  70. package/dist/reporters/markdown.js +15 -1
  71. package/dist/reporters/sarif.js +6 -0
  72. package/dist/reporters/terminal.js +1 -5
  73. package/dist/rules/severityMap.d.ts +1 -0
  74. package/dist/rules/severityMap.js +1 -0
  75. package/package.json +6 -2
@@ -105,12 +105,17 @@ async function readPackageMetadata(root, packageManager) {
105
105
  }
106
106
  return { testCommands, frameworkHints };
107
107
  }
108
- async function detectProject(root) {
108
+ function isFrameworkEntryFile(file) {
109
+ return (/^(?:src\/)?app\/(?:.+\/)?(?:page|layout|route|loading|error|global-error|not-found|default|template)\.(ts|tsx|js|jsx)$/.test(file) ||
110
+ /^(?:src\/)?pages\/(?:.+)\.(ts|tsx|js|jsx)$/.test(file) ||
111
+ /^(?:src\/)?(?:middleware|instrumentation)\.(ts|js)$/.test(file));
112
+ }
113
+ async function detectProject(root, excludePatterns) {
109
114
  const projectFiles = await (0, paths_1.listProjectFiles)(root);
110
- const fileSet = new Set(projectFiles);
115
+ const detectionFiles = excludePatterns ? (0, paths_1.filterPaths)(projectFiles, ["**/*"], excludePatterns) : projectFiles;
111
116
  const languages = new Set();
112
117
  const frameworkHints = new Set();
113
- for (const file of projectFiles) {
118
+ for (const file of detectionFiles) {
114
119
  if (file.endsWith(".py")) {
115
120
  languages.add("python");
116
121
  }
@@ -128,29 +133,46 @@ async function detectProject(root) {
128
133
  }
129
134
  }
130
135
  const packageManagers = new Set();
131
- if (fileSet.has("package.json")) {
132
- packageManagers.add(fileSet.has("pnpm-lock.yaml") ? "pnpm" : fileSet.has("yarn.lock") ? "yarn" : fileSet.has("bun.lockb") ? "bun" : "npm");
133
- }
134
- if (fileSet.has("requirements.txt") || fileSet.has("pyproject.toml")) {
135
- packageManagers.add(fileSet.has("uv.lock") ? "uv" : fileSet.has("poetry.lock") ? "poetry" : fileSet.has("pdm.lock") ? "pdm" : "pip");
136
+ const hasPackageJson = detectionFiles.some((f) => f === "package.json" || f.endsWith("/package.json"));
137
+ const hasPythonManifest = detectionFiles.some((f) => f === "requirements.txt" || f.endsWith("/requirements.txt") || f === "pyproject.toml" || f.endsWith("/pyproject.toml"));
138
+ if (hasPackageJson) {
139
+ packageManagers.add(detectionFiles.some((f) => f === "pnpm-lock.yaml" || f.endsWith("/pnpm-lock.yaml"))
140
+ ? "pnpm"
141
+ : detectionFiles.some((f) => f === "yarn.lock" || f.endsWith("/yarn.lock"))
142
+ ? "yarn"
143
+ : detectionFiles.some((f) => f === "bun.lockb" || f.endsWith("/bun.lockb"))
144
+ ? "bun"
145
+ : "npm");
146
+ }
147
+ if (hasPythonManifest) {
148
+ packageManagers.add(detectionFiles.some((f) => f === "uv.lock" || f.endsWith("/uv.lock"))
149
+ ? "uv"
150
+ : detectionFiles.some((f) => f === "poetry.lock" || f.endsWith("/poetry.lock"))
151
+ ? "poetry"
152
+ : detectionFiles.some((f) => f === "pdm.lock" || f.endsWith("/pdm.lock"))
153
+ ? "pdm"
154
+ : "pip");
136
155
  }
137
156
  const packageMetadata = await readPackageMetadata(root, ["npm", "pnpm", "yarn", "bun"].find((manager) => packageManagers.has(manager)));
138
157
  for (const hint of packageMetadata.frameworkHints) {
139
158
  frameworkHints.add(hint);
140
159
  }
141
- if (fileSet.has("pytest.ini") || projectFiles.some((file) => /(^|\/)tests?\//.test(file) && file.endsWith(".py"))) {
160
+ if (detectionFiles.some((f) => f === "pytest.ini" || f.endsWith("/pytest.ini")) ||
161
+ detectionFiles.some((file) => /(^|\/)tests?\//.test(file) && file.endsWith(".py"))) {
142
162
  packageMetadata.testCommands.push(pythonTestCommand(packageManagers));
143
163
  }
144
164
  const toolPairs = await Promise.all(KNOWN_TOOLS.map(async (tool) => [tool, await commandExists(tool, root)]));
145
- const entryFiles = projectFiles.filter((file) => /(^|\/)(main|index|app|server|cli)\.(ts|tsx|js|jsx|py)$/.test(file) || file === "package.json");
165
+ const entryFiles = detectionFiles.filter((file) => /(^|\/)(main|index|app|server|cli)\.(ts|tsx|js|jsx|py)$/.test(file) || isFrameworkEntryFile(file) || file.endsWith("package.json"));
146
166
  return {
147
167
  root,
148
168
  languages: Array.from(languages).sort(),
149
169
  packageManagers: Array.from(packageManagers).sort(),
150
170
  hasGit: await (0, git_1.isGitRepo)(root),
151
171
  changedFiles: await (0, git_1.getChangedFiles)(root),
152
- configFiles: KNOWN_CONFIG_FILES.filter((fileName) => fileSet.has(fileName)),
153
- lockfiles: KNOWN_LOCKFILES.filter((fileName) => fileSet.has(fileName)),
172
+ configFiles: KNOWN_CONFIG_FILES.filter((fileName) => detectionFiles.some((f) => f === fileName || f.endsWith(`/${fileName}`))),
173
+ // Consumers pass these values directly to tools such as osv-scanner, so
174
+ // retain the repository-relative path rather than just the basename.
175
+ lockfiles: detectionFiles.filter((file) => KNOWN_LOCKFILES.some((fileName) => file === fileName || file.endsWith(`/${fileName}`))),
154
176
  testCommands: Array.from(new Set(packageMetadata.testCommands)),
155
177
  toolsAvailable: Object.fromEntries(toolPairs),
156
178
  frameworkHints: Array.from(frameworkHints).sort(),
@@ -10,6 +10,7 @@ async function createScanPlan(project, config, adapters, mode) {
10
10
  "pyright",
11
11
  "gitleaks",
12
12
  "osv-scanner",
13
+ "privacy-detector",
13
14
  "custom-leftovers"
14
15
  ]);
15
16
  for (const adapter of adapters) {
@@ -31,6 +32,9 @@ async function createScanPlan(project, config, adapters, mode) {
31
32
  if (adapter.category === "dependencies" && !config.checks.dependencies.enabled) {
32
33
  continue;
33
34
  }
35
+ if (adapter.category === "privacy" && !config.checks.privacy.enabled) {
36
+ continue;
37
+ }
34
38
  if (mode === "quick" && !quickAdapterIds.has(adapter.id)) {
35
39
  continue;
36
40
  }
@@ -11,6 +11,7 @@ const defaultCategoryScore = {
11
11
  maintainability: 100,
12
12
  dependencies: 100,
13
13
  tests: 100,
14
+ privacy: 100,
14
15
  efficiency: 100,
15
16
  refactor_readiness: 100
16
17
  };
@@ -22,10 +23,14 @@ const defaultPenalties = {
22
23
  maintainability: 0,
23
24
  dependencies: 0,
24
25
  tests: 0,
26
+ privacy: 0,
25
27
  efficiency: 0,
26
28
  refactor_readiness: 0
27
29
  };
28
30
  function scoreFinding(finding) {
31
+ if (finding.category === "privacy" && finding.evidence?.reviewState === "false_positive") {
32
+ return 0;
33
+ }
29
34
  const issueMultiplier = finding.isNew ? 1.5 : 0.3;
30
35
  const confidence = severityMap_1.confidenceMultiplier[finding.confidence];
31
36
  const autofix = finding.safeToAutofix ? 0.5 : 1;
@@ -48,6 +53,7 @@ function buildScore(findings) {
48
53
  categories.correctness * severityMap_1.categoryWeights.correctness +
49
54
  categories.tests * severityMap_1.categoryWeights.tests +
50
55
  categories.dependencies * severityMap_1.categoryWeights.dependencies +
56
+ categories.privacy * severityMap_1.categoryWeights.privacy +
51
57
  categories.maintainability * severityMap_1.categoryWeights.maintainability +
52
58
  categories.dead_code * severityMap_1.categoryWeights.dead_code +
53
59
  categories.leftovers * severityMap_1.categoryWeights.leftovers +
@@ -16,6 +16,7 @@ export type ToolResult = {
16
16
  };
17
17
  export declare function getLocalToolSearchPaths(cwd: string | undefined): string[];
18
18
  export declare function buildCommandEnv(cwd: string | undefined, overrides: NodeJS.ProcessEnv | undefined): NodeJS.ProcessEnv;
19
+ export declare function commandExistsOnWindowsPath(command: string, cwd?: string): boolean;
19
20
  export declare function runCommand(spec: CommandSpec, installHint?: string): Promise<ToolResult>;
20
21
  export declare function runCommands(commands: Array<{
21
22
  id: string;
@@ -5,10 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getLocalToolSearchPaths = getLocalToolSearchPaths;
7
7
  exports.buildCommandEnv = buildCommandEnv;
8
+ exports.commandExistsOnWindowsPath = commandExistsOnWindowsPath;
8
9
  exports.runCommand = runCommand;
9
10
  exports.runCommands = runCommands;
10
11
  const node_path_1 = __importDefault(require("node:path"));
12
+ const node_fs_1 = require("node:fs");
11
13
  const node_child_process_1 = require("node:child_process");
14
+ const node_child_process_2 = require("node:child_process");
12
15
  const LOCAL_TOOL_PATHS = [
13
16
  ["node_modules", ".bin"],
14
17
  [".venv", "Scripts"],
@@ -38,23 +41,78 @@ function getLocalToolSearchPaths(cwd) {
38
41
  const paths = ancestorDirs(cwd).flatMap((dir) => LOCAL_TOOL_PATHS.map((segments) => node_path_1.default.join(dir, ...segments)));
39
42
  return Array.from(new Set(paths));
40
43
  }
44
+ function getUserToolSearchPaths(env) {
45
+ const paths = [];
46
+ if (process.platform === "win32" && env.APPDATA) {
47
+ const pythonRoot = node_path_1.default.join(env.APPDATA, "Python");
48
+ try {
49
+ for (const entry of (0, node_fs_1.readdirSync)(pythonRoot, { withFileTypes: true })) {
50
+ if (entry.isDirectory() && /^Python\d+$/i.test(entry.name)) {
51
+ paths.push(node_path_1.default.join(pythonRoot, entry.name, "Scripts"));
52
+ }
53
+ }
54
+ }
55
+ catch {
56
+ // Python user packages have not been installed for this account.
57
+ }
58
+ }
59
+ else if (env.HOME) {
60
+ paths.push(node_path_1.default.join(env.HOME, ".local", "bin"));
61
+ }
62
+ return paths;
63
+ }
41
64
  function buildCommandEnv(cwd, overrides) {
42
65
  const env = { ...process.env, ...overrides };
43
66
  const pathKey = getPathKey(env);
44
67
  const existingPath = env[pathKey];
45
- env[pathKey] = [...getLocalToolSearchPaths(cwd), existingPath].filter(Boolean).join(node_path_1.default.delimiter);
68
+ env[pathKey] = [...getLocalToolSearchPaths(cwd), ...getUserToolSearchPaths(env), existingPath].filter(Boolean).join(node_path_1.default.delimiter);
46
69
  return env;
47
70
  }
71
+ function findWindowsCommandOnPath(command, env) {
72
+ const pathValue = env[getPathKey(env)] ?? "";
73
+ const extensions = (env.PATHEXT ?? ".COM;.EXE;.BAT;.CMD")
74
+ .split(";")
75
+ .map((extension) => extension.toLowerCase());
76
+ for (const directory of pathValue.split(node_path_1.default.delimiter).filter(Boolean)) {
77
+ for (const extension of extensions) {
78
+ const candidate = node_path_1.default.join(directory, `${command}${extension}`);
79
+ if ((0, node_fs_1.existsSync)(candidate)) {
80
+ return candidate;
81
+ }
82
+ }
83
+ }
84
+ return undefined;
85
+ }
86
+ function commandExistsOnWindowsPath(command, cwd) {
87
+ return findWindowsCommandOnPath(command, buildCommandEnv(cwd, undefined)) !== undefined;
88
+ }
89
+ function resolveWindowsCommand(command, env) {
90
+ if (process.platform !== "win32" || node_path_1.default.isAbsolute(command) || node_path_1.default.extname(command)) {
91
+ return { command, useShell: false };
92
+ }
93
+ const candidate = findWindowsCommandOnPath(command, env);
94
+ if (candidate) {
95
+ if (/\.(?:cmd|bat)$/i.test(candidate)) {
96
+ // cmd.exe scripts must run through the shell; quote the resolved path so
97
+ // directories with spaces (e.g. "Program Files") do not break parsing.
98
+ return { command: candidate.includes(" ") ? `"${candidate}"` : candidate, useShell: true };
99
+ }
100
+ return { command: candidate, useShell: false };
101
+ }
102
+ // Not found via PATH/PATHEXT probing. Fall back to the shell so commands that
103
+ // are only reachable through cmd.exe mechanisms (App Execution Aliases,
104
+ // App Paths registry entries) still launch, matching the previous behavior.
105
+ return { command, useShell: true };
106
+ }
48
107
  async function runCommand(spec, installHint) {
49
108
  const startedAt = Date.now();
50
- const useShell = process.platform === "win32" &&
51
- !node_path_1.default.isAbsolute(spec.cmd) &&
52
- node_path_1.default.extname(spec.cmd).length === 0;
109
+ const env = buildCommandEnv(spec.cwd, spec.env);
110
+ const resolved = resolveWindowsCommand(spec.cmd, env);
53
111
  return new Promise((resolve) => {
54
- const child = (0, node_child_process_1.spawn)(spec.cmd, spec.args, {
112
+ const child = (0, node_child_process_1.spawn)(resolved.command, spec.args, {
55
113
  cwd: spec.cwd,
56
- env: buildCommandEnv(spec.cwd, spec.env),
57
- shell: useShell,
114
+ env,
115
+ shell: resolved.useShell,
58
116
  windowsHide: true
59
117
  });
60
118
  let stdout = "";
@@ -126,11 +184,15 @@ async function runCommand(spec, installHint) {
126
184
  return;
127
185
  }
128
186
  settled = true;
129
- const killSignal = process.platform === "win32" ? undefined : "SIGTERM";
130
- try {
131
- child.kill(killSignal);
187
+ if (process.platform === "win32" && child.pid) {
188
+ (0, node_child_process_2.execFile)("taskkill", ["/pid", String(child.pid), "/T", "/F"], { windowsHide: true }, () => undefined);
189
+ }
190
+ else {
191
+ try {
192
+ child.kill("SIGTERM");
193
+ }
194
+ catch { }
132
195
  }
133
- catch { }
134
196
  cleanup();
135
197
  resolve({
136
198
  command: [spec.cmd, ...spec.args].join(" "),
package/dist/index.d.ts CHANGED
@@ -1,7 +1,9 @@
1
1
  export * from "./agentPack/generateAgentPack";
2
2
  export * from "./agentPack/policy";
3
+ export { AGENT_SKILLS, DEFAULT_SKILL_NAMES, type SkillTemplate } from "./agentPack/templates";
3
4
  export * from "./core/config";
4
5
  export * from "./core/engine";
5
6
  export * from "./core/finding";
7
+ export * from "./core/privacyReview";
6
8
  export * from "./core/projectDetector";
7
9
  export * from "./mcp/server";
package/dist/index.js CHANGED
@@ -14,10 +14,15 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.DEFAULT_SKILL_NAMES = exports.AGENT_SKILLS = void 0;
17
18
  __exportStar(require("./agentPack/generateAgentPack"), exports);
18
19
  __exportStar(require("./agentPack/policy"), exports);
20
+ var templates_1 = require("./agentPack/templates");
21
+ Object.defineProperty(exports, "AGENT_SKILLS", { enumerable: true, get: function () { return templates_1.AGENT_SKILLS; } });
22
+ Object.defineProperty(exports, "DEFAULT_SKILL_NAMES", { enumerable: true, get: function () { return templates_1.DEFAULT_SKILL_NAMES; } });
19
23
  __exportStar(require("./core/config"), exports);
20
24
  __exportStar(require("./core/engine"), exports);
21
25
  __exportStar(require("./core/finding"), exports);
26
+ __exportStar(require("./core/privacyReview"), exports);
22
27
  __exportStar(require("./core/projectDetector"), exports);
23
28
  __exportStar(require("./mcp/server"), exports);
@@ -30,7 +30,7 @@ export declare const categorySchema: {
30
30
  readonly type: "array";
31
31
  readonly items: {
32
32
  readonly type: "string";
33
- readonly enum: readonly ["security", "correctness", "dead_code", "leftovers", "maintainability", "dependencies", "tests", "efficiency", "refactor_readiness"];
33
+ readonly enum: readonly ["security", "correctness", "dead_code", "leftovers", "maintainability", "dependencies", "tests", "privacy", "efficiency", "refactor_readiness"];
34
34
  };
35
35
  };
36
36
  export declare function parseCategories(value: unknown): FindingCategory[] | undefined;
@@ -50,7 +50,14 @@ async function prepareScan(root, mode, categories, target = "generic") {
50
50
  const filtered = categories && categories.length > 0 ? (0, engine_1.filterScanByCategories)(scan, categories, { policy, target }) : scan;
51
51
  const withPlan = {
52
52
  ...filtered,
53
- agentPlan: (0, engine_1.createAgentPlan)({ findings: filtered.findings, score: filtered.score, skippedTools: filtered.skippedTools }, { policy, target })
53
+ agentPlan: (0, engine_1.createAgentPlan)({
54
+ findings: filtered.findings,
55
+ score: filtered.score,
56
+ skippedTools: filtered.skippedTools,
57
+ toolStatuses: filtered.toolStatuses,
58
+ completeness: filtered.completeness,
59
+ recoveryActions: filtered.recoveryActions
60
+ }, { policy, target })
54
61
  };
55
62
  await (0, shared_1.ensureOutputArtifacts)(root, config, withPlan);
56
63
  return {
@@ -9,6 +9,14 @@ function renderAgentMarkdown(input) {
9
9
  const plan = getPlan(input);
10
10
  const lines = ["# VibeDoctor Agent Plan", "", `Goal: ${plan.goal}.`, "", `Target: ${plan.target}`, "", "## Workflow", ""];
11
11
  plan.workflow.forEach((step, index) => lines.push(`${index + 1}. ${step}`));
12
+ if (plan.recoveryActions.length > 0) {
13
+ lines.push("", "## Recover before editing", "");
14
+ plan.recoveryActions.forEach((action) => {
15
+ lines.push(`- ${action.tool}: \`${action.command}\``);
16
+ lines.push(` Success: ${action.successCondition}.`);
17
+ lines.push(` If it fails: ${action.onFailure}`);
18
+ });
19
+ }
12
20
  lines.push("", "## Allowed actions", "");
13
21
  plan.allowedActions.forEach((action) => lines.push(`- ${action}`));
14
22
  lines.push("", "## Forbidden actions", "");
@@ -49,27 +49,31 @@ function renderHtmlReport(scan) {
49
49
  <h1>VibeDoctor Health Report</h1>
50
50
  <div class="meta">Root: <code>${escapeHtml(scan.root)}</code> &middot; Mode: ${scan.mode} &middot; Generated for agents &amp; humans</div>
51
51
 
52
- <div class="score">Health: ${scan.score.overall}/100 ${scan.score.overall >= 85 ? "✅" : "⚠️"}</div>
52
+ <div class="score">Health: ${scan.score.overall}/100 — ${scan.completeness.status.toUpperCase()} ${scan.score.overall >= 85 ? "✅" : "⚠️"}</div>
53
+ <div class="meta">Scan coverage: ${scan.completeness.completed}/${scan.completeness.planned} checks completed.${scan.completeness.comparable ? "" : " This score is not comparable to a complete scan."}</div>
53
54
 
54
55
  <div class="summary">
55
- <span class="pill">Blockers: ${scan.blockers.length}</span>
56
- <span class="pill">Fix next: ${scan.fixNext.length}</span>
57
- <span class="pill">Leftovers: ${scan.leftovers.length}</span>
56
+ <span class="pill">Blockers: ${scan.blockers.length}</span>
57
+ <span class="pill">Fix next: ${scan.fixNext.length}</span>
58
+ <span class="pill">Privacy Review: ${scan.privacyFindings.length}</span>
59
+ <span class="pill">Leftovers: ${scan.leftovers.length}</span>
58
60
  <span class="pill">Dead chains: ${scan.deadCodeCandidates.length}</span>
59
61
  <span class="pill">Refactor: ${scan.refactorCandidates.length}</span>
60
62
  </div>
61
63
 
62
64
  <div class="section">
63
- ${renderFindingList(scan.blockers, "BLOCKERS")}
64
- ${renderFindingList(scan.fixNext, "FIX NEXT")}
65
- ${renderFindingList(scan.leftovers, "LEFTOVERS")}
65
+ ${renderFindingList(scan.blockers, "BLOCKERS")}
66
+ ${renderFindingList(scan.fixNext, "FIX NEXT")}
67
+ ${renderFindingList(scan.privacyFindings.slice(0, 10), "PRIVACY REVIEW FINDINGS")}
68
+ ${renderFindingList(scan.leftovers, "LEFTOVERS")}
66
69
  ${renderFindingList(scan.deadCodeCandidates, "DEAD CHAINS")}
67
70
  ${renderFindingList(scan.refactorCandidates, "REFACTOR CANDIDATES")}
68
71
  </div>
69
72
 
70
73
  ${toolList(scan.toolStatuses.filter(t => t.status !== "ok"), "Tool Statuses (non-ok)")}
71
74
  ${toolList(scan.skippedTools, "Skipped Tools")}
72
- ${errored.length ? toolList(errored, "Errored / Timed Out Tools") : ""}
75
+ ${errored.length ? toolList(errored, "Errored / Timed Out Tools") : ""}
76
+ ${scan.recoveryActions.length ? `<h3>Recover before editing</h3><ul>${scan.recoveryActions.map(action => `<li><code>${escapeHtml(action.command)}</code> — ${escapeHtml(action.successCondition)}</li>`).join("")}</ul>` : ""}
73
77
 
74
78
  <p class="meta" style="margin-top:32px">Run <code>vibedoctor agent-plan</code> for guided repair. Full JSON/HTML/Markdown/SARIF available via --report.</p>
75
79
  </body>
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.renderJsonReport = renderJsonReport;
7
- const node_os_1 = __importDefault(require("node:os"));
8
4
  function renderJsonReport(scan) {
9
5
  return JSON.stringify({
10
6
  score: scan.score.overall,
7
+ completeness: scan.completeness,
8
+ recoveryActions: scan.recoveryActions,
11
9
  categoryScores: scan.score.categories,
12
10
  findings: scan.findings,
13
11
  topFindings: scan.topFindings,
12
+ privacyFindings: scan.privacyFindings,
13
+ privacyReview: scan.privacyReview,
14
14
  toolStatuses: scan.toolStatuses,
15
15
  skippedTools: scan.skippedTools,
16
16
  agentPlan: scan.agentPlan
17
- }, null, 2).replace(/\n/g, node_os_1.default.EOL) + node_os_1.default.EOL;
17
+ }, null, 2) + "\n";
18
18
  }
@@ -3,10 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.renderMarkdownReport = renderMarkdownReport;
4
4
  function renderMarkdownReport(scan) {
5
5
  const plan = scan.agentPlan;
6
- const lines = [`# VibeDoctor Report`, "", `Health: **${scan.score.overall}/100**`, ""];
6
+ const lines = [
7
+ `# VibeDoctor Report`,
8
+ "",
9
+ `Health: **${scan.score.overall}/100** — ${scan.completeness.status.toUpperCase()}`,
10
+ `Scan coverage: **${scan.completeness.completed}/${scan.completeness.planned} checks completed**`,
11
+ ...(scan.completeness.comparable ? [] : ["This score is not comparable to a complete scan."]),
12
+ ""
13
+ ];
7
14
  lines.push("## Summary");
8
15
  lines.push(`- Blockers: ${scan.blockers.length}`);
9
16
  lines.push(`- Fix next: ${scan.fixNext.length}`);
17
+ lines.push(`- Privacy Review findings: ${scan.privacyFindings.length}`);
10
18
  lines.push(`- Leftovers: ${scan.leftovers.length}`);
11
19
  lines.push(`- Dead code candidates: ${scan.deadCodeCandidates.length}`);
12
20
  lines.push(`- Refactor candidates: ${scan.refactorCandidates.length}`);
@@ -19,6 +27,12 @@ function renderMarkdownReport(scan) {
19
27
  }
20
28
  lines.push("", "## Fix next");
21
29
  scan.fixNext.forEach((finding) => lines.push(`- ${finding.title}${finding.file ? ` — \`${finding.file}\`` : ""}`));
30
+ if (scan.privacyFindings.length > 0) {
31
+ lines.push("", "## Privacy Review findings");
32
+ scan.privacyFindings
33
+ .slice(0, 10)
34
+ .forEach((finding) => lines.push(`- ${finding.title}${finding.file ? ` — \`${finding.file}${finding.startLine ? `:${finding.startLine}` : ""}\`` : ""}: ${finding.evidence?.maskedValue ?? finding.evidence?.entityType ?? finding.message}`));
35
+ }
22
36
  if (scan.deadCodeCandidates.length > 0) {
23
37
  lines.push("", "## Dead chains and dead code");
24
38
  scan.deadCodeCandidates.slice(0, 5).forEach((finding) => lines.push(`- ${finding.title}${finding.file ? ` — \`${finding.file}\`` : ""}: ${finding.message}`));
@@ -17,6 +17,12 @@ function renderSarif(scan) {
17
17
  message: {
18
18
  text: finding.message
19
19
  },
20
+ properties: {
21
+ category: finding.category,
22
+ confidence: finding.confidence,
23
+ entityType: finding.evidence?.entityType,
24
+ sensitivity: finding.evidence?.sensitivity
25
+ },
20
26
  locations: finding.file
21
27
  ? [
22
28
  {
@@ -1,11 +1,7 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
3
  exports.renderTerminalReport = renderTerminalReport;
7
- const node_os_1 = __importDefault(require("node:os"));
8
4
  const engine_1 = require("../core/engine");
9
5
  function renderTerminalReport(scan) {
10
- return `${(0, engine_1.buildSummaryLines)(scan).join(node_os_1.default.EOL)}${node_os_1.default.EOL}\n`;
6
+ return `${(0, engine_1.buildSummaryLines)(scan).join("\n")}\n\n`;
11
7
  }
@@ -7,6 +7,7 @@ export declare const categoryWeights: {
7
7
  readonly correctness: 0.18;
8
8
  readonly tests: 0.15;
9
9
  readonly dependencies: 0.13;
10
+ readonly privacy: 0;
10
11
  readonly maintainability: 0.12;
11
12
  readonly dead_code: 0.08;
12
13
  readonly leftovers: 0.06;
@@ -25,6 +25,7 @@ exports.categoryWeights = {
25
25
  correctness: 0.18,
26
26
  tests: 0.15,
27
27
  dependencies: 0.13,
28
+ privacy: 0,
28
29
  maintainability: 0.12,
29
30
  dead_code: 0.08,
30
31
  leftovers: 0.06,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neuralaxis/vibedoctor",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Health diagnosis and fix planning for JS, TS, Python, and mixed repositories.",
5
5
  "type": "commonjs",
6
6
  "publishConfig": {
@@ -68,6 +68,10 @@
68
68
  "knip": "^6.16.1",
69
69
  "tsx": "^4.20.3",
70
70
  "typescript": "^5.8.3",
71
- "vitest": "^3.2.4"
71
+ "vite": "^7.3.5",
72
+ "vitest": "^3.2.6"
73
+ },
74
+ "overrides": {
75
+ "esbuild": "0.28.1"
72
76
  }
73
77
  }