FAILURE MAP
← Case archive

FA-58290 / Double-entry ledger accounting / Member archive

Payroll journal entry: year-to-date accumulation · case 05

A bonus paycheck in the same run is taxed as if the base had not been used.

Member previewVariant 5 · 3 implementations · 7 checks per implementation

Case contract

x = {'gross': [[employee, cents]] (an employee may appear twice), 'ytd': prior year-to-date gross, 'wage_base', 'ss_bp', 'med_bp', 'itax_bp', 'benefit': {employee: pre-tax deduction per paycheck}}. Per paycheck: social wages = min(gross, max(0, wage_base - ytd)), ytd then increases by gross; social tax = round(social wages * ss_bp / 10000), medicare = round(gross * med_bp / 10000) (no cap), income tax = round((gross - benefit) * itax_bp / 10000), all half-up; net = gross - social - medicare - income tax - benefit. The employer matches social and medicare. Return {'wage_expense', 'tax_expense', 'cash', 'withholding', 'benefits'} where withholding holds employee and employer taxes.

Why this case matters

Ledger software must keep debits equal to credits and apply normal-balance, period and cutoff rules exactly; small sign or boundary slips silently misstate financial statements.

One recorded failure

Sample boundary fixture

This sample comes from the broken implementation of a controlled reproducer.

Boundary fixtureActualExpectedOutcome
regression: year-to-date accumulation{"benefits": 10000, "cash": 205555, "tax_expense": 10445, "wage_expense": 250000, "withholding": 44890}{"benefits": 10000, "cash": 208655, "tax_expense": 7345, "wage_expense": 250000, "withholding": 38690}Failed

MEMBER ARCHIVE

The complete case is available to members.

This record includes three runnable implementations, regression fixtures, execution results, and source hashes.

Member access is invitation-based. Sign in with your invited account to inspect the sources.

Sign in to the archive ↗