feat: add assessment, privacy and support flows

This commit is contained in:
TakuyaYagam1 committed 2026-10-08 08:08:25 +03:00
1 parent ee3738ee73
commit e4f24fa202
339 files changed
+56454 -1126

No files matched your search

@@ -947,6 +947,7 @@ schemas:
number:
type: number
format: double
x-ogen-type: lincodex/backend/internal/adapter/primary/http/apitypes.AssessmentNumber
StringAnswer:
type: object
description: >-
@@ -1329,6 +1330,64 @@ schemas:
root: "#/schemas/AssessmentQualifiedResult"
corrective: "#/schemas/AssessmentCorrectiveResult"
demo_express: "#/schemas/AssessmentExpressResult"
AssessmentFinalizeConflictProblem:
type: object
description: >-
A finalize state conflict. `pending_item_ids` is present only when the
attempt still has required questions without answers; it is omitted for
other state conflicts and idempotency conflicts.
additionalProperties: false
required:
- type
- title
- status
- code
properties:
type:
type: string
format: uri-reference
maxLength: 256
title:
type: string
minLength: 1
maxLength: 200
status:
type: integer
format: int32
const: 409
code:
type: string
enum:
- state_conflict
- idempotency_in_progress
detail:
type: string
maxLength: 1000
instance:
type: string
format: uri-reference
maxLength: 2048
trace_id:
type: string
minLength: 1
maxLength: 128
pattern: "^[A-Za-z0-9._-]+$"
errors:
type: array
maxItems: 100
items:
$ref: "./problem_schemas.yml#/schemas/ProblemFieldError"
pending_item_ids:
type: array
maxItems: 220
uniqueItems: true
items:
type: string
format: uuid
description: >-
Frozen item IDs still unanswered when finalize is rejected for an
incomplete attempt. Omitted when the conflict is unrelated to
unanswered items.
AssessmentRealResultCommon:
type: object
description: >-
@@ -0,0 +1,124 @@
schemas:
AssessmentSignalEvent:
description: >-
One client-reported event bound to an item instance of the attempt. The
timestamp is untrusted input and is used only as event metadata; server
receipt time is authoritative for limits and retention.
oneOf:
- $ref: "#/schemas/AssessmentFocusLossSignal"
- $ref: "#/schemas/AssessmentClipboardSignal"
- $ref: "#/schemas/AssessmentFullscreenExitSignal"
discriminator:
propertyName: kind
mapping:
focus_loss: "#/schemas/AssessmentFocusLossSignal"
copy: "#/schemas/AssessmentClipboardSignal"
paste: "#/schemas/AssessmentClipboardSignal"
cut: "#/schemas/AssessmentClipboardSignal"
fullscreen_exit: "#/schemas/AssessmentFullscreenExitSignal"
AssessmentFocusLossSignal:
type: object
additionalProperties: false
required:
- kind
- item_instance_id
- occurred_at
- duration_ms
properties:
kind:
type: string
enum:
- focus_loss
item_instance_id:
$ref: "#/schemas/AssessmentItemId"
occurred_at:
$ref: "#/schemas/Timestamp"
duration_ms:
type: integer
format: int32
minimum: 1
maximum: 259200000
description: Client-measured duration away from the assessment tab or window, in milliseconds.
AssessmentClipboardSignal:
type: object
additionalProperties: false
required:
- kind
- item_instance_id
- occurred_at
- size_bytes
properties:
kind:
type: string
enum:
- copy
- paste
- cut
item_instance_id:
$ref: "#/schemas/AssessmentItemId"
occurred_at:
$ref: "#/schemas/Timestamp"
size_bytes:
type: integer
format: int32
minimum: 0
maximum: 2147483647
description: Byte count only. Clipboard or selection contents are not transmitted or retained.
AssessmentFullscreenExitSignal:
type: object
additionalProperties: false
required:
- kind
- item_instance_id
- occurred_at
properties:
kind:
type: string
enum:
- fullscreen_exit
item_instance_id:
$ref: "#/schemas/AssessmentItemId"
occurred_at:
$ref: "#/schemas/Timestamp"
AssessmentSignalBatch:
type: object
description: >-
A bounded batch of client event metadata. The raw request body is limited
to 32 KiB before decoding and the batch contains at most 50 events.
additionalProperties: false
required:
- events
properties:
events:
type: array
minItems: 1
maxItems: 50
items:
$ref: "#/schemas/AssessmentSignalEvent"
AssessmentSignalReceipt:
type: object
description: >-
Receipt for the submitted batch. It contains no signal details, score,
review decision, threshold, or result band.
additionalProperties: false
required:
- status
- accepted_events
- received_at
properties:
status:
type: string
enum:
- accepted
- saturated
description: >-
`saturated` means no event from this batch was stored because the
attempt's bounded evidence storage is full.
accepted_events:
type: integer
format: int32
minimum: 0
maximum: 50
description: Number of events stored from this batch; zero when saturated.
received_at:
$ref: "#/schemas/Timestamp"
+10 -10
View File
@@ -34,16 +34,16 @@ schemas:
must not parse, build, or store it beyond the current listing.
CandidateHandle:
type: string
minLength: 1
maxLength: 128
pattern: "^[A-Za-z0-9_-]+$"
minLength: 47
maxLength: 47
pattern: '^cv1_[A-Za-z0-9_-]{43}$'
description: >-
Opaque reference to a candidate as one organization sees it, taken
from a search result card of that organization. It is not the
candidate's account or profile identifier, it never contains an email
address or a phone number, and it means nothing to another
organization. The server resolves it only for the organization in the
path. Clients never parse it. It is shared by the invitations of
FR12 and the search results of FR11, which issue it.
from the organization-scoped anonymous card. It is a versioned HMAC
alias, not a candidate account or profile identifier; it contains no
contact information and is meaningless to another organization. The
server resolves it only against the current visible cohort of the
organization in the path. Clients never parse or construct it. It is
shared by the candidate-card read and invitations.
examples:
- cand_7Qm2xVb9Lr4Kp0Zt
- cv1_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+122 -63
View File
@@ -28,27 +28,31 @@ schemas:
description: |-
A group of values of the anonymous candidate card that the candidate chooses to publish. The set is closed and has no value for the full name, a contact, or the lowest salary: the card never carries them, so no choice and no later contract change in this list can publish them by accident. Contacts leave only through the contact grant of an accepted invitation (C4), and the lowest salary never leaves.
- categories: the categories confirmed by assessment results (specialization and confirmed grade). A self-assessed grade is not a category and is never published.
- stack: the technology tags of the profile.
- experience: the total months of work experience, without employers, periods, or descriptions.
- soft_skills: the soft skills of the profile.
- location: the city or region of the profile.
- relocation: whether the candidate is ready to relocate.
- categories: specialization and grade confirmed by an authoritative assessment result.
- self_assessment: the candidate's declared specialization and grade, separate from confirmed categories.
- stack: only recognized technology codes from the server's closed taxonomy.
- experience: a coarse total-experience band, without employers, periods, or descriptions.
- work_formats: explicitly selected work formats from the private questionnaire.
- salary_compatibility: a nullable compatibility outcome with no salary amounts or bounds.
- soft_skills, location, and relocation: retained only for compatibility in existing saved sets; they are not returned by the anonymous card.
Only values that the candidate confirmed ever reach the card: an unconfirmed suggestion (status `extracted`) and an unknown value never do, whatever the field set says.
Adding a value is a contract change that lets a candidate publish more, and it is also a migration (the function `candidate_card_fields_are_canonical` and the CHECK constraints of the publication and event tables list the codes). A client treats an unknown value as a reason to ask for an update, and the server never adds a new value to a published set on its own.
enum:
- categories
- salary_compatibility
- self_assessment
- stack
- experience
- soft_skills
- location
- relocation
- work_formats
CardFieldSet:
type: array
minItems: 0
maxItems: 6
maxItems: 9
uniqueItems: true
description: >-
Distinct card fields. The server stores them in ascending order of
@@ -316,21 +320,70 @@ schemas:
required:
- specialization
- grade
- strength
properties:
specialization:
$ref: "./catalog_schemas.yml#/schemas/SpecializationCode"
grade:
$ref: "./catalog_schemas.yml#/schemas/GradeCode"
strength:
type: string
enum:
- standard
- strong
description: Coarse strength of the authoritative confirmation.
CardSelfAssessment:
type: object
description: Candidate-declared specialization and optional grade. This is never an assessment result.
additionalProperties: false
required:
- specialization
- confirmation_status
properties:
specialization:
$ref: "./catalog_schemas.yml#/schemas/SpecializationCode"
confirmation_status:
type: string
enum:
- confirmed
- unconfirmed
declared_grade:
oneOf:
- $ref: "./catalog_schemas.yml#/schemas/GradeCode"
- type: "null"
CandidateExperienceBand:
type: string
description: >-
Coarse total experience bucket. Rare combinations may be generalized to
0_3 or 3_plus before they are returned.
enum:
- "0_1"
- "1_3"
- "3_6"
- "6_plus"
- "0_3"
- "3_plus"
CandidateWorkFormat:
type: string
enum:
- remote
- office
- hybrid
CandidateSalaryCompatibility:
type: string
description: >-
A coarse compatibility result only. No salary amount, minimum, range,
or threshold is part of the anonymous card.
enum:
- compatible
- not_compatible
AnonymousCardContent:
type: object
description: >-
The anonymous candidate card as an organization reads it. Only values
that the candidate confirmed reach it; an unconfirmed suggestion and an
unknown value never do. A free text value (a stack tag, a soft skill, the
location) that looks like a contact (an email address, a phone number, a
URL or domain, a Telegram link, an @handle) is dropped by the builder
and never published. It carries
no name, contact, resume text, employer, salary figure, account or
The anonymous candidate card as an organization reads it. Only explicitly
published values reach it; unconfirmed stack suggestions and unknown
values never do. Stack output uses a closed taxonomy. It carries no name,
contact, resume text, employer, salary figure, account or
profile identifier, and no schema of the private profile or of a
contact disclosure is reachable from it; a contact reaches an
organization only through the contact grant of an accepted
@@ -343,13 +396,22 @@ schemas:
content.
additionalProperties: false
required:
- pseudonym
- categories
- stack
- experience_months
- soft_skills
- location
- relocation
- self_assessment
- experience_band
- work_formats
- salary_compatibility
properties:
pseudonym:
type: string
minLength: 47
maxLength: 47
pattern: '^cv1_[A-Za-z0-9_-]{43}$'
description: >-
Stable opaque alias scoped to the reading organization. It is not an
account or profile identifier and changes across organizations.
categories:
type:
- array
@@ -362,54 +424,51 @@ schemas:
type:
- array
- "null"
maxItems: 30
description: Technology tags of the candidate, or null.
maxItems: 4
description: Recognized confirmed technology codes only, or null.
items:
$ref: "./questionnaire_schemas.yml#/schemas/StackTag"
experience_months:
type:
- integer
- "null"
minimum: 0
maximum: 1200
description: >-
Total months of work experience, summed by the server without the
employers, periods, or descriptions, or null.
soft_skills:
type: string
enum:
- go
- postgresql
- kafka
- docker
self_assessment:
type:
- array
- "null"
maxItems: 10
description: Soft skills of the candidate, or null.
maxItems: 9
description: Candidate-declared specialization and grade, separate from categories.
items:
type: string
minLength: 1
maxLength: 50
pattern: '^\S(?:.*\S)?$'
description: Plain text; clients show it as text, never as HTML.
location:
$ref: "#/schemas/CardSelfAssessment"
experience_band:
oneOf:
- $ref: "#/schemas/CandidateExperienceBand"
- type: "null"
description: Coarse total work-experience bucket, or null.
work_formats:
type:
- string
- array
- "null"
minLength: 1
maxLength: 100
pattern: '^\S(?:.*\S)?$'
description: >-
City or region as free text, never a street address, or null.
Plain text; clients show it as text, never as HTML.
relocation:
type:
- boolean
- "null"
description: Whether the candidate is ready to relocate, or null.
maxItems: 3
description: Explicitly opted-in work formats, or null.
items:
$ref: "#/schemas/CandidateWorkFormat"
salary_compatibility:
oneOf:
- $ref: "#/schemas/CandidateSalaryCompatibility"
- type: "null"
description: Nullable compatibility result with no salary values.
CardPreview:
type: object
description: >-
What an organization that the candidate does not hide the profile from
would read now, computed from the current profile, the current
publication, and the consent ledger. It is a read for the candidate: it
creates no view and no history record, and it never reaches an
organization. `card` is null while the profile is closed.
A private candidate preview computed from the current profile,
publication, and consent ledger. Its pseudonym uses a separate preview
context and is not an organization's alias. Organization-specific
visibility filters and cohort checks can further generalize or suppress
the organization-facing card. This read creates no view or history
record and never reaches an organization. `card` is null while the
profile is closed.
additionalProperties: false
required:
- state
@@ -520,7 +579,7 @@ schemas:
description: |-
How an organization reached the candidate.
- card_viewed: an organization read the anonymous card in a search result.
- card_viewed: an organization read the permitted anonymous card.
- contact_read: an organization read the contacts through the contact grant of an accepted invitation.
enum:
- card_viewed
@@ -529,12 +588,12 @@ schemas:
type: object
description: >-
One access of an organization to the card or the contacts of the
current candidate. `organization` is null for a view by an
organization that has no invitation relation with the candidate, so the
history shows that the card was viewed without naming a company that
the candidate cannot otherwise see; whether the candidate should learn
the name is an open product question. The record carries no query,
ranking, or search filter of the organization.
current candidate. A retained access permits the candidate to see the
organization's identifier and current name and to hide their profile
from it. `organization` is null when the organization cannot be
presented. Earlier permitted accesses remain after hiding. The record
carries no employee identity, query, ranking, or search filter of the
organization.
additionalProperties: false
required:
- id
@@ -533,12 +533,12 @@ schemas:
format: int32
minimum: 1
description: >-
For a manual assessment, the version of the published rubric of the
category that the server fixed on creation; the expert assesses with
it, the same rubric as the automated assessment. Null for other
types, and null for a manual assessment whose category has no
published rubric yet: the case then waits in `waiting_expert` and
the client says so instead of promising a date.
For a manual assessment, the version of the grading policy pinned
by the server at creation. The exact reviewed category opening and
rubric manifest are retained privately so the expert can use the
same rubric as automated assessment. Null for other types and for a
manual assessment without one unique current reviewed category; the
case still waits in `waiting_expert`.
response_target:
$ref: "#/schemas/SupportResponseTarget"
decision: