refactor(semantics): migrate legacy @TIER to @COMPLEXITY annotations
- Replaced @TIER: TRIVIAL with @COMPLEXITY: 1 - Replaced @TIER: STANDARD with @COMPLEXITY: 3 - Replaced @TIER: CRITICAL with @COMPLEXITY: 5 - Manually elevated specific critical/complex components to levels 2 and 4 - Ignored legacy, specs, and node_modules directories - Updated generated semantic map
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
# [DEF:test_models:Module]
|
||||
# @TIER: TRIVIAL
|
||||
# @COMPLEXITY: 1
|
||||
# @PURPOSE: Unit tests for data models
|
||||
# @LAYER: Domain
|
||||
# @RELATION: VERIFIES -> src.models
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# [DEF:test_report_models:Module]
|
||||
# @TIER: STANDARD
|
||||
# @COMPLEXITY: 3
|
||||
# @PURPOSE: Unit tests for report Pydantic models and their validators
|
||||
# @LAYER: Domain
|
||||
# @RELATION: TESTS -> backend.src.models.report
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# [DEF:backend.src.models.assistant:Module]
|
||||
# @TIER: STANDARD
|
||||
# @COMPLEXITY: 3
|
||||
# @SEMANTICS: assistant, audit, confirmation, chat
|
||||
# @PURPOSE: SQLAlchemy models for assistant audit trail and confirmation tokens.
|
||||
# @LAYER: Domain
|
||||
@@ -14,7 +14,7 @@ from .mapping import Base
|
||||
|
||||
|
||||
# [DEF:AssistantAuditRecord:Class]
|
||||
# @TIER: STANDARD
|
||||
# @COMPLEXITY: 3
|
||||
# @PURPOSE: Store audit decisions and outcomes produced by assistant command handling.
|
||||
# @PRE: user_id must identify the actor for every record.
|
||||
# @POST: Audit payload remains available for compliance and debugging.
|
||||
@@ -33,7 +33,7 @@ class AssistantAuditRecord(Base):
|
||||
|
||||
|
||||
# [DEF:AssistantMessageRecord:Class]
|
||||
# @TIER: STANDARD
|
||||
# @COMPLEXITY: 3
|
||||
# @PURPOSE: Persist chat history entries for assistant conversations.
|
||||
# @PRE: user_id, conversation_id, role and text must be present.
|
||||
# @POST: Message row can be queried in chronological order.
|
||||
@@ -54,7 +54,7 @@ class AssistantMessageRecord(Base):
|
||||
|
||||
|
||||
# [DEF:AssistantConfirmationRecord:Class]
|
||||
# @TIER: STANDARD
|
||||
# @COMPLEXITY: 3
|
||||
# @PURPOSE: Persist risky operation confirmation tokens with lifecycle state.
|
||||
# @PRE: intent/dispatch and expiry timestamp must be provided.
|
||||
# @POST: State transitions can be tracked and audited.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# [DEF:backend.src.models.auth:Module]
|
||||
#
|
||||
# @TIER: STANDARD
|
||||
# @COMPLEXITY: 3
|
||||
# @SEMANTICS: auth, models, user, role, permission, sqlalchemy
|
||||
# @PURPOSE: SQLAlchemy models for multi-user authentication and authorization.
|
||||
# @LAYER: Domain
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# [DEF:backend.src.models.clean_release:Module]
|
||||
# @TIER: CRITICAL
|
||||
# @COMPLEXITY: 5
|
||||
# @SEMANTICS: clean-release, models, lifecycle, compliance, evidence, immutability
|
||||
# @PURPOSE: Define canonical clean release domain entities and lifecycle guards.
|
||||
# @LAYER: Domain
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# [DEF:backend.src.models.config:Module]
|
||||
#
|
||||
# @TIER: CRITICAL
|
||||
# @COMPLEXITY: 5
|
||||
# @SEMANTICS: database, config, settings, sqlalchemy, notification
|
||||
# @PURPOSE: Defines SQLAlchemy persistence models for application and notification configuration records.
|
||||
# @LAYER: Domain
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# [DEF:backend.src.models.connection:Module]
|
||||
#
|
||||
# @TIER: TRIVIAL
|
||||
# @COMPLEXITY: 1
|
||||
# @SEMANTICS: database, connection, configuration, sqlalchemy, sqlite
|
||||
# @PURPOSE: Defines the database schema for external database connection configurations.
|
||||
# @LAYER: Domain
|
||||
@@ -16,7 +16,7 @@ import uuid
|
||||
# [/SECTION]
|
||||
|
||||
# [DEF:ConnectionConfig:Class]
|
||||
# @TIER: TRIVIAL
|
||||
# @COMPLEXITY: 1
|
||||
# @PURPOSE: Stores credentials for external databases used for column mapping.
|
||||
class ConnectionConfig(Base):
|
||||
__tablename__ = "connection_configs"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# [DEF:backend.src.models.dashboard:Module]
|
||||
# @TIER: STANDARD
|
||||
# @COMPLEXITY: 3
|
||||
# @SEMANTICS: dashboard, model, metadata, migration
|
||||
# @PURPOSE: Defines data models for dashboard metadata and selection.
|
||||
# @LAYER: Model
|
||||
@@ -9,7 +9,7 @@ from pydantic import BaseModel
|
||||
from typing import List
|
||||
|
||||
# [DEF:DashboardMetadata:Class]
|
||||
# @TIER: TRIVIAL
|
||||
# @COMPLEXITY: 1
|
||||
# @PURPOSE: Represents a dashboard available for migration.
|
||||
class DashboardMetadata(BaseModel):
|
||||
id: int
|
||||
@@ -19,7 +19,7 @@ class DashboardMetadata(BaseModel):
|
||||
# [/DEF:DashboardMetadata:Class]
|
||||
|
||||
# [DEF:DashboardSelection:Class]
|
||||
# @TIER: TRIVIAL
|
||||
# @COMPLEXITY: 1
|
||||
# @PURPOSE: Represents the user's selection of dashboards to migrate.
|
||||
class DashboardSelection(BaseModel):
|
||||
selected_ids: List[int]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# [DEF:GitModels:Module]
|
||||
# @TIER: TRIVIAL
|
||||
# @COMPLEXITY: 1
|
||||
# @SEMANTICS: git, models, sqlalchemy, database, schema
|
||||
# @PURPOSE: Git-specific SQLAlchemy models for configuration and repository tracking.
|
||||
# @LAYER: Model
|
||||
@@ -27,7 +27,7 @@ class SyncStatus(str, enum.Enum):
|
||||
CONFLICT = "CONFLICT"
|
||||
|
||||
# [DEF:GitServerConfig:Class]
|
||||
# @TIER: TRIVIAL
|
||||
# @COMPLEXITY: 1
|
||||
# @PURPOSE: Configuration for a Git server connection.
|
||||
class GitServerConfig(Base):
|
||||
__tablename__ = "git_server_configs"
|
||||
@@ -44,7 +44,7 @@ class GitServerConfig(Base):
|
||||
# [/DEF:GitServerConfig:Class]
|
||||
|
||||
# [DEF:GitRepository:Class]
|
||||
# @TIER: TRIVIAL
|
||||
# @COMPLEXITY: 1
|
||||
# @PURPOSE: Tracking for a local Git repository linked to a dashboard.
|
||||
class GitRepository(Base):
|
||||
__tablename__ = "git_repositories"
|
||||
@@ -59,7 +59,7 @@ class GitRepository(Base):
|
||||
# [/DEF:GitRepository:Class]
|
||||
|
||||
# [DEF:DeploymentEnvironment:Class]
|
||||
# @TIER: TRIVIAL
|
||||
# @COMPLEXITY: 1
|
||||
# @PURPOSE: Target Superset environments for dashboard deployment.
|
||||
class DeploymentEnvironment(Base):
|
||||
__tablename__ = "deployment_environments"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# [DEF:backend.src.models.llm:Module]
|
||||
# @TIER: STANDARD
|
||||
# @COMPLEXITY: 3
|
||||
# @SEMANTICS: llm, models, sqlalchemy, persistence
|
||||
# @PURPOSE: SQLAlchemy models for LLM provider configuration and validation results.
|
||||
# @LAYER: Domain
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# [DEF:backend.src.models.mapping:Module]
|
||||
#
|
||||
# @TIER: STANDARD
|
||||
# @COMPLEXITY: 3
|
||||
# @SEMANTICS: database, mapping, environment, migration, sqlalchemy, sqlite
|
||||
# @PURPOSE: Defines the database schema for environment metadata and database mappings using SQLAlchemy.
|
||||
# @LAYER: Domain
|
||||
@@ -20,7 +20,7 @@ import enum
|
||||
Base = declarative_base()
|
||||
|
||||
# [DEF:ResourceType:Class]
|
||||
# @TIER: TRIVIAL
|
||||
# @COMPLEXITY: 1
|
||||
# @PURPOSE: Enumeration of possible Superset resource types for ID mapping.
|
||||
class ResourceType(str, enum.Enum):
|
||||
CHART = "chart"
|
||||
@@ -30,7 +30,7 @@ class ResourceType(str, enum.Enum):
|
||||
|
||||
|
||||
# [DEF:MigrationStatus:Class]
|
||||
# @TIER: TRIVIAL
|
||||
# @COMPLEXITY: 1
|
||||
# @PURPOSE: Enumeration of possible migration job statuses.
|
||||
class MigrationStatus(enum.Enum):
|
||||
PENDING = "PENDING"
|
||||
@@ -41,7 +41,7 @@ class MigrationStatus(enum.Enum):
|
||||
# [/DEF:MigrationStatus:Class]
|
||||
|
||||
# [DEF:Environment:Class]
|
||||
# @TIER: STANDARD
|
||||
# @COMPLEXITY: 3
|
||||
# @PURPOSE: Represents a Superset instance environment.
|
||||
class Environment(Base):
|
||||
__tablename__ = "environments"
|
||||
@@ -53,7 +53,7 @@ class Environment(Base):
|
||||
# [/DEF:Environment:Class]
|
||||
|
||||
# [DEF:DatabaseMapping:Class]
|
||||
# @TIER: STANDARD
|
||||
# @COMPLEXITY: 3
|
||||
# @PURPOSE: Represents a mapping between source and target databases.
|
||||
class DatabaseMapping(Base):
|
||||
__tablename__ = "database_mappings"
|
||||
@@ -69,7 +69,7 @@ class DatabaseMapping(Base):
|
||||
# [/DEF:DatabaseMapping:Class]
|
||||
|
||||
# [DEF:MigrationJob:Class]
|
||||
# @TIER: TRIVIAL
|
||||
# @COMPLEXITY: 2
|
||||
# @PURPOSE: Represents a single migration execution job.
|
||||
class MigrationJob(Base):
|
||||
__tablename__ = "migration_jobs"
|
||||
@@ -83,7 +83,7 @@ class MigrationJob(Base):
|
||||
# [/DEF:MigrationJob:Class]
|
||||
|
||||
# [DEF:ResourceMapping:Class]
|
||||
# @TIER: STANDARD
|
||||
# @COMPLEXITY: 3
|
||||
# @PURPOSE: Maps a universal UUID for a resource to its actual ID on a specific environment.
|
||||
# @TEST_DATA: resource_mapping_record -> {'environment_id': 'prod-env-1', 'resource_type': 'chart', 'uuid': '123e4567-e89b-12d3-a456-426614174000', 'remote_integer_id': '42'}
|
||||
class ResourceMapping(Base):
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# [DEF:backend.src.models.profile:Module]
|
||||
#
|
||||
# @TIER: STANDARD
|
||||
# @COMPLEXITY: 3
|
||||
# @SEMANTICS: profile, preferences, persistence, user, dashboard-filter, git, ui-preferences, sqlalchemy
|
||||
# @PURPOSE: Defines persistent per-user profile settings for dashboard filter, Git identity/token, and UX preferences.
|
||||
# @LAYER: Domain
|
||||
@@ -20,7 +20,7 @@ from .mapping import Base
|
||||
|
||||
|
||||
# [DEF:UserDashboardPreference:Class]
|
||||
# @TIER: STANDARD
|
||||
# @COMPLEXITY: 3
|
||||
# @PURPOSE: Stores Superset username binding and default "my dashboards" toggle for one authenticated user.
|
||||
class UserDashboardPreference(Base):
|
||||
__tablename__ = "user_dashboard_preferences"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# [DEF:backend.src.models.report:Module]
|
||||
# @TIER: CRITICAL
|
||||
# @COMPLEXITY: 5
|
||||
# @SEMANTICS: reports, models, pydantic, normalization, pagination
|
||||
# @PURPOSE: Canonical report schemas for unified task reporting across heterogeneous task types.
|
||||
# @LAYER: Domain
|
||||
@@ -20,7 +20,7 @@ from pydantic import BaseModel, Field, field_validator, model_validator
|
||||
|
||||
|
||||
# [DEF:TaskType:Class]
|
||||
# @TIER: CRITICAL
|
||||
# @COMPLEXITY: 5
|
||||
# @INVARIANT: Must contain valid generic task type mappings.
|
||||
# @SEMANTICS: enum, type, task
|
||||
# @PURPOSE: Supported normalized task report types.
|
||||
@@ -35,7 +35,7 @@ class TaskType(str, Enum):
|
||||
|
||||
|
||||
# [DEF:ReportStatus:Class]
|
||||
# @TIER: CRITICAL
|
||||
# @COMPLEXITY: 5
|
||||
# @INVARIANT: TaskStatus enum mapping logic holds.
|
||||
# @SEMANTICS: enum, status, task
|
||||
# @PURPOSE: Supported normalized report status values.
|
||||
@@ -48,7 +48,7 @@ class ReportStatus(str, Enum):
|
||||
|
||||
|
||||
# [DEF:ErrorContext:Class]
|
||||
# @TIER: CRITICAL
|
||||
# @COMPLEXITY: 5
|
||||
# @INVARIANT: The properties accurately describe error state.
|
||||
# @SEMANTICS: error, context, payload
|
||||
# @PURPOSE: Error and recovery context for failed/partial reports.
|
||||
@@ -73,7 +73,7 @@ class ErrorContext(BaseModel):
|
||||
|
||||
|
||||
# [DEF:TaskReport:Class]
|
||||
# @TIER: CRITICAL
|
||||
# @COMPLEXITY: 5
|
||||
# @INVARIANT: Must represent canonical task record attributes.
|
||||
# @SEMANTICS: report, model, summary
|
||||
# @PURPOSE: Canonical normalized report envelope for one task execution.
|
||||
@@ -130,7 +130,7 @@ class TaskReport(BaseModel):
|
||||
|
||||
|
||||
# [DEF:ReportQuery:Class]
|
||||
# @TIER: CRITICAL
|
||||
# @COMPLEXITY: 5
|
||||
# @INVARIANT: Time and pagination queries are mutually consistent.
|
||||
# @SEMANTICS: query, filter, search
|
||||
# @PURPOSE: Query object for server-side report filtering, sorting, and pagination.
|
||||
@@ -188,7 +188,7 @@ class ReportQuery(BaseModel):
|
||||
|
||||
|
||||
# [DEF:ReportCollection:Class]
|
||||
# @TIER: CRITICAL
|
||||
# @COMPLEXITY: 5
|
||||
# @INVARIANT: Represents paginated data correctly.
|
||||
# @SEMANTICS: collection, pagination
|
||||
# @PURPOSE: Paginated collection of normalized task reports.
|
||||
@@ -213,7 +213,7 @@ class ReportCollection(BaseModel):
|
||||
|
||||
|
||||
# [DEF:ReportDetailView:Class]
|
||||
# @TIER: CRITICAL
|
||||
# @COMPLEXITY: 5
|
||||
# @INVARIANT: Incorporates a report and logs correctly.
|
||||
# @SEMANTICS: view, detail, logs
|
||||
# @PURPOSE: Detailed report representation including diagnostics and recovery actions.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# [DEF:backend.src.models.storage:Module]
|
||||
# @TIER: TRIVIAL
|
||||
# @COMPLEXITY: 1
|
||||
# @SEMANTICS: storage, file, model, pydantic
|
||||
# @PURPOSE: Data models for the storage system.
|
||||
# @LAYER: Domain
|
||||
@@ -10,7 +10,7 @@ from typing import Optional
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
# [DEF:FileCategory:Class]
|
||||
# @TIER: TRIVIAL
|
||||
# @COMPLEXITY: 1
|
||||
# @PURPOSE: Enumeration of supported file categories in the storage system.
|
||||
class FileCategory(str, Enum):
|
||||
BACKUP = "backups"
|
||||
@@ -18,7 +18,7 @@ class FileCategory(str, Enum):
|
||||
# [/DEF:FileCategory:Class]
|
||||
|
||||
# [DEF:StorageConfig:Class]
|
||||
# @TIER: TRIVIAL
|
||||
# @COMPLEXITY: 1
|
||||
# @PURPOSE: Configuration model for the storage system, defining paths and naming patterns.
|
||||
class StorageConfig(BaseModel):
|
||||
root_path: str = Field(default="backups", description="Absolute path to the storage root directory.")
|
||||
@@ -30,7 +30,7 @@ class StorageConfig(BaseModel):
|
||||
# [/DEF:StorageConfig:Class]
|
||||
|
||||
# [DEF:StoredFile:Class]
|
||||
# @TIER: TRIVIAL
|
||||
# @COMPLEXITY: 1
|
||||
# @PURPOSE: Data model representing metadata for a file stored in the system.
|
||||
class StoredFile(BaseModel):
|
||||
name: str = Field(..., description="Name of the file (including extension).")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# [DEF:backend.src.models.task:Module]
|
||||
#
|
||||
# @TIER: TRIVIAL
|
||||
# @COMPLEXITY: 1
|
||||
# @SEMANTICS: database, task, record, sqlalchemy, sqlite
|
||||
# @PURPOSE: Defines the database schema for task execution records.
|
||||
# @LAYER: Domain
|
||||
@@ -16,7 +16,7 @@ import uuid
|
||||
# [/SECTION]
|
||||
|
||||
# [DEF:TaskRecord:Class]
|
||||
# @TIER: TRIVIAL
|
||||
# @COMPLEXITY: 1
|
||||
# @PURPOSE: Represents a persistent record of a task execution.
|
||||
class TaskRecord(Base):
|
||||
__tablename__ = "task_records"
|
||||
@@ -36,7 +36,7 @@ class TaskRecord(Base):
|
||||
|
||||
# [DEF:TaskLogRecord:Class]
|
||||
# @PURPOSE: Represents a single persistent log entry for a task.
|
||||
# @TIER: CRITICAL
|
||||
# @COMPLEXITY: 5
|
||||
# @RELATION: DEPENDS_ON -> TaskRecord
|
||||
# @INVARIANT: Each log entry belongs to exactly one task.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user