@neuralaxis/vibedoctor 0.1.3 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +298 -115
- package/dist/adapters/biome.js +135 -21
- 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/osvScanner.js +136 -17
- package/dist/adapters/presidio.js +6 -2
- package/dist/adapters/privacyDetector.d.ts +24 -1
- package/dist/adapters/privacyDetector.js +86 -2
- package/dist/adapters/shared.d.ts +6 -0
- package/dist/agentPack/templates/skills.js +159 -53
- package/dist/cli/commands/dpdp.d.ts +35 -0
- package/dist/cli/commands/dpdp.js +103 -0
- package/dist/cli/commands/init.js +105 -50
- package/dist/cli/commands/privacyReview.js +3 -4
- package/dist/cli/commands/scan.js +4 -1
- package/dist/cli/commands/setup.d.ts +13 -17
- package/dist/cli/commands/setup.js +138 -200
- package/dist/cli/index.js +84 -0
- package/dist/core/capability.d.ts +92 -0
- package/dist/core/capability.js +122 -0
- package/dist/core/config.d.ts +57 -0
- package/dist/core/config.js +194 -7
- package/dist/core/credentialHeuristics.d.ts +28 -0
- package/dist/core/credentialHeuristics.js +179 -0
- package/dist/core/engine.d.ts +21 -0
- package/dist/core/engine.js +484 -84
- package/dist/core/executable.d.ts +18 -0
- package/dist/core/executable.js +137 -0
- package/dist/core/fileRole.d.ts +24 -0
- package/dist/core/fileRole.js +125 -0
- package/dist/core/finding.d.ts +125 -1
- package/dist/core/finding.js +63 -5
- package/dist/core/findingNormalizer.d.ts +33 -0
- package/dist/core/findingNormalizer.js +171 -0
- package/dist/core/projectDetector.d.ts +13 -0
- package/dist/core/projectDetector.js +100 -15
- package/dist/core/relevance.d.ts +87 -0
- package/dist/core/relevance.js +367 -0
- package/dist/core/scanPlanner.d.ts +12 -0
- package/dist/core/scanPlanner.js +61 -29
- package/dist/core/semverLite.d.ts +27 -0
- package/dist/core/semverLite.js +163 -0
- package/dist/core/suppressions.d.ts +96 -0
- package/dist/core/suppressions.js +302 -0
- package/dist/core/toolRegistry.d.ts +58 -0
- package/dist/core/toolRegistry.js +247 -0
- package/dist/core/toolRunner.d.ts +23 -2
- package/dist/core/toolRunner.js +61 -93
- package/dist/core/toolVerification.d.ts +87 -0
- package/dist/core/toolVerification.js +370 -0
- 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 +437 -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 +44 -0
- package/dist/dpdp/findings.js +286 -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 +41 -0
- package/dist/dpdp/scoring.js +237 -0
- package/dist/dpdp/types.d.ts +312 -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/reporters/html.js +57 -13
- package/dist/reporters/json.js +12 -1
- package/dist/reporters/markdown.js +46 -4
- package/dist/reporters/sarif.js +54 -5
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -1,187 +1,374 @@
|
|
|
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
|
-
##
|
|
27
|
-
|
|
28
|
-
<video src="docs/assets/vibedoctor-product-release-demo-v0.1.1.mp4" controls muted playsinline width="100%"></video>
|
|
41
|
+
## What you get
|
|
29
42
|
|
|
30
|
-
|
|
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.
|
|
31
44
|
|
|
32
|
-
|
|
45
|
+
Default artifacts are written under `.vibedoctor/`:
|
|
33
46
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
47
|
+
```text
|
|
48
|
+
.vibedoctor/
|
|
49
|
+
├── report.json # automation and agents
|
|
50
|
+
├── report.html # human review
|
|
51
|
+
└── agent-plan.md # ordered repair work
|
|
52
|
+
```
|
|
38
53
|
|
|
39
|
-
|
|
54
|
+
Use the terminal report for quick triage, HTML for review, JSON for automation, and `agent-plan.md` for a coding agent.
|
|
40
55
|
|
|
41
|
-
|
|
56
|
+
## What VibeDoctor checks
|
|
42
57
|
|
|
43
58
|
- Type and lint failures from TypeScript, Pyright, Ruff, Biome, and similar local tools.
|
|
44
|
-
- Secrets and
|
|
45
|
-
-
|
|
46
|
-
-
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
- 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.
|
|
50
64
|
|
|
51
|
-
|
|
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`.
|
|
52
66
|
|
|
53
|
-
##
|
|
67
|
+
## Know exactly what ran
|
|
54
68
|
|
|
55
|
-
|
|
69
|
+
Every scan prints a coverage table with one row per tool, so "installed" is never confused with "completed":
|
|
56
70
|
|
|
57
|
-
|
|
71
|
+
```
|
|
72
|
+
TOOL COVERAGE
|
|
73
|
+
TOOL STATE FINDINGS TIME DETAIL
|
|
74
|
+
biome completed 200 of 223 1.8s Ran at node_modules/.bin/biome.cmd.
|
|
75
|
+
semgrep timed out 0 300.0s Exceeded its 300s budget and was stopped, so this check did not run.
|
|
76
|
+
pyright not applicable 0 Nothing in this repository matches what pyright analyses.
|
|
77
|
+
vulture not installed 0 vulture was not found on the scanner's PATH.
|
|
78
|
+
|
|
79
|
+
TO RESTORE COVERAGE
|
|
80
|
+
- semgrep: Raise runtime.tool_timeouts.semgrep, or run `vibedoctor scan --changed` for a diff-scoped run.
|
|
81
|
+
```
|
|
58
82
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
| Render reports | `vibedoctor report --html`, `--markdown`, `--sarif`, or `--agent` |
|
|
70
|
-
| Apply safe tool fixes | `vibedoctor fix --safe` |
|
|
71
|
-
| Create a baseline | `vibedoctor baseline create` |
|
|
72
|
-
| Explain a finding | `vibedoctor explain <finding-id>` |
|
|
73
|
-
| Verify after edits | `vibedoctor verify` |
|
|
74
|
-
| Retry a timed-out scanner | `vibedoctor tool retry <tool-id> [--timeout 600]` |
|
|
75
|
-
| Generate an agent repair plan | `vibedoctor agent-plan --format markdown` |
|
|
83
|
+
Each row separates the facts that used to be collapsed into "skipped":
|
|
84
|
+
|
|
85
|
+
- **applicable** — is there anything here for this tool to analyse?
|
|
86
|
+
- **installed** — did the executable resolve, and at which path?
|
|
87
|
+
- **executed** — did it start, and did it finish inside its time budget?
|
|
88
|
+
- **findings shown of reported** — a tool that ran but had output filtered shows `200 of 223`, so a short list is never mistaken for a clean one.
|
|
89
|
+
|
|
90
|
+
States are `completed`, `partial`, `timed out`, `failed`, `not installed`, `runtime mismatch`, `deferred`, `disabled`, `not applicable`, and `not selected`. Only the first is treated as full coverage; deliberate exclusions do not count against you, and everything else is disclosed with a reason and a remediation.
|
|
91
|
+
|
|
92
|
+
`vibedoctor setup --apply` verifies each tool by running it the way the scanner will, reports the resolved path and version, and **fails if a tool cannot be verified** — even when the install command itself succeeded. Tools that install but cannot run under the current runtime are reported as a runtime mismatch, with the option to defer them deliberately via `runtime.deferred_tools`.
|
|
76
93
|
|
|
77
|
-
|
|
94
|
+
## Keeping the report readable
|
|
78
95
|
|
|
79
|
-
|
|
96
|
+
Scanners are tuned for recall, so raw output buries the findings that matter. VibeDoctor applies uniform relevance controls and always discloses what they withheld:
|
|
97
|
+
|
|
98
|
+
- **Ranking** puts new findings and findings in changed files first, so pre-existing debt does not hide a regression you just introduced.
|
|
99
|
+
- **Per-tool caps** keep an exhaustive detector from dominating the report. What falls outside the cap is reported as a count with the setting to raise.
|
|
100
|
+
- **Confidence floors** apply per tool.
|
|
101
|
+
- **File roles** — tests, fixtures, generated, and vendored code are recognised, and findings there are downgraded rather than presented like production defects.
|
|
102
|
+
- **Contextual validation** re-checks findings that claim to have found a credential. A match on an identifier like `format_key` is downgraded and marked as a likely false positive, with the reason given; a genuine high-entropy token keeps full severity.
|
|
103
|
+
- **Evidence grades** — every finding records whether it was `verified` from code, `observed` at a location, inferred as a `heuristic`, or `unproven`, so a naming guess never reads like a traced code path.
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
REPORT FILTERING
|
|
107
|
+
Relevance: showing 54 of 124 findings.
|
|
108
|
+
- vulture: showing 50 of 120 — withheld 70 beyond the 50-finding cap.
|
|
109
|
+
To see withheld findings:
|
|
110
|
+
- Raise relevance.per_tool.vulture.max_findings in vibedoctor.yml.
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Acknowledging findings you have already decided about
|
|
114
|
+
|
|
115
|
+
`.vibedoctor/suppressions.yml` records findings that are known and accepted. Unlike the baseline, which only answers "was this here before?", an acknowledgement carries a reason and an expiry:
|
|
80
116
|
|
|
81
117
|
```yaml
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
-
|
|
89
|
-
|
|
90
|
-
|
|
118
|
+
version: 1
|
|
119
|
+
suppressions:
|
|
120
|
+
- id: fixture-credentials
|
|
121
|
+
reason: Synthetic credentials in test fixtures, never used against real systems.
|
|
122
|
+
classification: fixture # false_positive | accepted_risk | deferred | fixture
|
|
123
|
+
owner: platform-team
|
|
124
|
+
expires: 2026-12-31
|
|
125
|
+
match:
|
|
126
|
+
tools: [gitleaks]
|
|
127
|
+
paths: ["fixtures/**"]
|
|
91
128
|
```
|
|
92
129
|
|
|
93
|
-
|
|
130
|
+
A reason is required, and a rule with no match criteria is rejected rather than silencing the report. When an acknowledgement lapses, its findings come back marked `resurfaced` instead of staying hidden. Acknowledgements apply to every finding, including DPDP ones.
|
|
131
|
+
|
|
132
|
+
## Understand the result before fixing code
|
|
133
|
+
|
|
134
|
+
| Status | Meaning | What to do |
|
|
135
|
+
| --- | --- | --- |
|
|
136
|
+
| `COMPLETE` | All required checks completed. | Work through the ranked findings. |
|
|
137
|
+
| `PARTIAL` | Some checks were skipped, failed, or timed out. | Follow `recoveryActions`; do not rely on the score alone. |
|
|
138
|
+
| `INVALID` | There is not enough trustworthy evidence for an authoritative result. | Recover the required scanners and scan again before editing. |
|
|
139
|
+
|
|
140
|
+
CLI exit codes let people, agents, and CI distinguish health failures from missing evidence:
|
|
141
|
+
|
|
142
|
+
| Code | Meaning |
|
|
143
|
+
| --- | --- |
|
|
144
|
+
| `0` | The scan completed and configured gates passed. |
|
|
145
|
+
| `1` | One or more configured health gates failed. |
|
|
146
|
+
| `2` | Required checks were incomplete. |
|
|
147
|
+
|
|
148
|
+
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.
|
|
94
149
|
|
|
95
|
-
|
|
150
|
+
If a scanner times out or fails, run the recovery command shown in the report. For example:
|
|
96
151
|
|
|
97
152
|
```bash
|
|
98
|
-
vibedoctor
|
|
99
|
-
vibedoctor privacy-review --refresh --format markdown
|
|
153
|
+
vibedoctor tool retry semgrep --timeout 600
|
|
100
154
|
```
|
|
101
155
|
|
|
102
|
-
|
|
156
|
+
## A fast, safe repair loop
|
|
103
157
|
|
|
104
|
-
|
|
105
|
-
|
|
158
|
+
```bash
|
|
159
|
+
# 1. Establish the current state
|
|
160
|
+
vibedoctor scan --changed --report json
|
|
106
161
|
|
|
107
|
-
|
|
162
|
+
# 2. Generate ordered work
|
|
163
|
+
vibedoctor agent-plan --format markdown
|
|
108
164
|
|
|
109
|
-
|
|
165
|
+
# 3. Optionally apply supported safe tool fixes
|
|
166
|
+
vibedoctor fix --safe
|
|
110
167
|
|
|
111
|
-
|
|
168
|
+
# 4. Review every change, then verify
|
|
169
|
+
vibedoctor verify
|
|
170
|
+
```
|
|
112
171
|
|
|
113
|
-
|
|
172
|
+
Use `vibedoctor explain <finding-id>` when a finding needs more context. Always review generated changes before committing them.
|
|
173
|
+
|
|
174
|
+
For an inherited repository, baseline existing debt and fail only on new findings:
|
|
175
|
+
|
|
176
|
+
```bash
|
|
177
|
+
vibedoctor baseline create
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
```yaml
|
|
181
|
+
baseline:
|
|
182
|
+
fail_only_on_new_issues: true
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Using VibeDoctor with AI agents
|
|
186
|
+
|
|
187
|
+
The quickest one-off handoff is `.vibedoctor/agent-plan.md`. An agent should follow this protocol:
|
|
188
|
+
|
|
189
|
+
1. Run the appropriate scan.
|
|
190
|
+
2. Read `completeness.status`, `toolStatuses`, `skippedTools`, and `recoveryActions` in `.vibedoctor/report.json`.
|
|
191
|
+
3. Recover required scanners before treating findings or scores as authoritative.
|
|
192
|
+
4. Fix only the ranked, in-scope findings and preserve unrelated user changes.
|
|
193
|
+
5. Run `vibedoctor verify` after edits.
|
|
194
|
+
6. Report remaining findings and any incomplete evidence; never claim success from a `PARTIAL` or `INVALID` scan.
|
|
195
|
+
|
|
196
|
+
For repeated agent use, install repository-scoped instructions, skills, policy, and supported editor wiring:
|
|
114
197
|
|
|
115
198
|
```bash
|
|
116
199
|
vibedoctor agent init --targets all
|
|
117
200
|
vibedoctor agent doctor --targets all
|
|
118
201
|
```
|
|
119
202
|
|
|
120
|
-
This
|
|
203
|
+
This can generate `AGENTS.md`, `.agents/skills/`, target-specific skills for Claude and GitHub, Cursor rules and MCP config, and `.vibedoctor/agent-policy.yml`.
|
|
121
204
|
|
|
122
|
-
|
|
123
|
-
- `.agents/skills/<skill>/SKILL.md`
|
|
124
|
-
- `.agents/skills/<skill>/agents/openai.yaml`
|
|
125
|
-
- `.claude/skills/<skill>/SKILL.md`
|
|
126
|
-
- `.github/skills/<skill>/SKILL.md`
|
|
127
|
-
- `.github/copilot-instructions.md`
|
|
128
|
-
- `.cursor/rules/vibedoctor.mdc`
|
|
129
|
-
- `.cursor/mcp.json`
|
|
130
|
-
- `.vibedoctor/agent-policy.yml`
|
|
131
|
-
|
|
132
|
-
Plugin bundle:
|
|
205
|
+
To create installable Codex and Claude plugin bundles under `plugins/vibedoctor/`:
|
|
133
206
|
|
|
134
207
|
```bash
|
|
135
|
-
vibedoctor agent plugin --target codex
|
|
136
|
-
vibedoctor agent plugin --target claude
|
|
137
208
|
vibedoctor agent plugin --targets all --force
|
|
138
209
|
```
|
|
139
210
|
|
|
140
|
-
|
|
211
|
+
### MCP server
|
|
141
212
|
|
|
142
|
-
|
|
143
|
-
- `plugins/vibedoctor/.claude-plugin/plugin.json`
|
|
144
|
-
- `plugins/vibedoctor/skills/<skill>/SKILL.md`
|
|
213
|
+
Start the MCP server over standard input/output:
|
|
145
214
|
|
|
146
|
-
|
|
215
|
+
```bash
|
|
216
|
+
vibedoctor mcp
|
|
217
|
+
```
|
|
147
218
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
219
|
+
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.
|
|
220
|
+
|
|
221
|
+
## Privacy Review
|
|
222
|
+
|
|
223
|
+
Privacy Review is deterministic-first and advisory by default. Evidence stored in reports is masked or classified instead of preserving raw PII.
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
vibedoctor scan --category privacy --report json
|
|
227
|
+
vibedoctor privacy-review --refresh --format markdown
|
|
151
228
|
```
|
|
152
229
|
|
|
153
|
-
The
|
|
230
|
+
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.
|
|
231
|
+
|
|
232
|
+
To make high-confidence privacy findings blocking, opt in:
|
|
154
233
|
|
|
155
|
-
|
|
234
|
+
```yaml
|
|
235
|
+
checks:
|
|
236
|
+
privacy:
|
|
237
|
+
fail_on_regulated_identifiers: true
|
|
238
|
+
fail_on_sensitive_attributes: true
|
|
239
|
+
```
|
|
156
240
|
|
|
157
|
-
|
|
241
|
+
## DPDP technical readiness
|
|
242
|
+
|
|
243
|
+
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.
|
|
244
|
+
|
|
245
|
+
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.
|
|
158
246
|
|
|
159
247
|
```bash
|
|
160
|
-
vibedoctor
|
|
248
|
+
vibedoctor dpdp init
|
|
249
|
+
vibedoctor dpdp scan --full
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
Common commands:
|
|
253
|
+
|
|
254
|
+
| Goal | Command |
|
|
255
|
+
| --- | --- |
|
|
256
|
+
| Scaffold optional context and evidence | `vibedoctor dpdp init` |
|
|
257
|
+
| Full technical-readiness scan | `vibedoctor dpdp scan --full` |
|
|
258
|
+
| Collect evidence from changed files | `vibedoctor dpdp scan --changed` |
|
|
259
|
+
| Print the personal-data map | `vibedoctor dpdp map` |
|
|
260
|
+
| Print questions requiring human review | `vibedoctor dpdp review-queue` |
|
|
261
|
+
| Render a report | `vibedoctor dpdp report --json`, `--html`, or `--markdown` |
|
|
262
|
+
| Generate an agent handoff | `vibedoctor dpdp handoff` |
|
|
263
|
+
| Verify after changes | `vibedoctor dpdp verify` |
|
|
264
|
+
| Explain a control or finding | `vibedoctor dpdp explain <id>` |
|
|
265
|
+
|
|
266
|
+
Artifacts are stored in `.vibedoctor/dpdp/`:
|
|
267
|
+
|
|
268
|
+
```text
|
|
269
|
+
data-map.json
|
|
270
|
+
control-matrix.json
|
|
271
|
+
evidence-ledger.json
|
|
272
|
+
review-queue.md
|
|
273
|
+
agent-handoff.md
|
|
274
|
+
readiness-report.json
|
|
275
|
+
readiness-report.md
|
|
276
|
+
readiness-report.html
|
|
161
277
|
```
|
|
162
278
|
|
|
163
|
-
|
|
279
|
+
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.
|
|
280
|
+
|
|
281
|
+
`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.
|
|
282
|
+
|
|
283
|
+
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.
|
|
164
284
|
|
|
165
285
|
## Configuration
|
|
166
286
|
|
|
167
|
-
`vibedoctor init` writes `vibedoctor.yml`. Editing is optional
|
|
287
|
+
`vibedoctor init` writes `vibedoctor.yml`. Editing is optional. The most useful settings are:
|
|
288
|
+
|
|
289
|
+
```yaml
|
|
290
|
+
score:
|
|
291
|
+
minimum: 80
|
|
292
|
+
|
|
293
|
+
baseline:
|
|
294
|
+
fail_only_on_new_issues: true
|
|
295
|
+
|
|
296
|
+
runtime:
|
|
297
|
+
default_timeout_seconds: 120
|
|
298
|
+
tool_timeouts:
|
|
299
|
+
biome: 180
|
|
300
|
+
semgrep: 300
|
|
301
|
+
required_tools:
|
|
302
|
+
- biome
|
|
303
|
+
- semgrep
|
|
304
|
+
fail_on_incomplete_scan: true
|
|
305
|
+
on_timeout: scoped_retry # scoped_retry | skip | fail
|
|
306
|
+
total_budget_seconds: 0 # 0 means no wall-clock ceiling
|
|
307
|
+
deferred_tools: [] # deliberately not run; reported as deferred
|
|
308
|
+
|
|
309
|
+
relevance:
|
|
310
|
+
min_confidence: low
|
|
311
|
+
max_findings_per_tool: 200
|
|
312
|
+
synthetic_file_policy: downgrade # keep | downgrade | drop
|
|
313
|
+
validate_secrets: true
|
|
314
|
+
per_tool:
|
|
315
|
+
vulture:
|
|
316
|
+
min_confidence: medium
|
|
317
|
+
max_findings: 50
|
|
318
|
+
|
|
319
|
+
suppressions:
|
|
320
|
+
enabled: true
|
|
321
|
+
file: .vibedoctor/suppressions.yml
|
|
322
|
+
|
|
323
|
+
paths:
|
|
324
|
+
include:
|
|
325
|
+
- src/**
|
|
326
|
+
exclude:
|
|
327
|
+
- dist/**
|
|
328
|
+
- coverage/**
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
- `score.minimum` sets the passing health score.
|
|
332
|
+
- `baseline.fail_only_on_new_issues` limits gates to debt introduced after the baseline.
|
|
333
|
+
- `runtime.required_tools` defines which scanners must complete.
|
|
334
|
+
- `runtime.tool_timeouts` sets scanner-specific deadlines.
|
|
335
|
+
- `runtime.on_timeout: scoped_retry` reruns a tool that runs out of time over changed files only, and reports the partial coverage instead of losing the check.
|
|
336
|
+
- `runtime.deferred_tools` marks tools you have deliberately chosen not to run, so the report says "deferred" rather than implying they passed.
|
|
337
|
+
- `relevance.*` controls how much of what the tools report reaches the report. Nothing is dropped silently.
|
|
338
|
+
- `suppressions.*` points at the acknowledgements file described above.
|
|
339
|
+
- `checks.*` enables categories and their gates.
|
|
340
|
+
- `checks.privacy.*` controls privacy detection, masking, optional AI review, and blocking behavior.
|
|
341
|
+
- `checks.dpdp.*` controls technical-readiness evidence, organisation context, optional scanners, and deterministic gates.
|
|
342
|
+
- `paths.include` and `paths.exclude` scope the scan.
|
|
168
343
|
|
|
169
|
-
-
|
|
170
|
-
- `baseline.fail_only_on_new_issues`: fail only on debt introduced after the baseline.
|
|
171
|
-
- `checks.*`: enable categories and fail-fast gates for secrets, type errors, test failures, and vulnerabilities.
|
|
172
|
-
- `checks.privacy.*`: tune deterministic privacy detection, masking, optional Presidio support, optional AI review, and CI blocking behavior.
|
|
173
|
-
- `paths.include` and `paths.exclude`: scope scanned files.
|
|
344
|
+
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.
|
|
174
345
|
|
|
175
|
-
|
|
346
|
+
## Command reference
|
|
176
347
|
|
|
177
|
-
|
|
348
|
+
| Goal | Command |
|
|
349
|
+
| --- | --- |
|
|
350
|
+
| Initialize configuration | `vibedoctor init` |
|
|
351
|
+
| Plan or apply scanner setup | `vibedoctor setup` / `vibedoctor setup --apply` |
|
|
352
|
+
| Quick, changed, or full scan | `vibedoctor scan --quick` / `--changed` / `--full` |
|
|
353
|
+
| Scan selected categories | `vibedoctor scan --category dead_code,leftovers` |
|
|
354
|
+
| Render a fresh full report | `vibedoctor report --json`, `--html`, `--markdown`, `--sarif`, or `--agent` |
|
|
355
|
+
| Apply supported safe fixes | `vibedoctor fix --safe` |
|
|
356
|
+
| Verify changed files | `vibedoctor verify` |
|
|
357
|
+
| Create a baseline | `vibedoctor baseline create` |
|
|
358
|
+
| Explain a finding | `vibedoctor explain <finding-id>` |
|
|
359
|
+
| Retry a scanner | `vibedoctor tool retry <tool-id> [--timeout 600]` |
|
|
360
|
+
| Generate an agent plan | `vibedoctor agent-plan --format markdown` |
|
|
361
|
+
| Start MCP | `vibedoctor mcp` |
|
|
362
|
+
|
|
363
|
+
`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.
|
|
178
364
|
|
|
179
|
-
|
|
365
|
+
## Network and data behavior
|
|
180
366
|
|
|
181
|
-
|
|
182
|
-
- npm 10.x
|
|
367
|
+
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.
|
|
183
368
|
|
|
184
|
-
|
|
369
|
+
## Development
|
|
370
|
+
|
|
371
|
+
Requirements: Node.js 18 or newer and npm 10.x.
|
|
185
372
|
|
|
186
373
|
```bash
|
|
187
374
|
npm test
|
|
@@ -190,7 +377,7 @@ npm run build
|
|
|
190
377
|
npm pack --dry-run
|
|
191
378
|
```
|
|
192
379
|
|
|
193
|
-
Useful
|
|
380
|
+
Useful local commands:
|
|
194
381
|
|
|
195
382
|
```bash
|
|
196
383
|
npm run dev -- scan --quick
|
|
@@ -198,20 +385,16 @@ npm run dev -- agent init --targets all
|
|
|
198
385
|
npm run dev -- agent plugin --targets all --force
|
|
199
386
|
```
|
|
200
387
|
|
|
201
|
-
`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.
|
|
202
|
-
|
|
203
|
-
## Project Layout
|
|
204
|
-
|
|
205
388
|
| Path | Purpose |
|
|
206
389
|
| --- | --- |
|
|
207
|
-
| `src/adapters` |
|
|
208
|
-
| `src/core` | Project detection, scan planning, scoring, baselines, and
|
|
390
|
+
| `src/adapters` | Scanner adapters and parsers |
|
|
391
|
+
| `src/core` | Project detection, scan planning, scoring, baselines, and execution |
|
|
209
392
|
| `src/cli` | Command-line interface |
|
|
210
|
-
| `src/agentPack` | Agent instructions, skills,
|
|
211
|
-
| `src/
|
|
393
|
+
| `src/agentPack` | Agent instructions, skills, policies, and plugin generation |
|
|
394
|
+
| `src/dpdp` | DPDP evidence collection, controls, and reports |
|
|
395
|
+
| `src/mcp` | MCP server and tool definitions |
|
|
212
396
|
| `src/reporters` | Terminal, JSON, Markdown, HTML, SARIF, and agent reports |
|
|
213
|
-
| `
|
|
214
|
-
| `fixtures` | Sample projects for tests |
|
|
397
|
+
| `fixtures` | Sample repositories used by tests |
|
|
215
398
|
| `tests` | Unit, integration, and snapshot tests |
|
|
216
399
|
|
|
217
400
|
## License
|