From 801a330e274a7e8b94bd930b4bdf6dc249eb89d8 Mon Sep 17 00:00:00 2001 From: Alexander Myasoedov Date: Sun, 2 Mar 2025 22:55:21 +0200 Subject: [PATCH] feat(add fe is_active logic): --- agentic_security/probe_data/__init__.py | 6 ++-- agentic_security/static/index.html | 39 ++++++++++++------------- agentic_security/static/main.js | 4 +++ tests/test_registry.py | 2 ++ 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/agentic_security/probe_data/__init__.py b/agentic_security/probe_data/__init__.py index ecb04be..558194b 100644 --- a/agentic_security/probe_data/__init__.py +++ b/agentic_security/probe_data/__init__.py @@ -288,7 +288,7 @@ REGISTRY = REGISTRY_V0 + [ "dataset_name": "Lemhf14/EasyJailbreak_Datasets", "num_prompts": 1630, "tokens": 19758, - "is_active": True, + "is_active": False, "approx_cost": 0.0, "source": "Hugging Face Datasets", "selected": False, @@ -312,7 +312,7 @@ REGISTRY = REGISTRY_V0 + [ "dataset_name": "JailbreakV-28K/JailBreakV-28k", "num_prompts": 28300, "tokens": 1975800, - "is_active": True, + "is_active": False, "approx_cost": 0.0, "source": "Hugging Face Datasets", "selected": False, @@ -324,7 +324,7 @@ REGISTRY = REGISTRY_V0 + [ "dataset_name": "ShawnMenz/jailbreak_sft_rm_ds", "num_prompts": 371000, "tokens": 1975800, - "is_active": True, + "is_active": False, "approx_cost": 0.0, "source": "Hugging Face Datasets", "selected": False, diff --git a/agentic_security/static/index.html b/agentic_security/static/index.html index ff00c50..43e150e 100644 --- a/agentic_security/static/index.html +++ b/agentic_security/static/index.html @@ -383,27 +383,26 @@ class="text-gray-400 hover:underline">Deselect All -
-
-
{{ package.dataset_name - }}
-
- {{ package.source || 'Local dataset' }} -
-
- {{ package.dynamic ? 'Dynamic dataset' : - `${package.num_prompts.toLocaleString()} prompts` }} -
-
+
+
+
{{ package.dataset_name }}
+
+ {{ package.source || 'Local dataset' }}
+
+ {{ package.dynamic ? 'Dynamic dataset' : `${package.num_prompts.toLocaleString()} prompts` }} +
+
+
diff --git a/agentic_security/static/main.js b/agentic_security/static/main.js index c988ef7..c998ea1 100644 --- a/agentic_security/static/main.js +++ b/agentic_security/static/main.js @@ -350,6 +350,10 @@ var app = new Vue({ // If all are selected, deselect all. Otherwise, select all. this.dataConfig.forEach(package => { + if (!package.is_active) { + package.selected = false; + return + } package.selected = !allSelected; }); diff --git a/tests/test_registry.py b/tests/test_registry.py index 5f7a81c..2cf0cbc 100644 --- a/tests/test_registry.py +++ b/tests/test_registry.py @@ -10,6 +10,8 @@ def test_registry_accessibility(dataset): source = dataset.get("source", "") if "hugging" not in source.lower(): return pytest.skip("skipped dataset") + if not dataset.get("is_active"): + return pytest.skip("skipped dataset") dataset_name = dataset.get("dataset_name") if not dataset_name: