Filter the account-wide task listings by assignee and due date

Merged
JE
4mo ago
+823-84

Adds two filters to the account-wide task listings:

  • --assignee — repeatable, server-side (assignee_ids[])
  • --due — with / without / overdue, server-side (due=)

Both ride the bounded walk reworked in #590 rather than reintroducing an
unbounded account-wide fetch.

This targets main directly. It is an ordinary PR, not part of a stack:
#611 merged as ebeecc13 (tree-identical to its reviewed head ad39cd8c), and
#610 was closed as superseded. Earlier revisions of this description said it was
stacked on bc5-command-surface and received almost no CI — both are obsolete.

Review findings, fixed

Explicit --due= was treated as omission. Every check tested the flag's
value, so an empty string was indistinguishable from never passing the flag:
it slipped past the project-scoped guard, built no account-wide filter, and
returned a full unfiltered listing to a caller who believed they had narrowed
it. Now rejected on presence (Flags().Changed). --assignee= had the
mirror-image bug — StringArrayVar appends the empty string, so len(...) > 0
sent a filter naming nobody — and is rejected the same way.

Filter usage errors demanded an account. The --due token check lived
inside the account-wide path, which runs after ensureAccount. With nothing
configured, todos list --due tomorrow hit account resolution first: an
interactive session got the account picker, a noninteractive one got
--account is required, and the actual mistake was never reported. Both the
token and emptiness checks now run in validateTaskFilterValues before account
resolution — neither depends on the account or the scope.
TestTaskFilterUsageErrorsPrecedeAccountResolution uses an app with no
configured account and asserts on the message; asserting only "no requests
were made" would have passed before the fix, since account resolution fails
without issuing one.

The pagination claim was wrong in four places. accountwide.go, todos.go,
cards.go and the test file header all said filtering leaves the page/request
count untouched. The production soak disproved that: 2 requests for 100
unfiltered todos vs 3 for --assignee's 21, because the bounded walk's cap
counts items, so a narrower result can need another page. Only the walk's
algorithm is unchanged — which is what the same-fixture test actually pins;
its body already said so correctly while the header contradicted it.

Four skill/annotation contradictions. The todos list agent note still said
--assignee requires a project and redirected cross-project work to reports assigned, and claimed --assignee works on todos "not cards" — which this PR
makes false too. The skill separately said "Cards do NOT support --assignee"
in two places (true project-scoped, false account-wide now), and Smart Defaults
advertised --due tomorrow natural dates — valid when setting a due date,
rejected on a listing, where --due is a different flag taking
with|without|overdue. All corrected so the skill presents one contract.

Also fixed earlier: the four (cross-project) recipes that omitted
--all-projects. accountWide := flags.allProjects || !projectKnown(...), so a
configured default project counts as in scope — those recipes returned different
results depending on the reader's config.

Verification at 20506d70

  • Full remote suite on the exact head: 22 success / 2 skipped / 1 neutral /
    0 failures
    .
  • Local bin/ci exit 0 on the same SHA.
  • Every behavioural guard is mutation-checked: neutering it fails exactly its
    own test and nothing else.
  • Zero unresolved review threads.