Skip to content

Commit fb3ef87

Browse files
Merge pull request #392 from Ratio1/develop
fix: added back bitsandbytes in requirements temporarily; it will be …
2 parents e5fefd4 + 23e74cc commit fb3ef87

6 files changed

Lines changed: 14 additions & 12 deletions

File tree

extensions/business/cybersec/red_mesh/AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ Only append entries for critical or fundamental RedMesh backend changes, discove
302302

303303
### 2026-03-16T20:40:00Z
304304

305-
- Change: introduced a dedicated LLM payload-shaping boundary in [`mixins/llm_agent.py`](./mixins/llm_agent.py) so RedMesh no longer sends the full aggregated report directly to the LLM path.
305+
- Change: introduced a dedicated LLM payload-shaping boundary in [`mixins/llm_agent_mixin.py`](mixins/llm_agent_mixin.py) so RedMesh no longer sends the full aggregated report directly to the LLM path.
306306
- Change: added network and webapp-specific compact payload shaping, finding deduplication/ranking/capping, analysis-type budgets, and runtime payload-size observability.
307307
- Verification: the known failing job `a3a357bc` dropped from `303,760` raw bytes to `21,559` shaped bytes for `security_assessment` and completed manually in `38.97s` on rm1 instead of timing out.
308308
- Horizontal insight: RedMesh archive/report data and LLM reasoning data must remain separate contracts; future LLM work should extend the bounded payload model rather than re-coupling the agent to raw archived aggregates.

extensions/business/cybersec/red_mesh/mixins/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from .risk import _RiskScoringMixin
33
from .report import _ReportMixin
44
from .live_progress import _LiveProgressMixin
5-
from .llm_agent import _RedMeshLlmAgentMixin
5+
from .llm_agent_mixin import _RedMeshLlmAgentMixin
66

77
__all__ = [
88
"_AttestationMixin",

extensions/business/cybersec/red_mesh/mixins/llm_agent.py renamed to extensions/business/cybersec/red_mesh/mixins/llm_agent_mixin.py

File renamed without changes.

extensions/business/cybersec/red_mesh/tests/test_hardening.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def P(self, *_args, **_kwargs):
9292
class TestLlmRetryHardening(unittest.TestCase):
9393

9494
def test_build_llm_analysis_payload_network_is_compact_and_structured(self):
95-
from extensions.business.cybersec.red_mesh.mixins.llm_agent import _RedMeshLlmAgentMixin
95+
from extensions.business.cybersec.red_mesh.mixins.llm_agent_mixin import _RedMeshLlmAgentMixin
9696

9797
class MockHost(_RedMeshLlmAgentMixin):
9898
def __init__(self):
@@ -146,7 +146,7 @@ def __init__(self):
146146
self.assertEqual(payload["findings_summary"]["total_findings"], 2)
147147

148148
def test_run_aggregated_llm_analysis_uses_shaped_payload(self):
149-
from extensions.business.cybersec.red_mesh.mixins.llm_agent import _RedMeshLlmAgentMixin
149+
from extensions.business.cybersec.red_mesh.mixins.llm_agent_mixin import _RedMeshLlmAgentMixin
150150

151151
class MockHost(_RedMeshLlmAgentMixin):
152152
def __init__(self):
@@ -186,7 +186,7 @@ def _auto_analyze_report(self, job_id, report, target, scan_type="network", anal
186186
self.assertGreater(host._last_llm_payload_stats["reduction_bytes"], 0)
187187

188188
def test_build_llm_analysis_payload_deduplicates_and_tracks_truncation(self):
189-
from extensions.business.cybersec.red_mesh.mixins.llm_agent import _RedMeshLlmAgentMixin
189+
from extensions.business.cybersec.red_mesh.mixins.llm_agent_mixin import _RedMeshLlmAgentMixin
190190

191191
class MockHost(_RedMeshLlmAgentMixin):
192192
def __init__(self):
@@ -246,7 +246,7 @@ def __init__(self):
246246
self.assertTrue(all(len(finding["evidence"]) <= 220 for finding in payload["top_findings"]))
247247

248248
def test_quick_summary_payload_is_smaller_than_security_assessment(self):
249-
from extensions.business.cybersec.red_mesh.mixins.llm_agent import _RedMeshLlmAgentMixin
249+
from extensions.business.cybersec.red_mesh.mixins.llm_agent_mixin import _RedMeshLlmAgentMixin
250250

251251
class MockHost(_RedMeshLlmAgentMixin):
252252
def __init__(self):
@@ -291,7 +291,7 @@ def __init__(self):
291291
self.assertEqual(quick_payload["truncation"]["finding_limit"], 12)
292292

293293
def test_record_llm_payload_stats_tracks_size_reduction(self):
294-
from extensions.business.cybersec.red_mesh.mixins.llm_agent import _RedMeshLlmAgentMixin
294+
from extensions.business.cybersec.red_mesh.mixins.llm_agent_mixin import _RedMeshLlmAgentMixin
295295

296296
class MockHost(_RedMeshLlmAgentMixin):
297297
def __init__(self):
@@ -314,7 +314,7 @@ def Pd(self, *_args, **_kwargs):
314314
self.assertEqual(host._last_llm_payload_stats["job_id"], "job-obs")
315315

316316
def test_extract_report_findings_includes_graybox_results(self):
317-
from extensions.business.cybersec.red_mesh.mixins.llm_agent import _RedMeshLlmAgentMixin
317+
from extensions.business.cybersec.red_mesh.mixins.llm_agent_mixin import _RedMeshLlmAgentMixin
318318

319319
class MockHost(_RedMeshLlmAgentMixin):
320320
def __init__(self):
@@ -337,7 +337,7 @@ def __init__(self):
337337
self.assertEqual(findings[0]["scenario_id"], "S-1")
338338

339339
def test_build_llm_analysis_payload_webapp_is_compact_and_structured(self):
340-
from extensions.business.cybersec.red_mesh.mixins.llm_agent import _RedMeshLlmAgentMixin
340+
from extensions.business.cybersec.red_mesh.mixins.llm_agent_mixin import _RedMeshLlmAgentMixin
341341

342342
class MockHost(_RedMeshLlmAgentMixin):
343343
def __init__(self):
@@ -423,7 +423,7 @@ def __init__(self):
423423
self.assertEqual(payload["probe_summary"]["top_probes"][0]["probe"], "_graybox_authz")
424424

425425
def test_call_llm_agent_api_retries_transient_connection_error(self):
426-
from extensions.business.cybersec.red_mesh.mixins.llm_agent import _RedMeshLlmAgentMixin
426+
from extensions.business.cybersec.red_mesh.mixins.llm_agent_mixin import _RedMeshLlmAgentMixin
427427

428428
class MockHost(_RedMeshLlmAgentMixin):
429429
def __init__(self):
@@ -465,7 +465,7 @@ def flaky_post(*_args, **_kwargs):
465465
self.assertEqual(calls["count"], 2)
466466

467467
def test_call_llm_agent_api_does_not_retry_non_retryable_provider_rejection(self):
468-
from extensions.business.cybersec.red_mesh.mixins.llm_agent import _RedMeshLlmAgentMixin
468+
from extensions.business.cybersec.red_mesh.mixins.llm_agent_mixin import _RedMeshLlmAgentMixin
469469

470470
class MockHost(_RedMeshLlmAgentMixin):
471471
def __init__(self):

requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ python-telegram-bot[rate-limiter]
55
protobuf
66
ngrok
77

8+
bitsandbytes
9+
810
openai
911
sqlfluff
1012
pypdf

ver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__VER__ = '2.10.160'
1+
__VER__ = '2.10.170'

0 commit comments

Comments
 (0)