feat(assessment): add the review band of attempt signals and the disclosed collector

This commit is contained in:
shira committed 2026-10-08 23:04:57 +03:00
1 parent 68286af8b7
commit b3c6dc870b
124 files changed
+13522 -633

No files matched your search

+5 -1
View File
@@ -251,9 +251,13 @@ The `assessment` tag covers the assessment attempts of the current candidate (PR
| `POST /api/v1/me/assessment-attempts/{attempt_id}/answers` | `SubmitMyAssessmentAnswer` | session and CSRF, Idempotency-Key | 200 `AssessmentAttempt`, `Cache-Control: no-store` | 400, 401, 403, 404, 409 `state_conflict` or `idempotency_in_progress`, 412 `version_conflict`, 422, 429 |
| `POST /api/v1/me/assessment-attempts/{attempt_id}/finalize` | `FinalizeMyAssessmentAttempt` | session and CSRF, Idempotency-Key | 200 `AssessmentAttempt`, `Cache-Control: no-store` | 400, 401, 403, 404, 409 `state_conflict` or `idempotency_in_progress`, 412 `version_conflict`, 422 |
| `GET /api/v1/me/assessment-attempts/{attempt_id}/result` | `GetMyAssessmentResult` | session | 200 `AssessmentResult`, `Cache-Control: no-store` | 401, 403 `forbidden`, 404 `not_found`, 409 `state_conflict` |
| `GET /api/v1/me/assessment-signal-notice` | `GetMyAssessmentSignalNotice` | session | 200 `AssessmentSignalNotice`, `Cache-Control: no-store` | 401, 403 `forbidden` |
| `PUT /api/v1/me/assessment-signal-notice` | `AcknowledgeMyAssessmentSignalNotice` | session and CSRF | 200 `AssessmentSignalNotice`, `Cache-Control: no-store` | 400 `validation_failed`, 401, 403 `csrf_check_failed` or `forbidden`, 409 `state_conflict` |
Every operation also declares the `default` problem response.
The signal notice (`assessment-signal-notice`) lists the signals collected during a real attempt: browser events (focus loss, copy, paste and cut with a size, fullscreen exit; stored only while C3 is current) and server signals (response time, change of network address, parallel sessions, comparison of answer digests; only one-way keyed digests are stored, never addresses or session tokens). `GET` returns the notice version the server requires and whether the candidate acknowledged it; `PUT` stores the acknowledgement for the account and that version. The acknowledgement is a record that the candidate was informed, not a consent: it does not change C3, and the signal operation neither reads it nor refuses a batch without it. `PUT` needs no Idempotency-Key, because a repeat keeps the first time and answers 200; another version answers 409 `state_conflict`. The `demo_express` mode collects no signals and needs no acknowledgement.
Access:
- The candidate comes only from the session; no operation takes a candidate identifier. An employer account answers 403 `forbidden`. An attempt of another candidate answers 404 `not_found`, the same as an unknown identifier, so attempt identifiers cannot be probed.
@@ -313,7 +317,7 @@ Result:
- `next_steps` come from the server: `retake_same_grade`, `take_lower_grade`, `accept_lower_grade` (the command is planned), and `take_higher_grade`. A first confirmation is not a promotion, so `take_higher_grade` after it has a null `available_at`; after a promotion the next one waits for the 90-day promotion interval.
- The result never contains answers, per-item correctness, keys, seeds, hidden checks, or anti-cheat signals.
Planned, additive: a short approach description of up to 1500 characters next to the practice, which never decides the grade (PRD FR05); the debug run operation of the practice; the notice and storage of the anti-cheat signals (time, focus changes, pastes, parallel sessions), which lead to a review and an appeal, never to a public label and never to the employer (PRD FR05).
Planned, additive: a short approach description of up to 1500 characters next to the practice, which never decides the grade (PRD FR05); the debug run operation of the practice; the server signals of the anti-cheat layer (answer time, parallel sessions, address changes), which lead to a review and an appeal, never to a public label and never to the employer (PRD FR05).
### Needs
+5 -1
View File
@@ -251,9 +251,13 @@ ML-сервис отвечает на ошибки той же схемой `Pro
| `POST /api/v1/me/assessment-attempts/{attempt_id}/answers` | `SubmitMyAssessmentAnswer` | сессия и CSRF, Idempotency-Key | 200 `AssessmentAttempt`, `Cache-Control: no-store` | 400, 401, 403, 404, 409 `state_conflict` или `idempotency_in_progress`, 412 `version_conflict`, 422, 429 |
| `POST /api/v1/me/assessment-attempts/{attempt_id}/finalize` | `FinalizeMyAssessmentAttempt` | сессия и CSRF, Idempotency-Key | 200 `AssessmentAttempt`, `Cache-Control: no-store` | 400, 401, 403, 404, 409 `state_conflict` или `idempotency_in_progress`, 412 `version_conflict`, 422 |
| `GET /api/v1/me/assessment-attempts/{attempt_id}/result` | `GetMyAssessmentResult` | сессия | 200 `AssessmentResult`, `Cache-Control: no-store` | 401, 403 `forbidden`, 404 `not_found`, 409 `state_conflict` |
| `GET /api/v1/me/assessment-signal-notice` | `GetMyAssessmentSignalNotice` | сессия | 200 `AssessmentSignalNotice`, `Cache-Control: no-store` | 401, 403 `forbidden` |
| `PUT /api/v1/me/assessment-signal-notice` | `AcknowledgeMyAssessmentSignalNotice` | сессия и CSRF | 200 `AssessmentSignalNotice`, `Cache-Control: no-store` | 400 `validation_failed`, 401, 403 `csrf_check_failed` или `forbidden`, 409 `state_conflict` |
Каждая операция также объявляет problem-ответ `default`.
Уведомление о сигналах (`assessment-signal-notice`) перечисляет сигналы, которые собираются во время реальной попытки: события браузера (потеря фокуса, копирование, вставка и вырезание с размером, выход из полноэкранного режима, сохраняются только при действующем C3) и серверные (время ответа, смена сетевого адреса, параллельные сессии, сравнение отпечатков ответов; хранятся только односторонние ключевые отпечатки, адреса и токены сессий не хранятся). `GET` возвращает версию уведомления, которую требует сервер, и признак, что кандидат ее подтвердил; `PUT` сохраняет подтверждение для аккаунта и этой версии. Подтверждение - запись о том, что кандидат ознакомлен, а не согласие: оно не меняет C3, и операция приема сигналов его не читает и не отклоняет пакет без него. `PUT` не требует Idempotency-Key: повтор сохраняет первое время и отвечает 200; другая версия отвечает 409 `state_conflict`. Режим `demo_express` сигналы не собирает и подтверждения не требует.
Доступ:
- Кандидат берется только из сессии; ни одна операция не принимает идентификатор кандидата. Аккаунт работодателя получает 403 `forbidden`. Попытка другого кандидата дает 404 `not_found`, как и неизвестный идентификатор, поэтому идентификаторы попыток нельзя перебирать.
@@ -313,7 +317,7 @@ ML-сервис отвечает на ошибки той же схемой `Pro
- `next_steps` приходят с сервера: `retake_same_grade`, `take_lower_grade`, `accept_lower_grade` (команда запланирована) и `take_higher_grade`. Первое подтверждение - не повышение, поэтому `take_higher_grade` после него имеет null в `available_at`; после повышения следующее ждет 90-дневный интервал повышения.
- Результат никогда не содержит ответы, правильность отдельных заданий, ключи, seed, скрытые проверки или античит-сигналы.
Запланировано, добавляется без ломающих изменений: краткое описание подхода до 1500 знаков рядом с практикой, которое не определяет грейд (FR05 в PRD); операция отладочных запусков практики; уведомление о собираемых античит-сигналах (время, переключение фокуса, вставки, параллельные сессии) и их хранение; сигналы ведут к перепроверке и апелляции, а не к публичному ярлыку, и работодателю не показываются (FR05 в PRD).
Запланировано, добавляется без ломающих изменений: краткое описание подхода до 1500 знаков рядом с практикой, которое не определяет грейд (FR05 в PRD); операция отладочных запусков практики; серверные сигналы античит-слоя (время ответа, параллельные сессии, смена адреса); сигналы ведут к перепроверке и апелляции, а не к публичному ярлыку, и работодателю не показываются (FR05 в PRD).
### Потребности
+37 -1
View File
@@ -1778,7 +1778,7 @@ AssessmentClipboardSignal:
format: int32
minimum: 0
maximum: 2147483647
description: Byte count only. Clipboard or selection contents are not transmitted or retained.
description: Size only; clipboard and selection contents are never transmitted or retained. For `paste` it is the UTF-8 byte count of the pasted plain text plus the byte size of pasted files, counted on the device from the paste event. For `copy` and `cut` it is the selection length in UTF-16 code units taken from the selection offsets of a form field, or zero when the field offsets are unavailable; it is an approximate size and the selected text is not read. The server applies no conversion and treats the value as an order-of-magnitude indicator.
AssessmentFullscreenExitSignal:
type: object
additionalProperties: false
@@ -1831,6 +1831,42 @@ AssessmentSignalReceipt:
description: Number of events stored from this batch; zero when saturated.
received_at:
$ref: '#/Timestamp'
AssessmentSignalNoticeVersion:
type: integer
format: int32
minimum: 1
maximum: 2147483647
description: Version of the notice text about the collected signals. The client shows the text of the version it knows and sends that version back when the candidate confirms; a changed text gets a new version and needs a new confirmation.
AssessmentSignalNotice:
type: object
description: State of the notice about the signals that are collected during a real assessment attempt. The acknowledgement is a record that the candidate was informed. It is not a consent, grants no purpose, and neither enables nor blocks signal storage; C3 remains the only consent that the signal operation checks.
additionalProperties: false
required:
- notice_version
- acknowledged
- acknowledged_at
properties:
notice_version:
allOf:
- $ref: '#/AssessmentSignalNoticeVersion'
description: The version the server currently requires the candidate to acknowledge.
acknowledged:
type: boolean
description: True when the candidate acknowledged `notice_version`.
acknowledged_at:
description: Server time of the first acknowledgement of this version, or null.
oneOf:
- $ref: '#/Timestamp'
- type: 'null'
AssessmentSignalNoticeAcknowledgement:
type: object
description: The notice version the candidate was shown and acknowledged.
additionalProperties: false
required:
- notice_version
properties:
notice_version:
$ref: '#/AssessmentSignalNoticeVersion'
ProfileVersion:
type: integer
format: int64
@@ -63,7 +63,15 @@ schemas:
format: int32
minimum: 0
maximum: 2147483647
description: Byte count only. Clipboard or selection contents are not transmitted or retained.
description: >-
Size only; clipboard and selection contents are never transmitted or
retained. For `paste` it is the UTF-8 byte count of the pasted plain
text plus the byte size of pasted files, counted on the device from
the paste event. For `copy` and `cut` it is the selection length in
UTF-16 code units taken from the selection offsets of a form field,
or zero when the field offsets are unavailable; it is an approximate
size and the selected text is not read. The server applies no
conversion and treats the value as an order-of-magnitude indicator.
AssessmentFullscreenExitSignal:
type: object
additionalProperties: false
@@ -122,3 +130,48 @@ schemas:
description: Number of events stored from this batch; zero when saturated.
received_at:
$ref: "#/schemas/Timestamp"
AssessmentSignalNoticeVersion:
type: integer
format: int32
minimum: 1
maximum: 2147483647
description: >-
Version of the notice text about the collected signals. The client
shows the text of the version it knows and sends that version back when
the candidate confirms; a changed text gets a new version and needs a
new confirmation.
AssessmentSignalNotice:
type: object
description: >-
State of the notice about the signals that are collected during a real
assessment attempt. The acknowledgement is a record that the candidate
was informed. It is not a consent, grants no purpose, and neither
enables nor blocks signal storage; C3 remains the only consent that
the signal operation checks.
additionalProperties: false
required:
- notice_version
- acknowledged
- acknowledged_at
properties:
notice_version:
allOf:
- $ref: "#/schemas/AssessmentSignalNoticeVersion"
description: The version the server currently requires the candidate to acknowledge.
acknowledged:
type: boolean
description: True when the candidate acknowledged `notice_version`.
acknowledged_at:
description: Server time of the first acknowledgement of this version, or null.
oneOf:
- $ref: "#/schemas/Timestamp"
- type: "null"
AssessmentSignalNoticeAcknowledgement:
type: object
description: The notice version the candidate was shown and acknowledged.
additionalProperties: false
required:
- notice_version
properties:
notice_version:
$ref: "#/schemas/AssessmentSignalNoticeVersion"
+118 -10
View File
@@ -711,6 +711,78 @@ paths:
$ref: '#/components/responses/Forbidden'
default:
$ref: '#/components/responses/Problem'
/api/v1/me/assessment-signal-notice:
get:
operationId: GetMyAssessmentSignalNotice
summary: Read whether the current candidate acknowledged the signal notice.
description: |-
Requires the session cookie of a candidate account with a confirmed email; the candidate comes from the session. Returns the notice version that the server requires now and whether this candidate acknowledged it. The notice lists the signals that are collected during a real assessment attempt and states that images, sound, and clipboard contents are not collected. Client signals are the time away from the tab or window, copy, paste and cut with a size only, and exits from fullscreen mode. Server signals are the response time of each item measured by the server, a change of network address during the attempt, parallel sessions, and the comparison of answers to variants of the same task by candidates. The server stores for these only one-way keyed digests: it stores no network address, no session token, and no answer text. Client signals are stored only while the C3 consent is current. The client shows it before a real attempt starts and does not start the attempt until the notice is acknowledged.
The acknowledgement is stored on the server per account and notice version, so it survives a reload and a new browser. It is not a consent and never changes C3: the signal operation still requires a current C3 consent, and an unacknowledged notice does not make that operation fail. The demo_express training mode collects no signals and needs no acknowledgement.
A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account or an unconfirmed email answers 403 forbidden.
security:
- sessionCookie: []
tags:
- assessment
responses:
'200':
description: The notice version and the acknowledgement state of the current candidate.
headers:
Cache-Control:
$ref: '#/components/headers/CacheControlNoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/AssessmentSignalNotice'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/Forbidden'
default:
$ref: '#/components/responses/Problem'
put:
operationId: AcknowledgeMyAssessmentSignalNotice
summary: Record that the current candidate read the signal notice.
description: |-
Requires the session cookie of a candidate account with a confirmed email, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The body carries the notice version the candidate was shown. The server stores the acknowledgement for the account and that version; the response carries the server time of the first acknowledgement.
The operation needs no Idempotency-Key: it is idempotent. Repeating it for an acknowledged version changes nothing, keeps the first time, and answers 200, so a retry after a lost response succeeds. A version other than the one the server requires answers 409 state_conflict and stores nothing; the client reads the notice again.
The acknowledgement is not a consent. It does not grant, replace, or hide C3, and it does not affect the signal operation or any score, category, or quota. The body carries no signal, answer, or clipboard data.
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account (403 forbidden), then the version (409).
security:
- sessionCookie: []
sessionCsrf: []
tags:
- assessment
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AssessmentSignalNoticeAcknowledgement'
responses:
'200':
description: The stored acknowledgement, new or repeated.
headers:
Cache-Control:
$ref: '#/components/headers/CacheControlNoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/AssessmentSignalNotice'
'400':
$ref: '#/components/responses/ValidationFailed'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/CsrfCheckFailedOrForbidden'
'409':
$ref: '#/components/responses/StateConflict'
default:
$ref: '#/components/responses/Problem'
/api/v1/me/assessment-attempts:
post:
operationId: CreateMyAssessmentAttempt
@@ -5411,7 +5483,7 @@ components:
format: int32
minimum: 0
maximum: 2147483647
description: Byte count only. Clipboard or selection contents are not transmitted or retained.
description: Size only; clipboard and selection contents are never transmitted or retained. For `paste` it is the UTF-8 byte count of the pasted plain text plus the byte size of pasted files, counted on the device from the paste event. For `copy` and `cut` it is the selection length in UTF-16 code units taken from the selection offsets of a form field, or zero when the field offsets are unavailable; it is an approximate size and the selected text is not read. The server applies no conversion and treats the value as an order-of-magnitude indicator.
AssessmentFullscreenExitSignal:
type: object
additionalProperties: false
@@ -9504,6 +9576,42 @@ components:
- kind
- root_attempt_id
- chain_deadline
AssessmentSignalNoticeVersion:
type: integer
format: int32
minimum: 1
maximum: 2147483647
description: Version of the notice text about the collected signals. The client shows the text of the version it knows and sends that version back when the candidate confirms; a changed text gets a new version and needs a new confirmation.
AssessmentSignalNotice:
type: object
description: State of the notice about the signals that are collected during a real assessment attempt. The acknowledgement is a record that the candidate was informed. It is not a consent, grants no purpose, and neither enables nor blocks signal storage; C3 remains the only consent that the signal operation checks.
additionalProperties: false
required:
- notice_version
- acknowledged
- acknowledged_at
properties:
notice_version:
allOf:
- $ref: '#/components/schemas/AssessmentSignalNoticeVersion'
description: The version the server currently requires the candidate to acknowledge.
acknowledged:
type: boolean
description: True when the candidate acknowledged `notice_version`.
acknowledged_at:
description: Server time of the first acknowledgement of this version, or null.
oneOf:
- $ref: '#/components/schemas/Timestamp'
- type: 'null'
AssessmentSignalNoticeAcknowledgement:
type: object
description: The notice version the candidate was shown and acknowledged.
additionalProperties: false
required:
- notice_version
properties:
notice_version:
$ref: '#/components/schemas/AssessmentSignalNoticeVersion'
AssessmentQualifiedAttemptCreate:
type: object
description: Start a real assessment for a specialization and target grade, with the task language. The candidate comes from the session. The server chooses demo_basic or adaptive and fixes the policy, bank, and algorithm versions. Unknown fields such as `mode`, `seed`, or `score` are rejected.
@@ -11900,6 +12008,15 @@ components:
max_sessions: null
max_items: null
practice_required: null
StateConflict:
summary: The resource state does not allow the operation
value:
type: urn:lincodex:problem:state_conflict
title: Resource state conflict
status: 409
code: state_conflict
detail: The resource is in a state that does not allow this operation.
trace_id: 1e2f3a4b-5c6d-4e7f-8a9b-0c1d2e3f4a5b
AssessmentAttemptCreateBackendJunior:
summary: Start Backend junior with Go tasks
value:
@@ -12432,15 +12549,6 @@ components:
code: version_conflict
detail: The resource changed after it was read. Read it again before retrying.
trace_id: 5f6a7b8c-9d0e-4f1a-8b2c-3d4e5f6a7b8c
StateConflict:
summary: The resource state does not allow the operation
value:
type: urn:lincodex:problem:state_conflict
title: Resource state conflict
status: 409
code: state_conflict
detail: The resource is in a state that does not allow this operation.
trace_id: 1e2f3a4b-5c6d-4e7f-8a9b-0c1d2e3f4a5b
PayloadTooLarge:
summary: The request body exceeds the limit
value:
+2
View File
@@ -105,6 +105,8 @@ paths:
$ref: ./routes/candidate_assessment_availability.yml
/api/v1/me/assessment-results:
$ref: ./routes/candidate_assessment_results.yml
/api/v1/me/assessment-signal-notice:
$ref: ./routes/candidate_assessment_signal_notice.yml
/api/v1/me/assessment-attempts:
$ref: ./routes/candidate_assessment_attempts.yml
/api/v1/me/assessment-attempts/{attempt_id}:
@@ -0,0 +1,71 @@
get:
operationId: GetMyAssessmentSignalNotice
summary: Read whether the current candidate acknowledged the signal notice.
description: |-
Requires the session cookie of a candidate account with a confirmed email; the candidate comes from the session. Returns the notice version that the server requires now and whether this candidate acknowledged it. The notice lists the signals that are collected during a real assessment attempt and states that images, sound, and clipboard contents are not collected. Client signals are the time away from the tab or window, copy, paste and cut with a size only, and exits from fullscreen mode. Server signals are the response time of each item measured by the server, a change of network address during the attempt, parallel sessions, and the comparison of answers to variants of the same task by candidates. The server stores for these only one-way keyed digests: it stores no network address, no session token, and no answer text. Client signals are stored only while the C3 consent is current. The client shows it before a real attempt starts and does not start the attempt until the notice is acknowledged.
The acknowledgement is stored on the server per account and notice version, so it survives a reload and a new browser. It is not a consent and never changes C3: the signal operation still requires a current C3 consent, and an unacknowledged notice does not make that operation fail. The demo_express training mode collects no signals and needs no acknowledgement.
A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account or an unconfirmed email answers 403 forbidden.
security:
- sessionCookie: []
tags:
- assessment
responses:
"200":
description: The notice version and the acknowledgement state of the current candidate.
headers:
Cache-Control:
$ref: ../components/headers.yml#/CacheControlNoStore
content:
application/json:
schema:
$ref: ../components/schemas.yml#/AssessmentSignalNotice
"401":
$ref: ../components/responses.yml#/Unauthenticated
"403":
$ref: ../components/responses.yml#/Forbidden
default:
$ref: ../components/responses.yml#/Problem
put:
operationId: AcknowledgeMyAssessmentSignalNotice
summary: Record that the current candidate read the signal notice.
description: |-
Requires the session cookie of a candidate account with a confirmed email, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The body carries the notice version the candidate was shown. The server stores the acknowledgement for the account and that version; the response carries the server time of the first acknowledgement.
The operation needs no Idempotency-Key: it is idempotent. Repeating it for an acknowledged version changes nothing, keeps the first time, and answers 200, so a retry after a lost response succeeds. A version other than the one the server requires answers 409 state_conflict and stores nothing; the client reads the notice again.
The acknowledgement is not a consent. It does not grant, replace, or hide C3, and it does not affect the signal operation or any score, category, or quota. The body carries no signal, answer, or clipboard data.
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account (403 forbidden), then the version (409).
security:
- sessionCookie: []
sessionCsrf: []
tags:
- assessment
requestBody:
required: true
content:
application/json:
schema:
$ref: ../components/schemas.yml#/AssessmentSignalNoticeAcknowledgement
responses:
"200":
description: The stored acknowledgement, new or repeated.
headers:
Cache-Control:
$ref: ../components/headers.yml#/CacheControlNoStore
content:
application/json:
schema:
$ref: ../components/schemas.yml#/AssessmentSignalNotice
"400":
$ref: ../components/responses.yml#/ValidationFailed
"401":
$ref: ../components/responses.yml#/Unauthenticated
"403":
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
"409":
$ref: ../components/responses.yml#/StateConflict
default:
$ref: ../components/responses.yml#/Problem