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:
|
if v is None:
|
||||||
return v
|
return v
|
||||||
if isinstance(v, str) and v.lower() not in {
|
if isinstance(v, str) and v.lower() not in {
|
||||||
"external", "internal", "question", "dependency",
|
"external",
|
||||||
|
"internal",
|
||||||
|
"question",
|
||||||
|
"dependency",
|
||||||
}:
|
}:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"blocker_type must be one of: external | internal | "
|
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."
|
f"Priority is not a delegate parameter — drop it."
|
||||||
)
|
)
|
||||||
if isinstance(v, str) and v.lower() not in {
|
if isinstance(v, str) and v.lower() not in {
|
||||||
"low", "medium", "high", "critical",
|
"low",
|
||||||
|
"medium",
|
||||||
|
"high",
|
||||||
|
"critical",
|
||||||
}:
|
}:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"estimated_complexity must be one of: low, medium, high, "
|
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:
|
def _task_type_must_be_known(cls, v: object) -> object:
|
||||||
"""Reject invented task_type values with the enum hint."""
|
"""Reject invented task_type values with the enum hint."""
|
||||||
if isinstance(v, str) and v.lower() not in {
|
if isinstance(v, str) and v.lower() not in {
|
||||||
"code", "documentation", "research",
|
"code",
|
||||||
"planning", "design", "administrative",
|
"documentation",
|
||||||
|
"research",
|
||||||
|
"planning",
|
||||||
|
"design",
|
||||||
|
"administrative",
|
||||||
}:
|
}:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
f"task_type must be one of: code | documentation | research | "
|
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_FLOW = spec.intents_for_role(spec.Role.DEVELOPER)
|
||||||
_DEV_DO = (
|
_DEV_DO = (
|
||||||
"commit", "note", "say", "dm", "evidence", "progress",
|
"commit",
|
||||||
*_NOTIFY_RECEIVER, *_CHANNEL_DISCOVERY,
|
"note",
|
||||||
|
"say",
|
||||||
|
"dm",
|
||||||
|
"evidence",
|
||||||
|
"progress",
|
||||||
|
*_NOTIFY_RECEIVER,
|
||||||
|
*_CHANNEL_DISCOVERY,
|
||||||
)
|
)
|
||||||
|
|
||||||
_QA_FLOW = spec.intents_for_role(spec.Role.QA)
|
_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_FLOW = spec.intents_for_role(spec.Role.DOCUMENTER)
|
||||||
_DOC_DO = (
|
_DOC_DO = (
|
||||||
"commit", "note", "say", "dm", "evidence", "progress",
|
"commit",
|
||||||
*_NOTIFY_RECEIVER, *_CHANNEL_DISCOVERY,
|
"note",
|
||||||
|
"say",
|
||||||
|
"dm",
|
||||||
|
"evidence",
|
||||||
|
"progress",
|
||||||
|
*_NOTIFY_RECEIVER,
|
||||||
|
*_CHANNEL_DISCOVERY,
|
||||||
)
|
)
|
||||||
|
|
||||||
_CELL_PM_FLOW = spec.intents_for_role(spec.Role.CELL_PM)
|
_CELL_PM_FLOW = spec.intents_for_role(spec.Role.CELL_PM)
|
||||||
_CELL_PM_DO = (
|
_CELL_PM_DO = (
|
||||||
"note", "say", "dm", "notify", "evidence",
|
"note",
|
||||||
"open_session", "link_session",
|
"say",
|
||||||
*_NOTIFY_RECEIVER, *_CHANNEL_DISCOVERY,
|
"dm",
|
||||||
|
"notify",
|
||||||
|
"evidence",
|
||||||
|
"open_session",
|
||||||
|
"link_session",
|
||||||
|
*_NOTIFY_RECEIVER,
|
||||||
|
*_CHANNEL_DISCOVERY,
|
||||||
)
|
)
|
||||||
|
|
||||||
_MAIN_PM_FLOW = spec.intents_for_role(spec.Role.MAIN_PM)
|
_MAIN_PM_FLOW = spec.intents_for_role(spec.Role.MAIN_PM)
|
||||||
_MAIN_PM_DO = (
|
_MAIN_PM_DO = (
|
||||||
"note", "say", "dm", "notify", "evidence",
|
"note",
|
||||||
"open_session", "link_session",
|
"say",
|
||||||
*_NOTIFY_RECEIVER, *_CHANNEL_DISCOVERY,
|
"dm",
|
||||||
|
"notify",
|
||||||
|
"evidence",
|
||||||
|
"open_session",
|
||||||
|
"link_session",
|
||||||
|
*_NOTIFY_RECEIVER,
|
||||||
|
*_CHANNEL_DISCOVERY,
|
||||||
)
|
)
|
||||||
|
|
||||||
_PRODUCT_OWNER_FLOW = spec.intents_for_role(spec.Role.PRODUCT_OWNER)
|
_PRODUCT_OWNER_FLOW = spec.intents_for_role(spec.Role.PRODUCT_OWNER)
|
||||||
_HEAD_MARKETING_FLOW = spec.intents_for_role(spec.Role.HEAD_MARKETING)
|
_HEAD_MARKETING_FLOW = spec.intents_for_role(spec.Role.HEAD_MARKETING)
|
||||||
_BOARD_DO = (
|
_BOARD_DO = (
|
||||||
"note", "say", "dm", "notify", "evidence",
|
"note",
|
||||||
|
"say",
|
||||||
|
"dm",
|
||||||
|
"notify",
|
||||||
|
"evidence",
|
||||||
"open_session", # Board can open strategic sessions but not link arbitrary
|
"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)
|
_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.
|
# First call populates the cache.
|
||||||
await svc.ensure_workspace(project_slug="roboco", agent_id=agent.id)
|
await svc.ensure_workspace(project_slug="roboco", agent_id=agent.id)
|
||||||
# Second call with force=True must bypass the cache and fetch again.
|
# Second call with force=True must bypass the cache and fetch again.
|
||||||
await svc.ensure_workspace(
|
await svc.ensure_workspace(project_slug="roboco", agent_id=agent.id, force=True)
|
||||||
project_slug="roboco", agent_id=agent.id, force=True
|
|
||||||
)
|
|
||||||
|
|
||||||
assert fetch_call_count == _EXPECTED_TWO_FETCHES, (
|
assert fetch_call_count == _EXPECTED_TWO_FETCHES, (
|
||||||
f"force=True should bypass cache and fetch again; "
|
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:
|
def capture_debug(event: str, **_kw: object) -> None:
|
||||||
captured.append(("debug", event))
|
captured.append(("debug", event))
|
||||||
|
|
||||||
with patch(
|
with (
|
||||||
"roboco.services.workspace.subprocess.run", return_value=fake_result
|
patch("roboco.services.workspace.subprocess.run", return_value=fake_result),
|
||||||
), patch(
|
patch("roboco.services.workspace.logger.warning", side_effect=capture_warning),
|
||||||
"roboco.services.workspace.logger.warning", side_effect=capture_warning
|
patch("roboco.services.workspace.logger.debug", side_effect=capture_debug),
|
||||||
), patch(
|
|
||||||
"roboco.services.workspace.logger.debug", side_effect=capture_debug
|
|
||||||
):
|
):
|
||||||
await WorkspaceService._fetch_origin_best_effort(
|
await WorkspaceService._fetch_origin_best_effort(
|
||||||
workspace=workspace, project_slug="roboco-api"
|
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:
|
def capture_debug(event: str, **_kw: object) -> None:
|
||||||
captured.append(("debug", event))
|
captured.append(("debug", event))
|
||||||
|
|
||||||
with patch(
|
with (
|
||||||
"roboco.services.workspace.subprocess.run", return_value=fake_result
|
patch("roboco.services.workspace.subprocess.run", return_value=fake_result),
|
||||||
), patch(
|
patch("roboco.services.workspace.logger.warning", side_effect=capture_warning),
|
||||||
"roboco.services.workspace.logger.warning", side_effect=capture_warning
|
patch("roboco.services.workspace.logger.debug", side_effect=capture_debug),
|
||||||
), patch(
|
|
||||||
"roboco.services.workspace.logger.debug", side_effect=capture_debug
|
|
||||||
):
|
):
|
||||||
await WorkspaceService._fetch_origin_best_effort(
|
await WorkspaceService._fetch_origin_best_effort(
|
||||||
workspace=workspace, project_slug="roboco-api"
|
workspace=workspace, project_slug="roboco-api"
|
||||||
|
|||||||
Reference in New Issue
Block a user