← back
Methodology

The rule book.

Every rule the algorithm uses, every constant it sets, and every paper it's grounded in. Read it; check it against the sources; challenge anything that looks wrong.

Last calibrated
9 May 2026
Latest paper folded into the rules: Brown, Brainard, Cajochen, Czeisler, Hanifin, Lockley, Lucas, Münch, et al. 2022 Recommendations for daytime, evening, and nighttime indoor light exposure to best support physiology, sleep, and wakefulness in healthy adults. v0.2.0 literature integration. R4 migrated from photopic lux (Zeitzer 2000) to melanopic EDI (Brown 2022); R4.1 added for individual light sensitivity (Phillips 2019); R10 thresholds switched from absolute (e.g. score <70) to relative-to-personal-baseline trends (Chinoy 2021); Roach & Sargent 2019 promoted to current-synthesis citation across R3, R8.3, and R11.

Rules

Numbered R1–R13. Each rule names the constant or decision it governs, then lists the primary-literature source(s) the constant comes from.

R1

Phase markers from self-report

Estimate the user's current circadian phase from habitual bedtime, habitual wake, and chronotype.

chronotype ∈ {early, intermediate, late}
DLMO_offset = {early: 2.0 h, intermediate: 2.5 h, late: 3.0 h}[chronotype]

DLMO       = habitual_bedtime − DLMO_offset
DLMO_check = habitual_wake_time + 13.5 h
            # take mean if both available; flag if they disagree by >2 h
CBT_min    = DLMO + 7 h
            # cross-check: should fall ~1.5–2 h before habitual_wake_time
Sources · Burgess 2014; Kantermann, Sung, Burgess 2015
R2

Direction and magnitude of required shift

delta = destination_TZ − origin_TZ                # positive = eastward
if abs(delta) > 12: delta = -sign(delta) × (24 − abs(delta))
direction = "advance" if delta > 0 else "delay"
magnitude = abs(delta)                            # in hours

The 12-hour rule encodes that for very large eastward shifts, going around the long way (delay) is faster.

Sources · Eastman, Burgess 2009
R3

Adaptation rate and total days

rate_advance = 1.0 h/day      # with full intervention (light + melatonin + sleep)
rate_delay   = 1.5 h/day      # with full intervention

# Without intervention, real-world rates degrade to:
rate_advance_natural = 0.95 h/day   # ~57 min
rate_delay_natural   = 1.5 h/day    # ~92 min

days_to_adapt = ceil(magnitude / rate_for_direction)
Sources · Roach, Sargent 2019; Eastman, Burgess 2009; Revell, Burgess, Gazda, Smith, Fogg, Eastman 2006
Asymmetry rationale: human τ ≈ 24.18 h, slightly long, so the SCN drifts later naturally. Delays move with τ, advances against it. Roach & Sargent 2019 also note delay-zone PRC amplitude > advance-zone, plus practical adherence advantages of delay protocols.
R4

Light intensity model — four tiers

Discrete approximation of the dose-response. Updated to use melanopic equivalent daylight illuminance (melanopic EDI) per Brown et al. 2022, the field-standard metric — replaces simple photopic lux. Phillips et al. 2019 establishes that the population-mean ED50 is far lower than Zeitzer 2000 reported and that individual sensitivity varies >50× — both reflected below.

TierMelanopic EDIPhotopic-lux equiv. (5000K LED)Practical example
Strong-seek≥ 250~280 luxDirect outdoor sunlight; well-lit office near window; 10,000 lux therapy box
Mild-seek50–250~55–280 luxBright indoor; well-lit room mid-day
Soft-avoid10–50~10–55 luxDim indoor; warm-white lamp; sunglasses outdoors; screens night-shift
Full-avoid< 1~1 luxEye mask; blackout; eyes closed

Conversion notes. Photopic lux ≠ melanopic EDI; the multiplier depends on light-source spectrum:

  • Incandescent / warm LED (2700 K): melanopic EDI ≈ 0.45 × photopic lux
  • Daylight LED (5000 K): melanopic EDI ≈ 0.9 × photopic lux
  • Daylight (≥6000 K, blue sky): melanopic EDI ≈ 1.1 × photopic lux

