Migrate to basecamp-sdk TodoListOptions.Completed
Summary
basecamp-sdk PR #279 (merged 2026-04-23, unreleased — no tag past v0.7.3) restructures TodoListOptions:
Statusbecomes lifecycle-only ("archived","trashed", or empty).- A new
Completed boolfield handles the completion filter. - Unsupported
Statusvalues are rejected at the wrapper boundary. Status: ""no longer returns all todos — it now returns incomplete only.
The CLI today encodes the completion filter via Status: "completed" / Status: "pending" and relies on Status: "" returning all todos so listAllTodos can filter client-side. Both assumptions break under the new SDK.
This PR ships the SDK bump and the CLI migration together.
What changed
- SDK bump —
go.mod/go.sum/internal/version/sdk-provenance.jsontov0.7.4-0.20260423230153-f54589f0924a(merge-commit pseudo-version). internal/commands/todos.go— newresolveStatusFilterhelper maps--status {completed,incomplete,archived,trashed}to(sdkStatus, sdkCompleted)and rejects everything else (including legacypending) withErrUsage. Threaded the pair throughrunTodosList→listTodosInList/listAllTodos→fetchTodosIncludingGroups. Deleted theincomplete→pendingcoercion and the cross-list client-side status filter — the server is now the single source of truth on both paths.internal/tui/workspace/data/hub.go—CompletedTodosswitches to{Completed: true}. Behavior fix inHub.Todos: the empty{}now correctly returns only incomplete todos, so the active pane no longer leaks completed ones.internal/tui/empty/messages.go— drop the dead"pending"alias from the empty-state context switch.skills/basecamp/SKILL.md—--statusflag values updated to(completed/incomplete/archived/trashed).- Tests —
todos_test.goextendedstatusCapturingTransportto capture every/todos.jsonrequest's query params and to simulate server-side filtering. Rewrote 3 existing tests, added 8 new ones covering the matrix (single-list × cross-list × completed/archived/trashed, plus bogus andpendingrejection assertingoutput.CodeUsageandtotalCount == 0). WithMaxRetries(0) → (1)sweep — the new SDK enforces a minimum of 1 attempt;(1)still means "no retries."
Breaking change
--status pending is no longer accepted and now returns ErrUsage. This is option A from the migration handoff (drop pending as a synonym for incomplete). Option B (keep pending as an alias mapped to the API default) is a one-line addition to resolveStatusFilter. Flag the choice if you'd prefer B before merge.
Test plan
-
bin/cigreen (formatting, vet, lint, unit + e2e BATS, surface, skill drift, provenance, tidy) -
--status completed,--status archived,--status trashedall send the expected query params on both single-list and cross-list paths (covered by new tests) -
--status pendingand bogus values returnErrUsagebefore any HTTP fires - No
replacedirective ingo.mod; no legacyStatus: "completed"/Status: "pending"strings remain ininternal/ - TUI manual check:
./bin/basecamp tui→ project → completed-todos pane populates; active pane no longer mixes in completed todos
Summary by cubic
Migrates to github.com/basecamp/basecamp-sdk/go’s new TodoListOptions (lifecycle-only Status + Completed bool) and updates CLI/TUI filtering to use the server as the source of truth. Fixes the TUI active todos pane showing completed items and rejects --status pending.
-
Refactors
- Map
--status {completed,incomplete,archived,trashed}to(Status, Completed)via a new resolver; invalid values returnErrUsage. - Remove client-side status filtering for cross-list and single-list paths; API applies filters directly.
- TUI: use
{Completed: true}for completed panes; empty options now return only incomplete todos. - Tests: add coverage for query params and server-side filtering across single-list/cross-list.
- Enforce
WithMaxRetries(1)per new SDK requirement; bump SDK tov0.7.4-0.20260423230153-f54589f0924a.
- Map
-
Migration
- Replace
--status pendingwith--status incomplete. - Supported values are now:
completed,incomplete,archived,trashed.
- Replace