Skip to content

fix: auth refresh issue#1450

Merged
Crunchyman-ralph merged 6 commits intonextfrom
ralph/fix/auth.refresh.token.regression
Nov 26, 2025
Merged

fix: auth refresh issue#1450
Crunchyman-ralph merged 6 commits intonextfrom
ralph/fix/auth.refresh.token.regression

Conversation

@Crunchyman-ralph
Copy link
Collaborator

@Crunchyman-ralph Crunchyman-ralph commented Nov 26, 2025

  • add many integration tests and regression tests

What type of PR is this?

  • 🐛 Bug fix
  • ✨ Feature
  • 🔌 Integration
  • 📝 Docs
  • 🧹 Refactor
  • Other:

Description

Related Issues

How to Test This

# Example commands or steps

Expected result:

Contributor Checklist

  • Created changeset: npm run changeset
  • Tests pass: npm test
  • Format check passes: npm run format-check (or npm run format to fix)
  • Addressed CodeRabbit comments (if any)
  • Linked related issues (if any)
  • Manually tested the changes

Changelog Entry


For Maintainers

  • PR title follows conventional commits
  • Target branch correct
  • Labels added
  • Milestone assigned (if applicable)

Summary by CodeRabbit

  • Refactor

    • Enforced a singleton auth client to prevent concurrent refresh races.
    • Broadened TypeScript project roots to include tests and updated module resolution.
  • New Features

    • Reusable test configuration fixtures and lightweight mock session helpers.
    • API error objects now include URL and request-body details for richer context.
  • Tests

    • Added singleton-focused integration tests and local test helpers.
    • Removed or simplified many legacy unit/integration suites and a complex provider mock; several test imports updated for ESM resolution.

✏️ Tip: You can customize this high-level summary in your review settings.

- add many integration tests and regression tests
@changeset-bot
Copy link

changeset-bot bot commented Nov 26, 2025

⚠️ No Changeset found

Latest commit: 3ece77e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 26, 2025

Walkthrough

Converts SupabaseAuthClient to a singleton, updates callers to use getInstance() and resetInstance(), broadens tsconfigs to include tests and vitest globals, adds testing fixtures/mocks and re-exports, updates tests/imports and APICallError expectations, adds singleton-focused integration tests, and deletes multiple unit/integration test suites. (50 words)

Changes

Cohort / File(s) Summary
Supabase singleton & callers
packages/tm-core/src/modules/integration/clients/supabase-client.ts, packages/tm-core/src/modules/auth/managers/auth-manager.ts, packages/tm-core/src/modules/storage/services/storage-factory.ts
Introduces SupabaseAuthClient singleton (private constructor, getInstance(), resetInstance()); replaces new SupabaseAuthClient() usages with getInstance() and updates reset flow for tests.
Singleton-focused tests (added/updated)
packages/tm-core/src/modules/integration/clients/supabase-client.spec.ts, packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts, packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts, packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
Adds/updates tests exercising singleton enforcement, shared underlying client, concurrency safety, and centralized refresh behavior; tests reset singleton lifecycle in hooks.
TSConfig changes
apps/cli/tsconfig.json, apps/mcp/tsconfig.json, packages/ai-sdk-provider-grok-cli/tsconfig.json, packages/tm-bridge/tsconfig.json, packages/tm-core/tsconfig.json
Set rootDir to ., add "vitest/globals" to types, include tests/**/*, and simplify exclude to ["node_modules","dist"].
Test fixtures & re-exports
packages/tm-core/src/testing/config-fixtures.ts, packages/tm-core/src/testing/index.ts
Adds config fixture factories, ConfigScenarios, and re-exports test helpers; expands testing API surface.
New test utilities / mocks
packages/tm-core/src/testing/auth-mocks.ts, packages/tm-core/src/testing/test-mocks.ts
Adds MockSupabaseSessionStorage (and minimal variant) and createMockLogger test utilities.
APICallError / provider tests
packages/ai-sdk-provider-grok-cli/src/errors.test.ts, packages/ai-sdk-provider-grok-cli/src/grok-cli-provider.test.ts
Tests updated to expect APICallError instances include url and requestBodyValues; removed unused local captures of provider returns.
CLI test import adjustments
apps/cli/src/ui/components/dashboard.component.spec.ts, apps/cli/tests/integration/*.test.ts, apps/cli/tests/integration/task-lifecycle.test.ts
Refactors dashboard test helpers (createTestTask/createTestSubtask), switches helper imports to explicit .js extensions, and normalizes test data to string IDs.
Minor test refactors / typing relaxations
packages/tm-core/src/modules/auth/auth-domain.spec.ts, packages/tm-core/src/modules/auth/services/supabase-session-storage.spec.ts, packages/tm-core/src/modules/config/services/config-merger.service.spec.ts, packages/tm-core/src/modules/workflow/.../test*.ts
Removes unused shared variables/imports, loosens types with as any, reduces imported test types, and renames unused params to _….
Large test deletions — core areas
packages/tm-core/src/common/mappers/TaskMapper.test.ts, packages/tm-core/src/modules/config/services/config-persistence.service.spec.ts, packages/tm-core/src/modules/config/services/environment-config-provider.service.spec.ts, packages/tm-core/src/modules/git/adapters/git-adapter.test.ts, packages/tm-core/src/modules/tasks/entities/task.entity.spec.ts, packages/tm-core/tests/integration/list-tasks.test.ts, packages/tm-core/tests/integration/storage/activity-logger.test.ts
Removes many unit/integration test suites covering mappers, config persistence, env provider, git adapter, task entity validation, list-tasks E2E, and activity logger.
Test deletions — infra/mocks/units
packages/tm-core/tests/auth/auth-refresh.test.ts, packages/tm-core/tests/integration/auth-token-refresh.test.ts, packages/tm-core/tests/mocks/mock-provider.ts, packages/tm-core/tests/unit/base-provider.test.ts, packages/tm-core/tests/unit/executor.test.ts, packages/tm-core/tests/unit/smoke.test.ts, packages/tm-core/src/subpath-exports.test.ts
Removes tests for auth refresh flows, mock provider, base provider unit tests, executor, smoke tests, and subpath export examples/coverage.
Misc test import fixes
apps/cli/tests/integration/generate.command.test.ts, apps/cli/tests/integration/list.command.test.ts, apps/cli/tests/integration/next.command.test.ts, apps/cli/tests/integration/set-status.command.test.ts, apps/cli/tests/integration/show.command.test.ts, apps/cli/tests/integration/task-lifecycle.test.ts
Changes helper imports to include explicit .js extension for ESM resolution.

Sequence Diagram(s)

sequenceDiagram
    participant AuthMgr as AuthManager
    participant StorageFac as StorageFactory
    participant SupabaseS as SupabaseAuthClient\n(singleton)
    participant Underlying as Underlying Supabase Client

    Note over AuthMgr,SupabaseS: Callers obtain shared client via accessor
    AuthMgr->>SupabaseS: getInstance()
    SupabaseS->>SupabaseS: if !instance -> create() (private ctor)
    SupabaseS-->>AuthMgr: instance
    AuthMgr->>Underlying: instance.getClient()

    StorageFac->>SupabaseS: getInstance()
    SupabaseS-->>StorageFac: same instance
    StorageFac->>Underlying: instance.getClient()

    Note over Underlying: refreshSession calls centralized on shared client to avoid race conditions
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

  • Focus areas:
    • SupabaseAuthClient: verify singleton concurrency safety in getInstance()/resetInstance() and private ctor correctness.
    • Call sites: ensure all new SupabaseAuthClient() replacements are complete and tests reset singletons appropriately.
    • APICallError: confirm added optional fields (url, requestBodyValues) are deliberate and compatible with consumers.
    • Large test deletions: validate intentional removal and CI/test-coverage impact.
    • tsconfig changes: check type-checking and CI effects of including tests and vitest globals.

Possibly related PRs

Suggested reviewers

  • eyaltoledano

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'fix: auth refresh issue' relates to auth/token refresh changes throughout the PR, but is vague about the specific problem and solution being implemented. Consider a more descriptive title that explains what 'auth refresh issue' is being fixed, such as 'fix: prevent token refresh race condition with singleton pattern' or similar.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch ralph/fix/auth.refresh.token.regression

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ba883c3 and 3ece77e.

📒 Files selected for processing (1)
  • apps/cli/src/ui/components/dashboard.component.spec.ts (9 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

TypeScript test files must achieve minimum code coverage thresholds: 80% lines/functions and 70% branches globally, 90% for utilities, and 85% for middleware; new features must meet or exceed these thresholds

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
**/*.{js,ts}

📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)

**/*.{js,ts}: Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic
Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call
Do not add direct console.log calls outside the logging utility - use the central log function instead
Ensure silent mode is disabled in a finally block to prevent it from staying enabled
Do not access the global silentMode variable directly - use the exported silent mode control functions instead
Do not duplicate task ID formatting logic across modules - centralize formatting utilities
Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context
Use FuzzyTaskSearch class from utils/fuzzyTaskSearch.js for automatic task relevance detection with configurable search parameters
Use fuzzy search to supplement user-provided task IDs and display discovered task IDs to users for transparency
Do not replace explicit user task selections with fuzzy results - fuzzy search should supplement, not replace user selections
Use readJSON and writeJSON utilities for all JSON file operations instead of raw fs.readFileSync or fs.writeFileSync
Include error handling for JSON file operations and validate JSON structure after reading
Use path.join() for cross-platform path construction and path.resolve() for absolute paths, validating paths before file operations
Support both .env files and MCP session environment for environment variable resolution with fallbacks for missing values
Prefer updating the core function to accept an outputFormat parameter and check outputFormat === 'json' before displaying UI elements

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
**/*.spec.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Place package and app test files in packages/<package-name>/src/<module>/<file>.spec.ts or apps/<app-name>/src/<module>/<file>.spec.ts alongside source files

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
**/*.{spec,test}.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{spec,test}.ts: Always use .ts for TypeScript tests, never .js
NEVER use async/await in test functions unless testing actual asynchronous operations; use synchronous top-level imports instead of dynamic await import()

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Import modules with .js extension even in TypeScript source files for ESM compatibility

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
apps/cli/**/*.{spec,test}.ts

📄 CodeRabbit inference engine (CLAUDE.md)

In unit tests for apps/cli, mock tm-core responses but use real Commander/chalk/inquirer/other npm packages to test display logic

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
apps/cli/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

CLI (@tm/cli) should be a thin presentation layer that calls tm-core methods and displays results; handle only CLI-specific concerns like argument parsing, output formatting, and user prompts

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
🧠 Learnings (33)
📓 Common learnings
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/git_workflow.mdc:0-0
Timestamp: 2025-11-24T18:00:23.000Z
Learning: Pull Request descriptions must include: Task Overview, Subtasks Completed (checklist), Implementation Details, Testing approach, Breaking Changes (if any), and Related Tasks.
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Use established mocking patterns from auth.test.ts as templates: mock bcrypt with proper TypeScript typing, mock Prisma client with transaction support, and always clear mocks between tests
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/fixtures/**/*.ts : Test fixture files must export reusable test data creators and constants (createTestUser, adminUser, invalidUser, etc.) for use across unit, integration, and e2e tests to ensure consistency
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to **/*.integration.test.ts : Integration tests must use supertest for API endpoint testing, verify database state changes after operations, clean test data before each test, and include full request/response validation with expected HTTP status codes
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/setup/integration.ts : Integration test setup file must connect to Prisma before all tests with prisma.$connect(), disconnect after all tests with prisma.$disconnect(), and provide database cleanup before each test
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1069
File: .changeset/fix-tag-complexity-detection.md:0-0
Timestamp: 2025-08-02T15:33:22.656Z
Learning: For changeset files (.changeset/*.md), Crunchyman-ralph prefers to ignore formatting nitpicks about blank lines between frontmatter and descriptions, as he doesn't mind having them and wants to avoid such comments in future reviews.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1200
File: src/ai-providers/custom-sdk/grok-cli/language-model.js:96-100
Timestamp: 2025-09-19T16:06:42.182Z
Learning: The user Crunchyman-ralph prefers to keep environment variable names explicit (like GROK_CLI_API_KEY) rather than supporting multiple aliases, to avoid overlap and ensure clear separation between different CLI implementations.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: scripts/modules/supported-models.json:242-254
Timestamp: 2025-08-08T11:33:15.297Z
Learning: Preference: In scripts/modules/supported-models.json, the "name" field is optional. For OpenAI entries (e.g., "gpt-5"), Crunchyman-ralph prefers omitting "name" when the id is explicit enough; avoid nitpicks requesting a "name" in such cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/subpath-exports.test.ts:6-9
Timestamp: 2025-09-03T12:45:30.724Z
Learning: The user Crunchyman-ralph prefers to avoid overly nitpicky or detailed suggestions in code reviews, especially for test coverage of minor import paths. Focus on more substantial issues rather than comprehensive coverage of all possible edge cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1217
File: apps/cli/src/index.ts:16-21
Timestamp: 2025-09-18T16:35:35.147Z
Learning: The user Crunchyman-ralph considers suggestions to export types for better ergonomics (like exporting UpdateInfo type alongside related functions) as nitpicky and prefers not to implement such suggestions.
📚 Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to **/*.test.{js,ts} : Test new features with both legacy and tagged task data formats; verify tag resolution behavior; test migration compatibility; ensure pre-migration projects are handled correctly

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to scripts/modules/**/*.{js,ts} : Implement complete migration functions for tagged task lists that handle configuration, state file creation, and migration status tracking

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: For each subtask, use task-master to document TDD progress including failing tests written, implementation status, coverage metrics, and test completion with specific numbers of tests and coverage percentages

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to **/{utils,utilities}/**/*.{js,ts} : Implement reusable task finding utilities that support both task and subtask lookups and add context to subtask results

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Implement status update functions that handle both individual tasks and subtasks within the current tag context, considering subtask status when updating parent tasks and suggesting parent task updates when all subtasks are done

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Use consistent properties for subtasks (id, title, description, status, dependencies, details) without duplicating parent task properties, maintaining simple numeric IDs unique within the parent task

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:46.699Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.699Z
Learning: Applies to **/*.test.js : For task file operations in tests: use test-specific file paths (e.g., 'test-tasks.json'); mock `readJSON` and `writeJSON` to avoid real file system interactions; verify file operations use correct paths; use different paths for each test; verify modifications on in-memory task objects passed to `writeJSON`.

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Include all required task properties (id, title, description, status, dependencies, priority, details, testStrategy, subtasks) in each task object without adding extra properties outside the standard schema

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Format task files with consistent structure including task metadata (ID, title, status), dependencies with status indicators, and tag context information in the file header

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:00:23.000Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/git_workflow.mdc:0-0
Timestamp: 2025-11-24T18:00:23.000Z
Learning: Test commits should be separate from feature commits and follow the format: `test(task-X): [Description]` with details about unit tests, integration tests, coverage metrics, and task reference.

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Calculate and display task completion statistics for the current tag context including total tasks, completed tasks, completion percentage, and subtask completion counts using visual progress indicators

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Generate appropriate numbers of subtasks based on task complexity analysis, using recommended subtask counts from complexity analysis when available instead of always using default counts

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Filter and display tasks by status within the current tag context, handling subtask display in lists and using consistent table formats

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to src/utils/**/*.ts : Utility functions must achieve 90% statement coverage, 85% branch coverage, and 90% function coverage with tests covering all code paths, edge cases, null/undefined values, and error scenarios

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-21T02:41:13.453Z
Learnt from: rtmcrc
Repo: eyaltoledano/claude-task-master PR: 933
File: scripts/modules/task-manager/expand-all-tasks.js:0-0
Timestamp: 2025-07-21T02:41:13.453Z
Learning: In scripts/modules/task-manager/expand-all-tasks.js, the success flag should always be true when the expansion process completes successfully, even if individual tasks fail due to LLM errors. Failed tasks are designed to be expanded on subsequent iterations, so individual task failures don't constitute overall operation failure.

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/e2e/**/*.test.ts : End-to-end tests must test complete user workflows across multiple API endpoints in sequence, verify state changes between workflow steps, use extended timeouts (30000ms), and validate final outcomes without mocking business logic

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:01.617Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ui.mdc:0-0
Timestamp: 2025-11-24T18:04:01.617Z
Learning: Applies to scripts/modules/ui.js : Display progress indicators using both numeric and visual representations, such as showing completed tasks count, total tasks, completion percentage, and progress bars together

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to **/*.test.ts : Unit tests must follow the describe/it pattern, use beforeEach for mock setup with jest.clearAllMocks(), include specific assertions with expect(), and test both success and error scenarios including edge cases

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Allow numeric subtask IDs to reference other subtasks within the same parent

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Allow numeric subtask IDs to reference other subtasks within the same parent and convert between formats appropriately when needed, avoiding circular dependencies between subtasks

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Support both task and subtask dependencies in cycle detection

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:58:07.977Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.977Z
Learning: Applies to scripts/modules/dependency-manager.js : dependency-manager.js should manage task dependencies by handling add/remove/validate/fix operations across tagged task contexts

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Represent task dependencies as arrays of task IDs

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Represent task dependencies as arrays of task IDs, using numeric IDs for direct task references and string IDs with dot notation (e.g., '1.2') for subtask references

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Do not create circular dependencies between subtasks

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Check for and remove references to non-existent tasks and self-references during cleanup, tracking and reporting changes made during cleanup

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Validate that referenced tasks exist before adding dependencies

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Check for and remove references to non-existent tasks during cleanup

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Remove references to non-existent tasks during validation

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Prevent tasks from depending on themselves, handling both direct and indirect self-dependencies

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Prevent tasks from depending on themselves

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to **/{utils,utilities}/**/*.{js,ts} : Detect circular dependencies using DFS and validate task references before operations

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
🧬 Code graph analysis (1)
apps/cli/src/ui/components/dashboard.component.spec.ts (2)
packages/tm-core/src/common/types/index.ts (1)
  • Subtask (91-95)
