semantics: complete DEF-to-region migration, fix regressions

- Convert legacy [DEF🆔Type] anchors to #region/#endregion across 329 files
- Reinstate _normalize_timestamp_value in sql_generator.py
- Fix MarkerLogger→logger migration in events.py (molecular CoT markers)
- Fix dataset_review orchestrator dependencies (_build_execution_snapshot)
- Fix config_manager stale-record deletion (moved to save path only)
- Add 77 missing [/DEF:] closers in 5 unbalanced test files
- Update assistant_chat.integration.test.js for #region format
- Apply molecular-cot-logging markers (REASON/REFLECT/EXPLORE) via logger.* methods
This commit is contained in:
2026-05-12 23:54:55 +03:00
parent fe8978f716
commit 306c5ae742
331 changed files with 9630 additions and 10312 deletions

View File

@@ -1,3 +1,7 @@
// #region ReportsApiTest [C:3] [TYPE Module] [SEMANTICS test,reports,api]
// @BRIEF Unit tests for reports API client functions: query string building, error normalization, and fetch wrappers.
// @RELATION DEPENDS_ON -> [ReportsApi]
// [DEF:ReportsApiTest:Module]
// @COMPLEXITY: 3
// @SEMANTICS: tests, reports, api-client, query-string, error-normalization
@@ -211,3 +215,4 @@ describe('getReportDetail', () => {
// [/DEF:TestGetReportsAsync:Class]
// [/DEF:ReportsApiTest:Module]
// #endregion ReportsApiTest

View File

@@ -1,3 +1,7 @@
// #region PermissionsTest [C:3] [TYPE Module] [SEMANTICS test,auth,permissions,rbac]
// @BRIEF Verifies frontend RBAC permission parsing and access checks.
// @RELATION DEPENDS_ON -> [Permissions]
// [DEF:PermissionsTest:Module]
// @COMPLEXITY: 3
// @SEMANTICS: tests, auth, permissions, rbac
@@ -101,3 +105,4 @@ describe("auth.permissions", () => {
});
// [/DEF:PermissionsTest:Module]
// #endregion PermissionsTest

View File

@@ -47,14 +47,14 @@ describe('AssistantChatPanel integration contract', () => {
it('contains semantic anchors and UX contract tags', () => {
const source = fs.readFileSync(COMPONENT_PATH, 'utf-8');
expect(source).toContain('<!-- [DEF' + ':AssistantChatPanel:Component] -->');
expect(source).toContain('<!-- #region AssistantChatPanel');
expect(source).toContain('@COMPLEXITY: 5');
expect(source).toContain('@UX_STATE: LoadingHistory');
expect(source).toContain('@UX_STATE: Sending');
expect(source).toContain('@UX_STATE: Error');
expect(source).toContain('@UX_FEEDBACK: Started operation surfaces task_id');
expect(source).toContain('@UX_RECOVERY: User can retry command');
expect(source).toContain('<!-- [/DEF' + ':AssistantChatPanel:Component] -->');
expect(source).toContain('<!-- #endregion AssistantChatPanel -->');
});
it('keeps confirmation/task-tracking action hooks in place', () => {

View File

@@ -1,3 +1,5 @@
// #region MockEnvPublic [C:1] [TYPE Module] [SEMANTICS mock,env]
// [DEF:mock_env_public:Module]
// @RELATION: DEPENDS_ON -> [$env/static/public]
// @COMPLEXITY: 3
@@ -5,3 +7,4 @@
// @LAYER: UI (Tests)
export const PUBLIC_WS_URL = 'ws://localhost:8000';
// [/DEF:mock_env_public:Module]
// #endregion MockEnvPublic

View File

@@ -1,3 +1,6 @@
// #region EnvironmentMock [C:2] [TYPE Module] [SEMANTICS mock,environment]
// @BRIEF Mock for $app/environment in vitest, supplying browser, dev, and building flags.
// [DEF:EnvironmentMock:Module]
// @COMPLEXITY: 2
// @PURPOSE: Mock for $app/environment in tests
@@ -9,3 +12,4 @@ export const dev = true;
export const building = false;
// [/DEF:EnvironmentMock:Module]
// #endregion EnvironmentMock

View File

@@ -1,3 +1,6 @@
// #region NavigationMock [C:2] [TYPE Module] [SEMANTICS mock,navigation]
// @BRIEF Mock for $app/navigation in vitest, supplying goto, push, replace, prefetch, and prefetchRoutes stubs.
// [DEF:NavigationMock:Module]
// @COMPLEXITY: 1
// @SEMANTICS: mock, navigation, sveltekit-v1-legacy-surface
@@ -13,3 +16,4 @@ export const prefetch = () => Promise.resolve();
export const prefetchRoutes = () => Promise.resolve();
// [/DEF:NavigationMock:Module]
// #endregion NavigationMock

View File

@@ -1,3 +1,6 @@
// #region StateMock [C:2] [TYPE Module] [SEMANTICS mock,state]
// @BRIEF Mock for $app/state page data in vitest route/component tests, supplying default params, route, URL, status, and data.
// [DEF:state_mock:Module]
// @COMPLEXITY: 2
// @PURPOSE: Mock for AppState in vitest route/component tests.
@@ -13,4 +16,5 @@ export const page = {
form: null,
};
// [/DEF:state_mock:Module]
// [/DEF:state_mock:Module]
// #endregion StateMock

View File

@@ -1,3 +1,7 @@
// #region SidebarTest [C:3] [TYPE Module] [SEMANTICS test,sidebar,store,mobile,navigation]
// @BRIEF Unit tests for sidebar store validating expansion toggles, active item selection, and mobile open/close transitions.
// @RELATION DEPENDS_ON -> [sidebar]
// [DEF:SidebarTest:Module]
// @COMPLEXITY: 3
// @SEMANTICS: sidebar, store, tests, mobile, navigation
@@ -132,3 +136,4 @@ describe('SidebarStore', () => {
});
// [/DEF:SidebarTest:Module]
// #endregion SidebarTest

View File

@@ -1,3 +1,7 @@
// #region TaskDrawerTests [C:3] [TYPE Module] [SEMANTICS test,store,task-drawer]
// @BRIEF Unit tests for task drawer store validating open/close, preference-aware opening, resource task mapping, and status-driven cleanup.
// @RELATION DEPENDS_ON -> [taskDrawer]
import { describe, it, expect, beforeEach, vi } from 'vitest';
import { get } from 'svelte/store';
import {
@@ -74,3 +78,4 @@ describe('taskDrawerStore', () => {
expect(state.resourceTaskMap['dash-1']).toBeUndefined();
});
});
// #endregion TaskDrawerTests

View File

@@ -1,3 +1,7 @@
// #region GitServiceContractTests [C:3] [TYPE Module] [SEMANTICS test,git-service,api]
// @BRIEF API client tests ensuring correct endpoints are called per contract for Git service operations.
// @RELATION DEPENDS_ON -> [GitServiceClient]
// [DEF:gitServiceContractTests:Module]
// @COMPLEXITY: 3
// @SEMANTICS: git-service, api-client, contract-tests
@@ -246,3 +250,4 @@ describe('gitService', () => {
});
});
// [/DEF:gitServiceContractTests:Module]
// #endregion GitServiceContractTests