Skip to content

Instantly share code, notes, and snippets.

@GwynethLlewelyn
Last active September 21, 2025 11:43
Show Gist options
  • Save GwynethLlewelyn/4cc0033a575ca9937ffbd8af7248170a to your computer and use it in GitHub Desktop.
Save GwynethLlewelyn/4cc0033a575ca9937ffbd8af7248170a to your computer and use it in GitHub Desktop.
Testing Mermaid rendering in GitHub

Explaining rolling window

Basic Flowchart

flowchart TD
    A[Request new task] --> B{Check last 3 task times}
    B -->|All > 72h| C[Eligible]
    B -->|Some < 72h| D[Wait until oldest is >72h]

    C --> E{Check 15-day average}
    E -->| ≥ 4.0 | F[Limit: 3 tasks / 24h]
    E -->| < 4.0 | G[Limit: 3 tasks / 72h]

    D --> A
    F --> A
    G --> A
Loading
gantt
    dateFormat  X
    axisFormat  %Hh
    title Rolling Window Example (72h)

    section Tasks
    Task 1 (done)        :done, t1, 0, 1h
    Task 2 (done)        :done, t2, 7200, 1h
    Task 3 (done)        :done, t3, 21600, 1h
    Next eligible task   :milestone, m1, 266400, 0h

    section Windows
    Rolling 72h window after Task 1  :active, w1, 0, 72h
    Rolling 72h window after Task 2  :active, w2, 7200, 72h
    Rolling 72h window after Task 3  :active, w3, 21600, 72h
Loading
gantt
    dateFormat  X
    axisFormat  %Hh
    title Stage 0 — Immediately after 3 quick tasks

    section Score < 4.0  (3 tasks / 72h)
    Task 1        :done, low1, 0, 1h
    Task 2        :done, low2, 7200, 1h
    Task 3        :done, low3, 21600, 1h
    Next eligible :milestone, low_next, 266400, 0h
    72h window T1 :active, lw1, 0, 72h
    72h window T2 :active, lw2, 7200, 72h
    72h window T3 :active, lw3, 21600, 72h

    section Score ≥ 4.0  (3 tasks / 24h)
    Task A        :done, high1, 0, 1h
    Task B        :done, high2, 7200, 1h
    Task C        :done, high3, 21600, 1h
    Next eligible :milestone, high_next, 86400, 0h
    24h window T1 :active, hw1, 0, 24h
    24h window T2 :active, hw2, 7200, 24h
    24h window T3 :active, hw3, 21600, 24h
Loading
gantt
    dateFormat  X
    axisFormat  %Hh
    title Stage 1 — +24h (24h path becomes eligible)

    section Score < 4.0  (3 tasks / 72h)
    Task 1        :done, low1, 0, 1h
    Task 2        :done, low2, 7200, 1h
    Task 3        :done, low3, 21600, 1h
    Next eligible :milestone, low_next, 266400, 0h
    72h window T1 :active, lw1, 0, 72h
    72h window T2 :active, lw2, 7200, 72h
    72h window T3 :active, lw3, 21600, 72h

    section Score ≥ 4.0  (3 tasks / 24h)
    Task A        :done, high1, 0, 1h
    Task B        :done, high2, 7200, 1h
    Task C        :done, high3, 21600, 1h
    Next eligible :milestone, high_next, 86400, 0h
    24h window T1 :crit, hw1, 0, 24h
    24h window T2 :crit, hw2, 7200, 24h
    24h window T3 :crit, hw3, 21600, 24h
Loading
gantt
    dateFormat  X
    axisFormat  %Hh
    title Stage 2 — +48h (24h track still allows activity)

    section Score < 4.0  (3 tasks / 72h)
    Task 1        :done, low1, 0, 1h
    Task 2        :done, low2, 7200, 1h
    Task 3        :done, low3, 21600, 1h
    Next eligible :milestone, low_next, 266400, 0h
    72h window T1 :active, lw1, 0, 72h
    72h window T2 :active, lw2, 7200, 72h
    72h window T3 :active, lw3, 21600, 72h

    section Score ≥ 4.0  (3 tasks / 24h)
    Task A        :done, high1, 0, 1h
    Task B        :done, high2, 7200, 1h
    Task C        :done, high3, 21600, 1h
    Next eligible :milestone, high_next, 86400, 0h
    24h window T1 :crit, hw1, 0, 24h
    24h window T2 :crit, hw2, 7200, 24h
    24h window T3 :crit, hw3, 21600, 24h
Loading
gantt
    dateFormat  X
    axisFormat  %Hh
    title Stage 3 — +74h (72h track now allows a new task)

    section Score < 4.0  (3 tasks / 72h)
    Task 1        :done, low1, 0, 1h
    Task 2        :done, low2, 7200, 1h
    Task 3        :done, low3, 21600, 1h
    Next eligible :milestone, low_next, 266400, 0h
    72h window T1 :done, lw1, 0, 72h
    72h window T2 :done, lw2, 7200, 72h
    72h window T3 :done, lw3, 21600, 72h

    section Score ≥ 4.0  (3 tasks / 24h)
    Task A        :done, high1, 0, 1h
    Task B        :done, high2, 7200, 1h
    Task C        :done, high3, 21600, 1h
    Next eligible :milestone, high_next, 86400, 0h
    24h window T1 :done, hw1, 0, 24h
    24h window T2 :done, hw2, 7200, 24h
    24h window T3 :done, hw3, 21600, 24h
Loading
gantt
    dateFormat  X
    axisFormat  %Hh
    title Bonus — Score drops below 4.0 at +30h (demotion)

    section Before demotion (user thought they were on 24h)
    Task A        :done, high1, 0, 1h
    Task B        :done, high2, 7200, 1h
    Task C        :done, high3, 21600, 1h
    24h windows   :active, hw_all, 0, 24h

    section At +30h (a bad grade arrives; rolling average < 4.0)
    Demoted check  :milestone, demote, 108000, 0h
    System enforces 72h windows instead of 24h :crit, dem_rule, 108000, 0h

    section Resulting 72h windows (still blocking)
    72h window T1 :active, lw1, 0, 72h
    72h window T2 :active, lw2, 7200, 72h
    72h window T3 :active, lw3, 21600, 72h
    Next eligible :milestone, low_next, 266400, 0h
Loading

Note: Mermaid may be unsupported in the preview panel of GitHub Gists for now, but it certainly renders flawlessly once the Gist is created and published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment