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:
@@ -1,8 +1,8 @@
|
||||
# #region MigrationArchiveParserModule [C:3] [TYPE Module] [SEMANTICS migration, zip, parser, yaml, metadata]
|
||||
# @BRIEF Parse Superset export ZIP archives into normalized object catalogs for diffing.
|
||||
# @LAYER Core
|
||||
# @INVARIANT Parsing is read-only and never mutates archive files.
|
||||
# @LAYER: Core
|
||||
# @RELATION DEPENDS_ON -> [LoggerModule]
|
||||
# @INVARIANT: Parsing is read-only and never mutates archive files.
|
||||
|
||||
import json
|
||||
import tempfile
|
||||
@@ -21,12 +21,12 @@ from ..logger import logger, belief_scope
|
||||
# @RELATION CONTAINS -> [_collect_yaml_objects]
|
||||
# @RELATION CONTAINS -> [_normalize_object_payload]
|
||||
class MigrationArchiveParser:
|
||||
# #region extract_objects_from_zip [TYPE Function]
|
||||
# @BRIEF Extract object catalogs from Superset archive.
|
||||
# @PRE zip_path points to a valid readable ZIP.
|
||||
# @POST Returns object lists grouped by resource type.
|
||||
# @RETURN Dict[str, List[Dict[str, Any]]]
|
||||
# @RELATION DEPENDS_ON -> [_collect_yaml_objects]
|
||||
# [DEF:extract_objects_from_zip:Function]
|
||||
# @PURPOSE: Extract object catalogs from Superset archive.
|
||||
# @RELATION: DEPENDS_ON -> [_collect_yaml_objects]
|
||||
# @PRE: zip_path points to a valid readable ZIP.
|
||||
# @POST: Returns object lists grouped by resource type.
|
||||
# @RETURN: Dict[str, List[Dict[str, Any]]]
|
||||
def extract_objects_from_zip(
|
||||
self, zip_path: str
|
||||
) -> Dict[str, List[Dict[str, Any]]]:
|
||||
@@ -49,13 +49,13 @@ class MigrationArchiveParser:
|
||||
|
||||
return result
|
||||
|
||||
# #endregion extract_objects_from_zip
|
||||
# [/DEF:extract_objects_from_zip:Function]
|
||||
|
||||
# #region _collect_yaml_objects [TYPE Function]
|
||||
# @BRIEF Read and normalize YAML manifests for one object type.
|
||||
# @PRE object_type is one of dashboards/charts/datasets.
|
||||
# @POST Returns only valid normalized objects.
|
||||
# @RELATION DEPENDS_ON -> [_normalize_object_payload]
|
||||
# [DEF:_collect_yaml_objects:Function]
|
||||
# @PURPOSE: Read and normalize YAML manifests for one object type.
|
||||
# @RELATION: DEPENDS_ON -> [_normalize_object_payload]
|
||||
# @PRE: object_type is one of dashboards/charts/datasets.
|
||||
# @POST: Returns only valid normalized objects.
|
||||
def _collect_yaml_objects(
|
||||
self, root_dir: Path, object_type: str
|
||||
) -> List[Dict[str, Any]]:
|
||||
@@ -79,12 +79,12 @@ class MigrationArchiveParser:
|
||||
)
|
||||
return objects
|
||||
|
||||
# #endregion _collect_yaml_objects
|
||||
# [/DEF:_collect_yaml_objects:Function]
|
||||
|
||||
# #region _normalize_object_payload [TYPE Function]
|
||||
# @BRIEF Convert raw YAML payload to stable diff signature shape.
|
||||
# @PRE payload is parsed YAML mapping.
|
||||
# @POST Returns normalized descriptor with `uuid`, `title`, and `signature`.
|
||||
# [DEF:_normalize_object_payload:Function]
|
||||
# @PURPOSE: Convert raw YAML payload to stable diff signature shape.
|
||||
# @PRE: payload is parsed YAML mapping.
|
||||
# @POST: Returns normalized descriptor with `uuid`, `title`, and `signature`.
|
||||
def _normalize_object_payload(
|
||||
self, payload: Dict[str, Any], object_type: str
|
||||
) -> Optional[Dict[str, Any]]:
|
||||
@@ -149,7 +149,7 @@ class MigrationArchiveParser:
|
||||
|
||||
return None
|
||||
|
||||
# #endregion _normalize_object_payload
|
||||
# [/DEF:_normalize_object_payload:Function]
|
||||
|
||||
|
||||
# #endregion MigrationArchiveParser
|
||||
|
||||
Reference in New Issue
Block a user