Skip to content

automations: a finished reminder moved later wakes again; a late save is refused - #1837

Merged
ZeroPoint95 merged 4 commits into
devfrom
zeropoint95/fix-edit-finished-reminder
Oct 15, 2026
Merged

ZeroPoint95 merged 4 commits into
devfrom
zeropoint95/fix-edit-finished-reminder

Conversation

@ZeroPoint95

@ZeroPoint95 ZeroPoint95 commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes moving a finished one-time reminder later with e on /automations, which could leave the row finished.

What changed

  • Cause: the edit line wrote at to the minute, so an in 2m reminder came back seconds earlier and "the next minute" could be seconds away. Store.Update then saved a new moment that had passed while the card was up; the clock said it at once and the row was finished again.
  • Store.Update refuses a changed one-time moment that is not after now (… has already passed, to the second within the current minute). Store.Create is unchanged: an add answered late still runs once.
  • The edit line keeps a moment's seconds (at 2026-10-14T20:33:13), and writes a moment in a fall-back's repeated hour as RFC 3339 with its offset.
  • An edit is refused for a past moment only when it moves the moment, so a finished reminder can be renamed or re-said.
  • automation.NextAfterChange is the one next-run rule for both cards (typed edit and the conversation's change).
  • A typed save of a paused automation says still paused — resume starts it again, not a next run.
  • Manual: automations.md gains a section on a change refused at save time and renaming a finished reminder, plus the refusal list; three retrieval probes. DESIGN.md and a change entry updated.

How it was checked

  1. gofmt -l internal/ cmd/ printed nothing; go vet on automation, tui3, session and manual was clean.
  2. go test -race ./internal/automation/ → ok.
  3. go test ./internal/tui3/ -run 'Automation|Typed|Edit' → ok; -run Manual → ok.
  4. go test ./internal/session/ -run 'Automation|Manual' → ok.
  5. go test ./internal/manual/ → ok, with the three new probes reaching automations.
  6. make changelog-check → all entries well formed.
  7. Each new test failed with its production hunk reverted:
    • The owner's walk (in 2m, said, e, next minute, Save 5 seconds late) left the reminder due at once.
    • The paused card promised next Mon 19 Oct at 09:00.
    • The paused receipt said saved weekly update renamed · next Mon 19 Oct at 09:00.
    • The repeated-hour line read 01:30 EST back as 01:30 EDT.
    • The same-minute refusal said 14:30 has already passed at 14:30:05.
  8. Not run: make pr-ready or the full tui3/session suites. The PR's CI runs them.

Checklist

  • A change entry — docs/changes/unreleased/1837-edit-finished-reminder.md.
  • The manual knows about it — internal/manual/chat/automations.md, with probes in internal/manual/chat_test.go.
  • No new line in .github/known-red.txt.
  • Only my own paths are staged. Commits used git add -A in a clean worktree; git diff --stat origin/dev...HEAD lists only the 11 files of this change.

🤖 Generated with Claude Code

ZeroPoint95 and others added 4 commits October 14, 2026 21:06
… is refused

Moving a FINISHED one-time reminder later with `e` on /automations could leave
the row finished. Two things combined:

- CommandLine wrote a one-time `at` to the minute, so an `in 2m` reminder
  (seconds precision) came back earlier in the box, and "the next minute"
  could be seconds away.
- Store.Update saved a new one-time moment that had already passed while the
  card was up as the next run; the clock took it at once and the reminder was
  finished again a beat after the save.

Fixes:
- The edit line keeps a moment's seconds (and fraction); parseMoment reads them.
- Store.Update refuses a changed one-time moment that is not after now.
- An edit is refused for a past moment only when it moves the moment, so a
  finished reminder can be renamed.
- automation.NextAfterChange is the one rule both doors' cards use for the
  next run, so the typed edit no longer promises a run to a paused automation
  or a fresh slot to an unchanged rhythm.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A typed edit of a paused automation says "still paused — resume starts it
  again" instead of a next slot it does not run at.
- The edit line writes a moment in a fall-back's repeated hour with its
  offset, so it reads back as the same instant.
- A moment that passed in the current minute is refused to the second.
- The Store.Update comment names errPassed, and that a zone-only change to a
  one-time schedule is refused too.
- DESIGN.md narrowed: only a change is refused at save time; an add answered
  late still runs once.
- Manual: a section on a change refused at save time and renaming a finished
  reminder, the refusal list, and three retrieval probes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ZeroPoint95
ZeroPoint95 marked this pull request as ready for review October 15, 2026 12:57
@ZeroPoint95
ZeroPoint95 merged commit 85d2184 into dev Oct 15, 2026
8 checks passed
@ZeroPoint95
ZeroPoint95 deleted the zeropoint95/fix-edit-finished-reminder branch October 15, 2026 13:11
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