refactor(backend)!: separate algorithm and data layers

Reorganize algorithm packages by business responsibility, move orchestration into services, and keep database access behind pooled repositories.

Harden analysis API validation, remove unsafe legacy simulation endpoints, and add regression and architecture boundary coverage.

BREAKING CHANGE: legacy algorithm module paths and obsolete simulation endpoints are removed.
This commit is contained in:
2026-09-04 17:30:55 +08:00
parent 9b095c7439
commit 5966d039de
91 changed files with 1418 additions and 4020 deletions
+4 -4
View File
@@ -8,13 +8,13 @@ from uuid import UUID
import numpy as np
import pandas as pd
from app.algorithms.burst_detection.burst_detector import BurstDetector
from app.algorithms.burst_detection.pressure_anomaly import PressureAnomalyDetector
from app.infra.db.postgresql.scada import get_all_scada_info
from app.infra.db.timescaledb.internal_queries import InternalQueries
from app.services.scheme_management import (
store_scheme_info,
)
from app.services.tjnetwork import get_all_scada_info
from app.services.time_api import parse_utc_time, utc_now
from app.domain.time import parse_utc_time, utc_now
TARGET_DAY_COUNT = 15
@@ -178,7 +178,7 @@ def run_burst_detection(
observed_input = observed_pressure_data
observed_source = "request_payload"
detector = BurstDetector(
detector = PressureAnomalyDetector(
mu=mu,
points_per_day=points_per_day,
iforest_params=iforest_params,