# Change 2: target rules judged against approved exceptions, and three sizing figures

Declared after every result of the first version had been read, and before the code below was written or run. Nothing
in the first version is edited: protocol-r1.json, predictions-r1.json and every results/*-r1.json file stay as they
are, and the pages report the first version's figures beside these.

## Why

In the first version a target rule caught a fault when its failure count moved off its count on the correct
conversion, up or down. A real go-live gate cannot use a fall as a signal. It works from an approved list of
exceptions: the failures found on the first full run, read one by one and accepted as defects of the source data. A
fault is then flagged only when a rule fails on more records than that list allows. This change scores the rules that
way. It was built for a doubt raised after the results, so it stays out of any headline hit rate.

## C2-A: rules counted only when their failures rise

- Scope: the 19 chosen and the 40 random faults, from the per-fault rule counts already stored in main-r1.json and
  fresh-r1.json (`target_rules.moved`). A rule fires on a fault when its failure count on the faulted conversion is
  higher than on the correct one. The quick checks (totals, target rules, code census) are recounted with it.
- Expectation, and why it is bookkeeping rather than a test: the stored counts already show that the two random draws
  that drop every 504 record only lower rule counts. So the rules are expected to catch 20 of 40 random faults (22
  before) and 15 of 19 chosen; the quick checks to stay at 25 of 40 and 17 of 19, since totals catch both drop draws.
  No pass bar: this is a rescoring.

## C2-B: three sizing figures

- The rebuild's break-even cost per escaped fault over the declared range of rebuild effort (10 to 25 days at the
  base day rate and 10 faults a conversion), from assumptions.json.
- The exact (Clopper-Pearson) 95% upper bound on the quick checks' miss share among the random faults that move a
  charge-off figure (1 of 15 in the first version).
- The smallest number of charge-off-moving faults that, with no miss, bounds that miss share under 10% at 95%.

Code: tools/change2.py. Output: results/change2-r2.json.
