Repository navigation
fix(scheduler): accept 5-field cron by padding seconds 0 (ADR-0021) - #167
Merged
Merged
Conversation
Closes #155. - normalize_cron_expr replaces validate_cron_expr: 5 fields get a leading '0', 6 fields pass through, 4/7 fields and @macros are rejected. - Portal POST/PUT and the schedule_task tool store and echo the normalised 6-field value. - Built-in [memory] summarize_cron / [learning] user_model_cron are normalised; errors name the config key. - Boot restore heals legacy 5-field rows in the DB and never arms an invalid one. - Portal heuristic and copy accept 5 or 6 fields.
Owner
Author
|
TL ACCEPT on tip Verified: 5→6 seconds pad, 6 unchanged, reject 4/7/@macros, portal POST/PUT + tool + config crons store normalised 6-field, restore rewrites 5-field rows, portal en/zh-HK UTC hint, Non-blocking follow-ups (not this PR): rename Waiting on Product GO + QA GO + CI green before merge. No tag. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #155. Implements ADR-0021 (
docs/adr/0021-five-field-cron-seconds-pad.md). Timezone is out of scope (#166); crons are still evaluated in UTC.Change
agent::normalize_cron_exprreplacesvalidate_cron_expr: 5 fields →"0 " + fields; 6 fields pass through; 4/7 fields and@macrosare rejected with a clear error.POST /api/tasksandPUT /api/tasks/{id}store the normalised 6-field value and echo it (triggerValue); 4/7 fields still return400 invalid_cron.schedule_tasktool stores the normalised value and shows it in the success text; thetrigger_valuedescription now documents 5 or 6 fields, UTC, stored as 6.[memory] summarize_cron/[learning] user_model_cronare normalised at boot; errors name the config key (still fail-fast).ScheduledTaskStore::normalize_stored_cronrewrites legacy 5-field rows (info logNormalised 5-field cron for task …), leaves 6-field rows untouched, and never arms an invalid row (error log).CRON_5_OR_6_FIELDheuristic; en / zh-HK copy says 5 or 6 fields with a 5-field example.Tests
@daily; padded0 9 * * *→ next 09:00:00 UTC; restore heal (5 rewritten, 6 untouched, 7 refused, row unchanged).cargo fmt --check,cargo clippy --all-targets -D warningsclean;cargo test: 929 passed; web: 41 passed.QA matrix
0 9 * * *→ stored0 0 9 * * *, fires 09:00 UTC (17:00 HKT).9 * * *,0 0 9 * * * 2026,@dailyare rejected (portal 400invalid_cron, tool error).