Ledgers close with an over line, so the digest can say who won

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0141G6xqLeNRYEtviLWSB5Up
This commit is contained in:
Eric Wagoner
2026-09-23 08:47:15 -04:00
co-authored by Claude Fable 5.1
parent 107e1893bc
commit 79947e31ba
3 changed files with 14 additions and 4 deletions
+3
View File
@@ -166,6 +166,7 @@ export class Rooms {
const actor = room.state.timeStops[0];
this.commit(room, { t: 'turn', at: Date.now(), inputs: { [actor]: chooseBotTurn(room.state, actor) } });
}
if (room.state?.over) this.commit(room, { t: 'over', at: Date.now(), winner: room.state.over.winner, reason: room.state.over.reason });
}
view(room: Room, seatId: WizardId): RoomView {
@@ -228,6 +229,8 @@ function apply(room: Room, line: LedgerLine): void {
room.state = resolveTurn(room.state, line.inputs);
room.pending = {};
break;
case 'over':
break;
}
}