diff --git a/.ai/MODULE_MAP.md b/.ai/MODULE_MAP.md new file mode 100644 index 0000000..af0d4ff --- /dev/null +++ b/.ai/MODULE_MAP.md @@ -0,0 +1,1602 @@ +# Module Map + +> High-level module structure for AI Context. Generated automatically. + +**Generated:** 2026-02-27T15:09:17.269938 + +## Summary + +- **Total Modules:** 78 +- **Total Entities:** 1927 + +## Module Hierarchy + +### π `backend/` + +- ποΈ **Layers:** Unknown, Utility +- π **Tiers:** STANDARD: 2, TRIVIAL: 2 +- π **Files:** 2 +- π¦ **Entities:** 4 + +**Key Entities:** + + - π¦ **backend.delete_running_tasks** (Module) + - Script to delete tasks with RUNNING status from the database... + - π¦ **test_auth_debug** (Module) `[TRIVIAL]` + - Auto-generated module for backend/test_auth_debug.py + + ### π `src/` + + - ποΈ **Layers:** API, Core, UI (API) + - π **Tiers:** CRITICAL: 2, STANDARD: 19, TRIVIAL: 2 + - π **Files:** 2 + - π¦ **Entities:** 23 + + **Key Entities:** + + - π¦ **AppModule** (Module) `[CRITICAL]` + - The main entry point for the FastAPI application. It initial... + - π¦ **Dependencies** (Module) + - Manages creation and provision of shared application depende... + + ### π `api/` + + - ποΈ **Layers:** API + - π **Tiers:** STANDARD: 7 + - π **Files:** 1 + - π¦ **Entities:** 7 + + **Key Entities:** + + - π¦ **backend.src.api.auth** (Module) + - Authentication API endpoints. + + ### π `routes/` + + - ποΈ **Layers:** API, UI (API) + - π **Tiers:** CRITICAL: 3, STANDARD: 197, TRIVIAL: 6 + - π **Files:** 17 + - π¦ **Entities:** 206 + + **Key Entities:** + + - β **AssistantAction** (Class) `[TRIVIAL]` + - UI action descriptor returned with assistant responses. + - β **AssistantMessageRequest** (Class) `[TRIVIAL]` + - Input payload for assistant message endpoint. + - β **AssistantMessageResponse** (Class) + - Output payload contract for assistant interaction endpoints. + - β **BranchCheckout** (Class) + - Schema for branch checkout requests. + - β **BranchCreate** (Class) + - Schema for branch creation requests. + - β **BranchSchema** (Class) + - Schema for representing a Git branch metadata. + - β **CommitCreate** (Class) + - Schema for staging and committing changes. + - β **CommitSchema** (Class) + - Schema for representing Git commit details. + - β **ConfirmationRecord** (Class) + - In-memory confirmation token model for risky operation dispa... + - β **ConflictResolution** (Class) + - Schema for resolving merge conflicts. + + **Dependencies:** + + - π DEPENDS_ON -> ConfigManager + - π DEPENDS_ON -> ConfigModels + - π DEPENDS_ON -> backend.src.core.database + - π DEPENDS_ON -> backend.src.core.superset_client + - π DEPENDS_ON -> backend.src.core.task_manager + + ### π `__tests__/` + + - ποΈ **Layers:** API, Domain (Tests), UI (API Tests) + - π **Tiers:** STANDARD: 51, TRIVIAL: 104 + - π **Files:** 8 + - π¦ **Entities:** 155 + + **Key Entities:** + + - β **_FakeConfigManager** (Class) `[TRIVIAL]` + - Provide deterministic environment aliases required by intent... + - β **_FakeConfigManager** (Class) `[TRIVIAL]` + - Environment config fixture with dev/prod aliases for parser ... + - β **_FakeDb** (Class) `[TRIVIAL]` + - In-memory session substitute for assistant route persistence... + - β **_FakeDb** (Class) `[TRIVIAL]` + - In-memory fake database implementing subset of Session inter... + - β **_FakeQuery** (Class) `[TRIVIAL]` + - Minimal chainable query object for fake DB interactions. + - β **_FakeQuery** (Class) `[TRIVIAL]` + - Minimal chainable query object for fake SQLAlchemy-like DB b... + - β **_FakeTask** (Class) `[TRIVIAL]` + - Lightweight task model used for assistant authz tests. + - β **_FakeTask** (Class) `[TRIVIAL]` + - Lightweight task stub used by assistant API tests. + - β **_FakeTaskManager** (Class) `[TRIVIAL]` + - Minimal task manager for deterministic operation creation an... + - β **_FakeTaskManager** (Class) `[TRIVIAL]` + - Minimal async-compatible TaskManager fixture for determinist... + + **Dependencies:** + + - π DEPENDS_ON -> backend.src.api.routes.assistant + + ### π `core/` + + - ποΈ **Layers:** Core + - π **Tiers:** CRITICAL: 2, STANDARD: 125, TRIVIAL: 8 + - π **Files:** 10 + - π¦ **Entities:** 135 + + **Key Entities:** + + - β **AuthSessionLocal** (Class) `[TRIVIAL]` + - A session factory for the authentication database. + - β **BeliefFormatter** (Class) + - Custom logging formatter that adds belief state prefixes to ... + - β **ConfigManager** (Class) + - A class to handle application configuration persistence and ... + - β **IdMappingService** (Class) `[CRITICAL]` + - Service handling the cataloging and retrieval of remote Supe... + - β **LogEntry** (Class) + - A Pydantic model representing a single, structured log entry... + - β **MigrationEngine** (Class) + - Engine for transforming Superset export ZIPs. + - β **PluginBase** (Class) + - Defines the abstract base class that all plugins must implem... + - β **PluginConfig** (Class) + - A Pydantic model used to represent the validated configurati... + - β **PluginLoader** (Class) + - Scans a specified directory for Python modules, dynamically ... + - β **SchedulerService** (Class) + - Provides a service to manage scheduled backup tasks. + + **Dependencies:** + + - π DEPENDS_ON -> AppConfigRecord + - π DEPENDS_ON -> ConfigModels + - π DEPENDS_ON -> PyYAML + - π DEPENDS_ON -> backend.src.core.auth.config + - π DEPENDS_ON -> backend.src.core.logger + + ### π `auth/` + + - ποΈ **Layers:** Core + - π **Tiers:** STANDARD: 26 + - π **Files:** 6 + - π¦ **Entities:** 26 + + **Key Entities:** + + - β **AuthConfig** (Class) + - Holds authentication-related settings. + - β **AuthRepository** (Class) + - Encapsulates database operations for authentication. + - π¦ **backend.src.core.auth.config** (Module) + - Centralized configuration for authentication and authorizati... + - π¦ **backend.src.core.auth.jwt** (Module) + - JWT token generation and validation logic. + - π¦ **backend.src.core.auth.logger** (Module) + - Audit logging for security-related events. + - π¦ **backend.src.core.auth.oauth** (Module) + - ADFS OIDC configuration and client using Authlib. + - π¦ **backend.src.core.auth.repository** (Module) + - Data access layer for authentication-related entities. + - π¦ **backend.src.core.auth.security** (Module) + - Utility for password hashing and verification using Passlib. + + **Dependencies:** + + - π DEPENDS_ON -> authlib + - π DEPENDS_ON -> jose + - π DEPENDS_ON -> passlib + - π DEPENDS_ON -> pydantic + - π DEPENDS_ON -> sqlalchemy + + ### π `__tests__/` + + - ποΈ **Layers:** Domain + - π **Tiers:** STANDARD: 1, TRIVIAL: 14 + - π **Files:** 1 + - π¦ **Entities:** 15 + + **Key Entities:** + + - π¦ **test_auth** (Module) + - Unit tests for authentication module + + ### π `__tests__/` + + - ποΈ **Layers:** Infra + - π **Tiers:** STANDARD: 11, TRIVIAL: 1 + - π **Files:** 1 + - π¦ **Entities:** 12 + + **Key Entities:** + + - π¦ **test_logger** (Module) + - Unit tests for logger module + + ### π `task_manager/` + + - ποΈ **Layers:** Core + - π **Tiers:** CRITICAL: 10, STANDARD: 63, TRIVIAL: 5 + - π **Files:** 7 + - π¦ **Entities:** 78 + + **Key Entities:** + + - β **LogEntry** (Class) `[CRITICAL]` + - A Pydantic model representing a single, structured log entry... + - β **LogFilter** (Class) + - Filter parameters for querying task logs. + - β **LogStats** (Class) + - Statistics about log entries for a task. + - β **Task** (Class) + - A Pydantic model representing a single execution instance of... + - β **TaskCleanupService** (Class) + - Provides methods to clean up old task records and their asso... + - β **TaskContext** (Class) `[CRITICAL]` + - A container passed to plugin.execute() providing the logger ... + - β **TaskLog** (Class) + - A Pydantic model representing a persisted log entry from the... + - β **TaskLogPersistenceService** (Class) `[CRITICAL]` + - Provides methods to save and query task logs from the task_l... + - β **TaskLogger** (Class) `[CRITICAL]` + - A wrapper around TaskManager._add_log that carries task_id a... + - β **TaskManager** (Class) `[CRITICAL]` + - Manages the lifecycle of tasks, including their creation, ex... + + **Dependencies:** + + - π DEPENDS_ON -> TaskLogRecord + - π DEPENDS_ON -> TaskLogger, USED_BY -> plugins + - π DEPENDS_ON -> TaskManager, CALLS -> TaskManager._add_log + + ### π `utils/` + + - ποΈ **Layers:** Core, Domain, Infra + - π **Tiers:** STANDARD: 48, TRIVIAL: 1 + - π **Files:** 4 + - π¦ **Entities:** 49 + + **Key Entities:** + + - β **APIClient** (Class) + - ΠΠ½ΠΊΠ°ΠΏΡΡΠ»ΠΈΡΡΠ΅Ρ HTTP-Π»ΠΎΠ³ΠΈΠΊΡ Π΄Π»Ρ ΡΠ°Π±ΠΎΡΡ Ρ API, Π²ΠΊΠ»ΡΡΠ°Ρ ΡΠ΅ΡΡΠΈΠΈ, ... + - β **AuthenticationError** (Class) + - Exception raised when authentication fails. + - β **DashboardNotFoundError** (Class) + - Exception raised when a dashboard cannot be found. + - β **DatasetMapper** (Class) + - ΠΠ»Π°ΡΡ Π΄Π»Ρ ΠΌΠ΅ΠΏΠΏΠΈΠ½Π³Π° ΠΈ ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΡ verbose_map Π² Π΄Π°ΡΠ°ΡΠ΅ΡΠ°Ρ Supe... + - β **InvalidZipFormatError** (Class) + - Exception raised when a file is not a valid ZIP archive. + - β **NetworkError** (Class) + - Exception raised when a network level error occurs. + - β **PermissionDeniedError** (Class) + - Exception raised when access is denied. + - β **SupersetAPIError** (Class) + - Base exception for all Superset API related errors. + - π¦ **backend.core.utils.dataset_mapper** (Module) + - ΠΡΠΎΡ ΠΌΠΎΠ΄ΡΠ»Ρ ΠΎΡΠ²Π΅ΡΠ°Π΅Ρ Π·Π° ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΌΠ΅ΡΠ°Π΄Π°Π½Π½ΡΡ (verbose_map) ... + - π¦ **backend.core.utils.fileio** (Module) + - ΠΡΠ΅Π΄ΠΎΡΡΠ°Π²Π»ΡΠ΅Ρ Π½Π°Π±ΠΎΡ ΡΡΠΈΠ»ΠΈΡ Π΄Π»Ρ ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΡ ΡΠ°ΠΉΠ»ΠΎΠ²ΡΠΌΠΈ ΠΎΠΏΠ΅ΡΠ°ΡΠΈΡ... + + **Dependencies:** + + - π DEPENDS_ON -> backend.core.superset_client + - π DEPENDS_ON -> backend.src.core.logger + - π DEPENDS_ON -> pandas + - π DEPENDS_ON -> psycopg2 + - π DEPENDS_ON -> pyyaml + + ### π `models/` + + - ποΈ **Layers:** Domain, Model + - π **Tiers:** CRITICAL: 9, STANDARD: 22, TRIVIAL: 22 + - π **Files:** 11 + - π¦ **Entities:** 53 + + **Key Entities:** + + - β **ADGroupMapping** (Class) + - Maps an Active Directory group to a local System Role. + - β **AppConfigRecord** (Class) + - Stores the single source of truth for application configurat... + - β **AssistantAuditRecord** (Class) + - Store audit decisions and outcomes produced by assistant com... + - β **AssistantConfirmationRecord** (Class) + - Persist risky operation confirmation tokens with lifecycle s... + - β **AssistantMessageRecord** (Class) + - Persist chat history entries for assistant conversations. + - β **ConnectionConfig** (Class) `[TRIVIAL]` + - Stores credentials for external databases used for column ma... + - β **DashboardMetadata** (Class) `[TRIVIAL]` + - Represents a dashboard available for migration. + - β **DashboardSelection** (Class) `[TRIVIAL]` + - Represents the user's selection of dashboards to migrate. + - β **DatabaseMapping** (Class) + - Represents a mapping between source and target databases. + - β **DeploymentEnvironment** (Class) `[TRIVIAL]` + - Target Superset environments for dashboard deployment. + + **Dependencies:** + + - π DEPENDS_ON -> Role + - π DEPENDS_ON -> TaskRecord + - π DEPENDS_ON -> backend.src.core.task_manager.models + - π DEPENDS_ON -> backend.src.models.mapping + - π DEPENDS_ON -> sqlalchemy + + ### π `__tests__/` + + - ποΈ **Layers:** Domain + - π **Tiers:** STANDARD: 2, TRIVIAL: 27 + - π **Files:** 2 + - π¦ **Entities:** 29 + + **Key Entities:** + + - π¦ **test_models** (Module) `[TRIVIAL]` + - Unit tests for data models + - π¦ **test_report_models** (Module) + - Unit tests for report Pydantic models and their validators + + ### π `plugins/` + + - ποΈ **Layers:** App, Plugin, Plugins + - π **Tiers:** STANDARD: 63 + - π **Files:** 6 + - π¦ **Entities:** 63 + + **Key Entities:** + + - β **BackupPlugin** (Class) + - Implementation of the backup plugin logic. + - β **DebugPlugin** (Class) + - Plugin for system diagnostics and debugging. + - β **GitPlugin** (Class) + - Π Π΅Π°Π»ΠΈΠ·Π°ΡΠΈΡ ΠΏΠ»Π°Π³ΠΈΠ½Π° Git Integration Π΄Π»Ρ ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΡ Π²Π΅ΡΡΠΈΡΠΌΠΈ Π΄... + - β **MapperPlugin** (Class) + - Plugin for mapping dataset columns verbose names. + - β **MigrationPlugin** (Class) + - Implementation of the migration plugin logic. + - β **SearchPlugin** (Class) + - Plugin for searching text patterns in Superset datasets. + - π¦ **BackupPlugin** (Module) + - A plugin that provides functionality to back up Superset das... + - π¦ **DebugPluginModule** (Module) + - Implements a plugin for system diagnostics and debugging Sup... + - π¦ **MapperPluginModule** (Module) + - Implements a plugin for mapping dataset columns using extern... + - π¦ **MigrationPlugin** (Module) + - A plugin that provides functionality to migrate Superset das... + + **Dependencies:** + + - π DEPENDS_ON -> superset_tool.client + - π DEPENDS_ON -> superset_tool.utils + - π IMPLEMENTS -> PluginBase + + ### π `git/` + + - ποΈ **Layers:** Unknown + - π **Tiers:** STANDARD: 2, TRIVIAL: 2 + - π **Files:** 1 + - π¦ **Entities:** 4 + + **Key Entities:** + + - β **GitLLMExtension** (Class) + - Provides LLM capabilities to the Git plugin. + - π¦ **llm_extension** (Module) `[TRIVIAL]` + - Auto-generated module for backend/src/plugins/git/llm_extens... + + ### π `llm_analysis/` + + - ποΈ **Layers:** Unknown + - π **Tiers:** STANDARD: 21, TRIVIAL: 24 + - π **Files:** 4 + - π¦ **Entities:** 45 + + **Key Entities:** + + - β **DashboardValidationPlugin** (Class) + - Plugin for automated dashboard health analysis using LLMs. + - β **DetectedIssue** (Class) + - Model for a single issue detected during validation. + - β **DocumentationPlugin** (Class) + - Plugin for automated dataset documentation using LLMs. + - β **LLMClient** (Class) + - Wrapper for LLM provider APIs. + - β **LLMProviderConfig** (Class) + - Configuration for an LLM provider. + - β **LLMProviderType** (Class) + - Enum for supported LLM providers. + - β **ScreenshotService** (Class) + - Handles capturing screenshots of Superset dashboards. + - β **ValidationResult** (Class) + - Model for dashboard validation result. + - β **ValidationStatus** (Class) + - Enum for dashboard validation status. + - π¦ **plugin** (Module) `[TRIVIAL]` + - Auto-generated module for backend/src/plugins/llm_analysis/p... + + **Dependencies:** + + - π IMPLEMENTS -> backend.src.core.plugin_base.PluginBase + + ### π `storage/` + + - ποΈ **Layers:** App + - π **Tiers:** STANDARD: 18 + - π **Files:** 1 + - π¦ **Entities:** 18 + + **Key Entities:** + + - β **StoragePlugin** (Class) + - Implementation of the storage management plugin. + - π¦ **StoragePlugin** (Module) + - Provides core filesystem operations for managing backups and... + + **Dependencies:** + + - π DEPENDS_ON -> backend.src.models.storage + - π IMPLEMENTS -> PluginBase + + ### π `schemas/` + + - ποΈ **Layers:** API + - π **Tiers:** STANDARD: 10, TRIVIAL: 3 + - π **Files:** 1 + - π¦ **Entities:** 13 + + **Key Entities:** + + - β **ADGroupMappingCreate** (Class) + - Schema for creating an AD Group mapping. + - β **ADGroupMappingSchema** (Class) + - Represents an AD Group to Role mapping in API responses. + - β **PermissionSchema** (Class) `[TRIVIAL]` + - Represents a permission in API responses. + - β **RoleCreate** (Class) + - Schema for creating a new role. + - β **RoleSchema** (Class) + - Represents a role in API responses. + - β **RoleUpdate** (Class) + - Schema for updating an existing role. + - β **Token** (Class) `[TRIVIAL]` + - Represents a JWT access token response. + - β **TokenData** (Class) `[TRIVIAL]` + - Represents the data encoded in a JWT token. + - β **User** (Class) + - Schema for user data in API responses. + - β **UserBase** (Class) + - Base schema for user data. + + **Dependencies:** + + - π DEPENDS_ON -> pydantic + + ### π `scripts/` + + - ποΈ **Layers:** Scripts, Unknown + - π **Tiers:** STANDARD: 26, TRIVIAL: 2 + - π **Files:** 6 + - π¦ **Entities:** 28 + + **Key Entities:** + + - π¦ **backend.src.scripts.create_admin** (Module) + - CLI tool for creating the initial admin user. + - π¦ **backend.src.scripts.init_auth_db** (Module) + - Initializes the auth database and creates the necessary tabl... + - π¦ **backend.src.scripts.migrate_sqlite_to_postgres** (Module) + - Migrates legacy config and task history from SQLite/file sto... + - π¦ **backend.src.scripts.seed_permissions** (Module) + - Populates the auth database with initial system permissions. + - π¦ **backend.src.scripts.seed_superset_load_test** (Module) + - Creates randomized load-test data in Superset by cloning cha... + - π¦ **test_dataset_dashboard_relations** (Module) `[TRIVIAL]` + - Auto-generated module for backend/src/scripts/test_dataset_d... + + ### π `services/` + + - ποΈ **Layers:** Core, Domain, Service + - π **Tiers:** CRITICAL: 1, STANDARD: 58, TRIVIAL: 5 + - π **Files:** 7 + - π¦ **Entities:** 64 + + **Key Entities:** + + - β **AuthService** (Class) + - Provides high-level authentication services. + - β **EncryptionManager** (Class) `[CRITICAL]` + - Handles encryption and decryption of sensitive data like API... + - β **GitService** (Class) + - Wrapper for GitPython operations with semantic logging and e... + - β **LLMProviderService** (Class) + - Service to manage LLM provider lifecycle. + - β **MappingService** (Class) + - Service for handling database mapping logic. + - β **ResourceService** (Class) + - Provides centralized access to resource data with enhanced m... + - π¦ **backend.src.services** (Module) + - Package initialization for services module + - π¦ **backend.src.services.auth_service** (Module) + - Orchestrates authentication business logic. + - π¦ **backend.src.services.git_service** (Module) + - Core Git logic using GitPython to manage dashboard repositor... + - π¦ **backend.src.services.llm_prompt_templates** (Module) + - Provide default LLM prompt templates and normalization helpe... + + **Dependencies:** + + - π DEPENDS_ON -> backend.src.core.config_manager + - π DEPENDS_ON -> backend.src.core.database + - π DEPENDS_ON -> backend.src.core.superset_client + - π DEPENDS_ON -> backend.src.core.task_manager + - π DEPENDS_ON -> backend.src.core.utils.matching + + ### π `__tests__/` + + - ποΈ **Layers:** Domain, Domain Tests, Service + - π **Tiers:** STANDARD: 24, TRIVIAL: 7 + - π **Files:** 3 + - π¦ **Entities:** 31 + + **Key Entities:** + + - β **TestEncryptionManager** (Class) + - Validate EncryptionManager encrypt/decrypt roundtrip, unique... + - π¦ **backend.src.services.__tests__.test_llm_prompt_templates** (Module) + - Validate normalization and rendering behavior for configurab... + - π¦ **backend.src.services.__tests__.test_resource_service** (Module) + - Unit tests for ResourceService + - π¦ **test_encryption_manager** (Module) + - Unit tests for EncryptionManager encrypt/decrypt functionali... + + **Dependencies:** + + - π DEPENDS_ON -> backend.src.services.llm_prompt_templates + + ### π `reports/` + + - ποΈ **Layers:** Domain + - π **Tiers:** CRITICAL: 5, STANDARD: 15 + - π **Files:** 3 + - π¦ **Entities:** 20 + + **Key Entities:** + + - β **ReportsService** (Class) `[CRITICAL]` + - Service layer for list/detail report retrieval and normaliza... + - π¦ **backend.src.services.reports.normalizer** (Module) `[CRITICAL]` + - Convert task manager task objects into canonical unified Tas... + - π¦ **backend.src.services.reports.report_service** (Module) `[CRITICAL]` + - Aggregate, normalize, filter, and paginate task reports for ... + - π¦ **backend.src.services.reports.type_profiles** (Module) `[CRITICAL]` + - Deterministic mapping of plugin/task identifiers to canonica... + + **Dependencies:** + + - π DEPENDS_ON -> backend.src.core.task_manager.manager.TaskManager + - π DEPENDS_ON -> backend.src.core.task_manager.models.Task + - π DEPENDS_ON -> backend.src.models.report + - π DEPENDS_ON -> backend.src.models.report.TaskType + - π DEPENDS_ON -> backend.src.services.reports.normalizer + + ### π `__tests__/` + + - ποΈ **Layers:** Domain, Domain (Tests) + - π **Tiers:** STANDARD: 2, TRIVIAL: 19 + - π **Files:** 2 + - π¦ **Entities:** 21 + + **Key Entities:** + + - π¦ **backend.tests.test_report_normalizer** (Module) + - Validate unknown task type fallback and partial payload norm... + - π¦ **test_report_service** (Module) + - Unit tests for ReportsService list/detail operations + + ### π `tests/` + + - ποΈ **Layers:** Core, Domain (Tests), Test, Unknown + - π **Tiers:** CRITICAL: 6, STANDARD: 79, TRIVIAL: 85 + - π **Files:** 10 + - π¦ **Entities:** 170 + + **Key Entities:** + + - β **TestLogPersistence** (Class) `[CRITICAL]` + - Test suite for TaskLogPersistenceService. + - β **TestTaskContext** (Class) + - Test suite for TaskContext. + - β **TestTaskLogger** (Class) + - Test suite for TaskLogger. + - β **TestTaskPersistenceHelpers** (Class) `[CRITICAL]` + - Test suite for TaskPersistenceService static helper methods. + - β **TestTaskPersistenceService** (Class) `[CRITICAL]` + - Test suite for TaskPersistenceService CRUD operations. + - π¦ **backend.tests.test_dashboards_api** (Module) + - Comprehensive contract-driven tests for Dashboard Hub API + - π¦ **test_auth** (Module) `[TRIVIAL]` + - Auto-generated module for backend/tests/test_auth.py + - π¦ **test_log_persistence** (Module) `[CRITICAL]` + - Unit tests for TaskLogPersistenceService. + - π¦ **test_resource_hubs** (Module) `[TRIVIAL]` + - Auto-generated module for backend/tests/test_resource_hubs.p... + - π¦ **test_smoke_plugins** (Module) `[TRIVIAL]` + - Auto-generated module for backend/tests/test_smoke_plugins.p... + + ### π `core/` + + - ποΈ **Layers:** Domain, Unknown + - π **Tiers:** STANDARD: 2, TRIVIAL: 31 + - π **Files:** 3 + - π¦ **Entities:** 33 + + **Key Entities:** + + - π¦ **backend.tests.core.test_mapping_service** (Module) + - Unit tests for the IdMappingService matching UUIDs to intege... + - π¦ **backend.tests.core.test_migration_engine** (Module) + - Unit tests for MigrationEngine's cross-filter patching algor... + - π¦ **test_defensive_guards** (Module) `[TRIVIAL]` + - Auto-generated module for backend/tests/core/test_defensive_... + + ### π `components/` + + - ποΈ **Layers:** Component, Feature, UI, UI -->, Unknown + - π **Tiers:** CRITICAL: 1, STANDARD: 49, TRIVIAL: 4 + - π **Files:** 13 + - π¦ **Entities:** 54 + + **Key Entities:** + + - π§© **DashboardGrid** (Component) + - Displays a grid of dashboards with selection and pagination. + - π§© **DynamicForm** (Component) + - Generates a form dynamically based on a JSON schema. + - π§© **EnvSelector** (Component) + - Provides a UI component for selecting source and target envi... + - π§© **Footer** (Component) `[TRIVIAL]` + - Displays the application footer with copyright information. + - π§© **MappingTable** (Component) + - Displays and allows editing of database mappings. + - π§© **MissingMappingModal** (Component) + - Prompts the user to provide a database mapping when one is m... + - π§© **Navbar** (Component) + - Main navigation bar for the application. + - π§© **PasswordPrompt** (Component) + - A modal component to prompt the user for database passwords ... + - π§© **TaskHistory** (Component) + - Displays a list of recent tasks with their status and allows... + - π§© **TaskList** (Component) + - Displays a list of tasks with their status and execution det... + + ### π `__tests__/` + + - ποΈ **Layers:** UI (Tests) + - π **Tiers:** STANDARD: 1 + - π **Files:** 1 + - π¦ **Entities:** 1 + + **Key Entities:** + + - π¦ **frontend.src.components.__tests__.task_log_viewer** (Module) + - Unit tests for TaskLogViewer component by mounting it and ob... + + ### π `auth/` + + - ποΈ **Layers:** Component + - π **Tiers:** TRIVIAL: 1 + - π **Files:** 1 + - π¦ **Entities:** 1 + + **Key Entities:** + + - π§© **ProtectedRoute** (Component) `[TRIVIAL]` + - Wraps content to ensure only authenticated users can access ... + + ### π `git/` + + - ποΈ **Layers:** Component + - π **Tiers:** STANDARD: 26 + - π **Files:** 6 + - π¦ **Entities:** 26 + + **Key Entities:** + + - π§© **BranchSelector** (Component) + - UI Π΄Π»Ρ Π²ΡΠ±ΠΎΡΠ° ΠΈ ΡΠΎΠ·Π΄Π°Π½ΠΈΡ Π²Π΅ΡΠΎΠΊ Git. + - π§© **CommitHistory** (Component) + - Displays the commit history for a specific dashboard. + - π§© **CommitModal** (Component) + - ΠΠΎΠ΄Π°Π»ΡΠ½ΠΎΠ΅ ΠΎΠΊΠ½ΠΎ Π΄Π»Ρ ΡΠΎΠ·Π΄Π°Π½ΠΈΡ ΠΊΠΎΠΌΠΌΠΈΡΠ° Ρ ΠΏΡΠΎΡΠΌΠΎΡΡΠΎΠΌ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ (... + - π§© **ConflictResolver** (Component) + - UI for resolving merge conflicts (Keep Mine / Keep Theirs). + - π§© **DeploymentModal** (Component) + - Modal for deploying a dashboard to a target environment. + - π§© **GitManager** (Component) + - Π¦Π΅Π½ΡΡΠ°Π»ΡΠ½ΡΠΉ ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ Π΄Π»Ρ ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΡ Git-ΠΎΠΏΠ΅ΡΠ°ΡΠΈΡΠΌΠΈ ΠΊΠΎΠ½ΠΊΡΠ΅ΡΠ½... + + ### π `llm/` + + - ποΈ **Layers:** UI, Unknown + - π **Tiers:** STANDARD: 2, TRIVIAL: 11 + - π **Files:** 3 + - π¦ **Entities:** 13 + + **Key Entities:** + + - π§© **DocPreview** (Component) + - UI component for previewing generated dataset documentation ... + - π§© **ProviderConfig** (Component) + - UI form for managing LLM provider configurations. + - π¦ **DocPreview** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/components/llm/DocPre... + - π¦ **ProviderConfig** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/components/llm/Provid... + - π¦ **ValidationReport** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/components/llm/Valida... + + ### π `__tests__/` + + - ποΈ **Layers:** UI Tests + - π **Tiers:** STANDARD: 2 + - π **Files:** 1 + - π¦ **Entities:** 2 + + **Key Entities:** + + - π¦ **frontend.src.components.llm.__tests__.provider_config_integration** (Module) + - Protect edit-button interaction contract in LLM provider set... + + ### π `storage/` + + - ποΈ **Layers:** UI + - π **Tiers:** STANDARD: 7 + - π **Files:** 2 + - π¦ **Entities:** 7 + + **Key Entities:** + + - π§© **FileList** (Component) + - Displays a table of files with metadata and actions. + - π§© **FileUpload** (Component) + - Provides a form for uploading files to a specific category. + + ### π `tasks/` + + - ποΈ **Layers:** UI, Unknown + - π **Tiers:** STANDARD: 4, TRIVIAL: 12 + - π **Files:** 4 + - π¦ **Entities:** 16 + + **Key Entities:** + + - π§© **LogEntryRow** (Component) + - Renders a single log entry with stacked layout optimized for... + - π§© **LogFilterBar** (Component) + - Compact filter toolbar for logs β level, source, and text se... + - π§© **TaskLogPanel** (Component) + - Combines log filtering and display into a single cohesive da... + - π¦ **LogFilterBar** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/components/tasks/LogF... + - π¦ **TaskLogPanel** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/components/tasks/Task... + - π¦ **TaskResultPanel** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/components/tasks/Task... + + ### π `tools/` + + - ποΈ **Layers:** UI, Unknown + - π **Tiers:** STANDARD: 14, TRIVIAL: 2 + - π **Files:** 4 + - π¦ **Entities:** 16 + + **Key Entities:** + + - π§© **ConnectionForm** (Component) + - UI component for creating a new database connection configur... + - π§© **ConnectionList** (Component) + - UI component for listing and deleting saved database connect... + - π§© **DebugTool** (Component) + - UI component for system diagnostics and debugging API respon... + - π§© **MapperTool** (Component) + - UI component for mapping dataset column verbose names using ... + - π¦ **MapperTool** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/components/tools/Mapp... + + ### π `lib/` + + - ποΈ **Layers:** Infra, Infra-API, UI, UI-State + - π **Tiers:** STANDARD: 23, TRIVIAL: 3 + - π **Files:** 5 + - π¦ **Entities:** 26 + + **Key Entities:** + + - π§© **Counter** (Component) `[TRIVIAL]` + - Simple counter demo component + - π¦ **Utils** (Module) `[TRIVIAL]` + - General utility functions (class merging) + - π¦ **api_module** (Module) + - Handles all communication with the backend API. + - π¦ **stores_module** (Module) + - Global state management using Svelte stores. + - π¦ **toasts_module** (Module) + - Manages toast notifications using a Svelte writable store. + + ### π `api/` + + - ποΈ **Layers:** Infra, Infra-API + - π **Tiers:** CRITICAL: 1, STANDARD: 10 + - π **Files:** 2 + - π¦ **Entities:** 11 + + **Key Entities:** + + - π¦ **frontend.src.lib.api.assistant** (Module) + - API client wrapper for assistant chat, confirmation actions,... + - π¦ **frontend.src.lib.api.reports** (Module) `[CRITICAL]` + - Wrapper-based reports API client for list/detail retrieval w... + + **Dependencies:** + + - π DEPENDS_ON -> [DEF:api_module] + - π DEPENDS_ON -> frontend.src.lib.api.api_module + + ### π `__tests__/` + + - ποΈ **Layers:** Infra (Tests) + - π **Tiers:** STANDARD: 4 + - π **Files:** 1 + - π¦ **Entities:** 4 + + **Key Entities:** + + - β **TestBuildReportQueryString** (Class) + - Validate query string construction from filter options. + - β **TestGetReportsAsync** (Class) + - Validate getReports and getReportDetail with mocked api.fetc... + - β **TestNormalizeApiError** (Class) + - Validate error normalization for UI-state mapping. + - π¦ **frontend.src.lib.api.__tests__.reports_api** (Module) + - Unit tests for reports API client functions: query string bu... + + ### π `auth/` + + - ποΈ **Layers:** Feature + - π **Tiers:** STANDARD: 7 + - π **Files:** 1 + - π¦ **Entities:** 7 + + **Key Entities:** + + - ποΈ **authStore** (Store) + - Manages the global authentication state on the frontend. + + ### π `assistant/` + + - ποΈ **Layers:** UI, Unknown + - π **Tiers:** CRITICAL: 1, STANDARD: 12, TRIVIAL: 5 + - π **Files:** 1 + - π¦ **Entities:** 18 + + **Key Entities:** + + - π§© **AssistantChatPanel** (Component) `[CRITICAL]` + - Slide-out assistant chat panel for natural language command ... + - π¦ **AssistantChatPanel** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/lib/components/assist... + + ### π `__tests__/` + + - ποΈ **Layers:** UI Tests + - π **Tiers:** STANDARD: 3 + - π **Files:** 1 + - π¦ **Entities:** 3 + + **Key Entities:** + + - π¦ **frontend.src.lib.components.assistant.__tests__.assistant_chat_integration** (Module) + - Contract-level integration checks for assistant chat panel i... + + ### π `layout/` + + - ποΈ **Layers:** UI, Unknown + - π **Tiers:** CRITICAL: 3, STANDARD: 5, TRIVIAL: 46 + - π **Files:** 4 + - π¦ **Entities:** 54 + + **Key Entities:** + + - π§© **Breadcrumbs** (Component) + - Display page hierarchy navigation + - π§© **Sidebar** (Component) `[CRITICAL]` + - Persistent left sidebar with resource categories navigation + - π§© **TaskDrawer** (Component) `[CRITICAL]` + - Global task drawer for monitoring background operations + - π§© **TopNavbar** (Component) `[CRITICAL]` + - Unified top navigation bar with Logo, Search, Activity, and ... + - π¦ **Breadcrumbs** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/lib/components/layout... + - π¦ **Sidebar** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/lib/components/layout... + - π¦ **TaskDrawer** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/lib/components/layout... + - π¦ **TopNavbar** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/lib/components/layout... + + ### π `__tests__/` + + - ποΈ **Layers:** Unknown + - π **Tiers:** TRIVIAL: 3 + - π **Files:** 1 + - π¦ **Entities:** 3 + + **Key Entities:** + + - π¦ **test_breadcrumbs.svelte** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/lib/components/layout... + + ### π `reports/` + + - ποΈ **Layers:** UI, Unknown + - π **Tiers:** CRITICAL: 4, STANDARD: 1, TRIVIAL: 10 + - π **Files:** 4 + - π¦ **Entities:** 15 + + **Key Entities:** + + - π§© **ReportCard** (Component) `[CRITICAL]` + - Render one report with explicit textual type label and profi... + - π§© **ReportDetailPanel** (Component) `[CRITICAL]` + - Display detailed report context with diagnostics and actiona... + - π§© **ReportsList** (Component) `[CRITICAL]` + - Render unified list of normalized reports with canonical min... + - π¦ **ReportCard** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/lib/components/report... + - π¦ **ReportDetailPanel** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/lib/components/report... + - π¦ **ReportsList** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/lib/components/report... + - π¦ **frontend.src.lib.components.reports.reportTypeProfiles** (Module) `[CRITICAL]` + - Deterministic mapping from report task_type to visual profil... + + **Dependencies:** + + - π DEPENDS_ON -> frontend/src/lib/i18n/index.ts + + ### π `__tests__/` + + - ποΈ **Layers:** UI, UI (Tests) + - π **Tiers:** STANDARD: 6, TRIVIAL: 4 + - π **Files:** 6 + - π¦ **Entities:** 10 + + **Key Entities:** + + - π¦ **frontend.src.lib.components.reports.__tests__.report_card.ux** (Module) + - Test UX states and transitions for ReportCard component + - π¦ **frontend.src.lib.components.reports.__tests__.report_detail.integration** (Module) + - Validate detail-panel behavior for failed reports and recove... + - π¦ **frontend.src.lib.components.reports.__tests__.report_detail.ux** (Module) + - Test UX states and recovery for ReportDetailPanel component + - π¦ **frontend.src.lib.components.reports.__tests__.report_type_profiles** (Module) + - Validate report type profile mapping and unknown fallback be... + - π¦ **frontend.src.lib.components.reports.__tests__.reports_filter_performance** (Module) + - Guard test for report filter responsiveness on moderate in-m... + - π¦ **frontend.src.lib.components.reports.__tests__.reports_page.integration** (Module) + - Integration-style checks for unified mixed-type reports rend... + + ### π `fixtures/` + + - ποΈ **Layers:** UI + - π **Tiers:** STANDARD: 1 + - π **Files:** 1 + - π¦ **Entities:** 1 + + **Key Entities:** + + - π¦ **reports.fixtures** (Module) + - Shared frontend fixtures for unified reports states. + + ### π `i18n/` + + - ποΈ **Layers:** Infra + - π **Tiers:** STANDARD: 4 + - π **Files:** 1 + - π¦ **Entities:** 4 + + **Key Entities:** + + - π¦ **i18n** (Module) + - Determines the starting locale. + - ποΈ **locale** (Store) + - Holds the current active locale string. + - ποΈ **t** (Store) + - Derived store providing the translation dictionary. + + **Dependencies:** + + - π DEPENDS_ON -> locales/en.json + - π DEPENDS_ON -> locales/ru.json + + ### π `stores/` + + - ποΈ **Layers:** UI, UI-State, Unknown + - π **Tiers:** CRITICAL: 1, STANDARD: 8, TRIVIAL: 21 + - π **Files:** 5 + - π¦ **Entities:** 30 + + **Key Entities:** + + - π¦ **environmentContext** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/lib/stores/environmen... + - π¦ **sidebar** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/lib/stores/sidebar.js + - π¦ **taskDrawer** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/lib/stores/taskDrawer... + - ποΈ **activity** (Store) + - Track active task count for navbar indicator + - ποΈ **assistantChat** (Store) + - Control assistant chat panel visibility and active conversat... + - ποΈ **environmentContext** (Store) + - Global selected environment context for navigation and safet... + - ποΈ **sidebar** (Store) + - Manage sidebar visibility and navigation state + - ποΈ **taskDrawer** (Store) `[CRITICAL]` + - Manage Task Drawer visibility and resource-to-task mapping + + **Dependencies:** + + - π DEPENDS_ON -> WebSocket connection, taskDrawer store + + ### π `__tests__/` + + - ποΈ **Layers:** Domain (Tests), UI, UI Tests + - π **Tiers:** STANDARD: 11 + - π **Files:** 6 + - π¦ **Entities:** 11 + + **Key Entities:** + + - π¦ **frontend.src.lib.stores.__tests__.assistantChat** (Module) + - Validate assistant chat store visibility and conversation bi... + - π¦ **frontend.src.lib.stores.__tests__.sidebar** (Module) + - Unit tests for sidebar store + - π¦ **frontend.src.lib.stores.__tests__.test_activity** (Module) + - Unit tests for activity store + - π¦ **frontend.src.lib.stores.__tests__.test_sidebar** (Module) + - Unit tests for sidebar store + - π¦ **frontend.src.lib.stores.__tests__.test_taskDrawer** (Module) + - Unit tests for task drawer store + - π¦ **setupTests** (Module) + - Global test setup with mocks for SvelteKit modules + + **Dependencies:** + + - π DEPENDS_ON -> assistantChatStore + - π DEPENDS_ON -> frontend.src.lib.stores.taskDrawer + + ### π `mocks/` + + - ποΈ **Layers:** UI (Tests) + - π **Tiers:** STANDARD: 4 + - π **Files:** 4 + - π¦ **Entities:** 4 + + **Key Entities:** + + - π¦ **mock_env_public** (Module) + - Mock for $env/static/public SvelteKit module in vitest + + ### π `ui/` + + - ποΈ **Layers:** Atom + - π **Tiers:** TRIVIAL: 7 + - π **Files:** 7 + - π¦ **Entities:** 7 + + **Key Entities:** + + - π§© **Button** (Component) `[TRIVIAL]` + - Define component interface and default values (Svelte 5 Rune... + - π§© **Card** (Component) `[TRIVIAL]` + - Standardized container with padding and elevation. + - π§© **Input** (Component) `[TRIVIAL]` + - Standardized text input component with label and error handl... + - π§© **LanguageSwitcher** (Component) `[TRIVIAL]` + - Dropdown component to switch between supported languages. + - π§© **PageHeader** (Component) `[TRIVIAL]` + - Standardized page header with title and action area. + - π§© **Select** (Component) `[TRIVIAL]` + - Standardized dropdown selection component. + - π¦ **ui** (Module) `[TRIVIAL]` + - Central export point for standardized UI components. + + ### π `utils/` + + - ποΈ **Layers:** Infra + - π **Tiers:** TRIVIAL: 2 + - π **Files:** 1 + - π¦ **Entities:** 2 + + **Key Entities:** + + - π¦ **Debounce** (Module) `[TRIVIAL]` + - Debounce utility for limiting function execution rate + + ### π `pages/` + + - ποΈ **Layers:** UI + - π **Tiers:** STANDARD: 11 + - π **Files:** 2 + - π¦ **Entities:** 11 + + **Key Entities:** + + - π§© **Dashboard** (Component) + - Displays the list of available plugins and allows selecting ... + - π§© **Settings** (Component) + - The main settings page for the application, allowing managem... + + ### π `routes/` + + - ποΈ **Layers:** Infra, UI + - π **Tiers:** CRITICAL: 1, STANDARD: 3, TRIVIAL: 1 + - π **Files:** 5 + - π¦ **Entities:** 5 + + **Key Entities:** + + - π¦ **RootLayoutConfig** (Module) `[TRIVIAL]` + - Root layout configuration (SPA mode) + - π¦ **layout** (Module) + - Bind global layout shell and conditional login/full-app rend... + + ### π `roles/` + + - ποΈ **Layers:** Domain + - π **Tiers:** STANDARD: 6 + - π **Files:** 1 + - π¦ **Entities:** 6 + + **Key Entities:** + + - π§© **AdminRolesPage** (Component) + - UI for managing system roles and their permissions. + + ### π `settings/` + + - ποΈ **Layers:** Feature + - π **Tiers:** STANDARD: 5 + - π **Files:** 1 + - π¦ **Entities:** 5 + + **Key Entities:** + + - π§© **AdminSettingsPage** (Component) + - UI for configuring Active Directory Group to local Role mapp... + + ### π `llm/` + + - ποΈ **Layers:** UI, Unknown + - π **Tiers:** STANDARD: 1, TRIVIAL: 5 + - π **Files:** 1 + - π¦ **Entities:** 6 + + **Key Entities:** + + - π§© **LLMSettingsPage** (Component) + - Admin settings page for LLM provider configuration. + - π¦ **+page** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/routes/admin/settings... + + ### π `users/` + + - ποΈ **Layers:** Feature + - π **Tiers:** STANDARD: 6 + - π **Files:** 1 + - π¦ **Entities:** 6 + + **Key Entities:** + + - π§© **AdminUsersPage** (Component) + - UI for managing system users and their roles. + + ### π `dashboards/` + + - ποΈ **Layers:** UI, Unknown + - π **Tiers:** CRITICAL: 1, TRIVIAL: 35 + - π **Files:** 1 + - π¦ **Entities:** 36 + + **Key Entities:** + + - π¦ **+page** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/routes/dashboards/+pa... + + ### π `[id]/` + + - ποΈ **Layers:** UI, Unknown + - π **Tiers:** CRITICAL: 1, TRIVIAL: 17 + - π **Files:** 1 + - π¦ **Entities:** 18 + + **Key Entities:** + + - π¦ **+page** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/routes/dashboards/[id... + + ### π `datasets/` + + - ποΈ **Layers:** UI, Unknown + - π **Tiers:** CRITICAL: 1, TRIVIAL: 15 + - π **Files:** 1 + - π¦ **Entities:** 16 + + **Key Entities:** + + - π¦ **+page** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/routes/datasets/+page... + + ### π `[id]/` + + - ποΈ **Layers:** UI, Unknown + - π **Tiers:** CRITICAL: 1, TRIVIAL: 6 + - π **Files:** 1 + - π¦ **Entities:** 7 + + **Key Entities:** + + - π¦ **+page** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/routes/datasets/[id]/... + + ### π `git/` + + - ποΈ **Layers:** Page + - π **Tiers:** STANDARD: 3 + - π **Files:** 1 + - π¦ **Entities:** 3 + + **Key Entities:** + + - π§© **GitDashboardPage** (Component) + - Dashboard management page for Git integration. + + ### π `login/` + + - ποΈ **Layers:** UI + - π **Tiers:** STANDARD: 3 + - π **Files:** 1 + - π¦ **Entities:** 3 + + **Key Entities:** + + - π§© **LoginPage** (Component) + - Provides the user interface for local and ADFS authenticatio... + + ### π `migration/` + + - ποΈ **Layers:** Page + - π **Tiers:** STANDARD: 10 + - π **Files:** 1 + - π¦ **Entities:** 10 + + **Key Entities:** + + - π§© **DashboardSelectionSection** (Component) + - π§© **MigrationDashboard** (Component) + - Main dashboard for configuring and starting migrations. + + ### π `mappings/` + + - ποΈ **Layers:** Page + - π **Tiers:** STANDARD: 4 + - π **Files:** 1 + - π¦ **Entities:** 4 + + **Key Entities:** + + - π§© **MappingManagement** (Component) + - Page for managing database mappings between environments. + + ### π `reports/` + + - ποΈ **Layers:** UI, Unknown + - π **Tiers:** CRITICAL: 1, TRIVIAL: 7 + - π **Files:** 1 + - π¦ **Entities:** 8 + + **Key Entities:** + + - π§© **UnifiedReportsPage** (Component) `[CRITICAL]` + - Unified reports page with filtering and resilient UX states ... + - π¦ **+page** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/routes/reports/+page.... + + ### π `[taskId]/` + + - ποΈ **Layers:** Unknown + - π **Tiers:** TRIVIAL: 8 + - π **Files:** 1 + - π¦ **Entities:** 8 + + **Key Entities:** + + - π¦ **+page** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/routes/reports/llm/[t... + + ### π `settings/` + + - ποΈ **Layers:** UI, Unknown + - π **Tiers:** CRITICAL: 1, STANDARD: 1, TRIVIAL: 23 + - π **Files:** 2 + - π¦ **Entities:** 25 + + **Key Entities:** + + - π¦ **+page** (Module) `[TRIVIAL]` + - Auto-generated module for frontend/src/routes/settings/+page... + + ### π `connections/` + + - ποΈ **Layers:** UI + - π **Tiers:** STANDARD: 2 + - π **Files:** 1 + - π¦ **Entities:** 2 + + **Key Entities:** + + - π§© **ConnectionsSettingsPage** (Component) + - Page for managing database connection configurations. + + ### π `git/` + + - ποΈ **Layers:** Page + - π **Tiers:** STANDARD: 5 + - π **Files:** 1 + - π¦ **Entities:** 5 + + **Key Entities:** + + - π§© **GitSettingsPage** (Component) + - Manage Git server configurations for dashboard versioning. + + ### π `storage/` + + - ποΈ **Layers:** Page + - π **Tiers:** TRIVIAL: 1 + - π **Files:** 1 + - π¦ **Entities:** 1 + + ### π `repos/` + + - π **Tiers:** STANDARD: 3 + - π **Files:** 1 + - π¦ **Entities:** 3 + + ### π `debug/` + + - ποΈ **Layers:** UI + - π **Tiers:** TRIVIAL: 1 + - π **Files:** 1 + - π¦ **Entities:** 1 + + **Key Entities:** + + - π§© **DebugPage** (Component) `[TRIVIAL]` + - Page for system diagnostics and debugging. + + ### π `mapper/` + + - ποΈ **Layers:** UI + - π **Tiers:** TRIVIAL: 1 + - π **Files:** 1 + - π¦ **Entities:** 1 + + **Key Entities:** + + - π§© **MapperPage** (Component) `[TRIVIAL]` + - Page for the dataset column mapper tool. + + ### π `storage/` + + - ποΈ **Layers:** UI + - π **Tiers:** STANDARD: 5 + - π **Files:** 1 + - π¦ **Entities:** 5 + + **Key Entities:** + + - π§© **StoragePage** (Component) + - Main page for file storage management. + + ### π `services/` + + - ποΈ **Layers:** Service + - π **Tiers:** STANDARD: 33 + - π **Files:** 6 + - π¦ **Entities:** 33 + + **Key Entities:** + + - π¦ **GitServiceClient** (Module) + - API client for Git operations, managing the communication be... + - π¦ **adminService** (Module) + - Service for Admin-related API calls (User and Role managemen... + - π¦ **storageService** (Module) + - Frontend API client for file storage management. + + **Dependencies:** + + - π DEPENDS_ON -> frontend.src.lib.api + + ### π `types/` + + - ποΈ **Layers:** Domain + - π **Tiers:** TRIVIAL: 1 + - π **Files:** 1 + - π¦ **Entities:** 1 + + **Key Entities:** + + - π¦ **DashboardTypes** (Module) `[TRIVIAL]` + - TypeScript interfaces for Dashboard entities + +### π `root/` + +- ποΈ **Layers:** DevOps/Tooling, Domain, Unknown +- π **Tiers:** CRITICAL: 14, STANDARD: 24, TRIVIAL: 12 +- π **Files:** 4 +- π¦ **Entities:** 50 + +**Key Entities:** + + - β **ComplianceIssue** (Class) `[TRIVIAL]` + - Represents a single compliance issue with severity. + - β **ReportsService** (Class) `[CRITICAL]` + - Service layer for list/detail report retrieval and normaliza... + - β **SemanticEntity** (Class) `[CRITICAL]` + - Represents a code entity (Module, Function, Component) found... + - β **SemanticMapGenerator** (Class) `[CRITICAL]` + - Orchestrates the mapping process with tier-based validation. + - β **Severity** (Class) `[TRIVIAL]` + - Severity levels for compliance issues. + - β **Tier** (Class) `[TRIVIAL]` + - Enumeration of semantic tiers defining validation strictness... + - π¦ **backend.src.services.reports.report_service** (Module) `[CRITICAL]` + - Aggregate, normalize, filter, and paginate task reports for ... + - π¦ **check_test_data** (Module) `[TRIVIAL]` + - Auto-generated module for check_test_data.py + - π¦ **generate_semantic_map** (Module) + - Scans the codebase to generate a Semantic Map, Module Map, a... + - π¦ **test_analyze** (Module) `[TRIVIAL]` + - Auto-generated module for test_analyze.py + +**Dependencies:** + + - π DEPENDS_ON -> backend.src.core.task_manager.manager.TaskManager + - π DEPENDS_ON -> backend.src.models.report + - π DEPENDS_ON -> backend.src.services.reports.normalizer + +## Cross-Module Dependencies + +```mermaid +graph TD + api-->|USES|backend + api-->|USES|backend + routes-->|DEPENDS_ON|backend + routes-->|DEPENDS_ON|backend + routes-->|DEPENDS_ON|backend + routes-->|DEPENDS_ON|backend + routes-->|DEPENDS_ON|backend + routes-->|DEPENDS_ON|backend + routes-->|DEPENDS_ON|backend + routes-->|DEPENDS_ON|backend + routes-->|DEPENDS_ON|backend + routes-->|DEPENDS_ON|backend + routes-->|USES|backend + routes-->|USES|backend + routes-->|CALLS|backend + routes-->|CALLS|backend + routes-->|CALLS|backend + routes-->|CALLS|backend + routes-->|CALLS|backend + routes-->|DEPENDS_ON|backend + routes-->|DEPENDS_ON|backend + routes-->|DEPENDS_ON|backend + routes-->|DEPENDS_ON|backend + routes-->|CALLS|root + routes-->|DEPENDS_ON|backend + routes-->|DEPENDS_ON|backend + routes-->|DEPENDS_ON|backend + routes-->|DEPENDS_ON|backend + routes-->|DEPENDS_ON|backend + __tests__-->|TESTS|backend + __tests__-->|TESTS|backend + __tests__-->|TESTS|backend + __tests__-->|TESTS|backend + __tests__-->|DEPENDS_ON|backend + __tests__-->|DEPENDS_ON|backend + __tests__-->|VERIFIES|backend + core-->|USES|backend + core-->|USES|backend + core-->|DEPENDS_ON|backend + core-->|DEPENDS_ON|backend + core-->|DEPENDS_ON|backend + core-->|DEPENDS_ON|backend + auth-->|USES|backend + auth-->|USES|backend + auth-->|USES|backend + auth-->|USES|backend + utils-->|DEPENDS_ON|backend + utils-->|DEPENDS_ON|backend + utils-->|DEPENDS_ON|backend + models-->|INHERITS_FROM|backend + models-->|DEPENDS_ON|backend + models-->|DEPENDS_ON|backend + models-->|USED_BY|backend + models-->|INHERITS_FROM|backend + __tests__-->|TESTS|backend + llm_analysis-->|IMPLEMENTS|backend + llm_analysis-->|IMPLEMENTS|backend + storage-->|DEPENDS_ON|backend + scripts-->|USES|backend + scripts-->|USES|backend + scripts-->|READS_FROM|backend + scripts-->|READS_FROM|backend + scripts-->|USES|backend + scripts-->|USES|backend + scripts-->|CALLS|backend + scripts-->|USES|backend + scripts-->|USES|backend + scripts-->|USES|backend + services-->|DEPENDS_ON|backend + services-->|DEPENDS_ON|backend + services-->|DEPENDS_ON|backend + services-->|DEPENDS_ON|backend + services-->|DEPENDS_ON|backend + services-->|DEPENDS_ON|backend + services-->|USES|backend + services-->|USES|backend + services-->|USES|backend + services-->|DEPENDS_ON|backend + services-->|DEPENDS_ON|backend + __tests__-->|TESTS|backend + __tests__-->|DEPENDS_ON|backend + __tests__-->|TESTS|backend + reports-->|DEPENDS_ON|backend + reports-->|DEPENDS_ON|backend + reports-->|DEPENDS_ON|backend + reports-->|DEPENDS_ON|backend + reports-->|DEPENDS_ON|backend + reports-->|DEPENDS_ON|backend + reports-->|DEPENDS_ON|backend + __tests__-->|TESTS|backend + __tests__-->|TESTS|backend + tests-->|TESTS|backend + core-->|VERIFIES|backend + core-->|VERIFIES|backend + __tests__-->|VERIFIES|components + __tests__-->|VERIFIES|lib + reports-->|DEPENDS_ON|lib + __tests__-->|TESTS|routes + __tests__-->|TESTS|routes + __tests__-->|TESTS|lib + __tests__-->|TESTS|lib + __tests__-->|TESTS|lib + __tests__-->|TESTS|routes + root-->|DEPENDS_ON|backend + root-->|DEPENDS_ON|backend + root-->|DEPENDS_ON|backend +``` diff --git a/.ai/PROJECT_MAP.md b/.ai/PROJECT_MAP.md new file mode 100644 index 0000000..873d655 --- /dev/null +++ b/.ai/PROJECT_MAP.md @@ -0,0 +1,4523 @@ +# Project Semantic Map + +> Compressed view for AI Context. Generated automatically. + +- π¦ **check_test_data** (`Module`) `[TRIVIAL]` + - π Auto-generated module for check_test_data.py + - ποΈ Layer: Unknown + - Ζ **check_file** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.src.services.reports.report_service** (`Module`) `[CRITICAL]` + - π Aggregate, normalize, filter, and paginate task reports for unified list/detail API use cases. + - ποΈ Layer: Domain + - π Invariant: List responses are deterministic and include applied filter echo metadata. + - π DEPENDS_ON -> `backend.src.core.task_manager.manager.TaskManager` + - π DEPENDS_ON -> `backend.src.models.report` + - π DEPENDS_ON -> `backend.src.services.reports.normalizer` + - β **ReportsService** (`Class`) `[CRITICAL]` + - π Service layer for list/detail report retrieval and normalization. + - π Invariant: Service methods are read-only over task history source. + - Ζ **__init__** (`Function`) `[CRITICAL]` + - π Initialize service with TaskManager dependency. + - π Invariant: Constructor performs no task mutations. + - Ζ **_load_normalized_reports** (`Function`) + - π Build normalized reports from all available tasks. + - π Invariant: Every returned item is a TaskReport. + - Ζ **_to_utc_datetime** (`Function`) + - π Normalize naive/aware datetime values to UTC-aware datetime for safe comparisons. + - π Invariant: Naive datetimes are interpreted as UTC to preserve deterministic ordering/filtering. + - Ζ **_datetime_sort_key** (`Function`) + - π Produce stable numeric sort key for report timestamps. + - π Invariant: Mixed naive/aware datetimes never raise TypeError. + - Ζ **_matches_query** (`Function`) + - π Apply query filtering to a report. + - π Invariant: Filter evaluation is side-effect free. + - Ζ **_sort_reports** (`Function`) + - π Sort reports deterministically according to query settings. + - π Invariant: Sorting criteria are deterministic for equal input. + - Ζ **list_reports** (`Function`) + - π Return filtered, sorted, paginated report collection. + - Ζ **get_report_detail** (`Function`) + - π Return one normalized report with timeline/diagnostics/next actions. + - Ζ **print_entity** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **test_analyze** (`Module`) `[TRIVIAL]` + - π Auto-generated module for test_analyze.py + - ποΈ Layer: Unknown + - Ζ **print_issues** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **generate_semantic_map** (`Module`) + - π Scans the codebase to generate a Semantic Map, Module Map, and Compliance Report based on the System Standard. + - ποΈ Layer: DevOps/Tooling + - π Invariant: All DEF anchors must have matching closing anchors; TIER determines validation strictness. + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Mock init for self-containment. + - Ζ **__enter__** (`Function`) `[TRIVIAL]` + - π Mock enter. + - Ζ **__exit__** (`Function`) `[TRIVIAL]` + - π Mock exit. + - β **Tier** (`Class`) `[TRIVIAL]` + - π Enumeration of semantic tiers defining validation strictness. + - β **Severity** (`Class`) `[TRIVIAL]` + - π Severity levels for compliance issues. + - β **ComplianceIssue** (`Class`) `[TRIVIAL]` + - π Represents a single compliance issue with severity. + - β **SemanticEntity** (`Class`) `[CRITICAL]` + - π Represents a code entity (Module, Function, Component) found during parsing. + - π Invariant: start_line is always set; end_line is set upon closure; tier defaults to STANDARD. + - Ζ **__init__** (`Function`) + - π Initializes a new SemanticEntity instance. + - Ζ **get_tier** (`Function`) + - π Returns the tier of the entity, defaulting to STANDARD. + - Ζ **to_dict** (`Function`) + - π Serializes the entity to a dictionary for JSON output. + - Ζ **validate** (`Function`) `[CRITICAL]` + - π Checks for semantic compliance based on TIER requirements. + - Ζ **get_score** (`Function`) + - π Calculates a compliance score (0.0 to 1.0) based on tier requirements. + - Ζ **get_patterns** (`Function`) + - π Returns regex patterns for a specific language. + - Ζ **extract_svelte_props** (`Function`) + - π Extracts props from Svelte component script section. + - Ζ **extract_svelte_events** (`Function`) + - π Extracts dispatched events from Svelte component. + - Ζ **extract_data_flow** (`Function`) + - π Extracts store subscriptions and data flow from Svelte component. + - Ζ **parse_file** (`Function`) `[CRITICAL]` + - π Parses a single file to extract semantic entities with tier awareness and enhanced Svelte analysis. + - π Invariant: Every opened anchor must have a matching closing anchor for valid compliance. + - β **SemanticMapGenerator** (`Class`) `[CRITICAL]` + - π Orchestrates the mapping process with tier-based validation. + - π Invariant: All entities are validated according to their TIER requirements. + - Ζ **__init__** (`Function`) + - π Initializes the generator with a root directory. + - Ζ **_load_gitignore** (`Function`) + - π Loads patterns from .gitignore file. + - Ζ **_is_ignored** (`Function`) + - π Checks if a path should be ignored based on .gitignore or hardcoded defaults. + - Ζ **run** (`Function`) `[CRITICAL]` + - π Main execution flow. + - π CALLS -> `_walk_and_parse` + - π CALLS -> `_generate_artifacts` + - Ζ **_walk_and_parse** (`Function`) `[CRITICAL]` + - π Recursively walks directories and triggers parsing. + - Ζ **_process_file_results** (`Function`) + - π Validates entities and calculates file scores with tier awareness. + - Ζ **validate_recursive** (`Function`) + - π Calculate score and determine module's max tier for weighted global score + - Ζ **_generate_artifacts** (`Function`) `[CRITICAL]` + - π Writes output files with tier-based compliance data. + - Ζ **_generate_report** (`Function`) `[CRITICAL]` + - π Generates the Markdown compliance report with severity levels. + - Ζ **_collect_issues** (`Function`) + - π Helper to collect issues for a specific file from the entity tree. + - Ζ **_generate_compressed_map** (`Function`) `[CRITICAL]` + - π Generates the token-optimized project map with enhanced Svelte details. + - Ζ **_write_entity_md** (`Function`) `[CRITICAL]` + - π Recursive helper to write entity tree to Markdown with tier badges and enhanced details. + - Ζ **_generate_module_map** (`Function`) `[CRITICAL]` + - π Generates a module-centric map grouping entities by directory structure. + - Ζ **_get_module_path** (`Function`) + - π Extracts the module path from a file path. + - Ζ **_collect_all_entities** (`Function`) + - π Flattens entity tree for easier grouping. + - Ζ **to_dict** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **DashboardTypes** (`Module`) `[TRIVIAL]` + - π TypeScript interfaces for Dashboard entities + - ποΈ Layer: Domain +- π§© **Counter** (`Component`) `[TRIVIAL]` + - π Simple counter demo component + - ποΈ Layer: UI + - β‘οΈ WRITES_TO `state` +- π¦ **stores_module** (`Module`) + - π Global state management using Svelte stores. + - ποΈ Layer: UI-State + - π¦ **plugins** (`Data`) + - π Store for the list of available plugins. + - π¦ **tasks** (`Data`) + - π Store for the list of tasks. + - π¦ **selectedPlugin** (`Data`) + - π Store for the currently selected plugin. + - π¦ **selectedTask** (`Data`) + - π Store for the currently selected task. + - π¦ **currentPage** (`Data`) + - π Store for the current page. + - π¦ **taskLogs** (`Data`) + - π Store for the logs of the currently selected task. + - Ζ **fetchPlugins** (`Function`) + - π Fetches plugins from the API and updates the plugins store. + - Ζ **fetchTasks** (`Function`) + - π Fetches tasks from the API and updates the tasks store. +- π¦ **toasts_module** (`Module`) + - π Manages toast notifications using a Svelte writable store. + - ποΈ Layer: UI-State + - π¦ **toasts** (`Data`) + - π Writable store containing the list of active toasts. + - Ζ **addToast** (`Function`) + - π Adds a new toast message. + - Ζ **removeToast** (`Function`) + - π Removes a toast message by ID. +- π¦ **api_module** (`Module`) + - π Handles all communication with the backend API. + - ποΈ Layer: Infra-API + - Ζ **buildApiError** (`Function`) + - π Creates a normalized Error object for failed API responses. + - Ζ **notifyApiError** (`Function`) + - π Shows toast for API errors with explicit handling of critical statuses. + - Ζ **getWsUrl** (`Function`) + - π Returns the WebSocket URL for a specific task, with fallback logic. + - Ζ **getAuthHeaders** (`Function`) + - π Returns headers with Authorization if token exists. + - Ζ **fetchApi** (`Function`) + - π Generic GET request wrapper. + - Ζ **fetchApiBlob** (`Function`) + - π Generic GET wrapper for binary payloads. + - Ζ **postApi** (`Function`) + - π Generic POST request wrapper. + - Ζ **requestApi** (`Function`) + - π Generic request wrapper. + - π¦ **api** (`Data`) + - π API client object with specific methods. +- π¦ **Utils** (`Module`) `[TRIVIAL]` + - π General utility functions (class merging) + - ποΈ Layer: Infra + - Ζ **cn** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- ποΈ **authStore** (`Store`) + - π Manages the global authentication state on the frontend. + - ποΈ Layer: Feature + - π¦ **AuthState** (`Interface`) + - π Defines the structure of the authentication state. + - Ζ **createAuthStore** (`Function`) + - π Creates and configures the auth store with helper methods. + - Ζ **setToken** (`Function`) + - π Updates the store with a new JWT token. + - Ζ **setUser** (`Function`) + - π Sets the current user profile data. + - Ζ **logout** (`Function`) + - π Clears authentication state and storage. + - Ζ **setLoading** (`Function`) + - π Updates the loading state. +- π¦ **Debounce** (`Module`) `[TRIVIAL]` + - π Debounce utility for limiting function execution rate + - ποΈ Layer: Infra + - Ζ **debounce** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- ποΈ **assistantChat** (`Store`) + - π Control assistant chat panel visibility and active conversation binding. + - ποΈ Layer: UI + - π Invariant: conversationId persists while panel toggles unless explicitly reset. + - Ζ **toggleAssistantChat** (`Function`) + - π Toggle assistant panel visibility. + - Ζ **openAssistantChat** (`Function`) + - π Open assistant panel. + - Ζ **closeAssistantChat** (`Function`) + - π Close assistant panel. + - Ζ **setAssistantConversationId** (`Function`) + - π Bind current conversation id in UI state. +- ποΈ **taskDrawer** (`Store`) `[CRITICAL]` + - π Manage Task Drawer visibility and resource-to-task mapping + - ποΈ Layer: UI + - π Invariant: resourceTaskMap always reflects current task associations +- π¦ **taskDrawer** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/lib/stores/taskDrawer.js + - ποΈ Layer: Unknown + - Ζ **openDrawerForTask** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **openDrawer** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **closeDrawer** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **updateResourceTask** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **getTaskForResource** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- ποΈ **sidebar** (`Store`) + - π Manage sidebar visibility and navigation state + - ποΈ Layer: UI + - π Invariant: isExpanded state is always synced with localStorage +- π¦ **sidebar** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/lib/stores/sidebar.js + - ποΈ Layer: Unknown + - Ζ **toggleSidebar** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **setActiveItem** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **setMobileOpen** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **closeMobile** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **toggleMobileSidebar** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- ποΈ **environmentContext** (`Store`) + - π Global selected environment context for navigation and safety cues. + - ποΈ Layer: UI-State +- π¦ **environmentContext** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/lib/stores/environmentContext.js + - ποΈ Layer: Unknown + - Ζ **getStoredSelectedEnvId** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **persistSelectedEnvId** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **hasAuthToken** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **resolveSelectedEnvId** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **applySelectedEnvId** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **refreshEnvironmentContext** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **initializeEnvironmentContext** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **setSelectedEnvironment** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- ποΈ **activity** (`Store`) + - π Track active task count for navbar indicator + - ποΈ Layer: UI + - π DEPENDS_ON -> `WebSocket connection, taskDrawer store` +- π¦ **frontend.src.lib.stores.__tests__.test_sidebar** (`Module`) + - π Unit tests for sidebar store + - ποΈ Layer: UI +- π¦ **frontend.src.lib.stores.__tests__.sidebar** (`Module`) + - π Unit tests for sidebar store + - ποΈ Layer: Domain (Tests) + - π Invariant: Sidebar store transitions must be deterministic across desktop/mobile toggles. + - Ζ **test_sidebar_initial_state** (`Function`) + - π Verify initial sidebar store values when no persisted state is available. + - Ζ **test_toggleSidebar** (`Function`) + - π Verify desktop sidebar expansion toggles deterministically. + - Ζ **test_setActiveItem** (`Function`) + - Ζ **test_mobile_functions** (`Function`) +- π¦ **frontend.src.lib.stores.__tests__.test_activity** (`Module`) + - π Unit tests for activity store + - ποΈ Layer: UI + - π DEPENDS_ON -> `frontend.src.lib.stores.taskDrawer` +- π¦ **setupTests** (`Module`) + - π Global test setup with mocks for SvelteKit modules + - ποΈ Layer: UI +- π¦ **frontend.src.lib.stores.__tests__.test_taskDrawer** (`Module`) + - π Unit tests for task drawer store + - ποΈ Layer: UI + - π Invariant: Store state transitions remain deterministic for open/close and task-status mapping. +- π¦ **frontend.src.lib.stores.__tests__.assistantChat** (`Module`) + - π Validate assistant chat store visibility and conversation binding transitions. + - ποΈ Layer: UI Tests + - π Invariant: Each test starts from default closed state. + - π DEPENDS_ON -> `assistantChatStore` + - Ζ **assistantChatStore_tests** (`Function`) + - π Group store unit scenarios for assistant panel behavior. +- π¦ **navigation** (`Mock`) + - π Mock for $app/navigation in tests +- π¦ **stores** (`Mock`) + - π Mock for $app/stores in tests +- π¦ **environment** (`Mock`) + - π Mock for $app/environment in tests +- π¦ **mock_env_public** (`Module`) + - π Mock for $env/static/public SvelteKit module in vitest + - ποΈ Layer: UI (Tests) +- π¦ **frontend.src.lib.api.reports** (`Module`) `[CRITICAL]` + - π Wrapper-based reports API client for list/detail retrieval without direct native fetch usage. + - ποΈ Layer: Infra + - π Invariant: Uses existing api wrapper methods and returns structured errors for UI-state mapping. + - π DEPENDS_ON -> `[DEF:api_module]` + - Ζ **buildReportQueryString** (`Function`) + - π Build query string for reports list endpoint from filter options. + - Ζ **normalizeApiError** (`Function`) + - π Convert unknown API exceptions into deterministic UI-consumable error objects. + - Ζ **getReports** (`Function`) + - π Fetch unified report list using existing request wrapper. + - Ζ **getReportDetail** (`Function`) + - π Fetch one report detail by report_id. +- π¦ **frontend.src.lib.api.assistant** (`Module`) + - π API client wrapper for assistant chat, confirmation actions, and history retrieval. + - ποΈ Layer: Infra-API + - π Invariant: All assistant requests must use requestApi wrapper (no native fetch). + - π DEPENDS_ON -> `frontend.src.lib.api.api_module` + - Ζ **sendAssistantMessage** (`Function`) + - π Send a user message to assistant orchestrator endpoint. + - Ζ **confirmAssistantOperation** (`Function`) + - π Confirm a pending risky assistant operation. + - Ζ **cancelAssistantOperation** (`Function`) + - π Cancel a pending risky assistant operation. + - Ζ **getAssistantHistory** (`Function`) + - π Retrieve paginated assistant conversation history. + - Ζ **getAssistantConversations** (`Function`) + - π Retrieve paginated conversation list for assistant sidebar/history switcher. +- π¦ **frontend.src.lib.api.__tests__.reports_api** (`Module`) + - π Unit tests for reports API client functions: query string building, error normalization, and fetch wrappers. + - ποΈ Layer: Infra (Tests) + - π Invariant: Pure functions produce deterministic output. Async wrappers propagate structured errors. + - β **TestBuildReportQueryString** (`Class`) + - π Validate query string construction from filter options. + - β **TestNormalizeApiError** (`Class`) + - π Validate error normalization for UI-state mapping. + - β **TestGetReportsAsync** (`Class`) + - π Validate getReports and getReportDetail with mocked api.fetchApi. +- π§© **Select** (`Component`) `[TRIVIAL]` + - π Standardized dropdown selection component. + - ποΈ Layer: Atom + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `bindable` + - β‘οΈ WRITES_TO `props` +- π¦ **ui** (`Module`) `[TRIVIAL]` + - π Central export point for standardized UI components. + - ποΈ Layer: Atom + - π Invariant: All components exported here must follow Semantic Protocol. +- π§© **PageHeader** (`Component`) `[TRIVIAL]` + - π Standardized page header with title and action area. + - ποΈ Layer: Atom + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `props` +- π§© **Card** (`Component`) `[TRIVIAL]` + - π Standardized container with padding and elevation. + - ποΈ Layer: Atom + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `props` +- π§© **Button** (`Component`) `[TRIVIAL]` + - π Define component interface and default values (Svelte 5 Runes). + - ποΈ Layer: Atom + - π Invariant: Supports accessible labels and keyboard navigation. + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `props` +- π§© **Input** (`Component`) `[TRIVIAL]` + - π Standardized text input component with label and error handling. + - ποΈ Layer: Atom + - π Invariant: Consistent spacing and focus states. + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `bindable` + - β‘οΈ WRITES_TO `props` +- π§© **LanguageSwitcher** (`Component`) `[TRIVIAL]` + - π Dropdown component to switch between supported languages. + - ποΈ Layer: Atom + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `locale` +- π¦ **i18n** (`Module`) + - π Determines the starting locale. + - ποΈ Layer: Infra + - π Invariant: Persistence is handled via LocalStorage. + - π DEPENDS_ON -> `locales/ru.json` + - π DEPENDS_ON -> `locales/en.json` + - ποΈ **locale** (`Store`) + - π Holds the current active locale string. + - ποΈ **t** (`Store`) + - π Derived store providing the translation dictionary. + - Ζ **_** (`Function`) + - π Get translation by key path. +- π§© **AssistantChatPanel** (`Component`) `[CRITICAL]` + - π Slide-out assistant chat panel for natural language command execution and task tracking. + - ποΈ Layer: UI + - π Invariant: Risky operations are executed only through explicit confirm action. + - β¬ οΈ READS_FROM `app` + - β¬ οΈ READS_FROM `lib` + - β¬ οΈ READS_FROM `assistantChatStore` + - Ζ **loadHistory** (`Function`) + - π Load current conversation history when panel becomes visible. + - Ζ **loadConversations** (`Function`) + - π Load paginated conversation summaries for quick switching UI. + - Ζ **loadOlderMessages** (`Function`) + - π Lazy-load older messages for active conversation when user scrolls to top. + - Ζ **appendLocalUserMessage** (`Function`) + - π Add optimistic local user message before backend response. + - Ζ **appendAssistantResponse** (`Function`) + - π Normalize and append assistant response payload to chat list. + - Ζ **handleSend** (`Function`) + - π Submit user command to assistant orchestration API. + - Ζ **selectConversation** (`Function`) + - π Switch active chat context to selected conversation item. + - Ζ **startNewConversation** (`Function`) + - π Create local empty chat context that will be persisted on first message. + - Ζ **handleAction** (`Function`) + - π Execute assistant action button behavior (open task/reports, confirm, cancel). + - Ζ **handleKeydown** (`Function`) + - π Submit command by Enter while preserving multiline input with Shift+Enter. + - Ζ **stateClass** (`Function`) + - π Map assistant state to visual badge style class. + - Ζ **handleHistoryScroll** (`Function`) + - π Trigger lazy history fetch when user scroll reaches top boundary. +- π¦ **AssistantChatPanel** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/lib/components/assistant/AssistantChatPanel.svelte + - ποΈ Layer: Unknown + - Ζ **buildConversationTitle** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **setConversationFilter** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **formatConversationTime** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **loadLlmStatus** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **frontend.src.lib.components.assistant.__tests__.assistant_chat_integration** (`Module`) + - π Contract-level integration checks for assistant chat panel implementation and localization wiring. + - ποΈ Layer: UI Tests + - π Invariant: Critical assistant UX states and action hooks remain present in component source. + - Ζ **readJson** (`Function`) + - π Read and parse JSON fixture file from disk. + - Ζ **assistant_chat_contract_tests** (`Function`) + - π Validate assistant chat component contract and locale integration without DOM runtime dependency. +- π§© **ReportCard** (`Component`) `[CRITICAL]` + - π Render one report with explicit textual type label and profile-driven visual variant. + - ποΈ Layer: UI + - π Invariant: Unknown task type always uses fallback profile. + - β‘ Events: select + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `derived` +- π¦ **ReportCard** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/lib/components/reports/ReportCard.svelte + - ποΈ Layer: Unknown + - Ζ **getStatusClass** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **getStatusLabel** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **formatDate** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **onSelect** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π§© **ReportsList** (`Component`) `[CRITICAL]` + - π Render unified list of normalized reports with canonical minimum fields. + - ποΈ Layer: UI + - π Invariant: Every rendered row shows task_type label, status, summary, and updated_at. + - β‘ Events: select + - β‘οΈ WRITES_TO `props` +- π¦ **ReportsList** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/lib/components/reports/ReportsList.svelte + - ποΈ Layer: Unknown + - Ζ **handleSelect** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **frontend.src.lib.components.reports.reportTypeProfiles** (`Module`) `[CRITICAL]` + - π Deterministic mapping from report task_type to visual profile with one fallback. + - ποΈ Layer: UI + - π Invariant: Unknown type always resolves to fallback profile. + - π DEPENDS_ON -> `frontend/src/lib/i18n/index.ts` + - Ζ **getReportTypeProfile** (`Function`) + - π Resolve visual profile by task type with guaranteed fallback. +- π§© **ReportDetailPanel** (`Component`) `[CRITICAL]` + - π Display detailed report context with diagnostics and actionable recovery guidance. + - ποΈ Layer: UI + - π Invariant: Failed/partial reports surface actionable hints when available. + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `props` + - β¬ οΈ READS_FROM `t` +- π¦ **ReportDetailPanel** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/lib/components/reports/ReportDetailPanel.svelte + - ποΈ Layer: Unknown + - Ζ **notProvided** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **formatDate** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **frontend.src.lib.components.reports.__tests__.reports_filter_performance** (`Module`) + - π Guard test for report filter responsiveness on moderate in-memory dataset. + - ποΈ Layer: UI (Tests) + - Ζ **applyFilters** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **makeDataset** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **frontend.src.lib.components.reports.__tests__.reports_page.integration** (`Module`) + - π Integration-style checks for unified mixed-type reports rendering expectations. + - ποΈ Layer: UI (Tests) + - π Invariant: Mixed fixture includes all supported report types in one list. + - Ζ **collectVisibleTypeLabels** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **frontend.src.lib.components.reports.__tests__.report_type_profiles** (`Module`) + - π Validate report type profile mapping and unknown fallback behavior. + - ποΈ Layer: UI (Tests) + - π Invariant: Unknown task_type always resolves to the fallback profile. +- π¦ **frontend.src.lib.components.reports.__tests__.report_card.ux** (`Module`) + - π Test UX states and transitions for ReportCard component + - ποΈ Layer: UI + - π Invariant: Each test asserts at least one observable UX contract outcome. +- π¦ **frontend.src.lib.components.reports.__tests__.report_detail.ux** (`Module`) + - π Test UX states and recovery for ReportDetailPanel component + - ποΈ Layer: UI + - π Invariant: Detail UX tests keep placeholder-safe rendering and recovery visibility verifiable. +- π¦ **frontend.src.lib.components.reports.__tests__.report_detail.integration** (`Module`) + - π Validate detail-panel behavior for failed reports and recovery guidance visibility. + - ποΈ Layer: UI (Tests) + - π Invariant: Failed report detail exposes actionable next actions when available. + - Ζ **buildFailedDetailFixture** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **reports.fixtures** (`Module`) + - π Shared frontend fixtures for unified reports states. + - ποΈ Layer: UI +- π§© **Sidebar** (`Component`) `[CRITICAL]` + - π Persistent left sidebar with resource categories navigation + - ποΈ Layer: UI + - π Invariant: Always shows active category and item + - β¬ οΈ READS_FROM `app` + - β¬ οΈ READS_FROM `lib` + - β¬ οΈ READS_FROM `t` +- π¦ **Sidebar** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/lib/components/layout/Sidebar.svelte + - ποΈ Layer: Unknown + - Ζ **buildCategories** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleItemClick** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleCategoryToggle** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleSubItemClick** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleToggleClick** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleOverlayClick** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π§© **TopNavbar** (`Component`) `[CRITICAL]` + - π Unified top navigation bar with Logo, Search, Activity, and User menu + - ποΈ Layer: UI + - π Invariant: Always visible on non-login pages + - β‘ Events: activityClick + - β¬ οΈ READS_FROM `app` + - β¬ οΈ READS_FROM `lib` + - β¬ οΈ READS_FROM `sidebarStore` +- π¦ **TopNavbar** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/lib/components/layout/TopNavbar.svelte + - ποΈ Layer: Unknown + - Ζ **toggleUserMenu** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **closeUserMenu** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleLogout** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleActivityClick** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleAssistantClick** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleSearchFocus** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **clearSearchState** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleDocumentClick** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleHamburgerClick** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleGlobalEnvironmentChange** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **buildSearchResultSections** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **triggerSearch** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleSearchInput** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **openSearchResult** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleSearchKeydown** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π§© **Breadcrumbs** (`Component`) + - π Display page hierarchy navigation + - ποΈ Layer: UI + - π Invariant: Always shows current page path + - β¬ οΈ READS_FROM `app` + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `props` +- π¦ **Breadcrumbs** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/lib/components/layout/Breadcrumbs.svelte + - ποΈ Layer: Unknown + - Ζ **getBreadcrumbs** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **formatBreadcrumbLabel** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **getCrumbMeta** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π§© **TaskDrawer** (`Component`) `[CRITICAL]` + - π Global task drawer for monitoring background operations + - ποΈ Layer: UI + - π Invariant: Drawer shows logs for active task or remains closed + - β¬ οΈ READS_FROM `lib` + - β¬ οΈ READS_FROM `taskDrawerStore` + - β‘οΈ WRITES_TO `taskDrawerStore` + - Ζ **disconnectWebSocket** (`Function`) + - π Disconnects the active WebSocket connection + - Ζ **loadRecentTasks** (`Function`) + - π Load recent tasks for list mode display + - Ζ **selectTask** (`Function`) + - π Select a task from list to view details + - Ζ **goBackToList** (`Function`) + - π Return to task list view from task details +- π¦ **TaskDrawer** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/lib/components/layout/TaskDrawer.svelte + - ποΈ Layer: Unknown + - Ζ **handleClose** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **goToReportsPage** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleGlobalKeydown** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **normalizeTaskId** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **isTaskFinished** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **resolveLlmValidationStatus** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **llmValidationBadgeClass** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **stopTaskDetailsPolling** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **loadEnvironmentOptions** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **resolveEnvironmentName** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **resolveEnvironmentId** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **loadActiveTaskDetails** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **extractPrimaryDashboardId** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **buildTaskSummary** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleOpenDashboardDeepLink** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleShowDiff** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleOpenLlmReport** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **connectWebSocket** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **test_breadcrumbs.svelte** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/lib/components/layout/__tests__/test_breadcrumbs.svelte.js + - ποΈ Layer: Unknown + - Ζ **getBreadcrumbs** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **formatBreadcrumbLabel** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **ErrorPage** (`Page`) + - π Global error page displaying HTTP status and messages + - ποΈ Layer: UI +- π¦ **RootLayoutConfig** (`Module`) `[TRIVIAL]` + - π Root layout configuration (SPA mode) + - ποΈ Layer: Infra +- π¦ **HomePage** (`Page`) `[CRITICAL]` + - π Redirect to Dashboard Hub as per UX requirements + - ποΈ Layer: UI + - π Invariant: Always redirects to /dashboards +- Ζ **load** (`Function`) + - π Loads initial plugin data for the dashboard. +- π¦ **layout** (`Module`) + - π Bind global layout shell and conditional login/full-app rendering. + - ποΈ Layer: UI + - π Invariant: Login route bypasses shell; all other routes are wrapped by ProtectedRoute. +- π¦ **DatasetHub** (`Page`) `[CRITICAL]` + - π Dataset Hub - Dedicated hub for datasets with mapping progress + - ποΈ Layer: UI + - π Invariant: Always shows datasets for the active environment from context store +- π¦ **+page** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/routes/datasets/+page.svelte + - ποΈ Layer: Unknown + - Ζ **loadDatasets** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleSearch** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handlePageChange** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handlePageSizeChange** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **updateSelectionState** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleCheckboxChange** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleSelectAll** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleSelectVisible** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleAction** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleBulkMapColumns** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleBulkGenerateDocs** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleTaskStatusClick** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **getTaskStatusIcon** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **getMappingProgressClass** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **DatasetDetail** (`Page`) `[CRITICAL]` + - π Dataset Detail View - Shows detailed dataset information with columns, SQL, and linked dashboards + - ποΈ Layer: UI + - π Invariant: Always shows dataset details when loaded +- π¦ **+page** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/routes/datasets/[id]/+page.svelte + - ποΈ Layer: Unknown + - Ζ **loadDatasetDetail** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **navigateToDashboard** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **goBack** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **getColumnTypeClass** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **getMappingProgress** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π§© **UnifiedReportsPage** (`Component`) `[CRITICAL]` + - π Unified reports page with filtering and resilient UX states for mixed task types. + - ποΈ Layer: UI + - π Invariant: List state remains deterministic for active filter set. + - β¬ οΈ READS_FROM `lib` + - β¬ οΈ READS_FROM `t` + - β‘οΈ WRITES_TO `t` +- π¦ **+page** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/routes/reports/+page.svelte + - ποΈ Layer: Unknown + - Ζ **buildQuery** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **loadReports** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **hasActiveFilters** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **clearFilters** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **onFilterChange** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **onSelectReport** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **+page** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/routes/reports/llm/[taskId]/+page.svelte + - ποΈ Layer: Unknown + - Ζ **formatDate** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **formatMs** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **getDashboardCheckResult** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **getCheckResultClasses** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **loadReport** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **backToReports** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **openTaskDetails** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π§© **LoginPage** (`Component`) + - π Provides the user interface for local and ADFS authentication. + - ποΈ Layer: UI + - π Invariant: Shows both local login form and ADFS SSO button. + - β¬ οΈ READS_FROM `app` + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `t` + - Ζ **handleLogin** (`Function`) + - π Submits the local login form to the backend. + - Ζ **handleADFSLogin** (`Function`) + - π Redirects the user to the ADFS login endpoint. +- π¦ **StorageIndexPage** (`Page`) `[TRIVIAL]` + - π Redirect to the backups page as the default storage view. + - ποΈ Layer: Page + - π Invariant: Always redirects to /storage/backups. +- π¦ **StorageReposPage** (`Page`) + - Ζ **fetchEnvironments** (`Function`) + - π Fetches the list of available environments. + - Ζ **fetchDashboards** (`Function`) + - π Fetches dashboards for a specific environment. +- π¦ **DashboardHub** (`Page`) `[CRITICAL]` + - π Dashboard Hub - Central hub for managing dashboards with Git status and task actions + - ποΈ Layer: UI + - π Invariant: Always shows dashboards for the active environment from context store +- π¦ **+page** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/routes/dashboards/+page.svelte + - ποΈ Layer: Unknown + - Ζ **handleDocumentClick** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **loadDashboards** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleSearch** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handlePageChange** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handlePageSizeChange** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **updateSelectionState** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleCheckboxChange** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleSelectAll** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleSelectVisible** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **toggleActionDropdown** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **closeActionDropdown** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleAction** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleValidate** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleTargetEnvChange** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **loadDatabases** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleMappingUpdate** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **loadDbMappings** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleBulkMigrate** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleBulkBackup** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleTaskStatusClick** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **navigateToDashboardDetail** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **getStatusBadgeClass** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **isGitBusy** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **setGitBusy** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **ensureGitConfigs** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **updateDashboardGitState** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **refreshDashboardGitState** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleGitInit** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleGitSync** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleGitCommit** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleGitPull** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleGitPush** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **getTaskStatusIcon** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **getPaginationRange** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **DashboardDetail** (`Page`) `[CRITICAL]` + - π Dashboard Detail View - Overview of charts and datasets linked to a dashboard + - ποΈ Layer: UI + - π Invariant: Shows dashboard metadata, charts, and datasets for selected environment +- π¦ **+page** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/routes/dashboards/[id]/+page.svelte + - ποΈ Layer: Unknown + - Ζ **loadDashboardPage** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **loadDashboardDetail** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **loadTaskHistory** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **releaseThumbnailUrl** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **loadThumbnail** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **runBackupTask** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **runLlmValidationTask** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **openLlmReport** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **toTaskTypeLabel** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **getTaskStatusClasses** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **getValidationStatus** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **getValidationStatusClasses** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **goBack** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **openDataset** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **formatDate** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **loadLlmStatus** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π§© **AdminRolesPage** (`Component`) + - π UI for managing system roles and their permissions. + - ποΈ Layer: Domain + - π Invariant: Only accessible by users with Admin role. + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `t` + - β¬ οΈ READS_FROM `t` + - Ζ **loadData** (`Function`) + - π Fetches roles and available permissions. + - Ζ **openCreateModal** (`Function`) + - π Initializes state for creating a new role. + - Ζ **openEditModal** (`Function`) + - π Initializes state for editing an existing role. + - Ζ **handleSaveRole** (`Function`) + - π Submits role data (create or update). + - Ζ **handleDeleteRole** (`Function`) + - π Deletes a role after confirmation. +- π§© **AdminUsersPage** (`Component`) + - π UI for managing system users and their roles. + - ποΈ Layer: Feature + - π Invariant: Only accessible by users with "admin:users" permission. + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `t` + - β¬ οΈ READS_FROM `t` + - Ζ **loadData** (`Function`) + - π Fetches users and roles from the backend. + - Ζ **openCreateModal** (`Function`) + - π Prepares the form for creating a new user. + - Ζ **openEditModal** (`Function`) + - π Prepares the form for editing an existing user. + - Ζ **handleSaveUser** (`Function`) + - π Submits user data to the backend (create or update). + - Ζ **handleDeleteUser** (`Function`) + - π Deletes a user after confirmation. +- π§© **AdminSettingsPage** (`Component`) + - π UI for configuring Active Directory Group to local Role mappings for ADFS SSO and logging settings. + - ποΈ Layer: Feature + - π Invariant: Only accessible by users with "admin:settings" permission. + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `t` + - β¬ οΈ READS_FROM `t` + - Ζ **loadData** (`Function`) + - π Fetches AD mappings and roles from the backend to populate the UI. + - Ζ **handleCreateMapping** (`Function`) + - π Submits a new AD Group to Role mapping to the backend. + - Ζ **loadLoggingConfig** (`Function`) + - π Fetches current logging configuration from the backend. + - Ζ **saveLoggingConfig** (`Function`) + - π Saves logging configuration to the backend. +- π§© **LLMSettingsPage** (`Component`) + - π Admin settings page for LLM provider configuration. + - ποΈ Layer: UI + - β¬ οΈ READS_FROM `t` + - β‘οΈ WRITES_TO `t` +- π¦ **+page** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/routes/admin/settings/llm/+page.svelte + - ποΈ Layer: Unknown + - Ζ **isMultimodalModel** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **getProviderById** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **fetchProviders** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **saveSettings** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π§© **MigrationDashboard** (`Component`) + - π Main dashboard for configuring and starting migrations. + - ποΈ Layer: Page + - π Invariant: Migration cannot start without source and target environments. + - β¬ οΈ READS_FROM `lib` + - β¬ οΈ READS_FROM `selectedTask` + - β‘οΈ WRITES_TO `selectedTask` + - Ζ **fetchEnvironments** (`Function`) + - π Fetches the list of environments from the API. + - Ζ **fetchDashboards** (`Function`) + - π Fetches dashboards for the selected source environment. + - Ζ **fetchDatabases** (`Function`) + - π Fetches databases from both environments and gets suggestions. + - Ζ **handleMappingUpdate** (`Function`) + - π Saves a mapping to the backend. + - Ζ **handleViewLogs** (`Function`) + - π Opens the log viewer for a specific task. + - Ζ **handlePasswordPrompt** (`Function`) + - π Reactive logic to show password prompt when a task is awaiting input. + - Ζ **handleResumeMigration** (`Function`) + - π Resumes a migration task with provided passwords. + - Ζ **startMigration** (`Function`) + - π Starts the migration process. + - π§© **DashboardSelectionSection** (`Component`) +- π§© **MappingManagement** (`Component`) + - π Page for managing database mappings between environments. + - ποΈ Layer: Page + - π Invariant: Mappings are saved to the backend for persistence. + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `t` + - β¬ οΈ READS_FROM `t` + - Ζ **fetchEnvironments** (`Function`) + - π Fetches the list of environments. + - Ζ **fetchDatabases** (`Function`) + - π Fetches databases from both environments and gets suggestions. + - Ζ **handleUpdate** (`Function`) + - π Saves a mapping to the backend. +- π§© **StoragePage** (`Component`) + - π Main page for file storage management. + - ποΈ Layer: UI + - π Invariant: Always displays tabs for Backups and Repositories. + - β¬ οΈ READS_FROM `app` + - β¬ οΈ READS_FROM `t` + - β‘οΈ WRITES_TO `page` + - Ζ **loadFiles** (`Function`) + - π Fetches the list of files from the server. + - Ζ **handleDelete** (`Function`) + - π Handles the file deletion process. + - Ζ **handleNavigate** (`Function`) + - π Updates the current path and reloads files when navigating into a directory. + - Ζ **navigateUp** (`Function`) + - π Navigates one level up in the directory structure. +- π§© **MapperPage** (`Component`) `[TRIVIAL]` + - π Page for the dataset column mapper tool. + - ποΈ Layer: UI + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `t` +- π§© **DebugPage** (`Component`) `[TRIVIAL]` + - π Page for system diagnostics and debugging. + - ποΈ Layer: UI + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `t` +- π¦ **SettingsPage** (`Page`) `[CRITICAL]` + - π Consolidated Settings Page - All settings in one place with tabbed navigation + - ποΈ Layer: UI + - π Invariant: Always shows tabbed interface with all settings categories +- π¦ **+page** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/routes/settings/+page.svelte + - ποΈ Layer: Unknown + - Ζ **normalizeTab** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **readTabFromUrl** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **writeTabToUrl** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **loadSettings** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **normalizeLlmSettings** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **isMultimodalModel** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **getProviderById** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **isDashboardValidationBindingValid** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleTabChange** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **loadMigrationSettings** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **loadMappingsPage** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **onMappingsSearchInput** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **onMappingsFilterChange** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **goToMappingsPage** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **saveMigrationSettings** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **triggerSyncNow** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleSave** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleTestEnv** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **editEnv** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **resetEnvForm** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleAddOrUpdateEnv** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleDeleteEnv** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- Ζ **load** (`Function`) + - π Loads application settings and environment list. +- π§© **ConnectionsSettingsPage** (`Component`) + - π Page for managing database connection configurations. + - ποΈ Layer: UI + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `t` + - Ζ **handleSuccess** (`Function`) + - π Refreshes the connection list after a successful creation. +- π§© **GitSettingsPage** (`Component`) + - π Manage Git server configurations for dashboard versioning. + - ποΈ Layer: Page + - π Invariant: All configurations must be validated via connection test. + - β¬ οΈ READS_FROM `lib` + - β¬ οΈ READS_FROM `t` + - β‘οΈ WRITES_TO `t` + - Ζ **loadConfigs** (`Function`) + - π Fetches existing git configurations. + - Ζ **handleTest** (`Function`) + - π Tests connection to a git server with current form data. + - Ζ **handleSave** (`Function`) + - π Saves a new git configuration. + - Ζ **handleDelete** (`Function`) + - π Deletes a git configuration by ID. +- π§© **GitDashboardPage** (`Component`) + - π Dashboard management page for Git integration. + - ποΈ Layer: Page + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `environmentContextStore` + - β¬ οΈ READS_FROM `environmentContextStore` + - Ζ **fetchEnvironments** (`Function`) + - π Fetches the list of deployment environments from the API. + - Ζ **fetchDashboards** (`Function`) + - π Fetches dashboards for a specific environment. +- π§© **Dashboard** (`Component`) + - π Displays the list of available plugins and allows selecting one. + - ποΈ Layer: UI + - β¬ οΈ READS_FROM `plugins` + - Ζ **onMount** (`Function`) + - π Fetch plugins when the component mounts. + - Ζ **selectPlugin** (`Function`) + - π Selects a plugin to display its form. +- π§© **Settings** (`Component`) + - π The main settings page for the application, allowing management of environments and global settings. + - ποΈ Layer: UI + - π Invariant: Settings changes must be saved to the backend. + - β¬ οΈ READS_FROM `t` + - β‘οΈ WRITES_TO `t` + - Ζ **loadSettings** (`Function`) + - π Loads settings from the backend. + - Ζ **handleSaveGlobal** (`Function`) + - π Saves global settings to the backend. + - Ζ **handleAddOrUpdateEnv** (`Function`) + - π Adds or updates an environment. + - Ζ **handleDeleteEnv** (`Function`) + - π Deletes an environment. + - Ζ **handleTestEnv** (`Function`) + - π Tests the connection to an environment. + - Ζ **editEnv** (`Function`) + - π Sets the form to edit an existing environment. + - Ζ **resetEnvForm** (`Function`) + - π Resets the environment form. +- Ζ **getConnections** (`Function`) + - π Fetch a list of saved connections. +- Ζ **createConnection** (`Function`) + - π Create a new connection configuration. +- Ζ **deleteConnection** (`Function`) + - π Delete a connection configuration. +- π¦ **GitServiceClient** (`Module`) + - π API client for Git operations, managing the communication between frontend and backend. + - ποΈ Layer: Service + - π¦ **gitService** (`Action`) + - π Retrieves the diff for specific files or the whole repository. +- Ζ **runTask** (`Function`) + - π Start a new task for a given plugin. +- Ζ **getTaskStatus** (`Function`) + - π Fetch details for a specific task (to poll status or get result). +- π¦ **adminService** (`Module`) + - π Service for Admin-related API calls (User and Role management). + - ποΈ Layer: Service + - π Invariant: All requests must include valid Admin JWT token (handled by api client). + - π DEPENDS_ON -> `frontend.src.lib.api` + - Ζ **getUsers** (`Function`) + - π Fetches all registered users from the backend. + - Ζ **createUser** (`Function`) + - π Creates a new local user. + - Ζ **getRoles** (`Function`) + - π Fetches all available system roles. + - Ζ **getADGroupMappings** (`Function`) + - π Fetches mappings between AD groups and local roles. + - Ζ **createADGroupMapping** (`Function`) + - π Creates or updates an AD group to Role mapping. + - Ζ **updateUser** (`Function`) + - π Updates an existing user. + - Ζ **deleteUser** (`Function`) + - π Deletes a user. + - Ζ **createRole** (`Function`) + - π Creates a new role. + - Ζ **updateRole** (`Function`) + - π Updates an existing role. + - Ζ **deleteRole** (`Function`) + - π Deletes a role. + - Ζ **getPermissions** (`Function`) + - π Fetches all available permissions. + - Ζ **getLoggingConfig** (`Function`) + - π Fetches current logging configuration. + - Ζ **updateLoggingConfig** (`Function`) + - π Updates logging configuration. +- Ζ **getTasks** (`Function`) + - π Fetch a list of tasks with pagination and optional status filter. +- Ζ **getTask** (`Function`) + - π Fetch details for a specific task. +- Ζ **getTaskLogs** (`Function`) + - π Fetch logs for a specific task. +- Ζ **resumeTask** (`Function`) + - π Resume a task that is awaiting input (e.g., passwords). +- Ζ **resolveTask** (`Function`) + - π Resolve a task that is awaiting mapping. +- Ζ **clearTasks** (`Function`) + - π Clear tasks based on status. +- π¦ **storageService** (`Module`) + - π Frontend API client for file storage management. + - ποΈ Layer: Service + - Ζ **getStorageAuthHeaders** (`Function`) + - π Returns headers with Authorization for storage API calls. + - Ζ **listFiles** (`Function`) + - π Fetches the list of files for a given category and subpath. + - Ζ **uploadFile** (`Function`) + - π Uploads a file to the storage system. + - Ζ **deleteFile** (`Function`) + - π Deletes a file or directory from storage. + - Ζ **downloadFileUrl** (`Function`) + - π Returns the URL for downloading a file. +- π§© **PasswordPrompt** (`Component`) + - π A modal component to prompt the user for database passwords when a migration task is paused. + - ποΈ Layer: UI + - β‘ Events: cancel, resume + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `state` + - β¬ οΈ READS_FROM `effect` + - Ζ **handleSubmit** (`Function`) + - π Validates and dispatches the passwords to resume the task. + - Ζ **handleCancel** (`Function`) + - π Cancels the password prompt. +- π§© **MappingTable** (`Component`) + - π Displays and allows editing of database mappings. + - ποΈ Layer: Feature + - π Invariant: Each source database can be mapped to one target database. + - β‘ Events: update + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `t` + - Ζ **updateMapping** (`Function`) + - π Updates a mapping for a specific source database. + - Ζ **getSuggestion** (`Function`) + - π Finds a suggestion for a source database. +- π§© **TaskLogViewer** (`Component`) `[CRITICAL]` + - π Displays detailed logs for a specific task inline or in a modal using TaskLogPanel. + - ποΈ Layer: UI + - π Invariant: Real-time logs are always appended without duplicates. + - β‘ Events: close + - β‘οΈ WRITES_TO `bindable` + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `state` + - π¦ **handleRealTimeLogs** (`Action`) + - π Sync real-time logs to the current log list + - Ζ **fetchLogs** (`Function`) + - π Fetches logs for a given task ID + - Ζ **handleFilterChange** (`Function`) + - π Updates filter conditions for the log viewer + - Ζ **handleRefresh** (`Function`) + - π Refreshes the logs by polling the API + - π§© **showInline** (`Component`) + - π Shows inline logs --> + - ποΈ Layer: UI --> + - π§© **showModal** (`Component`) + - π Shows modal logs --> + - ποΈ Layer: UI --> +- π§© **Footer** (`Component`) `[TRIVIAL]` + - π Displays the application footer with copyright information. + - ποΈ Layer: UI +- π§© **MissingMappingModal** (`Component`) + - π Prompts the user to provide a database mapping when one is missing during migration. + - ποΈ Layer: Feature + - π Invariant: Modal blocks migration progress until resolved or cancelled. + - β‘ Events: cancel, resolve + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `state` + - Ζ **resolve** (`Function`) + - π Dispatches the resolution event with the selected mapping. + - Ζ **cancel** (`Function`) + - π Cancels the mapping resolution modal. +- π§© **DashboardGrid** (`Component`) + - π Displays a grid of dashboards with selection and pagination. + - ποΈ Layer: Component + - π Invariant: Selected IDs must be a subset of available dashboards. + - β‘ Events: selectionChanged + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `state` + - β‘οΈ WRITES_TO `derived` + - Ζ **handleValidate** (`Function`) + - π Triggers dashboard validation task. + - Ζ **handleSort** (`Function`) + - π Toggles sort direction or changes sort column. + - Ζ **handleSelectionChange** (`Function`) + - π Handles individual checkbox changes. + - Ζ **handleSelectAll** (`Function`) + - π Handles select all checkbox. + - Ζ **goToPage** (`Function`) + - π Changes current page. + - Ζ **openGit** (`Function`) + - π Opens the Git management modal for a dashboard. +- π§© **Navbar** (`Component`) + - π Main navigation bar for the application. + - ποΈ Layer: UI + - β¬ οΈ READS_FROM `app` + - β¬ οΈ READS_FROM `lib` + - β‘οΈ WRITES_TO `page` +- π¦ **Navbar** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/components/Navbar.svelte + - ποΈ Layer: Unknown + - Ζ **handleLogout** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π§© **TaskHistory** (`Component`) + - π Displays a list of recent tasks with their status and allows selecting them for viewing logs. + - ποΈ Layer: UI + - β¬ οΈ READS_FROM `selectedTask` + - β‘οΈ WRITES_TO `selectedTask` + - β¬ οΈ READS_FROM `t` + - Ζ **fetchTasks** (`Function`) + - π Fetches the list of recent tasks from the API. + - Ζ **clearTasks** (`Function`) + - π Clears tasks from the history, optionally filtered by status. + - Ζ **selectTask** (`Function`) + - π Selects a task and fetches its full details. + - Ζ **getStatusColor** (`Function`) + - π Returns the CSS color class for a given task status. + - Ζ **onMount** (`Function`) + - π Initializes the component by fetching tasks and starting polling. + - Ζ **onDestroy** (`Function`) + - π Cleans up the polling interval when the component is destroyed. +- π§© **Toast** (`Component`) `[TRIVIAL]` + - π Displays transient notifications (toasts) in the bottom-right corner. + - ποΈ Layer: UI + - β¬ οΈ READS_FROM `toasts` +- π§© **TaskRunner** (`Component`) + - π Connects to a WebSocket to display real-time logs for a running task with filtering support. + - ποΈ Layer: UI + - β¬ οΈ READS_FROM `t` + - β¬ οΈ READS_FROM `selectedTask` + - β‘οΈ WRITES_TO `t` + - Ζ **connect** (`Function`) + - π Establishes WebSocket connection with exponential backoff and filter parameters. + - Ζ **handleFilterChange** (`Function`) + - π Handles filter changes and reconnects WebSocket with new parameters. + - Ζ **fetchTargetDatabases** (`Function`) + - π Fetches available databases from target environment for mapping. + - Ζ **handleMappingResolve** (`Function`) + - π Resolves missing database mapping and continues migration. + - Ζ **handlePasswordResume** (`Function`) + - π Submits passwords and resumes paused migration task. + - Ζ **startDataTimeout** (`Function`) + - π Starts timeout timer to detect idle connection. + - Ζ **resetDataTimeout** (`Function`) + - π Resets data timeout timer when new data arrives. + - Ζ **onMount** (`Function`) + - π Initializes WebSocket connection when component mounts. + - Ζ **onDestroy** (`Function`) +- π§© **TaskList** (`Component`) + - π Displays a list of tasks with their status and execution details. + - ποΈ Layer: Component + - β‘ Events: select + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `t` + - β¬ οΈ READS_FROM `t` + - Ζ **getStatusColor** (`Function`) + - π Returns the CSS color class for a given task status. + - Ζ **formatTime** (`Function`) + - π Formats a date string using date-fns. + - Ζ **handleTaskClick** (`Function`) + - π Dispatches a select event when a task is clicked. +- π§© **DynamicForm** (`Component`) + - π Generates a form dynamically based on a JSON schema. + - ποΈ Layer: UI + - β‘ Events: submit + - β‘οΈ WRITES_TO `props` + - Ζ **handleSubmit** (`Function`) + - π Dispatches the submit event with the form data. + - Ζ **initializeForm** (`Function`) + - π Initialize form data with default values from the schema. +- π§© **EnvSelector** (`Component`) + - π Provides a UI component for selecting source and target environments. + - ποΈ Layer: Feature + - π Invariant: Source and target environments must be selectable from the list of configured environments. + - β‘ Events: change + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `t` + - Ζ **handleSelect** (`Function`) + - π Dispatches the selection change event. +- π§© **ProtectedRoute** (`Component`) `[TRIVIAL]` + - π Wraps content to ensure only authenticated users can access it. + - ποΈ Layer: Component + - π Invariant: Redirects to /login if user is not authenticated. + - β¬ οΈ READS_FROM `app` + - β¬ οΈ READS_FROM `auth` +- π§© **TaskLogPanel** (`Component`) + - π Combines log filtering and display into a single cohesive dark-themed panel. + - ποΈ Layer: UI + - π Invariant: Must always display logs in chronological order and respect auto-scroll preference. + - β‘ Events: filterChange + - β‘οΈ WRITES_TO `bindable` + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `state` +- π¦ **TaskLogPanel** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/components/tasks/TaskLogPanel.svelte + - ποΈ Layer: Unknown + - Ζ **filterLogs** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleFilterChange** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **scrollToBottom** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **toggleAutoScroll** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π§© **LogFilterBar** (`Component`) + - π Compact filter toolbar for logs β level, source, and text search in a single dense row. + - ποΈ Layer: UI + - β‘οΈ WRITES_TO `bindable` + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `derived` +- π¦ **LogFilterBar** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/components/tasks/LogFilterBar.svelte + - ποΈ Layer: Unknown + - Ζ **handleLevelChange** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleSourceChange** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleSearchChange** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **clearFilters** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π§© **LogEntryRow** (`Component`) + - π Renders a single log entry with stacked layout optimized for narrow drawer panels. + - ποΈ Layer: UI + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `derived` + - Ζ **formatTime** (`Function`) + - π Format ISO timestamp to HH:MM:SS */ +- π¦ **TaskResultPanel** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/components/tasks/TaskResultPanel.svelte + - ποΈ Layer: Unknown + - Ζ **statusColor** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **frontend.src.components.__tests__.task_log_viewer** (`Module`) + - π Unit tests for TaskLogViewer component by mounting it and observing the DOM. + - ποΈ Layer: UI (Tests) + - π Invariant: Duplicate logs are never appended. Polling only active for in-progress tasks. +- π§© **FileList** (`Component`) + - π Displays a table of files with metadata and actions. + - ποΈ Layer: UI + - β‘ Events: delete, navigate + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `t` + - β¬ οΈ READS_FROM `t` + - Ζ **isDirectory** (`Function`) + - π Checks if a file object represents a directory. + - Ζ **formatSize** (`Function`) + - π Formats file size in bytes into a human-readable string. + - Ζ **formatDate** (`Function`) + - π Formats an ISO date string into a localized readable format. +- π§© **FileUpload** (`Component`) + - π Provides a form for uploading files to a specific category. + - ποΈ Layer: UI + - β‘ Events: uploaded + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `state` + - β¬ οΈ READS_FROM `t` + - Ζ **handleUpload** (`Function`) + - π Handles the file upload process. + - Ζ **handleDrop** (`Function`) + - π Handles the file drop event for drag-and-drop. +- π§© **ConnectionForm** (`Component`) + - π UI component for creating a new database connection configuration. + - ποΈ Layer: UI + - β‘ Events: success + - β¬ οΈ READS_FROM `t` + - β‘οΈ WRITES_TO `t` + - Ζ **handleSubmit** (`Function`) + - π Submits the connection form to the backend. + - Ζ **resetForm** (`Function`) + - π Resets the connection form fields to their default values. +- π§© **ConnectionList** (`Component`) + - π UI component for listing and deleting saved database connection configurations. + - ποΈ Layer: UI + - β¬ οΈ READS_FROM `t` + - β‘οΈ WRITES_TO `t` + - Ζ **fetchConnections** (`Function`) + - π Fetches the list of connections from the backend. + - Ζ **handleDelete** (`Function`) + - π Deletes a connection configuration. +- π§© **MapperTool** (`Component`) + - π UI component for mapping dataset column verbose names using the MapperPlugin. + - ποΈ Layer: UI + - β¬ οΈ READS_FROM `t` + - β‘οΈ WRITES_TO `t` + - Ζ **fetchData** (`Function`) + - π Fetches environments and saved connections. + - Ζ **handleRunMapper** (`Function`) + - π Triggers the MapperPlugin task. + - Ζ **handleGenerateDocs** (`Function`) + - π Triggers the LLM Documentation task. +- π¦ **MapperTool** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/components/tools/MapperTool.svelte + - ποΈ Layer: Unknown + - Ζ **handleApplyDoc** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π§© **DebugTool** (`Component`) + - π UI component for system diagnostics and debugging API responses. + - ποΈ Layer: UI + - β¬ οΈ READS_FROM `t` + - β‘οΈ WRITES_TO `t` + - Ζ **fetchEnvironments** (`Function`) + - π Fetches available environments. + - Ζ **handleRunDebug** (`Function`) + - π Triggers the debug task. + - Ζ **startPolling** (`Function`) + - π Polls for task completion. +- π§© **CommitHistory** (`Component`) + - π Displays the commit history for a specific dashboard. + - ποΈ Layer: Component + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `state` + - β¬ οΈ READS_FROM `t` + - Ζ **onMount** (`Function`) + - π Load history when component is mounted. + - Ζ **loadHistory** (`Function`) + - π Fetch commit history from the backend. +- π§© **DeploymentModal** (`Component`) + - π Modal for deploying a dashboard to a target environment. + - ποΈ Layer: Component + - π Invariant: Cannot deploy without a selected environment. + - β‘ Events: deploy + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `state` + - β¬ οΈ READS_FROM `effect` + - π¦ **loadStatus** (`Watcher`) + - Ζ **loadEnvironments** (`Function`) + - π Fetch available environments from API. + - Ζ **handleDeploy** (`Function`) + - π Trigger deployment to selected environment. +- π§© **ConflictResolver** (`Component`) + - π UI for resolving merge conflicts (Keep Mine / Keep Theirs). + - ποΈ Layer: Component + - π Invariant: User must resolve all conflicts before saving. + - β‘ Events: resolve + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `state` + - Ζ **resolve** (`Function`) + - π Set resolution strategy for a file. + - Ζ **handleSave** (`Function`) + - π Validate and submit resolutions. +- π§© **CommitModal** (`Component`) + - π ΠΠΎΠ΄Π°Π»ΡΠ½ΠΎΠ΅ ΠΎΠΊΠ½ΠΎ Π΄Π»Ρ ΡΠΎΠ·Π΄Π°Π½ΠΈΡ ΠΊΠΎΠΌΠΌΠΈΡΠ° Ρ ΠΏΡΠΎΡΠΌΠΎΡΡΠΎΠΌ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΠΉ (diff). + - ποΈ Layer: Component + - β‘ Events: commit + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `state` + - β¬ οΈ READS_FROM `t` + - Ζ **handleGenerateMessage** (`Function`) + - π Generates a commit message using LLM. + - Ζ **loadStatus** (`Function`) + - π ΠΠ°Π³ΡΡΠΆΠ°Π΅Ρ ΡΠ΅ΠΊΡΡΠΈΠΉ ΡΡΠ°ΡΡΡ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΡ ΠΈ diff. + - Ζ **handleCommit** (`Function`) + - π Π‘ΠΎΠ·Π΄Π°Π΅Ρ ΠΊΠΎΠΌΠΌΠΈΡ Ρ ΡΠΊΠ°Π·Π°Π½Π½ΡΠΌ ΡΠΎΠΎΠ±ΡΠ΅Π½ΠΈΠ΅ΠΌ. +- π§© **BranchSelector** (`Component`) + - π UI Π΄Π»Ρ Π²ΡΠ±ΠΎΡΠ° ΠΈ ΡΠΎΠ·Π΄Π°Π½ΠΈΡ Π²Π΅ΡΠΎΠΊ Git. + - ποΈ Layer: Component + - β‘ Events: change + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `state` + - β¬ οΈ READS_FROM `t` + - Ζ **onMount** (`Function`) + - π Load branches when component is mounted. + - Ζ **loadBranches** (`Function`) + - π ΠΠ°Π³ΡΡΠΆΠ°Π΅Ρ ΡΠΏΠΈΡΠΎΠΊ Π²Π΅ΡΠΎΠΊ Π΄Π»Ρ Π΄Π°ΡΠ±ΠΎΡΠ΄Π°. + - Ζ **handleSelect** (`Function`) + - π Handles branch selection from dropdown. + - Ζ **handleCheckout** (`Function`) + - π ΠΠ΅ΡΠ΅ΠΊΠ»ΡΡΠ°Π΅Ρ ΡΠ΅ΠΊΡΡΡΡ Π²Π΅ΡΠΊΡ. + - Ζ **handleCreate** (`Function`) + - π Π‘ΠΎΠ·Π΄Π°Π΅Ρ Π½ΠΎΠ²ΡΡ Π²Π΅ΡΠΊΡ. +- π§© **GitManager** (`Component`) + - π Π¦Π΅Π½ΡΡΠ°Π»ΡΠ½ΡΠΉ ΠΊΠΎΠΌΠΏΠΎΠ½Π΅Π½Ρ Π΄Π»Ρ ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΡ Git-ΠΎΠΏΠ΅ΡΠ°ΡΠΈΡΠΌΠΈ ΠΊΠΎΠ½ΠΊΡΠ΅ΡΠ½ΠΎΠ³ΠΎ Π΄Π°ΡΠ±ΠΎΡΠ΄Π°. + - ποΈ Layer: Component + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `state` + - β¬ οΈ READS_FROM `t` + - Ζ **checkStatus** (`Function`) + - π ΠΡΠΎΠ²Π΅ΡΡΠ΅Ρ, ΠΈΠ½ΠΈΡΠΈΠ°Π»ΠΈΠ·ΠΈΡΠΎΠ²Π°Π½ Π»ΠΈ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΉ Π΄Π»Ρ Π΄Π°Π½Π½ΠΎΠ³ΠΎ Π΄Π°ΡΠ±ΠΎΡΠ΄Π°. + - Ζ **handleInit** (`Function`) + - π ΠΠ½ΠΈΡΠΈΠ°Π»ΠΈΠ·ΠΈΡΡΠ΅Ρ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΉ Π΄Π»Ρ Π΄Π°ΡΠ±ΠΎΡΠ΄Π°. + - Ζ **handleSync** (`Function`) + - π Π‘ΠΈΠ½Ρ ΡΠΎΠ½ΠΈΠ·ΠΈΡΡΠ΅Ρ ΡΠΎΡΡΠΎΡΠ½ΠΈΠ΅ Superset Ρ Π»ΠΎΠΊΠ°Π»ΡΠ½ΡΠΌ Git-ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠ΅ΠΌ. + - Ζ **handlePush** (`Function`) + - π Pushes local commits to the remote repository. + - Ζ **handlePull** (`Function`) + - π Pulls changes from the remote repository. +- π§© **DocPreview** (`Component`) + - π UI component for previewing generated dataset documentation before saving. + - ποΈ Layer: UI + - β‘οΈ WRITES_TO `props` + - β‘οΈ WRITES_TO `derived` + - β‘οΈ WRITES_TO `state` +- π¦ **DocPreview** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/components/llm/DocPreview.svelte + - ποΈ Layer: Unknown + - Ζ **handleSave** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π§© **ProviderConfig** (`Component`) + - π UI form for managing LLM provider configurations. + - ποΈ Layer: UI + - π₯ Props: providers: any, onSave: any + - β‘οΈ WRITES_TO `t` + - β¬ οΈ READS_FROM `t` +- π¦ **ProviderConfig** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/components/llm/ProviderConfig.svelte + - ποΈ Layer: Unknown + - Ζ **isMultimodalModel** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **resetForm** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleEdit** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **testConnection** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **handleSubmit** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **toggleActive** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **ValidationReport** (`Module`) `[TRIVIAL]` + - π Auto-generated module for frontend/src/components/llm/ValidationReport.svelte + - ποΈ Layer: Unknown + - Ζ **getStatusColor** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **frontend.src.components.llm.__tests__.provider_config_integration** (`Module`) + - π Protect edit-button interaction contract in LLM provider settings UI. + - ποΈ Layer: UI Tests + - π Invariant: Edit action keeps explicit click handler and opens normalized edit form. + - Ζ **provider_config_edit_contract_tests** (`Function`) + - π Validate edit button handler wiring and normalized edit form state mapping. +- π¦ **test_auth_debug** (`Module`) `[TRIVIAL]` + - π Auto-generated module for backend/test_auth_debug.py + - ποΈ Layer: Unknown + - Ζ **main** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.delete_running_tasks** (`Module`) + - π Script to delete tasks with RUNNING status from the database. + - ποΈ Layer: Utility + - Ζ **delete_running_tasks** (`Function`) + - π Delete all tasks with RUNNING status from the database. +- π¦ **AppModule** (`Module`) `[CRITICAL]` + - π The main entry point for the FastAPI application. It initializes the app, configures CORS, sets up dependencies, includes API routers, and defines the WebSocket endpoint for log streaming. + - ποΈ Layer: UI (API) + - π Invariant: All WebSocket connections must be properly cleaned up on disconnect. + - π¦ **App** (`Global`) + - π The global FastAPI application instance. + - Ζ **startup_event** (`Function`) + - π Handles application startup tasks, such as starting the scheduler. + - Ζ **shutdown_event** (`Function`) + - π Handles application shutdown tasks, such as stopping the scheduler. + - Ζ **network_error_handler** (`Function`) + - π Global exception handler for NetworkError. + - Ζ **log_requests** (`Function`) + - π Middleware to log incoming HTTP requests and their response status. + - π¦ **api.include_routers** (`Action`) + - π Registers all API routers with the FastAPI application. + - ποΈ Layer: API + - Ζ **websocket_endpoint** (`Function`) `[CRITICAL]` + - π Provides a WebSocket endpoint for real-time log streaming of a task with server-side filtering. + - π¦ **StaticFiles** (`Mount`) + - π Mounts the frontend build directory to serve static assets. + - Ζ **serve_spa** (`Function`) + - π Serves the SPA frontend for any path not matched by API routes. + - Ζ **read_root** (`Function`) + - π A simple root endpoint to confirm that the API is running when frontend is missing. + - Ζ **matches_filters** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **Dependencies** (`Module`) + - π Manages creation and provision of shared application dependencies, such as PluginLoader and TaskManager, to avoid circular imports. + - ποΈ Layer: Core + - Ζ **get_config_manager** (`Function`) + - π Dependency injector for ConfigManager. + - Ζ **get_plugin_loader** (`Function`) + - π Dependency injector for PluginLoader. + - Ζ **get_task_manager** (`Function`) + - π Dependency injector for TaskManager. + - Ζ **get_scheduler_service** (`Function`) + - π Dependency injector for SchedulerService. + - Ζ **get_resource_service** (`Function`) + - π Dependency injector for ResourceService. + - Ζ **get_mapping_service** (`Function`) + - π Dependency injector for MappingService. + - π¦ **oauth2_scheme** (`Variable`) + - π OAuth2 password bearer scheme for token extraction. + - Ζ **get_current_user** (`Function`) + - π Dependency for retrieving currently authenticated user from a JWT. + - Ζ **has_permission** (`Function`) + - π Dependency for checking if the current user has a specific permission. + - Ζ **permission_checker** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.src.scripts.seed_superset_load_test** (`Module`) + - π Creates randomized load-test data in Superset by cloning chart configurations and creating dashboards in target environments. + - ποΈ Layer: Scripts + - π Invariant: Created chart and dashboard names are globally unique for one script run. + - Ζ **_parse_args** (`Function`) + - π Parses CLI arguments for load-test data generation. + - Ζ **_extract_result_payload** (`Function`) + - π Normalizes Superset API payloads that may be wrapped in `result`. + - Ζ **_extract_created_id** (`Function`) + - π Extracts object ID from create/update API response. + - Ζ **_generate_unique_name** (`Function`) + - π Generates globally unique random names for charts/dashboards. + - Ζ **_resolve_target_envs** (`Function`) + - π Resolves requested environment IDs from configuration. + - Ζ **_build_chart_template_pool** (`Function`) + - π Builds a pool of source chart templates to clone in one environment. + - Ζ **seed_superset_load_data** (`Function`) + - π Creates dashboards and cloned charts for load testing across target environments. + - Ζ **main** (`Function`) + - π CLI entrypoint for Superset load-test data seeding. +- π¦ **test_dataset_dashboard_relations** (`Module`) `[TRIVIAL]` + - π Auto-generated module for backend/src/scripts/test_dataset_dashboard_relations.py + - ποΈ Layer: Unknown + - Ζ **test_dashboard_dataset_relations** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.src.scripts.migrate_sqlite_to_postgres** (`Module`) + - π Migrates legacy config and task history from SQLite/file storage to PostgreSQL. + - ποΈ Layer: Scripts + - π Invariant: Script is idempotent for task_records and app_configurations. + - π¦ **Constants** (`Section`) + - Ζ **_json_load_if_needed** (`Function`) + - π Parses JSON-like values from SQLite TEXT/JSON columns to Python objects. + - Ζ **_find_legacy_config_path** (`Function`) + - π Resolves the existing legacy config.json path from candidates. + - Ζ **_connect_sqlite** (`Function`) + - π Opens a SQLite connection with row factory. + - Ζ **_ensure_target_schema** (`Function`) + - π Ensures required PostgreSQL tables exist before migration. + - Ζ **_migrate_config** (`Function`) + - π Migrates legacy config.json into app_configurations(global). + - Ζ **_migrate_tasks_and_logs** (`Function`) + - π Migrates task_records and task_logs from SQLite into PostgreSQL. + - Ζ **run_migration** (`Function`) + - π Orchestrates migration from SQLite/file to PostgreSQL. + - Ζ **main** (`Function`) + - π CLI entrypoint. +- π¦ **backend.src.scripts.seed_permissions** (`Module`) + - π Populates the auth database with initial system permissions. + - ποΈ Layer: Scripts + - π Invariant: Safe to run multiple times (idempotent). + - π¦ **INITIAL_PERMISSIONS** (`Constant`) + - Ζ **seed_permissions** (`Function`) + - π Inserts missing permissions into the database. +- π¦ **backend.src.scripts.init_auth_db** (`Module`) + - π Initializes the auth database and creates the necessary tables. + - ποΈ Layer: Scripts + - π Invariant: Safe to run multiple times (idempotent). + - π CALLS -> `backend.src.core.database.init_db` + - Ζ **run_init** (`Function`) + - π Main entry point for the initialization script. +- π¦ **backend.src.scripts.create_admin** (`Module`) + - π CLI tool for creating the initial admin user. + - ποΈ Layer: Scripts + - π Invariant: Admin user must have the "Admin" role. + - Ζ **create_admin** (`Function`) + - π Creates an admin user and necessary roles/permissions. +- π¦ **backend.src.schemas.auth** (`Module`) + - π Pydantic schemas for authentication requests and responses. + - ποΈ Layer: API + - π Invariant: Sensitive fields like password must not be included in response schemas. + - π DEPENDS_ON -> `pydantic` + - β **Token** (`Class`) `[TRIVIAL]` + - π Represents a JWT access token response. + - β **TokenData** (`Class`) `[TRIVIAL]` + - π Represents the data encoded in a JWT token. + - β **PermissionSchema** (`Class`) `[TRIVIAL]` + - π Represents a permission in API responses. + - β **RoleSchema** (`Class`) + - π Represents a role in API responses. + - β **RoleCreate** (`Class`) + - π Schema for creating a new role. + - β **RoleUpdate** (`Class`) + - π Schema for updating an existing role. + - β **ADGroupMappingSchema** (`Class`) + - π Represents an AD Group to Role mapping in API responses. + - β **ADGroupMappingCreate** (`Class`) + - π Schema for creating an AD Group mapping. + - β **UserBase** (`Class`) + - π Base schema for user data. + - β **UserCreate** (`Class`) + - π Schema for creating a new user. + - β **UserUpdate** (`Class`) + - π Schema for updating an existing user. + - β **User** (`Class`) + - π Schema for user data in API responses. +- π¦ **backend.src.core.superset_client** (`Module`) + - π ΠΡΠ΅Π΄ΠΎΡΡΠ°Π²Π»ΡΠ΅Ρ Π²ΡΡΠΎΠΊΠΎΡΡΠΎΠ²Π½Π΅Π²ΡΠΉ ΠΊΠ»ΠΈΠ΅Π½Ρ Π΄Π»Ρ Π²Π·Π°ΠΈΠΌΠΎΠ΄Π΅ΠΉΡΡΠ²ΠΈΡ Ρ Superset REST API, ΠΈΠ½ΠΊΠ°ΠΏΡΡΠ»ΠΈΡΡΡ Π»ΠΎΠ³ΠΈΠΊΡ Π·Π°ΠΏΡΠΎΡΠΎΠ², ΠΎΠ±ΡΠ°Π±ΠΎΡΠΊΡ ΠΎΡΠΈΠ±ΠΎΠΊ ΠΈ ΠΏΠ°Π³ΠΈΠ½Π°ΡΠΈΡ. + - ποΈ Layer: Core + - π Invariant: All network operations must use the internal APIClient instance. + - β **SupersetClient** (`Class`) + - π ΠΠ»Π°ΡΡ-ΠΎΠ±ΡΡΡΠΊΠ° Π½Π°Π΄ Superset REST API, ΠΏΡΠ΅Π΄ΠΎΡΡΠ°Π²Π»ΡΡΡΠΈΠΉ ΠΌΠ΅ΡΠΎΠ΄Ρ Π΄Π»Ρ ΡΠ°Π±ΠΎΡΡ Ρ Π΄Π°ΡΠ±ΠΎΡΠ΄Π°ΠΌΠΈ ΠΈ Π΄Π°ΡΠ°ΡΠ΅ΡΠ°ΠΌΠΈ. + - Ζ **__init__** (`Function`) + - π ΠΠ½ΠΈΡΠΈΠ°Π»ΠΈΠ·ΠΈΡΡΠ΅Ρ ΠΊΠ»ΠΈΠ΅Π½Ρ, ΠΏΡΠΎΠ²Π΅ΡΡΠ΅Ρ ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΡ ΠΈ ΡΠΎΠ·Π΄Π°Π΅Ρ ΡΠ΅ΡΠ΅Π²ΠΎΠΉ ΠΊΠ»ΠΈΠ΅Π½Ρ. + - Ζ **authenticate** (`Function`) + - π Authenticates the client using the configured credentials. + - Ζ **headers** (`Function`) + - π ΠΠΎΠ·Π²ΡΠ°ΡΠ°Π΅Ρ Π±Π°Π·ΠΎΠ²ΡΠ΅ HTTP-Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠΈ, ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΠΌΡΠ΅ ΡΠ΅ΡΠ΅Π²ΡΠΌ ΠΊΠ»ΠΈΠ΅Π½ΡΠΎΠΌ. + - Ζ **get_dashboards** (`Function`) + - π ΠΠΎΠ»ΡΡΠ°Π΅Ρ ΠΏΠΎΠ»Π½ΡΠΉ ΡΠΏΠΈΡΠΎΠΊ Π΄Π°ΡΠ±ΠΎΡΠ΄ΠΎΠ², Π°Π²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈ ΠΎΠ±ΡΠ°Π±Π°ΡΡΠ²Π°Ρ ΠΏΠ°Π³ΠΈΠ½Π°ΡΠΈΡ. + - Ζ **get_dashboards_summary** (`Function`) + - π Fetches dashboard metadata optimized for the grid. + - Ζ **get_dashboard** (`Function`) + - π Fetches a single dashboard by ID. + - Ζ **get_chart** (`Function`) + - π Fetches a single chart by ID. + - Ζ **get_dashboard_detail** (`Function`) + - π Fetches detailed dashboard information including related charts and datasets. + - Ζ **_extract_chart_ids_from_layout** (`Function`) + - π Traverses dashboard layout metadata and extracts chart IDs from common keys. + - Ζ **export_dashboard** (`Function`) + - π ΠΠΊΡΠΏΠΎΡΡΠΈΡΡΠ΅Ρ Π΄Π°ΡΠ±ΠΎΡΠ΄ Π² Π²ΠΈΠ΄Π΅ ZIP-Π°ΡΡ ΠΈΠ²Π°. + - Ζ **import_dashboard** (`Function`) + - π ΠΠΌΠΏΠΎΡΡΠΈΡΡΠ΅Ρ Π΄Π°ΡΠ±ΠΎΡΠ΄ ΠΈΠ· ZIP-ΡΠ°ΠΉΠ»Π°. + - Ζ **delete_dashboard** (`Function`) + - π Π£Π΄Π°Π»ΡΠ΅Ρ Π΄Π°ΡΠ±ΠΎΡΠ΄ ΠΏΠΎ Π΅Π³ΠΎ ID ΠΈΠ»ΠΈ slug. + - Ζ **get_datasets** (`Function`) + - π ΠΠΎΠ»ΡΡΠ°Π΅Ρ ΠΏΠΎΠ»Π½ΡΠΉ ΡΠΏΠΈΡΠΎΠΊ Π΄Π°ΡΠ°ΡΠ΅ΡΠΎΠ², Π°Π²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈ ΠΎΠ±ΡΠ°Π±Π°ΡΡΠ²Π°Ρ ΠΏΠ°Π³ΠΈΠ½Π°ΡΠΈΡ. + - Ζ **get_datasets_summary** (`Function`) + - π Fetches dataset metadata optimized for the Dataset Hub grid. + - Ζ **get_dataset_detail** (`Function`) + - π Fetches detailed dataset information including columns and linked dashboards + - π CALLS -> `self.get_dataset` + - π CALLS -> `self.network.request (for related_objects)` + - Ζ **get_dataset** (`Function`) + - π ΠΠΎΠ»ΡΡΠ°Π΅Ρ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ ΠΎ ΠΊΠΎΠ½ΠΊΡΠ΅ΡΠ½ΠΎΠΌ Π΄Π°ΡΠ°ΡΠ΅ΡΠ΅ ΠΏΠΎ Π΅Π³ΠΎ ID. + - Ζ **update_dataset** (`Function`) + - π ΠΠ±Π½ΠΎΠ²Π»ΡΠ΅Ρ Π΄Π°Π½Π½ΡΠ΅ Π΄Π°ΡΠ°ΡΠ΅ΡΠ° ΠΏΠΎ Π΅Π³ΠΎ ID. + - Ζ **get_databases** (`Function`) + - π ΠΠΎΠ»ΡΡΠ°Π΅Ρ ΠΏΠΎΠ»Π½ΡΠΉ ΡΠΏΠΈΡΠΎΠΊ Π±Π°Π· Π΄Π°Π½Π½ΡΡ . + - Ζ **get_database** (`Function`) + - π ΠΠΎΠ»ΡΡΠ°Π΅Ρ ΠΈΠ½ΡΠΎΡΠΌΠ°ΡΠΈΡ ΠΎ ΠΊΠΎΠ½ΠΊΡΠ΅ΡΠ½ΠΎΠΉ Π±Π°Π·Π΅ Π΄Π°Π½Π½ΡΡ ΠΏΠΎ Π΅Ρ ID. + - Ζ **get_databases_summary** (`Function`) + - π Fetch a summary of databases including uuid, name, and engine. + - Ζ **get_database_by_uuid** (`Function`) + - π Find a database by its UUID. + - Ζ **_resolve_target_id_for_delete** (`Function`) + - π Resolves a dashboard ID from either an ID or a slug. + - Ζ **_do_import** (`Function`) + - π Performs the actual multipart upload for import. + - Ζ **_validate_export_response** (`Function`) + - π Validates that the export response is a non-empty ZIP archive. + - Ζ **_resolve_export_filename** (`Function`) + - π Determines the filename for an exported dashboard. + - Ζ **_validate_query_params** (`Function`) + - π Ensures query parameters have default page and page_size. + - Ζ **_fetch_total_object_count** (`Function`) + - π Fetches the total number of items for a given endpoint. + - Ζ **_fetch_all_pages** (`Function`) + - π Iterates through all pages to collect all data items. + - Ζ **_validate_import_file** (`Function`) + - π Validates that the file to be imported is a valid ZIP with metadata.yaml. + - Ζ **get_all_resources** (`Function`) + - π Fetches all resources of a given type with id, uuid, and name columns. + - Ζ **extract_dataset_id_from_form_data** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **walk** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **as_bool** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **ConfigManagerModule** (`Module`) + - π Manages application configuration persisted in database with one-time migration from JSON. + - ποΈ Layer: Core + - π Invariant: Configuration must always be valid according to AppConfig model. + - π DEPENDS_ON -> `ConfigModels` + - π DEPENDS_ON -> `AppConfigRecord` + - π CALLS -> `logger` + - β **ConfigManager** (`Class`) + - π A class to handle application configuration persistence and management. + - Ζ **__init__** (`Function`) + - π Initializes the ConfigManager. + - Ζ **_default_config** (`Function`) + - π Returns default application configuration. + - Ζ **_load_from_legacy_file** (`Function`) + - π Loads legacy configuration from config.json for migration fallback. + - Ζ **_get_record** (`Function`) + - π Loads config record from DB. + - Ζ **_load_config** (`Function`) + - π Loads the configuration from DB or performs one-time migration from JSON file. + - Ζ **_save_config_to_db** (`Function`) + - π Saves the provided configuration object to DB. + - Ζ **save** (`Function`) + - π Saves the current configuration state to DB. + - Ζ **get_config** (`Function`) + - π Returns the current configuration. + - Ζ **update_global_settings** (`Function`) + - π Updates the global settings and persists the change. + - Ζ **validate_path** (`Function`) + - π Validates if a path exists and is writable. + - Ζ **get_environments** (`Function`) + - π Returns the list of configured environments. + - Ζ **has_environments** (`Function`) + - π Checks if at least one environment is configured. + - Ζ **get_environment** (`Function`) + - π Returns a single environment by ID. + - Ζ **add_environment** (`Function`) + - π Adds a new environment to the configuration. + - Ζ **update_environment** (`Function`) + - π Updates an existing environment. + - Ζ **delete_environment** (`Function`) + - π Deletes an environment by ID. +- π¦ **SchedulerModule** (`Module`) + - π Manages scheduled tasks using APScheduler. + - ποΈ Layer: Core + - β **SchedulerService** (`Class`) + - π Provides a service to manage scheduled backup tasks. + - Ζ **__init__** (`Function`) + - π Initializes the scheduler service with task and config managers. + - Ζ **start** (`Function`) + - π Starts the background scheduler and loads initial schedules. + - Ζ **stop** (`Function`) + - π Stops the background scheduler. + - Ζ **load_schedules** (`Function`) + - π Loads backup schedules from configuration and registers them. + - Ζ **add_backup_job** (`Function`) + - π Adds a scheduled backup job for an environment. + - Ζ **_trigger_backup** (`Function`) + - π Triggered by the scheduler to start a backup task. +- π¦ **ConfigModels** (`Module`) + - π Defines the data models for application configuration using Pydantic. + - ποΈ Layer: Core + - π¦ **Schedule** (`DataClass`) + - π Represents a backup schedule configuration. + - π¦ **Environment** (`DataClass`) + - π Represents a Superset environment configuration. + - π¦ **LoggingConfig** (`DataClass`) + - π Defines the configuration for the application's logging system. + - π¦ **GlobalSettings** (`DataClass`) + - π Represents global application settings. + - π¦ **AppConfig** (`DataClass`) + - π The root configuration model containing all application settings. +- π¦ **backend.src.core.database** (`Module`) + - π Configures database connection and session management (PostgreSQL-first). + - ποΈ Layer: Core + - π Invariant: A single engine instance is used for the entire application. + - π DEPENDS_ON -> `sqlalchemy` + - π DEPENDS_ON -> `backend.src.models.mapping` + - π DEPENDS_ON -> `backend.src.core.auth.config` + - π¦ **BASE_DIR** (`Variable`) + - π Base directory for the backend. + - π¦ **DATABASE_URL** (`Constant`) + - π URL for the main application database. + - π¦ **TASKS_DATABASE_URL** (`Constant`) + - π URL for the tasks execution database. + - π¦ **AUTH_DATABASE_URL** (`Constant`) + - π URL for the authentication database. + - π¦ **engine** (`Variable`) + - π SQLAlchemy engine for mappings database. + - π¦ **tasks_engine** (`Variable`) + - π SQLAlchemy engine for tasks database. + - π¦ **auth_engine** (`Variable`) + - π SQLAlchemy engine for authentication database. + - β **SessionLocal** (`Class`) `[TRIVIAL]` + - π A session factory for the main mappings database. + - β **TasksSessionLocal** (`Class`) `[TRIVIAL]` + - π A session factory for the tasks execution database. + - β **AuthSessionLocal** (`Class`) `[TRIVIAL]` + - π A session factory for the authentication database. + - Ζ **init_db** (`Function`) + - π Initializes the database by creating all tables. + - Ζ **get_db** (`Function`) + - π Dependency for getting a database session. + - Ζ **get_tasks_db** (`Function`) + - π Dependency for getting a tasks database session. + - Ζ **get_auth_db** (`Function`) + - π Dependency for getting an authentication database session. + - Ζ **_build_engine** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **LoggerModule** (`Module`) + - π Configures the application's logging system, including a custom handler for buffering logs and streaming them over WebSockets. + - ποΈ Layer: Core + - β **BeliefFormatter** (`Class`) + - π Custom logging formatter that adds belief state prefixes to log messages. + - Ζ **format** (`Function`) + - π Formats the log record, adding belief state context if available. + - β **LogEntry** (`Class`) + - π A Pydantic model representing a single, structured log entry. This is a re-definition for consistency, as it's also defined in task_manager.py. + - Ζ **belief_scope** (`Function`) + - π Context manager for structured Belief State logging. + - Ζ **configure_logger** (`Function`) + - π Configures the logger with the provided logging settings. + - Ζ **get_task_log_level** (`Function`) + - π Returns the current task log level filter. + - Ζ **should_log_task_level** (`Function`) + - π Checks if a log level should be recorded based on task_log_level setting. + - β **WebSocketLogHandler** (`Class`) + - π A custom logging handler that captures log records into a buffer. It is designed to be extended for real-time log streaming over WebSockets. + - Ζ **__init__** (`Function`) + - π Initializes the handler with a fixed-capacity buffer. + - Ζ **emit** (`Function`) + - π Captures a log record, formats it, and stores it in the buffer. + - Ζ **get_recent_logs** (`Function`) + - π Returns a list of recent log entries from the buffer. + - π¦ **Logger** (`Global`) + - π The global logger instance for the application, configured with both a console handler and the custom WebSocket handler. + - Ζ **believed** (`Function`) + - π A decorator that wraps a function in a belief scope. + - Ζ **decorator** (`Function`) + - π Internal decorator for belief scope. + - Ζ **explore** (`Function`) + - π Logs an EXPLORE message (Van der Waals force) for searching, alternatives, and hypotheses. + - Ζ **reason** (`Function`) + - π Logs a REASON message (Covalent bond) for strict deduction and core logic. + - Ζ **reflect** (`Function`) + - π Logs a REFLECT message (Hydrogen bond) for self-check and structural validation. +- β **PluginLoader** (`Class`) + - π Scans a specified directory for Python modules, dynamically loads them, and registers any classes that are valid implementations of the PluginBase interface. + - ποΈ Layer: Core + - Ζ **__init__** (`Function`) + - π Initializes the PluginLoader with a directory to scan. + - Ζ **_load_plugins** (`Function`) + - π Scans the plugin directory and loads all valid plugins. + - Ζ **_load_module** (`Function`) + - π Loads a single Python module and discovers PluginBase implementations. + - Ζ **_register_plugin** (`Function`) + - π Registers a PluginBase instance and its configuration. + - Ζ **get_plugin** (`Function`) + - π Retrieves a loaded plugin instance by its ID. + - Ζ **get_all_plugin_configs** (`Function`) + - π Returns a list of all registered plugin configurations. + - Ζ **has_plugin** (`Function`) + - π Checks if a plugin with the given ID is registered. +- π¦ **backend.src.core.migration_engine** (`Module`) + - π Handles the interception and transformation of Superset asset ZIP archives. + - ποΈ Layer: Core + - π Invariant: ZIP structure must be preserved after transformation. + - π DEPENDS_ON -> `PyYAML` + - β **MigrationEngine** (`Class`) + - π Engine for transforming Superset export ZIPs. + - Ζ **__init__** (`Function`) + - π Initializes the migration engine with optional ID mapping service. + - Ζ **transform_zip** (`Function`) + - π Extracts ZIP, replaces database UUIDs in YAMLs, patches cross-filters, and re-packages. + - Ζ **_transform_yaml** (`Function`) + - π Replaces database_uuid in a single YAML file. + - Ζ **_extract_chart_uuids_from_archive** (`Function`) + - π Scans the unpacked ZIP to map local exported integer IDs back to their UUIDs. + - Ζ **_patch_dashboard_metadata** (`Function`) + - π Replaces integer IDs in json_metadata. +- β **PluginBase** (`Class`) + - π Defines the abstract base class that all plugins must implement to be recognized by the system. It enforces a common structure for plugin metadata and execution. + - ποΈ Layer: Core + - π Invariant: All plugins MUST inherit from this class. + - Ζ **id** (`Function`) + - π Returns the unique identifier for the plugin. + - Ζ **name** (`Function`) + - π Returns the human-readable name of the plugin. + - Ζ **description** (`Function`) + - π Returns a brief description of the plugin. + - Ζ **version** (`Function`) + - π Returns the version of the plugin. + - Ζ **required_permission** (`Function`) + - π Returns the required permission string to execute this plugin. + - Ζ **ui_route** (`Function`) + - π Returns the frontend route for the plugin's UI, if applicable. + - Ζ **get_schema** (`Function`) + - π Returns the JSON schema for the plugin's input parameters. + - Ζ **execute** (`Function`) + - π Executes the plugin's core logic. +- β **PluginConfig** (`Class`) + - π A Pydantic model used to represent the validated configuration and metadata of a loaded plugin. This object is what gets exposed to the API layer. + - ποΈ Layer: Core +- π¦ **backend.src.core.mapping_service** (`Module`) `[CRITICAL]` + - π Service for tracking and synchronizing Superset Resource IDs (UUID <-> Integer ID) + - ποΈ Layer: Core + - π Invariant: sync_environment must handle remote API failures gracefully. + - π DEPENDS_ON -> `backend.src.models.mapping (ResourceMapping, ResourceType)` + - π DEPENDS_ON -> `backend.src.core.logger` + - β **IdMappingService** (`Class`) `[CRITICAL]` + - π Service handling the cataloging and retrieval of remote Superset Integer IDs. + - Ζ **__init__** (`Function`) + - π Initializes the mapping service. + - Ζ **start_scheduler** (`Function`) + - π Starts the background scheduler with a given cron string. + - Ζ **sync_environment** (`Function`) + - π Fully synchronizes mapping for a specific environment. + - Ζ **get_remote_id** (`Function`) + - π Retrieves the remote integer ID for a given universal UUID. + - Ζ **get_remote_ids_batch** (`Function`) + - π Retrieves remote integer IDs for a list of universal UUIDs efficiently. + - Ζ **sync_all** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.src.core.auth.config** (`Module`) + - π Centralized configuration for authentication and authorization. + - ποΈ Layer: Core + - π Invariant: All sensitive configuration must have defaults or be loaded from environment. + - π DEPENDS_ON -> `pydantic` + - β **AuthConfig** (`Class`) + - π Holds authentication-related settings. + - π¦ **auth_config** (`Variable`) + - π Singleton instance of AuthConfig. +- π¦ **backend.src.core.auth.jwt** (`Module`) + - π JWT token generation and validation logic. + - ποΈ Layer: Core + - π Invariant: Tokens must include expiration time and user identifier. + - π DEPENDS_ON -> `jose` + - Ζ **create_access_token** (`Function`) + - π Generates a new JWT access token. + - Ζ **decode_token** (`Function`) + - π Decodes and validates a JWT token. +- π¦ **backend.src.core.auth.oauth** (`Module`) + - π ADFS OIDC configuration and client using Authlib. + - ποΈ Layer: Core + - π Invariant: Must use secure OIDC flows. + - π DEPENDS_ON -> `authlib` + - π¦ **oauth** (`Variable`) + - π Global Authlib OAuth registry. + - Ζ **register_adfs** (`Function`) + - π Registers the ADFS OIDC client. + - Ζ **is_adfs_configured** (`Function`) + - π Checks if ADFS is properly configured. +- π¦ **backend.src.core.auth.logger** (`Module`) + - π Audit logging for security-related events. + - ποΈ Layer: Core + - π Invariant: Must not log sensitive data like passwords or full tokens. + - Ζ **log_security_event** (`Function`) + - π Logs a security-related event for audit trails. +- π¦ **backend.src.core.auth.security** (`Module`) + - π Utility for password hashing and verification using Passlib. + - ποΈ Layer: Core + - π Invariant: Uses bcrypt for hashing with standard work factor. + - π DEPENDS_ON -> `passlib` + - Ζ **verify_password** (`Function`) + - π Verifies a plain password against a hashed password. + - Ζ **get_password_hash** (`Function`) + - π Generates a bcrypt hash for a plain password. +- π¦ **backend.src.core.auth.repository** (`Module`) + - π Data access layer for authentication-related entities. + - ποΈ Layer: Core + - π Invariant: All database operations must be performed within a session. + - π DEPENDS_ON -> `sqlalchemy` + - β **AuthRepository** (`Class`) + - π Encapsulates database operations for authentication. + - Ζ **__init__** (`Function`) + - π Initializes the repository with a database session. + - Ζ **get_user_by_username** (`Function`) + - π Retrieves a user by their username. + - Ζ **get_user_by_id** (`Function`) + - π Retrieves a user by their unique ID. + - Ζ **get_role_by_name** (`Function`) + - π Retrieves a role by its name. + - Ζ **update_last_login** (`Function`) + - π Updates the last_login timestamp for a user. + - Ζ **get_role_by_id** (`Function`) + - π Retrieves a role by its unique ID. + - Ζ **get_permission_by_id** (`Function`) + - π Retrieves a permission by its unique ID. + - Ζ **get_permission_by_resource_action** (`Function`) + - π Retrieves a permission by resource and action. + - Ζ **list_permissions** (`Function`) + - π Lists all available permissions. +- π¦ **test_auth** (`Module`) + - π Unit tests for authentication module + - ποΈ Layer: Domain + - Ζ **db_session** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **auth_service** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **auth_repo** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_create_user** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_authenticate_user** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_create_session** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_role_permission_association** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_user_role_association** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_ad_group_mapping** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_authenticate_user_updates_last_login** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_authenticate_inactive_user** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_verify_password_empty_hash** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_provision_adfs_user_new** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_provision_adfs_user_existing** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.core.utils.fileio** (`Module`) + - π ΠΡΠ΅Π΄ΠΎΡΡΠ°Π²Π»ΡΠ΅Ρ Π½Π°Π±ΠΎΡ ΡΡΠΈΠ»ΠΈΡ Π΄Π»Ρ ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΡ ΡΠ°ΠΉΠ»ΠΎΠ²ΡΠΌΠΈ ΠΎΠΏΠ΅ΡΠ°ΡΠΈΡΠΌΠΈ, Π²ΠΊΠ»ΡΡΠ°Ρ ΡΠ°Π±ΠΎΡΡ Ρ Π²ΡΠ΅ΠΌΠ΅Π½Π½ΡΠΌΠΈ ΡΠ°ΠΉΠ»Π°ΠΌΠΈ, Π°ΡΡ ΠΈΠ²Π°ΠΌΠΈ ZIP, ΡΠ°ΠΉΠ»Π°ΠΌΠΈ YAML ΠΈ ΠΎΡΠΈΡΡΠΊΡ Π΄ΠΈΡΠ΅ΠΊΡΠΎΡΠΈΠΉ. + - ποΈ Layer: Infra + - π DEPENDS_ON -> `backend.src.core.logger` + - π DEPENDS_ON -> `pyyaml` + - β **InvalidZipFormatError** (`Class`) + - π Exception raised when a file is not a valid ZIP archive. + - Ζ **create_temp_file** (`Function`) + - π ΠΠΎΠ½ΡΠ΅ΠΊΡΡΠ½ΡΠΉ ΠΌΠ΅Π½Π΅Π΄ΠΆΠ΅Ρ Π΄Π»Ρ ΡΠΎΠ·Π΄Π°Π½ΠΈΡ Π²ΡΠ΅ΠΌΠ΅Π½Π½ΠΎΠ³ΠΎ ΡΠ°ΠΉΠ»Π° ΠΈΠ»ΠΈ Π΄ΠΈΡΠ΅ΠΊΡΠΎΡΠΈΠΈ Ρ Π³Π°ΡΠ°Π½ΡΠΈΡΠΎΠ²Π°Π½Π½ΡΠΌ ΡΠ΄Π°Π»Π΅Π½ΠΈΠ΅ΠΌ. + - Ζ **remove_empty_directories** (`Function`) + - π Π Π΅ΠΊΡΡΡΠΈΠ²Π½ΠΎ ΡΠ΄Π°Π»ΡΠ΅Ρ Π²ΡΠ΅ ΠΏΡΡΡΡΠ΅ ΠΏΠΎΠ΄Π΄ΠΈΡΠ΅ΠΊΡΠΎΡΠΈΠΈ, Π½Π°ΡΠΈΠ½Π°Ρ Ρ ΡΠΊΠ°Π·Π°Π½Π½ΠΎΠ³ΠΎ ΠΏΡΡΠΈ. + - Ζ **read_dashboard_from_disk** (`Function`) + - π Π§ΠΈΡΠ°Π΅Ρ Π±ΠΈΠ½Π°ΡΠ½ΠΎΠ΅ ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ΅ ΡΠ°ΠΉΠ»Π° Ρ Π΄ΠΈΡΠΊΠ°. + - Ζ **calculate_crc32** (`Function`) + - π ΠΡΡΠΈΡΠ»ΡΠ΅Ρ ΠΊΠΎΠ½ΡΡΠΎΠ»ΡΠ½ΡΡ ΡΡΠΌΠΌΡ CRC32 Π΄Π»Ρ ΡΠ°ΠΉΠ»Π°. + - π¦ **RetentionPolicy** (`DataClass`) + - π ΠΠΏΡΠ΅Π΄Π΅Π»ΡΠ΅Ρ ΠΏΠΎΠ»ΠΈΡΠΈΠΊΡ Ρ ΡΠ°Π½Π΅Π½ΠΈΡ Π΄Π»Ρ Π°ΡΡ ΠΈΠ²ΠΎΠ² (Π΅ΠΆΠ΅Π΄Π½Π΅Π²Π½ΡΠ΅, Π΅ΠΆΠ΅Π½Π΅Π΄Π΅Π»ΡΠ½ΡΠ΅, Π΅ΠΆΠ΅ΠΌΠ΅ΡΡΡΠ½ΡΠ΅). + - Ζ **archive_exports** (`Function`) + - π Π£ΠΏΡΠ°Π²Π»ΡΠ΅Ρ Π°ΡΡ ΠΈΠ²ΠΎΠΌ ΡΠΊΡΠΏΠΎΡΡΠΈΡΠΎΠ²Π°Π½Π½ΡΡ ΡΠ°ΠΉΠ»ΠΎΠ², ΠΏΡΠΈΠΌΠ΅Π½ΡΡ ΠΏΠΎΠ»ΠΈΡΠΈΠΊΡ Ρ ΡΠ°Π½Π΅Π½ΠΈΡ ΠΈ Π΄Π΅Π΄ΡΠΏΠ»ΠΈΠΊΠ°ΡΠΈΡ. + - π CALLS -> `apply_retention_policy` + - π CALLS -> `calculate_crc32` + - Ζ **apply_retention_policy** (`Function`) + - π (Helper) ΠΡΠΈΠΌΠ΅Π½ΡΠ΅Ρ ΠΏΠΎΠ»ΠΈΡΠΈΠΊΡ Ρ ΡΠ°Π½Π΅Π½ΠΈΡ ΠΊ ΡΠΏΠΈΡΠΊΡ ΡΠ°ΠΉΠ»ΠΎΠ², Π²ΠΎΠ·Π²ΡΠ°ΡΠ°Ρ ΡΠ΅, ΡΡΠΎ Π½ΡΠΆΠ½ΠΎ ΡΠΎΡ ΡΠ°Π½ΠΈΡΡ. + - Ζ **save_and_unpack_dashboard** (`Function`) + - π Π‘ΠΎΡ ΡΠ°Π½ΡΠ΅Ρ Π±ΠΈΠ½Π°ΡΠ½ΠΎΠ΅ ΡΠΎΠ΄Π΅ΡΠΆΠΈΠΌΠΎΠ΅ ZIP-Π°ΡΡ ΠΈΠ²Π° Π½Π° Π΄ΠΈΡΠΊ ΠΈ ΠΎΠΏΡΠΈΠΎΠ½Π°Π»ΡΠ½ΠΎ ΡΠ°ΡΠΏΠ°ΠΊΠΎΠ²ΡΠ²Π°Π΅Ρ Π΅Π³ΠΎ. + - Ζ **update_yamls** (`Function`) + - π ΠΠ±Π½ΠΎΠ²Π»ΡΠ΅Ρ ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠΈ Π² YAML-ΡΠ°ΠΉΠ»Π°Ρ , Π·Π°ΠΌΠ΅Π½ΡΡ Π·Π½Π°ΡΠ΅Π½ΠΈΡ ΠΈΠ»ΠΈ ΠΏΡΠΈΠΌΠ΅Π½ΡΡ regex. + - π CALLS -> `_update_yaml_file` + - Ζ **_update_yaml_file** (`Function`) + - π (Helper) ΠΠ±Π½ΠΎΠ²Π»ΡΠ΅Ρ ΠΎΠ΄ΠΈΠ½ YAML ΡΠ°ΠΉΠ». + - Ζ **replacer** (`Function`) + - π Π€ΡΠ½ΠΊΡΠΈΡ Π·Π°ΠΌΠ΅Π½Ρ, ΡΠΎΡ ΡΠ°Π½ΡΡΡΠ°Ρ ΠΊΠ°Π²ΡΡΠΊΠΈ Π΅ΡΠ»ΠΈ ΠΎΠ½ΠΈ Π±ΡΠ»ΠΈ. + - Ζ **create_dashboard_export** (`Function`) + - π Π‘ΠΎΠ·Π΄Π°Π΅Ρ ZIP-Π°ΡΡ ΠΈΠ² ΠΈΠ· ΡΠΊΠ°Π·Π°Π½Π½ΡΡ ΠΈΡΡ ΠΎΠ΄Π½ΡΡ ΠΏΡΡΠ΅ΠΉ. + - Ζ **sanitize_filename** (`Function`) + - π ΠΡΠΈΡΠ°Π΅Ρ ΡΡΡΠΎΠΊΡ ΠΎΡ ΡΠΈΠΌΠ²ΠΎΠ»ΠΎΠ², Π½Π΅Π΄ΠΎΠΏΡΡΡΠΈΠΌΡΡ Π² ΠΈΠΌΠ΅Π½Π°Ρ ΡΠ°ΠΉΠ»ΠΎΠ². + - Ζ **get_filename_from_headers** (`Function`) + - π ΠΠ·Π²Π»Π΅ΠΊΠ°Π΅Ρ ΠΈΠΌΡ ΡΠ°ΠΉΠ»Π° ΠΈΠ· HTTP Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠ° 'Content-Disposition'. + - Ζ **consolidate_archive_folders** (`Function`) + - π ΠΠΎΠ½ΡΠΎΠ»ΠΈΠ΄ΠΈΡΡΠ΅Ρ Π΄ΠΈΡΠ΅ΠΊΡΠΎΡΠΈΠΈ Π°ΡΡ ΠΈΠ²ΠΎΠ² Π½Π° ΠΎΡΠ½ΠΎΠ²Π΅ ΠΎΠ±ΡΠ΅Π³ΠΎ ΡΠ»Π°Π³Π° Π² ΠΈΠΌΠ΅Π½ΠΈ. +- π¦ **backend.core.utils.network** (`Module`) + - π ΠΠ½ΠΊΠ°ΠΏΡΡΠ»ΠΈΡΡΠ΅Ρ Π½ΠΈΠ·ΠΊΠΎΡΡΠΎΠ²Π½Π΅Π²ΡΡ HTTP-Π»ΠΎΠ³ΠΈΠΊΡ Π΄Π»Ρ Π²Π·Π°ΠΈΠΌΠΎΠ΄Π΅ΠΉΡΡΠ²ΠΈΡ Ρ Superset API, Π²ΠΊΠ»ΡΡΠ°Ρ Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΡ, ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΠ΅ ΡΠ΅ΡΡΠΈΠ΅ΠΉ, retry-Π»ΠΎΠ³ΠΈΠΊΡ ΠΈ ΠΎΠ±ΡΠ°Π±ΠΎΡΠΊΡ ΠΎΡΠΈΠ±ΠΎΠΊ. + - ποΈ Layer: Infra + - π DEPENDS_ON -> `backend.src.core.logger` + - π DEPENDS_ON -> `requests` + - β **SupersetAPIError** (`Class`) + - π Base exception for all Superset API related errors. + - Ζ **__init__** (`Function`) + - π Initializes the exception with a message and context. + - β **AuthenticationError** (`Class`) + - π Exception raised when authentication fails. + - Ζ **__init__** (`Function`) + - π Initializes the authentication error. + - β **PermissionDeniedError** (`Class`) + - π Exception raised when access is denied. + - Ζ **__init__** (`Function`) + - π Initializes the permission denied error. + - β **DashboardNotFoundError** (`Class`) + - π Exception raised when a dashboard cannot be found. + - Ζ **__init__** (`Function`) + - π Initializes the not found error with resource ID. + - β **NetworkError** (`Class`) + - π Exception raised when a network level error occurs. + - Ζ **__init__** (`Function`) + - π Initializes the network error. + - β **APIClient** (`Class`) + - π ΠΠ½ΠΊΠ°ΠΏΡΡΠ»ΠΈΡΡΠ΅Ρ HTTP-Π»ΠΎΠ³ΠΈΠΊΡ Π΄Π»Ρ ΡΠ°Π±ΠΎΡΡ Ρ API, Π²ΠΊΠ»ΡΡΠ°Ρ ΡΠ΅ΡΡΠΈΠΈ, Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΡ, ΠΈ ΠΎΠ±ΡΠ°Π±ΠΎΡΠΊΡ Π·Π°ΠΏΡΠΎΡΠΎΠ². + - Ζ **__init__** (`Function`) + - π ΠΠ½ΠΈΡΠΈΠ°Π»ΠΈΠ·ΠΈΡΡΠ΅Ρ API ΠΊΠ»ΠΈΠ΅Π½Ρ Ρ ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠ΅ΠΉ, ΡΠ΅ΡΡΠΈΠ΅ΠΉ ΠΈ Π»ΠΎΠ³Π³Π΅ΡΠΎΠΌ. + - Ζ **_init_session** (`Function`) + - π Π‘ΠΎΠ·Π΄Π°Π΅Ρ ΠΈ Π½Π°ΡΡΡΠ°ΠΈΠ²Π°Π΅Ρ `requests.Session` Ρ retry-Π»ΠΎΠ³ΠΈΠΊΠΎΠΉ. + - Ζ **authenticate** (`Function`) + - π ΠΡΠΏΠΎΠ»Π½ΡΠ΅Ρ Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΡ Π² Superset API ΠΈ ΠΏΠΎΠ»ΡΡΠ°Π΅Ρ access ΠΈ CSRF ΡΠΎΠΊΠ΅Π½Ρ. + - Ζ **headers** (`Function`) + - π ΠΠΎΠ·Π²ΡΠ°ΡΠ°Π΅Ρ HTTP-Π·Π°Π³ΠΎΠ»ΠΎΠ²ΠΊΠΈ Π΄Π»Ρ Π°ΡΡΠ΅Π½ΡΠΈΡΠΈΡΠΈΡΠΎΠ²Π°Π½Π½ΡΡ Π·Π°ΠΏΡΠΎΡΠΎΠ². + - Ζ **request** (`Function`) + - π ΠΡΠΏΠΎΠ»Π½ΡΠ΅Ρ ΡΠ½ΠΈΠ²Π΅ΡΡΠ°Π»ΡΠ½ΡΠΉ HTTP-Π·Π°ΠΏΡΠΎΡ ΠΊ API. + - Ζ **_handle_http_error** (`Function`) + - π (Helper) ΠΡΠ΅ΠΎΠ±ΡΠ°Π·ΡΠ΅Ρ HTTP ΠΎΡΠΈΠ±ΠΊΠΈ Π² ΠΊΠ°ΡΡΠΎΠΌΠ½ΡΠ΅ ΠΈΡΠΊΠ»ΡΡΠ΅Π½ΠΈΡ. + - Ζ **_handle_network_error** (`Function`) + - π (Helper) ΠΡΠ΅ΠΎΠ±ΡΠ°Π·ΡΠ΅Ρ ΡΠ΅ΡΠ΅Π²ΡΠ΅ ΠΎΡΠΈΠ±ΠΊΠΈ Π² `NetworkError`. + - Ζ **upload_file** (`Function`) + - π ΠΠ°Π³ΡΡΠΆΠ°Π΅Ρ ΡΠ°ΠΉΠ» Π½Π° ΡΠ΅ΡΠ²Π΅Ρ ΡΠ΅ΡΠ΅Π· multipart/form-data. + - Ζ **_perform_upload** (`Function`) + - π (Helper) ΠΡΠΏΠΎΠ»Π½ΡΠ΅Ρ POST Π·Π°ΠΏΡΠΎΡ Ρ ΡΠ°ΠΉΠ»ΠΎΠΌ. + - Ζ **fetch_paginated_count** (`Function`) + - π ΠΠΎΠ»ΡΡΠ°Π΅Ρ ΠΎΠ±ΡΠ΅Π΅ ΠΊΠΎΠ»ΠΈΡΠ΅ΡΡΠ²ΠΎ ΡΠ»Π΅ΠΌΠ΅Π½ΡΠΎΠ² Π΄Π»Ρ ΠΏΠ°Π³ΠΈΠ½Π°ΡΠΈΠΈ. + - Ζ **fetch_paginated_data** (`Function`) + - π ΠΠ²ΡΠΎΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈ ΡΠΎΠ±ΠΈΡΠ°Π΅Ρ Π΄Π°Π½Π½ΡΠ΅ ΡΠΎ Π²ΡΠ΅Ρ ΡΡΡΠ°Π½ΠΈΡ ΠΏΠ°Π³ΠΈΠ½ΠΈΡΠΎΠ²Π°Π½Π½ΠΎΠ³ΠΎ ΡΠ½Π΄ΠΏΠΎΠΈΠ½ΡΠ°. + - Ζ **init_poolmanager** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.src.core.utils.matching** (`Module`) + - π Provides utility functions for fuzzy matching database names. + - ποΈ Layer: Core + - π Invariant: Confidence scores are returned as floats between 0.0 and 1.0. + - π DEPENDS_ON -> `rapidfuzz` + - Ζ **suggest_mappings** (`Function`) + - π Suggests mappings between source and target databases using fuzzy matching. +- π¦ **backend.core.utils.dataset_mapper** (`Module`) + - π ΠΡΠΎΡ ΠΌΠΎΠ΄ΡΠ»Ρ ΠΎΡΠ²Π΅ΡΠ°Π΅Ρ Π·Π° ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΌΠ΅ΡΠ°Π΄Π°Π½Π½ΡΡ (verbose_map) Π² Π΄Π°ΡΠ°ΡΠ΅ΡΠ°Ρ Superset, ΠΈΠ·Π²Π»Π΅ΠΊΠ°Ρ ΠΈΡ ΠΈΠ· PostgreSQL ΠΈΠ»ΠΈ XLSX-ΡΠ°ΠΉΠ»ΠΎΠ². + - ποΈ Layer: Domain + - π DEPENDS_ON -> `backend.core.superset_client` + - π DEPENDS_ON -> `pandas` + - π DEPENDS_ON -> `psycopg2` + - β **DatasetMapper** (`Class`) + - π ΠΠ»Π°ΡΡ Π΄Π»Ρ ΠΌΠ΅ΠΏΠΏΠΈΠ½Π³Π° ΠΈ ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΡ verbose_map Π² Π΄Π°ΡΠ°ΡΠ΅ΡΠ°Ρ Superset. + - Ζ **__init__** (`Function`) + - π Initializes the mapper. + - Ζ **get_postgres_comments** (`Function`) + - π ΠΠ·Π²Π»Π΅ΠΊΠ°Π΅Ρ ΠΊΠΎΠΌΠΌΠ΅Π½ΡΠ°ΡΠΈΠΈ ΠΊ ΠΊΠΎΠ»ΠΎΠ½ΠΊΠ°ΠΌ ΠΈΠ· ΡΠΈΡΡΠ΅ΠΌΠ½ΠΎΠ³ΠΎ ΠΊΠ°ΡΠ°Π»ΠΎΠ³Π° PostgreSQL. + - Ζ **load_excel_mappings** (`Function`) + - π ΠΠ°Π³ΡΡΠΆΠ°Π΅Ρ ΠΌΠ΅ΠΏΠΏΠΈΠ½Π³ΠΈ 'column_name' -> 'column_comment' ΠΈΠ· XLSX ΡΠ°ΠΉΠ»Π°. + - Ζ **run_mapping** (`Function`) + - π ΠΡΠ½ΠΎΠ²Π½Π°Ρ ΡΡΠ½ΠΊΡΠΈΡ Π΄Π»Ρ Π²ΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΡ ΠΌΠ΅ΠΏΠΏΠΈΠ½Π³Π° ΠΈ ΠΎΠ±Π½ΠΎΠ²Π»Π΅Π½ΠΈΡ verbose_map Π΄Π°ΡΠ°ΡΠ΅ΡΠ° Π² Superset. + - π CALLS -> `self.get_postgres_comments` + - π CALLS -> `self.load_excel_mappings` + - π CALLS -> `superset_client.get_dataset` + - π CALLS -> `superset_client.update_dataset` +- π¦ **test_logger** (`Module`) + - π Unit tests for logger module + - ποΈ Layer: Infra + - Ζ **test_belief_scope_logs_entry_action_exit_at_debug** (`Function`) + - π Test that belief_scope generates [ID][Entry], [ID][Action], and [ID][Exit] logs at DEBUG level. + - Ζ **test_belief_scope_error_handling** (`Function`) + - π Test that belief_scope logs Coherence:Failed on exception. + - Ζ **test_belief_scope_success_coherence** (`Function`) + - π Test that belief_scope logs Coherence:OK on success. + - Ζ **test_belief_scope_not_visible_at_info** (`Function`) + - π Test that belief_scope Entry/Exit/Coherence logs are NOT visible at INFO level. + - Ζ **test_task_log_level_default** (`Function`) + - π Test that default task log level is INFO. + - Ζ **test_should_log_task_level** (`Function`) + - π Test that should_log_task_level correctly filters log levels. + - Ζ **test_configure_logger_task_log_level** (`Function`) + - π Test that configure_logger updates task_log_level. + - Ζ **test_enable_belief_state_flag** (`Function`) + - π Test that enable_belief_state flag controls belief_scope logging. + - Ζ **test_belief_scope_missing_anchor** (`Function`) + - π Test @PRE condition: anchor_id must be provided + - Ζ **test_configure_logger_post_conditions** (`Function`) + - π Test @POST condition: Logger level, handlers, belief state flag, and task log level are updated. + - Ζ **reset_logger_state** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **TaskLoggerModule** (`Module`) `[CRITICAL]` + - π Provides a dedicated logger for tasks with automatic source attribution. + - ποΈ Layer: Core + - π Invariant: Each TaskLogger instance is bound to a specific task_id and default source. + - π DEPENDS_ON -> `TaskManager, CALLS -> TaskManager._add_log` + - β **TaskLogger** (`Class`) `[CRITICAL]` + - π A wrapper around TaskManager._add_log that carries task_id and source context. + - π Invariant: All log calls include the task_id and source. + - Ζ **__init__** (`Function`) + - π Initialize the TaskLogger with task context. + - Ζ **with_source** (`Function`) + - π Create a sub-logger with a different default source. + - Ζ **_log** (`Function`) + - π Internal method to log a message at a given level. + - Ζ **debug** (`Function`) + - π Log a DEBUG level message. + - Ζ **info** (`Function`) + - π Log an INFO level message. + - Ζ **warning** (`Function`) + - π Log a WARNING level message. + - Ζ **error** (`Function`) + - π Log an ERROR level message. + - Ζ **progress** (`Function`) + - π Log a progress update with percentage. +- π¦ **TaskPersistenceModule** (`Module`) `[CRITICAL]` + - π Handles the persistence of tasks using SQLAlchemy and the tasks.db database. + - ποΈ Layer: Core + - π Invariant: Database schema must match the TaskRecord model structure. + - β **TaskPersistenceService** (`Class`) `[CRITICAL]` + - π Provides methods to save and load tasks from the tasks.db database using SQLAlchemy. + - π Invariant: Persistence must handle potentially missing task fields natively. + - Ζ **_json_load_if_needed** (`Function`) + - π Safely load JSON strings from DB if necessary + - Ζ **_parse_datetime** (`Function`) + - π Safely parse a datetime string from the database + - Ζ **_resolve_environment_id** (`Function`) + - π Resolve environment id based on provided value or fallback to default + - Ζ **__init__** (`Function`) + - π Initializes the persistence service. + - Ζ **persist_task** (`Function`) + - π Persists or updates a single task in the database. + - Ζ **persist_tasks** (`Function`) + - π Persists multiple tasks. + - Ζ **load_tasks** (`Function`) + - π Loads tasks from the database. + - Ζ **delete_tasks** (`Function`) + - π Deletes specific tasks from the database. + - β **TaskLogPersistenceService** (`Class`) `[CRITICAL]` + - π Provides methods to save and query task logs from the task_logs table. + - π Invariant: Log entries are batch-inserted for performance. + - π DEPENDS_ON -> `TaskLogRecord` + - Ζ **__init__** (`Function`) + - π Initializes the TaskLogPersistenceService + - Ζ **add_logs** (`Function`) + - π Batch insert log entries for a task. + - Ζ **get_logs** (`Function`) + - π Query logs for a task with filtering and pagination. + - Ζ **get_log_stats** (`Function`) + - π Get statistics about logs for a task. + - Ζ **get_sources** (`Function`) + - π Get unique sources for a task's logs. + - Ζ **delete_logs_for_task** (`Function`) + - π Delete all logs for a specific task. + - Ζ **delete_logs_for_tasks** (`Function`) + - π Delete all logs for multiple tasks. + - Ζ **json_serializable** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **TaskManagerModule** (`Module`) `[CRITICAL]` + - π Manages the lifecycle of tasks, including their creation, execution, and state tracking. It uses a thread pool to run plugins asynchronously. + - ποΈ Layer: Core + - π Invariant: Task IDs are unique. + - β **TaskManager** (`Class`) `[CRITICAL]` + - π Manages the lifecycle of tasks, including their creation, execution, and state tracking. + - π Invariant: Log entries are never deleted after being added to a task. + - Ζ **__init__** (`Function`) + - π Initialize the TaskManager with dependencies. + - Ζ **_flusher_loop** (`Function`) + - π Background thread that periodically flushes log buffer to database. + - Ζ **_flush_logs** (`Function`) + - π Flush all buffered logs to the database. + - Ζ **_flush_task_logs** (`Function`) + - π Flush logs for a specific task immediately. + - Ζ **create_task** (`Function`) + - π Creates and queues a new task for execution. + - Ζ **_run_task** (`Function`) + - π Internal method to execute a task with TaskContext support. + - Ζ **resolve_task** (`Function`) + - π Resumes a task that is awaiting mapping. + - Ζ **wait_for_resolution** (`Function`) + - π Pauses execution and waits for a resolution signal. + - Ζ **wait_for_input** (`Function`) + - π Pauses execution and waits for user input. + - Ζ **get_task** (`Function`) + - π Retrieves a task by its ID. + - Ζ **get_all_tasks** (`Function`) + - π Retrieves all registered tasks. + - Ζ **get_tasks** (`Function`) + - π Retrieves tasks with pagination and optional status filter. + - Ζ **get_task_logs** (`Function`) + - π Retrieves logs for a specific task (from memory for running, persistence for completed). + - Ζ **get_task_log_stats** (`Function`) + - π Get statistics about logs for a task. + - Ζ **get_task_log_sources** (`Function`) + - π Get unique sources for a task's logs. + - Ζ **_add_log** (`Function`) + - π Adds a log entry to a task buffer and notifies subscribers. + - Ζ **subscribe_logs** (`Function`) + - π Subscribes to real-time logs for a task. + - Ζ **unsubscribe_logs** (`Function`) + - π Unsubscribes from real-time logs for a task. + - Ζ **load_persisted_tasks** (`Function`) + - π Load persisted tasks using persistence service. + - Ζ **await_input** (`Function`) + - π Transition a task to AWAITING_INPUT state with input request. + - Ζ **resume_task_with_password** (`Function`) + - π Resume a task that is awaiting input with provided passwords. + - Ζ **clear_tasks** (`Function`) + - π Clears tasks based on status filter (also deletes associated logs). + - Ζ **sort_key** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **TaskManagerModels** (`Module`) + - π Defines the data models and enumerations used by the Task Manager. + - ποΈ Layer: Core + - π Invariant: Task IDs are immutable once created. + - π¦ **TaskStatus** (`Enum`) `[TRIVIAL]` + - π Defines the possible states a task can be in during its lifecycle. + - π¦ **LogLevel** (`Enum`) + - π Defines the possible log levels for task logging. + - β **LogEntry** (`Class`) `[CRITICAL]` + - π A Pydantic model representing a single, structured log entry associated with a task. + - π Invariant: Each log entry has a unique timestamp and source. + - β **TaskLog** (`Class`) + - π A Pydantic model representing a persisted log entry from the database. + - β **LogFilter** (`Class`) + - π Filter parameters for querying task logs. + - β **LogStats** (`Class`) + - π Statistics about log entries for a task. + - β **Task** (`Class`) + - π A Pydantic model representing a single execution instance of a plugin, including its status, parameters, and logs. + - Ζ **__init__** (`Function`) + - π Initializes the Task model and validates input_request for AWAITING_INPUT status. +- π¦ **TaskCleanupModule** (`Module`) + - π Implements task cleanup and retention policies, including associated logs. + - ποΈ Layer: Core + - β **TaskCleanupService** (`Class`) + - π Provides methods to clean up old task records and their associated logs. + - Ζ **__init__** (`Function`) + - π Initializes the cleanup service with dependencies. + - Ζ **run_cleanup** (`Function`) + - π Deletes tasks older than the configured retention period and their logs. + - Ζ **delete_task_with_logs** (`Function`) + - π Delete a single task and all its associated logs. +- π¦ **TaskManagerPackage** (`Module`) `[TRIVIAL]` + - π Exports the public API of the task manager package. + - ποΈ Layer: Core +- π¦ **TaskContextModule** (`Module`) `[CRITICAL]` + - π Provides execution context passed to plugins during task execution. + - ποΈ Layer: Core + - π Invariant: Each TaskContext is bound to a single task execution. + - π DEPENDS_ON -> `TaskLogger, USED_BY -> plugins` + - β **TaskContext** (`Class`) `[CRITICAL]` + - π A container passed to plugin.execute() providing the logger and other task-specific utilities. + - π Invariant: logger is always a valid TaskLogger instance. + - Ζ **__init__** (`Function`) + - π Initialize the TaskContext with task-specific resources. + - Ζ **task_id** (`Function`) + - π Get the task ID. + - Ζ **logger** (`Function`) + - π Get the TaskLogger instance for this context. + - Ζ **params** (`Function`) + - π Get the task parameters. + - Ζ **get_param** (`Function`) + - π Get a specific parameter value with optional default. + - Ζ **create_sub_context** (`Function`) + - π Create a sub-context with a different default source. + - Ζ **execute** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.src.api.auth** (`Module`) + - π Authentication API endpoints. + - ποΈ Layer: API + - π Invariant: All auth endpoints must return consistent error codes. + - π¦ **router** (`Variable`) + - π APIRouter instance for authentication routes. + - Ζ **login_for_access_token** (`Function`) + - π Authenticates a user and returns a JWT access token. + - Ζ **read_users_me** (`Function`) + - π Retrieves the profile of the currently authenticated user. + - Ζ **logout** (`Function`) + - π Logs out the current user (placeholder for session revocation). + - Ζ **login_adfs** (`Function`) + - π Initiates the ADFS OIDC login flow. + - Ζ **auth_callback_adfs** (`Function`) + - π Handles the callback from ADFS after successful authentication. +- π¦ **router** (`Global`) + - π APIRouter instance for LLM routes. +- Ζ **_is_valid_runtime_api_key** (`Function`) + - π Validate decrypted runtime API key presence/shape. +- Ζ **get_providers** (`Function`) + - π Retrieve all LLM provider configurations. +- Ζ **get_llm_status** (`Function`) + - π Returns whether LLM runtime is configured for dashboard validation. +- Ζ **create_provider** (`Function`) + - π Create a new LLM provider configuration. +- Ζ **update_provider** (`Function`) + - π Update an existing LLM provider configuration. +- Ζ **delete_provider** (`Function`) + - π Delete an LLM provider configuration. +- Ζ **test_connection** (`Function`) + - π Test connection to an LLM provider. +- Ζ **test_provider_config** (`Function`) + - π Test connection with a provided configuration (not yet saved). +- π¦ **backend.src.api.routes.datasets** (`Module`) + - π API endpoints for the Dataset Hub - listing datasets with mapping progress + - ποΈ Layer: API + - π Invariant: All dataset responses include last_task metadata + - π DEPENDS_ON -> `backend.src.dependencies` + - π DEPENDS_ON -> `backend.src.services.resource_service` + - π DEPENDS_ON -> `backend.src.core.superset_client` + - π¦ **MappedFields** (`DataClass`) + - π¦ **LastTask** (`DataClass`) + - π¦ **DatasetItem** (`DataClass`) + - π¦ **LinkedDashboard** (`DataClass`) + - π¦ **DatasetColumn** (`DataClass`) + - π¦ **DatasetDetailResponse** (`DataClass`) + - π¦ **DatasetsResponse** (`DataClass`) + - π¦ **TaskResponse** (`DataClass`) + - Ζ **get_dataset_ids** (`Function`) + - π Fetch list of all dataset IDs from a specific environment (without pagination) + - π CALLS -> `ResourceService.get_datasets_with_status` + - Ζ **get_datasets** (`Function`) + - π Fetch list of datasets from a specific environment with mapping progress + - π CALLS -> `ResourceService.get_datasets_with_status` + - π¦ **MapColumnsRequest** (`DataClass`) + - Ζ **map_columns** (`Function`) + - π Trigger bulk column mapping for datasets + - π DISPATCHES -> `MapperPlugin` + - π CALLS -> `task_manager.create_task` + - π¦ **GenerateDocsRequest** (`DataClass`) + - Ζ **generate_docs** (`Function`) + - π Trigger bulk documentation generation for datasets + - π DISPATCHES -> `LLMAnalysisPlugin` + - π CALLS -> `task_manager.create_task` + - Ζ **get_dataset_detail** (`Function`) + - π Get detailed dataset information including columns and linked dashboards + - π CALLS -> `SupersetClient.get_dataset_detail` +- π¦ **backend.src.api.routes.git** (`Module`) + - π Provides FastAPI endpoints for Git integration operations. + - ποΈ Layer: API + - π Invariant: All Git operations must be routed through GitService. + - Ζ **get_git_configs** (`Function`) + - π List all configured Git servers. + - Ζ **create_git_config** (`Function`) + - π Register a new Git server configuration. + - Ζ **delete_git_config** (`Function`) + - π Remove a Git server configuration. + - Ζ **test_git_config** (`Function`) + - π Validate connection to a Git server using provided credentials. + - Ζ **init_repository** (`Function`) + - π Link a dashboard to a Git repository and perform initial clone/init. + - Ζ **get_branches** (`Function`) + - π List all branches for a dashboard's repository. + - Ζ **create_branch** (`Function`) + - π Create a new branch in the dashboard's repository. + - Ζ **checkout_branch** (`Function`) + - π Switch the dashboard's repository to a specific branch. + - Ζ **commit_changes** (`Function`) + - π Stage and commit changes in the dashboard's repository. + - Ζ **push_changes** (`Function`) + - π Push local commits to the remote repository. + - Ζ **pull_changes** (`Function`) + - π Pull changes from the remote repository. + - Ζ **sync_dashboard** (`Function`) + - π Sync dashboard state from Superset to Git using the GitPlugin. + - Ζ **get_environments** (`Function`) + - π List all deployment environments. + - Ζ **deploy_dashboard** (`Function`) + - π Deploy dashboard from Git to a target environment. + - Ζ **get_history** (`Function`) + - π View commit history for a dashboard's repository. + - Ζ **get_repository_status** (`Function`) + - π Get current Git status for a dashboard repository. + - Ζ **get_repository_diff** (`Function`) + - π Get Git diff for a dashboard repository. + - Ζ **generate_commit_message** (`Function`) + - π Generate a suggested commit message using LLM. +- π¦ **ConnectionsRouter** (`Module`) + - π Defines the FastAPI router for managing external database connections. + - ποΈ Layer: UI (API) + - β **ConnectionSchema** (`Class`) + - π Pydantic model for connection response. + - β **ConnectionCreate** (`Class`) + - π Pydantic model for creating a connection. + - Ζ **list_connections** (`Function`) + - π Lists all saved connections. + - Ζ **create_connection** (`Function`) + - π Creates a new connection configuration. + - Ζ **delete_connection** (`Function`) + - π Deletes a connection configuration. +- π¦ **backend.src.api.routes.environments** (`Module`) + - π API endpoints for listing environments and their databases. + - ποΈ Layer: API + - π Invariant: Environment IDs must exist in the configuration. + - π DEPENDS_ON -> `backend.src.dependencies` + - π DEPENDS_ON -> `backend.src.core.superset_client` + - π¦ **ScheduleSchema** (`DataClass`) + - π¦ **EnvironmentResponse** (`DataClass`) + - π¦ **DatabaseResponse** (`DataClass`) + - Ζ **get_environments** (`Function`) + - π List all configured environments. + - ποΈ Layer: API + - Ζ **update_environment_schedule** (`Function`) + - π Update backup schedule for an environment. + - ποΈ Layer: API + - Ζ **get_environment_databases** (`Function`) + - π Fetch the list of databases from a specific environment. + - ποΈ Layer: API +- π¦ **backend.src.api.routes.migration** (`Module`) + - π API endpoints for migration operations. + - ποΈ Layer: API + - π DEPENDS_ON -> `backend.src.dependencies` + - π DEPENDS_ON -> `backend.src.models.dashboard` + - Ζ **get_dashboards** (`Function`) + - π Fetch all dashboards from the specified environment for the grid. + - Ζ **execute_migration** (`Function`) + - π Execute the migration of selected dashboards. + - Ζ **get_migration_settings** (`Function`) + - π Get current migration Cron string explicitly. + - Ζ **update_migration_settings** (`Function`) + - π Update migration Cron string. + - Ζ **get_resource_mappings** (`Function`) + - π Fetch synchronized object mappings with search, filtering, and pagination. + - Ζ **trigger_sync_now** (`Function`) + - π Triggers an immediate ID synchronization for all environments. +- π¦ **PluginsRouter** (`Module`) + - π Defines the FastAPI router for plugin-related endpoints, allowing clients to list available plugins. + - ποΈ Layer: UI (API) + - Ζ **list_plugins** (`Function`) + - π Retrieve a list of all available plugins. +- π¦ **backend.src.api.routes.mappings** (`Module`) + - π API endpoints for managing database mappings and getting suggestions. + - ποΈ Layer: API + - π Invariant: Mappings are persisted in the SQLite database. + - π DEPENDS_ON -> `backend.src.dependencies` + - π DEPENDS_ON -> `backend.src.core.database` + - π DEPENDS_ON -> `backend.src.services.mapping_service` + - π¦ **MappingCreate** (`DataClass`) + - π¦ **MappingResponse** (`DataClass`) + - π¦ **SuggestRequest** (`DataClass`) + - Ζ **get_mappings** (`Function`) + - π List all saved database mappings. + - Ζ **create_mapping** (`Function`) + - π Create or update a database mapping. + - Ζ **suggest_mappings_api** (`Function`) + - π Get suggested mappings based on fuzzy matching. +- π¦ **SettingsRouter** (`Module`) + - π Provides API endpoints for managing application settings and Superset environments. + - ποΈ Layer: UI (API) + - π Invariant: All settings changes must be persisted via ConfigManager. + - π DEPENDS_ON -> `ConfigManager` + - π DEPENDS_ON -> `ConfigModels` + - β **LoggingConfigResponse** (`Class`) + - π Response model for logging configuration with current task log level. + - Ζ **get_settings** (`Function`) + - π Retrieves all application settings. + - Ζ **update_global_settings** (`Function`) + - π Updates global application settings. + - Ζ **get_storage_settings** (`Function`) + - π Retrieves storage-specific settings. + - Ζ **update_storage_settings** (`Function`) + - π Updates storage-specific settings. + - Ζ **get_environments** (`Function`) + - π Lists all configured Superset environments. + - Ζ **add_environment** (`Function`) + - π Adds a new Superset environment. + - Ζ **update_environment** (`Function`) + - π Updates an existing Superset environment. + - Ζ **delete_environment** (`Function`) + - π Deletes a Superset environment. + - Ζ **test_environment_connection** (`Function`) + - π Tests the connection to a Superset environment. + - Ζ **get_logging_config** (`Function`) + - π Retrieves current logging configuration. + - Ζ **update_logging_config** (`Function`) + - π Updates logging configuration. + - β **ConsolidatedSettingsResponse** (`Class`) + - Ζ **get_consolidated_settings** (`Function`) + - π Retrieves all settings categories in a single call + - Ζ **update_consolidated_settings** (`Function`) + - π Bulk update application settings from the consolidated view. +- π¦ **backend.src.api.routes.admin** (`Module`) + - π Admin API endpoints for user and role management. + - ποΈ Layer: API + - π Invariant: All endpoints in this module require 'Admin' role or 'admin' scope. + - π¦ **router** (`Variable`) + - π APIRouter instance for admin routes. + - Ζ **list_users** (`Function`) + - π Lists all registered users. + - Ζ **create_user** (`Function`) + - π Creates a new local user. + - Ζ **update_user** (`Function`) + - π Updates an existing user. + - Ζ **delete_user** (`Function`) + - π Deletes a user. + - Ζ **list_roles** (`Function`) + - π Lists all available roles. + - π CALLS -> `backend.src.models.auth.Role` + - Ζ **create_role** (`Function`) + - π Creates a new system role with associated permissions. + - π CALLS -> `backend.src.core.auth.repository.AuthRepository.get_permission_by_id` + - Ζ **update_role** (`Function`) + - π Updates an existing role's metadata and permissions. + - π CALLS -> `backend.src.core.auth.repository.AuthRepository.get_role_by_id` + - Ζ **delete_role** (`Function`) + - π Removes a role from the system. + - π CALLS -> `backend.src.core.auth.repository.AuthRepository.get_role_by_id` + - Ζ **list_permissions** (`Function`) + - π Lists all available system permissions for assignment. + - π CALLS -> `backend.src.core.auth.repository.AuthRepository.list_permissions` + - Ζ **list_ad_mappings** (`Function`) + - π Lists all AD Group to Role mappings. + - Ζ **create_ad_mapping** (`Function`) + - π Creates a new AD Group mapping. +- π¦ **backend.src.api.routes.git_schemas** (`Module`) + - π Defines Pydantic models for the Git integration API layer. + - ποΈ Layer: API + - π Invariant: All schemas must be compatible with the FastAPI router. + - π DEPENDS_ON -> `backend.src.models.git` + - β **GitServerConfigBase** (`Class`) `[TRIVIAL]` + - π Base schema for Git server configuration attributes. + - β **GitServerConfigCreate** (`Class`) + - π Schema for creating a new Git server configuration. + - β **GitServerConfigSchema** (`Class`) + - π Schema for representing a Git server configuration with metadata. + - β **GitRepositorySchema** (`Class`) + - π Schema for tracking a local Git repository linked to a dashboard. + - β **BranchSchema** (`Class`) + - π Schema for representing a Git branch metadata. + - β **CommitSchema** (`Class`) + - π Schema for representing Git commit details. + - β **BranchCreate** (`Class`) + - π Schema for branch creation requests. + - β **BranchCheckout** (`Class`) + - π Schema for branch checkout requests. + - β **CommitCreate** (`Class`) + - π Schema for staging and committing changes. + - β **ConflictResolution** (`Class`) + - π Schema for resolving merge conflicts. + - β **DeploymentEnvironmentSchema** (`Class`) + - π Schema for representing a target deployment environment. + - β **DeployRequest** (`Class`) + - π Schema for dashboard deployment requests. + - β **RepoInitRequest** (`Class`) + - π Schema for repository initialization requests. +- π¦ **backend.src.api.routes.assistant** (`Module`) + - π API routes for LLM assistant command parsing and safe execution orchestration. + - ποΈ Layer: API + - π Invariant: Risky operations are never executed without valid confirmation token. + - π DEPENDS_ON -> `backend.src.core.task_manager` + - π DEPENDS_ON -> `backend.src.models.assistant` + - β **AssistantMessageRequest** (`Class`) `[TRIVIAL]` + - π Input payload for assistant message endpoint. + - β **AssistantAction** (`Class`) `[TRIVIAL]` + - π UI action descriptor returned with assistant responses. + - β **AssistantMessageResponse** (`Class`) + - π Output payload contract for assistant interaction endpoints. + - β **ConfirmationRecord** (`Class`) + - π In-memory confirmation token model for risky operation dispatch. + - Ζ **_append_history** (`Function`) + - π Append conversation message to in-memory history buffer. + - Ζ **_persist_message** (`Function`) + - π Persist assistant/user message record to database. + - Ζ **_audit** (`Function`) + - π Append in-memory audit record for assistant decision trace. + - Ζ **_persist_audit** (`Function`) + - π Persist structured assistant audit payload in database. + - Ζ **_persist_confirmation** (`Function`) + - π Persist confirmation token record to database. + - Ζ **_update_confirmation_state** (`Function`) + - π Update persistent confirmation token lifecycle state. + - Ζ **_load_confirmation_from_db** (`Function`) + - π Load confirmation token from database into in-memory model. + - Ζ **_ensure_conversation** (`Function`) + - π Resolve active conversation id in memory or create a new one. + - Ζ **_resolve_or_create_conversation** (`Function`) + - π Resolve active conversation using explicit id, memory cache, or persisted history. + - Ζ **_cleanup_history_ttl** (`Function`) + - π Enforce assistant message retention window by deleting expired rows and in-memory records. + - Ζ **_is_conversation_archived** (`Function`) + - π Determine archived state for a conversation based on last update timestamp. + - Ζ **_coerce_query_bool** (`Function`) + - π Normalize bool-like query values for compatibility in direct handler invocations/tests. + - Ζ **_extract_id** (`Function`) + - π Extract first regex match group from text by ordered pattern list. + - Ζ **_resolve_env_id** (`Function`) + - π Resolve environment identifier/name token to canonical environment id. + - Ζ **_is_production_env** (`Function`) + - π Determine whether environment token resolves to production-like target. + - Ζ **_resolve_provider_id** (`Function`) + - π Resolve provider token to provider id with active/default fallback. + - Ζ **_get_default_environment_id** (`Function`) + - π Resolve default environment id from settings or first configured environment. + - Ζ **_resolve_dashboard_id_by_ref** (`Function`) + - π Resolve dashboard id by title or slug reference in selected environment. + - Ζ **_resolve_dashboard_id_entity** (`Function`) + - π Resolve dashboard id from intent entities using numeric id or dashboard_ref fallback. + - Ζ **_get_environment_name_by_id** (`Function`) + - π Resolve human-readable environment name by id. + - Ζ **_extract_result_deep_links** (`Function`) + - π Build deep-link actions to verify task result from assistant chat. + - Ζ **_build_task_observability_summary** (`Function`) + - π Build compact textual summary for completed tasks to reduce "black box" effect. + - Ζ **_parse_command** (`Function`) + - π Deterministically parse RU/EN command text into intent payload. + - Ζ **_check_any_permission** (`Function`) + - π Validate user against alternative permission checks (logical OR). + - Ζ **_has_any_permission** (`Function`) + - π Check whether user has at least one permission tuple from the provided list. + - Ζ **_build_tool_catalog** (`Function`) + - π Build current-user tool catalog for LLM planner with operation contracts and defaults. + - Ζ **_coerce_intent_entities** (`Function`) + - π Normalize intent entity value types from LLM output to route-compatible values. + - Ζ **_confirmation_summary** (`Function`) + - π Build human-readable confirmation prompt for an intent before execution. + - Ζ **_clarification_text_for_intent** (`Function`) + - π Convert technical missing-parameter errors into user-facing clarification prompts. + - Ζ **_plan_intent_with_llm** (`Function`) + - π Use active LLM provider to select best tool/operation from dynamic catalog. + - Ζ **_authorize_intent** (`Function`) + - π Validate user permissions for parsed intent before confirmation/dispatch. + - Ζ **_dispatch_intent** (`Function`) + - π Execute parsed assistant intent via existing task/plugin/git services. + - Ζ **send_message** (`Function`) + - π Parse assistant command, enforce safety gates, and dispatch executable intent. + - Ζ **confirm_operation** (`Function`) + - π Execute previously requested risky operation after explicit user confirmation. + - Ζ **cancel_operation** (`Function`) + - π Cancel pending risky operation and mark confirmation token as cancelled. + - Ζ **list_conversations** (`Function`) + - π Return paginated conversation list for current user with archived flag and last message preview. + - Ζ **get_history** (`Function`) + - π Retrieve paginated assistant conversation history for current user. + - Ζ **get_assistant_audit** (`Function`) + - π Return assistant audit decisions for current user from persistent and in-memory stores. + - Ζ **_label** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **storage_routes** (`Module`) + - π API endpoints for file storage management (backups and repositories). + - ποΈ Layer: API + - π Invariant: All paths must be validated against path traversal. + - π DEPENDS_ON -> `backend.src.models.storage` + - Ζ **list_files** (`Function`) + - π List all files and directories in the storage system. + - π CALLS -> `StoragePlugin.list_files` + - Ζ **upload_file** (`Function`) + - π Upload a file to the storage system. + - π CALLS -> `StoragePlugin.save_file` + - Ζ **delete_file** (`Function`) + - π Delete a specific file or directory. + - π CALLS -> `StoragePlugin.delete_file` + - Ζ **download_file** (`Function`) + - π Retrieve a file for download. + - π CALLS -> `StoragePlugin.get_file_path` + - Ζ **get_file_by_path** (`Function`) + - π Retrieve a file by validated absolute/relative path under storage root. + - π CALLS -> `StoragePlugin.get_storage_root` + - π CALLS -> `StoragePlugin.validate_path` +- π¦ **ReportsRouter** (`Module`) `[CRITICAL]` + - π FastAPI router for unified task report list and detail retrieval endpoints. + - ποΈ Layer: UI (API) + - π Invariant: Endpoints are read-only and do not trigger long-running tasks. + - π DEPENDS_ON -> `backend.src.services.reports.report_service.ReportsService` + - π DEPENDS_ON -> `backend.src.dependencies` + - Ζ **_parse_csv_enum_list** (`Function`) + - π Parse comma-separated query value into enum list. + - Ζ **list_reports** (`Function`) + - π Return paginated unified reports list. + - Ζ **get_report_detail** (`Function`) + - π Return one normalized report detail with diagnostics and next actions. +- π¦ **backend.src.api.routes.__init__** (`Module`) + - π Provide lazy route module loading to avoid heavyweight imports during tests. + - ποΈ Layer: API + - π Invariant: Only names listed in __all__ are importable via __getattr__. + - π DEPENDS_ON -> `importlib` + - Ζ **__getattr__** (`Function`) `[TRIVIAL]` + - π Lazily import route module by attribute name. +- π¦ **TasksRouter** (`Module`) + - π Defines the FastAPI router for task-related endpoints, allowing clients to create, list, and get the status of tasks. + - ποΈ Layer: UI (API) + - Ζ **create_task** (`Function`) + - π Create and start a new task for a given plugin. + - Ζ **list_tasks** (`Function`) + - π Retrieve a list of tasks with pagination and optional status filter. + - Ζ **get_task** (`Function`) + - π Retrieve the details of a specific task. + - Ζ **get_task_logs** (`Function`) `[CRITICAL]` + - π Retrieve logs for a specific task with optional filtering. + - Ζ **get_task_log_stats** (`Function`) + - π Get statistics about logs for a task (counts by level and source). + - Ζ **get_task_log_sources** (`Function`) + - π Get unique sources for a task's logs. + - Ζ **resolve_task** (`Function`) + - π Resolve a task that is awaiting mapping. + - Ζ **resume_task** (`Function`) + - π Resume a task that is awaiting input (e.g., passwords). + - Ζ **clear_tasks** (`Function`) + - π Clear tasks matching the status filter. +- π¦ **backend.src.api.routes.dashboards** (`Module`) `[CRITICAL]` + - π API endpoints for the Dashboard Hub - listing dashboards with Git and task status + - ποΈ Layer: API + - π Invariant: All dashboard responses include git_status and last_task metadata + - π DEPENDS_ON -> `backend.src.dependencies` + - π DEPENDS_ON -> `backend.src.services.resource_service` + - π DEPENDS_ON -> `backend.src.core.superset_client` + - π¦ **GitStatus** (`DataClass`) + - π¦ **LastTask** (`DataClass`) + - π¦ **DashboardItem** (`DataClass`) + - π¦ **DashboardsResponse** (`DataClass`) + - π¦ **DashboardChartItem** (`DataClass`) + - π¦ **DashboardDatasetItem** (`DataClass`) + - π¦ **DashboardDetailResponse** (`DataClass`) + - π¦ **DashboardTaskHistoryItem** (`DataClass`) + - π¦ **DashboardTaskHistoryResponse** (`DataClass`) + - π¦ **DatabaseMapping** (`DataClass`) + - π¦ **DatabaseMappingsResponse** (`DataClass`) + - Ζ **get_dashboards** (`Function`) + - π Fetch list of dashboards from a specific environment with Git status and last task status + - π CALLS -> `ResourceService.get_dashboards_with_status` + - Ζ **get_database_mappings** (`Function`) + - π Get database mapping suggestions between source and target environments + - π CALLS -> `MappingService.get_suggestions` + - Ζ **get_dashboard_detail** (`Function`) + - π Fetch detailed dashboard info with related charts and datasets + - π CALLS -> `SupersetClient.get_dashboard_detail` + - Ζ **_task_matches_dashboard** (`Function`) + - π Checks whether task params are tied to a specific dashboard and environment. + - Ζ **get_dashboard_tasks_history** (`Function`) + - π Returns history of backup and LLM validation tasks for a dashboard. + - Ζ **get_dashboard_thumbnail** (`Function`) + - π Proxies Superset dashboard thumbnail with cache support. + - π¦ **MigrateRequest** (`DataClass`) + - π¦ **TaskResponse** (`DataClass`) + - Ζ **migrate_dashboards** (`Function`) + - π Trigger bulk migration of dashboards from source to target environment + - π DISPATCHES -> `MigrationPlugin` + - π CALLS -> `task_manager.create_task` + - π¦ **BackupRequest** (`DataClass`) + - Ζ **backup_dashboards** (`Function`) + - π Trigger bulk backup of dashboards with optional cron schedule + - π DISPATCHES -> `BackupPlugin` + - π CALLS -> `task_manager.create_task` + - Ζ **_sort_key** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.src.api.routes.__tests__.test_dashboards** (`Module`) + - π Unit tests for Dashboards API endpoints + - ποΈ Layer: API + - Ζ **test_get_dashboards_success** (`Function`) + - Ζ **test_get_dashboards_with_search** (`Function`) + - Ζ **test_get_dashboards_empty** (`Function`) + - Ζ **test_get_dashboards_superset_failure** (`Function`) + - Ζ **test_get_dashboards_env_not_found** (`Function`) + - Ζ **test_get_dashboards_invalid_pagination** (`Function`) + - Ζ **test_get_dashboard_detail_success** (`Function`) + - Ζ **test_get_dashboard_detail_env_not_found** (`Function`) + - Ζ **test_migrate_dashboards_success** (`Function`) + - Ζ **test_migrate_dashboards_no_ids** (`Function`) + - Ζ **test_migrate_dashboards_env_not_found** (`Function`) + - Ζ **test_backup_dashboards_success** (`Function`) + - Ζ **test_backup_dashboards_env_not_found** (`Function`) + - Ζ **test_get_database_mappings_success** (`Function`) + - Ζ **test_get_database_mappings_env_not_found** (`Function`) + - Ζ **test_get_dashboard_tasks_history_filters_success** (`Function`) + - Ζ **test_get_dashboard_thumbnail_success** (`Function`) + - Ζ **mock_deps** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **mock_get_dashboards** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_network_request** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.tests.test_reports_openapi_conformance** (`Module`) + - π Validate implemented reports payload shape against OpenAPI-required top-level contract fields. + - ποΈ Layer: Domain (Tests) + - π Invariant: List and detail payloads include required contract keys. + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **get_all_tasks** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_admin_user** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_task** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_reports_list_openapi_required_keys** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_reports_detail_openapi_required_keys** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.tests.test_reports_api** (`Module`) + - π Contract tests for GET /api/reports defaults, pagination, and filtering behavior. + - ποΈ Layer: Domain (Tests) + - π Invariant: API response contract contains {items,total,page,page_size,has_next,applied_filters}. + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **get_all_tasks** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_admin_user** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_make_task** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_reports_default_pagination_contract** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_reports_filter_and_pagination** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_reports_handles_mixed_naive_and_aware_datetimes** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_reports_invalid_filter_returns_400** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.src.api.routes.__tests__.test_datasets** (`Module`) + - π Unit tests for Datasets API endpoints + - ποΈ Layer: API + - π Invariant: Endpoint contracts remain stable for success and validation failure paths. + - Ζ **test_get_datasets_success** (`Function`) + - π Validate successful datasets listing contract for an existing environment. + - Ζ **test_get_datasets_env_not_found** (`Function`) + - Ζ **test_get_datasets_invalid_pagination** (`Function`) + - Ζ **test_map_columns_success** (`Function`) + - Ζ **test_map_columns_invalid_source_type** (`Function`) + - Ζ **test_generate_docs_success** (`Function`) + - Ζ **test_map_columns_empty_ids** (`Function`) + - Ζ **test_generate_docs_empty_ids** (`Function`) + - Ζ **test_generate_docs_env_not_found** (`Function`) + - Ζ **test_get_datasets_superset_failure** (`Function`) + - Ζ **mock_deps** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.tests.test_reports_detail_api** (`Module`) + - π Contract tests for GET /api/reports/{report_id} detail endpoint behavior. + - ποΈ Layer: Domain (Tests) + - π Invariant: Detail endpoint tests must keep deterministic assertions for success and not-found contracts. + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **get_all_tasks** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_admin_user** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_make_task** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_report_detail_success** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_report_detail_not_found** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.src.api.routes.__tests__.test_assistant_authz** (`Module`) + - π Verify assistant confirmation ownership, expiration, and deny behavior for restricted users. + - ποΈ Layer: UI (API Tests) + - π Invariant: Security-sensitive flows fail closed for unauthorized actors. + - π DEPENDS_ON -> `backend.src.api.routes.assistant` + - Ζ **_run_async** (`Function`) `[TRIVIAL]` + - π Execute async endpoint handler in synchronous test context. + - β **_FakeTask** (`Class`) `[TRIVIAL]` + - π Lightweight task model used for assistant authz tests. + - β **_FakeTaskManager** (`Class`) `[TRIVIAL]` + - π Minimal task manager for deterministic operation creation and lookup. + - β **_FakeConfigManager** (`Class`) `[TRIVIAL]` + - π Provide deterministic environment aliases required by intent parsing. + - Ζ **_admin_user** (`Function`) `[TRIVIAL]` + - π Build admin principal fixture. + - Ζ **_other_admin_user** (`Function`) `[TRIVIAL]` + - π Build second admin principal fixture for ownership tests. + - Ζ **_limited_user** (`Function`) `[TRIVIAL]` + - π Build limited principal without required assistant execution privileges. + - β **_FakeQuery** (`Class`) `[TRIVIAL]` + - π Minimal chainable query object for fake DB interactions. + - β **_FakeDb** (`Class`) `[TRIVIAL]` + - π In-memory session substitute for assistant route persistence calls. + - Ζ **_clear_assistant_state** (`Function`) `[TRIVIAL]` + - π Reset assistant process-local state between test cases. + - Ζ **test_confirmation_owner_mismatch_returns_403** (`Function`) + - π Confirm endpoint should reject requests from user that does not own the confirmation token. + - Ζ **test_expired_confirmation_cannot_be_confirmed** (`Function`) + - π Expired confirmation token should be rejected and not create task. + - Ζ **test_limited_user_cannot_launch_restricted_operation** (`Function`) + - π Limited user should receive denied state for privileged operation. + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **create_task** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **get_task** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **get_tasks** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **get_environments** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **filter** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **order_by** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **first** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **all** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **limit** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **offset** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **count** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **add** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **merge** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **query** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **commit** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **rollback** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.src.api.routes.__tests__.test_assistant_api** (`Module`) + - π Validate assistant API endpoint logic via direct async handler invocation. + - ποΈ Layer: UI (API Tests) + - π Invariant: Every test clears assistant in-memory state before execution. + - π DEPENDS_ON -> `backend.src.api.routes.assistant` + - Ζ **_run_async** (`Function`) `[TRIVIAL]` + - π Execute async endpoint handler in synchronous test context. + - β **_FakeTask** (`Class`) `[TRIVIAL]` + - π Lightweight task stub used by assistant API tests. + - β **_FakeTaskManager** (`Class`) `[TRIVIAL]` + - π Minimal async-compatible TaskManager fixture for deterministic test flows. + - β **_FakeConfigManager** (`Class`) `[TRIVIAL]` + - π Environment config fixture with dev/prod aliases for parser tests. + - Ζ **_admin_user** (`Function`) `[TRIVIAL]` + - π Build admin principal fixture. + - Ζ **_limited_user** (`Function`) `[TRIVIAL]` + - π Build non-admin principal fixture. + - β **_FakeQuery** (`Class`) `[TRIVIAL]` + - π Minimal chainable query object for fake SQLAlchemy-like DB behavior in tests. + - β **_FakeDb** (`Class`) `[TRIVIAL]` + - π In-memory fake database implementing subset of Session interface used by assistant routes. + - Ζ **_clear_assistant_state** (`Function`) `[TRIVIAL]` + - π Reset in-memory assistant registries for isolation between tests. + - Ζ **test_unknown_command_returns_needs_clarification** (`Function`) + - π Unknown command should return clarification state and unknown intent. + - Ζ **test_capabilities_question_returns_successful_help** (`Function`) + - π Capability query should return deterministic help response, not clarification. + - Ζ **test_non_admin_command_returns_denied** (`Function`) + - π Non-admin user must receive denied state for privileged command. + - Ζ **test_migration_to_prod_requires_confirmation_and_can_be_confirmed** (`Function`) + - π Migration to prod must require confirmation and then start task after explicit confirm. + - Ζ **test_status_query_returns_task_status** (`Function`) + - π Task status command must surface current status text for existing task id. + - Ζ **test_status_query_without_task_id_returns_latest_user_task** (`Function`) + - π Status command without explicit task_id should resolve to latest task for current user. + - Ζ **test_llm_validation_with_dashboard_ref_requires_confirmation** (`Function`) + - π LLM validation with dashboard_ref should now require confirmation before dispatch. + - Ζ **test_list_conversations_groups_by_conversation_and_marks_archived** (`Function`) + - π Conversations endpoint must group messages and compute archived marker by inactivity threshold. + - Ζ **test_history_from_latest_returns_recent_page_first** (`Function`) + - π History endpoint from_latest mode must return newest page while preserving chronological order in chunk. + - Ζ **test_list_conversations_archived_only_filters_active** (`Function`) + - π archived_only mode must return only archived conversations. + - Ζ **test_guarded_operation_always_requires_confirmation** (`Function`) + - π Non-dangerous (guarded) commands must still require confirmation before execution. + - Ζ **test_guarded_operation_confirm_roundtrip** (`Function`) + - π Guarded operation must execute successfully after explicit confirmation. + - Ζ **test_confirm_nonexistent_id_returns_404** (`Function`) + - π Confirming a non-existent ID should raise 404. + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **create_task** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **get_task** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **get_tasks** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **get_environments** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **filter** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **order_by** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **first** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **all** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **count** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **offset** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **limit** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **add** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **merge** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **query** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **commit** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **rollback** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.src.api.routes.__tests__.test_migration_routes** (`Module`) + - π Unit tests for migration API route handlers. + - ποΈ Layer: API + - Ζ **db_session** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_make_config_manager** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_migration_settings_returns_default_cron** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_migration_settings_returns_fallback_when_no_cron** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_update_migration_settings_saves_cron** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_update_migration_settings_rejects_missing_cron** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_resource_mappings_returns_formatted_list** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_resource_mappings_respects_pagination** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_resource_mappings_search_by_name** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_resource_mappings_filter_by_env** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_resource_mappings_filter_by_type** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_mock_env** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_make_sync_config_manager** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_trigger_sync_now_creates_env_row_and_syncs** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_trigger_sync_now_rejects_empty_environments** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_trigger_sync_now_handles_partial_failure** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_trigger_sync_now_idempotent_env_upsert** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboards_success** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboards_invalid_env_raises_404** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_execute_migration_success** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_execute_migration_invalid_env_raises_400** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.src.models.config** (`Module`) + - π Defines database schema for persisted application configuration. + - ποΈ Layer: Domain + - π DEPENDS_ON -> `sqlalchemy` + - β **AppConfigRecord** (`Class`) + - π Stores the single source of truth for application configuration. +- π¦ **backend.src.models.llm** (`Module`) + - π SQLAlchemy models for LLM provider configuration and validation results. + - ποΈ Layer: Domain + - β **LLMProvider** (`Class`) + - π SQLAlchemy model for LLM provider configuration. + - β **ValidationRecord** (`Class`) + - π SQLAlchemy model for dashboard validation history. + - Ζ **generate_uuid** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **GitModels** (`Module`) `[TRIVIAL]` + - π Git-specific SQLAlchemy models for configuration and repository tracking. + - ποΈ Layer: Model + - β **GitServerConfig** (`Class`) `[TRIVIAL]` + - π Configuration for a Git server connection. + - β **GitRepository** (`Class`) `[TRIVIAL]` + - π Tracking for a local Git repository linked to a dashboard. + - β **DeploymentEnvironment** (`Class`) `[TRIVIAL]` + - π Target Superset environments for dashboard deployment. +- π¦ **backend.src.models.task** (`Module`) `[TRIVIAL]` + - π Defines the database schema for task execution records. + - ποΈ Layer: Domain + - π Invariant: All primary keys are UUID strings. + - π DEPENDS_ON -> `sqlalchemy` + - β **TaskRecord** (`Class`) `[TRIVIAL]` + - π Represents a persistent record of a task execution. + - β **TaskLogRecord** (`Class`) `[CRITICAL]` + - π Represents a single persistent log entry for a task. + - π Invariant: Each log entry belongs to exactly one task. + - π DEPENDS_ON -> `TaskRecord` +- π¦ **backend.src.models.connection** (`Module`) `[TRIVIAL]` + - π Defines the database schema for external database connection configurations. + - ποΈ Layer: Domain + - π Invariant: All primary keys are UUID strings. + - π DEPENDS_ON -> `sqlalchemy` + - β **ConnectionConfig** (`Class`) `[TRIVIAL]` + - π Stores credentials for external databases used for column mapping. +- π¦ **backend.src.models.mapping** (`Module`) + - π Defines the database schema for environment metadata and database mappings using SQLAlchemy. + - ποΈ Layer: Domain + - π Invariant: All primary keys are UUID strings. + - π DEPENDS_ON -> `sqlalchemy` + - β **ResourceType** (`Class`) `[TRIVIAL]` + - π Enumeration of possible Superset resource types for ID mapping. + - β **MigrationStatus** (`Class`) `[TRIVIAL]` + - π Enumeration of possible migration job statuses. + - β **Environment** (`Class`) + - π Represents a Superset instance environment. + - β **DatabaseMapping** (`Class`) + - π Represents a mapping between source and target databases. + - β **MigrationJob** (`Class`) `[TRIVIAL]` + - π Represents a single migration execution job. + - β **ResourceMapping** (`Class`) + - π Maps a universal UUID for a resource to its actual ID on a specific environment. +- π¦ **backend.src.models.report** (`Module`) `[CRITICAL]` + - π Canonical report schemas for unified task reporting across heterogeneous task types. + - ποΈ Layer: Domain + - π Invariant: Canonical report fields are always present for every report item. + - π DEPENDS_ON -> `backend.src.core.task_manager.models` + - β **TaskType** (`Class`) `[CRITICAL]` + - π Supported normalized task report types. + - π Invariant: Must contain valid generic task type mappings. + - β **ReportStatus** (`Class`) `[CRITICAL]` + - π Supported normalized report status values. + - π Invariant: TaskStatus enum mapping logic holds. + - β **ErrorContext** (`Class`) `[CRITICAL]` + - π Error and recovery context for failed/partial reports. + - π Invariant: The properties accurately describe error state. + - β **TaskReport** (`Class`) `[CRITICAL]` + - π Canonical normalized report envelope for one task execution. + - π Invariant: Must represent canonical task record attributes. + - β **ReportQuery** (`Class`) `[CRITICAL]` + - π Query object for server-side report filtering, sorting, and pagination. + - π Invariant: Time and pagination queries are mutually consistent. + - β **ReportCollection** (`Class`) `[CRITICAL]` + - π Paginated collection of normalized task reports. + - π Invariant: Represents paginated data correctly. + - β **ReportDetailView** (`Class`) `[CRITICAL]` + - π Detailed report representation including diagnostics and recovery actions. + - π Invariant: Incorporates a report and logs correctly. + - Ζ **_non_empty_str** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_validate_sort_by** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_validate_sort_order** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_validate_time_range** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.src.models.assistant** (`Module`) + - π SQLAlchemy models for assistant audit trail and confirmation tokens. + - ποΈ Layer: Domain + - π Invariant: Assistant records preserve immutable ids and creation timestamps. + - π DEPENDS_ON -> `backend.src.models.mapping` + - β **AssistantAuditRecord** (`Class`) + - π Store audit decisions and outcomes produced by assistant command handling. + - β **AssistantMessageRecord** (`Class`) + - π Persist chat history entries for assistant conversations. + - β **AssistantConfirmationRecord** (`Class`) + - π Persist risky operation confirmation tokens with lifecycle state. +- π¦ **backend.src.models.storage** (`Module`) `[TRIVIAL]` + - π Data models for the storage system. + - ποΈ Layer: Domain + - β **FileCategory** (`Class`) `[TRIVIAL]` + - π Enumeration of supported file categories in the storage system. + - β **StorageConfig** (`Class`) `[TRIVIAL]` + - π Configuration model for the storage system, defining paths and naming patterns. + - β **StoredFile** (`Class`) `[TRIVIAL]` + - π Data model representing metadata for a file stored in the system. +- π¦ **backend.src.models.dashboard** (`Module`) + - π Defines data models for dashboard metadata and selection. + - ποΈ Layer: Model + - β **DashboardMetadata** (`Class`) `[TRIVIAL]` + - π Represents a dashboard available for migration. + - β **DashboardSelection** (`Class`) `[TRIVIAL]` + - π Represents the user's selection of dashboards to migrate. +- π¦ **backend.src.models.auth** (`Module`) + - π SQLAlchemy models for multi-user authentication and authorization. + - ποΈ Layer: Domain + - π Invariant: Usernames and emails must be unique. + - Ζ **generate_uuid** (`Function`) + - π Generates a unique UUID string. + - π¦ **user_roles** (`Table`) + - π Association table for many-to-many relationship between Users and Roles. + - π¦ **role_permissions** (`Table`) + - π Association table for many-to-many relationship between Roles and Permissions. + - β **User** (`Class`) + - π Represents an identity that can authenticate to the system. + - β **Role** (`Class`) + - π Represents a collection of permissions. + - β **Permission** (`Class`) + - π Represents a specific capability within the system. + - β **ADGroupMapping** (`Class`) + - π Maps an Active Directory group to a local System Role. + - π DEPENDS_ON -> `Role` +- π¦ **test_models** (`Module`) `[TRIVIAL]` + - π Unit tests for data models + - ποΈ Layer: Domain + - Ζ **test_environment_model** (`Function`) + - π Tests that Environment model correctly stores values. +- π¦ **test_report_models** (`Module`) + - π Unit tests for report Pydantic models and their validators + - ποΈ Layer: Domain + - Ζ **test_enum_values** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_enum_values** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_valid_creation** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_minimal_creation** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_make_report** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_valid_creation** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_empty_report_id_raises** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_whitespace_report_id_raises** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_empty_task_id_raises** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_empty_summary_raises** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_summary_whitespace_trimmed** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_optional_fields** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_with_error_context** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_defaults** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_invalid_sort_by_raises** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_valid_sort_by_values** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_invalid_sort_order_raises** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_valid_sort_order_values** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_time_range_validation_valid** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_time_range_validation_invalid** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_page_ge_1** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_page_size_bounds** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_valid_creation** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_with_items** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_valid_creation** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_with_all_fields** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.src.services.resource_service** (`Module`) + - π Shared service for fetching resource data with Git status and task status + - ποΈ Layer: Service + - π Invariant: All resources include metadata about their current state + - π DEPENDS_ON -> `backend.src.core.superset_client` + - π DEPENDS_ON -> `backend.src.core.task_manager` + - π DEPENDS_ON -> `backend.src.services.git_service` + - β **ResourceService** (`Class`) + - π Provides centralized access to resource data with enhanced metadata + - Ζ **__init__** (`Function`) + - π Initialize the resource service with dependencies + - Ζ **get_dashboards_with_status** (`Function`) + - π Fetch dashboards from environment with Git status and last task status + - π CALLS -> `SupersetClient.get_dashboards_summary` + - π CALLS -> `self._get_git_status_for_dashboard` + - π CALLS -> `self._get_last_task_for_resource` + - Ζ **get_datasets_with_status** (`Function`) + - π Fetch datasets from environment with mapping progress and last task status + - π CALLS -> `SupersetClient.get_datasets_summary` + - π CALLS -> `self._get_last_task_for_resource` + - Ζ **get_activity_summary** (`Function`) + - π Get summary of active and recent tasks for the activity indicator + - Ζ **_get_git_status_for_dashboard** (`Function`) + - π Get Git sync status for a dashboard + - π CALLS -> `GitService.get_repo` + - Ζ **_get_last_task_for_resource** (`Function`) + - π Get the most recent task for a specific resource + - Ζ **_extract_resource_name_from_task** (`Function`) + - π Extract resource name from task params + - Ζ **_extract_resource_type_from_task** (`Function`) + - π Extract resource type from task params +- π¦ **backend.src.services.llm_prompt_templates** (`Module`) + - π Provide default LLM prompt templates and normalization helpers for runtime usage. + - ποΈ Layer: Domain + - π Invariant: All required prompt template keys are always present after normalization. + - π DEPENDS_ON -> `backend.src.core.config_manager` + - π¦ **DEFAULT_LLM_PROMPTS** (`Constant`) + - π Default prompt templates used by documentation, dashboard validation, and git commit generation. + - π¦ **DEFAULT_LLM_PROVIDER_BINDINGS** (`Constant`) + - π Default provider binding per task domain. + - π¦ **DEFAULT_LLM_ASSISTANT_SETTINGS** (`Constant`) + - π Default planner settings for assistant chat intent model/provider resolution. + - Ζ **normalize_llm_settings** (`Function`) + - π Ensure llm settings contain stable schema with prompts section and default templates. + - Ζ **is_multimodal_model** (`Function`) + - π Heuristically determine whether model supports image input required for dashboard validation. + - Ζ **resolve_bound_provider_id** (`Function`) + - π Resolve provider id configured for a task binding with fallback to default provider. + - Ζ **render_prompt** (`Function`) + - π Render prompt template using deterministic placeholder replacement with graceful fallback. +- π¦ **backend.src.services.llm_provider** (`Module`) + - π Service for managing LLM provider configurations with encrypted API keys. + - ποΈ Layer: Domain + - π DEPENDS_ON -> `backend.src.core.database` + - π DEPENDS_ON -> `backend.src.models.llm` + - β **EncryptionManager** (`Class`) `[CRITICAL]` + - π Handles encryption and decryption of sensitive data like API keys. + - π Invariant: Uses a secret key from environment or a default one (fallback only for dev). + - Ζ **EncryptionManager.__init__** (`Function`) + - π Initialize the encryption manager with a Fernet key. + - Ζ **EncryptionManager.encrypt** (`Function`) + - π Encrypt a plaintext string. + - Ζ **EncryptionManager.decrypt** (`Function`) + - π Decrypt an encrypted string. + - β **LLMProviderService** (`Class`) + - π Service to manage LLM provider lifecycle. + - Ζ **LLMProviderService.__init__** (`Function`) + - π Initialize the service with database session. + - Ζ **get_all_providers** (`Function`) + - π Returns all configured LLM providers. + - Ζ **get_provider** (`Function`) + - π Returns a single LLM provider by ID. + - Ζ **create_provider** (`Function`) + - π Creates a new LLM provider with encrypted API key. + - Ζ **update_provider** (`Function`) + - π Updates an existing LLM provider. + - Ζ **delete_provider** (`Function`) + - π Deletes an LLM provider. + - Ζ **get_decrypted_api_key** (`Function`) + - π Returns the decrypted API key for a provider. + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **encrypt** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **decrypt** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.src.services** (`Module`) + - π Package initialization for services module + - ποΈ Layer: Core + - Ζ **__getattr__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.src.services.auth_service** (`Module`) + - π Orchestrates authentication business logic. + - ποΈ Layer: Service + - π Invariant: Authentication must verify both credentials and account status. + - β **AuthService** (`Class`) + - π Provides high-level authentication services. + - Ζ **__init__** (`Function`) + - π Initializes the service with a database session. + - Ζ **authenticate_user** (`Function`) + - π Authenticates a user with username and password. + - Ζ **create_session** (`Function`) + - π Creates a JWT session for an authenticated user. + - Ζ **provision_adfs_user** (`Function`) + - π Just-In-Time (JIT) provisioning for ADFS users based on group mappings. +- π¦ **backend.src.services.git_service** (`Module`) + - π Core Git logic using GitPython to manage dashboard repositories. + - ποΈ Layer: Service + - π Invariant: All Git operations must be performed on a valid local directory. + - β **GitService** (`Class`) + - π Wrapper for GitPython operations with semantic logging and error handling. + - Ζ **__init__** (`Function`) + - π Initializes the GitService with a base path for repositories. + - Ζ **_get_repo_path** (`Function`) + - π Resolves the local filesystem path for a dashboard's repository. + - Ζ **init_repo** (`Function`) + - π Initialize or clone a repository for a dashboard. + - Ζ **get_repo** (`Function`) + - π Get Repo object for a dashboard. + - Ζ **list_branches** (`Function`) + - π List all branches for a dashboard's repository. + - Ζ **create_branch** (`Function`) + - π Create a new branch from an existing one. + - Ζ **checkout_branch** (`Function`) + - π Switch to a specific branch. + - Ζ **commit_changes** (`Function`) + - π Stage and commit changes. + - Ζ **push_changes** (`Function`) + - π Push local commits to remote. + - Ζ **pull_changes** (`Function`) + - π Pull changes from remote. + - Ζ **get_status** (`Function`) + - π Get current repository status (dirty files, untracked, etc.) + - Ζ **get_diff** (`Function`) + - π Generate diff for a file or the whole repository. + - Ζ **get_commit_history** (`Function`) + - π Retrieve commit history for a repository. + - Ζ **test_connection** (`Function`) + - π Test connection to Git provider using PAT. +- π¦ **backend.src.services.mapping_service** (`Module`) + - π Orchestrates database fetching and fuzzy matching suggestions. + - ποΈ Layer: Service + - π Invariant: Suggestions are based on database names. + - π DEPENDS_ON -> `backend.src.core.superset_client` + - π DEPENDS_ON -> `backend.src.core.utils.matching` + - β **MappingService** (`Class`) + - π Service for handling database mapping logic. + - Ζ **__init__** (`Function`) + - π Initializes the mapping service with a config manager. + - Ζ **_get_client** (`Function`) + - π Helper to get an initialized SupersetClient for an environment. + - Ζ **get_suggestions** (`Function`) + - π Fetches databases from both environments and returns fuzzy matching suggestions. +- π¦ **test_encryption_manager** (`Module`) + - π Unit tests for EncryptionManager encrypt/decrypt functionality. + - ποΈ Layer: Domain + - π Invariant: Encrypt+decrypt roundtrip always returns original plaintext. + - β **TestEncryptionManager** (`Class`) + - π Validate EncryptionManager encrypt/decrypt roundtrip, uniqueness, and error handling. + - Ζ **test_encrypt_decrypt_roundtrip** (`Function`) + - π Encrypt then decrypt returns original plaintext. + - Ζ **test_encrypt_produces_different_output** (`Function`) + - π Same plaintext produces different ciphertext (Fernet uses random IV). + - Ζ **test_different_inputs_yield_different_ciphertext** (`Function`) + - π Different inputs produce different ciphertexts. + - Ζ **test_decrypt_invalid_data_raises** (`Function`) + - π Decrypting invalid data raises InvalidToken. + - Ζ **test_encrypt_empty_string** (`Function`) + - π Encrypting and decrypting an empty string works. + - Ζ **test_custom_key_roundtrip** (`Function`) + - π Custom Fernet key produces valid roundtrip. + - Ζ **_make_manager** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **encrypt** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **decrypt** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **encrypt** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **decrypt** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.src.services.__tests__.test_llm_prompt_templates** (`Module`) + - π Validate normalization and rendering behavior for configurable LLM prompt templates. + - ποΈ Layer: Domain Tests + - π Invariant: All required prompt keys remain available after normalization. + - π DEPENDS_ON -> `backend.src.services.llm_prompt_templates` + - Ζ **test_normalize_llm_settings_adds_default_prompts** (`Function`) + - π Ensure legacy/partial llm settings are expanded with all prompt defaults. + - Ζ **test_normalize_llm_settings_keeps_custom_prompt_values** (`Function`) + - π Ensure user-customized prompt values are preserved during normalization. + - Ζ **test_render_prompt_replaces_known_placeholders** (`Function`) + - π Ensure template placeholders are deterministically replaced. + - Ζ **test_is_multimodal_model_detects_known_vision_models** (`Function`) + - π Ensure multimodal model detection recognizes common vision-capable model names. + - Ζ **test_resolve_bound_provider_id_prefers_binding_then_default** (`Function`) + - π Verify provider binding resolution priority. + - Ζ **test_normalize_llm_settings_keeps_assistant_planner_settings** (`Function`) + - π Ensure assistant planner provider/model fields are preserved and normalized. +- π¦ **backend.src.services.__tests__.test_resource_service** (`Module`) + - π Unit tests for ResourceService + - ποΈ Layer: Service + - π Invariant: Resource summaries preserve task linkage and status projection behavior. + - Ζ **test_get_dashboards_with_status** (`Function`) + - π Validate dashboard enrichment includes git/task status projections. + - Ζ **test_get_datasets_with_status** (`Function`) + - Ζ **test_get_activity_summary** (`Function`) + - Ζ **test_get_git_status_for_dashboard_no_repo** (`Function`) + - Ζ **test_get_last_task_for_resource** (`Function`) + - Ζ **test_extract_resource_name_from_task** (`Function`) + - Ζ **test_get_last_task_for_resource_empty_tasks** (`Function`) + - Ζ **test_get_last_task_for_resource_no_match** (`Function`) +- π¦ **backend.src.services.reports.normalizer** (`Module`) `[CRITICAL]` + - π Convert task manager task objects into canonical unified TaskReport entities with deterministic fallback behavior. + - ποΈ Layer: Domain + - π Invariant: Unknown task types and partial payloads remain visible via fallback mapping. + - π DEPENDS_ON -> `backend.src.core.task_manager.models.Task` + - π DEPENDS_ON -> `backend.src.models.report` + - π DEPENDS_ON -> `backend.src.services.reports.type_profiles` + - Ζ **status_to_report_status** (`Function`) + - π Normalize internal task status to canonical report status. + - Ζ **build_summary** (`Function`) + - π Build deterministic user-facing summary from task payload and status. + - Ζ **extract_error_context** (`Function`) + - π Extract normalized error context and next actions for failed/partial reports. + - Ζ **normalize_task_report** (`Function`) + - π Convert one Task to canonical TaskReport envelope. +- π¦ **backend.src.services.reports.type_profiles** (`Module`) `[CRITICAL]` + - π Deterministic mapping of plugin/task identifiers to canonical report task types and fallback profile metadata. + - ποΈ Layer: Domain + - π Invariant: Unknown input always resolves to TaskType.UNKNOWN with a single fallback profile. + - π DEPENDS_ON -> `backend.src.models.report.TaskType` + - π¦ **PLUGIN_TO_TASK_TYPE** (`Data`) + - π Maps plugin identifiers to normalized report task types. + - π¦ **TASK_TYPE_PROFILES** (`Data`) + - π Profile metadata registry for each normalized task type. + - Ζ **resolve_task_type** (`Function`) + - π Resolve canonical task type from plugin/task identifier with guaranteed fallback. + - Ζ **get_type_profile** (`Function`) + - π Return deterministic profile metadata for a task type. +- π¦ **backend.src.services.reports.report_service** (`Module`) `[CRITICAL]` + - π Aggregate, normalize, filter, and paginate task reports for unified list/detail API use cases. + - ποΈ Layer: Domain + - π Invariant: List responses are deterministic and include applied filter echo metadata. + - π DEPENDS_ON -> `backend.src.core.task_manager.manager.TaskManager` + - π DEPENDS_ON -> `backend.src.models.report` + - π DEPENDS_ON -> `backend.src.services.reports.normalizer` + - β **ReportsService** (`Class`) `[CRITICAL]` + - π Service layer for list/detail report retrieval and normalization. + - π Invariant: Service methods are read-only over task history source. + - Ζ **__init__** (`Function`) `[CRITICAL]` + - π Initialize service with TaskManager dependency. + - π Invariant: Constructor performs no task mutations. + - Ζ **_load_normalized_reports** (`Function`) + - π Build normalized reports from all available tasks. + - π Invariant: Every returned item is a TaskReport. + - Ζ **_to_utc_datetime** (`Function`) + - π Normalize naive/aware datetime values to UTC-aware datetime for safe comparisons. + - π Invariant: Naive datetimes are interpreted as UTC to preserve deterministic ordering/filtering. + - Ζ **_datetime_sort_key** (`Function`) + - π Produce stable numeric sort key for report timestamps. + - π Invariant: Mixed naive/aware datetimes never raise TypeError. + - Ζ **_matches_query** (`Function`) + - π Apply query filtering to a report. + - π Invariant: Filter evaluation is side-effect free. + - Ζ **_sort_reports** (`Function`) + - π Sort reports deterministically according to query settings. + - π Invariant: Sorting criteria are deterministic for equal input. + - Ζ **list_reports** (`Function`) + - π Return filtered, sorted, paginated report collection. + - Ζ **get_report_detail** (`Function`) + - π Return one normalized report with timeline/diagnostics/next actions. +- π¦ **test_report_service** (`Module`) + - π Unit tests for ReportsService list/detail operations + - ποΈ Layer: Domain + - Ζ **_make_task** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_make_service** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_empty_tasks_returns_empty_collection** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_single_task_normalized** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_pagination_first_page** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_pagination_last_page** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_filter_by_status** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_filter_by_task_type** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_search_filter** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_sort_by_status** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_applied_filters_echoed** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_make_service** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_detail_found** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_detail_not_found** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_detail_includes_timeline** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_detail_failed_task_has_next_actions** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_detail_success_task_no_error_next_actions** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.tests.test_report_normalizer** (`Module`) + - π Validate unknown task type fallback and partial payload normalization behavior. + - ποΈ Layer: Domain (Tests) + - π Invariant: Unknown plugin types are mapped to canonical unknown task type. + - Ζ **test_unknown_type_maps_to_unknown_profile** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_partial_payload_keeps_report_visible_with_placeholders** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **BackupPlugin** (`Module`) + - π A plugin that provides functionality to back up Superset dashboards. + - ποΈ Layer: App + - π IMPLEMENTS -> `PluginBase` + - π DEPENDS_ON -> `superset_tool.client` + - π DEPENDS_ON -> `superset_tool.utils` + - β **BackupPlugin** (`Class`) + - π Implementation of the backup plugin logic. + - Ζ **id** (`Function`) + - π Returns the unique identifier for the backup plugin. + - Ζ **name** (`Function`) + - π Returns the human-readable name of the backup plugin. + - Ζ **description** (`Function`) + - π Returns a description of the backup plugin. + - Ζ **version** (`Function`) + - π Returns the version of the backup plugin. + - Ζ **ui_route** (`Function`) + - π Returns the frontend route for the backup plugin. + - Ζ **get_schema** (`Function`) + - π Returns the JSON schema for backup plugin parameters. + - Ζ **execute** (`Function`) + - π Executes the dashboard backup logic with TaskContext support. +- π¦ **DebugPluginModule** (`Module`) + - π Implements a plugin for system diagnostics and debugging Superset API responses. + - ποΈ Layer: Plugins + - β **DebugPlugin** (`Class`) + - π Plugin for system diagnostics and debugging. + - Ζ **id** (`Function`) + - π Returns the unique identifier for the debug plugin. + - Ζ **name** (`Function`) + - π Returns the human-readable name of the debug plugin. + - Ζ **description** (`Function`) + - π Returns a description of the debug plugin. + - Ζ **version** (`Function`) + - π Returns the version of the debug plugin. + - Ζ **ui_route** (`Function`) + - π Returns the frontend route for the debug plugin. + - Ζ **get_schema** (`Function`) + - π Returns the JSON schema for the debug plugin parameters. + - Ζ **execute** (`Function`) + - π Executes the debug logic with TaskContext support. + - Ζ **_test_db_api** (`Function`) + - π Tests database API connectivity for source and target environments. + - Ζ **_get_dataset_structure** (`Function`) + - π Retrieves the structure of a dataset. +- π¦ **SearchPluginModule** (`Module`) + - π Implements a plugin for searching text patterns across all datasets in a specific Superset environment. + - ποΈ Layer: Plugins + - β **SearchPlugin** (`Class`) + - π Plugin for searching text patterns in Superset datasets. + - Ζ **id** (`Function`) + - π Returns the unique identifier for the search plugin. + - Ζ **name** (`Function`) + - π Returns the human-readable name of the search plugin. + - Ζ **description** (`Function`) + - π Returns a description of the search plugin. + - Ζ **version** (`Function`) + - π Returns the version of the search plugin. + - Ζ **ui_route** (`Function`) + - π Returns the frontend route for the search plugin. + - Ζ **get_schema** (`Function`) + - π Returns the JSON schema for the search plugin parameters. + - Ζ **execute** (`Function`) + - π Executes the dataset search logic with TaskContext support. + - Ζ **_get_context** (`Function`) + - π Extracts a small context around the match for display. +- π¦ **MapperPluginModule** (`Module`) + - π Implements a plugin for mapping dataset columns using external database connections or Excel files. + - ποΈ Layer: Plugins + - β **MapperPlugin** (`Class`) + - π Plugin for mapping dataset columns verbose names. + - Ζ **id** (`Function`) + - π Returns the unique identifier for the mapper plugin. + - Ζ **name** (`Function`) + - π Returns the human-readable name of the mapper plugin. + - Ζ **description** (`Function`) + - π Returns a description of the mapper plugin. + - Ζ **version** (`Function`) + - π Returns the version of the mapper plugin. + - Ζ **ui_route** (`Function`) + - π Returns the frontend route for the mapper plugin. + - Ζ **get_schema** (`Function`) + - π Returns the JSON schema for the mapper plugin parameters. + - Ζ **execute** (`Function`) + - π Executes the dataset mapping logic with TaskContext support. +- π¦ **backend.src.plugins.git_plugin** (`Module`) + - π ΠΡΠ΅Π΄ΠΎΡΡΠ°Π²Π»ΡΠ΅Ρ ΠΏΠ»Π°Π³ΠΈΠ½ Π΄Π»Ρ Π²Π΅ΡΡΠΈΠΎΠ½ΠΈΡΠΎΠ²Π°Π½ΠΈΡ ΠΈ ΡΠ°Π·Π²Π΅ΡΡΡΠ²Π°Π½ΠΈΡ Π΄Π°ΡΠ±ΠΎΡΠ΄ΠΎΠ² Superset. + - ποΈ Layer: Plugin + - π Invariant: ΠΡΠ΅ ΠΎΠΏΠ΅ΡΠ°ΡΠΈΠΈ Ρ Git Π΄ΠΎΠ»ΠΆΠ½Ρ Π²ΡΠΏΠΎΠ»Π½ΡΡΡΡΡ ΡΠ΅ΡΠ΅Π· GitService. + - β **GitPlugin** (`Class`) + - π Π Π΅Π°Π»ΠΈΠ·Π°ΡΠΈΡ ΠΏΠ»Π°Π³ΠΈΠ½Π° Git Integration Π΄Π»Ρ ΡΠΏΡΠ°Π²Π»Π΅Π½ΠΈΡ Π²Π΅ΡΡΠΈΡΠΌΠΈ Π΄Π°ΡΠ±ΠΎΡΠ΄ΠΎΠ². + - Ζ **__init__** (`Function`) + - π ΠΠ½ΠΈΡΠΈΠ°Π»ΠΈΠ·ΠΈΡΡΠ΅Ρ ΠΏΠ»Π°Π³ΠΈΠ½ ΠΈ Π΅Π³ΠΎ Π·Π°Π²ΠΈΡΠΈΠΌΠΎΡΡΠΈ. + - Ζ **id** (`Function`) + - π Returns the plugin identifier. + - Ζ **name** (`Function`) + - π Returns the plugin name. + - Ζ **description** (`Function`) + - π Returns the plugin description. + - Ζ **version** (`Function`) + - π Returns the plugin version. + - Ζ **ui_route** (`Function`) + - π Returns the frontend route for the git plugin. + - Ζ **get_schema** (`Function`) + - π ΠΠΎΠ·Π²ΡΠ°ΡΠ°Π΅Ρ JSON-ΡΡ Π΅ΠΌΡ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΠΎΠ² Π΄Π»Ρ Π²ΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΡ Π·Π°Π΄Π°Ρ ΠΏΠ»Π°Π³ΠΈΠ½Π°. + - Ζ **initialize** (`Function`) + - π ΠΡΠΏΠΎΠ»Π½ΡΠ΅Ρ Π½Π°ΡΠ°Π»ΡΠ½ΡΡ Π½Π°ΡΡΡΠΎΠΉΠΊΡ ΠΏΠ»Π°Π³ΠΈΠ½Π°. + - Ζ **execute** (`Function`) + - π ΠΡΠ½ΠΎΠ²Π½ΠΎΠΉ ΠΌΠ΅ΡΠΎΠ΄ Π²ΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΡ Π·Π°Π΄Π°Ρ ΠΏΠ»Π°Π³ΠΈΠ½Π° Ρ ΠΏΠΎΠ΄Π΄Π΅ΡΠΆΠΊΠΎΠΉ TaskContext. + - π CALLS -> `self._handle_sync` + - π CALLS -> `self._handle_deploy` + - Ζ **_handle_sync** (`Function`) + - π ΠΠΊΡΠΏΠΎΡΡΠΈΡΡΠ΅Ρ Π΄Π°ΡΠ±ΠΎΡΠ΄ ΠΈΠ· Superset ΠΈ ΡΠ°ΡΠΏΠ°ΠΊΠΎΠ²ΡΠ²Π°Π΅Ρ Π² Git-ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΉ. + - π CALLS -> `src.services.git_service.GitService.get_repo` + - π CALLS -> `src.core.superset_client.SupersetClient.export_dashboard` + - Ζ **_handle_deploy** (`Function`) + - π Π£ΠΏΠ°ΠΊΠΎΠ²ΡΠ²Π°Π΅Ρ ΡΠ΅ΠΏΠΎΠ·ΠΈΡΠΎΡΠΈΠΉ Π² ZIP ΠΈ ΠΈΠΌΠΏΠΎΡΡΠΈΡΡΠ΅Ρ Π² ΡΠ΅Π»Π΅Π²ΠΎΠ΅ ΠΎΠΊΡΡΠΆΠ΅Π½ΠΈΠ΅ Superset. + - π CALLS -> `src.core.superset_client.SupersetClient.import_dashboard` + - Ζ **_get_env** (`Function`) + - π ΠΡΠΏΠΎΠΌΠΎΠ³Π°ΡΠ΅Π»ΡΠ½ΡΠΉ ΠΌΠ΅ΡΠΎΠ΄ Π΄Π»Ρ ΠΏΠΎΠ»ΡΡΠ΅Π½ΠΈΡ ΠΊΠΎΠ½ΡΠΈΠ³ΡΡΠ°ΡΠΈΠΈ ΠΎΠΊΡΡΠΆΠ΅Π½ΠΈΡ. +- π¦ **MigrationPlugin** (`Module`) + - π A plugin that provides functionality to migrate Superset dashboards between environments. + - ποΈ Layer: App + - π IMPLEMENTS -> `PluginBase` + - π DEPENDS_ON -> `superset_tool.client` + - π DEPENDS_ON -> `superset_tool.utils` + - β **MigrationPlugin** (`Class`) + - π Implementation of the migration plugin logic. + - Ζ **id** (`Function`) + - π Returns the unique identifier for the migration plugin. + - Ζ **name** (`Function`) + - π Returns the human-readable name of the migration plugin. + - Ζ **description** (`Function`) + - π Returns a description of the migration plugin. + - Ζ **version** (`Function`) + - π Returns the version of the migration plugin. + - Ζ **ui_route** (`Function`) + - π Returns the frontend route for the migration plugin. + - Ζ **get_schema** (`Function`) + - π Returns the JSON schema for migration plugin parameters. + - Ζ **execute** (`Function`) + - π Executes the dashboard migration logic with TaskContext support. + - π¦ **MigrationPlugin.execute** (`Action`) + - π Execute the migration logic with proper task logging. +- Ζ **schedule_dashboard_validation** (`Function`) + - π Schedules a recurring dashboard validation task. +- Ζ **_parse_cron** (`Function`) + - π Basic cron parser placeholder. +- π¦ **scheduler** (`Module`) `[TRIVIAL]` + - π Auto-generated module for backend/src/plugins/llm_analysis/scheduler.py + - ποΈ Layer: Unknown + - Ζ **job_func** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- β **LLMProviderType** (`Class`) + - π Enum for supported LLM providers. +- β **LLMProviderConfig** (`Class`) + - π Configuration for an LLM provider. +- β **ValidationStatus** (`Class`) + - π Enum for dashboard validation status. +- β **DetectedIssue** (`Class`) + - π Model for a single issue detected during validation. +- β **ValidationResult** (`Class`) + - π Model for dashboard validation result. +- Ζ **_is_masked_or_invalid_api_key** (`Function`) + - π Guards against placeholder or malformed API keys in runtime. +- Ζ **_json_safe_value** (`Function`) + - π Recursively normalize payload values for JSON serialization. +- β **DashboardValidationPlugin** (`Class`) + - π Plugin for automated dashboard health analysis using LLMs. + - π IMPLEMENTS -> `backend.src.core.plugin_base.PluginBase` + - Ζ **DashboardValidationPlugin.execute** (`Function`) + - π Executes the dashboard validation task with TaskContext support. +- β **DocumentationPlugin** (`Class`) + - π Plugin for automated dataset documentation using LLMs. + - π IMPLEMENTS -> `backend.src.core.plugin_base.PluginBase` + - Ζ **DocumentationPlugin.execute** (`Function`) + - π Executes the dataset documentation task with TaskContext support. +- π¦ **plugin** (`Module`) `[TRIVIAL]` + - π Auto-generated module for backend/src/plugins/llm_analysis/plugin.py + - ποΈ Layer: Unknown + - Ζ **id** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **name** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **description** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **version** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **get_schema** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **execute** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **id** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **name** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **description** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **version** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **get_schema** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **execute** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- β **ScreenshotService** (`Class`) + - π Handles capturing screenshots of Superset dashboards. + - Ζ **ScreenshotService.__init__** (`Function`) + - π Initializes the ScreenshotService with environment configuration. + - Ζ **ScreenshotService.capture_dashboard** (`Function`) + - π Captures a full-page screenshot of a dashboard using Playwright and CDP. +- β **LLMClient** (`Class`) + - π Wrapper for LLM provider APIs. + - Ζ **LLMClient.__init__** (`Function`) + - π Initializes the LLMClient with provider settings. + - Ζ **LLMClient._supports_json_response_format** (`Function`) + - π Detect whether provider/model is likely compatible with response_format=json_object. + - Ζ **LLMClient.get_json_completion** (`Function`) + - π Helper to handle LLM calls with JSON mode and fallback parsing. + - Ζ **LLMClient.analyze_dashboard** (`Function`) + - π Sends dashboard data (screenshot + logs) to LLM for health analysis. +- π¦ **service** (`Module`) `[TRIVIAL]` + - π Auto-generated module for backend/src/plugins/llm_analysis/service.py + - ποΈ Layer: Unknown + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **capture_dashboard** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **switch_tabs** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_supports_json_response_format** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_should_retry** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **get_json_completion** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **analyze_dashboard** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **StoragePlugin** (`Module`) + - π Provides core filesystem operations for managing backups and repositories. + - ποΈ Layer: App + - π Invariant: All file operations must be restricted to the configured storage root. + - π IMPLEMENTS -> `PluginBase` + - π DEPENDS_ON -> `backend.src.models.storage` + - β **StoragePlugin** (`Class`) + - π Implementation of the storage management plugin. + - Ζ **__init__** (`Function`) + - π Initializes the StoragePlugin and ensures required directories exist. + - Ζ **id** (`Function`) + - π Returns the unique identifier for the storage plugin. + - Ζ **name** (`Function`) + - π Returns the human-readable name of the storage plugin. + - Ζ **description** (`Function`) + - π Returns a description of the storage plugin. + - Ζ **version** (`Function`) + - π Returns the version of the storage plugin. + - Ζ **ui_route** (`Function`) + - π Returns the frontend route for the storage plugin. + - Ζ **get_schema** (`Function`) + - π Returns the JSON schema for storage plugin parameters. + - Ζ **execute** (`Function`) + - π Executes storage-related tasks with TaskContext support. + - Ζ **get_storage_root** (`Function`) + - π Resolves the absolute path to the storage root. + - Ζ **resolve_path** (`Function`) + - π Resolves a dynamic path pattern using provided variables. + - Ζ **ensure_directories** (`Function`) + - π Creates the storage root and category subdirectories if they don't exist. + - Ζ **validate_path** (`Function`) + - π Prevents path traversal attacks by ensuring the path is within the storage root. + - Ζ **list_files** (`Function`) + - π Lists all files and directories in a specific category and subpath. + - Ζ **save_file** (`Function`) + - π Saves an uploaded file to the specified category and optional subpath. + - Ζ **delete_file** (`Function`) + - π Deletes a file or directory from the specified category and path. + - Ζ **get_file_path** (`Function`) + - π Returns the absolute path of a file for download. +- β **GitLLMExtension** (`Class`) + - π Provides LLM capabilities to the Git plugin. + - Ζ **suggest_commit_message** (`Function`) + - π Generates a suggested commit message based on a diff and history. +- π¦ **llm_extension** (`Module`) `[TRIVIAL]` + - π Auto-generated module for backend/src/plugins/git/llm_extension.py + - ποΈ Layer: Unknown + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **test_task_persistence** (`Module`) `[CRITICAL]` + - π Unit tests for TaskPersistenceService. + - ποΈ Layer: Test + - β **TestTaskPersistenceHelpers** (`Class`) `[CRITICAL]` + - π Test suite for TaskPersistenceService static helper methods. + - Ζ **test_json_load_if_needed_none** (`Function`) + - π Test _json_load_if_needed with None input. + - Ζ **test_json_load_if_needed_dict** (`Function`) + - π Test _json_load_if_needed with dict input. + - Ζ **test_json_load_if_needed_list** (`Function`) + - π Test _json_load_if_needed with list input. + - Ζ **test_json_load_if_needed_json_string** (`Function`) + - π Test _json_load_if_needed with JSON string. + - Ζ **test_json_load_if_needed_empty_string** (`Function`) + - π Test _json_load_if_needed with empty/null strings. + - Ζ **test_json_load_if_needed_plain_string** (`Function`) + - π Test _json_load_if_needed with non-JSON string. + - Ζ **test_json_load_if_needed_integer** (`Function`) + - π Test _json_load_if_needed with integer. + - Ζ **test_parse_datetime_none** (`Function`) + - π Test _parse_datetime with None. + - Ζ **test_parse_datetime_datetime_object** (`Function`) + - π Test _parse_datetime with datetime object. + - Ζ **test_parse_datetime_iso_string** (`Function`) + - π Test _parse_datetime with ISO string. + - Ζ **test_parse_datetime_invalid_string** (`Function`) + - π Test _parse_datetime with invalid string. + - Ζ **test_parse_datetime_integer** (`Function`) + - π Test _parse_datetime with non-string, non-datetime. + - β **TestTaskPersistenceService** (`Class`) `[CRITICAL]` + - π Test suite for TaskPersistenceService CRUD operations. + - Ζ **setup_class** (`Function`) + - π Setup in-memory test database. + - Ζ **teardown_class** (`Function`) + - π Dispose of test database. + - Ζ **setup_method** (`Function`) + - π Clean task_records table before each test. + - Ζ **test_persist_task_new** (`Function`) + - π Test persisting a new task creates a record. + - Ζ **test_persist_task_update** (`Function`) + - π Test updating an existing task. + - Ζ **test_persist_task_with_logs** (`Function`) + - π Test persisting a task with log entries. + - Ζ **test_persist_task_failed_extracts_error** (`Function`) + - π Test that FAILED task extracts last error message. + - Ζ **test_persist_tasks_batch** (`Function`) + - π Test persisting multiple tasks. + - Ζ **test_load_tasks** (`Function`) + - π Test loading tasks from database. + - Ζ **test_load_tasks_with_status_filter** (`Function`) + - π Test loading tasks filtered by status. + - Ζ **test_load_tasks_with_limit** (`Function`) + - π Test loading tasks with limit. + - Ζ **test_delete_tasks** (`Function`) + - π Test deleting tasks by ID list. + - Ζ **test_delete_tasks_empty_list** (`Function`) + - π Test deleting with empty list (no-op). + - Ζ **test_persist_task_with_datetime_in_params** (`Function`) + - π Test json_serializable handles datetime in params. + - Ζ **_patched** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_make_task** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- Ζ **test_environment_model** (`Function`) + - π Tests that Environment model correctly stores values. +- π¦ **test_task_manager** (`Module`) `[CRITICAL]` + - π Unit tests for TaskManager lifecycle, CRUD, log buffering, and filtering. + - ποΈ Layer: Core + - π Invariant: TaskManager state changes are deterministic and testable with mocked dependencies. + - Ζ **_make_manager** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_cleanup_manager** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_init_creates_empty_tasks** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_init_loads_persisted_tasks** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_init_starts_flusher_thread** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_task_returns_none_for_missing** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_task_returns_existing** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_all_tasks** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_tasks_with_status_filter** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_tasks_with_plugin_filter** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_tasks_with_pagination** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_tasks_completed_only** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_create_task_success** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_create_task_unknown_plugin_raises** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_create_task_invalid_params_raises** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_add_log_appends_to_task_and_buffer** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_add_log_skips_nonexistent_task** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_flush_logs_writes_to_persistence** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_flush_task_logs_writes_single_task** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_flush_logs_requeues_on_failure** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_clear_all_non_active** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_clear_by_status** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_clear_preserves_awaiting_input** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_subscribe_creates_queue** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_unsubscribe_removes_queue** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_multiple_subscribers** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_await_input_sets_status** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_await_input_not_running_raises** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_await_input_nonexistent_raises** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_resume_with_password** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_resume_not_awaiting_raises** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_resume_empty_passwords_raises** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.tests.test_dashboards_api** (`Module`) + - π Comprehensive contract-driven tests for Dashboard Hub API + - ποΈ Layer: Domain (Tests) + - Ζ **mock_deps** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboards_success** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboards_with_search** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboards_empty** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboards_superset_failure** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboards_env_not_found** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboards_invalid_pagination** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_database_mappings_success** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_database_mappings_env_not_found** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboard_detail_success** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboard_detail_env_not_found** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboard_tasks_history_success** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboard_tasks_history_sorting** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboard_thumbnail_success** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboard_thumbnail_env_not_found** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboard_thumbnail_202** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_migrate_dashboards_success** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_migrate_dashboards_pre_checks** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_migrate_dashboards_env_not_found** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_backup_dashboards_success** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_backup_dashboards_pre_checks** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_backup_dashboards_env_not_found** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_backup_dashboards_with_schedule** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_task_matches_dashboard_logic** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **test_dashboards_api** (`Test`) + - π Verify GET /api/dashboards contract compliance +- π¦ **test_datasets_api** (`Test`) + - π Verify GET /api/datasets contract compliance +- π¦ **test_pagination_boundaries** (`Test`) + - π Verify pagination validation for GET endpoints +- π¦ **test_resource_hubs** (`Module`) `[TRIVIAL]` + - π Auto-generated module for backend/tests/test_resource_hubs.py + - ποΈ Layer: Unknown + - Ζ **mock_deps** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboards_success** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboards_not_found** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboards_search** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_datasets_success** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_datasets_not_found** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_datasets_search** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_datasets_service_failure** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboards_pagination_zero_page** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_dashboards_pagination_oversize** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_datasets_pagination_zero_page** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_datasets_pagination_oversize** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **test_task_logger** (`Module`) + - π Unit tests for TaskLogger and TaskContext. + - ποΈ Layer: Test + - β **TestTaskLogger** (`Class`) + - π Test suite for TaskLogger. + - Ζ **setup_method** (`Function`) + - π Setup for each test method. + - Ζ **test_init** (`Function`) + - π Test TaskLogger initialization. + - Ζ **test_with_source** (`Function`) + - π Test creating a sub-logger with different source. + - Ζ **test_debug** (`Function`) + - π Test debug log level. + - Ζ **test_info** (`Function`) + - π Test info log level. + - Ζ **test_warning** (`Function`) + - π Test warning log level. + - Ζ **test_error** (`Function`) + - π Test error log level. + - Ζ **test_error_with_metadata** (`Function`) + - π Test error logging with metadata. + - Ζ **test_progress** (`Function`) + - π Test progress logging. + - Ζ **test_progress_clamping** (`Function`) + - π Test progress value clamping (0-100). + - Ζ **test_source_override** (`Function`) + - π Test overriding the default source. + - Ζ **test_sub_logger_source_independence** (`Function`) + - π Test sub-logger independence from parent. + - β **TestTaskContext** (`Class`) + - π Test suite for TaskContext. + - Ζ **setup_method** (`Function`) + - π Setup for each test method. + - Ζ **test_init** (`Function`) + - π Test TaskContext initialization. + - Ζ **test_task_id_property** (`Function`) + - π Test task_id property. + - Ζ **test_logger_property** (`Function`) + - π Test logger property. + - Ζ **test_params_property** (`Function`) + - π Test params property. + - Ζ **test_get_param** (`Function`) + - π Test getting a specific parameter. + - Ζ **test_create_sub_context** (`Function`) + - π Test creating a sub-context with different source. + - Ζ **test_context_logger_delegates_to_task_logger** (`Function`) + - π Test context logger delegates to TaskLogger. + - Ζ **test_sub_context_with_source** (`Function`) + - π Test sub-context logger uses new source. + - Ζ **test_multiple_sub_contexts** (`Function`) + - π Test creating multiple sub-contexts. +- π¦ **test_smoke_plugins** (`Module`) `[TRIVIAL]` + - π Auto-generated module for backend/tests/test_smoke_plugins.py + - ποΈ Layer: Unknown + - Ζ **test_plugins_load_successfully** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_task_manager_initializes_with_plugins** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- Ζ **test_belief_scope_logs_entry_action_exit_at_debug** (`Function`) + - π Test that belief_scope generates [ID][Entry], [ID][Action], and [ID][Exit] logs at DEBUG level. +- Ζ **test_belief_scope_error_handling** (`Function`) + - π Test that belief_scope logs Coherence:Failed on exception. +- Ζ **test_belief_scope_success_coherence** (`Function`) + - π Test that belief_scope logs Coherence:OK on success. +- Ζ **test_belief_scope_not_visible_at_info** (`Function`) + - π Test that belief_scope Entry/Exit/Coherence logs are NOT visible at INFO level. +- Ζ **test_task_log_level_default** (`Function`) + - π Test that default task log level is INFO. +- Ζ **test_should_log_task_level** (`Function`) + - π Test that should_log_task_level correctly filters log levels. +- Ζ **test_configure_logger_task_log_level** (`Function`) + - π Test that configure_logger updates task_log_level. +- Ζ **test_enable_belief_state_flag** (`Function`) + - π Test that enable_belief_state flag controls belief_scope logging. +- π¦ **test_auth** (`Module`) `[TRIVIAL]` + - π Auto-generated module for backend/tests/test_auth.py + - ποΈ Layer: Unknown + - Ζ **db_session** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **auth_service** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **auth_repo** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_create_user** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_authenticate_user** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_create_session** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_role_permission_association** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_user_role_association** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_ad_group_mapping** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **test_log_persistence** (`Module`) `[CRITICAL]` + - π Unit tests for TaskLogPersistenceService. + - ποΈ Layer: Test + - β **TestLogPersistence** (`Class`) `[CRITICAL]` + - π Test suite for TaskLogPersistenceService. + - Ζ **setup_class** (`Function`) + - π Setup test database and service instance. + - Ζ **teardown_class** (`Function`) + - π Clean up test database. + - Ζ **setup_method** (`Function`) + - π Setup for each test method β clean task_logs table. + - Ζ **test_add_logs_single** (`Function`) + - π Test adding a single log entry. + - Ζ **test_add_logs_batch** (`Function`) + - π Test adding multiple log entries in batch. + - Ζ **test_add_logs_empty** (`Function`) + - π Test adding empty log list (should be no-op). + - Ζ **test_get_logs_by_task_id** (`Function`) + - π Test retrieving logs by task ID. + - Ζ **test_get_logs_with_filters** (`Function`) + - π Test retrieving logs with level and source filters. + - Ζ **test_get_logs_with_pagination** (`Function`) + - π Test retrieving logs with pagination. + - Ζ **test_get_logs_with_search** (`Function`) + - π Test retrieving logs with search query. + - Ζ **test_get_log_stats** (`Function`) + - π Test retrieving log statistics. + - Ζ **test_get_sources** (`Function`) + - π Test retrieving unique log sources. + - Ζ **test_delete_logs_for_task** (`Function`) + - π Test deleting logs by task ID. + - Ζ **test_delete_logs_for_tasks** (`Function`) + - π Test deleting logs for multiple tasks. + - Ζ **test_delete_logs_for_tasks_empty** (`Function`) + - π Test deleting with empty list (no-op). + - Ζ **_patched** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.tests.core.test_mapping_service** (`Module`) + - π Unit tests for the IdMappingService matching UUIDs to integer IDs. + - ποΈ Layer: Domain + - Ζ **db_session** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **get_all_resources** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_sync_environment_upserts_correctly** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_remote_id_returns_integer** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_remote_ids_batch_returns_dict** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_sync_environment_updates_existing_mapping** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_sync_environment_skips_resources_without_uuid** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_sync_environment_handles_api_error_gracefully** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **get_all_resources** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_remote_id_returns_none_for_missing** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_get_remote_ids_batch_returns_empty_for_empty_input** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_mapping_service_alignment_with_test_data** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_sync_environment_requires_existing_env** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_sync_environment_deletes_stale_mappings** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **test_defensive_guards** (`Module`) `[TRIVIAL]` + - π Auto-generated module for backend/tests/core/test_defensive_guards.py + - ποΈ Layer: Unknown + - Ζ **test_git_service_get_repo_path_guard** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_superset_client_import_dashboard_guard** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) +- π¦ **backend.tests.core.test_migration_engine** (`Module`) + - π Unit tests for MigrationEngine's cross-filter patching algorithms. + - ποΈ Layer: Domain + - Ζ **__init__** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **get_remote_ids_batch** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **_write_dashboard_yaml** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_patch_dashboard_metadata_replaces_chart_ids** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_patch_dashboard_metadata_replaces_dataset_ids** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_patch_dashboard_metadata_skips_when_no_metadata** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_patch_dashboard_metadata_handles_missing_targets** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_extract_chart_uuids_from_archive** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_transform_yaml_replaces_database_uuid** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_transform_yaml_ignores_unmapped_uuid** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_transform_zip_end_to_end** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_transform_zip_invalid_path** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) + - Ζ **test_transform_yaml_nonexistent_file** (`Function`) `[TRIVIAL]` + - π Auto-detected function (orphan) diff --git a/.ai/shots/critical_module.py b/.ai/shots/critical_module.py index 490b25d..79a9db3 100644 --- a/.ai/shots/critical_module.py +++ b/.ai/shots/critical_module.py @@ -3,76 +3,28 @@ # @SEMANTICS: Finance, ACID, Transfer, Ledger # @PURPOSE: Core banking transaction processor with ACID guarantees. # @LAYER: Domain (Core) -# @RELATION: DEPENDS_ON -> [DEF:Infra:PostgresDB] -# @RELATION: DEPENDS_ON -> [DEF:Infra:AuditLog] +# @RELATION: DEPENDS_ON ->[DEF:Infra:PostgresDB] # # @INVARIANT: Total system balance must remain constant (Double-Entry Bookkeeping). # @INVARIANT: Negative transfers are strictly forbidden. -# @INVARIANT: No partial commit must occur under failure (ACID Atomicity). -# @TEST_CONTRACT: TransferInput -> -# { -# required_fields: { -# sender_id: str, -# receiver_id: str, -# amount: Decimal -# }, -# invariants: [ -# "amount > 0", -# "sender_id != receiver_id" -# ], -# constraints: [ -# "sender must exist", -# "receiver must exist" -# ] -# } +# --- Test Specifications (The "What" and "Why", not the "Data") --- +# @TEST_CONTRACT: Input -> TransferInputDTO, Output -> TransferResultDTO -# @TEST_CONTRACT: TransferResult -> -# { -# required_fields: { -# tx_id: str, -# status: str, -# new_balance: Decimal -# }, -# invariants: [ -# "status == COMPLETED implies balance mutation occurred" -# ] -# } +# Happy Path +# @TEST_SCENARIO: sufficient_funds -> Returns COMPLETED, balances updated. +# @TEST_FIXTURE: sufficient_funds -> file:./__tests__/fixtures/transfers.json#happy_path -# @TEST_FIXTURE: sufficient_funds -> -# { -# sender_balance: 500.00, -# receiver_balance: 100.00, -# amount: 100.00 -# } +# Edge Cases (CRITICAL) +# @TEST_SCENARIO: insufficient_funds -> Throws BusinessRuleViolation("INSUFFICIENT_FUNDS"). +# @TEST_SCENARIO: negative_amount -> Throws BusinessRuleViolation("Transfer amount must be positive."). +# @TEST_SCENARIO: self_transfer -> Throws BusinessRuleViolation("Cannot transfer to self."). +# @TEST_SCENARIO: audit_failure -> Throws RuntimeError("TRANSACTION_ABORTED"). +# @TEST_SCENARIO: concurrency_conflict -> Throws DBTransactionError. -# @TEST_EDGE: insufficient_funds -> -# { -# sender_balance: 50.00, -# receiver_balance: 100.00, -# amount: 100.00 -# } -# -# @TEST_EDGE: negative_amount -> -# { -# sender_balance: 500.00, -# receiver_balance: 100.00, -# amount: -10.00 -# } -# -# @TEST_EDGE: self_transfer -> -# { -# sender_id: "acc_A", -# receiver_id: "acc_A", -# amount: 10.00 -# } - -# @TEST_EDGE: audit_failure -> raises Exception -# @TEST_EDGE: concurrency_conflict -> special: concurrent_execution - -# @TEST_INVARIANT: total_balance_constant -> verifies: [sufficient_funds, concurrency_conflict] -# @TEST_INVARIANT: no_partial_commit -> verifies: [audit_failure] -# @TEST_INVARIANT: negative_transfer_forbidden -> verifies: [negative_amount] +# Linking Tests to Invariants +# @TEST_INVARIANT: total_balance_constant -> VERIFIED_BY: [sufficient_funds, concurrency_conflict] +# @TEST_INVARIANT: negative_transfer_forbidden -> VERIFIED_BY: [negative_amount] from decimal import Decimal diff --git a/backend/src/api/routes/__tests__/test_migration_routes.py b/backend/src/api/routes/__tests__/test_migration_routes.py index 6863eff..66e5b57 100644 --- a/backend/src/api/routes/__tests__/test_migration_routes.py +++ b/backend/src/api/routes/__tests__/test_migration_routes.py @@ -407,4 +407,104 @@ async def test_execute_migration_invalid_env_raises_400(_mock_env): assert exc.value.status_code == 400 +@pytest.mark.asyncio +async def test_dry_run_migration_returns_diff_and_risk(db_session): + # @TEST_EDGE: missing_target_datasource -> validates high risk item generation + # @TEST_EDGE: breaking_reference -> validates high risk on missing dataset link + from src.api.routes.migration import dry_run_migration + from src.models.dashboard import DashboardSelection + + env_source = MagicMock() + env_source.id = "src" + env_source.name = "Source" + env_source.url = "http://source" + env_source.username = "admin" + env_source.password = "admin" + env_source.verify_ssl = False + env_source.timeout = 30 + + env_target = MagicMock() + env_target.id = "tgt" + env_target.name = "Target" + env_target.url = "http://target" + env_target.username = "admin" + env_target.password = "admin" + env_target.verify_ssl = False + env_target.timeout = 30 + + cm = _make_sync_config_manager([env_source, env_target]) + selection = DashboardSelection( + selected_ids=[42], + source_env_id="src", + target_env_id="tgt", + replace_db_config=False, + fix_cross_filters=True, + ) + + with patch("src.api.routes.migration.SupersetClient") as MockClient, \ + patch("src.api.routes.migration.MigrationDryRunService") as MockService: + source_client = MagicMock() + target_client = MagicMock() + MockClient.side_effect = [source_client, target_client] + + service_instance = MagicMock() + service_payload = { + "generated_at": "2026-02-27T00:00:00+00:00", + "selection": selection.model_dump(), + "selected_dashboard_titles": ["Sales"], + "diff": { + "dashboards": {"create": [], "update": [{"uuid": "dash-1"}], "delete": []}, + "charts": {"create": [{"uuid": "chart-1"}], "update": [], "delete": []}, + "datasets": {"create": [{"uuid": "dataset-1"}], "update": [], "delete": []}, + }, + "summary": { + "dashboards": {"create": 0, "update": 1, "delete": 0}, + "charts": {"create": 1, "update": 0, "delete": 0}, + "datasets": {"create": 1, "update": 0, "delete": 0}, + "selected_dashboards": 1, + }, + "risk": { + "score": 75, + "level": "high", + "items": [ + {"code": "missing_datasource"}, + {"code": "breaking_reference"}, + ], + }, + } + service_instance.run.return_value = service_payload + MockService.return_value = service_instance + + result = await dry_run_migration(selection=selection, config_manager=cm, db=db_session, _=None) + + assert result["summary"]["dashboards"]["update"] == 1 + assert result["summary"]["charts"]["create"] == 1 + assert result["summary"]["datasets"]["create"] == 1 + assert result["risk"]["score"] > 0 + assert any(item["code"] == "missing_datasource" for item in result["risk"]["items"]) + assert any(item["code"] == "breaking_reference" for item in result["risk"]["items"]) + + +@pytest.mark.asyncio +async def test_dry_run_migration_rejects_same_environment(db_session): + from src.api.routes.migration import dry_run_migration + from src.models.dashboard import DashboardSelection + + env = MagicMock() + env.id = "same" + env.name = "Same" + env.url = "http://same" + env.username = "admin" + env.password = "admin" + env.verify_ssl = False + env.timeout = 30 + + cm = _make_sync_config_manager([env]) + selection = DashboardSelection(selected_ids=[1], source_env_id="same", target_env_id="same") + + with pytest.raises(HTTPException) as exc: + await dry_run_migration(selection=selection, config_manager=cm, db=db_session, _=None) + assert exc.value.status_code == 400 + + # [/DEF:backend.src.api.routes.__tests__.test_migration_routes:Module] diff --git a/backend/src/api/routes/migration.py b/backend/src/api/routes/migration.py index ccf16c6..7a599c5 100644 --- a/backend/src/api/routes/migration.py +++ b/backend/src/api/routes/migration.py @@ -14,6 +14,7 @@ from ...core.database import get_db from ...models.dashboard import DashboardMetadata, DashboardSelection from ...core.superset_client import SupersetClient from ...core.logger import belief_scope +from ...core.migration.dry_run_orchestrator import MigrationDryRunService from ...core.mapping_service import IdMappingService from ...models.mapping import ResourceMapping @@ -83,6 +84,44 @@ async def execute_migration( raise HTTPException(status_code=500, detail=f"Failed to create migration task: {str(e)}") # [/DEF:execute_migration:Function] + +# [DEF:dry_run_migration:Function] +# @PURPOSE: Build pre-flight diff and risk summary without applying migration. +# @PRE: Selection and environments are valid. +# @POST: Returns deterministic JSON diff and risk scoring. +@router.post("/migration/dry-run", response_model=Dict[str, Any]) +async def dry_run_migration( + selection: DashboardSelection, + config_manager=Depends(get_config_manager), + db: Session = Depends(get_db), + _ = Depends(has_permission("plugin:migration", "EXECUTE")) +): + with belief_scope("dry_run_migration"): + environments = config_manager.get_environments() + env_map = {env.id: env for env in environments} + source_env = env_map.get(selection.source_env_id) + target_env = env_map.get(selection.target_env_id) + if not source_env or not target_env: + raise HTTPException(status_code=400, detail="Invalid source or target environment") + if selection.source_env_id == selection.target_env_id: + raise HTTPException(status_code=400, detail="Source and target environments must be different") + if not selection.selected_ids: + raise HTTPException(status_code=400, detail="No dashboards selected for dry run") + + service = MigrationDryRunService() + source_client = SupersetClient(source_env) + target_client = SupersetClient(target_env) + try: + return service.run( + selection=selection, + source_client=source_client, + target_client=target_client, + db=db, + ) + except ValueError as exc: + raise HTTPException(status_code=500, detail=str(exc)) from exc +# [/DEF:dry_run_migration:Function] + # [DEF:get_migration_settings:Function] # @PURPOSE: Get current migration Cron string explicitly. @router.get("/migration/settings", response_model=Dict[str, str]) @@ -221,4 +260,4 @@ async def trigger_sync_now( } # [/DEF:trigger_sync_now:Function] -# [/DEF:backend.src.api.routes.migration:Module] \ No newline at end of file +# [/DEF:backend.src.api.routes.migration:Module] diff --git a/backend/src/core/migration/__init__.py b/backend/src/core/migration/__init__.py new file mode 100644 index 0000000..360f617 --- /dev/null +++ b/backend/src/core/migration/__init__.py @@ -0,0 +1,12 @@ +# [DEF:backend.src.core.migration.__init__:Module] +# @TIER: TRIVIAL +# @SEMANTICS: migration, package, exports +# @PURPOSE: Namespace package for migration pre-flight orchestration components. +# @LAYER: Core + +from .dry_run_orchestrator import MigrationDryRunService +from .archive_parser import MigrationArchiveParser + +__all__ = ["MigrationDryRunService", "MigrationArchiveParser"] + +# [/DEF:backend.src.core.migration.__init__:Module] diff --git a/backend/src/core/migration/archive_parser.py b/backend/src/core/migration/archive_parser.py new file mode 100644 index 0000000..a8be8ff --- /dev/null +++ b/backend/src/core/migration/archive_parser.py @@ -0,0 +1,139 @@ +# [DEF:backend.src.core.migration.archive_parser:Module] +# @TIER: STANDARD +# @SEMANTICS: migration, zip, parser, yaml, metadata +# @PURPOSE: Parse Superset export ZIP archives into normalized object catalogs for diffing. +# @LAYER: Core +# @RELATION: DEPENDS_ON -> backend.src.core.logger +# @INVARIANT: Parsing is read-only and never mutates archive files. + +import json +import tempfile +import zipfile +from pathlib import Path +from typing import Any, Dict, List, Optional + +import yaml + +from ..logger import logger, belief_scope + + +# [DEF:MigrationArchiveParser:Class] +# @PURPOSE: Extract normalized dashboards/charts/datasets metadata from ZIP archives. +class MigrationArchiveParser: + # [DEF:extract_objects_from_zip:Function] + # @PURPOSE: 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]]] + def extract_objects_from_zip(self, zip_path: str) -> Dict[str, List[Dict[str, Any]]]: + with belief_scope("MigrationArchiveParser.extract_objects_from_zip"): + result: Dict[str, List[Dict[str, Any]]] = { + "dashboards": [], + "charts": [], + "datasets": [], + } + with tempfile.TemporaryDirectory() as temp_dir_str: + temp_dir = Path(temp_dir_str) + with zipfile.ZipFile(zip_path, "r") as zip_file: + zip_file.extractall(temp_dir) + + result["dashboards"] = self._collect_yaml_objects(temp_dir, "dashboards") + result["charts"] = self._collect_yaml_objects(temp_dir, "charts") + result["datasets"] = self._collect_yaml_objects(temp_dir, "datasets") + + return result + # [/DEF:extract_objects_from_zip:Function] + + # [DEF:_collect_yaml_objects:Function] + # @PURPOSE: Read and normalize YAML manifests for one object type. + # @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]]: + with belief_scope("MigrationArchiveParser._collect_yaml_objects"): + files = list(root_dir.glob(f"**/{object_type}/**/*.yaml")) + list(root_dir.glob(f"**/{object_type}/*.yaml")) + objects: List[Dict[str, Any]] = [] + for file_path in set(files): + try: + with open(file_path, "r") as file_obj: + payload = yaml.safe_load(file_obj) or {} + normalized = self._normalize_object_payload(payload, object_type) + if normalized: + objects.append(normalized) + except Exception as exc: + logger.reflect( + "[MigrationArchiveParser._collect_yaml_objects][REFLECT] skip_invalid_yaml path=%s error=%s", + file_path, + exc, + ) + return objects + # [/DEF:_collect_yaml_objects:Function] + + # [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]]: + with belief_scope("MigrationArchiveParser._normalize_object_payload"): + if not isinstance(payload, dict): + return None + uuid = payload.get("uuid") + if not uuid: + return None + + if object_type == "dashboards": + title = payload.get("dashboard_title") or payload.get("title") + signature = { + "title": title, + "slug": payload.get("slug"), + "position_json": payload.get("position_json"), + "json_metadata": payload.get("json_metadata"), + "description": payload.get("description"), + "owners": payload.get("owners"), + } + return { + "uuid": str(uuid), + "title": title or f"Dashboard {uuid}", + "signature": json.dumps(signature, sort_keys=True, default=str), + "owners": payload.get("owners") or [], + } + + if object_type == "charts": + title = payload.get("slice_name") or payload.get("name") + signature = { + "title": title, + "viz_type": payload.get("viz_type"), + "params": payload.get("params"), + "query_context": payload.get("query_context"), + "datasource_uuid": payload.get("datasource_uuid"), + "dataset_uuid": payload.get("dataset_uuid"), + } + return { + "uuid": str(uuid), + "title": title or f"Chart {uuid}", + "signature": json.dumps(signature, sort_keys=True, default=str), + "dataset_uuid": payload.get("datasource_uuid") or payload.get("dataset_uuid"), + } + + if object_type == "datasets": + title = payload.get("table_name") or payload.get("name") + signature = { + "title": title, + "schema": payload.get("schema"), + "database_uuid": payload.get("database_uuid"), + "sql": payload.get("sql"), + "columns": payload.get("columns"), + "metrics": payload.get("metrics"), + } + return { + "uuid": str(uuid), + "title": title or f"Dataset {uuid}", + "signature": json.dumps(signature, sort_keys=True, default=str), + "database_uuid": payload.get("database_uuid"), + } + + return None + # [/DEF:_normalize_object_payload:Function] + + +# [/DEF:MigrationArchiveParser:Class] +# [/DEF:backend.src.core.migration.archive_parser:Module] diff --git a/backend/src/core/migration/dry_run_orchestrator.py b/backend/src/core/migration/dry_run_orchestrator.py new file mode 100644 index 0000000..29a6a1f --- /dev/null +++ b/backend/src/core/migration/dry_run_orchestrator.py @@ -0,0 +1,235 @@ +# [DEF:backend.src.core.migration.dry_run_orchestrator:Module] +# @TIER: STANDARD +# @SEMANTICS: migration, dry_run, diff, risk, superset +# @PURPOSE: Compute pre-flight migration diff and risk scoring without apply. +# @LAYER: Core +# @RELATION: DEPENDS_ON -> backend.src.core.superset_client +# @RELATION: DEPENDS_ON -> backend.src.core.migration_engine +# @RELATION: DEPENDS_ON -> backend.src.core.migration.archive_parser +# @RELATION: DEPENDS_ON -> backend.src.core.migration.risk_assessor +# @INVARIANT: Dry run is informative only and must not mutate target environment. + +from datetime import datetime, timezone +import json +from typing import Any, Dict, List + +from sqlalchemy.orm import Session + +from ...models.dashboard import DashboardSelection +from ...models.mapping import DatabaseMapping +from ..logger import logger, belief_scope +from .archive_parser import MigrationArchiveParser +from .risk_assessor import build_risks, score_risks +from ..migration_engine import MigrationEngine +from ..superset_client import SupersetClient +from ..utils.fileio import create_temp_file + + +# [DEF:MigrationDryRunService:Class] +# @PURPOSE: Build deterministic diff/risk payload for migration pre-flight. +class MigrationDryRunService: + # [DEF:__init__:Function] + # @PURPOSE: Wire parser dependency for archive object extraction. + # @PRE: parser can be omitted to use default implementation. + # @POST: Service is ready to calculate dry-run payload. + def __init__(self, parser: MigrationArchiveParser | None = None): + self.parser = parser or MigrationArchiveParser() + # [/DEF:__init__:Function] + + # [DEF:run:Function] + # @PURPOSE: Execute full dry-run computation for selected dashboards. + # @PRE: source/target clients are authenticated and selection validated by caller. + # @POST: Returns JSON-serializable pre-flight payload with summary, diff and risk. + # @SIDE_EFFECT: Reads source export archives and target metadata via network. + def run( + self, + selection: DashboardSelection, + source_client: SupersetClient, + target_client: SupersetClient, + db: Session, + ) -> Dict[str, Any]: + with belief_scope("MigrationDryRunService.run"): + logger.explore("[MigrationDryRunService.run][EXPLORE] starting dry-run pipeline") + engine = MigrationEngine() + db_mapping = self._load_db_mapping(db, selection) if selection.replace_db_config else {} + transformed = {"dashboards": {}, "charts": {}, "datasets": {}} + + dashboards_preview = source_client.get_dashboards_summary() + selected_preview = { + item["id"]: item + for item in dashboards_preview + if item.get("id") in selection.selected_ids + } + + for dashboard_id in selection.selected_ids: + exported_content, _ = source_client.export_dashboard(int(dashboard_id)) + with create_temp_file(content=exported_content, suffix=".zip") as source_zip: + with create_temp_file(suffix=".zip") as transformed_zip: + success = engine.transform_zip( + str(source_zip), + str(transformed_zip), + db_mapping, + strip_databases=False, + target_env_id=selection.target_env_id, + fix_cross_filters=selection.fix_cross_filters, + ) + if not success: + raise ValueError(f"Failed to transform export archive for dashboard {dashboard_id}") + extracted = self.parser.extract_objects_from_zip(str(transformed_zip)) + self._accumulate_objects(transformed, extracted) + + source_objects = {key: list(value.values()) for key, value in transformed.items()} + target_objects = self._build_target_signatures(target_client) + diff = { + "dashboards": self._build_object_diff(source_objects["dashboards"], target_objects["dashboards"]), + "charts": self._build_object_diff(source_objects["charts"], target_objects["charts"]), + "datasets": self._build_object_diff(source_objects["datasets"], target_objects["datasets"]), + } + risk = self._build_risks(source_objects, target_objects, diff, target_client) + + summary = { + "dashboards": {action: len(diff["dashboards"][action]) for action in ("create", "update", "delete")}, + "charts": {action: len(diff["charts"][action]) for action in ("create", "update", "delete")}, + "datasets": {action: len(diff["datasets"][action]) for action in ("create", "update", "delete")}, + "selected_dashboards": len(selection.selected_ids), + } + selected_titles = [ + selected_preview[dash_id]["title"] + for dash_id in selection.selected_ids + if dash_id in selected_preview + ] + + logger.reason("[MigrationDryRunService.run][REASON] dry-run payload assembled") + return { + "generated_at": datetime.now(timezone.utc).isoformat(), + "selection": selection.model_dump(), + "selected_dashboard_titles": selected_titles, + "diff": diff, + "summary": summary, + "risk": score_risks(risk), + } + # [/DEF:run:Function] + + # [DEF:_load_db_mapping:Function] + # @PURPOSE: Resolve UUID mapping for optional DB config replacement. + def _load_db_mapping(self, db: Session, selection: DashboardSelection) -> Dict[str, str]: + rows = db.query(DatabaseMapping).filter( + DatabaseMapping.source_env_id == selection.source_env_id, + DatabaseMapping.target_env_id == selection.target_env_id, + ).all() + return {row.source_db_uuid: row.target_db_uuid for row in rows} + # [/DEF:_load_db_mapping:Function] + + # [DEF:_accumulate_objects:Function] + # @PURPOSE: Merge extracted resources by UUID to avoid duplicates. + def _accumulate_objects(self, target: Dict[str, Dict[str, Dict[str, Any]]], source: Dict[str, List[Dict[str, Any]]]) -> None: + for object_type in ("dashboards", "charts", "datasets"): + for item in source.get(object_type, []): + uuid = item.get("uuid") + if uuid: + target[object_type][str(uuid)] = item + # [/DEF:_accumulate_objects:Function] + + # [DEF:_index_by_uuid:Function] + # @PURPOSE: Build UUID-index map for normalized resources. + def _index_by_uuid(self, objects: List[Dict[str, Any]]) -> Dict[str, Dict[str, Any]]: + indexed: Dict[str, Dict[str, Any]] = {} + for obj in objects: + uuid = obj.get("uuid") + if uuid: + indexed[str(uuid)] = obj + return indexed + # [/DEF:_index_by_uuid:Function] + + # [DEF:_build_object_diff:Function] + # @PURPOSE: Compute create/update/delete buckets by UUID+signature. + def _build_object_diff(self, source_objects: List[Dict[str, Any]], target_objects: List[Dict[str, Any]]) -> Dict[str, List[Dict[str, Any]]]: + target_index = self._index_by_uuid(target_objects) + created: List[Dict[str, Any]] = [] + updated: List[Dict[str, Any]] = [] + deleted: List[Dict[str, Any]] = [] + for source_obj in source_objects: + source_uuid = str(source_obj.get("uuid")) + target_obj = target_index.get(source_uuid) + if not target_obj: + created.append({"uuid": source_uuid, "title": source_obj.get("title")}) + continue + if source_obj.get("signature") != target_obj.get("signature"): + updated.append({ + "uuid": source_uuid, + "title": source_obj.get("title"), + "target_title": target_obj.get("title"), + }) + return {"create": created, "update": updated, "delete": deleted} + # [/DEF:_build_object_diff:Function] + + # [DEF:_build_target_signatures:Function] + # @PURPOSE: Pull target metadata and normalize it into comparable signatures. + def _build_target_signatures(self, client: SupersetClient) -> Dict[str, List[Dict[str, Any]]]: + _, dashboards = client.get_dashboards(query={ + "columns": ["uuid", "dashboard_title", "slug", "position_json", "json_metadata", "description", "owners"], + }) + _, datasets = client.get_datasets(query={ + "columns": ["uuid", "table_name", "schema", "database_uuid", "sql", "columns", "metrics"], + }) + _, charts = client.get_charts(query={ + "columns": ["uuid", "slice_name", "viz_type", "params", "query_context", "datasource_uuid", "dataset_uuid"], + }) + return { + "dashboards": [{ + "uuid": str(item.get("uuid")), + "title": item.get("dashboard_title"), + "owners": item.get("owners") or [], + "signature": json.dumps({ + "title": item.get("dashboard_title"), + "slug": item.get("slug"), + "position_json": item.get("position_json"), + "json_metadata": item.get("json_metadata"), + "description": item.get("description"), + "owners": item.get("owners"), + }, sort_keys=True, default=str), + } for item in dashboards if item.get("uuid")], + "datasets": [{ + "uuid": str(item.get("uuid")), + "title": item.get("table_name"), + "database_uuid": item.get("database_uuid"), + "signature": json.dumps({ + "title": item.get("table_name"), + "schema": item.get("schema"), + "database_uuid": item.get("database_uuid"), + "sql": item.get("sql"), + "columns": item.get("columns"), + "metrics": item.get("metrics"), + }, sort_keys=True, default=str), + } for item in datasets if item.get("uuid")], + "charts": [{ + "uuid": str(item.get("uuid")), + "title": item.get("slice_name") or item.get("name"), + "dataset_uuid": item.get("datasource_uuid") or item.get("dataset_uuid"), + "signature": json.dumps({ + "title": item.get("slice_name") or item.get("name"), + "viz_type": item.get("viz_type"), + "params": item.get("params"), + "query_context": item.get("query_context"), + "datasource_uuid": item.get("datasource_uuid"), + "dataset_uuid": item.get("dataset_uuid"), + }, sort_keys=True, default=str), + } for item in charts if item.get("uuid")], + } + # [/DEF:_build_target_signatures:Function] + + # [DEF:_build_risks:Function] + # @PURPOSE: Build risk items for missing datasource, broken refs, overwrite, owner mismatch. + def _build_risks( + self, + source_objects: Dict[str, List[Dict[str, Any]]], + target_objects: Dict[str, List[Dict[str, Any]]], + diff: Dict[str, Dict[str, List[Dict[str, Any]]]], + target_client: SupersetClient, + ) -> List[Dict[str, Any]]: + return build_risks(source_objects, target_objects, diff, target_client) + # [/DEF:_build_risks:Function] + + +# [/DEF:MigrationDryRunService:Class] +# [/DEF:backend.src.core.migration.dry_run_orchestrator:Module] diff --git a/backend/src/core/migration/risk_assessor.py b/backend/src/core/migration/risk_assessor.py new file mode 100644 index 0000000..d296d69 --- /dev/null +++ b/backend/src/core/migration/risk_assessor.py @@ -0,0 +1,119 @@ +# [DEF:backend.src.core.migration.risk_assessor:Module] +# @TIER: STANDARD +# @SEMANTICS: migration, dry_run, risk, scoring +# @PURPOSE: Risk evaluation helpers for migration pre-flight reporting. +# @LAYER: Core +# @RELATION: USED_BY -> backend.src.core.migration.dry_run_orchestrator + +from typing import Any, Dict, List + +from ..superset_client import SupersetClient + + +# [DEF:index_by_uuid:Function] +# @PURPOSE: Build UUID-index from normalized objects. +def index_by_uuid(objects: List[Dict[str, Any]]) -> Dict[str, Dict[str, Any]]: + indexed: Dict[str, Dict[str, Any]] = {} + for obj in objects: + uuid = obj.get("uuid") + if uuid: + indexed[str(uuid)] = obj + return indexed +# [/DEF:index_by_uuid:Function] + + +# [DEF:extract_owner_identifiers:Function] +# @PURPOSE: Normalize owner payloads for stable comparison. +def extract_owner_identifiers(owners: Any) -> List[str]: + if not isinstance(owners, list): + return [] + ids: List[str] = [] + for owner in owners: + if isinstance(owner, dict): + if owner.get("username"): + ids.append(str(owner["username"])) + elif owner.get("id") is not None: + ids.append(str(owner["id"])) + elif owner is not None: + ids.append(str(owner)) + return sorted(set(ids)) +# [/DEF:extract_owner_identifiers:Function] + + +# [DEF:build_risks:Function] +# @PURPOSE: Build risk list from computed diffs and target catalog state. +def build_risks( + source_objects: Dict[str, List[Dict[str, Any]]], + target_objects: Dict[str, List[Dict[str, Any]]], + diff: Dict[str, Dict[str, List[Dict[str, Any]]]], + target_client: SupersetClient, +) -> List[Dict[str, Any]]: + risks: List[Dict[str, Any]] = [] + for object_type in ("dashboards", "charts", "datasets"): + for item in diff[object_type]["update"]: + risks.append({ + "code": "overwrite_existing", + "severity": "medium", + "object_type": object_type[:-1], + "object_uuid": item["uuid"], + "message": f"Object will be updated in target: {item.get('title') or item['uuid']}", + }) + + target_dataset_uuids = set(index_by_uuid(target_objects["datasets"]).keys()) + _, target_databases = target_client.get_databases(query={"columns": ["uuid"]}) + target_database_uuids = {str(item.get("uuid")) for item in target_databases if item.get("uuid")} + + for dataset in source_objects["datasets"]: + db_uuid = dataset.get("database_uuid") + if db_uuid and str(db_uuid) not in target_database_uuids: + risks.append({ + "code": "missing_datasource", + "severity": "high", + "object_type": "dataset", + "object_uuid": dataset.get("uuid"), + "message": f"Target datasource is missing for dataset {dataset.get('title') or dataset.get('uuid')}", + }) + + for chart in source_objects["charts"]: + ds_uuid = chart.get("dataset_uuid") + if ds_uuid and str(ds_uuid) not in target_dataset_uuids: + risks.append({ + "code": "breaking_reference", + "severity": "high", + "object_type": "chart", + "object_uuid": chart.get("uuid"), + "message": f"Chart references dataset not found on target: {ds_uuid}", + }) + + source_dash = index_by_uuid(source_objects["dashboards"]) + target_dash = index_by_uuid(target_objects["dashboards"]) + for item in diff["dashboards"]["update"]: + source_obj = source_dash.get(item["uuid"]) + target_obj = target_dash.get(item["uuid"]) + if not source_obj or not target_obj: + continue + source_owners = extract_owner_identifiers(source_obj.get("owners")) + target_owners = extract_owner_identifiers(target_obj.get("owners")) + if source_owners and target_owners and source_owners != target_owners: + risks.append({ + "code": "owner_mismatch", + "severity": "low", + "object_type": "dashboard", + "object_uuid": item["uuid"], + "message": f"Owner mismatch for dashboard {item.get('title') or item['uuid']}", + }) + return risks +# [/DEF:build_risks:Function] + + +# [DEF:score_risks:Function] +# @PURPOSE: Aggregate risk list into score and level. +def score_risks(risk_items: List[Dict[str, Any]]) -> Dict[str, Any]: + weights = {"high": 25, "medium": 10, "low": 5} + score = min(100, sum(weights.get(item.get("severity", "low"), 5) for item in risk_items)) + level = "low" if score < 25 else "medium" if score < 60 else "high" + return {"score": score, "level": level, "items": risk_items} +# [/DEF:score_risks:Function] + + +# [/DEF:backend.src.core.migration.risk_assessor:Module] diff --git a/backend/src/core/superset_client.py b/backend/src/core/superset_client.py index 5fbf196..37b97e7 100644 --- a/backend/src/core/superset_client.py +++ b/backend/src/core/superset_client.py @@ -336,6 +336,25 @@ class SupersetClient: } # [/DEF:get_dashboard_detail:Function] + # [DEF:get_charts:Function] + # @PURPOSE: Fetches all charts with pagination support. + # @PARAM: query (Optional[Dict]) - Optional query params/columns/filters. + # @PRE: Client is authenticated. + # @POST: Returns total count and charts list. + # @RETURN: Tuple[int, List[Dict]] + def get_charts(self, query: Optional[Dict] = None) -> Tuple[int, List[Dict]]: + with belief_scope("get_charts"): + validated_query = self._validate_query_params(query or {}) + if "columns" not in validated_query: + validated_query["columns"] = ["id", "uuid", "slice_name", "viz_type"] + + paginated_data = self._fetch_all_pages( + endpoint="/chart/", + pagination_options={"base_query": validated_query, "results_field": "result"}, + ) + return len(paginated_data), paginated_data + # [/DEF:get_charts:Function] + # [DEF:_extract_chart_ids_from_layout:Function] # @PURPOSE: Traverses dashboard layout metadata and extracts chart IDs from common keys. # @PRE: payload can be dict/list/scalar. diff --git a/backend/tests/core/migration/test_archive_parser.py b/backend/tests/core/migration/test_archive_parser.py new file mode 100644 index 0000000..050bca3 --- /dev/null +++ b/backend/tests/core/migration/test_archive_parser.py @@ -0,0 +1,62 @@ +# [DEF:backend.tests.core.migration.test_archive_parser:Module] +# +# @TIER: STANDARD +# @PURPOSE: Unit tests for MigrationArchiveParser ZIP extraction contract. +# @LAYER: Domain +# @RELATION: VERIFIES -> backend.src.core.migration.archive_parser +# +import os +import sys +import tempfile +import zipfile +from pathlib import Path + +import yaml + +backend_dir = str(Path(__file__).parent.parent.parent.parent.resolve()) +if backend_dir not in sys.path: + sys.path.insert(0, backend_dir) + +from src.core.migration.archive_parser import MigrationArchiveParser + + +def test_extract_objects_from_zip_collects_all_types(): + parser = MigrationArchiveParser() + with tempfile.TemporaryDirectory() as td: + td_path = Path(td) + zip_path = td_path / "objects.zip" + src_dir = td_path / "src" + (src_dir / "dashboards").mkdir(parents=True) + (src_dir / "charts").mkdir(parents=True) + (src_dir / "datasets").mkdir(parents=True) + + with open(src_dir / "dashboards" / "dash.yaml", "w") as file_obj: + yaml.dump({"uuid": "dash-u1", "dashboard_title": "D1", "json_metadata": "{}"}, file_obj) + with open(src_dir / "charts" / "chart.yaml", "w") as file_obj: + yaml.dump({"uuid": "chart-u1", "slice_name": "C1", "viz_type": "bar"}, file_obj) + with open(src_dir / "datasets" / "dataset.yaml", "w") as file_obj: + yaml.dump({"uuid": "ds-u1", "table_name": "orders", "database_uuid": "db-u1"}, file_obj) + + with zipfile.ZipFile(zip_path, "w") as zip_obj: + for root, _, files in os.walk(src_dir): + for file_name in files: + file_path = Path(root) / file_name + zip_obj.write(file_path, file_path.relative_to(src_dir)) + + extracted = parser.extract_objects_from_zip(str(zip_path)) + + if len(extracted["dashboards"]) != 1: + raise AssertionError("dashboards extraction size mismatch") + if extracted["dashboards"][0]["uuid"] != "dash-u1": + raise AssertionError("dashboard uuid mismatch") + if len(extracted["charts"]) != 1: + raise AssertionError("charts extraction size mismatch") + if extracted["charts"][0]["uuid"] != "chart-u1": + raise AssertionError("chart uuid mismatch") + if len(extracted["datasets"]) != 1: + raise AssertionError("datasets extraction size mismatch") + if extracted["datasets"][0]["uuid"] != "ds-u1": + raise AssertionError("dataset uuid mismatch") + + +# [/DEF:backend.tests.core.migration.test_archive_parser:Module] diff --git a/backend/tests/core/migration/test_dry_run_orchestrator.py b/backend/tests/core/migration/test_dry_run_orchestrator.py new file mode 100644 index 0000000..20ba409 --- /dev/null +++ b/backend/tests/core/migration/test_dry_run_orchestrator.py @@ -0,0 +1,110 @@ +# [DEF:backend.tests.core.migration.test_dry_run_orchestrator:Module] +# +# @TIER: STANDARD +# @PURPOSE: Unit tests for MigrationDryRunService diff and risk computation contracts. +# @LAYER: Domain +# @RELATION: VERIFIES -> backend.src.core.migration.dry_run_orchestrator +# +import json +import sys +from pathlib import Path +from unittest.mock import MagicMock, patch + +from sqlalchemy import create_engine +from sqlalchemy.orm import sessionmaker +from sqlalchemy.pool import StaticPool + +backend_dir = str(Path(__file__).parent.parent.parent.parent.resolve()) +if backend_dir not in sys.path: + sys.path.insert(0, backend_dir) + +from src.core.migration.dry_run_orchestrator import MigrationDryRunService +from src.models.dashboard import DashboardSelection +from src.models.mapping import Base + + +def _load_fixture() -> dict: + fixture_path = Path(__file__).parents[2] / "fixtures" / "migration_dry_run_fixture.json" + return json.loads(fixture_path.read_text()) + + +def _make_session(): + engine = create_engine( + "sqlite:///:memory:", + connect_args={"check_same_thread": False}, + poolclass=StaticPool, + ) + Base.metadata.create_all(engine) + Session = sessionmaker(bind=engine) + return Session() + + +def test_migration_dry_run_service_builds_diff_and_risk(): + # @TEST_CONTRACT: dry_run_result_contract -> { + # required_fields: {diff: object, summary: object, risk: object}, + # invariants: ["risk.score >= 0", "summary.selected_dashboards == len(selection.selected_ids)"] + # } + # @TEST_FIXTURE: migration_dry_run_fixture -> backend/tests/fixtures/migration_dry_run_fixture.json + # @TEST_EDGE: missing_target_datasource -> fixture.transformed_zip_objects.datasets[0].database_uuid + # @TEST_EDGE: breaking_reference -> fixture.transformed_zip_objects.charts[0].dataset_uuid + fixture = _load_fixture() + db = _make_session() + selection = DashboardSelection( + selected_ids=[42], + source_env_id="src", + target_env_id="tgt", + replace_db_config=False, + fix_cross_filters=True, + ) + + source_client = MagicMock() + source_client.get_dashboards_summary.return_value = fixture["source_dashboard_summary"] + source_client.export_dashboard.return_value = (b"PK\x03\x04", "source.zip") + + target_client = MagicMock() + target_client.get_dashboards.return_value = ( + len(fixture["target"]["dashboards"]), + fixture["target"]["dashboards"], + ) + target_client.get_datasets.return_value = ( + len(fixture["target"]["datasets"]), + fixture["target"]["datasets"], + ) + target_client.get_charts.return_value = ( + len(fixture["target"]["charts"]), + fixture["target"]["charts"], + ) + target_client.get_databases.return_value = ( + len(fixture["target"]["databases"]), + fixture["target"]["databases"], + ) + + parser = MagicMock() + parser.extract_objects_from_zip.return_value = fixture["transformed_zip_objects"] + service = MigrationDryRunService(parser=parser) + + with patch("src.core.migration.dry_run_orchestrator.MigrationEngine") as EngineMock: + engine = MagicMock() + engine.transform_zip.return_value = True + EngineMock.return_value = engine + result = service.run(selection, source_client, target_client, db) + + if "summary" not in result: + raise AssertionError("summary is missing in dry-run payload") + if result["summary"]["selected_dashboards"] != 1: + raise AssertionError("selected_dashboards summary mismatch") + if result["summary"]["dashboards"]["update"] != 1: + raise AssertionError("dashboard update count mismatch") + if result["summary"]["charts"]["create"] != 1: + raise AssertionError("chart create count mismatch") + if result["summary"]["datasets"]["create"] != 1: + raise AssertionError("dataset create count mismatch") + + risk_codes = {item["code"] for item in result["risk"]["items"]} + if "missing_datasource" not in risk_codes: + raise AssertionError("missing_datasource risk is not detected") + if "breaking_reference" not in risk_codes: + raise AssertionError("breaking_reference risk is not detected") + + +# [/DEF:backend.tests.core.migration.test_dry_run_orchestrator:Module] diff --git a/backend/tests/fixtures/migration_dry_run_fixture.json b/backend/tests/fixtures/migration_dry_run_fixture.json new file mode 100644 index 0000000..d0cc08e --- /dev/null +++ b/backend/tests/fixtures/migration_dry_run_fixture.json @@ -0,0 +1,58 @@ +{ + "source_dashboard_summary": [ + { + "id": 42, + "title": "Sales" + } + ], + "target": { + "dashboards": [ + { + "uuid": "dash-1", + "dashboard_title": "Sales Old", + "slug": "sales-old", + "position_json": "{}", + "json_metadata": "{}", + "description": "", + "owners": [ + { + "username": "owner-a" + } + ] + } + ], + "datasets": [], + "charts": [], + "databases": [] + }, + "transformed_zip_objects": { + "dashboards": [ + { + "uuid": "dash-1", + "title": "Sales New", + "signature": "{\"title\":\"Sales New\"}", + "owners": [ + { + "username": "owner-b" + } + ] + } + ], + "charts": [ + { + "uuid": "chart-1", + "title": "Chart A", + "signature": "{\"title\":\"Chart A\"}", + "dataset_uuid": "dataset-404" + } + ], + "datasets": [ + { + "uuid": "dataset-1", + "title": "orders", + "signature": "{\"title\":\"orders\"}", + "database_uuid": "db-missing" + } + ] + } +} diff --git a/frontend/src/routes/migration/+page.svelte b/frontend/src/routes/migration/+page.svelte index 1a54421..6540deb 100644 --- a/frontend/src/routes/migration/+page.svelte +++ b/frontend/src/routes/migration/+page.svelte @@ -24,6 +24,7 @@ import type { DashboardMetadata, DashboardSelection, + MigrationDryRunResult, } from "../../types/dashboard"; import { t } from "$lib/i18n"; import { Button, Card, PageHeader } from "$lib/ui"; @@ -44,6 +45,8 @@ let mappings: any[] = []; let suggestions: any[] = []; let fetchingDbs = false; + let dryRunLoading = false; + let dryRunResult: MigrationDryRunResult | null = null; // UI State for Modals let showLogViewer = false; @@ -253,6 +256,7 @@ error = ""; try { + dryRunResult = null; const selection: DashboardSelection = { selected_ids: selectedDashboardIds, source_env_id: sourceEnvId, @@ -296,6 +300,57 @@ } } // [/DEF:startMigration:Function] + + // [DEF:startDryRun:Function] + /** + * @purpose Builds pre-flight diff and risk summary without applying migration. + * @pre source/target environments and selected dashboards are valid. + * @post dryRunResult is populated with backend response. + * @UX_STATE: Idle -> Dry Run button is enabled when selection is valid. + * @UX_STATE: Loading -> Dry Run button shows "Dry Run..." and stays disabled. + * @UX_STATE: Error -> error banner is displayed and dryRunResult resets to null. + * @UX_FEEDBACK: User sees summary cards + risk block + JSON details after success. + * @UX_RECOVERY: User can adjust selection and press Dry Run again. + */ + async function startDryRun() { + if (!sourceEnvId || !targetEnvId) { + error = + $t.migration?.select_both_envs || + "Please select both source and target environments."; + return; + } + if (sourceEnvId === targetEnvId) { + error = + $t.migration?.different_envs || + "Source and target environments must be different."; + return; + } + if (selectedDashboardIds.length === 0) { + error = + $t.migration?.select_dashboards || + "Please select at least one dashboard to migrate."; + return; + } + + error = ""; + dryRunLoading = true; + try { + const selection: DashboardSelection = { + selected_ids: selectedDashboardIds, + source_env_id: sourceEnvId, + target_env_id: targetEnvId, + replace_db_config: replaceDb, + fix_cross_filters: fixCrossFilters, + }; + dryRunResult = await api.postApi("/migration/dry-run", selection); + } catch (e) { + error = e.message; + dryRunResult = null; + } finally { + dryRunLoading = false; + } + } + // [/DEF:startDryRun:Function] @@ -417,15 +472,70 @@ {/if} - +
{JSON.stringify(dryRunResult, null, 2)}
+