apps/cli/src/ui/components/dashboard.component.ts (1)
  • calculateDependencyStatistics (285-352)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Typecheck
🔇 Additional comments (3)
apps/cli/src/ui/components/dashboard.component.spec.ts (3)

21-49: Excellent test helper design for focused testing.

The local helpers provide clean, type-safe factory functions for creating minimal test data. The documentation clearly indicates these are intentionally local and focused on status-based statistics, which is appropriate for this test file's scope.


56-227: LGTM! Comprehensive test coverage with consistent string IDs.

The refactored tests maintain excellent coverage of the cancelled-tasks-as-complete behavior across task statistics, subtask statistics, and dependency calculations. All assertions are correct and the consistent use of string IDs throughout aligns well with the codebase changes.


228-242: Good addition of partial dependency edge case.

This test case strengthens coverage by verifying that tasks remain blocked when only some dependencies are satisfied, even if those satisfied dependencies are cancelled. The scenario correctly validates that task 3 stays blocked by pending task 2, while task 2 itself is ready to work.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
apps/cli/src/ui/components/dashboard.component.spec.ts (1)

1-1: Fix formatting before merge.

The pipeline indicates that Biome formatting would change this file. Run npm run format-check to apply formatting fixes.

Run the following command to fix formatting:

npm run format-check
packages/tm-core/src/modules/integration/clients/supabase-client.ts (1)

299-305: sessionStorage.clear() returns a Promise but is not awaited.

SupabaseSessionStorage.clear() is an async method (as shown in the relevant snippet), but it's called without await here. While this may work in practice since signOut doesn't depend on the clear completion, for consistency and to ensure data is flushed before the method returns:

 async signOut(): Promise<void> {
   const client = this.getClient();

   try {
     // Sign out with local scope to clear only this device's session
     const { error } = await client.auth.signOut({ scope: 'local' });

     if (error) {
       this.logger.warn('Failed to sign out:', error);
     }

     // Clear cached session data
-    this.sessionStorage.clear();
+    await this.sessionStorage.clear();
   } catch (error) {
     this.logger.error('Error during sign out:', error);
   }
 }
🧹 Nitpick comments (7)
apps/cli/src/ui/components/dashboard.component.spec.ts (1)

14-44: Consider using existing test utilities from @tm/core/testing.

The local createTask and createSubtask helper functions duplicate functionality already available in @tm/core/testing. Other integration test files (set-status.command.test.ts, list.command.test.ts, etc.) successfully import and use these utilities:

import { createTask, createTasksFile, createSubtask } from '@tm/core/testing';

Using the shared utilities would improve consistency across tests and reduce maintenance burden.

Apply this diff to use the shared utilities:

-// Helper to create minimal test tasks
-const createTask = (
-	overrides: Omit<Partial<Task>, 'id'> & { id: number | string }
-): Task => {
-	const { id, ...rest } = overrides;
-	return {
-		title: '',
-		description: '',
-		status: 'pending',
-		priority: 'medium',
-		dependencies: [],
-		details: '',
-		testStrategy: '',
-		subtasks: [],
-		...rest,
-		id: String(id)
-	} as Task;
-};
-
-// Helper to create minimal subtasks
-const createSubtask = (id: string, parentId: string, status: TaskStatus): Subtask => ({
-	id,
-	parentId,
-	title: `Subtask ${id}`,
-	status,
-	description: '',
-	priority: 'medium',
-	dependencies: [],
-	details: '',
-	testStrategy: ''
-});

And add to imports:

-import type { Subtask, Task, TaskStatus } from '@tm/core';
+import type { Subtask, Task, TaskStatus } from '@tm/core';
+import { createTask, createSubtask } from '@tm/core/testing';

Note: You may need to adjust the helper calls if the @tm/core/testing versions have different signatures.

packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts (1)

199-242: Consider verifying that StorageFactory.create doesn't trigger its own refresh.

The test asserts refreshCallCount === 1 after explicitly calling supabaseAuthClient.refreshSession(). However, the comment on Line 234-236 states "all code paths share the same mock" but doesn't verify whether StorageFactory.create or AuthManager.getInstance internally triggered any refresh. If they did, the count would still be 1 due to the singleton, which is the correct behavior you're testing—but the comment could be clearer.

packages/tm-core/src/modules/auth/managers/auth-manager.ts (1)

80-83: Consider resetting SupabaseAuthClient in resetInstance().

AuthManager.resetInstance() resets ContextStore but not SupabaseAuthClient. In tests, if AuthManager is reset but SupabaseAuthClient retains state (including a potentially stale or mocked Supabase client), subsequent AuthManager instances will inherit that state. The integration tests already call SupabaseAuthClient.resetInstance() separately, but adding it here would make AuthManager.resetInstance() self-contained for testing.

 static resetInstance(): void {
   AuthManager.instance = null;
   ContextStore.resetInstance();
+  SupabaseAuthClient.resetInstance();
 }
packages/tm-core/src/modules/integration/clients/supabase-client.ts (1)

44-46: Consider cleaning up the internal client on reset.

resetInstance() sets instance = null but if the old instance held an initialized this.client, that Supabase client may still have active listeners or pending operations. For test isolation, consider also nullifying the client or calling cleanup:

 static resetInstance(): void {
+  if (SupabaseAuthClient.instance) {
+    SupabaseAuthClient.instance.client = null;
+  }
   SupabaseAuthClient.instance = null;
 }

This ensures no stale client references persist across test resets.

packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts (1)

120-175: Test verifies mock infrastructure but doesn't fully simulate concurrent refresh scenario.

The test comment mentions "both would try to refresh" but only calls refreshSession once (Line 162). While this validates the mock works correctly, it doesn't simulate the actual race condition scenario where both AuthManager and StorageFactory would call refresh.

Consider adding assertions that verify AuthManager and StorageFactory share the same spied client, or explicitly call refresh through both code paths if full coverage of the race scenario is desired.

packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts (1)

142-170: Tests overlap with auth-token-refresh-singleton.test.ts.

These concurrent access tests partially duplicate tests in the companion file (auth-token-refresh-singleton.test.ts). While redundant coverage isn't harmful, consider consolidating overlapping test cases into a shared test file or extracting common test utilities to reduce maintenance burden.

packages/tm-core/src/modules/config/services/config-merger.service.spec.ts (1)

17-21: as any casts are fine for behavior tests but could be tightened with fixtures

Casting configs and merge results to any keeps these tests focused on merge behavior instead of config typing, which is reasonable. If you later want stronger type-safety here, consider switching to the shared config test fixtures (or typed helpers) so the configs stay aligned with the real config shape without needing as any everywhere. Not a blocker.

Also applies to: 49-59, 71-87, 103-116, 121-131, 148-168

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

♻️ Duplicate comments (2)
packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts (1)

1-1: Biome formatting still needs to be fixed for this file.

CI has already flagged a Biome formatting difference here; run npm run format-check (then npm run format) and commit the result so the pipeline passes.

packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts (1)

1-1: Biome formatting still needs to be fixed for this file.

CI has already reported a Biome formatting diff here; please re-run the formatter (npm run format-check / npm run format) and commit the formatted file so tests can pass.

🧹 Nitpick comments (4)
apps/cli/src/ui/components/dashboard.component.spec.ts (1)

14-48: Local task/subtask factories are sound; consider reusing shared test helpers

The createTask / createSubtask helpers build valid minimal objects and keep the tests readable. If you find yourself needing similar factories in other specs, consider either:

  • Importing the centralized createTask / createSubtask from the tm-core testing utilities, or
  • Moving these helpers into a small shared fixture module under apps/cli and reusing them,

to avoid divergence in default field values across tests.

packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts (1)

126-143: Tighten StorageFactory integration assertions to actually cover its Supabase client usage.

Both StorageFactory.createApiStorage should use the singleton Supabase client and AuthManager and StorageFactory should share the same Supabase client currently only re-check that SupabaseAuthClient.getInstance().getClient() returns a stable client; they would still pass even if StorageFactory.create internally instantiated its own Supabase client.

To make these true regression tests for the StorageFactory path, consider asserting StorageFactory’s own Supabase usage, for example by:

  • Spying on SupabaseAuthClient.getInstance / getClient and asserting they are invoked during StorageFactory.create, or
  • Exposing (even only in test builds) a way to inspect the client used by the created storage and comparing it to SupabaseAuthClient.getInstance().getClient().

That would align the assertions with the comments about preventing separate clients in StorageFactory and AuthManager.

Also applies to: 159-172

packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts (2)

133-153: Remove unnecessary async from the first time-based expiration test.

it('should detect expired token after time passes', ...) is declared async but doesn’t perform any asynchronous work. Dropping async keeps the test in line with the guideline to only use async when a test actually awaits something, and avoids masking accidental missing awaits in the future.


173-307: Race-condition tests don’t yet prove that StorageFactory participates in the shared-refresh behavior.

The scenarios in Singleton Pattern with Expired Token Scenario and Real-World Command Simulation are described as guarding against multiple clients each refreshing the same token, but in practice:

  • All refresh calls are made via supabaseAuthClient.refreshSession() or authManager.supabaseClient.refreshSession().
  • StorageFactory.create(...) is invoked but never causes a refresh or a distinct client to participate in the mocked internalClient.auth.refreshSession flow.
  • The AuthError('Invalid Refresh Token: Already Used', 400) branch in the mocked refreshSession is never hit, because the tests only ever perform a single refresh.

As a result, these tests would still pass if StorageFactory internally created its own Supabase client and used it for refreshes, which weakens them as regressions for the original "refresh_token_already_used" bug.

To fully encode the regression, consider something along the lines of:

  • Driving two code paths that each attempt to refresh (e.g., one via AuthManager.hasValidSession() and one via whatever call Storage-backed flows use), and asserting that the single mocked internalClient.auth.refreshSession spy sees the expected call count (and that the “second client” path doesn’t observe the AuthError), or
  • Explicitly asserting that StorageFactory.create uses SupabaseAuthClient.getInstance().getClient() (e.g., via spies), so any future divergence back to per-call clients will be caught.

This would make the tests a more direct guard against the race condition they document.

Also applies to: 310-360

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3582bd and 4c36c33.

📒 Files selected for processing (4)
  • apps/cli/src/ui/components/dashboard.component.spec.ts (9 hunks)
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts (1 hunks)
  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts (1 hunks)
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
🧰 Additional context used
📓 Path-based instructions (12)
**/*.test.{js,ts}

📄 CodeRabbit inference engine (.cursor/rules/new_features.mdc)

**/*.test.{js,ts}: Follow the mock-first-then-import pattern for Jest mocking; use jest.spyOn() for spy functions; clear mocks between tests; verify mocks with the pattern described in tests.mdc
Test new features with both legacy and tagged task data formats; verify tag resolution behavior; test migration compatibility; ensure pre-migration projects are handled correctly

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
**/*.test.ts

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Unit tests must follow the describe/it pattern, use beforeEach for mock setup with jest.clearAllMocks(), include specific assertions with expect(), and test both success and error scenarios including edge cases

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

TypeScript test files must achieve minimum code coverage thresholds: 80% lines/functions and 70% branches globally, 90% for utilities, and 85% for middleware; new features must meet or exceed these thresholds

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
**/*.{js,ts}

📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)

**/*.{js,ts}: Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic
Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call
Do not add direct console.log calls outside the logging utility - use the central log function instead
Ensure silent mode is disabled in a finally block to prevent it from staying enabled
Do not access the global silentMode variable directly - use the exported silent mode control functions instead
Do not duplicate task ID formatting logic across modules - centralize formatting utilities
Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context
Use FuzzyTaskSearch class from utils/fuzzyTaskSearch.js for automatic task relevance detection with configurable search parameters
Use fuzzy search to supplement user-provided task IDs and display discovered task IDs to users for transparency
Do not replace explicit user task selections with fuzzy results - fuzzy search should supplement, not replace user selections
Use readJSON and writeJSON utilities for all JSON file operations instead of raw fs.readFileSync or fs.writeFileSync
Include error handling for JSON file operations and validate JSON structure after reading
Use path.join() for cross-platform path construction and path.resolve() for absolute paths, validating paths before file operations
Support both .env files and MCP session environment for environment variable resolution with fallbacks for missing values
Prefer updating the core function to accept an outputFormat parameter and check outputFormat === 'json' before displaying UI elements

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
**/tests/integration/**/*.test.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Place package and app integration tests in packages/<package-name>/tests/integration/<module>/<file>.test.ts or apps/<app-name>/tests/integration/<module>/<file>.test.ts

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
**/*.{spec,test}.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{spec,test}.ts: Always use .ts for TypeScript tests, never .js
NEVER use async/await in test functions unless testing actual asynchronous operations; use synchronous top-level imports instead of dynamic await import()

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Import modules with .js extension even in TypeScript source files for ESM compatibility

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
packages/tm-core/**/*.{spec,test}.ts

📄 CodeRabbit inference engine (CLAUDE.md)

In unit tests for @tm/core, mock only external I/O (Supabase, APIs, filesystem) and use real internal services

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
**/tests/integration/**/*.{spec,test}.ts

📄 CodeRabbit inference engine (CLAUDE.md)

In integration tests, use real tm-core and mock only external boundaries (APIs, DB, filesystem)

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
**/*.spec.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Place package and app test files in packages/<package-name>/src/<module>/<file>.spec.ts or apps/<app-name>/src/<module>/<file>.spec.ts alongside source files

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
apps/cli/**/*.{spec,test}.ts

📄 CodeRabbit inference engine (CLAUDE.md)

In unit tests for apps/cli, mock tm-core responses but use real Commander/chalk/inquirer/other npm packages to test display logic

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
apps/cli/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

CLI (@tm/cli) should be a thin presentation layer that calls tm-core methods and displays results; handle only CLI-specific concerns like argument parsing, output formatting, and user prompts

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
🧠 Learnings (49)
📓 Common learnings
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/git_workflow.mdc:0-0
Timestamp: 2025-11-24T18:00:23.000Z
Learning: Pull Request descriptions must include: Task Overview, Subtasks Completed (checklist), Implementation Details, Testing approach, Breaking Changes (if any), and Related Tasks.
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Use established mocking patterns from auth.test.ts as templates: mock bcrypt with proper TypeScript typing, mock Prisma client with transaction support, and always clear mocks between tests
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/setup/integration.ts : Integration test setup file must connect to Prisma before all tests with prisma.$connect(), disconnect after all tests with prisma.$disconnect(), and provide database cleanup before each test
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/fixtures/**/*.ts : Test fixture files must export reusable test data creators and constants (createTestUser, adminUser, invalidUser, etc.) for use across unit, integration, and e2e tests to ensure consistency
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to **/*.integration.test.ts : Integration tests must use supertest for API endpoint testing, verify database state changes after operations, clean test data before each test, and include full request/response validation with expected HTTP status codes
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1069
File: .changeset/fix-tag-complexity-detection.md:0-0
Timestamp: 2025-08-02T15:33:22.656Z
Learning: For changeset files (.changeset/*.md), Crunchyman-ralph prefers to ignore formatting nitpicks about blank lines between frontmatter and descriptions, as he doesn't mind having them and wants to avoid such comments in future reviews.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1200
File: src/ai-providers/custom-sdk/grok-cli/language-model.js:96-100
Timestamp: 2025-09-19T16:06:42.182Z
Learning: The user Crunchyman-ralph prefers to keep environment variable names explicit (like GROK_CLI_API_KEY) rather than supporting multiple aliases, to avoid overlap and ensure clear separation between different CLI implementations.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: scripts/modules/supported-models.json:242-254
Timestamp: 2025-08-08T11:33:15.297Z
Learning: Preference: In scripts/modules/supported-models.json, the "name" field is optional. For OpenAI entries (e.g., "gpt-5"), Crunchyman-ralph prefers omitting "name" when the id is explicit enough; avoid nitpicks requesting a "name" in such cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/subpath-exports.test.ts:6-9
Timestamp: 2025-09-03T12:45:30.724Z
Learning: The user Crunchyman-ralph prefers to avoid overly nitpicky or detailed suggestions in code reviews, especially for test coverage of minor import paths. Focus on more substantial issues rather than comprehensive coverage of all possible edge cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1217
File: apps/cli/src/index.ts:16-21
Timestamp: 2025-09-18T16:35:35.147Z
Learning: The user Crunchyman-ralph considers suggestions to export types for better ergonomics (like exporting UpdateInfo type alongside related functions) as nitpicky and prefers not to implement such suggestions.
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to **/tests/integration/**/*.{spec,test}.ts : In integration tests, use real tm-core and mock only external boundaries (APIs, DB, filesystem)

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to packages/tm-core/**/*.{spec,test}.ts : In unit tests for tm/core, mock only external I/O (Supabase, APIs, filesystem) and use real internal services

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Use established mocking patterns from auth.test.ts as templates: mock bcrypt with proper TypeScript typing, mock Prisma client with transaction support, and always clear mocks between tests

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to **/*.integration.test.ts : Integration tests must use supertest for API endpoint testing, verify database state changes after operations, clean test data before each test, and include full request/response validation with expected HTTP status codes

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/e2e/**/*.test.ts : End-to-end tests must test complete user workflows across multiple API endpoints in sequence, verify state changes between workflow steps, use extended timeouts (30000ms), and validate final outcomes without mocking business logic

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/fixtures/**/*.ts : Test fixture files must export reusable test data creators and constants (createTestUser, adminUser, invalidUser, etc.) for use across unit, integration, and e2e tests to ensure consistency

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-10-15T14:43:40.410Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1314
File: packages/tm-core/src/auth/credential-store.ts:92-94
Timestamp: 2025-10-15T14:43:40.410Z
Learning: In the claude-task-master codebase, `getCredentials()` in `credential-store.ts` defaults to `allowExpired: true` to enable Supabase refresh flows. The Supabase client automatically handles token refresh when credentials are expired but have a valid refresh token. The `SupabaseSessionStorage` updates the credentials after Supabase performs the refresh. This is an intentional design pattern where the credential store is passive storage and Supabase manages the active token lifecycle.

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/setup.ts : Create global test setup file that configures jest.setTimeout(10000), clears all mocks after each test with jest.clearAllMocks(), and initializes global test configuration

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
📚 Learning: 2025-11-24T18:03:46.699Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.699Z
Learning: Applies to tests/integration/**/*.test.js : Locate integration tests in `tests/integration/` directory. Test interactions between modules, focus on component interfaces rather than implementation details, use more realistic but controlled test environments.

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to src/**/*.ts : Source code must have corresponding test files either colocated (*.test.ts) or in tests/unit/ directory following established patterns from src/utils/auth.test.ts with proper mocking for external dependencies

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to **/*.test.ts : Unit tests must follow the describe/it pattern, use beforeEach for mock setup with jest.clearAllMocks(), include specific assertions with expect(), and test both success and error scenarios including edge cases

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
📚 Learning: 2025-11-24T18:03:46.699Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.699Z
Learning: Applies to **/*.test.js : When testing UI functions: mock console output and verify correct formatting; test conditional output logic; use `toContain()` or `toMatch()` rather than exact `toBe()` for strings with emojis or formatting; create separate tests for different behavior modes; test structure of formatted output rather than exact string matching.

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
📚 Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to **/*.test.{js,ts} : Test new features with both legacy and tagged task data formats; verify tag resolution behavior; test migration compatibility; ensure pre-migration projects are handled correctly

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to package.json : package.json scripts must include: 'test', 'test:watch', 'test:coverage', 'test:unit', 'test:integration', 'test:e2e', and 'test:ci' commands for testing framework integration

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
📚 Learning: 2025-11-24T18:03:46.700Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.700Z
Learning: Applies to **/*.test.js : Do not import or instantiate real AI service clients. Create fully mocked versions that return predictable responses. Mock the entire module with controlled behavior.

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to apps/cli/**/*.{spec,test}.ts : In unit tests for apps/cli, mock tm-core responses but use real Commander/chalk/inquirer/other npm packages to test display logic

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:46.700Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.700Z
Learning: Applies to **/*.test.js : For modules with initialization-dependent functions in tests: create test-specific implementations that initialize all variables correctly; use factory functions in mocks to ensure proper initialization order; be careful with how you mock functions that depend on module state.

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to **/tests/integration/**/*.test.ts : Place package and app integration tests in `packages/<package-name>/tests/integration/<module>/<file>.test.ts` or `apps/<app-name>/tests/integration/<module>/<file>.test.ts`

Applied to files:

  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
📚 Learning: 2025-11-24T17:57:14.728Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.728Z
Learning: Applies to tests/unit/ai-providers/*.test.js : Create unit tests in `tests/unit/ai-providers/<provider-name>.test.js` that mock the provider's AI SDK module and test each exported function for correct client instantiation, parameter passing, result handling, and error handling

Applied to files:

  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/setup/integration.ts : Integration test setup file must connect to Prisma before all tests with prisma.$connect(), disconnect after all tests with prisma.$disconnect(), and provide database cleanup before each test

Applied to files:

  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
📚 Learning: 2025-11-24T18:03:46.700Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.700Z
Learning: Applies to **/*.test.js : Create simplified test functions instead of complex setups: create simplified versions of complex functions focusing on core logic; remove file system operations, API calls, and external dependencies; pass all dependencies as parameters.

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to **/{utils,utilities}/**/*.{js,ts} : Implement reusable task finding utilities that support both task and subtask lookups and add context to subtask results

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:46.699Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.699Z
Learning: Applies to **/*.test.js : For task file operations in tests: use test-specific file paths (e.g., 'test-tasks.json'); mock `readJSON` and `writeJSON` to avoid real file system interactions; verify file operations use correct paths; use different paths for each test; verify modifications on in-memory task objects passed to `writeJSON`.

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to scripts/modules/**/*.{js,ts} : Implement complete migration functions for tagged task lists that handle configuration, state file creation, and migration status tracking

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to mcp-server/src/core/task-master-core.js : Update `task-master-core.js` by importing and re-exporting direct functions and adding them to the directFunctions map

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Calculate and display task completion statistics for the current tag context including total tasks, completed tasks, completion percentage, and subtask completion counts using visual progress indicators

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Implement status update functions that handle both individual tasks and subtasks within the current tag context, considering subtask status when updating parent tasks and suggesting parent task updates when all subtasks are done

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: For each subtask, use task-master to document TDD progress including failing tests written, implementation status, coverage metrics, and test completion with specific numbers of tests and coverage percentages

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Use consistent properties for subtasks (id, title, description, status, dependencies, details) without duplicating parent task properties, maintaining simple numeric IDs unique within the parent task

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Generate appropriate numbers of subtasks based on task complexity analysis, using recommended subtask counts from complexity analysis when available instead of always using default counts

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Include all required task properties (id, title, description, status, dependencies, priority, details, testStrategy, subtasks) in each task object without adding extra properties outside the standard schema

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Filter and display tasks by status within the current tag context, handling subtask display in lists and using consistent table formats

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-21T02:41:13.453Z
Learnt from: rtmcrc
Repo: eyaltoledano/claude-task-master PR: 933
File: scripts/modules/task-manager/expand-all-tasks.js:0-0
Timestamp: 2025-07-21T02:41:13.453Z
Learning: In scripts/modules/task-manager/expand-all-tasks.js, the success flag should always be true when the expansion process completes successfully, even if individual tasks fail due to LLM errors. Failed tasks are designed to be expanded on subsequent iterations, so individual task failures don't constitute overall operation failure.

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:05:23.891Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: assets/AGENTS.md:0-0
Timestamp: 2025-11-24T18:05:23.891Z
Learning: Apply task status values: `pending` (ready), `in-progress` (being worked on), `done` (completed), `deferred` (postponed), `cancelled` (no longer needed), `blocked` (waiting on external factors)

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:01.617Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ui.mdc:0-0
Timestamp: 2025-11-24T18:04:01.617Z
Learning: Applies to scripts/modules/ui.js : Display progress indicators using both numeric and visual representations, such as showing completed tasks count, total tasks, completion percentage, and progress bars together

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to src/utils/**/*.ts : Utility functions must achieve 90% statement coverage, 85% branch coverage, and 90% function coverage with tests covering all code paths, edge cases, null/undefined values, and error scenarios

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Allow numeric subtask IDs to reference other subtasks within the same parent

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Allow numeric subtask IDs to reference other subtasks within the same parent and convert between formats appropriately when needed, avoiding circular dependencies between subtasks

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Support both task and subtask dependencies in cycle detection

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Do not create circular dependencies between subtasks

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Validate that referenced tasks exist before adding dependencies

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:58:07.977Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.977Z
Learning: Applies to scripts/modules/dependency-manager.js : dependency-manager.js should manage task dependencies by handling add/remove/validate/fix operations across tagged task contexts

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Represent task dependencies as arrays of task IDs

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Remove references to non-existent tasks during validation

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Represent task dependencies as arrays of task IDs, using numeric IDs for direct task references and string IDs with dot notation (e.g., '1.2') for subtask references

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Check for and remove references to non-existent tasks during cleanup

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Check for and remove references to non-existent tasks and self-references during cleanup, tracking and reporting changes made during cleanup

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Validate that referenced tasks exist before adding dependencies and provide clear error messages for non-existent dependencies

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
🧬 Code graph analysis (2)
packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts (2)
packages/tm-core/src/testing/index.ts (1)
  • createApiStorageConfig (29-29)
packages/tm-core/src/modules/storage/services/storage-factory.ts (1)
  • StorageFactory (24-285)
apps/cli/src/ui/components/dashboard.component.spec.ts (2)
packages/tm-core/src/testing/index.ts (2)
  • createTask (19-19)
  • createSubtask (20-20)
packages/tm-core/src/common/types/index.ts (1)
  • Subtask (91-95)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test
🔇 Additional comments (5)
apps/cli/src/ui/components/dashboard.component.spec.ts (4)

6-12: Imports and module wiring look correct

Using import type for Task/Subtask/TaskStatus and the .js extension for the local dashboard module matches the project’s ESM/typing guidelines; no changes needed here.


51-133: Task statistics tests clearly lock in “cancelled/completed are complete” semantics

These four cases thoroughly cover the combinations of done, completed, cancelled, pending, and in-progress, and assert both counts and percentages, which should protect against regressions in calculateTaskStatistics. No issues from a correctness or style perspective.


135-188: Subtask statistics tests accurately cover cancelled/completed handling

The subtask tests mirror the task-level behavior and explicitly verify both completedCount and the rounded percentage, which is good for catching future logic changes in calculateSubtaskStatistics. Implementation here looks solid.


190-277: Dependency statistics tests enforce domain rule for cancelled/completed deps

These scenarios make it explicit that dependencies in cancelled or completed states should not block dependents and that such dependents are counted as “ready to work”, which is a key business rule for the dashboard. Please just confirm this matches the intended product behavior for cancelled tasks (i.e., they’re always treated as satisfied dependencies rather than requiring re-planning).

packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts (1)

52-124: Singleton and AuthManager wiring tests look solid.

The Singleton Enforcement and AuthManager Integration suites give good coverage that SupabaseAuthClient.getInstance() is stable and that AuthManager is wired to that singleton, which directly guards against the prior “multiple SupabaseAuthClient instances” regression.

@Crunchyman-ralph Crunchyman-ralph force-pushed the ralph/fix/auth.refresh.token.regression branch from c5c2c0c to 408b064 Compare November 26, 2025 20:48
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts (1)

37-50: Consider using a consistent mock implementation across test files.

This mock uses simpler empty method stubs, while auth-token-refresh-singleton.test.ts uses a Map-based implementation. The simpler mock works for these tests since they don't exercise storage behavior, but consider extracting a shared mock fixture for consistency.

Based on coding guidelines, test fixture files should export reusable test data creators for use across tests to ensure consistency.

apps/cli/src/ui/components/dashboard.component.spec.ts (1)

14-54: Consider shared test utilities for consistency.

While the local helpers work correctly and the comment explains the rationale, several test cases still provide explicit title values (e.g., lines 64, 70, 90-93), which undermines the justification that these helpers allow "creating tasks without titles for cleaner test data."

Per the learnings, test fixture files should export reusable test data creators for consistency across unit, integration, and e2e tests. Consider whether @tm/core/testing utilities could be enhanced to support optional titles rather than maintaining parallel helpers.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4c36c33 and 408b064.

📒 Files selected for processing (7)
  • apps/cli/src/ui/components/dashboard.component.spec.ts (9 hunks)
  • packages/tm-core/src/modules/auth/managers/auth-manager.ts (2 hunks)
  • packages/tm-core/src/modules/integration/clients/supabase-client.ts (1 hunks)
  • packages/tm-core/src/testing/config-fixtures.ts (1 hunks)
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts (1 hunks)
  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts (1 hunks)
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/tm-core/src/testing/config-fixtures.ts
  • packages/tm-core/src/modules/integration/clients/supabase-client.ts
🧰 Additional context used
📓 Path-based instructions (12)
**/*.test.{js,ts}

📄 CodeRabbit inference engine (.cursor/rules/new_features.mdc)

**/*.test.{js,ts}: Follow the mock-first-then-import pattern for Jest mocking; use jest.spyOn() for spy functions; clear mocks between tests; verify mocks with the pattern described in tests.mdc
Test new features with both legacy and tagged task data formats; verify tag resolution behavior; test migration compatibility; ensure pre-migration projects are handled correctly

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
**/*.test.ts

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Unit tests must follow the describe/it pattern, use beforeEach for mock setup with jest.clearAllMocks(), include specific assertions with expect(), and test both success and error scenarios including edge cases

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

TypeScript test files must achieve minimum code coverage thresholds: 80% lines/functions and 70% branches globally, 90% for utilities, and 85% for middleware; new features must meet or exceed these thresholds

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/src/modules/auth/managers/auth-manager.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
**/*.{js,ts}

📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)

**/*.{js,ts}: Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic
Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call
Do not add direct console.log calls outside the logging utility - use the central log function instead
Ensure silent mode is disabled in a finally block to prevent it from staying enabled
Do not access the global silentMode variable directly - use the exported silent mode control functions instead
Do not duplicate task ID formatting logic across modules - centralize formatting utilities
Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context
Use FuzzyTaskSearch class from utils/fuzzyTaskSearch.js for automatic task relevance detection with configurable search parameters
Use fuzzy search to supplement user-provided task IDs and display discovered task IDs to users for transparency
Do not replace explicit user task selections with fuzzy results - fuzzy search should supplement, not replace user selections
Use readJSON and writeJSON utilities for all JSON file operations instead of raw fs.readFileSync or fs.writeFileSync
Include error handling for JSON file operations and validate JSON structure after reading
Use path.join() for cross-platform path construction and path.resolve() for absolute paths, validating paths before file operations
Support both .env files and MCP session environment for environment variable resolution with fallbacks for missing values
Prefer updating the core function to accept an outputFormat parameter and check outputFormat === 'json' before displaying UI elements

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/src/modules/auth/managers/auth-manager.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
**/tests/integration/**/*.test.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Place package and app integration tests in packages/<package-name>/tests/integration/<module>/<file>.test.ts or apps/<app-name>/tests/integration/<module>/<file>.test.ts

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
**/*.{spec,test}.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{spec,test}.ts: Always use .ts for TypeScript tests, never .js
NEVER use async/await in test functions unless testing actual asynchronous operations; use synchronous top-level imports instead of dynamic await import()

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Import modules with .js extension even in TypeScript source files for ESM compatibility

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/src/modules/auth/managers/auth-manager.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
packages/tm-core/**/*.{spec,test}.ts

📄 CodeRabbit inference engine (CLAUDE.md)

In unit tests for @tm/core, mock only external I/O (Supabase, APIs, filesystem) and use real internal services

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
**/tests/integration/**/*.{spec,test}.ts

📄 CodeRabbit inference engine (CLAUDE.md)

In integration tests, use real tm-core and mock only external boundaries (APIs, DB, filesystem)

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
**/*.spec.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Place package and app test files in packages/<package-name>/src/<module>/<file>.spec.ts or apps/<app-name>/src/<module>/<file>.spec.ts alongside source files

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
apps/cli/**/*.{spec,test}.ts

📄 CodeRabbit inference engine (CLAUDE.md)

In unit tests for apps/cli, mock tm-core responses but use real Commander/chalk/inquirer/other npm packages to test display logic

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
apps/cli/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

CLI (@tm/cli) should be a thin presentation layer that calls tm-core methods and displays results; handle only CLI-specific concerns like argument parsing, output formatting, and user prompts

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
🧠 Learnings (50)
📓 Common learnings
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/git_workflow.mdc:0-0
Timestamp: 2025-11-24T18:00:23.000Z
Learning: Pull Request descriptions must include: Task Overview, Subtasks Completed (checklist), Implementation Details, Testing approach, Breaking Changes (if any), and Related Tasks.
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Use established mocking patterns from auth.test.ts as templates: mock bcrypt with proper TypeScript typing, mock Prisma client with transaction support, and always clear mocks between tests
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/setup/integration.ts : Integration test setup file must connect to Prisma before all tests with prisma.$connect(), disconnect after all tests with prisma.$disconnect(), and provide database cleanup before each test
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to **/*.integration.test.ts : Integration tests must use supertest for API endpoint testing, verify database state changes after operations, clean test data before each test, and include full request/response validation with expected HTTP status codes
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/fixtures/**/*.ts : Test fixture files must export reusable test data creators and constants (createTestUser, adminUser, invalidUser, etc.) for use across unit, integration, and e2e tests to ensure consistency
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1069
File: .changeset/fix-tag-complexity-detection.md:0-0
Timestamp: 2025-08-02T15:33:22.656Z
Learning: For changeset files (.changeset/*.md), Crunchyman-ralph prefers to ignore formatting nitpicks about blank lines between frontmatter and descriptions, as he doesn't mind having them and wants to avoid such comments in future reviews.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1200
File: src/ai-providers/custom-sdk/grok-cli/language-model.js:96-100
Timestamp: 2025-09-19T16:06:42.182Z
Learning: The user Crunchyman-ralph prefers to keep environment variable names explicit (like GROK_CLI_API_KEY) rather than supporting multiple aliases, to avoid overlap and ensure clear separation between different CLI implementations.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: scripts/modules/supported-models.json:242-254
Timestamp: 2025-08-08T11:33:15.297Z
Learning: Preference: In scripts/modules/supported-models.json, the "name" field is optional. For OpenAI entries (e.g., "gpt-5"), Crunchyman-ralph prefers omitting "name" when the id is explicit enough; avoid nitpicks requesting a "name" in such cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/subpath-exports.test.ts:6-9
Timestamp: 2025-09-03T12:45:30.724Z
Learning: The user Crunchyman-ralph prefers to avoid overly nitpicky or detailed suggestions in code reviews, especially for test coverage of minor import paths. Focus on more substantial issues rather than comprehensive coverage of all possible edge cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1217
File: apps/cli/src/index.ts:16-21
Timestamp: 2025-09-18T16:35:35.147Z
Learning: The user Crunchyman-ralph considers suggestions to export types for better ergonomics (like exporting UpdateInfo type alongside related functions) as nitpicky and prefers not to implement such suggestions.
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to **/tests/integration/**/*.{spec,test}.ts : In integration tests, use real tm-core and mock only external boundaries (APIs, DB, filesystem)

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to packages/tm-core/**/*.{spec,test}.ts : In unit tests for tm/core, mock only external I/O (Supabase, APIs, filesystem) and use real internal services

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Use established mocking patterns from auth.test.ts as templates: mock bcrypt with proper TypeScript typing, mock Prisma client with transaction support, and always clear mocks between tests

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/src/modules/auth/managers/auth-manager.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to **/*.integration.test.ts : Integration tests must use supertest for API endpoint testing, verify database state changes after operations, clean test data before each test, and include full request/response validation with expected HTTP status codes

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/e2e/**/*.test.ts : End-to-end tests must test complete user workflows across multiple API endpoints in sequence, verify state changes between workflow steps, use extended timeouts (30000ms), and validate final outcomes without mocking business logic

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/fixtures/**/*.ts : Test fixture files must export reusable test data creators and constants (createTestUser, adminUser, invalidUser, etc.) for use across unit, integration, and e2e tests to ensure consistency

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-10-15T14:43:40.410Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1314
File: packages/tm-core/src/auth/credential-store.ts:92-94
Timestamp: 2025-10-15T14:43:40.410Z
Learning: In the claude-task-master codebase, `getCredentials()` in `credential-store.ts` defaults to `allowExpired: true` to enable Supabase refresh flows. The Supabase client automatically handles token refresh when credentials are expired but have a valid refresh token. The `SupabaseSessionStorage` updates the credentials after Supabase performs the refresh. This is an intentional design pattern where the credential store is passive storage and Supabase manages the active token lifecycle.

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/src/modules/auth/managers/auth-manager.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:46.699Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.699Z
Learning: Applies to tests/integration/**/*.test.js : Locate integration tests in `tests/integration/` directory. Test interactions between modules, focus on component interfaces rather than implementation details, use more realistic but controlled test environments.

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/setup.ts : Create global test setup file that configures jest.setTimeout(10000), clears all mocks after each test with jest.clearAllMocks(), and initializes global test configuration

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to src/**/*.ts : Source code must have corresponding test files either colocated (*.test.ts) or in tests/unit/ directory following established patterns from src/utils/auth.test.ts with proper mocking for external dependencies

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to **/*.test.ts : Unit tests must follow the describe/it pattern, use beforeEach for mock setup with jest.clearAllMocks(), include specific assertions with expect(), and test both success and error scenarios including edge cases

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to **/*.test.{js,ts} : Test new features with both legacy and tagged task data formats; verify tag resolution behavior; test migration compatibility; ensure pre-migration projects are handled correctly

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to apps/mcp/**/*.{spec,test}.ts : In unit tests for apps/mcp, mock tm-core responses but use real MCP framework to test response formatting

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:46.700Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.700Z
Learning: Applies to **/*.test.js : Do not import or instantiate real AI service clients. Create fully mocked versions that return predictable responses. Mock the entire module with controlled behavior.

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:46.700Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.700Z
Learning: Applies to **/*.test.js : For modules with initialization-dependent functions in tests: create test-specific implementations that initialize all variables correctly; use factory functions in mocks to ensure proper initialization order; be careful with how you mock functions that depend on module state.

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to apps/cli/**/*.{spec,test}.ts : In unit tests for apps/cli, mock tm-core responses but use real Commander/chalk/inquirer/other npm packages to test display logic

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:46.699Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.699Z
Learning: Applies to **/*.test.js : For task file operations in tests: use test-specific file paths (e.g., 'test-tasks.json'); mock `readJSON` and `writeJSON` to avoid real file system interactions; verify file operations use correct paths; use different paths for each test; verify modifications on in-memory task objects passed to `writeJSON`.

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to **/{utils,utilities}/**/*.{js,ts} : Implement reusable task finding utilities that support both task and subtask lookups and add context to subtask results

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to scripts/modules/**/*.{js,ts} : Implement complete migration functions for tagged task lists that handle configuration, state file creation, and migration status tracking

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:46.700Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.700Z
Learning: Applies to **/*.test.js : Create simplified test functions instead of complex setups: create simplified versions of complex functions focusing on core logic; remove file system operations, API calls, and external dependencies; pass all dependencies as parameters.

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to mcp-server/src/core/task-master-core.js : Update `task-master-core.js` by importing and re-exporting direct functions and adding them to the directFunctions map

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Calculate and display task completion statistics for the current tag context including total tasks, completed tasks, completion percentage, and subtask completion counts using visual progress indicators

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Implement status update functions that handle both individual tasks and subtasks within the current tag context, considering subtask status when updating parent tasks and suggesting parent task updates when all subtasks are done

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: For each subtask, use task-master to document TDD progress including failing tests written, implementation status, coverage metrics, and test completion with specific numbers of tests and coverage percentages

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Use consistent properties for subtasks (id, title, description, status, dependencies, details) without duplicating parent task properties, maintaining simple numeric IDs unique within the parent task

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Generate appropriate numbers of subtasks based on task complexity analysis, using recommended subtask counts from complexity analysis when available instead of always using default counts

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Filter and display tasks by status within the current tag context, handling subtask display in lists and using consistent table formats

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Include all required task properties (id, title, description, status, dependencies, priority, details, testStrategy, subtasks) in each task object without adding extra properties outside the standard schema

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-21T02:41:13.453Z
Learnt from: rtmcrc
Repo: eyaltoledano/claude-task-master PR: 933
File: scripts/modules/task-manager/expand-all-tasks.js:0-0
Timestamp: 2025-07-21T02:41:13.453Z
Learning: In scripts/modules/task-manager/expand-all-tasks.js, the success flag should always be true when the expansion process completes successfully, even if individual tasks fail due to LLM errors. Failed tasks are designed to be expanded on subsequent iterations, so individual task failures don't constitute overall operation failure.

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:05:23.891Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: assets/AGENTS.md:0-0
Timestamp: 2025-11-24T18:05:23.891Z
Learning: Apply task status values: `pending` (ready), `in-progress` (being worked on), `done` (completed), `deferred` (postponed), `cancelled` (no longer needed), `blocked` (waiting on external factors)

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to src/utils/**/*.ts : Utility functions must achieve 90% statement coverage, 85% branch coverage, and 90% function coverage with tests covering all code paths, edge cases, null/undefined values, and error scenarios

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:01.617Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ui.mdc:0-0
Timestamp: 2025-11-24T18:04:01.617Z
Learning: Applies to scripts/modules/ui.js : Display progress indicators using both numeric and visual representations, such as showing completed tasks count, total tasks, completion percentage, and progress bars together

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Allow numeric subtask IDs to reference other subtasks within the same parent

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Allow numeric subtask IDs to reference other subtasks within the same parent and convert between formats appropriately when needed, avoiding circular dependencies between subtasks

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Support both task and subtask dependencies in cycle detection

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Do not create circular dependencies between subtasks

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Validate that referenced tasks exist before adding dependencies

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:58:07.977Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.977Z
Learning: Applies to scripts/modules/dependency-manager.js : dependency-manager.js should manage task dependencies by handling add/remove/validate/fix operations across tagged task contexts

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Represent task dependencies as arrays of task IDs

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Remove references to non-existent tasks during validation

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Represent task dependencies as arrays of task IDs, using numeric IDs for direct task references and string IDs with dot notation (e.g., '1.2') for subtask references

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Check for and remove references to non-existent tasks during cleanup

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Check for and remove references to non-existent tasks and self-references during cleanup, tracking and reporting changes made during cleanup

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Prevent tasks from depending on themselves, handling both direct and indirect self-dependencies

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:57:14.728Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.728Z
Learning: Applies to tests/unit/ai-providers/*.test.js : Create unit tests in `tests/unit/ai-providers/<provider-name>.test.js` that mock the provider's AI SDK module and test each exported function for correct client instantiation, parameter passing, result handling, and error handling

Applied to files:

  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to **/tests/integration/**/*.test.ts : Place package and app integration tests in `packages/<package-name>/tests/integration/<module>/<file>.test.ts` or `apps/<app-name>/tests/integration/<module>/<file>.test.ts`

Applied to files:

  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/setup/integration.ts : Integration test setup file must connect to Prisma before all tests with prisma.$connect(), disconnect after all tests with prisma.$disconnect(), and provide database cleanup before each test

Applied to files:

  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:46.699Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.699Z
Learning: Applies to **/*.test.js : When testing UI functions: mock console output and verify correct formatting; test conditional output logic; use `toContain()` or `toMatch()` rather than exact `toBe()` for strings with emojis or formatting; create separate tests for different behavior modes; test structure of formatted output rather than exact string matching.

Applied to files:

  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to package.json : package.json scripts must include: 'test', 'test:watch', 'test:coverage', 'test:unit', 'test:integration', 'test:e2e', and 'test:ci' commands for testing framework integration

Applied to files:

  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
🧬 Code graph analysis (2)
apps/cli/src/ui/components/dashboard.component.spec.ts (1)
packages/tm-core/src/common/types/index.ts (1)
  • Subtask (91-95)
packages/tm-core/src/modules/auth/managers/auth-manager.ts (2)
packages/tm-core/src/modules/integration/clients/supabase-client.ts (1)
  • SupabaseAuthClient (15-536)
packages/tm-core/src/modules/auth/services/context-store.ts (1)
  • ContextStore (30-181)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test
🔇 Additional comments (21)
packages/tm-core/src/modules/auth/managers/auth-manager.ts (2)

45-46: LGTM! Singleton pattern correctly prevents refresh token race conditions.

The change from direct instantiation to SupabaseAuthClient.getInstance() ensures all code paths share the same Supabase client, preventing the "refresh_token_already_used" error when multiple clients attempt to refresh simultaneously.


79-85: LGTM! Proper singleton reset chain for test isolation.

The resetInstance() method now correctly resets both ContextStore and SupabaseAuthClient singletons, ensuring clean state between tests.

packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts (5)

1-23: Excellent documentation of the bug scenario.

The file header clearly explains the race condition that occurs when multiple SupabaseAuthClient instances each try to refresh the same token, and how the singleton pattern fixes it.


62-95: LGTM! Robust environment variable handling in setup/teardown.

The beforeEach/afterEach properly:

  • Stores original env values before modification
  • Resets all singletons to ensure test isolation
  • Handles the undefined case correctly when restoring env vars

97-113: LGTM! Proper singleton enforcement validation.

These tests correctly verify that getInstance() returns the same instance across multiple calls, and that getClient() also returns the same underlying Supabase client.


132-175: LGTM! StorageFactory singleton integration properly validated.

The spy-based verification ensures StorageFactory.create calls getInstance() rather than creating its own client instance. The regression guard pattern is effective.


177-217: LGTM! Concurrent access and cross-component sharing properly tested.

The tests verify that multiple rapid getInstance() calls and cross-component access (AuthManager + StorageFactory) all share the same underlying Supabase client.

packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts (6)

1-20: Clear documentation of the refresh token race condition.

The file header effectively explains the bug scenario and how the singleton pattern prevents "refresh_token_already_used" errors.


34-55: Good Map-based mock implementation for session storage.

This mock implementation with actual Map storage is more realistic and allows tests that depend on storage state persistence within a test.


102-121: LGTM! Core singleton validation across managers.

The test correctly verifies that AuthManager and StorageFactory share the same SupabaseAuthClient instance and underlying Supabase client.


123-185: LGTM! Effective mock infrastructure for refresh tracking.

The test demonstrates that with the singleton pattern, a single spy can track all refresh calls across all code paths—something impossible when multiple independent clients existed.


187-231: LGTM! Sequential refresh behavior validated.

This test correctly differentiates between the problematic parallel refresh race condition and legitimate sequential refreshes, which should work correctly.


251-271: LGTM! Core fix validation for shared client identity.

The three-step verification (AuthManager → StorageFactory → direct singleton) confirms that all code paths converge on the same underlying Supabase client, preventing the race condition.

packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts (6)

1-11: Comprehensive documentation for time-based expiration tests.

The file header clearly explains the test objectives: validating singleton pattern prevents duplicate refresh attempts across time-based token expiration scenarios.


56-88: Well-designed helper functions for session creation.

The createSessionExpiringAt and createRefreshedSession helpers correctly create valid Session objects with proper type casting.


110-130: LGTM! Proper fake timer cleanup.

The vi.useRealTimers() call in afterEach ensures fake timers don't leak between tests, preventing flaky test behavior.


132-153: LGTM! Time-based expiration detection validated.

The test correctly demonstrates that fake timers can simulate token expiration by advancing time, which is foundational for the subsequent tests.


277-346: Excellent race condition prevention test.

This test simulates the exact Supabase behavior where the first refresh succeeds and rotates the token, while subsequent refreshes with the old token would fail. The singleton pattern ensures only one refresh path exists, preventing this scenario.


349-410: Valuable real-world scenario simulation.

Testing the exact tm show HAM-1945 command flow (user logs in, token expires after 1 hour, user runs command) provides strong regression protection against the original bug.

apps/cli/src/ui/components/dashboard.component.spec.ts (2)

6-6: LGTM: Import updates follow ESM conventions.

The addition of the .js extension and the updated imports are correct for ESM compatibility.

Also applies to: 12-12


83-84: The review comment is incorrect. The implementation is already fixed and will treat cancelled tasks as complete.

The calculateTaskStatistics function uses isTaskComplete() from @tm/core, which includes 'cancelled' in its TERMINAL_COMPLETE_STATUSES array. This means:

  1. completedCount correctly counts cancelled tasks as complete (line 211 in dashboard.component.ts)
  2. completionPercentage is calculated from completedCount and will show 100% for tasks with statuses of 'done', 'completed', or 'cancelled'
  3. The tests will pass as written—the "bugs" documented in the BUG comments are not actually bugs

The fix is already in place at the core library level (@tm/core/src/common/constants/index.ts), which is the correct design pattern for centralizing status logic.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
packages/tm-core/src/testing/test-mocks.ts (1)

20-25: Consider adding explicit return type for better type safety.

The mock logger factory is clean and well-documented. For improved type safety and IDE support, consider adding an explicit return type annotation.

-export const createMockLogger = () => ({
+export const createMockLogger = (): {
+	warn: () => void;
+	info: () => void;
+	debug: () => void;
+	error: () => void;
+} => ({
 	warn: () => {},
 	info: () => {},
 	debug: () => {},
 	error: () => {}
 });
apps/cli/src/ui/components/dashboard.component.spec.ts (1)

6-53: Local helpers are clean; consider tightening Task typing and avoiding as cast

The new createTestTask/createTestSubtask helpers keep the specs focused and readable. One small refinement:

  • createTestTask currently coerces id to a string and then forces the whole object to Task via as Task. If Task['id'] is not actually a string (or later changes), this can silently drift from the real type.

You can keep the convenience while preserving type-safety like this:

-const createTestTask = (
-	overrides: Omit<Partial<Task>, 'id'> & { id: number | string }
-): Task => {
-	const { id, ...rest } = overrides;
-	return {
-		title: '',
-		description: '',
-		status: 'pending',
-		priority: 'medium',
-		dependencies: [],
-		details: '',
-		testStrategy: '',
-		subtasks: [],
-		...rest,
-		id: String(id)
-	} as Task;
-};
+const createTestTask = (
+	overrides: Partial<Omit<Task, 'id'>> & Pick<Task, 'id'>
+): Task => {
+	const { id, ...rest } = overrides;
+	return {
+		title: '',
+		description: '',
+		status: 'pending',
+		priority: 'medium',
+		dependencies: [],
+		details: '',
+		testStrategy: '',
+		subtasks: [],
+		...rest,
+		id
+	};
+};

This keeps the helper minimal but ensures id always matches whatever Task['id'] is in @tm/core and removes the unsafe cast.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 408b064 and e04a633.

📒 Files selected for processing (7)
  • apps/cli/src/ui/components/dashboard.component.spec.ts (8 hunks)
  • packages/tm-core/src/testing/auth-mocks.ts (1 hunks)
  • packages/tm-core/src/testing/index.ts (2 hunks)
  • packages/tm-core/src/testing/test-mocks.ts (1 hunks)
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts (1 hunks)
  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts (1 hunks)
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/tm-core/tests/integration/auth/supabase-client-singleton.test.ts
🧰 Additional context used
📓 Path-based instructions (12)
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

TypeScript test files must achieve minimum code coverage thresholds: 80% lines/functions and 70% branches globally, 90% for utilities, and 85% for middleware; new features must meet or exceed these thresholds

Files:

  • packages/tm-core/src/testing/test-mocks.ts
  • packages/tm-core/src/testing/index.ts
  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
  • packages/tm-core/src/testing/auth-mocks.ts
**/*.{js,ts}

📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)

