pwn 0.5.708 → 0.5.710

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 (450) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +2 -2
  3. data/documentation/Installation.md +1 -0
  4. data/etc/default_skills/exploitdev/SKILL.md +38 -0
  5. data/etc/default_skills/pwn/ai/agent/extrospection/osint/bridges/SKILL.md +30 -8
  6. data/etc/default_skills/pwn/ai/agent/extrospection/osint/social/SKILL.md +30 -8
  7. data/etc/default_skills/pwn/ai/agent/extrospection/osint/social/references/urls.md +1 -1
  8. data/etc/default_skills/pwn/ai/agent/extrospection/references/urls.md +0 -1
  9. data/etc/default_skills/pwn/memory_index/SKILL.md +0 -4
  10. data/etc/default_skills/pwn/plugins/aflplusplus/SKILL.md +49 -0
  11. data/etc/default_skills/pwn/plugins/android/SKILL.md +1 -0
  12. data/etc/default_skills/pwn/plugins/artifact_registry/SKILL.md +49 -0
  13. data/etc/default_skills/pwn/plugins/binary_parser/SKILL.md +54 -0
  14. data/etc/default_skills/pwn/plugins/credential_attack/SKILL.md +58 -0
  15. data/etc/default_skills/pwn/plugins/credential_attack/references/urls.md +3 -0
  16. data/etc/default_skills/pwn/plugins/exploit_db/SKILL.md +49 -0
  17. data/etc/default_skills/pwn/plugins/exploit_dev/SKILL.md +63 -0
  18. data/etc/default_skills/pwn/plugins/frida/SKILL.md +51 -0
  19. data/etc/default_skills/pwn/plugins/fuzz/SKILL.md +2 -0
  20. data/etc/default_skills/pwn/plugins/gdb/SKILL.md +53 -0
  21. data/etc/default_skills/pwn/plugins/jobs/SKILL.md +51 -0
  22. data/etc/default_skills/pwn/plugins/k8s/SKILL.md +51 -0
  23. data/etc/default_skills/pwn/plugins/nuclei/SKILL.md +50 -0
  24. data/etc/default_skills/pwn/plugins/preflight_checker/SKILL.md +59 -0
  25. data/etc/default_skills/pwn/plugins/process_tube/SKILL.md +53 -0
  26. data/etc/default_skills/pwn/plugins/radare2/SKILL.md +59 -0
  27. data/etc/default_skills/pwn/plugins/recon/SKILL.md +57 -0
  28. data/etc/default_skills/pwn/plugins/recon/references/urls.md +6 -0
  29. data/etc/default_skills/pwn/plugins/semgrep/SKILL.md +48 -0
  30. data/etc/default_skills/pwn/plugins/sqlmap/SKILL.md +48 -0
  31. data/etc/default_skills/pwn/plugins/transparent_browser/SKILL.md +0 -4
  32. data/etc/default_skills/pwn/plugins/volatility/SKILL.md +49 -0
  33. data/lib/pwn/ai/agent/assembly.rb +4 -1
  34. data/lib/pwn/ai/agent/btc.rb +4 -1
  35. data/lib/pwn/ai/agent/burp_suite.rb +5 -2
  36. data/lib/pwn/ai/agent/curriculum.rb +89 -30
  37. data/lib/pwn/ai/agent/dispatch.rb +27 -16
  38. data/lib/pwn/ai/agent/extrospection/osint/bridges.rb +9 -18
  39. data/lib/pwn/ai/agent/extrospection/osint/social.rb +9 -18
  40. data/lib/pwn/ai/agent/extrospection.rb +185 -60
  41. data/lib/pwn/ai/agent/gqrx.rb +4 -1
  42. data/lib/pwn/ai/agent/hacker_one.rb +5 -2
  43. data/lib/pwn/ai/agent/learning.rb +142 -25
  44. data/lib/pwn/ai/agent/loop.rb +53 -46
  45. data/lib/pwn/ai/agent/metrics.rb +133 -23
  46. data/lib/pwn/ai/agent/mistakes.rb +126 -17
  47. data/lib/pwn/ai/agent/open_goal.rb +25 -9
  48. data/lib/pwn/ai/agent/policy.rb +158 -18
  49. data/lib/pwn/ai/agent/prompt_builder.rb +21 -11
  50. data/lib/pwn/ai/agent/prompt_cache.rb +44 -13
  51. data/lib/pwn/ai/agent/reflect.rb +9 -5
  52. data/lib/pwn/ai/agent/registry.rb +65 -12
  53. data/lib/pwn/ai/agent/result.rb +19 -10
  54. data/lib/pwn/ai/agent/reward.rb +150 -32
  55. data/lib/pwn/ai/agent/sast.rb +4 -1
  56. data/lib/pwn/ai/agent/swarm.rb +72 -36
  57. data/lib/pwn/ai/agent/task_summarizer.rb +165 -36
  58. data/lib/pwn/ai/agent/tool_guard.rb +105 -6
  59. data/lib/pwn/ai/agent/tools/sessions.rb +8 -1
  60. data/lib/pwn/ai/agent/transparent_browser.rb +4 -1
  61. data/lib/pwn/ai/agent/turn_finalizer.rb +41 -21
  62. data/lib/pwn/ai/agent/vuln_gen.rb +6 -3
  63. data/lib/pwn/ai/agent.rb +4 -0
  64. data/lib/pwn/ai/anthropic.rb +41 -7
  65. data/lib/pwn/ai/gemini.rb +21 -11
  66. data/lib/pwn/ai/grok.rb +44 -6
  67. data/lib/pwn/ai/http_retry.rb +40 -12
  68. data/lib/pwn/ai/ollama.rb +19 -10
  69. data/lib/pwn/ai/open_ai.rb +81 -30
  70. data/lib/pwn/ai/open_web_ui.rb +20 -14
  71. data/lib/pwn/ai/red_team/agent_protocol_abuse.rb +7 -1
  72. data/lib/pwn/ai/red_team/data_and_model_poisoning.rb +7 -1
  73. data/lib/pwn/ai/red_team/excessive_agency.rb +7 -1
  74. data/lib/pwn/ai/red_team/hidden_context_exposure.rb +7 -1
  75. data/lib/pwn/ai/red_team/insecure_output_handling.rb +7 -1
  76. data/lib/pwn/ai/red_team/jailbreak.rb +7 -1
  77. data/lib/pwn/ai/red_team/memory_poisoning.rb +7 -1
  78. data/lib/pwn/ai/red_team/multimodal_injection.rb +7 -1
  79. data/lib/pwn/ai/red_team/overreliance.rb +7 -1
  80. data/lib/pwn/ai/red_team/payload_splitting.rb +7 -1
  81. data/lib/pwn/ai/red_team/prompt_injection.rb +7 -1
  82. data/lib/pwn/ai/red_team/rag_poisoning.rb +7 -1
  83. data/lib/pwn/ai/red_team/sensitive_information_disclosure.rb +7 -1
  84. data/lib/pwn/ai/red_team/supply_chain.rb +7 -1
  85. data/lib/pwn/ai/red_team/system_prompt_extraction.rb +7 -1
  86. data/lib/pwn/ai/red_team/test_case_engine.rb +12 -9
  87. data/lib/pwn/ai/red_team/token_smuggling.rb +7 -1
  88. data/lib/pwn/ai/red_team/unbounded_consumption.rb +7 -1
  89. data/lib/pwn/ai/red_team/vector_and_embedding_weaknesses.rb +7 -1
  90. data/lib/pwn/ai/red_team.rb +4 -0
  91. data/lib/pwn/ai.rb +4 -0
  92. data/lib/pwn/aws/acm.rb +5 -2
  93. data/lib/pwn/aws/api_gateway.rb +10 -7
  94. data/lib/pwn/aws/app_stream.rb +5 -2
  95. data/lib/pwn/aws/application_auto_scaling.rb +5 -2
  96. data/lib/pwn/aws/application_discovery_service.rb +5 -2
  97. data/lib/pwn/aws/auto_scaling.rb +5 -2
  98. data/lib/pwn/aws/batch.rb +5 -2
  99. data/lib/pwn/aws/budgets.rb +5 -2
  100. data/lib/pwn/aws/cloud_formation.rb +5 -2
  101. data/lib/pwn/aws/cloud_front.rb +7 -4
  102. data/lib/pwn/aws/cloud_hsm.rb +5 -2
  103. data/lib/pwn/aws/cloud_search.rb +5 -2
  104. data/lib/pwn/aws/cloud_search_domain.rb +5 -2
  105. data/lib/pwn/aws/cloud_trail.rb +5 -2
  106. data/lib/pwn/aws/cloud_watch.rb +5 -2
  107. data/lib/pwn/aws/cloud_watch_events.rb +5 -2
  108. data/lib/pwn/aws/cloud_watch_logs.rb +5 -2
  109. data/lib/pwn/aws/code_build.rb +5 -2
  110. data/lib/pwn/aws/code_commit.rb +5 -2
  111. data/lib/pwn/aws/code_deploy.rb +5 -2
  112. data/lib/pwn/aws/code_pipeline.rb +5 -2
  113. data/lib/pwn/aws/cognito_identity.rb +5 -2
  114. data/lib/pwn/aws/cognito_identity_provider.rb +5 -2
  115. data/lib/pwn/aws/cognito_sync.rb +5 -2
  116. data/lib/pwn/aws/config_service.rb +5 -2
  117. data/lib/pwn/aws/data_pipleline.rb +5 -2
  118. data/lib/pwn/aws/database_migration_service.rb +5 -2
  119. data/lib/pwn/aws/device_farm.rb +5 -2
  120. data/lib/pwn/aws/direct_connect.rb +5 -2
  121. data/lib/pwn/aws/directory_service.rb +5 -2
  122. data/lib/pwn/aws/dynamo_db.rb +5 -2
  123. data/lib/pwn/aws/dynamo_db_streams.rb +5 -2
  124. data/lib/pwn/aws/ec2.rb +5 -2
  125. data/lib/pwn/aws/ecr.rb +5 -2
  126. data/lib/pwn/aws/ecs.rb +5 -2
  127. data/lib/pwn/aws/efs.rb +5 -2
  128. data/lib/pwn/aws/elasti_cache.rb +5 -2
  129. data/lib/pwn/aws/elastic_beanstalk.rb +8 -5
  130. data/lib/pwn/aws/elastic_load_balancing.rb +5 -2
  131. data/lib/pwn/aws/elastic_load_balancing_v2.rb +6 -3
  132. data/lib/pwn/aws/elastic_transcoder.rb +5 -2
  133. data/lib/pwn/aws/elasticsearch_service.rb +5 -2
  134. data/lib/pwn/aws/emr.rb +5 -2
  135. data/lib/pwn/aws/firehose.rb +5 -2
  136. data/lib/pwn/aws/game_lift.rb +5 -2
  137. data/lib/pwn/aws/glacier.rb +6 -3
  138. data/lib/pwn/aws/health.rb +5 -2
  139. data/lib/pwn/aws/iam.rb +10 -4
  140. data/lib/pwn/aws/import_export.rb +5 -2
  141. data/lib/pwn/aws/inspector.rb +5 -2
  142. data/lib/pwn/aws/iot.rb +5 -2
  143. data/lib/pwn/aws/iot_data_plane.rb +5 -2
  144. data/lib/pwn/aws/kinesis.rb +5 -2
  145. data/lib/pwn/aws/kinesis_analytics.rb +5 -2
  146. data/lib/pwn/aws/kms.rb +5 -2
  147. data/lib/pwn/aws/lambda.rb +5 -2
  148. data/lib/pwn/aws/lambda_preview.rb +5 -2
  149. data/lib/pwn/aws/lex.rb +5 -2
  150. data/lib/pwn/aws/lightsail.rb +5 -2
  151. data/lib/pwn/aws/machine_learning.rb +5 -2
  152. data/lib/pwn/aws/marketplace_commerce_analytics.rb +5 -2
  153. data/lib/pwn/aws/marketplace_metering.rb +5 -2
  154. data/lib/pwn/aws/ops_works.rb +5 -2
  155. data/lib/pwn/aws/ops_works_cm.rb +5 -2
  156. data/lib/pwn/aws/pinpoint.rb +5 -2
  157. data/lib/pwn/aws/polly.rb +5 -2
  158. data/lib/pwn/aws/rds.rb +5 -2
  159. data/lib/pwn/aws/redshift.rb +5 -2
  160. data/lib/pwn/aws/rekognition.rb +5 -2
  161. data/lib/pwn/aws/route53.rb +5 -2
  162. data/lib/pwn/aws/route53_domains.rb +5 -2
  163. data/lib/pwn/aws/s3.rb +5 -2
  164. data/lib/pwn/aws/service_catalog.rb +5 -2
  165. data/lib/pwn/aws/ses.rb +5 -2
  166. data/lib/pwn/aws/shield.rb +5 -2
  167. data/lib/pwn/aws/simple_db.rb +5 -2
  168. data/lib/pwn/aws/sms.rb +5 -2
  169. data/lib/pwn/aws/snowball.rb +5 -2
  170. data/lib/pwn/aws/sns.rb +5 -2
  171. data/lib/pwn/aws/sqs.rb +5 -2
  172. data/lib/pwn/aws/ssm.rb +5 -2
  173. data/lib/pwn/aws/states.rb +5 -2
  174. data/lib/pwn/aws/storage_gateway.rb +5 -2
  175. data/lib/pwn/aws/sts.rb +4 -1
  176. data/lib/pwn/aws/support.rb +5 -2
  177. data/lib/pwn/aws/swf.rb +5 -2
  178. data/lib/pwn/aws/waf.rb +5 -2
  179. data/lib/pwn/aws/waf_regional.rb +5 -2
  180. data/lib/pwn/aws/workspaces.rb +5 -2
  181. data/lib/pwn/aws/x_ray.rb +5 -2
  182. data/lib/pwn/aws.rb +4 -0
  183. data/lib/pwn/banner/anon.rb +3 -0
  184. data/lib/pwn/banner/bubble.rb +3 -0
  185. data/lib/pwn/banner/cheshire.rb +3 -0
  186. data/lib/pwn/banner/code_cave.rb +3 -0
  187. data/lib/pwn/banner/dont_panic.rb +3 -0
  188. data/lib/pwn/banner/f_society.rb +3 -0
  189. data/lib/pwn/banner/fork_bomb.rb +3 -0
  190. data/lib/pwn/banner/jmp_esp.rb +3 -0
  191. data/lib/pwn/banner/matrix.rb +5 -1
  192. data/lib/pwn/banner/ninja.rb +3 -0
  193. data/lib/pwn/banner/off_the_air.rb +3 -0
  194. data/lib/pwn/banner/pirate.rb +3 -0
  195. data/lib/pwn/banner/radare2.rb +3 -0
  196. data/lib/pwn/banner/radare2_ai.rb +3 -0
  197. data/lib/pwn/banner/white_rabbit.rb +3 -0
  198. data/lib/pwn/banner.rb +6 -2
  199. data/lib/pwn/blockchain/btc.rb +8 -3
  200. data/lib/pwn/blockchain/eth.rb +10 -3
  201. data/lib/pwn/blockchain.rb +4 -0
  202. data/lib/pwn/bounty/lifecycle_authz_replay.rb +46 -27
  203. data/lib/pwn/bounty.rb +4 -0
  204. data/lib/pwn/config.rb +79 -13
  205. data/lib/pwn/cron.rb +297 -20
  206. data/lib/pwn/driver.rb +2 -18
  207. data/lib/pwn/ffi/adalm_pluto.rb +65 -11
  208. data/lib/pwn/ffi/fftw.rb +31 -6
  209. data/lib/pwn/ffi/hack_rf.rb +59 -8
  210. data/lib/pwn/ffi/liquid.rb +63 -10
  211. data/lib/pwn/ffi/rtl_sdr.rb +35 -5
  212. data/lib/pwn/ffi/soapy_sdr.rb +60 -10
  213. data/lib/pwn/ffi/stdio.rb +7 -8
  214. data/lib/pwn/ffi/volk.rb +36 -7
  215. data/lib/pwn/ffi.rb +12 -0
  216. data/lib/pwn/memory.rb +136 -16
  217. data/lib/pwn/memory_index.rb +34 -19
  218. data/lib/pwn/migrate.rb +34 -24
  219. data/lib/pwn/module_skills.rb +39 -8
  220. data/lib/pwn/plugins/aflplusplus.rb +72 -0
  221. data/lib/pwn/plugins/android.rb +71 -245
  222. data/lib/pwn/plugins/artifact_registry.rb +71 -0
  223. data/lib/pwn/plugins/assembly.rb +9 -4
  224. data/lib/pwn/plugins/authentication_helper.rb +8 -5
  225. data/lib/pwn/plugins/baresip.rb +59 -12
  226. data/lib/pwn/plugins/basic_auth.rb +9 -3
  227. data/lib/pwn/plugins/beef.rb +28 -18
  228. data/lib/pwn/plugins/binary_parser.rb +133 -0
  229. data/lib/pwn/plugins/black_duck_binary_analysis.rb +63 -39
  230. data/lib/pwn/plugins/burp_suite.rb +98 -68
  231. data/lib/pwn/plugins/bus_pirate.rb +15 -8
  232. data/lib/pwn/plugins/char.rb +33 -3
  233. data/lib/pwn/plugins/credential_attack.rb +158 -0
  234. data/lib/pwn/plugins/credit_card.rb +6 -1
  235. data/lib/pwn/plugins/dao_ldap.rb +19 -13
  236. data/lib/pwn/plugins/dao_mongo.rb +11 -5
  237. data/lib/pwn/plugins/dao_postgres.rb +28 -19
  238. data/lib/pwn/plugins/dao_sqlite3.rb +15 -6
  239. data/lib/pwn/plugins/defect_dojo.rb +38 -22
  240. data/lib/pwn/plugins/detect_os.rb +5 -0
  241. data/lib/pwn/plugins/ein.rb +3 -0
  242. data/lib/pwn/plugins/exploit_db.rb +69 -0
  243. data/lib/pwn/plugins/exploit_dev.rb +330 -0
  244. data/lib/pwn/plugins/file_fu.rb +11 -8
  245. data/lib/pwn/plugins/frida.rb +112 -0
  246. data/lib/pwn/plugins/fuzz.rb +42 -6
  247. data/lib/pwn/plugins/gdb.rb +115 -0
  248. data/lib/pwn/plugins/git.rb +19 -14
  249. data/lib/pwn/plugins/github.rb +38 -15
  250. data/lib/pwn/plugins/google_workspace.rb +188 -45
  251. data/lib/pwn/plugins/hacker_one.rb +159 -35
  252. data/lib/pwn/plugins/hunter.rb +6 -3
  253. data/lib/pwn/plugins/ip_info.rb +9 -4
  254. data/lib/pwn/plugins/irc.rb +28 -15
  255. data/lib/pwn/plugins/jenkins.rb +65 -57
  256. data/lib/pwn/plugins/jira_data_center.rb +30 -22
  257. data/lib/pwn/plugins/jobs.rb +110 -0
  258. data/lib/pwn/plugins/json_pathify.rb +9 -5
  259. data/lib/pwn/plugins/k8s.rb +73 -0
  260. data/lib/pwn/plugins/log.rb +113 -13
  261. data/lib/pwn/plugins/mail_agent.rb +87 -79
  262. data/lib/pwn/plugins/metasploit.rb +11 -6
  263. data/lib/pwn/plugins/monkey_patch.rb +3 -0
  264. data/lib/pwn/plugins/msr206.rb +42 -28
  265. data/lib/pwn/plugins/nessus_cloud.rb +44 -4
  266. data/lib/pwn/plugins/nexpose_vuln_scan.rb +40 -24
  267. data/lib/pwn/plugins/nmap_it.rb +14 -34
  268. data/lib/pwn/plugins/nuclei.rb +90 -0
  269. data/lib/pwn/plugins/oauth2.rb +11 -5
  270. data/lib/pwn/plugins/ocr.rb +3 -0
  271. data/lib/pwn/plugins/open_api.rb +5 -2
  272. data/lib/pwn/plugins/openvas.rb +33 -25
  273. data/lib/pwn/plugins/packet.rb +152 -31
  274. data/lib/pwn/plugins/pdf_parse.rb +5 -2
  275. data/lib/pwn/plugins/pony.rb +86 -1
  276. data/lib/pwn/plugins/preflight_checker.rb +166 -0
  277. data/lib/pwn/plugins/process_tube.rb +139 -0
  278. data/lib/pwn/plugins/ps.rb +7 -1
  279. data/lib/pwn/plugins/pwn_logger.rb +6 -2
  280. data/lib/pwn/plugins/rabbit_mq.rb +12 -7
  281. data/lib/pwn/plugins/radare2.rb +253 -0
  282. data/lib/pwn/plugins/recon.rb +196 -0
  283. data/lib/pwn/plugins/repl.rb +122 -1
  284. data/lib/pwn/plugins/scannable_codes.rb +5 -1
  285. data/lib/pwn/plugins/semgrep.rb +61 -0
  286. data/lib/pwn/plugins/serial.rb +24 -14
  287. data/lib/pwn/plugins/shodan.rb +54 -35
  288. data/lib/pwn/plugins/slack_client.rb +11 -6
  289. data/lib/pwn/plugins/sock.rb +17 -8
  290. data/lib/pwn/plugins/spider.rb +5 -2
  291. data/lib/pwn/plugins/sqlmap.rb +49 -0
  292. data/lib/pwn/plugins/ssn.rb +3 -0
  293. data/lib/pwn/plugins/thread_pool.rb +6 -9
  294. data/lib/pwn/plugins/tor.rb +9 -4
  295. data/lib/pwn/plugins/transparent_browser.rb +62 -107
  296. data/lib/pwn/plugins/tty_spinner.rb +16 -2
  297. data/lib/pwn/plugins/twitter_api.rb +6 -2
  298. data/lib/pwn/plugins/uri_scheme.rb +4 -1
  299. data/lib/pwn/plugins/vault.rb +12 -3
  300. data/lib/pwn/plugins/vin.rb +24 -12
  301. data/lib/pwn/plugins/voice.rb +7 -2
  302. data/lib/pwn/plugins/volatility.rb +67 -0
  303. data/lib/pwn/plugins/vsphere.rb +9 -5
  304. data/lib/pwn/plugins/xxd.rb +12 -43
  305. data/lib/pwn/plugins/zaproxy.rb +30 -16
  306. data/lib/pwn/plugins.rb +22 -0
  307. data/lib/pwn/reports/ai_red_team.rb +6 -2
  308. data/lib/pwn/reports/csv.rb +8 -1
  309. data/lib/pwn/reports/fuzz.rb +5 -2
  310. data/lib/pwn/reports/html.rb +8 -1
  311. data/lib/pwn/reports/html_footer.rb +4 -3
  312. data/lib/pwn/reports/html_header.rb +6 -2
  313. data/lib/pwn/reports/json.rb +8 -1
  314. data/lib/pwn/reports/markdown.rb +8 -1
  315. data/lib/pwn/reports/pdf.rb +8 -1
  316. data/lib/pwn/reports/phone.rb +5 -2
  317. data/lib/pwn/reports/sast.rb +6 -2
  318. data/lib/pwn/reports/uri_buster.rb +5 -2
  319. data/lib/pwn/reports/xml.rb +8 -1
  320. data/lib/pwn/reports.rb +19 -0
  321. data/lib/pwn/sast/amqp_connect_as_guest.rb +9 -3
  322. data/lib/pwn/sast/apache_file_system_util_api.rb +9 -3
  323. data/lib/pwn/sast/aws.rb +9 -3
  324. data/lib/pwn/sast/banned_function_calls_c.rb +9 -3
  325. data/lib/pwn/sast/base64.rb +9 -3
  326. data/lib/pwn/sast/beef_hook.rb +9 -3
  327. data/lib/pwn/sast/cmd_execution_go_lang.rb +9 -3
  328. data/lib/pwn/sast/cmd_execution_java.rb +9 -3
  329. data/lib/pwn/sast/cmd_execution_python.rb +9 -3
  330. data/lib/pwn/sast/cmd_execution_ruby.rb +9 -3
  331. data/lib/pwn/sast/cmd_execution_scala.rb +9 -3
  332. data/lib/pwn/sast/csrf.rb +9 -3
  333. data/lib/pwn/sast/deserial_java.rb +9 -3
  334. data/lib/pwn/sast/emoticon.rb +9 -3
  335. data/lib/pwn/sast/eval.rb +9 -3
  336. data/lib/pwn/sast/factory.rb +9 -3
  337. data/lib/pwn/sast/http_authorization_header.rb +9 -3
  338. data/lib/pwn/sast/inner_html.rb +9 -3
  339. data/lib/pwn/sast/keystore.rb +9 -3
  340. data/lib/pwn/sast/local_storage.rb +9 -3
  341. data/lib/pwn/sast/location_hash.rb +9 -3
  342. data/lib/pwn/sast/log4j.rb +9 -3
  343. data/lib/pwn/sast/logger.rb +9 -3
  344. data/lib/pwn/sast/md5.rb +9 -3
  345. data/lib/pwn/sast/outer_html.rb +9 -3
  346. data/lib/pwn/sast/padding_oracle.rb +9 -3
  347. data/lib/pwn/sast/password.rb +9 -3
  348. data/lib/pwn/sast/php_input_mechanisms.rb +9 -3
  349. data/lib/pwn/sast/php_type_juggling.rb +9 -3
  350. data/lib/pwn/sast/pom_version.rb +9 -3
  351. data/lib/pwn/sast/port.rb +9 -3
  352. data/lib/pwn/sast/post_message.rb +9 -3
  353. data/lib/pwn/sast/private_key.rb +9 -3
  354. data/lib/pwn/sast/redirect.rb +9 -3
  355. data/lib/pwn/sast/redos.rb +9 -3
  356. data/lib/pwn/sast/shell.rb +9 -3
  357. data/lib/pwn/sast/signature.rb +9 -3
  358. data/lib/pwn/sast/sql.rb +9 -3
  359. data/lib/pwn/sast/ssl.rb +9 -3
  360. data/lib/pwn/sast/sudo.rb +9 -3
  361. data/lib/pwn/sast/task_tag.rb +9 -3
  362. data/lib/pwn/sast/test_case_engine.rb +11 -7
  363. data/lib/pwn/sast/throw_errors.rb +9 -3
  364. data/lib/pwn/sast/token.rb +9 -3
  365. data/lib/pwn/sast/type_script_type_juggling.rb +9 -3
  366. data/lib/pwn/sast/use_after_free.rb +9 -3
  367. data/lib/pwn/sast/version.rb +9 -3
  368. data/lib/pwn/sast/window_location_hash.rb +9 -3
  369. data/lib/pwn/sast.rb +4 -0
  370. data/lib/pwn/sdr/decoder/adsb.rb +36 -5
  371. data/lib/pwn/sdr/decoder/apt.rb +9 -6
  372. data/lib/pwn/sdr/decoder/base.rb +74 -22
  373. data/lib/pwn/sdr/decoder/bluetooth.rb +17 -5
  374. data/lib/pwn/sdr/decoder/dect.rb +12 -3
  375. data/lib/pwn/sdr/decoder/dsp.rb +229 -39
  376. data/lib/pwn/sdr/decoder/flex.rb +59 -11
  377. data/lib/pwn/sdr/decoder/gps.rb +12 -3
  378. data/lib/pwn/sdr/decoder/gsm.rb +24 -4
  379. data/lib/pwn/sdr/decoder/iridium.rb +12 -3
  380. data/lib/pwn/sdr/decoder/lora.rb +13 -4
  381. data/lib/pwn/sdr/decoder/lte.rb +27 -3
  382. data/lib/pwn/sdr/decoder/morse.rb +12 -3
  383. data/lib/pwn/sdr/decoder/p25.rb +12 -3
  384. data/lib/pwn/sdr/decoder/pager.rb +8 -5
  385. data/lib/pwn/sdr/decoder/pocsag.rb +29 -9
  386. data/lib/pwn/sdr/decoder/rds.rb +14 -8
  387. data/lib/pwn/sdr/decoder/rfid.rb +12 -3
  388. data/lib/pwn/sdr/decoder/rtl433.rb +12 -3
  389. data/lib/pwn/sdr/decoder/rtty.rb +8 -5
  390. data/lib/pwn/sdr/decoder/wifi.rb +12 -3
  391. data/lib/pwn/sdr/decoder/zigbee.rb +12 -3
  392. data/lib/pwn/sdr/decoder.rb +9 -0
  393. data/lib/pwn/sdr/flipper_zero.rb +17 -10
  394. data/lib/pwn/sdr/frequency_allocation.rb +4 -1
  395. data/lib/pwn/sdr/gqrx.rb +178 -119
  396. data/lib/pwn/sdr/rfidler.rb +4 -1
  397. data/lib/pwn/sdr/son_micro_rfid.rb +37 -24
  398. data/lib/pwn/sdr.rb +14 -0
  399. data/lib/pwn/sessions.rb +86 -16
  400. data/lib/pwn/setup.rb +106 -37
  401. data/lib/pwn/version.rb +1 -1
  402. data/lib/pwn/www/app_cobalt_io.rb +11 -5
  403. data/lib/pwn/www/bing.rb +10 -5
  404. data/lib/pwn/www/bug_crowd.rb +11 -5
  405. data/lib/pwn/www/checkip.rb +8 -4
  406. data/lib/pwn/www/coinbase_pro.rb +11 -5
  407. data/lib/pwn/www/duckduckgo.rb +12 -6
  408. data/lib/pwn/www/facebook.rb +11 -5
  409. data/lib/pwn/www/github.rb +11 -5
  410. data/lib/pwn/www/google.rb +11 -5
  411. data/lib/pwn/www/hacker_one.rb +20 -9
  412. data/lib/pwn/www/linkedin.rb +11 -5
  413. data/lib/pwn/www/pandora.rb +11 -5
  414. data/lib/pwn/www/pastebin.rb +9 -4
  415. data/lib/pwn/www/paypal.rb +19 -11
  416. data/lib/pwn/www/synack.rb +11 -5
  417. data/lib/pwn/www/torch.rb +13 -8
  418. data/lib/pwn/www/trading_view.rb +11 -5
  419. data/lib/pwn/www/twitter.rb +11 -5
  420. data/lib/pwn/www/uber.rb +11 -5
  421. data/lib/pwn/www/upwork.rb +11 -5
  422. data/lib/pwn/www/wayback_machine.rb +12 -6
  423. data/lib/pwn/www/youtube.rb +10 -5
  424. data/lib/pwn/www.rb +4 -0
  425. data/spec/conventions_spec.rb +118 -2
  426. data/spec/integration/help_contract_spec.rb +2 -0
  427. data/spec/lib/pwn/ai/agent/reward_spec.rb +9 -0
  428. data/spec/lib/pwn/plugins/aflplusplus_spec.rb +13 -0
  429. data/spec/lib/pwn/plugins/artifact_registry_spec.rb +13 -0
  430. data/spec/lib/pwn/plugins/binary_parser_spec.rb +21 -0
  431. data/spec/lib/pwn/plugins/credential_attack_spec.rb +13 -0
  432. data/spec/lib/pwn/plugins/exploit_db_spec.rb +13 -0
  433. data/spec/lib/pwn/plugins/exploit_dev_spec.rb +23 -0
  434. data/spec/lib/pwn/plugins/frida_spec.rb +13 -0
  435. data/spec/lib/pwn/plugins/gdb_spec.rb +13 -0
  436. data/spec/lib/pwn/plugins/jobs_spec.rb +13 -0
  437. data/spec/lib/pwn/plugins/k8s_spec.rb +13 -0
  438. data/spec/lib/pwn/plugins/nuclei_spec.rb +13 -0
  439. data/spec/lib/pwn/plugins/preflight_checker_spec.rb +23 -0
  440. data/spec/lib/pwn/plugins/process_tube_spec.rb +13 -0
  441. data/spec/lib/pwn/plugins/radare2_spec.rb +13 -0
  442. data/spec/lib/pwn/plugins/recon_spec.rb +26 -0
  443. data/spec/lib/pwn/plugins/semgrep_spec.rb +13 -0
  444. data/spec/lib/pwn/plugins/sqlmap_spec.rb +13 -0
  445. data/spec/lib/pwn/plugins/volatility_spec.rb +13 -0
  446. data/spec/lib/pwn/req_queue_spec.rb +168 -0
  447. data/third_party/pwn_rdoc.jsonl +160 -5
  448. metadata +63 -7
  449. data/etc/default_skills/pwn/memory_index/references/urls.md +0 -4
  450. data/etc/default_skills/pwn/plugins/transparent_browser/references/urls.md +0 -3
