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

@@ -64,6 +64,27 @@ type Handler interface {
//
// POST /api/v1/me/invitations/{invitation_id}/accept
AcceptMyInvitation(ctx context.Context, req *InvitationAcceptance, params AcceptMyInvitationParams) (AcceptMyInvitationRes, error)
// AcknowledgeMyAssessmentSignalNotice implements AcknowledgeMyAssessmentSignalNotice operation.
//
// 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).
//
// PUT /api/v1/me/assessment-signal-notice
AcknowledgeMyAssessmentSignalNotice(ctx context.Context, req *AssessmentSignalNoticeAcknowledgement) (AcknowledgeMyAssessmentSignalNoticeRes, error)
// CancelMyInvitation implements CancelMyInvitation operation.
//
// Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token,
@@ -599,6 +620,30 @@ type Handler interface {
//
// GET /api/v1/me/assessment-attempts/{attempt_id}/result
GetMyAssessmentResult(ctx context.Context, params GetMyAssessmentResultParams) (GetMyAssessmentResultRes, error)
// GetMyAssessmentSignalNotice implements GetMyAssessmentSignalNotice operation.
//
// 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.
//
// GET /api/v1/me/assessment-signal-notice
GetMyAssessmentSignalNotice(ctx context.Context) (GetMyAssessmentSignalNoticeRes, error)
// GetMyCardPreview implements GetMyCardPreview operation.
//
// Requires the session cookie of a candidate account. Returns a private preview of the permitted
@@ -956,6 +1001,21 @@ type Handler interface {
//
// PUT /api/v1/me/privacy/hidden-organizations/{org_id}
HideOrganization(ctx context.Context, params HideOrganizationParams) (HideOrganizationRes, error)
// ListMyAssessmentResults implements ListMyAssessmentResults operation.
//
// Requires a candidate session. Returns only completed root and corrective results owned by this
// candidate, newest first by decided_at and attempt_id. demo_express training results never appear.
// The cursor is opaque and bound to this candidate and listing; a malformed or foreign cursor returns
// 400 validation_failed.
//
// A v2 result includes the category decision captured when that attempt ended, including the confirmed
// grade then in force. Legacy v1 results omit category_decision because a later category must not be
// projected backward. Later policy, bank, review, or category changes do not alter either result.
// Employers cannot read this history; their separate projection contains only the current permitted
// category and no answers.
//
// GET /api/v1/me/assessment-results
ListMyAssessmentResults(ctx context.Context, params ListMyAssessmentResultsParams) (ListMyAssessmentResultsRes, error)
// ListMyCardAccessHistory implements ListMyCardAccessHistory operation.
//
// Requires the session cookie of a candidate account. The candidate comes from the session, so the