feat(practice): flag suspiciously short laps and remove any lap in one click

Practice laps under 85% of the driver's own median (a likely shortcut)
are flagged: counted, but never a best lap, record or training stat
until approved. Timing and Race Day get a one-click Approve/Remove
panel, overlays show a warning mark, and any lap can be removed or
restored from Timing and Judging with undo.

Also sends judge corrections straight to the server so its hot-results
protection can no longer hold back a correction made right after a
passing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
larssand
2026-10-07 19:53:23 +02:00
parent 3cc4fa0845
commit 8601954ea2
24 changed files with 556 additions and 60 deletions

View File

@@ -40,8 +40,9 @@ export async function startFakeDecoder() {
// listening so the frontend's own reconnect logic has somewhere to reconnect to.
dropConnections: () => { for (const socket of sockets) socket.destroy(); },
// Sends an AMMC-style PASSING message as an unmasked server->client WebSocket text frame.
sendPassing: (transponder) => {
const payload = Buffer.from(JSON.stringify({ msg: "PASSING", transponder: String(transponder), rtc_time: new Date().toISOString() }));
// `at` (ms) sets the decoder's own passing time, for exact lap times in a test.
sendPassing: (transponder, at = Date.now()) => {
const payload = Buffer.from(JSON.stringify({ msg: "PASSING", transponder: String(transponder), rtc_time: new Date(at).toISOString() }));
const header = payload.length < 126
? Buffer.from([0x81, payload.length])
: Buffer.from([0x81, 126, payload.length >> 8, payload.length & 0xff]);