@@ -1771,31 +1771,148 @@ module PWN
1771
1771
  # Display Usage for this Module
1772
1772
 
1773
1773
  public_class_method def self.help
1774
- puts <<~USAGE
1775
- USAGE:
1776
- PWN::AI::Agent::Learning.note_outcome(task: 'nmap sweep 10.0.0.0/24', success: true, details: '12 hosts up')
1777
- PWN::AI::Agent::Learning.outcomes(limit: 20, success: false)
1778
- PWN::AI::Agent::Learning.reflect(session_id: sid) # LLM or heuristic PWN::Memory
1779
- PWN::AI::Agent::Learning.auto_introspect(session_id: sid, request: req, final: text)
1780
- PWN::AI::Agent::Learning.distill_skill(name: 'quick_recon', session_id: sid)
1781
- PWN::AI::Agent::Learning.exemplars_for(request: 'nmap sweep 10/8') # few-shot for Loop.run
1782
- PWN::AI::Agent::Learning.export_finetune(format: :sharegpt) # -> ~/.pwn/finetune/*.jsonl
1783
- PWN::AI::Agent::Learning.consolidate(max_entries: 200) # M1 semantic-merge + M3 importance-evict
1784
- PWN::AI::Agent::Learning.lean! # memory + learning.jsonl prune
1785
- PWN::AI::Agent::Learning.gc_stores! # full ~/.pwn RL lean (mem/learn/mistakes/sessions)
1786
- PWN::AI::Agent::Learning.prune_outcomes! # learning.jsonl gold-keep cap
1787
- PWN::AI::Agent::Learning.purge_noise # one-shot GC of pre-R1 garbage lessons
1788
- PWN::AI::Agent::Learning.to_context(limit: 5) # injected by PromptBuilder
1789
- PWN::AI::Agent::Learning.stats
1790
- PWN::AI::Agent::Learning.reset
1791
-
1792
- Enable end-of-run auto-learning with:
1793
- PWN::Env[:ai][:agent][:auto_introspect] = true
1794
- # auto_introspect throttles gc_stores! every PRUNE_EVERY_N_APPENDS
1795
- # outcomes so ~/.pwn stays lean without a manual GC turn.
1796
-
1797
- #{self}.authors
1798
- USAGE
1774
+ puts "USAGE:
1775
+ # Run note outcome and return its result
1776
+ #{self}.note_outcome(
1777
+ task: 'required - short description of what was attempted',
1778
+ success: 'required - Boolean, did the attempt achieve its goal',
1779
+ details: 'optional - free-form notes / error / evidence',
1780
+ session_id: 'optional - PWN::Sessions id this outcome belongs to',
1781
+ tags: 'optional - Array of String labels for later retrieval',
1782
+ score: 'optional - score value consumed by #note_outcome',
1783
+ judge_source: 'required - judge source value consumed by #note_outcome',
1784
+ predicted: 'optional - predicted value consumed by #note_outcome',
1785
+ confidence: 'optional - confidence value consumed by #note_outcome',
1786
+ engine: 'optional - engine value consumed by #note_outcome'
1787
+ )
1788
+
1789
+ # Run outcomes and return its result
1790
+ #{self}.outcomes(
1791
+ limit: 'optional - max entries returned newest-first (default 50)',
1792
+ success: 'optional - filter by Boolean outcome',
1793
+ tag: 'optional - filter by tag substring'
1794
+ )
1795
+
1796
+ # Run stats and return its result
1797
+ #{self}.stats
1798
+
1799
+ # Run to context and return its result
1800
+ #{self}.to_context(
1801
+ limit: 'optional - number of recent outcomes to surface (default 5)'
1802
+ )
1803
+
1804
+ # Run exemplars for and return its result
1805
+ #{self}.exemplars_for(
1806
+ request: 'required - current user request',
1807
+ limit: 'optional - max exemplar traces to return (default 1)',
1808
+ max_msgs: 'optional - cap on messages per exemplar (default 6)'
1809
+ )
1810
+
1811
+ # Run export finetune and return its result
1812
+ #{self}.export_finetune(
1813
+ format: 'optional - format value consumed by #export_finetune (defaults to :sharegpt))',
1814
+ min_tools: 'optional - min tools value consumed by #export_finetune',
1815
+ min_score: 'optional - min score value consumed by #export_finetune',
1816
+ compress: 'optional - compress value consumed by #export_finetune',
1817
+ out: 'optional - out value consumed by #export_finetune'
1818
+ )
1819
+
1820
+ # Run distill skill and return its result
1821
+ #{self}.distill_skill(
1822
+ name: 'required - snake_case name for the new skill',
1823
+ session_id: 'optional - PWN::Sessions id to mine (uses its transcript)',
1824
+ content: 'optional - explicit markdown body; overrides transcript mining',
1825
+ references: 'optional - Array of reference URLs / CWE / CVE / ATT&CK ids',
1826
+ description: 'optional - description value consumed by #distill_skill'
1827
+ )
1828
+
1829
+ # Fold RL artefacts (mistakes / structured_fix / an explicit lesson)
1830
+ #{self}.update_skill(
1831
+ dry_run: 'optional - dry run value consumed by #update_skill',
1832
+ lesson: 'optional - lesson value consumed by #update_skill',
1833
+ signature: 'optional - signature value consumed by #update_skill',
1834
+ request: 'optional - request value consumed by #update_skill (defaults to opts[:query])',
1835
+ query: 'optional - search query string',
1836
+ name: 'required - binary or identifier name'
1837
+ )
1838
+
1839
+ # Run reflect and return its result
1840
+ #{self}.reflect(
1841
+ session_id: 'required - PWN::Sessions id to analyse',
1842
+ dry_run: 'optional - when true, do not write to Memory/Skills (default false)'
1843
+ )
1844
+
1845
+ # Called by Loop.run when PWN::Env[:ai][:agent][:auto_introspect] is
1846
+ #{self}.auto_introspect(
1847
+ session_id: 'required - id of the just-completed session',
1848
+ request: 'optional - original user request (for outcome logging)',
1849
+ final: 'optional - final assistant answer (for outcome logging)',
1850
+ inline: 'optional - inline value consumed by #auto_introspect',
1851
+ predicted: 'optional - predicted value consumed by #auto_introspect',
1852
+ plan: 'optional - plan value consumed by #auto_introspect',
1853
+ ts_state: 'optional - ts state value consumed by #auto_introspect'
1854
+ )
1855
+
1856
+ # Run flip last outcome and return its result
1857
+ #{self}.flip_last_outcome(
1858
+ session_id: 'optional - session id value consumed by #flip_last_outcome',
1859
+ reason: 'optional - reason value consumed by #flip_last_outcome'
1860
+ )
1861
+
1862
+ # Run consolidate and return its result
1863
+ #{self}.consolidate(
1864
+ max_entries: 'optional - hard cap on PWN::Memory size (default MAX_MEMORY_ENTRIES)'
1865
+ )
1866
+
1867
+ # Run reset and return its result
1868
+ #{self}.reset
1869
+
1870
+ # One-shot / on-load repair: rewrite tags+details where verdict label
1871
+ #{self}.reconcile_verdict_tags!(
1872
+ dry_run: 'optional - dry run value consumed by #reconcile_verdict_tags!'
1873
+ )
1874
+
1875
+ # Run prune outcomes and return its result
1876
+ #{self}.prune_outcomes!(
1877
+ dry_run: 'optional - Boolean (default false)',
1878
+ max_rows: 'optional - hard cap (default MAX_OUTCOME_ROWS)',
1879
+ retain_days: 'optional - age floor for low-value drop',
1880
+ recent_days: 'optional - always keep newer than this',
1881
+ details_max: 'optional - details max value consumed by #prune_outcomes!',
1882
+ gold_min_score: 'optional - gold min score value consumed by #prune_outcomes!'
1883
+ )
1884
+
1885
+ # Memory lean + outcome prune
1886
+ #{self}.lean!(
1887
+ dry_run: 'optional - dry run value consumed by #lean!',
1888
+ max_entries: 'optional - max entries value consumed by #lean!',
1889
+ max_rows: 'optional - max rows value consumed by #lean!',
1890
+ retain_days: 'optional - retain days value consumed by #lean!',
1891
+ recent_days: 'optional - recent days value consumed by #lean!',
1892
+ details_max: 'optional - details max value consumed by #lean!',
1893
+ gold_min_score: 'optional - gold min score value consumed by #lean!'
1894
+ )
1895
+
1896
+ # One-shot lean across memory + learning + mistakes + sessions
1897
+ #{self}.gc_stores!(
1898
+ dry_run: 'optional - Boolean (default false)',
1899
+ current_session_id: 'optional - never delete this sessions id',
1900
+ max_entries: 'optional - Memory consolidate cap',
1901
+ max_rows: 'optional - learning.jsonl cap',
1902
+ retain_days: 'optional - outcome / session age floor',
1903
+ recent_days: 'optional - recent days value consumed by #gc_stores!',
1904
+ details_max: 'optional - details max value consumed by #gc_stores!',
1905
+ gold_min_score: 'optional - gold min score value consumed by #gc_stores!',
1906
+ max_files: 'optional - max files value consumed by #gc_stores!'
1907
+ )
1908
+
1909
+ # One-shot GC of the pre-R1 garbage: drops every PWN::Memory entry
1910
+ #{self}.purge_noise
1911
+
1912
+ # Print the AUTHOR(S) string for this module.
1913
+ #{self}.authors
1914
+ "
1915
+ constants.sort
1799
1916
  end
