Skip to content

Add a repo-local archive for retired whys and decouple notes from park - #5

Merged
fuzzyporpoise merged 2 commits into
mainfrom
archive
Sep 26, 2026
Merged

fuzzyporpoise merged 2 commits into
mainfrom
archive

Conversation

@fuzzyporpoise

Copy link
Copy Markdown
Owner

Summary

Adds .todo/archive/, a repo-local home for retired whys, and decouples todo's note contract from park/schema. A completed task is retired with todo archive, which asserts the note's one-line relevance why and moves it into the repo where the work happened, so a how-did-we-fix-this search lands in the right place and relevance is inherited from the repo.

What's new

  • Archive command - todo archive <ref> retires a completed [x] task: it asserts the note's synopsis (existing, or --synopsis), rewrites the note as a todo-native record, writes .todo/archive/<ID>.md (--name overrides the basename), and removes the task line and the source note entry.
  • Archived view - todo list --archive prints a compact NAME/SYNOPSIS view of the archive; --json emits a versioned {schema_version, archived[]} envelope; --all aggregates across registered repos. Default list never shows archived content.
  • Native note contract - todo defines its own durable note shape (kind: record plus created/source/synopsis) and no longer imports github.com/polymorcodeus/park/schema. add -n without a disposition flag now stamps a native record.
  • Park interop kept - --category still emits a park-shaped record, rendered locally and byte-compatible with park's WriteTemplate, and NoteDisposition still recognizes a park note by the bare category: key.
  • Recorded disposition in clear - a completed task whose note is a native record has its line removed but the note preserved, reported separately from parked notes.

Usage

Command Purpose
todo archive <ref> [--synopsis ...] [--name ...] retire a done task into .todo/archive/
todo list --archive [--all] [--json] compact view of archived notes

Behavior changes / guardrails

  • archive only accepts a completed [x] task with a companion note; a failed guard mutates nothing.
  • The synopsis is a gate: an empty result is an error, never a silently unlabeled archive entry. The note's existing synopsis pre-fills it and --synopsis overrides it.
  • The archive directory is created and populated in the same pass, because the lnk store prunes empty directories.
  • Writes are repo-side only: todo stays lnk-agnostic and store adoption is out of band. The source note entry is unlinked (symlink only), so an adopted note's store copy is left for the lnk step.
  • NoteDisposition precedence is kind: work-order > category: (park) > kind: record > float.
  • add -n default output changes from a park record (category: areas) to a native record (kind: record); existing park-shaped notes keep working through category:.

Testing

  • Unit tests cover the native and park note shapes, NoteDisposition, the archive happy path, the synopsis gate, the done/note guards, synopsis override plus --name, ListArchived sorting and the missing-directory case, and clear preserving record notes.
  • CLI tests cover archive, list --archive, list --archive --json, and the error path when a work-order note is archived without a synopsis.
  • make check runs fmt, vet, lint, and tests; all green.

@fuzzyporpoise fuzzyporpoise self-assigned this Sep 26, 2026
@fuzzyporpoise
fuzzyporpoise merged commit a889743 into main Sep 26, 2026
4 checks passed
@fuzzyporpoise
fuzzyporpoise deleted the archive branch September 26, 2026 15:38
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