22
33Capture-the-flag is a Django app (` ctf ` ) layered on the platform's range system. It
44owns event/challenge/scoring data and orchestrates a dedicated range per participant
5- by calling the existing CMS range services — it does not introduce a second
5+ by calling the existing CMS range services; it does not introduce a second
66provisioning path.
77
88## Responsibility
@@ -53,24 +53,24 @@ challenge creation, and submission checking compares against the hash.
5353Business logic lives under ` ctf.services ` (views stay thin):
5454
5555- ` event ` , ` challenge ` , ` flag ` , ` bracket ` , ` hint ` , ` award ` , ` attachment ` ,
56- ` email_template ` , ` notification ` — entity operations.
57- - ` participant/ ` — ` lifecycle ` , ` bulk_import ` , ` queries ` .
58- - ` scoring/ ` — materialized-leaderboard hot path with an authoritative recompute
56+ ` email_template ` , ` notification ` : entity operations.
57+ - ` participant/ ` : ` lifecycle ` , ` bulk_import ` , ` queries ` .
58+ - ` scoring/ ` : materialized-leaderboard hot path with an authoritative recompute
5959 fallback (` get_scoreboard ` , ` calculate_score ` , ranks, stats, timeline, and the
6060 ` recompute_* ` maintenance helpers).
61- - ` authorization ` , ` audit ` — access checks and audit trail.
61+ - ` authorization ` , ` audit ` : access checks and audit trail.
6262
6363### Range Provisioning
6464
6565` ctf.services.range ` provisions a range per participant from ` event.scenario_id ` via
66- CMS range services — the same path Mission Control uses to launch a range.
66+ CMS range services, the same path Mission Control uses to launch a range.
6767
68- - ` provision.py ` — ` provision_participant_range(participant_id) ` runs under a
68+ - ` provision.py ` : ` provision_participant_range(participant_id) ` runs under a
6969 per-participant row lock so concurrent manual and scheduled provisioning cannot
7070 double-assign a range, with an exponential-backoff retry wrapper.
71- - ` batch.py ` — throttled event-wide provisioning, pacing participant spin-ups.
72- - ` lifecycle.py ` , ` status.py ` , ` tasks.py ` — teardown, status reads, and task wiring.
73- - ` recovery.py ` — `recover_participant_range(participant_id, * , strategy,
71+ - ` batch.py ` : throttled event-wide provisioning, pacing participant spin-ups.
72+ - ` lifecycle.py ` , ` status.py ` , ` tasks.py ` : teardown, status reads, and task wiring.
73+ - ` recovery.py ` : `recover_participant_range(participant_id, * , strategy,
7474 operator, spare_range_instance_id=None)` recovers a destroyed participant range
7575 (organizer-only). ` rebuild ` provisions a fresh range via the CMS bridge; ` reassign_spare `
7676 consumes an available ` CTFSpareRange ` from the participant's own event pool and
@@ -79,10 +79,10 @@ CMS range services — the same path Mission Control uses to launch a range.
7979 ` cms.services.reassign_range_owner ` ). The intent is persisted as a ` CTFRangeRecovery `
8080 row keyed on participant + old range + strategy; resumption after a partial failure is
8181 data-driven (recorded replacement id and the live old-range status), so retries never
82- duplicate the replacement or the audit row. The old range is always destroyed — there
82+ duplicate the replacement or the audit row. The old range is always destroyed; there
8383 is no disposition/forensics-retention choice. Recovery writes one ` risk_register ` audit
8484 row.
85- - ` spares.py ` — ` provision_event_spares(event_id, target_count, *, operator=None) ` tops up
85+ - ` spares.py ` : ` provision_event_spares(event_id, target_count, *, operator=None) ` tops up
8686 an event's prewarmed spare-range pool (` CTFEvent.spare_range_count ` ), each spare owned by
8787 a dedicated, auto-created managed system user (never a ` CTFParticipant ` ) until consumed.
8888 ` get_event_spare_summary(event_id) ` reports pool counts for the admin surface;
@@ -97,9 +97,9 @@ does not go stale and provisioning stays responsive to shutdown.
9797
9898Two management commands operate the event runtime:
9999
100- - ` run_ctf_scheduler ` — long-running scheduler that drives batch range provisioning,
100+ - ` run_ctf_scheduler ` : long-running scheduler that drives batch range provisioning,
101101 cleanup, reminders, and scheduled tasks, writing a liveness heartbeat.
102- - ` ctf_recompute_leaderboard ` — recomputes materialized leaderboard columns
102+ - ` ctf_recompute_leaderboard ` : recomputes materialized leaderboard columns
103103 authoritatively when reconciliation is needed.
104104
105105## Boundaries
@@ -112,5 +112,5 @@ Two management commands operate the event runtime:
112112
113113## See Also
114114
115- - [ CTF] ( ../../features/ctf ) — participant guide.
116- - [ CTF Organizer Guide] ( ../../features/ctf-organizer-guide ) — running an event.
115+ - [ CTF] ( ../../features/ctf ) : participant guide.
116+ - [ CTF Organizer Guide] ( ../../features/ctf-organizer-guide ) : running an event.
0 commit comments