When a user reports light exposure in lux from a phone meter (which measures photopic), apply the conversion before tier classification.

Sources · Brown, Brainard, Cajochen, Czeisler, Hanifin, Lockley, Lucas, Münch, et al. 2022; Phillips, Vidafar, Burns, McGlashan, Anderson, Rajaratnam, Lockley, Cain 2019; Zeitzer, Dijk, Kronauer, Brown, Czeisler 2000
Zeitzer 2000 retained as historical baseline. Brown 2022 + Phillips 2019 are the operational references for v0.2.0+.
R4.1

Individual light sensitivity — optional personalization

Per Phillips 2019, ED50 ranges from 6 lux (most sensitive) to 350 lux (least sensitive). Three-bucket approximation:

sensitivity ∈ {sensitive, average, resistant}  # default: average

if sensitivity == "sensitive":
    soft_avoid_upper  *= 0.4   # tighter evening dim required
    strong_seek_lower *= 0.5   # smaller dose still effective

elif sensitivity == "resistant":
    soft_avoid_upper  *= 1.5
    strong_seek_lower *= 2.0

Detect sensitivity from: (a) explicit user self-report ("evening light makes me wired" → sensitive; "I can sleep with the TV on" → resistant), or (b) feedback from prior protocols (no shift after 2 days at standard dose → resistant; vivid dreams + insomnia at standard dose → sensitive).

In current implementation, default to "average" if no signal. The form does not yet collect this knob — once it does, the per-tier multipliers above apply.

Sources · Phillips, Vidafar, Burns, McGlashan, Anderson, Rajaratnam, Lockley, Cain 2019
R5

Light windows for phase shift

CBT_min is the pivot point of the Khalsa light PRC. Light before CBT_min delays; light after CBT_min advances.

For delay (westward) protocol:

STRONG_SEEK = [CBT_min − 5h, CBT_min − 2h]   # peak biological evening
MILD_SEEK   = [CBT_min − 8h, CBT_min − 5h]   # late afternoon body-time
SOFT_AVOID  = [CBT_min − 1h, CBT_min + 1h]   # peri-CBT_min
FULL_AVOID  = [CBT_min + 1h, CBT_min + 5h]   # biological early morning

For advance (eastward) protocol:

STRONG_SEEK = [CBT_min + 2h, CBT_min + 5h]   # peak biological early morning
MILD_SEEK   = [CBT_min + 5h, CBT_min + 8h]   # mid-morning body-time
SOFT_AVOID  = [CBT_min − 1h, CBT_min + 1h]   # peri-CBT_min
FULL_AVOID  = [CBT_min − 5h, CBT_min − 1h]   # biological late evening

Each protocol day, after applying the day's shift, slide CBT_min forward (advance) or back (delay) by rate_for_direction hours and recompute the windows.

Sources · Khalsa, Jewett, Cajochen, Czeisler 2003; St Hilaire, Gooley, Khalsa, Kronauer, Czeisler, Lockley 2012; Zeitzer, Dijk, Kronauer, Brown, Czeisler 2000
R5.1

Practical translation — windows are theoretical, scheduling is real

The windows in R5 come from constant-routine PRCs where the subject is awake 24/7. In a real plan the user is asleep during much of the theoretical STRONG_SEEK window. So:

  • Pre-flight delay: brightest practical light from late afternoon to ~30 min before bedtime. Don't prescribe light during the theoretical peak (which is during sleep).
  • Pre-flight advance: brightest practical light from wake until ~5 h after wake.
  • Post-arrival: light intensity follows the user's actual wake/sleep schedule, not the theoretical PRC windows. See R8.3.

Rule of thumb: prescribe strong-seek on the side of the day farthest from the user's planned sleep — evening for delay, morning for advance — accepting that the theoretical peak may be unreachable.

Sources · Khalsa, Jewett, Cajochen, Czeisler 2003; Eastman, Burgess 2009
R6

Melatonin dose timing

Default dose: 0.5 mg, immediate-release, sublingual or oral. The 0.5 mg PRC is shifted ~1.5 h later than the 3.0 mg PRC and produces equivalent shifts when timed correctly, without daytime grogginess.

# 0.5 mg PRC
max_advance_dose_time = DLMO − 3.0 h       # ≡ bedtime − 5.5 h ≡ CBT_min − 10.5 h
max_delay_dose_time   = CBT_min + 6.5 h    # ≡ wake_time + 3.5 h

For advance (eastward) protocol:

pre_flight_dose     = bedtime[d] − 5.5 h     # afternoon at origin
return_flight_dose  = takeoff_time + ~1 h    # early in-flight, just before
                                              # the in-flight sleep window
post_arrival_dose   = bedtime[d] − 5.5 h     # tapered over 2–3 nights,
                                              # judgement call by sleep
                                              # quality

For delay (westward) protocol:

in_flight_dose      = NONE                   # the literature is tepid on
                                              # westward melatonin
arrival_night_dose  = bedtime_destination − 0.5 h   # small soporific dose
adaptation_doses    = OPTIONAL, 1–2 nights at bedtime − 0.5 h, drop if
                      sleep is good
Sources · Burgess, Revell, Eastman 2008; Burgess, Revell, Molina, Eastman 2010; Burgess et al. 2010; Burgess (Penn CBTI) 2020
R7

Caffeine — direction-asymmetric cutoff

half_life      = ~5 h        # median; range 2–10 h
phase_effect   = ~40 min delay per 200 mg dose given 3 h before bedtime
                              # ~half the magnitude of 3 h evening bright
                              # light at 3000 lux

# Cutoff timing differs by direction:
caffeine_cutoff_advance = bedtime[d] − 8 h   # earlier — caffeine would
                                              # phase-delay against the goal
caffeine_cutoff_delay   = bedtime[d] − 6 h   # more permissive — mildly
                                              # aligned with the delay
                                              # direction

# Output as paired blocks per day:
CAFFEINE_OK_block  = [wake_time, caffeine_cutoff]
NO_CAFFEINE_block  = [caffeine_cutoff, bedtime]

Dose guidance accompanying the schedule: "little and often" — 20–50 mg every 1–2 h beats a single 200 mg slug. Total daily intake unchanged; sleep disruption reduced.

Sources · Burke et al. 2015
R8.1

Pre-flight sleep — the sleep-bank rule

Naive rule "drift bedtime 1 h/day in the protocol direction" is wrong when departure-day wake is unusually early (e.g. early feeder flight). Override with sleep-banking on the night before flight:

For each pre-flight day d:
    protocol_bedtime    = bedtime[d−1] + (sign × 1.0 h)
    sleep_bank_bedtime  = depart_day_wake_time − target_sleep_h

    if direction == DELAY:
        bedtime[d] = min(protocol_bedtime, sleep_bank_bedtime)
                     # take the EARLIER — sleep-bank wins if morning forces it
    elif direction == ADVANCE:
        bedtime[d] = max(protocol_bedtime, sleep_bank_bedtime)
                     # take the LATER — sleep-bank wins if departure logistics
                     # require later sleep

Two-out from departure (D−2) is typically protocol-shifted; D−1 is typically sleep-bank-dominated when the flight is early. The flight's own sleep block carries the actual phase shift.

Anti-reversal correction. If D−1's sleep-bank bedtime is opposite the protocol direction, D−2's protocol drift is wasted because D−1 reverses it. In that case soften D−2's drift to 0.5 h (or skip if magnitude is small):

if direction == DELAY and sleep_bank_bedtime[d=−1] < bedtime_baseline:
    bedtime[d=−2] = bedtime_baseline + 0.5h
elif direction == ADVANCE and sleep_bank_bedtime[d=−1] > bedtime_baseline:
    bedtime[d=−2] = bedtime_baseline − 0.5h
Sources · Borbély 1982; Eastman, Burgess 2009
R8.2

In-flight sleep — possibly two blocks

For long-haul flights:

if flight_duration > 9h and direction == ADVANCE:
    nap_block        = [takeoff + 1h, takeoff + 3h]      # ~2h short nap
    main_sleep_block = [mid_flight, pre_landing − 1h]    # destination-night-aligned

elif flight_duration > 9h and direction == DELAY:
    # No early nap (would erase homeostatic pressure for destination bedtime).
    late_nap_block   = [pre_landing − 4h, pre_landing − 1h]
    # Main sleep happens at destination.