**/*.{js,ts}: Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic
Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call
Do not add direct console.log calls outside the logging utility - use the central log function instead
Ensure silent mode is disabled in a finally block to prevent it from staying enabled
Do not access the global silentMode variable directly - use the exported silent mode control functions instead
Do not duplicate task ID formatting logic across modules - centralize formatting utilities
Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context
Use FuzzyTaskSearch class from utils/fuzzyTaskSearch.js for automatic task relevance detection with configurable search parameters
Use fuzzy search to supplement user-provided task IDs and display discovered task IDs to users for transparency
Do not replace explicit user task selections with fuzzy results - fuzzy search should supplement, not replace user selections
Use readJSON and writeJSON utilities for all JSON file operations instead of raw fs.readFileSync or fs.writeFileSync
Include error handling for JSON file operations and validate JSON structure after reading
Use path.join() for cross-platform path construction and path.resolve() for absolute paths, validating paths before file operations
Support both .env files and MCP session environment for environment variable resolution with fallbacks for missing values
Prefer updating the core function to accept an outputFormat parameter and check outputFormat === 'json' before displaying UI elements

Files:

  • packages/tm-core/src/testing/test-mocks.ts
  • packages/tm-core/src/testing/index.ts
  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
  • packages/tm-core/src/testing/auth-mocks.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Import modules with .js extension even in TypeScript source files for ESM compatibility

Files:

  • packages/tm-core/src/testing/test-mocks.ts
  • packages/tm-core/src/testing/index.ts
  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
  • packages/tm-core/src/testing/auth-mocks.ts
**/*.test.{js,ts}

📄 CodeRabbit inference engine (.cursor/rules/new_features.mdc)

**/*.test.{js,ts}: Follow the mock-first-then-import pattern for Jest mocking; use jest.spyOn() for spy functions; clear mocks between tests; verify mocks with the pattern described in tests.mdc
Test new features with both legacy and tagged task data formats; verify tag resolution behavior; test migration compatibility; ensure pre-migration projects are handled correctly

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
**/*.test.ts

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

Unit tests must follow the describe/it pattern, use beforeEach for mock setup with jest.clearAllMocks(), include specific assertions with expect(), and test both success and error scenarios including edge cases

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
**/tests/integration/**/*.test.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Place package and app integration tests in packages/<package-name>/tests/integration/<module>/<file>.test.ts or apps/<app-name>/tests/integration/<module>/<file>.test.ts

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
**/*.{spec,test}.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{spec,test}.ts: Always use .ts for TypeScript tests, never .js
NEVER use async/await in test functions unless testing actual asynchronous operations; use synchronous top-level imports instead of dynamic await import()

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
packages/tm-core/**/*.{spec,test}.ts

📄 CodeRabbit inference engine (CLAUDE.md)

In unit tests for @tm/core, mock only external I/O (Supabase, APIs, filesystem) and use real internal services

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
**/tests/integration/**/*.{spec,test}.ts

📄 CodeRabbit inference engine (CLAUDE.md)

In integration tests, use real tm-core and mock only external boundaries (APIs, DB, filesystem)

Files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
**/*.spec.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Place package and app test files in packages/<package-name>/src/<module>/<file>.spec.ts or apps/<app-name>/src/<module>/<file>.spec.ts alongside source files

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
apps/cli/**/*.{spec,test}.ts

📄 CodeRabbit inference engine (CLAUDE.md)

In unit tests for apps/cli, mock tm-core responses but use real Commander/chalk/inquirer/other npm packages to test display logic

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
apps/cli/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

