@neuralaxis/vibedoctor 0.1.2 → 0.2.0
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/README.md +215 -102
- package/dist/adapters/biome.d.ts +1 -1
- package/dist/adapters/biome.js +7 -4
- package/dist/adapters/coveragePy.js +3 -0
- package/dist/adapters/deptry.js +21 -2
- package/dist/adapters/dpdp.d.ts +6 -0
- package/dist/adapters/dpdp.js +34 -0
- package/dist/adapters/index.d.ts +1 -0
- package/dist/adapters/index.js +3 -1
- package/dist/adapters/knip.js +29 -4
- package/dist/adapters/lizard.d.ts +1 -1
- package/dist/adapters/lizard.js +51 -2
- package/dist/adapters/osvScanner.js +14 -2
- package/dist/adapters/presidio.js +3 -1
- package/dist/adapters/privacyDetector.d.ts +24 -1
- package/dist/adapters/privacyDetector.js +91 -7
- package/dist/adapters/ruff.d.ts +1 -1
- package/dist/adapters/ruff.js +4 -1
- package/dist/adapters/semgrep.d.ts +1 -1
- package/dist/adapters/semgrep.js +17 -3
- package/dist/adapters/shared.d.ts +7 -0
- package/dist/adapters/shared.js +22 -0
- package/dist/adapters/tsc.js +43 -18
- package/dist/adapters/vulture.d.ts +1 -1
- package/dist/adapters/vulture.js +25 -6
- package/dist/agentPack/templates/index.js +7 -4
- package/dist/agentPack/templates/skills.js +156 -44
- package/dist/cli/commands/agentPlan.js +9 -1
- package/dist/cli/commands/dpdp.d.ts +35 -0
- package/dist/cli/commands/dpdp.js +103 -0
- package/dist/cli/commands/init.js +12 -4
- package/dist/cli/commands/scan.d.ts +1 -1
- package/dist/cli/commands/scan.js +8 -1
- package/dist/cli/commands/setup.js +4 -2
- package/dist/cli/commands/tool.d.ts +4 -0
- package/dist/cli/commands/tool.js +11 -0
- package/dist/cli/index.js +96 -0
- package/dist/core/config.d.ts +27 -0
- package/dist/core/config.js +118 -5
- package/dist/core/engine.d.ts +32 -1
- package/dist/core/engine.js +195 -30
- package/dist/core/finding.d.ts +1 -1
- package/dist/core/finding.js +1 -0
- package/dist/core/projectDetector.d.ts +1 -1
- package/dist/core/projectDetector.js +29 -12
- package/dist/core/scanPlanner.js +10 -2
- package/dist/core/toolRunner.d.ts +1 -0
- package/dist/core/toolRunner.js +73 -11
- package/dist/dpdp/artifacts.d.ts +11 -0
- package/dist/dpdp/artifacts.js +120 -0
- package/dist/dpdp/catalogue.d.ts +14 -0
- package/dist/dpdp/catalogue.js +661 -0
- package/dist/dpdp/collectors/confidence.d.ts +9 -0
- package/dist/dpdp/collectors/confidence.js +25 -0
- package/dist/dpdp/collectors/dependencies.d.ts +7 -0
- package/dist/dpdp/collectors/dependencies.js +63 -0
- package/dist/dpdp/collectors/index.d.ts +24 -0
- package/dist/dpdp/collectors/index.js +71 -0
- package/dist/dpdp/collectors/lifecycle.d.ts +2 -0
- package/dist/dpdp/collectors/lifecycle.js +202 -0
- package/dist/dpdp/collectors/optionalScanners.d.ts +14 -0
- package/dist/dpdp/collectors/optionalScanners.js +347 -0
- package/dist/dpdp/collectors/privacyBridge.d.ts +13 -0
- package/dist/dpdp/collectors/privacyBridge.js +152 -0
- package/dist/dpdp/collectors/safeguards.d.ts +5 -0
- package/dist/dpdp/collectors/safeguards.js +186 -0
- package/dist/dpdp/collectors/schema.d.ts +6 -0
- package/dist/dpdp/collectors/schema.js +122 -0
- package/dist/dpdp/collectors/shared.d.ts +10 -0
- package/dist/dpdp/collectors/shared.js +43 -0
- package/dist/dpdp/context.d.ts +28 -0
- package/dist/dpdp/context.js +195 -0
- package/dist/dpdp/dataMap.d.ts +7 -0
- package/dist/dpdp/dataMap.js +339 -0
- package/dist/dpdp/evaluators.d.ts +20 -0
- package/dist/dpdp/evaluators.js +522 -0
- package/dist/dpdp/evidence.d.ts +11 -0
- package/dist/dpdp/evidence.js +123 -0
- package/dist/dpdp/findings.d.ts +14 -0
- package/dist/dpdp/findings.js +99 -0
- package/dist/dpdp/gates.d.ts +14 -0
- package/dist/dpdp/gates.js +47 -0
- package/dist/dpdp/index.d.ts +16 -0
- package/dist/dpdp/index.js +32 -0
- package/dist/dpdp/legalSources.d.ts +10 -0
- package/dist/dpdp/legalSources.js +104 -0
- package/dist/dpdp/paths.d.ts +25 -0
- package/dist/dpdp/paths.js +85 -0
- package/dist/dpdp/report.d.ts +6 -0
- package/dist/dpdp/report.js +222 -0
- package/dist/dpdp/reviewQueue.d.ts +3 -0
- package/dist/dpdp/reviewQueue.js +88 -0
- package/dist/dpdp/scan.d.ts +26 -0
- package/dist/dpdp/scan.js +310 -0
- package/dist/dpdp/scoring.d.ts +31 -0
- package/dist/dpdp/scoring.js +211 -0
- package/dist/dpdp/types.d.ts +294 -0
- package/dist/dpdp/types.js +86 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/mcp/tools/dpdp.d.ts +11 -0
- package/dist/mcp/tools/dpdp.js +151 -0
- package/dist/mcp/tools/index.js +3 -1
- package/dist/mcp/tools/shared.js +8 -1
- package/dist/reporters/agent.js +8 -0
- package/dist/reporters/html.js +4 -2
- package/dist/reporters/json.js +8 -1
- package/dist/reporters/markdown.js +8 -1
- package/package.json +9 -2
package/README.md
CHANGED
|
@@ -1,171 +1,288 @@
|
|
|
1
1
|
# VibeDoctor
|
|
2
2
|
|
|
3
|
-
A health check for code you did not write line by line
|
|
3
|
+
**A local health check for code you did not write line by line.**
|
|
4
4
|
|
|
5
|
-
VibeDoctor
|
|
5
|
+
VibeDoctor scans JavaScript, TypeScript, Python, and mixed repositories for code-health, security, privacy, testing, and maintainability problems. It combines repository-local scanner output into one ranked report, one normalized finding format, and a fix-next plan that humans and coding agents can use without interpreting a wall of unrelated logs.
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
npx @neuralaxis/vibedoctor scan --changed
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
VibeDoctor runs locally by default. Missing or failed scanners are reported as incomplete evidence, never silently counted as a clean result.
|
|
12
|
+
|
|
13
|
+
## Start here
|
|
14
|
+
|
|
15
|
+
Choose the shortest path for what you are doing:
|
|
16
|
+
|
|
17
|
+
| Goal | Command |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| Check files changed in Git | `npx @neuralaxis/vibedoctor scan --changed` |
|
|
20
|
+
| Run a fast repository check | `npx @neuralaxis/vibedoctor scan --quick` |
|
|
21
|
+
| Run the most complete check | `npx @neuralaxis/vibedoctor scan --full` |
|
|
22
|
+
| Prepare local scanner tools | `npx @neuralaxis/vibedoctor setup` |
|
|
23
|
+
| Get a repair plan for an AI agent | `npx @neuralaxis/vibedoctor agent-plan --format markdown` |
|
|
24
|
+
| Check India DPDP technical readiness | `npx @neuralaxis/vibedoctor dpdp scan --full` |
|
|
25
|
+
|
|
26
|
+
For a new repository, initialize the config and review the scanner setup plan:
|
|
12
27
|
|
|
13
28
|
```bash
|
|
14
29
|
npx @neuralaxis/vibedoctor init
|
|
30
|
+
npx @neuralaxis/vibedoctor setup
|
|
15
31
|
npx @neuralaxis/vibedoctor setup --apply
|
|
16
32
|
npx @neuralaxis/vibedoctor scan --quick
|
|
17
33
|
```
|
|
18
34
|
|
|
19
|
-
|
|
35
|
+
`setup --apply` installs supported recommended tools, so review the plan before applying it. To use the shorter `vibedoctor` command everywhere:
|
|
20
36
|
|
|
21
37
|
```bash
|
|
22
38
|
npm install -g @neuralaxis/vibedoctor
|
|
23
|
-
vibedoctor scan --full
|
|
24
39
|
```
|
|
25
40
|
|
|
26
|
-
##
|
|
41
|
+
## What you get
|
|
27
42
|
|
|
28
|
-
|
|
43
|
+
Every scan reports both repository health and scan completeness. It highlights blockers, the next fixes, privacy findings, skipped or failed tools, and exact recovery commands.
|
|
29
44
|
|
|
30
|
-
|
|
45
|
+
Default artifacts are written under `.vibedoctor/`:
|
|
31
46
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
47
|
+
```text
|
|
48
|
+
.vibedoctor/
|
|
49
|
+
├── report.json # automation and agents
|
|
50
|
+
├── report.html # human review
|
|
51
|
+
└── agent-plan.md # ordered repair work
|
|
52
|
+
```
|
|
37
53
|
|
|
38
|
-
|
|
54
|
+
Use the terminal report for quick triage, HTML for review, JSON for automation, and `agent-plan.md` for a coding agent.
|
|
39
55
|
|
|
40
|
-
|
|
56
|
+
## What VibeDoctor checks
|
|
41
57
|
|
|
42
58
|
- Type and lint failures from TypeScript, Pyright, Ruff, Biome, and similar local tools.
|
|
43
|
-
- Secrets and
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
- Test and coverage signal from local JS and Python tooling.
|
|
59
|
+
- Secrets, vulnerable dependencies, and insecure patterns from Gitleaks, OSV-Scanner, Semgrep, and project-native scanners when available.
|
|
60
|
+
- Dead or unused code from Knip, Vulture, deptry, and VibeDoctor's dead-chain detector.
|
|
61
|
+
- AI and legacy leftovers such as stale TODOs, commented-out code, fallback flags, and half-removed features.
|
|
62
|
+
- Refactor-readiness hotspots, duplication, complexity, tests, and coverage signals.
|
|
63
|
+
- Regulated identifiers, personal-data fields, sensitive attributes, and risky combinations through deterministic privacy checks and optional Presidio support.
|
|
49
64
|
|
|
50
|
-
|
|
65
|
+
VibeDoctor detects the repository shape and discovers applicable local tools. A missing optional tool is marked `SKIPPED`; a failed or timed-out required tool can make the result `PARTIAL` or `INVALID`.
|
|
51
66
|
|
|
52
|
-
##
|
|
67
|
+
## Understand the result before fixing code
|
|
53
68
|
|
|
54
|
-
|
|
69
|
+
| Status | Meaning | What to do |
|
|
70
|
+
| --- | --- | --- |
|
|
71
|
+
| `COMPLETE` | All required checks completed. | Work through the ranked findings. |
|
|
72
|
+
| `PARTIAL` | Some checks were skipped, failed, or timed out. | Follow `recoveryActions`; do not rely on the score alone. |
|
|
73
|
+
| `INVALID` | There is not enough trustworthy evidence for an authoritative result. | Recover the required scanners and scan again before editing. |
|
|
55
74
|
|
|
56
|
-
|
|
75
|
+
CLI exit codes let people, agents, and CI distinguish health failures from missing evidence:
|
|
57
76
|
|
|
58
|
-
|
|
|
77
|
+
| Code | Meaning |
|
|
59
78
|
| --- | --- |
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
| Fast local triage | `vibedoctor scan --quick` |
|
|
64
|
-
| Review changed files | `vibedoctor scan --changed` |
|
|
65
|
-
| Full repository scan | `vibedoctor scan --full` |
|
|
66
|
-
| Scan selected categories | `vibedoctor scan --category dead_code,leftovers --report json` |
|
|
67
|
-
| Scan privacy findings only | `vibedoctor scan --category privacy --report json` |
|
|
68
|
-
| Render reports | `vibedoctor report --html`, `--markdown`, `--sarif`, or `--agent` |
|
|
69
|
-
| Apply safe tool fixes | `vibedoctor fix --safe` |
|
|
70
|
-
| Create a baseline | `vibedoctor baseline create` |
|
|
71
|
-
| Explain a finding | `vibedoctor explain <finding-id>` |
|
|
72
|
-
| Verify after edits | `vibedoctor verify` |
|
|
73
|
-
| Generate an agent repair plan | `vibedoctor agent-plan --format markdown` |
|
|
79
|
+
| `0` | The scan completed and configured gates passed. |
|
|
80
|
+
| `1` | One or more configured health gates failed. |
|
|
81
|
+
| `2` | Required checks were incomplete. |
|
|
74
82
|
|
|
75
|
-
|
|
83
|
+
Skipped scanners are never treated as clean results. Privacy findings affect the privacy category score by default, but do not lower the overall score or fail CI unless you opt into privacy gates.
|
|
76
84
|
|
|
77
|
-
|
|
85
|
+
If a scanner times out or fails, run the recovery command shown in the report. For example:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
vibedoctor tool retry semgrep --timeout 600
|
|
89
|
+
```
|
|
78
90
|
|
|
79
|
-
|
|
91
|
+
## A fast, safe repair loop
|
|
80
92
|
|
|
81
93
|
```bash
|
|
82
|
-
|
|
83
|
-
vibedoctor
|
|
94
|
+
# 1. Establish the current state
|
|
95
|
+
vibedoctor scan --changed --report json
|
|
96
|
+
|
|
97
|
+
# 2. Generate ordered work
|
|
98
|
+
vibedoctor agent-plan --format markdown
|
|
99
|
+
|
|
100
|
+
# 3. Optionally apply supported safe tool fixes
|
|
101
|
+
vibedoctor fix --safe
|
|
102
|
+
|
|
103
|
+
# 4. Review every change, then verify
|
|
104
|
+
vibedoctor verify
|
|
84
105
|
```
|
|
85
106
|
|
|
86
|
-
|
|
107
|
+
Use `vibedoctor explain <finding-id>` when a finding needs more context. Always review generated changes before committing them.
|
|
87
108
|
|
|
88
|
-
|
|
89
|
-
- `checks.privacy.fail_on_sensitive_attributes`
|
|
109
|
+
For an inherited repository, baseline existing debt and fail only on new findings:
|
|
90
110
|
|
|
91
|
-
|
|
111
|
+
```bash
|
|
112
|
+
vibedoctor baseline create
|
|
113
|
+
```
|
|
92
114
|
|
|
93
|
-
|
|
115
|
+
```yaml
|
|
116
|
+
baseline:
|
|
117
|
+
fail_only_on_new_issues: true
|
|
118
|
+
```
|
|
94
119
|
|
|
95
|
-
VibeDoctor
|
|
120
|
+
## Using VibeDoctor with AI agents
|
|
96
121
|
|
|
97
|
-
|
|
122
|
+
The quickest one-off handoff is `.vibedoctor/agent-plan.md`. An agent should follow this protocol:
|
|
123
|
+
|
|
124
|
+
1. Run the appropriate scan.
|
|
125
|
+
2. Read `completeness.status`, `toolStatuses`, `skippedTools`, and `recoveryActions` in `.vibedoctor/report.json`.
|
|
126
|
+
3. Recover required scanners before treating findings or scores as authoritative.
|
|
127
|
+
4. Fix only the ranked, in-scope findings and preserve unrelated user changes.
|
|
128
|
+
5. Run `vibedoctor verify` after edits.
|
|
129
|
+
6. Report remaining findings and any incomplete evidence; never claim success from a `PARTIAL` or `INVALID` scan.
|
|
130
|
+
|
|
131
|
+
For repeated agent use, install repository-scoped instructions, skills, policy, and supported editor wiring:
|
|
98
132
|
|
|
99
133
|
```bash
|
|
100
134
|
vibedoctor agent init --targets all
|
|
101
135
|
vibedoctor agent doctor --targets all
|
|
102
136
|
```
|
|
103
137
|
|
|
104
|
-
This
|
|
138
|
+
This can generate `AGENTS.md`, `.agents/skills/`, target-specific skills for Claude and GitHub, Cursor rules and MCP config, and `.vibedoctor/agent-policy.yml`.
|
|
105
139
|
|
|
106
|
-
|
|
107
|
-
- `.agents/skills/<skill>/SKILL.md`
|
|
108
|
-
- `.agents/skills/<skill>/agents/openai.yaml`
|
|
109
|
-
- `.claude/skills/<skill>/SKILL.md`
|
|
110
|
-
- `.github/skills/<skill>/SKILL.md`
|
|
111
|
-
- `.github/copilot-instructions.md`
|
|
112
|
-
- `.cursor/rules/vibedoctor.mdc`
|
|
113
|
-
- `.cursor/mcp.json`
|
|
114
|
-
- `.vibedoctor/agent-policy.yml`
|
|
115
|
-
|
|
116
|
-
Plugin bundle:
|
|
140
|
+
To create installable Codex and Claude plugin bundles under `plugins/vibedoctor/`:
|
|
117
141
|
|
|
118
142
|
```bash
|
|
119
|
-
vibedoctor agent plugin --target codex
|
|
120
|
-
vibedoctor agent plugin --target claude
|
|
121
143
|
vibedoctor agent plugin --targets all --force
|
|
122
144
|
```
|
|
123
145
|
|
|
124
|
-
|
|
146
|
+
### MCP server
|
|
125
147
|
|
|
126
|
-
|
|
127
|
-
- `plugins/vibedoctor/.claude-plugin/plugin.json`
|
|
128
|
-
- `plugins/vibedoctor/skills/<skill>/SKILL.md`
|
|
148
|
+
Start the MCP server over standard input/output:
|
|
129
149
|
|
|
130
|
-
|
|
150
|
+
```bash
|
|
151
|
+
vibedoctor mcp
|
|
152
|
+
```
|
|
131
153
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
154
|
+
It exposes structured operations for changed and full scans, report retrieval, finding explanations, safe fixes, repair plans, verification, privacy review, and DPDP technical readiness. Generated agent configs include MCP wiring where the target supports it.
|
|
155
|
+
|
|
156
|
+
## Privacy Review
|
|
157
|
+
|
|
158
|
+
Privacy Review is deterministic-first and advisory by default. Evidence stored in reports is masked or classified instead of preserving raw PII.
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
vibedoctor scan --category privacy --report json
|
|
162
|
+
vibedoctor privacy-review --refresh --format markdown
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
The second command writes a structured review artifact to `.vibedoctor/privacy-review.json`. Optional AI adjudication runs only when explicitly enabled and the configured API-key environment variables are present.
|
|
166
|
+
|
|
167
|
+
To make high-confidence privacy findings blocking, opt in:
|
|
168
|
+
|
|
169
|
+
```yaml
|
|
170
|
+
checks:
|
|
171
|
+
privacy:
|
|
172
|
+
fail_on_regulated_identifiers: true
|
|
173
|
+
fail_on_sensitive_attributes: true
|
|
135
174
|
```
|
|
136
175
|
|
|
137
|
-
|
|
176
|
+
## DPDP technical readiness
|
|
138
177
|
|
|
139
|
-
|
|
178
|
+
VibeDoctor includes an engineering-focused module for India's Digital Personal Data Protection framework. It maps apparent personal-data processing, evaluates visible technical controls, identifies deterministic technical risks, and creates a human-review queue.
|
|
140
179
|
|
|
141
|
-
|
|
180
|
+
It provides **technical readiness evidence, not legal compliance or certification**. Static analysis cannot establish legal applicability, production behavior, contractual adequacy, notice quality, or organisational policy implementation.
|
|
142
181
|
|
|
143
182
|
```bash
|
|
144
|
-
vibedoctor
|
|
183
|
+
vibedoctor dpdp init
|
|
184
|
+
vibedoctor dpdp scan --full
|
|
145
185
|
```
|
|
146
186
|
|
|
147
|
-
|
|
187
|
+
Common commands:
|
|
188
|
+
|
|
189
|
+
| Goal | Command |
|
|
190
|
+
| --- | --- |
|
|
191
|
+
| Scaffold optional context and evidence | `vibedoctor dpdp init` |
|
|
192
|
+
| Full technical-readiness scan | `vibedoctor dpdp scan --full` |
|
|
193
|
+
| Collect evidence from changed files | `vibedoctor dpdp scan --changed` |
|
|
194
|
+
| Print the personal-data map | `vibedoctor dpdp map` |
|
|
195
|
+
| Print questions requiring human review | `vibedoctor dpdp review-queue` |
|
|
196
|
+
| Render a report | `vibedoctor dpdp report --json`, `--html`, or `--markdown` |
|
|
197
|
+
| Generate an agent handoff | `vibedoctor dpdp handoff` |
|
|
198
|
+
| Verify after changes | `vibedoctor dpdp verify` |
|
|
199
|
+
| Explain a control or finding | `vibedoctor dpdp explain <id>` |
|
|
200
|
+
|
|
201
|
+
Artifacts are stored in `.vibedoctor/dpdp/`:
|
|
202
|
+
|
|
203
|
+
```text
|
|
204
|
+
data-map.json
|
|
205
|
+
control-matrix.json
|
|
206
|
+
evidence-ledger.json
|
|
207
|
+
review-queue.md
|
|
208
|
+
agent-handoff.md
|
|
209
|
+
readiness-report.json
|
|
210
|
+
readiness-report.md
|
|
211
|
+
readiness-report.html
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Controls distinguish repeatable `DETERMINISTIC` checks, uncertain `TECHNICAL_SIGNAL`s, human-supplied `DECLARED_EVIDENCE`, and `HUMAN_REVIEW`. Absence of evidence is never marked `VERIFIED`, and skipped optional scanners are never passes.
|
|
215
|
+
|
|
216
|
+
`dpdp scan` always refreshes the artifacts. `map`, `report`, `review-queue`, `handoff`, and `explain` reuse cached artifacts unless passed `--refresh`; `verify` always performs a live changed-scope scan. If Git has no changed-file delta, changed-scope collection falls back to the full repository and records a capability warning.
|
|
217
|
+
|
|
218
|
+
Presidio and Semgrep evidence collection are on by default and can be independently disabled under `checks.dpdp`. Normal scans also include DPDP privacy findings when `checks.dpdp.enabled` is true.
|
|
148
219
|
|
|
149
220
|
## Configuration
|
|
150
221
|
|
|
151
|
-
`vibedoctor init` writes `vibedoctor.yml`. Editing is optional
|
|
222
|
+
`vibedoctor init` writes `vibedoctor.yml`. Editing is optional. The most useful settings are:
|
|
223
|
+
|
|
224
|
+
```yaml
|
|
225
|
+
score:
|
|
226
|
+
minimum: 80
|
|
227
|
+
|
|
228
|
+
baseline:
|
|
229
|
+
fail_only_on_new_issues: true
|
|
230
|
+
|
|
231
|
+
runtime:
|
|
232
|
+
default_timeout_seconds: 120
|
|
233
|
+
tool_timeouts:
|
|
234
|
+
biome: 180
|
|
235
|
+
semgrep: 300
|
|
236
|
+
required_tools:
|
|
237
|
+
- biome
|
|
238
|
+
- semgrep
|
|
239
|
+
fail_on_incomplete_scan: true
|
|
240
|
+
|
|
241
|
+
paths:
|
|
242
|
+
include:
|
|
243
|
+
- src/**
|
|
244
|
+
exclude:
|
|
245
|
+
- dist/**
|
|
246
|
+
- coverage/**
|
|
247
|
+
```
|
|
152
248
|
|
|
153
|
-
- `score.minimum
|
|
154
|
-
- `baseline.fail_only_on_new_issues
|
|
155
|
-
- `
|
|
156
|
-
- `
|
|
157
|
-
- `
|
|
249
|
+
- `score.minimum` sets the passing health score.
|
|
250
|
+
- `baseline.fail_only_on_new_issues` limits gates to debt introduced after the baseline.
|
|
251
|
+
- `runtime.required_tools` defines which scanners must complete.
|
|
252
|
+
- `runtime.tool_timeouts` sets scanner-specific deadlines.
|
|
253
|
+
- `checks.*` enables categories and their gates.
|
|
254
|
+
- `checks.privacy.*` controls privacy detection, masking, optional AI review, and blocking behavior.
|
|
255
|
+
- `checks.dpdp.*` controls technical-readiness evidence, organisation context, optional scanners, and deterministic gates.
|
|
256
|
+
- `paths.include` and `paths.exclude` scope the scan.
|
|
158
257
|
|
|
159
|
-
|
|
258
|
+
Human-review-only DPDP items do not fail CI. Configure `checks.dpdp.fail_on_severity` or `checks.dpdp.fail_on_violated_controls` when deterministic DPDP findings should block a build.
|
|
160
259
|
|
|
161
|
-
##
|
|
260
|
+
## Command reference
|
|
162
261
|
|
|
163
|
-
|
|
262
|
+
| Goal | Command |
|
|
263
|
+
| --- | --- |
|
|
264
|
+
| Initialize configuration | `vibedoctor init` |
|
|
265
|
+
| Plan or apply scanner setup | `vibedoctor setup` / `vibedoctor setup --apply` |
|
|
266
|
+
| Quick, changed, or full scan | `vibedoctor scan --quick` / `--changed` / `--full` |
|
|
267
|
+
| Scan selected categories | `vibedoctor scan --category dead_code,leftovers` |
|
|
268
|
+
| Render a fresh full report | `vibedoctor report --json`, `--html`, `--markdown`, `--sarif`, or `--agent` |
|
|
269
|
+
| Apply supported safe fixes | `vibedoctor fix --safe` |
|
|
270
|
+
| Verify changed files | `vibedoctor verify` |
|
|
271
|
+
| Create a baseline | `vibedoctor baseline create` |
|
|
272
|
+
| Explain a finding | `vibedoctor explain <finding-id>` |
|
|
273
|
+
| Retry a scanner | `vibedoctor tool retry <tool-id> [--timeout 600]` |
|
|
274
|
+
| Generate an agent plan | `vibedoctor agent-plan --format markdown` |
|
|
275
|
+
| Start MCP | `vibedoctor mcp` |
|
|
276
|
+
|
|
277
|
+
`scan --report` supports `terminal`, `json`, `html`, `agent`, and `agent-json`. The separate `report` command performs a fresh full scan and can also render Markdown or SARIF to standard output.
|
|
278
|
+
|
|
279
|
+
## Network and data behavior
|
|
164
280
|
|
|
165
|
-
|
|
166
|
-
- npm 10.x
|
|
281
|
+
Core scanning and report generation run locally and do not require a hosted VibeDoctor service. Setup commands may download tools, dependency scanners may query their own data sources, and optional AI integrations may contact the configured service. Review an integration before enabling it if source code or findings may leave the machine.
|
|
167
282
|
|
|
168
|
-
|
|
283
|
+
## Development
|
|
284
|
+
|
|
285
|
+
Requirements: Node.js 18 or newer and npm 10.x.
|
|
169
286
|
|
|
170
287
|
```bash
|
|
171
288
|
npm test
|
|
@@ -174,7 +291,7 @@ npm run build
|
|
|
174
291
|
npm pack --dry-run
|
|
175
292
|
```
|
|
176
293
|
|
|
177
|
-
Useful
|
|
294
|
+
Useful local commands:
|
|
178
295
|
|
|
179
296
|
```bash
|
|
180
297
|
npm run dev -- scan --quick
|
|
@@ -182,20 +299,16 @@ npm run dev -- agent init --targets all
|
|
|
182
299
|
npm run dev -- agent plugin --targets all --force
|
|
183
300
|
```
|
|
184
301
|
|
|
185
|
-
`npm run build` emits production files into `dist/`. Plugin bundles under `plugins/` are generated on demand by `vibedoctor agent plugin ...` and are ignored in this repository by default.
|
|
186
|
-
|
|
187
|
-
## Project Layout
|
|
188
|
-
|
|
189
302
|
| Path | Purpose |
|
|
190
303
|
| --- | --- |
|
|
191
|
-
| `src/adapters` |
|
|
192
|
-
| `src/core` | Project detection, scan planning, scoring, baselines, and
|
|
304
|
+
| `src/adapters` | Scanner adapters and parsers |
|
|
305
|
+
| `src/core` | Project detection, scan planning, scoring, baselines, and execution |
|
|
193
306
|
| `src/cli` | Command-line interface |
|
|
194
|
-
| `src/agentPack` | Agent instructions, skills,
|
|
195
|
-
| `src/
|
|
307
|
+
| `src/agentPack` | Agent instructions, skills, policies, and plugin generation |
|
|
308
|
+
| `src/dpdp` | DPDP evidence collection, controls, and reports |
|
|
309
|
+
| `src/mcp` | MCP server and tool definitions |
|
|
196
310
|
| `src/reporters` | Terminal, JSON, Markdown, HTML, SARIF, and agent reports |
|
|
197
|
-
| `
|
|
198
|
-
| `fixtures` | Sample projects for tests |
|
|
311
|
+
| `fixtures` | Sample repositories used by tests |
|
|
199
312
|
| `tests` | Unit, integration, and snapshot tests |
|
|
200
313
|
|
|
201
314
|
## License
|
package/dist/adapters/biome.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ToolAdapter } from "./shared";
|
|
2
2
|
export declare const biomeAdapter: ToolAdapter;
|
package/dist/adapters/biome.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.biomeAdapter = void 0;
|
|
4
4
|
const finding_1 = require("../core/finding");
|
|
5
|
+
const shared_1 = require("./shared");
|
|
5
6
|
function parseBiomeOutput(stdout) {
|
|
6
7
|
const trimmed = stdout.trim();
|
|
7
8
|
if (!trimmed) {
|
|
@@ -26,11 +27,12 @@ exports.biomeAdapter = {
|
|
|
26
27
|
return project.languages.includes("javascript") || project.languages.includes("typescript");
|
|
27
28
|
},
|
|
28
29
|
buildScanCommand(ctx) {
|
|
30
|
+
const targets = (0, shared_1.adapterTargets)(ctx, /\.(?:js|jsx|ts|tsx|json|jsonc)$/i);
|
|
29
31
|
return {
|
|
30
32
|
cmd: "biome",
|
|
31
|
-
args: ["check",
|
|
33
|
+
args: ["check", ...targets, "--reporter=json"],
|
|
32
34
|
cwd: ctx.root,
|
|
33
|
-
timeoutMs:
|
|
35
|
+
timeoutMs: 180_000
|
|
34
36
|
};
|
|
35
37
|
},
|
|
36
38
|
parseResult(result, ctx) {
|
|
@@ -55,11 +57,12 @@ exports.biomeAdapter = {
|
|
|
55
57
|
}));
|
|
56
58
|
},
|
|
57
59
|
buildFixCommand(ctx) {
|
|
60
|
+
const targets = (0, shared_1.adapterTargets)(ctx, /\.(?:js|jsx|ts|tsx|json|jsonc)$/i);
|
|
58
61
|
return {
|
|
59
62
|
cmd: "biome",
|
|
60
|
-
args: ["check",
|
|
63
|
+
args: ["check", ...targets, "--write"],
|
|
61
64
|
cwd: ctx.root,
|
|
62
|
-
timeoutMs:
|
|
65
|
+
timeoutMs: 180_000
|
|
63
66
|
};
|
|
64
67
|
},
|
|
65
68
|
installHint: "Install Biome with: npm install -D @biomejs/biome"
|
|
@@ -46,6 +46,9 @@ exports.coveragePyAdapter = {
|
|
|
46
46
|
}
|
|
47
47
|
catch {
|
|
48
48
|
findings = [];
|
|
49
|
+
if (/no data to report|no coverage data/i.test(`${status.stderr}\n${status.stdout}`)) {
|
|
50
|
+
status.status = "skipped";
|
|
51
|
+
}
|
|
49
52
|
}
|
|
50
53
|
finally {
|
|
51
54
|
await node_fs_1.promises.rm(reportFile, { force: true }).catch(() => undefined);
|
package/dist/adapters/deptry.js
CHANGED
|
@@ -19,13 +19,32 @@ exports.deptryAdapter = {
|
|
|
19
19
|
return project.languages.includes("python");
|
|
20
20
|
},
|
|
21
21
|
async runStandalone(ctx) {
|
|
22
|
+
const manifestFile = ctx.project.projectFiles.find((f) => /(^|\/)(pyproject\.toml|requirements\.txt|setup\.py|Pipfile)$/i.test(f));
|
|
23
|
+
if (!manifestFile) {
|
|
24
|
+
return {
|
|
25
|
+
findings: [],
|
|
26
|
+
status: {
|
|
27
|
+
command: "deptry",
|
|
28
|
+
stdout: "",
|
|
29
|
+
stderr: "No Python dependency specification file (pyproject.toml, requirements.txt, setup.py) found.",
|
|
30
|
+
exitCode: null,
|
|
31
|
+
durationMs: 0,
|
|
32
|
+
status: "skipped",
|
|
33
|
+
installHint: exports.deptryAdapter.installHint
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const workingDir = node_path_1.default.dirname(manifestFile) === "." ? ctx.root : node_path_1.default.join(ctx.root, node_path_1.default.dirname(manifestFile));
|
|
22
38
|
const tempPath = node_path_1.default.join(node_os_1.default.tmpdir(), `vibedoctor-deptry-${Date.now()}.json`);
|
|
23
39
|
const status = await (0, toolRunner_1.runCommand)({
|
|
24
40
|
cmd: "deptry",
|
|
25
41
|
args: [".", "--json-output", tempPath],
|
|
26
|
-
cwd:
|
|
42
|
+
cwd: workingDir,
|
|
27
43
|
timeoutMs: 90_000
|
|
28
44
|
}, "Install deptry with: pipx install deptry or uv tool install deptry");
|
|
45
|
+
if (status.status === "error" && /DependencySpecificationNotFoundError|no pyproject\.toml/i.test(`${status.stderr}\n${status.stdout}`)) {
|
|
46
|
+
status.status = "skipped";
|
|
47
|
+
}
|
|
29
48
|
let findings = [];
|
|
30
49
|
try {
|
|
31
50
|
const content = await node_fs_1.promises.readFile(tempPath, "utf8");
|
|
@@ -37,7 +56,7 @@ exports.deptryAdapter = {
|
|
|
37
56
|
confidence: "high",
|
|
38
57
|
title: item.error.code,
|
|
39
58
|
message: item.error.message,
|
|
40
|
-
file: (0, finding_1.normalizeFilePath)(item.location?.file, ctx.root),
|
|
59
|
+
file: (0, finding_1.normalizeFilePath)(item.location?.file ? node_path_1.default.join(node_path_1.default.dirname(manifestFile), item.location.file) : undefined, ctx.root),
|
|
41
60
|
startLine: item.location?.line,
|
|
42
61
|
isNew: true,
|
|
43
62
|
isAutofixable: false,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dpdpAdapter = void 0;
|
|
4
|
+
const scan_1 = require("../dpdp/scan");
|
|
5
|
+
/**
|
|
6
|
+
* DPDP technical readiness adapter.
|
|
7
|
+
* Produces findings from the deterministic DPDP package and writes DPDP artifacts.
|
|
8
|
+
*/
|
|
9
|
+
exports.dpdpAdapter = {
|
|
10
|
+
id: "dpdp",
|
|
11
|
+
category: "privacy",
|
|
12
|
+
async detect(_project, config) {
|
|
13
|
+
return config.checks.dpdp.enabled;
|
|
14
|
+
},
|
|
15
|
+
async runStandalone(ctx) {
|
|
16
|
+
const mode = ctx.scanMode === "changed" ? "changed" : ctx.scanMode === "quick" ? "default" : "full";
|
|
17
|
+
const result = await (0, scan_1.runDpdpScan)(ctx.root, mode, {
|
|
18
|
+
context: ctx,
|
|
19
|
+
optionalScannersEnabled: ctx.scanMode !== "quick"
|
|
20
|
+
});
|
|
21
|
+
return {
|
|
22
|
+
findings: result.findings,
|
|
23
|
+
status: {
|
|
24
|
+
command: "dpdp",
|
|
25
|
+
stdout: `DPDP technical posture ${result.scores.technicalPostureScore}/100`,
|
|
26
|
+
stderr: "",
|
|
27
|
+
exitCode: 0,
|
|
28
|
+
durationMs: 0,
|
|
29
|
+
status: "ok"
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
installHint: "Built-in DPDP technical readiness module. No external install needed."
|
|
34
|
+
};
|
package/dist/adapters/index.d.ts
CHANGED
|
@@ -16,4 +16,5 @@ export { tscAdapter } from "./tsc";
|
|
|
16
16
|
export { vitestAdapter } from "./vitest";
|
|
17
17
|
export { vultureAdapter } from "./vulture";
|
|
18
18
|
export { privacyDetectorAdapter } from "./privacyDetector";
|
|
19
|
+
export { dpdpAdapter } from "./dpdp";
|
|
19
20
|
export { telemetryDetectorAdapter } from "./telemetryDetector";
|
package/dist/adapters/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.telemetryDetectorAdapter = exports.privacyDetectorAdapter = exports.vultureAdapter = exports.vitestAdapter = exports.tscAdapter = exports.semgrepAdapter = exports.ruffAdapter = exports.radonAdapter = exports.pyrightAdapter = exports.presidioAdapter = exports.osvScannerAdapter = exports.lizardAdapter = exports.knipAdapter = exports.jscpdAdapter = exports.jestAdapter = exports.gitleaksAdapter = exports.deptryAdapter = exports.coveragePyAdapter = exports.biomeAdapter = void 0;
|
|
3
|
+
exports.telemetryDetectorAdapter = exports.dpdpAdapter = exports.privacyDetectorAdapter = exports.vultureAdapter = exports.vitestAdapter = exports.tscAdapter = exports.semgrepAdapter = exports.ruffAdapter = exports.radonAdapter = exports.pyrightAdapter = exports.presidioAdapter = exports.osvScannerAdapter = exports.lizardAdapter = exports.knipAdapter = exports.jscpdAdapter = exports.jestAdapter = exports.gitleaksAdapter = exports.deptryAdapter = exports.coveragePyAdapter = exports.biomeAdapter = void 0;
|
|
4
4
|
var biome_1 = require("./biome");
|
|
5
5
|
Object.defineProperty(exports, "biomeAdapter", { enumerable: true, get: function () { return biome_1.biomeAdapter; } });
|
|
6
6
|
var coveragePy_1 = require("./coveragePy");
|
|
@@ -37,5 +37,7 @@ var vulture_1 = require("./vulture");
|
|
|
37
37
|
Object.defineProperty(exports, "vultureAdapter", { enumerable: true, get: function () { return vulture_1.vultureAdapter; } });
|
|
38
38
|
var privacyDetector_1 = require("./privacyDetector");
|
|
39
39
|
Object.defineProperty(exports, "privacyDetectorAdapter", { enumerable: true, get: function () { return privacyDetector_1.privacyDetectorAdapter; } });
|
|
40
|
+
var dpdp_1 = require("./dpdp");
|
|
41
|
+
Object.defineProperty(exports, "dpdpAdapter", { enumerable: true, get: function () { return dpdp_1.dpdpAdapter; } });
|
|
40
42
|
var telemetryDetector_1 = require("./telemetryDetector");
|
|
41
43
|
Object.defineProperty(exports, "telemetryDetectorAdapter", { enumerable: true, get: function () { return telemetryDetector_1.telemetryDetectorAdapter; } });
|