Skip to content

tsk list: --no-thread, --group/--sort like the board, refuse repeated flags (T243) - #205

Merged
smarzban merged 2 commits into
mainfrom
tsk/t243-cli-parity-for-t216-t218-tsk
Oct 12, 2026
Merged

smarzban merged 2 commits into
mainfrom
tsk/t243-cli-parity-for-t216-t218-tsk

Conversation

@smarzban

@smarzban smarzban commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

CLI parity for the board's T216/T218 work (T243).

What

  • Repeated flags refuse (exit 2). -p/--project, --thread, --state-dir, --group, --sort given twice (any mix of space and = forms) is a usage error instead of silently keeping the last value. tsk list -p alpha -p beta used to list only beta.
  • --no-thread: unthreaded tasks only (the board filter's without a thread, same ThreadFilter::Without predicate). Works with every scope and with --done/--archived/--deleted. Conflicts with --thread and with a task operand.
  • --group none|project|thread and --sort recent|project|thread|title: the board's g/s. The per-section core of ui::queue::arrange_view (sort + hottest-first bucketing) is extracted into bucket_rows; arrange_view and the new queue::arrange_rows (used by tsk list) both call it, so there is one implementation. Applied inside each status heading.
    • Human: sub-headings per group under each status, painted like the board (basename, desk, #thread, no thread); rows drop the grouped dimension; --all --group thread rows end with their scope label. Grouping replaces the --all scope sub-headings (no two-level nesting). A non-recent --sort without --group also drops them: each status lists its rows in sorted order with a scope label per row, like the board's ungrouped section.
    • --json: still a flat array in the listed order; each row gains group (the painted label) only when --group is set.

Decisions (matching the board)

  • --group/--sort project needs --all → exit 2 otherwise. A project board never offers project grouping (group_choices), and without --all the listing is one scope. For --desk the board silently no-ops on ON DECK · desk; the CLI refuses instead, because CLI --desk only holds desk tasks.
  • --group/--sort thread refuses with --thread/--no-thread: like the thread view, which offers none/project only.
  • --group/--sort refuse with --done/--archived/--deleted and with a task operand, even at their defaults (--done --sort recent exits 2): the done drawer and the archived group never group or sort.
  • Known limitation: under --all --group project, two repos that share a basename stay two groups on the board (two name headings), but CLI human output merges adjacent same-label groups under one heading. JSON keeps both the group label and the full project path on every row.

Tests

New in tests/cli_list.rs: list_repeated_scope_or_thread_flag_is_usage, list_no_thread_filters_within_scope, list_no_thread_conflicts_with_thread, list_group_thread_orders_groups_hottest_first_under_each_status, list_group_project_needs_all_and_orders_hottest_first, list_group_and_sort_combine_with_scope_and_thread, plus characterization tests for paths that already worked: list_all_thread_includes_desk_tasks, list_desk_thread_filters_desk_only, list_thread_combines_with_done_and_archived. tests/cli_steps.rs: steps_add_last_explicit.

Each regression test failed with its hunk reverted by hand (repeat check, --no-thread filter, --thread conflict, arrange_rows call), then passed with it restored. The existing arrange_view queue tests pass unchanged after the extraction.

Docs

cli.md (synopsis, examples, filter + arrange tables, refusals, JSON group), tsk list --help and usage line, llms.txt (dropped "tsk list is unchanged"), CHANGELOG Unreleased (Added + Fixed), SKILL.md Board-language rows (thread across repos, a project's thread, group) plus one line saying list order is board order. The skill is already 1.5.0 since v0.11.6 (shipped 1.4.0), so only the hash pin is refreshed.

Verification

  • cargo fmt --check && cargo clippy --all-targets -- -D warnings && cargo test: green.
  • site/: npm ci && npm test && npm run build: green.
  • Live in Herdr: tabs T243 before (daily ~/.local/bin/tsk 0.11.6 dispatch build) and T243 after (target/release/tsk from this branch), both on an isolated TSK_STATE_DIR holding two git repos plus desk tasks across api/release/no thread. Each runs: -p alpha -p beta, --all --no-thread, --all --group thread, --all --group project --sort title, --desk --group project, --all --thread release --group project --json. Before: the repeat lists beta only (exit 0) and the new flags are unknown. After: the repeat refuses (exit 2), --no-thread and both groupings print sub-headings hottest first, --desk --group project refuses, and the JSON rows carry group.

Out of scope, per the brief: --json on tsk steps mutations; bulk status from the CLI.

@vercel

vercel Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
herdr-tsk Ready Ready Preview Oct 12, 2026 11:11pm UTC

@smarzban

Copy link
Copy Markdown
Owner Author

Review K1–K3 addressed in 11a348c:

  • K1: --all --sort X (no --group) now prints each status as one sorted run with a scope label per row, instead of re-grouping by scope; human-text test added. cli.md updated.
  • K2: --group/--sort are tracked as given (Option), so --done --sort recent, --archived --group none, --deleted --sort=recent, T1 --sort recent, T1 --group=none all exit 2; added to the refusal test.
  • K3: added --all --sort project --json success assertion; title case moved to -p alpha --sort title, where title order differs from recent.
    Each new assertion fails with its fix reverted. PR body: dropped 'shown above', stated the same-basename limitation. Green bar + site tests green.

@smarzban
smarzban force-pushed the tsk/t243-cli-parity-for-t216-t218-tsk branch from 11a348c to d848bc7 Compare October 12, 2026 23:11
@smarzban

Copy link
Copy Markdown
Owner Author

Rebased onto main 4486a17 (#206). One conflict, CHANGELOG Fixed: kept both entries (T240 delete-notice line, then the tsk list repeated-flag line). Green bar, site test+build, release build, and the live Herdr smoke (tabs T243 before/after, now also covering --all --sort title and --done --sort recent) all pass.

@smarzban
smarzban merged commit ade0385 into main Oct 12, 2026
8 checks passed
@smarzban
smarzban deleted the tsk/t243-cli-parity-for-t216-t218-tsk branch October 12, 2026 23:17

This branch was successfully deployed

1 active deployment
Preview — d848bc77 Deployed Oct 12, 2026 by vercel[bot]
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