feat(visibility): add the candidate publication, hiding and search status contract

This commit is contained in:
shira committed 2026-10-07 00:15:52 +03:00
1 parent 4436f626a3
commit 0529601021
87 files changed
+21456 -83

No files matched your search

+227
View File
@@ -4056,3 +4056,230 @@ ProfileStaleVersion:
code: version_conflict
detail: The resource changed after it was read. Read it again before retrying.
trace_id: 9a0b1c2d-3e4f-4a5b-9c7d-8e9f0a1b2c34
PrivacyPublishedWithoutFields:
summary: A publication without any field
value:
type: urn:lincodex:problem:validation_failed
title: Request validation failed
status: 400
code: validation_failed
detail: One or more request fields are invalid.
trace_id: 3b4c5d6e-7f80-4a91-8b2c-3d4e5f6a7b8c
errors:
- in: body
pointer: /fields
code: invalid
message: A published profile needs at least one field, and a closed one none.
NewCandidatePrivacySettings:
summary: A new candidate with the profile closed
description: Nothing was ever published, announced, or hidden. Every version is 0.
value:
publication:
state: closed
closed_reason: never_published
fields: []
consent_id: null
published_at: null
version: 0
search_status:
value: not_looking
lapsed: false
confirmed_at: null
lapses_at: null
version: 0
hidden_organizations_total: 0
PublishedCandidatePrivacySettings:
summary: A published profile with a confirmed search status
value:
publication:
state: published
closed_reason: null
fields:
- categories
- stack
consent_id: 01928f7a-7a8b-7c9d-8e0f-1a2b3c4d5e60
published_at: "2026-10-06T09:10:00Z"
version: 1
search_status:
value: looking
lapsed: false
confirmed_at: "2026-10-06T09:12:00Z"
lapses_at: "2026-11-05T09:12:00Z"
version: 1
hidden_organizations_total: 1
PublicationUpdatePublish:
summary: Publish the confirmed categories and the stack
value:
expected_version: 0
state: published
fields:
- categories
- stack
PublicationUpdateClose:
summary: Close the publication
value:
expected_version: 1
state: closed
fields: []
PublishedPublication:
summary: The publication after the first publish
value:
state: published
closed_reason: null
fields:
- categories
- stack
consent_id: 01928f7a-7a8b-7c9d-8e0f-1a2b3c4d5e60
published_at: "2026-10-06T09:10:00Z"
version: 1
SearchStatusUpdateLooking:
summary: Set or confirm the status looking
value:
expected_version: 0
value: looking
LookingSearchStatus:
summary: A confirmed status that lapses after the policy interval
value:
value: looking
lapsed: false
confirmed_at: "2026-10-06T09:12:00Z"
lapses_at: "2026-11-05T09:12:00Z"
version: 1
LapsedSearchStatus:
summary: A status that was not confirmed in time
description: The candidate set looking and did not confirm it again, so it holds as not_looking. Nothing else changed; the publication and the hidden organizations are as they were.
value:
value: not_looking
lapsed: true
confirmed_at: "2026-10-06T09:12:00Z"
lapses_at: "2026-11-05T09:12:00Z"
version: 1
HiddenOrganizationRecord:
summary: An organization that the candidate hides the profile from
value:
organization:
id: 01928f7a-1a2b-7c3d-8e4f-5a6b7c8d9e01
name: ООО Пример Платежи
hidden_at: "2026-10-06T09:20:00Z"
HiddenOrganizationListPage:
summary: One hidden organization
value:
items:
- organization:
id: 01928f7a-1a2b-7c3d-8e4f-5a6b7c8d9e01
name: ООО Пример Платежи
hidden_at: "2026-10-06T09:20:00Z"
page:
has_more: false
next_cursor: null
PublishedCardPreview:
summary: The card of a published profile with two fields
description: The fields that are not published are null. The card carries no name and no contact.
value:
state: published
fields:
- categories
- stack
card:
categories:
- specialization: backend
grade: middle
stack:
- PostgreSQL
- Kafka
experience_months: null
soft_skills: null
location: null
relocation: null
generated_at: "2026-10-06T09:30:00Z"
ClosedCardPreview:
summary: The preview of a closed profile
value:
state: closed
fields: []
card: null
generated_at: "2026-10-06T09:30:00Z"
PrivacyEventListPage:
summary: A publication, a hiding, and a confirmed status
value:
items:
- id: 01928f7a-b1c2-7d3e-8f4a-5b6c7d8e9f01
kind: organization_hidden
occurred_at: "2026-10-06T09:20:00Z"
fields: null
consent_id: null
organization:
id: 01928f7a-1a2b-7c3d-8e4f-5a6b7c8d9e01
name: ООО Пример Платежи
- id: 01928f7a-b1c2-7d3e-8f4a-5b6c7d8e9e02
kind: search_status_confirmed
occurred_at: "2026-10-06T09:12:00Z"
fields: null
consent_id: null
organization: null
- id: 01928f7a-b1c2-7d3e-8f4a-5b6c7d8e9e01
kind: publication_opened
occurred_at: "2026-10-06T09:10:00Z"
fields:
- categories
- stack
consent_id: 01928f7a-7a8b-7c9d-8e0f-1a2b3c4d5e60
organization: null
page:
has_more: false
next_cursor: null
CardAccessListPage:
summary: An anonymous view and a contact read
value:
items:
- id: 01928f7a-c1d2-7e3f-8a4b-5c6d7e8f9a02
kind: contact_read
occurred_at: "2026-10-07T08:00:00Z"
organization:
id: 01928f7a-1a2b-7c3d-8e4f-5a6b7c8d9e01
name: ООО Пример Платежи
- id: 01928f7a-c1d2-7e3f-8a4b-5c6d7e8f9a01
kind: card_viewed
occurred_at: "2026-10-06T12:00:00Z"
organization: null
page:
has_more: false
next_cursor: null
PrivacyStaleVersion:
summary: The change carried a stale expected_version
description: The setting changed, for example in another tab, after the client read it. Nothing was changed; the client reads the settings again and reapplies its edit.
value:
type: urn:lincodex:problem:version_conflict
title: Resource version conflict
status: 412
code: version_conflict
detail: The resource changed after it was read. Read it again before retrying.
trace_id: 4c5d6e7f-8091-4ba2-9c3d-4e5f6a7b8c9d
PublicationConsentRequiredConflict:
summary: Publishing without an active C2 consent
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: 5d6e7f80-91a2-4cb3-8d4e-5f6a7b8c9d0e
errors:
- in: body
pointer: /state
code: consent_required
message: Publishing needs an active C2 consent of the account.
HiddenOrganizationLimitReached:
summary: The candidate hides the maximum number of organizations
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: 6e7f8091-a2b3-4dc4-9e5f-6a7b8c9d0e1f
errors:
- in: path
pointer: /org_id
code: limit_reached
message: The candidate already hides the maximum number of organizations.
+16
View File
@@ -129,3 +129,19 @@ MyInvitationId:
type: string
format: uuid
example: 01928f7a-7a8b-7c9d-8e0f-1a2b3c4d5e6f
HiddenOrganizationId:
name: org_id
in: path
required: true
description: >-
Identifier of the organization that the current candidate hides or stops
hiding the profile from. It names the target of a candidate's own
setting and grants the candidate nothing about the organization. Hiding
answers the same 404 not_found for an organization that does not exist
and for one that the candidate cannot see, so organizations cannot be
enumerated; lifting the hiding answers 204 for any well-formed
identifier.
schema:
type: string
format: uuid
example: 01928f7a-1a2b-7c3d-8e4f-5a6b7c8d9e01
+52
View File
@@ -624,3 +624,55 @@ ProfileVersionConflict:
examples:
version_conflict:
$ref: ./examples.yml#/ProfileStaleVersion
PrivacyValidationFailed:
description: >-
The body does not match the contract or breaks a visibility rule: an
unknown field, a repeated or unknown card field, a published state with
no field, a closed state with a field, a search status other than
looking and not_looking, or a missing or invalid expected_version; code
validation_failed with body pointers. Nothing was changed. The problem
never repeats a submitted value.
content:
application/problem+json:
schema:
$ref: ./schemas.yml#/Problem
examples:
published_without_fields:
$ref: ./examples.yml#/PrivacyPublishedWithoutFields
PrivacyVersionConflict:
description: >-
`expected_version` is not the current version of the setting; code
version_conflict. Nothing was changed; read the settings again before
retrying.
content:
application/problem+json:
schema:
$ref: ./schemas.yml#/Problem
examples:
version_conflict:
$ref: ./examples.yml#/PrivacyStaleVersion
PublicationConsentRequired:
description: >-
The profile cannot be published because the account has no active,
unrevoked C2 consent; code state_conflict. Nothing was changed. The
candidate gives C2 in the consent settings first. `errors` holds the entry
`{in: body, pointer: /state, code: consent_required}`.
content:
application/problem+json:
schema:
$ref: ./schemas.yml#/Problem
examples:
state_conflict:
$ref: ./examples.yml#/PublicationConsentRequiredConflict
HiddenOrganizationLimit:
description: >-
The candidate already hides the maximum number of organizations (1000);
code state_conflict with the entry `{in: path, pointer: /org_id, code:
limit_reached}` in `errors`. Nothing was changed.
content:
application/problem+json:
schema:
$ref: ./schemas.yml#/Problem
examples:
limit_reached:
$ref: ./examples.yml#/HiddenOrganizationLimitReached
+465 -2
View File
@@ -4874,6 +4874,469 @@ MyOrganizationList:
$ref: '#/MyOrganization'
page:
$ref: '#/PageInfo'
PublicationVersion:
type: integer
format: int64
minimum: 0
description: Version of the publication setting of the candidate. A candidate who has never published has version 0 and the profile is closed; every change that alters the setting advances it by one. The client sends the version it read as `expected_version`. It is independent of the versions of the profile and of the search status, so a change of one never makes another stale.
examples:
- 2
SearchStatusVersion:
type: integer
format: int64
minimum: 0
description: Version of the search status of the candidate. A candidate who never set the status has version 0 and the status `not_looking`; every confirmation or change advances it by one. The client sends the version it read as `expected_version`.
examples:
- 3
CardField:
type: string
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.
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
- stack
- experience
- soft_skills
- location
- relocation
CardFieldSet:
type: array
minItems: 0
maxItems: 6
uniqueItems: true
description: Distinct card fields. The server stores them in ascending order of the codes and answers them in that order, whatever order the client sent, so equal sets are equal arrays.
items:
$ref: '#/CardField'
PublicationState:
type: string
description: 'Whether the candidate card can be read by organizations at all. It is computed from the stored publication and the consent ledger: a profile is closed unless the candidate published it and the C2 consent that backs the publication is still unrevoked.
- closed: no organization reads the card. This is the state of every new profile and of a profile whose publication was closed or whose C2 was revoked.
- published: organizations may read exactly the fields in `fields`, except for the organizations the candidate hid.'
enum:
- closed
- published
PublicationClosedReason:
type: string
description: 'Why a closed profile is closed, shown only to the candidate.
- never_published: the candidate has never published the profile.
- closed_by_candidate: the candidate closed the publication.
- consent_revoked: the C2 consent that backed the publication was revoked. A later C2 grant never reopens the publication; the candidate publishes again explicitly and the new publication refers to the new consent record.'
enum:
- never_published
- closed_by_candidate
- consent_revoked
Publication:
type: object
description: 'Publication setting of the candidate card. It is separate from the consent: the C2 consent in the ledger proves that the candidate accepted the publication text, and this setting records whether and which fields are published. `state` is `published` only while the referenced C2 record is unrevoked, whatever the stored setting says, so a revocation closes the card at once. The state, the fields, and the times belong to the history that the C2 consent record does not carry.'
additionalProperties: false
required:
- state
- closed_reason
- fields
- consent_id
- published_at
- version
properties:
state:
$ref: '#/PublicationState'
closed_reason:
description: Why the profile is closed, or null while it is published.
oneOf:
- $ref: '#/PublicationClosedReason'
- type: 'null'
fields:
description: Card fields that organizations may read. Empty exactly when `state` is `closed`.
allOf:
- $ref: '#/CardFieldSet'
consent_id:
description: Identifier of the C2 record of the consent ledger that backs the current or the last publication, the `id` of a `ConsentRecord` of this account, or null when the profile was never published.
oneOf:
- type: string
format: uuid
- type: 'null'
published_at:
description: Moment of the latest change that published or republished the card, or null while the profile was never published. It stays after a closing, as the time of the last publication.
oneOf:
- $ref: '#/Timestamp'
- type: 'null'
version:
$ref: '#/PublicationVersion'
PublicationUpdate:
type: object
description: 'The complete new publication setting. `published` needs a non-empty set of fields and an active C2 consent of the account; `closed` needs an empty set and never fails for a missing consent. The body names no consent: the server binds the publication to the account''s current unrevoked C2 record, and a client can neither supply nor forge one.'
additionalProperties: false
required:
- expected_version
- state
- fields
properties:
expected_version:
$ref: '#/PublicationVersion'
state:
$ref: '#/PublicationState'
fields:
$ref: '#/CardFieldSet'
SearchStatusValue:
type: string
description: 'Whether the candidate says they are searching for work. The status is a statement, never a consent: it publishes nothing, hides nothing, and grants nothing, and no value of it changes the C2 consent, the publication, or the hidden organizations.
- looking: the candidate is searching ("Ищу"). It holds only while it is confirmed in time; see `SearchStatus.lapsed`.
- not_looking: the candidate is not announcing a search. It is the state of every new account and the state to which a lapsed status falls.'
enum:
- looking
- not_looking
SearchStatus:
type: object
description: 'Search status of the candidate as it holds now. The status `looking` stores the moment of its confirmation and lapses when the confirmation interval of the product policy passes without a new confirmation. A lapse only ever narrows: the status falls to `not_looking`, which is the non-public state, and a lapse never changes the publication or the hidden organizations. It needs no stored change, so no process can make a candidate more visible by expiry, and a lapsed candidate confirms again explicitly.'
additionalProperties: false
required:
- value
- lapsed
- confirmed_at
- lapses_at
- version
properties:
value:
description: 'The status that holds now: `looking` only while the confirmation has not lapsed.'
allOf:
- $ref: '#/SearchStatusValue'
lapsed:
type: boolean
description: True when the candidate set `looking`, did not confirm it again, and the interval ended, so `value` is `not_looking`. False otherwise, including a status the candidate cleared.
confirmed_at:
description: Moment of the latest confirmation of `looking`, or null when the candidate never set it or cleared it.
oneOf:
- $ref: '#/Timestamp'
- type: 'null'
lapses_at:
description: Moment at which the confirmed status lapses, fixed when it was confirmed from the `search_status` section of the product policy version in force then, or null when `confirmed_at` is null. A later policy change does not move it; it stays in the past for a lapsed status.
oneOf:
- $ref: '#/Timestamp'
- type: 'null'
version:
$ref: '#/SearchStatusVersion'
SearchStatusUpdate:
type: object
description: 'The complete new search status. `looking` is also the confirmation of a status that still holds or has lapsed: it sets the confirmation time to now. The body carries no time, interval, or policy version; the server takes them from the effective product policy.'
additionalProperties: false
required:
- expected_version
- value
properties:
expected_version:
$ref: '#/SearchStatusVersion'
value:
$ref: '#/SearchStatusValue'
PrivacyOrganization:
type: object
description: Organization as the candidate who hid it reads it. The name is the current name of the organization. The candidate must already have been able to see the organization to hide it, so the reference tells them nothing that they could not read before.
additionalProperties: false
required:
- id
- name
properties:
id:
type: string
format: uuid
description: Identifier of the organization.
name:
type: string
minLength: 1
maxLength: 200
description: Current name of the organization. Plain text; clients show it as text, never as HTML.
HiddenOrganization:
type: object
description: 'One organization that the candidate hides the profile from. The record belongs to the candidate: no organization reads it, learns that it was hidden, or can tell a hidden candidate from one who is not published.'
additionalProperties: false
required:
- organization
- hidden_at
properties:
organization:
$ref: '#/PrivacyOrganization'
hidden_at:
$ref: '#/Timestamp'
HiddenOrganizationList:
type: object
description: One page of the organizations that the candidate hides the profile from, newest first with the organization identifier as the tie-breaker.
additionalProperties: false
required:
- items
- page
properties:
items:
type: array
maxItems: 100
description: Hidden organizations of the page.
items:
$ref: '#/HiddenOrganization'
page:
$ref: '#/PageInfo'
PrivacySettings:
type: object
description: 'The visibility settings of the current candidate in one read: the publication, the search status, and the number of hidden organizations. The three are independent: each has its own version and its own operation, and a change of one leaves the others as they were. A new account reads a closed profile, `not_looking`, and no hidden organization.'
additionalProperties: false
required:
- publication
- search_status
- hidden_organizations_total
properties:
publication:
$ref: '#/Publication'
search_status:
$ref: '#/SearchStatus'
hidden_organizations_total:
type: integer
minimum: 0
maximum: 1000
description: Number of organizations that the candidate hides the profile from. The list is read with `ListMyHiddenOrganizations`.
CardCategory:
type: object
description: A category confirmed by assessment results, as the card shows it.
additionalProperties: false
required:
- specialization
- grade
properties:
specialization:
$ref: '#/SpecializationCode'
grade:
$ref: '#/GradeCode'
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 (TASK-089) and never published. 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 invitation. Each property is null when its field is not published or the candidate has no value for it, so the card does not tell the two apart. The set of properties is closed, and an organization-visible card must never gain a property that identifies the candidate. The search ranking and the full card of an organization's search
result are defined by the search contract (TASK-185), which reuses this content.
additionalProperties: false
required:
- categories
- stack
- experience_months
- soft_skills
- location
- relocation
properties:
categories:
type:
- array
- 'null'
maxItems: 9
description: Categories confirmed by assessment results, or null.
items:
$ref: '#/CardCategory'
stack:
type:
- array
- 'null'
maxItems: 30
description: Technology tags of the candidate, or null.
items:
$ref: '#/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:
- array
- 'null'
maxItems: 10
description: Soft skills of the candidate, or null.
items:
type: string
minLength: 1
maxLength: 50
pattern: ^\S(?:.*\S)?$
description: Plain text; clients show it as text, never as HTML.
location:
type:
- string
- '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.
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.'
additionalProperties: false
required:
- state
- fields
- card
- generated_at
properties:
state:
$ref: '#/PublicationState'
fields:
$ref: '#/CardFieldSet'
card:
oneOf:
- $ref: '#/AnonymousCardContent'
- type: 'null'
generated_at:
$ref: '#/Timestamp'
PrivacyEventKind:
type: string
description: 'Kind of a change of the visibility settings that the history records.
- publication_opened: the candidate published a closed profile.
- publication_changed: the candidate changed the published fields of a published profile, or published it again under a new C2 record.
- publication_closed: the candidate closed the publication. A revocation of C2 closes the card by the ledger and is read from the consent history, not recorded here.
- search_status_confirmed: the candidate set or confirmed `looking`.
- search_status_cleared: the candidate set `not_looking`. A lapse is not an event: it is computed.
- organization_hidden: the candidate hid the profile from an organization.
- organization_unhidden: the candidate lifted the hiding for an organization.'
enum:
- publication_opened
- publication_changed
- publication_closed
- search_status_confirmed
- search_status_cleared
- organization_hidden
- organization_unhidden
PrivacyEvent:
type: object
description: One recorded change of the visibility settings of the current candidate, as evidence of what was published, hidden, or announced and when. The history is append-only and returns only the caller's own records. A publication event carries the published fields and the C2 record behind them; an organization event names the organization; the other properties are null.
additionalProperties: false
required:
- id
- kind
- occurred_at
- fields
- consent_id
- organization
properties:
id:
type: string
format: uuid
description: Identifier of the event.
kind:
$ref: '#/PrivacyEventKind'
occurred_at:
$ref: '#/Timestamp'
fields:
description: Published fields after the change for `publication_opened` and `publication_changed`, an empty set for `publication_closed`, and null for every other kind.
oneOf:
- $ref: '#/CardFieldSet'
- type: 'null'
consent_id:
description: C2 record that backs the publication, for `publication_opened` and `publication_changed`, or null.
oneOf:
- type: string
format: uuid
- type: 'null'
organization:
description: Organization of `organization_hidden` and `organization_unhidden` with its current name, resolved when the history is read (the event stores only the identifier), or null.
oneOf:
- $ref: '#/PrivacyOrganization'
- type: 'null'
PrivacyEventList:
type: object
description: One page of the settings history of the current candidate, newest first.
additionalProperties: false
required:
- items
- page
properties:
items:
type: array
maxItems: 100
description: Events of the page.
items:
$ref: '#/PrivacyEvent'
page:
$ref: '#/PageInfo'
CardAccessKind:
type: string
description: 'How an organization reached the candidate.
- card_viewed: an organization read the anonymous card in a search result.
- contact_read: an organization read the contacts through the contact grant of an accepted invitation.'
enum:
- card_viewed
- contact_read
CardAccess:
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.
additionalProperties: false
required:
- id
- kind
- occurred_at
- organization
properties:
id:
type: string
format: uuid
description: Identifier of the access record.
kind:
$ref: '#/CardAccessKind'
occurred_at:
$ref: '#/Timestamp'
organization:
oneOf:
- $ref: '#/PrivacyOrganization'
- type: 'null'
CardAccessList:
type: object
description: One page of the accesses to the card of the current candidate, newest first.
additionalProperties: false
required:
- items
- page
properties:
items:
type: array
maxItems: 100
description: Accesses of the page.
items:
$ref: '#/CardAccess'
page:
$ref: '#/PageInfo'
Problem:
type: object
description: Problem details (RFC 9457) returned with the application/problem+json media type for every error response. `code` is the stable, machine-readable reason; clients branch on it rather than on `title`, `detail`, or the HTTP status alone. The body never contains internal error text, stack traces, SQL, file paths, credentials, contact data, or echoed request values.
@@ -4920,7 +5383,7 @@ Problem:
errors:
type: array
maxItems: 100
description: Field-level reasons for validation_failed. Other codes omit it.
description: Field-level reasons. validation_failed always carries them; state_conflict may carry one as a disambiguator when one code covers several conflicts (for example consent_required and limit_reached). Other codes omit it. A problem writer must not strip errors from a non-validation response.
items:
$ref: '#/ProblemFieldError'
ProblemCode:
@@ -5010,7 +5473,7 @@ ProblemFieldError:
minLength: 1
maxLength: 64
pattern: ^[a-z][a-z0-9_]*$
description: Stable field reason. Current values are `required` (missing value) and `invalid` (malformed value or a value outside the schema). Clients must tolerate new values.
description: Stable field reason. Current values are `required` (missing value) and `invalid` (malformed value or a value outside the schema), and, on a state_conflict, `consent_required` (the operation needs a consent that is not active) and `limit_reached` (a per-account bound is reached). Clients must tolerate new values.
message:
type: string
minLength: 1
@@ -0,0 +1,574 @@
schemas:
PublicationVersion:
type: integer
format: int64
minimum: 0
description: >-
Version of the publication setting of the candidate. A candidate who
has never published has version 0 and the profile is closed; every
change that alters the setting advances it by one. The client sends
the version it read as `expected_version`. It is independent of the
versions of the profile and of the search status, so a change of one
never makes another stale.
examples:
- 2
SearchStatusVersion:
type: integer
format: int64
minimum: 0
description: >-
Version of the search status of the candidate. A candidate who never
set the status has version 0 and the status `not_looking`; every
confirmation or change advances it by one. The client sends the
version it read as `expected_version`.
examples:
- 3
CardField:
type: string
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.
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
- stack
- experience
- soft_skills
- location
- relocation
CardFieldSet:
type: array
minItems: 0
maxItems: 6
uniqueItems: true
description: >-
Distinct card fields. The server stores them in ascending order of
the codes and answers them in that order, whatever order the client
sent, so equal sets are equal arrays.
items:
$ref: "#/schemas/CardField"
PublicationState:
type: string
description: |-
Whether the candidate card can be read by organizations at all. It is computed from the stored publication and the consent ledger: a profile is closed unless the candidate published it and the C2 consent that backs the publication is still unrevoked.
- closed: no organization reads the card. This is the state of every new profile and of a profile whose publication was closed or whose C2 was revoked.
- published: organizations may read exactly the fields in `fields`, except for the organizations the candidate hid.
enum:
- closed
- published
PublicationClosedReason:
type: string
description: |-
Why a closed profile is closed, shown only to the candidate.
- never_published: the candidate has never published the profile.
- closed_by_candidate: the candidate closed the publication.
- consent_revoked: the C2 consent that backed the publication was revoked. A later C2 grant never reopens the publication; the candidate publishes again explicitly and the new publication refers to the new consent record.
enum:
- never_published
- closed_by_candidate
- consent_revoked
Publication:
type: object
description: >-
Publication setting of the candidate card. It is separate from the
consent: the C2 consent in the ledger proves that the candidate
accepted the publication text, and this setting records whether and
which fields are published. `state` is `published` only while the
referenced C2 record is unrevoked, whatever the stored setting says,
so a revocation closes the card at once. The state, the fields, and
the times belong to the history that the C2 consent record does not
carry.
additionalProperties: false
required:
- state
- closed_reason
- fields
- consent_id
- published_at
- version
properties:
state:
$ref: "#/schemas/PublicationState"
closed_reason:
description: Why the profile is closed, or null while it is published.
oneOf:
- $ref: "#/schemas/PublicationClosedReason"
- type: "null"
fields:
description: >-
Card fields that organizations may read. Empty exactly when `state`
is `closed`.
allOf:
- $ref: "#/schemas/CardFieldSet"
consent_id:
description: >-
Identifier of the C2 record of the consent ledger that backs the
current or the last publication, the `id` of a `ConsentRecord` of
this account, or null when the profile was never published.
oneOf:
- type: string
format: uuid
- type: "null"
published_at:
description: >-
Moment of the latest change that published or republished the
card, or null while the profile was never published. It stays
after a closing, as the time of the last publication.
oneOf:
- $ref: "./common_schemas.yml#/schemas/Timestamp"
- type: "null"
version:
$ref: "#/schemas/PublicationVersion"
PublicationUpdate:
type: object
description: >-
The complete new publication setting. `published` needs a non-empty
set of fields and an active C2 consent of the account; `closed` needs
an empty set and never fails for a missing consent. The body names no
consent: the server binds the publication to the account's current
unrevoked C2 record, and a client can neither supply nor forge one.
additionalProperties: false
required:
- expected_version
- state
- fields
properties:
expected_version:
$ref: "#/schemas/PublicationVersion"
state:
$ref: "#/schemas/PublicationState"
fields:
$ref: "#/schemas/CardFieldSet"
SearchStatusValue:
type: string
description: |-
Whether the candidate says they are searching for work. The status is a statement, never a consent: it publishes nothing, hides nothing, and grants nothing, and no value of it changes the C2 consent, the publication, or the hidden organizations.
- looking: the candidate is searching ("Ищу"). It holds only while it is confirmed in time; see `SearchStatus.lapsed`.
- not_looking: the candidate is not announcing a search. It is the state of every new account and the state to which a lapsed status falls.
enum:
- looking
- not_looking
SearchStatus:
type: object
description: >-
Search status of the candidate as it holds now. The status `looking`
stores the moment of its confirmation and lapses when the
confirmation interval of the product policy passes without a new
confirmation. A lapse only ever narrows: the status falls to
`not_looking`, which is the non-public state, and a lapse never
changes the publication or the hidden organizations. It needs no
stored change, so no process can make a candidate more visible by
expiry, and a lapsed candidate confirms again explicitly.
additionalProperties: false
required:
- value
- lapsed
- confirmed_at
- lapses_at
- version
properties:
value:
description: >-
The status that holds now: `looking` only while the confirmation
has not lapsed.
allOf:
- $ref: "#/schemas/SearchStatusValue"
lapsed:
type: boolean
description: >-
True when the candidate set `looking`, did not confirm it again,
and the interval ended, so `value` is `not_looking`. False
otherwise, including a status the candidate cleared.
confirmed_at:
description: >-
Moment of the latest confirmation of `looking`, or null when the
candidate never set it or cleared it.
oneOf:
- $ref: "./common_schemas.yml#/schemas/Timestamp"
- type: "null"
lapses_at:
description: >-
Moment at which the confirmed status lapses, fixed when it was
confirmed from the `search_status` section of the product policy
version in force then, or null when `confirmed_at` is null. A
later policy change does not move it; it stays in the past for a
lapsed status.
oneOf:
- $ref: "./common_schemas.yml#/schemas/Timestamp"
- type: "null"
version:
$ref: "#/schemas/SearchStatusVersion"
SearchStatusUpdate:
type: object
description: >-
The complete new search status. `looking` is also the confirmation of
a status that still holds or has lapsed: it sets the confirmation time
to now. The body carries no time, interval, or policy version; the
server takes them from the effective product policy.
additionalProperties: false
required:
- expected_version
- value
properties:
expected_version:
$ref: "#/schemas/SearchStatusVersion"
value:
$ref: "#/schemas/SearchStatusValue"
PrivacyOrganization:
type: object
description: >-
Organization as the candidate who hid it reads it. The name is the
current name of the organization. The candidate must already have been
able to see the organization to hide it, so the reference tells them
nothing that they could not read before.
additionalProperties: false
required:
- id
- name
properties:
id:
type: string
format: uuid
description: Identifier of the organization.
name:
type: string
minLength: 1
maxLength: 200
description: >-
Current name of the organization. Plain text; clients show it as
text, never as HTML.
HiddenOrganization:
type: object
description: >-
One organization that the candidate hides the profile from. The record
belongs to the candidate: no organization reads it, learns that it was
hidden, or can tell a hidden candidate from one who is not published.
additionalProperties: false
required:
- organization
- hidden_at
properties:
organization:
$ref: "#/schemas/PrivacyOrganization"
hidden_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
HiddenOrganizationList:
type: object
description: >-
One page of the organizations that the candidate hides the profile
from, newest first with the organization identifier as the
tie-breaker.
additionalProperties: false
required:
- items
- page
properties:
items:
type: array
maxItems: 100
description: Hidden organizations of the page.
items:
$ref: "#/schemas/HiddenOrganization"
page:
$ref: "./common_schemas.yml#/schemas/PageInfo"
PrivacySettings:
type: object
description: >-
The visibility settings of the current candidate in one read: the
publication, the search status, and the number of hidden
organizations. The three are independent: each has its own version and
its own operation, and a change of one leaves the others as they were.
A new account reads a closed profile, `not_looking`, and no hidden
organization.
additionalProperties: false
required:
- publication
- search_status
- hidden_organizations_total
properties:
publication:
$ref: "#/schemas/Publication"
search_status:
$ref: "#/schemas/SearchStatus"
hidden_organizations_total:
type: integer
minimum: 0
maximum: 1000
description: >-
Number of organizations that the candidate hides the profile from.
The list is read with `ListMyHiddenOrganizations`.
CardCategory:
type: object
description: A category confirmed by assessment results, as the card shows it.
additionalProperties: false
required:
- specialization
- grade
properties:
specialization:
$ref: "./catalog_schemas.yml#/schemas/SpecializationCode"
grade:
$ref: "./catalog_schemas.yml#/schemas/GradeCode"
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
(TASK-089) and never published. 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
invitation. Each property is null when its field is not published or
the candidate has no value for it, so the card does not tell the two
apart. The set of properties is closed, and an organization-visible
card must never gain a property that identifies the candidate. The
search ranking and the full card of an organization's search result
are defined by the search contract (TASK-185), which reuses this
content.
additionalProperties: false
required:
- categories
- stack
- experience_months
- soft_skills
- location
- relocation
properties:
categories:
type:
- array
- "null"
maxItems: 9
description: Categories confirmed by assessment results, or null.
items:
$ref: "#/schemas/CardCategory"
stack:
type:
- array
- "null"
maxItems: 30
description: Technology tags of the candidate, 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:
- array
- "null"
maxItems: 10
description: Soft skills of the candidate, or null.
items:
type: string
minLength: 1
maxLength: 50
pattern: '^\S(?:.*\S)?$'
description: Plain text; clients show it as text, never as HTML.
location:
type:
- string
- "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.
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.
additionalProperties: false
required:
- state
- fields
- card
- generated_at
properties:
state:
$ref: "#/schemas/PublicationState"
fields:
$ref: "#/schemas/CardFieldSet"
card:
oneOf:
- $ref: "#/schemas/AnonymousCardContent"
- type: "null"
generated_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
PrivacyEventKind:
type: string
description: |-
Kind of a change of the visibility settings that the history records.
- publication_opened: the candidate published a closed profile.
- publication_changed: the candidate changed the published fields of a published profile, or published it again under a new C2 record.
- publication_closed: the candidate closed the publication. A revocation of C2 closes the card by the ledger and is read from the consent history, not recorded here.
- search_status_confirmed: the candidate set or confirmed `looking`.
- search_status_cleared: the candidate set `not_looking`. A lapse is not an event: it is computed.
- organization_hidden: the candidate hid the profile from an organization.
- organization_unhidden: the candidate lifted the hiding for an organization.
enum:
- publication_opened
- publication_changed
- publication_closed
- search_status_confirmed
- search_status_cleared
- organization_hidden
- organization_unhidden
PrivacyEvent:
type: object
description: >-
One recorded change of the visibility settings of the current
candidate, as evidence of what was published, hidden, or announced and
when. The history is append-only and returns only the caller's own
records. A publication event carries the published fields and the C2
record behind them; an organization event names the organization; the
other properties are null.
additionalProperties: false
required:
- id
- kind
- occurred_at
- fields
- consent_id
- organization
properties:
id:
type: string
format: uuid
description: Identifier of the event.
kind:
$ref: "#/schemas/PrivacyEventKind"
occurred_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
fields:
description: >-
Published fields after the change for `publication_opened` and
`publication_changed`, an empty set for `publication_closed`, and
null for every other kind.
oneOf:
- $ref: "#/schemas/CardFieldSet"
- type: "null"
consent_id:
description: >-
C2 record that backs the publication, for `publication_opened` and
`publication_changed`, or null.
oneOf:
- type: string
format: uuid
- type: "null"
organization:
description: >-
Organization of `organization_hidden` and `organization_unhidden`
with its current name, resolved when the history is read (the event
stores only the identifier), or null.
oneOf:
- $ref: "#/schemas/PrivacyOrganization"
- type: "null"
PrivacyEventList:
type: object
description: >-
One page of the settings history of the current candidate, newest
first.
additionalProperties: false
required:
- items
- page
properties:
items:
type: array
maxItems: 100
description: Events of the page.
items:
$ref: "#/schemas/PrivacyEvent"
page:
$ref: "./common_schemas.yml#/schemas/PageInfo"
CardAccessKind:
type: string
description: |-
How an organization reached the candidate.
- card_viewed: an organization read the anonymous card in a search result.
- contact_read: an organization read the contacts through the contact grant of an accepted invitation.
enum:
- card_viewed
- contact_read
CardAccess:
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.
additionalProperties: false
required:
- id
- kind
- occurred_at
- organization
properties:
id:
type: string
format: uuid
description: Identifier of the access record.
kind:
$ref: "#/schemas/CardAccessKind"
occurred_at:
$ref: "./common_schemas.yml#/schemas/Timestamp"
organization:
oneOf:
- $ref: "#/schemas/PrivacyOrganization"
- type: "null"
CardAccessList:
type: object
description: >-
One page of the accesses to the card of the current candidate, newest
first.
additionalProperties: false
required:
- items
- page
properties:
items:
type: array
maxItems: 100
description: Accesses of the page.
items:
$ref: "#/schemas/CardAccess"
page:
$ref: "./common_schemas.yml#/schemas/PageInfo"
@@ -61,7 +61,7 @@ schemas:
type: array
maxItems: 100
description: >-
Field-level reasons for validation_failed. Other codes omit it.
Field-level reasons. validation_failed always carries them; state_conflict may carry one as a disambiguator when one code covers several conflicts (for example consent_required and limit_reached). Other codes omit it. A problem writer must not strip errors from a non-validation response.
items:
$ref: "#/schemas/ProblemFieldError"
ProblemCode:
@@ -138,8 +138,10 @@ schemas:
pattern: "^[a-z][a-z0-9_]*$"
description: >-
Stable field reason. Current values are `required` (missing value)
and `invalid` (malformed value or a value outside the schema).
Clients must tolerate new values.
and `invalid` (malformed value or a value outside the schema), and,
on a state_conflict, `consent_required` (the operation needs a
consent that is not active) and `limit_reached` (a per-account
bound is reached). Clients must tolerate new values.
message:
type: string
minLength: 1
File diff suppressed because it is too large. Load diff
+84
View File
@@ -50,6 +50,16 @@ tags:
withdrawal and cancellation, and the contact grant. Contacts are
readable only through an active grant, in a response separate from
the terms.
- name: privacy
description: >-
Visibility of the current candidate: the publication of the anonymous
card (a setting that refers to the C2 consent of the ledger and never
replaces it), the search status that is not a consent, the
organizations that the candidate hides the profile from, the preview
of the card, and the history of the settings and of the accesses.
Everything is closed by default, and no change makes a candidate more
visible than they chose. No schema here reaches a contact, a name, or
the lowest salary.
- name: consent
description: >-
The consent ledger of the current account: the independent consents
@@ -137,6 +147,22 @@ paths:
$ref: ./routes/candidate_invitation_cancel.yml
/api/v1/me/consents:
$ref: ./routes/consents.yml
/api/v1/me/privacy:
$ref: ./routes/candidate_privacy.yml
/api/v1/me/privacy/publication:
$ref: ./routes/candidate_privacy_publication.yml
/api/v1/me/privacy/preview:
$ref: ./routes/candidate_privacy_preview.yml
/api/v1/me/privacy/search-status:
$ref: ./routes/candidate_privacy_search_status.yml
/api/v1/me/privacy/hidden-organizations:
$ref: ./routes/candidate_privacy_hidden_organizations.yml
/api/v1/me/privacy/hidden-organizations/{org_id}:
$ref: ./routes/candidate_privacy_hidden_organization.yml
/api/v1/me/privacy/history:
$ref: ./routes/candidate_privacy_history.yml
/api/v1/me/privacy/access-history:
$ref: ./routes/candidate_privacy_access_history.yml
/api/v1/me/support-cases:
$ref: ./routes/support_cases.yml
/api/v1/me/support-cases/{case_id}:
@@ -741,6 +767,54 @@ components:
$ref: ./components/schemas.yml#/MyOrganization
MyOrganizationList:
$ref: ./components/schemas.yml#/MyOrganizationList
PublicationVersion:
$ref: ./components/schemas.yml#/PublicationVersion
SearchStatusVersion:
$ref: ./components/schemas.yml#/SearchStatusVersion
CardField:
$ref: ./components/schemas.yml#/CardField
CardFieldSet:
$ref: ./components/schemas.yml#/CardFieldSet
PublicationState:
$ref: ./components/schemas.yml#/PublicationState
PublicationClosedReason:
$ref: ./components/schemas.yml#/PublicationClosedReason
Publication:
$ref: ./components/schemas.yml#/Publication
PublicationUpdate:
$ref: ./components/schemas.yml#/PublicationUpdate
SearchStatusValue:
$ref: ./components/schemas.yml#/SearchStatusValue
SearchStatus:
$ref: ./components/schemas.yml#/SearchStatus
SearchStatusUpdate:
$ref: ./components/schemas.yml#/SearchStatusUpdate
PrivacyOrganization:
$ref: ./components/schemas.yml#/PrivacyOrganization
HiddenOrganization:
$ref: ./components/schemas.yml#/HiddenOrganization
HiddenOrganizationList:
$ref: ./components/schemas.yml#/HiddenOrganizationList
PrivacySettings:
$ref: ./components/schemas.yml#/PrivacySettings
CardCategory:
$ref: ./components/schemas.yml#/CardCategory
AnonymousCardContent:
$ref: ./components/schemas.yml#/AnonymousCardContent
CardPreview:
$ref: ./components/schemas.yml#/CardPreview
PrivacyEventKind:
$ref: ./components/schemas.yml#/PrivacyEventKind
PrivacyEvent:
$ref: ./components/schemas.yml#/PrivacyEvent
PrivacyEventList:
$ref: ./components/schemas.yml#/PrivacyEventList
CardAccessKind:
$ref: ./components/schemas.yml#/CardAccessKind
CardAccess:
$ref: ./components/schemas.yml#/CardAccess
CardAccessList:
$ref: ./components/schemas.yml#/CardAccessList
parameters:
IdempotencyKey:
$ref: ./components/parameters.yml#/IdempotencyKey
@@ -762,6 +836,8 @@ components:
$ref: ./components/parameters.yml#/InvitationId
MyInvitationId:
$ref: ./components/parameters.yml#/MyInvitationId
HiddenOrganizationId:
$ref: ./components/parameters.yml#/HiddenOrganizationId
headers:
ETag:
$ref: ./components/headers.yml#/ETag
@@ -854,6 +930,14 @@ components:
$ref: ./components/responses.yml#/OrganizationValidationFailed
OrganizationVersionConflict:
$ref: ./components/responses.yml#/OrganizationVersionConflict
PrivacyValidationFailed:
$ref: ./components/responses.yml#/PrivacyValidationFailed
PrivacyVersionConflict:
$ref: ./components/responses.yml#/PrivacyVersionConflict
PublicationConsentRequired:
$ref: ./components/responses.yml#/PublicationConsentRequired
HiddenOrganizationLimit:
$ref: ./components/responses.yml#/HiddenOrganizationLimit
securitySchemes:
sessionCookie:
type: apiKey
+34
View File
@@ -0,0 +1,34 @@
get:
operationId: GetMyPrivacySettings
summary: Read the visibility settings of the current candidate.
description: |-
Requires the session cookie of a candidate account. The candidate comes from the session, never from a request parameter. Returns the publication of the candidate card, the search status, and the number of hidden organizations in one read. The response is `Cache-Control: no-store`.
A profile is closed by default. A candidate who never published reads `publication.state` `closed` with `closed_reason` `never_published`, an empty field set, and version 0; creating or saving the profile (`SaveMyProfile`) never publishes it, and no operation of the profile, the questionnaire, or an assessment changes these settings. The C2 consent, the search status, and the hidden organizations are three independent settings: the C2 record in the consent ledger proves that the candidate accepted the publication text, the publication records which fields are published, and the search status is a statement of the candidate that is not a consent. A change of one never changes another, and none of them ever makes the candidate more visible by itself: the search status lapses to the non-public `not_looking`, a revoked C2 closes the card, and a new C2 grant publishes nothing.
A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden.
security:
- sessionCookie: []
tags:
- privacy
responses:
"200":
description: The visibility settings of the current candidate.
headers:
Cache-Control:
$ref: ../components/headers.yml#/CacheControlNoStore
content:
application/json:
schema:
$ref: ../components/schemas.yml#/PrivacySettings
examples:
new_candidate:
$ref: ../components/examples.yml#/NewCandidatePrivacySettings
published_and_looking:
$ref: ../components/examples.yml#/PublishedCandidatePrivacySettings
"401":
$ref: ../components/responses.yml#/Unauthenticated
"403":
$ref: ../components/responses.yml#/Forbidden
default:
$ref: ../components/responses.yml#/Problem
@@ -0,0 +1,39 @@
get:
operationId: ListMyCardAccessHistory
summary: List the accesses of organizations to the card of the current candidate.
description: |-
Requires the session cookie of a candidate account. The candidate comes from the session, so the response holds only accesses to the caller's own card. Returns a page, newest first with the record identifier as the tie-breaker, with cursor pagination. The response is `Cache-Control: no-store`.
An access is a view of the anonymous card by an organization (`card_viewed`) or a read of the contacts through an active contact grant (`contact_read`). Reading the history is not an access and writes nothing. A view of the card by an organization that has no invitation relation with the candidate carries `organization` null, so the candidate sees that the card was viewed without learning a company that they cannot otherwise see; a contact read always names the organization, because the candidate accepted its invitation. The entries carry no search query, filter, or ranking of the organization, and no organization the candidate hides ever appears as a viewer, because a hidden organization cannot read the card.
The storage of accesses is planned with the card and contact operations of the organization side (TASK-185 and the contact read of the invitation contract); until then the operation answers 501 not_implemented after the session and request checks.
A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden. A malformed `limit` or `cursor` answers 400 validation_failed.
security:
- sessionCookie: []
tags:
- privacy
parameters:
- $ref: ../components/parameters.yml#/PageLimit
- $ref: ../components/parameters.yml#/PageCursor
responses:
"200":
description: A page of the accesses to the card of the current candidate.
headers:
Cache-Control:
$ref: ../components/headers.yml#/CacheControlNoStore
content:
application/json:
schema:
$ref: ../components/schemas.yml#/CardAccessList
examples:
page:
$ref: ../components/examples.yml#/CardAccessListPage
"400":
$ref: ../components/responses.yml#/ValidationFailed
"401":
$ref: ../components/responses.yml#/Unauthenticated
"403":
$ref: ../components/responses.yml#/Forbidden
default:
$ref: ../components/responses.yml#/Problem
@@ -0,0 +1,81 @@
put:
operationId: HideOrganization
summary: Hide the candidate profile from one organization.
description: |-
Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The request has no body: the path names the organization and the candidate comes from the session. The hiding is a record that belongs to the candidate and references the organization; it changes neither the C2 consent, nor the publication, nor the search status.
The operation sets a state, so it is idempotent and needs no Idempotency-Key: hiding an organization that is already hidden answers 200 with the existing record and its original `hidden_at`, changes nothing, and writes no history record. There is one record per candidate and organization.
Anti-enumeration: an organization that does not exist and an organization that the candidate cannot see answer the same 404 not_found, with the same body and without a timing or an error code that tells them apart, so the operation is not a way to ask whether an identifier belongs to an organization. The candidate can see an organization that has sent them an invitation, and the organizations that a candidate lookup will list (planned; see the open questions of the contract). The response names the organization only after that check, with its current name. The identifiers are random, the general rate limit applies and can answer 429 with Retry-After before any check, and the record never reveals to an organization that a candidate hides it.
A candidate hides at most 1000 organizations; hiding one more answers 409 state_conflict with the entry `{in: path, pointer: /org_id, code: limit_reached}` in `errors`, which tells it apart from other conflicts, and changes nothing, and a repeat of an existing hiding is never refused for the limit.
Hiding an organization that holds an active contact grant of the candidate revokes that grant with the reason `visibility_closed` in the same transaction (planned together with the invitation operations). Lifting the hiding never reopens a grant.
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation of the path (400), account scenario (403 forbidden for an employer), the organization and its visibility to the candidate (404 not_found), then the repeat (200), then the limit (409 state_conflict). Like every visibility change, hiding needs a verified email (a usecase requirement).
security:
- sessionCookie: []
sessionCsrf: []
tags:
- privacy
parameters:
- $ref: ../components/parameters.yml#/HiddenOrganizationId
responses:
"200":
description: >-
The organization is hidden from the candidate profile: the new record
or the one that existed.
headers:
Cache-Control:
$ref: ../components/headers.yml#/CacheControlNoStore
content:
application/json:
schema:
$ref: ../components/schemas.yml#/HiddenOrganization
examples:
hidden:
$ref: ../components/examples.yml#/HiddenOrganizationRecord
"400":
$ref: ../components/responses.yml#/ValidationFailed
"401":
$ref: ../components/responses.yml#/Unauthenticated
"403":
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
"404":
$ref: ../components/responses.yml#/NotFound
"409":
$ref: ../components/responses.yml#/HiddenOrganizationLimit
"429":
$ref: ../components/responses.yml#/TooManyRequests
default:
$ref: ../components/responses.yml#/Problem
delete:
operationId: UnhideOrganization
summary: Lift the hiding of the candidate profile from one organization.
description: |-
Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. Deletes the hiding record of the candidate for the organization in the path. The request is idempotent: it answers 204 whether the organization was hidden, was not hidden, or does not exist, so the operation reveals nothing about the organization, and a repeat after a lost response succeeds. The record is deleted, the settings history keeps the event `organization_unhidden` only when a record was deleted.
Lifting the hiding makes the candidate readable by that organization again only if the profile is published and the organization otherwise may read it. It changes neither the C2 consent, nor the publication, nor the search status, and it never reopens a contact grant that the hiding closed.
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation of the path (400), account scenario (403 forbidden for an employer), then the deletion (204).
security:
- sessionCookie: []
sessionCsrf: []
tags:
- privacy
parameters:
- $ref: ../components/parameters.yml#/HiddenOrganizationId
responses:
"204":
description: The organization is not hidden from the candidate profile.
headers:
Cache-Control:
$ref: ../components/headers.yml#/CacheControlNoStore
"400":
$ref: ../components/responses.yml#/ValidationFailed
"401":
$ref: ../components/responses.yml#/Unauthenticated
"403":
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
default:
$ref: ../components/responses.yml#/Problem
@@ -0,0 +1,37 @@
get:
operationId: ListMyHiddenOrganizations
summary: List the organizations that the candidate hides the profile from.
description: |-
Requires the session cookie of a candidate account. The candidate comes from the session, so the response holds only the caller's own records and no request can name another account. Returns a page of the hidden organizations, newest first with the organization identifier as the tie-breaker, with cursor pagination. The response is `Cache-Control: no-store`.
The records belong to the candidate. An organization never reads them, never learns that it is hidden, and sees a hidden candidate exactly as it sees one who is not published: no search result, no card, no contact read.
A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden. A malformed `limit` or `cursor` answers 400 validation_failed.
security:
- sessionCookie: []
tags:
- privacy
parameters:
- $ref: ../components/parameters.yml#/PageLimit
- $ref: ../components/parameters.yml#/PageCursor
responses:
"200":
description: A page of the hidden organizations of the current candidate.
headers:
Cache-Control:
$ref: ../components/headers.yml#/CacheControlNoStore
content:
application/json:
schema:
$ref: ../components/schemas.yml#/HiddenOrganizationList
examples:
page:
$ref: ../components/examples.yml#/HiddenOrganizationListPage
"400":
$ref: ../components/responses.yml#/ValidationFailed
"401":
$ref: ../components/responses.yml#/Unauthenticated
"403":
$ref: ../components/responses.yml#/Forbidden
default:
$ref: ../components/responses.yml#/Problem
@@ -0,0 +1,37 @@
get:
operationId: ListMyPrivacyHistory
summary: List the changes of the visibility settings of the current candidate.
description: |-
Requires the session cookie of a candidate account. The candidate comes from the session, so the response holds only the caller's own records. Returns a page of the settings history, newest first with the event identifier as the tie-breaker, with cursor pagination. The response is `Cache-Control: no-store`.
The history is append-only evidence of what the candidate published, hid, and announced, and when. A publication event keeps the published fields and the C2 record behind them, which is what the consent ledger deliberately does not carry (the C2 record proves the consent to the text, not the field set). A revocation of C2 and a lapse of the search status are computed and are not events here; the consent history shows the revocation. The history never contains a profile value.
A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden. A malformed `limit` or `cursor` answers 400 validation_failed.
security:
- sessionCookie: []
tags:
- privacy
parameters:
- $ref: ../components/parameters.yml#/PageLimit
- $ref: ../components/parameters.yml#/PageCursor
responses:
"200":
description: A page of the settings history of the current candidate.
headers:
Cache-Control:
$ref: ../components/headers.yml#/CacheControlNoStore
content:
application/json:
schema:
$ref: ../components/schemas.yml#/PrivacyEventList
examples:
page:
$ref: ../components/examples.yml#/PrivacyEventListPage
"400":
$ref: ../components/responses.yml#/ValidationFailed
"401":
$ref: ../components/responses.yml#/Unauthenticated
"403":
$ref: ../components/responses.yml#/Forbidden
default:
$ref: ../components/responses.yml#/Problem
@@ -0,0 +1,34 @@
get:
operationId: GetMyCardPreview
summary: Preview the anonymous card that organizations would read.
description: |-
Requires the session cookie of a candidate account. Returns the card exactly as an organization that the candidate does not hide the profile from would read it now, built from the current profile, the current publication, and the consent ledger. The response is `Cache-Control: no-store`.
The preview is a private read for the candidate: it creates no view, leaves no access record, and is never shown to an organization. While the profile is closed `card` is null. `card` is `AnonymousCardContent`, whose schema reaches no private profile schema, no contact, and no identifier of the candidate: it has no name, email, phone, Telegram name, employer, salary figure, or account or profile identifier, and each property is null when it is not published or has no value, so a reader cannot tell the two apart. Only the fields in `fields` are filled, and only with values that the candidate confirmed: an unconfirmed suggestion and an unknown value never appear. A free text value that looks like a contact (an email address, a phone number, a URL, a Telegram link, an @handle) is dropped from the card, so the preview shows exactly what an organization would read. The self-assessed grade is not a category and never appears; categories come only from assessment results.
A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account answers 403 forbidden.
security:
- sessionCookie: []
tags:
- privacy
responses:
"200":
description: The anonymous card as organizations would read it now.
headers:
Cache-Control:
$ref: ../components/headers.yml#/CacheControlNoStore
content:
application/json:
schema:
$ref: ../components/schemas.yml#/CardPreview
examples:
published:
$ref: ../components/examples.yml#/PublishedCardPreview
closed:
$ref: ../components/examples.yml#/ClosedCardPreview
"401":
$ref: ../components/responses.yml#/Unauthenticated
"403":
$ref: ../components/responses.yml#/Forbidden
default:
$ref: ../components/responses.yml#/Problem
@@ -0,0 +1,56 @@
put:
operationId: SetMyPublication
summary: Publish or close the anonymous candidate card.
description: |-
Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The body is the complete new publication setting: `state` `published` with the non-empty set of card fields, or `closed` with an empty set. It changes only the publication; the search status and the hidden organizations stay as they were.
Publication is not a consent and does not duplicate one. The consent C2 lives in the consent ledger (`ListMyConsents`); this setting refers to it. Publishing requires an active, unrevoked C2 record of the account and binds the publication to that record, so a client sends no consent identifier and cannot forge one. Without one the server answers 409 state_conflict with the entry `{in: body, pointer: /state, code: consent_required}` in `errors`, which tells it apart from every other conflict, and changes nothing: the client gives C2 first (planned in the consent settings, TASK-063) and then publishes. The server takes the C2 record under a share lock in the transaction that writes the publication, so a revocation that races with a publication either commits first (the publication is refused) or closes the card right after. A revocation of C2 closes the card at once, because `state` is computed from the unrevoked record; a later C2 grant never reopens it, and the candidate publishes again under the new record. The revocation path itself (TASK-064) closes the stored publication and revokes the contact grants in its own transaction. A closing sent over a stored publication whose C2 was revoked is a real change: it stores the closing, records `publication_closed`, and revokes the grants as any closing does. Publishing, like every visibility change, needs a verified email (a usecase requirement; the unverified account cleanup deletes only accounts without such records). Publishing never adds a field that the body did not name, and a new `CardField` value is never published for a candidate who did not choose it.
The field set contains only the groups of `CardField`. The full name, contacts, and the lowest salary have no value there, so no body can publish them. Only values that the candidate confirmed ever reach the card. Contacts reach an organization only through the contact grant (C4), and a profile that is published or closed changes none of the grants that exist; closing the publication, and hiding an organization that holds a grant, revoke the contact grants concerned with the reason `visibility_closed` in the same transaction as the change (planned together with the operations, see the invitation contract).
Optimistic concurrency uses `expected_version` in the body: the client sends the `version` it read, 0 for the first publication. If it is not the current version the server answers 412 version_conflict and changes nothing. The version travels in the body rather than in If-Match because the generated client cannot read the ETag header yet. A body that equals the stored setting changes nothing, keeps the version, and answers 200 even when `expected_version` is older, so a retry after a lost response succeeds without an Idempotency-Key. A version above the current one never existed and always answers 412. Every change is recorded in the settings history with its time, the fields, and the C2 record.
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for an employer), a version above the current one (412), rules that depend on the body alone (400), an unchanged body (200), a stale version (412), then the active C2 for a publication (409 state_conflict). The schema rejects an unknown field, a repeated or unknown card field, and more fields than there are groups; a published state with no field, and a closed state with a field, answer 400 validation_failed with the pointer `/fields`. Error bodies never repeat a submitted value.
security:
- sessionCookie: []
sessionCsrf: []
tags:
- privacy
requestBody:
required: true
content:
application/json:
schema:
$ref: ../components/schemas.yml#/PublicationUpdate
examples:
publish:
$ref: ../components/examples.yml#/PublicationUpdatePublish
close:
$ref: ../components/examples.yml#/PublicationUpdateClose
responses:
"200":
description: >-
The saved publication with its new version, or the current one when
the body changes nothing.
headers:
Cache-Control:
$ref: ../components/headers.yml#/CacheControlNoStore
content:
application/json:
schema:
$ref: ../components/schemas.yml#/Publication
examples:
published:
$ref: ../components/examples.yml#/PublishedPublication
"400":
$ref: ../components/responses.yml#/PrivacyValidationFailed
"401":
$ref: ../components/responses.yml#/Unauthenticated
"403":
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
"409":
$ref: ../components/responses.yml#/PublicationConsentRequired
"412":
$ref: ../components/responses.yml#/PrivacyVersionConflict
default:
$ref: ../components/responses.yml#/Problem
@@ -0,0 +1,54 @@
put:
operationId: SetMySearchStatus
summary: Set or confirm the search status of the current candidate.
description: |-
Requires the session cookie of a candidate account, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The body is the complete new status: `looking` ("Ищу") or `not_looking`. The status is a statement of the candidate and never a consent. It changes neither the C2 consent, nor the publication, nor the hidden organizations, and it does not close or open any contact grant; a candidate whose profile is closed who sets `looking` becomes visible to no one.
`looking` stores the moment of the confirmation and a lapse time. The server takes the interval from the `search_status` section of the effective product policy (30 days in the demo policy, `searching_confirmation_interval_days`), stores the policy version it used, and fixes the lapse time then, so a later policy change moves no stored time. Setting `looking` again is the confirmation: it replaces the confirmation time with now and advances the version, also after a lapse. The body carries no time, interval, or policy version.
After the lapse time the status holds as `not_looking` with `lapsed` true on the next read. The lapse is computed and written nowhere, so it needs no job, it can never make the candidate more visible, and it never touches the publication or the hidden organizations. A reminder before the lapse is a planned notification, not a part of this operation.
Optimistic concurrency uses `expected_version` in the body, 0 for a candidate who never set the status; a stale or non-existent version answers 412 version_conflict and changes nothing. `not_looking` over a stored `not_looking` changes nothing and answers 200 even with a stale version. `looking` always changes the stored confirmation, so a retry of a confirmation whose response was lost with the old version answers 412 and the client reads the status again.
Order of checks: session (401), CSRF and Origin (403 csrf_check_failed), request validation (400), account scenario (403 forbidden for an employer), a version above the current one (412), an unchanged `not_looking` (200), then a stale version (412).
security:
- sessionCookie: []
sessionCsrf: []
tags:
- privacy
requestBody:
required: true
content:
application/json:
schema:
$ref: ../components/schemas.yml#/SearchStatusUpdate
examples:
looking:
$ref: ../components/examples.yml#/SearchStatusUpdateLooking
responses:
"200":
description: >-
The saved search status with its new version, or the current one
when the body changes nothing.
headers:
Cache-Control:
$ref: ../components/headers.yml#/CacheControlNoStore
content:
application/json:
schema:
$ref: ../components/schemas.yml#/SearchStatus
examples:
looking:
$ref: ../components/examples.yml#/LookingSearchStatus
lapsed:
$ref: ../components/examples.yml#/LapsedSearchStatus
"400":
$ref: ../components/responses.yml#/PrivacyValidationFailed
"401":
$ref: ../components/responses.yml#/Unauthenticated
"403":
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
"412":
$ref: ../components/responses.yml#/PrivacyVersionConflict
default:
$ref: ../components/responses.yml#/Problem