@thomasminh1995/depverdict 0.6.0-alpha.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 (252) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +518 -0
  3. package/bin/depverdict.js +7 -0
  4. package/bin/upgradelens.js +7 -0
  5. package/docs/GR-01-Semantic-Grounding-Failure-Analysis.md +309 -0
  6. package/docs/GR-02-Versioned-Action-Evaluation-Criteria.md +187 -0
  7. package/docs/GR-03-Extractive-Contract-Safety-Experiment.md +242 -0
  8. package/docs/GR-04-Versioned-Production-Extractive-Contract.md +154 -0
  9. package/docs/IA-01-Repository-Usage-Discovery.md +122 -0
  10. package/docs/IA-02-Repository-Impact-Analysis.md +118 -0
  11. package/docs/IA-03-Repository-Impact-Evidence.md +160 -0
  12. package/docs/IA-04-CLI-Orchestration.md +235 -0
  13. package/docs/IA-05-Real-Provider-Validation.md +235 -0
  14. package/docs/IA-05-VinGrade-Validation.md +339 -0
  15. package/docs/MVP-01.md +48 -0
  16. package/docs/MVP-02-Architecture.md +536 -0
  17. package/docs/MVP-02-CLI-HTTP-Runtime.md +50 -0
  18. package/docs/MVP-02-HTTP-Lifecycle.md +37 -0
  19. package/docs/MVP-02-Knowledge-Manifest-Generation.md +75 -0
  20. package/docs/MVP-02-Knowledge-Manifest.md +279 -0
  21. package/docs/MVP-02-Knowledge-Research-Orchestration.md +62 -0
  22. package/docs/MVP-02-Knowledge-Store.md +87 -0
  23. package/docs/MVP-02-PyPI-Registry-Adapter.md +97 -0
  24. package/docs/MVP-02-Research-Planning.md +196 -0
  25. package/docs/MVP-02-Source-Provenance.md +81 -0
  26. package/docs/MVP-02-npm-Registry-Adapter.md +99 -0
  27. package/docs/RR-01-End-to-End-and-Real-Provider-Validation.md +393 -0
  28. package/docs/RR-01-RERUN-Extractive-Contract-Validation.md +566 -0
  29. package/docs/RR-02-Full-Product-Workflow-and-Developer-CLI-UX-Review.md +35 -0
  30. package/docs/RR02-FIX-01-Persistent-Qualification-Resolution.md +32 -0
  31. package/docs/RR02-FIX-02-Stage-aware-CLI-Progress-and-Heartbeat.md +28 -0
  32. package/docs/RR02-FIX-03-npm-Capture-Evidence-Exclusion.md +33 -0
  33. package/docs/RR02-FIX-03A-Complete-Package-Exclusion-and-Evidence-Commit.md +223 -0
  34. package/docs/RR02-FIX-04-Event-loop-safe-Heartbeat.md +393 -0
  35. package/docs/RR02-FIX-05-Materialize-Persisted-Qualification.md +207 -0
  36. package/docs/RR02-RERUN-CLI-Qualification-Progress-UX-and-Package-Validation.md +342 -0
  37. package/docs/VinGrade-MVP-02-Validation.md +480 -0
  38. package/docs/VinGrade-RC02-Live-Validation.md +273 -0
  39. package/docs/ai-capability-discovery.md +573 -0
  40. package/docs/ai-engineering-production-readiness.md +390 -0
  41. package/docs/ai-engineering-review.md +251 -0
  42. package/docs/ai-runtime-governance-discovery.md +754 -0
  43. package/docs/architecture-overview.md +78 -0
  44. package/docs/cli-progress.md +111 -0
  45. package/docs/decisions/diff-01-brand-distribution-identity.md +450 -0
  46. package/docs/decisions/diff-02-identity-compatibility-contract.md +274 -0
  47. package/docs/decisions/diff-03-repository-docs-community-migration.md +165 -0
  48. package/docs/decisions/diff-04-release-evidence-gap-acceptance.md +110 -0
  49. package/docs/discovery/mvp-05-ai-migration-planning-discovery.md +350 -0
  50. package/docs/gateway-runtime-discovery.md +614 -0
  51. package/docs/live-ai-validation.md +299 -0
  52. package/docs/migration-planning-qualification-resolution.md +99 -0
  53. package/docs/migrations/upgradelens-to-depverdict.md +97 -0
  54. package/docs/mp-r03-deterministic-upgrade-decision-architecture.md +135 -0
  55. package/docs/mp-r04-evidence-bounded-migration-handoff-architecture.md +116 -0
  56. package/docs/mp-r05-product-completion-and-decision-first-cli-architecture.md +162 -0
  57. package/docs/mvp-05-deterministic-context-runtime.md +127 -0
  58. package/docs/mvp-05-migration-checklist-contract.md +166 -0
  59. package/docs/mvp-05-migration-checklist-orchestration.md +105 -0
  60. package/docs/mvp-05-migration-evaluation-and-qualification.md +135 -0
  61. package/docs/mvp-05-provider-neutral-generator.md +79 -0
  62. package/docs/ollama-local-smoke-validation.md +156 -0
  63. package/docs/openai-compatible-runtime-discovery.md +789 -0
  64. package/docs/openrouter-one-dependency-validation.md +205 -0
  65. package/docs/oss-02-package-guard-hardening-architecture.md +131 -0
  66. package/docs/oss-04-public-ci-package-metadata-architecture.md +142 -0
  67. package/docs/package-content-policy.md +98 -0
  68. package/docs/releases/v0.5.0-technical-preview.md +114 -0
  69. package/docs/releases/v0.6.0-alpha.1-depverdict-preview.md +101 -0
  70. package/docs/reviews/diff-02-identity-contract-compatibility.md +413 -0
  71. package/docs/reviews/diff-03-repository-docs-community-migration.md +364 -0
  72. package/docs/reviews/diff-04-depverdict-distribution-identity-readiness-rereview.md +453 -0
  73. package/docs/reviews/diff-04-fix-post-rename-identity-release-remediation.md +310 -0
  74. package/docs/reviews/diff-05-final-preview-distribution-qualification.md +561 -0
  75. package/docs/reviews/mvp-05-final-product-value-workflow-rereview.md +471 -0
  76. package/docs/reviews/mvp-05-product-workflow-review.md +605 -0
  77. package/docs/reviews/oss-01-duplicate-artifact-investigation-cleanup.md +411 -0
  78. package/docs/reviews/oss-02-package-guard-hardening.md +303 -0
  79. package/docs/reviews/oss-03-community-scaffolding.md +378 -0
  80. package/docs/reviews/oss-04-public-ci-package-metadata.md +439 -0
  81. package/docs/reviews/oss-05-technical-preview-qualification.md +482 -0
  82. package/docs/reviews/upgradelens-vs-upgradedepdetective-source-comparison.md +355 -0
  83. package/docs/reviews/v0.5.0-pre-release-smoke.md +263 -0
  84. package/docs/reviews/v0.5.0-version-bump-release-verification.md +306 -0
  85. package/docs/runtime-contract-discovery.md +521 -0
  86. package/docs/structured-output-compatibility-report.md +100 -0
  87. package/docs/ts-fix-01-exact-duplicate-occurrence-target-selection-architecture.md +111 -0
  88. package/docs/version-analysis-architecture.md +827 -0
  89. package/eval/README.md +86 -0
  90. package/eval/datasets/generic/declared-constraint.json +59 -0
  91. package/eval/datasets/generic/evidence-conflict.json +73 -0
  92. package/eval/datasets/generic/major-breaking-release.json +66 -0
  93. package/eval/datasets/generic/missing-evidence.json +46 -0
  94. package/eval/datasets/generic/patch-release-low.json +59 -0
  95. package/eval/datasets/node/axios-patch-low.json +59 -0
  96. package/eval/datasets/node/react-major-breaking.json +66 -0
  97. package/eval/datasets/node/react-minor-compatibility.json +66 -0
  98. package/eval/datasets/python/fastapi-deprecation.json +66 -0
  99. package/eval/datasets/python/pydantic-major-breaking.json +66 -0
  100. package/eval/migration-planning/golden-dataset-v2.json +306 -0
  101. package/eval/migration-planning/golden-dataset.json +214 -0
  102. package/eval/schemas/expected-result.schema.json +88 -0
  103. package/eval/schemas/golden-case.schema.json +181 -0
  104. package/package.json +57 -0
  105. package/schemas/ai-scorecard.schema.json +132 -0
  106. package/schemas/benchmark-report.schema.json +189 -0
  107. package/schemas/benchmark.schema.json +55 -0
  108. package/schemas/capability-profile.schema.json +44 -0
  109. package/schemas/conformance-report.schema.json +150 -0
  110. package/schemas/deployment-profile.schema.json +64 -0
  111. package/schemas/evaluation-report.schema.json +158 -0
  112. package/schemas/knowledge-evidence-bundle.schema.json +150 -0
  113. package/schemas/knowledge-manifest.schema.json +548 -0
  114. package/schemas/metrics.schema.json +178 -0
  115. package/schemas/migration-checklist-extractive-candidate.schema.json +42 -0
  116. package/schemas/migration-checklist.schema.json +706 -0
  117. package/schemas/migration-evaluation-dataset-v2.schema.json +208 -0
  118. package/schemas/migration-evaluation-dataset.schema.json +204 -0
  119. package/schemas/migration-planning-qualification-record.schema.json +234 -0
  120. package/schemas/project-manifest.schema.json +308 -0
  121. package/schemas/qualification-record.schema.json +56 -0
  122. package/schemas/repository-impact-evidence.schema.json +232 -0
  123. package/schemas/repository-impact.schema.json +202 -0
  124. package/schemas/upgrade-decision.schema.json +273 -0
  125. package/schemas/usage-index.schema.json +179 -0
  126. package/schemas/version-analysis.schema.json +449 -0
  127. package/src/ai-runtime-debug.js +325 -0
  128. package/src/ai-runtime-error.js +42 -0
  129. package/src/ai-runtime.js +174 -0
  130. package/src/ai-scorecard.js +204 -0
  131. package/src/ai-version-analysis.js +484 -0
  132. package/src/artifact-root-compatibility.js +91 -0
  133. package/src/benchmark-report.js +111 -0
  134. package/src/benchmark-runner.js +191 -0
  135. package/src/canonical-json.js +69 -0
  136. package/src/cli.js +1299 -0
  137. package/src/conformance-report.js +158 -0
  138. package/src/conformance-runner.js +253 -0
  139. package/src/constants.js +73 -0
  140. package/src/cooperative-scheduler.js +79 -0
  141. package/src/dependencies.js +44 -0
  142. package/src/dependency-ai-context.js +625 -0
  143. package/src/detectors.js +253 -0
  144. package/src/discovery.js +234 -0
  145. package/src/ecosystem-version-adapter.js +294 -0
  146. package/src/environment-compatibility.js +77 -0
  147. package/src/evaluation-comparator.js +158 -0
  148. package/src/evaluation-report.js +76 -0
  149. package/src/evaluation-runner.js +248 -0
  150. package/src/evidence-source-adapter.js +472 -0
  151. package/src/files.js +89 -0
  152. package/src/governance-diagnostics.js +64 -0
  153. package/src/governance-loader.js +63 -0
  154. package/src/governance-metadata.js +346 -0
  155. package/src/governance-validator.js +360 -0
  156. package/src/http/bounded-fetch.js +278 -0
  157. package/src/http/cli-http-runtime.js +44 -0
  158. package/src/impact/input-loader.js +157 -0
  159. package/src/impact/matcher.js +40 -0
  160. package/src/impact/repository-impact.js +199 -0
  161. package/src/impact/runtime.js +24 -0
  162. package/src/impact/status.js +62 -0
  163. package/src/impact/writer.js +30 -0
  164. package/src/impact-evidence/input-loader.js +202 -0
  165. package/src/impact-evidence/repository-impact-evidence.js +234 -0
  166. package/src/impact-evidence/runtime.js +16 -0
  167. package/src/impact-evidence/writer.js +30 -0
  168. package/src/index.js +563 -0
  169. package/src/installed-version-baseline.js +196 -0
  170. package/src/knowledge-cache.js +324 -0
  171. package/src/knowledge-evidence-bundle.js +101 -0
  172. package/src/knowledge-evidence-producer.js +233 -0
  173. package/src/knowledge-manifest-builder.js +188 -0
  174. package/src/knowledge-manifest-writer.js +32 -0
  175. package/src/knowledge-manifest.js +255 -0
  176. package/src/knowledge-research.js +615 -0
  177. package/src/metrics-engine.js +205 -0
  178. package/src/migration-checklist/ai-candidate.js +320 -0
  179. package/src/migration-checklist/assembler.js +37 -0
  180. package/src/migration-checklist/context-runtime.js +828 -0
  181. package/src/migration-checklist/evaluation/action-criteria.js +244 -0
  182. package/src/migration-checklist/evaluation/comparator-v2.js +332 -0
  183. package/src/migration-checklist/evaluation/comparator.js +279 -0
  184. package/src/migration-checklist/evaluation/dataset-v2.js +227 -0
  185. package/src/migration-checklist/evaluation/dataset.js +336 -0
  186. package/src/migration-checklist/evaluation/extractive-fixtures-v2.js +148 -0
  187. package/src/migration-checklist/evaluation/metrics-v2.js +226 -0
  188. package/src/migration-checklist/evaluation/metrics.js +158 -0
  189. package/src/migration-checklist/evaluation/qualification-v2.js +321 -0
  190. package/src/migration-checklist/evaluation/qualification.js +239 -0
  191. package/src/migration-checklist/evaluation/runner-v2.js +294 -0
  192. package/src/migration-checklist/evaluation/runner.js +194 -0
  193. package/src/migration-checklist/evaluation/scorecard-v2.js +106 -0
  194. package/src/migration-checklist/evaluation/scorecard.js +86 -0
  195. package/src/migration-checklist/extractive-candidate.js +166 -0
  196. package/src/migration-checklist/extractive-prompt.js +62 -0
  197. package/src/migration-checklist/generator.js +702 -0
  198. package/src/migration-checklist/grounding-policy.js +117 -0
  199. package/src/migration-checklist/input-loader.js +613 -0
  200. package/src/migration-checklist/migration-checklist.js +635 -0
  201. package/src/migration-checklist/presentation.js +292 -0
  202. package/src/migration-checklist/progress.js +96 -0
  203. package/src/migration-checklist/prompt.js +83 -0
  204. package/src/migration-checklist/qualification-guard.js +462 -0
  205. package/src/migration-checklist/qualification-resolution.js +122 -0
  206. package/src/migration-checklist/qualification-store.js +225 -0
  207. package/src/migration-checklist/runtime.js +205 -0
  208. package/src/migration-checklist/verification.js +134 -0
  209. package/src/migration-checklist/writer.js +35 -0
  210. package/src/openai-compatible-provider.js +451 -0
  211. package/src/orchestration/failure-log.js +32 -0
  212. package/src/orchestration/pipeline.js +200 -0
  213. package/src/orchestration/progress-events.js +337 -0
  214. package/src/orchestration/progress-reporter.js +131 -0
  215. package/src/orchestration/text-writer.js +22 -0
  216. package/src/portable.js +13 -0
  217. package/src/product-completion.js +249 -0
  218. package/src/project-manifest-input.js +90 -0
  219. package/src/project-manifest.js +141 -0
  220. package/src/python-requirements.js +137 -0
  221. package/src/registry/npm-packument.js +256 -0
  222. package/src/registry/npm-registry-adapter.js +262 -0
  223. package/src/registry/pypi-project.js +300 -0
  224. package/src/registry/pypi-registry-adapter.js +235 -0
  225. package/src/registry/sanitize-registry-body.js +51 -0
  226. package/src/renderers/console.js +160 -0
  227. package/src/renderers/impact-presentation.js +278 -0
  228. package/src/renderers/markdown.js +172 -0
  229. package/src/research-plan.js +455 -0
  230. package/src/runtime-conformance.js +275 -0
  231. package/src/source-provenance.js +393 -0
  232. package/src/source-url.js +62 -0
  233. package/src/structured-output-schema.js +66 -0
  234. package/src/target-selector.js +306 -0
  235. package/src/upgrade-decision/input-loader.js +107 -0
  236. package/src/upgrade-decision/presentation.js +43 -0
  237. package/src/upgrade-decision/runtime.js +21 -0
  238. package/src/upgrade-decision/upgrade-decision.js +626 -0
  239. package/src/upgrade-decision/writer.js +30 -0
  240. package/src/usage/analyzer-registry.js +63 -0
  241. package/src/usage/coverage.js +116 -0
  242. package/src/usage/input-loader.js +139 -0
  243. package/src/usage/js/analyzer.js +240 -0
  244. package/src/usage/js/parser.js +21 -0
  245. package/src/usage/runtime.js +187 -0
  246. package/src/usage/scope.js +44 -0
  247. package/src/usage/source-files.js +50 -0
  248. package/src/usage/usage-index.js +217 -0
  249. package/src/usage/writer.js +31 -0
  250. package/src/version-analysis-loader.js +203 -0
  251. package/src/version-analysis-manifest.js +314 -0
  252. package/src/version-analysis-writer.js +30 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 thomasMinh1995
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,518 @@
1
+ # DepVerdict
2
+
3
+ > **Public Technical Preview / Alpha**
4
+
5
+ DepVerdict is a decision-first CLI for evidence-bounded dependency upgrade
6
+ analysis.
7
+
8
+ It discovers dependency occurrences in a repository, distinguishes declared,
9
+ installed, and target versions, checks how supported source files use those
10
+ dependencies, and projects a deterministic upgrade decision. When requested, it
11
+ also prepares an evidence-bounded migration handoff for human review.
12
+
13
+ DepVerdict helps answer:
14
+
15
+ - Should we keep the installed version, plan an upgrade, or investigate?
16
+ - Why, and what evidence and repository impact support that result?
17
+ - What is the bounded next step?
18
+ - What still requires human review?
19
+
20
+ DepVerdict does not update dependencies, patch source code, authorize a Coding
21
+ Agent, or guarantee that a migration is safe.
22
+
23
+ ## Why DepVerdict?
24
+
25
+ A registry reporting a newer version does not mean a team should upgrade. Release
26
+ notes do not know which dependency occurrence a repository uses, whether the
27
+ installed version differs from the declaration, or where affected APIs appear in
28
+ source.
29
+
30
+ Developers and Coding Agents can research these facts manually, but the context is
31
+ easy to lose and expensive to rebuild. DepVerdict produces versioned artifacts that
32
+ teams can inspect, discuss, and hand off:
33
+
34
+ - Registry latest is candidate discovery, not a recommendation.
35
+ - A positive upgrade recommendation requires a structured driver.
36
+ - Negative impact conclusions require complete analyzer coverage.
37
+ - AI-assisted output is bounded by selected official or publisher evidence.
38
+ - Humans choose targets, approve actions, and decide whether to migrate.
39
+
40
+ ## Current capabilities
41
+
42
+ DepVerdict `0.6.0-alpha.1` includes:
43
+
44
+ 1. Deterministic project and dependency discovery.
45
+ 2. npm and PyPI knowledge and evidence research.
46
+ 3. AI-assisted, schema-validated version analysis.
47
+ 4. Repository usage and impact analysis.
48
+ 5. Installed-version baseline resolution.
49
+ 6. Coverage-aware impact semantics.
50
+ 7. Deterministic Upgrade Decision projection.
51
+ 8. Evidence-bounded Migration Checklist v2.
52
+ 9. Decision-first product completion and CI exit semantics.
53
+ 10. Offline research using fresh cached evidence with explicit limitations.
54
+
55
+ ## Workflow overview
56
+
57
+ ```mermaid
58
+ flowchart TD
59
+ A["Discover projects and dependency occurrences"] --> B["Research target knowledge and evidence"]
60
+ B --> C["Analyze versions"]
61
+ C --> D["Inspect supported source usage and impact"]
62
+ D --> E["Project a deterministic upgrade decision"]
63
+ E --> F["Report the result"]
64
+ E -.->|"experimental opt-in"| G["Prepare a human-reviewed migration handoff"]
65
+ G --> F
66
+ ```
67
+
68
+ The primary command runs the stages in that order. Each stage consumes validated,
69
+ versioned artifacts from the preceding stages instead of inventing missing facts.
70
+
71
+ ## Installation
72
+
73
+ ### Requirements
74
+
75
+ - Node.js 20 or newer
76
+
77
+ The npm preview has not yet passed its distribution gate. The planned install
78
+ command after publication is:
79
+
80
+ ```sh
81
+ npm install -g @thomasminh1995/depverdict@preview
82
+ ```
83
+
84
+ Until then, use the canonical repository source checkout:
85
+
86
+ ```sh
87
+ git clone https://github.com/thomasMinh1995/DepVerdict.git
88
+ cd DepVerdict
89
+ npm ci
90
+ node ./bin/depverdict.js --version
91
+ ```
92
+
93
+ Optionally expose the local executable:
94
+
95
+ ```sh
96
+ npm link
97
+ depverdict --version
98
+ ```
99
+
100
+ ## Provider configuration
101
+
102
+ DepVerdict uses a provider-neutral `AiRuntime` boundary. The CLI supports a generic
103
+ HTTP JSON adapter and an OpenAI-compatible adapter. OpenRouter can be configured as
104
+ an OpenAI-compatible endpoint, but it is not required by the product architecture.
105
+
106
+ For an OpenAI-compatible runtime, configure a full chat-completions endpoint and an
107
+ exact model identity:
108
+
109
+ ```sh
110
+ export DEPVERDICT_AI_PROVIDER="openai-compatible"
111
+ export DEPVERDICT_AI_ENDPOINT="https://example-provider.invalid/v1/chat/completions"
112
+ export DEPVERDICT_AI_MODEL="provider/model-name"
113
+ export DEPVERDICT_AI_AUTHORIZATION="Bearer replace-me"
114
+ export DEPVERDICT_AI_TIMEOUT_MS="60000"
115
+ ```
116
+
117
+ `DEPVERDICT_AI_AUTHORIZATION` is optional and must contain the complete
118
+ Authorization header value when the endpoint requires one. Never commit a real
119
+ credential. `DEPVERDICT_AI_DEBUG=1` enables sanitized runtime diagnostics; keep it
120
+ off unless those diagnostics are needed.
121
+
122
+ Changing a provider or model can change output quality. Structured-output validation,
123
+ deterministic decision policy, evidence allowlists, and human review still govern
124
+ what DepVerdict publishes. A provider/model is not qualified for Migration
125
+ Checklist execution merely because it is OpenAI-compatible; qualification is bound
126
+ to exact machine-readable runtime identity.
127
+
128
+ Applications can also inject an `AiRuntime` through the JavaScript API rather than
129
+ using environment configuration.
130
+
131
+ ## Quick start
132
+
133
+ Run the complete decision-first workflow against the current repository:
134
+
135
+ ```sh
136
+ depverdict analyze .
137
+ ```
138
+
139
+ The console summary reports the overall completion state, each dependency decision,
140
+ installed and target versions, coverage, limitations, and the next step. Validated
141
+ JSON artifacts and the Markdown report are written under `.depverdict/`.
142
+
143
+ By default, research may discover `registryLatest` as a target candidate. That fact
144
+ does not express user intent and is not a recommendation driver. A newer registry
145
+ target alone does not become `PLAN_UPGRADE`; it normally produces `INVESTIGATE`.
146
+
147
+ Use `--stdout` to print only the machine-readable product-completion summary:
148
+
149
+ ```sh
150
+ depverdict analyze . --stdout
151
+ ```
152
+
153
+ Use `--progress auto|interactive|plain` to control progress rendering. `auto` selects
154
+ TTY-friendly or stable line-oriented output as appropriate. Heartbeats report real
155
+ elapsed time but never invent a percentage or ETA.
156
+
157
+ ### Zero-secret Technical Preview sample
158
+
159
+ The source repository includes a small public-safe Node sample with a declared
160
+ dependency, a lockfile-installed baseline, and real source usage. Run deterministic
161
+ discovery without provider configuration:
162
+
163
+ ```sh
164
+ depverdict discover examples/technical-preview-node --stdout
165
+ ```
166
+
167
+ Run the bounded offline workflow:
168
+
169
+ ```sh
170
+ depverdict analyze examples/technical-preview-node --offline --stdout
171
+ ```
172
+
173
+ Without a fresh local knowledge cache, the honest expected result is
174
+ `INSUFFICIENT_DATA`: DepVerdict preserves the installed baseline but does not
175
+ invent a registry target, evidence, or recommendation. See the
176
+ [sample guide](examples/technical-preview-node/README.md) for the expected boundary
177
+ and the optional provider-configured next level. The sample is repository-only and
178
+ is not included in the npm tarball.
179
+
180
+ ## Explicit target selection
181
+
182
+ A caller-owned target is repeatable and applies only to the matching dependency
183
+ occurrence:
184
+
185
+ ```sh
186
+ depverdict analyze . \
187
+ --target 'package=npm:framework-a,target=2.0.0'
188
+ ```
189
+
190
+ Qualify a monorepo occurrence when package identity alone is not unique:
191
+
192
+ ```sh
193
+ depverdict analyze . \
194
+ --target 'package=npm:framework-a,target=2.0.0,project=node:apps/web,manifest=apps/web/package.json,type=dependency'
195
+ ```
196
+
197
+ Scoped npm names are parsed as canonical package IDs; the `@` is not treated as a
198
+ version delimiter:
199
+
200
+ ```sh
201
+ depverdict analyze . \
202
+ --target 'package=npm:@scope/package,target=3.1.0'
203
+ ```
204
+
205
+ Python targets use the Python version adapter:
206
+
207
+ ```sh
208
+ depverdict analyze . \
209
+ --target 'package=pypi:library-a,target=2.0.0'
210
+ ```
211
+
212
+ If a selector matches multiple declarations, DepVerdict fails before provider
213
+ construction and prints exact candidate selectors. Copy one candidate, including its
214
+ stable occurrence identifier:
215
+
216
+ ```sh
217
+ depverdict analyze . \
218
+ --target 'package=pypi:library-a,target=2.0.0,project=python:.,manifest=requirements.txt,type=runtime,occurrence=sha256:<candidate-id>'
219
+ ```
220
+
221
+ `<candidate-id>` is a placeholder; use the digest printed by your CLI run. A stale
222
+ occurrence ID, or an ID that conflicts with package/project/manifest/type fields,
223
+ fails closed before a provider call. The selected occurrence receives the explicit
224
+ target; other occurrences continue to use `registryLatest`.
225
+
226
+ ## Deterministic Upgrade Decision
227
+
228
+ AI-assisted Version Analysis supplies bounded facts, but it does not own the final
229
+ decision state. DepVerdict applies a deterministic policy to installed and target
230
+ versions, evidence, repository impact, and coverage.
231
+
232
+ | Decision | User meaning |
233
+ | --- | --- |
234
+ | `KEEP_CURRENT` | The installed version needs no version change for the evaluated target. |
235
+ | `UPGRADE_NOW` | Reserved for a validated structured urgency driver. No current production urgency contract emits this state. |
236
+ | `PLAN_UPGRADE` | A structured caller-owned target and sufficient evidence support reviewed migration planning. |
237
+ | `INVESTIGATE` | A human must resolve target intent, evidence conflict, coverage, policy, or compatibility questions. |
238
+ | `INSUFFICIENT_EVIDENCE` | A required installed baseline, target, or target-scoped evidence is unavailable. |
239
+ | `NOT_ANALYZED` | Version analysis was skipped, failed, or unavailable. |
240
+
241
+ Important policy boundaries:
242
+
243
+ - Installed version equal to the target produces `KEEP_CURRENT`.
244
+ - A newer registry target without a structured recommendation driver produces
245
+ `INVESTIGATE`.
246
+ - A validated caller-selected target can provide the `USER_SELECTED_TARGET` driver
247
+ for `PLAN_UPGRADE`.
248
+ - AI prose and words such as “critical” cannot create `UPGRADE_NOW`.
249
+ - Unsupported ecosystems and incomparable versions fail closed to manual
250
+ investigation.
251
+ - Partial, unavailable, or failed source coverage cannot support a negative
252
+ repository-safety conclusion.
253
+
254
+ ## Migration Checklist v2
255
+
256
+ **Experimental · Opt-in · Human-reviewed**
257
+
258
+ Enable the stage explicitly:
259
+
260
+ ```sh
261
+ depverdict analyze . --experimental-migration-checklist
262
+ ```
263
+
264
+ The handoff can include:
265
+
266
+ - decision, occurrence, and version facts;
267
+ - official evidence provenance and exact evidence-bounded excerpts;
268
+ - affected source areas backed by positive repository evidence;
269
+ - verification commands derived from supported project scripts;
270
+ - preconditions, limitations, review questions, next steps, and recovery
271
+ availability.
272
+
273
+ The trust boundary is intentionally narrow:
274
+
275
+ - AI may select exact excerpts only from the occurrence's evidence allowlist.
276
+ - AI does not own the target, repository paths, commands, approval, recovery plan,
277
+ rollback, or source patch.
278
+ - Migration actions are eligible only for `PLAN_UPGRADE` or `UPGRADE_NOW`.
279
+ - `KEEP_CURRENT`, `INVESTIGATE`, `INSUFFICIENT_EVIDENCE`, and `NOT_ANALYZED` do not
280
+ produce migration actions.
281
+ - Suggested verification commands are displayed for review; DepVerdict does not
282
+ execute them.
283
+ - Every published action requires human review.
284
+
285
+ By default the CLI looks for a persisted Migration Planning v2 qualification record
286
+ at:
287
+
288
+ ```text
289
+ .depverdict/migration-planning-qualification.json
290
+ ```
291
+
292
+ Select another repository-relative record with:
293
+
294
+ ```sh
295
+ depverdict analyze . \
296
+ --experimental-migration-checklist \
297
+ --migration-qualification path/to/qualification.json
298
+ ```
299
+
300
+ A matching real-runtime record must preserve the exact provider, model, adapter,
301
+ dataset, prompt, policy, schema, and deterministic presentation identity. Corrupted,
302
+ identity-mismatched, fake-runtime, or matching `NOT_QUALIFIED` records fail closed
303
+ before provider use. An invalid explicit path never falls back. A missing default
304
+ record may run only under the explicitly requested experimental path and is reported
305
+ as an experimental override, not as qualified.
306
+
307
+ The resulting artifact and any Coding Agent handoff are a review draft, not
308
+ authorization to edit source and not proof that a migration completed.
309
+
310
+ ## Legacy compatibility during the preview
311
+
312
+ The `upgradelens` CLI, `.upgradelens/` artifact directory and `UPGRADELENS_*`
313
+ environment variables remain available during the `0.6.x` preview compatibility
314
+ window. New integrations should use `depverdict`, `.depverdict/` and
315
+ `DEPVERDICT_*`.
316
+
317
+ Legacy artifact input is a read fallback only; new implicit writes use
318
+ `.depverdict/`. DepVerdict never merges an artifact chain across the two roots.
319
+ Canonical environment values win conflicts, and legacy fallback emits bounded
320
+ warnings without printing values. See the
321
+ [UpgradeLens-to-DepVerdict migration guide](docs/migrations/upgradelens-to-depverdict.md).
322
+ Removal requires a separate compatibility decision and release note; this is not
323
+ an indefinite support promise.
324
+
325
+ ## Product completion and exit codes
326
+
327
+ The top-level completion state distinguishes a trustworthy result from a partial or
328
+ failed pipeline:
329
+
330
+ | Completion | Meaning | Default exit | `--fail-on-incomplete` |
331
+ | --- | --- | ---: | ---: |
332
+ | `COMPLETED` | Evaluated targets need no additional review or version change. | 0 | 0 |
333
+ | `COMPLETED_WITH_REVIEW` | A valid result requires human review. | 0 | 2 |
334
+ | `INSUFFICIENT_DATA` | Required baseline, target, or evidence is missing. | 0 | 2 |
335
+ | `PARTIAL` | Some provider, output, runtime, or action-generation result failed and was retained. | 2 | 2 |
336
+ | `FAILED` | A fatal pipeline stage failed. | 1 | 1 |
337
+ | `CANCELLED` | The run was cancelled. | 130 | 130 |
338
+
339
+ `INVESTIGATE` is not a pipeline failure by default. Zero migration actions are not a
340
+ failure, and an all-`KEEP_CURRENT` result is successful. Retained provider/output
341
+ failures produce `PARTIAL` and exit 2.
342
+
343
+ Use strict mode when CI should fail on review-required or insufficient-data results:
344
+
345
+ ```sh
346
+ depverdict analyze . --fail-on-incomplete
347
+ ```
348
+
349
+ ## Offline research
350
+
351
+ Use fresh repository-local cache entries and prevent registry/evidence research
352
+ requests:
353
+
354
+ ```sh
355
+ depverdict analyze . --offline
356
+ ```
357
+
358
+ Offline research can use repository dependency/source facts, fresh knowledge-cache
359
+ entries, and validated persisted artifacts. It does not fabricate evidence,
360
+ confidence, or a target when external evidence is unavailable. The result retains
361
+ limitations and may be `INSUFFICIENT_DATA` or `COMPLETED_WITH_REVIEW`, depending on
362
+ the canonical facts.
363
+
364
+ `--offline` is not equivalent to the online workflow: it prevents registry and
365
+ evidence-source requests, but Version Analysis can still require a configured or
366
+ injected AI runtime. Expired, missing, corrupted, or identity-mismatched cache
367
+ entries are not treated as fresh evidence.
368
+
369
+ ## Generated artifacts
370
+
371
+ The unified `analyze` workflow writes these validated artifacts:
372
+
373
+ | Artifact | Purpose |
374
+ | --- | --- |
375
+ | `.depverdict/project-manifest.json` | Projects, dependency occurrences, declarations, and installed-version facts. |
376
+ | `.depverdict/knowledge-manifest.json` | Researched package, release, source, warning, and target-candidate metadata. |
377
+ | `.depverdict/knowledge-evidence-bundle.json` | Portable evidence records consumed by Version Analysis. |
378
+ | `.depverdict/version-analysis.json` | Per-occurrence version findings, evidence references, confidence, and limitations. |
379
+ | `.depverdict/usage-index.json` | Supported source usage plus project-level analyzer coverage. |
380
+ | `.depverdict/repository-impact.json` | Coverage-aware dependency and finding impact classifications. |
381
+ | `.depverdict/repository-impact-evidence.json` | Exact positive usage matches and impact evidence. |
382
+ | `.depverdict/upgrade-decision.json` | Deterministic per-occurrence decision records and reason codes. |
383
+ | `.depverdict/migration-checklist.json` | Optional experimental migration handoff, created only with the Checklist flag. |
384
+ | `.depverdict/repository-impact.md` | Human-readable assessment, decision summary, and next steps. |
385
+
386
+ The qualification record is an input to the optional Checklist stage; `analyze` does
387
+ not generate it.
388
+
389
+ Individual `discover`, `research`, and `analyze-version` commands are also available
390
+ for staged workflows. Run `depverdict --help` for their exact options.
391
+
392
+ ## Supported scope and limitations
393
+
394
+ Support is layered. A detector existing for an ecosystem does not imply that every
395
+ downstream analyzer or resolver supports it.
396
+
397
+ | Layer | Current production scope |
398
+ | --- | --- |
399
+ | Project/dependency discovery | Node `package.json` projects and workspaces; Python `requirements.txt`. |
400
+ | Knowledge research | npm and PyPI registry adapters plus bounded evidence-source enrichment. |
401
+ | Installed-version baseline | npm `package-lock.json` v2/v3; limited v1 root-project compatibility. |
402
+ | Version comparison | Node SemVer and a bounded Python PEP 440 subset. |
403
+ | Source usage analysis | Node JavaScript/TypeScript files: `.cjs`, `.cts`, `.js`, `.jsx`, `.mjs`, `.mts`, `.ts`, `.tsx`. |
404
+ | Verification-command extraction | Safe `build`, `check`, `lint`, `test`, and `typecheck` scripts from Node `package.json`; commands are not executed. |
405
+
406
+ Important `0.6.0-alpha.1` limitations:
407
+
408
+ - pnpm and Yarn lockfiles do not currently resolve installed-version baselines.
409
+ - Python installed versions are not resolved from an environment or lockfile.
410
+ - npm lockfile v1 resolution is limited to root projects; workspace/member resolution
411
+ is fail-closed.
412
+ - JavaScript/TypeScript is the only source usage analyzer. Python and experimental
413
+ ecosystem detections therefore have unavailable source coverage.
414
+ - Partial or unavailable coverage cannot establish that an API is unused or an
415
+ upgrade is safe.
416
+ - Unsupported ecosystems, declarations, or version formats require manual
417
+ investigation.
418
+ - Recovery and rollback plans are not synthesized.
419
+ - Verification commands are suggested from project metadata but never executed.
420
+ - DepVerdict does not modify manifests, install packages, patch code, or run a
421
+ migration.
422
+ - Migration Checklist v2 remains experimental and opt-in.
423
+
424
+ Early discovery exists for `pyproject.toml`, Maven/Gradle, .NET, Go, Rust, Ruby, PHP,
425
+ and Business Central AL projects. Detection does not imply supported dependency
426
+ parsing, installed baselines, source analysis, upgrade decisions, or migration
427
+ handoffs for those ecosystems.
428
+
429
+ ## Human in the loop
430
+
431
+ DepVerdict creates an assessment and a bounded handoff. The developer or team must:
432
+
433
+ 1. Review target identity, evidence, risk, coverage, and affected areas.
434
+ 2. Resolve investigation questions and choose or approve the target.
435
+ 3. Approve each migration action and decide whether work should proceed.
436
+ 4. Re-open target files before patching to detect snapshot drift.
437
+ 5. Run and assess verification and define recovery or rollback steps.
438
+
439
+ A Coding Agent may consume the handoff for bounded execution planning, but it must
440
+ inspect the current source before proposing a patch. No artifact is authorization to
441
+ change code, proof of migration completion, or a safety certification.
442
+
443
+ ## JavaScript API
444
+
445
+ The package exposes its public API from the root entry point:
446
+
447
+ ```js
448
+ import { discoverProject } from '@thomasminh1995/depverdict';
449
+
450
+ const manifest = await discoverProject('.');
451
+ ```
452
+
453
+ The CLI is the primary product workflow. Programmatic callers are responsible for
454
+ providing the same runtime configuration and preserving artifact/qualification trust
455
+ boundaries.
456
+
457
+ ## Development and validation
458
+
459
+ ```sh
460
+ npm ci
461
+ npm test
462
+ npm run check
463
+ npm run check:package
464
+ ```
465
+
466
+ Design and contract references:
467
+
468
+ - [Current architecture overview](docs/architecture-overview.md)
469
+ - [Project Manifest](docs/MVP-01.md)
470
+ - [Knowledge Manifest](docs/MVP-02-Knowledge-Manifest.md)
471
+ - [Version Analysis architecture](docs/version-analysis-architecture.md)
472
+ - [Repository impact analysis](docs/IA-02-Repository-Impact-Analysis.md)
473
+ - [Deterministic Upgrade Decision](docs/mp-r03-deterministic-upgrade-decision-architecture.md)
474
+ - [Migration Checklist v2 contract](docs/mvp-05-migration-checklist-contract.md)
475
+ - [Product completion and decision-first CLI](docs/mp-r05-product-completion-and-decision-first-cli-architecture.md)
476
+ - [CLI progress contract](docs/cli-progress.md)
477
+ - [UpgradeLens-to-DepVerdict migration guide](docs/migrations/upgradelens-to-depverdict.md)
478
+
479
+ ## Roadmap
480
+
481
+ Completed product layers:
482
+
483
+ - ✓ MVP-01 — deterministic project discovery
484
+ - ✓ MVP-02 — knowledge and evidence research
485
+ - ✓ MVP-03 — AI-assisted version analysis
486
+ - ✓ MVP-04 — repository usage and impact analysis
487
+ - ✓ MVP-05 — evidence-bounded migration planning
488
+
489
+ Potential follow-ups, not current supported features:
490
+
491
+ - broader installed-version resolvers and source analyzers;
492
+ - structured security, end-of-support, and organization-policy drivers;
493
+ - recovery and rollback evidence;
494
+ - reviewed CI verification execution;
495
+ - broader model/provider evaluation and offline knowledge support;
496
+ - IDE or MCP integrations.
497
+
498
+ ## Community
499
+
500
+ - [Contributing](CONTRIBUTING.md)
501
+ - [Security](SECURITY.md)
502
+ - [Support](SUPPORT.md)
503
+ - [Code of Conduct](CODE_OF_CONDUCT.md)
504
+
505
+ ### Technical Preview feedback
506
+
507
+ When reporting feedback, tell us whether decisions are understandable and
508
+ actionable; whether `INVESTIGATE` is too frequent or too rare; whether installed
509
+ baselines and ambiguity selectors work in real npm workspaces; whether coverage
510
+ limitations prevent false confidence; whether the migration handoff reduces
511
+ re-research; whether completion states and exit codes work in CI; and which
512
+ artifacts help code review or team planning. Use the feature or bug form described
513
+ in [Support](SUPPORT.md), and never include credentials, private source, or raw
514
+ provider payloads.
515
+
516
+ ## License
517
+
518
+ [MIT](LICENSE)
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runCli } from '../src/cli.js';
4
+
5
+ process.exitCode = await runCli(process.argv.slice(2), {
6
+ invocationName: 'depverdict'
7
+ });
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runCli } from '../src/cli.js';
4
+
5
+ process.exitCode = await runCli(process.argv.slice(2), {
6
+ invocationName: 'upgradelens'
7
+ });