Sources · Borbély 1982; Eastman, Burgess 2009
R8.3

Post-arrival — wake-anchor light

Anchor the wake time to destination clock — wake time is the dominant entrainment cue. Bedtime is whatever the user can fall asleep at; sleep duration may be short on early adaptation nights.

Wake-anchor light rule. Get strong-seek light immediately on wake, every adaptation day, regardless of where wake falls relative to the still-shifting CBT_min. Rationale:

  • The theoretical PRC says morning light during a delay protocol could counter-shift. In practice the alertness benefit + entrainment to destination clock dominates the small advance contribution.
  • The strong-seek dose first thing on wake also resets the entrainment phase — wake-time light is the dominant zeitgeber for stable entrainment.
  • For delay protocols, the strong-seek dose continues into late afternoon/evening; for advance protocols, it's concentrated in the morning only.

This rule is the practical compromise between pure-PRC theory and adherence: telling the user to "sleep in until 11 AM destination time and avoid morning light for 4 days" produces compliance failures worse than the small theoretical loss from morning light.

Sources · Roach, Sargent 2019; Roenneberg et al. 2007; Eastman, Burgess 2009
R9

Wind-down marker

A 30–60 min discrete pre-bed event of dim lighting + screens off, regardless of phase-shift direction. Soporific aid for melatonin onset; lower light is sufficient (well below the CBT-min-relative window).

WIND_DOWN_block = [bedtime[d] − 0.5 h, bedtime[d]]
General sleep-hygiene literature, not jet-lag-specific. Included because it strictly improves outcomes without phase-shift cost.
R10

Sleep-quality modulation — generic wearable input

The skill consumes generic signals from whichever data source the user has connected — Garmin, Apple Watch (HealthKit), Oura, Whoop, Withings, manual self-report. Map vendor-specific fields to abstract signals:

Abstract signalSource examples
7-day mean sleep durationAll sources
7-day sleep score / qualityGarmin, Oura, Whoop, Withings, Apple Watch (computed)
HRV trend vs baselinerMSSD or vendor HRV; Apple Watch via HealthKit
RHR trend vs baselineAll sources
Recovery proxyGarmin body battery, Oura readiness, Whoop recovery, manual self-report
# Modulation rules (per Chinoy 2021: relative-to-personal-baseline, never absolute):

if 7d_sleep_score < (personal_30d_sleep_score_avg − 1 SD)
   OR HRV_trend < −10% personal baseline:
    pre_flight_drift_rate *= 0.5     # soften pre-flight to 0.5 h/day
    in_flight_nap_aggressiveness *= 0.7

