# Systematic debugging run notes

These are agent-authored workflow notes, not a verbatim chat transcript.

Request: A removed cart line (quantity 0) still contributes 1250 cents. Diagnose and fix the self-contained fixture; keep omitted quantity defaulting to one.

## 1. Investigation
Read the assertion: actual 1250, expected 0 at fixture.test.mjs:5. Reproduced with Node's real test runner: 1 failure, 3 passes (red.txt). This is a deliberately seeded teaching fixture authored for this showcase, not an incident from a production project. No prior change history or external component boundary exists.

Trace: lineTotal(1250, 0) -> quantity || 1 -> 1 -> 1250. The zero is lost at default selection before multiplication.

## 2. Pattern comparison
The working omitted/null cases need the default 1; explicit 2 must remain 2. The distinguishing input is a present but falsy numeric zero. There are no dependencies or mocks.

## 3. Hypothesis (recorded before changing the fixture)
Logical OR treats valid zero as missing. Replacing only || with ?? will preserve zero while retaining null/undefined defaults. The four independently derived literal assertions test both the symptom and neighboring behavior. A return of 0 for all inputs would fail the three other cases.

## 4. Implementation and verification
See fix.patch for the single expression change. Run the same complete fixture suite after applying it; retain green.txt. No refactoring or unrelated changes. No human patch edits. Invalid, negative and fractional quantities are outside this fixture's contract; no claim about production cart suitability.
