blitzstrike 1.0.48 → 1.0.49

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.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,21 @@ All notable changes to Blitz Strike are documented here.
5
5
  The format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/).
7
7
 
8
+ ## [1.0.49] — 2026-09-13
9
+
10
+ ### Added — Autonomous Security Engine (phase 9: failure recovery)
11
+
12
+ - **Failure Recovery** (`src/mission/recovery.ts`, §17):
13
+ - `diagnoseError()` — categorizes failures (network / permission /
14
+ missing_tool / invalid_args / scope / unknown).
15
+ - `recoveryDecision()` — network → retry (bounded); missing_tool → route to an
16
+ alternative agent; scope / permission / invalid_args → record (no retry).
17
+ - `AGENT_ALTERNATIVES` — fallback specialization per agent type.
18
+ - `recordFailure()` — a failed-approach record with a `future_policy` so the
19
+ autonomous system never blindly repeats the same mistake.
20
+ - Mission Control now routes task failures through the recovery engine and
21
+ persists `failed_approaches` into the mission state.
22
+
8
23
  ## [1.0.48] — 2026-09-13
9
24
 
10
25
  ### Added — Autonomous Security Engine (phase 8: coverage-driven scheduler)
package/dist/index.js CHANGED
@@ -17903,7 +17903,8 @@ function newMission(id, target, scope, mode, budget) {
17903
17903
  coverage: { dimensions: {} },
17904
17904
  memory_refs: [],
17905
17905
  termination_reason: null,
17906
- decision_log: []
17906
+ decision_log: [],
17907
+ failed_approaches: []
17907
17908
  };
17908
17909
  }
17909
17910
 
@@ -18654,6 +18655,67 @@ var init_coverage = __esm(() => {
18654
18655
  };
18655
18656
  });
18656
18657
 
18658
+ // src/mission/recovery.ts
18659
+ function diagnoseError(error) {
18660
+ const e = error.toLowerCase();
18661
+ if (/network|connect|timeout|econn|enotfound|unreachable|dns|resolve|refused|abort/i.test(e))
18662
+ return "network";
18663
+ if (/permission|eacces|denied|forbidden|401|403/i.test(e))
18664
+ return "permission";
18665
+ if (/not (installed|found)|no such|command not found|missing tool/i.test(e))
18666
+ return "missing_tool";
18667
+ if (/invalid|argument|usage|required|schema|type/i.test(e))
18668
+ return "invalid_args";
18669
+ if (/scope|authorized|out of scope|unauthorized/i.test(e))
18670
+ return "scope";
18671
+ return "unknown";
18672
+ }
18673
+ function recoveryDecision(task, error) {
18674
+ const category = diagnoseError(error);
18675
+ switch (category) {
18676
+ case "network":
18677
+ return task.attempts < 3 ? { action: "retry", reason: "transient network failure — retry", alternative_agent: null } : { action: "record", reason: "persistent network failure", alternative_agent: null };
18678
+ case "missing_tool":
18679
+ return { action: "alternative", reason: "tool unavailable — try alternative", alternative_agent: AGENT_ALTERNATIVES[task.agent_type]?.[0] ?? null };
18680
+ case "invalid_args":
18681
+ return { action: "record", reason: "invalid arguments — cannot auto-recover", alternative_agent: null };
18682
+ case "scope":
18683
+ return { action: "record", reason: "out of scope — do not retry", alternative_agent: null };
18684
+ case "permission":
18685
+ return { action: "record", reason: "permission denied — cannot auto-recover", alternative_agent: null };
18686
+ default:
18687
+ return task.attempts < 2 ? { action: "retry", reason: "unknown failure — retry once", alternative_agent: null } : { action: "record", reason: "unknown failure — give up", alternative_agent: null };
18688
+ }
18689
+ }
18690
+ function recordFailure(task, error) {
18691
+ const category = diagnoseError(error);
18692
+ return {
18693
+ technique: `${task.agent_type}:${task.objective}`,
18694
+ target: task.objective,
18695
+ category,
18696
+ reason: error,
18697
+ attempts: task.attempts,
18698
+ future_policy: category === "scope" ? "do not retry — out of scope" : category === "missing_tool" ? "route to an alternative agent next time" : category === "network" ? "retry with backoff" : "lower priority for this technique"
18699
+ };
18700
+ }
18701
+ var AGENT_ALTERNATIVES;
18702
+ var init_recovery = __esm(() => {
18703
+ AGENT_ALTERNATIVES = {
18704
+ commander: [],
18705
+ recon: ["api", "web"],
18706
+ web: ["api", "recon"],
18707
+ api: ["recon", "web"],
18708
+ source: ["analysis"],
18709
+ auth: ["analysis", "source"],
18710
+ mobile: ["source"],
18711
+ cloud: ["source"],
18712
+ analysis: ["source"],
18713
+ validator: ["reviewer"],
18714
+ reviewer: ["validator"],
18715
+ reporter: []
18716
+ };
18717
+ });
18718
+
18657
18719
  // src/mission/control.ts
