fix(app): schedules fire their latest time, count speech only when heard, survive stops

- A repeating schedule the app was off for is judged by its latest time up to
  now, so today's reminder is not skipped after a night off.
- A spoken reminder counts as delivered only when its speech ends played to
  the end; speech that failed or was stopped goes to the chat channel.
- A schedule being delivered is marked firing; one still marked at the next
  start gets a failed outcome instead of vanishing without a reason.
- Deliveries run in the loop's JoinSet, so stopping the services stops them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-14 16:34:28 +09:00
parent ea2d3ba958
commit 5aa014543c
3 changed files with 175 additions and 20 deletions

View File

@@ -122,13 +122,18 @@ check something at a time or regularly; the brain's `schedule` tool
still fire, soonest first), `delete` (one of theirs). The answer carries `{id, kind, text, next,
repeat}`; a refusal says why. With `features.schedule` off the tool is not offered; schedules
already kept still fire and can be deleted on the screen.
- **Firing**: while the services run, every 5 s the due ones are taken (a repeating one moves on to
its next time at once; a one-off one stops firing). One more than 15 minutes late (the app was
off, the PC asleep) is not delivered and is kept as missed. Each delivery runs on its own task.
- **Firing**: while the services run, every 5 s the due ones are taken. A repeating one is judged
by its latest time up to now (earlier ones passed while the app was off are skipped, not sent in a
row) and moves on to its next time at once; a one-off one stops firing. One whose (latest) time is
more than 15 minutes ago (the app was off, the PC asleep) is not delivered and is kept as missed.
A schedule taken is marked as being delivered until its outcome is recorded; one still marked at
the next start (the app stopped while delivering it) gets a failed outcome then. Each delivery runs
on its own task, and stopping the services stops the loop and every delivery it started.
- **Delivery**: a `task` first runs in the brain (`reply` `via: "task"`: read-only tools, its own
short-term memory, at most 300 s); no answer is a failure. The text sent is `<name>님, <reminder or
answer>`. Asked by voice: spoken when the person is in Jarvis's voice channel, else posted in
`schedule.chatChannel`; asked in chat: posted in that channel. Posts ping nobody and need the
answer>`. Asked by voice: spoken when the person is in Jarvis's voice channel and counted only when
the speech ends played to the end (at most 120 s, queued behind what is being said); otherwise,
or when it failed or was stopped, posted in `schedule.chatChannel`; asked in chat: posted in that channel. Posts ping nobody and need the
channel's send switch. A delivered one-off schedule is removed; one that failed, or was missed,
stays (not firing again) with its outcome `last: {at, ok, note}` for the screen, and a repeating
one keeps its latest outcome.