projscan 4.3.1 → 4.5.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 (699) hide show
  1. package/CONTRIBUTING.md +5 -1
  2. package/PRIVACY.md +1 -0
  3. package/README.md +278 -231
  4. package/THIRD-PARTY-NOTICES.md +31 -31
  5. package/dist/analyzers/architectureCheck.js.map +1 -1
  6. package/dist/analyzers/crossPackageImportCheck.js +3 -2
  7. package/dist/analyzers/crossPackageImportCheck.js.map +1 -1
  8. package/dist/analyzers/deadCodeCheck.js +10 -2
  9. package/dist/analyzers/deadCodeCheck.js.map +1 -1
  10. package/dist/analyzers/dependencyRiskCheck.js +1 -5
  11. package/dist/analyzers/dependencyRiskCheck.js.map +1 -1
  12. package/dist/analyzers/eslintCheck.js +3 -1
  13. package/dist/analyzers/eslintCheck.js.map +1 -1
  14. package/dist/analyzers/prettierCheck.js +16 -3
  15. package/dist/analyzers/prettierCheck.js.map +1 -1
  16. package/dist/analyzers/pythonDependencyRiskCheck.js +4 -17
  17. package/dist/analyzers/pythonDependencyRiskCheck.js.map +1 -1
  18. package/dist/analyzers/pythonLinterCheck.js +2 -12
  19. package/dist/analyzers/pythonLinterCheck.js.map +1 -1
  20. package/dist/analyzers/securityCheck.js +26 -9
  21. package/dist/analyzers/securityCheck.js.map +1 -1
  22. package/dist/analyzers/supplyChainCheck.js +6 -2
  23. package/dist/analyzers/supplyChainCheck.js.map +1 -1
  24. package/dist/analyzers/testCheck.js +10 -1
  25. package/dist/analyzers/testCheck.js.map +1 -1
  26. package/dist/analyzers/unusedDependencyCheck.js +8 -8
  27. package/dist/analyzers/unusedDependencyCheck.js.map +1 -1
  28. package/dist/cli/_shared.d.ts +2 -1
  29. package/dist/cli/_shared.js +14 -2
  30. package/dist/cli/_shared.js.map +1 -1
  31. package/dist/cli/commands/agentBrief.js +7 -1
  32. package/dist/cli/commands/agentBrief.js.map +1 -1
  33. package/dist/cli/commands/analyze.js +12 -2
  34. package/dist/cli/commands/analyze.js.map +1 -1
  35. package/dist/cli/commands/applyFix.js +1 -1
  36. package/dist/cli/commands/applyFix.js.map +1 -1
  37. package/dist/cli/commands/audit.js +4 -2
  38. package/dist/cli/commands/audit.js.map +1 -1
  39. package/dist/cli/commands/badge.js.map +1 -1
  40. package/dist/cli/commands/bugHunt.js +2 -2
  41. package/dist/cli/commands/bugHunt.js.map +1 -1
  42. package/dist/cli/commands/ci.js +11 -0
  43. package/dist/cli/commands/ci.js.map +1 -1
  44. package/dist/cli/commands/claim.js +3 -3
  45. package/dist/cli/commands/claim.js.map +1 -1
  46. package/dist/cli/commands/collision.js +4 -2
  47. package/dist/cli/commands/collision.js.map +1 -1
  48. package/dist/cli/commands/coordinate.js +4 -2
  49. package/dist/cli/commands/coordinate.js.map +1 -1
  50. package/dist/cli/commands/coupling.js.map +1 -1
  51. package/dist/cli/commands/coverage.js.map +1 -1
  52. package/dist/cli/commands/dataflow.js.map +1 -1
  53. package/dist/cli/commands/dependencies.js +1 -1
  54. package/dist/cli/commands/dependencies.js.map +1 -1
  55. package/dist/cli/commands/diff.js.map +1 -1
  56. package/dist/cli/commands/doctor.js +11 -0
  57. package/dist/cli/commands/doctor.js.map +1 -1
  58. package/dist/cli/commands/dogfood.js +30 -5
  59. package/dist/cli/commands/dogfood.js.map +1 -1
  60. package/dist/cli/commands/evidencePack.js.map +1 -1
  61. package/dist/cli/commands/explainIssue.js +1 -1
  62. package/dist/cli/commands/explainIssue.js.map +1 -1
  63. package/dist/cli/commands/feedback.js +19 -5
  64. package/dist/cli/commands/feedback.js.map +1 -1
  65. package/dist/cli/commands/file.js +1 -1
  66. package/dist/cli/commands/file.js.map +1 -1
  67. package/dist/cli/commands/fix.js.map +1 -1
  68. package/dist/cli/commands/fixSuggest.js +12 -4
  69. package/dist/cli/commands/fixSuggest.js.map +1 -1
  70. package/dist/cli/commands/hotspots.js.map +1 -1
  71. package/dist/cli/commands/impact.js +1 -1
  72. package/dist/cli/commands/impact.js.map +1 -1
  73. package/dist/cli/commands/init.js +13 -5
  74. package/dist/cli/commands/init.js.map +1 -1
  75. package/dist/cli/commands/installHook.js +2 -2
  76. package/dist/cli/commands/installHook.js.map +1 -1
  77. package/dist/cli/commands/mcp.js.map +1 -1
  78. package/dist/cli/commands/memory.js +5 -2
  79. package/dist/cli/commands/memory.js.map +1 -1
  80. package/dist/cli/commands/mergeRisk.js +1 -1
  81. package/dist/cli/commands/mergeRisk.js.map +1 -1
  82. package/dist/cli/commands/missionProof.js +13 -12
  83. package/dist/cli/commands/missionProof.js.map +1 -1
  84. package/dist/cli/commands/outdated.js +1 -1
  85. package/dist/cli/commands/outdated.js.map +1 -1
  86. package/dist/cli/commands/plugin.js +10 -6
  87. package/dist/cli/commands/plugin.js.map +1 -1
  88. package/dist/cli/commands/prDiff.js +1 -1
  89. package/dist/cli/commands/prDiff.js.map +1 -1
  90. package/dist/cli/commands/preflight.js +1 -5
  91. package/dist/cli/commands/preflight.js.map +1 -1
  92. package/dist/cli/commands/privacyCheck.js +3 -1
  93. package/dist/cli/commands/privacyCheck.js.map +1 -1
  94. package/dist/cli/commands/qualityScorecard.js.map +1 -1
  95. package/dist/cli/commands/recipes.js.map +1 -1
  96. package/dist/cli/commands/regressionPlan.js.map +1 -1
  97. package/dist/cli/commands/releaseTrain.js.map +1 -1
  98. package/dist/cli/commands/review.js +1 -1
  99. package/dist/cli/commands/review.js.map +1 -1
  100. package/dist/cli/commands/route.js.map +1 -1
  101. package/dist/cli/commands/search.js +5 -2
  102. package/dist/cli/commands/search.js.map +1 -1
  103. package/dist/cli/commands/semanticGraph.js.map +1 -1
  104. package/dist/cli/commands/session.js +2 -2
  105. package/dist/cli/commands/session.js.map +1 -1
  106. package/dist/cli/commands/start.js +3 -1177
  107. package/dist/cli/commands/start.js.map +1 -1
  108. package/dist/cli/commands/startAction.d.ts +36 -0
  109. package/dist/cli/commands/startAction.js +70 -0
  110. package/dist/cli/commands/startAction.js.map +1 -0
  111. package/dist/cli/commands/startConsole.d.ts +7 -0
  112. package/dist/cli/commands/startConsole.js +309 -0
  113. package/dist/cli/commands/startConsole.js.map +1 -0
  114. package/dist/cli/commands/startMissionBundle.d.ts +41 -0
  115. package/dist/cli/commands/startMissionBundle.js +645 -0
  116. package/dist/cli/commands/startMissionBundle.js.map +1 -0
  117. package/dist/cli/commands/startOutput.d.ts +31 -0
  118. package/dist/cli/commands/startOutput.js +232 -0
  119. package/dist/cli/commands/startOutput.js.map +1 -0
  120. package/dist/cli/commands/startShortcuts.d.ts +26 -0
  121. package/dist/cli/commands/startShortcuts.js +117 -0
  122. package/dist/cli/commands/startShortcuts.js.map +1 -0
  123. package/dist/cli/commands/telemetry.js +2 -1
  124. package/dist/cli/commands/telemetry.js.map +1 -1
  125. package/dist/cli/commands/trial.js +19 -4
  126. package/dist/cli/commands/trial.js.map +1 -1
  127. package/dist/cli/commands/understand.js +3 -1
  128. package/dist/cli/commands/understand.js.map +1 -1
  129. package/dist/cli/commands/upgrade.js +1 -1
  130. package/dist/cli/commands/upgrade.js.map +1 -1
  131. package/dist/cli/commands/watch.js +1 -1
  132. package/dist/cli/commands/watch.js.map +1 -1
  133. package/dist/cli/commands/workplan.js.map +1 -1
  134. package/dist/cli/commands/workspace.js +1 -1
  135. package/dist/cli/commands/workspace.js.map +1 -1
  136. package/dist/cli/commands/workspaces.js +1 -1
  137. package/dist/cli/commands/workspaces.js.map +1 -1
  138. package/dist/cli/index.js +2 -117
  139. package/dist/cli/index.js.map +1 -1
  140. package/dist/cli/registerCommands.d.ts +4 -0
  141. package/dist/cli/registerCommands.js +125 -0
  142. package/dist/cli/registerCommands.js.map +1 -0
  143. package/dist/core/adoption.d.ts +2 -1
  144. package/dist/core/adoption.js +40 -13
  145. package/dist/core/adoption.js.map +1 -1
  146. package/dist/core/agentBrief.js +19 -6
  147. package/dist/core/agentBrief.js.map +1 -1
  148. package/dist/core/applyFix.js.map +1 -1
  149. package/dist/core/ast.d.ts +5 -0
  150. package/dist/core/ast.js +38 -20
  151. package/dist/core/ast.js.map +1 -1
  152. package/dist/core/auditRunner.js.map +1 -1
  153. package/dist/core/bugHunt.js +119 -17
  154. package/dist/core/bugHunt.js.map +1 -1
  155. package/dist/core/claims.js +5 -2
  156. package/dist/core/claims.js.map +1 -1
  157. package/dist/core/codeGraph.js +10 -0
  158. package/dist/core/codeGraph.js.map +1 -1
  159. package/dist/core/codeGraphReexports.d.ts +9 -0
  160. package/dist/core/codeGraphReexports.js +59 -0
  161. package/dist/core/codeGraphReexports.js.map +1 -0
  162. package/dist/core/collisionDetector.js +14 -4
  163. package/dist/core/collisionDetector.js.map +1 -1
  164. package/dist/core/coordination.js +4 -6
  165. package/dist/core/coordination.js.map +1 -1
  166. package/dist/core/couplingAnalyzer.d.ts +2 -1
  167. package/dist/core/couplingAnalyzer.js.map +1 -1
  168. package/dist/core/coverageParser.js.map +1 -1
  169. package/dist/core/dataflow.js +13 -3
  170. package/dist/core/dataflow.js.map +1 -1
  171. package/dist/core/dataflowFilters.js +8 -3
  172. package/dist/core/dataflowFilters.js.map +1 -1
  173. package/dist/core/dependencyAnalyzer.js +4 -1
  174. package/dist/core/dependencyAnalyzer.js.map +1 -1
  175. package/dist/core/dogfood.d.ts +1 -1
  176. package/dist/core/dogfood.js +39 -5
  177. package/dist/core/dogfood.js.map +1 -1
  178. package/dist/core/embeddings.js.map +1 -1
  179. package/dist/core/evidenceComment.js +34 -12
  180. package/dist/core/evidenceComment.js.map +1 -1
  181. package/dist/core/explainIssue.js +1 -2
  182. package/dist/core/explainIssue.js.map +1 -1
  183. package/dist/core/feedback.d.ts +1 -1
  184. package/dist/core/feedback.js +15 -4
  185. package/dist/core/feedback.js.map +1 -1
  186. package/dist/core/fileInspector.js +8 -2
  187. package/dist/core/fileInspector.js.map +1 -1
  188. package/dist/core/fixFirst.d.ts +3 -1
  189. package/dist/core/fixFirst.js +17 -4
  190. package/dist/core/fixFirst.js.map +1 -1
  191. package/dist/core/fixSuggest.js +20 -12
  192. package/dist/core/fixSuggest.js.map +1 -1
  193. package/dist/core/frameworkDetector.js +5 -3
  194. package/dist/core/frameworkDetector.js.map +1 -1
  195. package/dist/core/frameworkSources.d.ts +1 -1
  196. package/dist/core/frameworkSources.js +114 -4
  197. package/dist/core/frameworkSources.js.map +1 -1
  198. package/dist/core/graphCorpus.d.ts +1 -1
  199. package/dist/core/graphCorpus.js +9 -1
  200. package/dist/core/graphCorpus.js.map +1 -1
  201. package/dist/core/graphQuery.js.map +1 -1
  202. package/dist/core/hotspotAnalyzer.js +26 -6
  203. package/dist/core/hotspotAnalyzer.js.map +1 -1
  204. package/dist/core/impact.d.ts +1 -1
  205. package/dist/core/impact.js.map +1 -1
  206. package/dist/core/importGraph.js.map +1 -1
  207. package/dist/core/indexCache.js +2 -1
  208. package/dist/core/indexCache.js.map +1 -1
  209. package/dist/core/intent.d.ts +1 -1
  210. package/dist/core/intent.js +143 -46
  211. package/dist/core/intent.js.map +1 -1
  212. package/dist/core/intentRouter.js +5467 -445
  213. package/dist/core/intentRouter.js.map +1 -1
  214. package/dist/core/issueEngine.js +1 -1
  215. package/dist/core/issueEngine.js.map +1 -1
  216. package/dist/core/languageDetector.js +1 -9
  217. package/dist/core/languageDetector.js.map +1 -1
  218. package/dist/core/languages/cppAdapter.js +3 -1
  219. package/dist/core/languages/cppAdapter.js.map +1 -1
  220. package/dist/core/languages/cppExports.js +6 -1
  221. package/dist/core/languages/cppExports.js.map +1 -1
  222. package/dist/core/languages/cppFunctions.js +3 -1
  223. package/dist/core/languages/cppFunctions.js.map +1 -1
  224. package/dist/core/languages/csharpAdapter.js.map +1 -1
  225. package/dist/core/languages/csharpFunctions.js +3 -1
  226. package/dist/core/languages/csharpFunctions.js.map +1 -1
  227. package/dist/core/languages/csharpImports.js +2 -1
  228. package/dist/core/languages/csharpImports.js.map +1 -1
  229. package/dist/core/languages/goAdapter.js.map +1 -1
  230. package/dist/core/languages/goExports.js.map +1 -1
  231. package/dist/core/languages/goFunctions.js +9 -3
  232. package/dist/core/languages/goFunctions.js.map +1 -1
  233. package/dist/core/languages/javaAdapter.js +1 -2
  234. package/dist/core/languages/javaAdapter.js.map +1 -1
  235. package/dist/core/languages/javaFunctions.js +6 -2
  236. package/dist/core/languages/javaFunctions.js.map +1 -1
  237. package/dist/core/languages/javascriptAdapter.js +43 -8
  238. package/dist/core/languages/javascriptAdapter.js.map +1 -1
  239. package/dist/core/languages/kotlinAdapter.js +5 -2
  240. package/dist/core/languages/kotlinAdapter.js.map +1 -1
  241. package/dist/core/languages/kotlinFunctions.js +5 -6
  242. package/dist/core/languages/kotlinFunctions.js.map +1 -1
  243. package/dist/core/languages/kotlinImports.js +3 -1
  244. package/dist/core/languages/kotlinImports.js.map +1 -1
  245. package/dist/core/languages/kotlinManifests.js +7 -1
  246. package/dist/core/languages/kotlinManifests.js.map +1 -1
  247. package/dist/core/languages/phpAdapter.js +4 -1
  248. package/dist/core/languages/phpAdapter.js.map +1 -1
  249. package/dist/core/languages/phpExports.js.map +1 -1
  250. package/dist/core/languages/phpFunctions.js +18 -6
  251. package/dist/core/languages/phpFunctions.js.map +1 -1
  252. package/dist/core/languages/phpManifests.js.map +1 -1
  253. package/dist/core/languages/pythonAdapter.js.map +1 -1
  254. package/dist/core/languages/pythonFunctions.js +9 -3
  255. package/dist/core/languages/pythonFunctions.js.map +1 -1
  256. package/dist/core/languages/pythonManifests.d.ts +11 -0
  257. package/dist/core/languages/pythonManifests.js +34 -19
  258. package/dist/core/languages/pythonManifests.js.map +1 -1
  259. package/dist/core/languages/rubyAdapter.js.map +1 -1
  260. package/dist/core/languages/rubyFunctions.js +6 -2
  261. package/dist/core/languages/rubyFunctions.js.map +1 -1
  262. package/dist/core/languages/rustAdapter.js.map +1 -1
  263. package/dist/core/languages/rustFunctions.js +6 -2
  264. package/dist/core/languages/rustFunctions.js.map +1 -1
  265. package/dist/core/languages/swiftAdapter.js +3 -1
  266. package/dist/core/languages/swiftAdapter.js.map +1 -1
  267. package/dist/core/languages/swiftCyclomatic.js.map +1 -1
  268. package/dist/core/languages/swiftFunctions.js +3 -1
  269. package/dist/core/languages/swiftFunctions.js.map +1 -1
  270. package/dist/core/languages/swiftImports.js.map +1 -1
  271. package/dist/core/mergeRisk.js +5 -1
  272. package/dist/core/mergeRisk.js.map +1 -1
  273. package/dist/core/missionOutcome.d.ts +1 -1
  274. package/dist/core/missionOutcome.js +9 -4
  275. package/dist/core/missionOutcome.js.map +1 -1
  276. package/dist/core/missionProof.d.ts +1 -1
  277. package/dist/core/missionProof.js +8 -6
  278. package/dist/core/missionProof.js.map +1 -1
  279. package/dist/core/missionProofBaseline.d.ts +1 -1
  280. package/dist/core/missionProofBaseline.js +8 -2
  281. package/dist/core/missionProofBaseline.js.map +1 -1
  282. package/dist/core/missionProofMarkdown.d.ts +1 -1
  283. package/dist/core/missionProofMarkdown.js +4 -1
  284. package/dist/core/missionProofMarkdown.js.map +1 -1
  285. package/dist/core/missionProofSummary.d.ts +1 -1
  286. package/dist/core/monorepo.d.ts +1 -1
  287. package/dist/core/monorepo.js +4 -2
  288. package/dist/core/monorepo.js.map +1 -1
  289. package/dist/core/onboarding.d.ts +2 -1
  290. package/dist/core/onboarding.js.map +1 -1
  291. package/dist/core/outdatedDetector.js +5 -1
  292. package/dist/core/outdatedDetector.js.map +1 -1
  293. package/dist/core/ownership.js +3 -1
  294. package/dist/core/ownership.js.map +1 -1
  295. package/dist/core/pathClassifiers.js.map +1 -1
  296. package/dist/core/pluginDx.js +2 -1
  297. package/dist/core/pluginDx.js.map +1 -1
  298. package/dist/core/pluginTrust.js +1 -3
  299. package/dist/core/pluginTrust.js.map +1 -1
  300. package/dist/core/plugins.js +5 -5
  301. package/dist/core/plugins.js.map +1 -1
  302. package/dist/core/prDiff.d.ts +1 -2
  303. package/dist/core/prDiff.js +5 -1
  304. package/dist/core/prDiff.js.map +1 -1
  305. package/dist/core/preflight.js +15 -6
  306. package/dist/core/preflight.js.map +1 -1
  307. package/dist/core/privacy.js.map +1 -1
  308. package/dist/core/qualityScorecard.d.ts +1 -1
  309. package/dist/core/qualityScorecard.js +43 -11
  310. package/dist/core/qualityScorecard.js.map +1 -1
  311. package/dist/core/regressionPlan.js +25 -7
  312. package/dist/core/regressionPlan.js.map +1 -1
  313. package/dist/core/releaseEvidence.js +41 -17
  314. package/dist/core/releaseEvidence.js.map +1 -1
  315. package/dist/core/releaseTrain.js +66 -38
  316. package/dist/core/releaseTrain.js.map +1 -1
  317. package/dist/core/reportScope.d.ts +17 -0
  318. package/dist/core/reportScope.js +143 -0
  319. package/dist/core/reportScope.js.map +1 -0
  320. package/dist/core/repositoryScanner.js +1 -3
  321. package/dist/core/repositoryScanner.js.map +1 -1
  322. package/dist/core/review.d.ts +1 -1
  323. package/dist/core/review.js +72 -10
  324. package/dist/core/review.js.map +1 -1
  325. package/dist/core/reviewDataflow.js +7 -1
  326. package/dist/core/reviewDataflow.js.map +1 -1
  327. package/dist/core/reviewPublicSurface.d.ts +13 -0
  328. package/dist/core/reviewPublicSurface.js +134 -0
  329. package/dist/core/reviewPublicSurface.js.map +1 -0
  330. package/dist/core/roadmapCatalog.d.ts +1 -0
  331. package/dist/core/roadmapCatalog.js +349 -30
  332. package/dist/core/roadmapCatalog.js.map +1 -1
  333. package/dist/core/searchIndex.js +124 -17
  334. package/dist/core/searchIndex.js.map +1 -1
  335. package/dist/core/semanticGraph.js.map +1 -1
  336. package/dist/core/semanticSearch.js +20 -4
  337. package/dist/core/semanticSearch.js.map +1 -1
  338. package/dist/core/session.js +1 -2
  339. package/dist/core/session.js.map +1 -1
  340. package/dist/core/sessionResources.js +6 -2
  341. package/dist/core/sessionResources.js.map +1 -1
  342. package/dist/core/start.d.ts +3 -9
  343. package/dist/core/start.js +23 -3237
  344. package/dist/core/start.js.map +1 -1
  345. package/dist/core/startAdoptionLoop.d.ts +2 -0
  346. package/dist/core/startAdoptionLoop.js +41 -0
  347. package/dist/core/startAdoptionLoop.js.map +1 -0
  348. package/dist/core/startEvidence.d.ts +5 -0
  349. package/dist/core/startEvidence.js +62 -0
  350. package/dist/core/startEvidence.js.map +1 -0
  351. package/dist/core/startExecutionPlan.d.ts +16 -0
  352. package/dist/core/startExecutionPlan.js +185 -0
  353. package/dist/core/startExecutionPlan.js.map +1 -0
  354. package/dist/core/startHarness.d.ts +3 -0
  355. package/dist/core/startHarness.js +47 -0
  356. package/dist/core/startHarness.js.map +1 -0
  357. package/dist/core/startIntentTargets.d.ts +24 -0
  358. package/dist/core/startIntentTargets.js +1106 -0
  359. package/dist/core/startIntentTargets.js.map +1 -0
  360. package/dist/core/startMissionControl.d.ts +16 -0
  361. package/dist/core/startMissionControl.js +145 -0
  362. package/dist/core/startMissionControl.js.map +1 -0
  363. package/dist/core/startMissionPolicy.d.ts +19 -0
  364. package/dist/core/startMissionPolicy.js +246 -0
  365. package/dist/core/startMissionPolicy.js.map +1 -0
  366. package/dist/core/startMode.d.ts +11 -0
  367. package/dist/core/startMode.js +139 -0
  368. package/dist/core/startMode.js.map +1 -0
  369. package/dist/core/startNextActions.d.ts +13 -0
  370. package/dist/core/startNextActions.js +19 -0
  371. package/dist/core/startNextActions.js.map +1 -0
  372. package/dist/core/startOptions.d.ts +18 -0
  373. package/dist/core/startOptions.js +29 -0
  374. package/dist/core/startOptions.js.map +1 -0
  375. package/dist/core/startResume.d.ts +7 -0
  376. package/dist/core/startResume.js +468 -0
  377. package/dist/core/startResume.js.map +1 -0
  378. package/dist/core/startReviewGate.d.ts +11 -0
  379. package/dist/core/startReviewGate.js +200 -0
  380. package/dist/core/startReviewGate.js.map +1 -0
  381. package/dist/core/startRouteActions.d.ts +7 -0
  382. package/dist/core/startRouteActions.js +497 -0
  383. package/dist/core/startRouteActions.js.map +1 -0
  384. package/dist/core/startRunbook.d.ts +24 -0
  385. package/dist/core/startRunbook.js +271 -0
  386. package/dist/core/startRunbook.js.map +1 -0
  387. package/dist/core/startSuccessCriteria.d.ts +14 -0
  388. package/dist/core/startSuccessCriteria.js +497 -0
  389. package/dist/core/startSuccessCriteria.js.map +1 -0
  390. package/dist/core/taint.js +22 -12
  391. package/dist/core/taint.js.map +1 -1
  392. package/dist/core/telemetry.js +19 -5
  393. package/dist/core/telemetry.js.map +1 -1
  394. package/dist/core/trial.d.ts +1 -1
  395. package/dist/core/trial.js +15 -6
  396. package/dist/core/trial.js.map +1 -1
  397. package/dist/core/understand.d.ts +1 -1
  398. package/dist/core/understand.js +165 -51
  399. package/dist/core/understand.js.map +1 -1
  400. package/dist/core/upgradePreview.js +73 -1
  401. package/dist/core/upgradePreview.js.map +1 -1
  402. package/dist/core/watcher.js +18 -3
  403. package/dist/core/watcher.js.map +1 -1
  404. package/dist/core/workplan.js +87 -17
  405. package/dist/core/workplan.js.map +1 -1
  406. package/dist/core/workspace.js.map +1 -1
  407. package/dist/index.d.ts +9 -9
  408. package/dist/index.js +7 -7
  409. package/dist/index.js.map +1 -1
  410. package/dist/mcp/pagination.js.map +1 -1
  411. package/dist/mcp/prompts.js +28 -20
  412. package/dist/mcp/prompts.js.map +1 -1
  413. package/dist/mcp/server.js +6 -74
  414. package/dist/mcp/server.js.map +1 -1
  415. package/dist/mcp/serverPayload.d.ts +13 -0
  416. package/dist/mcp/serverPayload.js +61 -0
  417. package/dist/mcp/serverPayload.js.map +1 -0
  418. package/dist/mcp/tokenBudget.js.map +1 -1
  419. package/dist/mcp/tools/_shared.js.map +1 -1
  420. package/dist/mcp/tools/agentBrief.js +7 -1
  421. package/dist/mcp/tools/agentBrief.js.map +1 -1
  422. package/dist/mcp/tools/applyFix.js +1 -1
  423. package/dist/mcp/tools/applyFix.js.map +1 -1
  424. package/dist/mcp/tools/audit.js.map +1 -1
  425. package/dist/mcp/tools/bugHunt.js +2 -2
  426. package/dist/mcp/tools/bugHunt.js.map +1 -1
  427. package/dist/mcp/tools/claim.js +8 -3
  428. package/dist/mcp/tools/claim.js.map +1 -1
  429. package/dist/mcp/tools/collision.js +3 -1
  430. package/dist/mcp/tools/collision.js.map +1 -1
  431. package/dist/mcp/tools/coordinate.js.map +1 -1
  432. package/dist/mcp/tools/coordinateWatch.js +5 -2
  433. package/dist/mcp/tools/coordinateWatch.js.map +1 -1
  434. package/dist/mcp/tools/costSummary.js.map +1 -1
  435. package/dist/mcp/tools/coupling.js.map +1 -1
  436. package/dist/mcp/tools/coverage.js.map +1 -1
  437. package/dist/mcp/tools/dataflow.js.map +1 -1
  438. package/dist/mcp/tools/dependencies.js +4 -1
  439. package/dist/mcp/tools/dependencies.js.map +1 -1
  440. package/dist/mcp/tools/doctor.js.map +1 -1
  441. package/dist/mcp/tools/explainIssue.js +4 -1
  442. package/dist/mcp/tools/explainIssue.js.map +1 -1
  443. package/dist/mcp/tools/fixSuggest.js +5 -2
  444. package/dist/mcp/tools/fixSuggest.js.map +1 -1
  445. package/dist/mcp/tools/hotspots.js +4 -1
  446. package/dist/mcp/tools/hotspots.js.map +1 -1
  447. package/dist/mcp/tools/impact.js +10 -3
  448. package/dist/mcp/tools/impact.js.map +1 -1
  449. package/dist/mcp/tools/mergeRisk.js.map +1 -1
  450. package/dist/mcp/tools/plugin.js +6 -1
  451. package/dist/mcp/tools/plugin.js.map +1 -1
  452. package/dist/mcp/tools/prDiff.js.map +1 -1
  453. package/dist/mcp/tools/preflight.js +1 -5
  454. package/dist/mcp/tools/preflight.js.map +1 -1
  455. package/dist/mcp/tools/review.js.map +1 -1
  456. package/dist/mcp/tools/reviewWatch.d.ts +1 -1
  457. package/dist/mcp/tools/reviewWatch.js +9 -9
  458. package/dist/mcp/tools/reviewWatch.js.map +1 -1
  459. package/dist/mcp/tools/route.js +1 -1
  460. package/dist/mcp/tools/route.js.map +1 -1
  461. package/dist/mcp/tools/search.js.map +1 -1
  462. package/dist/mcp/tools/semanticGraph.js +8 -2
  463. package/dist/mcp/tools/semanticGraph.js.map +1 -1
  464. package/dist/mcp/tools/start.js.map +1 -1
  465. package/dist/mcp/tools/structure.js +7 -1
  466. package/dist/mcp/tools/structure.js.map +1 -1
  467. package/dist/mcp/tools/understand.js.map +1 -1
  468. package/dist/mcp/tools/upgrade.d.ts +1 -1
  469. package/dist/mcp/tools/upgrade.js +2 -16
  470. package/dist/mcp/tools/upgrade.js.map +1 -1
  471. package/dist/mcp/tools/workspaceGraph.js +10 -1
  472. package/dist/mcp/tools/workspaceGraph.js.map +1 -1
  473. package/dist/mcp/tools.js +3 -1
  474. package/dist/mcp/tools.js.map +1 -1
  475. package/dist/projscan-sbom.cdx.json +2136 -904
  476. package/dist/reporters/consoleAnalysisReporter.d.ts +2 -0
  477. package/dist/reporters/consoleAnalysisReporter.js +89 -0
  478. package/dist/reporters/consoleAnalysisReporter.js.map +1 -0
  479. package/dist/reporters/consoleArchitectureReporter.d.ts +3 -0
  480. package/dist/reporters/consoleArchitectureReporter.js +47 -0
  481. package/dist/reporters/consoleArchitectureReporter.js.map +1 -0
  482. package/dist/reporters/consoleAuditReporter.d.ts +2 -0
  483. package/dist/reporters/consoleAuditReporter.js +46 -0
  484. package/dist/reporters/consoleAuditReporter.js.map +1 -0
  485. package/dist/reporters/consoleCiReporter.d.ts +2 -0
  486. package/dist/reporters/consoleCiReporter.js +27 -0
  487. package/dist/reporters/consoleCiReporter.js.map +1 -0
  488. package/dist/reporters/consoleCouplingReporter.d.ts +2 -0
  489. package/dist/reporters/consoleCouplingReporter.js +53 -0
  490. package/dist/reporters/consoleCouplingReporter.js.map +1 -0
  491. package/dist/reporters/consoleCoverageReporter.d.ts +2 -0
  492. package/dist/reporters/consoleCoverageReporter.js +62 -0
  493. package/dist/reporters/consoleCoverageReporter.js.map +1 -0
  494. package/dist/reporters/consoleDependencyReporter.d.ts +2 -0
  495. package/dist/reporters/consoleDependencyReporter.js +64 -0
  496. package/dist/reporters/consoleDependencyReporter.js.map +1 -0
  497. package/dist/reporters/consoleDiffReporter.d.ts +2 -0
  498. package/dist/reporters/consoleDiffReporter.js +80 -0
  499. package/dist/reporters/consoleDiffReporter.js.map +1 -0
  500. package/dist/reporters/consoleExplanationReporter.d.ts +2 -0
  501. package/dist/reporters/consoleExplanationReporter.js +33 -0
  502. package/dist/reporters/consoleExplanationReporter.js.map +1 -0
  503. package/dist/reporters/consoleFileReporter.d.ts +2 -0
  504. package/dist/reporters/consoleFileReporter.js +133 -0
  505. package/dist/reporters/consoleFileReporter.js.map +1 -0
  506. package/dist/reporters/consoleFixGuidanceReporter.d.ts +8 -0
  507. package/dist/reporters/consoleFixGuidanceReporter.js +135 -0
  508. package/dist/reporters/consoleFixGuidanceReporter.js.map +1 -0
  509. package/dist/reporters/consoleHealthReporter.d.ts +13 -0
  510. package/dist/reporters/consoleHealthReporter.js +111 -0
  511. package/dist/reporters/consoleHealthReporter.js.map +1 -0
  512. package/dist/reporters/consoleHotspotReporter.d.ts +2 -0
  513. package/dist/reporters/consoleHotspotReporter.js +68 -0
  514. package/dist/reporters/consoleHotspotReporter.js.map +1 -0
  515. package/dist/reporters/consoleImpactReporter.d.ts +2 -0
  516. package/dist/reporters/consoleImpactReporter.js +65 -0
  517. package/dist/reporters/consoleImpactReporter.js.map +1 -0
  518. package/dist/reporters/consoleOutdatedReporter.d.ts +2 -0
  519. package/dist/reporters/consoleOutdatedReporter.js +54 -0
  520. package/dist/reporters/consoleOutdatedReporter.js.map +1 -0
  521. package/dist/reporters/consolePrDiffReporter.d.ts +2 -0
  522. package/dist/reporters/consolePrDiffReporter.js +75 -0
  523. package/dist/reporters/consolePrDiffReporter.js.map +1 -0
  524. package/dist/reporters/consoleReporter.d.ts +21 -38
  525. package/dist/reporters/consoleReporter.js +19 -1000
  526. package/dist/reporters/consoleReporter.js.map +1 -1
  527. package/dist/reporters/consoleReviewReporter.d.ts +2 -0
  528. package/dist/reporters/consoleReviewReporter.js +101 -0
  529. package/dist/reporters/consoleReviewReporter.js.map +1 -0
  530. package/dist/reporters/consoleUpgradeReporter.d.ts +2 -0
  531. package/dist/reporters/consoleUpgradeReporter.js +89 -0
  532. package/dist/reporters/consoleUpgradeReporter.js.map +1 -0
  533. package/dist/reporters/consoleWorkspaceReporter.d.ts +2 -0
  534. package/dist/reporters/consoleWorkspaceReporter.js +24 -0
  535. package/dist/reporters/consoleWorkspaceReporter.js.map +1 -0
  536. package/dist/reporters/htmlReporter.d.ts +2 -1
  537. package/dist/reporters/htmlReporter.js +9 -3
  538. package/dist/reporters/htmlReporter.js.map +1 -1
  539. package/dist/reporters/jsonReporter.d.ts +2 -1
  540. package/dist/reporters/jsonReporter.js.map +1 -1
  541. package/dist/reporters/markdownAnalysisReporter.d.ts +2 -0
  542. package/dist/reporters/markdownAnalysisReporter.js +40 -0
  543. package/dist/reporters/markdownAnalysisReporter.js.map +1 -0
  544. package/dist/reporters/markdownAuditReporter.d.ts +2 -0
  545. package/dist/reporters/markdownAuditReporter.js +27 -0
  546. package/dist/reporters/markdownAuditReporter.js.map +1 -0
  547. package/dist/reporters/markdownDependencyReporter.d.ts +2 -0
  548. package/dist/reporters/markdownDependencyReporter.js +33 -0
  549. package/dist/reporters/markdownDependencyReporter.js.map +1 -0
  550. package/dist/reporters/markdownDiffReporter.d.ts +2 -0
  551. package/dist/reporters/markdownDiffReporter.js +65 -0
  552. package/dist/reporters/markdownDiffReporter.js.map +1 -0
  553. package/dist/reporters/markdownFileReporter.d.ts +2 -0
  554. package/dist/reporters/markdownFileReporter.js +92 -0
  555. package/dist/reporters/markdownFileReporter.js.map +1 -0
  556. package/dist/reporters/markdownFixGuidanceReporter.d.ts +8 -0
  557. package/dist/reporters/markdownFixGuidanceReporter.js +95 -0
  558. package/dist/reporters/markdownFixGuidanceReporter.js.map +1 -0
  559. package/dist/reporters/markdownImpactReporter.d.ts +2 -0
  560. package/dist/reporters/markdownImpactReporter.js +52 -0
  561. package/dist/reporters/markdownImpactReporter.js.map +1 -0
  562. package/dist/reporters/markdownReporter.d.ts +10 -16
  563. package/dist/reporters/markdownReporter.js +9 -452
  564. package/dist/reporters/markdownReporter.js.map +1 -1
  565. package/dist/reporters/markdownReviewReporter.d.ts +2 -0
  566. package/dist/reporters/markdownReviewReporter.js +84 -0
  567. package/dist/reporters/markdownReviewReporter.js.map +1 -0
  568. package/dist/reporters/markdownUpgradeReporter.d.ts +2 -0
  569. package/dist/reporters/markdownUpgradeReporter.js +62 -0
  570. package/dist/reporters/markdownUpgradeReporter.js.map +1 -0
  571. package/dist/reporters/sarifReporter.js.map +1 -1
  572. package/dist/tool-manifest.json +5 -5
  573. package/dist/types/agentBrief.d.ts +48 -0
  574. package/dist/types/agentBrief.js +2 -0
  575. package/dist/types/agentBrief.js.map +1 -0
  576. package/dist/types/analysis.d.ts +32 -0
  577. package/dist/types/analysis.js +2 -0
  578. package/dist/types/analysis.js.map +1 -0
  579. package/dist/types/baseline.d.ts +59 -0
  580. package/dist/types/baseline.js +2 -0
  581. package/dist/types/baseline.js.map +1 -0
  582. package/dist/types/bugHunt.d.ts +41 -0
  583. package/dist/types/bugHunt.js +2 -0
  584. package/dist/types/bugHunt.js.map +1 -0
  585. package/dist/types/common.d.ts +34 -0
  586. package/dist/types/common.js +2 -0
  587. package/dist/types/common.js.map +1 -0
  588. package/dist/types/config.d.ts +66 -0
  589. package/dist/types/config.js +2 -0
  590. package/dist/types/config.js.map +1 -0
  591. package/dist/types/coupling.d.ts +40 -0
  592. package/dist/types/coupling.js +2 -0
  593. package/dist/types/coupling.js.map +1 -0
  594. package/dist/types/coverage.d.ts +32 -0
  595. package/dist/types/coverage.js +2 -0
  596. package/dist/types/coverage.js.map +1 -0
  597. package/dist/types/dependencyHealth.d.ts +73 -0
  598. package/dist/types/dependencyHealth.js +2 -0
  599. package/dist/types/dependencyHealth.js.map +1 -0
  600. package/dist/types/dogfood.d.ts +185 -0
  601. package/dist/types/dogfood.js +2 -0
  602. package/dist/types/dogfood.js.map +1 -0
  603. package/dist/types/evidencePack.d.ts +76 -0
  604. package/dist/types/evidencePack.js +2 -0
  605. package/dist/types/evidencePack.js.map +1 -0
  606. package/dist/types/fixes.d.ts +77 -0
  607. package/dist/types/fixes.js +2 -0
  608. package/dist/types/fixes.js.map +1 -0
  609. package/dist/types/graph.d.ts +80 -0
  610. package/dist/types/graph.js +2 -0
  611. package/dist/types/graph.js.map +1 -0
  612. package/dist/types/graphCorpus.d.ts +16 -0
  613. package/dist/types/graphCorpus.js +2 -0
  614. package/dist/types/graphCorpus.js.map +1 -0
  615. package/dist/types/hotspots.d.ts +42 -0
  616. package/dist/types/hotspots.js +2 -0
  617. package/dist/types/hotspots.js.map +1 -0
  618. package/dist/types/impact.d.ts +62 -0
  619. package/dist/types/impact.js +2 -0
  620. package/dist/types/impact.js.map +1 -0
  621. package/dist/types/inspection.d.ts +47 -0
  622. package/dist/types/inspection.js +2 -0
  623. package/dist/types/inspection.js.map +1 -0
  624. package/dist/types/mcp.d.ts +39 -0
  625. package/dist/types/mcp.js +2 -0
  626. package/dist/types/mcp.js.map +1 -0
  627. package/dist/types/pluginDx.d.ts +42 -0
  628. package/dist/types/pluginDx.js +2 -0
  629. package/dist/types/pluginDx.js.map +1 -0
  630. package/dist/types/prDiff.d.ts +41 -0
  631. package/dist/types/prDiff.js +2 -0
  632. package/dist/types/prDiff.js.map +1 -0
  633. package/dist/types/preflight.d.ts +122 -0
  634. package/dist/types/preflight.js +2 -0
  635. package/dist/types/preflight.js.map +1 -0
  636. package/dist/types/qualityScorecard.d.ts +34 -0
  637. package/dist/types/qualityScorecard.js +2 -0
  638. package/dist/types/qualityScorecard.js.map +1 -0
  639. package/dist/types/regressionPlan.d.ts +32 -0
  640. package/dist/types/regressionPlan.js +2 -0
  641. package/dist/types/regressionPlan.js.map +1 -0
  642. package/dist/types/releaseTrain.d.ts +37 -0
  643. package/dist/types/releaseTrain.js +2 -0
  644. package/dist/types/releaseTrain.js.map +1 -0
  645. package/dist/types/review.d.ts +203 -0
  646. package/dist/types/review.js +2 -0
  647. package/dist/types/review.js.map +1 -0
  648. package/dist/types/reviewContract.d.ts +9 -0
  649. package/dist/types/reviewContract.js +2 -0
  650. package/dist/types/reviewContract.js.map +1 -0
  651. package/dist/types/scanning.d.ts +111 -0
  652. package/dist/types/scanning.js +2 -0
  653. package/dist/types/scanning.js.map +1 -0
  654. package/dist/types/session.d.ts +42 -0
  655. package/dist/types/session.js +2 -0
  656. package/dist/types/session.js.map +1 -0
  657. package/dist/types/start.d.ts +437 -0
  658. package/dist/types/start.js +2 -0
  659. package/dist/types/start.js.map +1 -0
  660. package/dist/types/trial.d.ts +27 -0
  661. package/dist/types/trial.js +2 -0
  662. package/dist/types/trial.js.map +1 -0
  663. package/dist/types/understand.d.ts +153 -0
  664. package/dist/types/understand.js +2 -0
  665. package/dist/types/understand.js.map +1 -0
  666. package/dist/types/workplan.d.ts +67 -0
  667. package/dist/types/workplan.js +2 -0
  668. package/dist/types/workplan.js.map +1 -0
  669. package/dist/types/workplanHandoff.d.ts +11 -0
  670. package/dist/types/workplanHandoff.js +2 -0
  671. package/dist/types/workplanHandoff.js.map +1 -0
  672. package/dist/types/workspace.d.ts +18 -0
  673. package/dist/types/workspace.js +2 -0
  674. package/dist/types/workspace.js.map +1 -0
  675. package/dist/types.d.ts +34 -2348
  676. package/dist/types.js +0 -1
  677. package/dist/types.js.map +1 -1
  678. package/dist/utils/banner.js +15 -6
  679. package/dist/utils/banner.js.map +1 -1
  680. package/dist/utils/baseline.js +11 -9
  681. package/dist/utils/baseline.js.map +1 -1
  682. package/dist/utils/changedFiles.js +1 -1
  683. package/dist/utils/changedFiles.js.map +1 -1
  684. package/dist/utils/config.d.ts +2 -1
  685. package/dist/utils/config.js +32 -0
  686. package/dist/utils/config.js.map +1 -1
  687. package/dist/utils/formatSupport.d.ts +1 -1
  688. package/dist/utils/formatSupport.js +7 -1
  689. package/dist/utils/formatSupport.js.map +1 -1
  690. package/dist/utils/packageJsonLocator.js.map +1 -1
  691. package/docs/GUIDE.md +211 -147
  692. package/docs/PLUGIN-GALLERY.md +9 -1
  693. package/docs/ROADMAP.md +120 -86
  694. package/docs/demos/projscan-4-1-demo.html +46 -79
  695. package/docs/examples/adoption-workflows.md +128 -0
  696. package/docs/examples/plugins/graph-context.mjs +1 -2
  697. package/docs/examples/plugins/security-sensitive-files.mjs +2 -1
  698. package/docs/examples/swarm-coordination.md +109 -0
  699. package/package.json +12 -5
