mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-29 19:35:20 +02:00
Cut the docstrings and Field(description=...) text across the entire automations/ tree down to single-line intent statements, matching the multi_agent_chat conciseness style: - Module docstrings: one line stating what the file is. - Class docstrings: deleted when the class name + module docstring already cover intent; kept only where they add a constraint or rationale not visible in the signature. - Pydantic Field descriptions: short noun phrases / clauses, not full sentences. Reasoning that belonged in the design plan moved out of the code. - Enum values: per-value docstrings replaced with terse inline comments where the meaning isn't obvious from the name. Behaviour is unchanged. The same 33 files, same public surface, same imports — verified by re-running the 10-point registry smoke test and the 8-point schema round-trip / constraint suite from commits 9 and 10. LOC: 1180 → 691 (-42%).
25 lines
944 B
Python
25 lines
944 B
Python
"""``ExecutionBlock`` — automation-wide execution defaults (overridable per step)."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Literal
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
from .plan_step import PlanStep
|
|
|
|
|
|
class ExecutionBlock(BaseModel):
|
|
model_config = ConfigDict(extra="forbid")
|
|
|
|
timeout_seconds: int = Field(default=600, gt=0, description="Wall-clock cap for the run.")
|
|
max_retries: int = Field(default=2, ge=0, description="Per-step retry budget.")
|
|
retry_backoff: Literal["exponential", "linear", "none"] = "exponential"
|
|
concurrency: Literal["drop_if_running", "queue", "always"] = "drop_if_running"
|
|
budget_cap_usd: float | None = Field(
|
|
default=None, gt=0, description="Kill the run when accumulated cost exceeds this."
|
|
)
|
|
on_failure: list[PlanStep] = Field(
|
|
default_factory=list,
|
|
description="Steps run when the main plan fails after retries.",
|
|
)
|