feat(evidence): project skill evidence from confirmed assessments

This commit is contained in:
shira committed 2026-10-09 11:25:19 +03:00
1 parent 4761508f13
commit c2a8d17195
94 files changed
+10077 -151

No files matched your search

@@ -663,6 +663,13 @@ type Handler interface {
// formats appear only through their separate explicit publication choices, and self-assessment never
// becomes a confirmed category. Salary compatibility is nullable and contains no salary amount.
//
// `evidence` shows what an organization would read in the evidence section of the card
// (`GetOrganizationCandidateEvidence`): for each category of the card, the one assessment fact that
// supports its confirmed grade, with its skill, the passed grade, the trust level, the year, and the
// basis and calibration (`synthetic_demo`, `uncalibrated`). It is null while `card` is null, and an
// empty list when the card shows no category or no visible fact supports one. The preview applies no
// organization or cohort, so an organization can still receive less.
//
// A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account
// answers 403 forbidden.
//
@@ -841,6 +848,45 @@ type Handler interface {
//
// GET /api/v1/organizations/{org_id}/candidate-cards/{candidate_handle}
GetOrganizationCandidateCard(ctx context.Context, params GetOrganizationCandidateCardParams) (GetOrganizationCandidateCardRes, error)
// GetOrganizationCandidateEvidence implements GetOrganizationCandidateEvidence operation.
//
// Requires the session cookie of an employer account with an active membership in `org_id`. The
// organization and membership come from the current server-side session and path, never from cached
// search data.
//
// `candidate_handle` is the organization-scoped opaque alias issued by the current anonymous-card
// projection. The server runs the same checks as the card read on every request: active membership,
// effective C2 publication, the candidate's hiding of this organization, and the minimum cohort. In
// addition the card must publish the `categories` field and show at least one category after the
// cohort rules, because the evidence explains those categories and discloses nothing beyond them. An
// unknown handle, a handle of another organization, a closed or revoked publication, a profile hidden
// from this organization, a profile suppressed by the minimum cohort, and a card without categories
// all answer the same 404 not_found. Closing C2 or hiding the organization blocks this read
// immediately, and a cached response proves nothing.
//
// The response lists, for each category of the card, the one visible fact that supports its confirmed
// grade: the earliest assessment that passed exactly that grade, so a lower grade or a retake adds
// nothing. A fact the candidate hid is absent. Each fact carries only the skill, the passed grade, the
// trust level, the year of the assessment, and the basis and calibration of the method
// (`synthetic_demo`, `uncalibrated`), which are the same for every candidate and say that the fact is
// a demonstration, not a validated measurement. It carries no identifier of the fact, event, result,
// or candidate, no month or exact time, and never an answer, item, score, failed attempt, review band,
// or anti-cheat signal. An express training run and a failed attempt create no fact. The answer has no
// key that joins it to a person, but it is not unlinkable: with the other values of the card it can
// narrow a small pool of candidates.
//
// Reading the evidence is a view of the candidate card: it consumes the organization's current
// card-view quota with the same distinct-card rule and is recorded in the access history with the
// `categories` field. When the quota is exhausted the operation answers 429 with Retry-After. The
// response is `Cache-Control: no-store`.
//
// A missing, unknown, expired, or revoked session answers 401 unauthenticated; a candidate account
// answers 403 forbidden; an unknown organization or account without an active membership answers 404
// not_found. An `org_id` that is not a UUID or a malformed candidate handle answers 400
// validation_failed.
//
// GET /api/v1/organizations/{org_id}/candidate-cards/{candidate_handle}/evidence
GetOrganizationCandidateEvidence(ctx context.Context, params GetOrganizationCandidateEvidenceParams) (GetOrganizationCandidateEvidenceRes, error)
// GetOrganizationInvitation implements GetOrganizationInvitation operation.
//
// Requires the session cookie of an employer account with an active membership in `org_id`. The
@@ -1069,6 +1115,30 @@ type Handler interface {
//
// GET /api/v1/me/consents
ListMyConsents(ctx context.Context, params ListMyConsentsParams) (ListMyConsentsRes, error)
// ListMyEvidence implements ListMyEvidence operation.
//
// Requires the session cookie of a candidate account. The candidate comes from the session, so the
// response holds only the caller's own facts. Returns a page, newest event first with the fact
// identifier as the tie-breaker, with cursor pagination. The response is `Cache-Control: no-store`.
//
// A fact is derived from the immutable result of a confirmed real assessment (root or corrective), in
// the same transaction that stores the result. Each fact names its source (the event and the result,
// which the candidate can open at `GetMyAssessmentResult`), the skills of the event, the grade that
// was passed with its basis and calibration, the attribution, the date, the visibility, and the trust
// level. An online assessment without a reliable confirmation of the identity has trust 1. One source
// event is one fact: its skills are tags of that fact, so several tags never make several facts.
//
// The list never carries raw answers, items, scores, failed attempts, or anti-cheat data. A failed
// attempt, a result without a reviewed category source, and an express training run (`demo_express`)
// create no fact, so reading the list before and after an express run shows no new fact. The list
// includes facts the candidate hid, with `visibility` `hidden`.
//
// A missing, unknown, expired, or revoked session answers 401 unauthenticated; an employer account, or
// a candidate with an unverified email, answers 403 forbidden. A malformed `limit` or `cursor`, or a
// cursor of another candidate, answers 400 validation_failed.
//
// GET /api/v1/me/evidence
ListMyEvidence(ctx context.Context, params ListMyEvidenceParams) (ListMyEvidenceRes, error)
// ListMyHiddenOrganizations implements ListMyHiddenOrganizations operation.
//
// Requires the session cookie of a candidate account. The candidate comes from the session, so the