-
Notifications
You must be signed in to change notification settings - Fork 0
Target Criteria & Fit Weights
Relevant source files
- src-tauri/src/community.rs
- src-tauri/src/experience.rs
- src-tauri/src/fit.rs
- src-tauri/src/pipeline/filter.rs
- src-tauri/src/pipeline/mod.rs
- src-tauri/src/profile.rs
The TargetCriteria system defines the user's career preferences and technical requirements. These criteria act as the configuration for the entire application, driving the high-recall Discovery Prefilter and the high-precision Fit Scoring Engine. All data is persisted in the vault at profile/target_criteria.mdsrc-tauri/src/profile.rs#1-3
The TargetCriteria struct encapsulates all dimensions of the user's job search, from title matching to compensation floors.
Defined in src-tauri/src/profile.rs, this struct is populated by parsing the YAML frontmatter of the profile note src-tauri/src/profile.rs#37-56
| Field | Type | Description |
|---|---|---|
match_titles |
Vec<String> |
Recall-oriented aliases used for the initial discovery filter. |
target_titles |
Vec<String> |
Human-readable titles preferred for display and alignment. |
work_arrangements |
Vec<String> |
Acceptable modes (e.g., ["remote", "hybrid"]). |
target_levels |
Vec<String> |
Targeted seniority (e.g., ["senior", "dept-head"]). |
comp_floor |
Option<i64> |
The minimum acceptable salary. |
fit_weights |
FitWeights |
Tuning parameters for the scoring engine. |
The FitWeights struct contains five integer percentages that must sum to 100. These determine how much influence each dimension has on the final 0–100 fit score src-tauri/src/profile.rs#16-22
| Dimension | Default Weight | Description |
|---|---|---|
seniority |
20 | Distance between job level and targeted levels. |
skills |
25 | Coverage of required and preferred competencies. |
comp |
30 | Proximity of job high-end to user's floor/target. |
arrangement |
15 | Match between job's mode and user's preferences. |
domain |
10 | Alignment with preferred or avoided industries. |
Sources:src-tauri/src/profile.rs#11-34src-tauri/src/profile.rs#37-56
The system transitions from "Natural Language" (the Markdown note) to "Code Entities" (the Structs) to drive the pipeline.
This diagram illustrates how read_target_criteria transforms vault data into active pipeline configuration.
flowchart TD
subgraph Subsystems
PREFILTER["pipeline::filter::prefilter"]
SCORING["fit::score_fit"]
end
subgraph subGraph1 ["Code Entity Space (src-tauri/src/profile.rs)"]
FM["split_frontmatter()"]
FRONT["struct Front (Deserialize)"]
TC_STRUCT["struct TargetCriteria"]
FW_STRUCT["struct FitWeights"]
end
subgraph subGraph0 ["Vault (Markdown/YAML)"]
TC_MD["profile/target_criteria.md"]
end
TC_MD --> FM
FM --> FRONT
FRONT --> TC_STRUCT
TC_STRUCT --> FW_STRUCT
TC_STRUCT --> PREFILTER
TC_STRUCT --> SCORING
Sources:src-tauri/src/profile.rs#96-123src-tauri/src/pipeline/filter.rs#31-35src-tauri/src/fit.rs#18-20
The prefilter function in src-tauri/src/pipeline/filter.rs is the first consumer of TargetCriteria. It is designed for recall rather than precision.
- Title Matching: It performs case-insensitive containment checks. If a job title contains any string in
match_titles, it passes src-tauri/src/pipeline/filter.rs#19-23 - Intentional Inclusion: Work arrangement is not filtered here. Even if a user wants "remote," a "hybrid" role will pass the prefilter so the user can decide if a compromise is worth actioning src-tauri/src/pipeline/filter.rs#2-5
- Deduplication: It drops URLs already present in the vault and collapses duplicates within the current scrape batch src-tauri/src/pipeline/filter.rs#31-43
Sources:src-tauri/src/pipeline/filter.rs#1-43
The fit.rs module uses TargetCriteria to calculate the FitBreakdown. This is a two-layer process:
Checks for absolute dealbreakers (e.g., compensation below floor). If a Dealbreaker flag fires, the final score is collapsed to 0 src-tauri/src/fit.rs#3-8
Calculates five sub-scores (0–100) which are then weighted by FitWeights.
- Seniority Fit: Uses a two-track model (IC vs. Management). It calculates rank distance (e.g., Senior is 1 rank away from Mid) and applies a YOE Reducer if the candidate's total experience is less than the job's minimum requirement src-tauri/src/fit.rs#72-158
- Comp Fit: Scales the score based on where the job's high-end salary falls between the user's
comp_floorandcomp_targetsrc-tauri/src/fit.rs#191-200
How level_track maps strings to a coordinate system for distance calculation.
flowchart TD
TC["TargetCriteria.target_levels"]
JOB["Job.seniority_level"]
subgraph Track_Management ["Track::Management"]
M3["'vp' (3)"]
subgraph Track_Ic ["Track::Ic"]
M0["'front-line-mgmt' (0)"]
M1["'middle-mgmt' (1)"]
M2["'dept-head' (2)"]
L0["'junior' (0)"]
L1["'mid' (1)"]
L2["'senior' (2)"]
end
end
TC -.-> JOB
M0 --> M1
M1 --> M2
M2 --> M3
L0 --> L1
L1 --> L2
Sources:src-tauri/src/fit.rs#74-86src-tauri/src/fit.rs#103-140
To drive the seniority_fit YOE reducer, the system calculates the "experience envelope" from profile/experience/*.md.
-
total_months_experience: Instead of summing individual role durations (which would double-count overlaps), it finds theearliest_startandlatest_endacross allExperienceentities to determine the total career span src-tauri/src/experience.rs#96-127 - Current Roles: If a role is marked
is_current, thelatest_endis treated astodaysrc-tauri/src/experience.rs#108-117