1800
1917
  end
1801
1918
  end
@@ -3071,52 +3071,59 @@ module PWN
3071
3071
  # Display Usage for this Module
3072
3072
 
3073
3073
  public_class_method def self.help
3074
- puts <<~USAGE
3075
- USAGE:
3076
- final = PWN::AI::Agent::Loop.run(
3077
- request: 'what does `id` return on this host?',
3078
- session_id: PWN::Sessions.create[:id],
3079
- enabled_toolsets: %w[terminal pwn memory skills],
3080
- on_tool: ->(name, args, result) { puts "→ \#{name}: \#{result[0,1_024]}" },
3081
- system_role_content: 'You are a helpful assistant that can call tools to answer questions.'
3082
- )
3083
- # Live task summaries (default ON): BEFORE each tool *collection*,
3084
- # on_tool('task', high_level_brief, '') — one-to-many with real tools.
3085
- # Task lines never carry a result payload (no result row in the TUI).
3086
- # so repl.rb prints name=task with arg_preview=summary. Also coalesce bursts into
3087
- # via on_tool only: [ ts → pwn-ai task ] <brief> (no [pwn-ai/task] prefix)
3088
- # Toggle via PWN::Env[:ai][:agent]:
3089
- # task_summary: true|false
3090
- # task_summary_every: 5 # emit every N tools
3091
- # task_summary_interval_s: 8.0 # or every N seconds
3092
- # task_summary_verbose: false
3093
-
3094
- Supported engines: #{ENGINE_MODS.keys.join(', ')}
3095
- Set PWN::Env[:ai][:active] to choose.
3096
-
3097
- Intent routing (all engines; critical for ollama/openwebui):
3098
- how-to / usage questions → text-only explanation (no tools, no plan_first)
3099
- pure prior-turn recall ("what did I just say?") → answer_recall (no tools)
3100
- pure greeting / light smalltalk answer_greeting (no tools, no weather echo)
3101
- live sweeps are host-work goals like any other — pwn-ai does not
3102
- decide authorization
3103
- Local-model scaffolding (PWN::Env[:ai][:agent]):
3104
- :plan_first - Boolean, plan-then-act pre-pass (default: local engine :ollama/:openwebui)
3105
- :tool_router - Boolean/nil, slim Registry.definitions (nil=auto on for ollama)
3106
- :escalation_persona - Swarm persona name for frontier corrective hints when stuck
3107
- :critic - S3 constitutional critic before every final (Boolean)
3108
- :red_team_plan - S4 adversarial plan review after plan_first (Boolean)
3109
- :counterfactual - S2 A/B branch on REPEAT_THRESHOLD → DPO pair (Boolean)
3110
- :hindsight - C3 HER-relabel failures (Boolean, default true)
3111
- :policy - R5 live tabular Q / REINFORCE (Boolean, default true; advisory only)
3112
- :verify_as_reward - E3 ground every final via extro_verify (Boolean)
3113
-
3114
- P28 autonomy: incomplete-final detector refuses mid-goal handoffs.
3115
- Loop.run keeps CORE_TOOLS until may_finalize? there is no
3116
- iteration-budget abort.
3117
-
3118
- #{self}.authors
3119
- USAGE
3074
+ puts "USAGE:
3075
+ # Run debug on and return its result
3076
+ #{self}.debug_on?(
3077
+ debug: 'optional - debug value consumed by #debug_on?'
3078
+ )
3079
+
3080
+ # True only when the ask needs a live host/file/browser effect. World-knowledge
3081
+ #{self}.catalog_lookup?(
3082
+ request: 'required - request value consumed by #catalog_lookup?'
3083
+ )
3084
+
3085
+ # Run world knowledge and return its result
3086
+ #{self}.world_knowledge?(
3087
+ request: 'required - request value consumed by #world_knowledge?'
3088
+ )
3089
+
3090
+ # Run needs host work and return its result
3091
+ #{self}.needs_host_work?(
3092
+ request: 'required - request value consumed by #needs_host_work?'
3093
+ )
3094
+
3095
+ # Run ollama wire messages and return its result
3096
+ #{self}.ollama_wire_messages(
3097
+ messages: 'required - in-memory OpenAI-ish messages (may have String args)'
3098
+ )
3099
+
3100
+ # Run openai wire messages and return its result
3101
+ #{self}.openai_wire_messages(
3102
+ messages: 'required - in-memory OpenAI-ish messages (may have Hash args / internal keys)'
3103
+ )
3104
+
3105
+ # Run request intent and return its result
3106
+ #{self}.request_intent(
3107
+ request: 'optional - request value consumed by #request_intent'
3108
+ )
3109
+
3110
+ # Run run and return its result
3111
+ #{self}.run(
3112
+ request: 'required - what the human typed',
3113
+ session_id: 'optional - PWN::Sessions id (transcript is appended to it)',
3114
+ enabled_toolsets: 'optional - subset of Registry.toolsets, or nil for all',
3115
+ on_tool: 'optional - ->(name, args, result) callback for live UI',
3116
+ system_role_content: 'optional - override default system prompt (built from session_id if not provided)',
3117
+ debug: 'optional - debug value consumed by #run',
3118
+ from: 'optional - sender account or address to bind as operator',
3119
+ account: 'optional - operator account id to bind',
3120
+ force_tools: 'optional - force tools value consumed by #run'
3121
+ )
3122
+
3123
+ # Print the AUTHOR(S) string for this module.
3124
+ #{self}.authors
3125
+ "
3126
+ constants.sort
3120
3127
  end
