Skip to content

test: preserve default getTask mock for DUPLICATE recovery#2283

Merged
gsxdsm merged 1 commit into
mainfrom
fix/pr-2275-review-feedback
Jul 18, 2026
Merged

test: preserve default getTask mock for DUPLICATE recovery#2283
gsxdsm merged 1 commit into
mainfrom
fix/pr-2275-review-feedback

Conversation

@gsxdsm

@gsxdsm gsxdsm commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #2275 review feedback: getTask mocks for DUPLICATE recovery tests now return a default current-task fixture for non-canonical IDs instead of undefined.

Context

CodeRabbit on #2275 noted that returning undefined for every id except the canonical task could break recovery if the subject task is re-fetched mid-path.

Test plan

  • triage-split-into-subtasks-delete.test.ts
  • triage-finalize-duplicate-lineage.test.ts

Summary by CodeRabbit

  • Tests
    • Improved duplicate-resolution test coverage by preserving task data during recovery and re-fetch scenarios.
    • Added validation for non-canonical task handling to prevent errors when duplicate tasks are resolved or split.

Address CodeRabbit review: non-canonical getTask lookups should return a
default current-task fixture instead of undefined, so recovery paths that
re-fetch the subject task cannot NPE.
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Duplicate-resolution tests now keep non-canonical task lookups populated with default task objects while preserving canonical task responses, covering recovery re-fetch behavior in lineage finalization and subtask deletion scenarios.

Changes

Duplicate lineage recovery tests

Layer / File(s) Summary
Preserve recovery task mocks
packages/engine/src/__tests__/triage-finalize-duplicate-lineage.test.ts, packages/engine/src/__tests__/triage-split-into-subtasks-delete.test.ts
TaskStore.getTask returns default tasks for non-canonical IDs and canonical tasks for FN-4894 in duplicate-resolution scenarios, with comments documenting the mock behavior.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the change: preserving the default getTask mock for DUPLICATE recovery tests.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pr-2275-review-feedback

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@greptile-apps

greptile-apps Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR preserves current-task fixtures in DUPLICATE recovery tests. The main changes are:

  • Return the canonical FN-4894 task for canonical lookups.
  • Return the current task fixture for other lookups.
  • Keep the split/delete test aligned with its existing store fallback.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
packages/engine/src/tests/triage-finalize-duplicate-lineage.test.ts Updates two DUPLICATE recovery mocks to support canonical and current-task lookups.
packages/engine/src/tests/triage-split-into-subtasks-delete.test.ts Adds a canonical-task response while preserving the store's prior fallback fixture.

Reviews (1): Last reviewed commit: "test: preserve default getTask mock for ..." | Re-trigger Greptile

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/engine/src/__tests__/triage-finalize-duplicate-lineage.test.ts (1)

116-120: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Prefer JSDoc-style comments for FNXC annotations.

As per coding guidelines, use JSDoc-style comments (/** ... */) instead of standard block comments (/* ... */) for FNXC annotations.

  • packages/engine/src/__tests__/triage-finalize-duplicate-lineage.test.ts#L116-L120: Change the comment block opening to /**.
  • packages/engine/src/__tests__/triage-split-into-subtasks-delete.test.ts#L168-L172: Change the comment block opening to /**.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/engine/src/__tests__/triage-finalize-duplicate-lineage.test.ts`
around lines 116 - 120, Update the FNXC annotation comments to use JSDoc-style
openings instead of standard block-comment openings. Change the comment at
packages/engine/src/__tests__/triage-finalize-duplicate-lineage.test.ts lines
116-120 and the corresponding comment at
packages/engine/src/__tests__/triage-split-into-subtasks-delete.test.ts lines
168-172; preserve their existing text and formatting otherwise.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/engine/src/__tests__/triage-finalize-duplicate-lineage.test.ts`:
- Around line 116-120: Update the FNXC annotation comments to use JSDoc-style
openings instead of standard block-comment openings. Change the comment at
packages/engine/src/__tests__/triage-finalize-duplicate-lineage.test.ts lines
116-120 and the corresponding comment at
packages/engine/src/__tests__/triage-split-into-subtasks-delete.test.ts lines
168-172; preserve their existing text and formatting otherwise.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 963af846-a31d-4334-8f8e-857b55d81fdc

📥 Commits

Reviewing files that changed from the base of the PR and between 12e0e39 and fe71f02.

📒 Files selected for processing (2)
  • packages/engine/src/__tests__/triage-finalize-duplicate-lineage.test.ts
  • packages/engine/src/__tests__/triage-split-into-subtasks-delete.test.ts

@gsxdsm
gsxdsm merged commit 57120f3 into main Jul 18, 2026
7 checks passed
@gsxdsm
gsxdsm deleted the fix/pr-2275-review-feedback branch July 18, 2026 07:57
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