feat: define anonymous match search contract

This commit is contained in:
TakuyaYagam1 committed 2026-10-08 08:19:27 +03:00
1 parent e4f24fa202
commit 6ad4402ff4
66 files changed
+13047 -36

No files matched your search

+1
View File
@@ -32,6 +32,7 @@ check: lint ## Build and lint both contract bundles
PYTHONDONTWRITEBYTECODE=1 "$(CODEGEN_PYTHON)" -m unittest discover -s "$(ROOT_DIR)/scripts" -p 'test_merge_schemas.py'
PYTHONDONTWRITEBYTECODE=1 "$(CODEGEN_PYTHON)" -m unittest discover -s "$(ROOT_DIR)/scripts" -p 'test_contract_copies.py'
PYTHONDONTWRITEBYTECODE=1 "$(CODEGEN_PYTHON)" -m unittest discover -s "$(ROOT_DIR)/scripts" -p 'test_assessment_contract.py'
PYTHONDONTWRITEBYTECODE=1 "$(CODEGEN_PYTHON)" -m unittest discover -s "$(ROOT_DIR)/scripts" -p 'test_match_contract.py'
.PHONY: check-compat
check-compat: bundle ## Compare the public contract with API_BASE_REF
+259
View File
@@ -0,0 +1,259 @@
SearchByNeed:
summary: Search against one confirmed requirements snapshot.
description: The reference is Need.requirements_version, not Need.version.
value:
need_id: 4d3a4a1b-4f60-44c1-9dc2-6c8e6c9d4c11
requirements_version: 3
filters:
specialization: backend
SearchByBank:
summary: Search the organization-visible bank with separate confirmed and declared filters.
value:
filters:
specialization: backend
confirmed_grade: middle
confirmed_category:
specialization: backend
grade: middle
confirmation_status: confirmed
declared_grade: junior
stack:
- go
- postgresql
conditions:
work_formats:
- remote
salary_compatibility: compatible
ThreeGroups:
summary: Synthetic example of main, near, and unconfirmed entries.
description: >-
Illustrative contract values only; these are not measurements from real
candidates. The same organization-scoped handle has independent Backend
and Networks states.
value:
source:
kind: bank
filters:
specialization: null
confirmed_grade: null
confirmed_category: null
confirmation_status: null
declared_grade: null
stack: null
conditions: null
groups:
main:
- candidate_handle: cv1_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
specialization: backend
confirmation_status: confirmed
declared_grade: middle
category:
specialization: backend
grade: middle
strength: standard
public_context:
stack:
- go
- postgresql
experience_band: "3_6"
work_formats:
- remote
salary_compatibility: compatible
evidence_summary:
- code: confirmed_category
state: supports
- code: required_skill_evidence
state: supports
- code: work_conditions_match
state: supports
components:
fit: 0.78
coverage: 0.72
domain: 0.75
semantics: 0.5
percentile: 0.61
competition: 0.0
freshness: 0.5
responsiveness: 0.5
rank_score: 0.65
unknown_flags: []
near:
- candidate_handle: cv1_BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
specialization: frontend
confirmation_status: confirmed
declared_grade: junior
category:
specialization: frontend
grade: junior
strength: standard
public_context:
stack:
- docker
experience_band: null
work_formats:
- hybrid
salary_compatibility: null
evidence_summary:
- code: confirmed_category
state: supports
- code: required_skill_evidence
state: gap
components:
fit: 0.48
coverage: 0.18
domain: 0.5
semantics: 0.5
percentile: 0.42
competition: 0.0
freshness: 0.5
responsiveness: 0.5
rank_score: 0.43
unknown_flags:
- component: experience_band
reason: not_in_public_card
- component: salary_compatibility
reason: not_in_public_card
unconfirmed:
- candidate_handle: cv1_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
specialization: network_engineer
confirmation_status: unconfirmed
declared_grade: junior
category: null
strength: null
public_context:
stack: null
experience_band: "1_3"
work_formats:
- remote
salary_compatibility: compatible
evidence_summary:
- code: declared_grade
state: declared_only
- code: required_skill_evidence
state: partial
components:
fit: 0.51
coverage: 0.38
unknown_flags:
- component: assessment
reason: no_confirmation_for_specialization
Empty:
summary: A valid search with no eligible visible candidates.
value:
source:
kind: bank
filters:
specialization: null
confirmed_grade: null
confirmed_category: null
confirmation_status: null
declared_grade: null
stack: null
conditions: null
groups:
main: []
near: []
unconfirmed: []
MLUnavailable:
summary: Semantic similarity uses the documented neutral value while ML is unavailable.
description: Synthetic example; 0.5 is the FR09 neutral value, not an inference.
value:
source:
kind: bank
filters:
specialization: backend
confirmed_grade: null
confirmed_category: null
confirmation_status: null
declared_grade: null
stack: null
conditions: null
groups:
main:
- candidate_handle: cv1_CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
specialization: backend
confirmation_status: confirmed
declared_grade: null
category:
specialization: backend
grade: middle
strength: strong
public_context:
stack:
- go
experience_band: 3_plus
work_formats:
- remote
salary_compatibility: compatible
evidence_summary:
- code: confirmed_category
state: supports
components:
fit: 0.7
coverage: 0.6
domain: 0.5
semantics: 0.5
percentile: 0.6
competition: 0.0
freshness: 0.5
responsiveness: 0.5
rank_score: 0.61
unknown_flags:
- component: semantics
reason: ml_unavailable
near: []
unconfirmed: []
CohortBelow30:
summary: A small comparison cohort has no published percentile.
description: Synthetic example; the exact cohort size is not disclosed.
value:
source:
kind: bank
filters:
specialization: backend
confirmed_grade: null
confirmed_category: null
confirmation_status: null
declared_grade: null
stack: null
conditions: null
groups:
main:
- candidate_handle: cv1_DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
specialization: backend
confirmation_status: confirmed
declared_grade: middle
category:
specialization: backend
grade: middle
strength: standard
public_context:
stack:
- postgresql
experience_band: "3_6"
work_formats:
- office
salary_compatibility: null
evidence_summary:
- code: confirmed_category
state: supports
components:
fit: 0.62
coverage: 0.55
domain: 0.5
semantics: 0.7
percentile: null
competition: 0.0
freshness: 0.5
responsiveness: 0.5
rank_score: 0.56
unknown_flags:
- component: percentile
reason: cohort_below_30
near: []
unconfirmed: []
+515
View File
@@ -4254,6 +4254,521 @@ InvitationDeclineRequest:
oneOf:
- $ref: '#/InvitationDeclineComment'
- type: 'null'
MatchConfirmationStatus:
type: string
description: Confirmation state for this specialization only. A result for one specialization never changes the state of another specialization.
enum:
- confirmed
- unconfirmed
MatchGradeFilter:
type: object
description: A confirmed category filter, never a candidate declaration.
additionalProperties: false
required:
- specialization
- grade
properties:
specialization:
$ref: '#/SpecializationCode'
grade:
$ref: '#/GradeCode'
MatchSearchStackTag:
type: string
description: A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.
enum:
- go
- postgresql
- kafka
- docker
MatchSearchConditions:
type: object
description: Filters against safe, coarse card conditions. No candidate location, salary amount, salary minimum, or salary range is accepted.
additionalProperties: false
properties:
work_formats:
type: array
minItems: 1
maxItems: 3
uniqueItems: true
items:
$ref: '#/WorkFormat'
salary_compatibility:
$ref: '#/CandidateSalaryCompatibility'
MatchSearchFilters:
type: object
description: Optional filters over the current organization-visible bank. An empty object means no additional filter. Confirmed and declared grades are separate fields; a declaration never satisfies a confirmed-grade or category filter. Conditions use only the safe, coarse card fields.
additionalProperties: false
properties:
specialization:
$ref: '#/SpecializationCode'
confirmed_grade:
description: Match only candidates with this currently confirmed grade in the selected specialization. It never matches a declared grade.
$ref: '#/GradeCode'
confirmed_category:
$ref: '#/MatchGradeFilter'
confirmation_status:
$ref: '#/MatchConfirmationStatus'
declared_grade:
description: Candidate-declared grade filter. This is a separate claim and cannot satisfy `confirmed_grade` or `confirmed_category`.
$ref: '#/GradeCode'
stack:
type: array
minItems: 1
maxItems: 4
uniqueItems: true
items:
$ref: '#/MatchSearchStackTag'
conditions:
$ref: '#/MatchSearchConditions'
MatchSearchByNeed:
type: object
description: Search one immutable set of confirmed requirements. `requirements_version` is the Need.requirements_version, not the general Need.version; text-only or suggestion-only edits do not change this search basis.
additionalProperties: false
required:
- need_id
- requirements_version
properties:
need_id:
type: string
format: uuid
description: Need owned by the organization in the path.
requirements_version:
$ref: '#/NeedVersion'
filters:
$ref: '#/MatchSearchFilters'
MatchSearchByBank:
type: object
description: Search the current organization-visible bank. An empty `filters` object includes all otherwise eligible specializations as separate entries.
additionalProperties: false
required:
- filters
properties:
filters:
$ref: '#/MatchSearchFilters'
MatchSearchRequest:
oneOf:
- $ref: '#/MatchSearchByNeed'
- $ref: '#/MatchSearchByBank'
description: Search either a Need.requirements_version snapshot or the whole organization-visible bank with explicit filters. Unknown fields are rejected by both closed request variants.
MatchSearchNeedSource:
type: object
description: The immutable need requirements snapshot used by this result.
additionalProperties: false
required:
- kind
- need_id
- requirements_version
properties:
kind:
type: string
enum:
- need
need_id:
type: string
format: uuid
requirements_version:
$ref: '#/NeedVersion'
MatchAppliedConditions:
type: object
description: Conditions echoed as a complete snapshot; null means no filter.
additionalProperties: false
required:
- work_formats
- salary_compatibility
properties:
work_formats:
oneOf:
- type: array
minItems: 1
maxItems: 3
uniqueItems: true
items:
$ref: '#/WorkFormat'
- type: 'null'
salary_compatibility:
oneOf:
- $ref: '#/CandidateSalaryCompatibility'
- type: 'null'
MatchAppliedFilters:
type: object
description: A normalized response snapshot of the bank filters. Each key is present; null means the corresponding request filter was omitted. This keeps a search result tied to its exact filter basis.
additionalProperties: false
required:
- specialization
- confirmed_grade
- confirmed_category
- confirmation_status
- declared_grade
- stack
- conditions
properties:
specialization:
oneOf:
- $ref: '#/SpecializationCode'
- type: 'null'
confirmed_grade:
oneOf:
- $ref: '#/GradeCode'
- type: 'null'
confirmed_category:
oneOf:
- $ref: '#/MatchGradeFilter'
- type: 'null'
confirmation_status:
oneOf:
- $ref: '#/MatchConfirmationStatus'
- type: 'null'
declared_grade:
oneOf:
- $ref: '#/GradeCode'
- type: 'null'
stack:
oneOf:
- type: array
minItems: 1
maxItems: 4
uniqueItems: true
items:
$ref: '#/MatchSearchStackTag'
- type: 'null'
conditions:
oneOf:
- $ref: '#/MatchAppliedConditions'
- type: 'null'
MatchSearchBankSource:
type: object
description: The normalized filters used for a bank search.
additionalProperties: false
required:
- kind
- filters
properties:
kind:
type: string
enum:
- bank
filters:
$ref: '#/MatchAppliedFilters'
MatchSearchSource:
oneOf:
- $ref: '#/MatchSearchNeedSource'
- $ref: '#/MatchSearchBankSource'
description: Search basis echoed with the response so the displayed result remains tied to its need requirements version or bank filters.
MatchStrength:
type: string
description: Coarse strength of a confirmed assessment for this specialization.
enum:
- standard
- strong
MatchCategory:
type: object
description: A confirmed category. Its specialization must equal the enclosing match entry's specialization.
additionalProperties: false
required:
- specialization
- grade
properties:
specialization:
$ref: '#/SpecializationCode'
grade:
$ref: '#/GradeCode'
MatchScore:
type: number
format: double
minimum: 0
maximum: 1
description: A normalized FR09 ranking component from 0 to 1.
MatchNullableScore:
description: A score from a versioned ranking component, or null when it is not available. Any null component has a matching bounded entry in `unknown_flags`.
oneOf:
- type: number
format: double
minimum: 0
maximum: 1
- type: 'null'
MatchUnknownComponent:
type: string
description: Ranking or public-card component whose value is unknown.
enum:
- semantics
- percentile
- assessment
- freshness
- responsiveness
- experience_band
- work_formats
- salary_compatibility
- domain
MatchUnknownReason:
type: string
description: Bounded explanation for an unknown component, not a hiding reason.
enum:
- ml_unavailable
- cohort_below_30
- no_confirmation_for_specialization
- not_in_public_card
- need_field_unconfirmed
- no_freshness_history
- no_response_history
MatchUnknownFlag:
type: object
description: A safe, bounded explanation for one unavailable component.
additionalProperties: false
required:
- component
- reason
properties:
component:
$ref: '#/MatchUnknownComponent'
reason:
$ref: '#/MatchUnknownReason'
MatchUnknownFlags:
type: array
maxItems: 9
items:
$ref: '#/MatchUnknownFlag'
MatchEvidenceCode:
type: string
description: Template code for an explanation derived from allowed evidence. It carries no free text, raw answer, or reason for withheld FSP data.
enum:
- confirmed_category
- required_skill_evidence
- desired_skill_evidence
- domain_alignment
- task_alignment
- work_conditions_match
- salary_compatibility
- declared_grade
MatchEvidenceState:
type: string
enum:
- supports
- partial
- gap
- declared_only
MatchEvidenceSummaryItem:
type: object
description: A templated, non-text evidence explanation.
additionalProperties: false
required:
- code
- state
properties:
code:
$ref: '#/MatchEvidenceCode'
state:
$ref: '#/MatchEvidenceState'
MatchEvidenceSummary:
type: array
maxItems: 12
items:
$ref: '#/MatchEvidenceSummaryItem'
MatchPublicStack:
type: array
maxItems: 4
uniqueItems: true
items:
$ref: '#/MatchSearchStackTag'
MatchPublicContext:
type: object
description: Safe anonymous-card context only. A null value means that the value is not in the public card or is not present; the response does not reveal which. It contains no contact, candidate location, or salary amount.
additionalProperties: false
required:
- stack
- experience_band
- work_formats
- salary_compatibility
properties:
stack:
oneOf:
- $ref: '#/MatchPublicStack'
- type: 'null'
experience_band:
oneOf:
- $ref: '#/CandidateExperienceBand'
- type: 'null'
work_formats:
oneOf:
- type: array
maxItems: 3
uniqueItems: true
items:
$ref: '#/WorkFormat'
- type: 'null'
salary_compatibility:
oneOf:
- $ref: '#/CandidateSalaryCompatibility'
- type: 'null'
MatchConfirmedComponents:
type: object
description: Components from the FR09 ranking model for a confirmed category. `percentile` is null when fewer than 30 comparable real candidates are available; the ranking uses neutral T = 0.5 and does not publish a percentile. If ML is unavailable, `semantics` uses neutral 0.5 and the reason appears in `unknown_flags`.
additionalProperties: false
required:
- fit
- coverage
- domain
- semantics
- percentile
- competition
- freshness
- responsiveness
- rank_score
properties:
fit:
$ref: '#/MatchScore'
coverage:
$ref: '#/MatchScore'
domain:
$ref: '#/MatchScore'
semantics:
$ref: '#/MatchScore'
percentile:
$ref: '#/MatchNullableScore'
competition:
$ref: '#/MatchScore'
freshness:
$ref: '#/MatchScore'
responsiveness:
$ref: '#/MatchScore'
rank_score:
$ref: '#/MatchScore'
MatchUnconfirmedComponents:
type: object
description: Unconfirmed entries are ordered only by Fit and coverage. This strict component object has no theta, T, P, test percentile, or confirmed assessment score.
additionalProperties: false
required:
- fit
- coverage
properties:
fit:
type: number
format: double
minimum: 0
maximum: 1
description: Job fit for this specialization, never an assessment score.
coverage:
type: number
format: double
minimum: 0
maximum: 1
description: Coverage of confirmed need skills by allowed public evidence.
MatchConfirmedCandidate:
type: object
description: One confirmed specialization entry in the `main` or `near` group. The group containing it supplies the group label. A candidate may have a separate entry for another specialization.
additionalProperties: false
required:
- candidate_handle
- specialization
- confirmation_status
- declared_grade
- category
- strength
- public_context
- evidence_summary
- components
- unknown_flags
properties:
candidate_handle:
$ref: '#/CandidateHandle'
specialization:
$ref: '#/SpecializationCode'
confirmation_status:
type: string
enum:
- confirmed
declared_grade:
oneOf:
- $ref: '#/GradeCode'
- type: 'null'
description: Candidate-declared grade for this specialization, never a confirmation.
category:
$ref: '#/MatchCategory'
strength:
$ref: '#/MatchStrength'
public_context:
$ref: '#/MatchPublicContext'
evidence_summary:
$ref: '#/MatchEvidenceSummary'
components:
$ref: '#/MatchConfirmedComponents'
unknown_flags:
$ref: '#/MatchUnknownFlags'
MatchUnconfirmedCandidate:
type: object
description: One specialization with no confirmed category. `category` and `strength` remain present and null. A confirmation in another specialization never changes this entry. The schema intentionally has no assessment measurement fields.
additionalProperties: false
required:
- candidate_handle
- specialization
- confirmation_status
- declared_grade
- category
- strength
- public_context
- evidence_summary
- components
- unknown_flags
properties:
candidate_handle:
$ref: '#/CandidateHandle'
specialization:
$ref: '#/SpecializationCode'
confirmation_status:
type: string
enum:
- unconfirmed
declared_grade:
oneOf:
- $ref: '#/GradeCode'
- type: 'null'
description: Candidate-declared grade, separate from assessment confirmation.
category:
type: 'null'
description: There is no confirmed category for this specialization.
strength:
type: 'null'
description: Assessment strength is not measured for this specialization.
public_context:
$ref: '#/MatchPublicContext'
evidence_summary:
$ref: '#/MatchEvidenceSummary'
components:
$ref: '#/MatchUnconfirmedComponents'
unknown_flags:
$ref: '#/MatchUnknownFlags'
MatchSearchGroups:
type: object
description: Separate ranking groups. Confirmed categories appear in main and near; unconfirmed specializations appear only in the lower unconfirmed group.
additionalProperties: false
required:
- main
- near
- unconfirmed
properties:
main:
type: array
items:
$ref: '#/MatchConfirmedCandidate'
near:
type: array
items:
$ref: '#/MatchConfirmedCandidate'
unconfirmed:
type: array
items:
$ref: '#/MatchUnconfirmedCandidate'
MatchSearchResponse:
type: object
description: Anonymous search result grouped by specialization state. Repeated organization-scoped handles are allowed when the same candidate has different specialization entries; entries never transfer confirmation between specializations.
additionalProperties: false
required:
- source
- groups
properties:
source:
$ref: '#/MatchSearchSource'
groups:
$ref: '#/MatchSearchGroups'
NeedVersion:
type: integer
format: int64
@@ -36,7 +36,7 @@ schemas:
type: string
minLength: 47
maxLength: 47
pattern: '^cv1_[A-Za-z0-9_-]{43}$'
pattern: "^cv1_[A-Za-z0-9_-]{43}$"
description: >-
Opaque reference to a candidate as one organization sees it, taken
from the organization-scoped anonymous card. It is a versioned HMAC
@@ -0,0 +1,574 @@
schemas:
MatchConfirmationStatus:
type: string
description: >-
Confirmation state for this specialization only. A result for one
specialization never changes the state of another specialization.
enum:
- confirmed
- unconfirmed
MatchGradeFilter:
type: object
description: A confirmed category filter, never a candidate declaration.
additionalProperties: false
required:
- specialization
- grade
properties:
specialization:
$ref: "./catalog_schemas.yml#/schemas/SpecializationCode"
grade:
$ref: "./catalog_schemas.yml#/schemas/GradeCode"
MatchSearchStackTag:
type: string
description: >-
A stack code that the anonymous card may expose. Search filters do not
accept arbitrary profile text or candidate-provided evidence.
enum:
- go
- postgresql
- kafka
- docker
MatchSearchConditions:
type: object
description: >-
Filters against safe, coarse card conditions. No candidate location,
salary amount, salary minimum, or salary range is accepted.
additionalProperties: false
properties:
work_formats:
type: array
minItems: 1
maxItems: 3
uniqueItems: true
items:
$ref: "./questionnaire_schemas.yml#/schemas/WorkFormat"
salary_compatibility:
$ref: "./privacy_schemas.yml#/schemas/CandidateSalaryCompatibility"
MatchSearchFilters:
type: object
description: >-
Optional filters over the current organization-visible bank. An empty
object means no additional filter. Confirmed and declared grades are
separate fields; a declaration never satisfies a confirmed-grade or
category filter. Conditions use only the safe, coarse card fields.
additionalProperties: false
properties:
specialization:
$ref: "./catalog_schemas.yml#/schemas/SpecializationCode"
confirmed_grade:
description: >-
Match only candidates with this currently confirmed grade in the
selected specialization. It never matches a declared grade.
$ref: "./catalog_schemas.yml#/schemas/GradeCode"
confirmed_category:
$ref: "#/schemas/MatchGradeFilter"
confirmation_status:
$ref: "#/schemas/MatchConfirmationStatus"
declared_grade:
description: >-
Candidate-declared grade filter. This is a separate claim and
cannot satisfy `confirmed_grade` or `confirmed_category`.
$ref: "./catalog_schemas.yml#/schemas/GradeCode"
stack:
type: array
minItems: 1
maxItems: 4
uniqueItems: true
items:
$ref: "#/schemas/MatchSearchStackTag"
conditions:
$ref: "#/schemas/MatchSearchConditions"
MatchSearchByNeed:
type: object
description: >-
Search one immutable set of confirmed requirements. `requirements_version`
is the Need.requirements_version, not the general Need.version; text-only
or suggestion-only edits do not change this search basis.
additionalProperties: false
required:
- need_id
- requirements_version
properties:
need_id:
type: string
format: uuid
description: Need owned by the organization in the path.
requirements_version:
$ref: "./need_schemas.yml#/schemas/NeedVersion"
filters:
$ref: "#/schemas/MatchSearchFilters"
MatchSearchByBank:
type: object
description: >-
Search the current organization-visible bank. An empty `filters` object
includes all otherwise eligible specializations as separate entries.
additionalProperties: false
required:
- filters
properties:
filters:
$ref: "#/schemas/MatchSearchFilters"
MatchSearchRequest:
oneOf:
- $ref: "#/schemas/MatchSearchByNeed"
- $ref: "#/schemas/MatchSearchByBank"
description: >-
Search either a Need.requirements_version snapshot or the whole
organization-visible bank with explicit filters. Unknown fields are
rejected by both closed request variants.
MatchSearchNeedSource:
type: object
description: The immutable need requirements snapshot used by this result.
additionalProperties: false
required:
- kind
- need_id
- requirements_version
properties:
kind:
type: string
enum:
- need
need_id:
type: string
format: uuid
requirements_version:
$ref: "./need_schemas.yml#/schemas/NeedVersion"
MatchAppliedConditions:
type: object
description: Conditions echoed as a complete snapshot; null means no filter.
additionalProperties: false
required:
- work_formats
- salary_compatibility
properties:
work_formats:
oneOf:
- type: array
minItems: 1
maxItems: 3
uniqueItems: true
items:
$ref: "./questionnaire_schemas.yml#/schemas/WorkFormat"
- type: "null"
salary_compatibility:
oneOf:
- $ref: "./privacy_schemas.yml#/schemas/CandidateSalaryCompatibility"
- type: "null"
MatchAppliedFilters:
type: object
description: >-
A normalized response snapshot of the bank filters. Each key is present;
null means the corresponding request filter was omitted. This keeps a
search result tied to its exact filter basis.
additionalProperties: false
required:
- specialization
- confirmed_grade
- confirmed_category
- confirmation_status
- declared_grade
- stack
- conditions
properties:
specialization:
oneOf:
- $ref: "./catalog_schemas.yml#/schemas/SpecializationCode"
- type: "null"
confirmed_grade:
oneOf:
- $ref: "./catalog_schemas.yml#/schemas/GradeCode"
- type: "null"
confirmed_category:
oneOf:
- $ref: "#/schemas/MatchGradeFilter"
- type: "null"
confirmation_status:
oneOf:
- $ref: "#/schemas/MatchConfirmationStatus"
- type: "null"
declared_grade:
oneOf:
- $ref: "./catalog_schemas.yml#/schemas/GradeCode"
- type: "null"
stack:
oneOf:
- type: array
minItems: 1
maxItems: 4
uniqueItems: true
items:
$ref: "#/schemas/MatchSearchStackTag"
- type: "null"
conditions:
oneOf:
- $ref: "#/schemas/MatchAppliedConditions"
- type: "null"
MatchSearchBankSource:
type: object
description: The normalized filters used for a bank search.
additionalProperties: false
required:
- kind
- filters
properties:
kind:
type: string
enum:
- bank
filters:
$ref: "#/schemas/MatchAppliedFilters"
MatchSearchSource:
oneOf:
- $ref: "#/schemas/MatchSearchNeedSource"
- $ref: "#/schemas/MatchSearchBankSource"
description: >-
Search basis echoed with the response so the displayed result remains
tied to its need requirements version or bank filters.
MatchStrength:
type: string
description: Coarse strength of a confirmed assessment for this specialization.
enum:
- standard
- strong
MatchCategory:
type: object
description: >-
A confirmed category. Its specialization must equal the enclosing
match entry's specialization.
additionalProperties: false
required:
- specialization
- grade
properties:
specialization:
$ref: "./catalog_schemas.yml#/schemas/SpecializationCode"
grade:
$ref: "./catalog_schemas.yml#/schemas/GradeCode"
MatchScore:
type: number
format: double
minimum: 0
maximum: 1
description: A normalized FR09 ranking component from 0 to 1.
MatchNullableScore:
description: >-
A score from a versioned ranking component, or null when it is not
available. Any null component has a matching bounded entry in
`unknown_flags`.
oneOf:
- type: number
format: double
minimum: 0
maximum: 1
- type: "null"
MatchUnknownComponent:
type: string
description: Ranking or public-card component whose value is unknown.
enum:
- semantics
- percentile
- assessment
- freshness
- responsiveness
- experience_band
- work_formats
- salary_compatibility
- domain
MatchUnknownReason:
type: string
description: Bounded explanation for an unknown component, not a hiding reason.
enum:
- ml_unavailable
- cohort_below_30
- no_confirmation_for_specialization
- not_in_public_card
- need_field_unconfirmed
- no_freshness_history
- no_response_history
MatchUnknownFlag:
type: object
description: A safe, bounded explanation for one unavailable component.
additionalProperties: false
required:
- component
- reason
properties:
component:
$ref: "#/schemas/MatchUnknownComponent"
reason:
$ref: "#/schemas/MatchUnknownReason"
MatchUnknownFlags:
type: array
maxItems: 9
items:
$ref: "#/schemas/MatchUnknownFlag"
MatchEvidenceCode:
type: string
description: >-
Template code for an explanation derived from allowed evidence. It
carries no free text, raw answer, or reason for withheld FSP data.
enum:
- confirmed_category
- required_skill_evidence
- desired_skill_evidence
- domain_alignment
- task_alignment
- work_conditions_match
- salary_compatibility
- declared_grade
MatchEvidenceState:
type: string
enum:
- supports
- partial
- gap
- declared_only
MatchEvidenceSummaryItem:
type: object
description: A templated, non-text evidence explanation.
additionalProperties: false
required:
- code
- state
properties:
code:
$ref: "#/schemas/MatchEvidenceCode"
state:
$ref: "#/schemas/MatchEvidenceState"
MatchEvidenceSummary:
type: array
maxItems: 12
items:
$ref: "#/schemas/MatchEvidenceSummaryItem"
MatchPublicStack:
type: array
maxItems: 4
uniqueItems: true
items:
$ref: "#/schemas/MatchSearchStackTag"
MatchPublicContext:
type: object
description: >-
Safe anonymous-card context only. A null value means that the value is
not in the public card or is not present; the response does not reveal
which. It contains no contact, candidate location, or salary amount.
additionalProperties: false
required:
- stack
- experience_band
- work_formats
- salary_compatibility
properties:
stack:
oneOf:
- $ref: "#/schemas/MatchPublicStack"
- type: "null"
experience_band:
oneOf:
- $ref: "./privacy_schemas.yml#/schemas/CandidateExperienceBand"
- type: "null"
work_formats:
oneOf:
- type: array
maxItems: 3
uniqueItems: true
items:
$ref: "./questionnaire_schemas.yml#/schemas/WorkFormat"
- type: "null"
salary_compatibility:
oneOf:
- $ref: "./privacy_schemas.yml#/schemas/CandidateSalaryCompatibility"
- type: "null"
MatchConfirmedComponents:
type: object
description: >-
Components from the FR09 ranking model for a confirmed category.
`percentile` is null when fewer than 30 comparable real candidates are
available; the ranking uses neutral T = 0.5 and does not publish a
percentile. If ML is unavailable, `semantics` uses neutral 0.5 and the
reason appears in `unknown_flags`.
additionalProperties: false
required:
- fit
- coverage
- domain
- semantics
- percentile
- competition
- freshness
- responsiveness
- rank_score
properties:
fit:
$ref: "#/schemas/MatchScore"
coverage:
$ref: "#/schemas/MatchScore"
domain:
$ref: "#/schemas/MatchScore"
semantics:
$ref: "#/schemas/MatchScore"
percentile:
$ref: "#/schemas/MatchNullableScore"
competition:
$ref: "#/schemas/MatchScore"
freshness:
$ref: "#/schemas/MatchScore"
responsiveness:
$ref: "#/schemas/MatchScore"
rank_score:
$ref: "#/schemas/MatchScore"
MatchUnconfirmedComponents:
type: object
description: >-
Unconfirmed entries are ordered only by Fit and coverage. This strict
component object has no theta, T, P, test percentile, or confirmed
assessment score.
additionalProperties: false
required:
- fit
- coverage
properties:
fit:
type: number
format: double
minimum: 0
maximum: 1
description: Job fit for this specialization, never an assessment score.
coverage:
type: number
format: double
minimum: 0
maximum: 1
description: Coverage of confirmed need skills by allowed public evidence.
MatchConfirmedCandidate:
type: object
description: >-
One confirmed specialization entry in the `main` or `near` group. The
group containing it supplies the group label. A candidate may have a
separate entry for another specialization.
additionalProperties: false
required:
- candidate_handle
- specialization
- confirmation_status
- declared_grade
- category
- strength
- public_context
- evidence_summary
- components
- unknown_flags
properties:
candidate_handle:
$ref: "./common_schemas.yml#/schemas/CandidateHandle"
specialization:
$ref: "./catalog_schemas.yml#/schemas/SpecializationCode"
confirmation_status:
type: string
enum:
- confirmed
declared_grade:
oneOf:
- $ref: "./catalog_schemas.yml#/schemas/GradeCode"
- type: "null"
description: Candidate-declared grade for this specialization, never a confirmation.
category:
$ref: "#/schemas/MatchCategory"
strength:
$ref: "#/schemas/MatchStrength"
public_context:
$ref: "#/schemas/MatchPublicContext"
evidence_summary:
$ref: "#/schemas/MatchEvidenceSummary"
components:
$ref: "#/schemas/MatchConfirmedComponents"
unknown_flags:
$ref: "#/schemas/MatchUnknownFlags"
MatchUnconfirmedCandidate:
type: object
description: >-
One specialization with no confirmed category. `category` and
`strength` remain present and null. A confirmation in another
specialization never changes this entry. The schema intentionally has
no assessment measurement fields.
additionalProperties: false
required:
- candidate_handle
- specialization
- confirmation_status
- declared_grade
- category
- strength
- public_context
- evidence_summary
- components
- unknown_flags
properties:
candidate_handle:
$ref: "./common_schemas.yml#/schemas/CandidateHandle"
specialization:
$ref: "./catalog_schemas.yml#/schemas/SpecializationCode"
confirmation_status:
type: string
enum:
- unconfirmed
declared_grade:
oneOf:
- $ref: "./catalog_schemas.yml#/schemas/GradeCode"
- type: "null"
description: Candidate-declared grade, separate from assessment confirmation.
category:
type: "null"
description: There is no confirmed category for this specialization.
strength:
type: "null"
description: Assessment strength is not measured for this specialization.
public_context:
$ref: "#/schemas/MatchPublicContext"
evidence_summary:
$ref: "#/schemas/MatchEvidenceSummary"
components:
$ref: "#/schemas/MatchUnconfirmedComponents"
unknown_flags:
$ref: "#/schemas/MatchUnknownFlags"
MatchSearchGroups:
type: object
description: >-
Separate ranking groups. Confirmed categories appear in main and near;
unconfirmed specializations appear only in the lower unconfirmed group.
additionalProperties: false
required:
- main
- near
- unconfirmed
properties:
main:
type: array
items:
$ref: "#/schemas/MatchConfirmedCandidate"
near:
type: array
items:
$ref: "#/schemas/MatchConfirmedCandidate"
unconfirmed:
type: array
items:
$ref: "#/schemas/MatchUnconfirmedCandidate"
MatchSearchResponse:
type: object
description: >-
Anonymous search result grouped by specialization state. Repeated
organization-scoped handles are allowed when the same candidate has
different specialization entries; entries never transfer confirmation
between specializations.
additionalProperties: false
required:
- source
- groups
properties:
source:
$ref: "#/schemas/MatchSearchSource"
groups:
$ref: "#/schemas/MatchSearchGroups"
@@ -408,7 +408,7 @@ schemas:
type: string
minLength: 47
maxLength: 47
pattern: '^cv1_[A-Za-z0-9_-]{43}$'
pattern: "^cv1_[A-Za-z0-9_-]{43}$"
description: >-
Stable opaque alias scoped to the reading organization. It is not an
account or profile identifier and changes across organizations.
+843 -16
View File
@@ -1522,6 +1522,67 @@ paths:
$ref: '#/components/responses/TooManyRequests'
default:
$ref: '#/components/responses/Problem'
/api/v1/organizations/{org_id}/matches:
post:
operationId: SearchOrganizationMatches
summary: Search the current organization-visible candidate bank.
description: |-
Requires the session cookie of an employer account with an active owner membership in `org_id`, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The organization comes from the path and the active server-side membership. Hidden profiles, revoked or missing C2 publication, and the organization's visibility restrictions are applied before any result is returned.
The body selects either a Need's `requirements_version` snapshot or the current organization-visible bank with explicit filters. A need reference uses `Need.requirements_version`, not the general `Need.version`; title or suggestion-only edits do not change the confirmed-requirements snapshot. An empty bank filter searches all otherwise eligible specializations, returning each specialization separately.
Every entry is one candidate specialization. A confirmed result in Backend never confirms Networks for the same candidate. The `main`, `near`, and `unconfirmed` arrays are separate groups. A confirmed category with required-skill coverage below 0.25 belongs to `near`; other confirmed entries belong to `main` (FR09). Entries in `unconfirmed` are ordered by Fit, then coverage, then a stable internal tie-breaker that is never returned. Their category and strength remain null, and they have no theta, T, P, or test percentile. The search result uses the organization-scoped opaque `candidate_handle` as its display pseudonym and invitation reference, never a candidate account or profile identifier.
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`.
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 not_found. The response is `Cache-Control: no-store`.
security:
- sessionCookie: []
sessionCsrf: []
tags:
- organization
parameters:
- $ref: '#/components/parameters/OrganizationId'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MatchSearchRequest'
examples:
by_need:
$ref: '#/components/examples/SearchByNeed'
by_bank_filters:
$ref: '#/components/examples/SearchByBank'
responses:
'200':
description: Organization-visible candidates in separate match groups.
headers:
Cache-Control:
$ref: '#/components/headers/CacheControlNoStore'
content:
application/json:
schema:
$ref: '#/components/schemas/MatchSearchResponse'
examples:
three_groups:
$ref: '#/components/examples/ThreeGroups'
empty:
$ref: '#/components/examples/Empty'
ml_unavailable:
$ref: '#/components/examples/MLUnavailable'
cohort_below_30:
$ref: '#/components/examples/CohortBelow30'
'400':
$ref: '#/components/responses/ValidationFailed'
'401':
$ref: '#/components/responses/Unauthenticated'
'403':
$ref: '#/components/responses/CsrfCheckFailedOrForbidden'
'404':
$ref: '#/components/responses/NotFound'
default:
$ref: '#/components/responses/Problem'
/api/v1/organizations/{org_id}/candidate-cards/{candidate_handle}:
get:
operationId: GetOrganizationCandidateCard
@@ -9744,6 +9805,537 @@ components:
description: Short educational feedback about this training run.
decided_at:
$ref: '#/components/schemas/Timestamp'
MatchGradeFilter:
type: object
description: A confirmed category filter, never a candidate declaration.
additionalProperties: false
required:
- specialization
- grade
properties:
specialization:
$ref: '#/components/schemas/SpecializationCode'
grade:
$ref: '#/components/schemas/GradeCode'
MatchConfirmationStatus:
type: string
description: Confirmation state for this specialization only. A result for one specialization never changes the state of another specialization.
enum:
- confirmed
- unconfirmed
MatchSearchStackTag:
type: string
description: A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.
enum:
- go
- postgresql
- kafka
- docker
CandidateSalaryCompatibility:
type: string
description: A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.
enum:
- compatible
- not_compatible
MatchSearchConditions:
type: object
description: Filters against safe, coarse card conditions. No candidate location, salary amount, salary minimum, or salary range is accepted.
additionalProperties: false
properties:
work_formats:
type: array
minItems: 1
maxItems: 3
uniqueItems: true
items:
$ref: '#/components/schemas/WorkFormat'
salary_compatibility:
$ref: '#/components/schemas/CandidateSalaryCompatibility'
MatchSearchFilters:
type: object
description: Optional filters over the current organization-visible bank. An empty object means no additional filter. Confirmed and declared grades are separate fields; a declaration never satisfies a confirmed-grade or category filter. Conditions use only the safe, coarse card fields.
additionalProperties: false
properties:
specialization:
$ref: '#/components/schemas/SpecializationCode'
confirmed_grade:
description: Match only candidates with this currently confirmed grade in the selected specialization. It never matches a declared grade.
$ref: '#/components/schemas/GradeCode'
confirmed_category:
$ref: '#/components/schemas/MatchGradeFilter'
confirmation_status:
$ref: '#/components/schemas/MatchConfirmationStatus'
declared_grade:
description: Candidate-declared grade filter. This is a separate claim and cannot satisfy `confirmed_grade` or `confirmed_category`.
$ref: '#/components/schemas/GradeCode'
stack:
type: array
minItems: 1
maxItems: 4
uniqueItems: true
items:
$ref: '#/components/schemas/MatchSearchStackTag'
conditions:
$ref: '#/components/schemas/MatchSearchConditions'
MatchSearchByNeed:
type: object
description: Search one immutable set of confirmed requirements. `requirements_version` is the Need.requirements_version, not the general Need.version; text-only or suggestion-only edits do not change this search basis.
additionalProperties: false
required:
- need_id
- requirements_version
properties:
need_id:
type: string
format: uuid
description: Need owned by the organization in the path.
requirements_version:
$ref: '#/components/schemas/NeedVersion'
filters:
$ref: '#/components/schemas/MatchSearchFilters'
MatchSearchByBank:
type: object
description: Search the current organization-visible bank. An empty `filters` object includes all otherwise eligible specializations as separate entries.
additionalProperties: false
required:
- filters
properties:
filters:
$ref: '#/components/schemas/MatchSearchFilters'
MatchSearchRequest:
oneOf:
- $ref: '#/components/schemas/MatchSearchByNeed'
- $ref: '#/components/schemas/MatchSearchByBank'
description: Search either a Need.requirements_version snapshot or the whole organization-visible bank with explicit filters. Unknown fields are rejected by both closed request variants.
MatchSearchNeedSource:
type: object
description: The immutable need requirements snapshot used by this result.
additionalProperties: false
required:
- kind
- need_id
- requirements_version
properties:
kind:
type: string
enum:
- need
need_id:
type: string
format: uuid
requirements_version:
$ref: '#/components/schemas/NeedVersion'
MatchAppliedConditions:
type: object
description: Conditions echoed as a complete snapshot; null means no filter.
additionalProperties: false
required:
- work_formats
- salary_compatibility
properties:
work_formats:
oneOf:
- type: array
minItems: 1
maxItems: 3
uniqueItems: true
items:
$ref: '#/components/schemas/WorkFormat'
- type: 'null'
salary_compatibility:
oneOf:
- $ref: '#/components/schemas/CandidateSalaryCompatibility'
- type: 'null'
MatchAppliedFilters:
type: object
description: A normalized response snapshot of the bank filters. Each key is present; null means the corresponding request filter was omitted. This keeps a search result tied to its exact filter basis.
additionalProperties: false
required:
- specialization
- confirmed_grade
- confirmed_category
- confirmation_status
- declared_grade
- stack
- conditions
properties:
specialization:
oneOf:
- $ref: '#/components/schemas/SpecializationCode'
- type: 'null'
confirmed_grade:
oneOf:
- $ref: '#/components/schemas/GradeCode'
- type: 'null'
confirmed_category:
oneOf:
- $ref: '#/components/schemas/MatchGradeFilter'
- type: 'null'
confirmation_status:
oneOf:
- $ref: '#/components/schemas/MatchConfirmationStatus'
- type: 'null'
declared_grade:
oneOf:
- $ref: '#/components/schemas/GradeCode'
- type: 'null'
stack:
oneOf:
- type: array
minItems: 1
maxItems: 4
uniqueItems: true
items:
$ref: '#/components/schemas/MatchSearchStackTag'
- type: 'null'
conditions:
oneOf:
- $ref: '#/components/schemas/MatchAppliedConditions'
- type: 'null'
MatchSearchBankSource:
type: object
description: The normalized filters used for a bank search.
additionalProperties: false
required:
- kind
- filters
properties:
kind:
type: string
enum:
- bank
filters:
$ref: '#/components/schemas/MatchAppliedFilters'
MatchSearchSource:
oneOf:
- $ref: '#/components/schemas/MatchSearchNeedSource'
- $ref: '#/components/schemas/MatchSearchBankSource'
description: Search basis echoed with the response so the displayed result remains tied to its need requirements version or bank filters.
MatchCategory:
type: object
description: A confirmed category. Its specialization must equal the enclosing match entry's specialization.
additionalProperties: false
required:
- specialization
- grade
properties:
specialization:
$ref: '#/components/schemas/SpecializationCode'
grade:
$ref: '#/components/schemas/GradeCode'
MatchStrength:
type: string
description: Coarse strength of a confirmed assessment for this specialization.
enum:
- standard
- strong
MatchPublicStack:
type: array
maxItems: 4
uniqueItems: true
items:
$ref: '#/components/schemas/MatchSearchStackTag'
CandidateExperienceBand:
type: string
description: Coarse total experience bucket. Rare combinations may be generalized to 0_3 or 3_plus before they are returned.
enum:
- '0_1'
- '1_3'
- '3_6'
- 6_plus
- '0_3'
- 3_plus
MatchPublicContext:
type: object
description: Safe anonymous-card context only. A null value means that the value is not in the public card or is not present; the response does not reveal which. It contains no contact, candidate location, or salary amount.
additionalProperties: false
required:
- stack
- experience_band
- work_formats
- salary_compatibility
properties:
stack:
oneOf:
- $ref: '#/components/schemas/MatchPublicStack'
- type: 'null'
experience_band:
oneOf:
- $ref: '#/components/schemas/CandidateExperienceBand'
- type: 'null'
work_formats:
oneOf:
- type: array
maxItems: 3
uniqueItems: true
items:
$ref: '#/components/schemas/WorkFormat'
- type: 'null'
salary_compatibility:
oneOf:
- $ref: '#/components/schemas/CandidateSalaryCompatibility'
- type: 'null'
MatchEvidenceCode:
type: string
description: Template code for an explanation derived from allowed evidence. It carries no free text, raw answer, or reason for withheld FSP data.
enum:
- confirmed_category
- required_skill_evidence
- desired_skill_evidence
- domain_alignment
- task_alignment
- work_conditions_match
- salary_compatibility
- declared_grade
MatchEvidenceState:
type: string
enum:
- supports
- partial
- gap
- declared_only
MatchEvidenceSummaryItem:
type: object
description: A templated, non-text evidence explanation.
additionalProperties: false
required:
- code
- state
properties:
code:
$ref: '#/components/schemas/MatchEvidenceCode'
state:
$ref: '#/components/schemas/MatchEvidenceState'
MatchEvidenceSummary:
type: array
maxItems: 12
items:
$ref: '#/components/schemas/MatchEvidenceSummaryItem'
MatchScore:
type: number
format: double
minimum: 0
maximum: 1
description: A normalized FR09 ranking component from 0 to 1.
MatchNullableScore:
description: A score from a versioned ranking component, or null when it is not available. Any null component has a matching bounded entry in `unknown_flags`.
oneOf:
- type: number
format: double
minimum: 0
maximum: 1
- type: 'null'
MatchConfirmedComponents:
type: object
description: Components from the FR09 ranking model for a confirmed category. `percentile` is null when fewer than 30 comparable real candidates are available; the ranking uses neutral T = 0.5 and does not publish a percentile. If ML is unavailable, `semantics` uses neutral 0.5 and the reason appears in `unknown_flags`.
additionalProperties: false
required:
- fit
- coverage
- domain
- semantics
- percentile
- competition
- freshness
- responsiveness
- rank_score
properties:
fit:
$ref: '#/components/schemas/MatchScore'
coverage:
$ref: '#/components/schemas/MatchScore'
domain:
$ref: '#/components/schemas/MatchScore'
semantics:
$ref: '#/components/schemas/MatchScore'
percentile:
$ref: '#/components/schemas/MatchNullableScore'
competition:
$ref: '#/components/schemas/MatchScore'
freshness:
$ref: '#/components/schemas/MatchScore'
responsiveness:
$ref: '#/components/schemas/MatchScore'
rank_score:
$ref: '#/components/schemas/MatchScore'
MatchUnknownComponent:
type: string
description: Ranking or public-card component whose value is unknown.
enum:
- semantics
- percentile
- assessment
- freshness
- responsiveness
- experience_band
- work_formats
- salary_compatibility
- domain
MatchUnknownReason:
type: string
description: Bounded explanation for an unknown component, not a hiding reason.
enum:
- ml_unavailable
- cohort_below_30
- no_confirmation_for_specialization
- not_in_public_card
- need_field_unconfirmed
- no_freshness_history
- no_response_history
MatchUnknownFlag:
type: object
description: A safe, bounded explanation for one unavailable component.
additionalProperties: false
required:
- component
- reason
properties:
component:
$ref: '#/components/schemas/MatchUnknownComponent'
reason:
$ref: '#/components/schemas/MatchUnknownReason'
MatchUnknownFlags:
type: array
maxItems: 9
items:
$ref: '#/components/schemas/MatchUnknownFlag'
MatchConfirmedCandidate:
type: object
description: One confirmed specialization entry in the `main` or `near` group. The group containing it supplies the group label. A candidate may have a separate entry for another specialization.
additionalProperties: false
required:
- candidate_handle
- specialization
- confirmation_status
- declared_grade
- category
- strength
- public_context
- evidence_summary
- components
- unknown_flags
properties:
candidate_handle:
$ref: '#/components/schemas/CandidateHandle'
specialization:
$ref: '#/components/schemas/SpecializationCode'
confirmation_status:
type: string
enum:
- confirmed
declared_grade:
oneOf:
- $ref: '#/components/schemas/GradeCode'
- type: 'null'
description: Candidate-declared grade for this specialization, never a confirmation.
category:
$ref: '#/components/schemas/MatchCategory'
strength:
$ref: '#/components/schemas/MatchStrength'
public_context:
$ref: '#/components/schemas/MatchPublicContext'
evidence_summary:
$ref: '#/components/schemas/MatchEvidenceSummary'
components:
$ref: '#/components/schemas/MatchConfirmedComponents'
unknown_flags:
$ref: '#/components/schemas/MatchUnknownFlags'
MatchUnconfirmedComponents:
type: object
description: Unconfirmed entries are ordered only by Fit and coverage. This strict component object has no theta, T, P, test percentile, or confirmed assessment score.
additionalProperties: false
required:
- fit
- coverage
properties:
fit:
type: number
format: double
minimum: 0
maximum: 1
description: Job fit for this specialization, never an assessment score.
coverage:
type: number
format: double
minimum: 0
maximum: 1
description: Coverage of confirmed need skills by allowed public evidence.
MatchUnconfirmedCandidate:
type: object
description: One specialization with no confirmed category. `category` and `strength` remain present and null. A confirmation in another specialization never changes this entry. The schema intentionally has no assessment measurement fields.
additionalProperties: false
required:
- candidate_handle
- specialization
- confirmation_status
- declared_grade
- category
- strength
- public_context
- evidence_summary
- components
- unknown_flags
properties:
candidate_handle:
$ref: '#/components/schemas/CandidateHandle'
specialization:
$ref: '#/components/schemas/SpecializationCode'
confirmation_status:
type: string
enum:
- unconfirmed
declared_grade:
oneOf:
- $ref: '#/components/schemas/GradeCode'
- type: 'null'
description: Candidate-declared grade, separate from assessment confirmation.
category:
type: 'null'
description: There is no confirmed category for this specialization.
strength:
type: 'null'
description: Assessment strength is not measured for this specialization.
public_context:
$ref: '#/components/schemas/MatchPublicContext'
evidence_summary:
$ref: '#/components/schemas/MatchEvidenceSummary'
components:
$ref: '#/components/schemas/MatchUnconfirmedComponents'
unknown_flags:
$ref: '#/components/schemas/MatchUnknownFlags'
MatchSearchGroups:
type: object
description: Separate ranking groups. Confirmed categories appear in main and near; unconfirmed specializations appear only in the lower unconfirmed group.
additionalProperties: false
required:
- main
- near
- unconfirmed
properties:
main:
type: array
items:
$ref: '#/components/schemas/MatchConfirmedCandidate'
near:
type: array
items:
$ref: '#/components/schemas/MatchConfirmedCandidate'
unconfirmed:
type: array
items:
$ref: '#/components/schemas/MatchUnconfirmedCandidate'
MatchSearchResponse:
type: object
description: Anonymous search result grouped by specialization state. Repeated organization-scoped handles are allowed when the same candidate has different specialization entries; entries never transfer confirmation between specializations.
additionalProperties: false
required:
- source
- groups
properties:
source:
$ref: '#/components/schemas/MatchSearchSource'
groups:
$ref: '#/components/schemas/MatchSearchGroups'
CardSelfAssessment:
type: object
description: Candidate-declared specialization and optional grade. This is never an assessment result.
@@ -9763,28 +10355,12 @@ components:
oneOf:
- $ref: '#/components/schemas/GradeCode'
- type: 'null'
CandidateExperienceBand:
type: string
description: Coarse total experience bucket. Rare combinations may be generalized to 0_3 or 3_plus before they are returned.
enum:
- '0_1'
- '1_3'
- '3_6'
- 6_plus
- '0_3'
- 3_plus
CandidateWorkFormat:
type: string
enum:
- remote
- office
- hybrid
CandidateSalaryCompatibility:
type: string
description: A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.
enum:
- compatible
- not_compatible
parameters:
IdempotencyKey:
name: Idempotency-Key
@@ -13091,6 +13667,257 @@ components:
code: version_conflict
detail: The resource changed after it was read. Read it again before retrying.
trace_id: 0f1a2b3c-4d5e-4f6a-8b7c-8d9e0f1a2b3d
SearchByNeed:
summary: Search against one confirmed requirements snapshot.
description: The reference is Need.requirements_version, not Need.version.
value:
need_id: 4d3a4a1b-4f60-44c1-9dc2-6c8e6c9d4c11
requirements_version: 3
filters:
specialization: backend
SearchByBank:
summary: Search the organization-visible bank with separate confirmed and declared filters.
value:
filters:
specialization: backend
confirmed_grade: middle
confirmed_category:
specialization: backend
grade: middle
confirmation_status: confirmed
declared_grade: junior
stack:
- go
- postgresql
conditions:
work_formats:
- remote
salary_compatibility: compatible
ThreeGroups:
summary: Synthetic example of main, near, and unconfirmed entries.
description: Illustrative contract values only; these are not measurements from real candidates. The same organization-scoped handle has independent Backend and Networks states.
value:
source:
kind: bank
filters:
specialization: null
confirmed_grade: null
confirmed_category: null
confirmation_status: null
declared_grade: null
stack: null
conditions: null
groups:
main:
- candidate_handle: cv1_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
specialization: backend
confirmation_status: confirmed
declared_grade: middle
category:
specialization: backend
grade: middle
strength: standard
public_context:
stack:
- go
- postgresql
experience_band: '3_6'
work_formats:
- remote
salary_compatibility: compatible
evidence_summary:
- code: confirmed_category
state: supports
- code: required_skill_evidence
state: supports
- code: work_conditions_match
state: supports
components:
fit: 0.78
coverage: 0.72
domain: 0.75
semantics: 0.5
percentile: 0.61
competition: 0
freshness: 0.5
responsiveness: 0.5
rank_score: 0.65
unknown_flags: []
near:
- candidate_handle: cv1_BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
specialization: frontend
confirmation_status: confirmed
declared_grade: junior
category:
specialization: frontend
grade: junior
strength: standard
public_context:
stack:
- docker
experience_band: null
work_formats:
- hybrid
salary_compatibility: null
evidence_summary:
- code: confirmed_category
state: supports
- code: required_skill_evidence
state: gap
components:
fit: 0.48
coverage: 0.18
domain: 0.5
semantics: 0.5
percentile: 0.42
competition: 0
freshness: 0.5
responsiveness: 0.5
rank_score: 0.43
unknown_flags:
- component: experience_band
reason: not_in_public_card
- component: salary_compatibility
reason: not_in_public_card
unconfirmed:
- candidate_handle: cv1_AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
specialization: network_engineer
confirmation_status: unconfirmed
declared_grade: junior
category: null
strength: null
public_context:
stack: null
experience_band: '1_3'
work_formats:
- remote
salary_compatibility: compatible
evidence_summary:
- code: declared_grade
state: declared_only
- code: required_skill_evidence
state: partial
components:
fit: 0.51
coverage: 0.38
unknown_flags:
- component: assessment
reason: no_confirmation_for_specialization
Empty:
summary: A valid search with no eligible visible candidates.
value:
source:
kind: bank
filters:
specialization: null
confirmed_grade: null
confirmed_category: null
confirmation_status: null
declared_grade: null
stack: null
conditions: null
groups:
main: []
near: []
unconfirmed: []
MLUnavailable:
summary: Semantic similarity uses the documented neutral value while ML is unavailable.
description: Synthetic example; 0.5 is the FR09 neutral value, not an inference.
value:
source:
kind: bank
filters:
specialization: backend
confirmed_grade: null
confirmed_category: null
confirmation_status: null
declared_grade: null
stack: null
conditions: null
groups:
main:
- candidate_handle: cv1_CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
specialization: backend
confirmation_status: confirmed
declared_grade: null
category:
specialization: backend
grade: middle
strength: strong
public_context:
stack:
- go
experience_band: 3_plus
work_formats:
- remote
salary_compatibility: compatible
evidence_summary:
- code: confirmed_category
state: supports
components:
fit: 0.7
coverage: 0.6
domain: 0.5
semantics: 0.5
percentile: 0.6
competition: 0
freshness: 0.5
responsiveness: 0.5
rank_score: 0.61
unknown_flags:
- component: semantics
reason: ml_unavailable
near: []
unconfirmed: []
CohortBelow30:
summary: A small comparison cohort has no published percentile.
description: Synthetic example; the exact cohort size is not disclosed.
value:
source:
kind: bank
filters:
specialization: backend
confirmed_grade: null
confirmed_category: null
confirmation_status: null
declared_grade: null
stack: null
conditions: null
groups:
main:
- candidate_handle: cv1_DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD
specialization: backend
confirmation_status: confirmed
declared_grade: middle
category:
specialization: backend
grade: middle
strength: standard
public_context:
stack:
- postgresql
experience_band: '3_6'
work_formats:
- office
salary_compatibility: null
evidence_summary:
- code: confirmed_category
state: supports
components:
fit: 0.62
coverage: 0.55
domain: 0.5
semantics: 0.7
percentile: null
competition: 0
freshness: 0.5
responsiveness: 0.5
rank_score: 0.56
unknown_flags:
- component: percentile
reason: cohort_below_30
near: []
unconfirmed: []
OrganizationAnonymousCandidateCard:
summary: An anonymous card currently visible to one organization
description: The alias is scoped to the reading organization; no contact values are included.
+2
View File
@@ -127,6 +127,8 @@ paths:
$ref: ./routes/organization_needs.yml
/api/v1/organizations/{org_id}/needs/{need_id}:
$ref: ./routes/organization_need.yml
/api/v1/organizations/{org_id}/matches:
$ref: ./routes/matches.yml
/api/v1/organizations/{org_id}/candidate-cards/{candidate_handle}:
$ref: ./routes/organization_candidate_card.yml
/api/v1/organizations/{org_id}/invitations:
+60
View File
@@ -0,0 +1,60 @@
post:
operationId: SearchOrganizationMatches
summary: Search the current organization-visible candidate bank.
description: |-
Requires the session cookie of an employer account with an active owner membership in `org_id`, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The organization comes from the path and the active server-side membership. Hidden profiles, revoked or missing C2 publication, and the organization's visibility restrictions are applied before any result is returned.
The body selects either a Need's `requirements_version` snapshot or the current organization-visible bank with explicit filters. A need reference uses `Need.requirements_version`, not the general `Need.version`; title or suggestion-only edits do not change the confirmed-requirements snapshot. An empty bank filter searches all otherwise eligible specializations, returning each specialization separately.
Every entry is one candidate specialization. A confirmed result in Backend never confirms Networks for the same candidate. The `main`, `near`, and `unconfirmed` arrays are separate groups. A confirmed category with required-skill coverage below 0.25 belongs to `near`; other confirmed entries belong to `main` (FR09). Entries in `unconfirmed` are ordered by Fit, then coverage, then a stable internal tie-breaker that is never returned. Their category and strength remain null, and they have no theta, T, P, or test percentile. The search result uses the organization-scoped opaque `candidate_handle` as its display pseudonym and invitation reference, never a candidate account or profile identifier.
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`.
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 not_found. The response is `Cache-Control: no-store`.
security:
- sessionCookie: []
sessionCsrf: []
tags:
- organization
parameters:
- $ref: ../components/parameters.yml#/OrganizationId
requestBody:
required: true
content:
application/json:
schema:
$ref: ../components/schemas.yml#/MatchSearchRequest
examples:
by_need:
$ref: ../components/examples/matches.yml#/SearchByNeed
by_bank_filters:
$ref: ../components/examples/matches.yml#/SearchByBank
responses:
"200":
description: Organization-visible candidates in separate match groups.
headers:
Cache-Control:
$ref: ../components/headers.yml#/CacheControlNoStore
content:
application/json:
schema:
$ref: ../components/schemas.yml#/MatchSearchResponse
examples:
three_groups:
$ref: ../components/examples/matches.yml#/ThreeGroups
empty:
$ref: ../components/examples/matches.yml#/Empty
ml_unavailable:
$ref: ../components/examples/matches.yml#/MLUnavailable
cohort_below_30:
$ref: ../components/examples/matches.yml#/CohortBelow30
"400":
$ref: ../components/responses.yml#/ValidationFailed
"401":
$ref: ../components/responses.yml#/Unauthenticated
"403":
$ref: ../components/responses.yml#/CsrfCheckFailedOrForbidden
"404":
$ref: ../components/responses.yml#/NotFound
default:
$ref: ../components/responses.yml#/Problem
@@ -11712,6 +11712,269 @@ func (s *Server) handleSaveMyQuestionnaireRequest(args [0]string, argsEscaped bo
}
}
// handleSearchOrganizationMatchesRequest handles SearchOrganizationMatches operation.
//
// Requires the session cookie of an employer account with an active owner membership in `org_id`, the
// CSRF token of that session in X-CSRF-Token, and an allowed Origin. The organization comes from the
// path and the active server-side membership. Hidden profiles, revoked or missing C2 publication, and
// the organization's visibility restrictions are applied before any result is returned.
//
// The body selects either a Need's `requirements_version` snapshot or the current organization-visible
// bank with explicit filters. A need reference uses `Need.requirements_version`, not the general
// `Need.version`; title or suggestion-only edits do not change the confirmed-requirements snapshot. An
// empty bank filter searches all otherwise eligible specializations, returning each specialization
// separately.
//
// Every entry is one candidate specialization. A confirmed result in Backend never confirms Networks
// for the same candidate. The `main`, `near`, and `unconfirmed` arrays are separate groups. A
// confirmed category with required-skill coverage below 0.25 belongs to `near`; other confirmed
// entries belong to `main` (FR09). Entries in `unconfirmed` are ordered by Fit, then coverage, then a
// stable internal tie-breaker that is never returned. Their category and strength remain null, and
// they have no theta, T, P, or test percentile. The search result uses the organization-scoped opaque
// `candidate_handle` as its display pseudonym and invitation reference, never a candidate account or
// profile identifier.
//
// 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`.
//
// 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
// not_found. The response is `Cache-Control: no-store`.
//
// POST /api/v1/organizations/{org_id}/matches
func (s *Server) handleSearchOrganizationMatchesRequest(args [1]string, argsEscaped bool, w http.ResponseWriter, r *http.Request) {
statusWriter := &codeRecorder{ResponseWriter: w}
w = statusWriter
otelAttrs := []attribute.KeyValue{
otelogen.OperationID("SearchOrganizationMatches"),
semconv.HTTPRequestMethodKey.String("POST"),
semconv.HTTPRouteKey.String("/api/v1/organizations/{org_id}/matches"),
}
// Add attributes from config.
otelAttrs = append(otelAttrs, s.cfg.Attributes...)
// Start a span for this request.
ctx, span := s.cfg.Tracer.Start(r.Context(), SearchOrganizationMatchesOperation,
trace.WithAttributes(otelAttrs...),
serverSpanKind,
)
defer span.End()
// Add Labeler to context.
labeler := &Labeler{attrs: otelAttrs}
ctx = contextWithLabeler(ctx, labeler)
// Run stopwatch.
startTime := time.Now()
defer func() {
elapsedDuration := time.Since(startTime)
attrSet := labeler.AttributeSet()
attrs := attrSet.ToSlice()
code := statusWriter.status
if code != 0 {
codeAttr := semconv.HTTPResponseStatusCode(code)
attrs = append(attrs, codeAttr)
span.SetAttributes(attrs...)
}
attrOpt := metric.WithAttributes(attrs...)
// Increment request counter.
s.requests.Add(ctx, 1, attrOpt)
// Use floating point division here for higher precision (instead of Millisecond method).
s.duration.Record(ctx, float64(elapsedDuration)/float64(time.Millisecond), attrOpt)
}()
var (
recordError = func(stage string, err error) {
span.RecordError(err)
// https://opentelemetry.io/docs/specs/semconv/http/http-spans/#status
// Span Status MUST be left unset if HTTP status code was in the 1xx, 2xx or 3xx ranges,
// unless there was another error (e.g., network error receiving the response body; or 3xx codes with
// max redirects exceeded), in which case status MUST be set to Error.
code := statusWriter.status
if code < 100 || code >= 500 {
span.SetStatus(codes.Error, stage)
}
attrSet := labeler.AttributeSet()
attrs := attrSet.ToSlice()
if code != 0 {
attrs = append(attrs, semconv.HTTPResponseStatusCode(code))
}
s.errors.Add(ctx, 1, metric.WithAttributes(attrs...))
}
err error
opErrContext = ogenerrors.OperationContext{
Name: SearchOrganizationMatchesOperation,
ID: "SearchOrganizationMatches",
}
)
{
type bitset = [1]uint8
var satisfied bitset
{
sctx, ok, err := s.securitySessionCookie(ctx, SearchOrganizationMatchesOperation, r)
if err != nil {
err = &ogenerrors.SecurityError{
OperationContext: opErrContext,
Security: "SessionCookie",
Err: err,
}
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
defer recordError("Security:SessionCookie", err)
}
return
}
if ok {
satisfied[0] |= 1 << 0
ctx = sctx
}
}
{
sctx, ok, err := s.securitySessionCsrf(ctx, SearchOrganizationMatchesOperation, r)
if err != nil {
err = &ogenerrors.SecurityError{
OperationContext: opErrContext,
Security: "SessionCsrf",
Err: err,
}
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
defer recordError("Security:SessionCsrf", err)
}
return
}
if ok {
satisfied[0] |= 1 << 1
ctx = sctx
}
}
if ok := func() bool {
nextRequirement:
for _, requirement := range []bitset{
{0b00000011},
} {
for i, mask := range requirement {
if satisfied[i]&mask != mask {
continue nextRequirement
}
}
return true
}
return false
}(); !ok {
err = &ogenerrors.SecurityError{
OperationContext: opErrContext,
Err: ogenerrors.ErrSecurityRequirementIsNotSatisfied,
}
if encodeErr := encodeErrorResponse(s.h.NewError(ctx, err), w, span); encodeErr != nil {
defer recordError("Security", err)
}
return
}
}
params, err := decodeSearchOrganizationMatchesParams(args, argsEscaped, r)
if err != nil {
err = &ogenerrors.DecodeParamsError{
OperationContext: opErrContext,
Err: err,
}
defer recordError("DecodeParams", err)
s.cfg.ErrorHandler(ctx, w, r, err)
return
}
var rawBody []byte
request, rawBody, close, err := s.decodeSearchOrganizationMatchesRequest(r)
if err != nil {
err = &ogenerrors.DecodeRequestError{
OperationContext: opErrContext,
Err: err,
}
defer recordError("DecodeRequest", err)
s.cfg.ErrorHandler(ctx, w, r, err)
return
}
defer func() {
if err := close(); err != nil {
recordError("CloseRequest", err)
}
}()
var response SearchOrganizationMatchesRes
if m := s.cfg.Middleware; m != nil {
mreq := middleware.Request{
Context: ctx,
OperationName: SearchOrganizationMatchesOperation,
OperationSummary: "Search the current organization-visible candidate bank.",
OperationID: "SearchOrganizationMatches",
Body: request,
RawBody: rawBody,
Params: middleware.Parameters{
{
Name: "org_id",
In: "path",
}: params.OrgID,
},
Raw: r,
}
type (
Request = MatchSearchRequest
Params = SearchOrganizationMatchesParams
Response = SearchOrganizationMatchesRes
)
response, err = middleware.HookMiddleware[
Request,
Params,
Response,
](
m,
mreq,
unpackSearchOrganizationMatchesParams,
func(ctx context.Context, request Request, params Params) (response Response, err error) {
response, err = s.h.SearchOrganizationMatches(ctx, request, params)
return response, err
},
)
} else {
response, err = s.h.SearchOrganizationMatches(ctx, request, params)
}
if err != nil {
if errRes, ok := errors.Into[*ProblemStatusCode](err); ok {
if err := encodeErrorResponse(errRes, w, span); err != nil {
defer recordError("Internal", err)
}
return
}
if errors.Is(err, ht.ErrNotImplemented) {
s.cfg.ErrorHandler(ctx, w, r, err)
return
}
if err := encodeErrorResponse(s.h.NewError(ctx, err), w, span); err != nil {
defer recordError("Internal", err)
}
return
}
if err := encodeSearchOrganizationMatchesResponse(response, w, span); err != nil {
defer recordError("EncodeResponse", err)
if !errors.Is(err, ht.ErrInternalServerErrorResponse) {
s.cfg.ErrorHandler(ctx, w, r, err)
}
return
}
}
// handleSendOrganizationInvitationRequest handles SendOrganizationInvitation operation.
//
// Requires the session cookie of an employer account with an active membership in `org_id`, the CSRF
@@ -201,6 +201,10 @@ type SaveMyQuestionnaireRes interface {
saveMyQuestionnaireRes()
}
type SearchOrganizationMatchesRes interface {
searchOrganizationMatchesRes()
}
type SendOrganizationInvitationRes interface {
sendOrganizationInvitationRes()
}
File diff suppressed because it is too large. Load diff
@@ -58,6 +58,7 @@ const (
RevokeMyOrganizationContactConsentOperation OperationName = "RevokeMyOrganizationContactConsent"
SaveMyProfileOperation OperationName = "SaveMyProfile"
SaveMyQuestionnaireOperation OperationName = "SaveMyQuestionnaire"
SearchOrganizationMatchesOperation OperationName = "SearchOrganizationMatches"
SendOrganizationInvitationOperation OperationName = "SendOrganizationInvitation"
SetMyPublicationOperation OperationName = "SetMyPublication"
SetMySearchStatusOperation OperationName = "SetMySearchStatus"
@@ -4788,6 +4788,75 @@ func decodeRevokeMyOrganizationContactConsentParams(args [1]string, argsEscaped
return params, nil
}
// SearchOrganizationMatchesParams is parameters of SearchOrganizationMatches operation.
type SearchOrganizationMatchesParams struct {
// Identifier of an organization. Access comes only from an active membership of the session account in
// this organization, checked by the server on every request; the identifier itself grants nothing. An
// organization without such a membership and an unknown identifier both answer 404 not_found, so
// organizations cannot be enumerated.
OrgID uuid.UUID
}
func unpackSearchOrganizationMatchesParams(packed middleware.Parameters) (params SearchOrganizationMatchesParams) {
{
key := middleware.ParameterKey{
Name: "org_id",
In: "path",
}
params.OrgID = packed[key].(uuid.UUID)
}
return params
}
func decodeSearchOrganizationMatchesParams(args [1]string, argsEscaped bool, r *http.Request) (params SearchOrganizationMatchesParams, _ error) {
// Decode path: org_id.
if err := func() error {
param := args[0]
if argsEscaped {
unescaped, err := url.PathUnescape(args[0])
if err != nil {
return errors.Wrap(err, "unescape path")
}
param = unescaped
}
if len(param) > 0 {
d := uri.NewPathDecoder(uri.PathDecoderConfig{
Param: "org_id",
Value: param,
Style: uri.PathStyleSimple,
Explode: false,
})
if err := func() error {
val, err := d.DecodeValue()
if err != nil {
return err
}
c, err := conv.ToUUID(val)
if err != nil {
return err
}
params.OrgID = c
return nil
}(); err != nil {
return err
}
} else {
return validate.ErrFieldRequired
}
return nil
}(); err != nil {
return params, &ogenerrors.DecodeParamError{
Name: "org_id",
In: "path",
Err: err,
}
}
return params, nil
}
// SendOrganizationInvitationParams is parameters of SendOrganizationInvitation operation.
type SendOrganizationInvitationParams struct {
// Identifier of an organization. Access comes only from an active membership of the session account in
@@ -1436,6 +1436,85 @@ func (s *Server) decodeSaveMyQuestionnaireRequest(r *http.Request) (
}
}
func (s *Server) decodeSearchOrganizationMatchesRequest(r *http.Request) (
req MatchSearchRequest,
rawBody []byte,
close func() error,
rerr error,
) {
var closers []func() error
close = func() error {
var merr error
// Close in reverse order, to match defer behavior.
for i := len(closers) - 1; i >= 0; i-- {
c := closers[i]
merr = errors.Join(merr, c())
}
return merr
}
defer func() {
if rerr != nil {
rerr = errors.Join(rerr, close())
}
}()
ct, _, err := mime.ParseMediaType(r.Header.Get("Content-Type"))
if err != nil {
return req, rawBody, close, errors.Wrap(err, "parse media type")
}
switch {
case ct == "application/json":
if r.ContentLength == 0 {
return req, rawBody, close, validate.ErrBodyRequired
}
buf, err := io.ReadAll(r.Body)
defer func() {
_ = r.Body.Close()
}()
if err != nil {
return req, rawBody, close, err
}
// Reset the body to allow for downstream reading.
r.Body = io.NopCloser(bytes.NewBuffer(buf))
if len(buf) == 0 {
return req, rawBody, close, validate.ErrBodyRequired
}
rawBody = append(rawBody, buf...)
d := jx.DecodeBytes(buf)
var request MatchSearchRequest
if err := func() error {
if err := request.Decode(d); err != nil {
return err
}
if err := d.Skip(); err != io.EOF {
return errors.New("unexpected trailing data")
}
return nil
}(); err != nil {
err = &ogenerrors.DecodeBodyError{
ContentType: ct,
Body: buf,
Err: err,
}
return req, rawBody, close, err
}
if err := func() error {
if err := request.Validate(); err != nil {
return err
}
return nil
}(); err != nil {
return req, rawBody, close, errors.Wrap(err, "validate")
}
return request, rawBody, close, nil
default:
return req, rawBody, close, validate.InvalidContentType(ct)
}
}
func (s *Server) decodeSendOrganizationInvitationRequest(r *http.Request) (
req *InvitationCommand,
rawBody []byte,
@@ -4388,6 +4388,89 @@ func encodeSaveMyQuestionnaireResponse(response SaveMyQuestionnaireRes, w http.R
}
}
func encodeSearchOrganizationMatchesResponse(response SearchOrganizationMatchesRes, w http.ResponseWriter, span trace.Span) error {
switch response := response.(type) {
case *MatchSearchResponseHeaders:
w.Header().Set("Content-Type", "application/json; charset=utf-8")
// Encoding response headers.
{
h := uri.NewHeaderEncoder(w.Header())
// Encode "Cache-Control" header.
{
cfg := uri.HeaderParameterEncodingConfig{
Name: "Cache-Control",
Explode: false,
}
if err := h.EncodeParam(cfg, func(e uri.Encoder) error {
return e.EncodeValue(conv.StringToString(string(response.CacheControl)))
}); err != nil {
return errors.Wrap(err, "encode Cache-Control header")
}
}
}
w.WriteHeader(200)
e := new(jx.Encoder)
response.Response.Encode(e)
if _, err := e.WriteTo(w); err != nil {
return errors.Wrap(err, "write")
}
return nil
case *SearchOrganizationMatchesBadRequest:
w.Header().Set("Content-Type", "application/problem+json")
w.WriteHeader(400)
e := new(jx.Encoder)
response.Encode(e)
if _, err := e.WriteTo(w); err != nil {
return errors.Wrap(err, "write")
}
return nil
case *SearchOrganizationMatchesUnauthorized:
w.Header().Set("Content-Type", "application/problem+json")
w.WriteHeader(401)
e := new(jx.Encoder)
response.Encode(e)
if _, err := e.WriteTo(w); err != nil {
return errors.Wrap(err, "write")
}
return nil
case *SearchOrganizationMatchesForbidden:
w.Header().Set("Content-Type", "application/problem+json")
w.WriteHeader(403)
e := new(jx.Encoder)
response.Encode(e)
if _, err := e.WriteTo(w); err != nil {
return errors.Wrap(err, "write")
}
return nil
case *SearchOrganizationMatchesNotFound:
w.Header().Set("Content-Type", "application/problem+json")
w.WriteHeader(404)
e := new(jx.Encoder)
response.Encode(e)
if _, err := e.WriteTo(w); err != nil {
return errors.Wrap(err, "write")
}
return nil
default:
return errors.Errorf("unexpected response type: %T", response)
}
}
func encodeSendOrganizationInvitationResponse(response SendOrganizationInvitationRes, w http.ResponseWriter, span trace.Span) error {
switch response := response.(type) {
case *OrganizationInvitationHeaders:
@@ -32,13 +32,13 @@ var (
rn9AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn79AllowedHeaders = map[string]string{
rn80AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn20AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn78AllowedHeaders = map[string]string{
rn79AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn64AllowedHeaders = map[string]string{
@@ -60,17 +60,17 @@ var (
rn17AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn80AllowedHeaders = map[string]string{
rn81AllowedHeaders = map[string]string{
"POST": "X-Csrf-Token",
}
rn53AllowedHeaders = map[string]string{
"DELETE": "X-Csrf-Token",
"PUT": "X-Csrf-Token",
}
rn75AllowedHeaders = map[string]string{
rn76AllowedHeaders = map[string]string{
"PUT": "Content-Type,X-Csrf-Token",
}
rn76AllowedHeaders = map[string]string{
rn77AllowedHeaders = map[string]string{
"PUT": "Content-Type,X-Csrf-Token",
}
rn36AllowedHeaders = map[string]string{
@@ -97,12 +97,15 @@ var (
rn63AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn73AllowedHeaders = map[string]string{
rn74AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn81AllowedHeaders = map[string]string{
rn82AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
rn72AllowedHeaders = map[string]string{
"POST": "Content-Type,X-Csrf-Token",
}
rn16AllowedHeaders = map[string]string{
"POST": "Content-Type,Idempotency-Key,X-Csrf-Token",
}
@@ -554,7 +557,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "POST",
allowedHeaders: rn79AllowedHeaders,
allowedHeaders: rn80AllowedHeaders,
acceptPost: "application/json",
acceptPatch: "",
})
@@ -647,7 +650,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "POST",
allowedHeaders: rn78AllowedHeaders,
allowedHeaders: rn79AllowedHeaders,
acceptPost: "application/json",
acceptPatch: "",
})
@@ -1048,7 +1051,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "POST",
allowedHeaders: rn80AllowedHeaders,
allowedHeaders: rn81AllowedHeaders,
acceptPost: "",
acceptPatch: "",
})
@@ -1319,7 +1322,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "PUT",
allowedHeaders: rn75AllowedHeaders,
allowedHeaders: rn76AllowedHeaders,
acceptPost: "",
acceptPatch: "",
})
@@ -1346,7 +1349,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "PUT",
allowedHeaders: rn76AllowedHeaders,
allowedHeaders: rn77AllowedHeaders,
acceptPost: "",
acceptPatch: "",
})
@@ -1763,7 +1766,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "POST",
allowedHeaders: rn73AllowedHeaders,
allowedHeaders: rn74AllowedHeaders,
acceptPost: "application/json",
acceptPatch: "",
})
@@ -1793,7 +1796,7 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "POST",
allowedHeaders: rn81AllowedHeaders,
allowedHeaders: rn82AllowedHeaders,
acceptPost: "application/json",
acceptPatch: "",
})
@@ -1808,6 +1811,33 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
case 'm': // Prefix: "matches"
if l := len("matches"); len(elem) >= l && elem[0:l] == "matches" {
elem = elem[l:]
} else {
break
}
if len(elem) == 0 {
// Leaf node.
switch r.Method {
case "POST":
s.handleSearchOrganizationMatchesRequest([1]string{
args[0],
}, elemIsEscaped, w, r)
default:
s.notAllowed(w, r, notAllowedParams{
allowedMethods: "POST",
allowedHeaders: rn72AllowedHeaders,
acceptPost: "application/json",
acceptPatch: "",
})
}
return
}
case 'n': // Prefix: "needs"
if l := len("needs"); len(elem) >= l && elem[0:l] == "needs" {
@@ -3655,6 +3685,31 @@ func (s *Server) FindPath(method string, u *url.URL) (r Route, _ bool) {
}
case 'm': // Prefix: "matches"
if l := len("matches"); len(elem) >= l && elem[0:l] == "matches" {
elem = elem[l:]
} else {
break
}
if len(elem) == 0 {
// Leaf node.
switch method {
case "POST":
r.name = SearchOrganizationMatchesOperation
r.summary = "Search the current organization-visible candidate bank."
r.operationID = "SearchOrganizationMatches"
r.operationGroup = ""
r.pathPattern = "/api/v1/organizations/{org_id}/matches"
r.args = args
r.count = 1
return r, true
default:
return
}
}
case 'n': // Prefix: "needs"
if l := len("needs"); len(elem) >= l && elem[0:l] == "needs" {
File diff suppressed because it is too large. Load diff
@@ -101,6 +101,7 @@ var operationRolesSessionCookie = map[string][]string{
RevokeMyOrganizationContactConsentOperation: []string{},
SaveMyProfileOperation: []string{},
SaveMyQuestionnaireOperation: []string{},
SearchOrganizationMatchesOperation: []string{},
SendOrganizationInvitationOperation: []string{},
SetMyPublicationOperation: []string{},
SetMySearchStatusOperation: []string{},
@@ -156,6 +157,7 @@ var operationRolesSessionCsrf = map[string][]string{
RevokeMyOrganizationContactConsentOperation: []string{},
SaveMyProfileOperation: []string{},
SaveMyQuestionnaireOperation: []string{},
SearchOrganizationMatchesOperation: []string{},
SendOrganizationInvitationOperation: []string{},
SetMyPublicationOperation: []string{},
SetMySearchStatusOperation: []string{},
@@ -1442,6 +1442,42 @@ type Handler interface {
//
// PUT /api/v1/me/questionnaire
SaveMyQuestionnaire(ctx context.Context, req *CandidateQuestionnaireUpdate) (SaveMyQuestionnaireRes, error)
// SearchOrganizationMatches implements SearchOrganizationMatches operation.
//
// Requires the session cookie of an employer account with an active owner membership in `org_id`, the
// CSRF token of that session in X-CSRF-Token, and an allowed Origin. The organization comes from the
// path and the active server-side membership. Hidden profiles, revoked or missing C2 publication, and
// the organization's visibility restrictions are applied before any result is returned.
//
// The body selects either a Need's `requirements_version` snapshot or the current organization-visible
// bank with explicit filters. A need reference uses `Need.requirements_version`, not the general
// `Need.version`; title or suggestion-only edits do not change the confirmed-requirements snapshot. An
// empty bank filter searches all otherwise eligible specializations, returning each specialization
// separately.
//
// Every entry is one candidate specialization. A confirmed result in Backend never confirms Networks
// for the same candidate. The `main`, `near`, and `unconfirmed` arrays are separate groups. A
// confirmed category with required-skill coverage below 0.25 belongs to `near`; other confirmed
// entries belong to `main` (FR09). Entries in `unconfirmed` are ordered by Fit, then coverage, then a
// stable internal tie-breaker that is never returned. Their category and strength remain null, and
// they have no theta, T, P, or test percentile. The search result uses the organization-scoped opaque
// `candidate_handle` as its display pseudonym and invitation reference, never a candidate account or
// profile identifier.
//
// 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`.
//
// 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
// not_found. The response is `Cache-Control: no-store`.
//
// POST /api/v1/organizations/{org_id}/matches
SearchOrganizationMatches(ctx context.Context, req MatchSearchRequest, params SearchOrganizationMatchesParams) (SearchOrganizationMatchesRes, error)
// SendOrganizationInvitation implements SendOrganizationInvitation operation.
//
// Requires the session cookie of an employer account with an active membership in `org_id`, the CSRF
@@ -1603,6 +1603,45 @@ func (UnimplementedHandler) SaveMyQuestionnaire(ctx context.Context, req *Candid
return r, ht.ErrNotImplemented
}
// SearchOrganizationMatches implements SearchOrganizationMatches operation.
//
// Requires the session cookie of an employer account with an active owner membership in `org_id`, the
// CSRF token of that session in X-CSRF-Token, and an allowed Origin. The organization comes from the
// path and the active server-side membership. Hidden profiles, revoked or missing C2 publication, and
// the organization's visibility restrictions are applied before any result is returned.
//
// The body selects either a Need's `requirements_version` snapshot or the current organization-visible
// bank with explicit filters. A need reference uses `Need.requirements_version`, not the general
// `Need.version`; title or suggestion-only edits do not change the confirmed-requirements snapshot. An
// empty bank filter searches all otherwise eligible specializations, returning each specialization
// separately.
//
// Every entry is one candidate specialization. A confirmed result in Backend never confirms Networks
// for the same candidate. The `main`, `near`, and `unconfirmed` arrays are separate groups. A
// confirmed category with required-skill coverage below 0.25 belongs to `near`; other confirmed
// entries belong to `main` (FR09). Entries in `unconfirmed` are ordered by Fit, then coverage, then a
// stable internal tie-breaker that is never returned. Their category and strength remain null, and
// they have no theta, T, P, or test percentile. The search result uses the organization-scoped opaque
// `candidate_handle` as its display pseudonym and invitation reference, never a candidate account or
// profile identifier.
//
// 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`.
//
// 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
// not_found. The response is `Cache-Control: no-store`.
//
// POST /api/v1/organizations/{org_id}/matches
func (UnimplementedHandler) SearchOrganizationMatches(ctx context.Context, req MatchSearchRequest, params SearchOrganizationMatchesParams) (r SearchOrganizationMatchesRes, _ error) {
return r, ht.ErrNotImplemented
}
// SendOrganizationInvitation implements SendOrganizationInvitation operation.
//
// Requires the session cookie of an employer account with an active membership in `org_id`, the CSRF
File diff suppressed because it is too large. Load diff
@@ -21,6 +21,11 @@ import type {
} from 'msw';
import type {
MatchAppliedConditions,
MatchGradeFilter,
MatchSearchBankSource,
MatchSearchNeedSource,
MatchSearchResponse,
MyOrganizationList,
Organization
} from '../../schemas';
@@ -34,6 +39,16 @@ export const getGetOrganizationResponseMock = (overrideResponse: Partial<Extract
export const getUpdateOrganizationResponseMock = (overrideResponse: Partial<Extract<Organization, object>> = {}): Organization => ({id: faker.string.uuid(), version: faker.number.int({min: 1}), name: fakeFromPattern("^\\S(?:[^\\n\\r]*\\S)?$", {minLength: 1, maxLength: 200}), description: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 2000}}),null,]), sphere: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), contacts: {website: faker.helpers.arrayElement([fakeFromPattern("^https://[^\\s/?#@]+(?:[/?#][^\\s]*)?$", {minLength: 9, maxLength: 300}),null,]), email: faker.helpers.arrayElement([faker.internet.email(),null,]), phone: faker.helpers.arrayElement([fakeFromPattern("^\\+[1-9][0-9]{6,14}$", {minLength: 8, maxLength: 16}),null,]), telegram: faker.helpers.arrayElement([fakeFromPattern("^@[A-Za-z0-9_]{5,32}$", {minLength: 6, maxLength: 33}),null,])}, representatives: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({name: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}), job_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100})})), verification: {level: faker.helpers.arrayElement(['e0','e1','e2','e3'] as const), basis: faker.helpers.arrayElement(['confirmed_email','corporate_domain','requisites_and_authority','manual_review','partner_status'] as const), changed_at: faker.date.past().toISOString().slice(0, 19) + 'Z'}, candidate_card: {id: faker.string.uuid(), name: fakeFromPattern("^\\S(?:[^\\n\\r]*\\S)?$", {minLength: 1, maxLength: 200}), description: faker.helpers.arrayElement([faker.string.alpha({length: {min: 1, max: 2000}}),null,]), sphere: faker.helpers.arrayElement([fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}),null,]), contacts: {website: faker.helpers.arrayElement([fakeFromPattern("^https://[^\\s/?#@]+(?:[/?#][^\\s]*)?$", {minLength: 9, maxLength: 300}),null,]), email: faker.helpers.arrayElement([faker.internet.email(),null,]), phone: faker.helpers.arrayElement([fakeFromPattern("^\\+[1-9][0-9]{6,14}$", {minLength: 8, maxLength: 16}),null,]), telegram: faker.helpers.arrayElement([fakeFromPattern("^@[A-Za-z0-9_]{5,32}$", {minLength: 6, maxLength: 33}),null,])}, representatives: faker.helpers.arrayElement([Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({name: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100}), job_title: fakeFromPattern("^\\S(?:.*\\S)?$", {minLength: 1, maxLength: 100})})), null]), verification_level: faker.helpers.arrayElement(['e0','e1','e2','e3'] as const)}, created_at: faker.date.past().toISOString().slice(0, 19) + 'Z', updated_at: faker.date.past().toISOString().slice(0, 19) + 'Z', ...overrideResponse})
export const getSearchOrganizationMatchesResponseMatchSearchNeedSourceMock = (overrideResponse: Partial<MatchSearchNeedSource> = {}): MatchSearchNeedSource => ({...{kind: faker.helpers.arrayElement(['need'] as const), need_id: faker.string.uuid(), requirements_version: faker.number.int({min: 1})}, ...overrideResponse});
export const getSearchOrganizationMatchesResponseMatchGradeFilterMock = (overrideResponse: Partial<MatchGradeFilter> = {}): MatchGradeFilter => ({...{specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const)}, ...overrideResponse});
export const getSearchOrganizationMatchesResponseMatchAppliedConditionsMock = (overrideResponse: Partial<MatchAppliedConditions> = {}): MatchAppliedConditions => ({...{work_formats: faker.helpers.arrayElement([faker.helpers.arrayElements(['remote','office','hybrid'] as const),null,]), salary_compatibility: faker.helpers.arrayElement([faker.helpers.arrayElement(['compatible','not_compatible'] as const),null,])}, ...overrideResponse});
export const getSearchOrganizationMatchesResponseMatchSearchBankSourceMock = (overrideResponse: Partial<MatchSearchBankSource> = {}): MatchSearchBankSource => ({...{kind: faker.helpers.arrayElement(['bank'] as const), filters: {specialization: faker.helpers.arrayElement([faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const),null,]), confirmed_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), confirmed_category: faker.helpers.arrayElement([{...getSearchOrganizationMatchesResponseMatchGradeFilterMock()},null,]), confirmation_status: faker.helpers.arrayElement([faker.helpers.arrayElement(['confirmed','unconfirmed'] as const),null,]), declared_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), stack: faker.helpers.arrayElement([faker.helpers.arrayElements(['go','postgresql','kafka','docker'] as const),null,]), conditions: faker.helpers.arrayElement([{...getSearchOrganizationMatchesResponseMatchAppliedConditionsMock()},null,])}}, ...overrideResponse});
export const getSearchOrganizationMatchesResponseMock = (overrideResponse: Partial<Extract<MatchSearchResponse, object>> = {}): MatchSearchResponse => ({source: faker.helpers.arrayElement([{...getSearchOrganizationMatchesResponseMatchSearchNeedSourceMock()},{...getSearchOrganizationMatchesResponseMatchSearchBankSourceMock()},]), groups: {main: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({candidate_handle: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), confirmation_status: faker.helpers.arrayElement(['confirmed'] as const), declared_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), category: {specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const)}, strength: faker.helpers.arrayElement(['standard','strong'] as const), public_context: {stack: faker.helpers.arrayElement([faker.helpers.arrayElements(['go','postgresql','kafka','docker'] as const),null,]), experience_band: faker.helpers.arrayElement([faker.helpers.arrayElement(['0_1','1_3','3_6','6_plus','0_3','3_plus'] as const),null,]), work_formats: faker.helpers.arrayElement([faker.helpers.arrayElements(['remote','office','hybrid'] as const),null,]), salary_compatibility: faker.helpers.arrayElement([faker.helpers.arrayElement(['compatible','not_compatible'] as const),null,])}, evidence_summary: Array.from({ length: faker.number.int({min: 1, max: 12}) }, (_, i) => i + 1).map(() => ({code: faker.helpers.arrayElement(['confirmed_category','required_skill_evidence','desired_skill_evidence','domain_alignment','task_alignment','work_conditions_match','salary_compatibility','declared_grade'] as const), state: faker.helpers.arrayElement(['supports','partial','gap','declared_only'] as const)})), components: {fit: faker.number.float({min: 0, max: 1, fractionDigits: 2}), coverage: faker.number.float({min: 0, max: 1, fractionDigits: 2}), domain: faker.number.float({min: 0, max: 1, fractionDigits: 2}), semantics: faker.number.float({min: 0, max: 1, fractionDigits: 2}), percentile: faker.helpers.arrayElement([faker.number.float({min: 0, max: 1, fractionDigits: 2}),null,]), competition: faker.number.float({min: 0, max: 1, fractionDigits: 2}), freshness: faker.number.float({min: 0, max: 1, fractionDigits: 2}), responsiveness: faker.number.float({min: 0, max: 1, fractionDigits: 2}), rank_score: faker.number.float({min: 0, max: 1, fractionDigits: 2})}, unknown_flags: Array.from({ length: faker.number.int({min: 1, max: 9}) }, (_, i) => i + 1).map(() => ({component: faker.helpers.arrayElement(['semantics','percentile','assessment','freshness','responsiveness','experience_band','work_formats','salary_compatibility','domain'] as const), reason: faker.helpers.arrayElement(['ml_unavailable','cohort_below_30','no_confirmation_for_specialization','not_in_public_card','need_field_unconfirmed','no_freshness_history','no_response_history'] as const)}))})), near: Array.from({ length: faker.number.int({min: 1, max: 10}) }, (_, i) => i + 1).map(() => ({candidate_handle: fakeFromPattern("^cv1_[A-Za-z0-9_-]{43}$", {minLength: 47, maxLength: 47}), specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), confirmation_status: faker.helpers.arrayElement(['confirmed'] as const), declared_grade: faker.helpers.arrayElement([faker.helpers.arrayElement(['intern','junior','middle','senior'] as const),null,]), category: {specialization: faker.helpers.arrayElement(['backend','frontend','mobile','network_engineer','devops_sre','data_analyst','ds_ml','information_security','qa'] as const), grade: faker.helpers.arrayElement(['intern','junior','middle','senior'] as const)}, strength: faker.helpers.arrayElement(['standard','strong'] as const), public_context: {stack: faker.helpers.arrayElement([faker.helpers.arrayElements(['go','postgresql','kafka','docker'] as const),null,]), experience_band: faker.helpers.arrayElement([faker.helpers.arrayElement(['0_1','1_3','3_6','6_plus','0_3','3_plus'] as const),null,]), work_formats: faker.helpers.arrayElement([faker.helpers.arrayElements(['remote','office','hybrid'] as const),null,]), salary_compatibility: faker.helpers.arrayElement([faker.helpers.arrayElement(['compatible','not_compatible'] as const),null,])}, evidence_summary: Array.from({ length: faker.number.int({min: 1, max: 12}) }, (_, i) => i + 1).map(() => ({code: faker.helpers.arrayElement(['confirmed_category','required_skill_evidence','desired_skill_evidence','domain_alignment','task_alignment','work_Line truncated
export const getListMyOrganizationsMockHandler = (overrideResponse?: MyOrganizationList | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Promise<MyOrganizationList> | MyOrganizationList), options?: RequestHandlerOptions) => {
return http.get('*/api/v1/me/organizations', async (info: Parameters<Parameters<typeof http.get>[1]>[0]) => {
@@ -82,9 +97,22 @@ export const getUpdateOrganizationMockHandler = (overrideResponse?: Organization
})
}, options)
}
export const getSearchOrganizationMatchesMockHandler = (overrideResponse?: MatchSearchResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Promise<MatchSearchResponse> | MatchSearchResponse), options?: RequestHandlerOptions) => {
return http.post('*/api/v1/organizations/:orgId/matches', async (info: Parameters<Parameters<typeof http.post>[1]>[0]) => {
return HttpResponse.json(overrideResponse !== undefined
? (typeof overrideResponse === "function" ? await overrideResponse(info) : overrideResponse)
: getSearchOrganizationMatchesResponseMock(),
{ status: 200
})
}, options)
}
export const getOrganizationMock = () => [
getListMyOrganizationsMockHandler(),
getCreateOrganizationMockHandler(),
getGetOrganizationMockHandler(),
getUpdateOrganizationMockHandler()
getUpdateOrganizationMockHandler(),
getSearchOrganizationMatchesMockHandler()
]
@@ -26,6 +26,8 @@ import type {
import type {
CreateOrganizationHeaders,
ListMyOrganizationsParams,
MatchSearchRequest,
MatchSearchResponse,
MyOrganizationList,
Organization,
OrganizationCreate,
@@ -467,3 +469,100 @@ export const useUpdateOrganization = <TError = ErrorType<Problem>,
> => {
return useMutation(getUpdateOrganizationMutationOptions(options), queryClient);
}
export const getSearchOrganizationMatchesUrl = (orgId: string,) => {
return `/api/v1/organizations/${orgId}/matches`
}
/**
* Requires the session cookie of an employer account with an active owner membership in `org_id`, the CSRF token of that session in X-CSRF-Token, and an allowed Origin. The organization comes from the path and the active server-side membership. Hidden profiles, revoked or missing C2 publication, and the organization's visibility restrictions are applied before any result is returned.
*
* The body selects either a Need's `requirements_version` snapshot or the current organization-visible bank with explicit filters. A need reference uses `Need.requirements_version`, not the general `Need.version`; title or suggestion-only edits do not change the confirmed-requirements snapshot. An empty bank filter searches all otherwise eligible specializations, returning each specialization separately.
*
* Every entry is one candidate specialization. A confirmed result in Backend never confirms Networks for the same candidate. The `main`, `near`, and `unconfirmed` arrays are separate groups. A confirmed category with required-skill coverage below 0.25 belongs to `near`; other confirmed entries belong to `main` (FR09). Entries in `unconfirmed` are ordered by Fit, then coverage, then a stable internal tie-breaker that is never returned. Their category and strength remain null, and they have no theta, T, P, or test percentile. The search result uses the organization-scoped opaque `candidate_handle` as its display pseudonym and invitation reference, never a candidate account or profile identifier.
*
* 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`.
*
* 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 not_found. The response is `Cache-Control: no-store`.
* @summary Search the current organization-visible candidate bank.
*/
export const searchOrganizationMatches = async (orgId: string,
matchSearchRequest: MatchSearchRequest, options?: Parameters<typeof apiRequest>[1]): Promise<MatchSearchResponse> => {
const getHeaders = (h?: NonNullable<RequestInit['headers']>): Record<string, string | readonly string[]> => {
if (!h) return {};
if (h instanceof Headers) return Object.fromEntries(h.entries());
if (Symbol.iterator in h) {
return Object.fromEntries(
Array.from(h as Iterable<Iterable<string>>, (entry) => Array.from(entry) as [string, string]),
);
}
const headers: Record<string, string | readonly string[]> = {};
for (const [name, value] of Object.entries<string | readonly string[] | undefined>(h)) {
if (value !== undefined) headers[name] = value;
}
return headers;
};
return apiRequest<MatchSearchResponse>(getSearchOrganizationMatchesUrl(orgId),
{
...options,
method: 'POST',
headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },
body: JSON.stringify(matchSearchRequest)
}
);}
export const getSearchOrganizationMatchesMutationKey = () => ['searchOrganizationMatches'] as const;
export const getSearchOrganizationMatchesMutationOptions = <TError = ErrorType<Problem>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof searchOrganizationMatches>>, TError,SearchOrganizationMatchesMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
): UseMutationOptions<Awaited<ReturnType<typeof searchOrganizationMatches>>, TError,SearchOrganizationMatchesMutationVariables, TContext> => {
const mutationKey = getSearchOrganizationMatchesMutationKey();
const {mutation: mutationOptions, request: requestOptions} = options ?
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
options
: {...options, mutation: {...options.mutation, mutationKey}}
: {mutation: { mutationKey, }, request: undefined};
const mutationFn: MutationFunction<Awaited<ReturnType<typeof searchOrganizationMatches>>, SearchOrganizationMatchesMutationVariables> = (props) => {
const {orgId,data} = props ?? {};
return searchOrganizationMatches(orgId,data,requestOptions)
}
return { mutationFn, ...mutationOptions }}
export type SearchOrganizationMatchesMutationResult = NonNullable<Awaited<ReturnType<typeof searchOrganizationMatches>>>
export type SearchOrganizationMatchesMutationBody = MatchSearchRequest
export type SearchOrganizationMatchesMutationError = ErrorType<Problem>
export type SearchOrganizationMatchesMutationVariables = {orgId: string;data: MatchSearchRequest}
/**
* @summary Search the current organization-visible candidate bank.
*/
export const useSearchOrganizationMatches = <TError = ErrorType<Problem>,
TContext = unknown>(options?: { mutation?:UseMutationOptions<Awaited<ReturnType<typeof searchOrganizationMatches>>, TError,SearchOrganizationMatchesMutationVariables, TContext>, request?: SecondParameter<typeof apiRequest>}
, queryClient?: QueryClient): UseMutationResult<
Awaited<ReturnType<typeof searchOrganizationMatches>>,
TError,
SearchOrganizationMatchesMutationVariables,
TContext
> => {
return useMutation(getSearchOrganizationMatchesMutationOptions(options), queryClient);
}
+3
View File
@@ -5,6 +5,9 @@
* OpenAPI spec version: 0.1.0
*/
export * from './candidateExperienceBand.zod';
export * from './candidateHandle.zod';
export * from './candidateSalaryCompatibility.zod';
export * from './consentPurposeCode.zod';
export * from './consentText.zod';
export * from './consentTextVersion.zod';
@@ -9,7 +9,6 @@ export * from './acceptMyInvitationBody.zod';
export * from './acceptMyInvitationHeaders.zod';
export * from './cancelMyInvitationBody.zod';
export * from './cancelMyInvitationHeaders.zod';
export * from './candidateHandle.zod';
export * from './candidateInvitation.zod';
export * from './candidateInvitationList.zod';
export * from './candidateInvitationSummary.zod';
@@ -9,6 +9,39 @@ export * from './candidateOrganizationCard.zod';
export * from './createOrganizationBody.zod';
export * from './createOrganizationHeaders.zod';
export * from './listMyOrganizationsParams.zod';
export * from './matchAppliedConditions.zod';
export * from './matchAppliedFilters.zod';
export * from './matchCategory.zod';
export * from './matchConfirmationStatus.zod';
export * from './matchConfirmedCandidate.zod';
export * from './matchConfirmedComponents.zod';
export * from './matchEvidenceCode.zod';
export * from './matchEvidenceState.zod';
export * from './matchEvidenceSummary.zod';
export * from './matchEvidenceSummaryItem.zod';
export * from './matchGradeFilter.zod';
export * from './matchNullableScore.zod';
export * from './matchPublicContext.zod';
export * from './matchPublicStack.zod';
export * from './matchScore.zod';
export * from './matchSearchBankSource.zod';
export * from './matchSearchByBank.zod';
export * from './matchSearchByNeed.zod';
export * from './matchSearchConditions.zod';
export * from './matchSearchFilters.zod';
export * from './matchSearchGroups.zod';
export * from './matchSearchNeedSource.zod';
export * from './matchSearchRequest.zod';
export * from './matchSearchResponse.zod';
export * from './matchSearchSource.zod';
export * from './matchSearchStackTag.zod';
export * from './matchStrength.zod';
export * from './matchUnconfirmedCandidate.zod';
export * from './matchUnconfirmedComponents.zod';
export * from './matchUnknownComponent.zod';
export * from './matchUnknownFlag.zod';
export * from './matchUnknownFlags.zod';
export * from './matchUnknownReason.zod';
export * from './membershipState.zod';
export * from './myOrganization.zod';
export * from './myOrganizationList.zod';
@@ -28,4 +61,5 @@ export * from './organizationVerificationBasis.zod';
export * from './organizationVerificationLevel.zod';
export * from './organizationVersion.zod';
export * from './organizationWebsite.zod';
export * from './searchOrganizationMatchesBody.zod';
export * from './updateOrganizationBody.zod';
@@ -0,0 +1,18 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const matchAppliedConditionsWorkFormatsOneMax = 3;
export const MatchAppliedConditions = zod.object({
"work_formats": zod.union([zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).min(1).max(matchAppliedConditionsWorkFormatsOneMax),zod.null()]),
"salary_compatibility": zod.union([zod.enum(['compatible', 'not_compatible']).describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.'),zod.null()])
}).describe('Conditions echoed as a complete snapshot; null means no filter.')
export type MatchAppliedConditions = zod.input<typeof MatchAppliedConditions>;
export type MatchAppliedConditionsOutput = zod.output<typeof MatchAppliedConditions>;
@@ -0,0 +1,31 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const matchAppliedFiltersStackOneMax = 4;
export const matchAppliedFiltersConditionsOneWorkFormatsOneMax = 3;
export const MatchAppliedFilters = zod.object({
"specialization": zod.union([zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),zod.null()]),
"confirmed_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]),
"confirmed_category": zod.union([zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
}).describe('A confirmed category filter, never a candidate declaration.'),zod.null()]),
"confirmation_status": zod.union([zod.enum(['confirmed', 'unconfirmed']).describe('Confirmation state for this specialization only. A result for one specialization never changes the state of another specialization.'),zod.null()]),
"declared_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]),
"stack": zod.union([zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).min(1).max(matchAppliedFiltersStackOneMax),zod.null()]),
"conditions": zod.union([zod.object({
"work_formats": zod.union([zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).min(1).max(matchAppliedFiltersConditionsOneWorkFormatsOneMax),zod.null()]),
"salary_compatibility": zod.union([zod.enum(['compatible', 'not_compatible']).describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.'),zod.null()])
}).describe('Conditions echoed as a complete snapshot; null means no filter.'),zod.null()])
}).describe('A normalized response snapshot of the bank filters. Each key is present; null means the corresponding request filter was omitted. This keeps a search result tied to its exact filter basis.')
export type MatchAppliedFilters = zod.input<typeof MatchAppliedFilters>;
export type MatchAppliedFiltersOutput = zod.output<typeof MatchAppliedFilters>;
@@ -0,0 +1,15 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const MatchCategory = zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
}).describe('A confirmed category. Its specialization must equal the enclosing match entry\'s specialization.')
export type MatchCategory = zod.input<typeof MatchCategory>;
export type MatchCategoryOutput = zod.output<typeof MatchCategory>;
@@ -0,0 +1,12 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const MatchConfirmationStatus = zod.enum(['confirmed', 'unconfirmed']).describe('Confirmation state for this specialization only. A result for one specialization never changes the state of another specialization.')
export type MatchConfirmationStatus = zod.input<typeof MatchConfirmationStatus>;
export type MatchConfirmationStatusOutput = zod.output<typeof MatchConfirmationStatus>;
@@ -0,0 +1,88 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const matchConfirmedCandidateCandidateHandleMin = 47;
export const matchConfirmedCandidateCandidateHandleMax = 47;
export const matchConfirmedCandidateCandidateHandleRegExp = new RegExp('^cv1_[A-Za-z0-9_-]{43}$');
export const matchConfirmedCandidatePublicContextStackOneMax = 4;
export const matchConfirmedCandidatePublicContextWorkFormatsOneMax = 3;
export const matchConfirmedCandidateEvidenceSummaryMax = 12;
export const matchConfirmedCandidateComponentsFitMin = 0;
export const matchConfirmedCandidateComponentsFitMax = 1;
export const matchConfirmedCandidateComponentsCoverageMin = 0;
export const matchConfirmedCandidateComponentsCoverageMax = 1;
export const matchConfirmedCandidateComponentsDomainMin = 0;
export const matchConfirmedCandidateComponentsDomainMax = 1;
export const matchConfirmedCandidateComponentsSemanticsMin = 0;
export const matchConfirmedCandidateComponentsSemanticsMax = 1;
export const matchConfirmedCandidateComponentsPercentileOneMin = 0;
export const matchConfirmedCandidateComponentsPercentileOneMax = 1;
export const matchConfirmedCandidateComponentsCompetitionMin = 0;
export const matchConfirmedCandidateComponentsCompetitionMax = 1;
export const matchConfirmedCandidateComponentsFreshnessMin = 0;
export const matchConfirmedCandidateComponentsFreshnessMax = 1;
export const matchConfirmedCandidateComponentsResponsivenessMin = 0;
export const matchConfirmedCandidateComponentsResponsivenessMax = 1;
export const matchConfirmedCandidateComponentsRankScoreMin = 0;
export const matchConfirmedCandidateComponentsRankScoreMax = 1;
export const matchConfirmedCandidateUnknownFlagsMax = 9;
export const MatchConfirmedCandidate = zod.object({
"candidate_handle": zod.string().min(matchConfirmedCandidateCandidateHandleMin).max(matchConfirmedCandidateCandidateHandleMax).regex(matchConfirmedCandidateCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from the organization-scoped anonymous card. It is a versioned HMAC alias, not a candidate account or profile identifier; it contains no contact information and is meaningless to another organization. The server resolves it only against the current visible cohort of the organization in the path. Clients never parse or construct it. It is shared by the candidate-card read and invitations.'),
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"confirmation_status": zod.enum(['confirmed']),
"declared_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Candidate-declared grade for this specialization, never a confirmation.'),
"category": zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
}).describe('A confirmed category. Its specialization must equal the enclosing match entry\'s specialization.'),
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of a confirmed assessment for this specialization.'),
"public_context": zod.object({
"stack": zod.union([zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).max(matchConfirmedCandidatePublicContextStackOneMax),zod.null()]),
"experience_band": zod.union([zod.enum(['0_1', '1_3', '3_6', '6_plus', '0_3', '3_plus']).describe('Coarse total experience bucket. Rare combinations may be generalized to 0_3 or 3_plus before they are returned.'),zod.null()]),
"work_formats": zod.union([zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).max(matchConfirmedCandidatePublicContextWorkFormatsOneMax),zod.null()]),
"salary_compatibility": zod.union([zod.enum(['compatible', 'not_compatible']).describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.'),zod.null()])
}).describe('Safe anonymous-card context only. A null value means that the value is not in the public card or is not present; the response does not reveal which. It contains no contact, candidate location, or salary amount.'),
"evidence_summary": zod.array(zod.object({
"code": zod.enum(['confirmed_category', 'required_skill_evidence', 'desired_skill_evidence', 'domain_alignment', 'task_alignment', 'work_conditions_match', 'salary_compatibility', 'declared_grade']).describe('Template code for an explanation derived from allowed evidence. It carries no free text, raw answer, or reason for withheld FSP data.'),
"state": zod.enum(['supports', 'partial', 'gap', 'declared_only'])
}).describe('A templated, non-text evidence explanation.')).max(matchConfirmedCandidateEvidenceSummaryMax),
"components": zod.object({
"fit": zod.number().min(matchConfirmedCandidateComponentsFitMin).max(matchConfirmedCandidateComponentsFitMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"coverage": zod.number().min(matchConfirmedCandidateComponentsCoverageMin).max(matchConfirmedCandidateComponentsCoverageMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"domain": zod.number().min(matchConfirmedCandidateComponentsDomainMin).max(matchConfirmedCandidateComponentsDomainMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"semantics": zod.number().min(matchConfirmedCandidateComponentsSemanticsMin).max(matchConfirmedCandidateComponentsSemanticsMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"percentile": zod.union([zod.number().min(matchConfirmedCandidateComponentsPercentileOneMin).max(matchConfirmedCandidateComponentsPercentileOneMax),zod.null()]).describe('A score from a versioned ranking component, or null when it is not available. Any null component has a matching bounded entry in `unknown_flags`.'),
"competition": zod.number().min(matchConfirmedCandidateComponentsCompetitionMin).max(matchConfirmedCandidateComponentsCompetitionMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"freshness": zod.number().min(matchConfirmedCandidateComponentsFreshnessMin).max(matchConfirmedCandidateComponentsFreshnessMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"responsiveness": zod.number().min(matchConfirmedCandidateComponentsResponsivenessMin).max(matchConfirmedCandidateComponentsResponsivenessMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"rank_score": zod.number().min(matchConfirmedCandidateComponentsRankScoreMin).max(matchConfirmedCandidateComponentsRankScoreMax).describe('A normalized FR09 ranking component from 0 to 1.')
}).describe('Components from the FR09 ranking model for a confirmed category. `percentile` is null when fewer than 30 comparable real candidates are available; the ranking uses neutral T = 0.5 and does not publish a percentile. If ML is unavailable, `semantics` uses neutral 0.5 and the reason appears in `unknown_flags`.'),
"unknown_flags": zod.array(zod.object({
"component": zod.enum(['semantics', 'percentile', 'assessment', 'freshness', 'responsiveness', 'experience_band', 'work_formats', 'salary_compatibility', 'domain']).describe('Ranking or public-card component whose value is unknown.'),
"reason": zod.enum(['ml_unavailable', 'cohort_below_30', 'no_confirmation_for_specialization', 'not_in_public_card', 'need_field_unconfirmed', 'no_freshness_history', 'no_response_history']).describe('Bounded explanation for an unknown component, not a hiding reason.')
}).describe('A safe, bounded explanation for one unavailable component.')).max(matchConfirmedCandidateUnknownFlagsMax)
}).describe('One confirmed specialization entry in the `main` or `near` group. The group containing it supplies the group label. A candidate may have a separate entry for another specialization.')
export type MatchConfirmedCandidate = zod.input<typeof MatchConfirmedCandidate>;
export type MatchConfirmedCandidateOutput = zod.output<typeof MatchConfirmedCandidate>;
@@ -0,0 +1,50 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const matchConfirmedComponentsFitMin = 0;
export const matchConfirmedComponentsFitMax = 1;
export const matchConfirmedComponentsCoverageMin = 0;
export const matchConfirmedComponentsCoverageMax = 1;
export const matchConfirmedComponentsDomainMin = 0;
export const matchConfirmedComponentsDomainMax = 1;
export const matchConfirmedComponentsSemanticsMin = 0;
export const matchConfirmedComponentsSemanticsMax = 1;
export const matchConfirmedComponentsPercentileOneMin = 0;
export const matchConfirmedComponentsPercentileOneMax = 1;
export const matchConfirmedComponentsCompetitionMin = 0;
export const matchConfirmedComponentsCompetitionMax = 1;
export const matchConfirmedComponentsFreshnessMin = 0;
export const matchConfirmedComponentsFreshnessMax = 1;
export const matchConfirmedComponentsResponsivenessMin = 0;
export const matchConfirmedComponentsResponsivenessMax = 1;
export const matchConfirmedComponentsRankScoreMin = 0;
export const matchConfirmedComponentsRankScoreMax = 1;
export const MatchConfirmedComponents = zod.object({
"fit": zod.number().min(matchConfirmedComponentsFitMin).max(matchConfirmedComponentsFitMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"coverage": zod.number().min(matchConfirmedComponentsCoverageMin).max(matchConfirmedComponentsCoverageMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"domain": zod.number().min(matchConfirmedComponentsDomainMin).max(matchConfirmedComponentsDomainMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"semantics": zod.number().min(matchConfirmedComponentsSemanticsMin).max(matchConfirmedComponentsSemanticsMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"percentile": zod.union([zod.number().min(matchConfirmedComponentsPercentileOneMin).max(matchConfirmedComponentsPercentileOneMax),zod.null()]).describe('A score from a versioned ranking component, or null when it is not available. Any null component has a matching bounded entry in `unknown_flags`.'),
"competition": zod.number().min(matchConfirmedComponentsCompetitionMin).max(matchConfirmedComponentsCompetitionMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"freshness": zod.number().min(matchConfirmedComponentsFreshnessMin).max(matchConfirmedComponentsFreshnessMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"responsiveness": zod.number().min(matchConfirmedComponentsResponsivenessMin).max(matchConfirmedComponentsResponsivenessMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"rank_score": zod.number().min(matchConfirmedComponentsRankScoreMin).max(matchConfirmedComponentsRankScoreMax).describe('A normalized FR09 ranking component from 0 to 1.')
}).describe('Components from the FR09 ranking model for a confirmed category. `percentile` is null when fewer than 30 comparable real candidates are available; the ranking uses neutral T = 0.5 and does not publish a percentile. If ML is unavailable, `semantics` uses neutral 0.5 and the reason appears in `unknown_flags`.')
export type MatchConfirmedComponents = zod.input<typeof MatchConfirmedComponents>;
export type MatchConfirmedComponentsOutput = zod.output<typeof MatchConfirmedComponents>;
@@ -0,0 +1,12 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const MatchEvidenceCode = zod.enum(['confirmed_category', 'required_skill_evidence', 'desired_skill_evidence', 'domain_alignment', 'task_alignment', 'work_conditions_match', 'salary_compatibility', 'declared_grade']).describe('Template code for an explanation derived from allowed evidence. It carries no free text, raw answer, or reason for withheld FSP data.')
export type MatchEvidenceCode = zod.input<typeof MatchEvidenceCode>;
export type MatchEvidenceCodeOutput = zod.output<typeof MatchEvidenceCode>;
@@ -0,0 +1,12 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const MatchEvidenceState = zod.enum(['supports', 'partial', 'gap', 'declared_only'])
export type MatchEvidenceState = zod.input<typeof MatchEvidenceState>;
export type MatchEvidenceStateOutput = zod.output<typeof MatchEvidenceState>;
@@ -0,0 +1,18 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const MatchEvidenceSummaryMax = 12;
export const MatchEvidenceSummary = zod.array(zod.object({
"code": zod.enum(['confirmed_category', 'required_skill_evidence', 'desired_skill_evidence', 'domain_alignment', 'task_alignment', 'work_conditions_match', 'salary_compatibility', 'declared_grade']).describe('Template code for an explanation derived from allowed evidence. It carries no free text, raw answer, or reason for withheld FSP data.'),
"state": zod.enum(['supports', 'partial', 'gap', 'declared_only'])
}).describe('A templated, non-text evidence explanation.')).max(MatchEvidenceSummaryMax)
export type MatchEvidenceSummary = zod.input<typeof MatchEvidenceSummary>;
export type MatchEvidenceSummaryOutput = zod.output<typeof MatchEvidenceSummary>;
@@ -0,0 +1,15 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const MatchEvidenceSummaryItem = zod.object({
"code": zod.enum(['confirmed_category', 'required_skill_evidence', 'desired_skill_evidence', 'domain_alignment', 'task_alignment', 'work_conditions_match', 'salary_compatibility', 'declared_grade']).describe('Template code for an explanation derived from allowed evidence. It carries no free text, raw answer, or reason for withheld FSP data.'),
"state": zod.enum(['supports', 'partial', 'gap', 'declared_only'])
}).describe('A templated, non-text evidence explanation.')
export type MatchEvidenceSummaryItem = zod.input<typeof MatchEvidenceSummaryItem>;
export type MatchEvidenceSummaryItemOutput = zod.output<typeof MatchEvidenceSummaryItem>;
@@ -0,0 +1,15 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const MatchGradeFilter = zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
}).describe('A confirmed category filter, never a candidate declaration.')
export type MatchGradeFilter = zod.input<typeof MatchGradeFilter>;
export type MatchGradeFilterOutput = zod.output<typeof MatchGradeFilter>;
@@ -0,0 +1,16 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const matchNullableScoreOneMin = 0;
export const matchNullableScoreOneMax = 1;
export const MatchNullableScore = zod.union([zod.number().min(matchNullableScoreOneMin).max(matchNullableScoreOneMax),zod.null()]).describe('A score from a versioned ranking component, or null when it is not available. Any null component has a matching bounded entry in `unknown_flags`.')
export type MatchNullableScore = zod.input<typeof MatchNullableScore>;
export type MatchNullableScoreOutput = zod.output<typeof MatchNullableScore>;
@@ -0,0 +1,22 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const matchPublicContextStackOneMax = 4;
export const matchPublicContextWorkFormatsOneMax = 3;
export const MatchPublicContext = zod.object({
"stack": zod.union([zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).max(matchPublicContextStackOneMax),zod.null()]),
"experience_band": zod.union([zod.enum(['0_1', '1_3', '3_6', '6_plus', '0_3', '3_plus']).describe('Coarse total experience bucket. Rare combinations may be generalized to 0_3 or 3_plus before they are returned.'),zod.null()]),
"work_formats": zod.union([zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).max(matchPublicContextWorkFormatsOneMax),zod.null()]),
"salary_compatibility": zod.union([zod.enum(['compatible', 'not_compatible']).describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.'),zod.null()])
}).describe('Safe anonymous-card context only. A null value means that the value is not in the public card or is not present; the response does not reveal which. It contains no contact, candidate location, or salary amount.')
export type MatchPublicContext = zod.input<typeof MatchPublicContext>;
export type MatchPublicContextOutput = zod.output<typeof MatchPublicContext>;
@@ -0,0 +1,15 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const MatchPublicStackMax = 4;
export const MatchPublicStack = zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).max(MatchPublicStackMax)
export type MatchPublicStack = zod.input<typeof MatchPublicStack>;
export type MatchPublicStackOutput = zod.output<typeof MatchPublicStack>;
@@ -0,0 +1,16 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const MatchScoreMin = 0;
export const MatchScoreMax = 1;
export const MatchScore = zod.number().min(MatchScoreMin).max(MatchScoreMax).describe('A normalized FR09 ranking component from 0 to 1.')
export type MatchScore = zod.input<typeof MatchScore>;
export type MatchScoreOutput = zod.output<typeof MatchScore>;
@@ -0,0 +1,34 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const matchSearchBankSourceFiltersStackOneMax = 4;
export const matchSearchBankSourceFiltersConditionsOneWorkFormatsOneMax = 3;
export const MatchSearchBankSource = zod.object({
"kind": zod.enum(['bank']),
"filters": zod.object({
"specialization": zod.union([zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),zod.null()]),
"confirmed_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]),
"confirmed_category": zod.union([zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
}).describe('A confirmed category filter, never a candidate declaration.'),zod.null()]),
"confirmation_status": zod.union([zod.enum(['confirmed', 'unconfirmed']).describe('Confirmation state for this specialization only. A result for one specialization never changes the state of another specialization.'),zod.null()]),
"declared_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]),
"stack": zod.union([zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).min(1).max(matchSearchBankSourceFiltersStackOneMax),zod.null()]),
"conditions": zod.union([zod.object({
"work_formats": zod.union([zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).min(1).max(matchSearchBankSourceFiltersConditionsOneWorkFormatsOneMax),zod.null()]),
"salary_compatibility": zod.union([zod.enum(['compatible', 'not_compatible']).describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.'),zod.null()])
}).describe('Conditions echoed as a complete snapshot; null means no filter.'),zod.null()])
}).describe('A normalized response snapshot of the bank filters. Each key is present; null means the corresponding request filter was omitted. This keeps a search result tied to its exact filter basis.')
}).describe('The normalized filters used for a bank search.')
export type MatchSearchBankSource = zod.input<typeof MatchSearchBankSource>;
export type MatchSearchBankSourceOutput = zod.output<typeof MatchSearchBankSource>;
@@ -0,0 +1,33 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const matchSearchByBankFiltersStackMax = 4;
export const matchSearchByBankFiltersConditionsWorkFormatsMax = 3;
export const MatchSearchByBank = zod.object({
"filters": zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).exactOptional().describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"confirmed_grade": zod.enum(['intern', 'junior', 'middle', 'senior']).exactOptional().describe('Match only candidates with this currently confirmed grade in the selected specialization. It never matches a declared grade.'),
"confirmed_category": zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
}).exactOptional().describe('A confirmed category filter, never a candidate declaration.'),
"confirmation_status": zod.enum(['confirmed', 'unconfirmed']).exactOptional().describe('Confirmation state for this specialization only. A result for one specialization never changes the state of another specialization.'),
"declared_grade": zod.enum(['intern', 'junior', 'middle', 'senior']).exactOptional().describe('Candidate-declared grade filter. This is a separate claim and cannot satisfy `confirmed_grade` or `confirmed_category`.'),
"stack": zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).min(1).max(matchSearchByBankFiltersStackMax).exactOptional(),
"conditions": zod.object({
"work_formats": zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).min(1).max(matchSearchByBankFiltersConditionsWorkFormatsMax).exactOptional(),
"salary_compatibility": zod.enum(['compatible', 'not_compatible']).exactOptional().describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.')
}).exactOptional().describe('Filters against safe, coarse card conditions. No candidate location, salary amount, salary minimum, or salary range is accepted.')
}).describe('Optional filters over the current organization-visible bank. An empty object means no additional filter. Confirmed and declared grades are separate fields; a declaration never satisfies a confirmed-grade or category filter. Conditions use only the safe, coarse card fields.')
}).describe('Search the current organization-visible bank. An empty `filters` object includes all otherwise eligible specializations as separate entries.')
export type MatchSearchByBank = zod.input<typeof MatchSearchByBank>;
export type MatchSearchByBankOutput = zod.output<typeof MatchSearchByBank>;
@@ -0,0 +1,36 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const matchSearchByNeedFiltersStackMax = 4;
export const matchSearchByNeedFiltersConditionsWorkFormatsMax = 3;
export const MatchSearchByNeed = zod.object({
"need_id": zod.uuid().describe('Need owned by the organization in the path.'),
"requirements_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.'),
"filters": zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).exactOptional().describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"confirmed_grade": zod.enum(['intern', 'junior', 'middle', 'senior']).exactOptional().describe('Match only candidates with this currently confirmed grade in the selected specialization. It never matches a declared grade.'),
"confirmed_category": zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
}).exactOptional().describe('A confirmed category filter, never a candidate declaration.'),
"confirmation_status": zod.enum(['confirmed', 'unconfirmed']).exactOptional().describe('Confirmation state for this specialization only. A result for one specialization never changes the state of another specialization.'),
"declared_grade": zod.enum(['intern', 'junior', 'middle', 'senior']).exactOptional().describe('Candidate-declared grade filter. This is a separate claim and cannot satisfy `confirmed_grade` or `confirmed_category`.'),
"stack": zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).min(1).max(matchSearchByNeedFiltersStackMax).exactOptional(),
"conditions": zod.object({
"work_formats": zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).min(1).max(matchSearchByNeedFiltersConditionsWorkFormatsMax).exactOptional(),
"salary_compatibility": zod.enum(['compatible', 'not_compatible']).exactOptional().describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.')
}).exactOptional().describe('Filters against safe, coarse card conditions. No candidate location, salary amount, salary minimum, or salary range is accepted.')
}).exactOptional().describe('Optional filters over the current organization-visible bank. An empty object means no additional filter. Confirmed and declared grades are separate fields; a declaration never satisfies a confirmed-grade or category filter. Conditions use only the safe, coarse card fields.')
}).describe('Search one immutable set of confirmed requirements. `requirements_version` is the Need.requirements_version, not the general Need.version; text-only or suggestion-only edits do not change this search basis.')
export type MatchSearchByNeed = zod.input<typeof MatchSearchByNeed>;
export type MatchSearchByNeedOutput = zod.output<typeof MatchSearchByNeed>;
@@ -0,0 +1,18 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const matchSearchConditionsWorkFormatsMax = 3;
export const MatchSearchConditions = zod.object({
"work_formats": zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).min(1).max(matchSearchConditionsWorkFormatsMax).exactOptional(),
"salary_compatibility": zod.enum(['compatible', 'not_compatible']).exactOptional().describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.')
}).describe('Filters against safe, coarse card conditions. No candidate location, salary amount, salary minimum, or salary range is accepted.')
export type MatchSearchConditions = zod.input<typeof MatchSearchConditions>;
export type MatchSearchConditionsOutput = zod.output<typeof MatchSearchConditions>;
@@ -0,0 +1,31 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const matchSearchFiltersStackMax = 4;
export const matchSearchFiltersConditionsWorkFormatsMax = 3;
export const MatchSearchFilters = zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).exactOptional().describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"confirmed_grade": zod.enum(['intern', 'junior', 'middle', 'senior']).exactOptional().describe('Match only candidates with this currently confirmed grade in the selected specialization. It never matches a declared grade.'),
"confirmed_category": zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
}).exactOptional().describe('A confirmed category filter, never a candidate declaration.'),
"confirmation_status": zod.enum(['confirmed', 'unconfirmed']).exactOptional().describe('Confirmation state for this specialization only. A result for one specialization never changes the state of another specialization.'),
"declared_grade": zod.enum(['intern', 'junior', 'middle', 'senior']).exactOptional().describe('Candidate-declared grade filter. This is a separate claim and cannot satisfy `confirmed_grade` or `confirmed_category`.'),
"stack": zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).min(1).max(matchSearchFiltersStackMax).exactOptional(),
"conditions": zod.object({
"work_formats": zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).min(1).max(matchSearchFiltersConditionsWorkFormatsMax).exactOptional(),
"salary_compatibility": zod.enum(['compatible', 'not_compatible']).exactOptional().describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.')
}).exactOptional().describe('Filters against safe, coarse card conditions. No candidate location, salary amount, salary minimum, or salary range is accepted.')
}).describe('Optional filters over the current organization-visible bank. An empty object means no additional filter. Confirmed and declared grades are separate fields; a declaration never satisfies a confirmed-grade or category filter. Conditions use only the safe, coarse card fields.')
export type MatchSearchFilters = zod.input<typeof MatchSearchFilters>;
export type MatchSearchFiltersOutput = zod.output<typeof MatchSearchFilters>;
@@ -0,0 +1,211 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const matchSearchGroupsMainItemCandidateHandleMin = 47;
export const matchSearchGroupsMainItemCandidateHandleMax = 47;
export const matchSearchGroupsMainItemCandidateHandleRegExp = new RegExp('^cv1_[A-Za-z0-9_-]{43}$');
export const matchSearchGroupsMainItemPublicContextStackOneMax = 4;
export const matchSearchGroupsMainItemPublicContextWorkFormatsOneMax = 3;
export const matchSearchGroupsMainItemEvidenceSummaryMax = 12;
export const matchSearchGroupsMainItemComponentsFitMin = 0;
export const matchSearchGroupsMainItemComponentsFitMax = 1;
export const matchSearchGroupsMainItemComponentsCoverageMin = 0;
export const matchSearchGroupsMainItemComponentsCoverageMax = 1;
export const matchSearchGroupsMainItemComponentsDomainMin = 0;
export const matchSearchGroupsMainItemComponentsDomainMax = 1;
export const matchSearchGroupsMainItemComponentsSemanticsMin = 0;
export const matchSearchGroupsMainItemComponentsSemanticsMax = 1;
export const matchSearchGroupsMainItemComponentsPercentileOneMin = 0;
export const matchSearchGroupsMainItemComponentsPercentileOneMax = 1;
export const matchSearchGroupsMainItemComponentsCompetitionMin = 0;
export const matchSearchGroupsMainItemComponentsCompetitionMax = 1;
export const matchSearchGroupsMainItemComponentsFreshnessMin = 0;
export const matchSearchGroupsMainItemComponentsFreshnessMax = 1;
export const matchSearchGroupsMainItemComponentsResponsivenessMin = 0;
export const matchSearchGroupsMainItemComponentsResponsivenessMax = 1;
export const matchSearchGroupsMainItemComponentsRankScoreMin = 0;
export const matchSearchGroupsMainItemComponentsRankScoreMax = 1;
export const matchSearchGroupsMainItemUnknownFlagsMax = 9;
export const matchSearchGroupsNearItemCandidateHandleMin = 47;
export const matchSearchGroupsNearItemCandidateHandleMax = 47;
export const matchSearchGroupsNearItemCandidateHandleRegExp = new RegExp('^cv1_[A-Za-z0-9_-]{43}$');
export const matchSearchGroupsNearItemPublicContextStackOneMax = 4;
export const matchSearchGroupsNearItemPublicContextWorkFormatsOneMax = 3;
export const matchSearchGroupsNearItemEvidenceSummaryMax = 12;
export const matchSearchGroupsNearItemComponentsFitMin = 0;
export const matchSearchGroupsNearItemComponentsFitMax = 1;
export const matchSearchGroupsNearItemComponentsCoverageMin = 0;
export const matchSearchGroupsNearItemComponentsCoverageMax = 1;
export const matchSearchGroupsNearItemComponentsDomainMin = 0;
export const matchSearchGroupsNearItemComponentsDomainMax = 1;
export const matchSearchGroupsNearItemComponentsSemanticsMin = 0;
export const matchSearchGroupsNearItemComponentsSemanticsMax = 1;
export const matchSearchGroupsNearItemComponentsPercentileOneMin = 0;
export const matchSearchGroupsNearItemComponentsPercentileOneMax = 1;
export const matchSearchGroupsNearItemComponentsCompetitionMin = 0;
export const matchSearchGroupsNearItemComponentsCompetitionMax = 1;
export const matchSearchGroupsNearItemComponentsFreshnessMin = 0;
export const matchSearchGroupsNearItemComponentsFreshnessMax = 1;
export const matchSearchGroupsNearItemComponentsResponsivenessMin = 0;
export const matchSearchGroupsNearItemComponentsResponsivenessMax = 1;
export const matchSearchGroupsNearItemComponentsRankScoreMin = 0;
export const matchSearchGroupsNearItemComponentsRankScoreMax = 1;
export const matchSearchGroupsNearItemUnknownFlagsMax = 9;
export const matchSearchGroupsUnconfirmedItemCandidateHandleMin = 47;
export const matchSearchGroupsUnconfirmedItemCandidateHandleMax = 47;
export const matchSearchGroupsUnconfirmedItemCandidateHandleRegExp = new RegExp('^cv1_[A-Za-z0-9_-]{43}$');
export const matchSearchGroupsUnconfirmedItemPublicContextStackOneMax = 4;
export const matchSearchGroupsUnconfirmedItemPublicContextWorkFormatsOneMax = 3;
export const matchSearchGroupsUnconfirmedItemEvidenceSummaryMax = 12;
export const matchSearchGroupsUnconfirmedItemComponentsFitMin = 0;
export const matchSearchGroupsUnconfirmedItemComponentsFitMax = 1;
export const matchSearchGroupsUnconfirmedItemComponentsCoverageMin = 0;
export const matchSearchGroupsUnconfirmedItemComponentsCoverageMax = 1;
export const matchSearchGroupsUnconfirmedItemUnknownFlagsMax = 9;
export const MatchSearchGroups = zod.object({
"main": zod.array(zod.object({
"candidate_handle": zod.string().min(matchSearchGroupsMainItemCandidateHandleMin).max(matchSearchGroupsMainItemCandidateHandleMax).regex(matchSearchGroupsMainItemCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from the organization-scoped anonymous card. It is a versioned HMAC alias, not a candidate account or profile identifier; it contains no contact information and is meaningless to another organization. The server resolves it only against the current visible cohort of the organization in the path. Clients never parse or construct it. It is shared by the candidate-card read and invitations.'),
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"confirmation_status": zod.enum(['confirmed']),
"declared_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Candidate-declared grade for this specialization, never a confirmation.'),
"category": zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
}).describe('A confirmed category. Its specialization must equal the enclosing match entry\'s specialization.'),
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of a confirmed assessment for this specialization.'),
"public_context": zod.object({
"stack": zod.union([zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).max(matchSearchGroupsMainItemPublicContextStackOneMax),zod.null()]),
"experience_band": zod.union([zod.enum(['0_1', '1_3', '3_6', '6_plus', '0_3', '3_plus']).describe('Coarse total experience bucket. Rare combinations may be generalized to 0_3 or 3_plus before they are returned.'),zod.null()]),
"work_formats": zod.union([zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).max(matchSearchGroupsMainItemPublicContextWorkFormatsOneMax),zod.null()]),
"salary_compatibility": zod.union([zod.enum(['compatible', 'not_compatible']).describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.'),zod.null()])
}).describe('Safe anonymous-card context only. A null value means that the value is not in the public card or is not present; the response does not reveal which. It contains no contact, candidate location, or salary amount.'),
"evidence_summary": zod.array(zod.object({
"code": zod.enum(['confirmed_category', 'required_skill_evidence', 'desired_skill_evidence', 'domain_alignment', 'task_alignment', 'work_conditions_match', 'salary_compatibility', 'declared_grade']).describe('Template code for an explanation derived from allowed evidence. It carries no free text, raw answer, or reason for withheld FSP data.'),
"state": zod.enum(['supports', 'partial', 'gap', 'declared_only'])
}).describe('A templated, non-text evidence explanation.')).max(matchSearchGroupsMainItemEvidenceSummaryMax),
"components": zod.object({
"fit": zod.number().min(matchSearchGroupsMainItemComponentsFitMin).max(matchSearchGroupsMainItemComponentsFitMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"coverage": zod.number().min(matchSearchGroupsMainItemComponentsCoverageMin).max(matchSearchGroupsMainItemComponentsCoverageMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"domain": zod.number().min(matchSearchGroupsMainItemComponentsDomainMin).max(matchSearchGroupsMainItemComponentsDomainMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"semantics": zod.number().min(matchSearchGroupsMainItemComponentsSemanticsMin).max(matchSearchGroupsMainItemComponentsSemanticsMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"percentile": zod.union([zod.number().min(matchSearchGroupsMainItemComponentsPercentileOneMin).max(matchSearchGroupsMainItemComponentsPercentileOneMax),zod.null()]).describe('A score from a versioned ranking component, or null when it is not available. Any null component has a matching bounded entry in `unknown_flags`.'),
"competition": zod.number().min(matchSearchGroupsMainItemComponentsCompetitionMin).max(matchSearchGroupsMainItemComponentsCompetitionMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"freshness": zod.number().min(matchSearchGroupsMainItemComponentsFreshnessMin).max(matchSearchGroupsMainItemComponentsFreshnessMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"responsiveness": zod.number().min(matchSearchGroupsMainItemComponentsResponsivenessMin).max(matchSearchGroupsMainItemComponentsResponsivenessMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"rank_score": zod.number().min(matchSearchGroupsMainItemComponentsRankScoreMin).max(matchSearchGroupsMainItemComponentsRankScoreMax).describe('A normalized FR09 ranking component from 0 to 1.')
}).describe('Components from the FR09 ranking model for a confirmed category. `percentile` is null when fewer than 30 comparable real candidates are available; the ranking uses neutral T = 0.5 and does not publish a percentile. If ML is unavailable, `semantics` uses neutral 0.5 and the reason appears in `unknown_flags`.'),
"unknown_flags": zod.array(zod.object({
"component": zod.enum(['semantics', 'percentile', 'assessment', 'freshness', 'responsiveness', 'experience_band', 'work_formats', 'salary_compatibility', 'domain']).describe('Ranking or public-card component whose value is unknown.'),
"reason": zod.enum(['ml_unavailable', 'cohort_below_30', 'no_confirmation_for_specialization', 'not_in_public_card', 'need_field_unconfirmed', 'no_freshness_history', 'no_response_history']).describe('Bounded explanation for an unknown component, not a hiding reason.')
}).describe('A safe, bounded explanation for one unavailable component.')).max(matchSearchGroupsMainItemUnknownFlagsMax)
}).describe('One confirmed specialization entry in the `main` or `near` group. The group containing it supplies the group label. A candidate may have a separate entry for another specialization.')),
"near": zod.array(zod.object({
"candidate_handle": zod.string().min(matchSearchGroupsNearItemCandidateHandleMin).max(matchSearchGroupsNearItemCandidateHandleMax).regex(matchSearchGroupsNearItemCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from the organization-scoped anonymous card. It is a versioned HMAC alias, not a candidate account or profile identifier; it contains no contact information and is meaningless to another organization. The server resolves it only against the current visible cohort of the organization in the path. Clients never parse or construct it. It is shared by the candidate-card read and invitations.'),
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"confirmation_status": zod.enum(['confirmed']),
"declared_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Candidate-declared grade for this specialization, never a confirmation.'),
"category": zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
}).describe('A confirmed category. Its specialization must equal the enclosing match entry\'s specialization.'),
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of a confirmed assessment for this specialization.'),
"public_context": zod.object({
"stack": zod.union([zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).max(matchSearchGroupsNearItemPublicContextStackOneMax),zod.null()]),
"experience_band": zod.union([zod.enum(['0_1', '1_3', '3_6', '6_plus', '0_3', '3_plus']).describe('Coarse total experience bucket. Rare combinations may be generalized to 0_3 or 3_plus before they are returned.'),zod.null()]),
"work_formats": zod.union([zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).max(matchSearchGroupsNearItemPublicContextWorkFormatsOneMax),zod.null()]),
"salary_compatibility": zod.union([zod.enum(['compatible', 'not_compatible']).describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.'),zod.null()])
}).describe('Safe anonymous-card context only. A null value means that the value is not in the public card or is not present; the response does not reveal which. It contains no contact, candidate location, or salary amount.'),
"evidence_summary": zod.array(zod.object({
"code": zod.enum(['confirmed_category', 'required_skill_evidence', 'desired_skill_evidence', 'domain_alignment', 'task_alignment', 'work_conditions_match', 'salary_compatibility', 'declared_grade']).describe('Template code for an explanation derived from allowed evidence. It carries no free text, raw answer, or reason for withheld FSP data.'),
"state": zod.enum(['supports', 'partial', 'gap', 'declared_only'])
}).describe('A templated, non-text evidence explanation.')).max(matchSearchGroupsNearItemEvidenceSummaryMax),
"components": zod.object({
"fit": zod.number().min(matchSearchGroupsNearItemComponentsFitMin).max(matchSearchGroupsNearItemComponentsFitMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"coverage": zod.number().min(matchSearchGroupsNearItemComponentsCoverageMin).max(matchSearchGroupsNearItemComponentsCoverageMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"domain": zod.number().min(matchSearchGroupsNearItemComponentsDomainMin).max(matchSearchGroupsNearItemComponentsDomainMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"semantics": zod.number().min(matchSearchGroupsNearItemComponentsSemanticsMin).max(matchSearchGroupsNearItemComponentsSemanticsMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"percentile": zod.union([zod.number().min(matchSearchGroupsNearItemComponentsPercentileOneMin).max(matchSearchGroupsNearItemComponentsPercentileOneMax),zod.null()]).describe('A score from a versioned ranking component, or null when it is not available. Any null component has a matching bounded entry in `unknown_flags`.'),
"competition": zod.number().min(matchSearchGroupsNearItemComponentsCompetitionMin).max(matchSearchGroupsNearItemComponentsCompetitionMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"freshness": zod.number().min(matchSearchGroupsNearItemComponentsFreshnessMin).max(matchSearchGroupsNearItemComponentsFreshnessMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"responsiveness": zod.number().min(matchSearchGroupsNearItemComponentsResponsivenessMin).max(matchSearchGroupsNearItemComponentsResponsivenessMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"rank_score": zod.number().min(matchSearchGroupsNearItemComponentsRankScoreMin).max(matchSearchGroupsNearItemComponentsRankScoreMax).describe('A normalized FR09 ranking component from 0 to 1.')
}).describe('Components from the FR09 ranking model for a confirmed category. `percentile` is null when fewer than 30 comparable real candidates are available; the ranking uses neutral T = 0.5 and does not publish a percentile. If ML is unavailable, `semantics` uses neutral 0.5 and the reason appears in `unknown_flags`.'),
"unknown_flags": zod.array(zod.object({
"component": zod.enum(['semantics', 'percentile', 'assessment', 'freshness', 'responsiveness', 'experience_band', 'work_formats', 'salary_compatibility', 'domain']).describe('Ranking or public-card component whose value is unknown.'),
"reason": zod.enum(['ml_unavailable', 'cohort_below_30', 'no_confirmation_for_specialization', 'not_in_public_card', 'need_field_unconfirmed', 'no_freshness_history', 'no_response_history']).describe('Bounded explanation for an unknown component, not a hiding reason.')
}).describe('A safe, bounded explanation for one unavailable component.')).max(matchSearchGroupsNearItemUnknownFlagsMax)
}).describe('One confirmed specialization entry in the `main` or `near` group. The group containing it supplies the group label. A candidate may have a separate entry for another specialization.')),
"unconfirmed": zod.array(zod.object({
"candidate_handle": zod.string().min(matchSearchGroupsUnconfirmedItemCandidateHandleMin).max(matchSearchGroupsUnconfirmedItemCandidateHandleMax).regex(matchSearchGroupsUnconfirmedItemCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from the organization-scoped anonymous card. It is a versioned HMAC alias, not a candidate account or profile identifier; it contains no contact information and is meaningless to another organization. The server resolves it only against the current visible cohort of the organization in the path. Clients never parse or construct it. It is shared by the candidate-card read and invitations.'),
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"confirmation_status": zod.enum(['unconfirmed']),
"declared_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Candidate-declared grade, separate from assessment confirmation.'),
"category": zod.null().describe('There is no confirmed category for this specialization.'),
"strength": zod.null().describe('Assessment strength is not measured for this specialization.'),
"public_context": zod.object({
"stack": zod.union([zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).max(matchSearchGroupsUnconfirmedItemPublicContextStackOneMax),zod.null()]),
"experience_band": zod.union([zod.enum(['0_1', '1_3', '3_6', '6_plus', '0_3', '3_plus']).describe('Coarse total experience bucket. Rare combinations may be generalized to 0_3 or 3_plus before they are returned.'),zod.null()]),
"work_formats": zod.union([zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).max(matchSearchGroupsUnconfirmedItemPublicContextWorkFormatsOneMax),zod.null()]),
"salary_compatibility": zod.union([zod.enum(['compatible', 'not_compatible']).describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.'),zod.null()])
}).describe('Safe anonymous-card context only. A null value means that the value is not in the public card or is not present; the response does not reveal which. It contains no contact, candidate location, or salary amount.'),
"evidence_summary": zod.array(zod.object({
"code": zod.enum(['confirmed_category', 'required_skill_evidence', 'desired_skill_evidence', 'domain_alignment', 'task_alignment', 'work_conditions_match', 'salary_compatibility', 'declared_grade']).describe('Template code for an explanation derived from allowed evidence. It carries no free text, raw answer, or reason for withheld FSP data.'),
"state": zod.enum(['supports', 'partial', 'gap', 'declared_only'])
}).describe('A templated, non-text evidence explanation.')).max(matchSearchGroupsUnconfirmedItemEvidenceSummaryMax),
"components": zod.object({
"fit": zod.number().min(matchSearchGroupsUnconfirmedItemComponentsFitMin).max(matchSearchGroupsUnconfirmedItemComponentsFitMax).describe('Job fit for this specialization, never an assessment score.'),
"coverage": zod.number().min(matchSearchGroupsUnconfirmedItemComponentsCoverageMin).max(matchSearchGroupsUnconfirmedItemComponentsCoverageMax).describe('Coverage of confirmed need skills by allowed public evidence.')
}).describe('Unconfirmed entries are ordered only by Fit and coverage. This strict component object has no theta, T, P, test percentile, or confirmed assessment score.'),
"unknown_flags": zod.array(zod.object({
"component": zod.enum(['semantics', 'percentile', 'assessment', 'freshness', 'responsiveness', 'experience_band', 'work_formats', 'salary_compatibility', 'domain']).describe('Ranking or public-card component whose value is unknown.'),
"reason": zod.enum(['ml_unavailable', 'cohort_below_30', 'no_confirmation_for_specialization', 'not_in_public_card', 'need_field_unconfirmed', 'no_freshness_history', 'no_response_history']).describe('Bounded explanation for an unknown component, not a hiding reason.')
}).describe('A safe, bounded explanation for one unavailable component.')).max(matchSearchGroupsUnconfirmedItemUnknownFlagsMax)
}).describe('One specialization with no confirmed category. `category` and `strength` remain present and null. A confirmation in another specialization never changes this entry. The schema intentionally has no assessment measurement fields.'))
}).describe('Separate ranking groups. Confirmed categories appear in main and near; unconfirmed specializations appear only in the lower unconfirmed group.')
export type MatchSearchGroups = zod.input<typeof MatchSearchGroups>;
export type MatchSearchGroupsOutput = zod.output<typeof MatchSearchGroups>;
@@ -0,0 +1,18 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const MatchSearchNeedSource = zod.object({
"kind": zod.enum(['need']),
"need_id": zod.uuid(),
"requirements_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.')
}).describe('The immutable need requirements snapshot used by this result.')
export type MatchSearchNeedSource = zod.input<typeof MatchSearchNeedSource>;
export type MatchSearchNeedSourceOutput = zod.output<typeof MatchSearchNeedSource>;
@@ -0,0 +1,56 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const matchSearchRequestOneFiltersStackMax = 4;
export const matchSearchRequestOneFiltersConditionsWorkFormatsMax = 3;
export const matchSearchRequestTwoFiltersStackMax = 4;
export const matchSearchRequestTwoFiltersConditionsWorkFormatsMax = 3;
export const MatchSearchRequest = zod.union([zod.object({
"need_id": zod.uuid().describe('Need owned by the organization in the path.'),
"requirements_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.'),
"filters": zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).exactOptional().describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"confirmed_grade": zod.enum(['intern', 'junior', 'middle', 'senior']).exactOptional().describe('Match only candidates with this currently confirmed grade in the selected specialization. It never matches a declared grade.'),
"confirmed_category": zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
}).exactOptional().describe('A confirmed category filter, never a candidate declaration.'),
"confirmation_status": zod.enum(['confirmed', 'unconfirmed']).exactOptional().describe('Confirmation state for this specialization only. A result for one specialization never changes the state of another specialization.'),
"declared_grade": zod.enum(['intern', 'junior', 'middle', 'senior']).exactOptional().describe('Candidate-declared grade filter. This is a separate claim and cannot satisfy `confirmed_grade` or `confirmed_category`.'),
"stack": zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).min(1).max(matchSearchRequestOneFiltersStackMax).exactOptional(),
"conditions": zod.object({
"work_formats": zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).min(1).max(matchSearchRequestOneFiltersConditionsWorkFormatsMax).exactOptional(),
"salary_compatibility": zod.enum(['compatible', 'not_compatible']).exactOptional().describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.')
}).exactOptional().describe('Filters against safe, coarse card conditions. No candidate location, salary amount, salary minimum, or salary range is accepted.')
}).exactOptional().describe('Optional filters over the current organization-visible bank. An empty object means no additional filter. Confirmed and declared grades are separate fields; a declaration never satisfies a confirmed-grade or category filter. Conditions use only the safe, coarse card fields.')
}).describe('Search one immutable set of confirmed requirements. `requirements_version` is the Need.requirements_version, not the general Need.version; text-only or suggestion-only edits do not change this search basis.'),zod.object({
"filters": zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).exactOptional().describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"confirmed_grade": zod.enum(['intern', 'junior', 'middle', 'senior']).exactOptional().describe('Match only candidates with this currently confirmed grade in the selected specialization. It never matches a declared grade.'),
"confirmed_category": zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
}).exactOptional().describe('A confirmed category filter, never a candidate declaration.'),
"confirmation_status": zod.enum(['confirmed', 'unconfirmed']).exactOptional().describe('Confirmation state for this specialization only. A result for one specialization never changes the state of another specialization.'),
"declared_grade": zod.enum(['intern', 'junior', 'middle', 'senior']).exactOptional().describe('Candidate-declared grade filter. This is a separate claim and cannot satisfy `confirmed_grade` or `confirmed_category`.'),
"stack": zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).min(1).max(matchSearchRequestTwoFiltersStackMax).exactOptional(),
"conditions": zod.object({
"work_formats": zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).min(1).max(matchSearchRequestTwoFiltersConditionsWorkFormatsMax).exactOptional(),
"salary_compatibility": zod.enum(['compatible', 'not_compatible']).exactOptional().describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.')
}).exactOptional().describe('Filters against safe, coarse card conditions. No candidate location, salary amount, salary minimum, or salary range is accepted.')
}).describe('Optional filters over the current organization-visible bank. An empty object means no additional filter. Confirmed and declared grades are separate fields; a declaration never satisfies a confirmed-grade or category filter. Conditions use only the safe, coarse card fields.')
}).describe('Search the current organization-visible bank. An empty `filters` object includes all otherwise eligible specializations as separate entries.')]).describe('Search either a Need.requirements_version snapshot or the whole organization-visible bank with explicit filters. Unknown fields are rejected by both closed request variants.')
export type MatchSearchRequest = zod.input<typeof MatchSearchRequest>;
export type MatchSearchRequestOutput = zod.output<typeof MatchSearchRequest>;
@@ -0,0 +1,240 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const matchSearchResponseSourceTwoFiltersStackOneMax = 4;
export const matchSearchResponseSourceTwoFiltersConditionsOneWorkFormatsOneMax = 3;
export const matchSearchResponseGroupsMainItemCandidateHandleMin = 47;
export const matchSearchResponseGroupsMainItemCandidateHandleMax = 47;
export const matchSearchResponseGroupsMainItemCandidateHandleRegExp = new RegExp('^cv1_[A-Za-z0-9_-]{43}$');
export const matchSearchResponseGroupsMainItemPublicContextStackOneMax = 4;
export const matchSearchResponseGroupsMainItemPublicContextWorkFormatsOneMax = 3;
export const matchSearchResponseGroupsMainItemEvidenceSummaryMax = 12;
export const matchSearchResponseGroupsMainItemComponentsFitMin = 0;
export const matchSearchResponseGroupsMainItemComponentsFitMax = 1;
export const matchSearchResponseGroupsMainItemComponentsCoverageMin = 0;
export const matchSearchResponseGroupsMainItemComponentsCoverageMax = 1;
export const matchSearchResponseGroupsMainItemComponentsDomainMin = 0;
export const matchSearchResponseGroupsMainItemComponentsDomainMax = 1;
export const matchSearchResponseGroupsMainItemComponentsSemanticsMin = 0;
export const matchSearchResponseGroupsMainItemComponentsSemanticsMax = 1;
export const matchSearchResponseGroupsMainItemComponentsPercentileOneMin = 0;
export const matchSearchResponseGroupsMainItemComponentsPercentileOneMax = 1;
export const matchSearchResponseGroupsMainItemComponentsCompetitionMin = 0;
export const matchSearchResponseGroupsMainItemComponentsCompetitionMax = 1;
export const matchSearchResponseGroupsMainItemComponentsFreshnessMin = 0;
export const matchSearchResponseGroupsMainItemComponentsFreshnessMax = 1;
export const matchSearchResponseGroupsMainItemComponentsResponsivenessMin = 0;
export const matchSearchResponseGroupsMainItemComponentsResponsivenessMax = 1;
export const matchSearchResponseGroupsMainItemComponentsRankScoreMin = 0;
export const matchSearchResponseGroupsMainItemComponentsRankScoreMax = 1;
export const matchSearchResponseGroupsMainItemUnknownFlagsMax = 9;
export const matchSearchResponseGroupsNearItemCandidateHandleMin = 47;
export const matchSearchResponseGroupsNearItemCandidateHandleMax = 47;
export const matchSearchResponseGroupsNearItemCandidateHandleRegExp = new RegExp('^cv1_[A-Za-z0-9_-]{43}$');
export const matchSearchResponseGroupsNearItemPublicContextStackOneMax = 4;
export const matchSearchResponseGroupsNearItemPublicContextWorkFormatsOneMax = 3;
export const matchSearchResponseGroupsNearItemEvidenceSummaryMax = 12;
export const matchSearchResponseGroupsNearItemComponentsFitMin = 0;
export const matchSearchResponseGroupsNearItemComponentsFitMax = 1;
export const matchSearchResponseGroupsNearItemComponentsCoverageMin = 0;
export const matchSearchResponseGroupsNearItemComponentsCoverageMax = 1;
export const matchSearchResponseGroupsNearItemComponentsDomainMin = 0;
export const matchSearchResponseGroupsNearItemComponentsDomainMax = 1;
export const matchSearchResponseGroupsNearItemComponentsSemanticsMin = 0;
export const matchSearchResponseGroupsNearItemComponentsSemanticsMax = 1;
export const matchSearchResponseGroupsNearItemComponentsPercentileOneMin = 0;
export const matchSearchResponseGroupsNearItemComponentsPercentileOneMax = 1;
export const matchSearchResponseGroupsNearItemComponentsCompetitionMin = 0;
export const matchSearchResponseGroupsNearItemComponentsCompetitionMax = 1;
export const matchSearchResponseGroupsNearItemComponentsFreshnessMin = 0;
export const matchSearchResponseGroupsNearItemComponentsFreshnessMax = 1;
export const matchSearchResponseGroupsNearItemComponentsResponsivenessMin = 0;
export const matchSearchResponseGroupsNearItemComponentsResponsivenessMax = 1;
export const matchSearchResponseGroupsNearItemComponentsRankScoreMin = 0;
export const matchSearchResponseGroupsNearItemComponentsRankScoreMax = 1;
export const matchSearchResponseGroupsNearItemUnknownFlagsMax = 9;
export const matchSearchResponseGroupsUnconfirmedItemCandidateHandleMin = 47;
export const matchSearchResponseGroupsUnconfirmedItemCandidateHandleMax = 47;
export const matchSearchResponseGroupsUnconfirmedItemCandidateHandleRegExp = new RegExp('^cv1_[A-Za-z0-9_-]{43}$');
export const matchSearchResponseGroupsUnconfirmedItemPublicContextStackOneMax = 4;
export const matchSearchResponseGroupsUnconfirmedItemPublicContextWorkFormatsOneMax = 3;
export const matchSearchResponseGroupsUnconfirmedItemEvidenceSummaryMax = 12;
export const matchSearchResponseGroupsUnconfirmedItemComponentsFitMin = 0;
export const matchSearchResponseGroupsUnconfirmedItemComponentsFitMax = 1;
export const matchSearchResponseGroupsUnconfirmedItemComponentsCoverageMin = 0;
export const matchSearchResponseGroupsUnconfirmedItemComponentsCoverageMax = 1;
export const matchSearchResponseGroupsUnconfirmedItemUnknownFlagsMax = 9;
export const MatchSearchResponse = zod.object({
"source": zod.union([zod.object({
"kind": zod.enum(['need']),
"need_id": zod.uuid(),
"requirements_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.')
}).describe('The immutable need requirements snapshot used by this result.'),zod.object({
"kind": zod.enum(['bank']),
"filters": zod.object({
"specialization": zod.union([zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),zod.null()]),
"confirmed_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]),
"confirmed_category": zod.union([zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
}).describe('A confirmed category filter, never a candidate declaration.'),zod.null()]),
"confirmation_status": zod.union([zod.enum(['confirmed', 'unconfirmed']).describe('Confirmation state for this specialization only. A result for one specialization never changes the state of another specialization.'),zod.null()]),
"declared_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]),
"stack": zod.union([zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).min(1).max(matchSearchResponseSourceTwoFiltersStackOneMax),zod.null()]),
"conditions": zod.union([zod.object({
"work_formats": zod.union([zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).min(1).max(matchSearchResponseSourceTwoFiltersConditionsOneWorkFormatsOneMax),zod.null()]),
"salary_compatibility": zod.union([zod.enum(['compatible', 'not_compatible']).describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.'),zod.null()])
}).describe('Conditions echoed as a complete snapshot; null means no filter.'),zod.null()])
}).describe('A normalized response snapshot of the bank filters. Each key is present; null means the corresponding request filter was omitted. This keeps a search result tied to its exact filter basis.')
}).describe('The normalized filters used for a bank search.')]).describe('Search basis echoed with the response so the displayed result remains tied to its need requirements version or bank filters.'),
"groups": zod.object({
"main": zod.array(zod.object({
"candidate_handle": zod.string().min(matchSearchResponseGroupsMainItemCandidateHandleMin).max(matchSearchResponseGroupsMainItemCandidateHandleMax).regex(matchSearchResponseGroupsMainItemCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from the organization-scoped anonymous card. It is a versioned HMAC alias, not a candidate account or profile identifier; it contains no contact information and is meaningless to another organization. The server resolves it only against the current visible cohort of the organization in the path. Clients never parse or construct it. It is shared by the candidate-card read and invitations.'),
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"confirmation_status": zod.enum(['confirmed']),
"declared_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Candidate-declared grade for this specialization, never a confirmation.'),
"category": zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
}).describe('A confirmed category. Its specialization must equal the enclosing match entry\'s specialization.'),
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of a confirmed assessment for this specialization.'),
"public_context": zod.object({
"stack": zod.union([zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).max(matchSearchResponseGroupsMainItemPublicContextStackOneMax),zod.null()]),
"experience_band": zod.union([zod.enum(['0_1', '1_3', '3_6', '6_plus', '0_3', '3_plus']).describe('Coarse total experience bucket. Rare combinations may be generalized to 0_3 or 3_plus before they are returned.'),zod.null()]),
"work_formats": zod.union([zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).max(matchSearchResponseGroupsMainItemPublicContextWorkFormatsOneMax),zod.null()]),
"salary_compatibility": zod.union([zod.enum(['compatible', 'not_compatible']).describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.'),zod.null()])
}).describe('Safe anonymous-card context only. A null value means that the value is not in the public card or is not present; the response does not reveal which. It contains no contact, candidate location, or salary amount.'),
"evidence_summary": zod.array(zod.object({
"code": zod.enum(['confirmed_category', 'required_skill_evidence', 'desired_skill_evidence', 'domain_alignment', 'task_alignment', 'work_conditions_match', 'salary_compatibility', 'declared_grade']).describe('Template code for an explanation derived from allowed evidence. It carries no free text, raw answer, or reason for withheld FSP data.'),
"state": zod.enum(['supports', 'partial', 'gap', 'declared_only'])
}).describe('A templated, non-text evidence explanation.')).max(matchSearchResponseGroupsMainItemEvidenceSummaryMax),
"components": zod.object({
"fit": zod.number().min(matchSearchResponseGroupsMainItemComponentsFitMin).max(matchSearchResponseGroupsMainItemComponentsFitMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"coverage": zod.number().min(matchSearchResponseGroupsMainItemComponentsCoverageMin).max(matchSearchResponseGroupsMainItemComponentsCoverageMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"domain": zod.number().min(matchSearchResponseGroupsMainItemComponentsDomainMin).max(matchSearchResponseGroupsMainItemComponentsDomainMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"semantics": zod.number().min(matchSearchResponseGroupsMainItemComponentsSemanticsMin).max(matchSearchResponseGroupsMainItemComponentsSemanticsMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"percentile": zod.union([zod.number().min(matchSearchResponseGroupsMainItemComponentsPercentileOneMin).max(matchSearchResponseGroupsMainItemComponentsPercentileOneMax),zod.null()]).describe('A score from a versioned ranking component, or null when it is not available. Any null component has a matching bounded entry in `unknown_flags`.'),
"competition": zod.number().min(matchSearchResponseGroupsMainItemComponentsCompetitionMin).max(matchSearchResponseGroupsMainItemComponentsCompetitionMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"freshness": zod.number().min(matchSearchResponseGroupsMainItemComponentsFreshnessMin).max(matchSearchResponseGroupsMainItemComponentsFreshnessMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"responsiveness": zod.number().min(matchSearchResponseGroupsMainItemComponentsResponsivenessMin).max(matchSearchResponseGroupsMainItemComponentsResponsivenessMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"rank_score": zod.number().min(matchSearchResponseGroupsMainItemComponentsRankScoreMin).max(matchSearchResponseGroupsMainItemComponentsRankScoreMax).describe('A normalized FR09 ranking component from 0 to 1.')
}).describe('Components from the FR09 ranking model for a confirmed category. `percentile` is null when fewer than 30 comparable real candidates are available; the ranking uses neutral T = 0.5 and does not publish a percentile. If ML is unavailable, `semantics` uses neutral 0.5 and the reason appears in `unknown_flags`.'),
"unknown_flags": zod.array(zod.object({
"component": zod.enum(['semantics', 'percentile', 'assessment', 'freshness', 'responsiveness', 'experience_band', 'work_formats', 'salary_compatibility', 'domain']).describe('Ranking or public-card component whose value is unknown.'),
"reason": zod.enum(['ml_unavailable', 'cohort_below_30', 'no_confirmation_for_specialization', 'not_in_public_card', 'need_field_unconfirmed', 'no_freshness_history', 'no_response_history']).describe('Bounded explanation for an unknown component, not a hiding reason.')
}).describe('A safe, bounded explanation for one unavailable component.')).max(matchSearchResponseGroupsMainItemUnknownFlagsMax)
}).describe('One confirmed specialization entry in the `main` or `near` group. The group containing it supplies the group label. A candidate may have a separate entry for another specialization.')),
"near": zod.array(zod.object({
"candidate_handle": zod.string().min(matchSearchResponseGroupsNearItemCandidateHandleMin).max(matchSearchResponseGroupsNearItemCandidateHandleMax).regex(matchSearchResponseGroupsNearItemCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from the organization-scoped anonymous card. It is a versioned HMAC alias, not a candidate account or profile identifier; it contains no contact information and is meaningless to another organization. The server resolves it only against the current visible cohort of the organization in the path. Clients never parse or construct it. It is shared by the candidate-card read and invitations.'),
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"confirmation_status": zod.enum(['confirmed']),
"declared_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Candidate-declared grade for this specialization, never a confirmation.'),
"category": zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
}).describe('A confirmed category. Its specialization must equal the enclosing match entry\'s specialization.'),
"strength": zod.enum(['standard', 'strong']).describe('Coarse strength of a confirmed assessment for this specialization.'),
"public_context": zod.object({
"stack": zod.union([zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).max(matchSearchResponseGroupsNearItemPublicContextStackOneMax),zod.null()]),
"experience_band": zod.union([zod.enum(['0_1', '1_3', '3_6', '6_plus', '0_3', '3_plus']).describe('Coarse total experience bucket. Rare combinations may be generalized to 0_3 or 3_plus before they are returned.'),zod.null()]),
"work_formats": zod.union([zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).max(matchSearchResponseGroupsNearItemPublicContextWorkFormatsOneMax),zod.null()]),
"salary_compatibility": zod.union([zod.enum(['compatible', 'not_compatible']).describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.'),zod.null()])
}).describe('Safe anonymous-card context only. A null value means that the value is not in the public card or is not present; the response does not reveal which. It contains no contact, candidate location, or salary amount.'),
"evidence_summary": zod.array(zod.object({
"code": zod.enum(['confirmed_category', 'required_skill_evidence', 'desired_skill_evidence', 'domain_alignment', 'task_alignment', 'work_conditions_match', 'salary_compatibility', 'declared_grade']).describe('Template code for an explanation derived from allowed evidence. It carries no free text, raw answer, or reason for withheld FSP data.'),
"state": zod.enum(['supports', 'partial', 'gap', 'declared_only'])
}).describe('A templated, non-text evidence explanation.')).max(matchSearchResponseGroupsNearItemEvidenceSummaryMax),
"components": zod.object({
"fit": zod.number().min(matchSearchResponseGroupsNearItemComponentsFitMin).max(matchSearchResponseGroupsNearItemComponentsFitMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"coverage": zod.number().min(matchSearchResponseGroupsNearItemComponentsCoverageMin).max(matchSearchResponseGroupsNearItemComponentsCoverageMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"domain": zod.number().min(matchSearchResponseGroupsNearItemComponentsDomainMin).max(matchSearchResponseGroupsNearItemComponentsDomainMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"semantics": zod.number().min(matchSearchResponseGroupsNearItemComponentsSemanticsMin).max(matchSearchResponseGroupsNearItemComponentsSemanticsMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"percentile": zod.union([zod.number().min(matchSearchResponseGroupsNearItemComponentsPercentileOneMin).max(matchSearchResponseGroupsNearItemComponentsPercentileOneMax),zod.null()]).describe('A score from a versioned ranking component, or null when it is not available. Any null component has a matching bounded entry in `unknown_flags`.'),
"competition": zod.number().min(matchSearchResponseGroupsNearItemComponentsCompetitionMin).max(matchSearchResponseGroupsNearItemComponentsCompetitionMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"freshness": zod.number().min(matchSearchResponseGroupsNearItemComponentsFreshnessMin).max(matchSearchResponseGroupsNearItemComponentsFreshnessMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"responsiveness": zod.number().min(matchSearchResponseGroupsNearItemComponentsResponsivenessMin).max(matchSearchResponseGroupsNearItemComponentsResponsivenessMax).describe('A normalized FR09 ranking component from 0 to 1.'),
"rank_score": zod.number().min(matchSearchResponseGroupsNearItemComponentsRankScoreMin).max(matchSearchResponseGroupsNearItemComponentsRankScoreMax).describe('A normalized FR09 ranking component from 0 to 1.')
}).describe('Components from the FR09 ranking model for a confirmed category. `percentile` is null when fewer than 30 comparable real candidates are available; the ranking uses neutral T = 0.5 and does not publish a percentile. If ML is unavailable, `semantics` uses neutral 0.5 and the reason appears in `unknown_flags`.'),
"unknown_flags": zod.array(zod.object({
"component": zod.enum(['semantics', 'percentile', 'assessment', 'freshness', 'responsiveness', 'experience_band', 'work_formats', 'salary_compatibility', 'domain']).describe('Ranking or public-card component whose value is unknown.'),
"reason": zod.enum(['ml_unavailable', 'cohort_below_30', 'no_confirmation_for_specialization', 'not_in_public_card', 'need_field_unconfirmed', 'no_freshness_history', 'no_response_history']).describe('Bounded explanation for an unknown component, not a hiding reason.')
}).describe('A safe, bounded explanation for one unavailable component.')).max(matchSearchResponseGroupsNearItemUnknownFlagsMax)
}).describe('One confirmed specialization entry in the `main` or `near` group. The group containing it supplies the group label. A candidate may have a separate entry for another specialization.')),
"unconfirmed": zod.array(zod.object({
"candidate_handle": zod.string().min(matchSearchResponseGroupsUnconfirmedItemCandidateHandleMin).max(matchSearchResponseGroupsUnconfirmedItemCandidateHandleMax).regex(matchSearchResponseGroupsUnconfirmedItemCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from the organization-scoped anonymous card. It is a versioned HMAC alias, not a candidate account or profile identifier; it contains no contact information and is meaningless to another organization. The server resolves it only against the current visible cohort of the organization in the path. Clients never parse or construct it. It is shared by the candidate-card read and invitations.'),
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"confirmation_status": zod.enum(['unconfirmed']),
"declared_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Candidate-declared grade, separate from assessment confirmation.'),
"category": zod.null().describe('There is no confirmed category for this specialization.'),
"strength": zod.null().describe('Assessment strength is not measured for this specialization.'),
"public_context": zod.object({
"stack": zod.union([zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).max(matchSearchResponseGroupsUnconfirmedItemPublicContextStackOneMax),zod.null()]),
"experience_band": zod.union([zod.enum(['0_1', '1_3', '3_6', '6_plus', '0_3', '3_plus']).describe('Coarse total experience bucket. Rare combinations may be generalized to 0_3 or 3_plus before they are returned.'),zod.null()]),
"work_formats": zod.union([zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).max(matchSearchResponseGroupsUnconfirmedItemPublicContextWorkFormatsOneMax),zod.null()]),
"salary_compatibility": zod.union([zod.enum(['compatible', 'not_compatible']).describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.'),zod.null()])
}).describe('Safe anonymous-card context only. A null value means that the value is not in the public card or is not present; the response does not reveal which. It contains no contact, candidate location, or salary amount.'),
"evidence_summary": zod.array(zod.object({
"code": zod.enum(['confirmed_category', 'required_skill_evidence', 'desired_skill_evidence', 'domain_alignment', 'task_alignment', 'work_conditions_match', 'salary_compatibility', 'declared_grade']).describe('Template code for an explanation derived from allowed evidence. It carries no free text, raw answer, or reason for withheld FSP data.'),
"state": zod.enum(['supports', 'partial', 'gap', 'declared_only'])
}).describe('A templated, non-text evidence explanation.')).max(matchSearchResponseGroupsUnconfirmedItemEvidenceSummaryMax),
"components": zod.object({
"fit": zod.number().min(matchSearchResponseGroupsUnconfirmedItemComponentsFitMin).max(matchSearchResponseGroupsUnconfirmedItemComponentsFitMax).describe('Job fit for this specialization, never an assessment score.'),
"coverage": zod.number().min(matchSearchResponseGroupsUnconfirmedItemComponentsCoverageMin).max(matchSearchResponseGroupsUnconfirmedItemComponentsCoverageMax).describe('Coverage of confirmed need skills by allowed public evidence.')
}).describe('Unconfirmed entries are ordered only by Fit and coverage. This strict component object has no theta, T, P, test percentile, or confirmed assessment score.'),
"unknown_flags": zod.array(zod.object({
"component": zod.enum(['semantics', 'percentile', 'assessment', 'freshness', 'responsiveness', 'experience_band', 'work_formats', 'salary_compatibility', 'domain']).describe('Ranking or public-card component whose value is unknown.'),
"reason": zod.enum(['ml_unavailable', 'cohort_below_30', 'no_confirmation_for_specialization', 'not_in_public_card', 'need_field_unconfirmed', 'no_freshness_history', 'no_response_history']).describe('Bounded explanation for an unknown component, not a hiding reason.')
}).describe('A safe, bounded explanation for one unavailable component.')).max(matchSearchResponseGroupsUnconfirmedItemUnknownFlagsMax)
}).describe('One specialization with no confirmed category. `category` and `strength` remain present and null. A confirmation in another specialization never changes this entry. The schema intentionally has no assessment measurement fields.'))
}).describe('Separate ranking groups. Confirmed categories appear in main and near; unconfirmed specializations appear only in the lower unconfirmed group.')
}).describe('Anonymous search result grouped by specialization state. Repeated organization-scoped handles are allowed when the same candidate has different specialization entries; entries never transfer confirmation between specializations.')
export type MatchSearchResponse = zod.input<typeof MatchSearchResponse>;
export type MatchSearchResponseOutput = zod.output<typeof MatchSearchResponse>;
@@ -0,0 +1,39 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const matchSearchSourceTwoFiltersStackOneMax = 4;
export const matchSearchSourceTwoFiltersConditionsOneWorkFormatsOneMax = 3;
export const MatchSearchSource = zod.union([zod.object({
"kind": zod.enum(['need']),
"need_id": zod.uuid(),
"requirements_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.')
}).describe('The immutable need requirements snapshot used by this result.'),zod.object({
"kind": zod.enum(['bank']),
"filters": zod.object({
"specialization": zod.union([zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),zod.null()]),
"confirmed_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]),
"confirmed_category": zod.union([zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
}).describe('A confirmed category filter, never a candidate declaration.'),zod.null()]),
"confirmation_status": zod.union([zod.enum(['confirmed', 'unconfirmed']).describe('Confirmation state for this specialization only. A result for one specialization never changes the state of another specialization.'),zod.null()]),
"declared_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]),
"stack": zod.union([zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).min(1).max(matchSearchSourceTwoFiltersStackOneMax),zod.null()]),
"conditions": zod.union([zod.object({
"work_formats": zod.union([zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).min(1).max(matchSearchSourceTwoFiltersConditionsOneWorkFormatsOneMax),zod.null()]),
"salary_compatibility": zod.union([zod.enum(['compatible', 'not_compatible']).describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.'),zod.null()])
}).describe('Conditions echoed as a complete snapshot; null means no filter.'),zod.null()])
}).describe('A normalized response snapshot of the bank filters. Each key is present; null means the corresponding request filter was omitted. This keeps a search result tied to its exact filter basis.')
}).describe('The normalized filters used for a bank search.')]).describe('Search basis echoed with the response so the displayed result remains tied to its need requirements version or bank filters.')
export type MatchSearchSource = zod.input<typeof MatchSearchSource>;
export type MatchSearchSourceOutput = zod.output<typeof MatchSearchSource>;
@@ -0,0 +1,12 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const MatchSearchStackTag = zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')
export type MatchSearchStackTag = zod.input<typeof MatchSearchStackTag>;
export type MatchSearchStackTagOutput = zod.output<typeof MatchSearchStackTag>;
@@ -0,0 +1,12 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const MatchStrength = zod.enum(['standard', 'strong']).describe('Coarse strength of a confirmed assessment for this specialization.')
export type MatchStrength = zod.input<typeof MatchStrength>;
export type MatchStrengthOutput = zod.output<typeof MatchStrength>;
@@ -0,0 +1,57 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const matchUnconfirmedCandidateCandidateHandleMin = 47;
export const matchUnconfirmedCandidateCandidateHandleMax = 47;
export const matchUnconfirmedCandidateCandidateHandleRegExp = new RegExp('^cv1_[A-Za-z0-9_-]{43}$');
export const matchUnconfirmedCandidatePublicContextStackOneMax = 4;
export const matchUnconfirmedCandidatePublicContextWorkFormatsOneMax = 3;
export const matchUnconfirmedCandidateEvidenceSummaryMax = 12;
export const matchUnconfirmedCandidateComponentsFitMin = 0;
export const matchUnconfirmedCandidateComponentsFitMax = 1;
export const matchUnconfirmedCandidateComponentsCoverageMin = 0;
export const matchUnconfirmedCandidateComponentsCoverageMax = 1;
export const matchUnconfirmedCandidateUnknownFlagsMax = 9;
export const MatchUnconfirmedCandidate = zod.object({
"candidate_handle": zod.string().min(matchUnconfirmedCandidateCandidateHandleMin).max(matchUnconfirmedCandidateCandidateHandleMax).regex(matchUnconfirmedCandidateCandidateHandleRegExp).describe('Opaque reference to a candidate as one organization sees it, taken from the organization-scoped anonymous card. It is a versioned HMAC alias, not a candidate account or profile identifier; it contains no contact information and is meaningless to another organization. The server resolves it only against the current visible cohort of the organization in the path. Clients never parse or construct it. It is shared by the candidate-card read and invitations.'),
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"confirmation_status": zod.enum(['unconfirmed']),
"declared_grade": zod.union([zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.'),zod.null()]).describe('Candidate-declared grade, separate from assessment confirmation.'),
"category": zod.null().describe('There is no confirmed category for this specialization.'),
"strength": zod.null().describe('Assessment strength is not measured for this specialization.'),
"public_context": zod.object({
"stack": zod.union([zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).max(matchUnconfirmedCandidatePublicContextStackOneMax),zod.null()]),
"experience_band": zod.union([zod.enum(['0_1', '1_3', '3_6', '6_plus', '0_3', '3_plus']).describe('Coarse total experience bucket. Rare combinations may be generalized to 0_3 or 3_plus before they are returned.'),zod.null()]),
"work_formats": zod.union([zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).max(matchUnconfirmedCandidatePublicContextWorkFormatsOneMax),zod.null()]),
"salary_compatibility": zod.union([zod.enum(['compatible', 'not_compatible']).describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.'),zod.null()])
}).describe('Safe anonymous-card context only. A null value means that the value is not in the public card or is not present; the response does not reveal which. It contains no contact, candidate location, or salary amount.'),
"evidence_summary": zod.array(zod.object({
"code": zod.enum(['confirmed_category', 'required_skill_evidence', 'desired_skill_evidence', 'domain_alignment', 'task_alignment', 'work_conditions_match', 'salary_compatibility', 'declared_grade']).describe('Template code for an explanation derived from allowed evidence. It carries no free text, raw answer, or reason for withheld FSP data.'),
"state": zod.enum(['supports', 'partial', 'gap', 'declared_only'])
}).describe('A templated, non-text evidence explanation.')).max(matchUnconfirmedCandidateEvidenceSummaryMax),
"components": zod.object({
"fit": zod.number().min(matchUnconfirmedCandidateComponentsFitMin).max(matchUnconfirmedCandidateComponentsFitMax).describe('Job fit for this specialization, never an assessment score.'),
"coverage": zod.number().min(matchUnconfirmedCandidateComponentsCoverageMin).max(matchUnconfirmedCandidateComponentsCoverageMax).describe('Coverage of confirmed need skills by allowed public evidence.')
}).describe('Unconfirmed entries are ordered only by Fit and coverage. This strict component object has no theta, T, P, test percentile, or confirmed assessment score.'),
"unknown_flags": zod.array(zod.object({
"component": zod.enum(['semantics', 'percentile', 'assessment', 'freshness', 'responsiveness', 'experience_band', 'work_formats', 'salary_compatibility', 'domain']).describe('Ranking or public-card component whose value is unknown.'),
"reason": zod.enum(['ml_unavailable', 'cohort_below_30', 'no_confirmation_for_specialization', 'not_in_public_card', 'need_field_unconfirmed', 'no_freshness_history', 'no_response_history']).describe('Bounded explanation for an unknown component, not a hiding reason.')
}).describe('A safe, bounded explanation for one unavailable component.')).max(matchUnconfirmedCandidateUnknownFlagsMax)
}).describe('One specialization with no confirmed category. `category` and `strength` remain present and null. A confirmation in another specialization never changes this entry. The schema intentionally has no assessment measurement fields.')
export type MatchUnconfirmedCandidate = zod.input<typeof MatchUnconfirmedCandidate>;
export type MatchUnconfirmedCandidateOutput = zod.output<typeof MatchUnconfirmedCandidate>;
@@ -0,0 +1,22 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const matchUnconfirmedComponentsFitMin = 0;
export const matchUnconfirmedComponentsFitMax = 1;
export const matchUnconfirmedComponentsCoverageMin = 0;
export const matchUnconfirmedComponentsCoverageMax = 1;
export const MatchUnconfirmedComponents = zod.object({
"fit": zod.number().min(matchUnconfirmedComponentsFitMin).max(matchUnconfirmedComponentsFitMax).describe('Job fit for this specialization, never an assessment score.'),
"coverage": zod.number().min(matchUnconfirmedComponentsCoverageMin).max(matchUnconfirmedComponentsCoverageMax).describe('Coverage of confirmed need skills by allowed public evidence.')
}).describe('Unconfirmed entries are ordered only by Fit and coverage. This strict component object has no theta, T, P, test percentile, or confirmed assessment score.')
export type MatchUnconfirmedComponents = zod.input<typeof MatchUnconfirmedComponents>;
export type MatchUnconfirmedComponentsOutput = zod.output<typeof MatchUnconfirmedComponents>;
@@ -0,0 +1,12 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const MatchUnknownComponent = zod.enum(['semantics', 'percentile', 'assessment', 'freshness', 'responsiveness', 'experience_band', 'work_formats', 'salary_compatibility', 'domain']).describe('Ranking or public-card component whose value is unknown.')
export type MatchUnknownComponent = zod.input<typeof MatchUnknownComponent>;
export type MatchUnknownComponentOutput = zod.output<typeof MatchUnknownComponent>;
@@ -0,0 +1,15 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const MatchUnknownFlag = zod.object({
"component": zod.enum(['semantics', 'percentile', 'assessment', 'freshness', 'responsiveness', 'experience_band', 'work_formats', 'salary_compatibility', 'domain']).describe('Ranking or public-card component whose value is unknown.'),
"reason": zod.enum(['ml_unavailable', 'cohort_below_30', 'no_confirmation_for_specialization', 'not_in_public_card', 'need_field_unconfirmed', 'no_freshness_history', 'no_response_history']).describe('Bounded explanation for an unknown component, not a hiding reason.')
}).describe('A safe, bounded explanation for one unavailable component.')
export type MatchUnknownFlag = zod.input<typeof MatchUnknownFlag>;
export type MatchUnknownFlagOutput = zod.output<typeof MatchUnknownFlag>;
@@ -0,0 +1,18 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const MatchUnknownFlagsMax = 9;
export const MatchUnknownFlags = zod.array(zod.object({
"component": zod.enum(['semantics', 'percentile', 'assessment', 'freshness', 'responsiveness', 'experience_band', 'work_formats', 'salary_compatibility', 'domain']).describe('Ranking or public-card component whose value is unknown.'),
"reason": zod.enum(['ml_unavailable', 'cohort_below_30', 'no_confirmation_for_specialization', 'not_in_public_card', 'need_field_unconfirmed', 'no_freshness_history', 'no_response_history']).describe('Bounded explanation for an unknown component, not a hiding reason.')
}).describe('A safe, bounded explanation for one unavailable component.')).max(MatchUnknownFlagsMax)
export type MatchUnknownFlags = zod.input<typeof MatchUnknownFlags>;
export type MatchUnknownFlagsOutput = zod.output<typeof MatchUnknownFlags>;
@@ -0,0 +1,12 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const MatchUnknownReason = zod.enum(['ml_unavailable', 'cohort_below_30', 'no_confirmation_for_specialization', 'not_in_public_card', 'need_field_unconfirmed', 'no_freshness_history', 'no_response_history']).describe('Bounded explanation for an unknown component, not a hiding reason.')
export type MatchUnknownReason = zod.input<typeof MatchUnknownReason>;
export type MatchUnknownReasonOutput = zod.output<typeof MatchUnknownReason>;
@@ -0,0 +1,56 @@
/**
* Generated by orval 🍺
* Do not edit manually.
* Lincodex API
* OpenAPI spec version: 0.1.0
*/
import * as zod from 'zod';
export const searchOrganizationMatchesBodyOneFiltersStackMax = 4;
export const searchOrganizationMatchesBodyOneFiltersConditionsWorkFormatsMax = 3;
export const searchOrganizationMatchesBodyTwoFiltersStackMax = 4;
export const searchOrganizationMatchesBodyTwoFiltersConditionsWorkFormatsMax = 3;
export const SearchOrganizationMatchesBody = zod.union([zod.object({
"need_id": zod.uuid().describe('Need owned by the organization in the path.'),
"requirements_version": zod.int().min(1).describe('Version of an employer need. Creation makes version 1, and every committed change of the need advances it by exactly one, including a change made by the server, such as a planned asynchronous ML suggestion. Each version is an immutable snapshot of the need. `requirements_version` names the version whose confirmed requirements are current, so a change that leaves them unchanged creates a need version without a new requirements version.'),
"filters": zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).exactOptional().describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"confirmed_grade": zod.enum(['intern', 'junior', 'middle', 'senior']).exactOptional().describe('Match only candidates with this currently confirmed grade in the selected specialization. It never matches a declared grade.'),
"confirmed_category": zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
}).exactOptional().describe('A confirmed category filter, never a candidate declaration.'),
"confirmation_status": zod.enum(['confirmed', 'unconfirmed']).exactOptional().describe('Confirmation state for this specialization only. A result for one specialization never changes the state of another specialization.'),
"declared_grade": zod.enum(['intern', 'junior', 'middle', 'senior']).exactOptional().describe('Candidate-declared grade filter. This is a separate claim and cannot satisfy `confirmed_grade` or `confirmed_category`.'),
"stack": zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).min(1).max(searchOrganizationMatchesBodyOneFiltersStackMax).exactOptional(),
"conditions": zod.object({
"work_formats": zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).min(1).max(searchOrganizationMatchesBodyOneFiltersConditionsWorkFormatsMax).exactOptional(),
"salary_compatibility": zod.enum(['compatible', 'not_compatible']).exactOptional().describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.')
}).exactOptional().describe('Filters against safe, coarse card conditions. No candidate location, salary amount, salary minimum, or salary range is accepted.')
}).exactOptional().describe('Optional filters over the current organization-visible bank. An empty object means no additional filter. Confirmed and declared grades are separate fields; a declaration never satisfies a confirmed-grade or category filter. Conditions use only the safe, coarse card fields.')
}).describe('Search one immutable set of confirmed requirements. `requirements_version` is the Need.requirements_version, not the general Need.version; text-only or suggestion-only edits do not change this search basis.'),zod.object({
"filters": zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).exactOptional().describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"confirmed_grade": zod.enum(['intern', 'junior', 'middle', 'senior']).exactOptional().describe('Match only candidates with this currently confirmed grade in the selected specialization. It never matches a declared grade.'),
"confirmed_category": zod.object({
"specialization": zod.enum(['backend', 'frontend', 'mobile', 'network_engineer', 'devops_sre', 'data_analyst', 'ds_ml', 'information_security', 'qa']).describe('Stable code of a specialization. A category is a specialization together with a confirmed grade; programming languages and the technology stack are separate attributes and never form a category of their own, so Backend with Go is the category `backend`, not `go`. Algorithms is a shared assessment module, not a specialization, and has no code here.\n\n- backend: Backend (development).\n- frontend: Frontend (development).\n- mobile: Mobile (development).\n- network_engineer: Network Engineer (infrastructure).\n- devops_sre: DevOps/SRE (infrastructure).\n- data_analyst: Data Analyst (data).\n- ds_ml: DS/ML (data).\n- information_security: Information security (security).\n- qa: QA (quality).\n\nAdding a value is a contract change; renaming or removing one is a breaking change.'),
"grade": zod.enum(['intern', 'junior', 'middle', 'senior']).describe('Grade of the MVP scale in ascending order: `intern`, `junior`, `middle`, `senior`. The same codes describe a self-assessed grade, which the candidate states, and a confirmed grade, which only an assessment result establishes. Lead and Architect are planned after the MVP; adding a value is a contract change.')
}).exactOptional().describe('A confirmed category filter, never a candidate declaration.'),
"confirmation_status": zod.enum(['confirmed', 'unconfirmed']).exactOptional().describe('Confirmation state for this specialization only. A result for one specialization never changes the state of another specialization.'),
"declared_grade": zod.enum(['intern', 'junior', 'middle', 'senior']).exactOptional().describe('Candidate-declared grade filter. This is a separate claim and cannot satisfy `confirmed_grade` or `confirmed_category`.'),
"stack": zod.array(zod.enum(['go', 'postgresql', 'kafka', 'docker']).describe('A stack code that the anonymous card may expose. Search filters do not accept arbitrary profile text or candidate-provided evidence.')).min(1).max(searchOrganizationMatchesBodyTwoFiltersStackMax).exactOptional(),
"conditions": zod.object({
"work_formats": zod.array(zod.enum(['remote', 'office', 'hybrid']).describe('Acceptable work format: `remote`, `office`, or `hybrid`.')).min(1).max(searchOrganizationMatchesBodyTwoFiltersConditionsWorkFormatsMax).exactOptional(),
"salary_compatibility": zod.enum(['compatible', 'not_compatible']).exactOptional().describe('A coarse compatibility result only. No salary amount, minimum, range, or threshold is part of the anonymous card.')
}).exactOptional().describe('Filters against safe, coarse card conditions. No candidate location, salary amount, salary minimum, or salary range is accepted.')
}).describe('Optional filters over the current organization-visible bank. An empty object means no additional filter. Confirmed and declared grades are separate fields; a declaration never satisfies a confirmed-grade or category filter. Conditions use only the safe, coarse card fields.')
}).describe('Search the current organization-visible bank. An empty `filters` object includes all otherwise eligible specializations as separate entries.')]).describe('Search either a Need.requirements_version snapshot or the whole organization-visible bank with explicit filters. Unknown fields are rejected by both closed request variants.')
export type SearchOrganizationMatchesBody = zod.input<typeof SearchOrganizationMatchesBody>;
export type SearchOrganizationMatchesBodyOutput = zod.output<typeof SearchOrganizationMatchesBody>;
@@ -6,8 +6,6 @@
*/
export * from './anonymousCardContent.zod';
export * from './candidateExperienceBand.zod';
export * from './candidateSalaryCompatibility.zod';
export * from './candidateWorkFormat.zod';
export * from './cardAccess.zod';
export * from './cardAccessKind.zod';
+610
View File
@@ -0,0 +1,610 @@
"""Check the split match contract without requiring a generated API bundle."""
from __future__ import annotations
import copy
import json
import subprocess
import tempfile
import unittest
from pathlib import Path
from typing import Any
import yaml
ROOT = Path(__file__).resolve().parents[1]
CORE = ROOT / "api" / "core"
API_ROOT = ROOT / "api"
SCHEMA_PATH = CORE / "components" / "schemas" / "match_schemas.yml"
ROUTE_PATH = CORE / "routes" / "matches.yml"
EXAMPLES_PATH = CORE / "components" / "examples" / "matches.yml"
REDOCLY_PATH = API_ROOT / "node_modules" / ".bin" / "redocly"
FORBIDDEN_PROPERTIES = {
"account_id",
"answers",
"candidate_name",
"candidate_id",
"candidate_internal_id",
"contact",
"contacts",
"contact_email",
"contact_phone",
"email",
"full_name",
"fsp_hiding_reason",
"fsp_reason",
"fsp_suppression_reason",
"fsp_visibility_reason",
"hidden_fsp_reason",
"hidden_reason",
"min_salary",
"phone",
"phone_number",
"profile_id",
"raw_answer",
"raw_answers",
"salary",
"salary_amount",
"salary_minimum",
"candidate_minimum",
"salary_from",
"salary_range",
"salary_to",
"source_text",
"telegram",
}
FORBIDDEN_PROPERTY_FRAGMENTS = {
"suppression_reason",
"hidden_reason",
"fsp_hidden",
"fsp_suppress",
}
UNCONFIRMED_MEASUREMENTS = {
"ability_estimate",
"percentile",
"p",
"t",
"test_percentile",
"theta",
}
def load_yaml(path: Path) -> dict[str, Any]:
with path.open(encoding="utf-8") as stream:
value = yaml.safe_load(stream)
if not isinstance(value, dict):
raise TypeError(f"{path} must contain a YAML mapping")
return value
def load_contract() -> tuple[dict[str, Any], dict[str, Any], dict[str, Any]]:
schema_document = load_yaml(SCHEMA_PATH)
route_document = load_yaml(ROUTE_PATH)
examples_document = load_yaml(EXAMPLES_PATH)
return (
schema_document.get("schemas", {}),
route_document,
examples_document,
)
def resolve_local(schema: dict[str, Any], schemas: dict[str, Any]) -> dict[str, Any]:
current = schema
visited: set[str] = set()
while "$ref" in current:
reference = current["$ref"]
if not reference.startswith("#/schemas/"):
return current
name = reference.rsplit("/", 1)[1]
if name in visited:
raise AssertionError(f"cyclic local schema reference: {name}")
visited.add(name)
current = schemas[name]
return current
def local_reference_name(schema: dict[str, Any]) -> str:
reference = schema.get("$ref", "")
if not reference.startswith("#/schemas/"):
raise AssertionError(f"expected local schema reference, got {reference!r}")
return reference.rsplit("/", 1)[1]
def walk_schema(
schema: dict[str, Any], schemas: dict[str, Any], seen: set[str] | None = None
):
"""Yield a local schema and its locally referenced child schemas."""
active = set() if seen is None else seen
current = schema
reference = current.get("$ref")
if isinstance(reference, str) and reference.startswith("#/schemas/"):
name = reference.rsplit("/", 1)[1]
if name in active:
return
active.add(name)
current = schemas[name]
yield current
for key in ("properties",):
properties = current.get(key, {})
if isinstance(properties, dict):
for child in properties.values():
if isinstance(child, dict):
yield from walk_schema(child, schemas, active)
items = current.get("items")
if isinstance(items, dict):
yield from walk_schema(items, schemas, active)
for key in ("oneOf", "anyOf", "allOf"):
branches = current.get(key, [])
if isinstance(branches, list):
for child in branches:
if isinstance(child, dict):
yield from walk_schema(child, schemas, active)
def property_names(schema: dict[str, Any], schemas: dict[str, Any]) -> set[str]:
names: set[str] = set()
for node in walk_schema(schema, schemas):
properties = node.get("properties", {})
if isinstance(properties, dict):
names.update(properties)
return names
def example_value(examples: dict[str, Any], name: str) -> dict[str, Any]:
example = examples[name]
value = example.get("value")
if not isinstance(value, dict):
raise TypeError(f"example {name} must contain an object value")
return value
def card_properties(card: dict[str, Any], schemas: dict[str, Any]) -> set[str]:
properties = property_names(card, schemas)
return properties
def assert_no_sensitive_keys(test: unittest.TestCase, value: Any) -> None:
if isinstance(value, dict):
for key, child in value.items():
test.assertNotIn(key, FORBIDDEN_PROPERTIES)
test.assertFalse(
any(
fragment in key.lower() for fragment in FORBIDDEN_PROPERTY_FRAGMENTS
),
key,
)
assert_no_sensitive_keys(test, child)
elif isinstance(value, list):
for child in value:
assert_no_sensitive_keys(test, child)
def lint_match_examples(
request_examples: dict[str, Any], response_examples: dict[str, Any]
) -> subprocess.CompletedProcess[str]:
if not REDOCLY_PATH.is_file():
raise AssertionError(f"Redocly CLI is unavailable: {REDOCLY_PATH}")
schema_path = Path("..") / "core" / "components" / "schemas" / "match_schemas.yml"
with tempfile.TemporaryDirectory(
prefix="match-contract-", dir=API_ROOT
) as directory:
temporary = Path(directory)
config_path = temporary / "redocly.yml"
config_path.write_text(
yaml.safe_dump(
{
"extends": [],
"rules": {"no-invalid-media-type-examples": "error"},
},
sort_keys=False,
),
encoding="utf-8",
)
content: dict[str, Any] = {}
if request_examples:
content["requestBody"] = {
"required": True,
"content": {
"application/json": {
"schema": {
"$ref": f"{schema_path.as_posix()}#/schemas/MatchSearchRequest"
},
"examples": {
name: {"value": value}
for name, value in request_examples.items()
},
}
},
}
content["responses"] = {
"200": {
"description": "Match results",
"content": {
"application/json": {
"schema": {
"$ref": f"{schema_path.as_posix()}#/schemas/MatchSearchResponse"
},
"examples": {
name: {"value": value}
for name, value in response_examples.items()
},
}
},
}
}
document_path = temporary / "openapi.yml"
document_path.write_text(
yaml.safe_dump(
{
"openapi": "3.2.0",
"info": {"title": "Match contract test", "version": "1.0.0"},
"paths": {"/matches": {"post": content}},
},
sort_keys=False,
),
encoding="utf-8",
)
return subprocess.run(
[
str(REDOCLY_PATH),
"lint",
str(document_path),
"--config",
str(config_path),
"--format",
"json",
],
cwd=API_ROOT,
capture_output=True,
check=False,
text=True,
timeout=30,
)
class MatchContractTest(unittest.TestCase):
@classmethod
def setUpClass(cls) -> None:
cls.schemas, cls.route, cls.examples = load_contract()
def test_request_selects_need_requirements_version_or_bank_filters(self) -> None:
request = self.schemas["MatchSearchRequest"]
branches = {local_reference_name(branch) for branch in request["oneOf"]}
self.assertEqual(branches, {"MatchSearchByNeed", "MatchSearchByBank"})
need = self.schemas["MatchSearchByNeed"]
self.assertFalse(need["additionalProperties"])
self.assertEqual(set(need["required"]), {"need_id", "requirements_version"})
self.assertEqual(need["properties"]["need_id"]["format"], "uuid")
self.assertEqual(
need["properties"]["requirements_version"]["$ref"],
"./need_schemas.yml#/schemas/NeedVersion",
)
self.assertIn("Need.requirements_version", need["description"])
self.assertNotIn("version", need["properties"])
bank = self.schemas["MatchSearchByBank"]
self.assertFalse(bank["additionalProperties"])
self.assertEqual(bank["required"], ["filters"])
filters = resolve_local(bank["properties"]["filters"], self.schemas)
self.assertFalse(filters["additionalProperties"])
fields = filters["properties"]
self.assertTrue(
{
"specialization",
"confirmed_grade",
"confirmed_category",
"confirmation_status",
"declared_grade",
"stack",
"conditions",
}.issubset(fields)
)
self.assertEqual(
fields["confirmed_category"]["$ref"], "#/schemas/MatchGradeFilter"
)
self.assertEqual(
fields["confirmed_grade"]["$ref"],
"./catalog_schemas.yml#/schemas/GradeCode",
)
self.assertEqual(
fields["declared_grade"]["$ref"],
"./catalog_schemas.yml#/schemas/GradeCode",
)
self.assertIn("separate", fields["declared_grade"]["description"])
self.assertNotIn("salary", fields)
need_example = example_value(self.examples, "SearchByNeed")
self.assertEqual(
set(need_example), {"need_id", "requirements_version", "filters"}
)
self.assertGreaterEqual(need_example["requirements_version"], 1)
bank_example = example_value(self.examples, "SearchByBank")
self.assertEqual(set(bank_example), {"filters"})
self.assertEqual(
bank_example["filters"]["confirmed_category"],
{"specialization": "backend", "grade": "middle"},
)
self.assertEqual(bank_example["filters"]["declared_grade"], "junior")
conditions = resolve_local(fields["conditions"], self.schemas)
self.assertEqual(
set(conditions["properties"]), {"work_formats", "salary_compatibility"}
)
self.assertFalse(conditions["additionalProperties"])
self.assertNotIn("salary_from", conditions["properties"])
self.assertNotIn("salary_minimum", conditions["properties"])
def test_every_local_object_schema_is_closed(self) -> None:
for name, schema in self.schemas.items():
with self.subTest(schema=name):
for node in walk_schema(schema, self.schemas):
if node.get("type") == "object":
self.assertIs(node.get("additionalProperties"), False)
def test_unconfirmed_schema_keeps_nullable_category_and_strength(self) -> None:
unconfirmed = self.schemas["MatchUnconfirmedCandidate"]
properties = unconfirmed["properties"]
self.assertFalse(unconfirmed["additionalProperties"])
self.assertTrue({"category", "strength"}.issubset(unconfirmed["required"]))
self.assertEqual(properties["category"]["type"], "null")
self.assertEqual(properties["strength"]["type"], "null")
self.assertEqual(properties["confirmation_status"]["enum"], ["unconfirmed"])
components = resolve_local(properties["components"], self.schemas)
self.assertEqual(set(components["properties"]), {"fit", "coverage"})
self.assertFalse(
UNCONFIRMED_MEASUREMENTS.intersection(components["properties"])
)
self.assertFalse(
UNCONFIRMED_MEASUREMENTS.intersection(
property_names(unconfirmed, self.schemas)
)
)
self.assertEqual(
properties["candidate_handle"]["$ref"],
"./common_schemas.yml#/schemas/CandidateHandle",
)
confirmed_components = resolve_local(
self.schemas["MatchConfirmedCandidate"]["properties"]["components"],
self.schemas,
)
self.assertEqual(
set(confirmed_components["properties"]),
{
"fit",
"coverage",
"domain",
"semantics",
"percentile",
"competition",
"freshness",
"responsiveness",
"rank_score",
},
)
for name, component in confirmed_components["properties"].items():
with self.subTest(component=name):
resolved = resolve_local(component, self.schemas)
if name == "percentile":
self.assertIn("oneOf", resolved)
self.assertIn({"type": "null"}, resolved["oneOf"])
else:
self.assertEqual(resolved["type"], "number")
def test_unknown_flags_are_bounded_and_explain_required_unknowns(self) -> None:
reasons = set(self.schemas["MatchUnknownReason"]["enum"])
self.assertTrue(
{
"ml_unavailable",
"cohort_below_30",
"no_confirmation_for_specialization",
"not_in_public_card",
}.issubset(reasons)
)
self.assertFalse(any("fsp" in reason.lower() for reason in reasons))
flags = self.schemas["MatchUnknownFlags"]
self.assertEqual(flags["maxItems"], len(self.schemas["MatchUnknownComponent"]["enum"]))
self.assertIn(
"unknown_flags", self.schemas["MatchUnconfirmedCandidate"]["required"]
)
def test_result_schema_exposes_only_anonymous_card_allowlist(self) -> None:
for name in ("MatchConfirmedCandidate", "MatchUnconfirmedCandidate"):
with self.subTest(schema=name):
properties = property_names(self.schemas[name], self.schemas)
self.assertFalse(FORBIDDEN_PROPERTIES.intersection(properties))
self.assertIn("candidate_handle", properties)
self.assertNotIn("candidate_id", properties)
self.assertNotIn("email", properties)
self.assertNotIn("salary_minimum", properties)
context = resolve_local(
self.schemas["MatchConfirmedCandidate"]["properties"]["public_context"],
self.schemas,
)
self.assertEqual(
set(context["properties"]),
{"stack", "experience_band", "work_formats", "salary_compatibility"},
)
def test_route_declares_protected_no_store_operation_and_source_examples(
self,
) -> None:
self.assertEqual(self.route["post"]["operationId"], "SearchOrganizationMatches")
self.assertEqual(
self.route["post"]["security"],
[{"sessionCookie": [], "sessionCsrf": []}],
)
self.assertEqual(
self.route["post"]["parameters"][0]["$ref"],
"../components/parameters.yml#/OrganizationId",
)
operation = self.route["post"]
request_schema_ref = operation["requestBody"]["content"]["application/json"][
"schema"
]["$ref"]
self.assertEqual(
request_schema_ref, "../components/schemas.yml#/MatchSearchRequest"
)
response = operation["responses"]["200"]
self.assertEqual(
response["headers"]["Cache-Control"]["$ref"],
"../components/headers.yml#/CacheControlNoStore",
)
self.assertEqual(
response["content"]["application/json"]["schema"]["$ref"],
"../components/schemas.yml#/MatchSearchResponse",
)
example_names = set(self.examples)
for collection in (
operation["requestBody"]["content"]["application/json"]["examples"],
response["content"]["application/json"]["examples"],
):
for example in collection.values():
reference = example["$ref"]
self.assertTrue(
reference.startswith("../components/examples/matches.yml#/")
)
self.assertIn(reference.rsplit("/", 1)[1], example_names)
def test_examples_cover_empty_three_groups_and_specialization_independence(
self,
) -> None:
three_groups = example_value(self.examples, "ThreeGroups")
groups = three_groups["groups"]
self.assertEqual(set(groups), {"main", "near", "unconfirmed"})
self.assertTrue(groups["main"])
self.assertTrue(groups["near"])
self.assertTrue(groups["unconfirmed"])
self.assertEqual(
example_value(self.examples, "Empty")["groups"],
{"main": [], "near": [], "unconfirmed": []},
)
backend = groups["main"][0]
network = groups["unconfirmed"][0]
for card in (*groups["main"], *groups["near"], *groups["unconfirmed"]):
with self.subTest(handle=card["candidate_handle"]):
self.assertRegex(card["candidate_handle"], r"^cv1_[A-Za-z0-9_-]{43}$")
self.assertEqual(backend["specialization"], "backend")
self.assertEqual(network["specialization"], "network_engineer")
self.assertEqual(backend["confirmation_status"], "confirmed")
self.assertEqual(network["confirmation_status"], "unconfirmed")
self.assertEqual(backend["candidate_handle"], network["candidate_handle"])
self.assertEqual(backend["category"]["specialization"], "backend")
self.assertIsNone(network["category"])
self.assertIsNone(network["strength"])
self.assertEqual(
network["unknown_flags"][0]["reason"], "no_confirmation_for_specialization"
)
for group_name in ("main", "near"):
for card in groups[group_name]:
with self.subTest(
group=group_name, specialization=card["specialization"]
):
self.assertEqual(card["confirmation_status"], "confirmed")
self.assertEqual(
card["category"]["specialization"], card["specialization"]
)
self.assertIn(card["strength"], {"standard", "strong"})
def test_ml_and_small_cohort_examples_use_explicit_unknowns(self) -> None:
ml_response = example_value(self.examples, "MLUnavailable")
ml_card = ml_response["groups"]["main"][0]
self.assertEqual(ml_card["components"]["semantics"], 0.5)
self.assertIn(
{"component": "semantics", "reason": "ml_unavailable"},
ml_card["unknown_flags"],
)
cohort_response = example_value(self.examples, "CohortBelow30")
cohort_card = cohort_response["groups"]["main"][0]
self.assertIsNone(cohort_card["components"]["percentile"])
self.assertIn(
{"component": "percentile", "reason": "cohort_below_30"},
cohort_card["unknown_flags"],
)
self.assertNotIn("cohort_size", cohort_card)
def test_bank_response_echoes_normalized_filter_snapshot(self) -> None:
fields = set(self.schemas["MatchAppliedFilters"]["required"])
self.assertEqual(fields, set(self.schemas["MatchAppliedFilters"]["properties"]))
for name in ("ThreeGroups", "Empty", "MLUnavailable", "CohortBelow30"):
with self.subTest(example=name):
source = example_value(self.examples, name)["source"]
self.assertEqual(source["kind"], "bank")
self.assertEqual(set(source["filters"]), fields)
def test_examples_do_not_contain_private_keys(self) -> None:
for name, example in self.examples.items():
with self.subTest(example=name):
assert_no_sensitive_keys(self, example.get("value"))
def test_source_examples_validate_against_local_and_external_schemas(self) -> None:
request_names = ("SearchByNeed", "SearchByBank")
request_examples = {
name: example_value(self.examples, name) for name in request_names
}
response_names = tuple(
name for name in self.examples if name not in request_names
)
response_examples = {
name: example_value(self.examples, name) for name in response_names
}
groups = example_value(self.examples, "ThreeGroups")["groups"]
self.assertEqual(set(groups), {"main", "near", "unconfirmed"})
self.assertTrue(groups["main"])
self.assertTrue(groups["near"])
self.assertEqual(
example_value(self.examples, "Empty")["groups"],
{"main": [], "near": [], "unconfirmed": []},
)
result = lint_match_examples(request_examples, response_examples)
self.assertEqual(result.returncode, 0, result.stdout or result.stderr)
def test_schema_validation_rejects_private_card_fields(self) -> None:
invalid_examples: dict[str, Any] = {}
forbidden_values = {
"email": "candidate@example.test",
"candidate_internal_id": "candidate-123",
"salary_minimum": 1000,
}
baseline = example_value(self.examples, "ThreeGroups")
for field, value in forbidden_values.items():
response = copy.deepcopy(baseline)
response["groups"]["main"][0][field] = value
invalid_examples[field] = response
result = lint_match_examples({}, invalid_examples)
self.assertNotEqual(result.returncode, 0, result.stdout or result.stderr)
try:
problems = json.loads(result.stdout).get("problems", [])
except json.JSONDecodeError as error:
self.fail(
f"Redocly did not return JSON diagnostics: {error}: {result.stdout}"
)
messages = [problem.get("message", "") for problem in problems]
self.assertTrue(messages, result.stdout or result.stderr)
for field in forbidden_values:
with self.subTest(field=field):
self.assertTrue(
any(
problem.get("ruleId") == "no-invalid-media-type-examples"
and field in problem.get("message", "")
for problem in problems
),
result.stdout or result.stderr,
)
if __name__ == "__main__":
unittest.main()