diff --git a/roboco/api/schemas/v2/flow.py b/roboco/api/schemas/v2/flow.py index eeb09ea0..68ef63f8 100644 --- a/roboco/api/schemas/v2/flow.py +++ b/roboco/api/schemas/v2/flow.py @@ -50,7 +50,10 @@ class IAmBlockedRequest(BaseModel): if v is None: return v if isinstance(v, str) and v.lower() not in { - "external", "internal", "question", "dependency", + "external", + "internal", + "question", + "dependency", }: raise ValueError( f"blocker_type must be one of: external | internal | " @@ -178,7 +181,10 @@ class DelegateRequest(BaseModel): f"Priority is not a delegate parameter — drop it." ) if isinstance(v, str) and v.lower() not in { - "low", "medium", "high", "critical", + "low", + "medium", + "high", + "critical", }: raise ValueError( f"estimated_complexity must be one of: low, medium, high, " @@ -203,8 +209,12 @@ class DelegateRequest(BaseModel): def _task_type_must_be_known(cls, v: object) -> object: """Reject invented task_type values with the enum hint.""" if isinstance(v, str) and v.lower() not in { - "code", "documentation", "research", - "planning", "design", "administrative", + "code", + "documentation", + "research", + "planning", + "design", + "administrative", }: raise ValueError( f"task_type must be one of: code | documentation | research | " diff --git a/roboco/services/gateway/role_config.py b/roboco/services/gateway/role_config.py index f195005d..4629141b 100644 --- a/roboco/services/gateway/role_config.py +++ b/roboco/services/gateway/role_config.py @@ -40,8 +40,14 @@ _CHANNEL_DISCOVERY = ("channels",) _DEV_FLOW = spec.intents_for_role(spec.Role.DEVELOPER) _DEV_DO = ( - "commit", "note", "say", "dm", "evidence", "progress", - *_NOTIFY_RECEIVER, *_CHANNEL_DISCOVERY, + "commit", + "note", + "say", + "dm", + "evidence", + "progress", + *_NOTIFY_RECEIVER, + *_CHANNEL_DISCOVERY, ) _QA_FLOW = spec.intents_for_role(spec.Role.QA) @@ -49,30 +55,53 @@ _QA_DO = ("note", "say", "dm", "evidence", *_NOTIFY_RECEIVER, *_CHANNEL_DISCOVER _DOC_FLOW = spec.intents_for_role(spec.Role.DOCUMENTER) _DOC_DO = ( - "commit", "note", "say", "dm", "evidence", "progress", - *_NOTIFY_RECEIVER, *_CHANNEL_DISCOVERY, + "commit", + "note", + "say", + "dm", + "evidence", + "progress", + *_NOTIFY_RECEIVER, + *_CHANNEL_DISCOVERY, ) _CELL_PM_FLOW = spec.intents_for_role(spec.Role.CELL_PM) _CELL_PM_DO = ( - "note", "say", "dm", "notify", "evidence", - "open_session", "link_session", - *_NOTIFY_RECEIVER, *_CHANNEL_DISCOVERY, + "note", + "say", + "dm", + "notify", + "evidence", + "open_session", + "link_session", + *_NOTIFY_RECEIVER, + *_CHANNEL_DISCOVERY, ) _MAIN_PM_FLOW = spec.intents_for_role(spec.Role.MAIN_PM) _MAIN_PM_DO = ( - "note", "say", "dm", "notify", "evidence", - "open_session", "link_session", - *_NOTIFY_RECEIVER, *_CHANNEL_DISCOVERY, + "note", + "say", + "dm", + "notify", + "evidence", + "open_session", + "link_session", + *_NOTIFY_RECEIVER, + *_CHANNEL_DISCOVERY, ) _PRODUCT_OWNER_FLOW = spec.intents_for_role(spec.Role.PRODUCT_OWNER) _HEAD_MARKETING_FLOW = spec.intents_for_role(spec.Role.HEAD_MARKETING) _BOARD_DO = ( - "note", "say", "dm", "notify", "evidence", + "note", + "say", + "dm", + "notify", + "evidence", "open_session", # Board can open strategic sessions but not link arbitrary - *_NOTIFY_RECEIVER, *_CHANNEL_DISCOVERY, + *_NOTIFY_RECEIVER, + *_CHANNEL_DISCOVERY, ) _AUDITOR_FLOW = spec.intents_for_role(spec.Role.AUDITOR) diff --git a/tests/unit/services/test_workspace_fetch_cache.py b/tests/unit/services/test_workspace_fetch_cache.py index a1b73131..d1d9107d 100644 --- a/tests/unit/services/test_workspace_fetch_cache.py +++ b/tests/unit/services/test_workspace_fetch_cache.py @@ -164,9 +164,7 @@ async def test_force_true_bypasses_cache( # First call populates the cache. await svc.ensure_workspace(project_slug="roboco", agent_id=agent.id) # Second call with force=True must bypass the cache and fetch again. - await svc.ensure_workspace( - project_slug="roboco", agent_id=agent.id, force=True - ) + await svc.ensure_workspace(project_slug="roboco", agent_id=agent.id, force=True) assert fetch_call_count == _EXPECTED_TWO_FETCHES, ( f"force=True should bypass cache and fetch again; " diff --git a/tests/unit/services/test_workspace_fetch_log_level.py b/tests/unit/services/test_workspace_fetch_log_level.py index b64de09b..7ff84cf1 100644 --- a/tests/unit/services/test_workspace_fetch_log_level.py +++ b/tests/unit/services/test_workspace_fetch_log_level.py @@ -39,12 +39,10 @@ async def test_fetch_auth_fail_logs_at_debug() -> None: def capture_debug(event: str, **_kw: object) -> None: captured.append(("debug", event)) - with patch( - "roboco.services.workspace.subprocess.run", return_value=fake_result - ), patch( - "roboco.services.workspace.logger.warning", side_effect=capture_warning - ), patch( - "roboco.services.workspace.logger.debug", side_effect=capture_debug + with ( + patch("roboco.services.workspace.subprocess.run", return_value=fake_result), + patch("roboco.services.workspace.logger.warning", side_effect=capture_warning), + patch("roboco.services.workspace.logger.debug", side_effect=capture_debug), ): await WorkspaceService._fetch_origin_best_effort( workspace=workspace, project_slug="roboco-api" @@ -79,12 +77,10 @@ async def test_fetch_genuine_failure_still_warns() -> None: def capture_debug(event: str, **_kw: object) -> None: captured.append(("debug", event)) - with patch( - "roboco.services.workspace.subprocess.run", return_value=fake_result - ), patch( - "roboco.services.workspace.logger.warning", side_effect=capture_warning - ), patch( - "roboco.services.workspace.logger.debug", side_effect=capture_debug + with ( + patch("roboco.services.workspace.subprocess.run", return_value=fake_result), + patch("roboco.services.workspace.logger.warning", side_effect=capture_warning), + patch("roboco.services.workspace.logger.debug", side_effect=capture_debug), ): await WorkspaceService._fetch_origin_best_effort( workspace=workspace, project_slug="roboco-api"