Skip to content

Iterative tasks proof of concept#729

Open
carmiac wants to merge 3 commits into
GothenburgBitFactory:mainfrom
carmiac:iterative-tasks
Open

Iterative tasks proof of concept#729
carmiac wants to merge 3 commits into
GothenburgBitFactory:mainfrom
carmiac:iterative-tasks

Conversation

@carmiac

@carmiac carmiac commented May 5, 2026

Copy link
Copy Markdown
Contributor

This is a proof of concept of iterative tasks, or recurrence v2. In the pr is a document describing the general approach and design.

Going this route would allow TaskWarrior a way to address many of the reported issues with recurring tasks, either in the PR or in future work.

It definitely has not been sufficiently tested in the real world yet and there are some missing features, but I wanted to start a conversation before moving forward any more on this.

The basics of creating and iterating iterative tasks is in this PR. Still missing are:

  • Updating recurring tasks to iterative
  • Non-synthetic testing
  • TaskWarrior integration
  • More fancy recurrence parsing

Comment thread docs/src/iterative-tasks.md Outdated
Comment thread docs/src/iterative-tasks.md Outdated
Comment thread docs/src/iterative-tasks.md Outdated

First, pre-3.0 based applications are completely left out as all iterative functionality is implemented in TaskChampion.

Second, all applications that haven’t been updated to recognize the Iterative status may hide or mishandle Iterative tasks. The biggest issue is likely to be marking an Iterative task done and then losing it as an iterative task. If that happens, it will disappear from that client's perspective and the iteration never advances. There are a few possible mitigations, such as a secondary UDA flag that legacy clients wouldn't set, but this might just need to be documented as a possible issue during a transition phase. This is the largest risk in the proposal.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We could do a major update to Taskwarrior, with instructions to not create iterative tasks until all replicas are updated to that major version.

@djmitche djmitche left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm excited about this! I read the doc but haven't looked at the source yet, and left a few comments. I'll be glad to see more people looking at this!

@carmiac

carmiac commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

After a few days of using this for my personal tasks, I found a few rough edges and have fixed them.

@carmiac

carmiac commented May 22, 2026

Copy link
Copy Markdown
Contributor Author

The only thing remaining from my original plan is adding a config option to not create the logged tasks. Since replicas don't really have a configuration system, I'd rather not block on that.

@carmiac
carmiac marked this pull request as ready for review May 22, 2026 18:00

@djmitche djmitche left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I like this! I've got a few concerns about the design, and I'd like more folks to have a look than just me -- while the current recurrence stuff is not particularly functional for me (I get dupes all the time), lots of folks have filed various kinds of recurrence bugs so I think more perspectives will help.

Since most conversation about TW happens in GitHub these days (for better or worse), I think a good way to address this will be to just comment on all of those recurrence-related bugs pointing folks to this PR.

Once we've got the design nailed down, we'll need to rewrite this Markdown from the proposal document into more authoritative "this is how it works" documentation, similar to the Task Model page. That will be a good time to look in more depth at the implementation, too.

Comment thread src/task/iter.rs
Comment on lines +11 to +17
#[strum(serialize = "fixed", serialize = "fx")]
Fixed,
#[strum(serialize = "fixed+", serialize = "f+", serialize = "fp")]
FixedPlus,
#[default]
#[strum(serialize = "chained", serialize = "ch")]
Chained,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

It seems the strum bits here are just used to serialize this enum to task storage. Why are there multiple options for each type?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

They're here so that they can be used as iter_type shortcuts in TaskWarrior without needing to map them there. e.g. task add iter:daily iter_type:fp ...

Comment thread docs/src/iterative-tasks.md Outdated
Comment thread docs/src/iterative-tasks.md Outdated
This was referenced May 24, 2026
@djmitche

Copy link
Copy Markdown
Collaborator

from @ForeverFloating in GothenburgBitFactory/taskwarrior#3982 (comment):

Would the RRULE implementation show users to use the RRULE syntax directly, or does it recognize only shorthand and text2rrule syntax?

@carmiac

carmiac commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

from @ForeverFloating in GothenburgBitFactory/taskwarrior#3982 (comment):

Would the RRULE implementation show users to use the RRULE syntax directly, or does it recognize only shorthand and text2rrule syntax?

Currently it only parses TaskWarrior shorthand and text2rrule, but checking for a direct RRULE would be very easy to add.

@gour

gour commented May 27, 2026

Copy link
Copy Markdown

Hello,

