# Service levels and handle time when a channel opens

A fourth page, [service-levels.html](service-levels.html), adds the numbers a support team reports next to resolution and
satisfaction: first-reply time, service-level attainment by channel, and handle time read as a distribution rather than
a mean. It asks how each moves when chat opens, when a chat transfer splits one contact into two tickets, and when the
queue is measured per ticket or per issue. The arrivals are the support metrics round's simulated year, unchanged
([support-metrics.html](support-metrics.html)); a declared queue (email and chat seats on shift, worked oldest first)
gives every ticket its first reply. Everything is simulated from declared assumptions; no model is called.

The design ([DESIGN-service-levels.md](DESIGN-service-levels.md)), with its definitions and nine predictions, and the
frozen protocol ([servicelevels/protocol.json](servicelevels/protocol.json)) were committed before the main run. The
results rebuild from the seeds with no key and no network:

```sh
python3 -B -m servicelevels.analysis --verify   # rebuilds every result and data file; contents must match exactly
python3 -B tests/test_service_levels.py         # queue, definitions, replay and pinned results
python3 -B -m servicelevels.check_page          # every number on the page, recounted from the stored records
python3 -B -m servicelevels.protocol_check      # every pinned file still hashes to the frozen protocol
python3 -B -m servicelevels.render              # rewrites the page from the results
```

`servicelevels/data/main-year-service.csv.gz` holds every ticket of the main simulated year (seed 1) opened in weeks 20
to 39, with its arrival minute, first reply and handling minutes, including the true issue id a help desk never sees.
`servicelevels/results/` holds the summary with each prediction's verdict, each year's record and the sweeps.
`python3 -B -m servicelevels.analysis` rewrites them all; it runs the years in parallel processes
(`SERVICELEVELS_PROCS`, default up to 8). The full rebuild runs 200 years plus the sweeps, so it can also be run in
resumable chunks (`--chunk` and `--assemble`, described in the module).

The support metrics page and its checks are described in [README-support-metrics.md](README-support-metrics.md), and the
main page of this study in [README.md](README.md).
