feat(matching): rank with semantic embeddings and explain matches by evidence

This commit is contained in:
shira committed 2026-10-11 10:39:46 +03:00
1 parent facc1789b1
commit 24b64d698a
215 files changed
+16951 -327

No files matched your search

@@ -515,6 +515,138 @@ schemas:
$ref: "#/schemas/ProfileItemStatus"
source:
$ref: "#/schemas/ProfileClaimSource"
ProfileProjectTitle:
type: string
minLength: 1
maxLength: 100
pattern: '^\S(?:.*\S)?$'
description: >-
Name of a project as the candidate wants an organization to read it. It
has no leading or trailing whitespace and no line breaks. When the
candidate publishes the `projects` card field, the title reaches the
anonymous card and match explanations, so it must not contain a name,
a contact, or a repository address. Plain text; clients show it as
text, never as HTML.
ProfileProjectDescription:
type: string
minLength: 1
maxLength: 500
description: >-
What the project does and what the candidate did in it. It may contain
line breaks. When the `projects` card field is published it reaches the
anonymous card. Plain text; clients show it as text, never as HTML.
ProfileRepositoryUrl:
type: string
minLength: 22
maxLength: 160
pattern: '^https://github\.com/[A-Za-z0-9](?:[A-Za-z0-9-]{0,38})/[A-Za-z0-9._-]{1,100}/?$'
description: >-
Address of a public GitHub repository of the project in the form
https://github.com/<owner>/<repository>. The server accepts only this
host and form, removes a trailing slash and a `.git` suffix, and stores
the canonical address. Organizations never receive the address before
an accepted invitation, because the owner name can identify the
candidate.
examples:
- https://github.com/example-org/payments-ledger
ProfileRepositoryCheckState:
type: string
description: |-
Result of the latest server check of a project repository on the public GitHub API. The server only reads public metadata; a check never proves that the candidate wrote the code.
- pending: the check is scheduled and has not finished yet.
- verified: the repository exists and is public. Match explanations may then say that the project is backed by a public repository.
- not_found: GitHub reports no such public repository; it may be private, renamed to another owner, or deleted.
- unavailable: GitHub could not be asked, for example because of its rate limit; the server retries later.
enum:
- pending
- verified
- not_found
- unavailable
ProfileRepositoryCheck:
type: object
description: >-
State of the server check of a project repository. Read-only; no
request writes it. The fetched metadata itself (description, topics,
languages, and a plain-text README excerpt) is used only for ranking
and is never returned or shown.
additionalProperties: false
required:
- state
- checked_at
properties:
state:
$ref: "#/schemas/ProfileRepositoryCheckState"
checked_at:
description: Time of the last finished check, or null before the first one.
oneOf:
- $ref: "./common_schemas.yml#/schemas/Timestamp"
- type: "null"
ProfileProjectStack:
type: array
maxItems: 10
description: >-
Technology tags of the project, each tag at most once without regard to
letter case.
items:
$ref: "./questionnaire_schemas.yml#/schemas/StackTag"
ProfileRepositoryCheckRequest:
type: object
description: Result of a request to check the linked repositories again.
additionalProperties: false
required:
- scheduled
properties:
scheduled:
type: integer
format: int32
minimum: 0
maximum: 10
description: Number of repository checks that the request scheduled.
ProfileProjectItem:
type: object
description: >-
One project of the candidate with its confirmation state and provenance.
A project is a claim of trust level 0 that the candidate types; a
linked repository adds a separate server check (`repository_check`),
never a higher trust level. The project reaches organizations only when
the candidate publishes the `projects` card field, and then without the
repository address.
additionalProperties: false
required:
- title
- description
- stack
- repository_url
- repository_check
- status
- source
properties:
title:
$ref: "#/schemas/ProfileProjectTitle"
description:
description: What the project is about, or null when the candidate gives nothing.
oneOf:
- $ref: "#/schemas/ProfileProjectDescription"
- type: "null"
stack:
$ref: "#/schemas/ProfileProjectStack"
repository_url:
description: Canonical repository address, or null when the project links none.
oneOf:
- $ref: "#/schemas/ProfileRepositoryUrl"
- type: "null"
repository_check:
description: >-
The server check of the linked repository, or null when the project
links none.
oneOf:
- $ref: "#/schemas/ProfileRepositoryCheck"
- type: "null"
status:
$ref: "#/schemas/ProfileItemStatus"
source:
$ref: "#/schemas/ProfileClaimSource"
ProfileExperienceOverlapStatus:
type: string
description: Whether the candidate confirmed that two overlapping periods are genuine parallel work.
@@ -622,8 +754,8 @@ schemas:
type: object
description: >-
The private profile of the current candidate: full name and contacts,
stack, roles, work experience, soft skills, and desired terms, each
value with its confirmation state and provenance. It is personal data
stack, roles, work experience, soft skills, projects, and desired
terms, each value with its confirmation state and provenance. It is personal data
that only the candidate reads. It is never an organization-visible
schema: an organization sees a candidate only through the anonymous
card and, after an accepted invitation, through the contact grant, and
@@ -650,6 +782,7 @@ schemas:
- experience
- experience_overlaps
- soft_skills
- projects
- terms
- confirmed_categories
- updated_at
@@ -698,6 +831,14 @@ schemas:
most once without regard to letter case.
items:
$ref: "#/schemas/ProfileSoftSkillItem"
projects:
type: array
maxItems: 10
description: >-
Projects in the order the candidate gave them, each repository
address at most once.
items:
$ref: "#/schemas/ProfileProjectItem"
terms:
$ref: "#/schemas/ProfileTerms"
confirmed_categories:
@@ -945,12 +1086,42 @@ schemas:
- type: "null"
status:
$ref: "#/schemas/ProfileItemStatus"
ProfileProjectItemInput:
type: object
description: >-
Decision about one project in a request; see CandidateProfileUpdate for
the rules of `status`. The server answers 400 with the pointer of the
field for a repository address that is not a GitHub repository address,
a repeated repository, or a repeated stack tag.
additionalProperties: false
required:
- title
- description
- stack
- repository_url
- status
properties:
title:
$ref: "#/schemas/ProfileProjectTitle"
description:
oneOf:
- $ref: "#/schemas/ProfileProjectDescription"
- type: "null"
stack:
$ref: "#/schemas/ProfileProjectStack"
repository_url:
oneOf:
- $ref: "#/schemas/ProfileRepositoryUrl"
- type: "null"
status:
$ref: "#/schemas/ProfileItemStatus"
CandidateProfileUpdate:
type: object
description: >-
Complete new state of the candidate profile. It replaces every stored
value as a whole: a single field sent as null is unknown and is removed,
and a list replaces the stored list. The body is personal data.
and a list replaces the stored list; only `projects` may be omitted,
which keeps the stored projects. The body is personal data.
Each value carries a decision `status`. `confirmed` sets a manual value
or confirms a stored suggestion; confirming a suggestion with exactly
@@ -1025,5 +1196,17 @@ schemas:
that repeats an earlier one without regard to letter case.
items:
$ref: "#/schemas/ProfileSoftSkillItemInput"
projects:
type: array
maxItems: 10
description: >-
Projects. Unlike the other lists this one is optional: a body
without `projects` keeps the stored projects unchanged, so a client
that does not know the section never deletes it, and an array,
including an empty one, replaces the stored list. A new or changed
repository address schedules a server check on the public GitHub
API after the save commits; the save itself never waits for GitHub.
items:
$ref: "#/schemas/ProfileProjectItemInput"
terms:
$ref: "#/schemas/ProfileTermsInput"
@@ -353,6 +353,91 @@ schemas:
maxItems: 12
items:
$ref: "#/schemas/MatchEvidenceSummaryItem"
MatchRequirementKind:
type: string
description: Kind of the need requirement that an explanation item answers.
enum:
- required_skill
- desired_skill
- task
MatchSemanticItemKind:
type: string
description: |-
Kind of the published card item that matched a requirement.
- project: one published project; `project_title` names it.
- stack: the recognized technology codes of the card.
- roles: the specializations and grades that the card shows.
enum:
- project
- stack
- roles
MatchSimilarityBand:
type: string
description: >-
Coarse band of the cosine similarity between the requirement and the
matched item under the versioned policy thresholds. `high` and `medium`
are the only values; a weaker similarity produces no item. The band is
a computed similarity of two texts, not a judgement of the candidate.
enum:
- high
- medium
MatchSemanticEvidence:
type: object
description: >-
Why the entry is in the result: one confirmed requirement of the need
and the published card item with the highest semantic similarity to it.
The server computes it from stored vectors and the versioned
thresholds; no model writes text into it. `requirement_text` is the
confirmed text of the organization's own need. `project_title` is the
title the candidate published with the `projects` card field and is
null for other kinds. No repository address, owner, or fetched
repository text is ever part of it.
additionalProperties: false
required:
- requirement_kind
- requirement_text
- item_kind
- project_title
- repository_verified
- similarity
properties:
requirement_kind:
$ref: "#/schemas/MatchRequirementKind"
requirement_text:
type: string
minLength: 1
maxLength: 300
description: Confirmed skill name or task text of the need. Plain text; show it as text, never as HTML.
item_kind:
$ref: "#/schemas/MatchSemanticItemKind"
project_title:
description: Published project title for `project`, otherwise null. Plain text; show it as text, never as HTML.
oneOf:
- type: string
minLength: 1
maxLength: 100
- type: "null"
repository_verified:
type: boolean
description: >-
True only for a project whose linked repository the latest server
check found public on GitHub ("backed by a public repository"). It
does not prove authorship.
similarity:
$ref: "#/schemas/MatchSimilarityBand"
MatchSemanticEvidenceList:
type: array
description: >-
Semantic explanation items in a stable order: `high` before `medium`,
then by similarity, then by the order of the requirements in the need.
At most the versioned per-entry limit is returned. It is empty for a
bank search, while vectors are not ready, when ML is unavailable, and
when no requirement reaches a band; `unknown_flags` names
`ml_unavailable` when the semantic component itself is unknown.
maxItems: 12
items:
$ref: "#/schemas/MatchSemanticEvidence"
MatchPublicStack:
type: array
maxItems: 4
@@ -469,6 +554,7 @@ schemas:
- strength
- public_context
- evidence_summary
- semantic_evidence
- components
- unknown_flags
properties:
@@ -493,6 +579,8 @@ schemas:
$ref: "#/schemas/MatchPublicContext"
evidence_summary:
$ref: "#/schemas/MatchEvidenceSummary"
semantic_evidence:
$ref: "#/schemas/MatchSemanticEvidenceList"
components:
$ref: "#/schemas/MatchConfirmedComponents"
unknown_flags:
@@ -514,6 +602,7 @@ schemas:
- strength
- public_context
- evidence_summary
- semantic_evidence
- components
- unknown_flags
properties:
@@ -540,6 +629,8 @@ schemas:
$ref: "#/schemas/MatchPublicContext"
evidence_summary:
$ref: "#/schemas/MatchEvidenceSummary"
semantic_evidence:
$ref: "#/schemas/MatchSemanticEvidenceList"
components:
$ref: "#/schemas/MatchUnconfirmedComponents"
unknown_flags:
@@ -34,6 +34,7 @@ schemas:
- 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.
- projects: the projects of the profile with their title, description, stack tags, and whether a linked repository is a public GitHub repository. The titles and descriptions are text that the candidate writes and may identify them; the repository address and its owner never reach an organization through the card. Published projects are also the text that semantic ranking reads and that match explanations name.
- 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.
@@ -49,10 +50,11 @@ schemas:
- location
- relocation
- work_formats
- projects
CardFieldSet:
type: array
minItems: 0
maxItems: 9
maxItems: 10
uniqueItems: true
description: >-
Distinct card fields. The server stores them in ascending order of
@@ -383,6 +385,47 @@ schemas:
enum:
- compatible
- not_compatible
CardProject:
type: object
description: >-
One published project as the card shows it. It never carries the
repository address, the repository owner, or any text fetched from the
repository.
additionalProperties: false
required:
- title
- description
- stack
- repository_verified
properties:
title:
type: string
minLength: 1
maxLength: 100
description: >-
Project title as the candidate published it. Plain text; show it as
text, never as HTML.
description:
description: >-
Published project description, or null. Plain text; show it as text,
never as HTML.
oneOf:
- type: string
minLength: 1
maxLength: 500
- type: "null"
stack:
type: array
maxItems: 10
description: Published technology tags of the project.
items:
$ref: "./questionnaire_schemas.yml#/schemas/StackTag"
repository_verified:
type: boolean
description: >-
True when the latest server check found the linked repository on
GitHub and it is public. It does not prove that the candidate wrote
the code.
AnonymousCardContent:
type: object
description: >-
@@ -396,8 +439,11 @@ schemas:
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
card must never gain a property that identifies the candidate. The one
free-text exception is `projects`: the candidate writes it and
publishes it by a separate explicit choice, the card never adds the
repository address or owner to it, and the client warns that a project
title can identify its author. The search ranking and the full card of an organization's search result
are defined by the search contract, which reuses this
content.
additionalProperties: false
@@ -409,6 +455,7 @@ schemas:
- experience_band
- work_formats
- salary_compatibility
- projects
properties:
pseudonym:
type: string
@@ -465,6 +512,17 @@ schemas:
- $ref: "#/schemas/CandidateSalaryCompatibility"
- type: "null"
description: Nullable compatibility result with no salary values.
projects:
type:
- array
- "null"
maxItems: 10
description: >-
Published projects in the candidate's order, or null. Cohort
generalization never changes them: they are text the candidate
chose to publish, so publishing them can make the card unique.
items:
$ref: "#/schemas/CardProject"
CardPreview:
type: object
description: >-
@@ -89,6 +89,7 @@ schemas:
- rate_limited (429): too many requests; see Retry-After.
- internal (500): unexpected server error.
- not_implemented (501): the operation is in the contract but not implemented yet.
- service_unavailable (503): the service cannot serve the request now, for example while a model loads; retry later.
enum:
- validation_failed
- verification_token_invalid
@@ -110,6 +111,7 @@ schemas:
- rate_limited
- internal
- not_implemented
- service_unavailable
ProblemFieldError:
type: object
description: One reason why a request field or parameter is invalid.