validations.ts
@file Every statement this Worker runs against validations. Same rule…
Overview
@file Every statement this Worker runs against validations. Same rule
as rigs.ts and testRequests.ts: no SQL built by concatenation, every
value a bound parameter.
depends on matrix.ts · used by matrix.ts test-result.ts roleConnection.ts
API
Fexport async function recordValidation(db: D1Database | undefined, v: NewValidation): Promise<void>
Records one test event. Never overwrites a prior result for the same
pair — a re-test is a new row, so the history survives even though
/matrix only ever reads the latest.
handler · calls need, runFexport async function countValidationsByTester(db: D1Database | undefined, userId: string): Promise<number>
How many test results one person has recorded — the Linked Roles
validated_runs metadata field.
computeRegistryMetadata · calls need, runFexport async function latestValidations(db: D1Database | undefined): Promise<ValidationStatus[]>
The most recent result per (board, ios_version) — what /matrix shows
as ✅/❌. A dead-tie on tested_at for the same pair (two rows written
at the exact same millisecond) can duplicate a pair in the result; that
is a display redundancy, not a wrong glyph, since every caller reads
this with .find() and takes the first match either way.
handler · calls need, runUndocumented (3)
ValidationsUnavailable.constructor, need, run