fix(inclusive-language): replace blacklist terminology with denylist
- Replace blacklisted_tools configuration key and comments in config/artemis.jsonc and README.md with denylisted_tools - Update AgentGlobalConfig and AgentConfig with denylisted_tools and validation aliases - Update AgentConfigBuilder and Explorer agent to use denylist conventions - Update Admin Console replay manager and data engine trace filters - Update all associated test suites and mock configurations - Add license headers and clean up test imports
This commit is contained in:
1 parent
5d2283deaa
commit
701a74b546
24 files changed
+201
-67
No files matched your search
@@ -843,7 +843,7 @@ async def test_explorer_initial_visual_marking_previous_screenshot_on_the_fly_oc
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_explorer_blacklisted_tool():
|
||||
async def test_explorer_denylisted_tool():
|
||||
# Mock context and state
|
||||
mock_ctx = MagicMock(spec=ArtemisContext)
|
||||
mock_ctx.device = MagicMock()
|
||||
@@ -855,12 +855,12 @@ async def test_explorer_blacklisted_tool():
|
||||
mock_ctx.llm_config.explorer = MagicMock()
|
||||
mock_ctx.llm_config.explorer.model = "gemini-3.6-flash"
|
||||
mock_ctx.agent_config = MagicMock()
|
||||
mock_ctx.agent_config.blacklisted_tools = {"explorer": ["search_xml_ocr"]}
|
||||
mock_ctx.agent_config.denylisted_tools = {"explorer": ["search_xml_ocr"]}
|
||||
|
||||
mock_state = MagicMock(spec=State)
|
||||
mock_state.latest_screenshot = "/tmp/test_screenshot.jpg"
|
||||
|
||||
# Response 1: Model calls search_xml_ocr (which is blacklisted)
|
||||
# Response 1: Model calls search_xml_ocr (which is denylisted)
|
||||
mock_response1 = MagicMock()
|
||||
mock_response1.text = ""
|
||||
mock_func_call1 = MagicMock()
|
||||
@@ -958,7 +958,7 @@ async def test_explorer_blacklisted_tool():
|
||||
assert mock_client.aio.models.generate_content.call_count == 2
|
||||
|
||||
# Verify the contents passed to the second call contain the error response
|
||||
# indicating that the tool is blacklisted and unavailable.
|
||||
# indicating that the tool is denylisted and unavailable.
|
||||
call_args = mock_client.aio.models.generate_content.call_args_list[1]
|
||||
contents = call_args[1]["contents"]
|
||||
|
||||
@@ -978,7 +978,7 @@ async def test_explorer_blacklisted_tool():
|
||||
for part in tool_content.parts:
|
||||
func_resp = part.function_response
|
||||
if func_resp and func_resp.name == "search_xml_ocr":
|
||||
assert "blacklisted and unavailable" in func_resp.response["error"]
|
||||
assert "denylisted and unavailable" in func_resp.response["error"]
|
||||
found_error = True
|
||||
|
||||
assert found_error
|
||||
|
||||
@@ -43,7 +43,7 @@ def mock_context(tmp_path):
|
||||
ctx.device.device_height = 2400
|
||||
|
||||
ctx.agent_config = Mock()
|
||||
ctx.agent_config.blacklisted_tools = {}
|
||||
ctx.agent_config.denylisted_tools = {}
|
||||
|
||||
ctx.data_engine = Mock()
|
||||
ctx.data_engine.base_dir = tmp_path
|
||||
|
||||
@@ -136,7 +136,7 @@ def test_agent_config_loading():
|
||||
assert agent_cfg.explorer.flash_mode == "flash"
|
||||
assert agent_cfg.explorer.pro_mode == "flash"
|
||||
assert agent_cfg.explorer.caching is True
|
||||
assert "explorer" in agent_cfg.blacklisted_tools
|
||||
assert "explorer" in agent_cfg.denylisted_tools
|
||||
assert agent_cfg.video_analyzer.enable_ledger is True
|
||||
assert agent_cfg.planner_validation.enabled is False
|
||||
assert agent_cfg.planner_validation.similarity_threshold == 0.85
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
# Copyright 2026 Google LLC
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
import asyncio
|
||||
import pytest
|
||||
from artemis.context import ArtemisContext, DeviceContext, DevicePlatform
|
||||
|
||||
Reference in new issue
Block a user