octocode-cli 1.2.8 → 1.2.9

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 (282) hide show
  1. package/README.md +42 -35
  2. package/out/octocode-cli.js +36 -11767
  3. package/package.json +36 -36
  4. package/skills/README.md +42 -114
  5. package/skills/{octocode-code-engineer → octocode-engineer}/.claude/settings.local.json +2 -1
  6. package/skills/octocode-engineer/README.md +99 -0
  7. package/skills/octocode-engineer/SKILL.md +499 -0
  8. package/skills/octocode-engineer/build.mjs +29 -0
  9. package/skills/{octocode-code-engineer → octocode-engineer}/eslint.config.mjs +3 -13
  10. package/skills/{octocode-code-engineer → octocode-engineer}/package.json +28 -27
  11. package/skills/octocode-engineer/references/ast-reference.md +166 -0
  12. package/skills/{octocode-code-engineer → octocode-engineer}/references/cli-reference.md +80 -6
  13. package/skills/octocode-engineer/references/externals.md +86 -0
  14. package/skills/{octocode-code-engineer → octocode-engineer}/references/output-files.md +46 -6
  15. package/skills/octocode-engineer/references/quality-indicators.md +202 -0
  16. package/skills/octocode-engineer/references/tool-workflows.md +298 -0
  17. package/skills/octocode-engineer/references/validation-playbooks.md +99 -0
  18. package/skills/octocode-engineer/scripts/ast/search.js +45 -0
  19. package/skills/octocode-engineer/scripts/ast/tree-search.js +27 -0
  20. package/skills/octocode-engineer/scripts/index.js +173 -0
  21. package/skills/octocode-engineer/scripts/run.js +179 -0
  22. package/skills/octocode-engineer/src/analysis/dependencies.ts +378 -0
  23. package/skills/{octocode-code-engineer → octocode-engineer}/src/analysis/discovery.test.ts +57 -0
  24. package/skills/{octocode-code-engineer → octocode-engineer}/src/analysis/discovery.ts +43 -0
  25. package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/search.test.ts +113 -0
  26. package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/search.ts +64 -1
  27. package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/tree-sitter.test.ts +118 -2
  28. package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/tree-sitter.ts +65 -3
  29. package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/ts-analyzer.test.ts +281 -1
  30. package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/ts-analyzer.ts +173 -3
  31. package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/security.test.ts +73 -0
  32. package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/security.ts +62 -4
  33. package/skills/octocode-engineer/src/detector-gating.test.ts +59 -0
  34. package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/code-quality.ts +342 -0
  35. package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/index.ts +8 -0
  36. package/skills/{octocode-code-engineer → octocode-engineer}/src/index.test.ts +565 -11
  37. package/skills/octocode-engineer/src/index.ts +468 -0
  38. package/skills/octocode-engineer/src/pipeline/affected.test.ts +147 -0
  39. package/skills/octocode-engineer/src/pipeline/affected.ts +68 -0
  40. package/skills/octocode-engineer/src/pipeline/baseline.test.ts +276 -0
  41. package/skills/octocode-engineer/src/pipeline/baseline.ts +76 -0
  42. package/skills/{octocode-code-engineer → octocode-engineer}/src/pipeline/cli.test.ts +300 -53
  43. package/skills/{octocode-code-engineer → octocode-engineer}/src/pipeline/cli.ts +180 -36
  44. package/skills/octocode-engineer/src/pipeline/config-loader.test.ts +264 -0
  45. package/skills/octocode-engineer/src/pipeline/config-loader.ts +109 -0
  46. package/skills/octocode-engineer/src/pipeline/create-options.ts +55 -0
  47. package/skills/octocode-engineer/src/pipeline/health-score.test.ts +65 -0
  48. package/skills/{octocode-code-engineer → octocode-engineer}/src/pipeline/main.ts +130 -17
  49. package/skills/octocode-engineer/src/pipeline/progress.ts +51 -0
  50. package/skills/octocode-engineer/src/pipeline/reporters.test.ts +155 -0
  51. package/skills/octocode-engineer/src/pipeline/reporters.ts +64 -0
  52. package/skills/octocode-engineer/src/reporting/graph-features.test.ts +279 -0
  53. package/skills/{octocode-code-engineer → octocode-engineer}/src/reporting/output-contract.test.ts +6 -0
  54. package/skills/octocode-engineer/src/reporting/summary-md.test.ts +1066 -0
  55. package/skills/octocode-engineer/src/reporting/summary-md.ts +1604 -0
  56. package/skills/{octocode-code-engineer → octocode-engineer}/src/reporting/writer.ts +136 -13
  57. package/skills/octocode-engineer/src/run.ts +78 -0
  58. package/skills/{octocode-code-engineer → octocode-engineer}/src/sanity.test.ts +1 -1
  59. package/skills/octocode-engineer/src/types/analysis.ts +25 -0
  60. package/skills/octocode-engineer/src/types/collectors.ts +134 -0
  61. package/skills/{octocode-code-engineer → octocode-engineer}/src/types/constants.ts +75 -41
  62. package/skills/octocode-engineer/src/types/core.ts +203 -0
  63. package/skills/octocode-engineer/src/types/dependency.ts +215 -0
  64. package/skills/octocode-engineer/src/types/file-entry.ts +108 -0
  65. package/skills/octocode-engineer/src/types/findings.ts +105 -0
  66. package/skills/{octocode-code-engineer → octocode-engineer}/src/types/index.ts +60 -30
  67. package/skills/octocode-engineer/src/types/tree-sitter.ts +38 -0
  68. package/skills/{octocode-code-engineer → octocode-engineer}/tsconfig.json +1 -0
  69. package/skills/octocode-research/.octocode/scan/.cache/analysis-cache.json +1 -0
  70. package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/architecture.json +1 -0
  71. package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/ast-trees.txt +5566 -0
  72. package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/code-quality.json +1 -0
  73. package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/dead-code.json +1 -0
  74. package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/file-inventory.json +1 -0
  75. package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/findings.json +1 -0
  76. package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/graph.md +189 -0
  77. package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/security.json +1 -0
  78. package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/summary.json +1 -0
  79. package/skills/octocode-research/.octocode/scan/2026-03-22T10-32-27-073Z/summary.md +265 -0
  80. package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/architecture.json +1 -0
  81. package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/ast-trees.txt +5555 -0
  82. package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/code-quality.json +1 -0
  83. package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/dead-code.json +1 -0
  84. package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/file-inventory.json +1 -0
  85. package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/findings.json +1 -0
  86. package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/graph.md +190 -0
  87. package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/security.json +1 -0
  88. package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/summary.json +1 -0
  89. package/skills/octocode-research/.octocode/scan/2026-03-22T10-40-10-469Z/summary.md +265 -0
  90. package/skills/octocode-research/CHANGELOG.md +60 -0
  91. package/skills/octocode-research/README.md +102 -388
  92. package/skills/octocode-research/SKILL.md +169 -498
  93. package/skills/octocode-research/package.json +19 -31
  94. package/skills/octocode-research/references/PARALLEL_AGENT_PROTOCOL.md +19 -0
  95. package/skills/octocode-research/references/SESSION_MANAGEMENT.md +38 -0
  96. package/skills/octocode-research/scripts/server-init.js +1 -1
  97. package/skills/octocode-research/scripts/server.d.ts +2 -1
  98. package/skills/octocode-research/scripts/server.js +329 -233
  99. package/skills/octocode-research/src/__tests__/integration/promptsRoutes.test.ts +180 -0
  100. package/skills/octocode-research/src/__tests__/integration/serverHttp.test.ts +221 -0
  101. package/skills/octocode-research/src/__tests__/integration/serverLifecycle.test.ts +194 -0
  102. package/skills/octocode-research/src/__tests__/integration/toolsRoutes.test.ts +501 -0
  103. package/skills/octocode-research/src/__tests__/unit/readiness.test.ts +61 -0
  104. package/skills/octocode-research/src/__tests__/unit/resilience.test.ts +192 -0
  105. package/skills/octocode-research/src/__tests__/unit/responseFactory.test.ts +172 -0
  106. package/skills/octocode-research/src/__tests__/unit/responseParser.test.ts +288 -0
  107. package/skills/octocode-research/src/__tests__/unit/schemas.test.ts +509 -0
  108. package/skills/octocode-research/src/index.ts +4 -124
  109. package/skills/octocode-research/src/middleware/queryParser.ts +0 -26
  110. package/skills/octocode-research/src/routes/lsp.ts +58 -59
  111. package/skills/octocode-research/src/routes/package.ts +35 -65
  112. package/skills/octocode-research/src/routes/prompts.ts +3 -3
  113. package/skills/octocode-research/src/routes/tools.ts +8 -20
  114. package/skills/octocode-research/src/server-init.ts +30 -237
  115. package/skills/octocode-research/src/server.ts +50 -23
  116. package/skills/octocode-research/src/types/errorGuards.ts +9 -80
  117. package/skills/octocode-research/src/types/guards.ts +0 -28
  118. package/skills/octocode-research/src/types/mcp.ts +11 -66
  119. package/skills/octocode-research/src/types/responses.ts +11 -129
  120. package/skills/octocode-research/src/utils/circuitBreaker.ts +0 -21
  121. package/skills/octocode-research/src/utils/logger.ts +1 -97
  122. package/skills/octocode-research/src/utils/resilience.ts +2 -12
  123. package/skills/octocode-research/src/utils/responseFactory.ts +0 -42
  124. package/skills/octocode-research/src/utils/responseParser.ts +3 -25
  125. package/skills/octocode-research/src/utils/retry.ts +0 -63
  126. package/skills/octocode-research/src/utils/routeFactory.ts +1 -1
  127. package/skills/octocode-research/src/validation/httpPreprocess.ts +0 -3
  128. package/skills/octocode-research/src/validation/index.ts +0 -1
  129. package/skills/octocode-research/src/validation/schemas.ts +0 -63
  130. package/skills/octocode-research/src/validation/toolCallSchema.ts +3 -3
  131. package/skills/octocode-research/tsdown.config.ts +4 -0
  132. package/skills/octocode-research/vitest.config.ts +3 -0
  133. package/skills/octocode-code-engineer/.plan/VALIDATED_PLAN.md +0 -223
  134. package/skills/octocode-code-engineer/README.md +0 -178
  135. package/skills/octocode-code-engineer/SKILL.md +0 -418
  136. package/skills/octocode-code-engineer/minify-scripts.mjs +0 -32
  137. package/skills/octocode-code-engineer/references/agent-ast-reading-rfc.md +0 -95
  138. package/skills/octocode-code-engineer/references/architecture-techniques.md +0 -121
  139. package/skills/octocode-code-engineer/references/ast-search.md +0 -210
  140. package/skills/octocode-code-engineer/references/ast-tree-search.md +0 -151
  141. package/skills/octocode-code-engineer/references/concepts.md +0 -107
  142. package/skills/octocode-code-engineer/references/finding-categories.md +0 -128
  143. package/skills/octocode-code-engineer/references/improvement-roadmap.md +0 -304
  144. package/skills/octocode-code-engineer/references/playbooks.md +0 -204
  145. package/skills/octocode-code-engineer/references/present-results.md +0 -136
  146. package/skills/octocode-code-engineer/references/tool-workflows.md +0 -566
  147. package/skills/octocode-code-engineer/references/validate-investigate.md +0 -225
  148. package/skills/octocode-code-engineer/scripts/analysis/dependencies.js +0 -1
  149. package/skills/octocode-code-engineer/scripts/analysis/dependency-summary.js +0 -1
  150. package/skills/octocode-code-engineer/scripts/analysis/discovery.js +0 -1
  151. package/skills/octocode-code-engineer/scripts/analysis/graph-analytics.js +0 -1
  152. package/skills/octocode-code-engineer/scripts/analysis/semantic.js +0 -1
  153. package/skills/octocode-code-engineer/scripts/ast/helpers.js +0 -1
  154. package/skills/octocode-code-engineer/scripts/ast/metrics.js +0 -1
  155. package/skills/octocode-code-engineer/scripts/ast/search.js +0 -2
  156. package/skills/octocode-code-engineer/scripts/ast/tree-search.js +0 -2
  157. package/skills/octocode-code-engineer/scripts/ast/tree-sitter.js +0 -1
  158. package/skills/octocode-code-engineer/scripts/ast/ts-analyzer.js +0 -1
  159. package/skills/octocode-code-engineer/scripts/collectors/chains.js +0 -1
  160. package/skills/octocode-code-engineer/scripts/collectors/effects.js +0 -1
  161. package/skills/octocode-code-engineer/scripts/collectors/input-sources.js +0 -1
  162. package/skills/octocode-code-engineer/scripts/collectors/performance.js +0 -1
  163. package/skills/octocode-code-engineer/scripts/collectors/prototype-pollution.js +0 -1
  164. package/skills/octocode-code-engineer/scripts/collectors/security.js +0 -1
  165. package/skills/octocode-code-engineer/scripts/collectors/test-profile.js +0 -1
  166. package/skills/octocode-code-engineer/scripts/common/is-direct-run.js +0 -1
  167. package/skills/octocode-code-engineer/scripts/common/utils.js +0 -1
  168. package/skills/octocode-code-engineer/scripts/detectors/code-quality.js +0 -1
  169. package/skills/octocode-code-engineer/scripts/detectors/cohesion.js +0 -1
  170. package/skills/octocode-code-engineer/scripts/detectors/coupling.js +0 -1
  171. package/skills/octocode-code-engineer/scripts/detectors/cycle.js +0 -1
  172. package/skills/octocode-code-engineer/scripts/detectors/dead-code.js +0 -1
  173. package/skills/octocode-code-engineer/scripts/detectors/import-style.js +0 -1
  174. package/skills/octocode-code-engineer/scripts/detectors/index.js +0 -1
  175. package/skills/octocode-code-engineer/scripts/detectors/security.js +0 -1
  176. package/skills/octocode-code-engineer/scripts/detectors/semantic.js +0 -1
  177. package/skills/octocode-code-engineer/scripts/detectors/shared.js +0 -1
  178. package/skills/octocode-code-engineer/scripts/detectors/test-quality.js +0 -1
  179. package/skills/octocode-code-engineer/scripts/index.js +0 -1
  180. package/skills/octocode-code-engineer/scripts/pipeline/cache.js +0 -1
  181. package/skills/octocode-code-engineer/scripts/pipeline/cli.js +0 -1
  182. package/skills/octocode-code-engineer/scripts/pipeline/main.js +0 -2
  183. package/skills/octocode-code-engineer/scripts/reporting/analysis.js +0 -1
  184. package/skills/octocode-code-engineer/scripts/reporting/summary-md.js +0 -1
  185. package/skills/octocode-code-engineer/scripts/reporting/writer.js +0 -1
  186. package/skills/octocode-code-engineer/scripts/types/constants.js +0 -1
  187. package/skills/octocode-code-engineer/scripts/types/index.js +0 -1
  188. package/skills/octocode-code-engineer/scripts/types/interfaces.js +0 -1
  189. package/skills/octocode-code-engineer/src/analysis/dependencies.ts +0 -406
  190. package/skills/octocode-code-engineer/src/index.ts +0 -403
  191. package/skills/octocode-code-engineer/src/reporting/summary-md.test.ts +0 -421
  192. package/skills/octocode-code-engineer/src/reporting/summary-md.ts +0 -714
  193. package/skills/octocode-code-engineer/src/types/interfaces.ts +0 -682
  194. package/skills/octocode-research/src/types/toolTypes.ts +0 -33
  195. package/skills/octocode-research/src/utils/logEmoji.ts +0 -103
  196. /package/skills/{octocode-code-engineer → octocode-engineer}/.octocode/rfc/RFC-code-engineer-weakness-fixes.md +0 -0
  197. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/architecture.ts.html +0 -0
  198. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/ast-helpers.ts.html +0 -0
  199. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/ast-search.ts.html +0 -0
  200. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/base.css +0 -0
  201. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/block-navigation.js +0 -0
  202. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/cache.ts.html +0 -0
  203. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/cli.ts.html +0 -0
  204. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/clover.xml +0 -0
  205. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/collect-effects.ts.html +0 -0
  206. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/collect-input-sources.ts.html +0 -0
  207. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/collect-performance.ts.html +0 -0
  208. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/collect-prototype-pollution.ts.html +0 -0
  209. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/collect-security.ts.html +0 -0
  210. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/collect-test-profile.ts.html +0 -0
  211. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/coverage-final.json +0 -0
  212. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/dependencies.ts.html +0 -0
  213. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/dependency-summary.ts.html +0 -0
  214. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/discovery.ts.html +0 -0
  215. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/favicon.png +0 -0
  216. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/graph-analytics.ts.html +0 -0
  217. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/index.html +0 -0
  218. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/index.ts.html +0 -0
  219. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/metrics.ts.html +0 -0
  220. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/pipeline.ts.html +0 -0
  221. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/prettify.css +0 -0
  222. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/prettify.js +0 -0
  223. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/report-analysis.ts.html +0 -0
  224. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/report-writer.ts.html +0 -0
  225. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/security-detectors.ts.html +0 -0
  226. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/semantic-detectors.ts.html +0 -0
  227. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/semantic.ts.html +0 -0
  228. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/sort-arrow-sprite.png +0 -0
  229. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/sorter.js +0 -0
  230. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/summary-md.ts.html +0 -0
  231. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/test-quality-detectors.ts.html +0 -0
  232. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/tree-sitter-analyzer.ts.html +0 -0
  233. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/ts-analyzer.ts.html +0 -0
  234. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/types.ts.html +0 -0
  235. /package/skills/{octocode-code-engineer → octocode-engineer}/coverage/utils.ts.html +0 -0
  236. /package/skills/{octocode-code-engineer → octocode-engineer}/src/analysis/dependencies.test.ts +0 -0
  237. /package/skills/{octocode-code-engineer → octocode-engineer}/src/analysis/dependency-summary.test.ts +0 -0
  238. /package/skills/{octocode-code-engineer → octocode-engineer}/src/analysis/dependency-summary.ts +0 -0
  239. /package/skills/{octocode-code-engineer → octocode-engineer}/src/analysis/graph-analytics.test.ts +0 -0
  240. /package/skills/{octocode-code-engineer → octocode-engineer}/src/analysis/graph-analytics.ts +0 -0
  241. /package/skills/{octocode-code-engineer → octocode-engineer}/src/analysis/semantic.test.ts +0 -0
  242. /package/skills/{octocode-code-engineer → octocode-engineer}/src/analysis/semantic.ts +0 -0
  243. /package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/helpers.test.ts +0 -0
  244. /package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/helpers.ts +0 -0
  245. /package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/metrics.test.ts +0 -0
  246. /package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/metrics.ts +0 -0
  247. /package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/tree-search.test.ts +0 -0
  248. /package/skills/{octocode-code-engineer → octocode-engineer}/src/ast/tree-search.ts +0 -0
  249. /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/chains.ts +0 -0
  250. /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/effects.test.ts +0 -0
  251. /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/effects.ts +0 -0
  252. /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/input-sources.test.ts +0 -0
  253. /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/input-sources.ts +0 -0
  254. /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/performance.test.ts +0 -0
  255. /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/performance.ts +0 -0
  256. /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/prototype-pollution.test.ts +0 -0
  257. /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/prototype-pollution.ts +0 -0
  258. /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/test-profile.test.ts +0 -0
  259. /package/skills/{octocode-code-engineer → octocode-engineer}/src/collectors/test-profile.ts +0 -0
  260. /package/skills/{octocode-code-engineer → octocode-engineer}/src/common/is-direct-run.test.ts +0 -0
  261. /package/skills/{octocode-code-engineer → octocode-engineer}/src/common/is-direct-run.ts +0 -0
  262. /package/skills/{octocode-code-engineer → octocode-engineer}/src/common/utils.test.ts +0 -0
  263. /package/skills/{octocode-code-engineer → octocode-engineer}/src/common/utils.ts +0 -0
  264. /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/cohesion.ts +0 -0
  265. /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/coupling.ts +0 -0
  266. /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/cycle.ts +0 -0
  267. /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/dead-code.ts +0 -0
  268. /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/import-style.ts +0 -0
  269. /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/index.test.ts +0 -0
  270. /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/security.test.ts +0 -0
  271. /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/security.ts +0 -0
  272. /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/semantic.ts +0 -0
  273. /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/shared.ts +0 -0
  274. /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/test-quality.test.ts +0 -0
  275. /package/skills/{octocode-code-engineer → octocode-engineer}/src/detectors/test-quality.ts +0 -0
  276. /package/skills/{octocode-code-engineer → octocode-engineer}/src/pipeline/cache.test.ts +0 -0
  277. /package/skills/{octocode-code-engineer → octocode-engineer}/src/pipeline/cache.ts +0 -0
  278. /package/skills/{octocode-code-engineer → octocode-engineer}/src/pipeline/main.test.ts +0 -0
  279. /package/skills/{octocode-code-engineer → octocode-engineer}/src/pipeline.test.ts +0 -0
  280. /package/skills/{octocode-code-engineer → octocode-engineer}/src/reporting/analysis.test.ts +0 -0
  281. /package/skills/{octocode-code-engineer → octocode-engineer}/src/reporting/analysis.ts +0 -0
  282. /package/skills/{octocode-code-engineer → octocode-engineer}/vitest.config.ts +0 -0
@@ -0,0 +1,190 @@
1
+ # Dependency Graph
2
+
3
+ ## Module Dependency Map
4
+
5
+ ```mermaid
6
+ graph LR
7
+ src_server_ts["⚠️ src/server.ts"]
8
+ src_routes_package_ts["⚠️ src/…/package.ts"]
9
+ src_routes_tools_ts["⚠️ src/…/tools.ts"]
10
+ src_routes_github_ts["⚠️ src/…/github.ts"]
11
+ src_routes_local_ts["⚠️ src/…/local.ts"]
12
+ src_routes_lsp_ts["⚠️ src/…/lsp.ts"]
13
+ src___tests___integration_routes_test_ts["src/…/routes.test.ts"]
14
+ src_middleware_errorHandler_ts["src/…/errorHandler.ts"]
15
+ src_routes_prompts_ts["src/…/prompts.ts"]
16
+ src_middleware_logger_ts["src/…/logger.ts"]
17
+ src_utils_circuitBreaker_ts["⚠️ src/…/circuitBreaker.ts"]
18
+ src_utils_resilience_ts["⚠️ src/…/resilience.ts"]
19
+ src___tests___unit_errorHandler_test_ts["src/…/errorHandler.test.ts"]
20
+ src_utils_logger_ts["⚠️ src/…/logger.ts"]
21
+ src_utils_responseFactory_ts["⚠️ src/…/responseFactory.ts"]
22
+ src_index_ts["src/index.ts"]
23
+ src_utils_asyncTimeout_ts["⚠️ src/…/asyncTimeout.ts"]
24
+ src_types_guards_ts["⚠️ src/…/guards.ts"]
25
+ src_utils_responseBuilder_ts["⚠️ src/…/responseBuilder.ts"]
26
+ src_mcpCache_ts["src/mcpCache.ts"]
27
+ src_utils_colors_ts["src/…/colors.ts"]
28
+ src_validation_index_ts["src/…/index.ts"]
29
+ src_utils_errorQueue_ts["src/…/errorQueue.ts"]
30
+ src_utils_responseParser_ts["⚠️ src/…/responseParser.ts"]
31
+ src_utils_routeFactory_ts["src/…/routeFactory.ts"]
32
+ src_validation_httpPreprocess_ts["⚠️ src/…/httpPreprocess.ts"]
33
+ src_utils_retry_ts["⚠️ src/…/retry.ts"]
34
+ src_server_init_ts["⚠️ src/server-init.ts"]
35
+ src_server_ts --> src_index_ts
36
+ src_server_ts --> src_mcpCache_ts
37
+ src_server_ts --> src_middleware_errorHandler_ts
38
+ src_server_ts --> src_middleware_logger_ts
39
+ src_server_ts --> src_routes_prompts_ts
40
+ src_server_ts --> src_routes_tools_ts
41
+ src_server_ts --> src_utils_asyncTimeout_ts
42
+ src_server_ts --> src_utils_circuitBreaker_ts
43
+ src_server_ts --> src_utils_colors_ts
44
+ src_server_ts --> src_utils_errorQueue_ts
45
+ src_server_ts --> src_utils_logger_ts
46
+ src_routes_package_ts --> src_index_ts
47
+ src_routes_package_ts --> src_types_guards_ts
48
+ src_routes_package_ts --> src_utils_resilience_ts
49
+ src_routes_package_ts --> src_utils_responseBuilder_ts
50
+ src_routes_package_ts --> src_utils_responseFactory_ts
51
+ src_routes_package_ts --> src_utils_responseParser_ts
52
+ src_routes_package_ts --> src_validation_index_ts
53
+ src_routes_tools_ts --> src_index_ts
54
+ src_routes_tools_ts --> src_mcpCache_ts
55
+ src_routes_tools_ts --> src_utils_asyncTimeout_ts
56
+ src_routes_tools_ts --> src_utils_resilience_ts
57
+ src_routes_tools_ts --> src_utils_responseParser_ts
58
+ src_routes_github_ts --> src_index_ts
59
+ src_routes_github_ts --> src_types_guards_ts
60
+ src_routes_github_ts --> src_utils_resilience_ts
61
+ src_routes_github_ts --> src_utils_responseBuilder_ts
62
+ src_routes_github_ts --> src_utils_responseFactory_ts
63
+ src_routes_github_ts --> src_utils_routeFactory_ts
64
+ src_routes_github_ts --> src_validation_index_ts
65
+ src_routes_local_ts --> src_index_ts
66
+ src_routes_local_ts --> src_types_guards_ts
67
+ src_routes_local_ts --> src_utils_resilience_ts
68
+ src_routes_local_ts --> src_utils_responseBuilder_ts
69
+ src_routes_local_ts --> src_utils_responseFactory_ts
70
+ src_routes_local_ts --> src_utils_routeFactory_ts
71
+ src_routes_local_ts --> src_validation_index_ts
72
+ src_routes_lsp_ts --> src_index_ts
73
+ src_routes_lsp_ts --> src_types_guards_ts
74
+ src_routes_lsp_ts --> src_utils_resilience_ts
75
+ src_routes_lsp_ts --> src_utils_responseBuilder_ts
76
+ src_routes_lsp_ts --> src_utils_responseFactory_ts
77
+ src_routes_lsp_ts --> src_utils_routeFactory_ts
78
+ src_routes_lsp_ts --> src_validation_index_ts
79
+ src___tests___integration_routes_test_ts --> src_routes_github_ts
80
+ src___tests___integration_routes_test_ts --> src_routes_local_ts
81
+ src___tests___integration_routes_test_ts --> src_routes_lsp_ts
82
+ src___tests___integration_routes_test_ts --> src_routes_package_ts
83
+ src_middleware_errorHandler_ts --> src_index_ts
84
+ src_middleware_errorHandler_ts --> src_utils_asyncTimeout_ts
85
+ src_middleware_errorHandler_ts --> src_utils_logger_ts
86
+ src_routes_prompts_ts --> src_index_ts
87
+ src_routes_prompts_ts --> src_mcpCache_ts
88
+ src_routes_prompts_ts --> src_utils_asyncTimeout_ts
89
+ src_middleware_logger_ts --> src_utils_colors_ts
90
+ src_middleware_logger_ts --> src_utils_logger_ts
91
+ src_utils_circuitBreaker_ts --> src_index_ts
92
+ src_utils_circuitBreaker_ts --> src_utils_asyncTimeout_ts
93
+ src_utils_circuitBreaker_ts --> src_utils_colors_ts
94
+ src_utils_resilience_ts --> src_utils_asyncTimeout_ts
95
+ src_utils_resilience_ts --> src_utils_circuitBreaker_ts
96
+ src_utils_resilience_ts --> src_utils_retry_ts
97
+ src___tests___unit_errorHandler_test_ts --> src_middleware_errorHandler_ts
98
+ src___tests___unit_errorHandler_test_ts --> src_utils_asyncTimeout_ts
99
+ src_utils_logger_ts --> src_utils_colors_ts
100
+ src_utils_logger_ts --> src_utils_errorQueue_ts
101
+ src_utils_responseFactory_ts --> src_types_guards_ts
102
+ src_index_ts --> src_utils_responseBuilder_ts
103
+ src_utils_asyncTimeout_ts --> src_utils_errorQueue_ts
104
+ src_validation_index_ts --> src_validation_httpPreprocess_ts
105
+ src_utils_routeFactory_ts --> src_utils_responseParser_ts
106
+ ```
107
+
108
+ ## Critical Dependency Chains
109
+
110
+ ```mermaid
111
+ graph LR
112
+ src_server_ts["src/server.ts"] ==> src_routes_tools_ts["src/…/tools.ts"]
113
+ src_routes_tools_ts["src/…/tools.ts"] ==> src_utils_resilience_ts["src/…/resilience.ts"]
114
+ src_utils_resilience_ts["src/…/resilience.ts"] ==> src_utils_circuitBreaker_ts["src/…/circuitBreaker.ts"]
115
+ src_utils_circuitBreaker_ts["src/…/circuitBreaker.ts"] ==> src_index_ts["src/index.ts"]
116
+ src_index_ts["src/index.ts"] ==> src_utils_responseBuilder_ts["src/…/responseBuilder.ts"]
117
+ src_routes_tools_ts["src/…/tools.ts"] ==> src_utils_resilience_ts["src/…/resilience.ts"]
118
+ src_utils_resilience_ts["src/…/resilience.ts"] ==> src_utils_circuitBreaker_ts["src/…/circuitBreaker.ts"]
119
+ src_utils_circuitBreaker_ts["src/…/circuitBreaker.ts"] ==> src_index_ts["src/index.ts"]
120
+ src_index_ts["src/index.ts"] ==> src_utils_responseBuilder_ts["src/…/responseBuilder.ts"]
121
+ src___tests___integration_routes_test_ts["src/…/routes.test.ts"] ==> src_routes_lsp_ts["src/…/lsp.ts"]
122
+ src_routes_lsp_ts["src/…/lsp.ts"] ==> src_utils_resilience_ts["src/…/resilience.ts"]
123
+ src_utils_resilience_ts["src/…/resilience.ts"] ==> src_utils_circuitBreaker_ts["src/…/circuitBreaker.ts"]
124
+ src_utils_circuitBreaker_ts["src/…/circuitBreaker.ts"] ==> src_index_ts["src/index.ts"]
125
+ src_index_ts["src/index.ts"] ==> src_utils_responseBuilder_ts["src/…/responseBuilder.ts"]
126
+ src_routes_lsp_ts["src/…/lsp.ts"] ==> src_utils_resilience_ts["src/…/resilience.ts"]
127
+ src_utils_resilience_ts["src/…/resilience.ts"] ==> src_utils_circuitBreaker_ts["src/…/circuitBreaker.ts"]
128
+ src_utils_circuitBreaker_ts["src/…/circuitBreaker.ts"] ==> src_index_ts["src/index.ts"]
129
+ src_index_ts["src/index.ts"] ==> src_utils_responseBuilder_ts["src/…/responseBuilder.ts"]
130
+ src_routes_github_ts["src/…/github.ts"] ==> src_utils_resilience_ts["src/…/resilience.ts"]
131
+ src_utils_resilience_ts["src/…/resilience.ts"] ==> src_utils_circuitBreaker_ts["src/…/circuitBreaker.ts"]
132
+ src_utils_circuitBreaker_ts["src/…/circuitBreaker.ts"] ==> src_index_ts["src/index.ts"]
133
+ src_index_ts["src/index.ts"] ==> src_utils_responseBuilder_ts["src/…/responseBuilder.ts"]
134
+ src_routes_local_ts["src/…/local.ts"] ==> src_utils_resilience_ts["src/…/resilience.ts"]
135
+ src_utils_resilience_ts["src/…/resilience.ts"] ==> src_utils_circuitBreaker_ts["src/…/circuitBreaker.ts"]
136
+ src_utils_circuitBreaker_ts["src/…/circuitBreaker.ts"] ==> src_index_ts["src/index.ts"]
137
+ src_index_ts["src/index.ts"] ==> src_utils_responseBuilder_ts["src/…/responseBuilder.ts"]
138
+ src_routes_package_ts["src/…/package.ts"] ==> src_utils_resilience_ts["src/…/resilience.ts"]
139
+ src_utils_resilience_ts["src/…/resilience.ts"] ==> src_utils_circuitBreaker_ts["src/…/circuitBreaker.ts"]
140
+ src_utils_circuitBreaker_ts["src/…/circuitBreaker.ts"] ==> src_index_ts["src/index.ts"]
141
+ src_index_ts["src/index.ts"] ==> src_utils_responseBuilder_ts["src/…/responseBuilder.ts"]
142
+ src_utils_resilience_ts["src/…/resilience.ts"] ==> src_utils_circuitBreaker_ts["src/…/circuitBreaker.ts"]
143
+ src_utils_circuitBreaker_ts["src/…/circuitBreaker.ts"] ==> src_index_ts["src/index.ts"]
144
+ src_index_ts["src/index.ts"] ==> src_utils_responseBuilder_ts["src/…/responseBuilder.ts"]
145
+ ```
146
+
147
+ ## Summary
148
+
149
+ | Metric | Value |
150
+ |--------|-------|
151
+ | Total modules | 53 |
152
+ | Total edges | 93 |
153
+ | Root modules | 21 |
154
+ | Leaf modules | 22 |
155
+ | Cycles | 0 |
156
+ | Critical paths | 12 |
157
+ | Test-only modules | 4 |
158
+ | Unresolved imports | 0 |
159
+
160
+ ## Critical Modules (Hub Nodes)
161
+
162
+ | Module | Score | Risk | Inbound | Outbound |
163
+ |--------|-------|------|---------|----------|
164
+ | `src/utils/logger.ts` | 112 | high | 4 | 2 |
165
+ | `src/utils/responseBuilder.ts` | 109 | high | 6 | 0 |
166
+ | `src/routes/tools.ts` | 79 | high | 1 | 8 |
167
+ | `src/server.ts` | 71 | high | 0 | 11 |
168
+ | `src/utils/circuitBreaker.ts` | 70 | high | 4 | 3 |
169
+ | `src/routes/lsp.ts` | 65 | high | 1 | 7 |
170
+ | `src/utils/retry.ts` | 66 | high | 2 | 1 |
171
+ | `src/routes/github.ts` | 54 | medium | 1 | 7 |
172
+ | `src/routes/local.ts` | 46 | medium | 1 | 7 |
173
+ | `src/server-init.ts` | 48 | medium | 0 | 0 |
174
+ | `src/types/errorGuards.ts` | 47 | medium | 1 | 0 |
175
+ | `src/utils/responseParser.ts` | 43 | medium | 3 | 0 |
176
+ | `src/types/guards.ts` | 40 | medium | 6 | 0 |
177
+ | `src/routes/package.ts` | 40 | medium | 1 | 8 |
178
+ | `src/utils/responseFactory.ts` | 38 | medium | 4 | 2 |
179
+ | `src/validation/schemas.ts` | 37 | medium | 2 | 1 |
180
+ | `src/types/responses.ts` | 34 | medium | 1 | 1 |
181
+ | `src/validation/httpPreprocess.ts` | 31 | medium | 3 | 0 |
182
+ | `src/utils/asyncTimeout.ts` | 26 | low | 7 | 1 |
183
+ | `src/utils/resilience.ts` | 21 | low | 5 | 3 |
184
+
185
+ ## Test-Only Modules
186
+
187
+ - `src/routes/github.ts`
188
+ - `src/routes/local.ts`
189
+ - `src/routes/lsp.ts`
190
+ - `src/routes/package.ts`
@@ -0,0 +1 @@
1
+ {"schemaVersion":"1.1.0","generatedAt":"2026-03-22T10:40:13.784Z","findings":[{"id":"AST-ISSUE-0055","severity":"high","category":"hardcoded-secret","file":"src/routes/tools.ts","lineStart":206,"lineEnd":206,"title":"Potential hardcoded secret","reason":"String literal matches a secret pattern (password, API key, token, high-entropy string). Secrets in source code risk credential leaks. Validate: use localSearchCode to find the variable, then lspFindReferences to check if it is used in auth or network calls.","files":["src/routes/tools.ts"],"suggestedFix":{"strategy":"Move secret to environment variable or secrets manager.","steps":["Replace the hardcoded value with process.env.YOUR_SECRET.","Add the variable to your .env file (excluded from git).","Verify the secret is not committed in git history."]},"impact":"Credential leak in source code exposes API access, database credentials, or authentication tokens to anyone with repo access.","tags":["security","secrets"],"lspHints":[{"tool":"lspFindReferences","symbolName":"secret","lineHint":206,"file":"src/routes/tools.ts","expectedResult":"find all usages of this secret value — if used only in tests or as a regex pattern, it is a false positive"}],"ruleId":"security.hardcoded-secret","confidence":"high","evidence":{"category":"hardcoded-secret","location":"src/routes/tools.ts:206-206","source":"","sink":"runtime usage","context":"literal","sanitizerStatus":"missing","propagationSteps":["src/routes/tools.ts:206"]},"analysisLens":"hybrid","correlatedSignals":["hot-file","critical-path-context","paired:prototype-pollution-risk","paired:untested-critical-code","paired:unvalidated-input-sink","paired:listener-leak-risk","paired:over-abstraction","paired:type-assertion-escape"],"recommendedValidation":{"summary":"find all usages of this secret value — if used only in tests or as a regex pattern, it is a false positive","tools":["localSearchCode","lspFindReferences"]},"flowTrace":[{"file":"src/routes/tools.ts","lineStart":206,"lineEnd":206,"label":"propagation step"}]},{"id":"AST-ISSUE-0056","severity":"high","category":"prototype-pollution-risk","file":"src/routes/tools.ts","lineStart":352,"lineEnd":352,"title":"Prototype pollution risk: computed-property-write","reason":"Dynamic bracket assignment: schemas[toolName]","files":["src/routes/tools.ts"],"suggestedFix":{"strategy":"Guard against __proto__, constructor, and prototype keys before merging.","steps":["Validate keys: reject \"__proto__\", \"constructor\", \"prototype\" before assignment.","Use Object.create(null) as the target for merges when possible.","Replace custom deep-merge with a hardened library (e.g. lodash.merge with prototype guard).","For Object.assign, ensure the source is sanitized or use structuredClone()."]},"impact":"Prototype pollution can override built-in methods, bypass security checks, or achieve remote code execution.","tags":["security","prototype-pollution","injection"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"bracket-assignment","lineHint":352,"file":"src/routes/tools.ts","expectedResult":"trace callers to determine if user-controlled data reaches this site — if key comes from Object.keys() on internal object, dismiss as false positive"}],"ruleId":"security.prototype-pollution-risk","confidence":"medium","evidence":{"category":"prototype-pollution-risk","location":"src/routes/tools.ts:352-352","source":"computed-property-write","sink":"Dynamic bracket assignment: schemas[toolName]","guarded":false,"sanitizerStatus":"missing","propagationSteps":["src/routes/tools.ts:352"]},"analysisLens":"hybrid","correlatedSignals":["hot-file","critical-path-context","paired:hardcoded-secret","paired:untested-critical-code","paired:unvalidated-input-sink","paired:listener-leak-risk","paired:over-abstraction","paired:type-assertion-escape"],"recommendedValidation":{"summary":"trace callers to determine if user-controlled data reaches this site — if key comes from Object.keys() on internal object, dismiss as false positive","tools":["localSearchCode","lspCallHierarchy"]},"flowTrace":[{"file":"src/routes/tools.ts","lineStart":352,"lineEnd":352,"label":"propagation step"}]},{"id":"AST-ISSUE-0057","severity":"high","category":"prototype-pollution-risk","file":"src/utils/circuitBreaker.ts","lineStart":288,"lineEnd":288,"title":"Prototype pollution risk: computed-property-write","reason":"Dynamic bracket assignment: states[name]","files":["src/utils/circuitBreaker.ts"],"suggestedFix":{"strategy":"Guard against __proto__, constructor, and prototype keys before merging.","steps":["Validate keys: reject \"__proto__\", \"constructor\", \"prototype\" before assignment.","Use Object.create(null) as the target for merges when possible.","Replace custom deep-merge with a hardened library (e.g. lodash.merge with prototype guard).","For Object.assign, ensure the source is sanitized or use structuredClone()."]},"impact":"Prototype pollution can override built-in methods, bypass security checks, or achieve remote code execution.","tags":["security","prototype-pollution","injection"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"bracket-assignment","lineHint":288,"file":"src/utils/circuitBreaker.ts","expectedResult":"trace callers to determine if user-controlled data reaches this site — if key comes from Object.keys() on internal object, dismiss as false positive"}],"ruleId":"security.prototype-pollution-risk","confidence":"medium","evidence":{"category":"prototype-pollution-risk","location":"src/utils/circuitBreaker.ts:288-288","source":"computed-property-write","sink":"Dynamic bracket assignment: states[name]","guarded":false,"sanitizerStatus":"missing","propagationSteps":["src/utils/circuitBreaker.ts:288"]},"analysisLens":"hybrid","correlatedSignals":["hot-file","critical-path-context","paired:dead-export","paired:semantic-dead-export","paired:over-abstraction","paired:type-assertion-escape","paired:uncleared-timer","paired:move-to-caller"],"recommendedValidation":{"summary":"trace callers to determine if user-controlled data reaches this site — if key comes from Object.keys() on internal object, dismiss as false positive","tools":["localSearchCode","lspCallHierarchy"]},"flowTrace":[{"file":"src/utils/circuitBreaker.ts","lineStart":288,"lineEnd":288,"label":"propagation step"}]},{"id":"AST-ISSUE-0103","severity":"high","category":"sql-injection-risk","file":"src/utils/logger.ts","lineStart":57,"lineEnd":57,"title":"SQL query built with template literal interpolation","reason":"Template literals with SQL keywords and interpolated expressions risk SQL injection if user input flows into the query.","files":["src/utils/logger.ts"],"suggestedFix":{"strategy":"Use parameterized queries or a query builder.","steps":["Replace template literal with parameterized query (e.g. db.query(sql, [param])).","Use an ORM or query builder that handles escaping.","If raw SQL is necessary, validate and sanitize all interpolated values."]},"impact":"SQL injection can expose, modify, or destroy database contents and potentially escalate to full server compromise.","tags":["security","injection","sql"],"ruleId":"security.sql-injection-risk","confidence":"high","evidence":{"category":"sql-injection-risk","location":"src/utils/logger.ts:57-57","sink":"sql template literal","sanitizerStatus":"missing","propagationSteps":["src/utils/logger.ts:57-57"]},"analysisLens":"hybrid","correlatedSignals":["hot-file","critical-path-context","paired:dead-export","paired:semantic-dead-export","paired:empty-catch","paired:excessive-parameters","paired:input-passthrough-risk","paired:listener-leak-risk"],"recommendedValidation":{"summary":"Validate both the structural location and the behavioral path before presenting the claim as fact.","tools":["localSearchCode","lspCallHierarchy"]},"flowTrace":[{"file":"src/utils/logger.ts","lineStart":57,"lineEnd":57,"label":"propagation step"}]},{"id":"AST-ISSUE-0104","severity":"high","category":"sql-injection-risk","file":"src/utils/logger.ts","lineStart":83,"lineEnd":83,"title":"SQL query built with template literal interpolation","reason":"Template literals with SQL keywords and interpolated expressions risk SQL injection if user input flows into the query.","files":["src/utils/logger.ts"],"suggestedFix":{"strategy":"Use parameterized queries or a query builder.","steps":["Replace template literal with parameterized query (e.g. db.query(sql, [param])).","Use an ORM or query builder that handles escaping.","If raw SQL is necessary, validate and sanitize all interpolated values."]},"impact":"SQL injection can expose, modify, or destroy database contents and potentially escalate to full server compromise.","tags":["security","injection","sql"],"ruleId":"security.sql-injection-risk","confidence":"high","evidence":{"category":"sql-injection-risk","location":"src/utils/logger.ts:83-83","sink":"sql template literal","sanitizerStatus":"missing","propagationSteps":["src/utils/logger.ts:83-83"]},"analysisLens":"hybrid","correlatedSignals":["hot-file","critical-path-context","paired:dead-export","paired:semantic-dead-export","paired:empty-catch","paired:excessive-parameters","paired:input-passthrough-risk","paired:listener-leak-risk"],"recommendedValidation":{"summary":"Validate both the structural location and the behavioral path before presenting the claim as fact.","tools":["localSearchCode","lspCallHierarchy"]},"flowTrace":[{"file":"src/utils/logger.ts","lineStart":83,"lineEnd":83,"label":"propagation step"}]},{"id":"AST-ISSUE-0127","severity":"high","category":"unvalidated-input-sink","file":"src/middleware/errorHandler.ts","lineStart":15,"lineEnd":65,"title":"Unvalidated input reaches response sink in errorHandler(req)","reason":"Parameter 'req' (external input) flows into response without validation (no type guard, schema call, or conditional check).","files":["src/middleware/errorHandler.ts"],"suggestedFix":{"strategy":"Add input validation before the sink operation.","steps":["Add schema validation (e.g. zod, joi) for input parameters.","Use parameterized APIs instead of template interpolation for SQL/exec.","Trace data flow: lspCallHierarchy(outgoing) on errorHandler."]},"impact":"Unvalidated external input reaching a dangerous sink (eval, SQL, exec, innerHTML, file write) enables injection attacks.","tags":["security","input-validation","injection"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"errorHandler","lineHint":15,"file":"src/middleware/errorHandler.ts","expectedResult":"trace outgoing calls to see where req data flows"},{"tool":"lspFindReferences","symbolName":"req","lineHint":15,"file":"src/middleware/errorHandler.ts","expectedResult":"check all usages of req parameter within function"}],"ruleId":"security.unvalidated-input-sink","confidence":"high","evidence":{"category":"unvalidated-input-sink","location":"src/middleware/errorHandler.ts:15-65","sourceParameters":["req"],"sink":"response","sanitizerStatus":"missing","propagationSteps":["sanitizeQueryParams:28","extractToolName:36"]},"analysisLens":"hybrid","correlatedSignals":["paired:move-to-caller"],"recommendedValidation":{"summary":"trace outgoing calls to see where req data flows","tools":["localSearchCode","lspCallHierarchy"]},"flowTrace":[{"file":"sanitizeQueryParams","lineStart":28,"lineEnd":28,"label":"propagation step"},{"file":"extractToolName","lineStart":36,"lineEnd":36,"label":"propagation step"}]},{"id":"AST-ISSUE-0128","severity":"high","category":"unvalidated-input-sink","file":"src/routes/package.ts","lineStart":17,"lineEnd":47,"title":"Unvalidated input reaches response sink in <anonymous>(req)","reason":"Parameter 'req' (external input) flows into response without validation (no type guard, schema call, or conditional check).","files":["src/routes/package.ts"],"suggestedFix":{"strategy":"Add input validation before the sink operation.","steps":["Add schema validation (e.g. zod, joi) for input parameters.","Use parameterized APIs instead of template interpolation for SQL/exec.","Trace data flow: lspCallHierarchy(outgoing) on <anonymous>."]},"impact":"Unvalidated external input reaching a dangerous sink (eval, SQL, exec, innerHTML, file write) enables injection attacks.","tags":["security","input-validation","injection"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"<anonymous>","lineHint":17,"file":"src/routes/package.ts","expectedResult":"trace outgoing calls to see where req data flows"},{"tool":"lspFindReferences","symbolName":"req","lineHint":17,"file":"src/routes/package.ts","expectedResult":"check all usages of req parameter within function"}],"ruleId":"security.unvalidated-input-sink","confidence":"high","evidence":{"category":"unvalidated-input-sink","location":"src/routes/package.ts:17-47","sourceParameters":["req"],"sink":"response","sanitizerStatus":"missing","propagationSteps":["parseAndValidate:19"]},"analysisLens":"hybrid","correlatedSignals":["hot-file","critical-path-context","paired:dependency-critical-path","paired:unreachable-module","paired:dependency-test-only","paired:over-abstraction","paired:move-to-caller"],"recommendedValidation":{"summary":"trace outgoing calls to see where req data flows","tools":["localSearchCode","lspCallHierarchy"]},"flowTrace":[{"file":"parseAndValidate","lineStart":19,"lineEnd":19,"label":"propagation step"}]},{"id":"AST-ISSUE-0129","severity":"high","category":"unvalidated-input-sink","file":"src/routes/prompts.ts","lineStart":88,"lineEnd":138,"title":"Unvalidated input reaches response sink in <anonymous>(req)","reason":"Parameter 'req' (external input) flows into response without validation (no type guard, schema call, or conditional check).","files":["src/routes/prompts.ts"],"suggestedFix":{"strategy":"Add input validation before the sink operation.","steps":["Add schema validation (e.g. zod, joi) for input parameters.","Use parameterized APIs instead of template interpolation for SQL/exec.","Trace data flow: lspCallHierarchy(outgoing) on <anonymous>."]},"impact":"Unvalidated external input reaching a dangerous sink (eval, SQL, exec, innerHTML, file write) enables injection attacks.","tags":["security","input-validation","injection"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"<anonymous>","lineHint":88,"file":"src/routes/prompts.ts","expectedResult":"trace outgoing calls to see where req data flows"},{"tool":"lspFindReferences","symbolName":"req","lineHint":88,"file":"src/routes/prompts.ts","expectedResult":"check all usages of req parameter within function"}],"ruleId":"security.unvalidated-input-sink","confidence":"high","evidence":{"category":"unvalidated-input-sink","location":"src/routes/prompts.ts:88-138","sourceParameters":["req"],"sink":"response","sanitizerStatus":"missing","propagationSteps":[]},"analysisLens":"hybrid","correlatedSignals":[],"recommendedValidation":{"summary":"trace outgoing calls to see where req data flows","tools":["localSearchCode","lspCallHierarchy"]}},{"id":"AST-ISSUE-0130","severity":"high","category":"unvalidated-input-sink","file":"src/routes/tools.ts","lineStart":158,"lineEnd":211,"title":"Unvalidated input reaches response sink in <anonymous>(req)","reason":"Parameter 'req' (external input) flows into response without validation (no type guard, schema call, or conditional check).","files":["src/routes/tools.ts"],"suggestedFix":{"strategy":"Add input validation before the sink operation.","steps":["Add schema validation (e.g. zod, joi) for input parameters.","Use parameterized APIs instead of template interpolation for SQL/exec.","Trace data flow: lspCallHierarchy(outgoing) on <anonymous>."]},"impact":"Unvalidated external input reaching a dangerous sink (eval, SQL, exec, innerHTML, file write) enables injection attacks.","tags":["security","input-validation","injection"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"<anonymous>","lineHint":158,"file":"src/routes/tools.ts","expectedResult":"trace outgoing calls to see where req data flows"},{"tool":"lspFindReferences","symbolName":"req","lineHint":158,"file":"src/routes/tools.ts","expectedResult":"check all usages of req parameter within function"}],"ruleId":"security.unvalidated-input-sink","confidence":"high","evidence":{"category":"unvalidated-input-sink","location":"src/routes/tools.ts:158-211","sourceParameters":["req"],"sink":"response","sanitizerStatus":"missing","propagationSteps":[]},"analysisLens":"hybrid","correlatedSignals":["hot-file","critical-path-context","paired:hardcoded-secret","paired:prototype-pollution-risk","paired:untested-critical-code","paired:listener-leak-risk","paired:over-abstraction","paired:type-assertion-escape"],"recommendedValidation":{"summary":"trace outgoing calls to see where req data flows","tools":["localSearchCode","lspCallHierarchy"]}},{"id":"AST-ISSUE-0131","severity":"high","category":"unvalidated-input-sink","file":"src/routes/tools.ts","lineStart":228,"lineEnd":290,"title":"Unvalidated input reaches response sink in <anonymous>(req)","reason":"Parameter 'req' (external input) flows into response without validation (no type guard, schema call, or conditional check).","files":["src/routes/tools.ts"],"suggestedFix":{"strategy":"Add input validation before the sink operation.","steps":["Add schema validation (e.g. zod, joi) for input parameters.","Use parameterized APIs instead of template interpolation for SQL/exec.","Trace data flow: lspCallHierarchy(outgoing) on <anonymous>."]},"impact":"Unvalidated external input reaching a dangerous sink (eval, SQL, exec, innerHTML, file write) enables injection attacks.","tags":["security","input-validation","injection"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"<anonymous>","lineHint":228,"file":"src/routes/tools.ts","expectedResult":"trace outgoing calls to see where req data flows"},{"tool":"lspFindReferences","symbolName":"req","lineHint":228,"file":"src/routes/tools.ts","expectedResult":"check all usages of req parameter within function"}],"ruleId":"security.unvalidated-input-sink","confidence":"high","evidence":{"category":"unvalidated-input-sink","location":"src/routes/tools.ts:228-290","sourceParameters":["req"],"sink":"response","sanitizerStatus":"missing","propagationSteps":[]},"analysisLens":"hybrid","correlatedSignals":["hot-file","critical-path-context","paired:hardcoded-secret","paired:prototype-pollution-risk","paired:untested-critical-code","paired:listener-leak-risk","paired:over-abstraction","paired:type-assertion-escape"],"recommendedValidation":{"summary":"trace outgoing calls to see where req data flows","tools":["localSearchCode","lspCallHierarchy"]}},{"id":"AST-ISSUE-0132","severity":"high","category":"unvalidated-input-sink","file":"src/routes/tools.ts","lineStart":564,"lineEnd":677,"title":"Unvalidated input reaches response sink in <anonymous>(req)","reason":"Parameter 'req' (external input) flows into response without validation (no type guard, schema call, or conditional check).","files":["src/routes/tools.ts"],"suggestedFix":{"strategy":"Add input validation before the sink operation.","steps":["Add schema validation (e.g. zod, joi) for input parameters.","Use parameterized APIs instead of template interpolation for SQL/exec.","Trace data flow: lspCallHierarchy(outgoing) on <anonymous>."]},"impact":"Unvalidated external input reaching a dangerous sink (eval, SQL, exec, innerHTML, file write) enables injection attacks.","tags":["security","input-validation","injection"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"<anonymous>","lineHint":564,"file":"src/routes/tools.ts","expectedResult":"trace outgoing calls to see where req data flows"},{"tool":"lspFindReferences","symbolName":"req","lineHint":564,"file":"src/routes/tools.ts","expectedResult":"check all usages of req parameter within function"}],"ruleId":"security.unvalidated-input-sink","confidence":"high","evidence":{"category":"unvalidated-input-sink","location":"src/routes/tools.ts:564-677","sourceParameters":["req"],"sink":"response","sanitizerStatus":"missing","propagationSteps":["validateToolCallBody:604"]},"analysisLens":"hybrid","correlatedSignals":["hot-file","critical-path-context","paired:hardcoded-secret","paired:prototype-pollution-risk","paired:untested-critical-code","paired:listener-leak-risk","paired:over-abstraction","paired:type-assertion-escape"],"recommendedValidation":{"summary":"trace outgoing calls to see where req data flows","tools":["localSearchCode","lspCallHierarchy"]},"flowTrace":[{"file":"validateToolCallBody","lineStart":604,"lineEnd":604,"label":"propagation step"}]},{"id":"AST-ISSUE-0133","severity":"high","category":"unvalidated-input-sink","file":"src/utils/routeFactory.ts","lineStart":91,"lineEnd":116,"title":"Unvalidated input reaches response sink in <anonymous>(req)","reason":"Parameter 'req' (external input) flows into response without validation (no type guard, schema call, or conditional check).","files":["src/utils/routeFactory.ts"],"suggestedFix":{"strategy":"Add input validation before the sink operation.","steps":["Add schema validation (e.g. zod, joi) for input parameters.","Use parameterized APIs instead of template interpolation for SQL/exec.","Trace data flow: lspCallHierarchy(outgoing) on <anonymous>."]},"impact":"Unvalidated external input reaching a dangerous sink (eval, SQL, exec, innerHTML, file write) enables injection attacks.","tags":["security","input-validation","injection"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"<anonymous>","lineHint":91,"file":"src/utils/routeFactory.ts","expectedResult":"trace outgoing calls to see where req data flows"},{"tool":"lspFindReferences","symbolName":"req","lineHint":91,"file":"src/utils/routeFactory.ts","expectedResult":"check all usages of req parameter within function"}],"ruleId":"security.unvalidated-input-sink","confidence":"high","evidence":{"category":"unvalidated-input-sink","location":"src/utils/routeFactory.ts:91-116","sourceParameters":["req"],"sink":"response","sanitizerStatus":"missing","propagationSteps":["parseAndValidate:94"]},"analysisLens":"hybrid","correlatedSignals":["paired:unreachable-module","paired:dead-export","paired:move-to-caller"],"recommendedValidation":{"summary":"trace outgoing calls to see where req data flows","tools":["localSearchCode","lspCallHierarchy"]},"flowTrace":[{"file":"parseAndValidate","lineStart":94,"lineEnd":94,"label":"propagation step"}]},{"id":"AST-ISSUE-0179","severity":"medium","category":"input-passthrough-risk","file":"src/middleware/logger.ts","lineStart":19,"lineEnd":60,"title":"Input passthrough without validation in requestLogger(req)","reason":"Parameter 'req' (external input) is passed to getRequestId without validation. Downstream callees may not validate either.","files":["src/middleware/logger.ts"],"suggestedFix":{"strategy":"Validate input before passing to downstream functions.","steps":["Add schema validation (e.g. zod, joi) at the entry point.","Trace downstream: lspCallHierarchy(outgoing) on requestLogger to verify callees validate.","Search for validation middleware: localSearchCode for guard/validate/sanitize patterns."]},"impact":"Unchecked input passed downstream can reach sinks in callees — validation gaps compound across the call chain.","tags":["security","input-validation","passthrough"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"requestLogger","lineHint":19,"file":"src/middleware/logger.ts","expectedResult":"trace outgoing calls to verify downstream validation of req"},{"tool":"lspFindReferences","symbolName":"req","lineHint":19,"file":"src/middleware/logger.ts","expectedResult":"find all usages of req to check if validation occurs upstream"}],"ruleId":"security.input-passthrough-risk","confidence":"medium","evidence":{"category":"input-passthrough-risk","location":"src/middleware/logger.ts:19-60","sourceParameters":["req"],"sink":"getRequestId","sanitizerStatus":"missing","propagationSteps":["getRequestId:25"]},"analysisLens":"hybrid","correlatedSignals":["critical-path-context","paired:listener-leak-risk","paired:similar-function-body","paired:move-to-caller"],"recommendedValidation":{"summary":"trace outgoing calls to verify downstream validation of req","tools":["localSearchCode","lspCallHierarchy"]},"flowTrace":[{"file":"getRequestId","lineStart":25,"lineEnd":25,"label":"propagation step"}]},{"id":"AST-ISSUE-0180","severity":"medium","category":"input-passthrough-risk","file":"src/utils/logger.ts","lineStart":404,"lineEnd":413,"title":"Input passthrough without validation in sanitizeQueryParams(query)","reason":"Parameter 'query' (external input) is passed to Object.entries without validation. Downstream callees may not validate either.","files":["src/utils/logger.ts"],"suggestedFix":{"strategy":"Validate input before passing to downstream functions.","steps":["Add schema validation (e.g. zod, joi) at the entry point.","Trace downstream: lspCallHierarchy(outgoing) on sanitizeQueryParams to verify callees validate.","Search for validation middleware: localSearchCode for guard/validate/sanitize patterns."]},"impact":"Unchecked input passed downstream can reach sinks in callees — validation gaps compound across the call chain.","tags":["security","input-validation","passthrough"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"sanitizeQueryParams","lineHint":404,"file":"src/utils/logger.ts","expectedResult":"trace outgoing calls to verify downstream validation of query"},{"tool":"lspFindReferences","symbolName":"query","lineHint":404,"file":"src/utils/logger.ts","expectedResult":"find all usages of query to check if validation occurs upstream"}],"ruleId":"security.input-passthrough-risk","confidence":"medium","evidence":{"category":"input-passthrough-risk","location":"src/utils/logger.ts:404-413","sourceParameters":["query"],"sink":"Object.entries","sanitizerStatus":"missing","propagationSteps":["Object.entries:407"]},"analysisLens":"hybrid","correlatedSignals":["hot-file","critical-path-context","paired:dead-export","paired:semantic-dead-export","paired:sql-injection-risk","paired:empty-catch","paired:excessive-parameters","paired:listener-leak-risk"],"recommendedValidation":{"summary":"trace outgoing calls to verify downstream validation of query","tools":["localSearchCode","lspCallHierarchy"]},"flowTrace":[{"file":"Object.entries","lineStart":407,"lineEnd":407,"label":"propagation step"}]},{"id":"AST-ISSUE-0181","severity":"medium","category":"input-passthrough-risk","file":"src/validation/toolCallSchema.ts","lineStart":85,"lineEnd":105,"title":"Input passthrough without validation in validateToolCallBody(body)","reason":"Parameter 'body' (external input) is passed to toolCallBodySchema.safeParse without validation. Downstream callees may not validate either.","files":["src/validation/toolCallSchema.ts"],"suggestedFix":{"strategy":"Validate input before passing to downstream functions.","steps":["Add schema validation (e.g. zod, joi) at the entry point.","Trace downstream: lspCallHierarchy(outgoing) on validateToolCallBody to verify callees validate.","Search for validation middleware: localSearchCode for guard/validate/sanitize patterns."]},"impact":"Unchecked input passed downstream can reach sinks in callees — validation gaps compound across the call chain.","tags":["security","input-validation","passthrough"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"validateToolCallBody","lineHint":85,"file":"src/validation/toolCallSchema.ts","expectedResult":"trace outgoing calls to verify downstream validation of body"},{"tool":"lspFindReferences","symbolName":"body","lineHint":85,"file":"src/validation/toolCallSchema.ts","expectedResult":"find all usages of body to check if validation occurs upstream"}],"ruleId":"security.input-passthrough-risk","confidence":"medium","evidence":{"category":"input-passthrough-risk","location":"src/validation/toolCallSchema.ts:85-105","sourceParameters":["body"],"sink":"toolCallBodySchema.safeParse","sanitizerStatus":"missing","propagationSteps":["toolCallBodySchema.safeParse:86"]},"analysisLens":"hybrid","correlatedSignals":["paired:dead-export","paired:over-abstraction","paired:move-to-caller"],"recommendedValidation":{"summary":"trace outgoing calls to verify downstream validation of body","tools":["localSearchCode","lspCallHierarchy"]},"flowTrace":[{"file":"toolCallBodySchema.safeParse","lineStart":86,"lineEnd":86,"label":"propagation step"}]},{"id":"AST-ISSUE-0224","severity":"low","category":"input-passthrough-risk","file":"src/middleware/queryParser.ts","lineStart":12,"lineEnd":18,"title":"Input passthrough without validation in <anonymous>(message)","reason":"Parameter 'message' (external input) is passed to super without validation. Downstream callees may not validate either.","files":["src/middleware/queryParser.ts"],"suggestedFix":{"strategy":"Validate input before passing to downstream functions.","steps":["Add schema validation (e.g. zod, joi) at the entry point.","Trace downstream: lspCallHierarchy(outgoing) on <anonymous> to verify callees validate.","Search for validation middleware: localSearchCode for guard/validate/sanitize patterns."]},"impact":"Unchecked input passed downstream can reach sinks in callees — validation gaps compound across the call chain.","tags":["security","input-validation","passthrough"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"<anonymous>","lineHint":12,"file":"src/middleware/queryParser.ts","expectedResult":"trace outgoing calls to verify downstream validation of message"},{"tool":"lspFindReferences","symbolName":"message","lineHint":12,"file":"src/middleware/queryParser.ts","expectedResult":"find all usages of message to check if validation occurs upstream"}],"ruleId":"security.input-passthrough-risk","confidence":"low","evidence":{"category":"input-passthrough-risk","location":"src/middleware/queryParser.ts:12-18","sourceParameters":["message"],"sink":"super","sanitizerStatus":"missing","propagationSteps":["super:13"]},"analysisLens":"hybrid","correlatedSignals":["paired:unreachable-module","paired:cognitive-complexity","paired:prototype-pollution-risk"],"recommendedValidation":{"summary":"trace outgoing calls to verify downstream validation of message","tools":["localSearchCode","lspCallHierarchy"]},"flowTrace":[{"file":"super","lineStart":13,"lineEnd":13,"label":"propagation step"}]},{"id":"AST-ISSUE-0225","severity":"low","category":"input-passthrough-risk","file":"src/utils/logger.ts","lineStart":231,"lineEnd":246,"title":"Input passthrough without validation in logError(message)","reason":"Parameter 'message' (external input) is passed to formatLogEntry without validation. Downstream callees may not validate either.","files":["src/utils/logger.ts"],"suggestedFix":{"strategy":"Validate input before passing to downstream functions.","steps":["Add schema validation (e.g. zod, joi) at the entry point.","Trace downstream: lspCallHierarchy(outgoing) on logError to verify callees validate.","Search for validation middleware: localSearchCode for guard/validate/sanitize patterns."]},"impact":"Unchecked input passed downstream can reach sinks in callees — validation gaps compound across the call chain.","tags":["security","input-validation","passthrough"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"logError","lineHint":231,"file":"src/utils/logger.ts","expectedResult":"trace outgoing calls to verify downstream validation of message"},{"tool":"lspFindReferences","symbolName":"message","lineHint":231,"file":"src/utils/logger.ts","expectedResult":"find all usages of message to check if validation occurs upstream"}],"ruleId":"security.input-passthrough-risk","confidence":"low","evidence":{"category":"input-passthrough-risk","location":"src/utils/logger.ts:231-246","sourceParameters":["message"],"sink":"formatLogEntry","sanitizerStatus":"missing","propagationSteps":["formatLogEntry:237"]},"analysisLens":"hybrid","correlatedSignals":["hot-file","critical-path-context","paired:dead-export","paired:semantic-dead-export","paired:sql-injection-risk","paired:empty-catch","paired:excessive-parameters","paired:listener-leak-risk"],"recommendedValidation":{"summary":"trace outgoing calls to verify downstream validation of message","tools":["localSearchCode","lspCallHierarchy"]},"flowTrace":[{"file":"formatLogEntry","lineStart":237,"lineEnd":237,"label":"propagation step"}]},{"id":"AST-ISSUE-0226","severity":"low","category":"input-passthrough-risk","file":"src/utils/logger.ts","lineStart":251,"lineEnd":256,"title":"Input passthrough without validation in logWarn(message, data)","reason":"Parameters 'message', 'data' (external input) are passed to formatLogEntry without validation. Downstream callees may not validate either.","files":["src/utils/logger.ts"],"suggestedFix":{"strategy":"Validate input before passing to downstream functions.","steps":["Add schema validation (e.g. zod, joi) at the entry point.","Trace downstream: lspCallHierarchy(outgoing) on logWarn to verify callees validate.","Search for validation middleware: localSearchCode for guard/validate/sanitize patterns."]},"impact":"Unchecked input passed downstream can reach sinks in callees — validation gaps compound across the call chain.","tags":["security","input-validation","passthrough"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"logWarn","lineHint":251,"file":"src/utils/logger.ts","expectedResult":"trace outgoing calls to verify downstream validation of message, data"},{"tool":"lspFindReferences","symbolName":"message","lineHint":251,"file":"src/utils/logger.ts","expectedResult":"find all usages of message to check if validation occurs upstream"}],"ruleId":"security.input-passthrough-risk","confidence":"low","evidence":{"category":"input-passthrough-risk","location":"src/utils/logger.ts:251-256","sourceParameters":["message","data"],"sink":"formatLogEntry","sanitizerStatus":"missing","propagationSteps":["formatLogEntry:252","formatLogEntry:252"]},"analysisLens":"hybrid","correlatedSignals":["hot-file","critical-path-context","paired:dead-export","paired:semantic-dead-export","paired:sql-injection-risk","paired:empty-catch","paired:excessive-parameters","paired:listener-leak-risk"],"recommendedValidation":{"summary":"trace outgoing calls to verify downstream validation of message, data","tools":["localSearchCode","lspCallHierarchy"]},"flowTrace":[{"file":"formatLogEntry","lineStart":252,"lineEnd":252,"label":"propagation step"},{"file":"formatLogEntry","lineStart":252,"lineEnd":252,"label":"propagation step"}]},{"id":"AST-ISSUE-0304","severity":"low","category":"prototype-pollution-risk","file":"src/middleware/queryParser.ts","lineStart":63,"lineEnd":63,"title":"Prototype pollution risk: computed-property-write (guarded)","reason":"Dynamic bracket assignment: cleanedQuery[key] — guards detected (internal iteration or key check), likely false positive. Verify the key variable does not trace to external input.","files":["src/middleware/queryParser.ts"],"suggestedFix":{"strategy":"Guard against __proto__, constructor, and prototype keys before merging.","steps":["Validate keys: reject \"__proto__\", \"constructor\", \"prototype\" before assignment.","Use Object.create(null) as the target for merges when possible.","Replace custom deep-merge with a hardened library (e.g. lodash.merge with prototype guard).","For Object.assign, ensure the source is sanitized or use structuredClone()."]},"impact":"Prototype pollution can override built-in methods, bypass security checks, or achieve remote code execution.","tags":["security","prototype-pollution","injection"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"bracket-assignment","lineHint":63,"file":"src/middleware/queryParser.ts","expectedResult":"trace callers to determine if user-controlled data reaches this site — if key comes from Object.keys() on internal object, dismiss as false positive"}],"ruleId":"security.prototype-pollution-risk","confidence":"low","evidence":{"category":"prototype-pollution-risk","location":"src/middleware/queryParser.ts:63-63","source":"computed-property-write","sink":"Dynamic bracket assignment: cleanedQuery[key]","guarded":true,"sanitizerStatus":"present","propagationSteps":["src/middleware/queryParser.ts:63"]},"analysisLens":"hybrid","correlatedSignals":["paired:unreachable-module","paired:cognitive-complexity","paired:input-passthrough-risk"],"recommendedValidation":{"summary":"trace callers to determine if user-controlled data reaches this site — if key comes from Object.keys() on internal object, dismiss as false positive","tools":["localSearchCode","lspCallHierarchy"]},"flowTrace":[{"file":"src/middleware/queryParser.ts","lineStart":63,"lineEnd":63,"label":"propagation step"}]},{"id":"AST-ISSUE-0305","severity":"low","category":"prototype-pollution-risk","file":"src/routes/tools.ts","lineStart":437,"lineEnd":437,"title":"Prototype pollution risk: computed-property-write (guarded)","reason":"Dynamic bracket assignment: schemas[toolName] — guards detected (internal iteration or key check), likely false positive. Verify the key variable does not trace to external input.","files":["src/routes/tools.ts"],"suggestedFix":{"strategy":"Guard against __proto__, constructor, and prototype keys before merging.","steps":["Validate keys: reject \"__proto__\", \"constructor\", \"prototype\" before assignment.","Use Object.create(null) as the target for merges when possible.","Replace custom deep-merge with a hardened library (e.g. lodash.merge with prototype guard).","For Object.assign, ensure the source is sanitized or use structuredClone()."]},"impact":"Prototype pollution can override built-in methods, bypass security checks, or achieve remote code execution.","tags":["security","prototype-pollution","injection"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"bracket-assignment","lineHint":437,"file":"src/routes/tools.ts","expectedResult":"trace callers to determine if user-controlled data reaches this site — if key comes from Object.keys() on internal object, dismiss as false positive"}],"ruleId":"security.prototype-pollution-risk","confidence":"low","evidence":{"category":"prototype-pollution-risk","location":"src/routes/tools.ts:437-437","source":"computed-property-write","sink":"Dynamic bracket assignment: schemas[toolName]","guarded":true,"sanitizerStatus":"present","propagationSteps":["src/routes/tools.ts:437"]},"analysisLens":"hybrid","correlatedSignals":["hot-file","critical-path-context","paired:hardcoded-secret","paired:untested-critical-code","paired:unvalidated-input-sink","paired:listener-leak-risk","paired:over-abstraction","paired:type-assertion-escape"],"recommendedValidation":{"summary":"trace callers to determine if user-controlled data reaches this site — if key comes from Object.keys() on internal object, dismiss as false positive","tools":["localSearchCode","lspCallHierarchy"]},"flowTrace":[{"file":"src/routes/tools.ts","lineStart":437,"lineEnd":437,"label":"propagation step"}]},{"id":"AST-ISSUE-0306","severity":"low","category":"prototype-pollution-risk","file":"src/types/mcp.ts","lineStart":94,"lineEnd":94,"title":"Prototype pollution risk: computed-property-write (guarded)","reason":"Dynamic bracket assignment: properties[key] — guards detected (internal iteration or key check), likely false positive. Verify the key variable does not trace to external input.","files":["src/types/mcp.ts"],"suggestedFix":{"strategy":"Guard against __proto__, constructor, and prototype keys before merging.","steps":["Validate keys: reject \"__proto__\", \"constructor\", \"prototype\" before assignment.","Use Object.create(null) as the target for merges when possible.","Replace custom deep-merge with a hardened library (e.g. lodash.merge with prototype guard).","For Object.assign, ensure the source is sanitized or use structuredClone()."]},"impact":"Prototype pollution can override built-in methods, bypass security checks, or achieve remote code execution.","tags":["security","prototype-pollution","injection"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"bracket-assignment","lineHint":94,"file":"src/types/mcp.ts","expectedResult":"trace callers to determine if user-controlled data reaches this site — if key comes from Object.keys() on internal object, dismiss as false positive"}],"ruleId":"security.prototype-pollution-risk","confidence":"low","evidence":{"category":"prototype-pollution-risk","location":"src/types/mcp.ts:94-94","source":"computed-property-write","sink":"Dynamic bracket assignment: properties[key]","guarded":true,"sanitizerStatus":"present","propagationSteps":["src/types/mcp.ts:94"]},"analysisLens":"hybrid","correlatedSignals":["paired:semantic-dead-export","paired:dead-export","paired:over-abstraction","paired:move-to-caller"],"recommendedValidation":{"summary":"trace callers to determine if user-controlled data reaches this site — if key comes from Object.keys() on internal object, dismiss as false positive","tools":["localSearchCode","lspCallHierarchy"]},"flowTrace":[{"file":"src/types/mcp.ts","lineStart":94,"lineEnd":94,"label":"propagation step"}]},{"id":"AST-ISSUE-0307","severity":"low","category":"prototype-pollution-risk","file":"src/utils/logger.ts","lineStart":409,"lineEnd":409,"title":"Prototype pollution risk: computed-property-write (guarded)","reason":"Dynamic bracket assignment: sanitized[key] — guards detected (internal iteration or key check), likely false positive. Verify the key variable does not trace to external input.","files":["src/utils/logger.ts"],"suggestedFix":{"strategy":"Guard against __proto__, constructor, and prototype keys before merging.","steps":["Validate keys: reject \"__proto__\", \"constructor\", \"prototype\" before assignment.","Use Object.create(null) as the target for merges when possible.","Replace custom deep-merge with a hardened library (e.g. lodash.merge with prototype guard).","For Object.assign, ensure the source is sanitized or use structuredClone()."]},"impact":"Prototype pollution can override built-in methods, bypass security checks, or achieve remote code execution.","tags":["security","prototype-pollution","injection"],"lspHints":[{"tool":"lspCallHierarchy","symbolName":"bracket-assignment","lineHint":409,"file":"src/utils/logger.ts","expectedResult":"trace callers to determine if user-controlled data reaches this site — if key comes from Object.keys() on internal object, dismiss as false positive"}],"ruleId":"security.prototype-pollution-risk","confidence":"low","evidence":{"category":"prototype-pollution-risk","location":"src/utils/logger.ts:409-409","source":"computed-property-write","sink":"Dynamic bracket assignment: sanitized[key]","guarded":true,"sanitizerStatus":"present","propagationSteps":["src/utils/logger.ts:409"]},"analysisLens":"hybrid","correlatedSignals":["hot-file","critical-path-context","paired:dead-export","paired:semantic-dead-export","paired:sql-injection-risk","paired:empty-catch","paired:excessive-parameters","paired:input-passthrough-risk"],"recommendedValidation":{"summary":"trace callers to determine if user-controlled data reaches this site — if key comes from Object.keys() on internal object, dismiss as false positive","tools":["localSearchCode","lspCallHierarchy"]},"flowTrace":[{"file":"src/utils/logger.ts","lineStart":409,"lineEnd":409,"label":"propagation step"}]}],"findingsCount":22,"severityBreakdown":{"critical":0,"high":12,"medium":3,"low":7,"info":0},"categoryBreakdown":{"hardcoded-secret":1,"prototype-pollution-risk":6,"sql-injection-risk":2,"unvalidated-input-sink":7,"input-passthrough-risk":6}}
@@ -0,0 +1 @@
1
+ {"schemaVersion":"1.1.0","generatedAt":"2026-03-22T10:40:13.784Z","repoRoot":"/Users/guybary/Documents/octocode-mcp/skills/octocode-research","options":{"minFunctionStatements":6,"minFlowStatements":6,"root":"/Users/guybary/Documents/octocode-mcp/skills/octocode-research","includeTests":false,"emitTree":true,"json":false,"graph":true,"out":null,"treeDepth":4,"findingsLimit":null,"parser":"auto","criticalComplexityThreshold":30,"deepLinkTopN":12,"packageRoot":"/Users/guybary/Documents/octocode-mcp/skills/octocode-research/packages","ignoreDirs":[".git",".next",".yarn",".cache",".octocode","node_modules","dist","coverage","out"],"couplingThreshold":15,"fanInThreshold":20,"fanOutThreshold":15,"godModuleStatements":500,"godModuleExports":20,"godFunctionStatements":100,"godFunctionMiThreshold":10,"cognitiveComplexityThreshold":15,"barrelSymbolThreshold":30,"layerOrder":[],"parameterThreshold":5,"halsteadEffortThreshold":500000,"maintainabilityIndexThreshold":20,"anyThreshold":5,"flowDupThreshold":3,"maxRecsPerCategory":2,"features":null,"scope":["/Users/guybary/Documents/octocode-mcp/skills/octocode-research/src"],"scopeSymbols":null,"noCache":false,"clearCache":false,"semantic":true,"overrideChainThreshold":3,"shotgunThreshold":8,"sdpMinDelta":0.15,"sdpMaxSourceInstability":0.6,"secretEntropyThreshold":4.5,"secretMinLength":20,"similarityThreshold":0.85,"mockThreshold":10,"noDiversify":false,"graphAdvanced":false,"flow":true},"parser":{"requested":"auto","effective":"typescript (primary) + tree-sitter (node count)","treeSitterAvailable":true,"treeSitterError":null},"summary":{"totalPackages":1,"totalFiles":36,"totalNodes":21976,"totalFunctions":286,"totalFlows":357,"totalDependencyFiles":53,"byPackage":{"octocode-skill":{"files":36,"nodes":21981,"functions":286,"flows":357,"topKinds":[["Identifier",7581],["PropertyAccessExpression",1403],["CallExpression",1200],["PropertyAssignment",1018],["StringLiteral",948],["BinaryExpression",539],["Block",432],["VariableDeclaration",424]],"rootPath":"octocode-research"}}},"agentOutput":{"totalFindings":307,"totalBeforeTruncation":307,"droppedCategories":[],"findingStats":{"overall":{"totalFindings":307,"severityBreakdown":{"critical":7,"high":126,"medium":90,"low":84,"info":0}},"pillars":{"architecture":{"totalFindings":67,"severityBreakdown":{"critical":7,"high":32,"medium":28,"low":0,"info":0}},"code-quality":{"totalFindings":41,"severityBreakdown":{"critical":0,"high":8,"medium":29,"low":4,"info":0}},"dead-code":{"totalFindings":177,"severityBreakdown":{"critical":0,"high":74,"medium":30,"low":73,"info":0}},"security":{"totalFindings":22,"severityBreakdown":{"critical":0,"high":12,"medium":3,"low":7,"info":0}},"test-quality":{"totalFindings":0,"severityBreakdown":{"critical":0,"high":0,"medium":0,"low":0,"info":0}}}},"analysisSummary":{"strongestGraphSignal":{"kind":"structural-chokepoint","lens":"graph","title":"Structural chokepoint","summary":"src/utils/responseBuilder.ts concentrates dependency pressure (articulation point, 1 bridge edge(s), on critical path, high complexity risk (109)).","confidence":"high","score":53,"files":["src/utils/responseBuilder.ts"],"categories":["broker-module","bridge-module"],"evidence":{"score":53,"reasons":["articulation point","1 bridge edge(s)","on critical path","high complexity risk (109)"]}},"strongestAstSignal":{"kind":"hidden-initialization","lens":"ast","title":"Hidden initialization logic","summary":"src/server-init.ts performs import-time work that matches the reported side-effect risk.","confidence":"medium","score":75,"files":["src/server-init.ts"],"categories":["import-side-effect-risk"],"evidence":{"totalEffects":2,"highestRisk":"process-handler"}},"combinedSignals":[{"kind":"combined-interpretation","lens":"hybrid","title":"Combined interpretation","summary":"Structural chokepoint and Hidden initialization logic both appear in this scan, so use a hybrid investigation instead of a single-lens conclusion.","confidence":"medium","score":64,"files":["src/utils/responseBuilder.ts","src/server-init.ts"],"categories":["broker-module","bridge-module","import-side-effect-risk"],"evidence":{"graphKind":"structural-chokepoint","astKind":"hidden-initialization","sharedFile":null}}],"recommendedValidation":{"summary":"navigate to the awaited call to check if parallelization is safe","tools":["localSearchCode","lspGotoDefinition"]}},"highPriority":133,"mediumPriority":90,"lowPriority":84,"topRecommendations":[{"id":"AST-ISSUE-0001","file":"src/server.ts","severity":"critical","category":"dependency-critical-path","title":"Critical dependency chain risk: 6 files (2 entry points)","reason":"Potentially high-change surface: src/server.ts -> src/routes/tools.ts -> src/utils/resilience.ts -> src/utils/circuitBreaker.ts -> src/index.ts -> src/utils/responseBuilder.ts (351 weight). Also reached from: src/routes/tools.ts.","suggestedFix":{"strategy":"Break chain at `src/server.ts` (fan-out: 11, fan-in: 0).","steps":["Extract interface from `src/server.ts` — it has 11 outbound dependencies.","Downstream modules depend on the interface, not the implementation.","This splits the chain into two independent segments."]}},{"id":"AST-ISSUE-0002","file":"src/__tests__/integration/routes.test.ts","severity":"critical","category":"dependency-critical-path","title":"Critical dependency chain risk: 6 files (2 entry points)","reason":"Potentially high-change surface: src/__tests__/integration/routes.test.ts -> src/routes/lsp.ts -> src/utils/resilience.ts -> src/utils/circuitBreaker.ts -> src/index.ts -> src/utils/responseBuilder.ts (267 weight). Also reached from: src/routes/lsp.ts.","suggestedFix":{"strategy":"Break chain at `src/routes/lsp.ts` (fan-out: 7, fan-in: 1).","steps":["Extract interface from `src/routes/lsp.ts` — it has 7 outbound dependencies.","Downstream modules depend on the interface, not the implementation.","This splits the chain into two independent segments."]}},{"id":"AST-ISSUE-0008","file":"src/server-init.ts","severity":"high","category":"await-in-loop","title":"await inside loop — sequential async execution","reason":"Each await runs serially. For N iterations this takes N * latency instead of max(latency). Use Promise.all() or Promise.allSettled() for parallel execution.","suggestedFix":{"strategy":"Collect promises and await them in parallel with Promise.all().","steps":["Collect all async operations into an array of promises.","Use await Promise.all(promises) or Promise.allSettled(promises).","If order matters or rate limiting is needed, use a batching utility."]}},{"id":"AST-ISSUE-0009","file":"src/server-init.ts","severity":"high","category":"await-in-loop","title":"await inside loop — sequential async execution","reason":"Each await runs serially. For N iterations this takes N * latency instead of max(latency). Use Promise.all() or Promise.allSettled() for parallel execution.","suggestedFix":{"strategy":"Collect promises and await them in parallel with Promise.all().","steps":["Collect all async operations into an array of promises.","Use await Promise.all(promises) or Promise.allSettled(promises).","If order matters or rate limiting is needed, use a batching utility."]}},{"id":"AST-ISSUE-0012","file":"src/utils/responseParser.ts","severity":"high","category":"cognitive-complexity","title":"High cognitive complexity: parseToolResponse (29)","reason":"Function cognitive complexity is 29 (threshold: 15). Nested branches compound reading difficulty.","suggestedFix":{"strategy":"Reduce nesting and simplify control flow.","steps":["Convert nested branches into early returns / guard clauses.","Extract deeply nested blocks into named helper functions.","Replace complex boolean chains with named predicates."]}},{"id":"AST-ISSUE-0013","file":"src/utils/responseParser.ts","severity":"high","category":"cognitive-complexity","title":"High cognitive complexity: parseToolResponseBulk (30)","reason":"Function cognitive complexity is 30 (threshold: 15). Nested branches compound reading difficulty.","suggestedFix":{"strategy":"Reduce nesting and simplify control flow.","steps":["Convert nested branches into early returns / guard clauses.","Extract deeply nested blocks into named helper functions.","Replace complex boolean chains with named predicates."]}},{"id":"AST-ISSUE-0014","file":"src/types/errorGuards.ts","severity":"high","category":"dead-export","title":"Unused export: hasMessage","reason":"Exported symbol \"hasMessage\" has no observed import or re-export usage in production or test files.","suggestedFix":{"strategy":"Remove or internalize unused exports.","steps":["Confirm symbol is not part of intentional public API surface.","Remove export modifier or delete symbol if truly unused.","Re-run scan and tests to ensure no hidden runtime usage."]}},{"id":"AST-ISSUE-0015","file":"src/types/errorGuards.ts","severity":"high","category":"dead-export","title":"Unused export: hasHeaders","reason":"Exported symbol \"hasHeaders\" has no observed import or re-export usage in production or test files.","suggestedFix":{"strategy":"Remove or internalize unused exports.","steps":["Confirm symbol is not part of intentional public API surface.","Remove export modifier or delete symbol if truly unused.","Re-run scan and tests to ensure no hidden runtime usage."]}},{"id":"AST-ISSUE-0044","file":"src/mcpCache.ts","severity":"high","category":"distance-from-main-sequence","title":"Distance from Main Sequence: src/mcpCache.ts (D=1.00)","reason":"Zone of Pain (concrete + stable): hard to extend, painful to change. A=0.00, I=0.00, D=1.00 (threshold: 0.7).","suggestedFix":{"strategy":"Add abstractions (interfaces/types) or reduce inbound coupling.","steps":["Extract interfaces for key behaviors to increase abstractness.","Consider splitting into abstract contracts + concrete implementations.","Reduce inbound coupling by narrowing the public API surface."]}},{"id":"AST-ISSUE-0045","file":"src/types/guards.ts","severity":"high","category":"distance-from-main-sequence","title":"Distance from Main Sequence: src/types/guards.ts (D=1.00)","reason":"Zone of Pain (concrete + stable): hard to extend, painful to change. A=0.00, I=0.00, D=1.00 (threshold: 0.7).","suggestedFix":{"strategy":"Add abstractions (interfaces/types) or reduce inbound coupling.","steps":["Extract interfaces for key behaviors to increase abstractness.","Consider splitting into abstract contracts + concrete implementations.","Reduce inbound coupling by narrowing the public API surface."]}},{"id":"AST-ISSUE-0051","file":"src/validation/index.ts","severity":"high","category":"export-star-leak","title":"export * leaks entire module surface: ./schemas.js","reason":"`export * from './schemas.js'` re-exports every symbol from the source, defeating granular tree-shaking. Target exports 39 symbols.","suggestedFix":{"strategy":"Replace export * with explicit named re-exports.","steps":["List the symbols actually consumed from `./schemas.js` by downstream modules.","Replace `export * from './schemas.js'` with `export { A, B, C } from './schemas.js'`.","This lets bundlers eliminate unused re-exports during tree-shaking."]}},{"id":"AST-ISSUE-0052","file":"src/utils/retry.ts","severity":"high","category":"feature-envy","title":"Feature envy: src/utils/retry.ts → src/types/errorGuards.ts","reason":"Module imports 5/5 symbols (100%) from \"src/types/errorGuards.ts\". This suggests the logic may belong in or closer to the target module.","suggestedFix":{"strategy":"Move dependent logic to the target module or extract a shared module.","steps":["Identify which functions/logic in this file use the imported symbols.","Move that logic to the target module if it belongs there.","If shared, extract a dedicated module that both can import from.","Reduce the import surface by passing data instead of importing behaviors."]}},{"id":"AST-ISSUE-0053","file":"src/validation/schemas.ts","severity":"high","category":"feature-envy","title":"Feature envy: src/validation/schemas.ts → src/validation/httpPreprocess.ts","reason":"Module imports 7/7 symbols (100%) from \"src/validation/httpPreprocess.ts\". This suggests the logic may belong in or closer to the target module.","suggestedFix":{"strategy":"Move dependent logic to the target module or extract a shared module.","steps":["Identify which functions/logic in this file use the imported symbols.","Move that logic to the target module if it belongs there.","If shared, extract a dedicated module that both can import from.","Reduce the import surface by passing data instead of importing behaviors."]}},{"id":"AST-ISSUE-0054","file":"src/validation/schemas.ts","severity":"high","category":"god-module","title":"God module: src/validation/schemas.ts","reason":"Module is excessively large: 39 exports (threshold: 20).","suggestedFix":{"strategy":"Split module into focused sub-modules with single responsibilities.","steps":["Identify distinct functional groups within the module.","Extract each group into a dedicated module.","Create a barrel if backward compatibility is needed.","Update imports incrementally."]}},{"id":"AST-ISSUE-0055","file":"src/routes/tools.ts","severity":"high","category":"hardcoded-secret","title":"Potential hardcoded secret","reason":"String literal matches a secret pattern (password, API key, token, high-entropy string). Secrets in source code risk credential leaks. Validate: use localSearchCode to find the variable, then lspFindReferences to check if it is used in auth or network calls.","suggestedFix":{"strategy":"Move secret to environment variable or secrets manager.","steps":["Replace the hardcoded value with process.env.YOUR_SECRET.","Add the variable to your .env file (excluded from git).","Verify the secret is not committed in git history."]}},{"id":"AST-ISSUE-0056","file":"src/routes/tools.ts","severity":"high","category":"prototype-pollution-risk","title":"Prototype pollution risk: computed-property-write","reason":"Dynamic bracket assignment: schemas[toolName]","suggestedFix":{"strategy":"Guard against __proto__, constructor, and prototype keys before merging.","steps":["Validate keys: reject \"__proto__\", \"constructor\", \"prototype\" before assignment.","Use Object.create(null) as the target for merges when possible.","Replace custom deep-merge with a hardened library (e.g. lodash.merge with prototype guard).","For Object.assign, ensure the source is sanitized or use structuredClone()."]}},{"id":"AST-ISSUE-0057","file":"src/utils/circuitBreaker.ts","severity":"high","category":"prototype-pollution-risk","title":"Prototype pollution risk: computed-property-write","reason":"Dynamic bracket assignment: states[name]","suggestedFix":{"strategy":"Guard against __proto__, constructor, and prototype keys before merging.","steps":["Validate keys: reject \"__proto__\", \"constructor\", \"prototype\" before assignment.","Use Object.create(null) as the target for merges when possible.","Replace custom deep-merge with a hardened library (e.g. lodash.merge with prototype guard).","For Object.assign, ensure the source is sanitized or use structuredClone()."]}},{"id":"AST-ISSUE-0058","file":"src/types/guards.ts","severity":"high","category":"semantic-dead-export","title":"Semantically dead export: isPositiveNumber","reason":"Exported symbol \"isPositiveNumber\" has zero semantic references across the entire program (confirmed via TypeChecker, not just import matching).","suggestedFix":{"strategy":"Remove the export or delete the symbol if unused internally.","steps":["Verify the symbol is not used via dynamic imports or runtime reflection.","Remove the export keyword, or delete the symbol entirely if also unused locally.","Re-run scan to confirm finding is resolved."]}},{"id":"AST-ISSUE-0059","file":"src/types/guards.ts","severity":"high","category":"semantic-dead-export","title":"Semantically dead export: isNonNegativeNumber","reason":"Exported symbol \"isNonNegativeNumber\" has zero semantic references across the entire program (confirmed via TypeChecker, not just import matching).","suggestedFix":{"strategy":"Remove the export or delete the symbol if unused internally.","steps":["Verify the symbol is not used via dynamic imports or runtime reflection.","Remove the export keyword, or delete the symbol entirely if also unused locally.","Re-run scan to confirm finding is resolved."]}},{"id":"AST-ISSUE-0102","file":"src/utils/responseBuilder.ts","severity":"high","category":"similar-function-body","title":"Similar function: fileContent (97% similar to bulkResult in src/utils/responseBuilder.ts)","reason":"\"fileContent\" and \"bulkResult\" have 97% structural similarity. Near-duplicates diverge over time and should be consolidated.","suggestedFix":{"strategy":"Extract shared logic into a parameterized helper.","steps":["Compare src/utils/responseBuilder.ts:133 with src/utils/responseBuilder.ts:410.","Identify the varying parts and extract them as parameters.","Create a shared function and call it from both locations."]}}],"filesWithIssues":[{"file":"src/server.ts","issueCount":8,"issueIds":["AST-ISSUE-0001","AST-ISSUE-0119","AST-ISSUE-0178","AST-ISSUE-0185","AST-ISSUE-0192","AST-ISSUE-0222","AST-ISSUE-0235","AST-ISSUE-0236"]},{"file":"src/__tests__/integration/routes.test.ts","issueCount":1,"issueIds":["AST-ISSUE-0002"]},{"file":"src/routes/github.ts","issueCount":4,"issueIds":["AST-ISSUE-0003","AST-ISSUE-0106","AST-ISSUE-0166","AST-ISSUE-0231"]},{"file":"src/routes/local.ts","issueCount":4,"issueIds":["AST-ISSUE-0004","AST-ISSUE-0107","AST-ISSUE-0167","AST-ISSUE-0232"]},{"file":"src/routes/package.ts","issueCount":6,"issueIds":["AST-ISSUE-0005","AST-ISSUE-0109","AST-ISSUE-0128","AST-ISSUE-0169","AST-ISSUE-0196","AST-ISSUE-0234"]},{"file":"src/__tests__/integration/circuitBreaker.test.ts","issueCount":1,"issueIds":["AST-ISSUE-0006"]},{"file":"src/__tests__/unit/circuitBreaker.test.ts","issueCount":1,"issueIds":["AST-ISSUE-0007"]},{"file":"src/server-init.ts","issueCount":10,"issueIds":["AST-ISSUE-0008","AST-ISSUE-0009","AST-ISSUE-0110","AST-ISSUE-0126","AST-ISSUE-0162","AST-ISSUE-0170","AST-ISSUE-0177","AST-ISSUE-0184","AST-ISSUE-0191","AST-ISSUE-0193"]},{"file":"src/utils/retry.ts","issueCount":11,"issueIds":["AST-ISSUE-0010","AST-ISSUE-0011","AST-ISSUE-0039","AST-ISSUE-0040","AST-ISSUE-0041","AST-ISSUE-0042","AST-ISSUE-0052","AST-ISSUE-0084","AST-ISSUE-0085","AST-ISSUE-0086","AST-ISSUE-0087"]},{"file":"src/utils/responseParser.ts","issueCount":15,"issueIds":["AST-ISSUE-0012","AST-ISSUE-0013","AST-ISSUE-0038","AST-ISSUE-0083","AST-ISSUE-0123","AST-ISSUE-0156","AST-ISSUE-0157","AST-ISSUE-0158","AST-ISSUE-0206","AST-ISSUE-0207","AST-ISSUE-0208","AST-ISSUE-0281","AST-ISSUE-0282","AST-ISSUE-0283","AST-ISSUE-0284"]},{"file":"src/types/errorGuards.ts","issueCount":19,"issueIds":["AST-ISSUE-0014","AST-ISSUE-0015","AST-ISSUE-0016","AST-ISSUE-0017","AST-ISSUE-0120","AST-ISSUE-0137","AST-ISSUE-0138","AST-ISSUE-0139","AST-ISSUE-0237","AST-ISSUE-0238","AST-ISSUE-0239","AST-ISSUE-0240","AST-ISSUE-0241","AST-ISSUE-0242","AST-ISSUE-0243","AST-ISSUE-0244","AST-ISSUE-0245","AST-ISSUE-0246","AST-ISSUE-0247"]},{"file":"src/types/guards.ts","issueCount":14,"issueIds":["AST-ISSUE-0018","AST-ISSUE-0019","AST-ISSUE-0020","AST-ISSUE-0021","AST-ISSUE-0045","AST-ISSUE-0058","AST-ISSUE-0059","AST-ISSUE-0060","AST-ISSUE-0111","AST-ISSUE-0118","AST-ISSUE-0248","AST-ISSUE-0249","AST-ISSUE-0250","AST-ISSUE-0300"]},{"file":"src/types/responses.ts","issueCount":18,"issueIds":["AST-ISSUE-0022","AST-ISSUE-0023","AST-ISSUE-0063","AST-ISSUE-0064","AST-ISSUE-0065","AST-ISSUE-0066","AST-ISSUE-0067","AST-ISSUE-0112","AST-ISSUE-0147","AST-ISSUE-0148","AST-ISSUE-0149","AST-ISSUE-0150","AST-ISSUE-0200","AST-ISSUE-0201","AST-ISSUE-0257","AST-ISSUE-0258","AST-ISSUE-0259","AST-ISSUE-0260"]},{"file":"src/types/toolTypes.ts","issueCount":10,"issueIds":["AST-ISSUE-0024","AST-ISSUE-0068","AST-ISSUE-0113","AST-ISSUE-0151","AST-ISSUE-0152","AST-ISSUE-0163","AST-ISSUE-0194","AST-ISSUE-0202","AST-ISSUE-0261","AST-ISSUE-0262"]},{"file":"src/utils/circuitBreaker.ts","issueCount":16,"issueIds":["AST-ISSUE-0025","AST-ISSUE-0026","AST-ISSUE-0057","AST-ISSUE-0069","AST-ISSUE-0070","AST-ISSUE-0071","AST-ISSUE-0072","AST-ISSUE-0203","AST-ISSUE-0221","AST-ISSUE-0223","AST-ISSUE-0264","AST-ISSUE-0265","AST-ISSUE-0266","AST-ISSUE-0267","AST-ISSUE-0268","AST-ISSUE-0269"]},{"file":"src/utils/logEmoji.ts","issueCount":11,"issueIds":["AST-ISSUE-0027","AST-ISSUE-0028","AST-ISSUE-0029","AST-ISSUE-0073","AST-ISSUE-0114","AST-ISSUE-0153","AST-ISSUE-0164","AST-ISSUE-0195","AST-ISSUE-0272","AST-ISSUE-0273","AST-ISSUE-0274"]},{"file":"src/utils/logger.ts","issueCount":33,"issueIds":["AST-ISSUE-0030","AST-ISSUE-0031","AST-ISSUE-0032","AST-ISSUE-0033","AST-ISSUE-0034","AST-ISSUE-0074","AST-ISSUE-0075","AST-ISSUE-0076","AST-ISSUE-0077","AST-ISSUE-0078","AST-ISSUE-0103","AST-ISSUE-0104","AST-ISSUE-0154","AST-ISSUE-0171","AST-ISSUE-0172","AST-ISSUE-0173","AST-ISSUE-0174","AST-ISSUE-0180","AST-ISSUE-0187","AST-ISSUE-0189","AST-ISSUE-0211","AST-ISSUE-0216","AST-ISSUE-0217","AST-ISSUE-0218","AST-ISSUE-0219","AST-ISSUE-0225","AST-ISSUE-0226","AST-ISSUE-0275","AST-ISSUE-0276","AST-ISSUE-0277","AST-ISSUE-0278","AST-ISSUE-0279","AST-ISSUE-0307"]},{"file":"src/utils/responseFactory.ts","issueCount":14,"issueIds":["AST-ISSUE-0035","AST-ISSUE-0036","AST-ISSUE-0037","AST-ISSUE-0080","AST-ISSUE-0081","AST-ISSUE-0082","AST-ISSUE-0115","AST-ISSUE-0122","AST-ISSUE-0134","AST-ISSUE-0176","AST-ISSUE-0280","AST-ISSUE-0301","AST-ISSUE-0302","AST-ISSUE-0303"]},{"file":"src/validation/toolCallSchema.ts","issueCount":11,"issueIds":["AST-ISSUE-0043","AST-ISSUE-0160","AST-ISSUE-0161","AST-ISSUE-0181","AST-ISSUE-0209","AST-ISSUE-0294","AST-ISSUE-0295","AST-ISSUE-0296","AST-ISSUE-0297","AST-ISSUE-0298","AST-ISSUE-0299"]},{"file":"src/mcpCache.ts","issueCount":5,"issueIds":["AST-ISSUE-0044","AST-ISSUE-0188","AST-ISSUE-0190","AST-ISSUE-0210","AST-ISSUE-0227"]},{"file":"src/utils/asyncTimeout.ts","issueCount":3,"issueIds":["AST-ISSUE-0046","AST-ISSUE-0186","AST-ISSUE-0263"]},{"file":"src/utils/colors.ts","issueCount":4,"issueIds":["AST-ISSUE-0047","AST-ISSUE-0124","AST-ISSUE-0270","AST-ISSUE-0271"]},{"file":"src/utils/errorQueue.ts","issueCount":2,"issueIds":["AST-ISSUE-0048","AST-ISSUE-0204"]},{"file":"src/utils/responseBuilder.ts","issueCount":6,"issueIds":["AST-ISSUE-0049","AST-ISSUE-0102","AST-ISSUE-0136","AST-ISSUE-0205","AST-ISSUE-0214","AST-ISSUE-0215"]},{"file":"src/validation/httpPreprocess.ts","issueCount":10,"issueIds":["AST-ISSUE-0050","AST-ISSUE-0088","AST-ISSUE-0286","AST-ISSUE-0287","AST-ISSUE-0288","AST-ISSUE-0289","AST-ISSUE-0290","AST-ISSUE-0291","AST-ISSUE-0292","AST-ISSUE-0293"]},{"file":"src/validation/index.ts","issueCount":3,"issueIds":["AST-ISSUE-0051","AST-ISSUE-0175","AST-ISSUE-0212"]},{"file":"src/validation/schemas.ts","issueCount":15,"issueIds":["AST-ISSUE-0053","AST-ISSUE-0054","AST-ISSUE-0089","AST-ISSUE-0090","AST-ISSUE-0091","AST-ISSUE-0092","AST-ISSUE-0093","AST-ISSUE-0094","AST-ISSUE-0095","AST-ISSUE-0096","AST-ISSUE-0097","AST-ISSUE-0098","AST-ISSUE-0099","AST-ISSUE-0100","AST-ISSUE-0101"]},{"file":"src/routes/tools.ts","issueCount":10,"issueIds":["AST-ISSUE-0055","AST-ISSUE-0056","AST-ISSUE-0117","AST-ISSUE-0130","AST-ISSUE-0131","AST-ISSUE-0132","AST-ISSUE-0183","AST-ISSUE-0197","AST-ISSUE-0220","AST-ISSUE-0305"]},{"file":"src/types/mcp.ts","issueCount":18,"issueIds":["AST-ISSUE-0061","AST-ISSUE-0062","AST-ISSUE-0140","AST-ISSUE-0141","AST-ISSUE-0142","AST-ISSUE-0143","AST-ISSUE-0144","AST-ISSUE-0145","AST-ISSUE-0146","AST-ISSUE-0198","AST-ISSUE-0199","AST-ISSUE-0251","AST-ISSUE-0252","AST-ISSUE-0253","AST-ISSUE-0254","AST-ISSUE-0255","AST-ISSUE-0256","AST-ISSUE-0306"]},{"file":"src/utils/resilience.ts","issueCount":3,"issueIds":["AST-ISSUE-0079","AST-ISSUE-0121","AST-ISSUE-0155"]},{"file":"src/middleware/queryParser.ts","issueCount":4,"issueIds":["AST-ISSUE-0105","AST-ISSUE-0135","AST-ISSUE-0224","AST-ISSUE-0304"]},{"file":"src/routes/lsp.ts","issueCount":3,"issueIds":["AST-ISSUE-0108","AST-ISSUE-0168","AST-ISSUE-0233"]},{"file":"src/utils/routeFactory.ts","issueCount":4,"issueIds":["AST-ISSUE-0116","AST-ISSUE-0133","AST-ISSUE-0159","AST-ISSUE-0285"]},{"file":"src/index.ts","issueCount":2,"issueIds":["AST-ISSUE-0125","AST-ISSUE-0165"]},{"file":"src/middleware/errorHandler.ts","issueCount":3,"issueIds":["AST-ISSUE-0127","AST-ISSUE-0228","AST-ISSUE-0229"]},{"file":"src/routes/prompts.ts","issueCount":1,"issueIds":["AST-ISSUE-0129"]},{"file":"src/middleware/logger.ts","issueCount":4,"issueIds":["AST-ISSUE-0179","AST-ISSUE-0182","AST-ISSUE-0213","AST-ISSUE-0230"]}]},"analysisSummary":{"graphSignals":[{"kind":"structural-chokepoint","lens":"graph","title":"Structural chokepoint","summary":"src/utils/responseBuilder.ts concentrates dependency pressure (articulation point, 1 bridge edge(s), on critical path, high complexity risk (109)).","confidence":"high","score":53,"files":["src/utils/responseBuilder.ts"],"categories":["broker-module","bridge-module"],"evidence":{"score":53,"reasons":["articulation point","1 bridge edge(s)","on critical path","high complexity risk (109)"]}}],"astSignals":[{"kind":"hidden-initialization","lens":"ast","title":"Hidden initialization logic","summary":"src/server-init.ts performs import-time work that matches the reported side-effect risk.","confidence":"medium","score":75,"files":["src/server-init.ts"],"categories":["import-side-effect-risk"],"evidence":{"totalEffects":2,"highestRisk":"process-handler"}},{"kind":"hidden-initialization","lens":"ast","title":"Hidden initialization logic","summary":"src/server.ts performs import-time work that matches the reported side-effect risk.","confidence":"medium","score":75,"files":["src/server.ts"],"categories":["import-side-effect-risk"],"evidence":{"totalEffects":2,"highestRisk":"process-handler"}}],"strongestGraphSignal":{"kind":"structural-chokepoint","lens":"graph","title":"Structural chokepoint","summary":"src/utils/responseBuilder.ts concentrates dependency pressure (articulation point, 1 bridge edge(s), on critical path, high complexity risk (109)).","confidence":"high","score":53,"files":["src/utils/responseBuilder.ts"],"categories":["broker-module","bridge-module"],"evidence":{"score":53,"reasons":["articulation point","1 bridge edge(s)","on critical path","high complexity risk (109)"]}},"strongestAstSignal":{"kind":"hidden-initialization","lens":"ast","title":"Hidden initialization logic","summary":"src/server-init.ts performs import-time work that matches the reported side-effect risk.","confidence":"medium","score":75,"files":["src/server-init.ts"],"categories":["import-side-effect-risk"],"evidence":{"totalEffects":2,"highestRisk":"process-handler"}},"combinedSignals":[{"kind":"combined-interpretation","lens":"hybrid","title":"Combined interpretation","summary":"Structural chokepoint and Hidden initialization logic both appear in this scan, so use a hybrid investigation instead of a single-lens conclusion.","confidence":"medium","score":64,"files":["src/utils/responseBuilder.ts","src/server-init.ts"],"categories":["broker-module","bridge-module","import-side-effect-risk"],"evidence":{"graphKind":"structural-chokepoint","astKind":"hidden-initialization","sharedFile":null}}],"recommendedValidation":{"summary":"navigate to the awaited call to check if parallelization is safe","tools":["localSearchCode","lspGotoDefinition"]}},"strongestGraphSignal":{"kind":"structural-chokepoint","lens":"graph","title":"Structural chokepoint","summary":"src/utils/responseBuilder.ts concentrates dependency pressure (articulation point, 1 bridge edge(s), on critical path, high complexity risk (109)).","confidence":"high","score":53,"files":["src/utils/responseBuilder.ts"],"categories":["broker-module","bridge-module"],"evidence":{"score":53,"reasons":["articulation point","1 bridge edge(s)","on critical path","high complexity risk (109)"]}},"strongestAstSignal":{"kind":"hidden-initialization","lens":"ast","title":"Hidden initialization logic","summary":"src/server-init.ts performs import-time work that matches the reported side-effect risk.","confidence":"medium","score":75,"files":["src/server-init.ts"],"categories":["import-side-effect-risk"],"evidence":{"totalEffects":2,"highestRisk":"process-handler"}},"combinedSignals":[{"kind":"combined-interpretation","lens":"hybrid","title":"Combined interpretation","summary":"Structural chokepoint and Hidden initialization logic both appear in this scan, so use a hybrid investigation instead of a single-lens conclusion.","confidence":"medium","score":64,"files":["src/utils/responseBuilder.ts","src/server-init.ts"],"categories":["broker-module","bridge-module","import-side-effect-risk"],"evidence":{"graphKind":"structural-chokepoint","astKind":"hidden-initialization","sharedFile":null}}],"recommendedValidation":{"summary":"navigate to the awaited call to check if parallelization is safe","tools":["localSearchCode","lspGotoDefinition"]},"investigationPrompts":["Inspect src/utils/responseBuilder.ts first and validate the graph claim with localSearchCode plus LSP navigation.","Use file-inventory.json for src/server-init.ts to explain why the code shape matches the finding.","Use a hybrid investigation before proposing a refactor because the signals do not fully align yet.","Cross-check the top hotspot src/utils/logger.ts with the strongest architecture finding before editing code."],"parseErrors":[],"outputFiles":{"summary":"summary.json","architecture":"architecture.json","codeQuality":"code-quality.json","deadCode":"dead-code.json","fileInventory":"file-inventory.json","findings":"findings.json","security":"security.json","graph":"graph.md","astTrees":"ast-trees.txt","summaryMd":"summary.md"}}