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:
2026-03-16 10:06:44 +03:00
parent 321e0eb2db
commit 274510fc38
321 changed files with 30101 additions and 58483 deletions

View File

@@ -1,5 +1,5 @@
# [DEF:Dependencies:Module]
# @TIER: STANDARD
# [DEF:backend.src.dependencies:Module]
# @COMPLEXITY: 3
# @SEMANTICS: dependency, injection, singleton, factory, auth, jwt
# @PURPOSE: Manages creation and provision of shared application dependencies, such as PluginLoader and TaskManager, to avoid circular imports.
# @LAYER: Core
@@ -40,7 +40,7 @@ init_db()
config_manager = ConfigManager(config_path=str(config_path))
# [DEF:get_config_manager:Function]
# @TIER: TRIVIAL
# @COMPLEXITY: 1
# @PURPOSE: Dependency injector for ConfigManager.
# @PRE: Global config_manager must be initialized.
# @POST: Returns shared ConfigManager instance.
@@ -71,7 +71,7 @@ logger.info("ResourceService initialized")
# initialize them inside the dependency functions.
# [DEF:get_plugin_loader:Function]
# @TIER: TRIVIAL
# @COMPLEXITY: 1
# @PURPOSE: Dependency injector for PluginLoader.
# @PRE: Global plugin_loader must be initialized.
# @POST: Returns shared PluginLoader instance.
@@ -82,7 +82,7 @@ def get_plugin_loader() -> PluginLoader:
# [/DEF:get_plugin_loader:Function]
# [DEF:get_task_manager:Function]
# @TIER: TRIVIAL
# @COMPLEXITY: 1
# @PURPOSE: Dependency injector for TaskManager.
# @PRE: Global task_manager must be initialized.
# @POST: Returns shared TaskManager instance.
@@ -93,7 +93,7 @@ def get_task_manager() -> TaskManager:
# [/DEF:get_task_manager:Function]
# [DEF:get_scheduler_service:Function]
# @TIER: TRIVIAL
# @COMPLEXITY: 1
# @PURPOSE: Dependency injector for SchedulerService.
# @PRE: Global scheduler_service must be initialized.
# @POST: Returns shared SchedulerService instance.
@@ -104,7 +104,7 @@ def get_scheduler_service() -> SchedulerService:
# [/DEF:get_scheduler_service:Function]
# [DEF:get_resource_service:Function]
# @TIER: TRIVIAL
# @COMPLEXITY: 1
# @PURPOSE: Dependency injector for ResourceService.
# @PRE: Global resource_service must be initialized.
# @POST: Returns shared ResourceService instance.
@@ -115,7 +115,7 @@ def get_resource_service() -> ResourceService:
# [/DEF:get_resource_service:Function]
# [DEF:get_mapping_service:Function]
# @TIER: TRIVIAL
# @COMPLEXITY: 1
# @PURPOSE: Dependency injector for MappingService.
# @PRE: Global config_manager must be initialized.
# @POST: Returns new MappingService instance.
@@ -129,7 +129,7 @@ def get_mapping_service() -> MappingService:
_clean_release_repository = CleanReleaseRepository()
# [DEF:get_clean_release_repository:Function]
# @TIER: TRIVIAL
# @COMPLEXITY: 1
# @PURPOSE: Legacy compatibility shim for CleanReleaseRepository.
# @POST: Returns a shared CleanReleaseRepository instance.
def get_clean_release_repository() -> CleanReleaseRepository:
@@ -139,7 +139,7 @@ def get_clean_release_repository() -> CleanReleaseRepository:
# [DEF:get_clean_release_facade:Function]
# @TIER: TRIVIAL
# @COMPLEXITY: 1
# @PURPOSE: Dependency injector for CleanReleaseFacade.
# @POST: Returns a facade instance with a fresh DB session.
def get_clean_release_facade(db = Depends(get_db)) -> CleanReleaseFacade:
@@ -168,13 +168,13 @@ def get_clean_release_facade(db = Depends(get_db)) -> CleanReleaseFacade:
# [/DEF:get_clean_release_facade:Function]
# [DEF:oauth2_scheme:Variable]
# @TIER: TRIVIAL
# @COMPLEXITY: 1
# @PURPOSE: OAuth2 password bearer scheme for token extraction.
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/api/auth/login")
# [/DEF:oauth2_scheme:Variable]
# [DEF:get_current_user:Function]
# @TIER: STANDARD
# @COMPLEXITY: 3
# @PURPOSE: Dependency for retrieving currently authenticated user from a JWT.
# @PRE: JWT token provided in Authorization header.
# @POST: Returns User object if token is valid.
@@ -204,7 +204,7 @@ def get_current_user(token: str = Depends(oauth2_scheme), db = Depends(get_auth_
# [/DEF:get_current_user:Function]
# [DEF:has_permission:Function]
# @TIER: STANDARD
# @COMPLEXITY: 3
# @PURPOSE: Dependency for checking if the current user has a specific permission.
# @PRE: User is authenticated.
# @POST: Returns True if user has permission.
@@ -234,4 +234,4 @@ def has_permission(resource: str, action: str):
return permission_checker
# [/DEF:has_permission:Function]
# [/DEF:Dependencies:Module]
# [/DEF:backend.src.dependencies:Module]