E9 fix + E11: out-of-band QSOs are no longer dropped; disallowed modes flagged #12
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/band-and-mode-flags"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two reglement checks the owner asked about after D merged, both built as advisory flags per the never-auto-reject rule.
The bug that was found on the way (E9)
The owner asked how wrong-band logging is handled. Answering that properly exposed a real defect: all three parsers (Cabrillo, EDI, ADIF) returned None for an unmappable band and ed/adif skipped the record, so a QSO outside the contest bands vanished at import. A 6cm/3cm EDI file (whose
PBandthe parser never knew) arrived as an empty log with no warning — silent loss, invisible to entrant and manager alike.Fix, per the standing rules: the QSO is kept everywhere it can be seen and scores nothing.
ParsedQSO.bandandqso.bandare nullable (migration 0008).-; view-layer banner mirrors the stored flag so preview and manager agree.INELIGIBLE_BANDflag, not one per QSO — a 6cm file would otherwise flood the report with identical rows.PBand, and inventing one would corrupt the export.E11: allowed modes
MODE_NOT_ALLOWEDper offending QSO, advisory only, from the verified reglement fact ("Toegestane modes zijn FM, SSB en CW").6and tripped the new check. Codes 1/2/6 now translate to SSB/CW/FM at parse time (IARU R1 Vienna 1998 4.12.2, the same table verified for the export). Unknown codes stay verbatim and are flagged — correct, since cross-mode (4) is not permitted by the reglement.One catch a green suite could not see
SQLite models enums as text, so tests passed while the first real ingest with the new flag would have died on Postgres enum validation:
invalid input value for enum flagtype: INELIGIBLE_BAND. Caught in live verification; migration 0009 adds both values viaALTER TYPE ... ADD VALUEin an autocommit block. The lesson is recorded in the postgres-alembic-migrations skill: growing a Python SAEnum is a schema change.Verification
band=Nonerow persists, view banner mirrors the flag, EDI export skips ineligible bands, and the upload-path end-to-end (preview shows both flags, submit stores the QSO and the flag row).alembic_versionandpg_type): corpus 16 ingests as entry with 3 QSOs (1band=None), score 4 (2 points × 2 multipliers), flagINELIGIBLE_BAND; corpus 17 ingests with twoMODE_NOT_ALLOWEDflags and scoring untouched; both new flag values round-trip through the enum.16-FLAG-ineligible-band.cbr,17-FLAG-disallowed-mode.cbrwith README outcomes.Deliberately out of scope (waiting on the Contest Manager)
Whether "70cm and up" is one band or separate 23cm/13cm/6cm/3cm — until that lands, an above-440 MHz QSO is
Band.HIGHERand eligible, which is exactly the behaviour the corpus tests.