From 113748dfd5054aba1d3e16f7d7350297de0990ca Mon Sep 17 00:00:00 2001 From: CREDO23 Date: Tue, 26 May 2026 22:38:41 +0200 Subject: [PATCH] feat(automation): scaffold isolated module structure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create app/automations/ with the SRP-per-file / grouped-folders layout that mirrors app/agents/multi_agent_chat/. Twelve __init__.py files, each a thin re-export with a single-line docstring describing the subpackage's role, no exports yet (filled in subsequent commits). Tree: app/automations/ ├── persistence/ │ ├── enums/ (status / type enums; one per file) │ └── models/ (SQLAlchemy tables; one per file) ├── schemas/ │ ├── definition/ (the JSON envelope, broken by concern) │ ├── triggers/ (per-trigger config schemas) │ └── actions/ (per-action config schemas) └── registries/ ├── capabilities/ (types.py + store.py) ├── actions/ (types.py + store.py) └── triggers/ (types.py + store.py) The persistence/ folder is named to avoid surfsense_backend/.gitignore's data/ ignore rule, which silently masked the original data/ name and its contents from version control. Isolation invariant: the module imports only from app.db (foundational Base + FK targets, unavoidable) and stdlib / SQLAlchemy / Pydantic. No imports from app.agents.*, app.services.*, app.tasks.*, app.routes.* or any other business-logic module. Confirmed importable with no side effects. --- surfsense_backend/app/automations/__init__.py | 5 +++++ surfsense_backend/app/automations/persistence/__init__.py | 5 +++++ .../app/automations/persistence/enums/__init__.py | 5 +++++ .../app/automations/persistence/models/__init__.py | 5 +++++ surfsense_backend/app/automations/registries/__init__.py | 5 +++++ .../app/automations/registries/actions/__init__.py | 5 +++++ .../app/automations/registries/capabilities/__init__.py | 5 +++++ .../app/automations/registries/triggers/__init__.py | 5 +++++ surfsense_backend/app/automations/schemas/__init__.py | 5 +++++ .../app/automations/schemas/actions/__init__.py | 5 +++++ .../app/automations/schemas/definition/__init__.py | 5 +++++ .../app/automations/schemas/triggers/__init__.py | 5 +++++ 12 files changed, 60 insertions(+) create mode 100644 surfsense_backend/app/automations/__init__.py create mode 100644 surfsense_backend/app/automations/persistence/__init__.py create mode 100644 surfsense_backend/app/automations/persistence/enums/__init__.py create mode 100644 surfsense_backend/app/automations/persistence/models/__init__.py create mode 100644 surfsense_backend/app/automations/registries/__init__.py create mode 100644 surfsense_backend/app/automations/registries/actions/__init__.py create mode 100644 surfsense_backend/app/automations/registries/capabilities/__init__.py create mode 100644 surfsense_backend/app/automations/registries/triggers/__init__.py create mode 100644 surfsense_backend/app/automations/schemas/__init__.py create mode 100644 surfsense_backend/app/automations/schemas/actions/__init__.py create mode 100644 surfsense_backend/app/automations/schemas/definition/__init__.py create mode 100644 surfsense_backend/app/automations/schemas/triggers/__init__.py diff --git a/surfsense_backend/app/automations/__init__.py b/surfsense_backend/app/automations/__init__.py new file mode 100644 index 000000000..edb7891ea --- /dev/null +++ b/surfsense_backend/app/automations/__init__.py @@ -0,0 +1,5 @@ +"""Automations: scheduled / triggered runs of capabilities — see automation-design-plan.md.""" + +from __future__ import annotations + +__all__: list[str] = [] diff --git a/surfsense_backend/app/automations/persistence/__init__.py b/surfsense_backend/app/automations/persistence/__init__.py new file mode 100644 index 000000000..05c39014e --- /dev/null +++ b/surfsense_backend/app/automations/persistence/__init__.py @@ -0,0 +1,5 @@ +"""Persistence layer: SQLAlchemy enums under ``enums/`` and models under ``models/``.""" + +from __future__ import annotations + +__all__: list[str] = [] diff --git a/surfsense_backend/app/automations/persistence/enums/__init__.py b/surfsense_backend/app/automations/persistence/enums/__init__.py new file mode 100644 index 000000000..f221687dc --- /dev/null +++ b/surfsense_backend/app/automations/persistence/enums/__init__.py @@ -0,0 +1,5 @@ +"""SQLAlchemy / Python enums backing the three automation tables.""" + +from __future__ import annotations + +__all__: list[str] = [] diff --git a/surfsense_backend/app/automations/persistence/models/__init__.py b/surfsense_backend/app/automations/persistence/models/__init__.py new file mode 100644 index 000000000..da73c9e41 --- /dev/null +++ b/surfsense_backend/app/automations/persistence/models/__init__.py @@ -0,0 +1,5 @@ +"""SQLAlchemy models: one file per table (``automation.py``, ``trigger.py``, ``run.py``).""" + +from __future__ import annotations + +__all__: list[str] = [] diff --git a/surfsense_backend/app/automations/registries/__init__.py b/surfsense_backend/app/automations/registries/__init__.py new file mode 100644 index 000000000..e7334cca8 --- /dev/null +++ b/surfsense_backend/app/automations/registries/__init__.py @@ -0,0 +1,5 @@ +"""Three registries — ``capabilities/``, ``actions/``, ``triggers/`` — populated at import time.""" + +from __future__ import annotations + +__all__: list[str] = [] diff --git a/surfsense_backend/app/automations/registries/actions/__init__.py b/surfsense_backend/app/automations/registries/actions/__init__.py new file mode 100644 index 000000000..6b19b7091 --- /dev/null +++ b/surfsense_backend/app/automations/registries/actions/__init__.py @@ -0,0 +1,5 @@ +"""Action registry: ``types.py`` (dataclass), ``store.py`` (dict + register fn).""" + +from __future__ import annotations + +__all__: list[str] = [] diff --git a/surfsense_backend/app/automations/registries/capabilities/__init__.py b/surfsense_backend/app/automations/registries/capabilities/__init__.py new file mode 100644 index 000000000..77f9f88b7 --- /dev/null +++ b/surfsense_backend/app/automations/registries/capabilities/__init__.py @@ -0,0 +1,5 @@ +"""Capability registry: ``types.py`` (dataclass), ``store.py`` (dict + register fn).""" + +from __future__ import annotations + +__all__: list[str] = [] diff --git a/surfsense_backend/app/automations/registries/triggers/__init__.py b/surfsense_backend/app/automations/registries/triggers/__init__.py new file mode 100644 index 000000000..bc795b61a --- /dev/null +++ b/surfsense_backend/app/automations/registries/triggers/__init__.py @@ -0,0 +1,5 @@ +"""Trigger registry: ``types.py`` (dataclass), ``store.py`` (dict + register fn).""" + +from __future__ import annotations + +__all__: list[str] = [] diff --git a/surfsense_backend/app/automations/schemas/__init__.py b/surfsense_backend/app/automations/schemas/__init__.py new file mode 100644 index 000000000..67211b898 --- /dev/null +++ b/surfsense_backend/app/automations/schemas/__init__.py @@ -0,0 +1,5 @@ +"""Pydantic schemas: definition envelope, trigger configs, action configs.""" + +from __future__ import annotations + +__all__: list[str] = [] diff --git a/surfsense_backend/app/automations/schemas/actions/__init__.py b/surfsense_backend/app/automations/schemas/actions/__init__.py new file mode 100644 index 000000000..1aa68b629 --- /dev/null +++ b/surfsense_backend/app/automations/schemas/actions/__init__.py @@ -0,0 +1,5 @@ +"""Per-action config schemas: one file per action type registered in v1.""" + +from __future__ import annotations + +__all__: list[str] = [] diff --git a/surfsense_backend/app/automations/schemas/definition/__init__.py b/surfsense_backend/app/automations/schemas/definition/__init__.py new file mode 100644 index 000000000..3fbda8cc8 --- /dev/null +++ b/surfsense_backend/app/automations/schemas/definition/__init__.py @@ -0,0 +1,5 @@ +"""Automation definition envelope: the editable structured spec users author and run.""" + +from __future__ import annotations + +__all__: list[str] = [] diff --git a/surfsense_backend/app/automations/schemas/triggers/__init__.py b/surfsense_backend/app/automations/schemas/triggers/__init__.py new file mode 100644 index 000000000..2da765bc3 --- /dev/null +++ b/surfsense_backend/app/automations/schemas/triggers/__init__.py @@ -0,0 +1,5 @@ +"""Per-trigger config schemas: one file per trigger type registered in v1.""" + +from __future__ import annotations + +__all__: list[str] = []