patchi 0.7.5__tar.gz

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 (585) hide show
  1. patchi-0.7.5/LICENSE +60 -0
  2. patchi-0.7.5/PKG-INFO +315 -0
  3. patchi-0.7.5/README.md +254 -0
  4. patchi-0.7.5/patchi/__init__.py +1 -0
  5. patchi-0.7.5/patchi/__main__.py +13 -0
  6. patchi-0.7.5/patchi/cli/__init__.py +0 -0
  7. patchi-0.7.5/patchi/cli/command_families.py +235 -0
  8. patchi-0.7.5/patchi/cli/commands/__init__.py +0 -0
  9. patchi-0.7.5/patchi/cli/commands/access_cmd.py +65 -0
  10. patchi-0.7.5/patchi/cli/commands/agent_stats_cmd.py +273 -0
  11. patchi-0.7.5/patchi/cli/commands/agents_cmd.py +187 -0
  12. patchi-0.7.5/patchi/cli/commands/ai_cmd.py +308 -0
  13. patchi-0.7.5/patchi/cli/commands/assure_cmd.py +538 -0
  14. patchi-0.7.5/patchi/cli/commands/audit_cmd.py +286 -0
  15. patchi-0.7.5/patchi/cli/commands/auto_cmd.py +110 -0
  16. patchi-0.7.5/patchi/cli/commands/blame_cmd.py +53 -0
  17. patchi-0.7.5/patchi/cli/commands/chains_cmd.py +327 -0
  18. patchi-0.7.5/patchi/cli/commands/charter_cmd.py +173 -0
  19. patchi-0.7.5/patchi/cli/commands/chat_cmd.py +597 -0
  20. patchi-0.7.5/patchi/cli/commands/check_cmd.py +232 -0
  21. patchi-0.7.5/patchi/cli/commands/cleanup_cmd.py +328 -0
  22. patchi-0.7.5/patchi/cli/commands/cockpit_cmd.py +208 -0
  23. patchi-0.7.5/patchi/cli/commands/commands_cmd.py +160 -0
  24. patchi-0.7.5/patchi/cli/commands/cross_repo_cmd.py +113 -0
  25. patchi-0.7.5/patchi/cli/commands/deps_cmd.py +110 -0
  26. patchi-0.7.5/patchi/cli/commands/dev_check_cmd.py +342 -0
  27. patchi-0.7.5/patchi/cli/commands/dev_cmd.py +445 -0
  28. patchi-0.7.5/patchi/cli/commands/doctor_cmd.py +457 -0
  29. patchi-0.7.5/patchi/cli/commands/findings_cmd.py +187 -0
  30. patchi-0.7.5/patchi/cli/commands/fix_cmd.py +648 -0
  31. patchi-0.7.5/patchi/cli/commands/fix_review_cmd.py +273 -0
  32. patchi-0.7.5/patchi/cli/commands/heatmap_cmd.py +62 -0
  33. patchi-0.7.5/patchi/cli/commands/help_cmd.py +159 -0
  34. patchi-0.7.5/patchi/cli/commands/hosted_cmd.py +980 -0
  35. patchi-0.7.5/patchi/cli/commands/init.py +456 -0
  36. patchi-0.7.5/patchi/cli/commands/key_cmd.py +571 -0
  37. patchi-0.7.5/patchi/cli/commands/learn_cmd.py +140 -0
  38. patchi-0.7.5/patchi/cli/commands/link_cmd.py +104 -0
  39. patchi-0.7.5/patchi/cli/commands/log_cmd.py +57 -0
  40. patchi-0.7.5/patchi/cli/commands/memory_cmd.py +215 -0
  41. patchi-0.7.5/patchi/cli/commands/model_cmd.py +207 -0
  42. patchi-0.7.5/patchi/cli/commands/notify_cmd.py +213 -0
  43. patchi-0.7.5/patchi/cli/commands/notify_prompts.py +29 -0
  44. patchi-0.7.5/patchi/cli/commands/patch_cmd.py +231 -0
  45. patchi-0.7.5/patchi/cli/commands/plan_cmd.py +128 -0
  46. patchi-0.7.5/patchi/cli/commands/plugins_cmd.py +307 -0
  47. patchi-0.7.5/patchi/cli/commands/queue_cmd.py +152 -0
  48. patchi-0.7.5/patchi/cli/commands/quick_cmd.py +159 -0
  49. patchi-0.7.5/patchi/cli/commands/ready_cmd.py +292 -0
  50. patchi-0.7.5/patchi/cli/commands/report_cmd.py +416 -0
  51. patchi-0.7.5/patchi/cli/commands/restrict_cmd.py +127 -0
  52. patchi-0.7.5/patchi/cli/commands/review_cmd.py +225 -0
  53. patchi-0.7.5/patchi/cli/commands/rules_cmd.py +233 -0
  54. patchi-0.7.5/patchi/cli/commands/scan_cmd.py +1908 -0
  55. patchi-0.7.5/patchi/cli/commands/settings_cmd.py +45 -0
  56. patchi-0.7.5/patchi/cli/commands/status_cmd.py +679 -0
  57. patchi-0.7.5/patchi/cli/commands/test_cmd.py +1052 -0
  58. patchi-0.7.5/patchi/cli/commands/trend_cmd.py +296 -0
  59. patchi-0.7.5/patchi/cli/commands/undo_cmd.py +235 -0
  60. patchi-0.7.5/patchi/cli/commands/update_cmd.py +345 -0
  61. patchi-0.7.5/patchi/cli/commands/verify_cmd.py +56 -0
  62. patchi-0.7.5/patchi/cli/commands/vr_cmd.py +440 -0
  63. patchi-0.7.5/patchi/cli/commands/watch_cmd.py +304 -0
  64. patchi-0.7.5/patchi/cli/commands/web_cmd.py +114 -0
  65. patchi-0.7.5/patchi/cli/console.py +101 -0
  66. patchi-0.7.5/patchi/cli/display/__init__.py +1 -0
  67. patchi-0.7.5/patchi/cli/display/live_audit.py +269 -0
  68. patchi-0.7.5/patchi/cli/display/live_progress.py +169 -0
  69. patchi-0.7.5/patchi/cli/framework.py +241 -0
  70. patchi-0.7.5/patchi/cli/logo.py +128 -0
  71. patchi-0.7.5/patchi/cli/main.py +222 -0
  72. patchi-0.7.5/patchi/cli/registry.py +1171 -0
  73. patchi-0.7.5/patchi/cli/style.py +68 -0
  74. patchi-0.7.5/patchi/cli/themes.py +187 -0
  75. patchi-0.7.5/patchi/cli/ux.py +444 -0
  76. patchi-0.7.5/patchi/core/__init__.py +0 -0
  77. patchi-0.7.5/patchi/core/agents/__init__.py +0 -0
  78. patchi-0.7.5/patchi/core/agents/api_fuzzer_agent.py +141 -0
  79. patchi-0.7.5/patchi/core/agents/attack_agent.py +242 -0
  80. patchi-0.7.5/patchi/core/agents/base.py +1012 -0
  81. patchi-0.7.5/patchi/core/agents/bug_predictor_agent.py +58 -0
  82. patchi-0.7.5/patchi/core/agents/build_tool_validator.py +150 -0
  83. patchi-0.7.5/patchi/core/agents/cache.py +192 -0
  84. patchi-0.7.5/patchi/core/agents/chaos_agent.py +133 -0
  85. patchi-0.7.5/patchi/core/agents/cicd_generator.py +240 -0
  86. patchi-0.7.5/patchi/core/agents/comment_scanner.py +280 -0
  87. patchi-0.7.5/patchi/core/agents/console_logging_agent.py +156 -0
  88. patchi-0.7.5/patchi/core/agents/coordinator.py +858 -0
  89. patchi-0.7.5/patchi/core/agents/core_scanner.py +269 -0
  90. patchi-0.7.5/patchi/core/agents/coverage_prioritizer.py +181 -0
  91. patchi-0.7.5/patchi/core/agents/dead_code_hygiene.py +296 -0
  92. patchi-0.7.5/patchi/core/agents/dead_code_scanner.py +692 -0
  93. patchi-0.7.5/patchi/core/agents/dependency_scanner.py +725 -0
  94. patchi-0.7.5/patchi/core/agents/doc_claim_agent.py +573 -0
  95. patchi-0.7.5/patchi/core/agents/duplicate_scanner.py +568 -0
  96. patchi-0.7.5/patchi/core/agents/env_scanner.py +410 -0
  97. patchi-0.7.5/patchi/core/agents/feature_flag_agent.py +89 -0
  98. patchi-0.7.5/patchi/core/agents/frontend_framework_agent.py +133 -0
  99. patchi-0.7.5/patchi/core/agents/goroutine_agent.py +82 -0
  100. patchi-0.7.5/patchi/core/agents/governor.py +1972 -0
  101. patchi-0.7.5/patchi/core/agents/i18n_agent.py +95 -0
  102. patchi-0.7.5/patchi/core/agents/license_compliance.py +247 -0
  103. patchi-0.7.5/patchi/core/agents/linking_agent.py +251 -0
  104. patchi-0.7.5/patchi/core/agents/memory_profiler_agent.py +102 -0
  105. patchi-0.7.5/patchi/core/agents/modernization_agent.py +84 -0
  106. patchi-0.7.5/patchi/core/agents/mutation_agent.py +174 -0
  107. patchi-0.7.5/patchi/core/agents/nl_query_agent.py +74 -0
  108. patchi-0.7.5/patchi/core/agents/promise_rejection_agent.py +100 -0
  109. patchi-0.7.5/patchi/core/agents/refactoring_agent.py +286 -0
  110. patchi-0.7.5/patchi/core/agents/resource_leak_agent.py +91 -0
  111. patchi-0.7.5/patchi/core/agents/route_graph_scanner.py +951 -0
  112. patchi-0.7.5/patchi/core/agents/run_agent.py +106 -0
  113. patchi-0.7.5/patchi/core/agents/rust_unwrap_agent.py +100 -0
  114. patchi-0.7.5/patchi/core/agents/sbom_generator.py +284 -0
  115. patchi-0.7.5/patchi/core/agents/scanners.py +67 -0
  116. patchi-0.7.5/patchi/core/agents/side/__init__.py +1 -0
  117. patchi-0.7.5/patchi/core/agents/side/build_agent.py +65 -0
  118. patchi-0.7.5/patchi/core/agents/side/format_agent.py +50 -0
  119. patchi-0.7.5/patchi/core/agents/side/install_agent.py +63 -0
  120. patchi-0.7.5/patchi/core/agents/side_file_scanner.py +549 -0
  121. patchi-0.7.5/patchi/core/agents/snapshot_drift_detector.py +146 -0
  122. patchi-0.7.5/patchi/core/agents/spa_route_inventory.py +203 -0
  123. patchi-0.7.5/patchi/core/agents/test_scanner.py +442 -0
  124. patchi-0.7.5/patchi/core/agents/tool_health.py +109 -0
  125. patchi-0.7.5/patchi/core/agents/tool_runner.py +162 -0
  126. patchi-0.7.5/patchi/core/agents/type_scanner.py +168 -0
  127. patchi-0.7.5/patchi/core/agents/ui_scanner.py +558 -0
  128. patchi-0.7.5/patchi/core/ai/__init__.py +20 -0
  129. patchi-0.7.5/patchi/core/ai/agent_audit.py +153 -0
  130. patchi-0.7.5/patchi/core/ai/agent_profiler.py +277 -0
  131. patchi-0.7.5/patchi/core/ai/client.py +499 -0
  132. patchi-0.7.5/patchi/core/ai/cost_tracker.py +107 -0
  133. patchi-0.7.5/patchi/core/ai/model_router.py +318 -0
  134. patchi-0.7.5/patchi/core/ai/orchestrator.py +625 -0
  135. patchi-0.7.5/patchi/core/ai/prompts.py +681 -0
  136. patchi-0.7.5/patchi/core/ai/smart.py +302 -0
  137. patchi-0.7.5/patchi/core/ai/tool_executor.py +24 -0
  138. patchi-0.7.5/patchi/core/ai/tools/__init__.py +10 -0
  139. patchi-0.7.5/patchi/core/ai/tools/executor.py +621 -0
  140. patchi-0.7.5/patchi/core/ai/tools/realize.py +1160 -0
  141. patchi-0.7.5/patchi/core/ai/tools/registry.py +1577 -0
  142. patchi-0.7.5/patchi/core/assurance/__init__.py +33 -0
  143. patchi-0.7.5/patchi/core/assurance/builder.py +211 -0
  144. patchi-0.7.5/patchi/core/assurance/graph.py +342 -0
  145. patchi-0.7.5/patchi/core/assurance/invariants.py +168 -0
  146. patchi-0.7.5/patchi/core/atomic.py +61 -0
  147. patchi-0.7.5/patchi/core/attackers/__init__.py +17 -0
  148. patchi-0.7.5/patchi/core/attackers/api_abuse.py +89 -0
  149. patchi-0.7.5/patchi/core/attackers/auth_bypass.py +73 -0
  150. patchi-0.7.5/patchi/core/attackers/base.py +91 -0
  151. patchi-0.7.5/patchi/core/attackers/business_logic.py +88 -0
  152. patchi-0.7.5/patchi/core/attackers/planner.py +108 -0
  153. patchi-0.7.5/patchi/core/attackers/priv_escalation.py +88 -0
  154. patchi-0.7.5/patchi/core/attackers/recon.py +87 -0
  155. patchi-0.7.5/patchi/core/brain/__init__.py +0 -0
  156. patchi-0.7.5/patchi/core/brain/ast_utils/__init__.py +81 -0
  157. patchi-0.7.5/patchi/core/brain/ast_utils/assignments.py +219 -0
  158. patchi-0.7.5/patchi/core/brain/ast_utils/calls.py +139 -0
  159. patchi-0.7.5/patchi/core/brain/ast_utils/config.py +132 -0
  160. patchi-0.7.5/patchi/core/brain/ast_utils/control_flow.py +74 -0
  161. patchi-0.7.5/patchi/core/brain/ast_utils/dead_symbols.py +205 -0
  162. patchi-0.7.5/patchi/core/brain/ast_utils/decorators.py +108 -0
  163. patchi-0.7.5/patchi/core/brain/ast_utils/helpers.py +144 -0
  164. patchi-0.7.5/patchi/core/brain/ast_utils/imports.py +169 -0
  165. patchi-0.7.5/patchi/core/brain/ast_utils/scan.py +143 -0
  166. patchi-0.7.5/patchi/core/brain/ast_utils/taint.py +310 -0
  167. patchi-0.7.5/patchi/core/brain/audit.py +379 -0
  168. patchi-0.7.5/patchi/core/brain/baseline.py +195 -0
  169. patchi-0.7.5/patchi/core/brain/blast_radius.py +312 -0
  170. patchi-0.7.5/patchi/core/brain/body_tags.py +144 -0
  171. patchi-0.7.5/patchi/core/brain/brain.py +1161 -0
  172. patchi-0.7.5/patchi/core/brain/brain_context.py +393 -0
  173. patchi-0.7.5/patchi/core/brain/brain_watcher.py +340 -0
  174. patchi-0.7.5/patchi/core/brain/charter.py +473 -0
  175. patchi-0.7.5/patchi/core/brain/classifier.py +214 -0
  176. patchi-0.7.5/patchi/core/brain/cockpit.py +350 -0
  177. patchi-0.7.5/patchi/core/brain/code_query.py +710 -0
  178. patchi-0.7.5/patchi/core/brain/contract.py +889 -0
  179. patchi-0.7.5/patchi/core/brain/contract_diff.py +155 -0
  180. patchi-0.7.5/patchi/core/brain/council.py +800 -0
  181. patchi-0.7.5/patchi/core/brain/cross_repo.py +104 -0
  182. patchi-0.7.5/patchi/core/brain/dead_code_tools.py +157 -0
  183. patchi-0.7.5/patchi/core/brain/doc_validator.py +197 -0
  184. patchi-0.7.5/patchi/core/brain/domain_activator.py +2183 -0
  185. patchi-0.7.5/patchi/core/brain/enriched_context.py +220 -0
  186. patchi-0.7.5/patchi/core/brain/file_corpus.py +220 -0
  187. patchi-0.7.5/patchi/core/brain/framework.py +953 -0
  188. patchi-0.7.5/patchi/core/brain/freshness.py +273 -0
  189. patchi-0.7.5/patchi/core/brain/git_aware.py +206 -0
  190. patchi-0.7.5/patchi/core/brain/heatmap.py +104 -0
  191. patchi-0.7.5/patchi/core/brain/ignore_parser.py +153 -0
  192. patchi-0.7.5/patchi/core/brain/import_graph.py +486 -0
  193. patchi-0.7.5/patchi/core/brain/languages.py +397 -0
  194. patchi-0.7.5/patchi/core/brain/layered_brain.py +419 -0
  195. patchi-0.7.5/patchi/core/brain/learning.py +229 -0
  196. patchi-0.7.5/patchi/core/brain/orphaned_endpoints.py +313 -0
  197. patchi-0.7.5/patchi/core/brain/personas/__init__.py +648 -0
  198. patchi-0.7.5/patchi/core/brain/personas/bad_user.py +165 -0
  199. patchi-0.7.5/patchi/core/brain/personas/base.py +349 -0
  200. patchi-0.7.5/patchi/core/brain/proactive.py +807 -0
  201. patchi-0.7.5/patchi/core/brain/project_context.py +121 -0
  202. patchi-0.7.5/patchi/core/brain/project_reader.py +521 -0
  203. patchi-0.7.5/patchi/core/brain/reasoning.py +269 -0
  204. patchi-0.7.5/patchi/core/brain/route_detector/__init__.py +15 -0
  205. patchi-0.7.5/patchi/core/brain/route_detector/base.py +31 -0
  206. patchi-0.7.5/patchi/core/brain/route_detector/csharp.py +209 -0
  207. patchi-0.7.5/patchi/core/brain/route_detector/file_based.py +81 -0
  208. patchi-0.7.5/patchi/core/brain/route_detector/go.py +152 -0
  209. patchi-0.7.5/patchi/core/brain/route_detector/java.py +195 -0
  210. patchi-0.7.5/patchi/core/brain/route_detector/javascript.py +197 -0
  211. patchi-0.7.5/patchi/core/brain/route_detector/php.py +158 -0
  212. patchi-0.7.5/patchi/core/brain/route_detector/python.py +193 -0
  213. patchi-0.7.5/patchi/core/brain/route_detector/registry.py +25 -0
  214. patchi-0.7.5/patchi/core/brain/route_detector/ruby.py +134 -0
  215. patchi-0.7.5/patchi/core/brain/route_detector/rust.py +216 -0
  216. patchi-0.7.5/patchi/core/brain/route_detector/swift.py +118 -0
  217. patchi-0.7.5/patchi/core/brain/route_mapper.py +265 -0
  218. patchi-0.7.5/patchi/core/brain/scanner.py +2136 -0
  219. patchi-0.7.5/patchi/core/brain/secrets.py +280 -0
  220. patchi-0.7.5/patchi/core/brain/symbol_graph.py +1955 -0
  221. patchi-0.7.5/patchi/core/brain/team.py +28 -0
  222. patchi-0.7.5/patchi/core/brain/trace_log.py +132 -0
  223. patchi-0.7.5/patchi/core/brain/type_checker/__init__.py +65 -0
  224. patchi-0.7.5/patchi/core/brain/type_checker/base.py +60 -0
  225. patchi-0.7.5/patchi/core/brain/type_checker/csharp.py +59 -0
  226. patchi-0.7.5/patchi/core/brain/type_checker/dart.py +59 -0
  227. patchi-0.7.5/patchi/core/brain/type_checker/go.py +81 -0
  228. patchi-0.7.5/patchi/core/brain/type_checker/java.py +75 -0
  229. patchi-0.7.5/patchi/core/brain/type_checker/kotlin.py +75 -0
  230. patchi-0.7.5/patchi/core/brain/type_checker/php.py +88 -0
  231. patchi-0.7.5/patchi/core/brain/type_checker/python.py +87 -0
  232. patchi-0.7.5/patchi/core/brain/type_checker/rust.py +81 -0
  233. patchi-0.7.5/patchi/core/brain/type_checker/swift.py +59 -0
  234. patchi-0.7.5/patchi/core/brain/type_checker/typescript.py +298 -0
  235. patchi-0.7.5/patchi/core/brain/understander.py +130 -0
  236. patchi-0.7.5/patchi/core/brain/verify.py +379 -0
  237. patchi-0.7.5/patchi/core/campaigns/__init__.py +14 -0
  238. patchi-0.7.5/patchi/core/campaigns/base.py +62 -0
  239. patchi-0.7.5/patchi/core/campaigns/data_flow_abuse.py +153 -0
  240. patchi-0.7.5/patchi/core/campaigns/orchestrator.py +140 -0
  241. patchi-0.7.5/patchi/core/campaigns/state_transitions.py +178 -0
  242. patchi-0.7.5/patchi/core/ci_bundle.py +104 -0
  243. patchi-0.7.5/patchi/core/config.py +311 -0
  244. patchi-0.7.5/patchi/core/constants.py +245 -0
  245. patchi-0.7.5/patchi/core/debug/__init__.py +25 -0
  246. patchi-0.7.5/patchi/core/debug/adapters/__init__.py +11 -0
  247. patchi-0.7.5/patchi/core/debug/adapters/codelldb.py +379 -0
  248. patchi-0.7.5/patchi/core/debug/adapters/node.py +222 -0
  249. patchi-0.7.5/patchi/core/debug/adapters/powershell.py +210 -0
  250. patchi-0.7.5/patchi/core/debug/adapters/python.py +244 -0
  251. patchi-0.7.5/patchi/core/debug/capture.py +210 -0
  252. patchi-0.7.5/patchi/core/debug/dap_client.py +268 -0
  253. patchi-0.7.5/patchi/core/detector/__init__.py +0 -0
  254. patchi-0.7.5/patchi/core/detector/audit.py +194 -0
  255. patchi-0.7.5/patchi/core/detector/bus.py +226 -0
  256. patchi-0.7.5/patchi/core/detector/dispatcher.py +275 -0
  257. patchi-0.7.5/patchi/core/detector/event.py +254 -0
  258. patchi-0.7.5/patchi/core/detector/sigma_engine.py +378 -0
  259. patchi-0.7.5/patchi/core/detector/triage.py +289 -0
  260. patchi-0.7.5/patchi/core/export/sarif.py +113 -0
  261. patchi-0.7.5/patchi/core/fix/__init__.py +17 -0
  262. patchi-0.7.5/patchi/core/fix/applier.py +574 -0
  263. patchi-0.7.5/patchi/core/fix/base.py +510 -0
  264. patchi-0.7.5/patchi/core/fix/code_fixer.py +169 -0
  265. patchi-0.7.5/patchi/core/fix/dead_code_remover.py +131 -0
  266. patchi-0.7.5/patchi/core/fix/fix_agents.py +775 -0
  267. patchi-0.7.5/patchi/core/fix/patch.py +444 -0
  268. patchi-0.7.5/patchi/core/fix/risk_gate.py +383 -0
  269. patchi-0.7.5/patchi/core/fix/security_fixer.py +93 -0
  270. patchi-0.7.5/patchi/core/fix/verify_loop.py +204 -0
  271. patchi-0.7.5/patchi/core/fuzz/__init__.py +8 -0
  272. patchi-0.7.5/patchi/core/fuzz/corpus.py +137 -0
  273. patchi-0.7.5/patchi/core/fuzz/input_fuzzer.py +256 -0
  274. patchi-0.7.5/patchi/core/fuzz/sequence_fuzzer.py +162 -0
  275. patchi-0.7.5/patchi/core/fuzz/state_fuzzer.py +236 -0
  276. patchi-0.7.5/patchi/core/health.py +407 -0
  277. patchi-0.7.5/patchi/core/hosted/__init__.py +1 -0
  278. patchi-0.7.5/patchi/core/hosted/anomaly.py +298 -0
  279. patchi-0.7.5/patchi/core/hosted/audit_log.py +102 -0
  280. patchi-0.7.5/patchi/core/hosted/compliance_report.py +148 -0
  281. patchi-0.7.5/patchi/core/hosted/ip_reputation.py +169 -0
  282. patchi-0.7.5/patchi/core/hosted/log_parsers.py +251 -0
  283. patchi-0.7.5/patchi/core/hosted/tokens.py +127 -0
  284. patchi-0.7.5/patchi/core/hosted/watchlist.py +164 -0
  285. patchi-0.7.5/patchi/core/hosted/webhooks.py +156 -0
  286. patchi-0.7.5/patchi/core/memory.py +437 -0
  287. patchi-0.7.5/patchi/core/notifications/__init__.py +18 -0
  288. patchi-0.7.5/patchi/core/notifications/channels.py +192 -0
  289. patchi-0.7.5/patchi/core/notifications/digest.py +141 -0
  290. patchi-0.7.5/patchi/core/notifications/escalation.py +158 -0
  291. patchi-0.7.5/patchi/core/notifications/notifier.py +182 -0
  292. patchi-0.7.5/patchi/core/notifications/quiet_hours.py +69 -0
  293. patchi-0.7.5/patchi/core/plugins/__init__.py +48 -0
  294. patchi-0.7.5/patchi/core/plugins/analyzer.py +326 -0
  295. patchi-0.7.5/patchi/core/plugins/analyzers/__init__.py +6 -0
  296. patchi-0.7.5/patchi/core/plugins/analyzers/dead_code_analyzer.py +120 -0
  297. patchi-0.7.5/patchi/core/plugins/analyzers/secret_scanner.py +158 -0
  298. patchi-0.7.5/patchi/core/plugins/analyzers/todo_scanner.py +115 -0
  299. patchi-0.7.5/patchi/core/plugins/registry.py +335 -0
  300. patchi-0.7.5/patchi/core/queue.py +375 -0
  301. patchi-0.7.5/patchi/core/reliability/__init__.py +13 -0
  302. patchi-0.7.5/patchi/core/reliability/chaos.py +163 -0
  303. patchi-0.7.5/patchi/core/reliability/fault_injector.py +172 -0
  304. patchi-0.7.5/patchi/core/reliability/idempotency.py +128 -0
  305. patchi-0.7.5/patchi/core/reliability/recovery.py +147 -0
  306. patchi-0.7.5/patchi/core/runtime/__init__.py +5 -0
  307. patchi-0.7.5/patchi/core/runtime/tracer.py +230 -0
  308. patchi-0.7.5/patchi/core/scan_bus.py +156 -0
  309. patchi-0.7.5/patchi/core/security/__init__.py +1 -0
  310. patchi-0.7.5/patchi/core/security/ai_validator.py +462 -0
  311. patchi-0.7.5/patchi/core/security/app_mapper.py +216 -0
  312. patchi-0.7.5/patchi/core/security/app_profile.py +464 -0
  313. patchi-0.7.5/patchi/core/security/attack_feedback.py +141 -0
  314. patchi-0.7.5/patchi/core/security/attack_scenarios/__init__.py +1 -0
  315. patchi-0.7.5/patchi/core/security/attack_tree.py +176 -0
  316. patchi-0.7.5/patchi/core/security/auth_audit_agent.py +344 -0
  317. patchi-0.7.5/patchi/core/security/authz_agent.py +602 -0
  318. patchi-0.7.5/patchi/core/security/auto_fix_proactive.py +620 -0
  319. patchi-0.7.5/patchi/core/security/auto_fixer.py +660 -0
  320. patchi-0.7.5/patchi/core/security/auto_ticket.py +53 -0
  321. patchi-0.7.5/patchi/core/security/bandit_agent.py +152 -0
  322. patchi-0.7.5/patchi/core/security/blast_radius.py +226 -0
  323. patchi-0.7.5/patchi/core/security/browser_tester.py +333 -0
  324. patchi-0.7.5/patchi/core/security/business_logic_agent.py +263 -0
  325. patchi-0.7.5/patchi/core/security/catch_block_auditor.py +395 -0
  326. patchi-0.7.5/patchi/core/security/cdn_cache_agent.py +357 -0
  327. patchi-0.7.5/patchi/core/security/chain_analyzer.py +321 -0
  328. patchi-0.7.5/patchi/core/security/chain_to_assurance.py +168 -0
  329. patchi-0.7.5/patchi/core/security/charter.py +510 -0
  330. patchi-0.7.5/patchi/core/security/cloud_waf_detector.py +295 -0
  331. patchi-0.7.5/patchi/core/security/codeql_agent.py +233 -0
  332. patchi-0.7.5/patchi/core/security/compliance_agent.py +348 -0
  333. patchi-0.7.5/patchi/core/security/confidence_gate.py +423 -0
  334. patchi-0.7.5/patchi/core/security/container_scanner.py +282 -0
  335. patchi-0.7.5/patchi/core/security/crypto_agent.py +378 -0
  336. patchi-0.7.5/patchi/core/security/cve_monitor.py +262 -0
  337. patchi-0.7.5/patchi/core/security/dast_agent.py +865 -0
  338. patchi-0.7.5/patchi/core/security/defectdojo.py +238 -0
  339. patchi-0.7.5/patchi/core/security/defenders/__init__.py +75 -0
  340. patchi-0.7.5/patchi/core/security/defenders/auth_middleware.py +115 -0
  341. patchi-0.7.5/patchi/core/security/defenders/base.py +97 -0
  342. patchi-0.7.5/patchi/core/security/defenders/block_ip.py +71 -0
  343. patchi-0.7.5/patchi/core/security/defenders/block_ws_origin.py +36 -0
  344. patchi-0.7.5/patchi/core/security/defenders/crypto_fix.py +118 -0
  345. patchi-0.7.5/patchi/core/security/defenders/enforce_rate_limit.py +108 -0
  346. patchi-0.7.5/patchi/core/security/defenders/fix_code.py +93 -0
  347. patchi-0.7.5/patchi/core/security/defenders/invalidate_session.py +40 -0
  348. patchi-0.7.5/patchi/core/security/defenders/patch_config.py +70 -0
  349. patchi-0.7.5/patchi/core/security/defenders/rotate_secret.py +54 -0
  350. patchi-0.7.5/patchi/core/security/defenders/suspend_account.py +41 -0
  351. patchi-0.7.5/patchi/core/security/defenders/update_dependency.py +160 -0
  352. patchi-0.7.5/patchi/core/security/defense_layer.py +217 -0
  353. patchi-0.7.5/patchi/core/security/dependency_vulnerability_agent.py +616 -0
  354. patchi-0.7.5/patchi/core/security/detection_pipeline.py +289 -0
  355. patchi-0.7.5/patchi/core/security/dns_security_agent.py +497 -0
  356. patchi-0.7.5/patchi/core/security/domain_activator_v2.py +913 -0
  357. patchi-0.7.5/patchi/core/security/domain_loader.py +1004 -0
  358. patchi-0.7.5/patchi/core/security/domains/__init__.py +0 -0
  359. patchi-0.7.5/patchi/core/security/email_authentication_agent.py +417 -0
  360. patchi-0.7.5/patchi/core/security/env_var_validator.py +304 -0
  361. patchi-0.7.5/patchi/core/security/evidence.py +100 -0
  362. patchi-0.7.5/patchi/core/security/falco_runtime_agent.py +387 -0
  363. patchi-0.7.5/patchi/core/security/fix-playbooks/__init__.py +0 -0
  364. patchi-0.7.5/patchi/core/security/gated_finding.py +85 -0
  365. patchi-0.7.5/patchi/core/security/git_diff_activator.py +367 -0
  366. patchi-0.7.5/patchi/core/security/governance.py +208 -0
  367. patchi-0.7.5/patchi/core/security/gradual_gate.py +34 -0
  368. patchi-0.7.5/patchi/core/security/history.py +315 -0
  369. patchi-0.7.5/patchi/core/security/iac_scanner.py +250 -0
  370. patchi-0.7.5/patchi/core/security/ignore_expiry.py +111 -0
  371. patchi-0.7.5/patchi/core/security/ignore_learner.py +416 -0
  372. patchi-0.7.5/patchi/core/security/injection_agent.py +319 -0
  373. patchi-0.7.5/patchi/core/security/insecure_randomness_agent.py +288 -0
  374. patchi-0.7.5/patchi/core/security/intent_analyzer.py +326 -0
  375. patchi-0.7.5/patchi/core/security/jwt_agent.py +453 -0
  376. patchi-0.7.5/patchi/core/security/kubernetes_agent.py +638 -0
  377. patchi-0.7.5/patchi/core/security/layer2_orchestrator.py +341 -0
  378. patchi-0.7.5/patchi/core/security/llm_security_agent.py +252 -0
  379. patchi-0.7.5/patchi/core/security/misconfig_agent.py +600 -0
  380. patchi-0.7.5/patchi/core/security/mobile_security_agent.py +474 -0
  381. patchi-0.7.5/patchi/core/security/network_agent.py +376 -0
  382. patchi-0.7.5/patchi/core/security/noise_filter.py +274 -0
  383. patchi-0.7.5/patchi/core/security/orchestrator.py +313 -0
  384. patchi-0.7.5/patchi/core/security/pattern_context.py +125 -0
  385. patchi-0.7.5/patchi/core/security/pattern_loader.py +101 -0
  386. patchi-0.7.5/patchi/core/security/pentest/__init__.py +4 -0
  387. patchi-0.7.5/patchi/core/security/pentest/base.py +58 -0
  388. patchi-0.7.5/patchi/core/security/pentest/dalfox_adapter.py +40 -0
  389. patchi-0.7.5/patchi/core/security/pentest/ffuf_adapter.py +48 -0
  390. patchi-0.7.5/patchi/core/security/pentest/nuclei_adapter.py +50 -0
  391. patchi-0.7.5/patchi/core/security/pentest/registry.py +80 -0
  392. patchi-0.7.5/patchi/core/security/pentest/shannon_adapter.py +107 -0
  393. patchi-0.7.5/patchi/core/security/pentest/sqlmap_adapter.py +56 -0
  394. patchi-0.7.5/patchi/core/security/pentest/zap_adapter.py +52 -0
  395. patchi-0.7.5/patchi/core/security/plan_auditor.py +276 -0
  396. patchi-0.7.5/patchi/core/security/policy_engine.py +272 -0
  397. patchi-0.7.5/patchi/core/security/prechecks.py +172 -0
  398. patchi-0.7.5/patchi/core/security/precommit_hook.py +247 -0
  399. patchi-0.7.5/patchi/core/security/privacy_agent.py +361 -0
  400. patchi-0.7.5/patchi/core/security/push_notification_agent.py +417 -0
  401. patchi-0.7.5/patchi/core/security/pysa_agent.py +143 -0
  402. patchi-0.7.5/patchi/core/security/reasoning.py +442 -0
  403. patchi-0.7.5/patchi/core/security/red_team_agent.py +184 -0
  404. patchi-0.7.5/patchi/core/security/red_team_engine.py +1142 -0
  405. patchi-0.7.5/patchi/core/security/remediation.py +360 -0
  406. patchi-0.7.5/patchi/core/security/request_interceptor.py +294 -0
  407. patchi-0.7.5/patchi/core/security/runtime_validator.py +245 -0
  408. patchi-0.7.5/patchi/core/security/saml_sso_agent.py +401 -0
  409. patchi-0.7.5/patchi/core/security/sast_agent.py +213 -0
  410. patchi-0.7.5/patchi/core/security/sast_gate.py +95 -0
  411. patchi-0.7.5/patchi/core/security/scheduler.py +287 -0
  412. patchi-0.7.5/patchi/core/security/secrets_runtime_agent.py +476 -0
  413. patchi-0.7.5/patchi/core/security/security_agents.py +175 -0
  414. patchi-0.7.5/patchi/core/security/security_config.py +551 -0
  415. patchi-0.7.5/patchi/core/security/security_probe.py +762 -0
  416. patchi-0.7.5/patchi/core/security/security_taint.py +1005 -0
  417. patchi-0.7.5/patchi/core/security/sensitive_data_agent.py +271 -0
  418. patchi-0.7.5/patchi/core/security/service_mesh_agent.py +412 -0
  419. patchi-0.7.5/patchi/core/security/session_management_agent.py +245 -0
  420. patchi-0.7.5/patchi/core/security/ssrf_agent.py +422 -0
  421. patchi-0.7.5/patchi/core/security/supply_chain.py +449 -0
  422. patchi-0.7.5/patchi/core/security/threat_model_generator.py +378 -0
  423. patchi-0.7.5/patchi/core/security/threat_model_updater.py +196 -0
  424. patchi-0.7.5/patchi/core/security/tool_adapters.py +135 -0
  425. patchi-0.7.5/patchi/core/security/tool_verify.py +173 -0
  426. patchi-0.7.5/patchi/core/security/websocket_security_agent.py +188 -0
  427. patchi-0.7.5/patchi/core/snapshot.py +242 -0
  428. patchi-0.7.5/patchi/core/tenant.py +386 -0
  429. patchi-0.7.5/patchi/core/testing/__init__.py +17 -0
  430. patchi-0.7.5/patchi/core/testing/_browser.py +147 -0
  431. patchi-0.7.5/patchi/core/testing/ads_agent.py +141 -0
  432. patchi-0.7.5/patchi/core/testing/api_contract_agent.py +450 -0
  433. patchi-0.7.5/patchi/core/testing/app_discovery_agent.py +641 -0
  434. patchi-0.7.5/patchi/core/testing/app_launcher.py +184 -0
  435. patchi-0.7.5/patchi/core/testing/browser_test_agent.py +516 -0
  436. patchi-0.7.5/patchi/core/testing/e2e_flow_agent.py +354 -0
  437. patchi-0.7.5/patchi/core/testing/flake_detector_agent.py +292 -0
  438. patchi-0.7.5/patchi/core/testing/gate.py +31 -0
  439. patchi-0.7.5/patchi/core/testing/live_test_runner.py +304 -0
  440. patchi-0.7.5/patchi/core/testing/live_v2/__init__.py +1 -0
  441. patchi-0.7.5/patchi/core/testing/live_v2/browser_pool.py +349 -0
  442. patchi-0.7.5/patchi/core/testing/live_v2/browser_test_runner.py +313 -0
  443. patchi-0.7.5/patchi/core/testing/live_v2/runner.py +626 -0
  444. patchi-0.7.5/patchi/core/testing/live_v2/screenshot_manager.py +474 -0
  445. patchi-0.7.5/patchi/core/testing/live_v2/stress_orchestrator.py +523 -0
  446. patchi-0.7.5/patchi/core/testing/live_v2/video_recorder.py +303 -0
  447. patchi-0.7.5/patchi/core/testing/regression_agent.py +302 -0
  448. patchi-0.7.5/patchi/core/testing/security_test_agent.py +253 -0
  449. patchi-0.7.5/patchi/core/testing/stress_test_agent.py +203 -0
  450. patchi-0.7.5/patchi/core/testing/test_agents.py +50 -0
  451. patchi-0.7.5/patchi/core/testing/test_config.py +194 -0
  452. patchi-0.7.5/patchi/core/testing/ui_accessibility_agent.py +324 -0
  453. patchi-0.7.5/patchi/core/testing/ui_button_agent.py +294 -0
  454. patchi-0.7.5/patchi/core/testing/ui_layout_agent.py +330 -0
  455. patchi-0.7.5/patchi/core/testing/unit_test_agent.py +1149 -0
  456. patchi-0.7.5/patchi/core/testing/visual_regression_agent.py +260 -0
  457. patchi-0.7.5/patchi/web/__init__.py +1 -0
  458. patchi-0.7.5/patchi/web/api/__init__.py +1 -0
  459. patchi-0.7.5/patchi/web/api/brain_map.py +114 -0
  460. patchi-0.7.5/patchi/web/api/charts.py +47 -0
  461. patchi-0.7.5/patchi/web/api/chat.py +224 -0
  462. patchi-0.7.5/patchi/web/api/cicd.py +576 -0
  463. patchi-0.7.5/patchi/web/api/dast_evidence.py +49 -0
  464. patchi-0.7.5/patchi/web/api/dev_check.py +320 -0
  465. patchi-0.7.5/patchi/web/api/fix.py +134 -0
  466. patchi-0.7.5/patchi/web/api/guard.py +65 -0
  467. patchi-0.7.5/patchi/web/api/hosted.py +128 -0
  468. patchi-0.7.5/patchi/web/api/hosted_v2.py +234 -0
  469. patchi-0.7.5/patchi/web/api/live_testing.py +699 -0
  470. patchi-0.7.5/patchi/web/api/scan.py +582 -0
  471. patchi-0.7.5/patchi/web/api/smart.py +111 -0
  472. patchi-0.7.5/patchi/web/api/tenant.py +117 -0
  473. patchi-0.7.5/patchi/web/api/tools.py +85 -0
  474. patchi-0.7.5/patchi/web/api_legacy.py +2401 -0
  475. patchi-0.7.5/patchi/web/app.py +310 -0
  476. patchi-0.7.5/patchi/web/events.py +483 -0
  477. patchi-0.7.5/patchi/web/routes/__init__.py +1 -0
  478. patchi-0.7.5/patchi/web/routes/assurance.py +541 -0
  479. patchi-0.7.5/patchi/web/routes/brain.py +36 -0
  480. patchi-0.7.5/patchi/web/routes/charter.py +227 -0
  481. patchi-0.7.5/patchi/web/routes/chat.py +23 -0
  482. patchi-0.7.5/patchi/web/routes/dashboard.py +558 -0
  483. patchi-0.7.5/patchi/web/routes/dashboard_v2.py +402 -0
  484. patchi-0.7.5/patchi/web/routes/findings.py +330 -0
  485. patchi-0.7.5/patchi/web/routes/guard.py +35 -0
  486. patchi-0.7.5/patchi/web/routes/history.py +126 -0
  487. patchi-0.7.5/patchi/web/routes/landing.py +52 -0
  488. patchi-0.7.5/patchi/web/routes/live_testing.py +24 -0
  489. patchi-0.7.5/patchi/web/routes/review.py +57 -0
  490. patchi-0.7.5/patchi/web/routes/self_improvement.py +110 -0
  491. patchi-0.7.5/patchi/web/routes/settings.py +49 -0
  492. patchi-0.7.5/patchi/web/routes/tokens.py +29 -0
  493. patchi-0.7.5/patchi/web/spawn.py +139 -0
  494. patchi-0.7.5/patchi/web/ws.py +141 -0
  495. patchi-0.7.5/patchi.egg-info/PKG-INFO +315 -0
  496. patchi-0.7.5/patchi.egg-info/SOURCES.txt +583 -0
  497. patchi-0.7.5/patchi.egg-info/dependency_links.txt +1 -0
  498. patchi-0.7.5/patchi.egg-info/requires.txt +55 -0
  499. patchi-0.7.5/patchi.egg-info/top_level.txt +1 -0
  500. patchi-0.7.5/pyproject.toml +173 -0
  501. patchi-0.7.5/setup.cfg +4 -0
  502. patchi-0.7.5/tests/test_agent_security.py +197 -0
  503. patchi-0.7.5/tests/test_ai_client.py +189 -0
  504. patchi-0.7.5/tests/test_app_profile.py +284 -0
  505. patchi-0.7.5/tests/test_applier.py +167 -0
  506. patchi-0.7.5/tests/test_assurance.py +220 -0
  507. patchi-0.7.5/tests/test_ast_utils.py +582 -0
  508. patchi-0.7.5/tests/test_ast_utils_new.py +185 -0
  509. patchi-0.7.5/tests/test_attack_agent.py +393 -0
  510. patchi-0.7.5/tests/test_audit.py +160 -0
  511. patchi-0.7.5/tests/test_base.py +419 -0
  512. patchi-0.7.5/tests/test_blast_radius_v2.py +301 -0
  513. patchi-0.7.5/tests/test_brain_map_views.py +483 -0
  514. patchi-0.7.5/tests/test_brain_watcher.py +187 -0
  515. patchi-0.7.5/tests/test_chain_engine.py +250 -0
  516. patchi-0.7.5/tests/test_chaos_engineering.py +79 -0
  517. patchi-0.7.5/tests/test_charter.py +152 -0
  518. patchi-0.7.5/tests/test_ci_bundle.py +70 -0
  519. patchi-0.7.5/tests/test_config.py +204 -0
  520. patchi-0.7.5/tests/test_contract.py +160 -0
  521. patchi-0.7.5/tests/test_coordinator.py +235 -0
  522. patchi-0.7.5/tests/test_corpus_noise.py +149 -0
  523. patchi-0.7.5/tests/test_debug_capture.py +90 -0
  524. patchi-0.7.5/tests/test_debug_codelldb.py +56 -0
  525. patchi-0.7.5/tests/test_debug_node.py +75 -0
  526. patchi-0.7.5/tests/test_debug_powershell.py +79 -0
  527. patchi-0.7.5/tests/test_detector.py +264 -0
  528. patchi-0.7.5/tests/test_differential.py +36 -0
  529. patchi-0.7.5/tests/test_dispatcher.py +181 -0
  530. patchi-0.7.5/tests/test_doc_claim_agent.py +447 -0
  531. patchi-0.7.5/tests/test_domain_loader.py +482 -0
  532. patchi-0.7.5/tests/test_fix_agents.py +390 -0
  533. patchi-0.7.5/tests/test_fp_triage.py +81 -0
  534. patchi-0.7.5/tests/test_framework.py +168 -0
  535. patchi-0.7.5/tests/test_freshness.py +106 -0
  536. patchi-0.7.5/tests/test_generated_suite.py +162 -0
  537. patchi-0.7.5/tests/test_governor_engine.py +457 -0
  538. patchi-0.7.5/tests/test_governor_integration.py +154 -0
  539. patchi-0.7.5/tests/test_governor_v2.py +503 -0
  540. patchi-0.7.5/tests/test_hosted_anomaly.py +157 -0
  541. patchi-0.7.5/tests/test_hosted_audit_log.py +80 -0
  542. patchi-0.7.5/tests/test_hosted_ip_reputation.py +80 -0
  543. patchi-0.7.5/tests/test_hosted_log_parsers.py +159 -0
  544. patchi-0.7.5/tests/test_hosted_mode.py +371 -0
  545. patchi-0.7.5/tests/test_hosted_tokens.py +98 -0
  546. patchi-0.7.5/tests/test_hosted_watchlist.py +96 -0
  547. patchi-0.7.5/tests/test_ignore_learner.py +217 -0
  548. patchi-0.7.5/tests/test_import_graph.py +233 -0
  549. patchi-0.7.5/tests/test_integration.py +233 -0
  550. patchi-0.7.5/tests/test_language_support.py +368 -0
  551. patchi-0.7.5/tests/test_layered_brain.py +227 -0
  552. patchi-0.7.5/tests/test_memory.py +253 -0
  553. patchi-0.7.5/tests/test_new_agents.py +1211 -0
  554. patchi-0.7.5/tests/test_new_features.py +365 -0
  555. patchi-0.7.5/tests/test_new_security_agents.py +285 -0
  556. patchi-0.7.5/tests/test_noise_reduction.py +413 -0
  557. patchi-0.7.5/tests/test_notifications.py +320 -0
  558. patchi-0.7.5/tests/test_p3_agents.py +183 -0
  559. patchi-0.7.5/tests/test_patch.py +225 -0
  560. patchi-0.7.5/tests/test_proactive.py +148 -0
  561. patchi-0.7.5/tests/test_proactive_phase5.py +78 -0
  562. patchi-0.7.5/tests/test_queue.py +246 -0
  563. patchi-0.7.5/tests/test_realize_tools.py +142 -0
  564. patchi-0.7.5/tests/test_reasoning.py +101 -0
  565. patchi-0.7.5/tests/test_rebuilt_modules.py +293 -0
  566. patchi-0.7.5/tests/test_risk_gate.py +228 -0
  567. patchi-0.7.5/tests/test_route_mapper.py +244 -0
  568. patchi-0.7.5/tests/test_runtime_crash_scanner.py +0 -0
  569. patchi-0.7.5/tests/test_scan_bus.py +102 -0
  570. patchi-0.7.5/tests/test_scanner.py +283 -0
  571. patchi-0.7.5/tests/test_scanners.py +706 -0
  572. patchi-0.7.5/tests/test_scheduler.py +93 -0
  573. patchi-0.7.5/tests/test_secrets.py +53 -0
  574. patchi-0.7.5/tests/test_security_config.py +29 -0
  575. patchi-0.7.5/tests/test_sigma_engine.py +178 -0
  576. patchi-0.7.5/tests/test_smart_agent.py +93 -0
  577. patchi-0.7.5/tests/test_snapshot.py +215 -0
  578. patchi-0.7.5/tests/test_test_agents.py +585 -0
  579. patchi-0.7.5/tests/test_tool_harness.py +463 -0
  580. patchi-0.7.5/tests/test_v2_agent_audit.py +137 -0
  581. patchi-0.7.5/tests/test_v2_smoke.py +259 -0
  582. patchi-0.7.5/tests/test_verify.py +102 -0
  583. patchi-0.7.5/tests/test_verify_loop.py +132 -0
  584. patchi-0.7.5/tests/test_web.py +204 -0
  585. patchi-0.7.5/tests/test_web_smart.py +55 -0
