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,6 +1,6 @@
# [DEF:backend.tests.core.migration.test_archive_parser:Module]
#
# @TIER: STANDARD
# @COMPLEXITY: 3
# @PURPOSE: Unit tests for MigrationArchiveParser ZIP extraction contract.
# @LAYER: Domain
# @RELATION: VERIFIES -> backend.src.core.migration.archive_parser

View File

@@ -1,6 +1,6 @@
# [DEF:backend.tests.core.migration.test_dry_run_orchestrator:Module]
#
# @TIER: STANDARD
# @COMPLEXITY: 3
# @PURPOSE: Unit tests for MigrationDryRunService diff and risk computation contracts.
# @LAYER: Domain
# @RELATION: VERIFIES -> backend.src.core.migration.dry_run_orchestrator

View File

@@ -1,5 +1,5 @@
# [DEF:backend.tests.core.test_git_service_gitea_pr:Module]
# @TIER: STANDARD
# @COMPLEXITY: 3
# @SEMANTICS: tests, git, gitea, pull_request, fallback
# @PURPOSE: Validate Gitea PR creation fallback behavior when configured server URL is stale.
# @LAYER: Domain

View File

@@ -1,6 +1,6 @@
# [DEF:backend.tests.core.test_mapping_service:Module]
#
# @TIER: STANDARD
# @COMPLEXITY: 3
# @PURPOSE: Unit tests for the IdMappingService matching UUIDs to integer IDs.
# @LAYER: Domain
# @RELATION: VERIFIES -> backend.src.core.mapping_service

View File

@@ -1,6 +1,6 @@
# [DEF:backend.tests.core.test_migration_engine:Module]
#
# @TIER: STANDARD
# @COMPLEXITY: 3
# @PURPOSE: Unit tests for MigrationEngine's cross-filter patching algorithms.
# @LAYER: Domain
# @RELATION: VERIFIES -> backend.src.core.migration_engine

View File

@@ -1,5 +1,5 @@
# [DEF:test_clean_release_cli:Module]
# @TIER: STANDARD
# @COMPLEXITY: 3
# @PURPOSE: Smoke tests for the redesigned clean release CLI.
# @LAYER: Domain

View File

@@ -1,5 +1,5 @@
# [DEF:backend.tests.scripts.test_clean_release_tui:Module]
# @TIER: STANDARD
# @COMPLEXITY: 3
# @SEMANTICS: tests, tui, clean-release, curses
# @PURPOSE: Unit tests for the interactive curses TUI of the clean release process.
# @LAYER: Scripts

View File

@@ -1,5 +1,5 @@
# [DEF:test_clean_release_tui_v2:Module]
# @TIER: STANDARD
# @COMPLEXITY: 3
# @PURPOSE: Smoke tests for thin-client TUI action dispatch and blocked transition behavior.
# @LAYER: Domain
# @RELATION: TESTS -> backend.src.scripts.clean_release_tui

View File

@@ -1,5 +1,5 @@
# [DEF:backend.tests.services.clean_release.test_approval_service:Module]
# @TIER: CRITICAL
# @COMPLEXITY: 5
# @SEMANTICS: tests, clean-release, approval, lifecycle, gate
# @PURPOSE: Define approval gate contracts for approve/reject operations over immutable compliance evidence.
# @LAYER: Tests

View File

@@ -1,5 +1,5 @@
# [DEF:test_candidate_manifest_services:Module]
# @TIER: STANDARD
# @COMPLEXITY: 3
# @PURPOSE: Test lifecycle and manifest versioning for release candidates.
# @LAYER: Tests

View File

@@ -1,5 +1,5 @@
# [DEF:backend.tests.services.clean_release.test_compliance_execution_service:Module]
# @TIER: CRITICAL
# @COMPLEXITY: 5
# @SEMANTICS: tests, clean-release, compliance, pipeline, run-finalization
# @PURPOSE: Validate stage pipeline and run finalization contracts for compliance execution.
# @LAYER: Tests

View File

@@ -1,5 +1,5 @@
# [DEF:backend.tests.services.clean_release.test_compliance_task_integration:Module]
# @TIER: CRITICAL
# @COMPLEXITY: 5
# @SEMANTICS: tests, clean-release, compliance, task-manager, integration
# @PURPOSE: Verify clean release compliance runs execute through TaskManager lifecycle with observable success/failure outcomes.
# @LAYER: Tests

View File

@@ -1,5 +1,5 @@
# [DEF:backend.tests.services.clean_release.test_demo_mode_isolation:Module]
# @TIER: STANDARD
# @COMPLEXITY: 3
# @SEMANTICS: clean-release, demo-mode, isolation, namespace, repository
# @PURPOSE: Verify demo and real mode namespace isolation contracts before TUI integration.
# @LAYER: Tests

View File

@@ -1,5 +1,5 @@
# [DEF:backend.tests.services.clean_release.test_policy_resolution_service:Module]
# @TIER: CRITICAL
# @COMPLEXITY: 5
# @SEMANTICS: clean-release, policy-resolution, trusted-snapshots, contracts
# @PURPOSE: Verify trusted policy snapshot resolution contract and error guards.
# @LAYER: Tests

