feat(practice): queue practice runs with one running and ten waiting

This commit is contained in:
shira committed 2026-10-11 15:01:07 +03:00
1 parent 51770eea6c
commit 754c745fba
40 files changed
+3040 -70

No files matched your search

@@ -247,19 +247,22 @@ type Handler interface {
// `additional_practice_pending` for the additional one, and its deadline has not passed. Otherwise the
// server answers 409 state_conflict.
//
// Availability. When code practice is not enabled on this server, the server answers 503
// service_unavailable and stores nothing.
// Limits. Debug runs are bounded by a per-candidate rate limit and by one unfinished run per practice;
// either answers 429 rate_limited with Retry-After. The sandbox queue holds one running and ten
// waiting runs and submissions together; when it is full the server answers 503 service_unavailable
// with Retry-After and stores nothing. When code practice is not enabled on this server, the server
// answers 503 service_unavailable without Retry-After and stores nothing.
//
// Repeats. A retry with the same Idempotency-Key and body within 24 hours returns the stored run in
// its current state with 202, without starting another run. A different body with the same key answers
// 422 idempotency_key_reused. Refusals (400, 404, 409, 503) are not stored under the key and are
// 422 idempotency_key_reused. Refusals (400, 404, 409, 429, 503) are not stored under the key and are
// evaluated again.
//
// Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400),
// account scenario (403 forbidden), the availability of code practice (503), the Idempotency-Key (422,
// replay), the attempt and the practice (404 not_found for an unknown attempt or item, or one of
// another candidate), the state (409), then the solution against the item (400 with a pointer such as
// `/language` or `/source_code`).
// another candidate), the state (409), the solution against the item (400 with a pointer such as
// `/language` or `/source_code`), the limits (429), then the queue (503).
//
// POST /api/v1/me/assessment-attempts/{attempt_id}/practice-runs
CreateMyAssessmentPracticeRun(ctx context.Context, req *PracticeRunCreate, params CreateMyAssessmentPracticeRunParams) (CreateMyAssessmentPracticeRunRes, error)