Skip to content

fix(desktop): stop dashboard navigation from opening a retired task (#11518) - #11626

Merged
kodjima33 merged 1 commit into
mainfrom
watchdog/issue-11518-task-navigation-retirement
Aug 15, 2026
Merged

kodjima33 merged 1 commit into
mainfrom
watchdog/issue-11518-task-navigation-retirement

Conversation

@kodjima33

@kodjima33 kodjima33 commented Aug 15, 2026 •

Copy link
Copy Markdown
Collaborator

Bug

DashboardIntelligenceStore.taskForNavigation(taskID:) fetched the task detail and returned it with no retirement check at all, so a "What matters now" recommendation minted before its task was cancelled, superseded, or deleted still routed the user to that task.

The user-visible symptom is a silent dead end rather than a stale card: every live Tasks lane filters retired rows out, so the TaskNavigationRequestStore request openRecommendation enqueues can never be consumed — the dashboard switches to the Tasks tab and selects nothing, with no explanation.

Its sibling in the same file, candidateForNavigation, already gates on SuggestedTasksStore.canPresentForNavigation(candidate) and reports "This Suggested item is no longer available." The task path had no equivalent.

Root cause

Retirement is re-derived by each reader instead of being asked of the one authority. TaskActionItem.isRetired exists precisely for this, and its doc comment records why:

/// Server list/detail responses project soft retirement through canonical
/// lifecycle status and may omit the legacy `deleted` field. Keep that
/// projection here so every local cache and surface applies the same rule.
var isRetired: Bool {
  deleted == true || taskStatus == "cancelled" || taskStatus == "superseded"
}

So a raw deleted read is not sufficient on anything straight off the wire, and taskForNavigation did not even do that much.

This is mostly invisible on cache paths because every writer normalizes: ActionItemRecord.from persists deleted: item.isRetired. It is observable only on objects read directly from an API response.

Fix

Cache reads elsewhere are left alone: they are already normalized, and #11518 explicitly warns that deleted is a field on unrelated types, so a blind sweep is not the fix.

Tested

cd desktop/macos
./scripts/dev-feedback.py --once swift 'DashboardIntelligenceStoreTests'
  → Executed 30 tests, with 0 failures  (PASS in 593.66s)

The two new tests execute production behavior through the injected DashboardIntelligenceClient seam, not a source scrape. To prove they are load-bearing, the !task.isRetired guard alone was reverted and they were re-run:

testLegacyDeletedTaskIsNotOpenedByNavigation  failed — deleted: true opened as live
testRetiredTaskIsNotOpenedByNavigation        failed — cancelled and superseded both opened as live
  → Executed 2 tests, with 6 failures

The guard was then restored and the suite re-run green (above).

Not exercised live: reproducing it in the running app needs a server-side task retired between projection mint and click. The seam the fix sits behind is the same one taskForNavigation's existing coverage uses.

Product invariants

None matched — scripts/pr-preflight --suggest reports no invariant citations required for these paths.

Fixes part of #11518.

🤖 automated by hourly watchdog — tested and merged

Failure-Class: none

Review in cubic

`DashboardIntelligenceStore.taskForNavigation` fetched the task detail and
returned it with no retirement check at all, so a "What matters now"
recommendation minted before the task was cancelled, superseded, or deleted
still routed the user to it. Its sibling `candidateForNavigation` already
gates on `SuggestedTasksStore.canPresentForNavigation`; this path had no
equivalent.

The user-visible result was a silent dead end, not a stale card: the live
Tasks lanes filter retired rows out, so `TaskNavigationRequestStore`'s pending
request can never be consumed — the dashboard switches to Tasks and selects
nothing. It now reports "This task is no longer available.", exactly as the
Suggested path does.

`TaskActionItem.isRetired` is the authority the model documents for this:
detail responses may omit legacy `deleted` and state retirement only through
canonical lifecycle status, so a raw `deleted` read is not sufficient. The
same raw read in `ChatFirstShell.taskForFocus` — the only other site that
tests an API response directly rather than a cache row — is corrected with it
(#11518). Cache reads are already normalized: `ActionItemRecord.from` persists
`deleted: item.isRetired`.

Verified (desktop/macos):
- ./scripts/dev-feedback.py --once swift 'DashboardIntelligenceStoreTests'
  → 30 tests, 0 failures.
- Reverted the guard alone and re-ran the two new tests → both fail
  (cancelled, superseded, and legacy `deleted: true` all opened as live),
  so the regression tests execute the fixed behavior rather than restating it.

Failure-Class: none

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 4 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@kodjima33
kodjima33 merged commit 197e699 into main Aug 15, 2026
31 checks passed
@kodjima33
kodjima33 deleted the watchdog/issue-11518-task-navigation-retirement branch August 15, 2026 14:36
@kodjima33

Copy link
Copy Markdown
Collaborator Author

Independently re-verified before merge (not trusting the opening run's claims):

  • dev-feedback.py --once swift 'DashboardIntelligenceStoreTests' on this branch: 30 tests, 0 failures.
  • Proved the new tests are real guards, not tautologies: reverted only the production line (guard task.id == taskID, !task.isRetired → guard task.id == taskID) and re-ran the two new tests — 6 failures; both taskStatus: cancelled/superseded and legacy deleted: true handed the retired task back as a live navigation target with error == nil. Restored the line, suite green again.
  • isRetired is the repo-wide retirement projection (TaskActionItem.swift:92), already used by SpineStore, TasksStore, ChatFirstContentBlockViews and ActionItemStorage — this fix mirrors the existing pattern rather than inventing a check.

CI green (Desktop Swift Static & Test Contracts, Release Compile, Build & Tests). Merging.

🤖 automated by hourly watchdog — tested and merged

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