pwn 0.5.669 → 0.5.670

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: 746a770eb9c9d4d410cd3fff4deb631ac67476a8d4f01ba7cf17c8414d4930d9
4
- data.tar.gz: 0aa9628ff2b8f80ed5b06fe682d8c252d4609c3545c96b68dd3890897de3d402
3
+ metadata.gz: df46a72d0f582458534c1bcfcbdc0fcbf121cf002828ff5da313a5cf5eddea37
4
+ data.tar.gz: c4bf47cbbe4e7ad22d52104f4fa9af499c06176cae9b93500652956428abe4a2
5
5
  SHA512:
6
- metadata.gz: adee5114bbd4a83820b12f591d334aeec378f5bf47d7b51d10e3ee9d14497e08207ee532eb2eab7881cb8bb2a1f8910ef6a83712b8b3cb1f7ed7d25cc14f0312
7
- data.tar.gz: 5343e693c473baf4112b47b1c8a932a22b6ec46ddf1998c34e828aa79483d7c350bce500ed502f015944960b8e8ec867028f4261f11ddd57360853286778a829
6
+ metadata.gz: c51242fc7542f675245804852cb313d75a8779675032148585cfde8afab392934d9da03eef08765d1339bca64732c7c3d7350a6ff76a366801c36e5b9e315df5
7
+ data.tar.gz: 983ff27f8a551664fbc42a5d72357389fee1aaeeb67da5c7b82e4704fa54c06d469aa4589585369c48eca7441193644fd837a08049ee3a560a6bb99f424ba007
data/Gemfile CHANGED
@@ -18,7 +18,7 @@ gem 'aws-sdk', '3.3.0'
18
18
  gem 'barby', '0.7.0'
19
19
  gem 'base32', '0.3.4'
20
20
  gem 'bitcoin-ruby', '0.0.20'
21
- gem 'brakeman', '8.0.5'
21
+ gem 'brakeman', '8.0.6'
22
22
  gem 'bson', '5.2.0'
23
23
  gem 'bundler', '>=4.0.18'
24
24
  gem 'bundler-audit', '>=0.9.3'
data/README.md CHANGED
@@ -118,8 +118,10 @@ message bus:
118
118
  ![Swarm Multi-Agent](documentation/diagrams/swarm-multi-agent.svg)
119
119
 
120
120
  Long-running turns also show **executive task briefs** (not raw commands) via
121
- `TaskSummarizer`: one full plan on submit (`emit_plan!`), then per-batch
122
- `about_to` lines keyed by `tool_counts_phrase` + `intent_phrase` with
121
+ `TaskSummarizer`. Every request is first classified as a **general statement**,
122
+ a **question**, or an **autonomous goal**. Only autonomous goals get a multi-step
123
+ breakdown on submit (`emit_plan!`); statements and questions stay single-turn.
124
+ Per-batch `about_to` lines use `tool_counts_phrase` + `intent_phrase` with
123
125
  `last_brief_fp` duplicate suppression. When recent turns keep hitting the iteration ceiling, the Loop tightens the remaining runway (lower `max_iters` on local engines, text-only tail, no counterfactual fork) so the agent still finishes instead of thrashing.
124
126
 
125
127
  Full pages: [How PWN Works](documentation/How-PWN-Works.md) ·
@@ -48,7 +48,7 @@ The harness adapts to the *class* of engine, not the model name:
48
48
  | **MEMORY ranking** | relevance-ranked when a local Ollama `embed_model` is reachable, else newest-first | relevance-ranked via `PWN::MemoryIndex` (`~/.pwn/memory.idx`) |
49
49
  | **Tool schemas shipped** | all toolsets | `CORE_TOOLS` + top-K keyword matches when `ai.agent.tool_router` is on |
50
50
  | **Pre-pass** | none | `plan_first` numbered tool plan before first dispatch |
