Skip to content

Serve preflight rounds in admin WebUI and publish round_finish - #208

Open
tire-fire wants to merge 2 commits into
dbaseqp:mainfrom
tire-fire:feature/preflight-rounds
Open

tire-fire wants to merge 2 commits into
dbaseqp:mainfrom
tire-fire:feature/preflight-rounds

Conversation

@tire-fire

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

Copy link
Copy Markdown
Contributor

Summary

  • Admin WebUI during preflight (engine/engine.go, engine/db/preflight.go, engine/db/servicechecks.go, engine/db/teams.go, www/api/graphs.go, www/api/services.go, www/api/admin.go):
    • While ScoringEngine.PreflightPending() is true (!GetCompetitionStarted() && !HasScoredRound()), ScoringEngine read methods (LastRound, WithUptimes, TeamSummary, ServiceAllChecksByTeam) serve preflight round results and uptimes through /api/graphs/services, /api/graphs/uptimes, /api/services/{team_id}, /api/services/{team_id}/{service_name} (all gated to admin by CheckCompetitionStarted), and /api/engine (gated by ADMINAUTH).
    • /admin/engine and /admin/runners label round progress as Preflight round N during preflight.
    • Once the competition starts, all endpoints switch immediately to scored rounds (round_schemas / service_check_schemas / UptimePerService).
    • Removed the standalone GET /api/engine/preflight endpoint now that the WebUI endpoints serve preflight directly.
  • Divisor IP rotation in preflight (engine/engine.go):
    • preflight() publishes round_finish on Redis events at the end of each preflight round so Divisor rotates runner source IPs during preflight too.
  • Reset Scores stops competition (engine/db/db.go):
    • ResetScores() sets CompetitionStateSchema.Started = false while preserving StartedAt (the imported-inject anchor) so resetting scores always returns the engine to preflight.

Verification

  • go vet ./...
  • go test -race -p 1 ./engine -run 'TestPreflight|TestResetScores'
  • go test -race -p 1 ./tests/integration -run 'TestGraphs|TestPreflight'
  • Headless Chromium verification of /graphs, /services (including drilldown), and /admin/engine during preflight

@tire-fire
tire-fire force-pushed the feature/preflight-rounds branch from 66bb9b7 to b600d06 Compare November 13, 2026 05:28
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.

1 participant