@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.
Files changed (112) hide show
  1. package/README.md +298 -115
  2. package/dist/adapters/biome.js +135 -21
  3. package/dist/adapters/dpdp.d.ts +6 -0
  4. package/dist/adapters/dpdp.js +34 -0
  5. package/dist/adapters/index.d.ts +1 -0
  6. package/dist/adapters/index.js +3 -1
  7. package/dist/adapters/osvScanner.js +136 -17
  8. package/dist/adapters/presidio.js +6 -2
  9. package/dist/adapters/privacyDetector.d.ts +24 -1
  10. package/dist/adapters/privacyDetector.js +86 -2
  11. package/dist/adapters/shared.d.ts +6 -0
  12. package/dist/agentPack/templates/skills.js +159 -53
  13. package/dist/cli/commands/dpdp.d.ts +35 -0
  14. package/dist/cli/commands/dpdp.js +103 -0
  15. package/dist/cli/commands/init.js +105 -50
  16. package/dist/cli/commands/privacyReview.js +3 -4
  17. package/dist/cli/commands/scan.js +4 -1
  18. package/dist/cli/commands/setup.d.ts +13 -17
  19. package/dist/cli/commands/setup.js +138 -200
  20. package/dist/cli/index.js +84 -0
  21. package/dist/core/capability.d.ts +92 -0
  22. package/dist/core/capability.js +122 -0
  23. package/dist/core/config.d.ts +57 -0
  24. package/dist/core/config.js +194 -7
  25. package/dist/core/credentialHeuristics.d.ts +28 -0
  26. package/dist/core/credentialHeuristics.js +179 -0
  27. package/dist/core/engine.d.ts +21 -0
  28. package/dist/core/engine.js +484 -84
  29. package/dist/core/executable.d.ts +18 -0
  30. package/dist/core/executable.js +137 -0
  31. package/dist/core/fileRole.d.ts +24 -0
  32. package/dist/core/fileRole.js +125 -0
  33. package/dist/core/finding.d.ts +125 -1
  34. package/dist/core/finding.js +63 -5
  35. package/dist/core/findingNormalizer.d.ts +33 -0
  36. package/dist/core/findingNormalizer.js +171 -0
  37. package/dist/core/projectDetector.d.ts +13 -0
  38. package/dist/core/projectDetector.js +100 -15
  39. package/dist/core/relevance.d.ts +87 -0
  40. package/dist/core/relevance.js +367 -0
  41. package/dist/core/scanPlanner.d.ts +12 -0
  42. package/dist/core/scanPlanner.js +61 -29
  43. package/dist/core/semverLite.d.ts +27 -0
  44. package/dist/core/semverLite.js +163 -0
  45. package/dist/core/suppressions.d.ts +96 -0
  46. package/dist/core/suppressions.js +302 -0
  47. package/dist/core/toolRegistry.d.ts +58 -0
  48. package/dist/core/toolRegistry.js +247 -0
  49. package/dist/core/toolRunner.d.ts +23 -2
  50. package/dist/core/toolRunner.js +61 -93
  51. package/dist/core/toolVerification.d.ts +87 -0
  52. package/dist/core/toolVerification.js +370 -0
  53. package/dist/dpdp/artifacts.d.ts +11 -0
  54. package/dist/dpdp/artifacts.js +120 -0
  55. package/dist/dpdp/catalogue.d.ts +14 -0
  56. package/dist/dpdp/catalogue.js +661 -0
  57. package/dist/dpdp/collectors/confidence.d.ts +9 -0
  58. package/dist/dpdp/collectors/confidence.js +25 -0
  59. package/dist/dpdp/collectors/dependencies.d.ts +7 -0
  60. package/dist/dpdp/collectors/dependencies.js +63 -0
  61. package/dist/dpdp/collectors/index.d.ts +24 -0
  62. package/dist/dpdp/collectors/index.js +71 -0
  63. package/dist/dpdp/collectors/lifecycle.d.ts +2 -0
  64. package/dist/dpdp/collectors/lifecycle.js +202 -0
  65. package/dist/dpdp/collectors/optionalScanners.d.ts +14 -0
  66. package/dist/dpdp/collectors/optionalScanners.js +437 -0
  67. package/dist/dpdp/collectors/privacyBridge.d.ts +13 -0
  68. package/dist/dpdp/collectors/privacyBridge.js +152 -0
  69. package/dist/dpdp/collectors/safeguards.d.ts +5 -0
  70. package/dist/dpdp/collectors/safeguards.js +186 -0
  71. package/dist/dpdp/collectors/schema.d.ts +6 -0
  72. package/dist/dpdp/collectors/schema.js +122 -0
  73. package/dist/dpdp/collectors/shared.d.ts +10 -0
  74. package/dist/dpdp/collectors/shared.js +43 -0
  75. package/dist/dpdp/context.d.ts +28 -0
  76. package/dist/dpdp/context.js +195 -0
  77. package/dist/dpdp/dataMap.d.ts +7 -0
  78. package/dist/dpdp/dataMap.js +339 -0
  79. package/dist/dpdp/evaluators.d.ts +20 -0
  80. package/dist/dpdp/evaluators.js +522 -0
  81. package/dist/dpdp/evidence.d.ts +11 -0
  82. package/dist/dpdp/evidence.js +123 -0
  83. package/dist/dpdp/findings.d.ts +44 -0
  84. package/dist/dpdp/findings.js +286 -0
  85. package/dist/dpdp/gates.d.ts +14 -0
  86. package/dist/dpdp/gates.js +47 -0
  87. package/dist/dpdp/index.d.ts +16 -0
  88. package/dist/dpdp/index.js +32 -0
  89. package/dist/dpdp/legalSources.d.ts +10 -0
  90. package/dist/dpdp/legalSources.js +104 -0
  91. package/dist/dpdp/paths.d.ts +25 -0
  92. package/dist/dpdp/paths.js +85 -0
  93. package/dist/dpdp/report.d.ts +6 -0
  94. package/dist/dpdp/report.js +222 -0
  95. package/dist/dpdp/reviewQueue.d.ts +3 -0
  96. package/dist/dpdp/reviewQueue.js +88 -0
  97. package/dist/dpdp/scan.d.ts +26 -0
  98. package/dist/dpdp/scan.js +310 -0
  99. package/dist/dpdp/scoring.d.ts +41 -0
  100. package/dist/dpdp/scoring.js +237 -0
  101. package/dist/dpdp/types.d.ts +312 -0
  102. package/dist/dpdp/types.js +86 -0
  103. package/dist/index.d.ts +1 -0
  104. package/dist/index.js +1 -0
  105. package/dist/mcp/tools/dpdp.d.ts +11 -0
  106. package/dist/mcp/tools/dpdp.js +151 -0
  107. package/dist/mcp/tools/index.js +3 -1
  108. package/dist/reporters/html.js +57 -13
  109. package/dist/reporters/json.js +12 -1
  110. package/dist/reporters/markdown.js +46 -4
  111. package/dist/reporters/sarif.js +54 -5
  112. 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 is a local code-health CLI for JS, TS, Python, and mixed repositories. It turns scattered tool output into a ranked health report, safe repair workflow, Privacy Review artifact, MCP server, and reusable agent skills.
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
- For a stronger first run:
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
- Install once if you prefer the short binary:
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
- ## Release Demos
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
- [Direct video link](docs/assets/vibedoctor-product-release-demo-v0.1.1.mp4)
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
- ## Why VibeDoctor
45
+ Default artifacts are written under `.vibedoctor/`:
33
46
 
34
- - It focuses on the failure modes AI-heavy repos accumulate: dead branches, stale fallbacks, leftovers, weak coverage, and accidental sensitive-data exposure.
35
- - It collapses many tool results into one finding model, one score, and a ranked fix list instead of a wall of unrelated warnings.
36
- - It is agent-native without locking you into a hosted service: reports stay local and output remains plain JSON, HTML, Markdown, and SARIF.
37
- - It tells agents whether a scan is complete, provides exact recovery commands for failed tools, and prevents partial scores from masquerading as authoritative health checks.
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
- ## What VibeDoctor Checks
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
- VibeDoctor detects the project shape, discovers local tool binaries, runs the checks that make sense for the repo, and reports missing tools as skipped instead of pretending they passed.
56
+ ## What VibeDoctor checks
42
57
 
43
58
  - Type and lint failures from TypeScript, Pyright, Ruff, Biome, and similar local tools.
44
- - Secrets and dependency risk from Gitleaks, OSV-Scanner, Semgrep, deptry, Knip, and project-native scanners when available.
45
- - Privacy and PII exposure from VibeDoctor's deterministic detector, with optional Presidio support.
46
- - Dead code from Vulture, Knip, and VibeDoctor's dead-chain detector.
47
- - AI and legacy leftovers such as commented-out blocks, stale TODOs, fallback flags, and half-removed code.
48
- - Refactor-readiness hotspots, duplication, complexity, and coverage gaps.
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
- After a scan, VibeDoctor writes machine-readable and human-readable artifacts under `.vibedoctor/`, including `report.json`, `report.html`, and `agent-plan.md`.
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
- ## Tool Setup Philosophy
67
+ ## Know exactly what ran
54
68
 
55
- VibeDoctor prefers repository-local tools and config so the scan matches the versions you actually use in development and CI. Missing tools are reported as skipped with install guidance instead of being counted as clean.
69
+ Every scan prints a coverage table with one row per tool, so "installed" is never confused with "completed":
56
70
 
57
- ## Common CLI Workflows
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
- | Goal | Command |
60
- | --- | --- |
61
- | Initialize config | `vibedoctor init` |
62
- | Plan scanner setup | `vibedoctor setup` |
63
- | Install automatable recommended tools | `vibedoctor setup --apply` |
64
- | Fast local triage | `vibedoctor scan --quick` |
65
- | Review changed files | `vibedoctor scan --changed` |
66
- | Full repository scan | `vibedoctor scan --full` |
67
- | Scan selected categories | `vibedoctor scan --category dead_code,leftovers --report json` |
68
- | Scan privacy findings only | `vibedoctor scan --category privacy --report json` |
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
- `scan` and `verify` return exit code `1` when completed health gates fail and exit code `2` when required checks are incomplete. Reports label incomplete scores as `PARTIAL` or `INVALID` and include machine-readable `recoveryActions`.
94
+ ## Keeping the report readable
78
95
 
79
- Timeouts and required checks are configurable:
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
- runtime:
83
- default_timeout_seconds: 120
84
- tool_timeouts:
85
- biome: 180
86
- semgrep: 300
87
- required_tools:
88
- - biome
89
- - semgrep
90
- fail_on_incomplete_scan: true
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
- ## Privacy Review
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
- Privacy Review is deterministic-first and advisory by default. The built-in privacy detector finds regulated identifiers, personal-data fields, sensitive attributes, and combination-risk patterns while storing masked evidence in reports.
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 scan --category privacy --report json
99
- vibedoctor privacy-review --refresh --format markdown
153
+ vibedoctor tool retry semgrep --timeout 600
100
154
  ```
101
155
 
102
- By default, privacy findings affect the privacy category score but do not lower the overall health score or fail CI. To make privacy findings blocking, opt in through config:
156
+ ## A fast, safe repair loop
103
157
 
104
- - `checks.privacy.fail_on_regulated_identifiers`
105
- - `checks.privacy.fail_on_sensitive_attributes`
158
+ ```bash
159
+ # 1. Establish the current state
160
+ vibedoctor scan --changed --report json
106
161
 
107
- The `privacy-review` command writes `.vibedoctor/privacy-review.json` with structured review decisions and merge-back metadata. Optional AI adjudication only runs when `checks.privacy.ai.enabled` is true and the configured API-key environment variables are present.
162
+ # 2. Generate ordered work
163
+ vibedoctor agent-plan --format markdown
108
164
 
109
- ## Agent Skills And Plugins
165
+ # 3. Optionally apply supported safe tool fixes
166
+ vibedoctor fix --safe
110
167
 
111
- VibeDoctor has two agent surfaces.
168
+ # 4. Review every change, then verify
169
+ vibedoctor verify
170
+ ```
112
171
 
113
- Repo-local install:
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 writes repository-scoped guidance and skills:
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
- - `AGENTS.md`
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
- This materializes an installable bundle under `plugins/vibedoctor/`:
211
+ ### MCP server
141
212
 
142
- - `plugins/vibedoctor/.codex-plugin/plugin.json`
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
- Codex discovers the plugin from `.codex-plugin/plugin.json`, which points to `./skills/`. Claude Code uses the plugin namespace for skill commands, for example:
215
+ ```bash
216
+ vibedoctor mcp
217
+ ```
147
218
 
148
- ```text
149
- /vibedoctor:vibedoctor-health-scan
150
- /vibedoctor:vibedoctor-privacy-review
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 canonical skill catalog is exported from the package root as `AGENT_SKILLS`, `DEFAULT_SKILL_NAMES`, and `SkillTemplate`, and the same templates generate repo skills, Claude skills, Copilot/Cursor shims, and packaged plugin skills.
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
- ## MCP Server
234
+ ```yaml
235
+ checks:
236
+ privacy:
237
+ fail_on_regulated_identifiers: true
238
+ fail_on_sensitive_attributes: true
239
+ ```
156
240
 
157
- Start the MCP server over stdio:
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 mcp
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
- The MCP server exposes structured tools for changed scans, full scans, safe fixes, report retrieval, agent-plan retrieval, finding explanations, and verification. Agent configs generated by `vibedoctor agent init --targets all` include target-specific MCP wiring where supported.
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, but these are the most common controls:
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
- - `score.minimum`: health score required for `scan` and `verify` to pass.
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
- Use `vibedoctor baseline create` to snapshot existing debt, then fail builds only on new problems while you pay down the rest.
346
+ ## Command reference
176
347
 
177
- ## Development And Release
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
- Requirements:
365
+ ## Network and data behavior
180
366
 
181
- - Node.js 18 or newer
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
- Run the local verification set:
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 development commands:
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` | Tool adapters and parsers |
208
- | `src/core` | Project detection, scan planning, scoring, baselines, and command execution |
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, policy, shims, and plugin generation |
211
- | `src/mcp` | MCP server and tools |
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
- | `plugins/vibedoctor` | Generated Codex and Claude plugin bundle |
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