Signalbox harbor / ledgerline 112,408 agents on the line

Why

Blame → Why

Every line carries the intent, the attempt, the step, the reasoning and the tests behind it. Pick a band in the gutter.

refunds/splitTender.ts version v7 main @ c41e90b 38 lines · 8 bands · 3 agents, 1 human

Provenance by line

Lines dimmed when not yet written at the scrubber step
Attempt #31 · ag-7f3a Tests-derived · #12 · ag-21c9 Human edit · Jonas Weber Later fix · INT-4790

How the file came to be

Session ag-7f3a / attempt #31 · one commit per step
read edit test run test failed think

Ask why

Answers come from stored steps, with citations

Because card wins ties, and only ties. The leftover cent goes to the leg with the largest remainder. When remainders are equal, a rank rule puts card first, so gift balance never rounds up.

Example: refund 0.01 on a payment of 1.00 card plus 1.00 gift. Each share is 0.5 cents, floors are 0, both remainders are 100, and one cent is left. Card takes it.

  1. Spec line 3 forbids refunding a tender more than its pro rata share by more than rounding allows. ag-7f3a read it at and chose largest remainder over floor-and-give-to-card.
  2. The first version broke ties by array order, so a payment listed gift-first sent the cent to gift. ag-7f3a noted this at and left it.
  3. Jonas Weber replaced array order with tieRank on 14 Oct (commit 3f9ac21): gift balance is reported in whole units, and rounding it up caused a monthly reconcile break.
  4. The tie is pinned by tie goes to card, which passed at and on main.
INT-4812→#31→step 52→Jonas 3f9ac21→lines 23 to 27

Why this is different