Repository navigation
fix(delivery): a waiting batch follows the schedule's script list CU-86akkb8f5 - #2939
semen-flamingo wants to merge 6 commits into
Conversation
…machine missed fires get one catch-up CU-86akkb8f5 The batch a machine waits for on the engine is the schedule as the user sees it now: a script added to the schedule joins the batch and gets a leaf under the same fire, one removed leaves it and its leaf closes with the reason. A machine still offline and waiting for an earlier fire of a repeating schedule gets the next fire instead of both, the way the reconnect sentinel merged them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018qx6NqA97kwRxQ4hnD5jtu
🦩 Flamingo Code Review✅ Tests and checks passed on this commit (2 lanes). 2 findings: 🔴 1 action required · 🟠 1 recommended · 🔵 0 informational Advisory: findings do not block the merge. 2 defects outside any rule
🔴 Action required (1)
🟠 Recommended (1)
✅ What this change does well
Inline comments: 2 new 5 possible problems checked and ruled out, 3 after reading more of the repository
🤖 Prompt for AI agents: fix every findingNext: commit a suggestion, or hand a comment's prompt to your coding agent. React 👍 on a finding that helped and 👎 on one that is wrong: the reviewer learns from both. Review again. New commits are not reviewed until you ask:
Or comment 🧪 Tests and mutationTests per lane
Mutation testingThis build has no PIT plugin, so each module is mutated from the command line with pit-adhoc.sh, changing nothing in the repository; no production class changed in openframe-api-service-core: nothing there to mutate.
New code, its covering tests and the result
23 mutants on lines this change added are not caught (0 survived, 23 with no test reaching them): each is annotated on its line in the Started 2026-11-02 18:05 UTC · updated 2026-11-02 18:07 UTC · workflow run |
…connect window under its repeat interval CU-86akkb8f5 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018qx6NqA97kwRxQ4hnD5jtu
…om the machine's own leaf CU-86akkb8f5 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018qx6NqA97kwRxQ4hnD5jtu
|
You fix the main case, but: A run could show FAILED when nothing actually failed. |
…he run shows what ran CU-86akkb8f5 A leaf of a batch the agent has not received is the promise of that batch. When a script leaves it (removed from the schedule, deleted, archived) the leaf is deleted, not closed FAILED: one FAILED leaf marked the whole run FAILED while every script that ran succeeded. retireScript is gone, a delete or archive refreshes the waiting batches like an edit. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018qx6NqA97kwRxQ4hnD5jtu
…ollows-schedule' into feature/delivery-waiting-batch-follows-schedule
What
One case of a batch that waits on the engine for an offline machine, found in the review of what can change while it waits (#2880 shipped the wait): the schedule's script list changes. The waiting machine gets the schedule as the user sees it now: a script added to the schedule joins the batch and gets a QUEUED leaf under the same fire; a script that leaves the batch (removed from the schedule, deleted, archived) loses its leaf. The leaf was the promise of a batch the agent never received, and a leaf closed FAILED for it marked the whole run FAILED while every script that ran succeeded; the run shows what ran, as the path before the engine did (it made a new fire from the current schedule at the reconnect). Before, the batch was rebuilt from the fire's own scripts only, so a schedule edited from [A, B] to [C] still sent A and B when the machine came back, and C never.
retireScriptis gone: a script delete or archive refreshes the waiting batches the way an edit does (the script is inactive, so it leaves the batch). A batch withdrawn as a whole (schedule deleted or archived, device unassigned, no script left) still closes through the engine with its reason, as before.Reviewed and left as is: a repeating schedule firing again while the machine is still offline. The API keeps the reconnect window under the repeat interval, so the earlier batch has failed at its window end before the next fire; the same held for the reconnect sentinel.
Checked on the feature tenant of #4291 (tenant-4291-77)
Schedule made in the UI: scripts A and B, "run when the device comes back online" 30 min, one offline machine. The fire at 18:28:00Z held the batch on the engine (two QUEUED leaves). At 18:30:41Z the schedule was edited in the UI to script C only: the body was replaced (
Delivery body replaced,Waiting batches refreshed … replaced=1), the leaves of A and B left the fire, a QUEUED leaf for C appeared under the same fire. The machine came back at 18:31:59Z, the sweep published at 18:32:08Z, the acknowledge for C closed the row DONE and moved the C leaf to RUNNING. (That check closed the A and B leaves FAILED, the head before the deletion; the re-check of this head is below.)Where
ScheduleDeliveryRefresher(api-lib):runnableScriptsOfreads the schedule's current list;alignLeavesmakes the leaves of a machine whose body was replaced equal to the batch (only those: a machine whose row is already acked, or on the route before the engine, keeps its leaves).ScriptServicedelete/archive callrefreshForScript.Tests
ScheduleDeliveryRefresherTest(+ script added, script removed, script deleted, row not replaced),ScriptServiceTest.Change-Set: delivery-waiting-batch-follows-schedule
🤖 Generated with Claude Code
https://claude.ai/code/session_018qx6NqA97kwRxQ4hnD5jtu
Change set
flamingo-stack/delivery-waiting-batch-follows-schedule: this pull request is the only one in it so far. Another pull request joins by naming this one in aDepends-Online, or by carrying the sameChange-Setline.Linked work
Linked by the
Depends-On/Change-Setlines in these descriptions; this block is maintained by the hub.