3121
3128
  end
3122
3129
  end
@@ -651,29 +651,139 @@ module PWN
651
651
  # Display Usage for this Module
652
652
 
653
653
  public_class_method def self.help
654
- puts <<~USAGE
655
- USAGE:
656
- PWN::AI::Agent::Metrics.record(name: 'shell', success: true, duration: 0.42, engine: :ollama)
657
- PWN::AI::Agent::Metrics.summary(limit: 10, engine: :ollama)
658
- PWN::AI::Agent::Metrics.to_context(limit: 8, engine: :ollama) # injected by PromptBuilder
659
- PWN::AI::Agent::Metrics.ucb(name: 'shell') # C1 exploration bonus
660
- PWN::AI::Agent::Metrics.thompson(name: 'shell') # C1 Beta(ok+1,fail+1) sample
661
- PWN::AI::Agent::Metrics.advantage(name: 'shell') # C1 local − global (P20 judge-blended)
662
- PWN::AI::Agent::Metrics.record_judge(name: 'shell', score: 0.8) # P20 ORM→metrics
663
- PWN::AI::Agent::Metrics.judge_rate(name: 'shell') # P20 mean ORM
664
- PWN::AI::Agent::Metrics.effective_rate(name: 'shell') # P20 proxy⋈judge
665
- PWN::AI::Agent::Metrics.changepoints(within_secs: 3600) # E1 CUSUM regime changes
666
- PWN::AI::Agent::Metrics.record_calibration(predicted: 0.8, actual: 1.0, brier: 0.04, engine: :ollama)
667
- PWN::AI::Agent::Metrics.calibration(engine: :ollama) # W3 Brier / overconfidence
668
- PWN::AI::Agent::Metrics.scale_prediction(predicted: 0.87) # temperature-scale before Policy/UI
669
- PWN::AI::Agent::Metrics.scoreboard # tool_ok vs task_ok vs judge_ok
670
- PWN::AI::Agent::Metrics.health_line
671
- PWN::AI::Agent::Metrics.reset
672
- PWN::AI::Agent::Metrics.load
673
- PWN::AI::Agent::Metrics.save(metrics: hash)
674
-
675
- #{self}.authors
676
- USAGE
654
+ puts "USAGE:
655
+ # Run load and return its result
656
+ #{self}.load
657
+
658
+ # Run save and return its result
659
+ #{self}.save(
660
+ metrics: 'required - Hash returned by .load / mutated in place'
661
+ )
662
+
663
+ # Run record and return its result
664
+ #{self}.record(
665
+ name: 'required - tool name that was dispatched',
666
+ success: 'required - Boolean, did the handler complete without error',
667
+ duration: 'optional - Float seconds the dispatch took',
668
+ error: 'optional - String error message when success is false',
669
+ engine: 'optional - Symbol/String AI engine that chose this tool (segments telemetry)'
670
+ )
671
+
672
+ # Run summary and return its result
673
+ #{self}.summary(
674
+ limit: 'optional - cap number of tools returned (default 25)',
675
+ engine: 'optional - only that engine\\s sub-bucket (falls back to global when absent)'
676
+ )
677
+
678
+ # Run to context and return its result
679
+ #{self}.to_context(
680
+ limit: 'optional - cap number of tools included (default 8)',
681
+ engine: 'optional - restrict to one engine\\s telemetry'
682
+ )
683
+
684
+ # P4 helper — Registry.rank calls this so β·advantage is scaled down
685
+ #{self}.proxy_trust
686
+
687
+ # Run ucb and return its result
688
+ #{self}.ucb(
689
+ name: 'optional - binary or identifier name',
690
+ c: 'optional - c value consumed by #ucb'
691
+ )
692
+
693
+ # Run thompson and return its result
694
+ #{self}.thompson(
695
+ name: 'optional - binary or identifier name'
696
+ )
697
+
698
+ # Run advantage and return its result
699
+ #{self}.advantage(
700
+ name: 'optional - binary or identifier name'
701
+ )
702
+
703
+ # Run prm advantage and return its result
704
+ #{self}.prm_advantage(
705
+ name: 'optional - binary or identifier name'
706
+ )
707
+
708
+ # Run prm n and return its result
709
+ #{self}.prm_n(
710
+ name: 'optional - binary or identifier name'
711
+ )
712
+
713
+ # P18 — called by Reward.prm after session annotate so live routing
714
+ #{self}.record_step_reward(
715
+ name: 'required - binary or identifier name',
716
+ reward: 'optional - reward value consumed by #record_step_reward'
717
+ )
718
+
719
+ # P20 — fold ORM judge (0..1) into per-tool telemetry so UCB /
720
+ #{self}.record_judge(
721
+ name: 'required - binary or identifier name',
722
+ score: 'optional - score value consumed by #record_judge',
723
+ confidence: 'optional - confidence value consumed by #record_judge',
724
+ source: 'optional - source value consumed by #record_judge'
725
+ )
726
+
727
+ # P1 — mean judge confidence for a tool (nil when no samples)
728
+ #{self}.judge_confidence(
729
+ name: 'optional - binary or identifier name'
730
+ )
731
+
732
+ # Mean judge score for a tool (nil when no ORM samples yet)
733
+ #{self}.judge_rate(
734
+ name: 'optional - binary or identifier name'
735
+ )
736
+
737
+ # Blended success rate: when proxy_distrust > 0 and judge samples
738
+ #{self}.effective_rate(
739
+ name: 'optional - binary or identifier name'
740
+ )
741
+
742
+ # Run changepoints and return its result
743
+ #{self}.changepoints(
744
+ cause: 'optional - :env_drift and does NOT count toward [REPEATING].',
745
+ within_secs: 'optional - within secs value consumed by #changepoints'
746
+ )
747
+
748
+ # W3 — plan_first emits p(success); Loop.run calls this with the
749
+ #{self}.record_calibration(
750
+ engine: 'optional - engine value consumed by #record_calibration (defaults to :global))',
751
+ brier: 'optional - brier value consumed by #record_calibration',
752
+ predicted: 'optional - predicted value consumed by #record_calibration',
753
+ actual: 'optional - actual value consumed by #record_calibration'
754
+ )
755
+
756
+ # Run calibration and return its result
757
+ #{self}.calibration(
758
+ engine: 'required - engine value consumed by #calibration'
759
+ )
760
+
761
+ # Run calibration green and return its result
762
+ #{self}.calibration_green?(
763
+ engine: 'optional - engine value consumed by #calibration_green?'
764
+ )
765
+
766
+ # Run scale prediction and return its result
767
+ #{self}.scale_prediction(
768
+ predicted: 'optional - predicted value consumed by #scale_prediction',
769
+ engine: 'optional - engine value consumed by #scale_prediction'
770
+ )
771
+
772
+ # Run scoreboard and return its result
773
+ #{self}.scoreboard(
774
+ engine: 'optional - engine value consumed by #scoreboard'
775
+ )
776
+
777
+ # Run health line and return its result
778
+ #{self}.health_line
779
+
780
+ # Run reset and return its result
781
+ #{self}.reset
782
+
783
+ # Print the AUTHOR(S) string for this module.
784
+ #{self}.authors
785
+ "
786
+ constants.sort
677
787
  end