CLI (@tm/cli) should be a thin presentation layer that calls tm-core methods and displays results; handle only CLI-specific concerns like argument parsing, output formatting, and user prompts

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
🧠 Learnings (61)
📓 Common learnings
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/git_workflow.mdc:0-0
Timestamp: 2025-11-24T18:00:23.000Z
Learning: Pull Request descriptions must include: Task Overview, Subtasks Completed (checklist), Implementation Details, Testing approach, Breaking Changes (if any), and Related Tasks.
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Use established mocking patterns from auth.test.ts as templates: mock bcrypt with proper TypeScript typing, mock Prisma client with transaction support, and always clear mocks between tests
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to **/*.integration.test.ts : Integration tests must use supertest for API endpoint testing, verify database state changes after operations, clean test data before each test, and include full request/response validation with expected HTTP status codes
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/fixtures/**/*.ts : Test fixture files must export reusable test data creators and constants (createTestUser, adminUser, invalidUser, etc.) for use across unit, integration, and e2e tests to ensure consistency
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/setup.ts : Create global test setup file that configures jest.setTimeout(10000), clears all mocks after each test with jest.clearAllMocks(), and initializes global test configuration
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/setup/integration.ts : Integration test setup file must connect to Prisma before all tests with prisma.$connect(), disconnect after all tests with prisma.$disconnect(), and provide database cleanup before each test
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1069
File: .changeset/fix-tag-complexity-detection.md:0-0
Timestamp: 2025-08-02T15:33:22.656Z
Learning: For changeset files (.changeset/*.md), Crunchyman-ralph prefers to ignore formatting nitpicks about blank lines between frontmatter and descriptions, as he doesn't mind having them and wants to avoid such comments in future reviews.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1200
File: src/ai-providers/custom-sdk/grok-cli/language-model.js:96-100
Timestamp: 2025-09-19T16:06:42.182Z
Learning: The user Crunchyman-ralph prefers to keep environment variable names explicit (like GROK_CLI_API_KEY) rather than supporting multiple aliases, to avoid overlap and ensure clear separation between different CLI implementations.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: scripts/modules/supported-models.json:242-254
Timestamp: 2025-08-08T11:33:15.297Z
Learning: Preference: In scripts/modules/supported-models.json, the "name" field is optional. For OpenAI entries (e.g., "gpt-5"), Crunchyman-ralph prefers omitting "name" when the id is explicit enough; avoid nitpicks requesting a "name" in such cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/subpath-exports.test.ts:6-9
Timestamp: 2025-09-03T12:45:30.724Z
Learning: The user Crunchyman-ralph prefers to avoid overly nitpicky or detailed suggestions in code reviews, especially for test coverage of minor import paths. Focus on more substantial issues rather than comprehensive coverage of all possible edge cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1217
File: apps/cli/src/index.ts:16-21
Timestamp: 2025-09-18T16:35:35.147Z
Learning: The user Crunchyman-ralph considers suggestions to export types for better ergonomics (like exporting UpdateInfo type alongside related functions) as nitpicky and prefers not to implement such suggestions.
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to packages/tm-core/**/*.{spec,test}.ts : In unit tests for tm/core, mock only external I/O (Supabase, APIs, filesystem) and use real internal services

Applied to files:

  • packages/tm-core/src/testing/test-mocks.ts
  • packages/tm-core/src/testing/index.ts
  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
  • packages/tm-core/src/testing/auth-mocks.ts
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to apps/cli/**/*.{spec,test}.ts : In unit tests for apps/cli, mock tm-core responses but use real Commander/chalk/inquirer/other npm packages to test display logic

Applied to files:

  • packages/tm-core/src/testing/test-mocks.ts
  • packages/tm-core/src/testing/index.ts
  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
📚 Learning: 2025-11-24T18:03:46.699Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.699Z
Learning: Applies to **/*.test.js : Mock file system operations using `mock-fs` library. Mock API calls by providing jest.fn() implementations that return expected structures. Mock environment variables in test setup.

Applied to files:

  • packages/tm-core/src/testing/test-mocks.ts
  • packages/tm-core/src/testing/index.ts
  • packages/tm-core/src/testing/auth-mocks.ts
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to **/tests/integration/**/*.{spec,test}.ts : In integration tests, use real tm-core and mock only external boundaries (APIs, DB, filesystem)

Applied to files:

  • packages/tm-core/src/testing/test-mocks.ts
  • packages/tm-core/src/testing/index.ts
  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
  • packages/tm-core/src/testing/auth-mocks.ts
📚 Learning: 2025-11-24T18:03:46.700Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.700Z
Learning: Applies to **/*.test.js : Do not import or instantiate real AI service clients. Create fully mocked versions that return predictable responses. Mock the entire module with controlled behavior.

Applied to files:

  • packages/tm-core/src/testing/test-mocks.ts
  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
  • packages/tm-core/src/testing/auth-mocks.ts
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to apps/mcp/**/*.{spec,test}.ts : In unit tests for apps/mcp, mock tm-core responses but use real MCP framework to test response formatting

Applied to files:

  • packages/tm-core/src/testing/test-mocks.ts
  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
  • packages/tm-core/src/testing/auth-mocks.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Use established mocking patterns from auth.test.ts as templates: mock bcrypt with proper TypeScript typing, mock Prisma client with transaction support, and always clear mocks between tests

Applied to files:

  • packages/tm-core/src/testing/test-mocks.ts
  • packages/tm-core/src/testing/index.ts
  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
  • packages/tm-core/src/testing/auth-mocks.ts
📚 Learning: 2025-11-24T18:03:46.700Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.700Z
Learning: Applies to **/*.test.js : For modules with initialization-dependent functions in tests: create test-specific implementations that initialize all variables correctly; use factory functions in mocks to ensure proper initialization order; be careful with how you mock functions that depend on module state.

Applied to files:

  • packages/tm-core/src/testing/test-mocks.ts
  • packages/tm-core/src/testing/index.ts
  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
  • packages/tm-core/src/testing/auth-mocks.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/setup.ts : Create global test setup file that configures jest.setTimeout(10000), clears all mocks after each test with jest.clearAllMocks(), and initializes global test configuration

Applied to files:

  • packages/tm-core/src/testing/test-mocks.ts
  • packages/tm-core/src/testing/index.ts
  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/src/testing/auth-mocks.ts
📚 Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to **/*.test.{js,ts} : Follow the mock-first-then-import pattern for Jest mocking; use jest.spyOn() for spy functions; clear mocks between tests; verify mocks with the pattern described in `tests.mdc`

Applied to files:

  • packages/tm-core/src/testing/test-mocks.ts
  • packages/tm-core/src/testing/auth-mocks.ts
📚 Learning: 2025-11-24T18:03:46.699Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.699Z
Learning: Applies to **/*.test.js : Use `jest.mock()` before any imports. Jest hoists mock calls to the top of the file. Always declare mocks before importing modules being tested. Use factory pattern for complex mocks that need access to other variables.

Applied to files:

  • packages/tm-core/src/testing/test-mocks.ts
📚 Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to mcp-server/src/**/*.{js,ts} : Use createLogWrapper(log) to create a logger object wrapper with standard methods mapping to the passed MCP log object's methods

Applied to files:

  • packages/tm-core/src/testing/test-mocks.ts
📚 Learning: 2025-11-24T17:58:07.977Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.977Z
Learning: Each module should have well-defined exports that can be mocked in tests

Applied to files:

  • packages/tm-core/src/testing/test-mocks.ts
  • packages/tm-core/src/testing/index.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/fixtures/**/*.ts : Test fixture files must export reusable test data creators and constants (createTestUser, adminUser, invalidUser, etc.) for use across unit, integration, and e2e tests to ensure consistency

Applied to files:

  • packages/tm-core/src/testing/index.ts
  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
  • packages/tm-core/src/testing/auth-mocks.ts
📚 Learning: 2025-10-08T19:57:00.982Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1282
File: packages/tm-core/src/utils/index.ts:16-34
Timestamp: 2025-10-08T19:57:00.982Z
Learning: For the tm-core package in the eyaltoledano/claude-task-master repository, the team prefers a minimal, need-based export strategy in index files rather than exposing all internal utilities. Exports should only be added when functions are actually consumed by other packages in the monorepo.

Applied to files:

  • packages/tm-core/src/testing/index.ts
📚 Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to **/{utils,utilities}/**/*.{js,ts} : Export all utility functions explicitly in logical groups and include configuration constants from utility modules

Applied to files:

  • packages/tm-core/src/testing/index.ts
📚 Learning: 2025-09-26T19:05:47.555Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1252
File: packages/ai-sdk-provider-grok-cli/package.json:11-13
Timestamp: 2025-09-26T19:05:47.555Z
Learning: In the eyaltoledano/claude-task-master repository, internal tm/ packages use a specific export pattern where the "exports" field points to TypeScript source files (./src/index.ts) while "main" points to compiled output (./dist/index.js) and "types" points to source files (./src/index.ts). This pattern is used consistently across internal packages like tm/core and tm/ai-sdk-provider-grok-cli because they are consumed directly during build-time bundling with tsdown rather than being published as separate packages.

Applied to files:

  • packages/tm-core/src/testing/index.ts
📚 Learning: 2025-11-24T18:03:46.699Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.699Z
Learning: Applies to tests/fixtures/**/* : Provide reusable test data in fixtures located in `tests/fixtures/`. Keep fixtures small and representative, export fixtures as named exports for reuse.

Applied to files:

  • packages/tm-core/src/testing/index.ts
📚 Learning: 2025-11-24T18:03:46.699Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.699Z
Learning: Applies to **/*.test.js : For task file operations in tests: use test-specific file paths (e.g., 'test-tasks.json'); mock `readJSON` and `writeJSON` to avoid real file system interactions; verify file operations use correct paths; use different paths for each test; verify modifications on in-memory task objects passed to `writeJSON`.

Applied to files:

  • packages/tm-core/src/testing/index.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to **/*.test.{js,ts} : Test new features with both legacy and tagged task data formats; verify tag resolution behavior; test migration compatibility; ensure pre-migration projects are handled correctly

Applied to files:

  • packages/tm-core/src/testing/index.ts
  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:46.700Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.700Z
Learning: Applies to **/*.test.js : Create simplified test functions instead of complex setups: create simplified versions of complex functions focusing on core logic; remove file system operations, API calls, and external dependencies; pass all dependencies as parameters.

Applied to files:

  • packages/tm-core/src/testing/index.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to **/{utils,utilities}/**/*.{js,ts} : Implement reusable task finding utilities that support both task and subtask lookups and add context to subtask results

Applied to files:

  • packages/tm-core/src/testing/index.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:00.042Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/context_gathering.mdc:0-0
Timestamp: 2025-11-24T17:59:00.042Z
Learning: Applies to scripts/modules/utils/{contextGatherer,fuzzyTaskSearch}.js : Export utility modules using named exports: `ContextGatherer`, `createContextGatherer` from contextGatherer.js and `FuzzyTaskSearch`, `PURPOSE_CATEGORIES`, `RELEVANCE_THRESHOLDS` from fuzzyTaskSearch.js

Applied to files:

  • packages/tm-core/src/testing/index.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to **/*.integration.test.ts : Integration tests must use supertest for API endpoint testing, verify database state changes after operations, clean test data before each test, and include full request/response validation with expected HTTP status codes

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/e2e/**/*.test.ts : End-to-end tests must test complete user workflows across multiple API endpoints in sequence, verify state changes between workflow steps, use extended timeouts (30000ms), and validate final outcomes without mocking business logic

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-10-15T14:43:40.410Z
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1314
File: packages/tm-core/src/auth/credential-store.ts:92-94
Timestamp: 2025-10-15T14:43:40.410Z
Learning: In the claude-task-master codebase, `getCredentials()` in `credential-store.ts` defaults to `allowExpired: true` to enable Supabase refresh flows. The Supabase client automatically handles token refresh when credentials are expired but have a valid refresh token. The `SupabaseSessionStorage` updates the credentials after Supabase performs the refresh. This is an intentional design pattern where the credential store is passive storage and Supabase manages the active token lifecycle.

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:46.699Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.699Z
Learning: Applies to tests/integration/**/*.test.js : Locate integration tests in `tests/integration/` directory. Test interactions between modules, focus on component interfaces rather than implementation details, use more realistic but controlled test environments.

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to src/**/*.ts : Source code must have corresponding test files either colocated (*.test.ts) or in tests/unit/ directory following established patterns from src/utils/auth.test.ts with proper mocking for external dependencies

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
  • packages/tm-core/src/testing/auth-mocks.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to **/*.test.ts : Unit tests must follow the describe/it pattern, use beforeEach for mock setup with jest.clearAllMocks(), include specific assertions with expect(), and test both success and error scenarios including edge cases

Applied to files:

  • packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts
  • apps/cli/src/ui/components/dashboard.component.spec.ts
  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to scripts/modules/**/*.{js,ts} : Implement complete migration functions for tagged task lists that handle configuration, state file creation, and migration status tracking

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to mcp-server/src/core/task-master-core.js : Update `task-master-core.js` by importing and re-exporting direct functions and adding them to the directFunctions map

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Format task files with consistent structure including task metadata (ID, title, status), dependencies with status indicators, and tag context information in the file header

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to **/*.{js,ts} : Do not duplicate task ID formatting logic across modules - centralize formatting utilities

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Calculate and display task completion statistics for the current tag context including total tasks, completed tasks, completion percentage, and subtask completion counts using visual progress indicators

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Implement status update functions that handle both individual tasks and subtasks within the current tag context, considering subtask status when updating parent tasks and suggesting parent task updates when all subtasks are done

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: For each subtask, use task-master to document TDD progress including failing tests written, implementation status, coverage metrics, and test completion with specific numbers of tests and coverage percentages

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Use consistent properties for subtasks (id, title, description, status, dependencies, details) without duplicating parent task properties, maintaining simple numeric IDs unique within the parent task

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Generate appropriate numbers of subtasks based on task complexity analysis, using recommended subtask counts from complexity analysis when available instead of always using default counts

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Filter and display tasks by status within the current tag context, handling subtask display in lists and using consistent table formats

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Include all required task properties (id, title, description, status, dependencies, priority, details, testStrategy, subtasks) in each task object without adding extra properties outside the standard schema

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to src/utils/**/*.ts : Utility functions must achieve 90% statement coverage, 85% branch coverage, and 90% function coverage with tests covering all code paths, edge cases, null/undefined values, and error scenarios

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-21T02:41:13.453Z
Learnt from: rtmcrc
Repo: eyaltoledano/claude-task-master PR: 933
File: scripts/modules/task-manager/expand-all-tasks.js:0-0
Timestamp: 2025-07-21T02:41:13.453Z
Learning: In scripts/modules/task-manager/expand-all-tasks.js, the success flag should always be true when the expansion process completes successfully, even if individual tasks fail due to LLM errors. Failed tasks are designed to be expanded on subsequent iterations, so individual task failures don't constitute overall operation failure.

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:01.617Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ui.mdc:0-0
Timestamp: 2025-11-24T18:04:01.617Z
Learning: Applies to scripts/modules/ui.js : Display progress indicators using both numeric and visual representations, such as showing completed tasks count, total tasks, completion percentage, and progress bars together

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Allow numeric subtask IDs to reference other subtasks within the same parent

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Allow numeric subtask IDs to reference other subtasks within the same parent and convert between formats appropriately when needed, avoiding circular dependencies between subtasks

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Support both task and subtask dependencies in cycle detection

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:58:07.977Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.977Z
Learning: Applies to scripts/modules/dependency-manager.js : dependency-manager.js should manage task dependencies by handling add/remove/validate/fix operations across tagged task contexts

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Represent task dependencies as arrays of task IDs

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Represent task dependencies as arrays of task IDs, using numeric IDs for direct task references and string IDs with dot notation (e.g., '1.2') for subtask references

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Do not create circular dependencies between subtasks

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Validate that referenced tasks exist before adding dependencies

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Check for and remove references to non-existent tasks and self-references during cleanup, tracking and reporting changes made during cleanup

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Check for and remove references to non-existent tasks during cleanup

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Remove references to non-existent tasks during validation

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to **/tests/integration/**/*.test.ts : Place package and app integration tests in `packages/<package-name>/tests/integration/<module>/<file>.test.ts` or `apps/<app-name>/tests/integration/<module>/<file>.test.ts`

Applied to files:

  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T17:57:14.728Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ai_providers.mdc:0-0
Timestamp: 2025-11-24T17:57:14.728Z
Learning: Applies to tests/unit/ai-providers/*.test.js : Create unit tests in `tests/unit/ai-providers/<provider-name>.test.js` that mock the provider's AI SDK module and test each exported function for correct client instantiation, parameter passing, result handling, and error handling

Applied to files:

  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:46.699Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.699Z
Learning: Applies to **/*.test.js : When testing UI functions: mock console output and verify correct formatting; test conditional output logic; use `toContain()` or `toMatch()` rather than exact `toBe()` for strings with emojis or formatting; create separate tests for different behavior modes; test structure of formatted output rather than exact string matching.

Applied to files:

  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to package.json : package.json scripts must include: 'test', 'test:watch', 'test:coverage', 'test:unit', 'test:integration', 'test:e2e', and 'test:ci' commands for testing framework integration

Applied to files:

  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/setup/integration.ts : Integration test setup file must connect to Prisma before all tests with prisma.$connect(), disconnect after all tests with prisma.$disconnect(), and provide database cleanup before each test

Applied to files:

  • packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts
📚 Learning: 2025-11-24T18:03:46.700Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.700Z
Learning: Applies to **/*.test.js : Clear mocks between tests using `jest.clearAllMocks()` in `beforeEach`. Reset specific mock functions with `mockFn.mockReset()`. Prevent state leakage between tests.

Applied to files:

  • packages/tm-core/src/testing/auth-mocks.ts
🧬 Code graph analysis (3)
packages/tm-core/src/testing/test-mocks.ts (1)
packages/tm-core/src/testing/index.ts (1)
  • createMockLogger (39-39)
apps/cli/src/ui/components/dashboard.component.spec.ts (2)
packages/tm-core/src/common/types/index.ts (1)
  • Subtask (91-95)
apps/cli/src/ui/components/dashboard.component.ts (1)
  • calculateDependencyStatistics (285-352)
packages/tm-core/src/testing/auth-mocks.ts (1)
packages/tm-core/src/testing/index.ts (2)
  • MockSupabaseSessionStorage (35-35)
  • MockSupabaseSessionStorageMinimal (36-36)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Test
🔇 Additional comments (18)
packages/tm-core/tests/integration/auth/auth-token-refresh-singleton.test.ts (6)

1-20: Excellent regression test documentation.

The file header clearly documents the bug scenario being prevented, making it easy for future developers to understand the purpose of these tests.


48-85: LGTM!

Test setup and teardown properly isolate tests by resetting singletons, clearing mocks, and restoring environment variables.


88-106: LGTM!

The test correctly verifies reference equality across AuthManager, StorageFactory, and the singleton, ensuring they share the same underlying Supabase client instance.


108-170: LGTM!

Good test that validates the mock infrastructure works correctly with the singleton pattern. The inline comments clearly explain the test's purpose and relationship to the time-based tests in expired-token-refresh.test.ts.


172-216: LGTM!

Good test distinguishing sequential refreshes (which should work) from concurrent race conditions (which the singleton prevents).


219-257: LGTM!

These tests effectively validate the core singleton guarantees that prevent the refresh token race condition.

packages/tm-core/src/testing/index.ts (1)

18-39: LGTM!

Clean export structure with proper .js extensions for ESM compatibility. The grouped exports make the public API clear and organized.

packages/tm-core/tests/integration/auth/expired-token-refresh.test.ts (6)

1-11: Excellent test documentation.

The file header clearly explains the purpose and what aspects are being verified by these time-based tests.


40-72: LGTM!

Helper functions correctly create session fixtures. createRefreshedSession using Date.now() works correctly with Vitest fake timers.


74-114: LGTM!

Proper test isolation with timer restoration, singleton resets, and environment variable cleanup.


116-155: LGTM!

These tests effectively verify time-based token expiration detection and singleton persistence across time manipulation.


157-330: LGTM!

Comprehensive tests with regression guards that verify StorageFactory uses the singleton pattern. The simulated "refresh_token_already_used" error scenario effectively validates the fix.


333-395: LGTM!

Excellent real-world simulation that reproduces the exact bug scenario. The regression guards ensure StorageFactory continues to use the singleton pattern.

packages/tm-core/src/testing/auth-mocks.ts (2)

22-40: LGTM!

Clean Map-based mock implementation that allows tests to exercise storage behavior when needed.


48-58: Minor: Return type inconsistency with full mock.

getItem() returns Promise<null> vs Promise<string | null> in MockSupabaseSessionStorage. This works fine for the no-op use case but is slightly inconsistent. Not blocking since TypeScript's type system handles this correctly.

apps/cli/src/ui/components/dashboard.component.spec.ts (3)

55-127: Task statistics tests thoroughly cover the cancelled/completed semantics

The four calculateTaskStatistics tests exercise the key combinations (done, completed, cancelled, pending/in‑progress) and assert both counts and percentages, including the “all cancelled” and “no complete” edge cases. This is a solid regression suite for the bug about treating cancelled tasks as complete.


130-179: Subtask statistics tests mirror task semantics correctly

The calculateSubtaskStatistics tests validate that cancelled and completed subtasks contribute to completion, while pending subtasks keep the percentage below 100%. Using createTestSubtask keeps these focused on status behavior without extra noise. No issues spotted here.


182-230: Dependency statistics tests look good; verify dependency ID representation

The calculateDependencyStatistics tests correctly cover:

  • Cancelled/ completed dependencies unblocking dependents.
  • Multiple tasks sharing a cancelled dependency being counted as ready.

One thing to double‑check: in these tests, both id and dependencies are strings like '1'/'14'. If in @tm/core the canonical representation for task‑to‑task dependencies is numeric IDs (with strings only for subtask references like '1.2'), you might want to switch these to numeric IDs to mirror production data more closely:

-	createTestTask({ id: 14, status: 'cancelled' }),
-	createTestTask({ id: 15, status: 'pending', dependencies: ['14'] })
+	createTestTask({ id: 14, status: 'cancelled' }),
+	createTestTask({ id: 15, status: 'pending', dependencies: [14] })

Same idea for the later dependency tests. If Task['id'] and dependencies are already string‑typed in core, then the current tests are perfectly aligned and no change is needed.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
apps/cli/src/ui/components/dashboard.component.spec.ts (2)

14-49: Well-designed test helpers improve test readability.

The createTestTask and createTestSubtask helpers provide clean, minimal test data construction focused on the fields needed for statistics calculations. The required id parameter and sensible defaults make tests more maintainable.

Optional refinements:

  1. Consider shared fixtures for reusability: Based on learnings, test fixture creators should be exported from tests/fixtures/**/*.ts for consistency across unit, integration, and e2e tests. If these helpers will be reused in other dashboard-related tests, consider moving them to a shared fixture file.

  2. Consider flexible id type in createTestSubtask: The Subtask type allows id: number | string, but the helper only accepts string. While the current usage is consistent (all tests use string IDs), accepting number | string would provide more flexibility for edge-case testing.


179-195: Make assertion more specific for better test precision.

Line 194 uses toBeGreaterThan(0) when the expected value should be exactly 1 (only task 15 is pending with satisfied dependencies). Specific assertions provide better regression detection compared to range checks.

Apply this diff to improve assertion precision:

-			expect(stats.tasksReadyToWork).toBeGreaterThan(0);
+			expect(stats.tasksReadyToWork).toBe(1);
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e04a633 and c3aa8c4.

📒 Files selected for processing (2)
  • apps/cli/src/ui/components/dashboard.component.spec.ts (8 hunks)
  • packages/tm-core/src/testing/test-mocks.ts (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/tm-core/src/testing/test-mocks.ts
🧰 Additional context used
📓 Path-based instructions (7)
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

TypeScript test files must achieve minimum code coverage thresholds: 80% lines/functions and 70% branches globally, 90% for utilities, and 85% for middleware; new features must meet or exceed these thresholds

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
**/*.{js,ts}

📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)

**/*.{js,ts}: Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic
Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call
Do not add direct console.log calls outside the logging utility - use the central log function instead
Ensure silent mode is disabled in a finally block to prevent it from staying enabled
Do not access the global silentMode variable directly - use the exported silent mode control functions instead
Do not duplicate task ID formatting logic across modules - centralize formatting utilities
Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context
Use FuzzyTaskSearch class from utils/fuzzyTaskSearch.js for automatic task relevance detection with configurable search parameters
Use fuzzy search to supplement user-provided task IDs and display discovered task IDs to users for transparency
Do not replace explicit user task selections with fuzzy results - fuzzy search should supplement, not replace user selections
Use readJSON and writeJSON utilities for all JSON file operations instead of raw fs.readFileSync or fs.writeFileSync
Include error handling for JSON file operations and validate JSON structure after reading
Use path.join() for cross-platform path construction and path.resolve() for absolute paths, validating paths before file operations
Support both .env files and MCP session environment for environment variable resolution with fallbacks for missing values
Prefer updating the core function to accept an outputFormat parameter and check outputFormat === 'json' before displaying UI elements

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
**/*.spec.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Place package and app test files in packages/<package-name>/src/<module>/<file>.spec.ts or apps/<app-name>/src/<module>/<file>.spec.ts alongside source files

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
**/*.{spec,test}.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{spec,test}.ts: Always use .ts for TypeScript tests, never .js
NEVER use async/await in test functions unless testing actual asynchronous operations; use synchronous top-level imports instead of dynamic await import()

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Import modules with .js extension even in TypeScript source files for ESM compatibility

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
apps/cli/**/*.{spec,test}.ts

📄 CodeRabbit inference engine (CLAUDE.md)

In unit tests for apps/cli, mock tm-core responses but use real Commander/chalk/inquirer/other npm packages to test display logic

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
apps/cli/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

CLI (@tm/cli) should be a thin presentation layer that calls tm-core methods and displays results; handle only CLI-specific concerns like argument parsing, output formatting, and user prompts

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
🧠 Learnings (37)
📓 Common learnings
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/git_workflow.mdc:0-0
Timestamp: 2025-11-24T18:00:23.000Z
Learning: Pull Request descriptions must include: Task Overview, Subtasks Completed (checklist), Implementation Details, Testing approach, Breaking Changes (if any), and Related Tasks.
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Use established mocking patterns from auth.test.ts as templates: mock bcrypt with proper TypeScript typing, mock Prisma client with transaction support, and always clear mocks between tests
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to **/*.integration.test.ts : Integration tests must use supertest for API endpoint testing, verify database state changes after operations, clean test data before each test, and include full request/response validation with expected HTTP status codes
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/fixtures/**/*.ts : Test fixture files must export reusable test data creators and constants (createTestUser, adminUser, invalidUser, etc.) for use across unit, integration, and e2e tests to ensure consistency
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/setup.ts : Create global test setup file that configures jest.setTimeout(10000), clears all mocks after each test with jest.clearAllMocks(), and initializes global test configuration
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/setup/integration.ts : Integration test setup file must connect to Prisma before all tests with prisma.$connect(), disconnect after all tests with prisma.$disconnect(), and provide database cleanup before each test
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to **/tests/integration/**/*.{spec,test}.ts : In integration tests, use real tm-core and mock only external boundaries (APIs, DB, filesystem)
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to packages/tm-core/**/*.{spec,test}.ts : In unit tests for tm/core, mock only external I/O (Supabase, APIs, filesystem) and use real internal services
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1069
File: .changeset/fix-tag-complexity-detection.md:0-0
Timestamp: 2025-08-02T15:33:22.656Z
Learning: For changeset files (.changeset/*.md), Crunchyman-ralph prefers to ignore formatting nitpicks about blank lines between frontmatter and descriptions, as he doesn't mind having them and wants to avoid such comments in future reviews.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1200
File: src/ai-providers/custom-sdk/grok-cli/language-model.js:96-100
Timestamp: 2025-09-19T16:06:42.182Z
Learning: The user Crunchyman-ralph prefers to keep environment variable names explicit (like GROK_CLI_API_KEY) rather than supporting multiple aliases, to avoid overlap and ensure clear separation between different CLI implementations.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: scripts/modules/supported-models.json:242-254
Timestamp: 2025-08-08T11:33:15.297Z
Learning: Preference: In scripts/modules/supported-models.json, the "name" field is optional. For OpenAI entries (e.g., "gpt-5"), Crunchyman-ralph prefers omitting "name" when the id is explicit enough; avoid nitpicks requesting a "name" in such cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/subpath-exports.test.ts:6-9
Timestamp: 2025-09-03T12:45:30.724Z
Learning: The user Crunchyman-ralph prefers to avoid overly nitpicky or detailed suggestions in code reviews, especially for test coverage of minor import paths. Focus on more substantial issues rather than comprehensive coverage of all possible edge cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1217
File: apps/cli/src/index.ts:16-21
Timestamp: 2025-09-18T16:35:35.147Z
Learning: The user Crunchyman-ralph considers suggestions to export types for better ergonomics (like exporting UpdateInfo type alongside related functions) as nitpicky and prefers not to implement such suggestions.
📚 Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to **/*.test.{js,ts} : Test new features with both legacy and tagged task data formats; verify tag resolution behavior; test migration compatibility; ensure pre-migration projects are handled correctly

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:46.699Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.699Z
Learning: Applies to **/*.test.js : For task file operations in tests: use test-specific file paths (e.g., 'test-tasks.json'); mock `readJSON` and `writeJSON` to avoid real file system interactions; verify file operations use correct paths; use different paths for each test; verify modifications on in-memory task objects passed to `writeJSON`.

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:46.700Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.700Z
Learning: Applies to **/*.test.js : Create simplified test functions instead of complex setups: create simplified versions of complex functions focusing on core logic; remove file system operations, API calls, and external dependencies; pass all dependencies as parameters.

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/fixtures/**/*.ts : Test fixture files must export reusable test data creators and constants (createTestUser, adminUser, invalidUser, etc.) for use across unit, integration, and e2e tests to ensure consistency

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to scripts/modules/**/*.{js,ts} : Implement complete migration functions for tagged task lists that handle configuration, state file creation, and migration status tracking

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to **/*.integration.test.ts : Integration tests must use supertest for API endpoint testing, verify database state changes after operations, clean test data before each test, and include full request/response validation with expected HTTP status codes

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to **/tests/integration/**/*.{spec,test}.ts : In integration tests, use real tm-core and mock only external boundaries (APIs, DB, filesystem)

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:46.700Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.700Z
Learning: Applies to **/*.test.js : Do not import or instantiate real AI service clients. Create fully mocked versions that return predictable responses. Mock the entire module with controlled behavior.

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:00:23.000Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/git_workflow.mdc:0-0
Timestamp: 2025-11-24T18:00:23.000Z
Learning: Test commits should be separate from feature commits and follow the format: `test(task-X): [Description]` with details about unit tests, integration tests, coverage metrics, and task reference.

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to apps/cli/**/*.{spec,test}.ts : In unit tests for apps/cli, mock tm-core responses but use real Commander/chalk/inquirer/other npm packages to test display logic

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Calculate and display task completion statistics for the current tag context including total tasks, completed tasks, completion percentage, and subtask completion counts using visual progress indicators

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Implement status update functions that handle both individual tasks and subtasks within the current tag context, considering subtask status when updating parent tasks and suggesting parent task updates when all subtasks are done

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: For each subtask, use task-master to document TDD progress including failing tests written, implementation status, coverage metrics, and test completion with specific numbers of tests and coverage percentages

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Use consistent properties for subtasks (id, title, description, status, dependencies, details) without duplicating parent task properties, maintaining simple numeric IDs unique within the parent task

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Generate appropriate numbers of subtasks based on task complexity analysis, using recommended subtask counts from complexity analysis when available instead of always using default counts

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Include all required task properties (id, title, description, status, dependencies, priority, details, testStrategy, subtasks) in each task object without adding extra properties outside the standard schema

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Filter and display tasks by status within the current tag context, handling subtask display in lists and using consistent table formats

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to **/{utils,utilities}/**/*.{js,ts} : Implement reusable task finding utilities that support both task and subtask lookups and add context to subtask results

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Format task files with consistent structure including task metadata (ID, title, status), dependencies with status indicators, and tag context information in the file header

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to src/utils/**/*.ts : Utility functions must achieve 90% statement coverage, 85% branch coverage, and 90% function coverage with tests covering all code paths, edge cases, null/undefined values, and error scenarios

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-21T02:41:13.453Z
Learnt from: rtmcrc
Repo: eyaltoledano/claude-task-master PR: 933
File: scripts/modules/task-manager/expand-all-tasks.js:0-0
Timestamp: 2025-07-21T02:41:13.453Z
Learning: In scripts/modules/task-manager/expand-all-tasks.js, the success flag should always be true when the expansion process completes successfully, even if individual tasks fail due to LLM errors. Failed tasks are designed to be expanded on subsequent iterations, so individual task failures don't constitute overall operation failure.

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/e2e/**/*.test.ts : End-to-end tests must test complete user workflows across multiple API endpoints in sequence, verify state changes between workflow steps, use extended timeouts (30000ms), and validate final outcomes without mocking business logic

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:01.617Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ui.mdc:0-0
Timestamp: 2025-11-24T18:04:01.617Z
Learning: Applies to scripts/modules/ui.js : Display progress indicators using both numeric and visual representations, such as showing completed tasks count, total tasks, completion percentage, and progress bars together

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to **/*.test.ts : Unit tests must follow the describe/it pattern, use beforeEach for mock setup with jest.clearAllMocks(), include specific assertions with expect(), and test both success and error scenarios including edge cases

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Allow numeric subtask IDs to reference other subtasks within the same parent

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Allow numeric subtask IDs to reference other subtasks within the same parent and convert between formats appropriately when needed, avoiding circular dependencies between subtasks

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Support both task and subtask dependencies in cycle detection

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:58:07.977Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.977Z
Learning: Applies to scripts/modules/dependency-manager.js : dependency-manager.js should manage task dependencies by handling add/remove/validate/fix operations across tagged task contexts

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Represent task dependencies as arrays of task IDs

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Represent task dependencies as arrays of task IDs, using numeric IDs for direct task references and string IDs with dot notation (e.g., '1.2') for subtask references

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Do not create circular dependencies between subtasks

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Check for and remove references to non-existent tasks and self-references during cleanup, tracking and reporting changes made during cleanup

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Validate that referenced tasks exist before adding dependencies

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to **/{utils,utilities}/**/*.{js,ts} : Detect circular dependencies using DFS and validate task references before operations

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Check for and remove references to non-existent tasks during cleanup

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Remove references to non-existent tasks during validation

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
🧬 Code graph analysis (1)
apps/cli/src/ui/components/dashboard.component.spec.ts (2)
packages/tm-core/src/common/types/index.ts (1)
  • Subtask (91-95)
apps/cli/src/ui/components/dashboard.component.ts (1)
  • calculateDependencyStatistics (285-352)
🔇 Additional comments (2)
apps/cli/src/ui/components/dashboard.component.spec.ts (2)

6-6: LGTM! Correct ESM import pattern.

The imports correctly use the .js extension for ESM compatibility, as required by the coding guidelines for TypeScript files.

Also applies to: 12-12


51-227: Excellent test coverage and structure.

The test suite comprehensively validates that cancelled tasks are treated as complete across all three calculation functions. The tests follow the Arrange-Act-Assert pattern consistently, cover edge cases (all cancelled, none complete, mixed statuses, dependencies), and use helpers effectively for maintainability.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
apps/cli/src/ui/components/dashboard.component.spec.ts (2)

14-49: Well-designed test helpers with good type safety.

The test helpers create minimal task structures with sensible defaults and proper TypeScript typing. The createTestTask function uses Partial<Omit<Task, 'id'>> & Pick<Task, 'id'> to ensure id is always provided, which is excellent type safety. The JSDoc clearly indicates these are local helpers focused on statistics testing.

Consider extracting these helpers to apps/cli/src/testing/fixtures/dashboard-fixtures.ts if other dashboard-related tests would benefit from them. Based on learnings, test fixture files should export reusable creators for consistency across tests.


178-227: Dependency statistics tests verify cancelled tasks satisfy dependencies.

The tests correctly verify that cancelled (and completed) tasks are treated as satisfying dependencies, allowing dependent tasks to be ready for work. The logic aligns with the production code where tasksReadyToWork = tasksWithNoDeps + tasksWithAllDepsSatisfied.

Consider adding a test case for a task with multiple dependencies where only some are cancelled/completed, to verify the every() logic handles mixed dependency states correctly. For example:

it('should block tasks when only some dependencies are complete', () => {
  const tasks: Task[] = [
    createTestTask({ id: '1', status: 'cancelled' }),
    createTestTask({ id: '2', status: 'pending' }),
    createTestTask({ id: '3', status: 'pending', dependencies: ['1', '2'] })
  ];
  
  const stats = calculateDependencyStatistics(tasks);
  
  expect(stats.tasksBlockedByDeps).toBe(1); // Task 3 blocked by pending task 2
  expect(stats.tasksReadyToWork).toBe(1); // Only task 2 is ready
});
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c3aa8c4 and ba883c3.

📒 Files selected for processing (1)
  • apps/cli/src/ui/components/dashboard.component.spec.ts (8 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
**/*.ts

📄 CodeRabbit inference engine (.cursor/rules/test_workflow.mdc)

TypeScript test files must achieve minimum code coverage thresholds: 80% lines/functions and 70% branches globally, 90% for utilities, and 85% for middleware; new features must meet or exceed these thresholds

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
**/*.{js,ts}

📄 CodeRabbit inference engine (.cursor/rules/utilities.mdc)

**/*.{js,ts}: Import and use specific getters from config-manager.js (e.g., getMainProvider(), getLogLevel(), getMainMaxTokens()) to access configuration values needed for application logic
Use isApiKeySet(providerName, session) from config-manager.js to check if a provider's key is available before potentially attempting an AI call
Do not add direct console.log calls outside the logging utility - use the central log function instead
Ensure silent mode is disabled in a finally block to prevent it from staying enabled
Do not access the global silentMode variable directly - use the exported silent mode control functions instead
Do not duplicate task ID formatting logic across modules - centralize formatting utilities
Use ContextGatherer class from utils/contextGatherer.js for AI-powered commands that need project context, supporting tasks, files, custom text, and project tree context
Use FuzzyTaskSearch class from utils/fuzzyTaskSearch.js for automatic task relevance detection with configurable search parameters
Use fuzzy search to supplement user-provided task IDs and display discovered task IDs to users for transparency
Do not replace explicit user task selections with fuzzy results - fuzzy search should supplement, not replace user selections
Use readJSON and writeJSON utilities for all JSON file operations instead of raw fs.readFileSync or fs.writeFileSync
Include error handling for JSON file operations and validate JSON structure after reading
Use path.join() for cross-platform path construction and path.resolve() for absolute paths, validating paths before file operations
Support both .env files and MCP session environment for environment variable resolution with fallbacks for missing values
Prefer updating the core function to accept an outputFormat parameter and check outputFormat === 'json' before displaying UI elements

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
**/*.spec.ts

📄 CodeRabbit inference engine (CLAUDE.md)

Place package and app test files in packages/<package-name>/src/<module>/<file>.spec.ts or apps/<app-name>/src/<module>/<file>.spec.ts alongside source files

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
**/*.{spec,test}.ts

📄 CodeRabbit inference engine (CLAUDE.md)

**/*.{spec,test}.ts: Always use .ts for TypeScript tests, never .js
NEVER use async/await in test functions unless testing actual asynchronous operations; use synchronous top-level imports instead of dynamic await import()

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

Import modules with .js extension even in TypeScript source files for ESM compatibility

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
apps/cli/**/*.{spec,test}.ts

📄 CodeRabbit inference engine (CLAUDE.md)

In unit tests for apps/cli, mock tm-core responses but use real Commander/chalk/inquirer/other npm packages to test display logic

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
apps/cli/src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

CLI (@tm/cli) should be a thin presentation layer that calls tm-core methods and displays results; handle only CLI-specific concerns like argument parsing, output formatting, and user prompts

Files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
🧠 Learnings (35)
📓 Common learnings
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/git_workflow.mdc:0-0
Timestamp: 2025-11-24T18:00:23.000Z
Learning: Pull Request descriptions must include: Task Overview, Subtasks Completed (checklist), Implementation Details, Testing approach, Breaking Changes (if any), and Related Tasks.
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Use established mocking patterns from auth.test.ts as templates: mock bcrypt with proper TypeScript typing, mock Prisma client with transaction support, and always clear mocks between tests
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/fixtures/**/*.ts : Test fixture files must export reusable test data creators and constants (createTestUser, adminUser, invalidUser, etc.) for use across unit, integration, and e2e tests to ensure consistency
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to **/*.integration.test.ts : Integration tests must use supertest for API endpoint testing, verify database state changes after operations, clean test data before each test, and include full request/response validation with expected HTTP status codes
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/setup.ts : Create global test setup file that configures jest.setTimeout(10000), clears all mocks after each test with jest.clearAllMocks(), and initializes global test configuration
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to packages/tm-core/**/*.{spec,test}.ts : In unit tests for tm/core, mock only external I/O (Supabase, APIs, filesystem) and use real internal services
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/setup/integration.ts : Integration test setup file must connect to Prisma before all tests with prisma.$connect(), disconnect after all tests with prisma.$disconnect(), and provide database cleanup before each test
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.700Z
Learning: Applies to **/*.test.js : Create simplified test functions instead of complex setups: create simplified versions of complex functions focusing on core logic; remove file system operations, API calls, and external dependencies; pass all dependencies as parameters.
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to **/tests/integration/**/*.{spec,test}.ts : In integration tests, use real tm-core and mock only external boundaries (APIs, DB, filesystem)
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.700Z
Learning: Applies to **/*.test.js : Do not import or instantiate real AI service clients. Create fully mocked versions that return predictable responses. Mock the entire module with controlled behavior.
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.700Z
Learning: Applies to **/*.test.js : For modules with initialization-dependent functions in tests: create test-specific implementations that initialize all variables correctly; use factory functions in mocks to ensure proper initialization order; be careful with how you mock functions that depend on module state.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/auth/config.ts:5-7
Timestamp: 2025-09-02T21:51:27.921Z
Learning: The user Crunchyman-ralph prefers not to use node: scheme imports (e.g., 'node:os', 'node:path') for Node.js core modules and considers suggestions to change bare imports to node: scheme as too nitpicky.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1069
File: .changeset/fix-tag-complexity-detection.md:0-0
Timestamp: 2025-08-02T15:33:22.656Z
Learning: For changeset files (.changeset/*.md), Crunchyman-ralph prefers to ignore formatting nitpicks about blank lines between frontmatter and descriptions, as he doesn't mind having them and wants to avoid such comments in future reviews.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1132
File: .github/workflows/weekly-metrics-discord.yml:81-93
Timestamp: 2025-08-13T22:10:46.958Z
Learning: Crunchyman-ralph ignores YAML formatting nitpicks about trailing spaces when there's no project-specific YAML formatter configured, preferring to focus on functionality over cosmetic formatting issues.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1200
File: src/ai-providers/custom-sdk/grok-cli/language-model.js:96-100
Timestamp: 2025-09-19T16:06:42.182Z
Learning: The user Crunchyman-ralph prefers to keep environment variable names explicit (like GROK_CLI_API_KEY) rather than supporting multiple aliases, to avoid overlap and ensure clear separation between different CLI implementations.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1105
File: scripts/modules/supported-models.json:242-254
Timestamp: 2025-08-08T11:33:15.297Z
Learning: Preference: In scripts/modules/supported-models.json, the "name" field is optional. For OpenAI entries (e.g., "gpt-5"), Crunchyman-ralph prefers omitting "name" when the id is explicit enough; avoid nitpicks requesting a "name" in such cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1178
File: packages/tm-core/src/subpath-exports.test.ts:6-9
Timestamp: 2025-09-03T12:45:30.724Z
Learning: The user Crunchyman-ralph prefers to avoid overly nitpicky or detailed suggestions in code reviews, especially for test coverage of minor import paths. Focus on more substantial issues rather than comprehensive coverage of all possible edge cases.
Learnt from: Crunchyman-ralph
Repo: eyaltoledano/claude-task-master PR: 1217
File: apps/cli/src/index.ts:16-21
Timestamp: 2025-09-18T16:35:35.147Z
Learning: The user Crunchyman-ralph considers suggestions to export types for better ergonomics (like exporting UpdateInfo type alongside related functions) as nitpicky and prefers not to implement such suggestions.
📚 Learning: 2025-11-24T18:01:44.137Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/new_features.mdc:0-0
Timestamp: 2025-11-24T18:01:44.137Z
Learning: Applies to **/*.test.{js,ts} : Test new features with both legacy and tagged task data formats; verify tag resolution behavior; test migration compatibility; ensure pre-migration projects are handled correctly

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/fixtures/**/*.ts : Test fixture files must export reusable test data creators and constants (createTestUser, adminUser, invalidUser, etc.) for use across unit, integration, and e2e tests to ensure consistency

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:46.699Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.699Z
Learning: Applies to **/*.test.js : For task file operations in tests: use test-specific file paths (e.g., 'test-tasks.json'); mock `readJSON` and `writeJSON` to avoid real file system interactions; verify file operations use correct paths; use different paths for each test; verify modifications on in-memory task objects passed to `writeJSON`.

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to **/tests/integration/**/*.{spec,test}.ts : In integration tests, use real tm-core and mock only external boundaries (APIs, DB, filesystem)

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to apps/cli/**/*.{spec,test}.ts : In unit tests for apps/cli, mock tm-core responses but use real Commander/chalk/inquirer/other npm packages to test display logic

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T22:09:45.426Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T22:09:45.426Z
Learning: Applies to packages/tm-core/**/*.{spec,test}.ts : In unit tests for tm/core, mock only external I/O (Supabase, APIs, filesystem) and use real internal services

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to scripts/modules/**/*.{js,ts} : Implement complete migration functions for tagged task lists that handle configuration, state file creation, and migration status tracking

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:43.949Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/utilities.mdc:0-0
Timestamp: 2025-11-24T18:04:43.949Z
Learning: Applies to **/{utils,utilities}/**/*.{js,ts} : Implement reusable task finding utilities that support both task and subtask lookups and add context to subtask results

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:46.700Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-11-24T18:03:46.700Z
Learning: Applies to **/*.test.js : Create simplified test functions instead of complex setups: create simplified versions of complex functions focusing on core logic; remove file system operations, API calls, and external dependencies; pass all dependencies as parameters.

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to **/*.integration.test.ts : Integration tests must use supertest for API endpoint testing, verify database state changes after operations, clean test data before each test, and include full request/response validation with expected HTTP status codes

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Calculate and display task completion statistics for the current tag context including total tasks, completed tasks, completion percentage, and subtask completion counts using visual progress indicators

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Implement status update functions that handle both individual tasks and subtasks within the current tag context, considering subtask status when updating parent tasks and suggesting parent task updates when all subtasks are done

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: For each subtask, use task-master to document TDD progress including failing tests written, implementation status, coverage metrics, and test completion with specific numbers of tests and coverage percentages

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Use consistent properties for subtasks (id, title, description, status, dependencies, details) without duplicating parent task properties, maintaining simple numeric IDs unique within the parent task

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Generate appropriate numbers of subtasks based on task complexity analysis, using recommended subtask counts from complexity analysis when available instead of always using default counts

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Include all required task properties (id, title, description, status, dependencies, priority, details, testStrategy, subtasks) in each task object without adding extra properties outside the standard schema

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Filter and display tasks by status within the current tag context, handling subtask display in lists and using consistent table formats

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:02:36.361Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/tasks.mdc:0-0
Timestamp: 2025-11-24T18:02:36.361Z
Learning: Applies to scripts/modules/task-manager.js : Format task files with consistent structure including task metadata (ID, title, status), dependencies with status indicators, and tag context information in the file header

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to src/utils/**/*.ts : Utility functions must achieve 90% statement coverage, 85% branch coverage, and 90% function coverage with tests covering all code paths, edge cases, null/undefined values, and error scenarios

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-21T02:41:13.453Z
Learnt from: rtmcrc
Repo: eyaltoledano/claude-task-master PR: 933
File: scripts/modules/task-manager/expand-all-tasks.js:0-0
Timestamp: 2025-07-21T02:41:13.453Z
Learning: In scripts/modules/task-manager/expand-all-tasks.js, the success flag should always be true when the expansion process completes successfully, even if individual tasks fail due to LLM errors. Failed tasks are designed to be expanded on subsequent iterations, so individual task failures don't constitute overall operation failure.

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to tests/e2e/**/*.test.ts : End-to-end tests must test complete user workflows across multiple API endpoints in sequence, verify state changes between workflow steps, use extended timeouts (30000ms), and validate final outcomes without mocking business logic

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:04:01.617Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/ui.mdc:0-0
Timestamp: 2025-11-24T18:04:01.617Z
Learning: Applies to scripts/modules/ui.js : Display progress indicators using both numeric and visual representations, such as showing completed tasks count, total tasks, completion percentage, and progress bars together

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T18:03:13.408Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/test_workflow.mdc:0-0
Timestamp: 2025-11-24T18:03:13.408Z
Learning: Applies to **/*.test.ts : Unit tests must follow the describe/it pattern, use beforeEach for mock setup with jest.clearAllMocks(), include specific assertions with expect(), and test both success and error scenarios including edge cases

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Allow numeric subtask IDs to reference other subtasks within the same parent

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Allow numeric subtask IDs to reference other subtasks within the same parent and convert between formats appropriately when needed, avoiding circular dependencies between subtasks

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Support both task and subtask dependencies in cycle detection

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:58:07.977Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/architecture.mdc:0-0
Timestamp: 2025-11-24T17:58:07.977Z
Learning: Applies to scripts/modules/dependency-manager.js : dependency-manager.js should manage task dependencies by handling add/remove/validate/fix operations across tagged task contexts

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Represent task dependencies as arrays of task IDs

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Represent task dependencies as arrays of task IDs, using numeric IDs for direct task references and string IDs with dot notation (e.g., '1.2') for subtask references

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Do not create circular dependencies between subtasks

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-11-24T17:59:18.633Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-11-24T17:59:18.633Z
Learning: Applies to scripts/modules/dependency-manager.js : Check for and remove references to non-existent tasks and self-references during cleanup, tracking and reporting changes made during cleanup

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Validate that referenced tasks exist before adding dependencies

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Check for and remove references to non-existent tasks during cleanup

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
📚 Learning: 2025-07-18T17:09:40.548Z
Learnt from: CR
Repo: eyaltoledano/claude-task-master PR: 0
File: .cursor/rules/dependencies.mdc:0-0
Timestamp: 2025-07-18T17:09:40.548Z
Learning: Applies to scripts/modules/dependency-manager.js : Remove references to non-existent tasks during validation

Applied to files:

  • apps/cli/src/ui/components/dashboard.component.spec.ts
🧬 Code graph analysis (1)
apps/cli/src/ui/components/dashboard.component.spec.ts (1)
apps/cli/src/ui/components/dashboard.component.ts (1)
  • calculateDependencyStatistics (285-352)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: Build
  • GitHub Check: Typecheck
🔇 Additional comments (3)
apps/cli/src/ui/components/dashboard.component.spec.ts (3)

52-124: Comprehensive test coverage for task statistics bug fix.

The tests thoroughly verify that cancelled tasks are treated as complete in completion percentage calculations. The Arrange/Act/Assert structure with clear comments makes the test intent obvious. All edge cases (all cancelled, no complete, mixed states) are covered.


126-176: Subtask statistics tests correctly verify cancelled behavior.

The tests properly verify that cancelled subtasks are treated as complete, consistent with the task-level behavior. The use of numeric IDs for subtasks is valid per the Subtask interface definition (id: number | string).


6-12: Imports are correctly structured and types are properly exported from @tm/core.

All three types (Subtask, Task, TaskStatus) are properly exported from @tm/core via the wildcard export in packages/tm-core/src/index.ts, which re-exports from packages/tm-core/src/common/types/index.ts. The local imports follow ESM conventions with the .js extension. No issues found.

@Crunchyman-ralph Crunchyman-ralph force-pushed the ralph/fix/auth.refresh.token.regression branch from ba883c3 to 3ece77e Compare November 26, 2025 22:28
@Crunchyman-ralph Crunchyman-ralph merged commit 88d3568 into next Nov 26, 2025
7 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Nov 27, 2025
16 tasks
sfc-gh-dflippo pushed a commit to sfc-gh-dflippo/task-master-ai that referenced this pull request Dec 4, 2025
@coderabbitai coderabbitai bot mentioned this pull request Dec 9, 2025
16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant