feat(practice): run practice jobs on the code runner with one stored result per run

This commit is contained in:
shira committed 2026-10-11 19:31:08 +03:00
1 parent 9385b2ddd4
commit 9344228e84
17 files changed
+1010 -35

No files matched your search

@@ -0,0 +1,20 @@
-- +goose Up
-- A finished practice job keeps the opaque run ID under which the code runner
-- held the run that produced the stored result. The ID is the HMAC-derived
-- value of the run key (attempt item, submission, generation) that the runner
-- itself logs, so an operator can match a stored result to one runner run
-- without the runner learning who the candidate is. Only the finishing try
-- writes it, in the transaction that stores the result; a failed or unfinished
-- job has none. The ID is unique, because one run produces at most one result.
ALTER TABLE assessment_practice_jobs
ADD COLUMN runner_run_id uuid,
ADD CONSTRAINT assessment_practice_jobs_runner_run_state CHECK (
runner_run_id IS NULL OR state = 'finished'
),
ADD CONSTRAINT assessment_practice_jobs_runner_run_key UNIQUE (runner_run_id);
-- +goose Down
ALTER TABLE assessment_practice_jobs
DROP CONSTRAINT assessment_practice_jobs_runner_run_key,
DROP CONSTRAINT assessment_practice_jobs_runner_run_state,
DROP COLUMN runner_run_id;