JST Trigger and Target Algorithm
For scheduled selection, convert UTC runtime to JST and gate execution on fixed slots.
Trigger Decision
- JST offset:
+9h - Allowed hours:
0, 6, 12, 18 - Allowed minute:
0
shouldTrigger = isScheduledJstHour && (jstMinute === 0)
Day Window Helper
Build JST day boundaries for daily counting:
dayStart:YYYY-MM-DD 00:00:00dayEndExclusive: next day00:00:00
Use this to count videos created "today" in JST.
Soft Target Balancing
Define soft per-format targets (for example 4 each) and compute remaining targets with non-negative clamps:
remaining = max(0, target - actual)
This gives scheduling context to selection prompts without hard blocking generation.