part 11 · sources checked 2026-11-30
general code and the edge-case tail
This module teaches how to keep general code correct while the set of edge cases grows with no end.
purpose
general code must work for many sites, and each new site can bring a new edge case.
After the module, you can count the cases of each component and estimate the unseen part of the tail. You can also decide, place, and retire each case.
objectives
- Count the special cases of each general component. Compute the unseen share and the Chao1 bound from a failure log.
- Check if a new edge case is a deliberate case. Then decide it with one of four outputs.
- Put a special case in data, in an adapter, or in the general code. Add an override precedence and a generic fallback.
- Build a closed output list with an unknown class. Work the queue of unknown cases at a fixed interval.
- Add one case with a test in the production shape and a mutation record. Keep one source for each fact.
- Gate a change to general code with a noise baseline and a differential run on a stored corpus.
- Make a correction replay over stored evidence. Quarantine only the rows that the evidence proves wrong.
- Give each override an owner, an expiry, and a hit counter. Publish what the product covers and what it does not cover.
lessons
9 of 9 published
- L01 count the special cases and measure the tail
- L02 triage a new edge case
- L03 the override layer
- L04 the unknown class and the review loop
- L05 add one case without a regression
- L06 the regression corpus and the differential run
- L07 tests with no expected page
- L08 corrections that reach the past
- L09 retire special cases and hold the scope