an ex-TW user here! I used the app for many years and can say it's the best and most productive task-management app. Tried with orgmode, but it did not click. Then was experimenting with some Python-powered apps (etm/tklr-dgraham, but they' re not real CLI apps. Due to many recurring tasks in my setup, had to leave TW and, more or less settled on Tasklite.

Now even integrated Tasklite with Timewarrior, but I'm excited seeing there is work on "recurrence overhaul" ❣️

Is there any raw estimate when it might land in the master?

Don't know if you're aware of Tasklite's solution, but it has proper recurring support.

Syncing support and mobile-apps are nice-to-have add-ons, but robust recurring is a must. 😉

Sincerely,
Gour

@carmiac

carmiac commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

Is there any raw estimate when it might land in the master?

I don't really know, but one thing that would really help is testing. If you could build and test this branch and report anything you find, good or bad, I would appreciate it. https://github.com/carmiac/taskwarrior/tree/iterative-tasks

Comment thread docs/src/iterative-tasks.md Outdated
@carmiac

carmiac commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

Ok, big update that changes from having the iterative task spawn closed tasks to having the iterative task close itself and spawn a new iterative task using a deterministic v5 UUID. This makes the dep management much simpler and provides a path to eventually implement per-recurrence changes via the "recurrence.confirmation=prompt" config.

Comment thread docs/src/iterative-tasks.md Outdated
@djmitche

Copy link
Copy Markdown
Collaborator

Dropping by to say that I agree: some things should move to TC. For me the line is, if a user stops running a Taskwarrior replica (maybe switches entirely to mobile and web frontends, for example), existing functionality should continue to work. Right now nothing recurs without a Taskwarrior replica, so moving recurrence to TC makes sense. In this context, the "live task metadata" is less of an issue: it just potentially looks different between task and other TC-based interfaces. But it could definitely use some cleanup.

In-replica config is, AIUI, in #741.

Are there other unresolved issues here?

@carmiac

carmiac commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

From my POV there are two or three issues remaining:

  1. Update iterative-tasks.md so it matches the current design.
  2. Evaluate the base UUIDv5 URL for iterative tasks in light of Add replica-level configuration #741 so it doesn't conflict.
  3. More real world testing? I've been using it, but my use cases probably aren't everybody's.

I will try to tackle those in the next couple days.

@ryneeverett

ryneeverett commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

Once we've got the design nailed down, we'll need to rewrite this Markdown from the proposal document into more authoritative "this is how it works" documentation, similar to the Task Model page. That will be a good time to look in more depth at the implementation, too.

I would suggest that we're already at this stage and it would make sense to revise into documentation at this time. There are still some decisions to make about how this gets integrated into taskwarrior, but I don't think that should be a blocker for this PR and it makes more sense to have those discussions in the taskwarrior repo anyway.

Edit: And 10 minutes later I open another thread on the proposal document. :)

Comment thread docs/src/iterative-tasks.md Outdated
@carmiac

carmiac commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

ok, all updates done. I think I've addressed everything

Comment thread docs/src/iterative-tasks.md Outdated
Comment thread docs/src/iterative-tasks.md
@Ram-Z

Ram-Z commented Jul 9, 2026

Copy link
Copy Markdown

Related to the discussion here on adding wait and scheduled, there is also until...

"until" has two meanings for recurring/iterative tasks. It may refer to the end of the recurrence, or to the end of each task.

RRULE supports UNTIL= and COUNT= to end the recurrence, if text2rrule supports this, then this part is covered.

until is also standard field on tasks, after which the task gets automatically closed. In the current recurrence implementation, until affects the end of the recurrence, and there is no way of setting until for any of the child tasks.

Maybe until can now be used again for the iterative instances?

A classic example of where this is useful is "Bring garbage bins out". Collection is monday morning (due=mon), but if the task isn't done by 10am, there's no point in keeping it around (until=mon+10h).

@djmitche

Copy link
Copy Markdown
Collaborator

For the semver issue -- this is a major semver change, but that's OK! Bumping to 4.0.0-pre in Cargo.toml should fix it.

squashed to deal with a messy rebase
@carmiac

carmiac commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

And now the handing of due, wait, scheduled and until is done and matches what normal tasks do, while advancing in a reasonable way. RRule based COUNT is also supported, which lets you do somthing like
task add "fold a paper crane" iter:"daily 1000 times"
I ended up squashing the changes to make the rebase easier.

In addition to the rust tests, I have been testing this in taskwarrior with my chores task list. Seems to work well.

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.

7 participants