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

@@ -68,11 +68,21 @@ SELECT
WHERE category.candidate_id = effective.user_id
),
'[]'::text
) AS confirmed_categories
) AS confirmed_categories,
COALESCE(
(
SELECT array_agg(repository.repository_key ORDER BY repository.repository_key)
FROM candidate_project_repositories AS repository
WHERE
repository.candidate_id = effective.user_id
AND repository.state = 'verified'
),
'{}'::text []
)::text [] AS verified_repositories
FROM candidate_effective_publications AS effective
LEFT JOIN candidate_profile_claims AS claim
ON claim.user_id = effective.user_id
AND claim.kind IN ('stack', 'role', 'experience')
AND claim.kind IN ('stack', 'role', 'experience', 'project')
LEFT JOIN candidate_questionnaires AS questionnaire
ON questionnaire.user_id = effective.user_id
WHERE NOT EXISTS (
@@ -98,15 +108,18 @@ type ListVisibleCandidateViewSourcesRow struct {
WorkFormats []string
ParallelPeriodAcknowledgements interface{}
ConfirmedCategories interface{}
VerifiedRepositories []string
}
// Organization-facing anonymous candidate projection inputs. The calling
// usecase has already authorized the active organization membership. This
// single statement snapshot filters both revoked/unpublished C2 states and
// candidates hidden from this organization before any profile value is read.
// The projection reads only stack, declared role, and experience dates. It
// deliberately excludes names, contacts, salary, location, soft skills,
// employer names, summaries, and imported excerpts. The only assessment data
// The projection reads only stack, declared role, experience dates, and
// projects with the keys of their verified repositories. It deliberately
// excludes names, contacts, salary, location, soft skills, employer names,
// summaries, and imported excerpts; the repository address of a project stays
// in the private input and never reaches the card. The only assessment data
// is the current category (specialization and grade) of the separate current
// category table; it carries no attempt, score, review, policy, or history.
func (q *Queries) ListVisibleCandidateViewSources(ctx context.Context, organizationID pgtype.UUID) ([]ListVisibleCandidateViewSourcesRow, error) {
@@ -132,6 +145,7 @@ func (q *Queries) ListVisibleCandidateViewSources(ctx context.Context, organizat
&i.WorkFormats,
&i.ParallelPeriodAcknowledgements,
&i.ConfirmedCategories,
&i.VerifiedRepositories,
); err != nil {
return nil, err
}
@@ -301,11 +315,21 @@ SELECT
WHERE category.candidate_id = effective.user_id
),
'[]'::text
) AS confirmed_categories
) AS confirmed_categories,
COALESCE(
(
SELECT array_agg(repository.repository_key ORDER BY repository.repository_key)
FROM candidate_project_repositories AS repository
WHERE
repository.candidate_id = effective.user_id
AND repository.state = 'verified'
),
'{}'::text []
)::text [] AS verified_repositories
FROM candidate_effective_publications AS effective
LEFT JOIN candidate_profile_claims AS claim
ON claim.user_id = effective.user_id
AND claim.kind IN ('stack', 'role', 'experience')
AND claim.kind IN ('stack', 'role', 'experience', 'project')
LEFT JOIN candidate_questionnaires AS questionnaire
ON questionnaire.user_id = effective.user_id
WHERE effective.user_id = $1
@@ -326,6 +350,7 @@ type ReadCandidateViewSourceForPreviewRow struct {
WorkFormats []string
ParallelPeriodAcknowledgements interface{}
ConfirmedCategories interface{}
VerifiedRepositories []string
}
// Read the candidate's current private projection inputs after the caller
@@ -354,6 +379,7 @@ func (q *Queries) ReadCandidateViewSourceForPreview(ctx context.Context, candida
&i.WorkFormats,
&i.ParallelPeriodAcknowledgements,
&i.ConfirmedCategories,
&i.VerifiedRepositories,
); err != nil {
return nil, err
}