Вроде работает
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Tasks: LLM Analysis & Documentation Plugins
|
||||
|
||||
**Feature**: `017-llm-analysis-plugin`
|
||||
**Status**: Pending
|
||||
**Status**: Completed
|
||||
**Spec**: [specs/017-llm-analysis-plugin/spec.md](spec.md)
|
||||
|
||||
## Dependencies
|
||||
@@ -17,80 +17,81 @@
|
||||
|
||||
**Goal**: Initialize project structure and dependencies.
|
||||
|
||||
- [ ] T001 Install backend dependencies (openai, playwright, tenacity) in `backend/requirements.txt`
|
||||
- [ ] T002 Create plugin directory structure `backend/src/plugins/llm_analysis/`
|
||||
- [ ] T003 Initialize `backend/src/plugins/llm_analysis/__init__.py`
|
||||
- [ ] T004 Create `backend/src/plugins/llm_analysis/models.py` for Pydantic models (LLMProviderConfig, ValidationResult)
|
||||
- [ ] T005 Update `backend/src/core/plugin_loader.py` to recognize new plugin type if necessary
|
||||
- [ ] T006 Create `backend/src/api/routes/llm.py` placeholder
|
||||
- [ ] T007 Register new route in `backend/src/app.py`
|
||||
- [x] T001 Install backend dependencies (openai, playwright, tenacity) in `backend/requirements.txt`
|
||||
- [x] T002 Create plugin directory structure `backend/src/plugins/llm_analysis/`
|
||||
- [x] T003 Initialize `backend/src/plugins/llm_analysis/__init__.py`
|
||||
- [x] T004 Create `backend/src/plugins/llm_analysis/models.py` for Pydantic models (LLMProviderConfig, ValidationResult)
|
||||
- [x] T005 Update `backend/src/core/plugin_loader.py` to recognize new plugin type if necessary
|
||||
- [x] T006 Create `backend/src/api/routes/llm.py` placeholder
|
||||
- [x] T007 Register new route in `backend/src/app.py`
|
||||
|
||||
## Phase 2: Foundational
|
||||
|
||||
**Goal**: Implement core services and shared infrastructure.
|
||||
|
||||
- [ ] T008 Implement `LLMProviderService` in `backend/src/services/llm_provider.py` (CRUD for providers, AES-256 encryption)
|
||||
- [ ] T009 Implement `ScreenshotService` in `backend/src/plugins/llm_analysis/service.py` (Playwright + API strategies, fallback logic)
|
||||
- [ ] T010 Implement `LLMClient` in `backend/src/plugins/llm_analysis/service.py` (OpenAI SDK wrapper, retry logic with tenacity, rate limit handling)
|
||||
- [ ] T011 Create `backend/src/plugins/llm_analysis/plugin.py` with `PluginBase` implementation stubs
|
||||
- [ ] T012 Define database schema updates for `LLMProviderConfig` in `backend/src/models/llm.py` (or appropriate location)
|
||||
- [ ] T013 Run migration to create new tables (if using SQLAlchemy/Alembic) or update SQLite schema
|
||||
- [x] T008 Implement `LLMProviderService` in `backend/src/services/llm_provider.py` (CRUD for providers, AES-256 encryption)
|
||||
- [x] T009 Implement `ScreenshotService` in `backend/src/plugins/llm_analysis/service.py` (Playwright + API strategies, fallback logic, min 1280x720px resolution)
|
||||
- [x] T010 Implement `LLMClient` in `backend/src/plugins/llm_analysis/service.py` (OpenAI SDK wrapper, retry logic with tenacity, rate limit handling)
|
||||
- [x] T011 Create `backend/src/plugins/llm_analysis/plugin.py` with `PluginBase` implementation stubs
|
||||
- [x] T012 Define database schema updates for `LLMProviderConfig` in `backend/src/models/llm.py` (or appropriate location)
|
||||
- [x] T013 Run migration to create new tables (if using SQLAlchemy/Alembic) or update SQLite schema
|
||||
|
||||
## Phase 3: Dashboard Health Analysis (US1)
|
||||
|
||||
**Goal**: Enable automated dashboard validation with multimodal analysis.
|
||||
|
||||
- [ ] T014 [US1] Implement `validate_dashboard` task logic in `backend/src/plugins/llm_analysis/plugin.py`
|
||||
- [ ] T015 [US1] Implement log retrieval logic (fetch recent logs) in `backend/src/plugins/llm_analysis/plugin.py`
|
||||
- [ ] T016 [US1] Construct multimodal prompt (image + text) in `backend/src/plugins/llm_analysis/service.py` (ensure data privacy/masking)
|
||||
- [ ] T017 [US1] Implement result parsing and persistence (ValidationResult) in `backend/src/plugins/llm_analysis/plugin.py`
|
||||
- [ ] T018 [US1] Add `validate` endpoint trigger in `backend/src/api/routes/tasks.py` (or reuse existing dispatch)
|
||||
- [ ] T019 [US1] Implement notification dispatch (Email/Pulse) on failure in `backend/src/plugins/llm_analysis/plugin.py` (Summary + Link format)
|
||||
- [ ] T020 [US1] Create `frontend/src/components/llm/ValidationReport.svelte` for viewing results
|
||||
- [ ] T021 [US1] Add "Validate" button to `frontend/src/components/DashboardGrid.svelte` (or Environments list)
|
||||
- [ ] T022 [US1] Enable scheduling for validation tasks in `backend/src/core/scheduler.py` (if not automatic via TaskManager)
|
||||
- [x] T014 [US1] Implement `validate_dashboard` task logic in `backend/src/plugins/llm_analysis/plugin.py`
|
||||
- [x] T015 [US1] Implement log retrieval logic (fetch recent logs, limit 100 lines/24h) in `backend/src/plugins/llm_analysis/plugin.py`
|
||||
- [x] T016 [US1] Construct multimodal prompt (image + text) in `backend/src/plugins/llm_analysis/service.py` (implement PII/credential filtering)
|
||||
- [x] T017 [US1] Implement result parsing and persistence (ValidationResult) in `backend/src/plugins/llm_analysis/plugin.py` (ensure JSON structure: status, issues, summary)
|
||||
- [x] T018 [US1] Add `validate` endpoint trigger in `backend/src/api/routes/tasks.py` (or reuse existing dispatch)
|
||||
- [x] T019 [US1] Implement notification dispatch (Email/Pulse) on failure in `backend/src/plugins/llm_analysis/plugin.py` (Summary + Link format)
|
||||
- [x] T020 [US1] Create `frontend/src/components/llm/ValidationReport.svelte` for viewing results
|
||||
- [x] T021 [US1] Add "Validate" button with loading state and disabling logic to `frontend/src/components/DashboardGrid.svelte` (FR-019)
|
||||
- [x] T022 [US1] Enable scheduling for validation tasks in `backend/src/core/scheduler.py` (if not automatic via TaskManager)
|
||||
|
||||
## Phase 4: Automated Dataset Documentation (US2)
|
||||
|
||||
**Goal**: Generate and persist dataset documentation.
|
||||
|
||||
- [ ] T023 [US2] Implement `generate_documentation` task logic in `backend/src/plugins/llm_analysis/plugin.py`
|
||||
- [ ] T024 [US2] Implement metadata fetching (schema, columns) in `backend/src/plugins/llm_analysis/plugin.py`
|
||||
- [ ] T025 [US2] Construct documentation prompt in `backend/src/plugins/llm_analysis/service.py` (handle schema changes)
|
||||
- [ ] T026 [US2] Implement metadata update logic (write back to DB) in `backend/src/services/mapping_service.py` (handle partial failures)
|
||||
- [ ] T027 [US2] Add "Generate Docs" button to `frontend/src/components/tools/MapperTool.svelte` (or Dataset view)
|
||||
- [ ] T028 [US2] Create feedback/preview UI component `frontend/src/components/llm/DocPreview.svelte` (optional but recommended)
|
||||
- [x] T023 [US2] Implement `generate_documentation` task logic in `backend/src/plugins/llm_analysis/plugin.py`
|
||||
- [x] T024 [US2] Implement metadata fetching (schema, columns) in `backend/src/plugins/llm_analysis/plugin.py`
|
||||
- [x] T025 [US2] Construct documentation prompt in `backend/src/plugins/llm_analysis/service.py` (handle schema changes)
|
||||
- [x] T026 [US2] Implement metadata update logic (write back to DB) in `backend/src/services/mapping_service.py` (handle partial failures with rollback, ignore invalid columns)
|
||||
- [x] T045 [US2] Implement optimistic locking for concurrent metadata updates
|
||||
- [x] T027 [US2] Add "Generate Docs" button to `frontend/src/components/tools/MapperTool.svelte` using standard system icons (FR-021)
|
||||
- [x] T028 [US2] Create feedback/preview UI component `frontend/src/components/llm/DocPreview.svelte` (optional but recommended)
|
||||
|
||||
## Phase 5: LLM Provider Configuration (US3)
|
||||
|
||||
**Goal**: Manage LLM providers via UI.
|
||||
|
||||
- [ ] T029 [US3] Implement CRUD endpoints for providers in `backend/src/api/routes/llm.py`
|
||||
- [ ] T030 [US3] Create `frontend/src/components/llm/ProviderConfig.svelte` form
|
||||
- [ ] T031 [US3] Create `frontend/src/routes/admin/settings/llm/+page.svelte` settings page
|
||||
- [ ] T032 [US3] Implement "Test Connection" button logic in frontend/backend
|
||||
- [ ] T033 [US3] Ensure API keys are masked in frontend responses
|
||||
- [x] T029 [US3] Implement CRUD endpoints for providers in `backend/src/api/routes/llm.py`
|
||||
- [x] T030 [US3] Create `frontend/src/components/llm/ProviderConfig.svelte` form
|
||||
- [x] T031 [US3] Create `frontend/src/routes/admin/settings/llm/+page.svelte` settings page
|
||||
- [x] T032 [US3] Implement "Test Connection" button logic with Toast feedback (FR-020)
|
||||
- [x] T033 [US3] Ensure API keys are masked in frontend responses
|
||||
|
||||
## Phase 6: Git Commit Message Suggestion (US4)
|
||||
|
||||
**Goal**: AI-assisted commit messages.
|
||||
|
||||
- [ ] T034 [US4] Implement `generate_commit_message` logic in `backend/src/plugins/git_plugin.py` (or `llm_analysis` if preferred, but Git context lives in Git plugin)
|
||||
- [ ] T035 [US4] Create endpoint `POST /api/git/generate-message` in `backend/src/api/routes/git.py`
|
||||
- [ ] T036 [US4] Construct commit generation prompt (Diff + History) in `backend/src/services/git_service.py`
|
||||
- [ ] T037 [US4] Add "Generate" button to `frontend/src/components/git/CommitModal.svelte`
|
||||
- [ ] T038 [US4] Wire up frontend to call generation endpoint and populate textarea
|
||||
- [x] T034 [US4] Implement `generate_commit_message` logic in `backend/src/plugins/git/llm_extension.py` (validate conventional commit format)
|
||||
- [x] T035 [US4] Create endpoint `POST /api/git/generate-message` in `backend/src/api/routes/git.py`
|
||||
- [x] T036 [US4] Construct commit generation prompt (Diff + History) in `backend/src/plugins/git/llm_extension.py`
|
||||
- [x] T037 [US4] Add "Generate" button to `frontend/src/components/git/CommitModal.svelte`
|
||||
- [x] T038 [US4] Wire up frontend to call generation endpoint and populate textarea (handle empty/invalid response with Toast)
|
||||
|
||||
## Phase 7: Polish & Cross-Cutting
|
||||
|
||||
**Goal**: Finalize and verify.
|
||||
|
||||
- [ ] T039 Verify all permissions (`plugin:llm:validate`, etc.) are registered and enforceable
|
||||
- [ ] T040 Verify i18n strings for all new UI components
|
||||
- [ ] T041 Run full end-to-end test of Dashboard Validation flow (including fallback scenarios)
|
||||
- [ ] T042 Run full end-to-end test of Documentation flow
|
||||
- [ ] T043 Update `README.md` with new plugin capabilities
|
||||
- [ ] T044 Verify API key masking in all UI responses and logs
|
||||
- [x] T039 Verify all permissions (`plugin:llm:validate`, etc.) are registered and enforceable
|
||||
- [x] T040 Verify i18n strings for all new UI components
|
||||
- [x] T041 Run full end-to-end test of Dashboard Validation flow (including fallback scenarios)
|
||||
- [x] T042 Run full end-to-end test of Documentation flow
|
||||
- [x] T043 Update `README.md` with new plugin capabilities
|
||||
- [x] T044 Verify API key masking in all UI responses and logs
|
||||
|
||||
## Implementation Strategy
|
||||
|
||||
|
||||
Reference in New Issue
Block a user