aboutsummaryrefslogtreecommitdiff
path: root/.ai/scripts/todo-cleanup.el
Commit message (Collapse)AuthorAgeFilesLines
* fix(todo-cleanup): keep --archive-done silent on a real-mode no-opCraig Jennings8 days1-14/+24
| | | | The wrap runs --archive-done twice (wrap-it-up, then open-tasks.org Phase A). The first pass archives and reports. The second finds nothing and used to print "0 subtree(s) moved", which reads as alarming next to the first pass's diff. Now a real-mode run that moves nothing and skips nothing says nothing. Check mode still previews "0 would move", and a missing-section skip still reports, since those are conditions the caller needs.
* chore(ai): sync scripts and workflows from claude-templatesCraig Jennings2026-05-151-12/+34
| | | | | | | - todo-cleanup.el: :no-sync: tag now inherits down the outline tree - task-review.org: completion procedure scoped to top-level entries - cj-scan.py + cj-remove-block.py: helpers for cj-comment block handling - inbox-send.py: cross-project messaging via inbox directories
* fix(todo-cleanup): read priority via org-heading-components, not regexCraig Jennings2026-05-141-4/+8
| | | | | | | | The first take walked the heading line with a plain `\[#\([A-Z]\)\]` regex, which matched any cookie-shaped substring anywhere in the line. Dated-log headings can carry that shape inside the title — e.g. "Reprioritized children =[#D]= → =[#B]= to match parent" quotes earlier and new priorities verbatim, and the script read =[#D]= as if it were the heading's own priority cookie. `(nth 3 (org-heading-components))` only returns a priority when the cookie sits in canonical position (right after the stars or the optional TODO keyword), which is the only place org itself recognizes it. That's the right primitive here. Surfaced via smoke-testing --check-child-priority against ~/projects/work/todo.org: 10 candidates dropped to 9 once the dated-log heading inside the Whisper parent stopped getting flagged. New ert test tc-sync-ignores-cookie-shaped-text-in-title covers the case directly.
* feat(todo-cleanup): add --sync-child-priority mode for drifted childrenCraig Jennings2026-05-141-11/+169
| | | | | | | | | | When a parent task in todo.org gets reprioritized, its children frequently keep their original (lower) priority cookies, which then mismatches the parent's new importance. The new mode walks every heading with a priority cookie and bumps any direct child whose own cookie is lower (D ranks below A in org's default scheme). Down-only: parents are never bumped up to a child's priority. Priority-less parents and priority-less children are both left alone — sync does not invent priorities. Children opt out by carrying the :no-sync: literal tag, useful for Follow-up:/Spike: sub-tasks that are deliberately deprioritized. The tag match is literal regex against the heading line rather than going through org-get-tags, because org's default tag character class excludes hyphens — :no-sync: would not be parsed as a real tag in batch mode without a custom org-tag-re. org-map-entries visits headings in document order, so a multi-level chain [#A] → [#B] → [#D] collapses to the top priority in one pass: the middle bumps to [#A] before the walk reaches the leaf. wrap-it-up.org Step 3 now invokes --sync-child-priority after --archive-done. --check-child-priority is the report-only alias (--sync-child-priority --check) for previewing before applying. Default cadence is auto-apply, same as --archive-done.
* feat(todo-cleanup): add --archive-done mode with ERT test suiteCraig Jennings2026-05-111-29/+210
| | | | | | | | --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.
* chore(ai): initialize project notes and Claude tooling surfacesCraig Jennings2026-05-061-0/+149
Replace the seed notes.org with project-specific context (layout, install modes, task tracker location, recent inflection point). Bring in the synced template surfaces (protocols, workflows, scripts, references, retrospectives, someday-maybe) as tracked content for this content/documentation project.