View File

@@ -1,5 +1,5 @@
# [DEF:backend.tests.services.clean_release.test_publication_service:Module]
# @TIER: CRITICAL
# @COMPLEXITY: 5
# @SEMANTICS: tests, clean-release, publication, revoke, gate
# @PURPOSE: Define publication gate contracts over approved candidates and immutable publication records.
# @LAYER: Tests

View File

@@ -1,5 +1,5 @@
# [DEF:backend.tests.services.clean_release.test_report_audit_immutability:Module]
# @TIER: CRITICAL
# @COMPLEXITY: 5
# @SEMANTICS: tests, clean-release, report, audit, immutability, append-only
# @PURPOSE: Validate report snapshot immutability expectations and append-only audit hook behavior for US2.
# @LAYER: Tests

View File

@@ -1,5 +1,5 @@
# [DEF:backend.tests.test_dashboards_api:Module]
# @TIER: STANDARD
# @COMPLEXITY: 3
# @PURPOSE: Comprehensive contract-driven tests for Dashboard Hub API
# @LAYER: Domain (Tests)
# @SEMANTICS: tests, dashboards, api, contract, remediation

View File

@@ -3,7 +3,7 @@
# @PURPOSE: Unit tests for TaskLogPersistenceService.
# @LAYER: Test
# @RELATION: TESTS -> TaskLogPersistenceService
# @TIER: CRITICAL
# @COMPLEXITY: 5
# [SECTION: IMPORTS]
from datetime import datetime
@@ -19,7 +19,7 @@ from src.core.task_manager.models import LogEntry, LogFilter
# [DEF:TestLogPersistence:Class]
# @PURPOSE: Test suite for TaskLogPersistenceService.
# @TIER: CRITICAL
# @COMPLEXITY: 5
# @TEST_DATA: log_entry -> {"task_id": "test-task-1", "level": "INFO", "source": "test_source", "message": "Test message"}
class TestLogPersistence:

View File

@@ -1,5 +1,5 @@
# [DEF:tests.test_logger:Module]
# @TIER: STANDARD
# @COMPLEXITY: 3
# @SEMANTICS: logging, tests, belief_state
# @PURPOSE: Unit tests for the custom logger formatters and configuration context manager.
# @LAYER: Logging (Tests)

View File

@@ -3,7 +3,7 @@
# @PURPOSE: Unit tests for TaskLogger and TaskContext.
# @LAYER: Test
# @RELATION: TESTS -> TaskLogger, TaskContext
# @TIER: STANDARD
# @COMPLEXITY: 3
# [SECTION: IMPORTS]
from unittest.mock import Mock
@@ -14,7 +14,7 @@ from src.core.task_manager.context import TaskContext
# [DEF:TestTaskLogger:Class]
# @PURPOSE: Test suite for TaskLogger.
# @TIER: STANDARD
# @COMPLEXITY: 3
class TestTaskLogger:
# [DEF:setup_method:Function]
@@ -220,7 +220,7 @@ class TestTaskLogger:
# [DEF:TestTaskContext:Class]
# @PURPOSE: Test suite for TaskContext.
# @TIER: STANDARD
# @COMPLEXITY: 3
class TestTaskContext:
# [DEF:setup_method:Function]

View File

@@ -1,5 +1,5 @@
# [DEF:test_task_manager:Module]
# @TIER: CRITICAL
# @COMPLEXITY: 5
# @SEMANTICS: task-manager, lifecycle, CRUD, log-buffer, filtering, tests
# @PURPOSE: Unit tests for TaskManager lifecycle, CRUD, log buffering, and filtering.
# @LAYER: Core

View File

@@ -3,7 +3,7 @@
# @PURPOSE: Unit tests for TaskPersistenceService.
# @LAYER: Test
# @RELATION: TESTS -> TaskPersistenceService
# @TIER: CRITICAL
# @COMPLEXITY: 5
# @TEST_DATA: valid_task -> {"id": "test-uuid-1", "plugin_id": "backup", "status": "PENDING"}
# [SECTION: IMPORTS]
@@ -22,7 +22,7 @@ from src.core.task_manager.models import Task, TaskStatus, LogEntry
# [DEF:TestTaskPersistenceHelpers:Class]
# @PURPOSE: Test suite for TaskPersistenceService static helper methods.
# @TIER: CRITICAL
# @COMPLEXITY: 5
class TestTaskPersistenceHelpers:
# [DEF:test_json_load_if_needed_none:Function]
@@ -111,7 +111,7 @@ class TestTaskPersistenceHelpers:
# [DEF:TestTaskPersistenceService:Class]
# @PURPOSE: Test suite for TaskPersistenceService CRUD operations.
# @TIER: CRITICAL
# @COMPLEXITY: 5
# @TEST_DATA: valid_task -> {"id": "test-uuid-1", "plugin_id": "backup", "status": "PENDING"}
class TestTaskPersistenceService: