pwn 0.5.798 → 0.5.800

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9fd12f22a3f9a9d4d6bf1188611efda40635ebe6a14f1d279c2a2a9bdc50e52e
4
- data.tar.gz: 1e6626db3bcb24d03d1ae169304d7bba96dca1cff32f14f74c362d547ad3f8ae
3
+ metadata.gz: 56a736106e65e77d80e40f36fbe1769a6a781c0238f32d4a1b2b167057799c71
4
+ data.tar.gz: 21ff5fbd244d4d43fc7a089a12e6f6cd20552964d09b40d6d7e2ef81bc107dec
5
5
  SHA512:
6
- metadata.gz: 6a64e04125b968f0379a8dc6e838897ca3975ca5b992a0368f8d9758f2e9971145cd2e53d21ca6cbbd7b3f91a3c76b23245241199517f5596980229193a88c70
7
- data.tar.gz: 37c6dcfb41e00ddf1ce62ba958e54c0e6f24f931a5ca0a965c0c11299a36d7ab6bf999793b278704d8222e8ebd62cf98a56ee9855e9d48cfb15dbce7316c6326
6
+ metadata.gz: b3058ac66d77c60c5cd44c695d7d1a26e77c715c1210c4f9c41ed414c2dca5dd4b4ed9ee0650b07f5df3222d522d8f07b9f813d8ad8934a729659f1a1a7f2d15
7
+ data.tar.gz: 40ae8191eba1dcecdbb9ca0543b09493d1365129b0048a11629ecccc48defb94b5156235cf57777e8acaf8fd737639c3f487d5865e6358fd99d6528a27e6b265
@@ -1,158 +1,183 @@
1
- 27c8b2b5 Merge pull request #1009 from ninp0/master
2
- 3af915b9 `pwn-ai` - deal with ReadTimeout when dealing w/ large payloads
3
- a06f59d6 Merge pull request #1008 from ninp0/master
4
- 3a87fdd5 `pwn-ai` - deal with HTTP 502, 503, 504 responses from LLM provider
5
- 7fde94c2 Merge pull request #1007 from ninp0/master
6
- 7a11fabd `pwn-ai` - Create timeout bounds for `shell` and `pwn_eval` tools ranging from 30-10_800 seconds incrementing 180 seconds until command completes or timeout after 3hrs is triggered steering a different approach. Also added `/model` command suite (with command completion) to quickly list / switch providers/model in an active `pwn-ai` session that persist cross-session
7
- 74890a72 Merge pull request #1006 from ninp0/master
8
- 05609003 PWN::AI::RedTeam namespace - extend modules to include attack methods described in OWASP Top 10 for LLM Applications 2025 / 2026 && AI Red Teaming Solutions Taxonomy
9
- 12c51f86 Merge pull request #1005 from ninp0/master
10
- 9a9511a5 Better Google Workspace authZ within `pwn-ai` #rubocop_fixes
11
- 3563cf03 Better Google Workspace authZ within `pwn-ai`
12
- 88fa6bd0 Better Google Workspace authZ within `pwn-ai`
13
- 7aeeb7c1 Merge pull request #1004 from ninp0/master
14
- 31d74e1d Add default skills for the entire PWN namespace
15
- b13d6392 pwn-ai - toggle-debug tmp file output bugfixes
16
- 341b0063 Merge pull request #1003 from ninp0/master
17
- 0422844d pwn-ai - begin implementing command menu, add path completion, and default cwe, capec, and ATT&CK skills
18
- 2bb98aa8 pwn-ai - begin implementing command menu, add path completion, and default cwe, capec, and ATT&CK skills
19
- b891eec4 Merge pull request #1002 from ninp0/master
20
- 6f20948b .ruby-version - Bump to 4.0.6 && implement `toggle-debug` in pwn REPL to gernerate `pwn-ai` logs for troubleshooting unexpected behavior
21
- 2a1026a9 .ruby-version - Bump to 4.0.6 && implement `toggle-debug` in pwn REPL to gernerate `pwn-ai` logs for troubleshooting unexpected behavior
22
- bee1d16e Merge pull request #1001 from ninp0/master
23
- d9bc8906 `pwn-ai` - implement verbose logging to /tmp and STDOUT when `toggle-pwn-ai-debug` == true
24
- 21433603 Merge pull request #1000 from ninp0/master
25
- ed4f4963 `pwn setup --migrate` - include default set of skills that live in /opt/pwn/etc/default_skills
26
- fed5a3be PWN::AI::Agent::Registry module - implement tool priority order preferences (including broader list of tools), `spin.stop` object #bugfix in `pwn-ai`, and documentation updates
27
- c99edf8b PWN::AI::Agent::Registry module - implement tool priority order preferences (including broader list of tools), `spin.stop` object #bugfix in `pwn-ai`, and documentation updates
28
- b5cb837b Merge pull request #999 from ninp0/master
29
- 3e26dfdb pwn-ai - eliminate request types and consolidate into the same logic (i.e. question vs statement vs autonomous_goal simply become autonomous_goal)
30
- c8b19465 pwn-ai #bugfixes / #enhancements related to autonomous_goal completion
31
- 67d30408 Merge pull request #998 from ninp0/master
32
- c83b239e More `spin.stop` object #bugfixes in `pwn-ai` and enhancement when submitting a statement.
33
- ba022c5c Merge pull request #997 from ninp0/master
34
- 16c21652 PWN::AI::Agent::Registry module - implement tool priority order preferences, `spin.stop` object #bugfix in `pwn-ai`, and documentation updates
35
- 2fd461a7 Merge pull request #996 from ninp0/master
36
- 212ac1be spinner bugfixes
37
- 270223c2 Merge pull request #995 from ninp0/master
38
- 64cc08fa pwn setup - Implement cron worker line entry to ensure pwn-ai cron jobs are executed on the schedule in which they're defined #bugfixesd
39
- f63e9e58 pwn setup - Implement cron worker line entry to ensure pwn-ai cron jobs are executed on the schedule in which they're defined
40
- 79d9ed03 Merge pull request #994 from ninp0/master
41
- 206c6211 Added PWN::WWW::GitHub module and removed PWN::AI::RedTeam::ModelDenialOfService module - too expensive / exhausts tokens too quickly.
42
- 20fc78c4 Merge pull request #993 from ninp0/master
43
- f8359e61 RL feedback loop enhancements
44
- 2c4d7df0 Merge pull request #992 from ninp0/master
45
- ee44dc6d Faster memory recall for current session and distinguish between users statements, questions, and autonomous goal requests where the latter requires a task breakdown.
46
- 8ff5835b Merge pull request #991 from ninp0/master
47
- f62af554 When using pwn-vault command within the pwn REPL driver, do not allow the editor to leave until PWN::Config confirms a valid config...this prevents cumbersome decrypt/re-edit/encrypt pwn.yaml tasks to get back into the pwn REPL.
48
- c96b74ea Merge pull request #990 from ninp0/master
49
- de9505b6 Decouple ollama and openwebui by creating each as their own provider, memory recall enhancements, more resislient request parsing when using ollama or openwebui
50
- ad53a14e Merge pull request #989 from ninp0/master
51
- 55b0183a README.md - update Groks take on `pwn-ai`.
52
- 908f6ab9 Merge pull request #988 from ninp0/master
53
- 2f3a0ea8 PWN::AI::Grok, PWN::AI::Anthropic, and PWN::AI::OpenAI - persist oauth bearer tokens to pwn.yaml when refresh token are used to refresh AuthZ
54
- e881ca80 Merge pull request #987 from ninp0/master
55
- ff56c555 ~/.pwn - keep files lean in RL feedback loopy
56
- 9df6e56e pwn-ai - t retrieve context in current session morr quickly
57
- 210f41ee Merge pull request #986 from ninp0/master
58
- 7d5488a7 Merge remote-tracking branch 'upstream/master'
59
- af2a13eb pwn-ai - task summarizer to convey task objectives for long running autonomous tasks which drives tools to complete each task until originally submitted user request is complete #round2.
60
- 716fa2a8 Merge pull request #985 from ninp0/master
61
- b03457ac pwn-ai - task summarizer to convey task objectives for long running autonomous tasks which drives tools to complete each task until originally submitted user request is complete.
62
- 9722b8e5 Merge pull request #984 from ninp0/master
63
- 5854f34a pwn-ai - task summarizer to convey task objectives for long running autonomous tasks, iteration exhaustion, and memory recall / learning outcome #bugfixes
64
- 85f6b6d7 Merge pull request #983 from ninp0/master
65
- 066088e5 pwn-ai - Implement a task summarizer to convey task objectives for long running autonomous tasks
66
- 0efb7de9 Merge pull request #982 from ninp0/master
67
- 989c3cea more autonomous fixes
68
- d44703ac Merge pull request #981 from ninp0/master
69
- 2dfd5762 PWN::AI::Agent::Tools::Shell module - long-running shell timeouts should no longer spam IOError errors to STDOUT
70
- c0440049 Merge pull request #980 from ninp0/master
71
- 27ade080 Reinforced learning feedback loop enhancements - better support for long autonomous tasks #round2
72
- 9701e708 Merge pull request #979 from ninp0/master
73
- 52c76428 Reinforced learning feedback loop enhancements - better support for long autonomous tasks
74
- be84dd69 Merge pull request #978 from ninp0/master
75
- 6311b03e #rubocop_fix
76
- c758c22b PWN::Plugins::HackerOne module - cast to hacker api #bump_gem_version_compatibility
77
- 8b0aaf79 PWN::Plugins::HackerOne module - cast to hacker api
78
- 712962e1 Merge pull request #977 from ninp0/master
79
- 6ecd9f29 doocumentation updates
80
- 13d8d16f Merge pull request #976 from ninp0/master
81
- 6333e3e4 Reinforced learning feedback loop enhancements && documentation updates
82
- 690654ec Merge pull request #975 from ninp0/master
83
- 0a644588 Reinforced learning feedback loop enhancements && documentation updates
84
- a23567b7 Merge remote-tracking branch 'upstream/master'
85
- 4330a39a Reinforced learning residual: P26 version-claim widen + pwn_eval EvalWithLocation + style
86
- 1ddd9df5 Reinforced learning residual: deepen P17 budget_hot + P26 claim filter + pwn_eval self-heal
87
- 85534396 Reinforced learning feedback loop: close P0/P1/P2/P17 weakness set
88
- f3f86bdb Merge pull request #974 from ninp0/master
89
- fd964ed4 Reinforced learning feedback loop enhancements && documentation updates
90
- 6533fc41 Merge pull request #973 from ninp0/master
91
- 33235063 Reinforced learning feedback loop enhancements && add oAuth support for PWN::AI::OpenAI && PWN::AI::Anthropic
92
- 97fcfc90 Merge pull request #972 from ninp0/master
93
- 3e66ada6 Reinforced learning feedback loop enhancements, convert ollama provider to stream for faster response times, and refresh documentation to reflect latest features
94
- ebb9c280 Reinforced learning feedback loop enhancements and convert ollama provider to stream for faster response times
95
- 4e7ef952 Merge pull request #971 from ninp0/master
96
- c8286237 Github install-matrix - arbiitrary fixes.
97
- 29ca2745 Merge pull request #970 from ninp0/master
98
- 516af396 pwn_ai_red_team Driver - Initial commit to enable targeted LLM penetration testing (e.g. Jail Breaking, Prompt Injection, etc.)
99
- 02a33526 Merge pull request #969 from ninp0/master
100
- cd97809f Github install-matrix - arbiitrary fixes.
101
- 04d271d5 Merge pull request #968 from ninp0/master
102
- b9111aef More ~/.pwn resilience checking following upgrades
103
- 310df119 Merge pull request #967 from ninp0/master
104
- d041088e Work towards getting install-matrix workflow operable
105
- 1f089d04 Merge pull request #966 from ninp0/master
106
- ffee333f Ensure pwn-ai skills conform to https://agentskills.io/specification
107
- bf484647 Ensure pwn-ai skills conform to https://agentskills.io/specification
108
- 97b444c0 Merge pull request #965 from ninp0/master
109
- 6a000929 More reinforcement learning feedback loop enhancements
110
- 5ace30cb Merge pull request #964 from ninp0/master
111
- d72fe894 Documentation / DFD updates to reflect proper configs / SDR decoder fixes #rake_fixes
112
- de3f5557 Documentation / DFD updates to reflect proper configs / SDR decoder fixes
113
- 2b279191 Merge pull request #963 from ninp0/master
114
- f988e881 Learning FeedBack Loop - enhancements to support smaller LLMs, refined easier installation, and updates to documentation / DFDs
115
- 677fcdc1 Learning FeedBack Loop - enhancements to support smaller, local models
116
- a9cc3625 Merge pull request #962 from ninp0/master
117
- 0cf0c7de README.md - prefer PWN gif over static png
118
- 5904e90d Extrospection tweaks to support things like, what song is playing on a specific FM station, what planes are flying over me, what are strongest RF signals around me, tell me the weather in Tokyo, has the bug bounty page been updated, any known exploits in Apache in 2026, what devices are connected to this laptop, etc.
119
- 690c7c1a fix(gqrx): restore regular-scan edge detection + sane squelch for fm_radio
120
- d94f1243 chore: clear rubocop/rake; extrospection limbs + GQRX scanner polish
121
- 90a41a68 Extrospection tweaks to support things like, what song is playing on a specific FM station, what planes are flying over me, what are strongest RF signals around me, tell me the weather in Tokyo, has the bug bounty page been updated, any known exploits in Apache in 2026, what devices are connected to this laptop, etc.
122
- 1949b9e5 Merge pull request #961 from ninp0/master
123
- 79278f1d Gemfile - pull in latest gem versions, documentation/Configuration.md - exhaustively document pwn.yaml && rename some key/value pairs for clarity.
124
- 5ceb5f6d Merge pull request #960 from ninp0/master
125
- 611da4ac More documentation updates and native ruby SDR decoders
126
- 6831b63f More documentation updates, enhanced "learning from mistakes", and added a few SDR decoders
127
- d65364a5 More documentation updates, enhanced "learning from mistakes", and added a few SDR decoders
128
- 68160bc2 Merge pull request #959 from ninp0/master
129
- fe461f73 More documentation tweaks
130
- 55392d25 Merge pull request #958 from ninp0/master
131
- c85981c9 Cron bugfixes. PWN::AI - feedback loop improvements / extrospection to mirror introspection. Also overhaul README.md , implement more documentation, and DFDs easier to understand, implement `pwn --ai` option within pwn REPL driver, remove deprecated pwn-irc command in favor of PWN::AI::Agent::Tools::Swarm module, etc.
132
- afaad9bc Cron bugfixes. PWN::AI - feedback loop improvements / extrospection to mirror introspection. Also overhaul README.md , implement more documentation, and make DFDs easier to evaluate.
133
- 7d580052 PWN::AI:Grok module - implement oauth. PWN::AI - feedback loop improvements. Also overhaul README.md , implement more documenration, and DFDs.
134
- f37a4f9b PWN::AI:Grok module - implement oauth. PWN::AI - feedback loop improvements. Also overhaul README.md , implement more documenration, and DFDs.
135
- 00a4ea0c Merge pull request #957 from ninp0/master
136
- c477a034 Remove backup file
137
- ee35abbe Merge pull request #956 from ninp0/master
138
- 5119246d Numerous #bugfixes / stability fixes for pwn-ai
139
- 0bdcb3b2 Merge pull request #955 from support-0dayInc/master
140
- b9093859 fix(ai): PWN::AI::Grok.obtain_oauth_bearer_token now reliable for singular long-lived enrollment; guard for secret+Basic auth+error handling+public method; clear user steps for one-time pwn-vault persist (GPG signed for 0dayinc/pwn merge)
141
- ae6a4902 fix(ai): correct PWN::AI::Grok oauth trigger to pass hash arg + guard per pwn_sdlc reference; remove debug puts
142
- 3314cedd Merge pull request #954 from ninp0/master
143
- b12a2745 Gemfile - bump meshtastic version
144
- 0eb50ed7 pwn-ai REPL command - minor bugfixes / optimizations
145
- ec7cfdee Merge pull request #953 from support-0dayInc/master
146
- 1cf42886 feat(ai): PWN::AI::Grok calls authorize endpoint (URL construction + code exchange) only when oauth configured for bearer_token (xAI SuperGrok); full pwn_sdlc pipeline
147
- 83abdf0d Merge remote-tracking branch 'upstream/master'
148
- 53b2b752 Merge pull request #952 from ninp0/master
149
- c6e12194 PWN::Plugins::REPL module - bugfixes in pwn-asm / pwn-ai commands within PWN prototyping REPL. (#951)
150
- 77436d17 PWN::Plugins::REPL module - bugfixes in pwn-asm / pwn-ai commands within PWN prototyping REPL.
151
- 04659d7e Merge remote-tracking branch 'upstream/master'
152
- cbad0e52 pwn: feat(pwn-ai): implement pwn-ai command in pwn REPL driver as an agentic AI harness (GPG signed for 0dayinc/pwn merge) (#950)
153
- 09213be5 feat(pwn-ai): implement pwn-ai command in pwn REPL driver as an agentic AI harness (GPG signed for 0dayinc/pwn merge requirement)
154
- d950414f Implement pwn-ai command in pwn REPL driver as an agentic AI harness.
155
- 94d4bb3e Merge pull request #949 from support-0dayInc/master
156
- 6a169ab4 Finalize pwn gem visibility outside /opt/pwn (ruby-4.0.5@pwn gemset), MFA/OTP prompt handling for rvmsudo gem push $latest_gem in git_commit.sh, pwn-ai REPL driver anthropic (and other) provider response visibility in TUI + system_role_content override bug fix (full pwn_sdlc pipeline)
157
- d3497740 Merge remote-tracking branch 'upstream/master'
158
- e6be6df5 Finalize pwn gem visibility outside /opt/pwn (ruby-4.0.5@pwn gemset), MFA/OTP prompt handling for rvmsudo gem push in git_commit.sh, pwn-ai REPL driver anthropic (and other) provider response visibility in TUI + system_role_content override bug fix (full pwn_sdlc pipeline)
1
+ e9875548 Merge pull request #1089 from ninp0/master
2
+ 53425130 rSpec bugfixes during upgrade #amd64
3
+ a487734e Merge pull request #1088 from ninp0/master
4
+ efc989db rSpec bugfixes during upgrade #amd64
5
+ 15ec49cb rSpec bugfixes during upgrade #amd64
6
+ 32961de0 Merge pull request #1087 from ninp0/master
7
+ 6de379bd pwn-ai - Reasoning Effort #bugfix when updating session titles
8
+ 7c876a4f Merge pull request #1086 from ninp0/master
9
+ 0894db81 rSpec bugfixes during upgrade #amd64
10
+ 784656bb rSpec bugfixes during upgrade #amd64
11
+ c42c19b9 Merge pull request #1085 from ninp0/master
12
+ 0d1f4dc4 rSpec bugfixes during upgrade #aarch64
13
+ 28a5a0d4 Merge pull request #1084 from ninp0/master
14
+ 7e7574bb rSpec bugfixes during upgrade
15
+ bb4158d1 Merge pull request #1083 from ninp0/master
16
+ 94ecee9f rSpec bugfixes during upgrade
17
+ 862fbc36 rSpec bugfixes during upgrade
18
+ e03413eb rSpec bugfixes during upgrade
19
+ 7141b848 rSpec bugfixes during upgrade
20
+ 32c07288 Merge pull request #1082 from ninp0/master
21
+ bd626420 Remove scripts intgegration folder
22
+ ce47ba31 Remove scripts intgegration folder
23
+ 47cc3fd5 Merge pull request #1081 from ninp0/master
24
+ 2d18e8e7 `pwn-ai` - implement sandboxed writes to disk, implement YubiKey compatibility within PWN, and upgrade to latest Ruby stable 4.0.9
25
+ 70358859 `pwn-ai` - implement sandboxed writes to disk
26
+ 4ca64ad1 `pwn-ai` - implementwandboxed writes to diskn
27
+ 7d429657 Merge pull request #1080 from ninp0/master
28
+ 072aa9b5 `pwn-ai` - implement housekeep or ~/.pwn
29
+ bfc69dd4 `pwn-ai` - implement housekeep or ~/.pwn
30
+ 08a61373 Merge pull request #1079 from ninp0/master
31
+ 87c52c70 `pwn-ai` - ehancements centered around `/sessions` commands
32
+ 39717645 Merge pull request #1078 from ninp0/master
33
+ 306bd553 Update complicated DFDs to be more digestable
34
+ 568aa76e Merge pull request #1077 from ninp0/master
35
+ 6581e528 PWN::AI::Agent::Loop - Added evidence-backed completion tracking, failure regressions, isolated evaluations, held-out acceptance, and versioned policy promotion and rollback to PWN to prove PWN improves through verified outcomes, prevent false success claims, and reject or roll back changes that worsen performance.
36
+ e256cd2c PWN::AI::Agent::Loop - Added evidence-backed completion tracking, failure regressions, isolated evaluations, held-out acceptance, and versioned policy promotion and rollback to PWN to prove PWN improves through verified outcomes, prevent false success claims, and reject or roll back changes that worsen performance.
37
+ c8a53623 Merge pull request #1076 from ninp0/master
38
+ 1ca1fd51 PWN::AI::Agent::Loop - more invalid byte sequence in UTF-8 #bugfixes
39
+ b0a4a09f Merge pull request #1075 from ninp0/master
40
+ d00ff67b pwn-mesh - visual enhancements in SENDER / RECEIVER TUI panes
41
+ 12c02347 Merge pull request #1074 from ninp0/master
42
+ d9df8424 PWN::ModuleSkills.refresh #bugfix interrupting latest pull from repo - for hosts already blocked, `cd /opt/pwn && git stash push -m "pwn: preserve legacy generated skills before upgrade" -- etc/default_skills/pwn && ./upgrade_pwn.sh`
43
+ d5b98699 Merge pull request #1073 from ninp0/master
44
+ 7a92b6c2 pwn-meah enhanced TUI8
45
+ d32b9294 Merge pull request #1072 from ninp0/master
46
+ 49ba88fd pwn-ai - #bugfixes in JSON::GeneratorError: "<BYTES>" from ASCII-8BIT to UTF-8
47
+ 2017fc5b pwn-ai - #bugfixes in JSON::GeneratorError: "<BYTES>" from ASCII-8BIT to UTF-8
48
+ d10cd968 Merge pull request #1071 from ninp0/master
49
+ fbcdc861 pwn-ai - #bugfixes in JSON::GeneratorError: "<BYTES>" from ASCII-8BIT to UTF-8
50
+ e564cba9 pwn-ai - #bugfixes in JSON::GeneratorError: "<BYTES>" from ASCII-8BIT to UTF-8
51
+ b38f0e33 Merge pull request #1070 from ninp0/master
52
+ c446483b rSpec bugfixes, PWN::AI provider enhancements, bugfixes, etc.
53
+ 5c59dbb9 Merge pull request #1069 from ninp0/master
54
+ 26a4b968 pwn-ai - loop enhancements && pwn-mesh - support simultaneous MQTT, in addition to active transport methods (i.e. Bluetooth, Serial, TCP) for RX/TX
55
+ 49724928 pwn-ai - loop enhancements && pwn-mesh - support simultaneous MQTT, in addition to active transport methods (i.e. Bluetooth, Serial, TCP) for RX/TX
56
+ 998a37bc pwn-ai - loop enhancements && pwn-mesh - support simultaneous MQTT, in addition to active transport methods (i.e. Bluetooth, Serial, TCP) for RX/TX
57
+ 902ad2f7 pwn-ai - loop enhancements && pwn-mesh - support simultaneous MQTT, in addition to active transport methods (i.e. Bluetooth, Serial, TCP) for RX/TX
58
+ 1324384d pwn-ai - loop enhancementsn
59
+ a035494a Merge pull request #1068 from ninp0/master
60
+ b6efc99b pwn-ai - summarize sessions using llm based on conversation and implement initial session cleanup via cro #rubocoo_fixesn
61
+ a1ad25e7 pwn-ai - summarize sessions using llm based on conversation and implement initial session cleanup via cron
62
+ 3d7b163f pwn-ai - summarize sessions using llm based on conversation and implement initial session cleanup via cron
63
+ 521341b8 Merge pull request #1067 from ninp0/master
64
+ 66012e8e pwn-ai - follow the white rabbit or better yet, follow Jesus.
65
+ c74ea3eb Merge pull request #1066 from ninp0/master
66
+ 4f252002 pwn-ai -make /swarm easier to usr to complete tasks via /swarm mission REQUESTs
67
+ b6e641be Merge pull request #1065 from ninp0/master
68
+ 059d2622 pwn-ai - add couple more animations
69
+ 7fa28dd5 Merge pull request #1064 from ninp0/master
70
+ 614f4ba8 pwn-ai - play the games when pane is active :)
71
+ 95646d98 Merge pull request #1063 from ninp0/master
72
+ d3a571c4 pwn-ai - Display thinking in SESSION pane if the model supports thinking
73
+ bb530b65 Merge pull request #1062 from ninp0/master
74
+ ab570d7a PWN::AI::OpenWebUI - #bugfixes related.to some models not working
75
+ 9da68a91 Merge pull request #1061 from ninp0/master
76
+ 36ed1c3d pwn-ai - better TUI key layouts, implement better token cost estimations, etc.
77
+ 88472937 Merge pull request #1060 from ninp0/master
78
+ f59eb0db PWN::API::Anthropic module - more #bugfixes and #bugifx when upgrading pwn on aarch64 hosts
79
+ ef6fdb48 Merge pull request #1059 from ninp0/master
80
+ d22034af pwn-ai - switch between MISSION CONTROL and SESSION panes to dictate how the TUI behaves
81
+ 11c5bceb Merge pull request #1058 from ninp0/master
82
+ 87138320 PWN::API::Anthropic module - bugfix in schema #rake_rubocop_fixes
83
+ a7cbc325 PWN::API::Anthropic module - bugfix in schema
84
+ 26028690 Merge pull request #1057 from ninp0/master
85
+ ba73d5d9 pwn-ai - TUI slight #tweak in animation pane
86
+ 30f09acf Merge pull request #1056 from ninp0/master
87
+ 9c7f8557 pwn-ai - TUI improvements
88
+ 5a4af7c8 Merge pull request #1055 from ninp0/master
89
+ bdb68fa1 pwn-ai - TUI overhaul and introduce new capabilities in BTC and ETH modules for intelligence gathering w/in PWN::Blockchain namespace
90
+ 1913053a Merge pull request #1054 from ninp0/master
91
+ f62887f2 rake - failure #bugfixes
92
+ 742471ad Merge pull request #1053 from ninp0/master
93
+ 828cc5fe Gemfile - bump gems to latest versions #rspec_fix
94
+ 6e251e1b Gemfile - bump gems to latest versions
95
+ f6561a02 Merge pull request #1052 from ninp0/master
96
+ 5f2dee20 rake - fix some rake failures on hosts that already have pwn installed.
97
+ 2d321bcd Merge pull request #1051 from ninp0/master
98
+ d568ffae pwn-ai - self-improving skill features for skills that reside in ~/.pwn/skills
99
+ a3c1dd0d Merge pull request #1050 from ninp0/master
100
+ 955ed7d5 pwn-ai - update metrics, better autonomous task support, etc.
101
+ aabf1e3b Merge pull request #1049 from ninp0/master
102
+ f2181634 pwn-mesh - #bugfixes
103
+ 701b2e1d Merge pull request #1048 from ninp0/master
104
+ ceb0529a pwn-ai - #bugfixes
105
+ 3b8c23a8 Merge pull request #1047 from ninp0/master
106
+ 92f838a0 pwn-mesh - rx && TUI enhancements / #bugfixes
107
+ 0d4a7e7c Merge pull request #1046 from ninp0/master
108
+ cdcce4d5 pwn-ai - many enhancements
109
+ 7f748aa0 Merge pull request #1045 from ninp0/master
110
+ 263bd5f6 pwn-ai - wire MCP modules in PWN::AI::Registry
111
+ 608f7c79 Merge pull request #1044 from ninp0/master
112
+ 83aff489 pwn-ai - more enhancements
113
+ 7a19243d Merge pull request #1043 from ninp0/master
114
+ 91b8f1fa pwn-mesh in pwn REPL - more #bugfixes
115
+ 4ab81121 Merge pull request #1042 from ninp0/master
116
+ fc9e13d4 pwn-mesh in pwn REPL -dynamic sized conv windows
117
+ fa019918 Merge pull request #1041 from ninp0/master
118
+ 073f135a pwn-mesh in pwn REPL - chunk long messages
119
+ 786be04b Merge pull request #1040 from ninp0/master
120
+ 8c013427 PWN::Plugins::REPL overhaul
121
+ 4fd42a02 Merge pull request #1039 from ninp0/master
122
+ ef707e20 Gemfile - bump gem versions
123
+ 4c8a5567 Merge pull request #1038 from ninp0/master
124
+ 9844ccd8 Add MCP compatibility
125
+ 3c9afd0d Merge pull request #1037 from ninp0/master
126
+ 140fe522 rSpec #bugfixes
127
+ c6481bac rSpec #bugfixes
128
+ 9f612ed5 Merge pull request #1036 from ninp0/master
129
+ 7ba5358e rSpec #bugfixes
130
+ d7c8a99c Merge pull request #1035 from ninp0/master
131
+ b7b3042e Spec to ensure pwn stays Ruby, bugfix when executing identical payloads, cleanup temp research files, rake fixes, and PWN::SDR::Decoder module updates
132
+ 6aa2d7fa Spec to ensure pwn stays Ruby, bugfix when executing identical payloads, cleanup temp research files, and PWN::SDR::Decoder module updates
133
+ 3bd68315 Spec to ensure pwn stays Ruby, bugfix when executing identical payloads, and PWN::SDR::Decoder module updates
134
+ 8824e019 Merge pull request #1034 from ninp0/master
135
+ b11fe9dd pwn-ai - support CTRL+D for exiting (in addtion to `back`) and enable thinking for models that support it in favor of task summarizer
136
+ 2c589aec Merge pull request #1033 from ninp0/master
137
+ d09855d6 PWN::AI::OpenAI - more model-based #bugfixes
138
+ dcbb7a0e Merge pull request #1032 from ninp0/master
139
+ 76f58aca PWN::AI::OpenAI - more model-based bugfixes / better oAuth handling
140
+ 2800b698 Merge pull request #1031 from ninp0/master
141
+ 914ab17c `pwn-ai` - enhancements
142
+ 6095bd18 Merge pull request #1030 from ninp0/master
143
+ 03fd5c58 `pwn-ai` - enhancements
144
+ 0895b0cc Merge pull request #1029 from ninp0/master
145
+ 1d78a19f `pwn-ai` - enhancements
146
+ e430b2c6 Merge pull request #1028 from ninp0/master
147
+ 2bb5a16f PWN::Plugins::ExploitDB module - sync ExploitDB and GTFOBins to ~/.pwn/intel/ #gtfobins_bugfix, PWN::Plugins::DetectOS.living_off_the_land #bugfix
148
+ 97aebfff Merge pull request #1027 from ninp0/master
149
+ 4729946e PWN::Plugins::ExploitDB module - sync ExploitDB and GTFOBins to ~/.pwn/intel/
150
+ f0783c72 Merge pull request #1026 from ninp0/master
151
+ 8e3dbc36 PWN::Plugins::DerectOS - better logic in living_off_the_land method #no_caps
152
+ b591dae7 Merge pull request #1025 from ninp0/master
153
+ 99e9ac9d PWN::Plugins::DerectOS - better logic in living_off_the_land method
154
+ 7d994d85 `pwn-ai` - fix referenced debug path when `toggle-debug` is true
155
+ 753fb9a3 Merge pull request #1024 from ninp0/master
156
+ bbc06594 `pwn-ai` - enhancements
157
+ 835787e9 Merge pull request #1023 from ninp0/master
158
+ 04c94e1a `pwn-ai` - enhancements
159
+ e1841493 Merge pull request #1022 from ninp0/master
160
+ 327c322c `pwn setup <OPTIONS>` - detect operating system in which pwn is installed and act accordingly when installing profiles, dependencies, etc. #bugfixes
161
+ f6384b70 Merge pull request #1021 from ninp0/master
162
+ 230a4446 `pwn setup <OPTIONS>` - detect operating system in which pwn is installed and act accordingly when installing profiles, dependencies, etc.
163
+ 1e7929ec Merge pull request #1020 from ninp0/master
164
+ cc45bb5f `pwn-ai` - enhancements
165
+ a6427bc3 Merge pull request #1019 from ninp0/master
166
+ ec8ebe30 PWN namespace enforce help method rrquirements for optimal referencing
167
+ 9b8a4290 Merge pull request #1018 from ninp0/master
168
+ 843f1a74 `pwn-ai` - more capability fixes / external prompt injection prevention
169
+ 0533b2d9 Merge pull request #1017 from ninp0/master
170
+ 7d4169b6 PWN::Reports namespace - add generic report creation modules (e.g. PDF, CSV, HTML, etc) && `pwn-ai` - more capability fixes that align w/ offsec research
171
+ be3a7630 Merge pull request #1016 from ninp0/master
172
+ 90749591 `pwn-ai` - enhancements
173
+ 9db0503c Merge pull request #1015 from ninp0/master
174
+ c48923df `pwn-ai` - implement more verbose and interactive `toggle-trace` / ensure pwn/etc/default_skills recursively stay in sync with those installed in ~/.pwn #bugfixes
175
+ 1a7c2a75 Merge pull request #1014 from ninp0/master
176
+ 6b377e93 `pwn-ai` - implement more verbose and interactive `toggle-trace` / ensure pwn/etc/default_skills recursively stay in sync with those installed in ~/.pwn
177
+ 7696bd79 Merge pull request #1013 from ninp0/master
178
+ 5dc90ff0 `pwn-ai` - debug-log-driven #bugfixes
179
+ cdd834bb Merge pull request #1012 from ninp0/master
180
+ 2b7b7e48 `pwn-ai` - debug-log-driven #bugfixes
181
+ 59f3ced0 Merge pull request #1011 from ninp0/master
182
+ 2d22ebcd `pwn-ai` - debug-log-driven #bugfixes
183
+ 3dee3957 Merge pull request #1010 from ninp0/master
data/lib/pwn/ai/ollama.rb CHANGED
@@ -147,6 +147,11 @@ module PWN
147
147
  stream_err = "ERROR: Ollama HTTP #{code} for #{rest_call}: #{buf.to_s[0, 800]}"
148
148
  return
149
149
  end
150
+ unless http_body.key?(:tools)
151
+ # Text replies are UTF-8 on the wire. A character may span several reads.
152
+ buf.force_encoding(Encoding::UTF_8)
153
+ raise 'ERROR: Ollama text response contains invalid UTF-8' unless buf.valid_encoding?
154
+ end
150
155
  if buf.to_s.strip.empty?
151
156
  stream_err = "ERROR: Ollama empty stream body for #{rest_call} (HTTP #{code})"
152
157
  return
@@ -158,6 +158,11 @@ module PWN
158
158
  stream_err = "ERROR: Open WebUI HTTP #{code} for #{rest_call}: #{buf.to_s[0, 800]}"
159
159
  return
160
160
  end
161
+ unless http_body.key?(:tools) || http_body.key?(:tool_ids)
162
+ # Text replies are UTF-8 on the wire. A character may span several reads.
163
+ buf.force_encoding(Encoding::UTF_8)
164
+ raise 'ERROR: Open WebUI text response contains invalid UTF-8' unless buf.valid_encoding?
165
+ end
161
166
  if buf.to_s.strip.empty?
162
167
  stream_err = "ERROR: Open WebUI empty stream body for #{rest_call} (HTTP #{code})"
163
168
  return
@@ -338,16 +338,17 @@ module PWN
338
338
 
339
339
  return if @stderr_redaction_overflow
340
340
 
341
- text = opts[:text].to_s
341
+ text = stderr_text(text: opts[:text])
342
342
  return if text.empty?
343
- return if spinner_frame?(text: text)
343
+ return if spinner_frame?(text: text) && (@stderr_redaction_buffer.to_s.empty? || !text.strip.empty?)
344
344
 
345
345
  Thread.current[:pwn_log_stderr] = true
346
346
  begin
347
347
  io = @debug_file
348
348
  return if io.nil? || (io.respond_to?(:closed?) && io.closed?)
349
349
 
350
- @stderr_redaction_buffer = @stderr_redaction_buffer.to_s + text.gsub(/\e\[[0-9;]*m/, '')
350
+ # A write can end in the middle of a UTF-8 character or an ANSI escape.
351
+ @stderr_redaction_buffer = @stderr_redaction_buffer.to_s.b + text.b
351
352
  buffer = @stderr_redaction_buffer
352
353
  if buffer.bytesize > 65_536
353
354
  clean = PWN::Redaction.token(kind: 'stream', value: buffer)
@@ -355,6 +356,8 @@ module PWN
355
356
  else
356
357
  # A write may split a JWT/header; PEM bodies may span many writes.
357
358
  return unless buffer.end_with?("\n")
359
+
360
+ buffer = stderr_text(text: buffer).scrub.gsub(/\e\[[0-9;]*m/, '')
358
361
  return if buffer.match?(/-----BEGIN [A-Z ]*PRIVATE KEY-----/) && !buffer.match?(/-----END [A-Z ]*PRIVATE KEY-----/)
359
362
 
360
363
  clean = sanitize_debug_text(text: buffer)
@@ -373,10 +376,18 @@ module PWN
373
376
  clean
374
377
  end
375
378
 
376
- # Spinner frames stay on the TTY; never persist them in the RN log.
379
+ private_class_method def self.stderr_text(opts = {})
380
+ text = opts[:text].to_s
381
+ return text.dup.force_encoding(Encoding::UTF_8) if text.encoding == Encoding::BINARY
382
+ return text if text.encoding == Encoding::UTF_8
383
+
384
+ text.encode(Encoding::UTF_8, invalid: :replace, undef: :replace)
385
+ end
386
+
387
+ # Spinner frames stay on the TTY; an incomplete character isn't a frame.
377
388
  public_class_method def self.spinner_frame?(opts = {})
378
- raw = opts[:text].to_s
379
- return false if raw.empty?
389
+ raw = stderr_text(text: opts[:text])
390
+ return false if raw.empty? || !raw.valid_encoding?
380
391
 
381
392
  stripped = raw.gsub(/\e\[[0-9;?]*[A-Za-z]/, '').delete("\r").delete("\b")
382
393
  stripped = stripped.gsub(/[\u2800-\u28FF]/, '')
@@ -811,6 +811,10 @@ module PWN
811
811
  else
812
812
  "#{e.class}: #{e.message}"
813
813
  end
814
+ if e.is_a?(Encoding::CompatibilityError) && (origin = e.backtrace_locations&.first)
815
+ file = File.basename(origin.path.to_s)
816
+ warning += " (#{file}:#{origin.lineno})" if file.ascii_only? && file.match?(/\A[\w-]{1,80}\.rb\z/)
817
+ end
814
818
  events << [:warning, warning]
815
819
  ensure
816
820
  output.flush
data/lib/pwn/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PWN
4
- VERSION = '0.5.798'
4
+ VERSION = '0.5.800'
5
5
  end
@@ -103,6 +103,28 @@ end
103
103
  RSpec.describe provider, 'PR-LOG-01 strict-template history' do
104
104
  include_context 'provider review synthetic stream transport', key
105
105
 
106
+ [false, true].each do |bom|
107
+ it "delivers a Unicode text-only chat reply from HTTP bytes (BOM=#{bom})" do
108
+ answer = 'Le café coûte 3 €.'
109
+ @stream = if key == :ollama
110
+ JSON.generate(message: { role: 'assistant', content: answer }, done: true)
111
+ else
112
+ "data: #{JSON.generate(choices: [{ delta: { content: answer }, finish_reason: 'stop' }])}\n\n"
113
+ end
114
+ @stream = ((bom ? "\uFEFF" : '') + @stream).b.freeze
115
+ reply = described_class.chat(request: 'Read the price.', timeout: 1).fetch(:choices).last
116
+ expect(reply).to include(role: 'assistant', content: answer)
117
+ expect(reply.fetch(:content).encoding).to eq(Encoding::UTF_8)
118
+ end
119
+ end
120
+
121
+ it 'rejects malformed wire bytes without returning partial text or echoing the body' do
122
+ @stream = "data: {\"choices\":[{\"delta\":{\"content\":\"fixture-private-\xFF\"},\"finish_reason\":\"stop\"}]}\n\n".b
123
+ expect { described_class.chat(request: 'Read the price.', timeout: 1) }.to raise_error(RuntimeError, /invalid UTF-8/i) do |error|
124
+ expect(error.message).not_to include('fixture-private')
125
+ end
126
+ end
127
+
106
128
  [false, true].each do |frozen_history|
107
129
  [false, true].each do |string_keys|
108
130
  it "folds once over three turns without mutating history (frozen=#{frozen_history}, string_keys=#{string_keys})" do
@@ -439,3 +439,34 @@ describe 'PWN::Plugins::Log toggle-trace step' do
439
439
  expect(PWN::Plugins::Log.debug_dir).to include('logs')
440
440
  end
441
441
  end
442
+
443
+ describe PWN::Plugins::Log::DebugStderrTee do
444
+ include_context 'pwn tmp sandbox'
445
+
446
+ let(:path) { File.join(@tmp, 'stderr.log') }
447
+ let(:original) { StringIO.new(+''.b) }
448
+ let(:stream) { described_class.new(orig: original) }
449
+
450
+ before { PWN::Plugins::Log.start_debug(path: path, tee: StringIO.new) }
451
+ after { PWN::Plugins::Log.stop_debug }
452
+
453
+ it 'preserves split UTF-8 on stderr and filters binary-tagged spinner frames from the log' do
454
+ parts = ["\r\e[1G⠴".b, "résumé: \xE2".b, "\x82\xAC".b, ' — done', "\n"]
455
+ parts.each { |part| expect(stream.write(part.freeze)).to eq(part.bytesize) }
456
+
457
+ expect(original.string).to eq(parts.map(&:b).join)
458
+ body = File.read(path, encoding: 'UTF-8')
459
+ expect(body).to include("résumé: € — done\n")
460
+ expect(body).not_to include('⠴', '�')
461
+ end
462
+
463
+ it 'replaces malformed stderr bytes in the log without losing the warning or exposing a split secret' do
464
+ stream.write("warning\xFF api_".b)
465
+ stream.write("key=synthetic-sensitive-value\n".b)
466
+
467
+ body = File.read(path, encoding: 'UTF-8')
468
+ expect(body).to be_valid_encoding
469
+ expect(body).to include('warning� [REDACTED:')
470
+ expect(body).not_to include('synthetic-sensitive-value')
471
+ end
472
+ end
@@ -2802,6 +2802,41 @@ describe 'pwn-ai curses launch' do # rubocop:disable Metrics/BlockLength -- publ
2802
2802
  expect(events.map { |_, text, *| text }.join).not_to match(/plan_first swallowed|private fixture response/)
2803
2803
  end
2804
2804
 
2805
+ it 'identifies the source line of a request-aborting encoding error without dumping request data' do
2806
+ allow(PWN::AI::Agent::Loop).to receive(:run) { /€/.match('fixture-private-é'.b) }
2807
+ launch("Read the price.\n".chars) { "\u0004" unless @console.send(:busy?) }
2808
+ events = @console.instance_variable_get(:@timeline)
2809
+ warnings = events.filter_map { |type, text, *| text if type == :warning }
2810
+ expect(warnings).to contain_exactly(a_string_matching(/Encoding::CompatibilityError:.*ai_console_spec\.rb:\d+/m))
2811
+ expect(warnings.join).not_to include(__dir__, 'fixture-private', 'block in')
2812
+ expect(events.none? { |type, *| type == :assistant }).to be(true)
2813
+ end
2814
+
2815
+ it 'delivers and saves a split UTF-8 text reply in a session with debugging off' do
2816
+ require 'rest-client'
2817
+ PWN::Env[:ai] = { active: :ollama, ollama: { model: 'fixture', base_uri: 'https://example.invalid' }, agent: { toolsets: [], plan_first: false } }
2818
+ allow(PWN::AI::Router).to receive(:summarize).and_return('{"title":"Lemon colour","summary":"A short answer."}')
2819
+ allow(PWN::Plugins::TransparentBrowser).to receive(:open).and_return(browser: RestClient)
2820
+ answer = 'Yellow — jaune citron.'
2821
+ bytes = JSON.generate(message: { role: 'assistant', content: answer }, done: true).b
2822
+ split = bytes.index('—'.b) + 1
2823
+ allow(RestClient::Request).to receive(:execute) do |args|
2824
+ next '{}' if args.fetch(:url).end_with?('/show')
2825
+
2826
+ payload = JSON.parse(args.fetch(:payload))
2827
+ raise 'Expected a text-only request' if payload.key?('tools')
2828
+
2829
+ response = double('text response', code: '200')
2830
+ allow(response).to receive(:read_body).and_yield(bytes.byteslice(0, split)).and_yield(bytes.byteslice(split..))
2831
+ args.fetch(:block_response).call(response)
2832
+ end
2833
+ launch("what color is a lemon?\n".chars) { "\u0004" unless @console.send(:busy?) }
2834
+ events = @console.instance_variable_get(:@timeline)
2835
+ expect(events.filter_map { |type, text, *| text if type == :warning }).to be_empty
2836
+ expect(events.filter_map { |type, text, *| text if type == :assistant }).to include(answer)
2837
+ expect(PWN::Sessions.load(session_id: @pry.config.pwn_ai_session_id)).to include(hash_including(role: 'assistant', content: answer))
2838
+ end
2839
+
2805
2840
  it 'honors locally selected model and resumed session in the actual provider call' do
2806
2841
  sid = PWN::Sessions.create(title: 'resumed console')[:id]
2807
2842
  PWN::Sessions.append(session_id: sid, role: 'user', content: 'Previous fixture question')
@@ -27,18 +27,35 @@ describe 'regex-ReAct mission containment' do
27
27
  Pry.config.hooks.get_hook(:after_read, :pwn_ai_hook).call(request, pry)
28
28
  end
29
29
 
30
+ def namespace_pids(status)
31
+ status.to_s[/^NSpid:[ \t]+([1-9]\d*(?:[ \t]+[1-9]\d*)*)\n/, 1].to_s.split.map(&:to_i)
32
+ end
33
+
30
34
  def wait_for_descendant_pid(marker)
35
+ observer = namespace_pids(File.read('/proc/self/status'))
36
+ raise 'Cannot identify the test runner PID namespace' unless observer.last == Process.pid
37
+
31
38
  Timeout.timeout(10) do
32
39
  loop do
33
- text = File.read(marker) if File.file?(marker)
34
- pid = text.to_s[/^NSpid:[ \t]+([1-9]\d*)(?:[ \t]+\d+)+\n/, 1]
35
- return pid.to_i if pid
40
+ if File.file?(marker)
41
+ pids = namespace_pids(File.read(marker))
42
+ return pids.fetch(observer.size - 1) if pids.size > observer.size
43
+ end
36
44
 
37
45
  sleep 0.01
38
46
  end
39
47
  end
40
48
  end
41
49
 
50
+ # Pin the live task before interrupting it. A pidfd reports exit even if
51
+ # another process has yet to reap it, and never follows a recycled PID.
52
+ def open_pidfd(pid)
53
+ fd = PWN::AI::Agent::MissionNamespace.native('pidfd_open', [Fiddle::TYPE_INT, Fiddle::TYPE_INT]).call(pid, 0)
54
+ raise SystemCallError.new('pidfd_open for descendant', Fiddle.last_error) if fd.negative?
55
+
56
+ IO.new(fd)
57
+ end
58
+
42
59
  it 'waits for the descendant PID contents rather than an empty readiness file' do
43
60
  marker = File.join(@tmp, 'partial-ready')
44
61
  File.write(marker, '')
@@ -48,6 +65,7 @@ describe 'regex-ReAct mission containment' do
48
65
  File.write(marker, "NSpid:\t12345\t1\n")
49
66
  end
50
67
  allow(File).to receive(:read).and_call_original
68
+ allow(File).to receive(:read).with('/proc/self/status').and_return("NSpid:\t#{Process.pid}\n")
51
69
  allow(File).to receive(:read).with(marker).and_wrap_original do |original, path|
52
70
  text = original.call(path)
53
71
  read_empty << true if text.empty?
@@ -58,6 +76,31 @@ describe 'regex-ReAct mission containment' do
58
76
  writer&.kill&.join
59
77
  end
60
78
 
79
+ it 'selects the PID visible to a nested upgrade runner, not the outer procfs PID' do
80
+ marker = File.join(@tmp, 'nested-ready')
81
+ File.write(marker, "NSpid:\t12345\t82\t1\n")
82
+ allow(File).to receive(:read).and_call_original
83
+ allow(File).to receive(:read).with('/proc/self/status').and_return("NSpid:\t12000\t#{Process.pid}\n")
84
+ expect(wait_for_descendant_pid(marker)).to eq(82)
85
+ end
86
+
87
+ it 'distinguishes a live child from an exited child that has not been reaped' do
88
+ reader, release = IO.pipe
89
+ pid = fork do
90
+ release.close
91
+ reader.read(1)
92
+ exit! 0
93
+ end
94
+ handle = open_pidfd(pid)
95
+ expect(handle.wait_readable(0)).to be_nil
96
+ release.close
97
+ expect(handle.wait_readable(5)).to be_truthy
98
+ expect(Process.kill(0, pid)).to eq(1) # The old probe still sees the zombie.
99
+ ensure
100
+ [release, reader, handle].compact.each { |io| io.close unless io.closed? }
101
+ Process.wait(pid) if pid
102
+ end
103
+
61
104
  it 'fails closed before calling a provider when mission containment is unavailable' do
62
105
  allow(PWN::Plugins::AISandbox::MissionProcess).to receive(:new).and_raise(PWN::Plugins::AISandbox::NotStarted, 'enable user/PID namespaces')
63
106
  expect(PWN::AI::Ollama).not_to receive(:chat)
@@ -168,10 +211,11 @@ describe 'regex-ReAct mission containment' do
168
211
  nil
169
212
  end
170
213
  marker = File.join(@tmp, '.pwn', 'workspaces', 'runtime', 'pty-ready')
171
- host_pid = wait_for_descendant_pid(marker)
214
+ descendant = open_pidfd(wait_for_descendant_pid(marker))
215
+ expect(descendant.wait_readable(0)).to be_nil, 'descendant exited before PTY CTRL+C'
172
216
  writer.write("\x03")
173
217
  Timeout.timeout(10) { sleep 0.01 until output.include?('CANCELLED READY') }
174
- expect { Process.kill(0, host_pid) }.to raise_error(Errno::ESRCH)
218
+ expect(descendant.wait_readable(0)).to be_truthy, 'detached descendant still alive at CANCELLED READY'
175
219
  writer.write("second\n")
176
220
  Timeout.timeout(10) { Process.wait(pid) }
177
221
  pid = nil
@@ -192,7 +236,7 @@ describe 'regex-ReAct mission containment' do
192
236
  nil
193
237
  end
194
238
  end
195
- [reader, writer].compact.each { |io| io.close unless io.closed? }
239
+ [descendant, reader, writer].compact.each { |io| io.close unless io.closed? }
196
240
  drain&.join(5)
197
241
  end
198
242
 
@@ -209,11 +253,12 @@ describe 'regex-ReAct mission containment' do
209
253
  rescue Interrupt
210
254
  :cancelled
211
255
  end
212
- host_pid = wait_for_descendant_pid(marker)
256
+ descendant = open_pidfd(wait_for_descendant_pid(marker))
257
+ expect(descendant.wait_readable(0)).to be_nil, 'descendant exited before interrupt'
213
258
  worker.raise(Interrupt)
214
259
  expect(Timeout.timeout(10) { worker.value }).to eq(:cancelled)
215
260
  expect(repl).to have_received(:ready_tty!)
216
- expect { Process.kill(0, host_pid) }.to raise_error(Errno::ESRCH)
261
+ expect(descendant.wait_readable(0)).to be_truthy, 'detached descendant still alive when the terminal became ready'
217
262
  sleep 1.1
218
263
  expect(File).not_to exist(late)
219
264
  allow(PWN::AI::Ollama).to receive(:chat).and_return(id: 'second', choices: [{ content: 'second complete' }])
@@ -222,6 +267,7 @@ describe 'regex-ReAct mission containment' do
222
267
  expect(PWN::Env.dig(:ai, :ollama, :response_history, :id)).to eq('second')
223
268
  expect(request).to eq('nil')
224
269
  ensure
270
+ descendant&.close
225
271
  worker&.raise(Interrupt) if worker&.alive?
226
272
  worker&.join(10)
227
273
  end
@@ -15,7 +15,7 @@ RSpec.describe PWN::SAST::TestCaseEngine, 'formatter review safeguards' do
15
15
  FileUtils.mkdir_p(@sources)
16
16
  @lock_path = File.expand_path('../../../../Gemfile.lock', __dir__)
17
17
  @lock_before = File.binread(@lock_path)
18
- @js_beautify_bin = Gem.bin_path('js-beautify', 'js-beautify')
18
+
19
19
  saved_env = %w[BUNDLE_GEMFILE BUNDLE_LOCKFILE RUBYOPT BUNDLE_FROZEN].to_h { |key| [key, ENV.fetch(key, nil)] }
20
20
  original_path = ENV.fetch('PATH')
21
21
  # Fixture subprocesses must not inherit the checkout lock path. Clearing
@@ -150,19 +150,25 @@ RSpec.describe PWN::SAST::TestCaseEngine, 'formatter review safeguards' do
150
150
  name = 'source;printf proof>review-marker;#.js'
151
151
  source = 'var fixture={value:1};'
152
152
  File.write(File.join(@sources, name), source)
153
- commands_dir = File.join(@root, 'commands')
154
- FileUtils.mkdir_p(commands_dir)
155
153
  shell_commands = []
156
154
  allow(described_class).to receive(:`).and_wrap_original do |original, command|
157
155
  shell_commands << command
158
156
  original.call(command)
159
157
  end
160
- # Load the actual gem launcher by its original path: it resolves its
161
- # bundled parser relative to __FILE__, so symlinking that file breaks it.
162
- launcher = File.join(commands_dir, 'js-beautify')
163
- File.write(launcher, "#!#{RbConfig.ruby}\nload #{@js_beautify_bin.dump}\n")
164
- File.chmod(0o700, launcher)
165
- ENV['PATH'] = "#{commands_dir}:#{ENV.fetch('PATH')}"
158
+ # Exercise the installed launcher's argument handling, not its Python parser.
159
+ # Only the launcher child sees this PATH; it cannot fall back to host Python.
160
+ backend_dir = File.join(@root, 'backend')
161
+ Dir.mkdir(backend_dir)
162
+ backend = File.join(backend_dir, 'python')
163
+ File.write(backend, <<~RUBY)
164
+ #!#{RbConfig.ruby}
165
+ abort 'expected parser and stdin selector' unless ARGV.size == 2 && File.file?(ARGV.first) && ARGV.last == '-'
166
+ abort 'expected source bytes on stdin' unless STDIN.binmode.read == #{source.dump}
167
+ puts 'var fixture = { value: 1 };'
168
+ RUBY
169
+ File.chmod(0o700, backend)
170
+ launcher = Gem.bin_path('js-beautify', 'js-beautify')
171
+ synthetic_formatter("ENV['PATH'] = #{backend_dir.dump}\nload #{launcher.dump}")
166
172
 
167
173
  result = described_class.execute(options)
168
174
 
@@ -170,8 +176,8 @@ RSpec.describe PWN::SAST::TestCaseEngine, 'formatter review safeguards' do
170
176
  expect(shell_commands.join("\n")).not_to include(Shellwords.escape(name))
171
177
  expect(File.exist?(File.join(@sources, 'review-marker'))).to be(false)
172
178
  expect(result.length).to eq(1)
173
- expect(result.first[:filename][:entry_beautified]).to be(true)
174
- expect(result.first[:line_no_and_contents].first[:contents]).to include('var fixture = {')
179
+ expect(result.first[:filename]).to include(entry: "./#{name}", entry_beautified: true)
180
+ expect(result.first[:line_no_and_contents].first[:contents]).to eq("var fixture = { value: 1 };\n")
175
181
  expect(File.read(File.join(@sources, name))).to eq(source)
176
182
  expect(Digest::SHA256.file(@lock_path).hexdigest).to eq(Digest::SHA256.hexdigest(@lock_before))
177
183
  end
@@ -3227,6 +3227,7 @@
3227
3227
  {"messages":[{"role":"user","content":"PWN::Plugins::Log.spinner_frame? Usage"},{"role":"assistant","content":"`PWN::Plugins::Log.spinner_frame?`: "}]}
3228
3228
  {"messages":[{"role":"user","content":"PWN::Plugins::Log.start_debug Usage"},{"role":"assistant","content":"`PWN::Plugins::Log.start_debug`: "}]}
3229
3229
  {"messages":[{"role":"user","content":"PWN::Plugins::Log.start_trace! Usage"},{"role":"assistant","content":"`PWN::Plugins::Log.start_trace!`: "}]}
3230
+ {"messages":[{"role":"user","content":"PWN::Plugins::Log.stderr_text Usage"},{"role":"assistant","content":"`PWN::Plugins::Log.stderr_text`: "}]}
3230
3231
  {"messages":[{"role":"user","content":"PWN::Plugins::Log.stop_debug Usage"},{"role":"assistant","content":"`PWN::Plugins::Log.stop_debug`: "}]}
3231
3232
  {"messages":[{"role":"user","content":"PWN::Plugins::Log.stop_trace! Usage"},{"role":"assistant","content":"`PWN::Plugins::Log.stop_trace!`: "}]}
3232
3233
  {"messages":[{"role":"user","content":"PWN::Plugins::Log.trace_arguments Usage"},{"role":"assistant","content":"`PWN::Plugins::Log.trace_arguments`: "}]}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pwn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.798
4
+ version: 0.5.800
5
5
  platform: ruby
6
6
  authors:
7
7
  - 0day Inc.