Skip to content

Conversation

@Crunchyman-ralph
Copy link
Collaborator

@Crunchyman-ralph Crunchyman-ralph commented Jan 28, 2026

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)

Note

Medium Risk
Touches task complexity report loading/enrichment behavior, which can affect list output for tagged task sets; change is small but in shared core code paths.

Overview
Fixes tagged complexity enrichment (Fixes #1614). ComplexityReportManager.loadReport now uses the resolved tag (defaulting to master) consistently for both cache lookup and report file path resolution, preventing cache/path mismatches when tag is undefined.

Adds a new integration test (complexity-enrichment.test.ts) that reproduces the missing-complexity-in-list scenario for tagged tasks, covers the master default report filename behavior, and verifies the no-report fallback.

Also rolls up release bookkeeping: replaces multiple old changesets with a new @tm/core patch changeset, updates CHANGELOG.md, and bumps versions to 0.43.0 in package.json, package-lock.json, and manifest.json.

Written by Cursor Bugbot for commit 43ee902. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • New Features

    • MCP Bundle support enabling direct Claude Desktop installation of the MCP server.
    • Verbose output mode (-v/--verbose) for loop command showing real-time thinking and tool usage.
    • Optional metadata field for tasks and subtasks with JSON support.
    • --no-banner flag to suppress startup banner.
    • --no-output option to reduce memory usage by excluding full output from iteration results.
  • Bug Fixes

    • Fixed complexity report tag consistency in cache and file path resolution.
  • Improvements

    • Enhanced error handling for incompatible command options.

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

Crunchyman-ralph and others added 3 commits January 27, 2026 16:52
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Ralph Khreish <[email protected]>
- Fix ComplexityReportManager to use resolvedTag consistently
- Add integration test for complexity enrichment with tags
- Ensure cache key and file path use same tag resolution

Fixes #1614

Co-authored-by: Ralph Khreish <[email protected]>
@changeset-bot
Copy link

changeset-bot bot commented Jan 28, 2026

πŸ¦‹ Changeset detected

Latest commit: 43ee902

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 28, 2026

πŸ“ Walkthrough

Walkthrough

This PR bumps the version from 0.42.0 to 0.43.0, consolidates pending changeset entries into the CHANGELOG, removes five changeset files, adds a new changeset for a bug fix, and fixes tag resolution in complexity report loading with accompanying integration tests.

Changes

Cohort / File(s) Summary
Version & Release
manifest.json, package.json, CHANGELOG.md
Version bumped to 0.43.0 across manifest and package files; CHANGELOG.md extended with new 0.43.0 section documenting feature additions (MCPB bundle, verbose loop output, metadata field), patch changes, and usage examples.
Changeset Management
.changeset/add-mcpb-bundle.md, .changeset/add-modifyjson-utils.md, .changeset/cuddly-wings-drop.md, .changeset/fair-heads-report.md, .changeset/task-metadata-field.md, .changeset/complexity-tag-fix.md
Five changeset entries removed (totaling 69 lines) after being merged into CHANGELOG; one new changeset added documenting bug fix for consistent tag resolution in complexity report loading (references issue #1614).
Bug Fix & Tests
packages/tm-core/src/modules/reports/managers/complexity-report-manager.ts, packages/tm-core/tests/integration/storage/complexity-enrichment.test.ts
complexity-report-manager.ts: fixed tag resolution to pass resolved tag (defaulting to 'master' when undefined) to getReportPath for consistency; new integration test added (195 lines) validating complexity enrichment with file-based storage across multiple tag scenarios and missing report cases.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • eyaltoledano
  • maxtuzz
πŸš₯ Pre-merge checks | βœ… 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Title check ⚠️ Warning The title 'Claude/issue 1614 20260128 1839' is a branch name format that does not clearly describe the main change; it lacks meaningful context about the actual fix. Rename the PR title to something descriptive like 'fix: ensure complexity data loads correctly with tags' to reflect the actual bug fix being addressed.
βœ… Passed checks (2 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • πŸ“ Generate docstrings

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: 2

πŸ€– Fix all issues with AI agents
In @.changeset/complexity-tag-fix.md:
- Around line 1-3: The changeset frontmatter currently lists an invalid package
("@tm/core") which breaks CI validation; open .changeset/complexity-tag-fix.md
and update the frontmatter package name value to an allowed package (e.g.,
replace "@tm/core" with "task-master-ai") so the top YAML block references a
valid package; ensure the triple-dash YAML block remains intact and save the
file.

In `@packages/tm-core/tests/integration/storage/complexity-enrichment.test.ts`:
- Around line 1-195: The file fails CI formatting; run the project formatter
(e.g., `biome format .` or the repo's configured formatter) and commit the
result so the test file (the describe/it/beforeEach/afterEach blocks that use
FileStorage, saveTasks, loadTasks) matches the repo style; ensure whitespace,
imports, and trailing newlines are fixed and re-run tests to confirm formatting
is clean before merging.

Comment on lines +1 to +3
---
"@tm/core": patch
---
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Changeset package name breaks validation.

CI reports this changeset references an invalid package. Please switch the frontmatter to an allowed package (likely task-master-ai).

πŸ› οΈ Suggested fix
---
-"@tm/core": patch
+"task-master-ai": patch
---
πŸ“ Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
---
"@tm/core": patch
---
---
"task-master-ai": patch
---
🧰 Tools
πŸͺ› GitHub Actions: CI

[error] 1-1: Changeset validation failed during 'node .github/scripts/validate-changesets.mjs': complexity-tag-fix.md references invalid package '@tm/core'. Only allowed packages: task-master-ai, extension.

πŸ€– Prompt for AI Agents
In @.changeset/complexity-tag-fix.md around lines 1 - 3, The changeset
frontmatter currently lists an invalid package ("@tm/core") which breaks CI
validation; open .changeset/complexity-tag-fix.md and update the frontmatter
package name value to an allowed package (e.g., replace "@tm/core" with
"task-master-ai") so the top YAML block references a valid package; ensure the
triple-dash YAML block remains intact and save the file.

Comment on lines +1 to +195
/**
* @fileoverview Integration test for complexity enrichment in list command
*
* This test reproduces the bug where task complexity is not shown in `list`
* after running `analyze-complexity` with a tag.
*
* Bug: https://github.com/eyaltoledano/claude-task-master/issues/1614
*/

import { describe, it, expect, beforeEach, afterEach } from 'vitest';
import fs from 'node:fs/promises';
import path from 'node:path';
import os from 'node:os';
import { FileStorage } from '../../../src/modules/storage/adapters/file-storage/file-storage.js';
import type { Task, ComplexityReport } from '../../../src/common/types/index.js';

describe('Complexity Enrichment Integration Test', () => {
let tempDir: string;
let storage: FileStorage;

beforeEach(async () => {
// Create a temporary directory for testing
tempDir = await fs.mkdtemp(path.join(os.tmpdir(), 'tm-complexity-test-'));

// Initialize storage
storage = new FileStorage(tempDir);
await storage.initialize();
});

afterEach(async () => {
// Cleanup
await storage.close();
await fs.rm(tempDir, { recursive: true, force: true });
});

it('should enrich tasks with complexity data for tagged tasks', async () => {
const tag = 'foo';

// Step 1: Create tasks with the 'foo' tag
const tasks: Task[] = [
{
id: '1',
title: 'Implement authentication',
description: 'Add JWT-based auth',
status: 'pending',
priority: 'high',
dependencies: [],
subtasks: [],
tags: [tag]
},
{
id: '2',
title: 'Create API endpoints',
description: 'Build REST API',
status: 'pending',
priority: 'medium',
dependencies: [],
subtasks: [],
tags: [tag]
}
];

await storage.saveTasks(tasks, tag);

// Step 2: Create a complexity report for the 'foo' tag
const reportsDir = path.join(tempDir, '.taskmaster', 'reports');
await fs.mkdir(reportsDir, { recursive: true });

const complexityReport: ComplexityReport = {
meta: {
generatedAt: new Date().toISOString(),
tasksAnalyzed: 2,
thresholdScore: 5,
usedResearch: false
},
complexityAnalysis: [
{
taskId: '1',
taskTitle: 'Implement authentication',
complexityScore: 8,
recommendedSubtasks: 5,
complexityReasoning: 'High complexity due to security concerns',
expansionPrompt: 'Break down auth into smaller tasks'
},
{
taskId: '2',
taskTitle: 'Create API endpoints',
complexityScore: 6,
recommendedSubtasks: 4,
complexityReasoning: 'Moderate complexity',
expansionPrompt: 'Split by endpoint functionality'
}
]
};

const reportPath = path.join(reportsDir, `task-complexity-report_${tag}.json`);
await fs.writeFile(reportPath, JSON.stringify(complexityReport, null, 2), 'utf-8');

// Step 3: Load tasks with the tag - complexity should be enriched
const loadedTasks = await storage.loadTasks(tag);

// Verify tasks were loaded
expect(loadedTasks).toHaveLength(2);

// Step 4: Verify complexity data was enriched
const task1 = loadedTasks.find(t => t.id === '1');
const task2 = loadedTasks.find(t => t.id === '2');

expect(task1).toBeDefined();
expect(task2).toBeDefined();

// BUG: These assertions should pass but currently fail
expect(task1!.complexity).toBe(8);
expect(task1!.recommendedSubtasks).toBe(5);
expect(task1!.expansionPrompt).toBe('Break down auth into smaller tasks');

expect(task2!.complexity).toBe(6);
expect(task2!.recommendedSubtasks).toBe(4);
expect(task2!.expansionPrompt).toBe('Split by endpoint functionality');
});

it('should handle master tag complexity enrichment', async () => {
// Test with default 'master' tag (no suffix in report filename)
const tasks: Task[] = [
{
id: '1',
title: 'Setup project',
description: 'Initialize project structure',
status: 'pending',
priority: 'high',
dependencies: [],
subtasks: [],
tags: []
}
];

await storage.saveTasks(tasks);

// Create complexity report for master tag (no suffix)
const reportsDir = path.join(tempDir, '.taskmaster', 'reports');
await fs.mkdir(reportsDir, { recursive: true });

const complexityReport: ComplexityReport = {
meta: {
generatedAt: new Date().toISOString(),
tasksAnalyzed: 1,
thresholdScore: 5,
usedResearch: false
},
complexityAnalysis: [
{
taskId: '1',
taskTitle: 'Setup project',
complexityScore: 3,
recommendedSubtasks: 2,
complexityReasoning: 'Low complexity',
expansionPrompt: 'Simple setup tasks'
}
]
};

const reportPath = path.join(reportsDir, 'task-complexity-report.json');
await fs.writeFile(reportPath, JSON.stringify(complexityReport, null, 2), 'utf-8');

// Load tasks without specifying tag (defaults to master)
const loadedTasks = await storage.loadTasks();

expect(loadedTasks).toHaveLength(1);
expect(loadedTasks[0].complexity).toBe(3);
expect(loadedTasks[0].recommendedSubtasks).toBe(2);
});

it('should return tasks without complexity when no report exists', async () => {
const tag = 'no-report';
const tasks: Task[] = [
{
id: '1',
title: 'Test task',
description: 'A test',
status: 'pending',
priority: 'medium',
dependencies: [],
subtasks: [],
tags: [tag]
}
];

await storage.saveTasks(tasks, tag);
const loadedTasks = await storage.loadTasks(tag);

expect(loadedTasks).toHaveLength(1);
expect(loadedTasks[0].complexity).toBeUndefined();
expect(loadedTasks[0].recommendedSubtasks).toBeUndefined();
});
});
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

CI formatting failure needs to be addressed.

The pipeline reports the formatter would change this file; please run the formatter (e.g., biome format .) before merging.

🧰 Tools
πŸͺ› GitHub Actions: CI

[error] 15-18: Formatter would have printed changes for complexity-enrichment.test.ts. Run the format tool (e.g., biome format .) to fix code style issues.

πŸ€– Prompt for AI Agents
In `@packages/tm-core/tests/integration/storage/complexity-enrichment.test.ts`
around lines 1 - 195, The file fails CI formatting; run the project formatter
(e.g., `biome format .` or the repo's configured formatter) and commit the
result so the test file (the describe/it/beforeEach/afterEach blocks that use
FileStorage, saveTasks, loadTasks) matches the repo style; ensure whitespace,
imports, and trailing newlines are fixed and re-run tests to confirm formatting
is clean before merging.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

expect(task1).toBeDefined();
expect(task2).toBeDefined();

// BUG: These assertions should pass but currently fail
Copy link

Choose a reason for hiding this comment

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

Outdated comment misleadingly describes passing tests as failing

Low Severity

The comment // BUG: These assertions should pass but currently fail is misleading. Since the fix for issue #1614 is included in this same PR, these assertions will pass after the PR merges. The comment reads as if the tests are expected to fail, which could confuse future developers reviewing the test or investigating test failures. The comment documents historical context but is stale by the time this PR lands.

Fix in CursorΒ Fix in Web

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.

2 participants