@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.
Files changed (109) hide show
  1. package/README.md +215 -102
  2. package/dist/adapters/biome.d.ts +1 -1
  3. package/dist/adapters/biome.js +7 -4
  4. package/dist/adapters/coveragePy.js +3 -0
  5. package/dist/adapters/deptry.js +21 -2
  6. package/dist/adapters/dpdp.d.ts +6 -0
  7. package/dist/adapters/dpdp.js +34 -0
  8. package/dist/adapters/index.d.ts +1 -0
  9. package/dist/adapters/index.js +3 -1
  10. package/dist/adapters/knip.js +29 -4
  11. package/dist/adapters/lizard.d.ts +1 -1
  12. package/dist/adapters/lizard.js +51 -2
  13. package/dist/adapters/osvScanner.js +14 -2
  14. package/dist/adapters/presidio.js +3 -1
  15. package/dist/adapters/privacyDetector.d.ts +24 -1
  16. package/dist/adapters/privacyDetector.js +91 -7
  17. package/dist/adapters/ruff.d.ts +1 -1
  18. package/dist/adapters/ruff.js +4 -1
  19. package/dist/adapters/semgrep.d.ts +1 -1
  20. package/dist/adapters/semgrep.js +17 -3
  21. package/dist/adapters/shared.d.ts +7 -0
  22. package/dist/adapters/shared.js +22 -0
  23. package/dist/adapters/tsc.js +43 -18
  24. package/dist/adapters/vulture.d.ts +1 -1
  25. package/dist/adapters/vulture.js +25 -6
  26. package/dist/agentPack/templates/index.js +7 -4
  27. package/dist/agentPack/templates/skills.js +156 -44
  28. package/dist/cli/commands/agentPlan.js +9 -1
  29. package/dist/cli/commands/dpdp.d.ts +35 -0
  30. package/dist/cli/commands/dpdp.js +103 -0
  31. package/dist/cli/commands/init.js +12 -4
  32. package/dist/cli/commands/scan.d.ts +1 -1
  33. package/dist/cli/commands/scan.js +8 -1
  34. package/dist/cli/commands/setup.js +4 -2
  35. package/dist/cli/commands/tool.d.ts +4 -0
  36. package/dist/cli/commands/tool.js +11 -0
  37. package/dist/cli/index.js +96 -0
  38. package/dist/core/config.d.ts +27 -0
  39. package/dist/core/config.js +118 -5
  40. package/dist/core/engine.d.ts +32 -1
  41. package/dist/core/engine.js +195 -30
  42. package/dist/core/finding.d.ts +1 -1
  43. package/dist/core/finding.js +1 -0
  44. package/dist/core/projectDetector.d.ts +1 -1
  45. package/dist/core/projectDetector.js +29 -12
  46. package/dist/core/scanPlanner.js +10 -2
  47. package/dist/core/toolRunner.d.ts +1 -0
  48. package/dist/core/toolRunner.js +73 -11
  49. package/dist/dpdp/artifacts.d.ts +11 -0
  50. package/dist/dpdp/artifacts.js +120 -0
  51. package/dist/dpdp/catalogue.d.ts +14 -0
  52. package/dist/dpdp/catalogue.js +661 -0
  53. package/dist/dpdp/collectors/confidence.d.ts +9 -0
  54. package/dist/dpdp/collectors/confidence.js +25 -0
  55. package/dist/dpdp/collectors/dependencies.d.ts +7 -0
  56. package/dist/dpdp/collectors/dependencies.js +63 -0
  57. package/dist/dpdp/collectors/index.d.ts +24 -0
  58. package/dist/dpdp/collectors/index.js +71 -0
  59. package/dist/dpdp/collectors/lifecycle.d.ts +2 -0
  60. package/dist/dpdp/collectors/lifecycle.js +202 -0
  61. package/dist/dpdp/collectors/optionalScanners.d.ts +14 -0
  62. package/dist/dpdp/collectors/optionalScanners.js +347 -0
  63. package/dist/dpdp/collectors/privacyBridge.d.ts +13 -0
  64. package/dist/dpdp/collectors/privacyBridge.js +152 -0
  65. package/dist/dpdp/collectors/safeguards.d.ts +5 -0
  66. package/dist/dpdp/collectors/safeguards.js +186 -0
  67. package/dist/dpdp/collectors/schema.d.ts +6 -0
  68. package/dist/dpdp/collectors/schema.js +122 -0
  69. package/dist/dpdp/collectors/shared.d.ts +10 -0
  70. package/dist/dpdp/collectors/shared.js +43 -0
  71. package/dist/dpdp/context.d.ts +28 -0
  72. package/dist/dpdp/context.js +195 -0
  73. package/dist/dpdp/dataMap.d.ts +7 -0
  74. package/dist/dpdp/dataMap.js +339 -0
  75. package/dist/dpdp/evaluators.d.ts +20 -0
  76. package/dist/dpdp/evaluators.js +522 -0
  77. package/dist/dpdp/evidence.d.ts +11 -0
  78. package/dist/dpdp/evidence.js +123 -0
  79. package/dist/dpdp/findings.d.ts +14 -0
  80. package/dist/dpdp/findings.js +99 -0
  81. package/dist/dpdp/gates.d.ts +14 -0
  82. package/dist/dpdp/gates.js +47 -0
  83. package/dist/dpdp/index.d.ts +16 -0
  84. package/dist/dpdp/index.js +32 -0
  85. package/dist/dpdp/legalSources.d.ts +10 -0
  86. package/dist/dpdp/legalSources.js +104 -0
  87. package/dist/dpdp/paths.d.ts +25 -0
  88. package/dist/dpdp/paths.js +85 -0
  89. package/dist/dpdp/report.d.ts +6 -0
  90. package/dist/dpdp/report.js +222 -0
  91. package/dist/dpdp/reviewQueue.d.ts +3 -0
  92. package/dist/dpdp/reviewQueue.js +88 -0
  93. package/dist/dpdp/scan.d.ts +26 -0
  94. package/dist/dpdp/scan.js +310 -0
  95. package/dist/dpdp/scoring.d.ts +31 -0
  96. package/dist/dpdp/scoring.js +211 -0
  97. package/dist/dpdp/types.d.ts +294 -0
  98. package/dist/dpdp/types.js +86 -0
  99. package/dist/index.d.ts +1 -0
  100. package/dist/index.js +1 -0
  101. package/dist/mcp/tools/dpdp.d.ts +11 -0
  102. package/dist/mcp/tools/dpdp.js +151 -0
  103. package/dist/mcp/tools/index.js +3 -1
  104. package/dist/mcp/tools/shared.js +8 -1
  105. package/dist/reporters/agent.js +8 -0
  106. package/dist/reporters/html.js +4 -2
  107. package/dist/reporters/json.js +8 -1
  108. package/dist/reporters/markdown.js +8 -1
  109. 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 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
41
+ ## What you get
27
42
 
28
- <video src="docs/assets/vibedoctor-product-release-demo-v0.1.1.mp4" controls muted playsinline width="100%"></video>
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
- [Direct video link](docs/assets/vibedoctor-product-release-demo-v0.1.1.mp4)
45
+ Default artifacts are written under `.vibedoctor/`:
31
46
 
32
- ## Why VibeDoctor
33
-
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.
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
- ## 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.
39
55
 
40
- 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
41
57
 
42
58
  - Type and lint failures from TypeScript, Pyright, Ruff, Biome, and similar local tools.
43
- - Secrets and dependency risk from Gitleaks, OSV-Scanner, Semgrep, deptry, Knip, and project-native scanners when available.
44
- - Privacy and PII exposure from VibeDoctor's deterministic detector, with optional Presidio support.
45
- - Dead code from Vulture, Knip, and VibeDoctor's dead-chain detector.
46
- - AI and legacy leftovers such as commented-out blocks, stale TODOs, fallback flags, and half-removed code.
47
- - Refactor-readiness hotspots, duplication, complexity, and coverage gaps.
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
- 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`.
51
66
 
52
- ## Tool Setup Philosophy
67
+ ## Understand the result before fixing code
53
68
 
54
- 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
+ | 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
- ## Common CLI Workflows
75
+ CLI exit codes let people, agents, and CI distinguish health failures from missing evidence:
57
76
 
58
- | Goal | Command |
77
+ | Code | Meaning |
59
78
  | --- | --- |
60
- | Initialize config | `vibedoctor init` |
61
- | Plan scanner setup | `vibedoctor setup` |
62
- | Install automatable recommended tools | `vibedoctor setup --apply` |
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
- `scan` and `verify` return a non-zero exit code when configured score thresholds or fail-fast checks are tripped, which makes them usable in pre-commit hooks and CI gates.
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
- ## Privacy Review
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
- 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.
91
+ ## A fast, safe repair loop
80
92
 
81
93
  ```bash
82
- vibedoctor scan --category privacy --report json
83
- vibedoctor privacy-review --refresh --format markdown
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
- 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:
107
+ Use `vibedoctor explain <finding-id>` when a finding needs more context. Always review generated changes before committing them.
87
108
 
88
- - `checks.privacy.fail_on_regulated_identifiers`
89
- - `checks.privacy.fail_on_sensitive_attributes`
109
+ For an inherited repository, baseline existing debt and fail only on new findings:
90
110
 
91
- 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.
111
+ ```bash
112
+ vibedoctor baseline create
113
+ ```
92
114
 
93
- ## Agent Skills And Plugins
115
+ ```yaml
116
+ baseline:
117
+ fail_only_on_new_issues: true
118
+ ```
94
119
 
95
- VibeDoctor has two agent surfaces.
120
+ ## Using VibeDoctor with AI agents
96
121
 
97
- Repo-local install:
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 writes repository-scoped guidance and skills:
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
- - `AGENTS.md`
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
- This materializes an installable bundle under `plugins/vibedoctor/`:
146
+ ### MCP server
125
147
 
126
- - `plugins/vibedoctor/.codex-plugin/plugin.json`
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
- Codex discovers the plugin from `.codex-plugin/plugin.json`, which points to `./skills/`. Claude Code uses the plugin namespace for skill commands, for example:
150
+ ```bash
151
+ vibedoctor mcp
152
+ ```
131
153
 
132
- ```text
133
- /vibedoctor:vibedoctor-health-scan
134
- /vibedoctor:vibedoctor-privacy-review
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
- 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.
176
+ ## DPDP technical readiness
138
177
 
139
- ## MCP Server
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
- Start the MCP server over stdio:
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 mcp
183
+ vibedoctor dpdp init
184
+ vibedoctor dpdp scan --full
145
185
  ```
146
186
 
147
- 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.
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, but these are the most common controls:
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`: health score required for `scan` and `verify` to pass.
154
- - `baseline.fail_only_on_new_issues`: fail only on debt introduced after the baseline.
155
- - `checks.*`: enable categories and fail-fast gates for secrets, type errors, test failures, and vulnerabilities.
156
- - `checks.privacy.*`: tune deterministic privacy detection, masking, optional Presidio support, optional AI review, and CI blocking behavior.
157
- - `paths.include` and `paths.exclude`: scope scanned files.
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
- Use `vibedoctor baseline create` to snapshot existing debt, then fail builds only on new problems while you pay down the rest.
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
- ## Development And Release
260
+ ## Command reference
162
261
 
163
- Requirements:
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
- - Node.js 18 or newer
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
- Run the local verification set:
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 development commands:
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` | Tool adapters and parsers |
192
- | `src/core` | Project detection, scan planning, scoring, baselines, and command execution |
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, policy, shims, and plugin generation |
195
- | `src/mcp` | MCP server and tools |
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
- | `plugins/vibedoctor` | Generated Codex and Claude plugin bundle |
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
@@ -1,2 +1,2 @@
1
- import type { ToolAdapter } from "./shared";
1
+ import { type ToolAdapter } from "./shared";
2
2
  export declare const biomeAdapter: ToolAdapter;
@@ -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", ".", "--reporter=json"],
33
+ args: ["check", ...targets, "--reporter=json"],
32
34
  cwd: ctx.root,
33
- timeoutMs: 60_000
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", ".", "--write"],
63
+ args: ["check", ...targets, "--write"],
61
64
  cwd: ctx.root,
62
- timeoutMs: 60_000
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);
@@ -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: ctx.root,
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,6 @@
1
+ import type { ToolAdapter } from "./shared";
2
+ /**
3
+ * DPDP technical readiness adapter.
4
+ * Produces findings from the deterministic DPDP package and writes DPDP artifacts.
5
+ */
6
+ export declare const dpdpAdapter: ToolAdapter;
@@ -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
+ };
@@ -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";
@@ -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; } });