Skip to content

refactor: centralize Taskwarrior commands - #9

Merged
MattHandzel merged 1 commit into
mainfrom
agent/centralize-taskwarrior-commands
Aug 16, 2026
Merged

refactor: centralize Taskwarrior commands#9
MattHandzel merged 1 commit into
mainfrom
agent/centralize-taskwarrior-commands

Conversation

@MattHandzel

Copy link
Copy Markdown
Owner

Summary

  • add a single taskwarrior.command process boundary for synchronous reads, mutations, and asynchronous commands
  • migrate plugin-owned Taskwarrior calls to argv-based execution with a consistent result contract
  • propagate real exit status through save/apply, undo, inbox, review, granulation, bulk, nested, capture, buffer, Telescope, health, completion, dashboard, feedback, and sync workflows
  • add architectural and live regression coverage

Why

Taskwarrior subprocess handling had grown independently across the plugin. Several call sites discarded exit status, advanced interactive workflows after rejected commands, reported false success, or interpolated user values into shell command strings. The save/apply path also counted attempted actions rather than successful Taskwarrior mutations.

The centralized boundary now owns availability checks, rc flags, argv construction, accepted exit codes, synchronous/asynchronous result handling, and spawn failures. User-controlled values remain individual argv elements instead of becoming shell syntax.

User impact

  • failed Taskwarrior commands no longer count as successful or produce success notifications
  • inbox and review stay on the current task when a mutation fails
  • partial undo retains the remaining undo count
  • granulation and bulk operations report partial failures accurately
  • annotations, descriptions, filters, and custom mutation arguments are passed without shell interpolation

Validation

  • git diff --check
  • ./tests/lua/bootstrap.sh
  • ./tests/e2e/run.sh command_live_spec.lua
  • live isolated Taskwarrior coverage verifies data-location isolation, literal shell-looking text, add/modify/export, rejected mutation behavior, and asynchronous reads

The live test redirects HOME, TASKRC, and TASKDATA to a temporary directory and removes it afterward; it does not touch the user's normal Taskwarrior database.

@MattHandzel
MattHandzel marked this pull request as ready for review August 16, 2026 22:32
@MattHandzel
MattHandzel merged commit caf0e00 into main Aug 16, 2026
4 checks passed
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