51
- | **Intent route** | always | `request_intent` short-circuits how-to (text only) and unauthorized recon (refuse) on all engines; critical for ollama/openwebui |
51
+ | **Intent route** | always | `request_intent` + LLM/heuristic `request_kind` (statement \| question \| autonomous_goal). Short-circuits how-to/questions (text only), greetings/statements (fixed ack), pure recall, and unauthorized recon on all engines; host-evidence Qs (hostname/cwd/whoami) and only true autonomous goals get multi-step TaskSummarizer plans. Critical for ollama/openwebui |
52
52
  | **Few-shot** | none | `Learning.exemplars_for(request)` splices a prior successful trace |
53
53
  | **Dispatch parsing** | strict | tolerant - Levenshtein tool-name repair + JSON5-ish arg cleanup, each repair fingerprinted into `Mistakes` |
54
54
  | **Post-answer** | `auto_introspect` | `auto_introspect` **+** `fact_check_local_final` (auto `extro_verify` on CVE/version-shaped claims) |
@@ -103,6 +103,8 @@ ai:
103
103
  task_summary_every: 5 # When task_summary_verbose: emit Progress every N completed tools.
104
104
  task_summary_interval_s: 8.0 # When verbose: also emit when this many seconds elapsed.
105
105
  task_summary_verbose: false # Mid-flight Progress/Finished lines (default: only plan + about_to).
106
+ task_summary_llm: true # LLM tangible-task decompose for autonomous goals (default on). false = offline fallback.
107
+ request_kind_llm: ~ # LLM request_kind classifier (statement|question|autonomous_goal). nil = follow task_summary_llm.
106
108
  max_depth: 3 # Recursion guard: how many levels deep agent_ask/agent_debate sub-agents may spawn sub-agents.
107
109
  auto_introspect: true # Run Learning.auto_introspect (outcome logging + lesson mining) after every final answer.
108
110
  auto_extrospect: false # Optional ambient baseline (host/repo/env ONLY - never launches burpsuite/zaproxy/msf/gqrx). Sense tools (intel/verify/watch/rf_tune/observe) stay on-demand.
@@ -268,6 +270,8 @@ PWN::Config.refresh_env
268
270
  | `ai.agent.task_summary_every` | Integer | `5` | `TaskSummarizer.every_n` | Verbose progress cadence (tools). |
269
271
  | `ai.agent.task_summary_interval_s` | Float | `8.0` | `TaskSummarizer.interval_s` | Verbose progress cadence (seconds). |
270
272
  | `ai.agent.task_summary_verbose` | Boolean | `false` | `TaskSummarizer.verbose?` | Emit mid-flight `Progress:` / `Finished:` lines; default keeps only plan + about_to. |
273
+ | `ai.agent.task_summary_llm` | Boolean \| `nil` | `nil` (on) | `TaskSummarizer.llm_plan_enabled?` | LLM tangible-task decomposition for autonomous goals. `false` forces offline generic fallback (tests / air-gap). |
274
+ | `ai.agent.request_kind_llm` | Boolean \| `nil` | `nil` (follow `task_summary_llm`) | `TaskSummarizer.llm_kind_enabled?` / `request_kind` | LLM classifier for `statement` \| `question` \| `autonomous_goal`. Cheap intents and host-evidence heuristics still win first; `false` is heuristic-only. |
271
275
  | `ai.agent.max_depth` | Integer | `3` | `PWN::AI::Agent::Swarm` | Recursion guard for `agent_ask` / `agent_debate` sub-agents spawning sub-agents. |
272
276
  | `ai.agent.auto_introspect` | Boolean | `true` | `PWN::AI::Agent::Learning.auto_introspect` | Run outcome logging + lesson mining after every final answer. Toggle live via `learning_auto_introspect_toggle`. |
273
277
  | `ai.agent.auto_extrospect` | Boolean | `false` | `PWN::AI::Agent::Extrospection.auto_extrospect` | Optional ambient baseline after every final answer (`AUTO_SECTIONS` = host/repo/env only; never spawns GUI/JVM tools). Prefer on-demand sense tools (`intel`/`verify`/`watch`/`rf_tune`/`observe`). Toggle live via `extro_auto_toggle`. |
