pwn 0.5.682 → 0.5.684
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/README.md +11 -10
- data/documentation/Agent-Tool-Registry.md +13 -9
- data/documentation/CLI-Drivers.md +27 -28
- data/documentation/Configuration.md +7 -5
- data/documentation/Contributing.md +2 -2
- data/documentation/Cron.md +11 -7
- data/documentation/Diagrams.md +2 -2
- data/documentation/General-PWN-Usage.md +1 -1
- data/documentation/Home.md +7 -6
- data/documentation/How-PWN-Works.md +9 -9
- data/documentation/Installation.md +1 -1
- data/documentation/Persistence.md +2 -1
- data/documentation/Plugins.md +3 -3
- data/documentation/Reinforcement-Learning.md +103 -101
- data/documentation/SAST.md +1 -1
- data/documentation/Session-Workflow.md +152 -0
- data/documentation/Sessions.md +2 -1
- data/documentation/Troubleshooting.md +2 -2
- data/documentation/What-is-PWN.md +3 -3
- data/documentation/diagrams/agent-tool-registry.svg +152 -152
- data/documentation/diagrams/cron-scheduling.svg +141 -121
- data/documentation/diagrams/dot/agent-tool-registry.dot +4 -4
- data/documentation/diagrams/dot/cron-scheduling.dot +10 -7
- data/documentation/diagrams/dot/driver-framework.dot +1 -1
- data/documentation/diagrams/dot/overall-pwn-architecture.dot +4 -4
- data/documentation/diagrams/dot/persistence-filesystem.dot +1 -1
- data/documentation/diagrams/dot/plugin-ecosystem.dot +2 -2
- data/documentation/diagrams/dot/task-summarizer.dot +18 -16
- data/documentation/diagrams/driver-framework.svg +1 -1
- data/documentation/diagrams/overall-pwn-architecture.svg +93 -93
- data/documentation/diagrams/persistence-filesystem.svg +4 -4
- data/documentation/diagrams/plugin-ecosystem.svg +101 -100
- data/documentation/diagrams/task-summarizer.svg +166 -156
- data/documentation/pwn-ai-Agent.md +9 -4
- data/lib/pwn/ai/agent/dispatch.rb +52 -1
- data/lib/pwn/ai/agent/loop.rb +198 -159
- data/lib/pwn/ai/agent/open_goal.rb +83 -0
- data/lib/pwn/ai/agent/policy.rb +2 -3
- data/lib/pwn/ai/agent/prompt_builder.rb +16 -13
- data/lib/pwn/ai/agent/registry.rb +6 -9
- data/lib/pwn/ai/agent/tools/sessions.rb +32 -0
- data/lib/pwn/ai/agent/tools/skills.rb +56 -0
- data/lib/pwn/ai/agent.rb +1 -0
- data/lib/pwn/ai/anthropic.rb +0 -1
- data/lib/pwn/ai/gemini.rb +0 -1
- data/lib/pwn/ai/grok.rb +0 -1
- data/lib/pwn/ai/ollama.rb +0 -1
- data/lib/pwn/ai/open_ai.rb +0 -1
- data/lib/pwn/ai/open_web_ui.rb +0 -1
- data/lib/pwn/config.rb +2 -2
- data/lib/pwn/cron.rb +18 -5
- data/lib/pwn/plugins/repl.rb +43 -1
- data/lib/pwn/plugins/tty_spinner.rb +109 -13
- data/lib/pwn/sessions.rb +82 -0
- data/lib/pwn/version.rb +1 -1
- data/spec/integration/persistence_roundtrip_spec.rb +2 -1
- data/spec/integration/prompt_builder_spec.rb +3 -3
- data/spec/integration/reinforced_feedback_loop_spec.rb +6 -11
- data/spec/lib/pwn/ai/agent/dispatch_spec.rb +38 -82
- data/spec/lib/pwn/ai/agent/loop_spec.rb +284 -11
- data/spec/lib/pwn/ai/agent/open_goal_spec.rb +37 -0
- data/spec/lib/pwn/ai/agent/prompt_builder_spec.rb +7 -3
- data/spec/lib/pwn/ai/agent/registry_spec.rb +16 -9
- data/spec/lib/pwn/ai/agent/tools/sessions_spec.rb +5 -0
- data/spec/lib/pwn/ai/agent/tools/skills_spec.rb +16 -0
- data/spec/lib/pwn/ai/red_team/test_case_engine_spec.rb +20 -0
- data/spec/lib/pwn/cron_spec.rb +13 -3
- data/spec/lib/pwn/plugins/repl_spec.rb +26 -0
- data/spec/lib/pwn/plugins/tty_spinner_spec.rb +44 -0
- data/spec/lib/pwn/sessions_spec.rb +29 -0
- data/spec/spec_helper.rb +6 -0
- data/third_party/pwn_rdoc.jsonl +28 -1
- metadata +4 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
digraph "PWN_Cron" {
|
|
2
2
|
graph [
|
|
3
|
-
label=<<B>PWN::Cron - Scheduled Autonomous Jobs</B><BR/><FONT POINT-SIZE="11" COLOR="#94a3b8">prompt · ruby · script → jobs.yml → worker → pwn-ai ·
|
|
3
|
+
label=<<B>PWN::Cron - Scheduled Autonomous Jobs</B><BR/><FONT POINT-SIZE="11" COLOR="#94a3b8">prompt · ruby · script → jobs.yml → worker → pwn-ai · hygiene on · curriculum opt-in</FONT>>,
|
|
4
4
|
labelloc=t, fontsize=20, fontname="Helvetica",
|
|
5
5
|
rankdir=LR, splines=spline, nodesep=0.5, ranksep=1.3,
|
|
6
6
|
bgcolor="#0f172a", fontcolor="#e2e8f0", pad=0.6, newrank=true
|
|
@@ -29,14 +29,15 @@ digraph "PWN_Cron" {
|
|
|
29
29
|
{rank=same; Prompt; Ruby; Script}
|
|
30
30
|
|
|
31
31
|
subgraph cluster_seed {
|
|
32
|
-
label="Seeded
|
|
32
|
+
label="Seeded Jobs (install_defaults)"; fontcolor="#ddd6fe"; style=rounded;
|
|
33
33
|
color="#6d28d9"; bgcolor="#2e1065"; penwidth=2;
|
|
34
|
-
Practice [label="curriculum_practice_nightly\n0 3 * *
|
|
35
|
-
Offline [label="curriculum_offline_judge\n30 3 * *
|
|
36
|
-
Train [label="curriculum_train_weekly\n0 4 * * 0\nCurriculum.train_and_gate\n(dry_run / export_ready)", fillcolor="#c4b5fd"];
|
|
37
|
-
MemGC [label="learning_consolidate_nightly\n0 5 * *
|
|
34
|
+
Practice [label="curriculum_practice_nightly\n0 3 * * * OFF\nCurriculum.practice(limit:3)", fillcolor="#c4b5fd"];
|
|
35
|
+
Offline [label="curriculum_offline_judge\n30 3 * * * OFF\nCurriculum.offline_judge", fillcolor="#c4b5fd"];
|
|
36
|
+
Train [label="curriculum_train_weekly\n0 4 * * 0 OFF\nCurriculum.train_and_gate\n(dry_run / export_ready)", fillcolor="#c4b5fd"];
|
|
37
|
+
MemGC [label="learning_consolidate_nightly\n0 5 * * * ON\nLearning.consolidate", fillcolor="#c4b5fd"];
|
|
38
|
+
Lean [label="pwn_stores_lean_nightly\n15 5 * * * ON\nLearning.gc_stores!", fillcolor="#c4b5fd"];
|
|
38
39
|
}
|
|
39
|
-
{rank=same; Practice; Offline; Train; MemGC}
|
|
40
|
+
{rank=same; Practice; Offline; Train; MemGC; Lean}
|
|
40
41
|
|
|
41
42
|
Log [label="~/.pwn/cron/log/<id>.log\nlast_run · last_status", shape=cylinder, fillcolor="#fcd34d"];
|
|
42
43
|
|
|
@@ -54,6 +55,7 @@ digraph "PWN_Cron" {
|
|
|
54
55
|
Ruby -> Offline [color="#a78bfa"];
|
|
55
56
|
Ruby -> Train [color="#a78bfa"];
|
|
56
57
|
Ruby -> MemGC [color="#a78bfa"];
|
|
58
|
+
Ruby -> Lean [color="#a78bfa"];
|
|
57
59
|
Prompt -> Log [color="#f59e0b"];
|
|
58
60
|
Ruby -> Log [color="#f59e0b"];
|
|
59
61
|
Script -> Log [color="#f59e0b"];
|
|
@@ -62,4 +64,5 @@ digraph "PWN_Cron" {
|
|
|
62
64
|
Offline -> Log [style=dashed, color="#fbbf24", constraint=false];
|
|
63
65
|
Train -> Log [style=dashed, color="#fbbf24", constraint=false];
|
|
64
66
|
MemGC -> Log [style=dashed, color="#fbbf24", constraint=false];
|
|
67
|
+
Lean -> Log [style=dashed, color="#fbbf24", constraint=false];
|
|
65
68
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
digraph "PWN_Driver" {
|
|
2
2
|
graph [
|
|
3
|
-
label=<<B>Driver Anatomy - bin/pwn_*</B><BR/><FONT POINT-SIZE="11" COLOR="#94a3b8">
|
|
3
|
+
label=<<B>Driver Anatomy - bin/pwn_*</B><BR/><FONT POINT-SIZE="11" COLOR="#94a3b8">54 executables (pwn + 53 pwn_*) · thin CLI over PWN::Plugins</FONT>>,
|
|
4
4
|
labelloc=t, fontsize=20, fontname="Helvetica",
|
|
5
5
|
rankdir=LR, splines=spline, nodesep=0.5, ranksep=1.3,
|
|
6
6
|
bgcolor="#0f172a", fontcolor="#e2e8f0", pad=0.6, newrank=true
|
|
@@ -27,7 +27,7 @@ digraph "PWN_Overall_Architecture" {
|
|
|
27
27
|
style=rounded; color="#0369a1"; bgcolor="#0c4a6e"; penwidth=2;
|
|
28
28
|
REPL [label="🐚 pwn REPL\nPry + PWN:: preload", fillcolor="#7dd3fc"];
|
|
29
29
|
PwnAI [label="✨ pwn-ai\nAgent TUI · pwn --ai", fillcolor="#7dd3fc"];
|
|
30
|
-
CLI [label="📜 bin/pwn_*\
|
|
30
|
+
CLI [label="📜 bin/pwn_*\n54 executables", fillcolor="#7dd3fc"];
|
|
31
31
|
Cronb [label="⏱ PWN::Cron\nScheduled jobs", fillcolor="#7dd3fc"];
|
|
32
32
|
}
|
|
33
33
|
{rank=same; REPL; PwnAI; CLI; Cronb}
|
|
@@ -36,8 +36,8 @@ digraph "PWN_Overall_Architecture" {
|
|
|
36
36
|
subgraph cluster_agent {
|
|
37
37
|
label="PWN::AI::Agent"; fontcolor="#ddd6fe";
|
|
38
38
|
style=rounded; color="#6d28d9"; bgcolor="#2e1065"; penwidth=2;
|
|
39
|
-
Loop [label="Loop\nTaskSummarizer briefs\
|
|
40
|
-
Registry [label="Registry\n13 toolsets ·
|
|
39
|
+
Loop [label="Loop\nTaskSummarizer briefs\nplan → dispatch → observe\nmax_iters 777 (scars do not shrink)\nlast-iter tools only if done", fillcolor="#c4b5fd"];
|
|
40
|
+
Registry [label="Registry\n13 toolsets · 87 tools\ntool_router (CORE+topK)", fillcolor="#c4b5fd"];
|
|
41
41
|
Swarm [label="Swarm\npersonas · debate · bus", fillcolor="#c4b5fd"];
|
|
42
42
|
Prompt [label="PromptBuilder\nengine-budgeted blocks\nMEMORY · SKILLS · POLICY\nMemoryIndex → relevance-ranked",fillcolor="#c4b5fd"];
|
|
43
43
|
}
|
|
@@ -47,7 +47,7 @@ digraph "PWN_Overall_Architecture" {
|
|
|
47
47
|
subgraph cluster_caps {
|
|
48
48
|
label="Capability Namespaces (lib/pwn/*)"; fontcolor="#a7f3d0";
|
|
49
49
|
style=rounded; color="#047857"; bgcolor="#022c22"; penwidth=2;
|
|
50
|
-
Plugins [label="Plugins\
|
|
50
|
+
Plugins [label="Plugins\n67 modules", fillcolor="#6ee7b7"];
|
|
51
51
|
SAST [label="SAST\n48 rules", fillcolor="#6ee7b7"];
|
|
52
52
|
WWW [label="WWW\n22 site drivers", fillcolor="#6ee7b7"];
|
|
53
53
|
AWS [label="AWS\n90 services", fillcolor="#6ee7b7"];
|
|
@@ -26,7 +26,7 @@ digraph "PWN_Persistence" {
|
|
|
26
26
|
ext [label="extrospection.json\nsnapshot (host/net/tc/repo/env/\nrf/web/osint/serial/telecomm/\npacket/vision/voice) + prev + obs[]"];
|
|
27
27
|
eart [label="extrospection/{web,packet,voice}/*\nscreenshots · pcaps · wav/txt"];
|
|
28
28
|
ses [label="sessions/*.jsonl\ntranscripts (+ step_reward)"];
|
|
29
|
-
crn [label="cron/jobs.yml + log/\
|
|
29
|
+
crn [label="cron/jobs.yml + log/\nhygiene ON: consolidate + lean\ncurriculum practice/judge/train OFF"];
|
|
30
30
|
agt [label="agents.yml\npersona registry"];
|
|
31
31
|
swm [label="swarm/<id>/bus.jsonl\nmulti-agent chat"];
|
|
32
32
|
cur [label="curriculum/ + curriculum_kpi.jsonl\nself-play · A/B eval · KPI trend"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
digraph "PWN_Plugins" {
|
|
2
2
|
graph [
|
|
3
|
-
label=<<B>PWN::Plugins -
|
|
3
|
+
label=<<B>PWN::Plugins - 67 Modules by Category</B>>,
|
|
4
4
|
labelloc=t, fontsize=20, fontname="Helvetica",
|
|
5
5
|
rankdir=LR, splines=spline, nodesep=0.25, ranksep=1.5,
|
|
6
6
|
bgcolor="#0f172a", fontcolor="#e2e8f0", pad=0.6, newrank=true
|
|
@@ -36,7 +36,7 @@ digraph "PWN_Plugins" {
|
|
|
36
36
|
h [label="Serial · BusPirate\nMSR206 · Android · BareSIP"];
|
|
37
37
|
c [label="Jenkins · Git · vSphere\nDefectDojo · BlackDuck"];
|
|
38
38
|
m [label="MailAgent · SlackClient\nIRC · RabbitMQ · TwitterAPI · Voice"];
|
|
39
|
-
u [label="FileFu · ThreadPool · Log\nChar · XXD · DetectOS\nScannableCodes · CreditCard\nSSN · EIN · VIN · Pony · PS"];
|
|
39
|
+
u [label="FileFu · ThreadPool · Log\nChar · XXD · DetectOS\nScannableCodes · CreditCard\nSSN · EIN · VIN · Pony · PS\nTTYSpinner"];
|
|
40
40
|
|
|
41
41
|
Root->Web; Root->Net; Root->Xpl; Root->Osint; Root->Data;
|
|
42
42
|
Root->Auth; Root->HW; Root->CI; Root->Comm; Root->Util;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
digraph "PWN_TaskSummarizer" {
|
|
2
2
|
graph [
|
|
3
|
-
label=<<B>PWN::AI::Agent::TaskSummarizer - executive briefs</B><BR/><FONT POINT-SIZE="11" COLOR="#94a3b8">every request
|
|
3
|
+
label=<<B>PWN::AI::Agent::TaskSummarizer - executive briefs</B><BR/><FONT POINT-SIZE="11" COLOR="#94a3b8">every request is a goal: emit_plan! then about_to then tools (no request type)</FONT>>,
|
|
4
4
|
labelloc=t, fontsize=20, fontname="Helvetica",
|
|
5
5
|
rankdir=TB, splines=spline, nodesep=0.55, ranksep=0.9,
|
|
6
6
|
bgcolor="#0f172a", fontcolor="#e2e8f0", pad=0.6, newrank=true, compound=true
|
|
@@ -11,23 +11,24 @@ digraph "PWN_TaskSummarizer" {
|
|
|
11
11
|
fontcolor="#cbd5e1", penwidth=1.3, arrowsize=0.8];
|
|
12
12
|
|
|
13
13
|
User [label="User request", fillcolor="#7dd3fc"];
|
|
14
|
-
Loop [label="Loop.run\nts_state = TaskSummarizer.fresh\nrequest_intent only", fillcolor="#c4b5fd"];
|
|
15
|
-
Kind [label="no request type\nevery turn is a goal", fillcolor="#fcd34d", penwidth=2];
|
|
14
|
+
Loop [label="Loop.run\nts_state = TaskSummarizer.fresh\nrequest_intent short-circuit only", fillcolor="#c4b5fd"];
|
|
15
|
+
Kind [label="no request type\nevery other turn is a goal", fillcolor="#fcd34d", penwidth=2];
|
|
16
16
|
{rank=same; User; Loop; Kind}
|
|
17
17
|
|
|
18
|
-
subgraph
|
|
19
|
-
label="
|
|
18
|
+
subgraph cluster_short {
|
|
19
|
+
label="Cheap short-circuits (no tools, no plan)"; fontcolor="#fda4af";
|
|
20
20
|
style=rounded; color="#be123c"; bgcolor="#4c0519"; penwidth=2;
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
Greet [label="greeting\nfixed short ack", fillcolor="#fda4af"];
|
|
22
|
+
HowTo [label="howto\nexample commands only", fillcolor="#fda4af"];
|
|
23
|
+
Recal [label="recall\nprior-turn answer", fillcolor="#fda4af"];
|
|
23
24
|
}
|
|
24
|
-
{rank=same;
|
|
25
|
+
{rank=same; Greet; HowTo; Recal}
|
|
25
26
|
|
|
26
27
|
subgraph cluster_plan {
|
|
27
|
-
label="
|
|
28
|
+
label="Goal plan (once per turn)"; fontcolor="#ddd6fe";
|
|
28
29
|
style=rounded; color="#6d28d9"; bgcolor="#2e1065"; penwidth=2;
|
|
29
30
|
Plan [label="plan(request)\nenumerated · LLM · fallback\nordered work units", fillcolor="#c4b5fd"];
|
|
30
|
-
EmitP [label="emit_plan!\
|
|
31
|
+
EmitP [label="emit_plan!\nGoal: (original request)\nTangible tasks (N):\n each may use 1+ tools", fillcolor="#c4b5fd", penwidth=2];
|
|
31
32
|
}
|
|
32
33
|
{rank=same; Plan; EmitP}
|
|
33
34
|
|
|
@@ -37,7 +38,7 @@ digraph "PWN_TaskSummarizer" {
|
|
|
37
38
|
About [label="about_to(tools:)\ntask k/n English primary\nvia tools (intent)", fillcolor="#6ee7b7"];
|
|
38
39
|
FP [label="brief_fingerprint\nlast_brief_fp", fillcolor="#6ee7b7"];
|
|
39
40
|
Dup [label="duplicate_brief?", shape=diamond, fillcolor="#fcd34d"];
|
|
40
|
-
EmitB [label="emit task line\ntask k/N
|
|
41
|
+
EmitB [label="emit task line\ntask k/N:\nvia shell (search)", fillcolor="#6ee7b7", penwidth=2];
|
|
41
42
|
Skip [label="return nil\n(suppress duplicate)", fillcolor="#fda4af"];
|
|
42
43
|
}
|
|
43
44
|
{rank=same; About; FP; Dup; EmitB; Skip}
|
|
@@ -45,7 +46,7 @@ digraph "PWN_TaskSummarizer" {
|
|
|
45
46
|
subgraph cluster_exec {
|
|
46
47
|
label="Execution (not on task row)"; fontcolor="#fde68a";
|
|
47
48
|
style=rounded; color="#a16207"; bgcolor="#422006"; penwidth=2;
|
|
48
|
-
Tools [label="Dispatch tools\nshell · pwn_eval ·
|
|
49
|
+
Tools [label="Dispatch tools\nshell · pwn_eval · CORE_TOOLS\nown REPL lines", fillcolor="#fcd34d"];
|
|
49
50
|
Rec [label="record!\nadvance plan_idx\n(silent unless verbose)", fillcolor="#fcd34d"];
|
|
50
51
|
Flush [label="flush! / emit!\noptional closing brief", fillcolor="#fcd34d"];
|
|
51
52
|
}
|
|
@@ -55,12 +56,13 @@ digraph "PWN_TaskSummarizer" {
|
|
|
55
56
|
|
|
56
57
|
User -> Loop [color="#38bdf8", penwidth=2];
|
|
57
58
|
Loop -> Kind [color="#fbbf24", penwidth=2];
|
|
58
|
-
Kind ->
|
|
59
|
-
Kind ->
|
|
60
|
-
Kind ->
|
|
59
|
+
Kind -> Greet [label="greeting", color="#fb7185"];
|
|
60
|
+
Kind -> HowTo [label="howto", color="#fb7185"];
|
|
61
|
+
Kind -> Recal [label="recall", color="#fb7185"];
|
|
62
|
+
Kind -> Plan [label="goal", color="#a78bfa", penwidth=2];
|
|
61
63
|
Plan -> EmitP [color="#a78bfa"];
|
|
62
64
|
EmitP -> UI [label="full goal once", color="#38bdf8", penwidth=2];
|
|
63
|
-
Loop -> About [label="before each\ntool batch
|
|
65
|
+
Loop -> About [label="before each\ntool batch", color="#a78bfa"];
|
|
64
66
|
About -> FP [color="#34d399"];
|
|
65
67
|
FP -> Dup [color="#34d399"];
|
|
66
68
|
Dup -> EmitB [label="new", color="#34d399"];
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<title>PWN_Driver</title>
|
|
11
11
|
<polygon fill="#0f172a" stroke="none" points="-43.2,43.2 -43.2,-397.2 684.45,-397.2 684.45,43.2 -43.2,43.2"/>
|
|
12
12
|
<text xml:space="preserve" text-anchor="start" x="191.62" y="-332" font-family="sans-Serif" font-weight="bold" font-size="20.00" fill="#e2e8f0">Driver Anatomy - bin/pwn_*</text>
|
|
13
|
-
<text xml:space="preserve" text-anchor="start" x="
|
|
13
|
+
<text xml:space="preserve" text-anchor="start" x="169.5" y="-320.55" font-family="sans-Serif" font-size="11.00" fill="#94a3b8">54 executables (pwn + 53 pwn_*) · thin CLI over PWN::Plugins</text>
|
|
14
14
|
<g id="clust1" class="cluster">
|
|
15
15
|
<title>cluster_d</title>
|
|
16
16
|
<path fill="#022c22" stroke="#047857" d="M276,-8C276,-8 419,-8 419,-8 425,-8 431,-14 431,-20 431,-20 431,-223 431,-223 431,-229 425,-235 419,-235 419,-235 276,-235 276,-235 270,-235 264,-229 264,-223 264,-223 264,-20 264,-20 264,-14 270,-8 276,-8"/>
|