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

+29 -7
View File
@@ -2,9 +2,11 @@
-- 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.
-- name: ListVisibleCandidateViewSources :many
@@ -64,11 +66,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 (
@@ -202,11 +214,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 = sqlc.arg(candidate_id)