-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug Description
netsecgame/game/worlds/CYSTCoordinator.py has multiple critical defects that make CYST integration non-functional and unsafe:
register_agentforcibly overwrites the provided role with"Attacker":
# CYSTCoordinator.py:64-67
async def register_agent(self, agent_id:tuple, agent_role:str, agent_initial_view:dict)->GameState:
self.logger.debug(f"Registering agent {agent_id} in the world.")
agent_role = "Attacker"This discards caller intent and stores only attacker role in _known_agent_roles.
register_agent/reset_agentmethod signatures do not match the baseGameCoordinatorcontract.
Base calls pass 4 logical parameters (agent_id, agent_role, agent_initial_view, agent_win_condition_view) and expect a tuple (game_state, goal_state), but CYSTCoordinator overrides accept only 3 parameters and return a single GameState.
CYSTCoordinator signatures:
async def register_agent(self, agent_id:tuple, agent_role:str, agent_initial_view:dict)->GameState
async def reset_agent(self, agent_id:tuple, agent_role:str, agent_initial_view:dict)->GameStateThis causes runtime failures in join/reset flows.
get_starting_position_from_cyst_confighas an indentation bug that writesstarting_positions[...]outsideif active_service.type == "netsecenv_agent", sohosts/networkscan be referenced before assignment for non-agent services.
# CYSTCoordinator.py:30-39 (current)
if active_service.type == "netsecenv_agent":
hosts = set()
networks = set()
...
starting_positions[f"{obj.id}.{active_service.name}"] = {"known_hosts":hosts, "known_networks":networks}Steps to Reproduce
- Start CYST coordinator world.
- Send
JoinGamefrom any agent. - Observe join path calls
register_agent(..., initial_view, win_condition_view)and fails due to signature mismatch / unpack expectation. - For role corruption, inspect
register_agent: role is overwritten to"Attacker"before cyst-id assignment. - For indentation bug, use CYST config with a non-
netsecenv_agentactive service before anetsecenv_agenton a node and callget_starting_position_from_cyst_config; observe exception due to uninitializedhosts/networks.
Expected Behavior
register_agentmust honor the passed role and never hardcode role elevation.register_agentandreset_agentinCYSTCoordinatormust match base contract:- accept
agent_win_condition_view - return
(GameState, GameState).
- accept
get_starting_position_from_cyst_configshould populatestarting_positionsonly insideif active_service.type == "netsecenv_agent".
Version
1.1
Installation / Deployment Method
Running locally from source
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working