aboutsummaryrefslogtreecommitdiff
path: root/.ai/scripts/tests/fixtures
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-11 15:24:42 -0500
committerCraig Jennings <c@cjennings.net>2026-05-11 15:24:42 -0500
commit571494b81e4608f8479bb8c761183b1d28798ca0 (patch)
tree3f8cde8813b74d5c24631f0a3e1b114f842022d6 /.ai/scripts/tests/fixtures
parent54845d38cc3ed8ca5b1093eb7a44d3db9db8f22d (diff)
downloadrulesets-571494b81e4608f8479bb8c761183b1d28798ca0.tar.gz
rulesets-571494b81e4608f8479bb8c761183b1d28798ca0.zip
feat(todo-cleanup): add --archive-done mode with ERT test suite
--archive-done moves every level-2 subtree whose TODO state is DONE or CANCELLED out of the "Open Work" section into the "Resolved" section of the same org file, subtree intact. Sections match on a unique level-1 heading containing "Open Work" (case-insensitive) and one containing "Resolved"; a missing or ambiguous section skips the file with a message rather than crashing. Only direct level-2 children move. A DONE entry nested under an open parent stays put. Opt-in, never run by default, doesn't also run the hygiene passes; --check previews without writing. The CLI dispatch moved into tc-main behind a guard so the new ERT suite can require the file without firing it. Hygiene mode is unchanged. 13 ERT cases (the repo's first elisp tests) cover the move and the stay-put cases, EOF with no final newline, missing or ambiguous sections, lowercase headings, idempotency, and --check. tests/fixtures/todo-sample.org is the synthetic sample, and the Makefile test target now runs the ERT suites alongside pytest.
Diffstat (limited to '.ai/scripts/tests/fixtures')
-rw-r--r--.ai/scripts/tests/fixtures/todo-sample.org37
1 files changed, 37 insertions, 0 deletions
diff --git a/.ai/scripts/tests/fixtures/todo-sample.org b/.ai/scripts/tests/fixtures/todo-sample.org
new file mode 100644
index 0000000..8b9e723
--- /dev/null
+++ b/.ai/scripts/tests/fixtures/todo-sample.org
@@ -0,0 +1,37 @@
+#+TITLE: Sample todo.org for todo-cleanup tests
+#+AUTHOR: synthetic fixture
+
+# A deliberately varied (but synthetic) todo.org: umbrella "Open Work" /
+# "Resolved" headings, mixed TODO/DOING/WAITING/DONE/CANCELLED states,
+# priorities, tags, nested level-3 children, and a few structural (no-state)
+# section headings. `--archive-done' should move only the direct level-2
+# DONE/CANCELLED subtrees from "Open Work" into "Resolved", intact, and leave
+# everything else alone.
+
+* Sample Open Work
+** TODO [#A] Write the README
+ This one stays — still open.
+** DOING [#A] Refactor the parser
+ In progress; stays.
+** DONE [#A] Bootstrap the test harness :tooling:
+ Finished. Should move to Resolved with this body intact.
+** WAITING [#B] Vendor reply on the licensing question
+ Blocked, not done — stays.
+** A grouping heading with no TODO state
+*** TODO [#B] sub-task one
+*** DONE [#C] sub-task two — done, but nested under an open parent, so stays
+** CANCELLED [#B] Drop the legacy importer :chore:
+ Decided against it. Should move to Resolved.
+** TODO [#B] Ship the migration :quick:
+*** DONE [#C] write the up migration
+*** TODO [#C] write the down migration
+** DONE [#B] Tag the 1.0 release
+*** DONE [#C] update the changelog
+*** TODO [#C] announce on the list
+ Parent is DONE, so the whole subtree (open child included) moves.
+** NEXT [#C] Pick the next milestone
+
+* Sample Resolved
+** DONE [#A] Initial project skeleton
+ Pre-existing archived entry; new arrivals append after this one.
+** CANCELLED [#C] Evaluate the other framework