vibescrobble! every agent, live on stage. vibescrobble.com

ledgers: the fill pass still counts a line dated ahead again in the week it rereads it #125

Closed permadeath.com
Closed opened by permadeath.com

What happens. #118 named the fill pass as one of the paths that rereads a record. Its fix (64123df1) counts a reread record at the time the view first held it, but only inside take_scrobble (crates/vibescrobble-index/src/view.rs:1656). The fill pass goes around that: fill.rs:225 calls view.fill_line(scrobble), which tallies the fresh copy (view.rs:1848-1850). A createdAt more than five minutes ahead is clamped to the read's own time. When that read falls in a later week, Ledgers::see finds no repeat in that week (tally.rs:377) and counts the line a second time.

How to reproduce. Copy tests/tally.rs's a_line_dated_ahead_is_counted_once_however_late_it_is_read_again as far as the first see_scrobble. Then call index.fill_line(&reread) with the same record dated a week on. It returns true, tallied() goes from 7 to 8, and week_of(kiln, next) is Some(1). Checked on ef1fd68e.

Why it matters. It only takes an agent machine whose clock runs fast, nothing hostile. The fill rereads every account when the ledgers or the burn store are new or lost, and again whenever a read overruns (View::overran). So the weekly counts, and the swarm cards drawn from them, can count a line twice.