@@ -28,7 +28,7 @@ hardware).
28
28
  | Module | Role |
29
29
  |---|---|
30
30
  | `Loop` | plan → **TaskSummarizer** briefs → dispatch tool_calls → observe → repeat until final answer; tightens runway when recent turns exhausted the budget |
31
- | **`TaskSummarizer`** | Executive UX: English tasks primary - `emit_plan!` · `about_to` as `task k/n` + via tools · Loop `plan_context` injection · clearer `plan_idx` advance |
31
+ | **`TaskSummarizer`** | Executive UX: LLM/heuristic `request_kind` gates plans (only autonomous goals, including host-evidence Qs) - English tasks primary - `emit_plan!` · `about_to` as `task k/n` + via tools · Loop `plan_context` injection · clearer `plan_idx` advance |
32
32
  | `Registry` | JSON-Schema function definitions grouped into 12 **toolsets** · **82 tools** |
33
33
  | `Dispatch` / `Result` | execute a tool, capture stdout/value/error/duration |
34
34
  | `PromptBuilder` | inject MEMORY / SKILLS / LEARNING / **KNOWN MISTAKES + FIXES** / METRICS / EXTROSPECTION blocks |
@@ -1,6 +1,6 @@
1
1
  digraph "PWN_TaskSummarizer" {
2
2
  graph [
3
- label=<<B>PWN::AI::Agent::TaskSummarizer - Executive task briefs</B><BR/><FONT POINT-SIZE="11" COLOR="#94a3b8">emit_plan! (full goal once) about_to (per batch, deduped) → tools on their own lines · Loop single emitter</FONT>>,
3
+ label=<<B>PWN::AI::Agent::TaskSummarizer - Request kind + executive briefs</B><BR/><FONT POINT-SIZE="11" COLOR="#94a3b8">request_kind (statement|question: no plan) · (autonomous_goal: emit_plan! about_to → tools)</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
@@ -10,25 +10,34 @@ digraph "PWN_TaskSummarizer" {
10
10
  edge [fontname="Helvetica", fontsize=9, color="#94a3b8",
11
11
  fontcolor="#cbd5e1", penwidth=1.3, arrowsize=0.8];
12
12
 
13
- User [label="👤 User goal", fillcolor="#7dd3fc"];
14
- Loop [label="Loop.run\nts_state = TaskSummarizer.fresh", fillcolor="#c4b5fd"];
15
- {rank=same; User; Loop}
13
+ User [label="User request", fillcolor="#7dd3fc"];
14
+ Loop [label="Loop.run\nts_state = TaskSummarizer.fresh\nrequest_kind + request_intent", fillcolor="#c4b5fd"];
15
+ Kind [label="request_kind (LLM + heuristic)\nstatement | question | autonomous_goal\nhost-evidence Qs → goal", fillcolor="#fcd34d", penwidth=2];
16
+ {rank=same; User; Loop; Kind}
17
+
18
+ subgraph cluster_nogoal {
19
+ label="No multi-step breakdown"; fontcolor="#fda4af";
20
+ style=rounded; color="#be123c"; bgcolor="#4c0519"; penwidth=2;
21
+ Stmt [label="statement\nanswer_statement / greeting ack", fillcolor="#fda4af"];
22
+ Ques [label="question (knowledge/howto/recall)\nanswer_question / howto / recall\nno tools / no plan", fillcolor="#fda4af"];
23
+ }
24
+ {rank=same; Stmt; Ques}
16
25
 
17
26
  subgraph cluster_plan {
18
- label="Plan layer (once per turn)"; fontcolor="#ddd6fe";
27
+ label="Autonomous goal plan (once per turn)"; fontcolor="#ddd6fe";
19
28
  style=rounded; color="#6d28d9"; bgcolor="#2e1065"; penwidth=2;
20
- Plan [label="plan(request)\nenumerated steps or heuristic_decompose", fillcolor="#c4b5fd"];
21
- EmitP [label="emit_plan!\nGoal: …\nTangible tasks (N):\n 1. … 2. …", fillcolor="#c4b5fd", penwidth=2];
29
+ Plan [label="plan(request)\nenumerated · LLM · fallback\nordered work units", fillcolor="#c4b5fd"];
30
+ EmitP [label="emit_plan!\nKind: autonomous_goal\nGoal: ...\nTangible tasks (N):\n each may use 1+ tools", fillcolor="#c4b5fd", penwidth=2];
22
31
  }
23
32
  {rank=same; Plan; EmitP}
24
33
 
25
34
  subgraph cluster_batch {
26
35
  label="Batch layer (each tool collection)"; fontcolor="#a7f3d0";
27
36
  style=rounded; color="#047857"; bgcolor="#022c22"; penwidth=2;
28
- About [label="about_to(tools:)\ncapability_label\ntool_counts_phrase\nintent_phrase", fillcolor="#6ee7b7"];
37
+ About [label="about_to(tools:)\ntask k/n English primary\nvia tools (intent)", fillcolor="#6ee7b7"];
29
38
  FP [label="brief_fingerprint\nlast_brief_fp", fillcolor="#6ee7b7"];
30
39
  Dup [label="duplicate_brief?", shape=diamond, fillcolor="#fcd34d"];
31
- EmitB [label="emit task line\nNext: shell×2 (search)\n[task k/N: …]", fillcolor="#6ee7b7", penwidth=2];
40
+ EmitB [label="emit task line\ntask k/N: ...\nvia shell×2 (search)", fillcolor="#6ee7b7", penwidth=2];
32
41
  Skip [label="return nil\n(suppress duplicate)", fillcolor="#fda4af"];
33
42
  }
34
43
  {rank=same; About; FP; Dup; EmitB; Skip}
@@ -36,7 +45,7 @@ digraph "PWN_TaskSummarizer" {
36
45
  subgraph cluster_exec {
37
46
  label="Execution (not on task row)"; fontcolor="#fde68a";
38
47
  style=rounded; color="#a16207"; bgcolor="#422006"; penwidth=2;
39
- Tools [label="Dispatch tools\nshell · pwn_eval · …\nown REPL lines", fillcolor="#fcd34d"];
48
+ Tools [label="Dispatch tools\nshell · pwn_eval · ...\nown REPL lines", fillcolor="#fcd34d"];
40
49
  Rec [label="record!\nadvance plan_idx\n(silent unless verbose)", fillcolor="#fcd34d"];
41
50
  Flush [label="flush! / emit!\noptional closing brief", fillcolor="#fcd34d"];
42
51
  }
@@ -45,10 +54,13 @@ digraph "PWN_TaskSummarizer" {
45
54
  UI [label="REPL on_tool\nname='task', full text, result=''\n(no truncation)", fillcolor="#7dd3fc"];
46
55
 
47
56
  User -> Loop [color="#38bdf8", penwidth=2];
48
- Loop -> Plan [color="#a78bfa"];
57
+ Loop -> Kind [color="#fbbf24", penwidth=2];
58
+ Kind -> Stmt [label="statement", color="#fb7185"];
59
+ Kind -> Ques [label="question", color="#fb7185"];
60
+ Kind -> Plan [label="autonomous_goal", color="#a78bfa", penwidth=2];
49
61
  Plan -> EmitP [color="#a78bfa"];
50
62
  EmitP -> UI [label="full goal once", color="#38bdf8", penwidth=2];
51
- Loop -> About [label="before each\ntool batch", color="#a78bfa"];
63
+ Loop -> About [label="before each\ntool batch\n(goals only)", color="#a78bfa"];
52
64
  About -> FP [color="#34d399"];
53
65
  FP -> Dup [color="#34d399"];
54
66
  Dup -> EmitB [label="new", color="#34d399"];