← Back to ERP system builders

Skill · Version 1.0.0

Time and scheduling properties

Tests time-dependent rules with controlled clocks and deliberate calendar, expiry and timezone edge cases.

time-scheduling-properties

Team members using this skill

See how it helps

When is it useful?

Use when subscriptions, delegations or schedules fail around month ends or clock changes.

What does it help you do?

  • Separates elapsed-time expiry from timezone-aware calendar arithmetic.
  • Generates exact cutoffs, leap dates, missing or repeated local hours.
  • Checks cycle continuity and late events without slow wall-clock sleeps.

Try asking this

Test monthly renewal from January 31 and access expiry across a Budapest daylight-saving transition with deterministic clocks. Advance a controlled clock exactly to the expiry boundary and one instant beyond. Report the agreed entitlement on both sides without waiting in real time.

Detailed documentation

Read the skill’s original instructions, examples and checks in their authored language.

Details…Show less

Time & Scheduling Properties

Use this skill when testing logic that depends on timestamps, durations, expirations, billing cycles, renewal dates, grace periods, rate-limit windows, or timezone conversions.

Controlled Clock Discipline

  1. Never Rely on Wall-Clock sleep in Property Tests:
    • Inject an explicit clock interface (Clock / now()) or deterministic virtual timer so generated time jumps (advanceBy(ms), setTime(instant)) execute instantaneously and reproducibly.
  2. Separate Instant (UTC) from Calendar Arithmetic (ZonedDateTime):
    • Expirations, token TTLs, and rate-limit windows operate on monotonic elapsed instants.
    • Monthly billing anchors, daily report cutoffs, and business-hour SLAs operate on timezone-aware calendar dates.

Adversarial Temporal Generators

Weight timestamp and calendar generators to hit notorious temporal boundaries:

  • Exact Boundary Instants: $t = \text{expires_at} - 1\text{ ms}$, $t = \text{expires_at}$, $t = \text{expires_at} + 1\text{ ms}$.
  • Calendar Rollovers: Month-end anchoring from Jan 29/30/31 into February (both leap years like 2024-02-29 and non-leap years like 2025-02-28), quarter ends, and year boundaries (Dec 31 23:59:59.999Z).
  • Daylight Saving Time (DST) Transitions:
    • Spring-forward missing local hour (e.g., 02:00–02:59 in Europe/Budapest or America/New_York).
    • Fall-back repeated local hour where the same local wall time occurs twice with different UTC offsets.
  • Out-of-Order & Skewed Event Timestamps: Events arriving with occurred_at < processed_at or slight clock skew between nodes.

Core Temporal Invariants

  • Strict Expiry Cutoffs: Once the clock advances past expires_at (and any documented grace window), expired tokens, delegations, reservations, or promotional credits must never be accepted, even if an earlier check cached their validity.
  • Non-Overlapping & Gap-Free Billing Cycles: For any sequence of subscription renewals or usage windows $[t_0, t_1), [t_1, t_2), \dots, [t_{k-1}, t_k)$, adjacent periods must meet at the exact boundary ($t_i = t_i$) with zero double-billed overlap and zero unbilled gap.
  • Idempotent Scheduled Sweeps: Running an expiration, dunning, or accrual cron job multiple times at the same timestamp $t$ or across fine-grained vs. coarse-grained clock steps must produce the exact same state as running it once.

Checklist

  • Does the test drive time through an injected or virtual clock rather than real wall-clock delays?
  • Are exact boundary instants ($\text{cutoff} - 1$, $\text{cutoff}$, $\text{cutoff} + 1$), leap years, month-end rollovers (31 -> 28/29), and DST transitions generated?
  • Are recurring periods verified to be contiguous (no gaps and no overlaps)?
  • Are scheduled background sweeps verified to be idempotent when triggered repeatedly at or after the deadline?

Included files 1

  • SKILL.md