This commit is contained in:
2026-04-01 22:04:19 +03:00
parent 2b8e3831ef
commit 61a0d8c322
6 changed files with 23 additions and 10 deletions

View File

@@ -8,6 +8,10 @@
# @RELATION: DEPENDS_ON -> MigrationEngine
# @RELATION: DEPENDS_ON -> IdMappingService
# @RELATION: USES -> TaskContext
# @PRE: Plugin loader can resolve infrastructure dependencies and execution requests provide validated migration context.
# @POST: Plugin metadata remains stable and migration execution preserves mapped-environment import guarantees.
# @SIDE_EFFECT: Reads config, opens database sessions, creates temporary artifacts, and triggers Superset export/import workflows.
# @DATA_CONTRACT: Input[TaskContext{from_env,to_env,dashboard_regex,replace_db_config,from_db_id,to_db_id,passwords?}] -> Output[MigrationResult|artifact set]
# @INVARIANT: Dashboards must never be imported with unmapped/source DB connections to prevent data leaks or cross-environment pollution.
from typing import Dict, Any, Optional

View File

@@ -3,10 +3,14 @@
# @SEMANTICS: clean-release, compliance, execution, stages, immutable-evidence
# @PURPOSE: Create and execute compliance runs with trusted snapshots, deterministic stages, violations and immutable report persistence.
# @LAYER: Domain
# @RELATION: [DEPENDS_ON] ->[RepositoryRelations]
# @RELATION: [DEPENDS_ON] ->[PolicyResolutionService]
# @RELATION: [DEPENDS_ON] ->[ComplianceStages]
# @RELATION: [DEPENDS_ON] ->[ReportBuilder]
# @RELATION: DEPENDS_ON -> RepositoryRelations
# @RELATION: DEPENDS_ON -> PolicyResolutionService
# @RELATION: DEPENDS_ON -> ComplianceStages
# @RELATION: DEPENDS_ON -> ReportBuilder
# @PRE: Repository adapters, trusted policy resolution, and deterministic stage implementations are available for the run request.
# @POST: Candidate-scoped compliance runs persist stage evidence, terminal status, and immutable report artifacts when execution succeeds.
# @SIDE_EFFECT: Persists runs, stage results, violations, and reports through repository adapters and audit helpers.
# @DATA_CONTRACT: Input[candidate_id, requested_by, manifest_id?, policy snapshots, stage results] -> Output[ComplianceExecutionResult]
# @INVARIANT: A run binds to exactly one candidate/manifest/policy/registry snapshot set.
from __future__ import annotations

View File

@@ -12,10 +12,10 @@
# @TEST_EDGE: counter_mismatch -> blocking counter cannot exceed total violations counter
# @TEST_EDGE: missing_operator_summary -> non-terminal run prevents report creation and summary generation
# @TEST_INVARIANT: blocking_count_le_total_count -> VERIFIED_BY: [counter_mismatch, empty_violations_for_blocked]
# @DATA_CONTRACT: Manifest -> Report
# @PRE: ManifestService and compliance data are available
# @POST: Report with generated summary and @SIDE_EFFECT':
# @SIDE_EFFECT: Writes report artifacts to database, generates audit trail
# @DATA_CONTRACT: Input[ComplianceRun, List[ComplianceViolation]] -> Output[ComplianceReport]
# @PRE: Compliance run is terminal and repository persistence is available for report storage.
# @POST: Returns immutable report payloads with consistent violation counters and operator summary content.
# @SIDE_EFFECT: Writes report artifacts to repository when persistence helpers are invoked.
from __future__ import annotations