Skip to content

The agent that grows with you

refactor(gateway): drop blank after dataclass docstrings and section headers in hosted-room modules (AST-neutral)

Teknium4c7847d59bd7
diff --git a/gateway/hosted_room_discussion.py b/gateway/hosted_room_discussion.py
index d1c14678472..1be91f68663 100644
--- a/gateway/hosted_room_discussion.py
+++ b/gateway/hosted_room_discussion.py
@@ -78,7 +78,6 @@ class DiscussionReconstructionError(DiscussionPolicyError):
@dataclass(frozen=True)
class DiscussionMember:
"""One immutable local or peer member of the hosted room."""
-
member_id: str
profile: str
handle: str
@@ -89,7 +88,6 @@ class DiscussionMember:
@dataclass(frozen=True)
class DiscussionRoom:
"""Validated policy projection of one active hosted room."""
-
room_id: str
name: str
members: tuple[DiscussionMember, ...]
@@ -100,7 +98,6 @@ class DiscussionRoom:
@dataclass(frozen=True)
class DiscussionTaskPlan:
"""One deterministic member turn compatible with the driver schema."""
-
identity: driver.TaskIdentity
payload: Mapping[str, Any]
discussion_event_id: str
@@ -113,7 +110,6 @@ class DiscussionTaskPlan:
@dataclass(frozen=True)
class DiscussionDecision:
"""Current result of replaying one room's Discussion policy."""
-
status: DecisionStatus
reason: str
discussion_event_id: str | None = None
@@ -125,7 +121,6 @@ class DiscussionDecision:
@dataclass(frozen=True)
class EventPlan:
"""One idempotent append for :func:`gateway.hosted_rooms.append_event`."""
-
event_id: str
kind: str
actor: Mapping[str, str]
@@ -141,7 +136,6 @@ class EventPlan:
@dataclass(frozen=True)
class PublicationPlan:
"""Ordered visible and terminal effects for one driver task."""
-
task_id: str
terminal_kind: str
events: tuple[EventPlan, ...]
@@ -354,8 +348,6 @@ def _validate_turn_coordinates(payload: Mapping[str, Any], room: DiscussionRoom)
# -- per-kind event payload validators (dispatched by _validate_event) ---------
# Each takes (kind, payload, actor, room) and returns the payload to record.
-
-
def _validate_user_event(kind: str, payload: Payload, actor: Payload, room: DiscussionRoom) -> Payload:
payload = validate_user_payload(payload)
if actor.get("kind") != "user":
diff --git a/gateway/hosted_room_driver.py b/gateway/hosted_room_driver.py
index 19e4f428abf..b53c85909a6 100644
--- a/gateway/hosted_room_driver.py
+++ b/gateway/hosted_room_driver.py
@@ -166,7 +166,6 @@ def _task_payload(value: Any) -> tuple[dict[str, Any], str, str]:
@dataclass(frozen=True)
class TaskIdentity:
"""Stable identity for one admitted room turn."""
-
room_id: str
task_id: str
thread_id: str
@@ -180,7 +179,6 @@ class TaskIdentity:
@dataclass(frozen=True)
class DriverLease:
"""A fenced lease held by one gateway process incarnation."""
-
room_id: str
gateway_id: str
authority_epoch: int
@@ -193,7 +191,6 @@ class DriverLease:
@dataclass(frozen=True)
class TaskAttempt:
"""The exact running generation authorized to settle one task."""
-
identity: TaskIdentity
lease: DriverLease
execution_generation: int
diff --git a/gateway/hosted_room_execution_policy.py b/gateway/hosted_room_execution_policy.py
index b12c5bfae48..b425d850ff0 100644
--- a/gateway/hosted_room_execution_policy.py
+++ b/gateway/hosted_room_execution_policy.py
@@ -30,7 +30,6 @@ def _identifier(value: Any, *, field: str) -> str:
@dataclass(frozen=True)
class RoomExecutionPolicy:
"""Immutable target policy applied at the agent and approval boundaries."""
-
version: int
target_profile: str
enabled_toolsets: tuple[str, ...]
diff --git a/gateway/hosted_room_peer.py b/gateway/hosted_room_peer.py
index d8936ffbdb1..fa3cff0a38e 100644
--- a/gateway/hosted_room_peer.py
+++ b/gateway/hosted_room_peer.py
@@ -194,7 +194,6 @@ _CATALOG_FIELDS = {
@dataclass(frozen=True)
class GatewayRoomCatalog:
"""Authenticated gateway capabilities inherited by its Bots."""
-
installation_id: str
protocol_versions: tuple[int, ...]
link_modes: tuple[LinkMode, ...]
@@ -353,7 +352,6 @@ _DISPATCH_FIELDS: dict[str, Callable[..., Any]] = dict(
@dataclass(frozen=True)
class HostedMemberDispatch:
"""Recipient-validated identity for one remote room member attempt."""
-
protocol_version: int
room_id: str
home_install_id: str
diff --git a/gateway/hosted_room_policy_checkpoint.py b/gateway/hosted_room_policy_checkpoint.py
index 3b6bfcff83c..c72daafa95a 100644
--- a/gateway/hosted_room_policy_checkpoint.py
+++ b/gateway/hosted_room_policy_checkpoint.py
@@ -69,7 +69,6 @@ _TRANSCRIPT_EVENTS_SQL = f"""WITH transcript_events(seq) AS (
@dataclass(frozen=True)
class PolicySnapshot:
"""Bounded active policy input at one durable room-log cursor."""
-
through_seq: int
stopped_through_seq: int
events: tuple[dict[str, Any], ...]
@@ -100,7 +99,6 @@ def _settled_message(
class HostedRoomPolicyCheckpoint:
"""Incrementally index room policy without compacting visible history."""
-
def __init__(self, db_path: DbPath) -> None:
self.db_path = Path(db_path)
with self._connect() as conn: