Skip to content

Add preflight rounds before competition start - #191

Merged
dbaseqp merged 5 commits into
dbaseqp:mainfrom
tire-fire:feature/preflight-rounds
Nov 12, 2026
Merged

dbaseqp merged 5 commits into
dbaseqp:mainfrom
tire-fire:feature/preflight-rounds

Conversation

@tire-fire

@tire-fire tire-fire commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

While an rvb competition is not started and no scored round exists yet, the engine runs preflight rounds: the same checks a scored round would run (inactive teams, disabled team services and checks without seeded credentials are skipped alike), with results stored in new preflight_round_schemas / preflight_check_schemas tables. They are never scored and never touch round_schemas, so points, uptime, and SLAs start clean.

  • Preflight rounds are a persisted entity numbered separately from scored rounds (the round row is written even when no results arrived, so a timed-out round is visible). Tasks and results carry round_id and preflight, and the result collector ignores results from the other kind of round.
  • The engine decides between preflight and scoring per round, under the rvb case only, from the DB rather than the in-memory round counter (which advances on rounds that stored nothing and is reseeded on restart): preflight while the competition is not started (GetCompetitionStarted, the same reader the UI and API gate on) and no scored round has been stored (GetLastRound). On a read error that iteration runs a preflight round, delaying scoring by one round. Stopping a competition that has stored scored rounds does not bring preflight back.
  • GET /api/engine/reset now also drops preflight rounds. Reset while stopped (or stopping before the first scored round is stored) re-enters preflight; competition state is kept, so injects keep their anchor.
  • GET /api/engine/preflight (admin-only; stored error/debug text can contain credentials) returns the latest preflight round.
  • Preflight rounds need an upgraded runner: results without the preflight flag are discarded; scored rounds are unaffected. The new tables are added by AutoMigrate.
  • Custom checks: the ROUND placeholder is the preflight round number during preflight and the scored round number afterwards (both start at 1); documented in README and docs/custom-checks.md.
  • Runner: the result's task identity and runner metadata are set once; only check-produced fields are taken from the check.
  • Engine tests share one fake runner helper stopped at test cleanup; the preflight gate/reset tests reset the competition-state row in setup and cleanup (testutil.ResetCompetitionState). Integration tests cover preflight storage, empty rounds, isolation from scored rounds, the start/stop/legacy-row gate, stopping after an unstored empty round, and reset re-entering preflight while keeping the competition start.

Known limits: GET /api/engine/reset is a pre-existing cookie-only GET that changes state; it should become a POST in its own change.

@tire-fire
tire-fire force-pushed the feature/preflight-rounds branch from 303b61c to dd770b3 Compare November 8, 2026 16:54
@tire-fire tire-fire changed the title Add preflight rounds, competition end time, and outages endpoint Add preflight rounds before competition start Nov 8, 2026
@tire-fire
tire-fire force-pushed the feature/preflight-rounds branch from dd770b3 to 2a45ffa Compare November 8, 2026 17:27
@tire-fire
tire-fire force-pushed the feature/preflight-rounds branch from 2a45ffa to 2a31d13 Compare November 9, 2026 07:08
@dbaseqp
dbaseqp merged commit 9acc190 into dbaseqp:main Nov 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants