# Support metrics that stay honest: design

Written and committed before any code or run. The frozen protocol, `supportmetrics/protocol.json`, is written after the
code passes its unit tests and a pilot on three pilot seeds, and before the main run; it pins the hash of this file and
of every code file the results depend on. Anything decided after seeing results is labelled as such on the page. No
model is called anywhere in this round: the classifier is a declared confusion matrix and every reader is a written
rule.

## What this round adds

The main page of this study counts self-service tasks: a task succeeds only when it finishes without an analyst's help,
stays finished for a week and holds up in a blind check, and a ticket count is volume, never success. The second page
measures how much the screen around an AI assistant that acts for a user changes the share of tasks that end correct.
Neither looks inside the support queue itself. This round asks how the support team's own numbers behave: resolution,
reopen rate, satisfaction, contacts per active account and contact drivers, under definitions a reasonable team could
defend, and whether the team can tell a real contact spike from a change in how contacts are counted. It reuses one rule
from the main page, one ID per customer issue across channels, and tests what that rule is worth on support metrics.

## Question

When a support team reports resolution rate, reopen rate, satisfaction and contacts per active account, how much do
denominator and classification choices change those numbers, and can the team tell a real contact spike from a
measurement artefact? No direction is claimed in advance.

## Data (explicitly synthetic, `supportmetrics/model.py`)

One synthetic support year of 52 weeks plus a following quarter of 13 weeks used only as the staffing truth. Day 0 is the
first day of week 1; nothing carries a calendar date.

Accounts. Weekly active accounts by plan, growing week on week: Basic starts at 40,000 and grows 0.25% a week, Standard
9,000 and 0.40%, Enterprise 800 and 0.50%. In the holiday week (week 47) active accounts are 80% of trend.

Contacts. Each week, for each plan and each true driver, the number of new customer issues is a binomial draw over that
week's active accounts with a per-account rate: 12 issues per 1,000 Basic accounts a week, 45 per 1,000 Standard and 160
per 1,000 Enterprise, split by driver as billing 20%, sign-in and access 18%, product errors 15%, how-to questions 32%
and account changes 15%. That is about 1,000 issues a week at the start. Within a week, issues are spread over the seven
days with weekend days at 40% of a weekday.

Tickets. Every issue has one customer-facing ticket. Before week 30 every issue arrives by email. From week 30 a chat
channel opens (see the events). 4% of issues also get a duplicate email ticket from the same customer 0 to 2 days after
opening, closed as solved the day it arrives, with 2 minutes of handling and no survey.

Escalation, by driver: billing 6%, sign-in 10%, product errors 30%, how-to 3%, account changes 5%.

First response (recorded, not used in any result): exponential, mean 5 hours by email and 3 minutes in chat, 2.5 times
longer for issues opened in the holiday week.

Solve. An email ticket is first solved a whole number of days after opening: the floor of an exponential draw with mean
1.2 days, or 1 plus the floor of an exponential draw with mean 4 days if escalated, plus 2 days if opened in the holiday
week. A chat-resolved issue is solved the day it opens.

Reopen. At most one reopen per customer-facing ticket. Probability 7% for email and 10% for chat-resolved, plus 8 points
if escalated and plus 4 points for product errors. Of reopens, 70% come 1 to 7 days after the first solve and 30% come 8
to 30 days after it (uniform whole days). A reopened ticket is solved again 1 plus the floor of an exponential draw with
mean 1.5 days later.

Handling time. Customer-facing email ticket: lognormal with median 18 minutes and log standard deviation 0.6, times 1.8
if escalated. Chat-resolved: lognormal with median 12 minutes and log standard deviation 0.5. A chat ticket that is
transferred: 5 minutes. A duplicate: 2 minutes. Each reopen adds 15 minutes.

Satisfaction (known for every issue, observed only through surveys). At the first solve, satisfied with probability 0.88
if the ticket will not be reopened and 0.55 if it will, times 0.85 if escalated, 0.92 if transferred from chat, 0.95 if
the first solve took more than 3 days, 0.95 for Enterprise and 0.95 if opened in the holiday week. At the second solve
of a reopened ticket, 0.45 times the same factors (except the reopen one). An issue's true final satisfaction is its
second-solve value if reopened and its first-solve value otherwise.

Surveys. One survey at each solve of the customer-facing ticket (first and, if reopened, second). Transferred chat
tickets and duplicates get none. A survey is answered with probability 0.15 by email and 0.30 in chat, times 0.5 for
Enterprise and 1.1 for Basic, times 1.5 for the survey after a reopen, and times 1.4 when the customer is not satisfied
at that solve (non-response that depends on the answer itself, which no weighting on recorded fields can remove).

Driver classifier. Every ticket gets a label drawn from the row of a declared confusion matrix for its true driver
(rows are true drivers, columns labels, in the order billing, sign-in, product errors, how-to, account changes). Version
1 labels tickets opened in weeks 1 to 39, version 2 from week 40.

Version 1:

| true \ label | billing | sign-in | product errors | how-to | account changes |
|---|---|---|---|---|---|
| billing | 0.88 | 0.02 | 0.01 | 0.05 | 0.04 |
| sign-in | 0.02 | 0.85 | 0.05 | 0.06 | 0.02 |
| product errors | 0.01 | 0.06 | 0.72 | 0.18 | 0.03 |
| how-to | 0.03 | 0.04 | 0.08 | 0.80 | 0.05 |
| account changes | 0.05 | 0.03 | 0.02 | 0.06 | 0.84 |

Version 2:

| true \ label | billing | sign-in | product errors | how-to | account changes |
|---|---|---|---|---|---|
| billing | 0.88 | 0.02 | 0.01 | 0.04 | 0.05 |
| sign-in | 0.02 | 0.86 | 0.04 | 0.04 | 0.04 |
| product errors | 0.01 | 0.04 | 0.82 | 0.10 | 0.03 |
| how-to | 0.03 | 0.03 | 0.06 | 0.62 | 0.26 |
| account changes | 0.04 | 0.03 | 0.02 | 0.04 | 0.87 |

Before each version ships, a labelled validation sample of 400 tickets, with true drivers drawn in the base driver
shares, gives the team its estimate of that version's matrix (row counts divided by row totals). The team never sees the
declared matrix itself.

Linking. A ticket that belongs to an issue already open (a duplicate, or the email ticket of a transferred chat) is
linked to that issue with probability 0.9. An unlinked ticket counts as a separate issue in every issue-level measure.

Randomness. Every draw comes from a stream seeded by the year's seed and its cell (week, plan, driver), and every issue
draws the same fixed list of uniform numbers whatever path it takes, so the same seed with an event switched off differs
only where that event acts.

## Injected events

1. A real product bug: in weeks 18 and 19, product-error issues per Standard and Enterprise account double.
2. A holiday dip: in week 47 active accounts fall to 80% and issues per active account to 75% (about 60% of normal
   volume); in week 48 issues per active account are 115% of normal as deferred contacts arrive; solves of week 47
   issues take 2 days longer.
3. A channel change that splits tickets: from week 30, 30% of issues start in chat. Half of those, and every escalated
   one, are transferred: the chat ticket is closed as solved on the same day and a new email ticket opens for the same
   issue. Demand does not change.
4. A classifier relabel: version 2 replaces version 1 from week 40. Demand does not change.

## The choices measured

Resolution, for tickets or issues opened in a quarter, read 35 days after the quarter's last day so that every window
has closed:

- tickets solved at least once, over tickets opened (resolution at first solve);
- tickets solved and not reopened within 7 days of the first solve;
- linked issues whose tickets were all solved, with no reopen within 7 days;
- the same with no reopen within 30 days.

Reopen rate: reopened within 7 days and within 30 days, over tickets solved.

Satisfaction, for surveys of tickets opened in the quarter:

- responders, ticket level: satisfied answers over all answers;
- responders, issue level: each linked issue's latest survey, if answered;
- weighted for non-response: the issue-level answers weighted by one over the answer rate of their cell, where cells
  are channel by plan by whether the ticket was reopened (all recorded fields);
- the truth, available only here: true final satisfaction over every true issue opened in the quarter.

Contact rate: tickets a week; tickets per 1,000 weekly active accounts; linked issues per 1,000 weekly active accounts.

Drivers: label shares as the classifier gives them, against shares corrected by solving the estimated matrix of the
version in use against the label counts (negative estimates set to zero), against the true shares.

Cost per contact: workload hours at US$40 an agent hour, over tickets and over linked issues.

Every quarter is computed; the headline quarter, fixed here, is weeks 27 to 39, the quarter of the channel change. The
main year, fixed here, is seed 1; every quarterly figure is also reported as the 5th to 95th percentile over the 200
main seeds.

## Reading the weekly series: four setups

Each setup watches six weekly series from week 13 to week 52: total volume and one series per driver.

1. Ticket counts: tickets opened a week, and per driver label.
2. Tickets per 1,000 active accounts: the same, divided by the week's active accounts.
3. Linked issues per 1,000 active accounts: issues as linking leaves them, dated by their first ticket and labelled by
   it.
4. Linked issues per 1,000 active accounts with corrected drivers and a holiday calendar: setup 3, with driver series
   corrected by the version's estimated matrix, and declared holiday weeks (47 and 48) handled by the holiday rule.

The rule: for each series and week, the baseline is the median of the previous 12 weeks (for setup 4, the previous 12
weeks that are not holiday weeks), the scale is the larger of 1.4826 times their median absolute deviation and 2% of
the median, and z is the week's value minus the median, over the scale. z of 4 or more is a spike alarm, z of minus 4
or less a drop alarm. The holiday rule (setup 4 only): week 47 is not tested; at week 48 the sum of weeks 47 and 48 is
tested against twice the median with the scale times the square root of 2.

An event is read correctly when:

- product bug: a spike alarm on the product-errors series in week 18 or 19;
- holiday: no alarm of either kind on any series in weeks 47 to 49;
- channel change: no spike alarm on any series in weeks 30 and 31;
- classifier relabel: no spike alarm on any series in weeks 40 and 41.

Also counted: spike alarms in quiet weeks (weeks 13 to 52 outside weeks 18 to 21, 30 to 37 and 40 to 50), per year and
setup. The control is the same 200 seeds with all four events switched off: the share of years with an alarm of the
counted kind in each event's window shows the chance level.

## Staffing

Each definition implies a headcount for the following quarter (weeks 53 to 65): weekly volume times handling minutes per
unit, plus volume times the reopen rate times 15 minutes, over 60, over 26.25 productive hours per agent a week (37.5
hours less 30% shrinkage). Handling minutes are always measured in the same unit as the volume.

Volume, from the last 8 weeks of the year (45 to 52):

- tickets a week, held flat;
- tickets per active account, times the projected active accounts (log-linear trend fitted to weeks 40 to 52 without the
  holiday week);
- linked issues per active account, times the same projection.

Rework:

- at first solve: reopens seen by the end of week 52 among units solved in weeks 45 to 52;
- 7-day window: units solved in weeks 44 to 51 reopened within 7 days;
- 30-day window: units solved in weeks 41 to 48 reopened within 30 days.

The truth is the mean weekly workload of weeks 53 to 65: the handling minutes of every ticket opened in the week, plus
15 minutes for each of those tickets that is ever reopened. Each plan is compared with it in agents and in US$ a year at
US$72,000 a loaded agent year.

## Runs, intervals and sweeps

- Pilot: seeds 9001 to 9003, run before the protocol is frozen, to check that the code runs and that base rates match
  this file (issues a week, tickets per issue, reopen and answer rates). The pilot prints base rates only; its
  readings are not looked at or used. Any parameter changed after the pilot is listed in the protocol.
- Main run: seeds 1 to 200, events on, run once after the protocol is frozen. Control: the same seeds, events off.
- Shares of years are reported with Wilson 95% intervals.
- Sweeps, one input at a time with the others at their main values, 40 seeds each (seeds 1 to 40): the bug's multiplier
  (1.2, 1.4, 1.6, 1.8, 2.0, 2.5), the linking rate (0.5, 0.7, 0.8, 0.9, 0.95, 1.0), the validation sample per classifier
  version (100, 200, 400, 800 tickets), the answer factor for unsatisfied customers (1.0, 1.2, 1.4, 1.8), and, on the
  200 main seeds without re-simulation, the alarm threshold (z of 3, 3.5, 4, 5).
- Worked example, by a rule fixed here: in seed 1, the first issue by id opened in week 31 that started in chat, was
  transferred, and was reopened 8 to 30 days after its first solve.

A defect found after the main run is fixed in a declared re-run, and both results are reported.

## Limits known before running

Everything is synthetic, and every rate, event and reading rule above is my assumption; the results are consequences of
those assumptions, not measurements of any support team. One author wrote the data model, the events and the setups, so
the readings are a self-test. Some readings are true by construction: a setup with a holiday calendar cannot misread a
declared holiday, and with perfect linking or an exact matrix the channel change and the relabel cannot move setup 4's
series; what the run measures is how far imperfect linking, a sampled matrix and noise leave that true. The classifier
is a declared confusion matrix, not a trained model. Chat concurrency, service-level targets and queueing are not
modelled in the staffing plans. Nothing here claims support-operations employment, and no help-desk product is named or
imitated.
