todo done: stable indices across calls + print completed task #95
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
streamd todo donere-reads open tasks from disk on every invocation. Afterdone 1marks task 1 as@Done, the list shrinks and old task 2 becomes task 1, old task 3 becomes task 2, etc. Runningdone 1; done 2therefore marks what was originally task 1 and task 3 — not 1 and 2.Additionally,
doneprints only a number and gives no feedback about which task was completed.Feature 1 — Stable indices across sequential
donecallsAccept multiple numbers in a single invocation (recommended)
Change the CLI signature to
streamd todo done <N>...(variadic). Collect all requested indices up front from the same snapshot, then process them highest-index-first so earlier indices stay valid as tasks are removed.Session state file
On every
todo listortodo donecall, write a snapshot of(index → file:line)to a temp file (e.g section todo of..streamd-cache.tomlis an array of index -> {filename, line}).done Nreads the snapshot to resolve the original file:line. The snapshot is invalidated whenever the markdown files change (compare mtime).Feature 2 — Print the completed task on
doneAfter successfully writing
@Done, print the full task block (same format astodo list) so the user sees confirmation of what was completed.Current output:
Desired output:
Implementation: in
run_done, after writing the file, read back the (now-modified) lines forstart_line..end_lineand print them — same loop asrun_list.Implemented in PR #96.
Duration: ~15 minutes
Tokens: ~40k input / ~3k output
Summary of findings:
run_doneto accept&[usize]and extractedmark_task_doneas a testable helper — clean separation that made TDD straightforwarddedup()handles duplicate numbers gracefully (e.g.done 1 1marks it once)lines[start..end]slice already computed during file mutation, so it shows the post-@Doneline — consistent with the desired confirmation output