Skip to content

Integrate schedule hardening and verified native enablement - #1

Merged
virtitnerd merged 1 commit into
virtitnerd:feat/schedule-storefrom
pponce:integrate/schedule-hardening
Oct 26, 2026
Merged

virtitnerd merged 1 commit into
virtitnerd:feat/schedule-storefrom
pponce:integrate/schedule-hardening

Conversation

@pponce

@pponce pponce commented Oct 26, 2026

Copy link
Copy Markdown

Purpose

Move the schedule hardening from upstream #213 onto feat/schedule-store, as requested, so it lands through #179 as one combined scheduling contribution.

Based directly on 59bf2e6d. This keeps the Python-roborock#179 implementation and attribution, adds the hardening in a commit authored by pponce, and excludes unrelated newer-main changes carried by the previous merge.

Changes

  • Verify exactly one matching native timer is on before dispatch; recheck the job and deadline after the network wait.
  • Never substitute an ordinary clean after a refused or timed-out native scheduled start.
  • Persist occurrence claims before dispatch and retain them through cloud refresh; document the at-most-once crash window, missed-run and DST policies.
  • Preserve complete imported settings and unknown fields; keep native-linked jobs out of the legacy timer compatibility view.
  • Synchronize native enablement across clients after fresh reads, verify HTTP enablement updates, reject stale/ambiguous state and preserve consumed one-time jobs during background polling.
  • Carry over the scheduler, API, persistence, native-sync and regression tests.

The feature-specific schedule-tests.yml workflow is not included. Tests remain in the normal Python suite; validation runs separately on my fork.

Validation

Passed 525 Python tests on both Python 3.11 and 3.13, plus an amd64 Docker build and schedule-module import check.

Validation run. The validation branch has the same contribution source plus a fork-only workflow; no validation workflow is included in this PR.

An earlier Python-roborock#213 build successfully started my S7 (a15, firmware 02.16.12) at its scheduled time, with LocalRock and the OEM app used for schedule control. This confirms the earlier scheduled-start scenario; hardware testing of this rebased branch remains pending.

Coordination

Once accepted here, Python-roborock#179 will include the hardening previously proposed in Python-roborock#213; a separate merge of Python-roborock#213 is no longer needed. The combined LocalRock Python-roborock#37/Python-roborock#60 implementation needs the server release containing Python-roborock#179 with this hardening.

The dashboard/editor work in #214 remains separate and waits for the stable Python-roborock#176 dashboard base. LocalRock does not depend on that dashboard.

@virtitnerd

Copy link
Copy Markdown
Owner

Thanks for moving this onto the Python-roborock#179 branch. I folded the Python-roborock#179 commits (10 down to 7, same files) and rebased them onto current main, and the branch on this fork has just been updated, so this PR is currently based on the old hashes. That is why it lists all 10 earlier commits as well as yours, and why it shows a conflict.

Could you rebase it so the PR holds only your own commit, Integrate schedule dispatch hardening and verified enablement? Something like:

git fetch https://github.com/virtitnerd/local_roborock_server.git feat/schedule-store
git rebase --onto FETCH_HEAD 59bf2e6 integrate/schedule-hardening
git push --force-with-lease

59bf2e6 is the old tip of the branch. I tried applying your commit onto the new branch and it applies cleanly, so I don't expect conflicts. Once the PR shows just that one commit I'll review and merge it, with your authorship kept.

@pponce
pponce force-pushed the integrate/schedule-hardening branch from fa8f269 to 99b64d7 Compare October 26, 2026 21:29
@pponce

pponce commented Oct 26, 2026

Copy link
Copy Markdown
Author

all set!

@virtitnerd virtitnerd left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the rebase, and for the care in this one. I read the whole change, not only the description.

What I checked

  • The new commit applies on the folded Python-roborock#179 branch with no conflicts, and the full suite passes on it here (566 tests, Python 3.11).
  • Dispatch: the claim is saved before anything is sent, the job and the deadline are rechecked after the network wait, and a failed or malformed get_server_timer raises instead of starting a clean. The refused native start no longer falls back to a plain clean, which fits a disabled or deleted timer being a decision the robot made.
  • Enablement sync: a read-back is the success test, a lost acknowledgement is confirmed with one read and no second write, duplicates and malformed entries are never guessed at, and a stale read cannot overwrite an edit made while the robot was being read.
  • Native-linked jobs leave the legacy get_timer view, so a client has to list schedules from the jobs API.
  • docs/schedules.md matches the code, including the at-most-once policy and the one-time job being consumed when evaluated.

Notes, none of them blocking

  • LocalRock's schedule list reads get_timer today, so on a server with this change it would not show native-linked schedules. Python-roborock#37 needs to list from the jobs API, which is the plan for the combined LocalRock PR. I will list this server change as the minimum version there.
  • A skipped run (timer off, missing or ambiguous) still ends with the "Completed routine" log line, which reads as if a clean was sent. A separate "schedule not started" message would be clearer.
  • The 30 second background read opens a new MQTT connection to each robot that has linked schedules. That is fine for a few robots, and worth a note in the docs if people run many.
  • server.py will conflict with other branches that touch the same startup code, which I will sort out when those land.

Merging this into the Python-roborock#179 branch now, keeping your authorship.

@virtitnerd
virtitnerd merged commit a14aa15 into virtitnerd:feat/schedule-store Oct 26, 2026
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.

2 participants