Repository navigation
bot_schedules: rows with no next run are sorted ahead of live tasks, so paused and finished rows come first - #3175
Conversation
`bot_schedules` sorted its rows on the instant alone, so a paused task (no instant at all) and a finished one-shot (a past instant, ThinkFlowLab#2767) sat above the tasks still due. A live row now comes first, and each group keeps instant order inside itself.
|
@Birfy T2 review request — PR #3175, tip Scope: comparator only in Author's readings: red-first on Please review this tip and leave the formal Verdict at |
|
Verdict: PASS at 73bc2cd Ran at this tip: Red first, on a tree at base The failing answer printed Review points:
Not run here, stated rather than claimed: |
Fixes #3174
Written-by: Dev-5
Owner: Dev-5
Bot: Dev-5
Tier: T2
What changed
bot_schedulessorted every row by the instant alone. A paused row carries no instant, and a finished one-shot keeps the past instant it was due at (#2767), so both landed above every task that is still due. Each row now also carries whether it is live (status === 'active'and an instant is stored); the comparator puts live rows first and rows with no next run after them, and each group keeps theat/lineorder it already had — only the order moves, the comparison inside a group is the same one as before.Boundaries
no next runand the state word for a paused or finished row,next <instant>for a live one.#2767's assertions are untouched, including#2767: an inactive task prints no next run, and an active one keeps its line.statusisactivebut stores no instant already readno next run; it now sorts with the rows that have no next run instead of first.schedulesView, the settings page, the line format, or any write path.Files
5 files, +63/−6:
core/src/host/schedules.js,core/test/schedules.test.js,docs/subsystems/core-host.md,patches/ds-bot/0001-core-fixes.patch(regenerated withnode scripts/ds-bot-patches.mjs generate),changelog.d/3174.fixed.md.Verification
Ran at
73bc2cd0e5aab2f51a8b4ae8d839cebe66b12e18:b303da8a2dd8a409d6e73366f86e03a7037fb476, before the source fix:cd core && TZ=UTC TMPDIR=/tmp node --import ./test/harness-resolve.mjs --test --test-name-pattern='#3174' test/schedules.test.js→not ok 1 - #3174: a row with no next run sorts after every live row,# pass 0 / # fail 1, and the failure printedPaused brief,Finished one-shot, thenLive brief.node --import ./test/harness-resolve.mjs --test test/schedules.test.js→ 43/43, 0 fail.test/schedules.test.js test/retired-bot-paths.test.js test/tool-schema.test.js test/install.test.js→ 75/75, 0 fail.TZ=UTC npm run verify→ exit 0; 10 suites each# fail 0(3313, 20, 715, 149, 172, 538, 151, 686, 37, 34);arch-docs: OK (5 changed file(s));ok 10 patches apply cleanly in order.node .github/scripts/check-mojibake.mjs --check→ 0 occurrences of U+FFFD.Not run: the smoke test — there is no
deepseek-harnesscheckout on this box fordev/bench.sh; the change is a sort inside thebot_schedulestool and the core suite exercises that path.{
"pr": 3175, "claim": "Dev-5", "issue": 3174,
"summary": "bot_schedules sorted its rows on the instant alone, so a paused row (no instant) and a finished one-shot (a past instant, #2767) sat above every task still due. Each row now also carries whether it is live — active and holding an instant — and the comparator sorts live rows first, then rows with no next run, keeping the existing instant and line order inside each group. The line format, the state words and #2767's assertions are unchanged.",
"files": ["core/src/host/schedules.js", "core/test/schedules.test.js", "docs/subsystems/core-host.md", "patches/ds-bot/0001-core-fixes.patch", "changelog.d/3174.fixed.md"],
"checks": { "ran": "TZ=UTC npm run verify", "result": "green", "at": "73bc2cd0e5aab2f51a8b4ae8d839cebe66b12e18" },
"next": "none — ready for review"
}