kuzushi 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (983) hide show
  1. package/README.md +429 -189
  2. package/dist/agent-runtime/batch-files.d.ts +9 -0
  3. package/dist/agent-runtime/batch-files.js +28 -0
  4. package/dist/agent-runtime/batch-files.js.map +1 -0
  5. package/dist/agent-runtime/claude.d.ts +28 -5
  6. package/dist/agent-runtime/claude.js +854 -105
  7. package/dist/agent-runtime/claude.js.map +1 -1
  8. package/dist/agent-runtime/context-guards.d.ts +61 -0
  9. package/dist/agent-runtime/context-guards.js +94 -0
  10. package/dist/agent-runtime/context-guards.js.map +1 -0
  11. package/dist/agent-runtime/error-classification.d.ts +18 -0
  12. package/dist/agent-runtime/error-classification.js +95 -0
  13. package/dist/agent-runtime/error-classification.js.map +1 -0
  14. package/dist/agent-runtime/execution.d.ts +81 -0
  15. package/dist/agent-runtime/execution.js +375 -0
  16. package/dist/agent-runtime/execution.js.map +1 -0
  17. package/dist/agent-runtime/index.d.ts +3 -4
  18. package/dist/agent-runtime/index.js +16 -22
  19. package/dist/agent-runtime/index.js.map +1 -1
  20. package/dist/agent-runtime/logging-runtime.d.ts +19 -0
  21. package/dist/agent-runtime/logging-runtime.js +91 -0
  22. package/dist/agent-runtime/logging-runtime.js.map +1 -0
  23. package/dist/agent-runtime/loop-detector.d.ts +30 -0
  24. package/dist/agent-runtime/loop-detector.js +157 -0
  25. package/dist/agent-runtime/loop-detector.js.map +1 -0
  26. package/dist/agent-runtime/model-fallback.d.ts +29 -0
  27. package/dist/agent-runtime/model-fallback.js +76 -0
  28. package/dist/agent-runtime/model-fallback.js.map +1 -0
  29. package/dist/agent-runtime/pi-ai.d.ts +7 -0
  30. package/dist/agent-runtime/pi-ai.js +446 -41
  31. package/dist/agent-runtime/pi-ai.js.map +1 -1
  32. package/dist/agent-runtime/tools.js +814 -2
  33. package/dist/agent-runtime/tools.js.map +1 -1
  34. package/dist/agent-runtime/turn-watchdog.d.ts +19 -0
  35. package/dist/agent-runtime/turn-watchdog.js +41 -0
  36. package/dist/agent-runtime/turn-watchdog.js.map +1 -0
  37. package/dist/agent-runtime/types.d.ts +44 -2
  38. package/dist/agents/handoff.d.ts +50 -0
  39. package/dist/agents/handoff.js +74 -0
  40. package/dist/agents/handoff.js.map +1 -0
  41. package/dist/agents/index.d.ts +3 -4
  42. package/dist/agents/index.js +153 -14
  43. package/dist/agents/index.js.map +1 -1
  44. package/dist/agents/registry.d.ts +17 -1
  45. package/dist/agents/registry.js +32 -8
  46. package/dist/agents/registry.js.map +1 -1
  47. package/dist/agents/scanner-adapter.js +2 -2
  48. package/dist/agents/scanner-adapter.js.map +1 -1
  49. package/dist/agents/task-loader.d.ts +42 -0
  50. package/dist/agents/task-loader.js +148 -0
  51. package/dist/agents/task-loader.js.map +1 -0
  52. package/dist/agents/task-manifest.d.ts +81 -0
  53. package/dist/agents/task-manifest.js +158 -0
  54. package/dist/agents/task-manifest.js.map +1 -0
  55. package/dist/agents/task-wrappers.d.ts +28 -0
  56. package/dist/agents/task-wrappers.js +129 -0
  57. package/dist/agents/task-wrappers.js.map +1 -0
  58. package/dist/agents/tasks/app-model-build.d.ts +29 -0
  59. package/dist/agents/tasks/app-model-build.js +531 -0
  60. package/dist/agents/tasks/app-model-build.js.map +1 -0
  61. package/dist/agents/tasks/approval-gate.d.ts +39 -0
  62. package/dist/agents/tasks/approval-gate.js +116 -0
  63. package/dist/agents/tasks/approval-gate.js.map +1 -0
  64. package/dist/agents/tasks/auth-logic-detect.d.ts +16 -0
  65. package/dist/agents/tasks/auth-logic-detect.js +185 -0
  66. package/dist/agents/tasks/auth-logic-detect.js.map +1 -0
  67. package/dist/agents/tasks/call-graph-assist.d.ts +10 -0
  68. package/dist/agents/tasks/call-graph-assist.js +98 -0
  69. package/dist/agents/tasks/call-graph-assist.js.map +1 -0
  70. package/dist/agents/tasks/category-filter.d.ts +21 -0
  71. package/dist/agents/tasks/category-filter.js +78 -0
  72. package/dist/agents/tasks/category-filter.js.map +1 -0
  73. package/dist/agents/tasks/chain-analysis.d.ts +36 -0
  74. package/dist/agents/tasks/chain-analysis.js +194 -0
  75. package/dist/agents/tasks/chain-analysis.js.map +1 -0
  76. package/dist/agents/tasks/code-config-detect.d.ts +23 -0
  77. package/dist/agents/tasks/code-config-detect.js +589 -0
  78. package/dist/agents/tasks/code-config-detect.js.map +1 -0
  79. package/dist/agents/tasks/code-graph/build.d.ts +21 -0
  80. package/dist/agents/tasks/code-graph/build.js +595 -0
  81. package/dist/agents/tasks/code-graph/build.js.map +1 -0
  82. package/dist/agents/tasks/code-graph/enrich.d.ts +3 -0
  83. package/dist/agents/tasks/code-graph/enrich.js +142 -0
  84. package/dist/agents/tasks/code-graph/enrich.js.map +1 -0
  85. package/dist/agents/tasks/code-graph/prompts.d.ts +65 -0
  86. package/dist/agents/tasks/code-graph/prompts.js +206 -0
  87. package/dist/agents/tasks/code-graph/prompts.js.map +1 -0
  88. package/dist/agents/tasks/code-graph/store.d.ts +20 -0
  89. package/dist/agents/tasks/code-graph/store.js +146 -0
  90. package/dist/agents/tasks/code-graph/store.js.map +1 -0
  91. package/dist/agents/tasks/code-graph/types.d.ts +85 -0
  92. package/dist/agents/tasks/code-graph/types.js +2 -0
  93. package/dist/agents/tasks/code-graph/types.js.map +1 -0
  94. package/dist/agents/tasks/command-injection.d.ts +4 -0
  95. package/dist/agents/tasks/command-injection.js +226 -0
  96. package/dist/agents/tasks/command-injection.js.map +1 -0
  97. package/dist/agents/tasks/context-enricher.d.ts +15 -0
  98. package/dist/agents/tasks/context-enricher.js +272 -0
  99. package/dist/agents/tasks/context-enricher.js.map +1 -0
  100. package/dist/agents/tasks/context-gatherer.d.ts +7 -2
  101. package/dist/agents/tasks/context-gatherer.js +229 -70
  102. package/dist/agents/tasks/context-gatherer.js.map +1 -1
  103. package/dist/agents/tasks/crypto-behavioral-test.d.ts +18 -0
  104. package/dist/agents/tasks/crypto-behavioral-test.js +269 -0
  105. package/dist/agents/tasks/crypto-behavioral-test.js.map +1 -0
  106. package/dist/agents/tasks/deep-semantic/cwe-select.d.ts +22 -0
  107. package/dist/agents/tasks/deep-semantic/cwe-select.js +138 -0
  108. package/dist/agents/tasks/deep-semantic/cwe-select.js.map +1 -0
  109. package/dist/agents/tasks/deep-semantic/hunt.d.ts +23 -0
  110. package/dist/agents/tasks/deep-semantic/hunt.js +531 -0
  111. package/dist/agents/tasks/deep-semantic/hunt.js.map +1 -0
  112. package/dist/agents/tasks/deep-semantic/types.d.ts +52 -0
  113. package/dist/agents/tasks/deep-semantic/types.js +25 -0
  114. package/dist/agents/tasks/deep-semantic/types.js.map +1 -0
  115. package/dist/agents/tasks/deserialization-detection.d.ts +4 -0
  116. package/dist/agents/tasks/deserialization-detection.js +229 -0
  117. package/dist/agents/tasks/deserialization-detection.js.map +1 -0
  118. package/dist/agents/tasks/diff-review.d.ts +52 -0
  119. package/dist/agents/tasks/diff-review.js +452 -0
  120. package/dist/agents/tasks/diff-review.js.map +1 -0
  121. package/dist/agents/tasks/graphql-security.d.ts +32 -0
  122. package/dist/agents/tasks/graphql-security.js +310 -0
  123. package/dist/agents/tasks/graphql-security.js.map +1 -0
  124. package/dist/agents/tasks/invariant-analysis/check.d.ts +18 -0
  125. package/dist/agents/tasks/invariant-analysis/check.js +287 -0
  126. package/dist/agents/tasks/invariant-analysis/check.js.map +1 -0
  127. package/dist/agents/tasks/invariant-analysis/extract.d.ts +13 -0
  128. package/dist/agents/tasks/invariant-analysis/extract.js +178 -0
  129. package/dist/agents/tasks/invariant-analysis/extract.js.map +1 -0
  130. package/dist/agents/tasks/invariant-analysis/types.d.ts +159 -0
  131. package/dist/agents/tasks/invariant-analysis/types.js +108 -0
  132. package/dist/agents/tasks/invariant-analysis/types.js.map +1 -0
  133. package/dist/agents/tasks/nosql-injection.d.ts +32 -0
  134. package/dist/agents/tasks/nosql-injection.js +366 -0
  135. package/dist/agents/tasks/nosql-injection.js.map +1 -0
  136. package/dist/agents/tasks/pre-read-prompt.d.ts +5 -0
  137. package/dist/agents/tasks/pre-read-prompt.js +77 -0
  138. package/dist/agents/tasks/pre-read-prompt.js.map +1 -0
  139. package/dist/agents/tasks/pre-read.d.ts +17 -0
  140. package/dist/agents/tasks/pre-read.js +118 -0
  141. package/dist/agents/tasks/pre-read.js.map +1 -0
  142. package/dist/agents/tasks/prototype-pollution.d.ts +32 -0
  143. package/dist/agents/tasks/prototype-pollution.js +287 -0
  144. package/dist/agents/tasks/prototype-pollution.js.map +1 -0
  145. package/dist/agents/tasks/race-condition.d.ts +32 -0
  146. package/dist/agents/tasks/race-condition.js +269 -0
  147. package/dist/agents/tasks/race-condition.js.map +1 -0
  148. package/dist/agents/tasks/reachability-check.d.ts +9 -0
  149. package/dist/agents/tasks/reachability-check.js +156 -0
  150. package/dist/agents/tasks/reachability-check.js.map +1 -0
  151. package/dist/agents/tasks/runtime-overrides.d.ts +13 -0
  152. package/dist/agents/tasks/runtime-overrides.js +93 -0
  153. package/dist/agents/tasks/runtime-overrides.js.map +1 -0
  154. package/dist/agents/tasks/scenario-guidance.d.ts +18 -0
  155. package/dist/agents/tasks/scenario-guidance.js +136 -0
  156. package/dist/agents/tasks/scenario-guidance.js.map +1 -0
  157. package/dist/agents/tasks/secrets-crypto-detect.d.ts +22 -0
  158. package/dist/agents/tasks/secrets-crypto-detect.js +380 -0
  159. package/dist/agents/tasks/secrets-crypto-detect.js.map +1 -0
  160. package/dist/agents/tasks/sharp-edges-detect.d.ts +43 -0
  161. package/dist/agents/tasks/sharp-edges-detect.js +434 -0
  162. package/dist/agents/tasks/sharp-edges-detect.js.map +1 -0
  163. package/dist/agents/tasks/ssrf-detection.d.ts +42 -0
  164. package/dist/agents/tasks/ssrf-detection.js +393 -0
  165. package/dist/agents/tasks/ssrf-detection.js.map +1 -0
  166. package/dist/agents/tasks/supply-chain.d.ts +32 -0
  167. package/dist/agents/tasks/supply-chain.js +286 -0
  168. package/dist/agents/tasks/supply-chain.js.map +1 -0
  169. package/dist/agents/tasks/systems-hunt/artifacts.d.ts +8 -0
  170. package/dist/agents/tasks/systems-hunt/artifacts.js +40 -0
  171. package/dist/agents/tasks/systems-hunt/artifacts.js.map +1 -0
  172. package/dist/agents/tasks/systems-hunt/context.d.ts +13 -0
  173. package/dist/agents/tasks/systems-hunt/context.js +301 -0
  174. package/dist/agents/tasks/systems-hunt/context.js.map +1 -0
  175. package/dist/agents/tasks/systems-hunt/helpers.d.ts +37 -0
  176. package/dist/agents/tasks/systems-hunt/helpers.js +387 -0
  177. package/dist/agents/tasks/systems-hunt/helpers.js.map +1 -0
  178. package/dist/agents/tasks/systems-hunt/hunt.d.ts +87 -0
  179. package/dist/agents/tasks/systems-hunt/hunt.js +864 -0
  180. package/dist/agents/tasks/systems-hunt/hunt.js.map +1 -0
  181. package/dist/agents/tasks/systems-hunt/invariant-extract.d.ts +10 -0
  182. package/dist/agents/tasks/systems-hunt/invariant-extract.js +201 -0
  183. package/dist/agents/tasks/systems-hunt/invariant-extract.js.map +1 -0
  184. package/dist/agents/tasks/systems-hunt/trigger-synth.d.ts +10 -0
  185. package/dist/agents/tasks/systems-hunt/trigger-synth.js +193 -0
  186. package/dist/agents/tasks/systems-hunt/trigger-synth.js.map +1 -0
  187. package/dist/agents/tasks/systems-hunt/types.d.ts +152 -0
  188. package/dist/agents/tasks/systems-hunt/types.js +97 -0
  189. package/dist/agents/tasks/systems-hunt/types.js.map +1 -0
  190. package/dist/agents/tasks/taint-analysis/analyze.d.ts +86 -0
  191. package/dist/agents/tasks/taint-analysis/analyze.js +1459 -0
  192. package/dist/agents/tasks/taint-analysis/analyze.js.map +1 -0
  193. package/dist/agents/tasks/taint-analysis/codeql-compat.d.ts +99 -0
  194. package/dist/agents/tasks/taint-analysis/codeql-compat.js +291 -0
  195. package/dist/agents/tasks/taint-analysis/codeql-compat.js.map +1 -0
  196. package/dist/agents/tasks/taint-analysis/cross-service/analyze.d.ts +40 -0
  197. package/dist/agents/tasks/taint-analysis/cross-service/analyze.js +296 -0
  198. package/dist/agents/tasks/taint-analysis/cross-service/analyze.js.map +1 -0
  199. package/dist/agents/tasks/taint-analysis/cross-service/boundary-agent.d.ts +30 -0
  200. package/dist/agents/tasks/taint-analysis/cross-service/boundary-agent.js +288 -0
  201. package/dist/agents/tasks/taint-analysis/cross-service/boundary-agent.js.map +1 -0
  202. package/dist/agents/tasks/taint-analysis/cross-service/discover.d.ts +15 -0
  203. package/dist/agents/tasks/taint-analysis/cross-service/discover.js +327 -0
  204. package/dist/agents/tasks/taint-analysis/cross-service/discover.js.map +1 -0
  205. package/dist/agents/tasks/taint-analysis/cross-service/stitch.d.ts +36 -0
  206. package/dist/agents/tasks/taint-analysis/cross-service/stitch.js +857 -0
  207. package/dist/agents/tasks/taint-analysis/cross-service/stitch.js.map +1 -0
  208. package/dist/agents/tasks/taint-analysis/cross-service/types.d.ts +363 -0
  209. package/dist/agents/tasks/taint-analysis/cross-service/types.js +183 -0
  210. package/dist/agents/tasks/taint-analysis/cross-service/types.js.map +1 -0
  211. package/dist/agents/tasks/taint-analysis/csv.d.ts +5 -0
  212. package/dist/agents/tasks/taint-analysis/csv.js +96 -0
  213. package/dist/agents/tasks/taint-analysis/csv.js.map +1 -0
  214. package/dist/agents/tasks/taint-analysis/diff-scope.d.ts +11 -0
  215. package/dist/agents/tasks/taint-analysis/diff-scope.js +95 -0
  216. package/dist/agents/tasks/taint-analysis/diff-scope.js.map +1 -0
  217. package/dist/agents/tasks/{augur-extraction-agent.d.ts → taint-analysis/extraction-agent.d.ts} +15 -7
  218. package/dist/agents/tasks/{augur-extraction-agent.js → taint-analysis/extraction-agent.js} +101 -41
  219. package/dist/agents/tasks/taint-analysis/extraction-agent.js.map +1 -0
  220. package/dist/agents/tasks/taint-analysis/grounding.d.ts +27 -0
  221. package/dist/agents/tasks/taint-analysis/grounding.js +78 -0
  222. package/dist/agents/tasks/taint-analysis/grounding.js.map +1 -0
  223. package/dist/agents/tasks/taint-analysis/label.d.ts +91 -0
  224. package/dist/agents/tasks/taint-analysis/label.js +2073 -0
  225. package/dist/agents/tasks/taint-analysis/label.js.map +1 -0
  226. package/dist/agents/tasks/taint-analysis/preflight.d.ts +92 -0
  227. package/dist/agents/tasks/taint-analysis/preflight.js +1105 -0
  228. package/dist/agents/tasks/taint-analysis/preflight.js.map +1 -0
  229. package/dist/agents/tasks/taint-analysis/ti-prior.d.ts +36 -0
  230. package/dist/agents/tasks/taint-analysis/ti-prior.js +398 -0
  231. package/dist/agents/tasks/taint-analysis/ti-prior.js.map +1 -0
  232. package/dist/agents/tasks/taint-analysis/types.d.ts +181 -0
  233. package/dist/agents/tasks/taint-analysis/types.js +333 -0
  234. package/dist/agents/tasks/taint-analysis/types.js.map +1 -0
  235. package/dist/agents/tasks/taint-iris/cwe-select.d.ts +11 -0
  236. package/dist/agents/tasks/taint-iris/cwe-select.js +132 -0
  237. package/dist/agents/tasks/taint-iris/cwe-select.js.map +1 -0
  238. package/dist/agents/tasks/taint-iris/iris.d.ts +4 -0
  239. package/dist/agents/tasks/taint-iris/iris.js +299 -0
  240. package/dist/agents/tasks/taint-iris/iris.js.map +1 -0
  241. package/dist/agents/tasks/task-selector.d.ts +32 -0
  242. package/dist/agents/tasks/task-selector.js +209 -0
  243. package/dist/agents/tasks/task-selector.js.map +1 -0
  244. package/dist/agents/tasks/template-injection.d.ts +32 -0
  245. package/dist/agents/tasks/template-injection.js +379 -0
  246. package/dist/agents/tasks/template-injection.js.map +1 -0
  247. package/dist/agents/tasks/threat-hunt.d.ts +29 -0
  248. package/dist/agents/tasks/threat-hunt.js +244 -0
  249. package/dist/agents/tasks/threat-hunt.js.map +1 -0
  250. package/dist/agents/tasks/threat-model-guidance.d.ts +33 -0
  251. package/dist/agents/tasks/threat-model-guidance.js +326 -0
  252. package/dist/agents/tasks/threat-model-guidance.js.map +1 -0
  253. package/dist/agents/tasks/threat-modeling/randori-adapter.d.ts +2 -0
  254. package/dist/agents/tasks/threat-modeling/randori-adapter.js +205 -0
  255. package/dist/agents/tasks/threat-modeling/randori-adapter.js.map +1 -0
  256. package/dist/agents/tasks/threat-modeling/randori-artifacts.d.ts +17 -0
  257. package/dist/agents/tasks/threat-modeling/randori-artifacts.js +140 -0
  258. package/dist/agents/tasks/threat-modeling/randori-artifacts.js.map +1 -0
  259. package/dist/agents/tasks/threat-modeling/randori.d.ts +8 -0
  260. package/dist/agents/tasks/threat-modeling/randori.js +210 -0
  261. package/dist/agents/tasks/threat-modeling/randori.js.map +1 -0
  262. package/dist/agents/tasks/threat-modeling/resolve-randori.d.ts +5 -0
  263. package/dist/agents/tasks/threat-modeling/resolve-randori.js +23 -0
  264. package/dist/agents/tasks/threat-modeling/resolve-randori.js.map +1 -0
  265. package/dist/agents/tasks/threat-modeling/types.d.ts +69 -0
  266. package/dist/agents/tasks/threat-modeling/types.js +53 -0
  267. package/dist/agents/tasks/threat-modeling/types.js.map +1 -0
  268. package/dist/agents/tasks/threat-scenario-build.d.ts +26 -0
  269. package/dist/agents/tasks/threat-scenario-build.js +250 -0
  270. package/dist/agents/tasks/threat-scenario-build.js.map +1 -0
  271. package/dist/agents/tasks/tob-audit/resolve-tob-plugin.d.ts +13 -0
  272. package/dist/agents/tasks/tob-audit/resolve-tob-plugin.js +55 -0
  273. package/dist/agents/tasks/tob-audit/resolve-tob-plugin.js.map +1 -0
  274. package/dist/agents/tasks/tob-audit/tob-audit.d.ts +15 -0
  275. package/dist/agents/tasks/tob-audit/tob-audit.js +132 -0
  276. package/dist/agents/tasks/tob-audit/tob-audit.js.map +1 -0
  277. package/dist/agents/tasks/variant-analysis.d.ts +54 -0
  278. package/dist/agents/tasks/variant-analysis.js +442 -0
  279. package/dist/agents/tasks/variant-analysis.js.map +1 -0
  280. package/dist/agents/tasks/vuln-scout/resolve-vuln-scout.d.ts +11 -0
  281. package/dist/agents/tasks/vuln-scout/resolve-vuln-scout.js +29 -0
  282. package/dist/agents/tasks/vuln-scout/resolve-vuln-scout.js.map +1 -0
  283. package/dist/agents/tasks/vuln-scout/vuln-scout.d.ts +15 -0
  284. package/dist/agents/tasks/vuln-scout/vuln-scout.js +131 -0
  285. package/dist/agents/tasks/vuln-scout/vuln-scout.js.map +1 -0
  286. package/dist/agents/tasks/xxe-detection.d.ts +4 -0
  287. package/dist/agents/tasks/xxe-detection.js +223 -0
  288. package/dist/agents/tasks/xxe-detection.js.map +1 -0
  289. package/dist/agents/types.d.ts +36 -1
  290. package/dist/analysis-support/code-intelligence.d.ts +13 -0
  291. package/dist/analysis-support/code-intelligence.js +304 -0
  292. package/dist/analysis-support/code-intelligence.js.map +1 -0
  293. package/dist/analysis-support/index.d.ts +3 -0
  294. package/dist/analysis-support/index.js +4 -0
  295. package/dist/analysis-support/index.js.map +1 -0
  296. package/dist/analysis-support/simple-index.d.ts +15 -0
  297. package/dist/analysis-support/simple-index.js +262 -0
  298. package/dist/analysis-support/simple-index.js.map +1 -0
  299. package/dist/analysis-support/types.d.ts +92 -0
  300. package/dist/analysis-support/types.js +2 -0
  301. package/dist/analysis-support/types.js.map +1 -0
  302. package/dist/banner.d.ts +5 -0
  303. package/dist/banner.js +40 -0
  304. package/dist/banner.js.map +1 -0
  305. package/dist/bus/adapters/in-process.js +5 -1
  306. package/dist/bus/adapters/in-process.js.map +1 -1
  307. package/dist/bus/adapters/index.js +1 -10
  308. package/dist/bus/adapters/index.js.map +1 -1
  309. package/dist/bus/event-log.d.ts +16 -0
  310. package/dist/bus/event-log.js +121 -0
  311. package/dist/bus/event-log.js.map +1 -0
  312. package/dist/bus/events.d.ts +383 -25
  313. package/dist/bus/index.d.ts +8 -7
  314. package/dist/bus/index.js +69 -13
  315. package/dist/bus/index.js.map +1 -1
  316. package/dist/bus/orchestrator/cheap-verify.d.ts +33 -0
  317. package/dist/bus/orchestrator/cheap-verify.js +204 -0
  318. package/dist/bus/orchestrator/cheap-verify.js.map +1 -0
  319. package/dist/bus/orchestrator/patch-dispatcher.d.ts +9 -0
  320. package/dist/bus/orchestrator/patch-dispatcher.js +122 -0
  321. package/dist/bus/orchestrator/patch-dispatcher.js.map +1 -0
  322. package/dist/bus/orchestrator/poc-dispatcher.d.ts +11 -0
  323. package/dist/bus/orchestrator/poc-dispatcher.js +93 -0
  324. package/dist/bus/orchestrator/poc-dispatcher.js.map +1 -0
  325. package/dist/bus/orchestrator/task-policy.d.ts +14 -0
  326. package/dist/bus/orchestrator/task-policy.js +169 -0
  327. package/dist/bus/orchestrator/task-policy.js.map +1 -0
  328. package/dist/bus/orchestrator/triage-dispatcher.d.ts +20 -0
  329. package/dist/bus/orchestrator/triage-dispatcher.js +172 -0
  330. package/dist/bus/orchestrator/triage-dispatcher.js.map +1 -0
  331. package/dist/bus/orchestrator/types.d.ts +168 -0
  332. package/dist/bus/orchestrator/types.js +2 -0
  333. package/dist/bus/orchestrator/types.js.map +1 -0
  334. package/dist/bus/orchestrator/verification-dispatcher.d.ts +14 -0
  335. package/dist/bus/orchestrator/verification-dispatcher.js +150 -0
  336. package/dist/bus/orchestrator/verification-dispatcher.js.map +1 -0
  337. package/dist/bus/orchestrator/verify-gate.d.ts +50 -0
  338. package/dist/bus/orchestrator/verify-gate.js +363 -0
  339. package/dist/bus/orchestrator/verify-gate.js.map +1 -0
  340. package/dist/bus/orchestrator.d.ts +72 -9
  341. package/dist/bus/orchestrator.js +2001 -421
  342. package/dist/bus/orchestrator.js.map +1 -1
  343. package/dist/bus/task-execution.d.ts +17 -0
  344. package/dist/bus/task-execution.js +228 -0
  345. package/dist/bus/task-execution.js.map +1 -0
  346. package/dist/bus/workers/audit-worker.js +6 -5
  347. package/dist/bus/workers/audit-worker.js.map +1 -1
  348. package/dist/bus/workers/dynamic-analysis-worker.d.ts +14 -0
  349. package/dist/bus/workers/dynamic-analysis-worker.js +268 -0
  350. package/dist/bus/workers/dynamic-analysis-worker.js.map +1 -0
  351. package/dist/bus/workers/github-worker.d.ts +13 -0
  352. package/dist/bus/workers/github-worker.js +131 -0
  353. package/dist/bus/workers/github-worker.js.map +1 -0
  354. package/dist/bus/workers/patch-verify-worker.d.ts +16 -0
  355. package/dist/bus/workers/patch-verify-worker.js +103 -0
  356. package/dist/bus/workers/patch-verify-worker.js.map +1 -0
  357. package/dist/bus/workers/patch-worker.d.ts +15 -0
  358. package/dist/bus/workers/patch-worker.js +48 -0
  359. package/dist/bus/workers/patch-worker.js.map +1 -0
  360. package/dist/bus/workers/poc-executor-worker.d.ts +7 -0
  361. package/dist/bus/workers/poc-executor-worker.js +33 -0
  362. package/dist/bus/workers/poc-executor-worker.js.map +1 -0
  363. package/dist/bus/workers/poc-harness-worker.d.ts +2 -0
  364. package/dist/bus/workers/poc-harness-worker.js +150 -49
  365. package/dist/bus/workers/poc-harness-worker.js.map +1 -1
  366. package/dist/bus/workers/report-worker.js +92 -44
  367. package/dist/bus/workers/report-worker.js.map +1 -1
  368. package/dist/bus/workers/scan-worker.d.ts +8 -6
  369. package/dist/bus/workers/scan-worker.js +144 -164
  370. package/dist/bus/workers/scan-worker.js.map +1 -1
  371. package/dist/bus/workers/store-worker.d.ts +9 -1
  372. package/dist/bus/workers/store-worker.js +79 -3
  373. package/dist/bus/workers/store-worker.js.map +1 -1
  374. package/dist/bus/workers/taint-analysis-artifact-worker.d.ts +9 -0
  375. package/dist/bus/workers/taint-analysis-artifact-worker.js +99 -0
  376. package/dist/bus/workers/taint-analysis-artifact-worker.js.map +1 -0
  377. package/dist/bus/workers/taint-analysis-refinement-worker.d.ts +29 -0
  378. package/dist/bus/workers/taint-analysis-refinement-worker.js +304 -0
  379. package/dist/bus/workers/taint-analysis-refinement-worker.js.map +1 -0
  380. package/dist/bus/workers/triage-worker.d.ts +19 -3
  381. package/dist/bus/workers/triage-worker.js +362 -55
  382. package/dist/bus/workers/triage-worker.js.map +1 -1
  383. package/dist/bus/workers/variant-analysis-worker.d.ts +26 -0
  384. package/dist/bus/workers/variant-analysis-worker.js +97 -0
  385. package/dist/bus/workers/variant-analysis-worker.js.map +1 -0
  386. package/dist/bus/workers/verification-worker.d.ts +8 -0
  387. package/dist/bus/workers/verification-worker.js +277 -48
  388. package/dist/bus/workers/verification-worker.js.map +1 -1
  389. package/dist/bypass-knowledge.d.ts +14 -0
  390. package/dist/bypass-knowledge.js +152 -0
  391. package/dist/bypass-knowledge.js.map +1 -0
  392. package/dist/cache.d.ts +48 -0
  393. package/dist/cache.js +157 -0
  394. package/dist/cache.js.map +1 -0
  395. package/dist/capabilities.d.ts +22 -0
  396. package/dist/capabilities.js +351 -0
  397. package/dist/capabilities.js.map +1 -0
  398. package/dist/cli/commands/monorepo-scan.d.ts +8 -0
  399. package/dist/cli/commands/monorepo-scan.js +636 -0
  400. package/dist/cli/commands/monorepo-scan.js.map +1 -0
  401. package/dist/cli/commands/scan.d.ts +53 -0
  402. package/dist/cli/commands/scan.js +398 -0
  403. package/dist/cli/commands/scan.js.map +1 -0
  404. package/dist/cli/errors.d.ts +14 -0
  405. package/dist/cli/errors.js +37 -0
  406. package/dist/cli/errors.js.map +1 -0
  407. package/dist/cli/pi-ai.d.ts +16 -0
  408. package/dist/cli/pi-ai.js +165 -0
  409. package/dist/cli/pi-ai.js.map +1 -0
  410. package/dist/cli/scan-config.d.ts +74 -0
  411. package/dist/cli/scan-config.js +243 -0
  412. package/dist/cli/scan-config.js.map +1 -0
  413. package/dist/cli/shared.d.ts +8 -0
  414. package/dist/cli/shared.js +27 -0
  415. package/dist/cli/shared.js.map +1 -0
  416. package/dist/cli.js +417 -413
  417. package/dist/cli.js.map +1 -1
  418. package/dist/confidence-calibration.d.ts +53 -0
  419. package/dist/confidence-calibration.js +192 -0
  420. package/dist/confidence-calibration.js.map +1 -0
  421. package/dist/config/defaults.d.ts +5 -0
  422. package/dist/config/defaults.js +166 -0
  423. package/dist/config/defaults.js.map +1 -0
  424. package/dist/config/paths.d.ts +7 -0
  425. package/dist/config/paths.js +32 -0
  426. package/dist/config/paths.js.map +1 -0
  427. package/dist/config/presets.d.ts +4 -0
  428. package/dist/config/presets.js +83 -0
  429. package/dist/config/presets.js.map +1 -0
  430. package/dist/config/validation.d.ts +11 -0
  431. package/dist/config/validation.js +86 -0
  432. package/dist/config/validation.js.map +1 -0
  433. package/dist/config-io.d.ts +16 -0
  434. package/dist/config-io.js +70 -0
  435. package/dist/config-io.js.map +1 -0
  436. package/dist/config.d.ts +9 -9
  437. package/dist/config.js +795 -367
  438. package/dist/config.js.map +1 -1
  439. package/dist/context.js +3 -0
  440. package/dist/context.js.map +1 -1
  441. package/dist/crypto-behavioral/harness-generator.d.ts +37 -0
  442. package/dist/crypto-behavioral/harness-generator.js +141 -0
  443. package/dist/crypto-behavioral/harness-generator.js.map +1 -0
  444. package/dist/crypto-behavioral/harness-prompts.d.ts +16 -0
  445. package/dist/crypto-behavioral/harness-prompts.js +188 -0
  446. package/dist/crypto-behavioral/harness-prompts.js.map +1 -0
  447. package/dist/crypto-behavioral/index.d.ts +4 -0
  448. package/dist/crypto-behavioral/index.js +5 -0
  449. package/dist/crypto-behavioral/index.js.map +1 -0
  450. package/dist/crypto-behavioral/result-parser.d.ts +14 -0
  451. package/dist/crypto-behavioral/result-parser.js +159 -0
  452. package/dist/crypto-behavioral/result-parser.js.map +1 -0
  453. package/dist/crypto-behavioral/types.d.ts +72 -0
  454. package/dist/crypto-behavioral/types.js +2 -0
  455. package/dist/crypto-behavioral/types.js.map +1 -0
  456. package/dist/discovery/adapters/bazel-adapter.d.ts +5 -0
  457. package/dist/discovery/adapters/bazel-adapter.js +215 -0
  458. package/dist/discovery/adapters/bazel-adapter.js.map +1 -0
  459. package/dist/discovery/adapters/go-adapter.d.ts +5 -0
  460. package/dist/discovery/adapters/go-adapter.js +152 -0
  461. package/dist/discovery/adapters/go-adapter.js.map +1 -0
  462. package/dist/discovery/adapters/msvs-adapter.d.ts +5 -0
  463. package/dist/discovery/adapters/msvs-adapter.js +96 -0
  464. package/dist/discovery/adapters/msvs-adapter.js.map +1 -0
  465. package/dist/discovery/adapters/native-adapter.d.ts +5 -0
  466. package/dist/discovery/adapters/native-adapter.js +59 -0
  467. package/dist/discovery/adapters/native-adapter.js.map +1 -0
  468. package/dist/discovery/adapters/node-adapter.d.ts +5 -0
  469. package/dist/discovery/adapters/node-adapter.js +218 -0
  470. package/dist/discovery/adapters/node-adapter.js.map +1 -0
  471. package/dist/discovery/adapters/rust-adapter.d.ts +5 -0
  472. package/dist/discovery/adapters/rust-adapter.js +142 -0
  473. package/dist/discovery/adapters/rust-adapter.js.map +1 -0
  474. package/dist/discovery/adapters/types.d.ts +25 -0
  475. package/dist/discovery/adapters/types.js +2 -0
  476. package/dist/discovery/adapters/types.js.map +1 -0
  477. package/dist/discovery/graph.d.ts +18 -0
  478. package/dist/discovery/graph.js +338 -0
  479. package/dist/discovery/graph.js.map +1 -0
  480. package/dist/discovery/helpers.d.ts +29 -0
  481. package/dist/discovery/helpers.js +278 -0
  482. package/dist/discovery/helpers.js.map +1 -0
  483. package/dist/discovery/llm-refinement.d.ts +17 -0
  484. package/dist/discovery/llm-refinement.js +311 -0
  485. package/dist/discovery/llm-refinement.js.map +1 -0
  486. package/dist/discovery/repo-discovery.d.ts +14 -0
  487. package/dist/discovery/repo-discovery.js +116 -0
  488. package/dist/discovery/repo-discovery.js.map +1 -0
  489. package/dist/discovery/types.d.ts +46 -0
  490. package/dist/discovery/types.js +2 -0
  491. package/dist/discovery/types.js.map +1 -0
  492. package/dist/discovery/workspace-clustering.d.ts +19 -0
  493. package/dist/discovery/workspace-clustering.js +281 -0
  494. package/dist/discovery/workspace-clustering.js.map +1 -0
  495. package/dist/errors.d.ts +67 -0
  496. package/dist/errors.js +164 -0
  497. package/dist/errors.js.map +1 -0
  498. package/dist/findings/taint-path.d.ts +4 -0
  499. package/dist/findings/taint-path.js +50 -0
  500. package/dist/findings/taint-path.js.map +1 -0
  501. package/dist/hooks/chain.d.ts +28 -0
  502. package/dist/hooks/chain.js +58 -0
  503. package/dist/hooks/chain.js.map +1 -0
  504. package/dist/hooks/index.d.ts +3 -0
  505. package/dist/hooks/index.js +3 -0
  506. package/dist/hooks/index.js.map +1 -0
  507. package/dist/hooks/loader.d.ts +7 -0
  508. package/dist/hooks/loader.js +41 -0
  509. package/dist/hooks/loader.js.map +1 -0
  510. package/dist/hooks/types.d.ts +33 -0
  511. package/dist/hooks/types.js +2 -0
  512. package/dist/hooks/types.js.map +1 -0
  513. package/dist/http-agent.d.ts +39 -0
  514. package/dist/http-agent.js +170 -0
  515. package/dist/http-agent.js.map +1 -0
  516. package/dist/incremental.d.ts +32 -0
  517. package/dist/incremental.js +99 -0
  518. package/dist/incremental.js.map +1 -0
  519. package/dist/index.d.ts +8 -0
  520. package/dist/index.js +8 -0
  521. package/dist/index.js.map +1 -0
  522. package/dist/invariant.d.ts +7 -0
  523. package/dist/invariant.js +13 -0
  524. package/dist/invariant.js.map +1 -0
  525. package/dist/knowledge/index.d.ts +7 -0
  526. package/dist/knowledge/index.js +36 -0
  527. package/dist/knowledge/index.js.map +1 -0
  528. package/dist/knowledge/modules/auth-bypass.d.ts +2 -0
  529. package/dist/knowledge/modules/auth-bypass.js +47 -0
  530. package/dist/knowledge/modules/auth-bypass.js.map +1 -0
  531. package/dist/knowledge/modules/command-injection.d.ts +2 -0
  532. package/dist/knowledge/modules/command-injection.js +47 -0
  533. package/dist/knowledge/modules/command-injection.js.map +1 -0
  534. package/dist/knowledge/modules/crypto.d.ts +2 -0
  535. package/dist/knowledge/modules/crypto.js +44 -0
  536. package/dist/knowledge/modules/crypto.js.map +1 -0
  537. package/dist/knowledge/modules/deserialization.d.ts +2 -0
  538. package/dist/knowledge/modules/deserialization.js +47 -0
  539. package/dist/knowledge/modules/deserialization.js.map +1 -0
  540. package/dist/knowledge/modules/file-upload.d.ts +2 -0
  541. package/dist/knowledge/modules/file-upload.js +45 -0
  542. package/dist/knowledge/modules/file-upload.js.map +1 -0
  543. package/dist/knowledge/modules/idor.d.ts +2 -0
  544. package/dist/knowledge/modules/idor.js +43 -0
  545. package/dist/knowledge/modules/idor.js.map +1 -0
  546. package/dist/knowledge/modules/nosql-injection.d.ts +2 -0
  547. package/dist/knowledge/modules/nosql-injection.js +40 -0
  548. package/dist/knowledge/modules/nosql-injection.js.map +1 -0
  549. package/dist/knowledge/modules/path-traversal.d.ts +2 -0
  550. package/dist/knowledge/modules/path-traversal.js +40 -0
  551. package/dist/knowledge/modules/path-traversal.js.map +1 -0
  552. package/dist/knowledge/modules/race-condition.d.ts +2 -0
  553. package/dist/knowledge/modules/race-condition.js +41 -0
  554. package/dist/knowledge/modules/race-condition.js.map +1 -0
  555. package/dist/knowledge/modules/sqli.d.ts +2 -0
  556. package/dist/knowledge/modules/sqli.js +42 -0
  557. package/dist/knowledge/modules/sqli.js.map +1 -0
  558. package/dist/knowledge/modules/ssrf.d.ts +2 -0
  559. package/dist/knowledge/modules/ssrf.js +42 -0
  560. package/dist/knowledge/modules/ssrf.js.map +1 -0
  561. package/dist/knowledge/modules/xss.d.ts +2 -0
  562. package/dist/knowledge/modules/xss.js +54 -0
  563. package/dist/knowledge/modules/xss.js.map +1 -0
  564. package/dist/knowledge/modules/xxe.d.ts +2 -0
  565. package/dist/knowledge/modules/xxe.js +45 -0
  566. package/dist/knowledge/modules/xxe.js.map +1 -0
  567. package/dist/knowledge/registry.d.ts +17 -0
  568. package/dist/knowledge/registry.js +144 -0
  569. package/dist/knowledge/registry.js.map +1 -0
  570. package/dist/knowledge/types.d.ts +64 -0
  571. package/dist/knowledge/types.js +6 -0
  572. package/dist/knowledge/types.js.map +1 -0
  573. package/dist/lifecycle.d.ts +23 -0
  574. package/dist/lifecycle.js +68 -0
  575. package/dist/lifecycle.js.map +1 -0
  576. package/dist/logger.d.ts +38 -0
  577. package/dist/logger.js +115 -0
  578. package/dist/logger.js.map +1 -0
  579. package/dist/migrations/001_initial_schema.d.ts +7 -0
  580. package/dist/migrations/001_initial_schema.js +50 -0
  581. package/dist/migrations/001_initial_schema.js.map +1 -0
  582. package/dist/migrations/002_add_scanner_column.d.ts +3 -0
  583. package/dist/migrations/002_add_scanner_column.js +14 -0
  584. package/dist/migrations/002_add_scanner_column.js.map +1 -0
  585. package/dist/migrations/003_add_triage_cost_column.d.ts +3 -0
  586. package/dist/migrations/003_add_triage_cost_column.js +12 -0
  587. package/dist/migrations/003_add_triage_cost_column.js.map +1 -0
  588. package/dist/migrations/004_add_triage_details_column.d.ts +3 -0
  589. package/dist/migrations/004_add_triage_details_column.js +12 -0
  590. package/dist/migrations/004_add_triage_details_column.js.map +1 -0
  591. package/dist/migrations/005_add_verification_columns.d.ts +3 -0
  592. package/dist/migrations/005_add_verification_columns.js +24 -0
  593. package/dist/migrations/005_add_verification_columns.js.map +1 -0
  594. package/dist/migrations/006_add_poc_harness_columns.d.ts +3 -0
  595. package/dist/migrations/006_add_poc_harness_columns.js +24 -0
  596. package/dist/migrations/006_add_poc_harness_columns.js.map +1 -0
  597. package/dist/migrations/007_add_poc_execution_columns.d.ts +3 -0
  598. package/dist/migrations/007_add_poc_execution_columns.js +22 -0
  599. package/dist/migrations/007_add_poc_execution_columns.js.map +1 -0
  600. package/dist/migrations/008_pipeline_runs_status_values.d.ts +8 -0
  601. package/dist/migrations/008_pipeline_runs_status_values.js +72 -0
  602. package/dist/migrations/008_pipeline_runs_status_values.js.map +1 -0
  603. package/dist/migrations/009_add_pipeline_runs_context.d.ts +3 -0
  604. package/dist/migrations/009_add_pipeline_runs_context.js +12 -0
  605. package/dist/migrations/009_add_pipeline_runs_context.js.map +1 -0
  606. package/dist/migrations/010_add_calibration_schema.d.ts +3 -0
  607. package/dist/migrations/010_add_calibration_schema.js +26 -0
  608. package/dist/migrations/010_add_calibration_schema.js.map +1 -0
  609. package/dist/migrations/011_add_trajectories_table.d.ts +3 -0
  610. package/dist/migrations/011_add_trajectories_table.js +27 -0
  611. package/dist/migrations/011_add_trajectories_table.js.map +1 -0
  612. package/dist/migrations/012_add_finding_provenance_columns.d.ts +3 -0
  613. package/dist/migrations/012_add_finding_provenance_columns.js +19 -0
  614. package/dist/migrations/012_add_finding_provenance_columns.js.map +1 -0
  615. package/dist/migrations/013_add_composite_confidence_columns.d.ts +3 -0
  616. package/dist/migrations/013_add_composite_confidence_columns.js +16 -0
  617. package/dist/migrations/013_add_composite_confidence_columns.js.map +1 -0
  618. package/dist/migrations/014_add_metrics_column.d.ts +3 -0
  619. package/dist/migrations/014_add_metrics_column.js +13 -0
  620. package/dist/migrations/014_add_metrics_column.js.map +1 -0
  621. package/dist/migrations/015_add_assertion_tracking.d.ts +2 -0
  622. package/dist/migrations/015_add_assertion_tracking.js +31 -0
  623. package/dist/migrations/015_add_assertion_tracking.js.map +1 -0
  624. package/dist/migrations/016_add_structured_finding_evidence.d.ts +5 -0
  625. package/dist/migrations/016_add_structured_finding_evidence.js +21 -0
  626. package/dist/migrations/016_add_structured_finding_evidence.js.map +1 -0
  627. package/dist/migrations/017_add_dynamic_and_patch_persistence.d.ts +5 -0
  628. package/dist/migrations/017_add_dynamic_and_patch_persistence.js +69 -0
  629. package/dist/migrations/017_add_dynamic_and_patch_persistence.js.map +1 -0
  630. package/dist/migrations/018_add_crypto_behavioral_runs.d.ts +2 -0
  631. package/dist/migrations/018_add_crypto_behavioral_runs.js +40 -0
  632. package/dist/migrations/018_add_crypto_behavioral_runs.js.map +1 -0
  633. package/dist/migrations/019_add_code_graph_tables.d.ts +2 -0
  634. package/dist/migrations/019_add_code_graph_tables.js +72 -0
  635. package/dist/migrations/019_add_code_graph_tables.js.map +1 -0
  636. package/dist/migrations/020_add_verified_patch_status.d.ts +6 -0
  637. package/dist/migrations/020_add_verified_patch_status.js +38 -0
  638. package/dist/migrations/020_add_verified_patch_status.js.map +1 -0
  639. package/dist/migrations/021_add_incremental_scanning_support.d.ts +2 -0
  640. package/dist/migrations/021_add_incremental_scanning_support.js +13 -0
  641. package/dist/migrations/021_add_incremental_scanning_support.js.map +1 -0
  642. package/dist/migrations/022_add_verdict_index.d.ts +2 -0
  643. package/dist/migrations/022_add_verdict_index.js +8 -0
  644. package/dist/migrations/022_add_verdict_index.js.map +1 -0
  645. package/dist/migrations/023_expand_pipeline_status_constraint.d.ts +6 -0
  646. package/dist/migrations/023_expand_pipeline_status_constraint.js +58 -0
  647. package/dist/migrations/023_expand_pipeline_status_constraint.js.map +1 -0
  648. package/dist/migrations/index.d.ts +5 -0
  649. package/dist/migrations/index.js +51 -0
  650. package/dist/migrations/index.js.map +1 -0
  651. package/dist/migrations/runner.d.ts +15 -0
  652. package/dist/migrations/runner.js +154 -0
  653. package/dist/migrations/runner.js.map +1 -0
  654. package/dist/migrations/types.d.ts +10 -0
  655. package/dist/migrations/types.js +2 -0
  656. package/dist/migrations/types.js.map +1 -0
  657. package/dist/monorepo/architectural-analysis.d.ts +30 -0
  658. package/dist/monorepo/architectural-analysis.js +429 -0
  659. package/dist/monorepo/architectural-analysis.js.map +1 -0
  660. package/dist/monorepo/attack-surface.d.ts +20 -0
  661. package/dist/monorepo/attack-surface.js +238 -0
  662. package/dist/monorepo/attack-surface.js.map +1 -0
  663. package/dist/monorepo/boundary-manifest.d.ts +4 -0
  664. package/dist/monorepo/boundary-manifest.js +96 -0
  665. package/dist/monorepo/boundary-manifest.js.map +1 -0
  666. package/dist/monorepo/budget-controller.d.ts +19 -0
  667. package/dist/monorepo/budget-controller.js +121 -0
  668. package/dist/monorepo/budget-controller.js.map +1 -0
  669. package/dist/monorepo/context-index.d.ts +3 -0
  670. package/dist/monorepo/context-index.js +96 -0
  671. package/dist/monorepo/context-index.js.map +1 -0
  672. package/dist/monorepo/cross-module-tracing.d.ts +35 -0
  673. package/dist/monorepo/cross-module-tracing.js +251 -0
  674. package/dist/monorepo/cross-module-tracing.js.map +1 -0
  675. package/dist/monorepo/dependency-graph.d.ts +28 -0
  676. package/dist/monorepo/dependency-graph.js +219 -0
  677. package/dist/monorepo/dependency-graph.js.map +1 -0
  678. package/dist/monorepo/types.d.ts +139 -0
  679. package/dist/monorepo/types.js +10 -0
  680. package/dist/monorepo/types.js.map +1 -0
  681. package/dist/multi-agent-triage.d.ts +31 -0
  682. package/dist/multi-agent-triage.js +430 -0
  683. package/dist/multi-agent-triage.js.map +1 -0
  684. package/dist/parameter-risk.d.ts +17 -0
  685. package/dist/parameter-risk.js +103 -0
  686. package/dist/parameter-risk.js.map +1 -0
  687. package/dist/patch.d.ts +31 -0
  688. package/dist/patch.js +505 -0
  689. package/dist/patch.js.map +1 -0
  690. package/dist/poc-executor/docker.d.ts +15 -0
  691. package/dist/poc-executor/docker.js +123 -0
  692. package/dist/poc-executor/docker.js.map +1 -0
  693. package/dist/poc-executor/index.d.ts +10 -0
  694. package/dist/poc-executor/index.js +23 -0
  695. package/dist/poc-executor/index.js.map +1 -0
  696. package/dist/poc-executor/process.d.ts +14 -0
  697. package/dist/poc-executor/process.js +76 -0
  698. package/dist/poc-executor/process.js.map +1 -0
  699. package/dist/poc-executor/types.d.ts +19 -0
  700. package/dist/poc-executor/types.js +6 -0
  701. package/dist/poc-executor/types.js.map +1 -0
  702. package/dist/poc-harness.d.ts +7 -10
  703. package/dist/poc-harness.js +136 -156
  704. package/dist/poc-harness.js.map +1 -1
  705. package/dist/precedents.d.ts +17 -0
  706. package/dist/precedents.js +93 -0
  707. package/dist/precedents.js.map +1 -0
  708. package/dist/prompts/bootstrap.d.ts +29 -0
  709. package/dist/prompts/bootstrap.js +80 -0
  710. package/dist/prompts/bootstrap.js.map +1 -0
  711. package/dist/prompts/context.d.ts +79 -0
  712. package/dist/prompts/context.js +127 -0
  713. package/dist/prompts/context.js.map +1 -0
  714. package/dist/prompts/index.d.ts +7 -0
  715. package/dist/prompts/index.js +7 -0
  716. package/dist/prompts/index.js.map +1 -0
  717. package/dist/prompts/loader.d.ts +10 -0
  718. package/dist/prompts/loader.js +30 -0
  719. package/dist/prompts/loader.js.map +1 -0
  720. package/dist/prompts/modules.d.ts +53 -0
  721. package/dist/prompts/modules.js +176 -0
  722. package/dist/prompts/modules.js.map +1 -0
  723. package/dist/prompts/prompt-report.d.ts +34 -0
  724. package/dist/prompts/prompt-report.js +97 -0
  725. package/dist/prompts/prompt-report.js.map +1 -0
  726. package/dist/prompts/sanitize.d.ts +20 -0
  727. package/dist/prompts/sanitize.js +92 -0
  728. package/dist/prompts/sanitize.js.map +1 -0
  729. package/dist/prompts/template.d.ts +45 -0
  730. package/dist/prompts/template.js +385 -0
  731. package/dist/prompts/template.js.map +1 -0
  732. package/dist/prompts/templates/triage.d.ts +48 -0
  733. package/dist/prompts/templates/triage.js +151 -0
  734. package/dist/prompts/templates/triage.js.map +1 -0
  735. package/dist/prompts/templates/verify.d.ts +68 -0
  736. package/dist/prompts/templates/verify.js +256 -0
  737. package/dist/prompts/templates/verify.js.map +1 -0
  738. package/dist/prompts/tool-policy.d.ts +55 -0
  739. package/dist/prompts/tool-policy.js +142 -0
  740. package/dist/prompts/tool-policy.js.map +1 -0
  741. package/dist/quality-gate.d.ts +28 -0
  742. package/dist/quality-gate.js +65 -0
  743. package/dist/quality-gate.js.map +1 -0
  744. package/dist/repo-context.d.ts +6 -0
  745. package/dist/repo-context.js +190 -0
  746. package/dist/repo-context.js.map +1 -0
  747. package/dist/repo-walk.d.ts +12 -0
  748. package/dist/repo-walk.js +57 -0
  749. package/dist/repo-walk.js.map +1 -0
  750. package/dist/report-csv.d.ts +9 -0
  751. package/dist/report-csv.js +69 -0
  752. package/dist/report-csv.js.map +1 -0
  753. package/dist/report-json.d.ts +8 -0
  754. package/dist/report-json.js +91 -0
  755. package/dist/report-json.js.map +1 -0
  756. package/dist/report-jsonl.d.ts +9 -0
  757. package/dist/report-jsonl.js +74 -0
  758. package/dist/report-jsonl.js.map +1 -0
  759. package/dist/report-markdown.d.ts +1 -1
  760. package/dist/report-markdown.js +191 -21
  761. package/dist/report-markdown.js.map +1 -1
  762. package/dist/report-monorepo.d.ts +21 -0
  763. package/dist/report-monorepo.js +96 -0
  764. package/dist/report-monorepo.js.map +1 -0
  765. package/dist/report-sarif.d.ts +1 -1
  766. package/dist/report-sarif.js +81 -25
  767. package/dist/report-sarif.js.map +1 -1
  768. package/dist/report.d.ts +8 -3
  769. package/dist/report.js +283 -13
  770. package/dist/report.js.map +1 -1
  771. package/dist/retry.d.ts +7 -0
  772. package/dist/retry.js +68 -1
  773. package/dist/retry.js.map +1 -1
  774. package/dist/scanner-cache.d.ts +44 -0
  775. package/dist/scanner-cache.js +124 -0
  776. package/dist/scanner-cache.js.map +1 -0
  777. package/dist/scanners/agentic.d.ts +5 -3
  778. package/dist/scanners/agentic.js +47 -6
  779. package/dist/scanners/agentic.js.map +1 -1
  780. package/dist/scanners/codeql.d.ts +5 -3
  781. package/dist/scanners/codeql.js +38 -5
  782. package/dist/scanners/codeql.js.map +1 -1
  783. package/dist/scanners/dedup.d.ts +15 -0
  784. package/dist/scanners/dedup.js +132 -0
  785. package/dist/scanners/dedup.js.map +1 -0
  786. package/dist/scanners/design-decision-classifier.d.ts +29 -0
  787. package/dist/scanners/design-decision-classifier.js +164 -0
  788. package/dist/scanners/design-decision-classifier.js.map +1 -0
  789. package/dist/scanners/finding-selection.d.ts +2 -3
  790. package/dist/scanners/finding-selection.js +5 -115
  791. package/dist/scanners/finding-selection.js.map +1 -1
  792. package/dist/scanners/fp-filter.d.ts +17 -0
  793. package/dist/scanners/fp-filter.js +167 -0
  794. package/dist/scanners/fp-filter.js.map +1 -0
  795. package/dist/scanners/llm-rescore.d.ts +21 -0
  796. package/dist/scanners/llm-rescore.js +332 -0
  797. package/dist/scanners/llm-rescore.js.map +1 -0
  798. package/dist/scanners/normalization.d.ts +19 -0
  799. package/dist/scanners/normalization.js +254 -0
  800. package/dist/scanners/normalization.js.map +1 -0
  801. package/dist/scanners/normalize-findings.d.ts +86 -0
  802. package/dist/scanners/{run-claude-adk.js → normalize-findings.js} +77 -119
  803. package/dist/scanners/normalize-findings.js.map +1 -0
  804. package/dist/scanners/registry.d.ts +5 -5
  805. package/dist/scanners/registry.js +20 -6
  806. package/dist/scanners/registry.js.map +1 -1
  807. package/dist/scanners/resolve-codeql.js +1 -1
  808. package/dist/scanners/resolve-codeql.js.map +1 -1
  809. package/dist/scanners/resolve-semgrep.js +45 -8
  810. package/dist/scanners/resolve-semgrep.js.map +1 -1
  811. package/dist/scanners/run-agentic.d.ts +6 -19
  812. package/dist/scanners/run-agentic.js +106 -205
  813. package/dist/scanners/run-agentic.js.map +1 -1
  814. package/dist/scanners/run-codeql.d.ts +14 -0
  815. package/dist/scanners/run-codeql.js +192 -17
  816. package/dist/scanners/run-codeql.js.map +1 -1
  817. package/dist/scanners/run-semgrep.d.ts +1 -1
  818. package/dist/scanners/run-semgrep.js +45 -15
  819. package/dist/scanners/run-semgrep.js.map +1 -1
  820. package/dist/scanners/scoring.d.ts +4 -1
  821. package/dist/scanners/scoring.js +78 -5
  822. package/dist/scanners/scoring.js.map +1 -1
  823. package/dist/scanners/semgrep.d.ts +3 -3
  824. package/dist/scanners/semgrep.js +25 -5
  825. package/dist/scanners/semgrep.js.map +1 -1
  826. package/dist/scanners/types.d.ts +40 -7
  827. package/dist/scheduler/index.d.ts +27 -0
  828. package/dist/scheduler/index.js +45 -0
  829. package/dist/scheduler/index.js.map +1 -0
  830. package/dist/scheduler/rate-limit-registry.d.ts +48 -0
  831. package/dist/scheduler/rate-limit-registry.js +282 -0
  832. package/dist/scheduler/rate-limit-registry.js.map +1 -0
  833. package/dist/scheduler/types.d.ts +55 -0
  834. package/dist/scheduler/types.js +2 -0
  835. package/dist/scheduler/types.js.map +1 -0
  836. package/dist/schemas.d.ts +1133 -0
  837. package/dist/schemas.js +779 -0
  838. package/dist/schemas.js.map +1 -0
  839. package/dist/scoring/composite-confidence.d.ts +51 -0
  840. package/dist/scoring/composite-confidence.js +102 -0
  841. package/dist/scoring/composite-confidence.js.map +1 -0
  842. package/dist/scoring/prompt-versioning.d.ts +4 -0
  843. package/dist/scoring/prompt-versioning.js +8 -0
  844. package/dist/scoring/prompt-versioning.js.map +1 -0
  845. package/dist/scoring/run-metrics.d.ts +80 -0
  846. package/dist/scoring/run-metrics.js +234 -0
  847. package/dist/scoring/run-metrics.js.map +1 -0
  848. package/dist/scoring/triage-assertions.d.ts +96 -0
  849. package/dist/scoring/triage-assertions.js +390 -0
  850. package/dist/scoring/triage-assertions.js.map +1 -0
  851. package/dist/security-profiles.d.ts +21 -0
  852. package/dist/security-profiles.js +82 -0
  853. package/dist/security-profiles.js.map +1 -0
  854. package/dist/store/crypto-behavioral.d.ts +4 -0
  855. package/dist/store/crypto-behavioral.js +54 -0
  856. package/dist/store/crypto-behavioral.js.map +1 -0
  857. package/dist/store/dynamic-analysis.d.ts +5 -0
  858. package/dist/store/dynamic-analysis.js +70 -0
  859. package/dist/store/dynamic-analysis.js.map +1 -0
  860. package/dist/store/patch-results.d.ts +6 -0
  861. package/dist/store/patch-results.js +63 -0
  862. package/dist/store/patch-results.js.map +1 -0
  863. package/dist/store.d.ts +140 -21
  864. package/dist/store.js +796 -245
  865. package/dist/store.js.map +1 -1
  866. package/dist/strategies/auto-rule.d.ts +19 -0
  867. package/dist/strategies/auto-rule.js +282 -0
  868. package/dist/strategies/auto-rule.js.map +1 -0
  869. package/dist/strategies/cwe-strategy-map.d.ts +13 -0
  870. package/dist/strategies/cwe-strategy-map.js +144 -0
  871. package/dist/strategies/cwe-strategy-map.js.map +1 -0
  872. package/dist/strategies/dataflow/index.d.ts +3 -0
  873. package/dist/strategies/dataflow/index.js +143 -0
  874. package/dist/strategies/dataflow/index.js.map +1 -0
  875. package/dist/strategies/execution/index.d.ts +3 -0
  876. package/dist/strategies/execution/index.js +132 -0
  877. package/dist/strategies/execution/index.js.map +1 -0
  878. package/dist/strategies/executor.d.ts +15 -0
  879. package/dist/strategies/executor.js +86 -0
  880. package/dist/strategies/executor.js.map +1 -0
  881. package/dist/strategies/index.d.ts +8 -0
  882. package/dist/strategies/index.js +8 -0
  883. package/dist/strategies/index.js.map +1 -0
  884. package/dist/strategies/init.d.ts +3 -0
  885. package/dist/strategies/init.js +35 -0
  886. package/dist/strategies/init.js.map +1 -0
  887. package/dist/strategies/merge.d.ts +12 -0
  888. package/dist/strategies/merge.js +118 -0
  889. package/dist/strategies/merge.js.map +1 -0
  890. package/dist/strategies/multi-strategy-task.d.ts +9 -0
  891. package/dist/strategies/multi-strategy-task.js +80 -0
  892. package/dist/strategies/multi-strategy-task.js.map +1 -0
  893. package/dist/strategies/reasoning/index.d.ts +3 -0
  894. package/dist/strategies/reasoning/index.js +155 -0
  895. package/dist/strategies/reasoning/index.js.map +1 -0
  896. package/dist/strategies/registry.d.ts +14 -0
  897. package/dist/strategies/registry.js +26 -0
  898. package/dist/strategies/registry.js.map +1 -0
  899. package/dist/strategies/rule-persistence.d.ts +16 -0
  900. package/dist/strategies/rule-persistence.js +54 -0
  901. package/dist/strategies/rule-persistence.js.map +1 -0
  902. package/dist/strategies/syntactic/index.d.ts +2 -0
  903. package/dist/strategies/syntactic/index.js +136 -0
  904. package/dist/strategies/syntactic/index.js.map +1 -0
  905. package/dist/strategies/task-profile-map.d.ts +5 -0
  906. package/dist/strategies/task-profile-map.js +26 -0
  907. package/dist/strategies/task-profile-map.js.map +1 -0
  908. package/dist/strategies/types.d.ts +60 -0
  909. package/dist/strategies/types.js +2 -0
  910. package/dist/strategies/types.js.map +1 -0
  911. package/dist/streaming.d.ts +11 -0
  912. package/dist/streaming.js +181 -0
  913. package/dist/streaming.js.map +1 -0
  914. package/dist/task-output-meta.d.ts +11 -0
  915. package/dist/task-output-meta.js +24 -0
  916. package/dist/task-output-meta.js.map +1 -0
  917. package/dist/trajectory-memory.d.ts +90 -0
  918. package/dist/trajectory-memory.js +275 -0
  919. package/dist/trajectory-memory.js.map +1 -0
  920. package/dist/triage.d.ts +257 -20
  921. package/dist/triage.js +505 -190
  922. package/dist/triage.js.map +1 -1
  923. package/dist/types.d.ts +528 -22
  924. package/dist/types.js +2 -1
  925. package/dist/types.js.map +1 -1
  926. package/dist/utils/index.d.ts +1 -0
  927. package/dist/utils/index.js +2 -0
  928. package/dist/utils/index.js.map +1 -0
  929. package/dist/utils/safe-json.d.ts +31 -0
  930. package/dist/utils/safe-json.js +70 -0
  931. package/dist/utils/safe-json.js.map +1 -0
  932. package/dist/utils.d.ts +3 -1
  933. package/dist/utils.js +8 -2
  934. package/dist/utils.js.map +1 -1
  935. package/dist/verify.d.ts +100 -11
  936. package/dist/verify.js +331 -181
  937. package/dist/verify.js.map +1 -1
  938. package/package.json +41 -8
  939. package/dist/agents/tasks/augur-analyze.d.ts +0 -22
  940. package/dist/agents/tasks/augur-analyze.js +0 -418
  941. package/dist/agents/tasks/augur-analyze.js.map +0 -1
  942. package/dist/agents/tasks/augur-extraction-agent.js.map +0 -1
  943. package/dist/agents/tasks/augur-label.d.ts +0 -21
  944. package/dist/agents/tasks/augur-label.js +0 -627
  945. package/dist/agents/tasks/augur-label.js.map +0 -1
  946. package/dist/agents/tasks/augur-preflight.d.ts +0 -36
  947. package/dist/agents/tasks/augur-preflight.js +0 -471
  948. package/dist/agents/tasks/augur-preflight.js.map +0 -1
  949. package/dist/agents/tasks/augur-types.d.ts +0 -111
  950. package/dist/agents/tasks/augur-types.js +0 -169
  951. package/dist/agents/tasks/augur-types.js.map +0 -1
  952. package/dist/bus/adapters/google-pubsub.d.ts +0 -13
  953. package/dist/bus/adapters/google-pubsub.js +0 -26
  954. package/dist/bus/adapters/google-pubsub.js.map +0 -1
  955. package/dist/bus/adapters/nats.d.ts +0 -13
  956. package/dist/bus/adapters/nats.js +0 -26
  957. package/dist/bus/adapters/nats.js.map +0 -1
  958. package/dist/bus/adapters/redis.d.ts +0 -13
  959. package/dist/bus/adapters/redis.js +0 -26
  960. package/dist/bus/adapters/redis.js.map +0 -1
  961. package/dist/deps.d.ts +0 -15
  962. package/dist/deps.js +0 -18
  963. package/dist/deps.js.map +0 -1
  964. package/dist/llm/anthropic.d.ts +0 -3
  965. package/dist/llm/anthropic.js +0 -21
  966. package/dist/llm/anthropic.js.map +0 -1
  967. package/dist/scanner/claude-adk.d.ts +0 -26
  968. package/dist/scanner/claude-adk.js +0 -265
  969. package/dist/scanner/claude-adk.js.map +0 -1
  970. package/dist/scanner/resolve.d.ts +0 -10
  971. package/dist/scanner/resolve.js +0 -99
  972. package/dist/scanner/resolve.js.map +0 -1
  973. package/dist/scanner.d.ts +0 -47
  974. package/dist/scanner.js +0 -123
  975. package/dist/scanner.js.map +0 -1
  976. package/dist/scanners/claude-adk.d.ts +0 -11
  977. package/dist/scanners/claude-adk.js +0 -74
  978. package/dist/scanners/claude-adk.js.map +0 -1
  979. package/dist/scanners/run-claude-adk.d.ts +0 -33
  980. package/dist/scanners/run-claude-adk.js.map +0 -1
  981. package/dist/scanners.d.ts +0 -25
  982. package/dist/scanners.js +0 -88
  983. package/dist/scanners.js.map +0 -1
package/README.md CHANGED
@@ -1,103 +1,246 @@
1
1
  <img src="kuzushi.png" alt="Kuzushi" width="200" />
2
2
 
3
- # Kuzushi — Agentic SAST Orchestrator
3
+ # Kuzushi — AI Security Scanner That Only Shows You Real Vulnerabilities
4
4
 
5
- Agentic SAST orchestrator. Runs security analysis tasks — scanners, AI triage, exploit verification, and more — as a dependency graph on an event-driven pipeline, then tells you what's actually dangerous.
5
+ [![CI](https://github.com/allsmog/Kuzushi/actions/workflows/ci.yml/badge.svg)](https://github.com/allsmog/Kuzushi/actions/workflows/ci.yml)
6
+ [![npm](https://img.shields.io/npm/v/kuzushi)](https://www.npmjs.com/package/kuzushi)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
8
+
9
+ [kuzushi.dev](https://kuzushi.dev)
10
+
11
+ SAST tools cry wolf. Semgrep finds 500 issues in your codebase. 480 of them are false positives. You spend hours triaging a wall of noise and still miss the real vulnerability on line 247.
12
+
13
+ Kuzushi runs the same scanners, then sends an AI agent to investigate each finding — reading the actual code, tracing data flow, checking for sanitization. It tells you which findings are real, which are noise, and optionally proves exploitability by constructing a working PoC.
14
+
15
+ ```sh
16
+ npx kuzushi /path/to/your/repo
17
+ ```
18
+
19
+ No config files. Just point it at a repo.
20
+
21
+ <!-- TODO: Add terminal recording / asciinema GIF here -->
6
22
 
7
23
  ## Quick Start
8
24
 
9
- Prereqs: Node 22+, an API key for at least one supported LLM provider.
25
+ Prereqs: Node 22+, and either an API key or Claude Code OAuth login.
26
+
27
+ ```sh
28
+ # Install globally (recommended — get upgrades with npm update -g kuzushi)
29
+ npm install -g kuzushi
30
+
31
+ # Or run without installing
32
+ npx kuzushi /path/to/your/repo
33
+ ```
34
+
35
+ ```sh
36
+ # With Claude Code OAuth (no API key needed — uses your Claude login)
37
+ kuzushi /path/to/your/repo
38
+
39
+ # With Anthropic API key
40
+ export ANTHROPIC_API_KEY=sk-ant-...
41
+ kuzushi /path/to/your/repo
42
+
43
+ # With OpenAI
44
+ export OPENAI_API_KEY=sk-...
45
+ kuzushi /path/to/repo --model openai:gpt-4o
46
+
47
+ # With Google, Groq, Mistral, or 15+ other providers
48
+ kuzushi /path/to/repo --model google:gemini-2.0-flash
49
+ ```
50
+
51
+ Kuzushi auto-downloads Opengrep if you don't have a scanner installed. Zero dependencies to manage.
10
52
 
11
- **With Anthropic (default):**
53
+ ## The Problem
12
54
 
13
- 1. Get an API key at https://console.anthropic.com/
14
- 2. Set it: `export ANTHROPIC_API_KEY=sk-ant-...`
15
- 3. Scan: `npx kuzushi /path/to/your/repo`
55
+ **SAST scanners alone** have high recall but terrible precision — they flag everything that *could* be a vulnerability, drowning you in false positives. Teams burn hours triaging, develop alert fatigue, and eventually stop looking.
16
56
 
17
- **With OpenAI, Google, or any pi-ai-supported provider:**
57
+ **LLMs alone** can reason about code but hallucinate when scanning from scratch — 95%+ false positive rate when you ask "find vulnerabilities in this repo."
18
58
 
19
- 1. Set the provider key: `export OPENAI_API_KEY=sk-...` (or `GEMINI_API_KEY`, etc.)
20
- 2. Scan: `npx kuzushi /path/to/repo --agent-runtime pi-ai --model openai:gpt-4o`
59
+ **Kuzushi combines both.** SAST signal narrows the search space. AI reasoning eliminates false positives. The result: near-human researcher agreement rates on vulnerability classification.
21
60
 
22
- That's it. Kuzushi auto-downloads Opengrep if you don't have a scanner installed. To add CodeQL, see [CodeQL Setup](#codeql-setup).
61
+ ## What You Get
23
62
 
24
- ## What It Does
63
+ For each finding, Kuzushi produces:
25
64
 
26
- - **Runs Opengrep/Semgrep** with severity-ranked rule matching
27
- - **Runs configurable scanners** (`semgrep`, `agentic`, `codeql`) in one orchestration flow
28
- - **Gathers repo context** — auto-detects language, frameworks, auth patterns, ORMs, and sanitization libraries to enrich AI analysis
29
- - **Scores and deduplicates** findings by severity, likelihood, impact, and subcategory cross-scanner normalization merges equivalent findings from different scanners at the same location
30
- - **AI-triages selected findings** — after dedupe/resume/max filters, agent investigates with repo tools, assigns tp/fp/needs_review with confidence and rationale
31
- - **Verifies exploitability** optional post-triage phase constructs concrete proof-of-concept payloads for true positives (e.g., SQL injection strings, XSS vectors)
32
- - **Generates PoC harnesses** — optional post-verification phase produces runnable exploit scripts (TypeScript, Python, etc.) for verified-exploitable findings
33
- - **Vendor-agnostic LLM runtime** — swap between Anthropic, OpenAI, Google, and 15+ other providers via the `pi-ai` backend with zero consumer-code changes
34
- - **Augur integration** multi-pass CodeQL-based source/sink labeling pipeline with LLM-assisted classification, checkpoint gating, and deterministic library generation
35
- - **Tracks cost** — per-finding triage, verification, and PoC harness costs are persisted and displayed in the summary
36
- - **Event-driven pipeline** — pluggable message bus interface (in-process backend implemented; Redis/Google Pub/Sub/NATS adapters are scaffolded)
37
- - **DAG-based task orchestration** — tasks declare dependencies, run in parallel groups, pass outputs downstream
38
- - **Extensible agent framework** — `AgentTask` interface for adding new analysis types (threat modeling, binary analysis, etc.)
39
- - **Persists results** in SQLite — resume interrupted scans, skip already-triaged findings
40
- - **Resumable runs** — checkpoint pipeline state to SQLite; `--resume` picks up where a crashed or interrupted scan left off
41
- - **Retry with backoff** — transient agent failures are retried automatically with exponential backoff
42
- - **Audit logging** — optional JSONL audit trail of every agent decision for debugging and accountability
43
- - **Markdown reports** — export a shareable `.md` report for CI pipelines and team review
44
- - **Prints a styled report** showing only what matters: true positives, needs-review items, and verified exploits with PoC payloads
65
+ - **Verdict** `true_positive`, `false_positive`, `by_design`, or `needs_review`
66
+ - **Confidence** 0.0 to 1.0
67
+ - **Rationale** — why the agent reached that verdict, referencing specific code lines
68
+ - **Verification steps** — 2-6 actionable steps a human reviewer can follow
69
+ - **Fix suggestion** — suggested patch when applicable
70
+ - **PoC exploit** (with `--verify`) a concrete proof-of-concept payload proving the vulnerability is exploitable
71
+ - **Cost** — per-finding triage and verification cost in USD
72
+
73
+ The terminal report shows true positives first, then needs-review items. False positives and by-design findings are counted but deprioritized. You only see what matters.
45
74
 
46
75
  ## How It Works
47
76
 
48
- Semgrep/Opengrep catches syntactic patterns but can't verify data flow or intent. LLMs can reason about code but hallucinate when scanning from scratch (95%+ false positive rate). Kuzushi combines both: SAST signal narrows the search space, LLM reasoning eliminates false positives. This hybrid approach matches human researcher agreement rates.
77
+ ```
78
+ ┌─────────────┐ ┌──────────────┐ ┌──────────────┐ ┌─────────┐ ┌──────────┐
79
+ │ Task DAG │────▶│ AI Triage │────▶│ Verification │────▶│ Patch │────▶│ Report │
80
+ │ Semgrep │ │ Investigate │ │ Construct │ │ Generate │ │ TP only │
81
+ │ CodeQL │ │ each finding │ │ PoC exploits │ │ & verify │ │ + export │
82
+ │ 15+ tasks │ │ with context │ │ (optional) │ │ (opt-in) │ │ + stream │
83
+ └─────────────┘ └──────────────┘ └──────────────┘ └─────────┘ └──────────┘
84
+ ```
85
+
86
+ 1. **Context gathering** — auto-detects your tech stack, frameworks, auth patterns, ORMs, and sanitization libraries
87
+ 2. **Code graph** — builds a persistent entry-point-to-sink graph via static analysis + LLM discovery mode. For HTTP services, traces pre-identified routes. For CLI tools, daemons, and non-HTTP projects, the LLM identifies entry points itself (main functions, socket listeners, gRPC servers, CLI handlers) and traces security-relevant call/data-flow paths
88
+ 3. **Threat modeling** — Randori PASTA plugin (shipped as `@kuzushi/randori-plugin`) performs 4-stage threat analysis: business objectives, technical scope, DFD decomposition, and STRIDE threat scenarios with ATT&CK/CAPEC/OWASP mapping and 5-factor probabilistic scoring. All threat leads are injected into every detector's prompts.
89
+ 4. **Threat-informed hunting** — spawns one adversarial Claude agent per DFD external entity (users, services, attackers) to CTF-style hunt for vulnerabilities from each actor's perspective
90
+ 5. **Task DAG execution** — runs enabled tasks as a dependency-aware DAG: Semgrep, CodeQL, agentic scanner, and 15+ specialized detectors (SSRF, SQLi, XSS, command injection, XXE, deserialization, NoSQL injection, template injection, prototype pollution, race conditions, supply chain, GraphQL, secrets/crypto, auth logic, sharp edges, systems-level deep semantic analysis); multi-strategy mode runs 2-4 analytical approaches per vuln class
91
+ 4. **Classifier funnel** — cheap single-token pre-filter removes ~80% of noise before expensive triage
92
+ 5. **Deduplication** — fingerprints and merges equivalent findings across scanners
93
+ 6. **Incremental skip** — findings already triaged in previous runs are skipped automatically
94
+ 7. **AI triage** — an agent investigates each finding with pre-loaded source context, code graph paths, evidence chains, threat model context, and CWE-specific knowledge modules. Threat model output from Randori PASTA is injected into triage prompts so the agent can distinguish design choices (`by_design`) from real vulnerabilities (`tp`). Batch-dropped findings auto-escalate to individual triage
95
+ 8. **Variant analysis** — confirmed TPs trigger automatic search for similar patterns across the codebase
96
+ 9. **Verification** (optional) — constructs concrete PoC exploit payloads for true positives
97
+ 10. **PoC harness generation** (optional) — produces runnable exploit scripts with iterative execution feedback
98
+ 11. **Dynamic analysis** (optional) — executes harnesses in Docker sandbox to confirm exploitability
99
+ 12. **Auto-patch** (optional) — generates, validates, and re-verifies patches in disposable git worktrees
100
+ 13. **Report** — terminal display + export to SARIF, Markdown, JSON, CSV, or JSONL; optional SSE live streaming
101
+
102
+ ## CI Integration
103
+
104
+ ### GitHub Actions
105
+
106
+ ```yaml
107
+ name: Security Scan
108
+ on: [push, pull_request]
109
+ jobs:
110
+ kuzushi:
111
+ runs-on: ubuntu-latest
112
+ steps:
113
+ - uses: actions/checkout@v4
114
+ - uses: actions/setup-node@v4
115
+ with:
116
+ node-version: 22
117
+ - run: npx kuzushi . --sarif results.sarif --quality-gate --fail-on-tp
118
+ env:
119
+ ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
120
+ - uses: github/codeql-action/upload-sarif@v3
121
+ if: always()
122
+ with:
123
+ sarif_file: results.sarif
124
+ ```
125
+
126
+ ### Quality Gates
127
+
128
+ ```sh
129
+ kuzushi <repo> --quality-gate # fail CI on threshold violations
130
+ kuzushi <repo> --fail-on-tp # fail if any high/critical TP is found
131
+ kuzushi <repo> --sarif results.sarif # export SARIF for GitHub Code Scanning
132
+ ```
133
+
134
+ ## Key Features
135
+
136
+ **Vendor-agnostic LLM runtime** — works with Anthropic, OpenAI, Google, Groq, Mistral, and 15+ other providers. Swap models at runtime with `--model provider:modelId`. Use cheaper models for triage, premium models for verification.
137
+
138
+ **Exploit verification** — goes beyond classification. Constructs concrete PoC payloads (SQL injection strings, XSS vectors, etc.) that prove a finding is exploitable, not just theoretically possible.
139
+
140
+ **Crypto behavioral testing** — generates and executes behavioral test harnesses in a Docker sandbox for crypto misuse findings. Detects timing side-channels, ECB mode, weak hashes, weak PRNGs, and more.
141
+
142
+ **IRIS-style taint analysis** — LLM-driven CodeQL taint analysis inspired by the IRIS paper (ICLR 2025). An LLM selects relevant CWE classes for the project, writes CodeQL extraction queries dynamically (language-agnostic, framework-agnostic), labels candidates, generates TaintTracking configurations, and iteratively refines queries when compilation fails. Structured taint paths (source-to-sink step data) are persisted to the findings DB for downstream verification and reporting. No templates, no hardcoded framework detection.
143
+
144
+ **Randori PASTA threat modeling** — ships `@kuzushi/randori-plugin` as a dependency. Runs 4-stage PASTA analysis (objectives, scope, DFD decomposition, STRIDE threats) via Claude Code plugin. Threat leads are injected into all detector prompts for threat-informed scanning. ATT&CK, CAPEC, and OWASP mapping included.
145
+
146
+ **Threat-informed hunting** — spawns adversarial Claude agents for each DFD external entity identified by the threat model. Each agent explores the codebase as that actor (end user, admin, external service, LLM agent) looking for exploitable paths. Findings are deduplicated and fed into triage/verification.
147
+
148
+ **Systems-level deep semantic hunt** — LLM-driven analysis pipeline for finding the class of bugs that survive decades of code review and fuzzing: integer overflow/wraparound (CWE-190), sentinel value collisions (CWE-787), signed/unsigned comparison bugs (CWE-681), buffer overflows exploitable via missing stack canaries (CWE-693), use-after-free in protocol state machines (CWE-416), and unsafe block violations in Rust (CWE-704). The LLM writes and runs CodeQL queries using range analysis, loop induction analysis, and type predicates — NOT TaintTracking — to find bugs that source-to-sink taint flows cannot express. Activates automatically for C, C++, Rust, and Go codebases. The `glasswing` preset routes a frontier model to this task for maximum depth.
149
+
150
+ **Auto rule generation** — verified exploitable findings automatically generate custom Semgrep rules. Rules are persisted to `.kuzushi/custom-rules/` and auto-loaded on subsequent scans, creating a feedback loop where the scanner gets smarter over time. Rules are validated against the original finding and removed if they don't match.
49
151
 
50
- Under the hood, Kuzushi uses an event-driven architecture with a DAG-based task orchestrator:
152
+ **Diff-aware taint analysis** narrows analysis to files changed since a base branch. Run `--taint-diff-base main` in CI to only analyze what's new in the PR.
51
153
 
52
- 1. **Context gathering** (optional, enabled by default) the context-gatherer task analyzes the repo structure (package.json, go.mod, etc.) to identify the tech stack, frameworks, and security-relevant libraries.
53
- 2. **Pipeline starts** — the orchestrator resolves enabled tasks into a dependency graph and groups them into parallel stages.
54
- 3. **Scanners run** — scanner tasks (Semgrep, CodeQL, Agentic, etc.) execute concurrently within their stage, emitting findings as typed events on the message bus.
55
- 4. **Results gate downstream tasks** — the orchestrator waits for each stage to complete before starting dependent stages. Upstream outputs are forwarded to dependent tasks via `TaskContext`.
56
- 5. **Triage stage** — findings are deduplicated (fingerprint + cross-scanner location/CWE/rule normalization), ranked, and sent to an LLM for semantic verification with configurable concurrency. The repo context from step 1 enriches every triage prompt.
57
- 6. **Verification stage** (optional) — triaged findings that pass verification gates (`verifyVerdicts`, scanner-level `scannerConfig.<id>.verify`, and `verifyMinConfidence`) are sent to a verification agent that attempts to construct concrete PoC exploit payloads.
58
- 7. **PoC harness generation** (optional) — verified-exploitable findings are sent to a harness generator that produces runnable exploit scripts with syntax validation.
59
- 8. **Report** — final results are persisted, rendered to terminal, and optionally exported as markdown.
154
+ **Resumable runs** — checkpoints pipeline state to SQLite. Interrupted scan? `--resume` picks up exactly where it left off.
60
155
 
61
- All communication happens through a transport-agnostic `MessageBus` interface. The default in-process bus works out of the box; distributed adapters (Redis, Google Pub/Sub, NATS) are planned and scaffolded behind the same interface.
156
+ **Patch synthesis** `kuzushi patch <repo> --fingerprint <fp>` generates and validates security patches in disposable git worktrees without touching your working copy.
62
157
 
63
- ## Commands
158
+ **15+ specialized detectors** — dedicated detection tasks for command injection, XXE, insecure deserialization, SSRF, NoSQL injection, template injection, prototype pollution, race conditions, supply chain, GraphQL security, secrets/crypto, code config, auth logic, sharp edges, crypto behavioral testing, and systems-level deep semantic analysis (integer overflow, buffer overflow, sentinel collision, use-after-free, unsafe blocks). Each has vulnerability-class-specific prompts, anti-hallucination constraints, and multi-lens analysis. All detectors receive threat model leads for threat-informed scanning.
159
+
160
+ **Classifier funnel** — single-token LLM pre-filter using a cheap model removes ~80% of false positives before expensive triage, cutting per-scan cost dramatically.
161
+
162
+ **Source pre-read** — triage agents receive the flagged source file pre-loaded (50 lines surrounding the finding), eliminating cold-start tool calls and improving reasoning accuracy.
163
+
164
+ **LLM code graph** — builds a persistent code graph tracing entry points through middleware, controllers, services, and data-access layers. Static skeleton from import analysis + LLM-assisted gap-filling for dynamic dispatch, DI, and callback patterns. Discovery mode: when no HTTP routes are detected, the LLM identifies entry points itself (main functions, socket listeners, gRPC servers, CLI handlers) and traces security-relevant paths with threat model context. Feeds graph context into triage for better reasoning.
165
+
166
+ **Multi-strategy analysis** — runs 2-4 different analytical approaches per vulnerability class (syntactic pattern matching, dataflow tracing, first-principles reasoning, execution-based proof) and merges results with confidence boosting when strategies agree. Auto-generates reusable Semgrep rules from confirmed multi-strategy findings.
167
+
168
+ **13 CWE knowledge modules** — domain-specific knowledge for SQL injection, XSS, SSRF, command injection, path traversal, auth bypass, deserialization, race conditions, crypto, XXE, file upload, IDOR, and NoSQL injection — including dangerous patterns, safe patterns, bypass techniques, and fix examples.
169
+
170
+ **Incremental scanning** — skips re-triage for unchanged findings across runs. Tracks the last scanned commit, computes file diffs, and expands the rescan scope with dependency-aware invalidation via the import graph.
171
+
172
+ **Auto-patch with closed-loop verification** — after confirming a vulnerability, automatically generates a patch in a disposable git worktree, validates it (apply, build, test), then re-runs the scanner on the patched code to confirm the vulnerability is gone.
173
+
174
+ **Live streaming** — SSE server streams pipeline events in real-time (`--stream`). Connect with `curl`, `EventSource`, or any SSE client to watch findings appear as they're triaged.
175
+
176
+ **Audit logging** — optional JSONL audit trail of every agent decision for debugging, accountability, and compliance records.
177
+
178
+ ## Scan Presets
179
+
180
+ Presets configure the pipeline for different cost/depth tradeoffs. CLI flags override preset values.
181
+
182
+ ```sh
183
+ kuzushi <repo> --preset fast # semgrep only, no context/enrichment/variant analysis
184
+ kuzushi <repo> --preset standard # semgrep + IRIS taint + secrets/crypto detection
185
+ kuzushi <repo> --preset deep # standard + verification + threat modeling + systems-level hunt
186
+ kuzushi <repo> --preset glasswing # verification + PoC generation + threat-informed hunting
187
+ # + deep semantic hunt with a frontier model
188
+ ```
189
+
190
+ The `glasswing` preset uses a cost-smart model tiering strategy: a standard model handles bulk scanning and triage, while a frontier model is used surgically for the systems-hunt and threat-hunt stages — where stronger adversarial reasoning has the highest ROI for zero-day discovery. Per-task model overrides keep costs controlled.
191
+
192
+ ## Tasks
193
+
194
+ Every stage of the pipeline is an **AgentTask** — a composable unit with explicit dependencies that the orchestrator runs as a DAG. Tasks are selected via `--tasks` or `config.tasks`, and per-task config (including model overrides) lives in `config.taskConfig`.
195
+
196
+ | Task ID | Description | Auto-download |
197
+ |---------|-------------|---------------|
198
+ | `semgrep` (default) | Traditional SAST via Opengrep/Semgrep | Yes |
199
+ | `codeql` | Semantic dataflow/taint analysis via GitHub CodeQL CLI | No (opt-in) |
200
+ | `agentic` | AI-driven scanner — LLM with read-only repo tools | N/A |
201
+ | `taint-cwe-select` / `taint-iris` | IRIS-style LLM-driven CodeQL taint analysis — dynamic CWE selection, LLM-generated queries, iterative refinement | No (opt-in) |
202
+ | `systems-hunt` | Deep semantic analysis for C/C++/Rust/Go — LLM-driven CodeQL range analysis, loop induction, missing mitigations | No (opt-in) |
203
+ | `secrets-crypto-detect` | Secrets, API keys, and cryptographic misuse detection | N/A |
204
+ | `code-config-detect` | Security-relevant code and configuration issues | N/A |
205
+ | `threat-model-randori` | PASTA threat modeling with STRIDE analysis | N/A |
206
+ | `threat-hunt` | Adversarial CTF-style hunting per DFD entity | N/A |
207
+ | `context-gatherer` | Auto-detects tech stack, frameworks, auth patterns | N/A |
208
+ | `context-enricher` | Deep context enrichment (middleware, trust boundaries) | N/A |
209
+
210
+ ```sh
211
+ kuzushi <repo> --tasks semgrep,codeql # run specific tasks
212
+ kuzushi <repo> --tasks agentic # AI-only scan
213
+ kuzushi <repo> --task-model threat-hunt=anthropic:claude-opus-4-6 # per-task model override
214
+ ```
215
+
216
+ ---
217
+
218
+ <details>
219
+ <summary><strong>All Commands</strong></summary>
64
220
 
65
221
  ### Scan (default)
66
222
 
67
223
  ```
68
224
  kuzushi <repo> # scan with defaults
69
- kuzushi <repo> --scanners codeql
70
- kuzushi <repo> --scanners semgrep,codeql
71
- kuzushi <repo> --scanners semgrep,agentic
225
+ kuzushi <repo> --tasks codeql
226
+ kuzushi <repo> --tasks semgrep,codeql
227
+ kuzushi <repo> --tasks semgrep,agentic
72
228
  kuzushi <repo> --severity ERROR # only ERROR-level findings
73
229
  kuzushi <repo> --max 20 # triage top 20 findings only
74
- kuzushi <repo> --model claude-opus-4-20250514 # use a different model
75
- kuzushi <repo> --triage-model claude-opus-4-20250514 # separate model for triage
76
- kuzushi <repo> --triage-max-turns 15 # triage agent turn budget
77
- kuzushi <repo> --api-key sk-ant-... --base-url https://basecamp.stark.rubrik.com/
230
+ kuzushi <repo> --model anthropic:claude-sonnet-4-6 # use a different model
231
+ kuzushi <repo> --task-model triage=openai:gpt-4o # separate model for triage stage
232
+ kuzushi <repo> --api-key sk-ant-... --base-url https://api.example.com/ # custom API endpoint
78
233
  kuzushi <repo> --fresh # clear prior results, re-triage everything
79
234
  kuzushi <repo> --db ./my.sqlite3 # custom database path
80
235
  kuzushi <repo> --resume # resume the most recent interrupted run
81
236
  kuzushi <repo> --resume <run-id> # resume a specific run by ID
82
237
  ```
83
238
 
84
- ### Vendor-Agnostic Runtime
85
-
86
- ```
87
- kuzushi <repo> --agent-runtime pi-ai --model openai:gpt-4o
88
- kuzushi <repo> --agent-runtime pi-ai --model google:gemini-2.0-flash
89
- kuzushi <repo> --agent-runtime pi-ai --model anthropic:claude-sonnet-4-20250514
90
- kuzushi config set agentRuntimeBackend pi-ai
91
- kuzushi config set model openai:gpt-4o
92
- ```
93
-
94
- When `agentRuntimeBackend` is `pi-ai`, model strings use `provider:modelId` format. The pi-ai backend implements its own agentic tool-calling loop with local Read/Glob/Grep tools, structured output enforcement, budget tracking, and abort support. All consumer code (triage, verify, PoC harness, scanners) works unchanged — the `AgentRuntime` abstraction handles it.
95
-
96
239
  ### Verification
97
240
 
98
241
  ```
99
242
  kuzushi <repo> --verify # enable exploit verification for TPs
100
- kuzushi <repo> --verify --verify-model claude-haiku-4-5-20251001 # cheaper model for verification
243
+ kuzushi <repo> --verify --task-model verify=openai:gpt-4o-mini # cheaper model for verification
101
244
  kuzushi <repo> --verify --verify-max-turns 20
102
245
  kuzushi <repo> --verify --verify-concurrency 3
103
246
  kuzushi <repo> --verify --verify-min-confidence 0.7 # skip low-confidence TPs
@@ -107,17 +250,86 @@ kuzushi <repo> --verify --verify-min-confidence 0.7 # skip low-confidence TPs
107
250
 
108
251
  ```
109
252
  kuzushi <repo> --verify --poc-harness # generate exploit scripts for verified findings
110
- kuzushi <repo> --verify --poc-harness --poc-harness-model claude-haiku-4-5-20251001
253
+ kuzushi <repo> --verify --poc-harness --task-model poc-harness=openai:gpt-4o-mini
111
254
  kuzushi <repo> --verify --poc-harness --poc-harness-max-turns 25
112
255
  kuzushi <repo> --verify --poc-harness --poc-harness-concurrency 2
113
256
  ```
114
257
 
258
+ ### Dynamic Analysis
259
+
260
+ ```
261
+ kuzushi <repo> --verify --poc-harness --dynamic-analysis # execute harnesses to confirm/reject findings
262
+ kuzushi <repo> --verify --dynamic-analysis --dynamic-max-candidates 10
263
+ kuzushi <repo> --verify --dynamic-analysis --dynamic-min-score 8
264
+ ```
265
+
266
+ ### Patch Synthesis
267
+
268
+ ```
269
+ kuzushi patch <repo> --fingerprint <fp> # synthesize and validate a patch
270
+ kuzushi patch <repo> --fingerprint <fp> --build-cmd "npm run build"
271
+ kuzushi patch <repo> --fingerprint <fp> --test-cmd "npm test" --max-iterations 5
272
+ ```
273
+
274
+ ### Code Graph
275
+
276
+ ```
277
+ kuzushi <repo> --code-graph # enable LLM-powered code graph (entry-point-to-sink tracing)
278
+ ```
279
+
280
+ ### Multi-Strategy Analysis
281
+
282
+ ```
283
+ kuzushi <repo> --multi-strategy # adaptive mode: run cheapest strategy first, exit early if confident
284
+ kuzushi <repo> --multi-strategy-full # run all strategies in parallel for maximum coverage
285
+ kuzushi <repo> --multi-strategy-budget 3.0 # per-finding budget across all strategies (USD)
286
+ kuzushi <repo> --multi-strategy-auto-rules # generate Semgrep rules from confirmed multi-strategy findings
287
+ ```
288
+
289
+ ### Auto-Patch (Closed-Loop)
290
+
291
+ ```
292
+ kuzushi <repo> --verify --auto-patch # patch exploitable findings, re-verify
293
+ kuzushi <repo> --verify --auto-patch --auto-patch-after triage # patch any TP (broadest trigger)
294
+ kuzushi <repo> --verify --auto-patch --auto-patch-after poc # patch only after PoC proves it
295
+ kuzushi <repo> --auto-patch --patch-verify-depth triage # re-run scanner + triage on patched code
296
+ kuzushi <repo> --auto-patch --patch-verify-depth full # full pipeline re-verify (most thorough)
297
+ kuzushi <repo> --auto-patch --patch-concurrency 3 # parallel patch synthesis tasks
298
+ ```
299
+
300
+ ### Streaming
301
+
302
+ ```
303
+ kuzushi <repo> --stream # start SSE server on auto-assigned port
304
+ kuzushi <repo> --stream --stream-port 3001 # start SSE server on specific port
305
+ # Then in another terminal:
306
+ curl -N http://localhost:3001/events # watch live pipeline events
307
+ ```
308
+
309
+ ### Crypto Behavioral Testing
310
+
311
+ ```
312
+ kuzushi <repo> --crypto-behavioral-test # generate & run behavioral tests for crypto misuse findings
313
+ ```
314
+
315
+ ### Diff-Aware Taint
316
+
317
+ ```
318
+ kuzushi <repo> --taint-diff-base main # only taint-analyze files changed since main
319
+ kuzushi <repo> --taint-diff-base main --taint-diff-mode delta # emit only findings intersecting the diff
320
+ kuzushi <repo> --taint-diff-base main --taint-diff-mode baseline # merge cached + rerun for full baseline
321
+ ```
322
+
115
323
  ### Output & Observability
116
324
 
117
325
  ```
118
326
  kuzushi <repo> --output report.md # export markdown report
119
327
  kuzushi <repo> --sarif results.sarif # export SARIF v2.1.0
328
+ kuzushi <repo> --json results.json # export JSON report
329
+ kuzushi <repo> --csv results.csv # export CSV report
330
+ kuzushi <repo> --jsonl results.jsonl # export JSONL report
120
331
  kuzushi <repo> --audit-log # write agent activity to .kuzushi/runs/{runId}/
332
+ kuzushi <repo> --verbose # show debug-level runtime diagnostics
121
333
  kuzushi <repo> --no-context # disable repo context gathering
122
334
  ```
123
335
 
@@ -134,77 +346,107 @@ kuzushi <repo> --retry-backoff-ms 10000 # initial backoff delay (default: 50
134
346
  ```
135
347
  kuzushi config get # show all config
136
348
  kuzushi config get model # show one key
137
- kuzushi config set model claude-opus-4-20250514
138
- kuzushi config set scanners semgrep,agentic
139
- kuzushi config set scannerConfig.codeql.dbPath ./codeql-db
140
- kuzushi config set scannerConfig.codeql.suite javascript-security-extended
141
- kuzushi config set scannerConfig.semgrep.binary opengrep
142
- kuzushi config set scannerConfig.semgrep.configFlag auto
143
- kuzushi config set scannerConfig.agentic.model claude-sonnet-4-20250514
144
- kuzushi config set scannerConfig.agentic.maxFindings 25
349
+ kuzushi config set model anthropic:claude-sonnet-4-6
350
+ kuzushi config set tasks semgrep,agentic
351
+ kuzushi config set taskConfig.codeql.dbPath ./codeql-db
352
+ kuzushi config set taskConfig.codeql.suite javascript-security-extended
353
+ kuzushi config set taskConfig.semgrep.binary opengrep
354
+ kuzushi config set taskConfig.semgrep.configFlag auto
355
+ kuzushi config set taskConfig.agentic.model anthropic:claude-sonnet-4-6
356
+ kuzushi config set taskConfig.agentic.maxFindings 25
357
+ kuzushi config set taskConfig.triage.model anthropic:claude-opus-4-6
358
+ kuzushi config set taskConfig.verify.model openai:gpt-4o-mini
145
359
  kuzushi config set severity ERROR,WARNING,INFO
146
360
  kuzushi config set verify true
147
361
  kuzushi config set verifyMinConfidence 0.7
148
362
  kuzushi config set auditLog true
363
+ kuzushi config validate --repo . # validate the effective config for this repo
149
364
  kuzushi config unset model # reset to default
150
365
  kuzushi config path # print config file location
151
366
  ```
152
367
 
153
368
  Global config lives at `~/.kuzushi/config.json`. Optional project overrides can live at `<repo>/.kuzushi/config.json`. CLI flags override config values.
154
369
 
370
+ **Repo-local config sandboxing:** By default, project-level config files (`<repo>/.kuzushi/config.json`) are sandboxed — keys that could execute code or reach external systems (e.g., `hooks`, `externalTasks`, `pocExecute`, scanner binary paths) are silently stripped. This prevents a cloned repo from altering your runtime behavior. Pass `--trust-repo-config` to opt in to the full project config when you trust the repository.
371
+
155
372
  Security note: `agentRuntimeConfig.apiKey` is stored in plaintext in config files. Prefer `--api-key` for one-off runs or `ANTHROPIC_API_KEY` from your shell/secret manager.
156
373
 
157
- ## Configuration
374
+ </details>
375
+
376
+ <details>
377
+ <summary><strong>Configuration Reference</strong></summary>
158
378
 
159
379
  | Key | Default | Description |
160
380
  | --- | --- | --- |
161
- | `model` | `claude-sonnet-4-20250514` | LLM model for scanners and default triage model |
162
- | `triageModel` | _(uses `model`)_ | Override model used by the triage agent |
163
- | `triageMaxTurns` | `10` | Max agentic turns per triage call |
164
- | `scanners` | `["semgrep"]` | Scanner plugins to run, in order |
381
+ | `model` | `anthropic:claude-sonnet-4-6` | Default LLM model for all tasks and stages |
382
+ | `tasks` | `["semgrep"]` | Enabled task IDs, in execution order |
383
+ | `taskConfig` | `{ semgrep: {...}, triage: {...}, ... }` | Per-task config blocks keyed by task ID or stage ID (see below) |
165
384
  | `severity` | `["ERROR","WARNING"]` | Semgrep severity filter |
166
385
  | `excludePatterns` | `["test","tests","node_modules",...]` | Directories/globs to skip |
167
- | `scannerConfig` | `{ semgrep: {...}, agentic: {...}, codeql: {...} }` | Per-scanner config blocks keyed by scanner id |
168
- | `busBackend` | `"in-process"` | Message bus transport (`in-process`, future: `redis`, `google-pubsub`, `nats`) |
169
- | `triageConcurrency` | `1` | Parallel LLM triage calls |
170
- | `scanMode` | `"sequential"` | Scanner execution mode (`sequential` or `concurrent`) |
171
- | `enabledTasks` | `[]` | Additional agent tasks beyond scanners |
172
- | `agentRuntimeBackend` | `"claude-sdk"` | Agent runtime backend (`claude-sdk`, `pi-ai`, future: `acp`) |
386
+ | `busBackend` | `"in-process"` | Message bus transport (`in-process`) |
387
+ | `triageConcurrency` | `5` | Parallel LLM triage calls |
388
+ | `scanMode` | `"concurrent"` | Task execution mode (`sequential` or `concurrent`) |
389
+ | `agentRuntimeBackend` | `"pi-ai"` | Agent runtime backend (`pi-ai`) |
173
390
  | `verify` | `false` | Enable proof-of-exploitability verification |
174
- | `verifyModel` | _(uses `triageModel` or `model`)_ | Override model for verification agent |
175
391
  | `verifyMaxTurns` | `15` | Max turns for verification agent |
176
- | `verifyConcurrency` | `1` | Parallel verification calls |
392
+ | `verifyConcurrency` | `3` | Parallel verification calls |
177
393
  | `verifyVerdicts` | `["tp"]` | Which triage verdicts to verify |
178
394
  | `verifyMinConfidence` | `0` | Minimum triage confidence to trigger verification (0-1) |
179
395
  | `pocHarness` | `false` | Enable post-verification PoC harness generation (requires `--verify`) |
180
- | `pocHarnessModel` | _(uses `triageModel` or `model`)_ | Override model for PoC harness agent |
181
396
  | `pocHarnessMaxTurns` | `20` | Max turns for PoC harness agent |
182
- | `pocHarnessConcurrency` | `1` | Parallel PoC harness generation calls |
397
+ | `pocHarnessConcurrency` | `2` | Parallel PoC harness generation calls |
398
+ | `cryptoBehavioralTestEnabled` | `false` | Enable crypto behavioral testing for crypto misuse findings |
399
+ | `cryptoBehavioralMaxFindings` | `10` | Max findings to generate behavioral tests for per run |
400
+ | `cryptoBehavioralTimeoutMs` | `120000` | Execution timeout per harness in ms |
401
+ | `cryptoBehavioralPerFindingBudgetUsd` | `1` | Cost budget per finding for harness generation |
402
+ | `codeGraphEnabled` | `true` | Enable LLM-powered code graph construction and enrichment |
403
+
404
+ **Stage model overrides** — set per-stage models via `taskConfig` instead of top-level fields:
405
+
406
+ | `taskConfig` key | Fallback chain | Purpose |
407
+ | --- | --- | --- |
408
+ | `taskConfig.triage.model` | `model` | Model for triage agents |
409
+ | `taskConfig.verify.model` | `model` | Model for verification agents |
410
+ | `taskConfig.poc-harness.model` | `taskConfig.verify.model` → `model` | Model for PoC harness generation |
411
+ | `multiStrategyMode` | `"off"` | Multi-strategy analysis mode (`off`, `adaptive`, `full`) |
412
+ | `multiStrategyBudgetUsd` | `2.0` | Per-finding budget across all strategies (USD) |
413
+ | `autoPatchEnabled` | `false` | Enable automatic patch generation in pipeline |
414
+ | `autoPatchAfter` | `"verify"` | Trigger threshold for auto-patch (`verify`, `poc`, `triage`) |
415
+ | `patchVerifyDepth` | `"task"` | Re-verification depth after patching (`task`, `triage`, `full`) |
416
+ | `patchConcurrency` | `2` | Max concurrent patch synthesis tasks |
417
+ | `incrementalCache` | `true` | Enable incremental scanning (skip unchanged findings across runs) |
418
+ | `incrementalDepTracking` | `true` | Include importers of changed files in rescan scope |
419
+ | `streamingEnabled` | `false` | Enable SSE streaming server for live pipeline events |
420
+ | `streamingPort` | `0` (auto) | Port for the SSE streaming server |
183
421
  | `enableContextGathering` | `true` | Run repo context analysis before triage |
184
422
  | `auditLog` | `false` | Write agent activity to JSONL audit files |
185
423
  | `reportOutput` | _(unset)_ | Write markdown report output to this path |
186
424
  | `sarifOutput` | _(unset)_ | Write SARIF v2.1.0 output to this path |
425
+ | `jsonOutput` | _(unset)_ | Write JSON report to this path |
426
+ | `csvOutput` | _(unset)_ | Write CSV report to this path |
427
+ | `jsonlOutput` | _(unset)_ | Write JSONL report to this path |
187
428
  | `maxTriageRetries` | `2` | Retry failed triage calls |
188
429
  | `maxVerifyRetries` | `2` | Retry failed verification calls |
189
430
  | `maxPocHarnessRetries` | `2` | Retry failed PoC harness generation calls |
190
431
  | `retryBackoffMs` | `5000` | Initial retry backoff delay in ms |
191
432
  | `retryBackoffMultiplier` | `2` | Exponential backoff multiplier |
192
433
 
193
- Example:
434
+ Example config:
194
435
 
195
436
  ```json
196
437
  {
197
- "scanners": ["semgrep", "codeql", "agentic"],
438
+ "tasks": ["semgrep", "codeql", "context-gatherer", "context-enricher", "secrets-crypto-detect", "code-config-detect", "taint-cwe-select", "taint-iris"],
198
439
  "scanMode": "concurrent",
199
440
  "triageConcurrency": 3,
200
441
  "verify": true,
201
442
  "verifyMinConfidence": 0.7,
202
443
  "auditLog": true,
203
- "enabledTasks": [],
204
- "scannerConfig": {
444
+ "taskConfig": {
205
445
  "codeql": { "dbPath": "./codeql-db", "suite": "javascript-security-extended" },
206
446
  "semgrep": { "binary": "opengrep", "configFlag": "auto" },
207
- "agentic": { "model": "claude-sonnet-4-20250514", "maxFindings": 20 }
447
+ "agentic": { "model": "anthropic:claude-sonnet-4-6", "maxFindings": 20 },
448
+ "triage": { "model": "anthropic:claude-opus-4-6" },
449
+ "verify": { "model": "openai:gpt-4o-mini" }
208
450
  }
209
451
  }
210
452
  ```
@@ -213,29 +455,14 @@ Example:
213
455
 
214
456
  | Variable | Required | Description |
215
457
  | --- | --- | --- |
216
- | `ANTHROPIC_API_KEY` | Yes (claude-sdk backend) | Anthropic API key required when `agentRuntimeBackend` is `claude-sdk` |
458
+ | `ANTHROPIC_API_KEY` | When using `anthropic:*` models | Anthropic API key for pi-ai backend |
217
459
  | `OPENAI_API_KEY` | When using `openai:*` models | OpenAI API key for pi-ai backend |
218
460
  | `GEMINI_API_KEY` / `GOOGLE_API_KEY` | When using `google:*` models | Google API key for pi-ai backend |
219
461
 
220
- ## Scanner Plugins
221
-
222
- - `semgrep`: traditional SAST via Opengrep/Semgrep binary
223
- - `codeql`: semantic dataflow/taint analysis via GitHub CodeQL CLI (SARIF output)
224
- - `agentic`: AI-driven agentic scanner — LLM with read-only repo tools via any supported runtime
225
- - `augur`: multi-pass CodeQL source/sink labeling pipeline — runs preflight (database creation, candidate extraction), LLM-assisted labeling with human-in-the-loop checkpoint, and deterministic library/query generation + analysis
226
-
227
- ## Semgrep Resolution
462
+ </details>
228
463
 
229
- For the `semgrep` plugin, Kuzushi finds a scanner binary in this order:
230
-
231
- 1. `opengrep` on your PATH
232
- 2. `semgrep` on your PATH
233
- 3. Previously downloaded binary at `~/.kuzushi/bin/opengrep`
234
- 4. Auto-downloads Opengrep from GitHub releases (~40 MB, cached for future runs)
235
-
236
- No pip, no brew, no manual install needed.
237
-
238
- ## CodeQL Setup
464
+ <details>
465
+ <summary><strong>CodeQL Setup</strong></summary>
239
466
 
240
467
  The `codeql` scanner requires the [CodeQL CLI](https://github.com/github/codeql-cli-binaries/releases) to be installed separately. Unlike Semgrep, it is **not auto-downloaded** (the CLI is ~500 MB and requires accepting GitHub's license).
241
468
 
@@ -269,142 +496,155 @@ CodeQL builds a database from your source code before running queries. You can s
269
496
  kuzushi config set scannerConfig.codeql.dbPath ./codeql-db
270
497
  ```
271
498
 
272
- ## Pi-AI Runtime
273
-
274
- The `pi-ai` backend uses `@mariozechner/pi-ai` to provide vendor-agnostic LLM access. It supports 15+ providers (Anthropic, OpenAI, Google, Groq, Mistral, etc.) through a single interface.
499
+ </details>
275
500
 
276
- Unlike the Claude SDK backend (which has a built-in agentic loop), the pi-ai backend implements its own:
501
+ <details>
502
+ <summary><strong>Taint Analysis Setup</strong></summary>
277
503
 
278
- 1. **Tool-calling loop** call model, parse tool calls, execute tools, feed results back, repeat until stop or max turns
279
- 2. **Local tool implementations** — Read (file reader with line numbers), Glob (Node 22+ `globSync`), Grep (regex search across files)
280
- 3. **Structured output** — system prompt injection + post-hoc JSON extraction from fenced code blocks or raw text
281
- 4. **Safety controls** — max turns, budget enforcement, abort signal, permission gating via `canUseTool`
282
-
283
- ```sh
284
- # Use with any supported provider:
285
- OPENAI_API_KEY=... kuzushi <repo> --agent-runtime pi-ai --model openai:gpt-4o
286
- GEMINI_API_KEY=... kuzushi <repo> --agent-runtime pi-ai --model google:gemini-2.0-flash
287
- ANTHROPIC_API_KEY=... kuzushi <repo> --agent-runtime pi-ai --model anthropic:claude-sonnet-4-20250514
288
- ```
289
-
290
- ## Augur Setup
291
-
292
- The `augur` scanner is a multi-pass CodeQL-based pipeline that uses LLM-assisted classification to label sources, sinks, sanitizers, and summaries. It requires:
504
+ The `taint-analysis` scanner is a multi-pass CodeQL-based pipeline that uses LLM-assisted classification to label sources, sinks, sanitizers, and summaries. It requires:
293
505
 
294
506
  1. **CodeQL CLI** — same requirement as the `codeql` scanner
295
- 2. **Python 3** — used by Augur's scripts for query generation
507
+ 2. **Python 3** — used by taint analysis scripts for query generation
296
508
 
297
- Augur's templates, references, and scripts are bundled as the [`@kuzushi/augur`](https://www.npmjs.com/package/@kuzushi/augur) npm package and installed automatically with `pnpm install`. No manual clone or `AUGUR_PATH` setup needed.
509
+ Taint analysis templates, references, and scripts are bundled as the [`@kuzushi/augur`](https://www.npmjs.com/package/@kuzushi/augur) npm package and installed automatically with `pnpm install`. No manual clone or `TAINT_ANALYSIS_PATH` setup needed.
298
510
 
299
511
  ```sh
300
- kuzushi <repo> --scanners augur
301
- kuzushi <repo> --scanners augur --approve-checkpoint # auto-approve label review
302
- kuzushi config set scannerConfig.augur.labelingModel claude-sonnet-4-20250514
303
- kuzushi config set scannerConfig.augur.passes "[1,2,3,4,5,6]"
512
+ kuzushi <repo> --scanners taint-analysis
513
+ kuzushi config set scannerConfig["taint-analysis"].labelingModel anthropic:claude-sonnet-4-6
514
+ kuzushi config set scannerConfig["taint-analysis"].passes "[1,2,3,4,5,6]"
304
515
  ```
305
516
 
306
- To override the bundled augur assets (e.g., for local development), set `AUGUR_PATH` or `scannerConfig.augur.augurPath`:
517
+ To override the bundled taint-analysis assets (e.g., for local development), set `TAINT_ANALYSIS_PATH` or `scannerConfig["taint-analysis"].taintAnalysisPath`:
307
518
 
308
519
  ```sh
309
- export AUGUR_PATH=/path/to/local/augur
310
- kuzushi config set scannerConfig.augur.augurPath /path/to/local/augur
520
+ export TAINT_ANALYSIS_PATH=/path/to/local/taint-analysis
521
+ kuzushi config set scannerConfig["taint-analysis"].taintAnalysisPath /path/to/local/taint-analysis
311
522
  ```
312
523
 
313
- Augur runs in three DAG-ordered stages: **preflight** (database creation, candidate extraction), **label** (LLM classification with checkpoint gate), and **analyze** (library generation, query execution, finding extraction). A human-in-the-loop checkpoint pauses after labeling for review — use `--approve-checkpoint` to auto-approve in CI.
524
+ Taint analysis runs in three DAG-ordered stages: **preflight** (database creation, candidate extraction), **label** (LLM classification), and **analyze** (library generation, query execution, finding extraction).
314
525
 
315
- ## Output
526
+ ### Taint Analysis TI + Artifact Outputs
316
527
 
317
- Results are stored in SQLite at `<repo>/.kuzushi/findings.sqlite3`. Each finding includes:
528
+ Each taint analysis run emits interoperability artifacts under the workspace (`scannerConfig["taint-analysis"].workspaceDir`, default `./iris`) and run directory:
318
529
 
319
- - **verdict**: `tp` (true positive), `fp` (false positive), or `needs_review`
320
- - **confidence**: 0.0-1.0
321
- - **rationale**: why the LLM reached that verdict, referencing specific code
322
- - **verification_steps**: 2-6 steps a human reviewer can follow
323
- - **fix_patch**: suggested fix (when applicable)
324
- - **exploitability** (with `--verify`): whether a concrete exploit was constructed, PoC payload, attack vector, and preconditions
325
- - **cost**: per-finding triage and verification cost in USD
530
+ - `iris/exploration/TI_PRIOR.md` and `iris/exploration/ti_prior.json` — live TI prior (CISA KEV + NVD) with degraded-mode metadata when fetches fail
531
+ - `iris/labels/TAINT_MODEL.json` — per-CWE taint model (`sources/sinks/sanitizers/propagators`) with TI-weighted basis
532
+ - `iris/results/findings.raw.json` normalized raw findings aggregate from taint analysis pass SARIF outputs
533
+ - `.kuzushi/runs/<runId>/findings.triaged.json` triaged findings export including optional taint analysis source/sink triage details
326
534
 
327
- The terminal report shows true positives first, then needs-review items. False positives are counted but hidden. Verified exploitable findings are highlighted with their PoC payloads.
535
+ Relevant `scannerConfig["taint-analysis"]` options:
328
536
 
329
- Use `--output report.md` to export a shareable markdown report.
330
- Use `--sarif results.sarif` to export SARIF v2.1.0 for code scanning platforms.
537
+ - `tiMode`: `"live-required"` (default)
538
+ - `tiFailurePolicy`: `"continue_without_ti"` (default)
539
+ - `tiTimeoutMs`: live TI fetch timeout in milliseconds
540
+ - `refinementEnabled`: enable one post-triage refinement loop (default `false`)
541
+ - `refinementIterations`: max refinement passes when enabled (default `1`)
542
+ - `refinementDeltaOnly`: triage only changed findings after refinement (default `true`)
543
+ - `refinementModel`: optional model override for refinement stage wiring
331
544
 
332
- ## SARIF / GitHub Code Scanning
545
+ </details>
333
546
 
334
- Kuzushi can emit SARIF v2.1.0 directly. GitHub Code Scanning ingests SARIF and creates inline annotations.
547
+ <details>
548
+ <summary><strong>Agent Runtime Backends</strong></summary>
335
549
 
336
- ```
337
- kuzushi <repo> --sarif results.sarif
550
+ Kuzushi supports two agent runtime backends:
338
551
 
339
- gh api \
340
- -X POST \
341
- repos/OWNER/REPO/code-scanning/sarifs \
342
- -f commit_sha="$(git rev-parse HEAD)" \
343
- -f ref="refs/heads/$(git rev-parse --abbrev-ref HEAD)" \
344
- -f sarif="$(gzip -c results.sarif | base64 | tr -d '\n')"
345
- ```
552
+ **Claude (default)** — Uses `@anthropic-ai/claude-agent-sdk` to spawn Claude Code subprocesses with built-in tool implementations (Read, Glob, Grep, Bash, etc.). Supports session reuse: batch operations keep a single subprocess alive across multiple turns via the SDK's streaming input API, reducing subprocess spawns by ~99%. Requires `ANTHROPIC_API_KEY`.
346
553
 
347
- ## Resume Support
554
+ **Pi-AI** Uses `@mariozechner/pi-ai` to provide vendor-agnostic LLM access. It supports 15+ providers (Anthropic, OpenAI, Google, Groq, Mistral, etc.) through a single interface. All LLM calls run in-process (no subprocesses).
348
555
 
349
- Kuzushi fingerprints every finding (content-based SHA-256 that survives line shifts). Re-running a scan skips already-triaged findings automatically. Use `--fresh` to start over.
556
+ Kuzushi implements an internal agentic loop on top of pi-ai:
350
557
 
351
- For interrupted runs, use `--resume` to pick up where the pipeline left off. Kuzushi checkpoints pipeline state (scan findings, triage progress, verification progress) to SQLite. On resume, completed phases are skipped and only remaining work is executed.
558
+ 1. **Tool-calling loop** call model, parse tool calls, execute tools, feed results back, repeat until stop or max turns
559
+ 2. **Local tool implementations** — Read (file reader with line numbers), Glob (Node 22+ `globSync`), Grep (regex search across files)
560
+ 3. **Structured output** — system prompt injection + post-hoc JSON extraction from fenced code blocks or raw text
561
+ 4. **Safety controls** — max turns, budget enforcement, abort signal, permission gating via `canUseTool`
352
562
 
353
- ```
354
- kuzushi <repo> --resume # resume most recent interrupted run
355
- kuzushi <repo> --resume abc-123 # resume a specific run by ID
563
+ ```sh
564
+ # Use with any supported provider:
565
+ OPENAI_API_KEY=... kuzushi <repo> --model openai:gpt-4o
566
+ GEMINI_API_KEY=... kuzushi <repo> --model google:gemini-2.0-flash
567
+ ANTHROPIC_API_KEY=... kuzushi <repo> --model anthropic:claude-sonnet-4-6
356
568
  ```
357
569
 
358
- ## Audit Logging
570
+ </details>
359
571
 
360
- With `--audit-log`, Kuzushi writes a structured audit trail to `.kuzushi/runs/{runId}/`:
572
+ <details>
573
+ <summary><strong>Architecture</strong></summary>
361
574
 
362
- - `triage.jsonl` every tool call, reasoning step, and verdict from triage agents
363
- - `verify.jsonl` — same for verification agents
364
- - `run.json` — run config and scan options
365
- - `stats.json` — final pipeline statistics
575
+ Kuzushi is built on three core abstractions:
366
576
 
367
- Use this to debug verdicts, review agent reasoning, or build compliance records.
577
+ **Message Bus** A transport-agnostic `MessageBus` interface (`publish`, `subscribe`, `waitFor`) that decouples pipeline stages. The stable build supports the in-process `EventEmitter` transport today.
368
578
 
369
- ## Architecture
579
+ **AgentTask + DAG** — Every unit of work (context gatherer, scanner, future threat modeler, etc.) implements the `AgentTask` interface: an `id`, `dependsOn` list, `outputKind`, and a `run()` method. The `TaskRegistry` resolves enabled tasks into a DAG, groups them into parallel stages, detects cycles, and hands execution to the `PipelineOrchestrator`. Upstream task outputs are forwarded to dependents automatically.
370
580
 
371
- Kuzushi is built on three core abstractions:
581
+ **Pipeline Phases** After the DAG completes, the orchestrator drives sequential phases: triage (classify findings), verification (construct PoC exploits), patch synthesis (auto-generate and re-verify fixes), and report (display results + optional SSE streaming). Each phase has its own concurrency control, cost tracking, and checkpoint support.
372
582
 
373
- **Message Bus** — A transport-agnostic `MessageBus` interface (`publish`, `subscribe`, `waitFor`) that decouples pipeline stages. The default in-process implementation uses an `EventEmitter`; the interface supports swapping in Redis, Google Pub/Sub, or NATS for distributed setups.
583
+ **Strategy Framework** — The multi-strategy system wraps detection tasks with multiple analytical approaches (syntactic, dataflow, reasoning, execution) that run in parallel or adaptively, merging results with corroboration-based confidence boosting.
374
584
 
375
- **AgentTask + DAG** — Every unit of work (context gatherer, scanner, future threat modeler, etc.) implements the `AgentTask` interface: an `id`, `dependsOn` list, `outputKind`, and a `run()` method. The `TaskRegistry` resolves enabled tasks into a DAG, groups them into parallel stages, detects cycles, and hands execution to the `PipelineOrchestrator`. Upstream task outputs are forwarded to dependents automatically.
585
+ **Code Graph** — A persistent SQLite-backed graph of code paths from entry points to sinks, built from static import analysis and LLM-assisted tracing. Injected into triage prompts for deeper reasoning about reachability and sanitization.
376
586
 
377
- **Pipeline Phases** — After the DAG completes, the orchestrator drives three sequential phases: triage (classify findings), verification (construct PoC exploits), and report (display results). Each phase has its own concurrency control, cost tracking, and checkpoint support.
587
+ **Session Reuse** — The Claude runtime uses the Agent SDK's `AsyncIterable<SDKUserMessage>` prompt to keep a single subprocess alive across multiple turns. Batch operations (taint labeling, triage, verification, rescoring, PoC generation, patch synthesis) write per-batch data to `.kuzushi/batches/` files and send the subprocess a prompt to `Read` each file. This reduces worst-case subprocess spawns from ~3,100 to ~24 per pipeline run. Runtimes without `createSession` support (pi-ai) fall back to one subprocess per call automatically.
378
588
 
379
589
  Existing `ScannerPlugin` implementations (Semgrep, Agentic) are adapted into `AgentTask` via `adaptScannerPlugin()`, so the scanner plugin API remains stable.
380
590
 
381
591
  See [AGENTS.md](AGENTS.md) for the full developer guide on adding new agent tasks.
382
592
 
593
+ ### Package Surface
594
+
595
+ Kuzushi is published as a CLI-first package. The supported npm surface is the executable plus the root package export; internal modules under `dist/*` and `src/*` are not a stable API contract and may change between releases.
596
+
597
+ Release builds are expected to come from a clean compile into `dist/`. `pnpm build` now cleans `dist/` first, `prepack` rebuilds automatically, and `pnpm verify:pack` runs `npm pack --dry-run` so stale artifacts do not get published.
598
+
599
+ </details>
600
+
601
+ ## Output
602
+
603
+ Results are stored in SQLite at `<repo>/.kuzushi/findings.sqlite3`. Export to any format:
604
+
605
+ ```sh
606
+ kuzushi <repo> --output report.md # Markdown
607
+ kuzushi <repo> --sarif results.sarif # SARIF v2.1.0 (GitHub Code Scanning compatible)
608
+ kuzushi <repo> --json results.json # JSON
609
+ kuzushi <repo> --csv results.csv # CSV
610
+ kuzushi <repo> --jsonl results.jsonl # JSONL
611
+ ```
612
+
383
613
  ## Development
384
614
 
385
615
  ```
386
616
  pnpm install # install deps
387
617
  pnpm dev -- /path/to/repo # run in dev mode
618
+ pnpm check:types # typecheck app + benchmark tooling
388
619
  pnpm typecheck # type check
389
- pnpm test # run tests (214 tests across 31 files)
620
+ pnpm test # run tests
621
+ pnpm test:e2e # deterministic mock-backed smoke scan against fixture app
390
622
  pnpm test:coverage # tests + coverage (70% threshold)
391
623
  pnpm build # compile to dist/
624
+ pnpm verify:pack # verify published tarball contents
625
+ pnpm benchmark # run benchmark suite against govwa dataset
626
+ pnpm benchmark:freeze # freeze current benchmark results as baseline
627
+ pnpm benchmark:diff # diff current results against frozen baseline
628
+ pnpm benchmark:regression # CI regression check against baseline
392
629
  ```
393
630
 
394
- Tests are organized by subsystem: `tests/bus/` for orchestrator, workers, and event bus tests, `tests/agents/` for DAG, task registry, and context-gatherer tests, and `tests/` for scanners, triage, verification, store, config, retry, and report.
631
+ `pnpm test:e2e` and the benchmark regression workflow use `tests/fixtures/mock-anthropic-server.mjs` for deterministic mock-backed coverage. They are useful smoke/regression checks, but they are not real LLM integration tests.
395
632
 
396
633
  ## Troubleshooting
397
634
 
398
- - **"Error: ANTHROPIC_API_KEY environment variable is required."**: Export your key `export ANTHROPIC_API_KEY=sk-ant-...` (only required for `claude-sdk` backend; use `--agent-runtime pi-ai` with other providers)
635
+ - **"Error: missing API credentials for selected model provider(s)."**: Set the provider env var(s) for your selected models (for example `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, or `GEMINI_API_KEY`)
399
636
  - **"No findings from scanner. Code looks clean."**: Your code is clean, or try `--severity ERROR,WARNING,INFO` to include lower-severity rules
400
637
  - **Scan interrupted**: Re-run the same command (already-triaged findings are skipped), or use `--resume` to continue from the exact checkpoint
401
- - **Wrong model**: `kuzushi config set model claude-opus-4-20250514` or pass `--model` per-scan
638
+ - **Wrong model**: `kuzushi config set model anthropic:claude-sonnet-4-6` or pass `--model` per-scan
402
639
  - **Scanner download fails**: Install Opengrep or Semgrep manually, ensure it's on your PATH
403
- - **High triage cost**: Use `--triage-model claude-haiku-4-5-20251001` for cheaper triage, or `--max 10` to limit findings
404
- - **Verification too expensive**: Use `--verify-min-confidence 0.8` to only verify high-confidence TPs, or `--verify-model claude-haiku-4-5-20251001`
640
+ - **High triage cost**: Use `--triage-model openai:gpt-4o-mini` for cheaper triage, or `--max 10` to limit findings
641
+ - **Verification too expensive**: Use `--verify-min-confidence 0.8` to only verify high-confidence TPs, or `--verify-model openai:gpt-4o-mini`
405
642
  - **pi-ai model not found**: Ensure the model string uses `provider:modelId` format (e.g., `openai:gpt-4o`, not just `gpt-4o`)
406
- - **Augur checkpoint blocks CI**: Pass `--approve-checkpoint` to auto-approve label review in non-interactive environments
643
+
644
+ ## Contributing
645
+
646
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
407
647
 
408
648
  ## License
409
649
 
410
- MIT
650
+ [MIT](LICENSE)