pwn 0.5.634 → 0.5.636
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/.github/workflows/install-matrix.yml +7 -0
- data/Rakefile +6 -0
- data/bin/pwn_setup +16 -0
- data/documentation/Home.md +7 -6
- data/documentation/Installation.md +26 -1
- data/lib/pwn/config.rb +42 -20
- data/lib/pwn/migrate.rb +716 -0
- data/lib/pwn/plugins/repl.rb +12 -1
- data/lib/pwn/setup.rb +53 -2
- data/lib/pwn/version.rb +1 -1
- data/lib/pwn.rb +1 -0
- data/pwn.gemspec +1 -0
- data/spec/documentation/installation_md_spec.rb +2 -2
- data/spec/lib/pwn/ai/agent/mistakes_spec.rb +2 -0
- data/spec/lib/pwn/migrate_spec.rb +136 -0
- data/spec/spec_helper.rb +35 -0
- data/spec/support/sandbox.rb +6 -0
- data/third_party/pwn_rdoc.jsonl +24 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 41a8a5c5d750508d4f3904d7a05151719e2c86fa4cf20001a3aab0985910963d
|
|
4
|
+
data.tar.gz: 7af0757b53bdfa6c97d86a9415a2cbf41ca9447b3f9e438b95b2424f5d835cbf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8053f31ef3138368e50c1b6920fa7804945f508daabc31191ba2a9578f3c31f7e6629e1ca901a409ec82e4cefdf3a824fa48bcfe4fdcd8ab4a1a9da0f168e1da
|
|
7
|
+
data.tar.gz: 592bfb24c2c2a610813fcd5b8431478d4774ef312405f446393db9cbb305c2c223b129a0714b9b464adc9976e682b1754a4e5d760d0ca28b00ba99778df21d7a
|
|
@@ -105,7 +105,13 @@ jobs:
|
|
|
105
105
|
# "detected dubious ownership" and the gem builds with ZERO files.
|
|
106
106
|
run: git config --global --add safe.directory "$PWD"
|
|
107
107
|
- name: build & install gem from checkout (git-checkout path in doc)
|
|
108
|
+
# `gem update --system` first: distro rubies ship RubyGems 3.x whose
|
|
109
|
+
# Molinillo resolver crashes with `undefined method 'request' for nil`
|
|
110
|
+
# (rubygems/rubygems#6215) instead of naming the unsatisfiable dep
|
|
111
|
+
# when a runtime dependency's required_ruby_version excludes this ruby.
|
|
112
|
+
# A modern RubyGems prints the real conflict.
|
|
108
113
|
run: |
|
|
114
|
+
gem update --system --no-document || true
|
|
109
115
|
gem build pwn.gemspec
|
|
110
116
|
gem install --no-document ./pwn-*.gem
|
|
111
117
|
gem install --no-document rspec
|
|
@@ -139,6 +145,7 @@ jobs:
|
|
|
139
145
|
|
|
140
146
|
- name: build & install gem from checkout
|
|
141
147
|
run: |
|
|
148
|
+
gem update --system --no-document || true
|
|
142
149
|
gem build pwn.gemspec
|
|
143
150
|
gem install --no-document ./pwn-*.gem
|
|
144
151
|
gem install --no-document rspec
|
data/Rakefile
CHANGED
|
@@ -16,7 +16,13 @@ if defined?(RDoc::Task)
|
|
|
16
16
|
RDoc::Task.new do |rdoc|
|
|
17
17
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
18
18
|
rdoc.rdoc_dir = 'rdoc'
|
|
19
|
+
rdoc.options << '--quiet'
|
|
19
20
|
end
|
|
21
|
+
# RDoc::Task's default :clobber_rdoc uses Rake's verbose FileUtils, which
|
|
22
|
+
# echoes "rm -r rdoc" to STDOUT on every `rake` (via :rerdoc). Replace it
|
|
23
|
+
# with a silent rm_rf so the default task emits only spec/rubocop output.
|
|
24
|
+
Rake::Task[:clobber_rdoc].clear_actions
|
|
25
|
+
task(:clobber_rdoc) { FileUtils.rm_rf('rdoc') }
|
|
20
26
|
end
|
|
21
27
|
|
|
22
28
|
default_tasks = %i[spec rubocop]
|
data/bin/pwn_setup
CHANGED
|
@@ -29,6 +29,16 @@ pwn_driver = PWN::Driver::Parser.new do |options|
|
|
|
29
29
|
opts[:list] = o
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
+
options.on('-m', '--migrate',
|
|
33
|
+
'<Optional - Verify ~/.pwn state files are compatible with this pwn version; apply schema migrations>') do |o|
|
|
34
|
+
opts[:migrate] = o
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
options.on('-f', '--fix',
|
|
38
|
+
'<Optional - With --migrate: also autofix incompatible files (backup taken first)>') do |o|
|
|
39
|
+
opts[:fix] = o
|
|
40
|
+
end
|
|
41
|
+
|
|
32
42
|
options.on('-y', '--yes',
|
|
33
43
|
'<Optional - Assume yes; non-interactive (CI-friendly)>') do |o|
|
|
34
44
|
opts[:yes] = o
|
|
@@ -45,6 +55,12 @@ pwn_driver.parse!
|
|
|
45
55
|
begin
|
|
46
56
|
if opts[:list]
|
|
47
57
|
PWN::Setup.list_profiles
|
|
58
|
+
elsif opts[:migrate]
|
|
59
|
+
r = PWN::Setup.migrate(
|
|
60
|
+
fix: opts[:fix] || opts[:yes],
|
|
61
|
+
dry_run: opts[:dry_run]
|
|
62
|
+
)
|
|
63
|
+
exit 1 unless r && r[:after] && r[:after][:incompatible].empty?
|
|
48
64
|
elsif opts[:deps] || opts[:profile]
|
|
49
65
|
PWN::Setup.deps(
|
|
50
66
|
profile: opts[:profile],
|
data/documentation/Home.md
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
| [What is PWN](What-is-PWN.md) | One-paragraph elevator pitch |
|
|
18
18
|
| [Why PWN](Why-PWN.md) | Design philosophy - why another framework |
|
|
19
19
|
| [How PWN Works](How-PWN-Works.md) | The five layers, with the architecture diagram |
|
|
20
|
-
| [Installation](Installation.md) | `gem install pwn` → `pwn setup` doctor/provisioner · capability profiles |
|
|
20
|
+
| [Installation](Installation.md) | `gem install pwn` → `pwn setup` doctor/provisioner · capability profiles · `--migrate` state doctor |
|
|
21
21
|
| [General Usage](General-PWN-Usage.md) | Day-one cheat sheet |
|
|
22
22
|
| [Configuration](Configuration.md) | `~/.pwn/pwn.yaml` (encrypted) - engines, keys, agent options · `pwn-vault` |
|
|
23
23
|
| **[All Data-Flow Diagrams](Diagrams.md)** | **27 SVGs** in one scrollable page |
|
|
@@ -36,13 +36,14 @@
|
|
|
36
36
|
| | |
|
|
37
37
|
|---|---|
|
|
38
38
|
| [AI / LLM Integration](AI-Integration.md) | OpenAI · Anthropic · Grok (OAuth) · Gemini · Ollama |
|
|
39
|
-
| [Agent Tool Registry](Agent-Tool-Registry.md) | 10 toolsets ·
|
|
39
|
+
| [Agent Tool Registry](Agent-Tool-Registry.md) | 10 toolsets · **71** LLM-callable tools |
|
|
40
40
|
| [Memory · Skills · Learning](Skills-Memory-Learning.md) | Introspection - the self-improvement loop |
|
|
41
41
|
| [Mistakes](Mistakes.md) | **Negative feedback** - fingerprint failures · do-NOT-repeat · `[REPEATING]`/`[REGRESSED]` · inline self-correction |
|
|
42
|
-
| [
|
|
42
|
+
| [Reinforcement Learning](Reinforcement-Learning.md) | **`Reward` + `Curriculum`** - ORM/PRM judge · sentinel · HER · self-play · DPO export · **regression-gated LoRA** |
|
|
43
|
+
| [Extrospection](Extrospection.md) | World-awareness - snapshot · drift · intel · **watch** · **verify** · **rf_tune** · **osint** · serial · telecomm · packet · vision · voice · correlate |
|
|
43
44
|
| [Swarm (Multi-Agent)](Swarm.md) | Personas · ask · debate · broadcast · shared bus |
|
|
44
45
|
| [Sessions](Sessions.md) | Transcript persistence + reflection |
|
|
45
|
-
| [Cron](Cron.md) | Scheduled autonomous jobs |
|
|
46
|
+
| [Cron](Cron.md) | Scheduled autonomous jobs (nightly self-play + weekly weight-loop seeded by default) |
|
|
46
47
|
|
|
47
48
|
## 🧩 Capability Namespaces (`lib/pwn/*`)
|
|
48
49
|
|
|
@@ -62,14 +63,14 @@
|
|
|
62
63
|
| [Blockchain](Blockchain.md) | BTC · ETH helpers |
|
|
63
64
|
| [Bounty](Bounty.md) | Lifecycle / auth-replay tooling |
|
|
64
65
|
| [Reports](Reporting.md) | HTML/JSON output + DefectDojo/Jira |
|
|
65
|
-
| [FFI](FFI.md) | Native DSP/RF backends (Volk · Liquid · FFTW · HackRF · RTL-SDR · SoapySDR) |
|
|
66
|
+
| [FFI](FFI.md) | Native DSP/RF backends (Volk · Liquid · FFTW · HackRF · RTL-SDR · **AdalmPluto** · SoapySDR · Stdio) |
|
|
66
67
|
| [Banner](Banner.md) | 15 startup banners |
|
|
67
68
|
|
|
68
69
|
## 🛠️ Meta
|
|
69
70
|
|
|
70
71
|
| | |
|
|
71
72
|
|---|---|
|
|
72
|
-
| [`~/.pwn/` Filesystem Map](Persistence.md) | Every file PWN writes and why |
|
|
73
|
+
| [`~/.pwn/` Filesystem Map](Persistence.md) | Every file PWN writes and why · `PWN::Migrate` state doctor |
|
|
73
74
|
| [Troubleshooting](Troubleshooting.md) | Common errors and fixes |
|
|
74
75
|
| [Contributing](Contributing.md) | Conventions, RuboCop, spec rules |
|
|
75
76
|
|
|
@@ -208,7 +208,8 @@ row as `MISSING` until a key is set.
|
|
|
208
208
|
Everything above is a thin CLI over one autoloaded module:
|
|
209
209
|
|
|
210
210
|
```ruby
|
|
211
|
-
PWN::Setup.check # → { ok:, native_gems_missing:, toolchain_missing:, pkg_manager:, os:, arch: }
|
|
211
|
+
PWN::Setup.check # → { ok:, native_gems_missing:, toolchain_missing:, state:, pkg_manager:, os:, arch: }
|
|
212
|
+
PWN::Setup.migrate(fix: true) # verify + autofix ~/.pwn state files (see PWN::Migrate)
|
|
212
213
|
PWN::Setup.deps(profile: :web, yes: true) # install, then re-check
|
|
213
214
|
PWN::Setup.list_profiles
|
|
214
215
|
PWN::Setup.pkg_manager # → { key: :apt, install: 'sudo apt-get install -y', sudo: true }
|
|
@@ -237,3 +238,27 @@ pwn[CURRENT_VERSION]:004 >>> pwn-ai # launches agent TUI
|
|
|
237
238
|
**Next:** [Configuration](Configuration.md) · [General Usage](General-PWN-Usage.md)
|
|
238
239
|
|
|
239
240
|
[← Home](Home.md)
|
|
241
|
+
|
|
242
|
+
---
|
|
243
|
+
|
|
244
|
+
## Upgrading — `~/.pwn` state migration
|
|
245
|
+
|
|
246
|
+
After `gem update pwn`, run the state doctor to verify (and autofix)
|
|
247
|
+
every persisted file under `~/.pwn` against the new release:
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
pwn setup --migrate # verify + apply schema migrations (backup taken)
|
|
251
|
+
pwn setup --migrate --fix # also autofix incompatible files
|
|
252
|
+
pwn setup --migrate --dry-run # report only, write nothing
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
`PWN::Migrate` (autoloaded) stamps `~/.pwn/.schema` with the release
|
|
256
|
+
schema number, checks each state file (`memory.json`, `metrics.json`,
|
|
257
|
+
`mistakes.json`, `learning.jsonl`, `agents.yml`, `cron/jobs.yml`,
|
|
258
|
+
`skills/`, …) against its owning module's loader, and — with `--fix` —
|
|
259
|
+
deep-merges any keys the current `PWN::Config.env_template` added into
|
|
260
|
+
your encrypted `~/.pwn/pwn.yaml` **without overwriting your values**.
|
|
261
|
+
Every run takes a timestamped backup under `~/.pwn/backup/<ts>/` first.
|
|
262
|
+
|
|
263
|
+
The plain `pwn` launcher will also print a one-line drift warning on
|
|
264
|
+
startup whenever `~/.pwn/.schema` predates the running gem.
|
data/lib/pwn/config.rb
CHANGED
|
@@ -7,26 +7,16 @@ module PWN
|
|
|
7
7
|
# Used to manage PWN configuration settings within PWN drivers.
|
|
8
8
|
module Config
|
|
9
9
|
# Supported Method Parameters::
|
|
10
|
-
#
|
|
11
|
-
#
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
#{pwn_env_path}
|
|
21
|
-
2. Your decryptor file will be written to:
|
|
22
|
-
#{pwn_dec_path}
|
|
23
|
-
3. Use the pwn-vault command in the pwn prototyping driver to update:
|
|
24
|
-
#{pwn_env_path}
|
|
25
|
-
4. For optimal security, it's recommended to move:
|
|
26
|
-
#{pwn_dec_path}
|
|
27
|
-
to a secure location and use the --pwn-dec parameter for PWN drivers.
|
|
28
|
-
"
|
|
29
|
-
env = {
|
|
10
|
+
# tmpl = PWN::Config.env_template
|
|
11
|
+
#
|
|
12
|
+
# The canonical current-release ~/.pwn/pwn.yaml shape as a pure Hash
|
|
13
|
+
# (no I/O, no vault write, no puts). Single source of truth used by:
|
|
14
|
+
# * PWN::Config.default_env — seed a fresh ~/.pwn/pwn.yaml
|
|
15
|
+
# * PWN::Migrate.vault_drift — diff a user vault against this release
|
|
16
|
+
# * PWN::Migrate.backfill_vault — deep-merge missing keys UNDER the
|
|
17
|
+
# user values on `pwn setup --migrate --fix`
|
|
18
|
+
public_class_method def self.env_template
|
|
19
|
+
{
|
|
30
20
|
ai: {
|
|
31
21
|
active: 'grok',
|
|
32
22
|
module_reflection: false,
|
|
@@ -174,6 +164,31 @@ module PWN
|
|
|
174
164
|
provider: 'yaml'
|
|
175
165
|
}
|
|
176
166
|
}
|
|
167
|
+
rescue StandardError => e
|
|
168
|
+
raise e
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
# Supported Method Parameters::
|
|
172
|
+
# env = PWN::Config.default_env(
|
|
173
|
+
# pwn_env_path: 'optional - Path to pwn.yaml file. Defaults to ~/.pwn/pwn.yaml'
|
|
174
|
+
# )
|
|
175
|
+
public_class_method def self.default_env(opts = {})
|
|
176
|
+
pwn_env_path = opts[:pwn_env_path]
|
|
177
|
+
pwn_dec_path = "#{pwn_env_path}.decryptor"
|
|
178
|
+
|
|
179
|
+
puts "
|
|
180
|
+
[*] NOTICE:
|
|
181
|
+
1. Writing minimal PWN::Env to:
|
|
182
|
+
#{pwn_env_path}
|
|
183
|
+
2. Your decryptor file will be written to:
|
|
184
|
+
#{pwn_dec_path}
|
|
185
|
+
3. Use the pwn-vault command in the pwn prototyping driver to update:
|
|
186
|
+
#{pwn_env_path}
|
|
187
|
+
4. For optimal security, it's recommended to move:
|
|
188
|
+
#{pwn_dec_path}
|
|
189
|
+
to a secure location and use the --pwn-dec parameter for PWN drivers.
|
|
190
|
+
"
|
|
191
|
+
env = env_template
|
|
177
192
|
|
|
178
193
|
# Remove beginning colon from key names
|
|
179
194
|
|
|
@@ -393,6 +408,13 @@ module PWN
|
|
|
393
408
|
Pry.config.refresh_pwn_env = false if defined?(Pry)
|
|
394
409
|
|
|
395
410
|
puts "[*] PWN::Env loaded via: #{pwn_env_path}\n"
|
|
411
|
+
|
|
412
|
+
# Upgrade drift — cheap schema-stamp check only (no per-file probes).
|
|
413
|
+
if defined?(PWN::Migrate) && PWN::Migrate.needed?
|
|
414
|
+
puts "[!] ~/.pwn state predates pwn #{PWN::VERSION} (schema " \
|
|
415
|
+
"#{PWN::Migrate.installed_schema} < #{PWN::Migrate::SCHEMA_VERSION}). " \
|
|
416
|
+
'Run `pwn setup --migrate --fix` to autofix (backup taken first).'
|
|
417
|
+
end
|
|
396
418
|
rescue StandardError => e
|
|
397
419
|
raise e
|
|
398
420
|
end
|