package/docs/GUIDE.md CHANGED
@@ -112,7 +112,7 @@ projscan is structured around the four questions an AI coding agent (or a carefu
112
112
 
113
113
  ### 1. Diagnose — "what's wrong here?"
114
114
 
115
- When the agent first opens a repo, or before starting a refactor, the question is: *is anything obviously broken or risky?*
115
+ When the agent first opens a repo, or before starting a refactor, the question is: _is anything obviously broken or risky?_
116
116
 
117
117
  - **`projscan privacy-check`** — trust boundary report. Shows telemetry/offline status, scan root, Git ignore handling, `.env` content handling, plugin execution status, local write surfaces, report-export sensitivity, and network-capable endpoints.
118
118
  - **`projscan_start` / `projscan start`** — first-60-seconds workflow orientation. Composes setup diagnostics, Mission Control, the recommended workflow recipe, `firstTenMinutes`, workplan, quality scorecard, top risks, adoption gaps, repeat-use metrics, next commands, optional handoff payload, and a split between current Git/worktree evidence and remembered session context. Pass `intent` / `--intent "<goal>"` when the developer or agent wants one routed action plan with route confidence, immediately callable `readyActions`, and proof commands, such as `projscan start --intent "what breaks if I rename this API?"`. For fuzzy impact targets, Mission Control searches first, then gives symbol and file impact follow-ups for the search result. For exact symbols or paths, such as `projscan start --intent "what breaks if I change src/core/start.ts?"`, `projscan start --intent "where is runAudit used?"`, `projscan start --intent "what depends on src/core/start.ts?"`, or `projscan start --intent "can I delete src/core/start.ts?"`, it runs impact directly. For repo-orientation questions, such as `projscan start --intent "summarize this repo"`, `projscan start --intent "what files should I read first?"`, `projscan start --intent "where do I start in this codebase?"`, `projscan start --intent "give me a tour of the repo"`, or `projscan start --intent "explain the architecture"`, it routes to `projscan_understand --view map` so the developer gets cited read-first files, entrypoints, boundaries, risks, and unknowns. For public surface questions, such as `projscan start --intent "what are the public contracts?"` or `projscan start --intent "how do I safely deprecate this API?"`, it routes to `projscan_understand --view contracts` so public exports, config contracts, and likely breaking-change risks are reviewed before touching API surfaces. For API breakage questions, such as `projscan start --intent "what will this API change break?"`, it searches for the exact public symbol or file before continuing to impact analysis. For broad quality/risk questions, such as `projscan start --intent "what is risky in this repo?"`, it routes to `projscan_quality_scorecard` so health, security, tests, maintainability, coordination, and top risks are reviewed before choosing work. For file-orientation questions, such as `projscan start --intent "what should I read before changing src/core/start.ts?"`, `projscan start --intent "explain src/core/start.ts"`, `projscan start --intent "who owns src/core/start.ts?"`, `projscan start --intent "who should review src/core/start.ts?"`, or `projscan start --intent "who last touched src/core/start.ts?"`, it routes to `projscan_file` so the developer sees purpose, imports, exports, ownership, history, reviewer context, and risk before editing. For targeted graph questions, such as `projscan start --intent "who imports src/core/start.ts?"`, it routes to `projscan_semantic_graph` query mode instead of dumping the full graph. For security source-to-sink questions, such as `projscan start --intent "is user input reaching SQL sinks?"`, it routes to `projscan_dataflow` and infers the `hardening` workflow. For coverage-gap questions, such as `projscan start --intent "what are the scariest untested files?"`, it routes to `projscan_coverage` so the next test target is chosen by risk. For dependency inventory questions, such as `projscan start --intent "what dependencies does this repo use?"`, it routes to `projscan_dependencies` instead of an upgrade preview. For dependency vulnerability questions, such as `projscan start --intent "does lodash have a CVE?"`, `projscan start --intent "what CVEs affect this repo?"`, or `projscan start --intent "find vulnerable packages"`, it routes to `projscan_audit`, scoped with `--package` when the package can be inferred. For package-bump or package-update questions, such as `projscan start --intent "what breaks if I bump chalk to 6?"` or `projscan start --intent "what breaks if I update react?"`, it routes to `projscan_upgrade`; if no package is named, Mission Control runs `projscan outdated --format json` first and marks the package name as `Needs Input`. For "what changed in this PR?", it routes to `projscan_pr_diff` before full review. For "what should I fix first?" or "what is the fastest safe fix?", it routes to `projscan_bug_hunt` instead of issue-specific fix-suggest or generic preflight. For open-ended next-step questions, such as `projscan start --intent "what should I do next?"`, it routes to `projscan_workplan --mode before_edit` so the developer gets an ordered plan with verification before editing. For "give the next agent a handoff", it routes to `projscan_agent_brief` with `intent: "next_agent"`. For issue context, such as `projscan start --intent "explain issue missing-test-framework"`, it routes to `projscan_explain_issue`; if no issue id is named, Mission Control runs `projscan doctor --format json` first and marks the issue id as `Needs Input`. For direct issue repair, such as `projscan start --intent "fix issue missing-test-framework"`, it routes to `projscan_fix_suggest`; if no issue id is named, Mission Control runs `projscan doctor --format json` first and marks the fix-suggest issue id as `Needs Input`. For failing CI or tests, such as `projscan start --intent "CI is failing after this PR"`, it routes to `projscan_regression_plan` with a focused verification plan. For right-sized verification questions, such as `projscan start --intent "what smoke checks should I run before commit?"` or `projscan start --intent "what full regression should I run before merge?"`, Mission Control preserves the requested `smoke` or `full` regression depth.
@@ -180,7 +180,9 @@ When the agent first opens a repo, or before starting a refactor, the question i
180
180
  For short proof-command phrasing, such as `projscan start --intent "give me proof commands"`, it also routes to `projscan_regression_plan --level focused`; reviewer-proof wording with PR comments still routes to `projscan_evidence_pack`.
181
181
  For pre-push command questions, such as `projscan start --intent "what commands should I run before pushing?"`, it routes to `projscan_regression_plan --level focused` so the branch has a small verification loop before it leaves the workstation.
182
182
  For release-readiness wording, such as `projscan start --intent "what should I check before release?"`, `projscan start --intent "can I deploy this?"`, `projscan start --intent "prepare this branch for deployment"`, `projscan start --intent "what changed since last release?"`, `projscan start --intent "write a release note for this change"`, or `projscan start --intent "draft changelog entry"`, it routes to `projscan_release_train` so changelog, package, SBOM, provenance, and blockers are reviewed before deploying or publishing.
183
- For quick-win and low-risk improvement wording, such as `projscan start --intent "find a quick win"`, `projscan start --intent "what is a low risk improvement?"`, or `projscan start --intent "pick a small safe task"`, it routes to `projscan_bug_hunt` so a ranked, verifiable fix queue is selected instead of a generic quality readout.
183
+ For product-planning questions, such as `projscan start --intent "what should we build next?"` or `projscan start --intent "plan the product roadmap"`, it routes to `projscan_workplan --mode bug_hunt` so broad product direction becomes an ordered, verifiable product-planning workplan with explicit accept, defer, or split criteria instead of a generic before-edit orientation.
184
+ For broad improvement-planning questions, such as `projscan start --intent "what should we improve next?"`, it routes to `projscan_bug_hunt` so the agent gets an actionable ranked queue; technical variants such as tests, performance, release, dependencies, or safety keep their specialized routes.
185
+ For quick-win and low-risk improvement wording, such as `projscan start --intent "find a quick win"`, `projscan start --intent "what is a low risk improvement?"`, or `projscan start --intent "pick a small safe task"`, it routes to `projscan_bug_hunt` so a ranked, verifiable action queue is selected instead of a generic quality readout.
184
186
  For tiny-task and beginner-safe wording, such as `projscan start --intent "what can I do in five minutes?"`, `projscan start --intent "pick an easy task for me"`, or `projscan start --intent "what should an intern work on?"`, it also routes to `projscan_bug_hunt`.
185
187
  For branch-diff, PR-size, and commit-message questions, such as `projscan start --intent "what did I change since main?"`, `projscan start --intent "is this PR too large?"`, `projscan start --intent "how big is this change?"`, `projscan start --intent "write a commit message for these changes"`, or `projscan start --intent "summarize my changes for a commit"`, it routes to `projscan_pr_diff` so changed exports, imports, call sites, complexity, and fan-in are reviewed before full review.
186
188
  For branch freshness and comparison questions, such as `projscan start --intent "is my branch stale?"` or `projscan start --intent "compare my branch with main"`, it also routes to `projscan_pr_diff` so the developer checks the structural diff before rebasing or asking for review. For rebase and merge-conflict recovery, such as `projscan start --intent "rebase went wrong"` or `projscan start --intent "resolve merge conflicts"`, it routes to `projscan_preflight --mode before_merge`; post-conflict test-plan wording such as `projscan start --intent "what should I test after resolving conflicts?"` stays on `projscan_regression_plan`.
@@ -190,7 +192,7 @@ When the agent first opens a repo, or before starting a refactor, the question i
190
192
  For file-claim requests, such as `projscan start --intent "claim src/core/start.ts for me"`, it routes to `projscan_claim`, lists active claims first, then adds the requested target only after a real agent name replaces `Needs Input`.
191
193
  For architecture-coupling questions, such as `projscan start --intent "show circular dependencies"` or `projscan start --intent "find dependency cycles"`, it routes to `projscan_coupling` with `direction: "cycles_only"` / `projscan coupling --cycles-only --format json`; broader wording such as `projscan start --intent "what modules are tightly coupled"` routes to the full fan-in, fan-out, instability, cross-package-edge, and cycle report.
192
194
  - **`projscan_workplan` / `projscan workplan`** — agent mission control. Composes preflight, review, session, hotspot, plugin-policy, and supply-chain evidence into prioritized tasks with suggested tools, exact verification commands, and short handoff text. Modes: `before_edit`, `before_commit`, `before_merge`, `refactor`, `release`, `bug_hunt`, and `hardening`.
193
- - **`projscan_bug_hunt` / `projscan bug-hunt`** — bug-hunt fix queue. Combines doctor issues, preflight, hotspots, and session coordination into ranked fix targets with verification commands; pure hotspot churn stays as watchlist/top-suspect evidence when health and gates are clean.
195
+ - **`projscan_bug_hunt` / `projscan bug-hunt`** — bug-hunt action queue. Combines doctor issues, preflight, hotspots, and session coordination into ranked actions with verification commands; release-scale findings can be manual sign-off actions, while pure hotspot churn stays as watchlist/top-suspect evidence when health and gates are clean.
194
196
  - **`projscan_agent_brief` / `projscan agent-brief`** — compact next-agent context packet with focus items, repo context, coordination hints, guardrails, and suggested next actions.
195
197
  - **`projscan_quality_scorecard` / `projscan quality-scorecard`** — dimensioned quality view across health, security, tests, maintainability, coordination, top risks, and verification commands.
196
198
  - **`projscan_understand` / `projscan understand`** — cited repo-comprehension surface. Returns repo maps, runtime flow maps, contract maps, change-readiness guidance, verification tiers, unknowns, read-first files, and exact next commands.
@@ -206,7 +208,7 @@ When the agent first opens a repo, or before starting a refactor, the question i
206
208
  - **`projscan_coupling` / `projscan coupling`** — per-file fan-in / fan-out / instability plus circular-import cycles (Tarjan SCC). Use `direction: cycles_only` or `projscan coupling --cycles-only` to surface architectural debt directly.
207
209
  - **`projscan_analyze` / `projscan analyze`** — the everything report; useful at session start but verbose.
208
210
 
209
- **Typical agent flow:** start with `projscan privacy-check`, then `projscan_start` with an optional plain-language intent. If no explicit mode is supplied, start infers the workflow mode from the intent, such as `before_commit` for commit-safety checks; read `modeSource` and `modeReason` to see whether the mode was explicit, inferred, or defaulted. `modeReason` distinguishes workflow-mode defaulting from action routing, so an impact intent can still route through Mission Control while the workflow stays `before_edit`. The `firstTenMinutes` path and current-worktree coordination hint follow that resolved mode, so a commit-safety start does not send the developer back through a before-edit gate. Follow `missionControl.actionPlan`, call `missionControl.readyActions` immediately, use `missionControl.executionPlan.currentPhase` as the cursor-aligned phase pointer, and use `missionControl.executionPlan.cursor.tool` / `args` when the cursor is directly MCP-callable. Use routed-intent weighted `confidence`, `score`, and `matchedKeywords` to judge weak or ambiguous matches, and read the same confidence line in console output when working manually. Fill any `missionControl.unresolvedInputs` before running placeholder follow-ups, inspect `missionControl.alternatives` when the intent mixes goals, stop only when `missionControl.successCriteria` is satisfied, and hand off with `missionControl.handoff`, `missionControl.runbook`, or the concise `missionControl.handoffPrompt`. Use `missionControl.reviewGate` as the autonomous-work stop boundary: finish the current checklist and proof, capture `git status --short` and `git diff --stat`, then wait for approval before another slice, release, publish, or deploy. Read `missionControl.reviewGate.worktree` for current worktree availability, changed-file count, base ref, and visible changed files. Use `missionControl.reviewGate.proof` when the reviewer needs the remaining proof queue without reading the full resume object. Read `missionControl.reviewGate.doneWhen` for the success criteria the reviewer must confirm before approving more work. Read `missionControl.reviewGate.policy` before continuing from a review handoff; it lists the actions blocked until explicit reviewer approval: another slice, release, publish, deploy, push, merge, and version bump. Use `projscan start --review-gate-json --intent "<goal>"` or saved `review-gate.json` when a script needs proof, worktree evidence, done criteria, decisions, and policy in one review object. Use `projscan start --review-policy --intent "<goal>"` or saved `review-policy.json` when a script only needs that approval boundary. Use `missionControl.reviewGate.decisions` as the approval menu in review gates, task cards, and runbooks; each decision includes copyable reviewer reply text so agents do not infer permission to continue, release, or publish. The default console review gate, saved mission bundle README, concise handoff prompt, `--review-replies`, and saved `review-replies.txt` show those replies for first-open review. `missionControl.handoff.reviewGate`, `--handoff-json`, and saved `handoff.json` carry that same gate for transfer-only flows. The handoff prompt starts with `missionControl.resume.prompt`, so it carries the current cursor, runnable command or blocked input instruction, labeled unlocks or blockers, done criteria, ready proof, review stop condition, and reviewer replies in one copyable sentence; the normal console prints that same value as `Handoff Prompt` without requiring JSON or `--include-handoff`, `projscan start --handoff-prompt --intent "<goal>"` prints only that prompt for piping or copy/paste, and the Markdown runbook renders it as `## Handoff Prompt` so copied runbooks carry the same next-agent prompt. When a human just needs the runnable shell step, `projscan start --next-command --intent "<goal>"` prints only the current cursor command; when an MCP agent needs the callable equivalent, `projscan start --next-tool-call --intent "<goal>"` prints the current cursor tool call as compact JSON. Cite `missionControl.proofSummary` plus the runnable-only `missionControl.proofCommands` in broad handoff notes, and use `missionControl.handoff.readyProof.items` when resuming because it is the complete ordered remaining-proof queue; each item carries its CLI command and an optional MCP `toolCall`. `missionControl.handoff.readyProof.commands` and `toolCalls` remain convenient command-only and MCP-callable views. MCP agents should use `missionControl.resume.toolCall` when present, use `missionControl.resume.inputBindings` to map unlocked placeholders to input steps, then call `missionControl.resume.followUps` as the next template calls; when they need one ordered sequence, follow `missionControl.resume.checklist`, whose `run_proof` rows include `tool` and `args` for MCP-callable proof steps. The normal console `Resume Checklist` and Markdown runbook checklist print callable rows inline as `(MCP: ...)` and mark unmapped proof rows as `(CLI only)`, so a copied runbook or default terminal run remains self-contained even outside the JSON payload. After the current action, prefer `missionControl.resume.remainingProofItems` for complete proof, using `remainingProofToolCalls` for the callable MCP subset without rerunning the current command. Humans can run the matching `command`; the normal console `Ready Proof` command list, normal console `Proof Queue`, and runbook `Proof queue` all use remaining proof so the current cursor command is not repeated, and each queued item shows either its MCP call or `CLI only`. Use `projscan_understand` and `projscan_preflight` when you need broader context or a safety gate. Use `projscan_workplan` when you need an ordered execution plan, `projscan_agent_brief` for a compact handoff, and `projscan_evidence_pack --pr-comment` when you need reviewer-facing proof. Deeper tools such as `doctor`, `hotspots`, `dataflow`, `review`, `bug-hunt`, `quality-scorecard`, `dogfood`, and `trial` are follow-up tools.
211
+ **Typical agent flow:** start with `projscan privacy-check`, then `projscan_start` with an optional plain-language intent. If no explicit mode is supplied, start infers the workflow mode from the intent, such as `before_commit` for commit-safety checks; read `modeSource` and `modeReason` to see whether the mode was explicit, inferred, or defaulted. `modeReason` distinguishes workflow-mode defaulting from action routing, so an impact intent can still route through Mission Control while the workflow stays `before_edit`. The `firstTenMinutes` path and current-worktree coordination hint follow that resolved mode, so a commit-safety start does not send the developer back through a before-edit gate. Follow `missionControl.actionPlan`, call `missionControl.readyActions` immediately, use `missionControl.executionPlan.currentPhase` as the cursor-aligned phase pointer, and use `missionControl.executionPlan.cursor.tool` / `args` when the cursor is directly MCP-callable. Use routed-intent weighted `confidence`, `score`, and `matchedKeywords` to judge weak or ambiguous matches, and read the same confidence line in console output when working manually. Fill any `missionControl.unresolvedInputs` before running placeholder follow-ups, inspect `missionControl.alternatives` when the intent mixes goals, stop only when `missionControl.successCriteria` is satisfied, and hand off with `missionControl.handoff`, `missionControl.runbook`, or the concise `missionControl.handoffPrompt`. Use `missionControl.reviewGate` as the autonomous-work stop boundary: finish the current checklist and proof, capture `git status --short` and `git diff --stat`, then wait for approval before another slice, release, publish, or deploy. Read `missionControl.reviewGate.worktree` for current worktree availability, changed-file count, base ref, and visible changed files. Use `missionControl.reviewGate.proof` when the reviewer needs the remaining proof queue without reading the full resume object. Read `missionControl.reviewGate.doneWhen` for the success criteria the reviewer must confirm before approving more work. Read `missionControl.reviewGate.policy` before continuing from a review handoff; it lists the actions blocked until explicit reviewer approval: another slice, release, publish, deploy, push, merge, and version bump. Use `projscan start --review-gate-json --intent "<goal>"` or saved `review-gate.json` when a script needs proof, worktree evidence, done criteria, decisions, and policy in one review object. Use `projscan start --review-policy --intent "<goal>"` or saved `review-policy.json` when a script only needs that approval boundary. Use `missionControl.reviewGate.decisions` as the approval menu in review gates, task cards, and runbooks; each decision includes copyable reviewer reply text so agents do not infer permission to continue, release, or publish. The default console review gate, saved mission bundle README, concise handoff prompt, `--review-replies`, and saved `review-replies.txt` show those replies for first-open review. `missionControl.handoff.reviewGate`, `--handoff-json`, and saved `handoff.json` carry that same gate for transfer-only flows. The handoff prompt starts with `missionControl.resume.prompt`, so it carries the current cursor, runnable command or blocked input instruction, labeled unlocks or blockers, done criteria, ready proof, review stop condition, and reviewer replies in one copyable sentence; the normal console prints that same value as `Handoff Prompt` without requiring JSON or `--include-handoff`, `projscan start --handoff-prompt --intent "<goal>"` prints only that prompt for piping or copy/paste, and the Markdown runbook renders it as `## Handoff Prompt` so copied runbooks carry the same next-agent prompt. When a human just needs the runnable shell step, `projscan start --next-command --intent "<goal>"` prints only the current cursor command; when an MCP agent needs the callable equivalent, `projscan start --next-tool-call --intent "<goal>"` prints the current cursor tool call as compact JSON. Cite `missionControl.proofSummary` plus the runnable-only `missionControl.proofCommands` in broad handoff notes, and use `missionControl.handoff.readyProof.items` when resuming because it is the complete ordered remaining-proof queue; each item carries its CLI command and an optional MCP `toolCall`. `missionControl.handoff.readyProof.commands` and `toolCalls` remain convenient command-only and MCP-callable views. If the repo has `AGENTLOOP.md` or `agentloop.config.json`, start adds `npm exec agentloop -- status` to the coordination/proof queue; if `.agentflight/config.json` exists, it adds `npm exec agentflight -- verify`. These harness commands are emitted for agents, scripts, saved mission bundles, and `--proof-commands`; start reports them but does not execute them. MCP agents should use `missionControl.resume.toolCall` when present, use `missionControl.resume.inputBindings` to map unlocked placeholders to input steps, then call `missionControl.resume.followUps` as the next template calls; when they need one ordered sequence, follow `missionControl.resume.checklist`, whose `run_proof` rows include `tool` and `args` for MCP-callable proof steps. The normal console `Resume Checklist` and Markdown runbook checklist print callable rows inline as `(MCP: ...)` and mark unmapped proof rows as `(CLI only)`, so a copied runbook or default terminal run remains self-contained even outside the JSON payload. After the current action, prefer `missionControl.resume.remainingProofItems` for complete proof, using `remainingProofToolCalls` for the callable MCP subset without rerunning the current command. Humans can run the matching `command`; the normal console `Ready Proof` command list, normal console `Proof Queue`, and runbook `Proof queue` all use remaining proof so the current cursor command is not repeated, and each queued item shows either its MCP call or `CLI only`. Use `projscan_understand` and `projscan_preflight` when you need broader context or a safety gate. Use `projscan_workplan` when you need an ordered execution plan, `projscan_agent_brief` for a compact handoff, and `projscan_evidence_pack --pr-comment` when you need reviewer-facing proof. Deeper tools such as `doctor`, `hotspots`, `dataflow`, `review`, `bug-hunt`, `quality-scorecard`, `dogfood`, and `trial` are follow-up tools.
210
212
 
211
213
  For shortcut discovery, `projscan start --shortcuts --intent "<goal>"` prints the copyable command menu for the current mission, and `projscan start --shortcuts-json --intent "<goal>"` prints the same menu as JSON for agents and scripts. For shell copy/paste, `projscan start --mission-script --intent "<goal>"` prints a POSIX script that runs the current cursor command, then the remaining proof queue, then prints the review evidence commands. For MCP queue copy/paste, `projscan start --ready-tool-calls --intent "<goal>"` prints the current cursor call followed by remaining MCP-callable proof as compact JSON. For structured resume handoff, `projscan start --resume-json --intent "<goal>"` prints only `missionControl.resume`. For the complete transfer object, `projscan start --handoff-json --intent "<goal>"` prints only `missionControl.handoff`. For a file bundle, `projscan start --save-mission .projscan/mission --intent "<goal>"` writes `README.md`, `next-command.txt`, `next-tool-call.json`, `handoff-prompt.txt`, `resume-prompt.txt`, `task-card.md`, `review-gate.md`, `review-gate.json`, `review-policy.json`, `review-replies.txt`, the runbook, handoff JSON, resume JSON, `ready-tool-calls.json`, `shortcuts.json`, `mission.sh`, `status.sh`, `proof-logs/README.md`, `proof-logs/status.jsonl`, `proof-logs/run-report.md`, `proof-logs/summary.json`, proof commands, and manifest. Saved `mission.sh` writes current-command and proof-command output under `proof-logs/`, appends exit-code rows to `status.jsonl`, refreshes `run-report.md`, and writes `summary.json`, so reviewers and wrappers can scan pass/fail proof before opening raw logs. Bundle `status.sh` reads `summary.json` and uses exit codes `0`, `1`, and `2` for passed, failed, and not-ready states. For verification-only copy/paste, `projscan start --proof-commands --intent "<goal>"` prints the remaining ready proof commands one per line without the rest of the start report. For an ordered checklist without the full report, `projscan start --checklist --intent "<goal>"` prints only the resume checklist rows. For paste-ready PR, issue, or handoff notes, `projscan start --task-card --intent "<goal>"` prints the Markdown task card. MCP agents can read `missionControl.taskCard.markdown` when they need the same checklist without rendering it from `resume.checklist`. For stop-and-review notes, `projscan start --review-gate --intent "<goal>"` prints only `missionControl.reviewGate.markdown`, `projscan start --review-gate-json --intent "<goal>"` prints only the review gate JSON, `projscan start --review-policy --intent "<goal>"` prints only the review policy JSON, and `projscan start --review-replies --intent "<goal>"` prints only the copyable reviewer replies. For a full Markdown artifact, `projscan start --runbook --intent "<goal>"` prints the mission runbook. For post-run proof, `projscan mission-proof --mission .projscan/mission --format markdown` prints a paste-ready evidence report, while `--format json` keeps the same data machine-readable. Add `--list` to show saved mission bundles, status, update time, totals, and copyable resume/proof commands before choosing a target; add `--needs-attention` or `--mission-status failed` to focus that list. Add `--latest` to select the saved mission bundle with the newest `proof-logs/summary.json`. Add `--all` to include `.projscan/mission` and direct child bundles under `.projscan/missions/`. Add `--summary` when logs need one pass/fail line. Add `--require-passed` when a local script should fail unless every selected bundle passed. Add `--write reports/mission-proof.md` or `--write reports/mission-proof.json` when a reviewer, CI job, or next agent needs a saved local artifact. Run `projscan mission-proof --init-baseline manual-runs.json` before manual comparison if the team has not created the baseline file yet; use `--add-baseline-run manual-runs.json --id manual-1 --status passed --minutes-spent 25` to append measured manual runs without editing JSON. Run `--check-baseline manual-runs.json` before comparison when you want to validate the file without scanning mission bundles. Add `--format json` to baseline init, append, or check commands when a wrapper needs the written path, run count, added run, or totals. Baseline run IDs must be non-empty and unique; statuses must be `passed`, `failed`, `running`, `not_run`, or `unknown`; metric fields must be non-negative numbers.
212
214
 
@@ -235,8 +237,8 @@ npm run docs:demos
235
237
 
236
238
  When the agent has changes in flight (or is asked to review someone else's), the question shifts from "what's wrong globally" to "what changed, and does the change introduce risk?"
237
239
 
238
- - **`projscan_pr_diff` / `projscan pr-diff`** *(0.11+)* — structural (AST) diff between two refs. Returns added / removed / modified files with explicit lists of exports, imports, call sites, and ΔCC / Δfan-in. Not a text diff: surfaces the symbols that moved, not the whitespace.
239
- - **`projscan_review` / `projscan review`** *(0.13+)* — **the headline tool for this phase**. Composes `pr_diff` + per-file risk + new/expanded import cycles + risky function additions + dependency changes + optional `contractChanges` for export and package-entrypoint changes + `newTaintFlows`, hardened `newDataflowRisks`, compact `graphEvidence`, and a verdict (`ok` / `review` / `block`). One tool call answers the whole question.
240
+ - **`projscan_pr_diff` / `projscan pr-diff`** _(0.11+)_ — structural (AST) diff between two refs. Returns added / removed / modified files with explicit lists of exports, imports, call sites, and ΔCC / Δfan-in. Not a text diff: surfaces the symbols that moved, not the whitespace.
241
+ - **`projscan_review` / `projscan review`** _(0.13+)_ — **the headline tool for this phase**. Composes `pr_diff` + per-file risk + new/expanded import cycles + risky function additions + dependency changes + optional `contractChanges` for export and package-entrypoint changes + `newTaintFlows`, hardened `newDataflowRisks`, compact `graphEvidence`, and a verdict (`ok` / `review` / `block`). One tool call answers the whole question.
240
242
  - **`projscan_preflight --mode before_merge` / `projscan_preflight { mode: "before_merge" }`** — smaller merge gate over review, changed-file health, taint, dataflow, session, hotspot, plugin, supply-chain, and release-scale signals. `evidence.releaseScale` marks large platform-release sign-off when review blocks on scale/complexity rather than a concrete defect. Use it when the agent needs the decision before reading the full review payload.
241
243
 
242
244
  **Typical agent flow:** start with `projscan_review` for the verdict + summary; if it returns `review` or `block`, drill into the `riskyFunctions` and `newCycles` arrays for specifics.
@@ -245,18 +247,18 @@ When the agent has changes in flight (or is asked to review someone else's), the
245
247
 
246
248
  projscan diagnoses but does not run an LLM. The agent (the LLM) is what writes the fix. projscan's job in this phase is to package the issue context into something the agent can act on.
247
249
 
248
- - **`projscan_fix_suggest` / `projscan fix-suggest`** *(0.14+)* — given an issue id (or a `file` + `rule` pair), return a structured action prompt: headline, why it matters, where to change, one-paragraph instruction, optional suggested test. Hand-tuned templates for ~12 common issue families plus a severity-anchored generic fallback.
249
- - **`projscan_explain_issue` / `projscan explain-issue`** *(0.14+)* — deep dive: code excerpt around the location, related issues touching the same file, similar past commits via `git log --grep=<rule>`. Use when an agent wants more context than `doctor` gave.
250
+ - **`projscan_fix_suggest` / `projscan fix-suggest`** _(0.14+)_ — given an issue id (or a `file` + `rule` pair), return a structured action prompt: headline, why it matters, where to change, one-paragraph instruction, optional suggested test. Hand-tuned templates for ~12 common issue families plus a severity-anchored generic fallback.
251
+ - **`projscan_explain_issue` / `projscan explain-issue`** _(0.14+)_ — deep dive: code excerpt around the location, related issues touching the same file, similar past commits via `git log --grep=<rule>`. Use when an agent wants more context than `doctor` gave.
250
252
  - **`projscan fix`** — rule-based auto-fix (ESLint, Prettier, Vitest scaffolding, EditorConfig). Pre-dates the `fix_suggest` flow; useful for the no-LLM-required class of fixes.
251
253
 
252
254
  **Typical agent flow:** read an issue from `projscan_doctor`, call `projscan_fix_suggest` with its id, paste the `instruction` field into the agent's plan.
253
255
 
254
256
  ### 4. Reach — "what breaks if I change this?"
255
257
 
256
- Before the agent commits to a refactor (or accepts a name-rename suggestion), the question is: *who depends on this thing, transitively?*
258
+ Before the agent commits to a refactor (or accepts a name-rename suggestion), the question is: _who depends on this thing, transitively?_
257
259
 
258
- - **`projscan_impact` / `projscan impact`** *(0.15+)* — transitive blast-radius. File mode returns every file that transitively imports the target, ranked by BFS distance. Symbol mode returns the symbol's definition file(s), the files that directly call it (their callSites match), and the transitive importers of those callers. Cycle-safe; depth-bounded.
259
- - **`projscan_semantic_graph` (`query` mode) / `projscan semantic-graph`** — direct one-hop queries via `query: { direction, file?, symbol? }`: `imports`, `exports`, `importers`, `symbol_defs`, `package_importers`. Use when impact is overkill and you want a pin-point answer. Package wording such as `which files import package chalk`, `who uses lodash`, or `why do we depend on lodash` maps to `package_importers`. With no `query`, returns the full graph projection (file, function, package, and symbol context in one contract). *(Subsumes the former `projscan_graph`, removed in 4.0.)*
260
+ - **`projscan_impact` / `projscan impact`** _(0.15+)_ — transitive blast-radius. File mode returns every file that transitively imports the target, ranked by BFS distance. Symbol mode returns the symbol's definition file(s), the files that directly call it (their callSites match), and the transitive importers of those callers. Cycle-safe; depth-bounded.
261
+ - **`projscan_semantic_graph` (`query` mode) / `projscan semantic-graph`** — direct one-hop queries via `query: { direction, file?, symbol? }`: `imports`, `exports`, `importers`, `symbol_defs`, `package_importers`. Use when impact is overkill and you want a pin-point answer. Package wording such as `which files import package chalk`, `who uses lodash`, or `why do we depend on lodash` maps to `package_importers`. With no `query`, returns the full graph projection (file, function, package, and symbol context in one contract). _(Subsumes the former `projscan_graph`, removed in 4.0.)_
260
262
 
261
263
  **Typical agent flow:** before renaming or deleting an export, call `projscan_impact --symbol <name>` to see the dependent set; before deleting a file, call `projscan_impact <path>`. The truncated flag tells you whether the actual blast radius extends beyond what you saw.
262
264
 
@@ -264,12 +266,12 @@ Before the agent commits to a refactor (or accepts a name-rename suggestion), th
264
266
 
265
267
  Long agent sessions edit files repeatedly. Each edit could otherwise cost a full repo re-scan. The watch infrastructure keeps the graph current at low cost.
266
268
 
267
- - **`projscan watch`** *(0.16+)* — long-running CLI command. On file change, debounces 200ms then runs the incremental graph update + re-runs `doctor`, printing a one-line status. Uses `node:fs.watch`, no new runtime dep. Filters out `node_modules`, `.git`, build dirs, etc.
269
+ - **`projscan watch`** _(0.16+)_ — long-running CLI command. On file change, debounces 200ms then runs the incremental graph update + re-runs `doctor`, printing a one-line status. Uses `node:fs.watch`, no new runtime dep. Filters out `node_modules`, `.git`, build dirs, etc.
268
270
  - **`incrementallyUpdateGraph(graph, rootPath, changedPaths[])`** — the public API the watcher uses; exported so callers maintaining their own state can patch the graph in place after handling their own change events.
269
- - **`--format html`** *(0.16+, expanded in 2.x)* — for sharing review snapshots: `projscan analyze --format html > report.html` produces a self-contained HTML page suitable for posting as a PR comment or saving as a CI artifact. Renderers exist for `analyze`, `doctor`, `hotspots`, `coupling`, `pr-diff`, `review`, `impact`, and `coverage`.
270
- - **`projscan mcp --watch`** *(1.3+)* — when projscan runs as an MCP server with this flag, it pushes JSON-RPC `notifications/file_changed` events to the connected agent on every debounced batch. Long-session agents stop polling. The capability is advertised under `experimental.fileChanged` on the `initialize` response so clients can detect support.
271
- - **`projscan_session` MCP tool + `projscan session` CLI** *(1.4+)* — durable cross-invocation session. Auto-records every file path that any tool returned (`tool-result` source) and every fs-watch batch (`fs-watch` source), so multiple agent invocations against the same project share a "what's been touched here" view without re-running git. Idle window 1 hour by default; subactions: `current` / `touched` / `events` / `reset`. State lives at `.projscan-cache/session.json`.
272
- - **MCP resources** *(2.1+)* — `projscan://session/summary`, `projscan://handoff`, and `projscan://risk-now` expose the shared session as resource reads. Agents can pick up touched files, coordination conflicts, remaining risks, `coordinationHints`, and recommended next tool calls without spending a tool call on discovery. The hints separate current worktree checks from remembered session context and conflict resolution.
271
+ - **`--format html`** _(0.16+, expanded in 2.x)_ — for sharing review snapshots: `projscan analyze --format html > report.html` produces a self-contained HTML page suitable for posting as a PR comment or saving as a CI artifact. Renderers exist for `analyze`, `doctor`, `hotspots`, `coupling`, `pr-diff`, `review`, `impact`, and `coverage`.
272
+ - **`projscan mcp --watch`** _(1.3+)_ — when projscan runs as an MCP server with this flag, it pushes JSON-RPC `notifications/file_changed` events to the connected agent on every debounced batch. Long-session agents stop polling. The capability is advertised under `experimental.fileChanged` on the `initialize` response so clients can detect support.
273
+ - **`projscan_session` MCP tool + `projscan session` CLI** _(1.4+)_ — durable cross-invocation session. Auto-records every file path that any tool returned (`tool-result` source) and every fs-watch batch (`fs-watch` source), so multiple agent invocations against the same project share a "what's been touched here" view without re-running git. Idle window 1 hour by default; subactions: `current` / `touched` / `events` / `reset`. State lives at `.projscan-cache/session.json`.
274
+ - **MCP resources** _(2.1+)_ — `projscan://session/summary`, `projscan://handoff`, and `projscan://risk-now` expose the shared session as resource reads. Agents can pick up touched files, coordination conflicts, remaining risks, `coordinationHints`, and recommended next tool calls without spending a tool call on discovery. The hints separate current worktree checks from remembered session context and conflict resolution.
273
275
 
274
276
  **Typical workflow:** start `projscan watch` in a side terminal at the start of a long session; subsequent agent tool calls hit a warm graph cache. With multi-agent setups, every MCP tool call additionally records into the session, so a coordinator agent can ask `projscan_session { action: "touched" }` to see what its peers have touched.
275
277
 
@@ -286,6 +288,7 @@ projscan analyze
286
288
  The flagship command. Runs every detection module and produces the full project report.
287
289
 
288
290
  **What it does internally:**
291
+
289
292
  1. Builds the scan file set. In Git repos, projscan uses `git ls-files --cached --others --exclude-standard` by default, then applies built-in noise ignores and `.projscanrc` `ignore` globs. Non-Git folders fall back to the local file walker.
290
293
  2. Builds a language breakdown by mapping file extensions to language names
291
294
  3. Detects frameworks by inspecting `package.json` dependencies and config file presence
@@ -296,9 +299,9 @@ The flagship command. Runs every detection module and produces the full project
296
299
 
297
300
  **Options:**
298
301
 
299
- | Flag | Description |
300
- |------|-------------|
301
- | `--changed-only` | Only report issues on files changed vs base ref |
302
+ | Flag | Description |
303
+ | ------------------ | -------------------------------------------------------- |
304
+ | `--changed-only` | Only report issues on files changed vs base ref |
302
305
  | `--base-ref <ref>` | Git base ref for `--changed-only` (default: origin/main) |
303
306
 
304
307
  <img src="https://abhiyoheswaran.com/images/projscan/hero-poster.png" alt="npx projscan analyze: banner, scan progress, full project report" width="700">
@@ -315,14 +318,15 @@ Use this when you want a quick "is this project in good shape?" answer without t
315
318
 
316
319
  **Options:**
317
320
 
318
- | Flag | Description |
319
- |------|-------------|
320
- | `--changed-only` | Only report issues on files changed vs base ref |
321
+ | Flag | Description |
322
+ | ------------------ | -------------------------------------------------------- |
323
+ | `--changed-only` | Only report issues on files changed vs base ref |
321
324
  | `--base-ref <ref>` | Git base ref for `--changed-only` (default: origin/main) |
322
325
 
323
326
  <img src="npx%20projscan%20doctor.gif" alt="npx projscan doctor" width="700">
324
327
 
325
328
  **Severity levels:**
329
+
326
330
  - **error** (✖) - Problems that should be addressed immediately
327
331
  - **warning** (⚠) - Issues that affect code quality or maintainability
328
332
  - **info** (ℹ) - Suggestions for best practices
@@ -339,12 +343,13 @@ Ranks files by **risk** - a combination of git churn, complexity (lines of code)
339
343
 
340
344
  **Options:**
341
345
 
342
- | Flag | Description | Default |
343
- |------|-------------|---------|
344
- | `--limit <n>` | Number of hotspots to show | 10 (or `hotspots.limit` from `.projscanrc`) |
345
- | `--since <when>` | Git history window (e.g. `"6 months ago"`, `"2024-01-01"`) | `12 months ago` |
346
+ | Flag | Description | Default |
347
+ | ---------------- | ---------------------------------------------------------- | ------------------------------------------- |
348
+ | `--limit <n>` | Number of hotspots to show | 10 (or `hotspots.limit` from `.projscanrc`) |
349
+ | `--since <when>` | Git history window (e.g. `"6 months ago"`, `"2024-01-01"`) | `12 months ago` |
346
350
 
347
351
  **What you get per file:**
352
+
348
353
  - `riskScore` - combined score (0–100)
349
354
  - `churn` - number of commits touching the file in the window
350
355
  - `distinctAuthors` - how many people have touched it
@@ -379,14 +384,14 @@ import a package.
379
384
 
380
385
  **Options:**
381
386
 
382
- | Flag | Description | Default |
383
- |------|-------------|---------|
384
- | `--max-nodes <n>` | Maximum nodes to return | 10000 |
385
- | `--max-edges <n>` | Maximum edges to return | 25000 |
387
+ | Flag | Description | Default |
388
+ | --------------------- | ---------------------------------------------------------------------------------------- | ---------- |
389
+ | `--max-nodes <n>` | Maximum nodes to return | 10000 |
390
+ | `--max-edges <n>` | Maximum edges to return | 25000 |
386
391
  | `--query <direction>` | Targeted query: `imports`, `exports`, `importers`, `symbol_defs`, or `package_importers` | full graph |
387
- | `--file <path>` | Repo-relative file for `imports`, `exports`, or `importers` | - |
388
- | `--symbol <name>` | Symbol/package for `symbol_defs` or `package_importers` | - |
389
- | `--limit <n>` | Maximum targeted query entries | 50 |
392
+ | `--file <path>` | Repo-relative file for `imports`, `exports`, or `importers` | - |
393
+ | `--symbol <name>` | Symbol/package for `symbol_defs` or `package_importers` | - |
394
+ | `--limit <n>` | Maximum targeted query entries | 50 |
390
395
 
391
396
  ### understand
392
397
 
@@ -402,21 +407,21 @@ Repo understanding for engineers before they edit. The command returns a cited r
402
407
 
403
408
  Views:
404
409
 
405
- | View | Use it for |
406
- |------|------------|
407
- | `map` | Orient around entrypoints, package boundaries, read-first files, risks, and unknowns |
408
- | `flow` | Trace runtime paths and side-effect sinks through graph-backed evidence |
409
- | `contracts` | Inspect public exports, config/env contracts, and likely breaking-change risks |
410
- | `change` | Tie an intent to blast radius, first safe edit, owner state, rollback, and verification commands |
411
- | `verify` | Build minimal, focused, and full proof tiers plus direct-test gap evidence |
410
+ | View | Use it for |
411
+ | ----------- | ------------------------------------------------------------------------------------------------ |
412
+ | `map` | Orient around entrypoints, package boundaries, read-first files, risks, and unknowns |
413
+ | `flow` | Trace runtime paths and side-effect sinks through graph-backed evidence |
414
+ | `contracts` | Inspect public exports, config/env contracts, and likely breaking-change risks |
415
+ | `change` | Tie an intent to blast radius, first safe edit, owner state, rollback, and verification commands |
416
+ | `verify` | Build minimal, focused, and full proof tiers plus direct-test gap evidence |
412
417
 
413
418
  **Options:**
414
419
 
415
- | Flag | Description | Default |
416
- |------|-------------|---------|
417
- | `--view <view>` | `map`, `flow`, `contracts`, `change`, or `verify` | `map` |
418
- | `--intent <text>` | Planned change or question for change-readiness output | none |
419
- | `--max-items <n>` | Maximum items per section | 8 |
420
+ | Flag | Description | Default |
421
+ | ----------------- | ------------------------------------------------------ | ------- |
422
+ | `--view <view>` | `map`, `flow`, `contracts`, `change`, or `verify` | `map` |
423
+ | `--intent <text>` | Planned change or question for change-readiness output | none |
424
+ | `--max-items <n>` | Maximum items per section | 8 |
420
425
 
421
426
  ### dataflow
422
427
 
@@ -429,18 +434,20 @@ graph. Bridge risks are graph-backed dataflow additions: a wrapper that calls a
429
434
  and a sink wrapper is surfaced even when legacy taint reachability cannot see a
430
435
  downstream call path from source to sink. By default, dataflow suppresses test-file paths,
431
436
  broad readFile/writeFile-style noise, and JavaScript RegExp.exec false positives.
437
+ Framework request-source detection covers narrow tested patterns for Next.js, Hono,
438
+ Express, Fastify, and Koa handlers while keeping lookalike helpers quiet.
432
439
 
433
440
  For release hardening, `npm run check:graph-corpus` compares bundled fixture metrics against `docs/graph-corpus-baseline.json`. The gate fails only when graph coverage drops below the baseline or dataflow risks rise above it.
434
441
 
435
442
  **Options:**
436
443
 
437
- | Flag | Description | Default |
438
- |------|-------------|---------|
439
- | `--source <name...>` | Add custom source identifiers | Built-ins + config |
440
- | `--sink <name...>` | Add custom sink identifiers | Built-ins + config |
441
- | `--max-risks <n>` | Maximum risks to return | 50 |
442
- | `--include-tests` | Include risks that touch test files | false |
443
- | `--include-broad-file-io` | Include broad default readFile/writeFile-style risks | false |
444
+ | Flag | Description | Default |
445
+ | ------------------------- | ---------------------------------------------------- | ------------------ |
446
+ | `--source <name...>` | Add custom source identifiers | Built-ins + config |
447
+ | `--sink <name...>` | Add custom sink identifiers | Built-ins + config |
448
+ | `--max-risks <n>` | Maximum risks to return | 50 |
449
+ | `--include-tests` | Include risks that touch test files | false |
450
+ | `--include-broad-file-io` | Include broad default readFile/writeFile-style risks | false |
444
451
 
445
452
  ### search
446
453
 
@@ -457,14 +464,15 @@ BM25-ranked search across content, symbol names, and path tokens. No embeddings,
457
464
 
458
465
  **Scopes:**
459
466
 
460
- | Scope | What it matches | Ranking |
461
- |-------|-----------------|---------|
462
- | `auto` (default) | Content, with symbol + path boost | BM25 + symbol boost × 2.0 + path boost × 0.5 |
463
- | `content` | Same as `auto` | BM25 |
464
- | `symbols` | Names of exported functions/classes/types/etc. | Exact → prefix → substring |
465
- | `files` | Relative path substring | Path order |
467
+ | Scope | What it matches | Ranking |
468
+ | ---------------- | ---------------------------------------------- | -------------------------------------------- |
469
+ | `auto` (default) | Content, with symbol + path boost | BM25 + symbol boost × 2.0 + path boost × 0.5 |
470
+ | `content` | Same as `auto` | BM25 |
471
+ | `symbols` | Names of exported functions/classes/types/etc. | Exact → prefix → substring |
472
+ | `files` | Relative path substring | Path order |
466
473
 
467
474
  **Query handling:**
475
+
468
476
  - Tokens are split on camelCase, snake_case, and digits. `userAuthToken` indexes as `user`, `auth`, `token`.
469
477
  - Light stemming (trailing `-s`, `-ing`, `-ed` stripped).
470
478
  - Stopwords and TypeScript keywords filtered (`the`, `function`, `class`, `export`, …).
@@ -473,7 +481,8 @@ BM25-ranked search across content, symbol names, and path tokens. No embeddings,
473
481
  **Output includes:** file path, line number, a one-line excerpt centered on the first matching line, the match score, and which tokens matched.
474
482
 
475
483
  **Limitations:**
476
- - No real semantic understanding by default. Searching for *"payment processing"* won't find a file that implements Stripe under the name `charge()`. True semantic search (local embeddings) shipped in 0.9.0 as an opt-in peer dep - install `@xenova/transformers` and pass `--mode semantic` (or `--mode hybrid` for BM25 + semantic via reciprocal rank fusion).
484
+
485
+ - No real semantic understanding by default. Searching for _"payment processing"_ won't find a file that implements Stripe under the name `charge()`. True semantic search (local embeddings) shipped in 0.9.0 as an opt-in peer dep - install `@xenova/transformers` and pass `--mode semantic` (or `--mode hybrid` for BM25 + semantic via reciprocal rank fusion).
477
486
  - Index is rebuilt on every run (fast - the AST is already parsed from the code-graph cache).
478
487
 
479
488
  ### file
@@ -490,7 +499,7 @@ Per-file drill-down. Combines everything ProjScan knows about a file into one vi
490
499
  - **Related issues** - every open issue whose `locations` reference the file
491
500
  - **Inline smells** - large files, `console.log`, TODO/FIXME, `any` types
492
501
 
493
- Natural follow-up to `projscan hotspots` - once hotspots tells you *which* file to look at, `file` tells you *what* to do about it.
502
+ Natural follow-up to `projscan hotspots` - once hotspots tells you _which_ file to look at, `file` tells you _what_ to do about it.
494
503
 
495
504
  ### ci
496
505
 
@@ -502,11 +511,11 @@ A CI-pipeline-friendly health gate. Runs the full health check and exits with co
502
511
 
503
512
  **Options:**
504
513
 
505
- | Flag | Description | Default |
506
- |------|-------------|---------|
507
- | `--min-score <n>` | Minimum passing score (0–100) | `minScore` from `.projscanrc`, else 70 |
508
- | `--changed-only` | Gate only on issues in files changed vs base ref | off |
509
- | `--base-ref <ref>` | Git base ref for `--changed-only` | auto (origin/main → origin/master → main → master → HEAD~1) |
514
+ | Flag | Description | Default |
515
+ | ------------------ | ------------------------------------------------ | ----------------------------------------------------------- |
516
+ | `--min-score <n>` | Minimum passing score (0–100) | `minScore` from `.projscanrc`, else 70 |
517
+ | `--changed-only` | Gate only on issues in files changed vs base ref | off |
518
+ | `--base-ref <ref>` | Git base ref for `--changed-only` | auto (origin/main → origin/master → main → master → HEAD~1) |
510
519
 
511
520
  **Example:**
512
521
 
@@ -519,6 +528,7 @@ projscan: B (82/100) - 0 errors, 2 warnings, 1 info - PASS (threshold: 80)
519
528
  <img src="npx%20projscan%20ci%20--min-score%2070.gif" alt="npx projscan ci" width="700">
520
529
 
521
530
  **Exit codes:**
531
+
522
532
  - `0` - Score meets or exceeds the threshold
523
533
  - `1` - Score is below the threshold
524
534
 
@@ -553,9 +563,9 @@ Compare your project's current health and hotspots against a saved baseline. Use
553
563
 
554
564
  **Options:**
555
565
 
556
- | Flag | Description |
557
- |------|-------------|
558
- | `--save-baseline` | Save current health + top hotspots as the baseline |
566
+ | Flag | Description |
567
+ | ------------------- | ---------------------------------------------------------- |
568
+ | `--save-baseline` | Save current health + top hotspots as the baseline |
559
569
  | `--baseline <path>` | Path to baseline file (default: `.projscan-baseline.json`) |
560
570
 
561
571
  **Workflow:**
@@ -593,12 +603,12 @@ projscan fix -y
593
603
 
594
604
  **Available fixes:**
595
605
 
596
- | Fix | What it creates | What it installs |
597
- |-----|----------------|-----------------|
598
- | ESLint | `eslint.config.js` (with TypeScript support if TS is detected) | `eslint`, `@eslint/js`, optionally `typescript-eslint` |
599
- | Prettier | `.prettierrc` with sensible defaults | `prettier` |
600
- | Test framework | `vitest.config.ts` + sample test file, adds `test` script to package.json | `vitest` |
601
- | EditorConfig | `.editorconfig` (UTF-8, LF, 2-space indent, trim trailing whitespace) | Nothing |
606
+ | Fix | What it creates | What it installs |
607
+ | -------------- | ------------------------------------------------------------------------- | ------------------------------------------------------ |
608
+ | ESLint | `eslint.config.js` (with TypeScript support if TS is detected) | `eslint`, `@eslint/js`, optionally `typescript-eslint` |
609
+ | Prettier | `.prettierrc` with sensible defaults | `prettier` |
610
+ | Test framework | `vitest.config.ts` + sample test file, adds `test` script to package.json | `vitest` |
611
+ | EditorConfig | `.editorconfig` (UTF-8, LF, 2-space indent, trim trailing whitespace) | Nothing |
602
612
 
603
613
  ### diagram
604
614
 
@@ -639,6 +649,7 @@ projscan outdated
639
649
  Offline drift check - compares the version declared in `package.json` against the version installed under `node_modules/<pkg>/package.json`. Classifies each package as `patch`, `minor`, `major`, `same`, or `unknown` drift. Does **not** hit the npm registry.
640
650
 
641
651
  **Output fields per package:**
652
+
642
653
  - `declared` - the range in `package.json` (e.g., `^1.2.3`)
643
654
  - `installed` - the concrete version in `node_modules`, or `null` if not installed
644
655
  - `latest` - same as `installed` in this offline drift check
@@ -669,9 +680,9 @@ Each finding becomes a SARIF result with `ruleId: audit-<pkg>`, severity mapped
669
680
 
670
681
  **Options:**
671
682
 
672
- | Flag | Description | Default |
673
- |------|-------------|---------|
674
- | `--timeout <ms>` | Override npm audit timeout | 60000 |
683
+ | Flag | Description | Default |
684
+ | ---------------- | -------------------------- | ------- |
685
+ | `--timeout <ms>` | Override npm audit timeout | 60000 |
675
686
 
676
687
  ### upgrade
677
688
 
@@ -679,13 +690,16 @@ Each finding becomes a SARIF result with `ruleId: audit-<pkg>`, severity mapped
679
690
  projscan upgrade <package>
680
691
  ```
681
692
 
682
- Preview the impact of upgrading a package. The default path is fully offline; pass `--check-registry` when you explicitly want npm registry lookup for the current latest version.
693
+ Preview the impact of upgrading a package. The default path is fully offline; pass `--check-registry` when you explicitly want npm registry lookup for the current latest npm version.
683
694
 
684
695
  **What you get:**
696
+
685
697
  - Drift classification (`patch` / `minor` / `major`)
686
698
  - Breaking-change markers found in the CHANGELOG: scans for `BREAKING CHANGE`, `deprecated`, `removed support`, `no longer supported`, and section headers containing "breaking"
687
699
  - CHANGELOG excerpt sliced to the relevant version range (read from `node_modules/<pkg>/CHANGELOG.md`)
688
700
  - Importer list - every file in your source tree that imports the package (direct or sub-path)
701
+ - Python manifest evidence for packages declared in `pyproject.toml`, `setup.cfg`, `setup.py`, or root `requirements*.txt`
702
+ - Python current-version evidence from `poetry.lock` package blocks or pinned root `requirements*.txt` entries
689
703
 
690
704
  **Example:**
691
705
 
@@ -704,8 +718,10 @@ $ projscan upgrade react --format markdown
704
718
  ```
705
719
 
706
720
  **Limitations:**
721
+
707
722
  - Reads the CHANGELOG that npm already placed in `node_modules/`. If the package author doesn't ship one, you'll see "No local CHANGELOG found."
708
723
  - Without `--check-registry`, works with what's **installed** and reports `latestSource: "installed"`. With `--check-registry`, npm registry lookup is attempted and failures fall back to the installed version with `registryError`.
724
+ - Python previews stay offline. They do not query PyPI; current-version evidence comes from supported local lockfiles or pinned root requirements.
709
725
 
710
726
  ### coverage
711
727
 
@@ -716,11 +732,13 @@ projscan coverage
716
732
  Joins test coverage with the hotspot ranking and produces a list sorted by "risk × uncovered fraction" - the files that most deserve tests.
717
733
 
718
734
  **Supported formats** (auto-detected in this order):
735
+
719
736
  - `coverage/lcov.info` - lcov format (Vitest, Jest, c8)
720
737
  - `coverage/coverage-final.json` - Istanbul per-file detail
721
738
  - `coverage/coverage-summary.json` - Istanbul summary
722
739
 
723
740
  **Output fields per entry:**
741
+
724
742
  - `relativePath` - file path
725
743
  - `riskScore` - the file's hotspot risk
726
744
  - `coverage` - line coverage %, or `null` if the file isn't in the coverage report
@@ -729,8 +747,8 @@ Joins test coverage with the hotspot ranking and produces a list sorted by "risk
729
747
 
730
748
  **Options:**
731
749
 
732
- | Flag | Description | Default |
733
- |------|-------------|---------|
750
+ | Flag | Description | Default |
751
+ | ------------- | --------------------------- | ------------ |
734
752
  | `--limit <n>` | Number of entries to return | 30 (max 200) |
735
753
 
736
754
  **How it feeds into `hotspots`:** when any coverage file exists, `projscan hotspots` automatically passes it into the risk calculator. Uncovered churning files get a score bump and a `low coverage (X%)` reason tag. No coverage file? Hotspots behaves exactly as before.
@@ -758,7 +776,7 @@ With `--watch`, the server starts an in-process file watcher and emits a JSON-RP
758
776
 
759
777
  See [MCP Server for AI Agents](#mcp-server-for-ai-agents).
760
778
 
761
- ### session *(1.4+)*
779
+ ### session _(1.4+)_
762
780
 
763
781
  ```bash
764
782
  projscan session # current session summary
@@ -829,22 +847,23 @@ Every `projscan doctor` and `projscan badge` run calculates a health score from
829
847
  **Scoring:**
830
848
 
831
849
  | Severity | Deduction per issue |
832
- |----------|-------------------|
833
- | Error | -20 points |
834
- | Warning | -10 points |
835
- | Info | -3 points |
850
+ | -------- | ------------------- |
851
+ | Error | -20 points |
852
+ | Warning | -10 points |
853
+ | Info | -3 points |
836
854
 
837
855
  **Grade thresholds:**
838
856
 
839
- | Grade | Score Range | Meaning |
840
- |-------|-------------|---------|
841
- | A | 90–100 | Excellent - project follows best practices |
842
- | B | 80–89 | Good - minor improvements possible |
843
- | C | 70–79 | Fair - several issues to address |
844
- | D | 60–69 | Poor - significant issues found |
845
- | F | < 60 | Critical - major issues need attention |
857
+ | Grade | Score Range | Meaning |
858
+ | ----- | ----------- | ------------------------------------------ |
859
+ | A | 90–100 | Excellent - project follows best practices |
860
+ | B | 80–89 | Good - minor improvements possible |
861
+ | C | 70–79 | Fair - several issues to address |
862
+ | D | 60–69 | Poor - significant issues found |
863
+ | F | < 60 | Critical - major issues need attention |
846
864
 
847
865
  The score appears in all output formats:
866
+
848
867
  - **Console**: Shown at the top of the doctor report
849
868
  - **JSON**: Included as `health.score` and `health.grade` fields
850
869
  - **Markdown**: Shown as a heading with an auto-generated shields.io badge
@@ -868,6 +887,8 @@ Machine-readable output. Useful for piping into other tools, storing results, or
868
887
  ```bash
869
888
  projscan analyze --format json | jq '.issues[] | select(.severity == "error")'
870
889
  projscan analyze --format json > analysis.json
890
+ projscan analyze --report-scope src/api --redact-paths --format json > scoped-analysis.json
891
+ projscan analyze --report-policy apiEvidence --format json > scoped-analysis.json
871
892
  ```
872
893
 
873
894
  ### Markdown
@@ -898,11 +919,19 @@ projscan ci --format sarif > projscan.sarif
898
919
  ```
899
920
 
900
921
  Supported on `analyze`, `audit`, `ci`, `doctor`, and `outdated`. Each issue is emitted as a SARIF `result` with:
922
+
901
923
  - `ruleId` - stable rule identifier (e.g., `hardcoded-secret`, `missing-prettier`)
902
924
  - `level` - `error`, `warning`, or `note` (mapped from projscan severity)
903
925
  - `message.text` - the issue description
904
926
  - `locations` - real file + line/column when the analyzer can supply them (security findings include line numbers); project-level issues anchor to repo root
905
927
  - `properties.category` - the analyzer category (`security`, `formatting`, `architecture`, …)
928
+
929
+ For shareable evidence artifacts, `analyze`, `doctor`, and `ci` accept
930
+ `--report-policy <name>`, `--report-scope <paths>`, and `--redact-paths`. Scope
931
+ is comma-separated and repo-relative. Redaction replaces file paths with stable
932
+ labels while preserving correlation across issues and files in the same report.
933
+ Direct `--report-scope` and `--redact-paths` flags override the selected preset
934
+ for a single run.
906
935
  - `properties.fixAvailable` - whether `projscan fix` can remediate it
907
936
 
908
937
  When uploaded to GitHub Code Scanning, findings appear in the **Security → Code scanning** tab and (for PRs) as inline annotations on changed lines.
@@ -936,6 +965,12 @@ ProjScan loads a project-wide config from one of:
936
965
  "severityOverrides": {
937
966
  "missing-prettier": "info"
938
967
  },
968
+ "reportPolicies": {
969
+ "apiEvidence": {
970
+ "reportScope": ["src/api", "packages/backend"],
971
+ "redactPaths": true
972
+ }
973
+ },
939
974
  "hotspots": {
940
975
  "limit": 20,
941
976
  "since": "6 months ago"
@@ -945,18 +980,19 @@ ProjScan loads a project-wide config from one of:
945
980
 
946
981
  ### Fields
947
982
 
948
- | Field | Type | Effect |
949
- |-------|------|--------|
950
- | `minScore` | number (0–100) | Default threshold for `projscan ci`. Clamped to 0–100. |
951
- | `baseRef` | string | Default base ref for `--changed-only`. |
952
- | `ignore` | string[] | Extra glob patterns added to the built-in ignore list (`node_modules`, `.git`, `dist`, `build`, `coverage`, `.next`, `.nuxt`, `.cache`, `.turbo`, `.output`). |
953
- | `scan.includeIgnored` | boolean | Explicitly include files hidden by Git ignore rules. Default `false`. |
954
- | `scan.scanEnvValues` | boolean | Explicitly read `.env*` contents during secret-pattern checks. Default `false`; `.env` files are path-only. |
955
- | `scan.offline` | boolean | Block projscan network-capable features: telemetry sending, `audit`, registry checks, and optional semantic model loading. Default `false`. |
956
- | `disableRules` | string[] | Silence rules by id. Exact match (`missing-prettier`) or wildcard prefix (`large-*`). |
957
- | `severityOverrides` | `Record<string, 'info' \| 'warning' \| 'error'>` | Remap a rule's severity. Useful for downgrading project-specific false positives without disabling them. |
958
- | `hotspots.limit` | number (1–100) | Default limit for `projscan hotspots`. |
959
- | `hotspots.since` | string | Default git history window for `projscan hotspots`. |
983
+ | Field | Type | Effect |
984
+ | --------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
985
+ | `minScore` | number (0–100) | Default threshold for `projscan ci`. Clamped to 0–100. |
986
+ | `baseRef` | string | Default base ref for `--changed-only`. |
987
+ | `ignore` | string[] | Extra glob patterns added to the built-in ignore list (`node_modules`, `.git`, `dist`, `build`, `coverage`, `.next`, `.nuxt`, `.cache`, `.turbo`, `.output`). |
988
+ | `scan.includeIgnored` | boolean | Explicitly include files hidden by Git ignore rules. Default `false`. |
989
+ | `scan.scanEnvValues` | boolean | Explicitly read `.env*` contents during secret-pattern checks. Default `false`; `.env` files are path-only. |
990
+ | `scan.offline` | boolean | Block projscan network-capable features: telemetry sending, `audit`, registry checks, and optional semantic model loading. Default `false`. |
991
+ | `disableRules` | string[] | Silence rules by id. Exact match (`missing-prettier`) or wildcard prefix (`large-*`). |
992
+ | `severityOverrides` | `Record<string, 'info' \| 'warning' \| 'error'>` | Remap a rule's severity. Useful for downgrading project-specific false positives without disabling them. |
993
+ | `reportPolicies` | `Record<string, { reportScope?: string[]; redactPaths?: boolean }>` | Named evidence export presets selected with `--report-policy <name>` on `analyze`, `doctor`, and `ci`. |
994
+ | `hotspots.limit` | number (1–100) | Default limit for `projscan hotspots`. |
995
+ | `hotspots.since` | string | Default git history window for `projscan hotspots`. |
960
996
 
961
997
  Invalid JSON in a discovered config file is a hard error - projscan exits rather than silently ignoring it.
962
998
 
@@ -974,7 +1010,7 @@ If you prefer to keep everything in `package.json`:
974
1010
  }
975
1011
  ```
976
1012
 
977
- ### Monorepo: cross-package import policy *(0.14+)*
1013
+ ### Monorepo: cross-package import policy _(0.14+)_
978
1014
 
979
1015
  In a monorepo, you can declare which packages may import which. Violations surface as `cross-package-violation-N` issues in `projscan_doctor` and on the CLI. The analyzer is **off by default**; adding any rule turns it on for the matching `from` package.
980
1016
 
@@ -1035,19 +1071,22 @@ Example GitHub Actions snippet:
1035
1071
 
1036
1072
  ## Global Options
1037
1073
 
1038
- | Option | Description |
1039
- |--------|-------------|
1040
- | `--format <type>` | Output format: `console` (default), `json`, `markdown`, `sarif`, `html` (command-dependent) |
1041
- | `--config <path>` | Path to a `.projscanrc` config file |
1042
- | `--include-ignored` | Explicitly include files hidden by Git ignore rules |
1043
- | `--scan-env-values` | Explicitly read `.env*` contents during secret checks |
1044
- | `--offline` | Block projscan network-capable features for this run |
1045
- | `--changed-only` | Scope to files changed vs base ref (applies to `analyze`, `doctor`, `ci`) |
1046
- | `--base-ref <ref>` | Git base ref for `--changed-only` (default: origin/main) |
1047
- | `--verbose` | Show debug-level logging - useful for diagnosing scan issues |
1048
- | `--quiet` | Suppress all non-essential output (spinners, status messages) |
1049
- | `-V, --version` | Print the version number |
1050
- | `-h, --help` | Print help for any command |
1074
+ | Option | Description |
1075
+ | ------------------- | ------------------------------------------------------------------------------------------- |
1076
+ | `--format <type>` | Output format: `console` (default), `json`, `markdown`, `sarif`, `html` (command-dependent) |
1077
+ | `--config <path>` | Path to a `.projscanrc` config file |
1078
+ | `--include-ignored` | Explicitly include files hidden by Git ignore rules |
1079
+ | `--scan-env-values` | Explicitly read `.env*` contents during secret checks |
1080
+ | `--offline` | Block projscan network-capable features for this run |
1081
+ | `--changed-only` | Scope to files changed vs base ref (applies to `analyze`, `doctor`, `ci`) |
1082
+ | `--base-ref <ref>` | Git base ref for `--changed-only` (default: origin/main) |
1083
+ | `--report-policy <name>` | Use a named report policy preset from config (`analyze`, `doctor`, `ci`) |
1084
+ | `--report-scope <paths>` | Comma-separated repo-relative paths to include in exported evidence (`analyze`, `doctor`, `ci`) |
1085
+ | `--redact-paths` | Replace file paths in exported evidence with stable labels (`analyze`, `doctor`, `ci`) |
1086
+ | `--verbose` | Show debug-level logging - useful for diagnosing scan issues |
1087
+ | `--quiet` | Suppress all non-essential output (spinners, status messages) |
1088
+ | `-V, --version` | Print the version number |
1089
+ | `-h, --help` | Print help for any command |
1051
1090
 
1052
1091
  **Per-command help:**
1053
1092
 
@@ -1085,31 +1124,37 @@ Each detection has a **confidence level** (high, medium, low) and a **category**
1085
1124
  ProjScan ships with six analyzer modules:
1086
1125
 
1087
1126
  #### 1. ESLint Check
1127
+
1088
1128
  - Looks for `.eslintrc.*`, `eslint.config.*`, or `eslintConfig` in package.json
1089
1129
  - If missing: warning with auto-fix available
1090
1130
 
1091
1131
  #### 2. Prettier Check
1132
+
1092
1133
  - Looks for `.prettierrc`, `.prettierrc.*`, `prettier.config.*`, or `prettier` in package.json
1093
1134
  - If missing: warning with auto-fix available
1094
1135
 
1095
1136
  #### 3. Test Check
1137
+
1096
1138
  - Looks for test frameworks in devDependencies (vitest, jest, mocha, etc.)
1097
1139
  - Looks for test files (`*.test.*`, `*.spec.*`, `__tests__/`)
1098
1140
  - If no framework: warning with auto-fix available
1099
1141
  - If framework exists but zero test files: separate warning
1100
1142
 
1101
1143
  #### 4. Architecture Check
1144
+
1102
1145
  - **Large utility directories**: warns if `utils/`, `helpers/`, or `lib/` contains 10+ files (issue anchored to the directory path)
1103
1146
  - **Missing .editorconfig**: info with auto-fix available
1104
1147
  - **Missing/empty README**: warning / info
1105
1148
 
1106
1149
  #### 5. Dependency Risk Check
1150
+
1107
1151
  - Warns if production dependencies exceed 50
1108
1152
  - Errors if total dependencies exceed 100
1109
1153
  - Flags `*` or `latest` version ranges
1110
1154
  - Warns if no lock file is present
1111
1155
 
1112
1156
  #### 6. Security Check
1157
+
1113
1158
  - **Committed `.env` files**: Flags `.env`, `.env.local`, `.env.production`, etc. (but not `.env.example`, `.env.sample`, `.env.template`) - location anchored to the file
1114
1159
  - **Private key files**: Detects `.pem`, `.key`, `id_rsa`, `id_ed25519`, `.p12`, `.pfx` files
1115
1160
  - **Hardcoded secrets**: Scans file contents (files under 512KB) for:
@@ -1118,7 +1163,7 @@ ProjScan ships with six analyzer modules:
1118
1163
  - Slack tokens (`xoxb-...`, `xoxp-...`)
1119
1164
  - Generic patterns (`password=`, `secret=`, `api_key=` with quoted values)
1120
1165
  - PEM private key headers
1121
- Each finding carries the exact **line number** of the match, which SARIF and GitHub Code Scanning use for inline PR annotations.
1166
+ Each finding carries the exact **line number** of the match, which SARIF and GitHub Code Scanning use for inline PR annotations.
1122
1167
  - **Missing `.gitignore` entries**: Warns if `.env` is not in `.gitignore`
1123
1168
  - **Path-only `.env` handling**: Tracked `.env*` files are flagged by filename, but their values are not read unless `--scan-env-values` or `scan.scanEnvValues: true` is set
1124
1169
 
@@ -1142,11 +1187,13 @@ The fix system is intentionally conservative. It only creates configuration file
1142
1187
  ### Fix details
1143
1188
 
1144
1189
  **ESLint fix:**
1190
+
1145
1191
  - Creates `eslint.config.js` using the flat config format (ESLint v9+)
1146
1192
  - If TypeScript files are detected, includes `typescript-eslint` plugin
1147
1193
  - Installs `eslint` and `@eslint/js` via the detected package manager
1148
1194
 
1149
1195
  **Prettier fix:**
1196
+
1150
1197
  - Creates `.prettierrc` with these defaults:
1151
1198
  ```json
1152
1199
  {
@@ -1160,12 +1207,14 @@ The fix system is intentionally conservative. It only creates configuration file
1160
1207
  - Installs `prettier`
1161
1208
 
1162
1209
  **Test framework fix:**
1210
+
1163
1211
  - Creates `vitest.config.ts`
1164
1212
  - Creates a sample test file at `tests/example.test.ts`
1165
1213
  - Adds `"test": "vitest run"` to package.json scripts (if not already present)
1166
1214
  - Installs `vitest`
1167
1215
 
1168
1216
  **EditorConfig fix:**
1217
+
1169
1218
  - Creates `.editorconfig`
1170
1219
  - Installs nothing - EditorConfig is handled by editor plugins
1171
1220
 
@@ -1189,6 +1238,7 @@ This is heuristic-based and works best with conventional project structures. Pro
1189
1238
  The `explain` command performs regex-based static analysis. It does not execute your code or make network calls.
1190
1239
 
1191
1240
  **Import detection** handles:
1241
+
1192
1242
  - ES modules: `import { foo } from 'bar'`
1193
1243
  - Default imports: `import foo from 'bar'`
1194
1244
  - Namespace imports: `import * as foo from 'bar'`
@@ -1196,11 +1246,13 @@ The `explain` command performs regex-based static analysis. It does not execute
1196
1246
  - CommonJS: `const foo = require('bar')`
1197
1247
 
1198
1248
  **Export detection** handles:
1249
+
1199
1250
  - Named exports: `export function`, `export class`, `export const`
1200
1251
  - Type exports: `export interface`, `export type`
1201
1252
  - Default exports: `export default`
1202
1253
 
1203
1254
  **Purpose inference** is based on file name and directory conventions. For example:
1255
+
1204
1256
  - Files named `*.test.*` or `*.spec.*` → "Test file"
1205
1257
  - Files in `routes/` → "Route definitions"
1206
1258
  - Files named `index.ts` → "Module entry point"
@@ -1212,15 +1264,16 @@ The `explain` command performs regex-based static analysis. It does not execute
1212
1264
 
1213
1265
  The `hotspots` command reads `git log` to build a per-file risk picture. The risk score combines five signals:
1214
1266
 
1215
- | Signal | Weight | Intuition |
1216
- |--------|--------|-----------|
1217
- | Churn | 0.40 | Files that change often are more likely to harbor bugs |
1218
- | Complexity (AST CC) | 0.30 | Files with more decision points are harder to reason about. **AST-derived McCabe cyclomatic complexity for JS/TS, Python, Go, Java, Ruby, Rust, PHP, and C#; falls back to LOC for non-AST languages.** |
1219
- | Issue density | 0.20 | Files that already have open issues need help |
1220
- | Recency | 0.10 | Recently touched hot files deserve attention first |
1221
- | Bus factor | penalty tag | Single-author + high churn = organizational risk |
1267
+ | Signal | Weight | Intuition |
1268
+ | ------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
1269
+ | Churn | 0.40 | Files that change often are more likely to harbor bugs |
1270
+ | Complexity (AST CC) | 0.30 | Files with more decision points are harder to reason about. **AST-derived McCabe cyclomatic complexity for JS/TS, Python, Go, Java, Ruby, Rust, PHP, and C#; falls back to LOC for non-AST languages.** |
1271
+ | Issue density | 0.20 | Files that already have open issues need help |
1272
+ | Recency | 0.10 | Recently touched hot files deserve attention first |
1273
+ | Bus factor | penalty tag | Single-author + high churn = organizational risk |
1222
1274
 
1223
1275
  **Ownership signals:**
1276
+
1224
1277
  - `primaryAuthor` - the top committer by share
1225
1278
  - `primaryAuthorShare` - fraction of commits (0–1)
1226
1279
  - `topAuthors` - ranked list
@@ -1229,6 +1282,7 @@ The `hotspots` command reads `git log` to build a per-file risk picture. The ris
1229
1282
  **Bus-factor-one files get a score penalty and a `bus-factor-one` reason tag** - they show up higher in the ranking because if that one author leaves, the knowledge is gone.
1230
1283
 
1231
1284
  **What "hotspots" can't do:**
1285
+
1232
1286
  - It's a heuristic, not a proof. Low-risk files may still have bugs.
1233
1287
  - It weights LOC as a proxy for complexity; a clean 1,000-line file may rank higher than it deserves.
1234
1288
  - It has no visibility into logical coupling - two small files that change together still look independent.
@@ -1243,16 +1297,17 @@ The `hotspots` command reads `git log` to build a per-file risk picture. The ris
1243
1297
 
1244
1298
  **Core tools include:**
1245
1299
 
1246
- *Structural / agent-native:*
1300
+ _Structural / agent-native:_
1301
+
1247
1302
  - `projscan_start` — first-60-seconds repo orientation with setup diagnostics, recommended workflow, top risks, adoption gaps, and next commands.
1248
- - `projscan_semantic_graph` — the code graph, two ways. With no `query`: the stable v3 semantic graph (file/function/package/symbol nodes and normalized structural edges). With `query: { direction, file?, symbol? }`: a targeted structural query (`imports`, `exports`, `importers`, `symbol_defs`, `package_importers`) in milliseconds on a warm cache. *(Subsumes the former `projscan_graph`, removed in 4.0.)*
1303
+ - `projscan_semantic_graph` — the code graph, two ways. With no `query`: the stable v3 semantic graph (file/function/package/symbol nodes and normalized structural edges). With `query: { direction, file?, symbol? }`: a targeted structural query (`imports`, `exports`, `importers`, `symbol_defs`, `package_importers`) in milliseconds on a warm cache. _(Subsumes the former `projscan_graph`, removed in 4.0.)_
1249
1304
  - `projscan_dataflow` — direct, propagated, and bridge source-to-sink dataflow risks over the function graph.
1250
1305
  - `projscan_search` — BM25-ranked search. Scopes: `auto` / `content` (ranked content + symbol + path boosts, line excerpts), `symbols` (exported names), `files` (path substring). Optional semantic mode + sub-file chunking with the `@xenova/transformers` peer dep.
1251
1306
  - `projscan_coupling` — per-file fan-in / fan-out / instability + Tarjan circular-import cycles.
1252
1307
  - `projscan_pr_diff` — structural (AST) diff between two refs. Returns added / removed / modified files with explicit lists of exports, imports, call sites, and ΔCC / Δfan-in.
1253
1308
  - `projscan_review` — one-call PR review composing `pr_diff` + per-changed-file risk + new/expanded cycles + risky function additions + dependency changes + a verdict (`ok` / `review` / `block`).
1254
1309
  - `projscan_workplan` — prioritized agent execution plan with evidence, suggested tools, verification commands, coordination context, and handoff text.
1255
- - `projscan_bug_hunt` — prioritized bug-hunt fix queue with per-target verification.
1310
+ - `projscan_bug_hunt` — prioritized bug-hunt action queue with per-action verification.
1256
1311
  - `projscan_agent_brief` — compact next-agent context packet with focus items, guardrails, repo context, and suggested next actions.
1257
1312
  - `projscan_quality_scorecard` — dimensioned quality view with top risks and verification commands.
1258
1313
  - `projscan_adoption` — adoption helper for MCP client snippets, MCP setup doctor, agent workflow recipes, and first-run diagnostics.
@@ -1263,7 +1318,8 @@ The `hotspots` command reads `git log` to build a per-file risk picture. The ris
1263
1318
  - `projscan_explain_issue` — deep dive on one issue: code excerpt, related issues, similar past commits via `git log --grep`, plus the structured FixSuggestion.
1264
1319
  - `projscan_impact` — transitive blast-radius for a file or symbol. BFS over reverse imports + symbol callsites. Cycle-safe; depth-bounded.
1265
1320
 
1266
- *Analysis:*
1321
+ _Analysis:_
1322
+
1267
1323
  - `projscan_analyze` — full project snapshot.
1268
1324
  - `projscan_doctor` — health score + issues with inline `suggestedAction` hints.
1269
1325
  - `projscan_preflight` — compact `proceed` / `caution` / `block` gate with health, changed-file, review, session, plugin, and supply-chain evidence.
@@ -1272,23 +1328,26 @@ The `hotspots` command reads `git log` to build a per-file risk picture. The ris
1272
1328
  - `projscan_structure` — directory tree.
1273
1329
  - `projscan_coverage` — coverage × hotspots, ranked by "risk × uncovered fraction".
1274
1330
 
1275
- *Dependencies (workspace-aware in monorepos):*
1331
+ _Dependencies (workspace-aware in monorepos):_
1332
+
1276
1333
  - `projscan_dependencies` — declared deps + risks, with a `byWorkspace` breakdown.
1277
1334
  - `projscan_outdated` — declared-vs-installed drift (offline), per-package.
1278
1335
  - `projscan_audit` — npm audit, normalized; `package` arg scopes findings to one workspace's direct deps.
1279
1336
  - `projscan_upgrade` — upgrade preview: drift + local CHANGELOG + importers.
1280
1337
 
1281
- *Workspace:*
1338
+ _Workspace:_
1339
+
1282
1340
  - `projscan_workspaces` — list monorepo packages (npm/yarn/pnpm/Nx/Turbo/Lerna).
1283
1341
 
1284
- *Session (1.4+):*
1342
+ _Session (1.4+):_
1343
+
1285
1344
  - `projscan_session` — durable cross-invocation session. Subactions: `current`, `touched`, `events`, `reset`. Auto-populated from every tool result and from `notifications/file_changed` push events when `--watch` is on.
1286
1345
 
1287
1346
  **Every tool accepts `max_tokens` (optional).** projscan estimates serialized output and truncates the largest array field until it fits. Over-budget responses include a `_budget: { truncated: true, estimatedTokens, maxTokens }` field. Tools that return arrays also support cursor pagination via `cursor` + `page_size`.
1288
1347
 
1289
1348
  **Every tool result also carries a `_cost` sidecar (1.5+).** `_cost: { estimatedTokens: N }` lets agents see what they paid for a call without counting tokens themselves — useful for budgeting tool sequences. Cost is the chars-divided-by-4 approximation of the serialized payload (within ~±15% of GPT/Claude tokenizers for code-shaped output).
1290
1349
 
1291
- **`projscan_review` accepts `max_cost_tokens` (1.5+).** Adaptive shape budget. The tool picks a tier based on the value and reshapes the response *before* serializing — different from `max_tokens` (post-hoc truncation):
1350
+ **`projscan_review` accepts `max_cost_tokens` (1.5+).** Adaptive shape budget. The tool picks a tier based on the value and reshapes the response _before_ serializing — different from `max_tokens` (post-hoc truncation):
1292
1351
 
1293
1352
  - **full** (no budget, or ≥ 7000): everything — full structural diff + per-changed-file lists + all cycles + risky functions + dependency changes.
1294
1353
  - **summary** (3000–6999): verdict + summary + top-5 changed files + top-3 of each list, with the heavy per-file expansion arrays stripped.
@@ -1301,14 +1360,16 @@ The chosen tier is surfaced as a top-level `tier` field on the response and lift
1301
1360
  For the analyzer and reporter plugin platform, including minimal manifests, analyzer modules, and `--reporter <name>`, see [Plugin Authoring](PLUGIN-AUTHORING.md). Reporter plugins are the supported boundary for custom presentation, white-label reports, and team-branded CLI summaries; the built-in HTML reporter remains the default core renderer.
1302
1361
 
1303
1362
  **Prompts (6, parameterized with live project data):**
1363
+
1304
1364
  - `prioritize_refactoring` — ranked plan grounded in current hotspots
1305
1365
  - `investigate_file` — senior-engineer brief for a specific file
1306
- - `refactor_hotspot` *(1.5+)* — step-by-step refactor plan for one hotspot file
1307
- - `triage_doctor_issues` *(1.5+)* — critical / important / backlog ordering of open issues
1308
- - `review_this_pr` *(1.5+)* — PR-comment-ready review primed with the structural diff and verdict
1309
- - `safely_rename_symbol` *(1.5+)* — ordered rename + verification checklist via `projscan_impact` blast radius
1366
+ - `refactor_hotspot` _(1.5+)_ — step-by-step refactor plan for one hotspot file
1367
+ - `triage_doctor_issues` _(1.5+)_ — critical / important / backlog ordering of open issues
1368
+ - `review_this_pr` _(1.5+)_ — PR-comment-ready review primed with the structural diff and verdict
1369
+ - `safely_rename_symbol` _(1.5+)_ — ordered rename + verification checklist via `projscan_impact` blast radius
1310
1370
 
1311
1371
  **Resources (3, readable on demand):**
1372
+
1312
1373
  - `projscan://health`
1313
1374
  - `projscan://hotspots`
1314
1375
  - `projscan://structure`
@@ -1332,7 +1393,7 @@ claude mcp add projscan -- npx projscan mcp
1332
1393
  }
1333
1394
  ```
1334
1395
 
1335
- Once connected, your agent can ask *"what are the riskiest files in this repo?"* or *"run projscan_doctor before proposing an edit"* and get grounded answers.
1396
+ Once connected, your agent can ask _"what are the riskiest files in this repo?"_ or _"run projscan_doctor before proposing an edit"_ and get grounded answers.
1336
1397
 
1337
1398
  ---
1338
1399
 
@@ -1340,14 +1401,15 @@ Once connected, your agent can ask *"what are the riskiest files in this repo?"*
1340
1401
 
1341
1402
  ProjScan is designed to be fast enough to run on every save or as a pre-commit hook.
1342
1403
 
1343
- | Metric | Target |
1344
- |--------|--------|
1345
- | 5,000 files | < 1.5 seconds |
1346
- | 20,000 files | < 3 seconds |
1347
- | Network requests | Zero |
1348
- | Runtime dependencies | 4 packages |
1404
+ | Metric | Target |
1405
+ | -------------------- | ------------- |
1406
+ | 5,000 files | < 1.5 seconds |
1407
+ | 20,000 files | < 3 seconds |
1408
+ | Network requests | Zero |
1409
+ | Runtime dependencies | 4 packages |
1349
1410
 
1350
1411
  **How it stays fast:**
1412
+
1351
1413
  - Uses `fast-glob` for file walking
1352
1414
  - Language detection is a pure function - no I/O, just extension mapping
1353
1415
  - Framework detection reads at most one file (`package.json`) plus checks file names already in memory
@@ -1420,14 +1482,14 @@ on:
1420
1482
 
1421
1483
  permissions:
1422
1484
  contents: read
1423
- security-events: write # required for SARIF upload
1485
+ security-events: write # required for SARIF upload
1424
1486
 
1425
1487
  jobs:
1426
1488
  scan:
1427
1489
  runs-on: ubuntu-latest
1428
1490
  steps:
1429
1491
  - uses: actions/checkout@v4
1430
- with: { fetch-depth: 0 } # needed for --changed-only
1492
+ with: { fetch-depth: 0 } # needed for --changed-only
1431
1493
  - uses: actions/setup-node@v4
1432
1494
  with: { node-version: 22 }
1433
1495
  - uses: abhiyoheswaran1/projscan@v1
@@ -1498,6 +1560,7 @@ If scanning takes more than a few seconds, check whether you have large unignore
1498
1560
  ### `--changed-only` reports everything
1499
1561
 
1500
1562
  Check stderr for a warning. Most common causes:
1563
+
1501
1564
  - Running outside a git repository
1502
1565
  - The base ref doesn't exist (e.g., `origin/main` isn't fetched in a shallow CI clone - set `fetch-depth: 0` in checkout)
1503
1566
  - Fresh commit with no parent (no `HEAD~1`)
@@ -1582,6 +1645,7 @@ src/
1582
1645
  ```
1583
1646
 
1584
1647
  **Key design decisions:**
1648
+
1585
1649
  - **Single `types.ts`** - avoids circular dependencies between modules
1586
1650
  - **ESM-only** - required by chalk v5 and ora v8; all imports use `.js` extensions
1587
1651
  - **Pure functions where possible** - `detectLanguages` is pure (no I/O), trivially testable