skip to content

general code and the edge-case tail · lesson 2 of 9 · sources checked 2026-11-30

triage a new edge case

This lesson checks first if a new edge case is deliberate, and then gives each accidental case one of four outputs in a decision record.

status of this lesson: documented in my test system

purpose

Each new edge case asks for a decision, and a quick special case can look like the easy answer. Some cases are not faults of the collector: the site makes them on purpose. A special case then hides the evidence, and each other quick fix adds to the work that the team must keep.

objectives

  1. Check if a new edge case is deliberate before you change the collector.
  2. Name the six inputs of a triage decision.
  3. Select one of the four outputs with the triage tree.
  4. Write a decision record with an owner and a review date.

new terms

how it works

Triage has two steps. First, check if the case is deliberate. Then, give an accidental case one output, and write a decision record.

step 1: the deliberate check

A deliberate case occurs because the target sees the collector. An accidental case occurs because of the page itself.

The check uses the one-factor design of One-factor differences and experiment design (not yet published). Change one factor of the configuration at a time from a base. Look for the case each time.

  • The case occurs in each configuration. It is a property of the page, and it is accidental.
  • The case occurs only for some configurations of the collector. The target can see the collector, and the case is deliberate.

For example, a list page is empty for the collector, but it shows ten items in each other configuration. That is a deliberate case. A special case in the extractor then hides the evidence, and it can collect decoy data.

A deliberate case gets no special case and no fix. It is detection evidence about the own system. The output is a diagnosis of the own system, a slower pace, a volume cap, the declared path, or a stop. Until the owner decides, the target goes on the exclusion list.

step 2: the six inputs

An accidental case gets a decision from six inputs:

inputwhat it measuresexample value
FrequencyThe targets and the failures with this class5 targets
Customer valueThe value of the lost records in one quarter30 staff hours
Cost to fixThe work to make the change6 staff hours
Cost to keepThe work on the special case in each quarter2 staff hours
How far the change reachesThe targets that the change can affect40 targets
Error budget of the tailThe failures that the team accepts in one period3 failures

The last input is an error budget for the edge-case tail: the team decides how many failures it accepts with no work.

step 3: the four outputs

The triage tree asks its questions in this order:

  1. Does the class occur on three or more targets? Does the change pass on each target that it reaches? Then the output is a general fix in the general code.
  2. Is the customer value more than the cost to fix and the cost to keep together? Then the output is a special case.
  3. Does the error budget of the tail still hold this failure? Then the output is an accepted failure.
  4. Else, the target goes on the exclusion list: the product leaves it out.

estimate, not measured I use three targets as the limit for a general fix. I use one quarter as the period of the value and of the cost to keep.

For example, a case has a customer value of 12 staff hours in a quarter. The cost to fix is 3 hours, and the cost to keep is 2 hours. Thus 12 is more than 5, and the output is a special case.

step 4: the decision record

The record holds the edge-case class, the result of the deliberate check, the six inputs, the output, the owner, and a review date. An accepted failure and an entry on the exclusion list are not permanent.

At the review date, the owner looks at the inputs again. For example, an accepted failure with a review date three months later comes back to the owner in the next quarter.

what the benchmark platform records

The code history of the benchmark platform, my test system shows the cost of a decision with no rule to end it. A manual stop must have a second change to undo it, and a person must remember that change. For a different item class, the platform replaced the manual stop with a gate that drops the item and brings it back from evidence.

The same history shows how far a correct general fix can reach. A fix can make each rendered page of a protected site class read as a challenge. The correction is a separate field for the derived markers, and a test in the exact form of the production input.

the two sides

automation sidedetection side
A case that occurs only for the collector is evidence that the target sees the collector. A special case in the extractor then hides the evidence, and the collector can collect decoy data. The correct output is a diagnosis of the own system, a slower pace, a volume cap, the declared path, or a stop.A deliberate change of markup or a decoy is a test by the defender. A collector that follows each change fast shows that a person or a model maintains it.

design decisions

optiongaincostwhen it is correct
A quick special case for each new caseThe failure stops at once.The cost to keep grows, and a deliberate case stays hidden.Never before the deliberate check
The deliberate check firstDetection evidence does not become a special case.One test in each configurationFor each new case
A general fixOne change covers each target of the class.It reaches many targets.When the class occurs on three or more targets
An accepted failureNo work nowRecords stay lost until the review date.When the error budget of the tail holds it
The exclusion listThe team stops work that has no value.The customer loses the target.When no other output is correct

diagram

the triage tree: the deliberate check first, then one of four outputs

The deliberate check comes before each question about cost and value.source: My model of the triage tree

code example

The example gives a schema of a decision record and a validator. It checks three synthetic records. The class names and the owner names are synthetic.

m53-x03-triage.tstypescript

A schema of a triage decision record with the deliberate check, the six inputs, the output, and the review date, and a validator.

// Triage decision record: a schema and a validator. All records are synthetic.
type Output = "general-fix" | "special-case" | "exclusion-list" | "accepted-failure";
type Decision = {
  caseClass: string;
  deliberateCheck: "each-configuration" | "only-some-configurations";
  inputs: {
    targetsAffected: number; // frequency: targets with the class
    valueHours: number; // customer value in one quarter, in staff hours
    fixHours: number; // cost to fix
    keepHoursPerQuarter: number; // cost to keep
    reach: number; // targets that the change reaches
    tailBudgetLeft: number; // failures that the error budget of the tail still holds
  };
  output: Output;
  owner: string;
  decidedOn: string; // ISO date
  reviewOn: string; // ISO date
};

function validate(d: Decision): string[] {
  const faults: string[] = [];
  for (const [k, v] of Object.entries(d.inputs)) if (!(Number.isFinite(v) && v >= 0)) faults.push(`input ${k} is not a count`);
  if (d.owner.trim() === "") faults.push("no owner");
  if (!(d.reviewOn > d.decidedOn)) faults.push("the review date is not after the decision date");
  // A deliberate case is detection evidence: it never gets a special case or a fix.
  if (d.deliberateCheck === "only-some-configurations" && d.output !== "exclusion-list")
    faults.push("deliberate case: the output must be the exclusion list until the owner decides");
  if (d.output === "accepted-failure" && d.inputs.tailBudgetLeft < 1)
    faults.push("accepted failure, but the error budget of the tail is used up");
  return faults;
}

const records: Decision[] = [
  { caseClass: "comma as decimal mark", deliberateCheck: "each-configuration",
    inputs: { targetsAffected: 5, valueHours: 30, fixHours: 6, keepHoursPerQuarter: 0, reach: 40, tailBudgetLeft: 3 },
    output: "general-fix", owner: "team-a", decidedOn: "2026-03-02", reviewOn: "2026-06-01" },
  { caseClass: "empty list only for the collector", deliberateCheck: "only-some-configurations",
    inputs: { targetsAffected: 1, valueHours: 20, fixHours: 4, keepHoursPerQuarter: 6, reach: 1, tailBudgetLeft: 3 },
    output: "special-case", owner: "team-a", decidedOn: "2026-03-02", reviewOn: "2026-04-01" },
  { caseClass: "title in an image", deliberateCheck: "each-configuration",
    inputs: { targetsAffected: 1, valueHours: 1, fixHours: 8, keepHoursPerQuarter: 2, reach: 1, tailBudgetLeft: 0 },
    output: "accepted-failure", owner: "", decidedOn: "2026-03-02", reviewOn: "2026-03-02" },
];

for (const r of records) {
  const faults = validate(r);
  console.log(`${r.caseClass}: ${r.output}, ${faults.length === 0 ? "valid" : "refused"}`);
  for (const f of faults) console.log(`  ${f}`);
}

output

The output and the result of each record, and each refusal.

