mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
style: ruff format leftovers from Wave A-D sessions
Pure whitespace / line-wrap reformats accumulated when ruff format ran during earlier waves but weren't included in their commits. No semantic changes — collection literals reflowed, with-statement context managers regrouped via PEP 617 parens.
This commit is contained in:
@@ -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 | "
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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; "
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user