if RHR_trend > +5 bpm vs personal baseline:
    flag_to_user("RHR elevated — possible illness/recovery debt; consider
                 delaying optional pre-shift component")

if no recent sleep deficit (all signals at or above personal baseline):
    run protocol at full nominal intensity

Do NOT use:

  • Absolute sleep-score thresholds (e.g. "<70"). Vendor-specific scales don't translate — a 70 on Oura is not equivalent to a 70 on Garmin. Always express as a delta from the user's own 30-day baseline.
  • Sleep-stage data (deep / REM absolute durations). Per Chinoy 2021, consumer-tracker stage accuracy ranges 30–65% epoch-by-epoch — too poor to gate decisions on.

Fallback if no wearable connected:

ask: "How was your sleep last week — good / mixed / poor?"
  good  → full intensity
  mixed → soften by 25%
  poor  → soften by 50%, flag user
Sources · Chinoy, Cuellar, Huwa, Jameson, Watson, Bessman, Hirsch, Cooper, Drake, Markwald 2021; Plews, Laursen, Stanley, Kilding, Buchheit 2013; Knufinke et al. 2018
R11

Trip-length minimums

if magnitude < 3 hours AND trip_length < 3 nights:
    skip protocol
    output: "Stay on home time — adaptation cost > jet-lag cost for short trips."
Sources · Roach, Sargent 2019; Eastman, Burgess 2009
R12

Older travelers

PRC amplitude shrinks ~25% in adults >55. Scale rate_for_direction accordingly when computing total days.

Sources · Klerman et al. 2007
R13

Caffeine sensitivity — slow metabolizers

If user reports slow caffeine metabolism (CYP1A2 *1F/*1F genotype, hormonal contraceptives, pregnancy, smoking cessation), extend the no-caffeine block:

caffeine_cutoff_advance_slow = bedtime[d] − 10 h
caffeine_cutoff_delay_slow   = bedtime[d] − 8 h
Sources · Burke et al. 2015

Parameter quarantine

Values that are educated guesses, not strongly evidence-backed at current N. Surfaced separately so a curious reader sees the seams.

Citations

Every paper the rule book draws on. 24 entries, ordered alphabetically by author. PMC links lead to free full-text where available.

Borbély 1982. A two process model of sleep regulation. Hum Neurobiol 1:195–204.
Process S × Process C — the wake-maintenance zone makes pre-flight sleep timing impossible to ignore. Foundation for R8.1's sleep-bank rule.
Brown, Brainard, Cajochen, Czeisler, Hanifin, Lockley, Lucas, Münch, et al. 2022. Recommendations for daytime, evening, and nighttime indoor light exposure to best support physiology, sleep, and wakefulness in healthy adults. PLOS Biology 20(3):e3001571.
Replaces photopic lux with melanopic equivalent daylight illuminance (melanopic EDI) as the canonical metric for circadian-relevant light. Field thresholds: daytime ≥250 melanopic EDI, evening (3 h pre-bed) <10, sleep <1. Drives R4's tier definitions in v0.2.0.
Burgess 2014. The dim light melatonin onset following fixed and free sleep schedules. J Sleep Res 23:516–522.
DLMO from self-report: ~2.5 h before bedtime, ~13.5 h after wake. Source of R1's DLMO estimator.
Burgess (Penn CBTI) 2020. Using bright light and melatonin to reduce jet lag. Clinical handout (Penn CBTI).
Practitioner-facing summary. Source of the recovery-melatonin recommendation (2–3 nights, taper by sleep quality).
Burgess et al. 2010. Clinical implications of the melatonin phase response curve. J Clin Endocrinol Metab 95:3325–3331 (commentary).
Translates the PRC into the clinical timing rules used directly in R6.
Burgess, Crowley, Gazda, Fogg, Eastman 2003. Preflight adjustment to eastward travel: 3 days of advancing sleep with and without morning bright light. Sleep 26:679–684.
Bright light + advanced sleep outperforms advanced sleep alone — justifies the algorithm's combined recommendation.
Burgess, Revell, Eastman 2008. A three pulse phase response curve to three milligrams of melatonin in humans. J Physiol 586:639–647.
3 mg melatonin PRC; max advance ~6 h before DLMO, max delay ~5 h after. Comparator for the 0.5 mg curve.
Burgess, Revell, Molina, Eastman 2010. Human phase response curves to three days of daily melatonin: 0.5 mg vs. 3.0 mg. J Clin Endocrinol Metab 95:3325–3331.
Critical paper for R6: the 0.5 mg PRC is shifted ~1.5 h later than 3.0 mg, with comparable shifts and no daytime grogginess. Drives all melatonin timing in the algorithm.
Burke et al. 2015. Effects of caffeine on the human circadian clock in vivo and in vitro. Sci Transl Med 7:305ra146.
200 mg caffeine 3 h before bedtime delays the circadian rhythm by ~40 min. Mechanism + half-life context. Source for R7 and R13.
Chinoy, Cuellar, Huwa, Jameson, Watson, Bessman, Hirsch, Cooper, Drake, Markwald 2021. Performance of seven consumer sleep-tracking devices compared with polysomnography. Sleep 44(5):zsaa291.
Validates 7 consumer trackers (Oura, Garmin, Fitbit, Whoop…) vs PSG. Total sleep time ±15–30 min across vendors; sleep-stage data substantially error-prone. Drives R10's switch from absolute thresholds (e.g. score <70) to relative-to-personal-baseline trends, and the explicit guardrail against gating on deep/REM stage data.
Czeisler et al. 1989. Bright light induction of strong (type 0) resetting of the human circadian pacemaker. Science 244:1328–1333.
Three-day type-0 resetting from high-dose light exposure; saturation behaviour at the top of R4's intensity tier.
Eastman, Burgess 2009. How to travel the world without jet lag. Sleep Med Clin 4:241–255.
Operational synthesis. Source of R3's adaptation rates (1.0 h/day advance, 1.5 h/day delay), R8.2's in-flight alignment, and R11's short-trip skip logic.
Eastman, Gazda, Burgess, Crowley, Fogg 2005. Advancing circadian rhythms before eastward flight. Sleep 28:33–44.
3-day pre-flight advance protocol with morning light + advancing sleep. Demonstrates ~1 h/day advance is feasible.
Kantermann, Sung, Burgess 2015. Comparing the Morningness-Eveningness Questionnaire and Munich ChronoType Questionnaire to the Dim Light Melatonin Onset. J Biol Rhythms 30:449–453.
MEQ correlates r = −0.70 with DLMO; chronotype questionnaires are an acceptable substitute for direct measurement. Justifies R1's chronotype-offset table.
Khalsa, Jewett, Cajochen, Czeisler 2003. A phase response curve to single bright light pulses in human subjects. J Physiol 549:945–952.
Foundational PRC: peak delay ~3 h before CBT_min, peak advance ~3 h after. Anchors R5's light-window placement (the *when*); Brown 2022 + Phillips 2019 update the *how much*.
Klerman et al. 2007. (Age-related PRC amplitude decline). J Circadian Rhythms.
PRC amplitude shrinks ~25% in adults >55. Source for R12's age-based rate scaling.
Knufinke et al. 2018. Effects of natural between-days variation in sleep on elite athletes' psychomotor vigilance and sport-specific measures of performance. J Sports Sci Med 17:515–524.
Sleep-quality variation effects on next-day performance; informs how R10 weights a single bad night.
Phillips, Vidafar, Burns, McGlashan, Anderson, Rajaratnam, Lockley, Cain 2019. High sensitivity and interindividual variability in the response of the human circadian system to evening light. PNAS 116(24):12019–12024.
Population-mean ED50 ~25 photopic lux (~14 melanopic EDI), well below Zeitzer 2000's ~120 lux. Individual ED50 ranges 6–350 lux — a >50× spread. Basis for R4.1's three-bucket light-sensitivity personalization (sensitive / average / resistant).
Plews, Laursen, Stanley, Kilding, Buchheit 2013. Training adaptation and heart rate variability. Sports Med 43:773–781.
HRV-based training prescription; rationale for using HRV trend as a recovery proxy in R10.
Revell, Burgess, Gazda, Smith, Fogg, Eastman 2006. Advancing human circadian rhythms with afternoon melatonin and morning intermittent bright light. J Clin Endocrinol Metab 91:54–59.
Adding 0.5 mg afternoon melatonin to morning-light + advanced-sleep gets you ~1 h/day advance. Combined-treatment basis cited in R3.
Roach, Sargent 2019. Interventions to minimize jet lag after westward and eastward flight. Frontiers in Physiology 10:927.
Current synthesis review of 2009–2019 jet-lag interventions, replacing Eastman & Burgess 2009 as the most current operational reference. Re-confirms R3's 1.0 h/day advance / 1.5 h/day delay ceilings; strengthens R8.3 wake-anchor light rule with 10+ new RCTs; provides current-evidence basis for R11's short-trip skip.
Roenneberg et al. 2007. Epidemiology of the human circadian clock. Sleep Med Rev 11:429–438.
Population distribution of mid-sleep on free days; rationale for using wake-time light as the dominant zeitgeber in R8.3.
St Hilaire, Gooley, Khalsa, Kronauer, Czeisler, Lockley 2012. Human phase response curve to a 1 h pulse of bright white light. J Physiol 590:3035–3045.
Same PRC shape as Khalsa 2003 for shorter pulses — lets the algorithm reason about realistic exposure durations.
Zeitzer, Dijk, Kronauer, Brown, Czeisler 2000. Sensitivity of the human circadian pacemaker to nocturnal light: melatonin phase resetting and suppression. J Physiol 526:695–702.
Sigmoidal dose-response on log-lux. Source of R4's four discrete intensity tiers (~2 / 120 / 550 lux thresholds).

Source of truth for these rules: jet-lag-protocol plugin repo, file references/algorithm-rules.md. Spot a mistake or a paper we should fold in? Open an issue.