измененные спеки таски

This commit is contained in:
2026-02-10 15:53:38 +03:00
parent edb2dd5263
commit 4a0273a604
5 changed files with 778 additions and 46 deletions

View File

@@ -12,22 +12,49 @@
- **[P]**: Can run in parallel (different files, no dependencies)
- **[Story]**: Which user story this task belongs to (e.g., US1, US2, US3)
- Include exact file paths in descriptions
- **Contract Reference**: Each task links to [contracts/modules.md](./contracts/modules.md) for Design-by-Contract specifications
## Path Conventions
- **Web app**: `backend/src/`, `frontend/src/`
## Contract References
All implementation tasks MUST follow the Design-by-Contract specifications:
| Component | Contract | TIER |
|-----------|----------|------|
| `sidebar.js` | [DEF:SidebarStore:Store](./contracts/modules.md#1-sidebarstore) | STANDARD |
| `taskDrawer.js` | [DEF:TaskDrawerStore:Store](./contracts/modules.md#2-taskdrawerstore) | CRITICAL |
| `activity.js` | [DEF:ActivityStore:Store](./contracts/modules.md#3-activitystore) | STANDARD |
| `Sidebar.svelte` | [DEF:Sidebar:Component](./contracts/modules.md#4-sidebar-component) | CRITICAL |
| `TopNavbar.svelte` | [DEF:TopNavbar:Component](./contracts/modules.md#5-topnavbar-component) | CRITICAL |
| `TaskDrawer.svelte` | [DEF:TaskDrawer:Component](./contracts/modules.md#6-taskdrawer-component) | CRITICAL |
| `Breadcrumbs.svelte` | [DEF:Breadcrumbs:Component](./contracts/modules.md#9-breadcrumbs-component) | STANDARD |
| `DashboardHub` | [DEF:DashboardHub:Component](./contracts/modules.md#7-dashboardhub-component) | CRITICAL |
| `DatasetHub` | [DEF:DatasetHub:Component](./contracts/modules.md#8-datasethub-component) | CRITICAL |
| `dashboards.py` | [DEF:DashboardsAPI:Module](./contracts/modules.md#10-dashboards-api) | CRITICAL |
| `datasets.py` | [DEF:DatasetsAPI:Module](./contracts/modules.md#11-datasets-api) | CRITICAL |
| `resource_service.py` | [DEF:ResourceService:Class](./contracts/modules.md#13-resourceservice) | STANDARD |
---
## Phase 1: Setup (Shared Infrastructure)
**Purpose**: Create new directory structure and stores for layout state
**Contract Requirements**:
- All stores MUST implement `@PRE` and `@POST` conditions from [contracts/modules.md](./contracts/modules.md)
- CRITICAL tier modules (TaskDrawerStore) require full UX state documentation
- [x] T001 Create `frontend/src/lib/components/layout/` directory for shared layout components
- [x] T002 Create `frontend/src/lib/components/hubs/` directory for resource hub pages
- [x] T003 [P] Create `frontend/src/lib/stores/sidebar.js` with persistentStore pattern for sidebar state
- [x] T004 [P] Create `frontend/src/lib/stores/taskDrawer.js` with resourceTaskMap store
- [x] T005 [P] Create `frontend/src/lib/stores/activity.js` as derived store from taskDrawer
- [x] T003 [P] Create `frontend/src/lib/stores/sidebar.js` with persistentStore pattern for sidebar state
_Contract: [DEF:SidebarStore:Store](./contracts/modules.md#1-sidebarstore)_
- [x] T004 [P] Create `frontend/src/lib/stores/taskDrawer.js` with resourceTaskMap store
_Contract: [DEF:TaskDrawerStore:Store](./contracts/modules.md#2-taskdrawerstore) - CRITICAL: Must implement all @UX_STATE transitions_
- [x] T005 [P] Create `frontend/src/lib/stores/activity.js` as derived store from taskDrawer
_Contract: [DEF:ActivityStore:Store](./contracts/modules.md#3-activitystore)_
---
@@ -37,9 +64,16 @@
**⚠️ CRITICAL**: No user story work can begin until this phase is complete
- [x] T006 Create `frontend/src/lib/components/layout/Sidebar.svelte` with categories: DASHBOARDS, DATASETS, STORAGE, ADMIN
- [x] T007 Create `frontend/src/lib/components/layout/TopNavbar.svelte` with Logo, Search placeholder, Activity indicator, User menu
- [x] T008 Create `frontend/src/lib/components/layout/Breadcrumbs.svelte` for page hierarchy navigation
**Contract Requirements**:
- All CRITICAL tier components MUST implement full `@UX_STATE` specifications
- Components MUST follow `@PRE` conditions for props and `@POST` for event handling
- [x] T006 Create `frontend/src/lib/components/layout/Sidebar.svelte` with categories: DASHBOARDS, DATASETS, STORAGE, ADMIN
_Contract: [DEF:Sidebar:Component](./contracts/modules.md#4-sidebar-component) - CRITICAL: Implement all @UX_STATE transitions (Expanded/Collapsed/Mobile)_
- [x] T007 Create `frontend/src/lib/components/layout/TopNavbar.svelte` with Logo, Search placeholder, Activity indicator, User menu
_Contract: [DEF:TopNavbar:Component](./contracts/modules.md#5-topnavbar-component) - CRITICAL: Activity badge must pulse on new tasks_
- [x] T008 Create `frontend/src/lib/components/layout/Breadcrumbs.svelte` for page hierarchy navigation
_Contract: [DEF:Breadcrumbs:Component](./contracts/modules.md#9-breadcrumbs-component) - Handle truncation for >3 levels_
- [x] T009 Update `frontend/src/routes/+layout.svelte` to include Sidebar, TopNavbar, and main content area
- [x] T010 Add i18n keys for navigation labels in `frontend/src/lib/i18n/translations/en.json`
- [x] T011 Add i18n keys for navigation labels in `frontend/src/lib/i18n/translations/ru.json`
@@ -75,12 +109,20 @@
### Implementation for User Story 2
- [x] T018 [US2] Create `frontend/src/lib/components/layout/TaskDrawer.svelte` as slide-out panel from right
**Contract Requirements**:
- TaskDrawer MUST implement all `@UX_STATE` transitions from [DEF:TaskDrawerStore:Store](./contracts/modules.md#2-taskdrawerstore)
- MUST handle `@UX_RECOVERY` for WebSocket disconnections
- [x] T018 [US2] Create `frontend/src/lib/components/layout/TaskDrawer.svelte` as slide-out panel from right
_Contract: [DEF:TaskDrawer:Component](./contracts/modules.md#6-taskdrawer-component) - CRITICAL: Implement Closed → Open-Loading → Open-Streaming → Open-InputRequired states_
- [x] T019 [US2] Integrate existing `TaskLogViewer` component inside Task Drawer
- [x] T020 [US2] Implement Activity indicator badge in TopNavbar showing `activeCount` from store
- [x] T021 [US2] Connect Task Drawer to WebSocket for real-time log streaming
- [x] T022 [US2] Implement interactive area in drawer for `PasswordPrompt` and other inputs
- [x] T023 [US2] Add close button that allows task to continue running in background
- [x] T021 [US2] Connect Task Drawer to WebSocket for real-time log streaming
_Contract: @RELATION: DEPENDS_ON -> WebSocket connection_
- [x] T022 [US2] Implement interactive area in drawer for `PasswordPrompt` and other inputs
_Contract: @UX_STATE: Open-InputRequired_
- [x] T023 [US2] Add close button that allows task to continue running in background
_Contract: @POST: Closing drawer does NOT cancel running task_
- [x] T024 [US2] Implement drawer open trigger from Activity indicator click
- [x] T025 [US2] Verify implementation matches ux_reference.md (Task Drawer mockup)
@@ -114,29 +156,52 @@
### Backend for User Story 3
- [x] T031 [P] [US3] Create `backend/src/api/routes/dashboards.py` with GET /api/dashboards endpoint
- [x] T032 [P] [US3] Create `backend/src/services/resource_service.py` for shared resource fetching logic
**Contract Requirements**:
- All endpoints MUST follow `@PRE` and `@POST` conditions from [DEF:DashboardsAPI:Module](./contracts/modules.md#10-dashboards-api)
- MUST use `ConfigManager` via dependency injection (Constitution Principle II)
- [x] T031 [P] [US3] Create `backend/src/api/routes/dashboards.py` with GET /api/dashboards endpoint
_Contract: [DEF:DashboardsAPI:Module](./contracts/modules.md#10-dashboards-api) - CRITICAL_
- [x] T032 [P] [US3] Create `backend/src/services/resource_service.py` for shared resource fetching logic
_Contract: [DEF:ResourceService:Class](./contracts/modules.md#13-resourceservice)_
- [x] T033 [US3] Implement dashboard list fetching with Git status and last task status
- [ ] T034 [US3] Add pagination support to GET /api/dashboards endpoint (page, page_size parameters)
- [ ] T035 [US3] Implement bulk migration endpoint POST /api/dashboards/migrate with target environment and dashboard IDs
- [ ] T036 [US3] Implement bulk backup endpoint POST /api/dashboards/backup with optional cron schedule
- [ ] T034 [US3] Add pagination support to GET /api/dashboards endpoint (page, page_size parameters)
_Contract: @POST: Response includes pagination metadata_
- [ ] T035 [US3] Implement bulk migration endpoint POST /api/dashboards/migrate with target environment and dashboard IDs
_Contract: @PRE: User has permission plugin:migration:execute_
- [ ] T036 [US3] Implement bulk backup endpoint POST /api/dashboards/backup with optional cron schedule
_Contract: @PRE: User has permission plugin:backup:execute_
- [ ] T037 [US3] Add database mappings retrieval from MappingService for migration modal
### Frontend for User Story 3
- [x] T038 [US3] Create `frontend/src/routes/dashboards/+page.svelte` as Dashboard Hub
**Contract Requirements**:
- MUST implement all `@UX_STATE` transitions from [DEF:DashboardHub:Component](./contracts/modules.md#7-dashboardhub-component)
- MUST preserve selection across pagination (`@INVARIANT: Selected dashboards persist across pagination`)
- [x] T038 [US3] Create `frontend/src/routes/dashboards/+page.svelte` as Dashboard Hub
_Contract: [DEF:DashboardHub:Component](./contracts/modules.md#7-dashboardhub-component) - CRITICAL_
- [x] T039 [US3] Implement environment selector dropdown at top of Dashboard Hub
- [x] T040 [US3] Create dashboard grid with checkboxes, columns: Title, Slug, Git Status, Last Task, Actions
- [ ] T041 [US3] Implement "Select All" and "Select Visible" buttons in toolbar
- [ ] T042 [US3] Add real-time search input that filters dashboard list
- [ ] T043 [US3] Implement pagination controls with page numbers and "Rows per page" dropdown
- [ ] T044 [US3] Create floating bulk action panel at bottom: "[✓ N selected] [Migrate] [Backup]"
- [ ] T045 [US3] Implement Bulk Migration modal with target environment, database mappings, and selected dashboards list
- [x] T040 [US3] Create dashboard grid with checkboxes, columns: Title, Slug, Git Status, Last Task, Actions
_Contract: @UX_STATE: Idle-Grid, @UX_FEEDBACK: Git status color-coded icons_
- [ ] T041 [US3] Implement "Select All" and "Select Visible" buttons in toolbar
_Contract: @UX_STATE: Selecting_
- [ ] T042 [US3] Add real-time search input that filters dashboard list
_Contract: @POST: Search filters results in real-time (debounced 300ms)_
- [ ] T043 [US3] Implement pagination controls with page numbers and "Rows per page" dropdown
_Contract: @INVARIANT: Selection persists across pagination_
- [ ] T044 [US3] Create floating bulk action panel at bottom: "[✓ N selected] [Migrate] [Backup]"
_Contract: @UX_FEEDBACK: Floating panel slides up from bottom_
- [ ] T045 [US3] Implement Bulk Migration modal with target environment, database mappings, and selected dashboards list
_Contract: @UX_STATE: BulkAction-Modal_
- [ ] T046 [US3] Implement Bulk Backup modal with one-time/scheduled options and cron expression
- [x] T047 [US3] Implement individual Actions menu with Migrate, Backup, Git Operations options
- [x] T048 [US3] Connect Actions menu to existing plugin triggers (Migration, Backup, Git)
- [x] T049 [US3] Implement status badge click to open Task Drawer with correct task
- [x] T050 [US3] Add empty state when no environments configured or no dashboards found
- [x] T048 [US3] Connect Actions menu to existing plugin triggers (Migration, Backup, Git)
_Contract: @RELATION: DISPATCHES -> MigrationPlugin, BackupPlugin_
- [x] T049 [US3] Implement status badge click to open Task Drawer with correct task
_Contract: @POST: Clicking status badge opens TaskDrawer with that task_
- [x] T050 [US3] Add empty state when no environments configured or no dashboards found
_Contract: @UX_STATE: Empty-NoEnv, Empty-NoData_
- [ ] T051 [US3] Verify implementation matches ux_reference.md (Dashboard Hub Grid mockup)
**Checkpoint**: Dashboard Hub fully functional with bulk operations
@@ -151,25 +216,46 @@
### Backend for User Story 4
- [x] T052 [P] [US4] Create `backend/src/api/routes/datasets.py` with GET /api/datasets endpoint
- [x] T053 [US4] Implement dataset list fetching with mapped fields count and SQL table extraction
**Contract Requirements**:
- All endpoints MUST follow `@PRE` and `@POST` conditions from [DEF:DatasetsAPI:Module](./contracts/modules.md#11-datasets-api)
- MUST calculate `mapped_fields` as (mapped_columns / total_columns) * 100
- [x] T052 [P] [US4] Create `backend/src/api/routes/datasets.py` with GET /api/datasets endpoint
_Contract: [DEF:DatasetsAPI:Module](./contracts/modules.md#11-datasets-api) - CRITICAL_
- [x] T053 [US4] Implement dataset list fetching with mapped fields count and SQL table extraction
_Contract: @INVARIANT: Mapped % is calculated as (mapped_columns / total_columns) * 100_
- [ ] T054 [US4] Add pagination support to GET /api/datasets endpoint (page, page_size parameters)
- [ ] T055 [US4] Implement bulk column mapping endpoint POST /api/datasets/map-columns with source selection
- [ ] T056 [US4] Implement bulk documentation generation endpoint POST /api/datasets/generate-docs
- [ ] T055 [US4] Implement bulk column mapping endpoint POST /api/datasets/map-columns with source selection
_Contract: @PRE: User has permission plugin:mapper:execute_
- [ ] T056 [US4] Implement bulk documentation generation endpoint POST /api/datasets/generate-docs
_Contract: @PRE: User has permission plugin:llm_analysis:execute_
- [ ] T057 [US4] Add dataset-to-dashboard relationship retrieval for linked dashboards display
### Frontend for User Story 4
- [x] T058 [US4] Create `frontend/src/routes/datasets/+page.svelte` as Dataset Hub
- [x] T059 [US4] Implement dataset grid with checkboxes, columns: Name, Database, Schema, Tables, Columns, Mapped %, Updated By, Actions
- [ ] T060 [US4] Implement "Select All" and "Select Visible" buttons in toolbar
- [ ] T061 [US4] Add real-time search input that filters dataset list by name, schema, or table names
**Contract Requirements**:
- MUST implement all `@UX_STATE` transitions from [DEF:DatasetHub:Component](./contracts/modules.md#8-datasethub-component)
- MUST display Mapped % with progress bar as specified in `@UX_FEEDBACK`
- [x] T058 [US4] Create `frontend/src/routes/datasets/+page.svelte` as Dataset Hub
_Contract: [DEF:DatasetHub:Component](./contracts/modules.md#8-datasethub-component) - CRITICAL_
- [x] T059 [US4] Implement dataset grid with checkboxes, columns: Name, Database, Schema, Tables, Columns, Mapped %, Updated By, Actions
_Contract: @UX_FEEDBACK: Mapped % column shows progress bar + percentage text_
- [ ] T060 [US4] Implement "Select All" and "Select Visible" buttons in toolbar
_Contract: @UX_STATE: Selecting_
- [ ] T061 [US4] Add real-time search input that filters dataset list by name, schema, or table names
_Contract: @POST: Search filters by name, schema, and table names_
- [ ] T062 [US4] Implement pagination controls with page numbers and "Rows per page" dropdown
- [ ] T063 [US4] Create floating bulk action panel at bottom: "[✓ N selected] [Map Columns] [Generate Docs] [Validate]"
- [ ] T064 [US4] Implement Column Mapping modal with PostgreSQL comments/XLSX source selection and preview
- [ ] T065 [US4] Implement Documentation Generation modal with LLM provider selection and options
- [ ] T066 [US4] Create dataset detail view showing SQL tables, column counts, mapping percentages, and linked dashboards
- [x] T067 [US4] Add empty state when no datasets found
- [ ] T063 [US4] Create floating bulk action panel at bottom: "[✓ N selected] [Map Columns] [Generate Docs] [Validate]"
_Contract: @UX_STATE: Selecting, @UX_FEEDBACK: Floating panel slides up_
- [ ] T064 [US4] Implement Column Mapping modal with PostgreSQL comments/XLSX source selection and preview
_Contract: @POST: Map Columns modal shows source selection (PostgreSQL or XLSX)_
- [ ] T065 [US4] Implement Documentation Generation modal with LLM provider selection and options
_Contract: @POST: Generate Docs modal shows LLM provider selection_
- [ ] T066 [US4] Create dataset detail view showing SQL tables, column counts, mapping percentages, and linked dashboards
_Contract: @UX_STATE: Detail-View, @POST: Clicking dataset name opens detail view_
- [x] T067 [US4] Add empty state when no datasets found
_Contract: @UX_STATE: Empty-NoData_
- [ ] T068 [US4] Verify implementation matches ux_reference.md (Dataset Hub Grid mockup)
**Checkpoint**: Dataset Hub fully functional with bulk operations
@@ -204,11 +290,19 @@
**Purpose**: Improvements that affect multiple user stories
- [x] T057 [P] Add breadcrumb navigation to all new pages
- [x] T058 [P] Implement breadcrumb truncation for deep paths (>3 levels)
**Contract Requirements**:
- Breadcrumbs MUST follow [DEF:Breadcrumbs:Component](./contracts/modules.md#9-breadcrumbs-component) specification
- Error handling MUST implement `@UX_RECOVERY` patterns from component contracts
- [x] T057 [P] Add breadcrumb navigation to all new pages
_Contract: [DEF:Breadcrumbs:Component](./contracts/modules.md#9-breadcrumbs-component)_
- [x] T058 [P] Implement breadcrumb truncation for deep paths (>3 levels)
_Contract: @POST: Deep paths (>3 levels) truncate middle segments_
- [x] T059 Remove old card-based dashboard grid if no longer needed
- [x] T060 [P] Add skeleton loaders for resource hub grids
- [x] T061 [P] Add error banners for environment connection failures
- [x] T060 [P] Add skeleton loaders for resource hub grids
_Contract: @UX_STATE: Loading -> Skeleton loaders in grid rows_
- [x] T061 [P] Add error banners for environment connection failures
_Contract: @UX_RECOVERY: Failed environment connection shows error banner with retry_
- [x] T062 Run quickstart.md validation for all user stories
- [x] T063 Final UX review against ux_reference.md