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

@@ -1732,6 +1732,29 @@ func (UnimplementedHandler) RequestMyAccountDeletion(ctx context.Context) (r Req
return r, ht.ErrNotImplemented
}
// RequestMyRepositoryChecks implements RequestMyRepositoryChecks operation.
//
// 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. It schedules a new check of every repository that
// the current profile links, for example after the candidate made a repository public, and answers 202
// with the number of scheduled checks; the checks run in the background and `GetMyProfile` shows their
// state in `projects[].repository_check`. A profile without linked repositories answers 202 with 0.
//
// A check reads only public metadata from the public GitHub API (`api.github.com`): whether the
// repository exists and is public, its description, topics, languages, and the beginning of its README
// as plain text. The server never fetches any other host, never follows a redirect to another host,
// and never shows the fetched text; it uses it only for semantic ranking. A verified repository does
// not prove that the candidate wrote the code.
//
// The operation is limited per candidate: a second request inside the versioned window answers 429
// rate_limited with Retry-After and schedules nothing. A missing, unknown, expired, or revoked session
// answers 401 unauthenticated; an employer account answers 403 forbidden.
//
// POST /api/v1/me/profile/repository-checks
func (UnimplementedHandler) RequestMyRepositoryChecks(ctx context.Context) (r RequestMyRepositoryChecksRes, _ error) {
return r, ht.ErrNotImplemented
}
// ResendEmailVerification implements ResendEmailVerification operation.
//
// Public operation without a session. The answer is the same 202 for an unknown email, a verified
@@ -1921,13 +1944,23 @@ func (UnimplementedHandler) SaveMyQuestionnaire(ctx context.Context, req *Candid
// The card context is limited to safe public fields: recognized stack tags, coarse experience,
// accepted work formats, and coarse salary compatibility. It contains no contact, candidate location,
// salary amount or minimum, raw answer, arbitrary profile text, or reason for withheld FSP data.
// Evidence explanations use bounded codes, not free text. When ML is unavailable, semantic similarity
// uses the neutral 0.5 specified by FR09 and `unknown_flags` names `ml_unavailable`. For fewer than 30
// comparable real candidates, the search uses neutral T = 0.5, returns no percentile value, and names
// `cohort_below_30`. When the comparable real cohort of a category reaches the minimum, the percentile
// is still not computed (the organization-safe projection carries no theta), T stays the neutral 0.5,
// the percentile stays null, and `unknown_flags` names `percentile_not_computed`; the search does not
// fail.
// Evidence explanations use bounded codes, not free text.
//
// Semantic similarity `Sem` is the calibrated cosine between the stored vector of the need's confirmed
// requirements snapshot and the stored vector of the candidate's published card text (roles,
// recognized stack, and published projects with the public metadata of their verified repositories).
// The search never calls the ML service: vectors are computed in the background after a change, and an
// entry whose vectors are missing, stale for the current model, or not computed because ML is
// unavailable uses the neutral 0.5 and names `ml_unavailable` in `unknown_flags`. `semantic_evidence`
// lists, for a need search, the confirmed requirements whose closest published card item reaches a
// similarity band of the versioned policy; it names a project only by the title that the candidate
// published with the `projects` card field and says whether its repository is a verified public one,
// never the repository address or owner. Showing a project title records the `projects` field in the
// candidate's access history. For fewer than 30 comparable real candidates, the search uses neutral T
// = 0.5, returns no percentile value, and names `cohort_below_30`. When the comparable real cohort of
// a category reaches the minimum, the percentile is still not computed (the organization-safe
// projection carries no theta), T stays the neutral 0.5, the percentile stays null, and
// `unknown_flags` names `percentile_not_computed`; the search does not fail.
//
// A missing, unknown, expired, or revoked session answers 401 unauthenticated; a candidate account
// answers 403 forbidden; an unknown organization or account without active membership answers 404