FAILURE MAP
← Case archive

FA-62731 / Tax bracket computation / Open access

Earned income is counted toward the parent-rate amount · case 01

A working teenager's wages are taxed at the parent's rate.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Net unearned income is computed from earned + unearned.

VERIFIED REPAIR

Only unearned income counts toward net unearned income.

Unsuccessful approach: Subtracting the child's standard deduction instead of 2600 mixes the deduction with the threshold.

Case contract

solve(earned, unearned, parent_rate): stipulated child unearned-income rule, whole dollars. Standard deduction = min(14600, max(1300, earned + 450)); taxable = max(0, earned + unearned - std). Net unearned income = max(0, unearned - 2600); the part of taxable income taxed at the parent's rate (percent string) is min(net unearned, taxable); the rest is taxed at 10%. Return integer cents half-up.

Why this case matters

Tax computations hinge on which slice, threshold, ordering and rounding rule applies at each step; a misplaced boundary silently misstates liabilities.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(earned, unearned, parent_rate):
    def prog(x, br):
        tax, lower = Fraction(0), 0
        for upper, rate in br:
            top = x if upper is None else min(x, upper)
            if top > lower: tax += (top - lower) * Fraction(rate) / 100
            if upper is None or x <= upper: break
            lower = upper
        return tax
    def cents(v):
        v = v * 100
        return int(v + Fraction(1, 2)) if v >= 0 else -int(-v + Fraction(1, 2))
    
    std = min(14600, max(1300, earned + 450))
    taxable = max(0, earned + unearned - std)
    net_unearned = max(0, earned + unearned - 2600)
    at_parent = min(net_unearned, taxable)
    tax = at_parent * Fraction(parent_rate) / 100 + (taxable - at_parent) * Fraction(10, 100)
    return cents(tax)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression earned-excluded 1', (20000, 5000, '24'), 137600),
  ('regression earned-excluded 2', (3000, 3000, '35'), 35500), ('control: unearned only', (0, 5000, '32'), 89800),
  ('control: below threshold', (0, 2000, '32'), 7000), ('control: large trust income', (0, 60000, '37'), 2136800),
  ('control: earned only', (8000, 0, '22'), 0)],
 [('regression earned-excluded 1', (16766, 0, '32'), 21660),
  ('regression earned-excluded 2', (8000, 5662, '22'), 88864), ('partial repair guard 1', (0, 5000, '32'), 89800),
  ('partial repair guard 2', (0, 2000, '32'), 7000), ('control: mixed small', (3000, 3000, '35'), 35500),
  ('control: large trust income', (0, 60000, '37'), 2136800), ('control: earned only', (8000, 0, '22'), 0),
  ('control: working teen', (20000, 5000, '24'), 137600)],
 [('regression earned-excluded 1', (1000, 60000, '22'), 1284300),
  ('regression earned-excluded 2', (3000, 5000, '32'), 98300), ('partial repair guard 1', (0, 60000, '37'), 2136800),
  ('partial repair guard 2', (0, 2600, '22'), 13000), ('control: unearned only', (0, 5000, '32'), 89800),
  ('control: below threshold', (0, 2000, '32'), 7000), ('control: working teen', (20000, 5000, '24'), 137600),
  ('control: mixed small', (3000, 3000, '35'), 35500)],
 [('regression earned-excluded 1', (3000, 1300, '24'), 8500),
  ('regression earned-excluded 2', (8000, 5000, '24'), 79100), ('partial repair guard 1', (8000, 5662, '22'), 88864),
  ('partial repair guard 2', (1000, 60000, '22'), 1284300), ('control: mixed small', (3000, 3000, '35'), 35500),
  ('control: large trust income', (0, 60000, '37'), 2136800), ('control: earned only', (8000, 0, '22'), 0),
  ('control: unearned only', (0, 5000, '32'), 89800)],
 [('regression earned-excluded 1', (20000, 5000, '35'), 164000),
  ('regression earned-excluded 2', (3000, 2601, '22'), 21522), ('partial repair guard 1', (3000, 5000, '32'), 98300),
  ('partial repair guard 2', (8000, 5000, '24'), 79100), ('control: unearned only', (0, 5000, '32'), 89800),
  ('control: below threshold', (0, 2000, '32'), 7000), ('control: working teen', (20000, 5000, '24'), 137600),
  ('control: mixed small', (3000, 3000, '35'), 35500)]]