678
788
  end
679
789
  end
@@ -843,23 +843,132 @@ module PWN
843
843
  # Display Usage for this Module
844
844
 
845
845
  public_class_method def self.help
846
- puts <<~USAGE
847
- USAGE:
848
- PWN::AI::Agent::Mistakes.record(tool: 'shell', error: 'nmpa: command not found', args: '{"command":"nmpa -sV"}')
849
- PWN::AI::Agent::Mistakes.top(limit: 10, unresolved_only: true)
850
- PWN::AI::Agent::Mistakes.find(signature: 'abc123def456')
851
- PWN::AI::Agent::Mistakes.for_tool(tool: 'shell')
852
- PWN::AI::Agent::Mistakes.resolve(signature: 'abc123def456', fix: 'binary is spelled `nmap`, not `nmpa`')
853
- PWN::AI::Agent::Mistakes.correction_hint(tool: 'shell', error: err) # inline self-correct
854
- PWN::AI::Agent::Mistakes.to_context(limit: 6) # injected by PromptBuilder
855
- PWN::AI::Agent::Mistakes.correction?(request: "no that's wrong")
856
- PWN::AI::Agent::Mistakes.check_user_correction(request: req, session_id: sid)
857
- PWN::AI::Agent::Mistakes.signature(tool: 'shell', error: err)
858
- PWN::AI::Agent::Mistakes.operator_inbox(limit: 12)
859
- PWN::AI::Agent::Mistakes.reset
860
-
861
- #{self}.authors
862
- USAGE
846
+ puts "USAGE:
847
+ # Run load and return its result
848
+ #{self}.load
849
+
850
+ # Run save and return its result
851
+ #{self}.save(
852
+ store: 'optional - store value consumed by #save'
853
+ )
854
+
855
+ # Run signature and return its result
856
+ #{self}.signature(
857
+ tool: 'required - tool/component name that failed',
858
+ error: 'required - raw error text (will be normalised)'
859
+ )
860
+
861
+ # Run find and return its result
862
+ #{self}.find(
863
+ signature: 'optional - exact signature to fetch',
864
+ tool: 'optional - with error:, compute signature and fetch',
865
+ error: 'optional - raw error text (used with tool:)'
866
+ )
867
+
868
+ # Run for tool and return its result
869
+ #{self}.for_tool(
870
+ tool: 'required - tool name',
871
+ unresolved_only: 'optional - default false'
872
+ )
873
+
874
+ # Run record and return its result
875
+ #{self}.record(
876
+ tool: 'required - tool/component that produced the failure',
877
+ error: 'required - error text / message',
878
+ args: 'optional - args that triggered it (stored truncated as sample)',
879
+ session_id: 'optional - PWN::Sessions id',
880
+ source: 'optional - :tool | :user_correction | :loop | :model | :heuristic (default :tool)',
881
+ force: 'optional - force value consumed by #record',
882
+ meta: 'optional - meta value consumed by #record',
883
+ cause: 'optional - cause value consumed by #record (defaults to :self))',
884
+ shape: 'optional - shape value consumed by #record',
885
+ needs_code_change: 'optional - needs code change value consumed by #record'
886
+ )
887
+
888
+ # Run resolve and return its result
889
+ #{self}.resolve(
890
+ signature: 'required - mistake signature (from mistakes_list / .top)',
891
+ fix: 'required - what to do INSTEAD next time',
892
+ structured: 'optional - structured value consumed by #resolve',
893
+ clear_needs_code_change: 'optional - clear needs code change value consumed by #resolve'
894
+ )
895
+
896
+ # Run top and return its result
897
+ #{self}.top(
898
+ limit: 'optional - max rows (default 10)',
899
+ unresolved_only: 'optional - default true',
900
+ practiceable_only: 'optional - practiceable only value consumed by #top'
901
+ )
902
+
903
+ # Run extinguish and return its result
904
+ #{self}.extinguish!(
905
+ signature: 'optional - signature value consumed by #extinguish!',
906
+ shape: 'optional - shape value consumed by #extinguish!',
907
+ force: 'optional - force value consumed by #extinguish!'
908
+ )
909
+
910
+ # Auto-resolve parked items that already have a known extinguish recipe
911
+ #{self}.extinguish_parked!(
912
+ limit: 'optional - limit value consumed by #extinguish_parked!',
913
+ dry_run: 'optional - dry run value consumed by #extinguish_parked!'
914
+ )
915
+
916
+ # Run park and return its result
917
+ #{self}.park(
918
+ signature: 'required - signature value consumed by #park',
919
+ reason: 'optional - reason value consumed by #park'
920
+ )
921
+
922
+ # Operator inbox: parked / needs_code_change / needs_human scars that
923
+ #{self}.operator_inbox(
924
+ limit: 'optional - limit value consumed by #operator_inbox'
925
+ )
926
+
927
+ # Run to context and return its result
928
+ #{self}.to_context(
929
+ limit: 'optional - limit value consumed by #to_context (defaults to 6)',
930
+ request: 'optional - request value consumed by #to_context',
931
+ include_open: 'optional - include open value consumed by #to_context',
932
+ full: 'optional - full value consumed by #to_context'
933
+ )
934
+
935
+ # Run correction hint and return its result
936
+ #{self}.correction_hint(
937
+ tool: 'required - tool that just failed',
938
+ error: 'required - raw error it failed with'
939
+ )
940
+
941
+ # Run correction and return its result
942
+ #{self}.correction?(
943
+ request: 'optional - request value consumed by #correction?'
944
+ )
945
+
946
+ # Run check user correction and return its result
947
+ #{self}.check_user_correction(
948
+ request: 'required - the incoming user message',
949
+ session_id: 'optional - session to inspect for the previous answer'
950
+ )
951
+
952
+ # Run lean and return its result
953
+ #{self}.lean!(
954
+ dry_run: 'optional - Boolean (default false)',
955
+ max_resolved_kept: 'optional - cap on resolved-with-fix records',
956
+ resolved_min_age_days: 'optional - age before resolved count=1 may drop'
957
+ )
958
+
959
+ # Run reset and return its result
960
+ #{self}.reset
961
+
962
+ # Age-weighted count for [REPEATING] threshold — a ×8 signature from
963
+ #{self}.effective_count(
964
+ mistake: 'optional - mistake value consumed by #effective_count',
965
+ signature: 'optional - signature value consumed by #effective_count'
966
+ )
967
+
968
+ # Print the AUTHOR(S) string for this module.
969
+ #{self}.authors
970
+ "
971
+ constants.sort
863
972
  end
