feat(refactor): Finalize AI service migration and cleanup obsolete files
This commit completes the major refactoring initiative (Task 61) to migrate all AI-interacting task management functions to the unified service layer (`ai-services-unified.js`) and standardized configuration (`config-manager.js`).
Key Changes:
1. **Refactor `update-task-by-id` & `update-subtask-by-id`:**
* Replaced direct AI client logic and config fetching with calls to `generateTextService`.
* Preserved original prompt logic while ensuring JSON output format is requested.
* Implemented robust manual JSON parsing and Zod validation for text-based AI responses.
* Corrected logger implementation (`logFn`/`isMCP`/`report` pattern) for both CLI and MCP contexts.
* Ensured correct passing of `session` context to the unified service.
* Refactored associated direct function wrappers (`updateTaskByIdDirect`, `updateSubtaskByIdDirect`) to remove AI client initialization and call core logic appropriately.
2. **CLI Environment Loading:**
* Added `dotenv.config()` to `scripts/dev.js` to ensure consistent loading of the `.env` file for CLI operations.
3. **Obsolete Code Removal:**
* Deleted unused helper files:
* `scripts/modules/task-manager/get-subtasks-from-ai.js`
* `scripts/modules/task-manager/generate-subtask-prompt.js`
* `scripts/modules/ai-services.js`
* `scripts/modules/ai-client-factory.js`
* `mcp-server/src/core/utils/ai-client-utils.js`
* Removed corresponding imports/exports from `scripts/modules/task-manager.js` and `mcp-server/src/core/task-master-core.js`.
4. **Verification:**
* Successfully tested `update-task` and `update-subtask` via both CLI and MCP after refactoring.
5. **Task Management:**
* Marked subtasks 61.38, 61.39, 61.40, 61.41, and 61.33 as 'done'.
* Includes other task content/status updates as reflected in the diff.
This completes the migration of core AI features to the new architecture, enhancing maintainability and flexibility.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Task ID: 56
|
||||
# Title: Refactor Task-Master Files into Node Module Structure
|
||||
# Status: pending
|
||||
# Status: done
|
||||
# Dependencies: None
|
||||
# Priority: medium
|
||||
# Description: Restructure the task-master files by moving them from the project root into a proper node module structure to improve organization and maintainability.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Task ID: 58
|
||||
# Title: Implement Elegant Package Update Mechanism for Task-Master
|
||||
# Status: pending
|
||||
# Status: done
|
||||
# Dependencies: None
|
||||
# Priority: medium
|
||||
# Description: Create a robust update mechanism that handles package updates gracefully, ensuring all necessary files are updated when the global package is upgraded.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Task ID: 59
|
||||
# Title: Remove Manual Package.json Modifications and Implement Automatic Dependency Management
|
||||
# Status: pending
|
||||
# Status: done
|
||||
# Dependencies: None
|
||||
# Priority: medium
|
||||
# Description: Eliminate code that manually modifies users' package.json files and implement proper npm dependency management that automatically handles package requirements when users install task-master-ai.
|
||||
@@ -30,37 +30,37 @@ This change will make the package more reliable, follow npm best practices, and
|
||||
9. Create an integration test that simulates a real user workflow from installation through usage
|
||||
|
||||
# Subtasks:
|
||||
## 1. Conduct Code Audit for Dependency Management [pending]
|
||||
## 1. Conduct Code Audit for Dependency Management [done]
|
||||
### Dependencies: None
|
||||
### Description: Review the current codebase to identify all areas where dependencies are manually managed, modified, or referenced outside of npm best practices.
|
||||
### Details:
|
||||
Focus on scripts, configuration files, and any custom logic related to dependency installation or versioning.
|
||||
|
||||
## 2. Remove Manual Dependency Modifications [pending]
|
||||
## 2. Remove Manual Dependency Modifications [done]
|
||||
### Dependencies: 59.1
|
||||
### Description: Eliminate any custom scripts or manual steps that alter dependencies outside of npm's standard workflow.
|
||||
### Details:
|
||||
Refactor or delete code that manually installs, updates, or modifies dependencies, ensuring all dependency management is handled via npm.
|
||||
|
||||
## 3. Update npm Dependencies [pending]
|
||||
## 3. Update npm Dependencies [done]
|
||||
### Dependencies: 59.2
|
||||
### Description: Update all project dependencies using npm, ensuring versions are current and compatible, and resolve any conflicts.
|
||||
### Details:
|
||||
Run npm update, audit for vulnerabilities, and adjust package.json and package-lock.json as needed.
|
||||
|
||||
## 4. Update Initialization and Installation Commands [pending]
|
||||
## 4. Update Initialization and Installation Commands [done]
|
||||
### Dependencies: 59.3
|
||||
### Description: Revise project setup scripts and documentation to reflect the new npm-based dependency management approach.
|
||||
### Details:
|
||||
Ensure that all initialization commands (e.g., npm install) are up-to-date and remove references to deprecated manual steps.
|
||||
|
||||
## 5. Update Documentation [pending]
|
||||
## 5. Update Documentation [done]
|
||||
### Dependencies: 59.4
|
||||
### Description: Revise project documentation to describe the new dependency management process and provide clear setup instructions.
|
||||
### Details:
|
||||
Update README, onboarding guides, and any developer documentation to align with npm best practices.
|
||||
|
||||
## 6. Perform Regression Testing [pending]
|
||||
## 6. Perform Regression Testing [done]
|
||||
### Dependencies: 59.5
|
||||
### Description: Run comprehensive tests to ensure that the refactor has not introduced any regressions or broken existing functionality.
|
||||
### Details:
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# Status: pending
|
||||
# Dependencies: None
|
||||
# Priority: medium
|
||||
# Description: Implement full support for installing and managing Taskmaster using Yarn package manager, ensuring users have the exact same experience as with npm or pnpm. The installation process, including any CLI prompts or web interfaces, must serve the exact same content and user experience regardless of whether npm, pnpm, or Yarn is used. The project uses 'module' as the package type, defines binaries 'task-master' and 'task-master-mcp', and its core logic resides in 'scripts/modules/'. The 'init' command (via scripts/init.js) creates the directory structure (.cursor/rules, scripts, tasks), copies templates (.env.example, .gitignore, rule files, dev.js), manages package.json merging, and sets up MCP config (.cursor/mcp.json). All dependencies are standard npm dependencies listed in package.json, and manual modifications are being removed.
|
||||
# Description: Implement full support for installing and managing Taskmaster using Yarn package manager, ensuring users have the exact same experience as with npm or pnpm. The installation process, including any CLI prompts or web interfaces, must serve the exact same content and user experience regardless of whether npm, pnpm, or Yarn is used. The project uses 'module' as the package type, defines binaries 'task-master' and 'task-master-mcp', and its core logic resides in 'scripts/modules/'. The 'init' command (via scripts/init.js) creates the directory structure (.cursor/rules, scripts, tasks), copies templates (.env.example, .gitignore, rule files, dev.js), manages package.json merging, and sets up MCP config (.cursor/mcp.json). All dependencies are standard npm dependencies listed in package.json, and manual modifications are being removed.
|
||||
|
||||
If the installation process includes a website component (such as for account setup or registration), ensure that any required website actions (e.g., creating an account, logging in, or configuring user settings) are clearly documented and tested for parity between Yarn and other package managers. If no website or account setup is required, confirm and document this explicitly.
|
||||
# Details:
|
||||
This task involves adding comprehensive Yarn support to the Taskmaster package to ensure it can be properly installed and managed using Yarn. Implementation should include:
|
||||
|
||||
@@ -24,6 +26,7 @@ This task involves adding comprehensive Yarn support to the Taskmaster package t
|
||||
11. Ensure proper lockfile generation and management
|
||||
12. Update any package manager detection logic in the codebase to recognize Yarn installations
|
||||
13. Verify that core logic in `scripts/modules/` works correctly when installed via Yarn
|
||||
14. If the installation process includes a website component, verify that any account setup or user registration flows work identically with Yarn as they do with npm or pnpm. If website actions are required, document the steps and ensure they are tested for parity. If not, confirm and document that no website or account setup is needed.
|
||||
|
||||
The implementation should maintain feature parity and identical user experience regardless of which package manager (npm, pnpm, or Yarn) is used to install Taskmaster.
|
||||
|
||||
@@ -64,6 +67,10 @@ Testing should verify complete Yarn support through the following steps:
|
||||
- Test package.json merging functionality
|
||||
- Verify MCP config setup
|
||||
|
||||
8. Website/Account Setup Testing:
|
||||
- If the installation process includes a website component, test the complete user flow including account setup, registration, or configuration steps. Ensure these work identically with Yarn as with npm. If no website or account setup is required, confirm and document this in the test results.
|
||||
- Document any website-specific steps that users need to complete during installation.
|
||||
|
||||
All tests should pass with the same results as when using npm, with identical user experience throughout the installation and usage process.
|
||||
|
||||
# Subtasks:
|
||||
@@ -87,9 +94,9 @@ Test all lifecycle scripts, post-install actions, and CLI commands using Yarn. A
|
||||
|
||||
## 4. Update Documentation for Yarn Installation and Usage [pending]
|
||||
### Dependencies: 64.3
|
||||
### Description: Revise installation and usage documentation to include clear instructions for installing and managing Taskmaster with Yarn. Clearly state that the installation process, including any website or UI shown, is identical to npm. Ensure documentation reflects the use of 'module' package type, binaries, and the init process as defined in scripts/init.js.
|
||||
### Description: Revise installation and usage documentation to include clear instructions for installing and managing Taskmaster with Yarn. Clearly state that the installation process, including any website or UI shown, is identical to npm. Ensure documentation reflects the use of 'module' package type, binaries, and the init process as defined in scripts/init.js. If the installation process includes a website component or requires account setup, document the steps users must follow. If not, explicitly state that no website or account setup is required.
|
||||
### Details:
|
||||
Add Yarn-specific installation commands, troubleshooting tips, and notes on version compatibility to the README and any relevant docs. Document that any installation website or prompt is the same as with npm. Include notes on the 'module' package type, binaries, and the directory/template setup performed by scripts/init.js.
|
||||
Add Yarn-specific installation commands, troubleshooting tips, and notes on version compatibility to the README and any relevant docs. Document that any installation website or prompt is the same as with npm. Include notes on the 'module' package type, binaries, and the directory/template setup performed by scripts/init.js. If website or account setup is required during installation, provide clear instructions; otherwise, confirm and document that no such steps are needed.
|
||||
|
||||
## 5. Implement and Test Package Manager Detection Logic [pending]
|
||||
### Dependencies: 64.4
|
||||
@@ -99,9 +106,9 @@ Modify detection logic to recognize Yarn (classic and berry), handle lockfile ge
|
||||
|
||||
## 6. Verify Installation UI/Website Consistency [pending]
|
||||
### Dependencies: 64.3
|
||||
### Description: Ensure any installation UIs, websites, or interactive prompts—including any website or prompt shown during install—appear and function identically when installing with Yarn compared to npm. Confirm that the experience is consistent for the 'module' package type and the init process.
|
||||
### Description: Ensure any installation UIs, websites, or interactive prompts—including any website or prompt shown during install—appear and function identically when installing with Yarn compared to npm. Confirm that the experience is consistent for the 'module' package type and the init process. If the installation process includes a website or account setup, verify that all required website actions (e.g., account creation, login) are consistent and documented. If not, confirm and document that no website or account setup is needed.
|
||||
### Details:
|
||||
Identify all user-facing elements during the installation process, including any website or prompt shown during install, and verify they are consistent across package managers. If a website is shown during installation, ensure it appears the same regardless of package manager used. Validate that any prompts or UIs triggered by scripts/init.js are identical.
|
||||
Identify all user-facing elements during the installation process, including any website or prompt shown during install, and verify they are consistent across package managers. If a website is shown during installation or account setup is required, ensure it appears and functions the same regardless of package manager used, and document the steps. If not, confirm and document that no website or account setup is needed. Validate that any prompts or UIs triggered by scripts/init.js are identical.
|
||||
|
||||
## 7. Test init.js Script with Yarn [pending]
|
||||
### Dependencies: 64.3
|
||||
@@ -115,3 +122,81 @@ Test the init command to ensure it properly creates .cursor/rules, scripts, and
|
||||
### Details:
|
||||
Check that the binaries defined in package.json are correctly linked in node_modules/.bin when installed with Yarn, and that they can be executed without errors. Validate that binaries work for ESM ('module') projects and are accessible after both global and local installs.
|
||||
|
||||
## 9. Test Website Account Setup with Yarn [pending]
|
||||
### Dependencies: 64.6
|
||||
### Description: If the installation process includes a website component, verify that account setup, registration, or any other user-specific configurations work correctly when Taskmaster is installed via Yarn. If no website or account setup is required, confirm and document this explicitly.
|
||||
### Details:
|
||||
Test the complete user flow for any website component that appears during installation, including account creation, login, and configuration steps. Ensure that all website interactions work identically with Yarn as they do with npm or pnpm. Document any website-specific steps that users need to complete during the installation process. If no website or account setup is required, confirm and document this.
|
||||
|
||||
<info added on 2025-04-25T08:45:48.709Z>
|
||||
Since the request is vague, I'll provide helpful implementation details for testing website account setup with Yarn:
|
||||
|
||||
For thorough testing, create a test matrix covering different browsers (Chrome, Firefox, Safari) and operating systems (Windows, macOS, Linux). Document specific Yarn-related environment variables that might affect website connectivity. Use tools like Playwright or Cypress to automate the account setup flow testing, capturing screenshots at each step for documentation. Implement network throttling tests to verify behavior under poor connectivity. Create a checklist of all UI elements that should be verified during the account setup process, including form validation, error messages, and success states. If no website component exists, explicitly document this in the project README and installation guides to prevent user confusion.
|
||||
</info added on 2025-04-25T08:45:48.709Z>
|
||||
|
||||
<info added on 2025-04-25T08:46:08.651Z>
|
||||
- For environments where the website component requires integration with external authentication providers (such as OAuth, SSO, or LDAP), ensure that these flows are tested specifically when Taskmaster is installed via Yarn. Validate that redirect URIs, token exchanges, and session persistence behave as expected across all supported browsers.
|
||||
|
||||
- If the website setup involves configuring application pools or web server settings (e.g., with IIS), document any Yarn-specific considerations, such as environment variable propagation or file permission differences, that could affect the web service's availability or configuration[2].
|
||||
|
||||
- When automating tests, include validation for accessibility compliance (e.g., using axe-core or Lighthouse) during the account setup process to ensure the UI is usable for all users.
|
||||
|
||||
- Capture and log all HTTP requests and responses during the account setup flow to help diagnose any discrepancies between Yarn and other package managers. This can be achieved by enabling network logging in Playwright or Cypress test runs.
|
||||
|
||||
- If the website component supports batch operations or automated uploads (such as uploading user data or configuration files), verify that these automation features function identically after installation with Yarn[3].
|
||||
|
||||
- For documentation, provide annotated screenshots or screen recordings of the account setup process, highlighting any Yarn-specific prompts, warnings, or differences encountered.
|
||||
|
||||
- If the website component is not required, add a badge or prominent note in the README and installation guides stating "No website or account setup required," and reference the test results confirming this.
|
||||
</info added on 2025-04-25T08:46:08.651Z>
|
||||
|
||||
<info added on 2025-04-25T17:04:12.550Z>
|
||||
For clarity, this task does not involve setting up a Yarn account. Yarn itself is just a package manager that doesn't require any account creation. The task is about testing whether any website component that is part of Taskmaster (if one exists) works correctly when Taskmaster is installed using Yarn as the package manager.
|
||||
|
||||
To be specific:
|
||||
- You don't need to create a Yarn account
|
||||
- Yarn is simply the tool used to install Taskmaster (`yarn add taskmaster` instead of `npm install taskmaster`)
|
||||
- The testing focuses on whether any web interfaces or account setup processes that are part of Taskmaster itself function correctly when the installation was done via Yarn
|
||||
- If Taskmaster includes a web dashboard or requires users to create accounts within the Taskmaster system, those features should be tested
|
||||
|
||||
If you're uncertain whether Taskmaster includes a website component at all, the first step would be to check the project documentation or perform an initial installation to determine if any web interface exists.
|
||||
</info added on 2025-04-25T17:04:12.550Z>
|
||||
|
||||
<info added on 2025-04-25T17:19:03.256Z>
|
||||
When testing website account setup with Yarn after the codebase refactor, pay special attention to:
|
||||
|
||||
- Verify that any environment-specific configuration files (like `.env` or config JSON files) are properly loaded when the application is installed via Yarn
|
||||
- Test the session management implementation to ensure user sessions persist correctly across page refreshes and browser restarts
|
||||
- Check that any database migrations or schema updates required for account setup execute properly when installed via Yarn
|
||||
- Validate that client-side form validation logic works consistently with server-side validation
|
||||
- Ensure that any WebSocket connections for real-time features initialize correctly after the refactor
|
||||
- Test account deletion and data export functionality to verify GDPR compliance remains intact
|
||||
- Document any changes to the authentication flow that resulted from the refactor and confirm they work identically with Yarn installation
|
||||
</info added on 2025-04-25T17:19:03.256Z>
|
||||
|
||||
<info added on 2025-04-25T17:22:05.951Z>
|
||||
When testing website account setup with Yarn after the logging fix, implement these additional verification steps:
|
||||
|
||||
1. Verify that all account-related actions are properly logged with the correct log levels (debug, info, warn, error) according to the updated logging framework
|
||||
2. Test the error handling paths specifically - force authentication failures and verify the logs contain sufficient diagnostic information
|
||||
3. Check that sensitive user information is properly redacted in logs according to privacy requirements
|
||||
4. Confirm that log rotation and persistence work correctly when high volumes of authentication attempts occur
|
||||
5. Validate that any custom logging middleware correctly captures HTTP request/response data for account operations
|
||||
6. Test that log aggregation tools (if used) can properly parse and display the account setup logs in their expected format
|
||||
7. Verify that performance metrics for account setup flows are correctly captured in logs for monitoring purposes
|
||||
8. Document any Yarn-specific environment variables that affect the logging configuration for the website component
|
||||
</info added on 2025-04-25T17:22:05.951Z>
|
||||
|
||||
<info added on 2025-04-25T17:22:46.293Z>
|
||||
When testing website account setup with Yarn, consider implementing a positive user experience validation:
|
||||
|
||||
1. Measure and document time-to-completion for the account setup process to ensure it meets usability standards
|
||||
2. Create a satisfaction survey for test users to rate the account setup experience on a 1-5 scale
|
||||
3. Implement A/B testing for different account setup flows to identify the most user-friendly approach
|
||||
4. Add delightful micro-interactions or success animations that make the setup process feel rewarding
|
||||
5. Test the "welcome" or "onboarding" experience that follows successful account creation
|
||||
6. Ensure helpful tooltips and contextual help are displayed at appropriate moments during setup
|
||||
7. Verify that error messages are friendly, clear, and provide actionable guidance rather than technical jargon
|
||||
8. Test the account recovery flow to ensure users have a smooth experience if they forget credentials
|
||||
</info added on 2025-04-25T17:22:46.293Z>
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
3602
tasks/tasks.json.bak
3602
tasks/tasks.json.bak
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user