for label, args, expected in cases[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression earned-excluded 1249600137600Failed
regression earned-excluded 28925035500Failed
control: unearned only8980089800Passed
control: below threshold70007000Passed
control: large trust income21368002136800Passed
control: earned only00Passed

SHA-256 / 07984c7f45e12550707b49ed45b0e32a49aacb48a783a637137bc67039bc2719

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(earned, unearned, parent_rate):
    def prog(x, br):
        tax, lower = Fraction(0), 0
        for upper, rate in br:
            top = x if upper is None else min(x, upper)
            if top > lower: tax += (top - lower) * Fraction(rate) / 100
            if upper is None or x <= upper: break
            lower = upper
        return tax
    def cents(v):
        v = v * 100
        return int(v + Fraction(1, 2)) if v >= 0 else -int(-v + Fraction(1, 2))
    
    std = min(14600, max(1300, earned + 450))
    taxable = max(0, earned + unearned - std)
    net_unearned = max(0, unearned - std)
    at_parent = min(net_unearned, taxable)
    tax = at_parent * Fraction(parent_rate) / 100 + (taxable - at_parent) * Fraction(10, 100)
    return cents(tax)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression earned-excluded 1', (20000, 5000, '24'), 137600),
  ('regression earned-excluded 2', (3000, 3000, '35'), 35500), ('control: unearned only', (0, 5000, '32'), 89800),
  ('control: below threshold', (0, 2000, '32'), 7000), ('control: large trust income', (0, 60000, '37'), 2136800),
  ('control: earned only', (8000, 0, '22'), 0)],
 [('regression earned-excluded 1', (16766, 0, '32'), 21660),
  ('regression earned-excluded 2', (8000, 5662, '22'), 88864), ('partial repair guard 1', (0, 5000, '32'), 89800),
  ('partial repair guard 2', (0, 2000, '32'), 7000), ('control: mixed small', (3000, 3000, '35'), 35500),
  ('control: large trust income', (0, 60000, '37'), 2136800), ('control: earned only', (8000, 0, '22'), 0),
  ('control: working teen', (20000, 5000, '24'), 137600)],
 [('regression earned-excluded 1', (1000, 60000, '22'), 1284300),
  ('regression earned-excluded 2', (3000, 5000, '32'), 98300), ('partial repair guard 1', (0, 60000, '37'), 2136800),
  ('partial repair guard 2', (0, 2600, '22'), 13000), ('control: unearned only', (0, 5000, '32'), 89800),
  ('control: below threshold', (0, 2000, '32'), 7000), ('control: working teen', (20000, 5000, '24'), 137600),
  ('control: mixed small', (3000, 3000, '35'), 35500)],
 [('regression earned-excluded 1', (3000, 1300, '24'), 8500),
  ('regression earned-excluded 2', (8000, 5000, '24'), 79100), ('partial repair guard 1', (8000, 5662, '22'), 88864),
  ('partial repair guard 2', (1000, 60000, '22'), 1284300), ('control: mixed small', (3000, 3000, '35'), 35500),
  ('control: large trust income', (0, 60000, '37'), 2136800), ('control: earned only', (8000, 0, '22'), 0),
  ('control: unearned only', (0, 5000, '32'), 89800)],
 [('regression earned-excluded 1', (20000, 5000, '35'), 164000),
  ('regression earned-excluded 2', (3000, 2601, '22'), 21522), ('partial repair guard 1', (3000, 5000, '32'), 98300),
  ('partial repair guard 2', (8000, 5000, '24'), 79100), ('control: unearned only', (0, 5000, '32'), 89800),
  ('control: below threshold', (0, 2000, '32'), 7000), ('control: working teen', (20000, 5000, '24'), 137600),
  ('control: mixed small', (3000, 3000, '35'), 35500)]]
for label, args, expected in cases[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression earned-excluded 1104000137600Failed
regression earned-excluded 22550035500Failed
control: unearned only11840089800Failed
control: below threshold224007000Failed
control: large trust income21719002136800Failed
control: earned only00Passed

SHA-256 / 9ce5ba222a2efd7001d82ca3c77da5bb139e9ae0bbfa08ff2adc9bd79edb907d

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
from fractions import Fraction
N = 1
observations = []
def solve(earned, unearned, parent_rate):
    def prog(x, br):
        tax, lower = Fraction(0), 0
        for upper, rate in br:
            top = x if upper is None else min(x, upper)
            if top > lower: tax += (top - lower) * Fraction(rate) / 100
            if upper is None or x <= upper: break
            lower = upper
        return tax
    def cents(v):
        v = v * 100
        return int(v + Fraction(1, 2)) if v >= 0 else -int(-v + Fraction(1, 2))
    
    std = min(14600, max(1300, earned + 450))
    taxable = max(0, earned + unearned - std)
    net_unearned = max(0, unearned - 2600)
    at_parent = min(net_unearned, taxable)
    tax = at_parent * Fraction(parent_rate) / 100 + (taxable - at_parent) * Fraction(10, 100)
    return cents(tax)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
cases = [[('regression earned-excluded 1', (20000, 5000, '24'), 137600),
  ('regression earned-excluded 2', (3000, 3000, '35'), 35500), ('control: unearned only', (0, 5000, '32'), 89800),
  ('control: below threshold', (0, 2000, '32'), 7000), ('control: large trust income', (0, 60000, '37'), 2136800),
  ('control: earned only', (8000, 0, '22'), 0)],
 [('regression earned-excluded 1', (16766, 0, '32'), 21660),
  ('regression earned-excluded 2', (8000, 5662, '22'), 88864), ('partial repair guard 1', (0, 5000, '32'), 89800),
  ('partial repair guard 2', (0, 2000, '32'), 7000), ('control: mixed small', (3000, 3000, '35'), 35500),
  ('control: large trust income', (0, 60000, '37'), 2136800), ('control: earned only', (8000, 0, '22'), 0),
  ('control: working teen', (20000, 5000, '24'), 137600)],
 [('regression earned-excluded 1', (1000, 60000, '22'), 1284300),
  ('regression earned-excluded 2', (3000, 5000, '32'), 98300), ('partial repair guard 1', (0, 60000, '37'), 2136800),
  ('partial repair guard 2', (0, 2600, '22'), 13000), ('control: unearned only', (0, 5000, '32'), 89800),
  ('control: below threshold', (0, 2000, '32'), 7000), ('control: working teen', (20000, 5000, '24'), 137600),
  ('control: mixed small', (3000, 3000, '35'), 35500)],
 [('regression earned-excluded 1', (3000, 1300, '24'), 8500),
  ('regression earned-excluded 2', (8000, 5000, '24'), 79100), ('partial repair guard 1', (8000, 5662, '22'), 88864),
  ('partial repair guard 2', (1000, 60000, '22'), 1284300), ('control: mixed small', (3000, 3000, '35'), 35500),
  ('control: large trust income', (0, 60000, '37'), 2136800), ('control: earned only', (8000, 0, '22'), 0),
  ('control: unearned only', (0, 5000, '32'), 89800)],
 [('regression earned-excluded 1', (20000, 5000, '35'), 164000),
  ('regression earned-excluded 2', (3000, 2601, '22'), 21522), ('partial repair guard 1', (3000, 5000, '32'), 98300),
  ('partial repair guard 2', (8000, 5000, '24'), 79100), ('control: unearned only', (0, 5000, '32'), 89800),
  ('control: below threshold', (0, 2000, '32'), 7000), ('control: working teen', (20000, 5000, '24'), 137600),
  ('control: mixed small', (3000, 3000, '35'), 35500)]]
for label, args, expected in cases[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
regression earned-excluded 1137600137600Passed
regression earned-excluded 23550035500Passed
control: unearned only8980089800Passed
control: below threshold70007000Passed
control: large trust income21368002136800Passed
control: earned only00Passed

SHA-256 / 50d90261dee3ad710684fb789f3951b2a63d3e5ff60ae1f27071bc08aec724bc

Verification & scope

A deterministic, bounded teaching model with a stipulated toy contract; it makes no claim of conformance to any real regulation, standard, or institution's rules. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:47:07.335351+00:00.

Case digest / 998cc9ef1ae221554bcdccbc150f6b2424337c5b13bbf6a262e869cf02bd6a53