semantics: complete DEF-to-region migration, fix regressions

- Convert legacy [DEF🆔Type] anchors to #region/#endregion across 329 files
- Reinstate _normalize_timestamp_value in sql_generator.py
- Fix MarkerLogger→logger migration in events.py (molecular CoT markers)
- Fix dataset_review orchestrator dependencies (_build_execution_snapshot)
- Fix config_manager stale-record deletion (moved to save path only)
- Add 77 missing [/DEF:] closers in 5 unbalanced test files
- Update assistant_chat.integration.test.js for #region format
- Apply molecular-cot-logging markers (REASON/REFLECT/EXPLORE) via logger.* methods
This commit is contained in:
2026-05-12 23:54:55 +03:00
parent fe8978f716
commit 306c5ae742
331 changed files with 9630 additions and 10312 deletions

View File

@@ -1,10 +1,10 @@
# #region BackupPlugin [TYPE Module] [SEMANTICS backup, superset, automation, dashboard, plugin]
# @BRIEF A plugin that provides functionality to back up Superset dashboards.
# @LAYER App
# @RELATION IMPLEMENTS -> [PluginBase]
# @RELATION DEPENDS_ON -> [superset_tool.client]
# @RELATION DEPENDS_ON -> [superset_tool.utils]
# @RELATION USES -> [TaskContext]
# @LAYER: App
# @RELATION IMPLEMENTS -> PluginBase
# @RELATION DEPENDS_ON -> superset_tool.client
# @RELATION DEPENDS_ON -> superset_tool.utils
# @RELATION USES -> TaskContext
from typing import Dict, Any, Optional
from pathlib import Path
@@ -33,63 +33,63 @@ class BackupPlugin(PluginBase):
"""
@property
# #region id [TYPE Function]
# @BRIEF Returns the unique identifier for the backup plugin.
# @PRE Plugin instance exists.
# @POST Returns string ID.
# @RETURN str - "superset-backup"
# [DEF:id:Function]
# @PURPOSE: Returns the unique identifier for the backup plugin.
# @PRE: Plugin instance exists.
# @POST: Returns string ID.
# @RETURN: str - "superset-backup"
def id(self) -> str:
with belief_scope("id"):
return "superset-backup"
# #endregion id
# [/DEF:id:Function]
@property
# #region name [TYPE Function]
# @BRIEF Returns the human-readable name of the backup plugin.
# @PRE Plugin instance exists.
# @POST Returns string name.
# @RETURN str - Plugin name.
# [DEF:name:Function]
# @PURPOSE: Returns the human-readable name of the backup plugin.
# @PRE: Plugin instance exists.
# @POST: Returns string name.
# @RETURN: str - Plugin name.
def name(self) -> str:
with belief_scope("name"):
return "Superset Dashboard Backup"
# #endregion name
# [/DEF:name:Function]
@property
# #region description [TYPE Function]
# @BRIEF Returns a description of the backup plugin.
# @PRE Plugin instance exists.
# @POST Returns string description.
# @RETURN str - Plugin description.
# [DEF:description:Function]
# @PURPOSE: Returns a description of the backup plugin.
# @PRE: Plugin instance exists.
# @POST: Returns string description.
# @RETURN: str - Plugin description.
def description(self) -> str:
with belief_scope("description"):
return "Backs up all dashboards from a Superset instance."
# #endregion description
# [/DEF:description:Function]
@property
# #region version [TYPE Function]
# @BRIEF Returns the version of the backup plugin.
# @PRE Plugin instance exists.
# @POST Returns string version.
# @RETURN str - "1.0.0"
# [DEF:version:Function]
# @PURPOSE: Returns the version of the backup plugin.
# @PRE: Plugin instance exists.
# @POST: Returns string version.
# @RETURN: str - "1.0.0"
def version(self) -> str:
with belief_scope("version"):
return "1.0.0"
# #endregion version
# [/DEF:version:Function]
@property
# #region ui_route [TYPE Function]
# @BRIEF Returns the frontend route for the backup plugin.
# @RETURN str - "/tools/backups"
# [DEF:ui_route:Function]
# @PURPOSE: Returns the frontend route for the backup plugin.
# @RETURN: str - "/tools/backups"
def ui_route(self) -> str:
with belief_scope("ui_route"):
return "/tools/backups"
# #endregion ui_route
# [/DEF:ui_route:Function]
# #region get_schema [TYPE Function]
# @BRIEF Returns the JSON schema for backup plugin parameters.
# @PRE Plugin instance exists.
# @POST Returns dictionary schema.
# @RETURN Dict[str, Any] - JSON schema.
# [DEF:get_schema:Function]
# @PURPOSE: Returns the JSON schema for backup plugin parameters.
# @PRE: Plugin instance exists.
# @POST: Returns dictionary schema.
# @RETURN: Dict[str, Any] - JSON schema.
def get_schema(self) -> Dict[str, Any]:
with belief_scope("get_schema"):
config_manager = get_config_manager()
@@ -108,10 +108,10 @@ class BackupPlugin(PluginBase):
},
"required": ["env"],
}
# #endregion get_schema
# [/DEF:get_schema:Function]
# #region execute [TYPE Function]
# @BRIEF Executes the dashboard backup logic with TaskContext support.
# [DEF:execute:Function]
# @PURPOSE: Executes the dashboard backup logic with TaskContext support.
# @PARAM: params (Dict[str, Any]) - Backup parameters (env, backup_path, dashboard_ids).
# @PARAM: context (Optional[TaskContext]) - Task context for logging with source attribution.
# @PRE: Target environment must be configured. params must be a dictionary.
@@ -255,6 +255,6 @@ class BackupPlugin(PluginBase):
except (RequestException, IOError, KeyError) as e:
log.error(f"Fatal error during backup for {env}: {e}")
raise e
# #endregion execute
# [/DEF:execute:Function]
# #endregion BackupPlugin
# #endregion BackupPlugin