864
973
  end
865
974
  end
@@ -67,15 +67,31 @@ module PWN
67
67
  end
68
68
 
69
69
  public_class_method def self.help
70
- puts <<~USAGE
71
- USAGE:
72
- PWN::AI::Agent::OpenGoal.begin!(request: '...', session_id: '...')
73
- PWN::AI::Agent::OpenGoal.current
74
- PWN::AI::Agent::OpenGoal.resume?(request: 'continue')
75
- PWN::AI::Agent::OpenGoal.clear!
76
-
77
- #{self}.authors
78
- USAGE
70
+ puts "USAGE:
71
+ # Run goal file and return its result
72
+ #{self}.goal_file
73
+
74
+ # Run current and return its result
75
+ #{self}.current
76
+
77
+ # Run begin and return its result
78
+ #{self}.begin!(
79
+ request: 'required - request value consumed by #begin!',
80
+ session_id: 'optional - session id value consumed by #begin!'
81
+ )
82
+
83
+ # Run clear and return its result
84
+ #{self}.clear!
85
+
86
+ # Run resume and return its result
87
+ #{self}.resume?(
88
+ request: 'optional - request value consumed by #resume?'
89
+ )
90
+
91
+ # Print the AUTHOR(S) string for this module.
92
+ #{self}.authors
93
+ "
94
+ constants.sort
79
95
  end
80
96
  end
81
97
  end