$ node test.js
all tests passed

$ node demo.js
=== failure kind: outage ===
[t=   0s] task 1 start: summarise the lighthouse report
[t=   0s] task 1 primary outage (503 service unavailable), failure 1/3
[t=   0s] task 1 waiting 2s (backoff) then retry
[t=   2s] task 1 primary outage (503 service unavailable), failure 2/3
[t=   2s] task 1 waiting 4s (backoff) then retry
[t=   6s] task 1 primary outage (503 service unavailable), failure 3/3
[t=   6s] task 1 falling back to secondary for this task only
[t=   6s] task 1 ok via secondary
[t=   6s] task 2 start: name three moons of Planet Zork
[t=   6s] task 2 primary outage (503 service unavailable), failure 1/3
[t=   6s] task 2 waiting 2s (backoff) then retry
[t=   8s] task 2 primary outage (503 service unavailable), failure 2/3
[t=   8s] task 2 waiting 4s (backoff) then retry
[t=  12s] task 2 ok via primary
[t=  12s] task 3 start: draft a recipe for blue soup
[t=  12s] task 3 ok via primary
[t=  12s] task 4 start: translate "hello" into Gnomish
[t=  12s] task 4 ok via primary
final task list (virtual time 12s):
  #1 [done] summarise the lighthouse report      by secondary
  #2 [done] name three moons of Planet Zork      by primary
  #3 [done] draft a recipe for blue soup         by primary
  #4 [done] translate "hello" into Gnomish       by primary

=== failure kind: limit ===
[t=   0s] task 1 start: summarise the lighthouse report
[t=   0s] task 1 primary limit (429 usage limit reached), failure 1/3
[t=   0s] task 1 waiting full maximum 60s then retry
[t=  60s] task 1 primary limit (429 usage limit reached), failure 2/3
[t=  60s] task 1 waiting full maximum 60s then retry
[t= 120s] task 1 primary limit (429 usage limit reached), failure 3/3
[t= 120s] task 1 falling back to secondary for this task only
[t= 120s] task 1 ok via secondary
[t= 120s] task 2 start: name three moons of Planet Zork
[t= 120s] task 2 primary limit (429 usage limit reached), failure 1/3
[t= 120s] task 2 waiting full maximum 60s then retry
[t= 180s] task 2 primary limit (429 usage limit reached), failure 2/3
[t= 180s] task 2 waiting full maximum 60s then retry
[t= 240s] task 2 ok via primary
[t= 240s] task 3 start: draft a recipe for blue soup
[t= 240s] task 3 ok via primary
[t= 240s] task 4 start: translate "hello" into Gnomish
[t= 240s] task 4 ok via primary
final task list (virtual time 240s):
  #1 [done] summarise the lighthouse report      by secondary
  #2 [done] name three moons of Planet Zork      by primary
  #3 [done] draft a recipe for blue soup         by primary
  #4 [done] translate "hello" into Gnomish       by primary

=== failure kind: badkey ===
[t=   0s] task 1 start: summarise the lighthouse report
[t=   0s] task 1 OWN ERROR (401 invalid key): no retry, no fallback, task left open; run stopped
final task list (virtual time 0s):
  #1 [open] summarise the lighthouse report      -
  #2 [open] name three moons of Planet Zork      -
  #3 [open] draft a recipe for blue soup         -
  #4 [open] translate "hello" into Gnomish       -