patchi-0.7.5/LICENSE ADDED
@@ -0,0 +1,60 @@
1
+ # Patchi License — Freemium Preview (pre-1.0.0)
2
+
3
+ Copyright (c) 2026 Ehis Idemudia — idemudiaehis6@gmail.com
4
+
5
+ > **Status:** Patchi is in active development (current: **v0.7.0**).
6
+ > Peak stable release is planned for **v1.0.0**.
7
+ > Feedback, bug reports, and contributions are highly appreciated.
8
+
9
+ ## Permissions
10
+
11
+ ### Free Use (No Contact Required)
12
+ You may use, modify, and distribute Patchi **free of charge** if you are:
13
+
14
+ - An **individual** using Patchi for **personal, educational, research, or open-source** projects; **or**
15
+ - A **team of fewer than 3 users** (2 or fewer) using Patchi for any purpose, including commercial work within that team size.
16
+
17
+ For these cases you may:
18
+ - Run Patchi locally or in CI
19
+ - Modify source and create derivative works
20
+ - Distribute Patchi or derivatives, provided you retain this license and attribution
21
+
22
+ ### Enterprise / Larger Teams
23
+ If you are a team of **3 or more users**, a company, or intend to deploy Patchi as part of a
24
+ commercial product/service for that team size, please **contact the author for an enterprise license**:
25
+
26
+ **idemudiaehis6@gmail.com**
27
+
28
+ Enterprise licensing is flexible — reach out to discuss terms that fit your org. No hard paywall for evaluation: you may trial Patchi enterprise-wide for up to 30 days before contacting.
29
+
30
+ ## Conditions
31
+
32
+ - You must retain the `LICENSE` file and copyright notice in all copies or substantial portions.
33
+ - You must not remove or alter the Patchi attribution (`patchi.dev` / `github.com/...` where applicable).
34
+ - Hosted mode is marked **EXPERIMENTAL** in this preview; do not rely on it for production traffic without review.
35
+ - This project is in active development — APIs, agents, and features may change between releases.
36
+
37
+ ## Donations & Contributions
38
+
39
+ If Patchi helps you, consider supporting its development:
40
+ - GitHub Sponsors / Donations (link in README)
41
+ - Contributions via pull requests are welcome and will be credited.
42
+
43
+ Donations directly accelerate the road to v1.0.0.
44
+
45
+ ## Warranty Disclaimer
46
+
47
+ Patchi is provided **"AS IS"**, without warranty of any kind, express or implied, including but not limited to
48
+ the warranties of merchantability, fitness for a particular purpose and non-infringement. In no event shall the
49
+ authors be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise,
50
+ arising from, out of or in connection with the software or the use or other dealings in the software.
51
+
52
+ ## Peak Notice
53
+
54
+ Patchi **will be at its peak at v1.0.0**. This preview (0.7.0) is functional and usable, but APIs, agent lists,
55
+ and hosted behavior may still evolve before 1.0.0. Lockfiles and `.patchi/` memory formats are forward-compatible on a
56
+ best-effort basis.
57
+
58
+ ---
59
+
60
+ For questions about licensing: **idemudiaehis6@gmail.com**
patchi-0.7.5/PKG-INFO ADDED
@@ -0,0 +1,315 @@
1
+ Metadata-Version: 2.4
2
+ Name: patchi
3
+ Version: 0.7.5
4
+ Summary: Patchi — AI-powered code security and quality agent colony (smart orchestrator, pre-1.0.0 dev preview)
5
+ License: Proprietary — Free for personal/education/open-source, enterprise contact idemudiaehis6@gmail.com
6
+ Requires-Python: >=3.11
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: httpx>=0.27
10
+ Requires-Dist: pyyaml>=6.0
11
+ Requires-Dist: rich>=13.0
12
+ Requires-Dist: loguru>=0.7
13
+ Requires-Dist: watchfiles>=0.21
14
+ Requires-Dist: psutil>=5.9
15
+ Requires-Dist: fastapi>=0.110
16
+ Requires-Dist: uvicorn>=0.29
17
+ Requires-Dist: jinja2>=3.1
18
+ Requires-Dist: websockets>=12.0
19
+ Requires-Dist: playwright>=1.44
20
+ Requires-Dist: Pillow>=10.0
21
+ Requires-Dist: aiohttp>=3.9
22
+ Requires-Dist: pixelmatch>=0.3
23
+ Requires-Dist: scikit-learn>=1.4
24
+ Requires-Dist: pymetasploit3>=1.0
25
+ Requires-Dist: tree-sitter>=0.21
26
+ Requires-Dist: tree-sitter-python>=0.21
27
+ Requires-Dist: tree-sitter-javascript>=0.21
28
+ Requires-Dist: tree-sitter-typescript>=0.21
29
+ Requires-Dist: tree-sitter-rust>=0.21
30
+ Requires-Dist: tree-sitter-svelte>=0.1
31
+ Requires-Dist: tree-sitter-java>=0.21
32
+ Requires-Dist: tree-sitter-go>=0.21
33
+ Requires-Dist: tree-sitter-c>=0.21
34
+ Requires-Dist: tree-sitter-cpp>=0.21
35
+ Requires-Dist: tree-sitter-swift>=0.1
36
+ Requires-Dist: tree-sitter-ruby>=0.1
37
+ Requires-Dist: tree-sitter-php>=0.1
38
+ Requires-Dist: tree-sitter-c-sharp>=0.1
39
+ Requires-Dist: tree-sitter-kotlin>=0.1
40
+ Requires-Dist: tree-sitter-dart>=0.1
41
+ Requires-Dist: tree-sitter-bash>=0.1
42
+ Requires-Dist: tree-sitter-css>=0.1
43
+ Requires-Dist: tree-sitter-sql>=0.1
44
+ Requires-Dist: tree-sitter-html>=0.1
45
+ Requires-Dist: pytest-xdist>=3.5
46
+ Provides-Extra: dev
47
+ Requires-Dist: pytest>=8.0; extra == "dev"
48
+ Requires-Dist: pytest-timeout>=2.3; extra == "dev"
49
+ Requires-Dist: pytest-mock>=3.12; extra == "dev"
50
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
51
+ Requires-Dist: ruff>=0.5; extra == "dev"
52
+ Requires-Dist: mypy>=1.10; extra == "dev"
53
+ Requires-Dist: vulture>=2.11; extra == "dev"
54
+ Provides-Extra: pentest
55
+ Requires-Dist: shannon>=0.1; extra == "pentest"
56
+ Provides-Extra: external-tools
57
+ Provides-Extra: all
58
+ Requires-Dist: dev; extra == "all"
59
+ Requires-Dist: pentest; extra == "all"
60
+ Dynamic: license-file
61
+
62
+ # Patchi v0.7.5
63
+
64
+ > AI-powered code security & quality orchestrator — CLI agent colony + unified web UI.
65
+ > Scans, secures, tests, and fixes your codebase using static analysis and optional AI.
66
+ > **1:1 CLI ↔ Web** — every screen maps to a command. Cross-platform (Windows, Linux, macOS).
67
+
68
+ **Requires Python 3.11+**
69
+
70
+ ---
71
+
72
+ ## What's New in 0.7.5
73
+
74
+ - **CLI UX module** — spinners, progress bars, colored status, formatted tables, confirmation prompts across all commands
75
+ - **Quick readiness check** — `p quick` runs 3 fast agents to validate project health in seconds
76
+ - **Interactive fix review** — `p fix-review` presents patches with accept/reject/skip and inline diff view
77
+ - **Command families** — `p <family> commands` lists all commands in a family (60 commands, 24 families)
78
+ - **Shannon integration** — entropy analysis for advanced obfuscation detection in pentest campaigns
79
+ - **Dependency consolidation** — all runtime deps now in main, dev/pentest in extras
80
+ - **Security audit fixes** — 7 production bugs fixed (risk gate, queue, memory, applier, health)
81
+ - **Version 0.7.5** — bug fixes, dependency updates, CLI UX improvements
82
+
83
+ Full changelog → [docs/archive/RELEASE-v0.7.5.md](docs/archive/RELEASE-v0.7.5.md)
84
+
85
+ ---
86
+
87
+ ## Quick Start
88
+
89
+ ```bash
90
+ # Install
91
+ pip install . # local dev
92
+ pip install patchi # from PyPI (once published)
93
+ pip install ".[web]" # with web UI
94
+
95
+ # Initialize and scan
96
+ cd your-project
97
+ p init # one-time setup
98
+ p scan # full scan (static analysis, no AI tokens)
99
+ p scan --with-license # include supply-chain license audit
100
+ p scan --deep # with LLM analysis on changed files
101
+ p scan --json # JSON output for CI/CD
102
+ p scan --offline # static analysis only, no AI calls
103
+
104
+ # Check and fix
105
+ p quick # fast readiness check (3 agents)
106
+ p status # brain health, mode, queue, AI status
107
+ p fix # apply AI-generated fixes (requires scan first)
108
+ p fix --dry-run # preview fixes without applying
109
+ p fix-review # interactive review with diff view
110
+
111
+ # Web UI
112
+ p web # launch at http://127.0.0.1:1612
113
+ p web --open # auto-open browser
114
+ ```
115
+
116
+ ---
117
+
118
+ ## Commands
119
+
120
+ **60 commands** across **24 families.** Full reference → [docs/CLI.md](docs/CLI.md)
121
+
122
+ ### Command Families
123
+
124
+ | Family | Purpose |
125
+ |--------|---------|
126
+ | `scan` | Scanning & analysis (`scan`, `security`, `deps`, `chains`, `findings`, `blast`, `impact`, `why`) |
127
+ | `fix` | Fixing & patching (`fix`, `fix-review`, `auto`, `patch`, `undo`, `redo`, `rollback`) |
128
+ | `test` | Testing (`test`, `verify`) |
129
+ | `agent` | Agent management (`agents`, `agent-stats`, `quick`, `ready`) |
130
+ | `ai` | AI configuration (`ai`, `chat`, `model`, `key`) |
131
+ | `config` | Configuration (`settings`, `mode`, `memory`, `cleanup`, `doctor`) |
132
+ | `web` | Web UI & reporting (`web`, `report`, `audit`) |
133
+ | `charter` | Governance (`charter`, `rules`, `restrict`, `assure`) |
134
+ | `notify` | Notifications (`notify`) |
135
+ | `hosted` | Live monitoring (`hosted`) — experimental |
136
+ | `git` | Git integration (`blame`, `log`, `status`) |
137
+ | `dev` | Developer tools (`dev`, `update`, `watch`) |
138
+ | `queue` | Task queue (`queue`) |
139
+ | `brain` | Knowledge & planning (`brain`, `learn`, `plan`) |
140
+ | `vr` | Visual regression (`vr`) |
141
+ | `goal` | Autonomous mode (`goal`) |
142
+ | `cross-repo` | Cross-repo intelligence (`cross-repo`) |
143
+
144
+ Run `p <command> --help` for flags. Run `p <family> commands` to list all commands in a family.
145
+
146
+ ---
147
+
148
+ ## Security Agents
149
+
150
+ **125 registered agents** across 11 categories (lazy-loaded).
151
+
152
+ | Category | Covers |
153
+ |----------|--------|
154
+ | Injection | SQLi, XSS, command injection, SSRF, CSRF, path traversal |
155
+ | Auth | Missing auth, broken access control, JWT, SAML SSO |
156
+ | Crypto | Weak hashing, hardcoded keys, SSL/TLS misconfig |
157
+ | Secrets | Leaked credentials, API keys, connection strings |
158
+ | Supply Chain | CVEs, typosquatting, unpinned deps (license = opt-in via `--with-license`) |
159
+ | Config/IaC | Debug mode, missing headers, CORS, Docker, K8s, Terraform |
160
+ | Compliance | SOC2, HIPAA, PCI-DSS, CIS policy enforcement |
161
+ | Privacy | PII handling |
162
+ | Runtime | Live app testing, anomaly detection |
163
+ | Adversarial | Attack surface analysis, exploit patterns |
164
+ | Governance | History, blast radius, drift detection |
165
+
166
+ Uses Semgrep CE, Gitleaks, OSV-Scanner, httpx, Shannon, and CodeQL under the hood.
167
+
168
+ ---
169
+
170
+ ## AI Setup (Optional)
171
+
172
+ Without AI, Patchi runs structural analysis using static analyzers — free, fast, zero API calls.
173
+
174
+ **Four AI tiers** (priority order):
175
+ 1. **Local model via Ollama** — fully offline, zero cost
176
+ 2. **API keys** — any OpenAI-compatible provider
177
+ 3. **Free keys** — Groq, Google AI, OpenRouter, Mistral, Together AI
178
+ 4. **AI Horde fallback** — anonymous community key, zero setup
179
+
180
+ **14 built-in providers:** OpenAI, Anthropic, Google, Groq, Mistral, Cohere, Together AI, Fireworks, Perplexity, OpenRouter, DeepSeek, xAI, NVIDIA, Hugging Face, plus any custom OpenAI-compatible endpoint.
181
+
182
+ Keys stored in `.patchi/keys.json`, never sent elsewhere.
183
+
184
+ ---
185
+
186
+ ## Modes
187
+
188
+ | Mode | Behaviour |
189
+ |------|-----------|
190
+ | `confirm` (default) | Every fix requires approval |
191
+ | `auto` | Low-risk fixes auto-apply, risky ones ask |
192
+ | `autopilot` | Full trust — applies everything |
193
+
194
+ ---
195
+
196
+ ## Architecture
197
+
198
+ ```
199
+ patchi/
200
+ ├── cli/ # Command-line interface
201
+ │ ├── main.py # Root parser, lazy imports
202
+ │ ├── framework.py # Command registration + family routing
203
+ │ ├── registry.py # 60 registered commands
204
+ │ ├── ux.py # Spinners, progress bars, formatting
205
+ │ ├── console.py # Rich console output
206
+ │ └── commands/ # One file per command (60 files)
207
+
208
+ ├── core/
209
+ │ ├── brain/ # AST scanning, import graph, language detection
210
+ │ │ ├── brain.py # Brain class — main orchestrator
211
+ │ │ ├── scanner.py # File discovery and scanning
212
+ │ │ ├── languages.py # Language support (20+ via tree-sitter)
213
+ │ │ ├── layered_brain.py # Layered architecture analysis
214
+ │ │ ├── charter.py # Project guard rails
215
+ │ │ ├── brain_context.py # Injectable context bridge
216
+ │ │ └── ast_utils/ # AST manipulation utilities
217
+ │ │
218
+ │ ├── agents/ # Agent framework
219
+ │ │ ├── base.py # BaseAgent, Finding, Severity, register()
220
+ │ │ ├── coordinator.py # Multi-agent orchestration
221
+ │ │ ├── governor.py # Phase-gated state machine
222
+ │ │ └── cache.py # Tree-sitter parse cache
223
+ │ │
224
+ │ ├── security/ # 125 security agents
225
+ │ │ ├── orchestrator.py # Cross-agent correlation
226
+ │ │ ├── security_agents.py # Agent registry
227
+ │ │ ├── pentest/ # Pentest toolkit (shannon, metasploit, nuclei, sqlmap, dalfox, ffuf)
228
+ │ │ └── ... # 100+ specialized agents
229
+ │ │
230
+ │ ├── ai/ # AI integration
231
+ │ │ ├── client.py # Unified AI client (14 providers)
232
+ │ │ ├── model_router.py # Cost-aware model routing
233
+ │ │ └── agent_profiler.py # Agent performance tracking
234
+ │ │
235
+ │ ├── fix/ # Fix application
236
+ │ │ ├── base.py # Fix generation with AI
237
+ │ │ ├── risk_gate.py # Risk assessment for fixes
238
+ │ │ └── patch.py # Patch management
239
+ │ │
240
+ │ ├── testing/ # Test execution
241
+ │ │ ├── live_v2/ # Playwright browser testing
242
+ │ │ │ ├── runner.py # Browser test runner
243
+ │ │ │ └── video_recorder.py # Video evidence capture
244
+ │ │ └── ... # Unit, stress, visual regression
245
+ │ │
246
+ │ ├── config.py # Project configuration
247
+ │ ├── constants.py # Shared constants
248
+ │ ├── memory.py # Atomic persistent memory
249
+ │ ├── queue.py # File-locked task queue
250
+ │ ├── snapshot.py # Atomic rollback
251
+ │ └── health.py # Health scoring (0-100)
252
+
253
+ ├── web/ # Unified web UI
254
+ │ ├── app.py # FastAPI application
255
+ │ ├── routes/ # Page routes (Jinja2 templates)
256
+ │ ├── api/ # REST API endpoints
257
+ │ ├── templates/ # Jinja2 HTML templates
258
+ │ └── static/ # CSS, JS, brain map assets
259
+
260
+ └── tests/ # 1,000+ tests across ~70 files
261
+ ```
262
+
263
+ ---
264
+
265
+ ## Key Features
266
+
267
+ - **Multi-language scanning** — Python, JS, TS, Rust, Go, Java, C, C++, Swift, Ruby, PHP, C#, Kotlin, Dart, SQL, HTML, CSS, Svelte, Bash, and more via tree-sitter
268
+ - **Git-aware** — incremental scanning via git diff, blame integration
269
+ - **Atomic writes + file locking** — crash-safe memory, queue, snapshots
270
+ - **Learning brain** — tracks accept/reject patterns, stops suggesting rejected fix types
271
+ - **Notifications** — Slack, Discord, email, webhook, Telegram
272
+ - **Hosted mode (Experimental)** — live log monitoring, anomaly detection, IP reputation, auto-blocking
273
+ - **Governor pipeline** — phase-gated state machine with crash recovery (via `p scan --governor`)
274
+ - **Security orchestrator** — deduplication, cross-agent correlation, OWASP Top 10 mapping
275
+ - **Policy engine** — YAML/JSON policy enforcement with compliance packs
276
+ - **Verify loop** — security fixes re-checked to confirm resolution
277
+ - **CLI UX** — spinners, progress bars, formatted tables, confirmation prompts
278
+
279
+ ---
280
+
281
+ ## Running Tests
282
+
283
+ ```bash
284
+ python -m pytest tests/ -q -x # full suite
285
+ python -m pytest tests/test_contract.py -q # contract tests
286
+ python tools/deep_audit_web.py # web UI audit
287
+ python tools/e2e_web_v2.py # end-to-end
288
+ ```
289
+
290
+ ---
291
+
292
+ ## License & Pricing
293
+
294
+ **Patchi Freemium Preview — see [LICENSE](LICENSE).**
295
+
296
+ - **Free:** Personal use, education, research, open-source, and teams of **fewer than 3 users** — no contact required.
297
+ - **Enterprise / teams ≥ 3:** Contact **idemudiaehis6@gmail.com** for a license. Trial up to 30 days before contacting is fine.
298
+ - **Donations & contributions appreciated** — they directly accelerate the road to **v1.0.0**.
299
+ - Hosted mode is **EXPERIMENTAL** — not recommended for production use yet.
300
+
301
+ ---
302
+
303
+ ## Contributing
304
+
305
+ Donations and contributions are appreciated:
306
+ - **GitHub Sponsors** — [sponsor @simply-ehis](https://github.com/sponsors/simply-ehis)
307
+ - **Pull requests** — welcome and credited
308
+ - **Bug reports** — open an issue or email **idemudiaehis6@gmail.com**
309
+
310
+ ---
311
+
312
+ ## Roadmap
313
+
314
+ **v1.0.0** will lock APIs, ship the full domain taxonomy, and promote hosted out of experimental.
315
+ Until then, pin `.patchi/` memory formats as best-effort forward-compatible.
patchi-0.7.5/README.md ADDED
@@ -0,0 +1,254 @@
1
+ # Patchi v0.7.5
2
+
3
+ > AI-powered code security & quality orchestrator — CLI agent colony + unified web UI.
4
+ > Scans, secures, tests, and fixes your codebase using static analysis and optional AI.
5
+ > **1:1 CLI ↔ Web** — every screen maps to a command. Cross-platform (Windows, Linux, macOS).
6
+
7
+ **Requires Python 3.11+**
8
+
9
+ ---
10
+
11
+ ## What's New in 0.7.5
12
+
13
+ - **CLI UX module** — spinners, progress bars, colored status, formatted tables, confirmation prompts across all commands
14
+ - **Quick readiness check** — `p quick` runs 3 fast agents to validate project health in seconds
15
+ - **Interactive fix review** — `p fix-review` presents patches with accept/reject/skip and inline diff view
16
+ - **Command families** — `p <family> commands` lists all commands in a family (60 commands, 24 families)
17
+ - **Shannon integration** — entropy analysis for advanced obfuscation detection in pentest campaigns
18
+ - **Dependency consolidation** — all runtime deps now in main, dev/pentest in extras
19
+ - **Security audit fixes** — 7 production bugs fixed (risk gate, queue, memory, applier, health)
20
+ - **Version 0.7.5** — bug fixes, dependency updates, CLI UX improvements
21
+
22
+ Full changelog → [docs/archive/RELEASE-v0.7.5.md](docs/archive/RELEASE-v0.7.5.md)
23
+
24
+ ---
25
+
26
+ ## Quick Start
27
+
28
+ ```bash
29
+ # Install
30
+ pip install . # local dev
31
+ pip install patchi # from PyPI (once published)
32
+ pip install ".[web]" # with web UI
33
+
34
+ # Initialize and scan
35
+ cd your-project
36
+ p init # one-time setup
37
+ p scan # full scan (static analysis, no AI tokens)
38
+ p scan --with-license # include supply-chain license audit
39
+ p scan --deep # with LLM analysis on changed files
40
+ p scan --json # JSON output for CI/CD
41
+ p scan --offline # static analysis only, no AI calls
42
+
43
+ # Check and fix
44
+ p quick # fast readiness check (3 agents)
45
+ p status # brain health, mode, queue, AI status
46
+ p fix # apply AI-generated fixes (requires scan first)
47
+ p fix --dry-run # preview fixes without applying
48
+ p fix-review # interactive review with diff view
49
+
50
+ # Web UI
51
+ p web # launch at http://127.0.0.1:1612
52
+ p web --open # auto-open browser
53
+ ```
54
+
55
+ ---
56
+
57
+ ## Commands
58
+
59
+ **60 commands** across **24 families.** Full reference → [docs/CLI.md](docs/CLI.md)
60
+
61
+ ### Command Families
62
+
63
+ | Family | Purpose |
64
+ |--------|---------|
65
+ | `scan` | Scanning & analysis (`scan`, `security`, `deps`, `chains`, `findings`, `blast`, `impact`, `why`) |
66
+ | `fix` | Fixing & patching (`fix`, `fix-review`, `auto`, `patch`, `undo`, `redo`, `rollback`) |
67
+ | `test` | Testing (`test`, `verify`) |
68
+ | `agent` | Agent management (`agents`, `agent-stats`, `quick`, `ready`) |
69
+ | `ai` | AI configuration (`ai`, `chat`, `model`, `key`) |
70
+ | `config` | Configuration (`settings`, `mode`, `memory`, `cleanup`, `doctor`) |
71
+ | `web` | Web UI & reporting (`web`, `report`, `audit`) |
72
+ | `charter` | Governance (`charter`, `rules`, `restrict`, `assure`) |
73
+ | `notify` | Notifications (`notify`) |
74
+ | `hosted` | Live monitoring (`hosted`) — experimental |
75
+ | `git` | Git integration (`blame`, `log`, `status`) |
76
+ | `dev` | Developer tools (`dev`, `update`, `watch`) |
77
+ | `queue` | Task queue (`queue`) |
78
+ | `brain` | Knowledge & planning (`brain`, `learn`, `plan`) |
79
+ | `vr` | Visual regression (`vr`) |
80
+ | `goal` | Autonomous mode (`goal`) |
81
+ | `cross-repo` | Cross-repo intelligence (`cross-repo`) |
82
+
83
+ Run `p <command> --help` for flags. Run `p <family> commands` to list all commands in a family.
84
+
85
+ ---
86
+
87
+ ## Security Agents
88
+
89
+ **125 registered agents** across 11 categories (lazy-loaded).
90
+
91
+ | Category | Covers |
92
+ |----------|--------|
93
+ | Injection | SQLi, XSS, command injection, SSRF, CSRF, path traversal |
94
+ | Auth | Missing auth, broken access control, JWT, SAML SSO |
95
+ | Crypto | Weak hashing, hardcoded keys, SSL/TLS misconfig |
96
+ | Secrets | Leaked credentials, API keys, connection strings |
97
+ | Supply Chain | CVEs, typosquatting, unpinned deps (license = opt-in via `--with-license`) |
98
+ | Config/IaC | Debug mode, missing headers, CORS, Docker, K8s, Terraform |
99
+ | Compliance | SOC2, HIPAA, PCI-DSS, CIS policy enforcement |
100
+ | Privacy | PII handling |
101
+ | Runtime | Live app testing, anomaly detection |
102
+ | Adversarial | Attack surface analysis, exploit patterns |
103
+ | Governance | History, blast radius, drift detection |
104
+
105
+ Uses Semgrep CE, Gitleaks, OSV-Scanner, httpx, Shannon, and CodeQL under the hood.
106
+
107
+ ---
108
+
109
+ ## AI Setup (Optional)
110
+
111
+ Without AI, Patchi runs structural analysis using static analyzers — free, fast, zero API calls.
112
+
113
+ **Four AI tiers** (priority order):
114
+ 1. **Local model via Ollama** — fully offline, zero cost
115
+ 2. **API keys** — any OpenAI-compatible provider
116
+ 3. **Free keys** — Groq, Google AI, OpenRouter, Mistral, Together AI
117
+ 4. **AI Horde fallback** — anonymous community key, zero setup
118
+
119
+ **14 built-in providers:** OpenAI, Anthropic, Google, Groq, Mistral, Cohere, Together AI, Fireworks, Perplexity, OpenRouter, DeepSeek, xAI, NVIDIA, Hugging Face, plus any custom OpenAI-compatible endpoint.
120
+
121
+ Keys stored in `.patchi/keys.json`, never sent elsewhere.
122
+
123
+ ---
124
+
125
+ ## Modes
126
+
127
+ | Mode | Behaviour |
128
+ |------|-----------|
129
+ | `confirm` (default) | Every fix requires approval |
130
+ | `auto` | Low-risk fixes auto-apply, risky ones ask |
131
+ | `autopilot` | Full trust — applies everything |
132
+
133
+ ---
134
+
135
+ ## Architecture
136
+
137
+ ```
138
+ patchi/
139
+ ├── cli/ # Command-line interface
140
+ │ ├── main.py # Root parser, lazy imports
141
+ │ ├── framework.py # Command registration + family routing
142
+ │ ├── registry.py # 60 registered commands
143
+ │ ├── ux.py # Spinners, progress bars, formatting
144
+ │ ├── console.py # Rich console output
145
+ │ └── commands/ # One file per command (60 files)
146
+
147
+ ├── core/
148
+ │ ├── brain/ # AST scanning, import graph, language detection
149
+ │ │ ├── brain.py # Brain class — main orchestrator
150
+ │ │ ├── scanner.py # File discovery and scanning
151
+ │ │ ├── languages.py # Language support (20+ via tree-sitter)
152
+ │ │ ├── layered_brain.py # Layered architecture analysis
153
+ │ │ ├── charter.py # Project guard rails
154
+ │ │ ├── brain_context.py # Injectable context bridge
155
+ │ │ └── ast_utils/ # AST manipulation utilities
156
+ │ │
157
+ │ ├── agents/ # Agent framework
158
+ │ │ ├── base.py # BaseAgent, Finding, Severity, register()
159
+ │ │ ├── coordinator.py # Multi-agent orchestration
160
+ │ │ ├── governor.py # Phase-gated state machine
161
+ │ │ └── cache.py # Tree-sitter parse cache
162
+ │ │
163
+ │ ├── security/ # 125 security agents
164
+ │ │ ├── orchestrator.py # Cross-agent correlation
165
+ │ │ ├── security_agents.py # Agent registry
166
+ │ │ ├── pentest/ # Pentest toolkit (shannon, metasploit, nuclei, sqlmap, dalfox, ffuf)
167
+ │ │ └── ... # 100+ specialized agents
168
+ │ │
169
+ │ ├── ai/ # AI integration
170
+ │ │ ├── client.py # Unified AI client (14 providers)
171
+ │ │ ├── model_router.py # Cost-aware model routing
172
+ │ │ └── agent_profiler.py # Agent performance tracking
173
+ │ │
174
+ │ ├── fix/ # Fix application
175
+ │ │ ├── base.py # Fix generation with AI
176
+ │ │ ├── risk_gate.py # Risk assessment for fixes
177
+ │ │ └── patch.py # Patch management
178
+ │ │
179
+ │ ├── testing/ # Test execution
180
+ │ │ ├── live_v2/ # Playwright browser testing
181
+ │ │ │ ├── runner.py # Browser test runner
182
+ │ │ │ └── video_recorder.py # Video evidence capture
183
+ │ │ └── ... # Unit, stress, visual regression
184
+ │ │
185
+ │ ├── config.py # Project configuration
186
+ │ ├── constants.py # Shared constants
187
+ │ ├── memory.py # Atomic persistent memory
188
+ │ ├── queue.py # File-locked task queue
189
+ │ ├── snapshot.py # Atomic rollback
190
+ │ └── health.py # Health scoring (0-100)
191
+
192
+ ├── web/ # Unified web UI
193
+ │ ├── app.py # FastAPI application
194
+ │ ├── routes/ # Page routes (Jinja2 templates)
195
+ │ ├── api/ # REST API endpoints
196
+ │ ├── templates/ # Jinja2 HTML templates
197
+ │ └── static/ # CSS, JS, brain map assets
198
+
199
+ └── tests/ # 1,000+ tests across ~70 files
200
+ ```
201
+
202
+ ---
203
+
204
+ ## Key Features
205
+
206
+ - **Multi-language scanning** — Python, JS, TS, Rust, Go, Java, C, C++, Swift, Ruby, PHP, C#, Kotlin, Dart, SQL, HTML, CSS, Svelte, Bash, and more via tree-sitter
207
+ - **Git-aware** — incremental scanning via git diff, blame integration
208
+ - **Atomic writes + file locking** — crash-safe memory, queue, snapshots
209
+ - **Learning brain** — tracks accept/reject patterns, stops suggesting rejected fix types
210
+ - **Notifications** — Slack, Discord, email, webhook, Telegram
211
+ - **Hosted mode (Experimental)** — live log monitoring, anomaly detection, IP reputation, auto-blocking
212
+ - **Governor pipeline** — phase-gated state machine with crash recovery (via `p scan --governor`)
213
+ - **Security orchestrator** — deduplication, cross-agent correlation, OWASP Top 10 mapping
214
+ - **Policy engine** — YAML/JSON policy enforcement with compliance packs
215
+ - **Verify loop** — security fixes re-checked to confirm resolution
216
+ - **CLI UX** — spinners, progress bars, formatted tables, confirmation prompts
217
+
218
+ ---
219
+
220
+ ## Running Tests
221
+
222
+ ```bash
223
+ python -m pytest tests/ -q -x # full suite
224
+ python -m pytest tests/test_contract.py -q # contract tests
225
+ python tools/deep_audit_web.py # web UI audit
226
+ python tools/e2e_web_v2.py # end-to-end
227
+ ```
228
+
229
+ ---
230
+
231
+ ## License & Pricing
232
+
233
+ **Patchi Freemium Preview — see [LICENSE](LICENSE).**
234
+
235
+ - **Free:** Personal use, education, research, open-source, and teams of **fewer than 3 users** — no contact required.
236
+ - **Enterprise / teams ≥ 3:** Contact **idemudiaehis6@gmail.com** for a license. Trial up to 30 days before contacting is fine.
237
+ - **Donations & contributions appreciated** — they directly accelerate the road to **v1.0.0**.
238
+ - Hosted mode is **EXPERIMENTAL** — not recommended for production use yet.
239
+
240
+ ---
241
+
242
+ ## Contributing
243
+
244
+ Donations and contributions are appreciated:
245
+ - **GitHub Sponsors** — [sponsor @simply-ehis](https://github.com/sponsors/simply-ehis)
246
+ - **Pull requests** — welcome and credited
247
+ - **Bug reports** — open an issue or email **idemudiaehis6@gmail.com**
248
+
249
+ ---
250
+
251
+ ## Roadmap
252
+
253
+ **v1.0.0** will lock APIs, ship the full domain taxonomy, and promote hosted out of experimental.
254
+ Until then, pin `.patchi/` memory formats as best-effort forward-compatible.
@@ -0,0 +1 @@
1
+ __version__ = "0.7.5"
@@ -0,0 +1,13 @@
1
+ """Allow running patchi as a module: python -m patchi"""
2
+
3
+ import sys
4
+
5
+
6
+ def main():
7
+ from patchi.cli.main import main as cli_main
8
+
9
+ return cli_main()
10
+
11
+
12
+ if __name__ == "__main__":
13
+ sys.exit(main() or 0)
File without changes