comma as decimal mark: general-fix, valid
empty list only for the collector: special-case, refused
  deliberate case: the output must be the exclusion list until the owner decides
title in an image: accepted-failure, refused
  no owner
  the review date is not after the decision date
  accepted failure, but the error budget of the tail is used up

The output shows that the validator refuses a special case for a deliberate case. It also refuses an accepted failure with no owner, no later review date, and no budget left.

failure modes

problemcausecorrection
The collector collects decoy data.A special case followed a deliberate case.Do the deliberate check first. A deliberate case gets no special case.
The cost to keep the special cases grows each quarter.Each new case got a special case with no comparison of value and cost.Use the six inputs and the triage tree for each case.
A general fix breaks targets that worked.Nobody checked how far the change reaches before the release.Pass the change first on each target that it reaches.
An accepted failure stays for ever.The record has no review date and no owner.Refuse a record with no owner and no later review date.
A stopped item comes back by mistake, or never comes back.A manual change must have a second manual change to undo it.Use a gate that drops the item and brings it back from evidence.

check questions

  1. A product page shows no price for the collector. In each other configuration of a one-factor test, the price is there. What is the correct action?

    1. Add a special case that reads the price from a second element.
    2. Treat the case as deliberate: no special case, and the target goes on the exclusion list until the owner decides.
    3. Add the failure to the error budget of the tail as an accepted failure.
    answer

    b. Treat the case as deliberate: no special case, and the target goes on the exclusion list until the owner decides.

    The case occurs only for some configurations of the collector, so the target can see the collector. A deliberate case is detection evidence. It gets no special case and no fix.

  2. Name the six inputs of a triage decision.

    sample answer

    The inputs are the frequency, the customer value, the cost to fix, and the cost to keep. The other two are how far the change reaches and the error budget of the tail.

  3. An accidental case occurs on one target. Its customer value is 4 staff hours in a quarter. The cost to fix is 5 hours, and the cost to keep is 1 hour. The error budget of the tail is used up. What is the output?

    1. General fix
    2. Special case
    3. Accepted failure
    4. Exclusion list
    answer

    d. Exclusion list

    One target is less than three targets, so no general fix. The value of 4 hours is less than 5 + 1 = 6 hours, so no special case. The budget is used up, so no accepted failure. The target goes on the exclusion list.

  4. Describe what a decision record of a triage holds, and why an accepted failure has a review date.

    sample answer

    The record holds the edge-case class, the result of the deliberate check, the six inputs, the output, the owner, and a review date. An accepted failure is not permanent. At the review date, the owner looks at the inputs again, because the value and the cost can change.

exercise

exercise Do this task on paper with the four synthetic cases below. The error budget of the tail holds 2 more failures. Use three targets as the limit for a general fix.

casedeliberate checktargetsvalue (hours)fix (hours)keep (hours)passes where it reaches
A: comma as decimal markeach configuration53060yes
B: date in a second elementeach configuration11232not applicable
C: list empty for the collectoronly some configurations12046not applicable
D: title in an imageeach configuration1182not applicable
  1. Do the deliberate check for each case.
  2. Use the triage tree for each accidental case.
  3. Write the output of each case.
  4. Write which outputs must have a review date.
sample answer

The answer uses the four cases and the budget of the task.

Case C occurs only for some configurations of the collector. It is deliberate, and it goes on the exclusion list as detection evidence. It gets no special case.

Case A occurs on five targets, and the change passes on each target that it reaches. The output is a general fix. Case B occurs on one target. Its value of 12 hours is more than 3 + 2 = 5 hours, thus the output is a special case.

Case D has a value of 1 hour, less than 8 + 2 = 10 hours. The budget holds 2 more failures, thus the output is an accepted failure. Cases C and D must have an owner and a review date.

sources

  1. My model of the deliberate check, the six inputs, the triage tree, and the decision record, 2026-11 (not public).
  2. Benchmark platform, code: the history of a manual stop and of a general fix in general form, 2026-11 (not public).