Repository navigation
Conversation
UX Review (Opus 5.5, fork) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5, fork) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. One new helper wraps both croniter call sites in Notes
What this change shipsInventory (4 items) — 3 justifiedIntent: the Cron list and the scheduler should show and use the configured local wall time for a cron job's next run, even across a DST or offset change. This is a FIX (#24853).
[FIRST-PRINCIPLES-REVIEWED] 4e877d6 Description read[DESCRIPTION-READ] 9a367610fee740d293bf8e64959ec47d8c64ee9db7fb789d8ed09c88eebbf5c4 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5, fork) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the fix is a single shared helper on both next-run paths, it takes nothing away, and it renders nothing new. Notes
[DESIGN-REVIEWED] 4e877d6 Description read[DESCRIPTION-READ] d72b095738668323db1f1e1da772a4c5ccbe19cb5ab7b9b4be8f9211e7f2ad21 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
GPT 6.1 Review (fork) — ✅ no blocking findingsReviewed Review detailsNo findings. |
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
9941895 to
4e877d6
Compare
|
[operator: bolichen97] Continuing this in #32403; thanks for the start. |
…#32403) A cron job's advertised next run and its timer boundary were computed by handing croniter an aware start in the job's zone. croniter 2 then shifts any run that lies past a DST change by the offset change a second time: a 03:00 job read 04:00 PST the day before the fall-back, a 22:00 job 21:00 PDT the day before the spring-forward, and is_due refused the advertised instant. Step the zone's naive wall clock instead and attach the zone to the result, as the schedule label already does. A repeated wall time whose first instant is not after now takes its second; a spring-forward gap resolves as fold=0 does, as before. Builds on #24864. Closes #24853
…#32403) A cron job's advertised next run and its timer boundary were computed by handing croniter an aware start in the job's zone. croniter 2 then shifts any run that lies past a DST change by the offset change a second time: a 03:00 job read 04:00 PST the day before the fall-back, a 22:00 job 21:00 PDT the day before the spring-forward, and is_due refused the advertised instant. Step the zone's naive wall clock instead and attach the zone to the result, as the schedule label already does. A repeated wall time whose first instant is not after now takes its second; a spring-forward gap resolves as fold=0 does, as before. Builds on #24864. Closes #24853 (cherry picked from commit 83ec532)
Problem / Motivation
Goal: Cron-expression next-run timestamps keep their configured local wall time across timezone offset changes.
A daily 03:00 job in America/Los_Angeles inspected before the 2026 fall-back advertises 04:00 PST. The scheduler refuses that advertised instant because the expression names 03:00.
Why it matters
The Cron list and next timer boundary give an incorrect deadline around timezone transitions. The regular polling cap keeps execution running, but the displayed time is misleading.
Not a goal
What changed (motivation → approach → change)
The Cron list's next-run time and the scheduler's next boundary keep the time named in a cron expression across a timezone offset change. Croniter's aware calculation can shift an existing local occurrence twice. A shared helper in cron_service/schedule.py compares that result with the expression's wall-clock occurrence and selects the earlier valid instant. Both timestamp paths use it, including the skip-date search. The owning spec in docs/system-specs/modules/learn-cron-dashboard.md records the behavior.
Backwards compatibility
Compatible: accepted expressions, saved jobs, due decisions, and polling limits retain their contracts. The parser's existing repeated/missing-hour choices remain in place.
Removes nothing: only an incorrect computed timestamp changes.
Tests
Proof: PROVEN test/test_cron_dst_previews.py::test_the_preview_and_boundary_name_the_configured_wall_time[America/Los_Angeles-2026-10-31T12:00-0 3 * * *-2026-11-01T03:00], test/test_cron_dst_previews.py::test_the_preview_and_boundary_name_the_configured_wall_time[America/New_York-2026-10-31T12:00-0 3 * * *-2026-11-01T03:00], test/test_cron_dst_previews.py::test_the_preview_and_boundary_name_the_configured_wall_time[America/Los_Angeles-2027-03-13T12:00-0 22 * * 1-5-2027-03-15T22:00], test/test_cron_dst_previews.py::test_the_preview_and_boundary_name_the_configured_wall_time[Australia/Lord_Howe-2026-04-04T12:00-0 3 * * *-2026-04-05T03:00], test/test_cron_dst_previews.py::test_the_preview_and_boundary_name_the_configured_wall_time[Australia/Lord_Howe-2026-10-03T12:00-0 3 * * *-2026-10-04T03:00] (head 81f6af8386d4)
62 focused tests passed on final head 4e877d6; 126 including the determinism ratchet passed on the preceding e7e3413 integration: new DST cases, existing DST execution, wake-boundary, skip-date, failure-backoff and determinism-ratchet tests.
All 19 new cases passed five serial repetitions (95 passed). A four-worker shuffled cohort passed 61 tests with seed 24853.
Original related backend selection before this base integration: 34 failed, 15191 passed, 592 skipped, 1 xfailed, 908 warnings in 1414.64s (0:23:34). All 34 normalized failing node IDs match a fresh clean-main replay on base 2ec42c9. Zero new failing nodes; these Windows baseline failures are not represented as a passing suite.
All four planned frontend-related batches were executed: 14,916 tests passed, 1 failed, 1 skipped and 3 suites failed during collection; 529 test files passed and 4 failed. The same four files and exact error messages reproduce on clean main: three CRLF-sensitive fixture readers and the Xvfb-only capture test. The runner stopped after batch 3, so its remaining batch 4 was executed separately with the unchanged selector and worker environment (842 passed). These baseline failures were not changed or treated as passing.
On the e7e3413 validation tree, all 39 applicable static-profile commands passed, plus Black, isort, flake8, mypy (3,678 source files) and documentation lint. The unchanged CloudFormation template inputs passed cfn-lint 1.22.3 on the same base. Semgrep 1.78.0 scanned both changed Python files with 15 rules and zero findings. Frontend dependencies and Playwright setup are provisioned; frontend build/lint gates do not apply to this backend-only diff.
Independent local GPT review: no findings at 4e877d6; requested gpt-6.1-sol, served model unverified.
WARNING: the extracted Opus discovery and validation contracts were reviewed by an independent generic-model fallback because no Opus/Sonnet model is available locally. No surviving blocking candidate; this is not an executed Opus/Sonnet verdict. Served model unverified. Remote review remains authoritative.
One-time published base integration onto 33590d6 includes merged test(crew-log): drop the strict xfail on the warm-session savepoint guard #24774, which removes the obsolete warm-session strict xfail. The original Cron source and regression-test blobs are unchanged. Focused regressions passed on the final head. Fresh red/green proof, all 39 static checks and full Black/isort/Flake8/mypy/documentation checks passed on e7e3413 before the final base alignment; the three intervening upstream commits change no Cron code, tests, spec, review contract or rule file. The original patch blobs are identical; unchanged earlier broad baseline comparisons are historical evidence, not a claim that current full CI passed. Current exact-head GPT and independent reduced-fidelity generic-model review of the Opus contract report no findings; remote review remains authoritative.
Exact-head CI diagnostic (2026-10-28): the offline E2E job failed two assertions in
capture-mcp-app-message-rows.mjs, for the queued dark scene's app attribution and visible message. This PR changes no frontend or harness source. A local Windows control using the unchanged frontend product/harness inputs from base e7e3413 reproduced those same queued-dark assertions (and four additional assertions); this is diagnostic evidence, not a passing CI claim. The Cron head is preserved; no E2E retry or unrelated source fix was made.Manual verification
Fixed-zone examples exercise the real compute_next_run_ts, timer boundary and is_due functions across US spring/fall transitions and Lord Howe's half-hour changes. Returned timestamps are checked against explicit expected epochs. No live gateway was started.
Screenshots / video
N/A — backend timestamp computation; no frontend code or layout changes.
Related Issues
Closes #24853
The timestamp residual is explicitly excluded by merged #24718, which fixes the human-readable schedule label. This patch is independent of the interval/one-shot work in #24479 and the timer retry work in #24409.
Sibling sweep
Swept: git grep -nE 'croniter(|get_next(' -- src/kiro_crew/cron_service
Sibling: src/kiro_crew/cron_service/schedule.py -- changed here
Both _next_cron_boundary_ts and _compute_next_run_ts_raw use the shared helper. _humanize_cron already iterates from the naive job wall clock. _cron_occurrence_ts uses get_prev only to identify one occurrence across adjacent minutes; the existing DST execution regressions pass.
Pattern harvest
Rule candidate: review-prompt
Pattern: A timezone-aware recurrence calculation must be checked against the configured wall time across offset transitions; a dependency can adjust an already-correct instant a second time.
Checklist
Contribution License Agreement
Contributed under the project's Apache-2.0 license.