18658
18720
  import { existsSync as existsSync8, statSync as statSync4 } from "node:fs";
18659
18721
  function scopeAllowed(mission) {
@@ -18774,8 +18836,29 @@ async function runMission(mission) {
18774
18836
  m = { ...m, report: r.output };
18775
18837
  }
18776
18838
  } else {
18777
- const failed = setTask(m.tasks, r.task.task_id, { status: r.task.attempts >= 2 ? "failed" : "retry", error: r.error ?? null });
18778
- m = { ...m, tasks: failed, decision_log: [...m.decision_log, { at: new Date().toISOString(), agent: r.task.agent_type, decision }] };
18839
+ const rec = recoveryDecision(r.task, r.error ?? "unknown error");
18840
+ const stamp = { at: new Date().toISOString(), agent: r.task.agent_type, decision };
18841
+ if (rec.action === "retry") {
18842
+ const retried = setTask(m.tasks, r.task.task_id, { status: "retry", error: r.error ?? null });
18843
+ m = { ...m, tasks: retried, decision_log: [...m.decision_log, stamp] };
18844
+ } else if (rec.action === "alternative" && rec.alternative_agent) {
18845
+ const failed = setTask(m.tasks, r.task.task_id, { status: "failed", error: r.error ?? null });
18846
+ const alt = createTask({ objective: `[alternative] ${r.task.objective}`, agent_type: rec.alternative_agent, risk: r.task.risk, priority: r.task.priority - 1 });
18847
+ m = {
18848
+ ...m,
18849
+ tasks: [...failed, alt],
18850
+ decision_log: [...m.decision_log, stamp],
18851
+ failed_approaches: [...m.failed_approaches, recordFailure(r.task, r.error ?? "")]
18852
+ };
18853
+ } else {
18854
+ const failed = setTask(m.tasks, r.task.task_id, { status: "failed", error: r.error ?? null });
18855
+ m = {
18856
+ ...m,
18857
+ tasks: failed,
18858
+ decision_log: [...m.decision_log, stamp],
18859
+ failed_approaches: [...m.failed_approaches, recordFailure(r.task, r.error ?? "")]
18860
+ };
18861
+ }
18779
18862
  }
18780
18863
  }
18781
18864
  m.budget.used_tasks += batch.length;
@@ -18816,6 +18899,7 @@ var init_control = __esm(() => {
18816
18899
  init_agents();
18817
18900
  init_planner();
18818
18901
  init_coverage();
18902
+ init_recovery();
18819
18903
  MODE_PROFILES = {
18820
18904
  web: { agents: ["recon", "web", "api", "auth", "validator", "reviewer", "reporter"], verify: true, risk: "medium" },
18821
18905
  api: { agents: ["recon", "api", "auth", "validator", "reviewer", "reporter"], verify: true, risk: "medium" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blitzstrike",
3
- "version": "1.0.48",
3
+ "version": "1.0.49",
4
4
  "description": "Blitz Strike — a universal MCP security-audit toolbelt. BLITZ sweeps the attack surface, EAGLE-EYE traces source-to-sink, STRIKE verifies live. 57 attack chains, 130-tool catalog, intelligence data layer. One server, every agent.",
5
5
  "type": "module",
6
6
  "bin": {