Fix: reject logs whose QSO dates do not match the selected contest month #6

Merged
kiro_agent merged 3 commits from fix/qso-date-contest-match into main 2026-10-24 14:20:37 +00:00
Owner

A March log could be uploaded into the October slot — the robot never compared the file QSO dates to the chosen Monthly Contest. Adds a date-match guard on BOTH preview and submit that blocks (400, bilingual message naming contest month vs file dates) when QSO dates fall outside the selected contest month. Format-tolerant (Cabrillo YYYY-MM-DD and ADIF YYYYMMDD). Individual in-window time anomalies stay the advisory OUT_OF_TIME flag; this is a wrong-slot input guard, not rule adjudication (never-reject still applies to contest-RULE compliance). 137 tests pass incl. a new guard test; two existing tests updated to use date-aligned fixtures.

A March log could be uploaded into the October slot — the robot never compared the file QSO dates to the chosen Monthly Contest. Adds a date-match guard on BOTH preview and submit that blocks (400, bilingual message naming contest month vs file dates) when QSO dates fall outside the selected contest month. Format-tolerant (Cabrillo YYYY-MM-DD and ADIF YYYYMMDD). Individual in-window time anomalies stay the advisory OUT_OF_TIME flag; this is a wrong-slot input guard, not rule adjudication (never-reject still applies to contest-RULE compliance). 137 tests pass incl. a new guard test; two existing tests updated to use date-aligned fixtures.
A March log could be uploaded into the October slot: the robot never
compared the file QSO dates against the chosen Monthly Contest. Add a
date-match guard on both preview and submit that blocks (400, bilingual
message) when the file QSO dates fall outside the selected contest month.
Format-tolerant (Cabrillo YYYY-MM-DD and ADIF YYYYMMDD). Individual
in-window time anomalies remain the advisory OUT_OF_TIME Flag; this is a
wrong-slot input guard, not rule adjudication. Tests updated + new guard test.
Two further date/time constraints beyond the month check:
- Hard block upgraded from month-match to full contest-DATE match, so a
  log on the wrong day (e.g. 3rd Tuesday) is refused, not just wrong month.
- OUT_OF_TIME advisory Flag is now actually populated. The web layer and
  ingest never passed a time window, so the flag never fired and the
  manager saw no advisory. Add contest_utc_window_for() (NL-local
  20:00-23:00 converted to UTC, DST-aware: 19-22 winter / 18-21 summer)
  and pass a ContestWindow into compute_flags on BOTH preview and submit.
  Out-of-hours QSOs stay advisory for the manager, never a block.
Verified: March sample 0 OUT_OF_TIME (in-window), a 23:30 QSO flags 1.
139 tests pass incl. wrong-day-block and OUT_OF_TIME advisory tests.
Bump the db image from the stale postgres:16 to the current GA major
(18.x). PG18 official image changed the data-dir convention: the volume
mounts at /var/lib/postgresql (not .../data) with the cluster in a
version subdirectory, so the old mount path made 18 refuse to start.
Verified live: fresh 18.6 init, migration + bootstrap seed, app healthy
on :8000 (upload 200, /manager 303, login 200).
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
public/vrza-contestrobot!6
No description provided.