pwn 0.5.799 → 0.5.802
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 +4 -4
- data/CHANGELOG_BETWEEN_TAGS.txt +183 -158
- data/Gemfile +1 -1
- data/Rakefile +1 -1
- data/lib/pwn/ai/ollama.rb +5 -0
- data/lib/pwn/ai/open_web_ui.rb +5 -0
- data/lib/pwn/plugins/jobs.rb +57 -25
- data/lib/pwn/plugins/repl/ai_console.rb +4 -0
- data/lib/pwn/version.rb +1 -1
- data/spec/integration/rake_example_timing_spec.rb +64 -0
- data/spec/lib/pwn/ai/provider_review_history_stream_regression_spec.rb +22 -0
- data/spec/lib/pwn/plugins/plugins_b_operational_regression_spec.rb +29 -5
- data/spec/lib/pwn/plugins/repl/ai_console_spec.rb +35 -0
- data/spec/lib/pwn/plugins/repl_mesh_dm_transport_spec.rb +1 -0
- data/spec/lib/pwn/plugins/repl_mesh_key_exchange_spec.rb +3 -0
- data/spec/lib/pwn/plugins/repl_spec.rb +3 -0
- data/spec/lib/pwn/sdr/decoder/base_spec.rb +3 -1
- data/spec/lib/pwn/sessions_spec.rb +3 -0
- data/spec/lib/pwn/www/login_yubikey_spec.rb +2 -0
- data/spec/spec_helper.rb +1 -1
- data/spec/support/gate_failure_formatter.rb +30 -5
- data/third_party/pwn_rdoc.jsonl +1 -0
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 80052ce5d8a763fc4bc6909d6335b59c7a3aaf5cbb201a60ac10d637c7138bb5
|
|
4
|
+
data.tar.gz: 679d21109b6baead7be731bc85e9cc89ac9227af20f5caa61ef49c6ec92494cc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 5761d5ab7b986ce9790d840426620470e5b5f72711c3f12df210c85edac5e63725f456770e96af6d27a39ae6be895f3b63c53640c7088d770e39aea93a728b97
|
|
7
|
+
data.tar.gz: 7fb6b534ca7f69574ec430d5b85ae99cafee9dd1f3045b6e18657cd8855e68c0aea0e473936feff1951e15ee9d9796ed33ff3a8110bb5773503744482b8167b1
|
data/CHANGELOG_BETWEEN_TAGS.txt
CHANGED
|
@@ -1,158 +1,183 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
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/Gemfile
CHANGED
data/Rakefile
CHANGED
|
@@ -27,7 +27,7 @@ class DiagnosticSpecTask < RSpec::Core::RakeTask
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
DiagnosticSpecTask.new(:spec) do |task|
|
|
30
|
-
task.rspec_opts = "#{task.rspec_opts} --require ./spec/support/gate_failure_formatter.rb --format
|
|
30
|
+
task.rspec_opts = "#{task.rspec_opts} --require ./spec/support/gate_failure_formatter.rb --format GateFailureFormatter"
|
|
31
31
|
end
|
|
32
32
|
task :silence_rspec_filter_banner do
|
|
33
33
|
ENV['PWN_RAKE_SPEC'] = '1'
|
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
|
data/lib/pwn/ai/open_web_ui.rb
CHANGED
|
@@ -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
|
data/lib/pwn/plugins/jobs.rb
CHANGED
|
@@ -16,6 +16,25 @@ module PWN
|
|
|
16
16
|
module Jobs
|
|
17
17
|
JOBS_DIR = File.join(Dir.home, '.pwn', 'jobs')
|
|
18
18
|
|
|
19
|
+
# Do not start the command until its process group is owned and its deadline is still live.
|
|
20
|
+
# FD 3 reports launch failures only; successful exec closes it before any job code runs.
|
|
21
|
+
GRAPH_LAUNCH = <<~RUBY
|
|
22
|
+
status = IO.for_fd(3)
|
|
23
|
+
status.close_on_exec = true
|
|
24
|
+
exit! 124 unless STDIN.getbyte == 1
|
|
25
|
+
if Process.clock_gettime(Process::CLOCK_MONOTONIC) >= Float(ARGV.fetch(0))
|
|
26
|
+
status.syswrite('timeout')
|
|
27
|
+
exit! 124
|
|
28
|
+
end
|
|
29
|
+
begin
|
|
30
|
+
exec(ARGV.fetch(1))
|
|
31
|
+
rescue SystemCallError => e
|
|
32
|
+
status.syswrite(e.errno.to_s)
|
|
33
|
+
exit! 127
|
|
34
|
+
end
|
|
35
|
+
RUBY
|
|
36
|
+
private_constant :GRAPH_LAUNCH
|
|
37
|
+
|
|
19
38
|
public_class_method def self.required_bins
|
|
20
39
|
[]
|
|
21
40
|
end
|
|
@@ -209,8 +228,6 @@ module PWN
|
|
|
209
228
|
Thread.new do
|
|
210
229
|
timeout = (job[:timeout] || opts[:timeout]).to_f
|
|
211
230
|
timeout = 3_600 if timeout <= 0
|
|
212
|
-
out = err = ''
|
|
213
|
-
st = nil
|
|
214
231
|
signaled = false
|
|
215
232
|
notify = lambda do
|
|
216
233
|
next if signaled
|
|
@@ -219,12 +236,10 @@ module PWN
|
|
|
219
236
|
started << true
|
|
220
237
|
end
|
|
221
238
|
begin
|
|
222
|
-
|
|
223
|
-
out, err, st = capture_graph(command: job[:command].to_s, dir: dir, groups: groups, started: notify)
|
|
224
|
-
end
|
|
239
|
+
out, err, st = capture_graph(command: job[:command].to_s, dir: dir, groups: groups, started: notify, timeout: timeout)
|
|
225
240
|
{ id: job[:id], ok: st.success?, stdout: out, stderr: err, exit: st.exitstatus }
|
|
226
241
|
rescue Timeout::Error
|
|
227
|
-
{ id: job[:id], ok: false, stdout:
|
|
242
|
+
{ id: job[:id], ok: false, stdout: '', stderr: 'timeout', exit: 124, timeout: true }
|
|
228
243
|
ensure
|
|
229
244
|
notify.call
|
|
230
245
|
end
|
|
@@ -250,29 +265,46 @@ module PWN
|
|
|
250
265
|
end
|
|
251
266
|
|
|
252
267
|
private_class_method def self.capture_graph(opts = {})
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
opts[:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
[readers[0].value, readers[1].value, waiter.value]
|
|
260
|
-
ensure
|
|
261
|
-
if waiter.alive? || readers.any?(&:alive?)
|
|
262
|
-
begin
|
|
263
|
-
Process.kill('KILL', -waiter.pid)
|
|
264
|
-
rescue Errno::ESRCH, Errno::EPERM
|
|
265
|
-
nil
|
|
266
|
-
end
|
|
267
|
-
end
|
|
268
|
-
readers.each do |thread|
|
|
269
|
-
thread.kill if thread.alive?
|
|
270
|
-
thread.join
|
|
271
|
-
end
|
|
268
|
+
deadline = Process.clock_gettime(Process::CLOCK_MONOTONIC) + opts.fetch(:timeout)
|
|
269
|
+
launcher = [RbConfig.ruby, '--disable=gems,rubyopt', '-e', GRAPH_LAUNCH, '--', deadline.to_s, opts.fetch(:command)]
|
|
270
|
+
IO.pipe do |status, writer|
|
|
271
|
+
Open3.popen3(*launcher, 3 => writer, chdir: opts[:dir], pgroup: true) do |stdin, stdout, stderr, waiter|
|
|
272
|
+
writer.close
|
|
273
|
+
capture_owned_graph(opts.merge(deadline: deadline, stdin: stdin, outputs: [stdout, stderr], waiter: waiter, status: status))
|
|
272
274
|
end
|
|
273
275
|
end
|
|
274
276
|
end
|
|
275
277
|
|
|
278
|
+
private_class_method def self.capture_owned_graph(opts = {})
|
|
279
|
+
waiter = opts.fetch(:waiter)
|
|
280
|
+
deadline = opts.fetch(:deadline)
|
|
281
|
+
readers = []
|
|
282
|
+
finished = false
|
|
283
|
+
opts.fetch(:groups) << waiter.pid
|
|
284
|
+
opts.fetch(:started).call
|
|
285
|
+
raise Timeout::Error if Process.clock_gettime(Process::CLOCK_MONOTONIC) >= deadline
|
|
286
|
+
|
|
287
|
+
opts[:stdin].write("\x01")
|
|
288
|
+
opts[:stdin].close
|
|
289
|
+
readers = opts[:outputs].map { |io| Thread.new { io.read } }
|
|
290
|
+
[*readers, waiter].each do |thread|
|
|
291
|
+
remaining = deadline - Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
|
292
|
+
raise Timeout::Error unless remaining.positive? && thread.join(remaining)
|
|
293
|
+
end
|
|
294
|
+
finished = true
|
|
295
|
+
status = opts[:status].read
|
|
296
|
+
raise Timeout::Error if status == 'timeout'
|
|
297
|
+
raise SystemCallError.new(opts[:command], Integer(status)) unless status.empty?
|
|
298
|
+
|
|
299
|
+
[readers[0].value, readers[1].value, waiter.value]
|
|
300
|
+
ensure
|
|
301
|
+
cancel_graph(groups: [waiter.pid]) if waiter && !finished
|
|
302
|
+
readers&.each do |thread|
|
|
303
|
+
thread.kill if thread.alive?
|
|
304
|
+
thread.join
|
|
305
|
+
end
|
|
306
|
+
end
|
|
307
|
+
|
|
276
308
|
private_class_method def self.cancel_graph(opts = {})
|
|
277
309
|
Array(opts[:groups]).uniq.each do |pid|
|
|
278
310
|
Process.kill('KILL', -pid)
|
|
@@ -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
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'spec_helper'
|
|
4
|
+
require 'json'
|
|
5
|
+
require 'open3'
|
|
6
|
+
|
|
7
|
+
RSpec.describe 'rake spec timing output' do
|
|
8
|
+
it 'prints one timed stdout row per selected example and keeps failure diagnostics' do
|
|
9
|
+
Dir.mktmpdir('pwn-rake-timing') do |dir|
|
|
10
|
+
file = File.join(dir, 'timing_spec.rb')
|
|
11
|
+
report = File.join(dir, 'results.json')
|
|
12
|
+
File.write(file, <<~RUBY)
|
|
13
|
+
require 'spec_helper'
|
|
14
|
+
RSpec.configure { |c| c.add_formatter('json', ENV.fetch('TIMING_REPORT')) }
|
|
15
|
+
RSpec.describe 'formatter fixture' do
|
|
16
|
+
it 'passes', :measured do
|
|
17
|
+
sleep 0.01
|
|
18
|
+
STDOUT.puts 'fixture output must stay hidden'
|
|
19
|
+
end
|
|
20
|
+
it('fails', :measured) { raise 'timing fixture failure' }
|
|
21
|
+
it('is pending', :measured)
|
|
22
|
+
it('is filtered out') { raise 'unexpected execution' }
|
|
23
|
+
end
|
|
24
|
+
RUBY
|
|
25
|
+
env = {
|
|
26
|
+
'SPEC' => file, 'PWN_SPEC_VERBOSE' => nil, 'TIMING_REPORT' => report,
|
|
27
|
+
'SPEC_OPTS' => '--tag measured --order defined'
|
|
28
|
+
}
|
|
29
|
+
stdout, stderr, status = Open3.capture3(env, RbConfig.ruby, Gem.bin_path('rake', 'rake'), 'spec', chdir: File.expand_path('../..', __dir__))
|
|
30
|
+
expect(status.exitstatus).to eq(1), stderr
|
|
31
|
+
results = JSON.parse(File.read(report)).fetch('examples')
|
|
32
|
+
expect(results.map { |ex| ex.fetch('status') }).to eq(%w[passed failed pending])
|
|
33
|
+
expect(results.first.fetch('run_time')).to be >= 0.01
|
|
34
|
+
rows = results.map.with_index(1) do |ex, n|
|
|
35
|
+
format("[#{n}/3] #{file}:#{ex.fetch('line_number')} %<seconds>.6fs", seconds: ex.fetch('run_time'))
|
|
36
|
+
end
|
|
37
|
+
expect(stdout.lines.map(&:chomp).grep(%r{^\[\d+/})).to eq(rows)
|
|
38
|
+
expect(stdout).not_to include('fixture output must stay hidden')
|
|
39
|
+
expect(stdout).not_to match(/^[.F*]+$/)
|
|
40
|
+
expect(stdout.index('timing fixture failure')).to be < stdout.index(rows.last)
|
|
41
|
+
expect(stdout).to include('3 examples, 1 failure, 1 pending')
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
RSpec.describe GateFailureFormatter do
|
|
47
|
+
it 'colors only the duration on a terminal, using the unrounded runtime for both thresholds' do
|
|
48
|
+
stream = StringIO.new
|
|
49
|
+
allow(stream).to receive(:tty?).and_return(true)
|
|
50
|
+
allow(RSpec.configuration).to receive(:color_mode).and_return(:automatic)
|
|
51
|
+
allow(ENV).to receive(:[]).and_call_original
|
|
52
|
+
allow(ENV).to receive(:[]).with('NO_COLOR').and_return(nil)
|
|
53
|
+
formatter = described_class.new(stream)
|
|
54
|
+
cases = [[0.9999999, 32], [1.0, 33], [5.0, 33], [10.0, 33], [10.0000001, 31]]
|
|
55
|
+
formatter.start(RSpec::Core::Notifications::StartNotification.new(cases.size, 0))
|
|
56
|
+
expected = cases.map.with_index(1) do |(seconds, code), n|
|
|
57
|
+
result = instance_double(RSpec::Core::Example::ExecutionResult, run_time: seconds)
|
|
58
|
+
example = instance_double(RSpec::Core::Example, metadata: { absolute_file_path: __FILE__, line_number: n }, execution_result: result)
|
|
59
|
+
formatter.example_finished(RSpec::Core::Notifications::ExampleNotification.new(example))
|
|
60
|
+
format("[#{n}/#{cases.size}] #{__FILE__}:#{n} \e[#{code}m%<seconds>.6fs\e[0m", seconds: seconds)
|
|
61
|
+
end
|
|
62
|
+
expect(stream.string.lines.map(&:chomp)).to eq(expected)
|
|
63
|
+
end
|
|
64
|
+
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
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'spec_helper'
|
|
4
|
+
require 'shellwords'
|
|
4
5
|
require 'tmpdir'
|
|
5
6
|
|
|
6
7
|
RSpec.describe PWN::Plugins::DAOLDAP do
|
|
@@ -286,11 +287,34 @@ RSpec.describe PWN::Plugins::BinaryParser do
|
|
|
286
287
|
end
|
|
287
288
|
|
|
288
289
|
RSpec.describe PWN::Plugins::Jobs do
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
290
|
+
%i[capture spawn_handoff].each do |phase|
|
|
291
|
+
it "[B025] terminates a timed-out graph command before its later write (#{phase})" do
|
|
292
|
+
Dir.mktmpdir('pwn-graph-deadline-') do |dir|
|
|
293
|
+
File.write(File.join(dir, 'slow.rb'), <<~RUBY)
|
|
294
|
+
require 'timeout'
|
|
295
|
+
Timeout.timeout(5) { sleep 0.01 until File.exist?('release') }
|
|
296
|
+
File.write('marker', 'late')
|
|
297
|
+
RUBY
|
|
298
|
+
waiter = nil
|
|
299
|
+
allow(Open3).to receive(:popen3).and_wrap_original do |open, *args, **opts, &capture|
|
|
300
|
+
open.call(*args, **opts) do |*handles|
|
|
301
|
+
waiter = handles.last
|
|
302
|
+
if phase == :spawn_handoff
|
|
303
|
+
sleep 0.1 # The deadline expires while Open3 still owns the handles.
|
|
304
|
+
File.write(File.join(dir, 'release'), 'go')
|
|
305
|
+
waiter.join(0.3) # An unguarded payload can write and exit before capture is called.
|
|
306
|
+
end
|
|
307
|
+
capture.call(*handles)
|
|
308
|
+
ensure
|
|
309
|
+
# Also expose a survivor of normal capture cleanup before Open3 joins it.
|
|
310
|
+
File.write(File.join(dir, 'release'), 'go')
|
|
311
|
+
end
|
|
312
|
+
end
|
|
313
|
+
graph = described_class.graph(artifact_dir: dir, jobs: [{ id: 'slow', command: Shellwords.join([RbConfig.ruby, 'slow.rb']), timeout: 0.05 }])
|
|
314
|
+
expect(graph[:jobs]['slow']).to include(ok: false, timeout: true, exit: 124)
|
|
315
|
+
expect(File.exist?(File.join(dir, 'marker'))).to be(false)
|
|
316
|
+
expect(waiter.value).to be_signaled.or have_attributes(exitstatus: 124)
|
|
317
|
+
end
|
|
294
318
|
end
|
|
295
319
|
end
|
|
296
320
|
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')
|
|
@@ -18,6 +18,7 @@ describe PWN::Plugins::REPL, 'mesh DM transport replay' do
|
|
|
18
18
|
packet = nil
|
|
19
19
|
allow(Meshtastic::Serial).to receive(:send_to_radio) do |opts|
|
|
20
20
|
packet = Meshtastic::ToRadio.decode(opts[:to_radio]).packet
|
|
21
|
+
sender[:proto_data] << { packet: { decoded: { portnum: :ROUTING_APP, request_id: packet.id, payload: { error_reason: :NONE } } } }
|
|
21
22
|
end
|
|
22
23
|
|
|
23
24
|
described_class.pwn_mesh_dispatch_slash!(request: '/msg !bbccddee hello receiver', env: env, pry: :fixture)
|
|
@@ -27,6 +27,8 @@ describe PWN::Plugins::REPL, 'mesh DM key exchange' do
|
|
|
27
27
|
expect(packet.decoded.want_response).to eq(true)
|
|
28
28
|
expect(Meshtastic::User.decode(packet.decoded.payload).public_key).to eq('a' * 32)
|
|
29
29
|
obj[:proto_data] << { packet: { from: 0xbbccddee, decoded: { portnum: 4, payload: Meshtastic::User.new(remote_user).to_proto } } }
|
|
30
|
+
elsif packet.decoded.portnum == :TEXT_MESSAGE_APP
|
|
31
|
+
obj[:proto_data] << { packet: { decoded: { portnum: :ROUTING_APP, request_id: packet.id, payload: { error_reason: :NONE } } } }
|
|
30
32
|
end
|
|
31
33
|
end
|
|
32
34
|
described_class.send(:mesh_send_text, env: env, obj: obj, to: '!bbccddee', text: 'private', channel_name: 'LongFast')
|
|
@@ -60,6 +62,7 @@ describe PWN::Plugins::REPL, 'mesh DM key exchange' do
|
|
|
60
62
|
packet = Meshtastic::ToRadio.decode(opts[:to_radio]).packet
|
|
61
63
|
expect(packet.pki_encrypted).to eq(true)
|
|
62
64
|
expect(packet.decoded.payload).to eq('retained text')
|
|
65
|
+
obj[:proto_data] << { packet: { decoded: { portnum: :ROUTING_APP, request_id: packet.id, payload: { error_reason: :NONE } } } }
|
|
63
66
|
end
|
|
64
67
|
described_class.send(:pwn_mesh_run_msg, env: env, args: [])
|
|
65
68
|
expect(PWN::MeshPendingDm).to be_nil
|
|
@@ -748,6 +748,7 @@ describe PWN::Plugins::REPL do # rubocop:disable Metrics/BlockLength
|
|
|
748
748
|
require 'meshtastic'
|
|
749
749
|
obj = { proto_data: [{ channel: { index: 3, role: :SECONDARY, settings: { name: 'LongFast' } } }] }
|
|
750
750
|
env = { transport: 'serial', channel: { active: 'LongFast', LongFast: { channel_num: 99 } } }
|
|
751
|
+
allow(described_class).to receive(:mesh_wait_tx_slot).and_return(:ok)
|
|
751
752
|
expect(Meshtastic::Serial).to receive(:send_text).with(hash_including(channel: 3))
|
|
752
753
|
described_class.send(:mesh_send_text, env: env, obj: obj, channel: 99, text: 'slot three')
|
|
753
754
|
end
|
|
@@ -764,6 +765,7 @@ describe PWN::Plugins::REPL do # rubocop:disable Metrics/BlockLength
|
|
|
764
765
|
transport: 'serial',
|
|
765
766
|
channel: { active: 'LongFast', LongFast: { psk: 'AQ==', channel_num: 8, topic: '2/e/LongFast/#' } }
|
|
766
767
|
}
|
|
768
|
+
allow(described_class).to receive(:mesh_wait_tx_slot).and_return(:ok)
|
|
767
769
|
expect(Meshtastic::Serial).to receive(:send_text).with(hash_including(channel: 2, text: 'hello LongFast'))
|
|
768
770
|
described_class.send(:mesh_send_text, env: env, obj: obj, text: 'hello LongFast')
|
|
769
771
|
end
|
|
@@ -781,6 +783,7 @@ describe PWN::Plugins::REPL do # rubocop:disable Metrics/BlockLength
|
|
|
781
783
|
transport: 'serial',
|
|
782
784
|
channel: { active: 'LongFast', LongFast: { psk: 'AQ==', channel_num: 8 } }
|
|
783
785
|
}
|
|
786
|
+
allow(described_class).to receive(:mesh_wait_tx_slot).and_return(:ok)
|
|
784
787
|
expect(Meshtastic::Serial).to receive(:send_text).with(hash_including(channel: 2, text: 'hello LongFast'))
|
|
785
788
|
described_class.send(:mesh_send_text, env: env, obj: obj, text: 'hello LongFast')
|
|
786
789
|
end
|
|
@@ -439,6 +439,8 @@ describe PWN::SDR::Decoder::Base do
|
|
|
439
439
|
end
|
|
440
440
|
|
|
441
441
|
it 'emits IQ frames before pipe EOF and exits on EOF without ENTER' do
|
|
442
|
+
# Keep interactive mode on, but model an idle keyboard, not the rake terminal.
|
|
443
|
+
allow($stdin).to receive(:read_nonblock).with(1, exception: false).and_return(:wait_readable)
|
|
442
444
|
reader, writer = IO.pipe
|
|
443
445
|
output = StringIO.new
|
|
444
446
|
received = Queue.new
|
|
@@ -454,7 +456,7 @@ describe PWN::SDR::Decoder::Base do
|
|
|
454
456
|
expect(frame[:samples].length).to eq(2)
|
|
455
457
|
expect(writer).not_to be_closed
|
|
456
458
|
writer.close
|
|
457
|
-
Timeout.timeout(2) { worker.value }
|
|
459
|
+
expect(Timeout.timeout(2) { worker.value }).to include(reason: :eof, capture_complete: true)
|
|
458
460
|
expect(JSON.parse(output.string)['samples']).to eq(frame[:samples])
|
|
459
461
|
expect(reader).to be_closed
|
|
460
462
|
ensure
|
|
@@ -392,6 +392,9 @@ end
|
|
|
392
392
|
describe PWN::Sessions do
|
|
393
393
|
include_context 'pwn tmp sandbox'
|
|
394
394
|
|
|
395
|
+
# Dependency discovery uses Dir.home independently of the session directory.
|
|
396
|
+
before { allow(Dir).to receive(:home).and_return(@tmp) }
|
|
397
|
+
|
|
395
398
|
it 'caps provisional titles at seven Unicode-whitespace words without shortening requests' do
|
|
396
399
|
sid = described_class.create(id: 'seven_words')[:id]
|
|
397
400
|
request = "Investigate\u00a0café\u2003login failures and repair expired certificates today"
|
|
@@ -17,6 +17,8 @@ RSpec.shared_context 'offline MFA browser' do |selectors|
|
|
|
17
17
|
@authenticated = false
|
|
18
18
|
@otp_written = false
|
|
19
19
|
@form_ready = false
|
|
20
|
+
# The fake browser updates its URL on click; it needs no redirect delay.
|
|
21
|
+
allow(described_class).to receive(:sleep).with(3).and_return(3)
|
|
20
22
|
stub_const('PWN::Plugins::YubiKey', Module.new)
|
|
21
23
|
allow(PWN::Plugins::YubiKey).to receive(:oath_code) do
|
|
22
24
|
raise 'OATH requested before the MFA form was ready' unless @form_ready
|
data/spec/spec_helper.rb
CHANGED
|
@@ -12,7 +12,7 @@ Dir[File.join(__dir__, 'support', '**', '*.rb')].reject { |f| f.include?('/suppo
|
|
|
12
12
|
# RSpec binds its formatter to $stdout at configure-time (before any example
|
|
13
13
|
# runs), so redirecting $stdout / $stderr *inside* each example swallows any
|
|
14
14
|
# incidental `puts` / `print` / `p` / `warn` emitted by the code under test
|
|
15
|
-
# WITHOUT affecting the
|
|
15
|
+
# WITHOUT affecting the formatter's timing rows or failure reports.
|
|
16
16
|
#
|
|
17
17
|
# Escape hatches:
|
|
18
18
|
# - `PWN_SPEC_VERBOSE=1 rake spec` → no redirection at all
|
|
@@ -1,14 +1,39 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require 'rspec/core/formatters/
|
|
3
|
+
require 'rspec/core/formatters/base_text_formatter'
|
|
4
4
|
|
|
5
|
-
#
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
# Show each example's elapsed time, retaining immediate failures and the normal summary.
|
|
6
|
+
class GateFailureFormatter < RSpec::Core::Formatters::BaseTextFormatter
|
|
7
|
+
RSpec::Core::Formatters.register self, :example_finished, :example_failed
|
|
8
|
+
|
|
9
|
+
def start(notification)
|
|
10
|
+
super
|
|
11
|
+
@completed = 0
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def example_finished(notification)
|
|
15
|
+
example = notification.example
|
|
16
|
+
@completed += 1
|
|
17
|
+
location = "#{example.metadata.fetch(:absolute_file_path)}:#{example.metadata.fetch(:line_number)}"
|
|
18
|
+
output.puts "[#{@completed}/#{@example_count}] #{location} #{formatted_duration(example.execution_result.run_time)}"
|
|
19
|
+
end
|
|
9
20
|
|
|
10
21
|
def example_failed(notification)
|
|
11
22
|
output.puts notification.fully_formatted(1)
|
|
12
23
|
output.flush
|
|
13
24
|
end
|
|
25
|
+
|
|
26
|
+
private
|
|
27
|
+
|
|
28
|
+
def formatted_duration(seconds)
|
|
29
|
+
text = format('%<seconds>.6fs', seconds: seconds)
|
|
30
|
+
return text unless ENV['NO_COLOR'].to_s.empty? && RSpec.configuration.color_enabled?(output)
|
|
31
|
+
|
|
32
|
+
code = case seconds
|
|
33
|
+
when ...1 then 32 # green
|
|
34
|
+
when ..10 then 33 # yellow
|
|
35
|
+
else 31 # red
|
|
36
|
+
end
|
|
37
|
+
"\e[#{code}m#{text}\e[0m"
|
|
38
|
+
end
|
|
14
39
|
end
|
data/third_party/pwn_rdoc.jsonl
CHANGED
|
@@ -3166,6 +3166,7 @@
|
|
|
3166
3166
|
{"messages":[{"role":"user","content":"PWN::Plugins::Jobs.authors Usage"},{"role":"assistant","content":"`PWN::Plugins::Jobs.authors`: "}]}
|
|
3167
3167
|
{"messages":[{"role":"user","content":"PWN::Plugins::Jobs.cancel_graph Usage"},{"role":"assistant","content":"`PWN::Plugins::Jobs.cancel_graph`: "}]}
|
|
3168
3168
|
{"messages":[{"role":"user","content":"PWN::Plugins::Jobs.capture_graph Usage"},{"role":"assistant","content":"`PWN::Plugins::Jobs.capture_graph`: "}]}
|
|
3169
|
+
{"messages":[{"role":"user","content":"PWN::Plugins::Jobs.capture_owned_graph Usage"},{"role":"assistant","content":"`PWN::Plugins::Jobs.capture_owned_graph`: "}]}
|
|
3169
3170
|
{"messages":[{"role":"user","content":"PWN::Plugins::Jobs.graph Usage"},{"role":"assistant","content":"`PWN::Plugins::Jobs.graph`: "}]}
|
|
3170
3171
|
{"messages":[{"role":"user","content":"PWN::Plugins::Jobs.harvest Usage"},{"role":"assistant","content":"`PWN::Plugins::Jobs.harvest`: "}]}
|
|
3171
3172
|
{"messages":[{"role":"user","content":"PWN::Plugins::Jobs.help Usage"},{"role":"assistant","content":"`PWN::Plugins::Jobs.help`: "}]}
|
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.
|
|
4
|
+
version: 0.5.802
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- 0day Inc.
|
|
@@ -128,7 +128,7 @@ dependencies:
|
|
|
128
128
|
-
|
|
129
129
|
- "="
|
|
130
130
|
- !ruby/object:Gem::Version
|
|
131
|
-
version: 8.1.
|
|
131
|
+
version: 8.1.1
|
|
132
132
|
type: :runtime
|
|
133
133
|
prerelease: false
|
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -136,7 +136,7 @@ dependencies:
|
|
|
136
136
|
-
|
|
137
137
|
- "="
|
|
138
138
|
- !ruby/object:Gem::Version
|
|
139
|
-
version: 8.1.
|
|
139
|
+
version: 8.1.1
|
|
140
140
|
- !ruby/object:Gem::Dependency
|
|
141
141
|
name: bson
|
|
142
142
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -6883,6 +6883,7 @@ files:
|
|
|
6883
6883
|
- spec/integration/native_ruby_helpers_spec.rb
|
|
6884
6884
|
- spec/integration/persistence_roundtrip_spec.rb
|
|
6885
6885
|
- spec/integration/prompt_builder_spec.rb
|
|
6886
|
+
- spec/integration/rake_example_timing_spec.rb
|
|
6886
6887
|
- spec/integration/readme_security_spec.rb
|
|
6887
6888
|
- spec/integration/reinforced_feedback_loop_spec.rb
|
|
6888
6889
|
- spec/integration/reports_spec.rb
|