2026-06-21 20:19:22 +02:00
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
|
|
import uuid
|
|
|
|
|
from datetime import datetime
|
|
|
|
|
|
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ConsistencySweepIssueSummary(BaseModel):
|
|
|
|
|
fail: int = 0
|
2026-06-22 01:20:59 +02:00
|
|
|
automation_error: int = 0
|
2026-06-21 20:19:22 +02:00
|
|
|
warn: int = 0
|
|
|
|
|
info: int = 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ConsistencySweepRepoResult(BaseModel):
|
|
|
|
|
repo_slug: str
|
|
|
|
|
repo_path: str
|
|
|
|
|
result: str
|
|
|
|
|
summary: ConsistencySweepIssueSummary
|
|
|
|
|
fixes_applied: list[str] = Field(default_factory=list)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ConsistencySweepRemoteAllGenerate(BaseModel):
|
|
|
|
|
max_seconds: int = Field(
|
|
|
|
|
default=300,
|
|
|
|
|
ge=0,
|
|
|
|
|
le=3600,
|
|
|
|
|
description="Wall-clock budget for the remote-all sweep (0 disables)",
|
|
|
|
|
)
|
2026-06-21 21:46:43 +02:00
|
|
|
source: str = Field(
|
|
|
|
|
default="api",
|
|
|
|
|
description="Runner label stored on progress events (local-timer, activity-core, api)",
|
|
|
|
|
)
|
2026-06-21 20:19:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class ConsistencySweepRemoteAllRun(BaseModel):
|
|
|
|
|
started_at: datetime
|
|
|
|
|
completed_at: datetime
|
|
|
|
|
max_seconds: int
|
2026-06-21 21:46:43 +02:00
|
|
|
source: str
|
2026-06-21 20:19:22 +02:00
|
|
|
exit_code: int
|
2026-06-22 01:20:59 +02:00
|
|
|
automation_error: bool = False
|
2026-06-21 20:19:22 +02:00
|
|
|
lock_skipped: bool
|
|
|
|
|
repos_processed: list[ConsistencySweepRepoResult] = Field(default_factory=list)
|
|
|
|
|
skipped_clean: list[str] = Field(default_factory=list)
|
|
|
|
|
skipped_missing: list[str] = Field(default_factory=list)
|
|
|
|
|
skipped_budget: list[str] = Field(default_factory=list)
|
|
|
|
|
progress_event_id: uuid.UUID | None = None
|