-
Notifications
You must be signed in to change notification settings - Fork 0
Job Entity
Relevant source files
- src-tauri/src/job.rs
- src-tauri/src/pipeline/gaps.rs
- src/lib/job.ts
- src/lib/jobDetail.test.ts
- src/lib/jobDetail.ts
- src/lib/jobStatus.test.ts
- src/lib/jobStatus.ts
- src/lib/styles/layout/jobs.css
- src/routes/jobs/[slug]/+page.svelte
- src/routes/jobs/[slug]/+page.ts
The Job Entity represents a specific role at a company. It is the primary unit of work for the automated pipeline, which transitions it from a raw URL to a structured, researched, and scored decision brief. Like other entities in Lodestar, Jobs are persisted as Markdown files within the jobs/ directory of the vault, utilizing YAML frontmatter for structured fields and Markdown sections for narrative analysis.
The Job struct in Rust and the Job interface in TypeScript mirror each other to ensure type safety across the Tauri IPC bridge.
The model includes compensation, role classification, location logistics, and pipeline-generated metadata.
| Category | Fields | Description |
|---|---|---|
| Identity |
title, company, url
|
Basic role info. company is stored as a wikilink (e.g., [[slug]]). |
| Classification |
level, employment_type, yoe_min, yoe_max
|
Seniority and contract type. |
| Compensation |
comp_low, comp_high, comp_currency, comp_period
|
Structured pay data. |
| Skills |
tech_stack, required_skills, preferred_skills
|
String arrays for matching. |
| Logistics |
remote, location_constraints, visa_sponsorship
|
Work arrangement and legalities. |
| Fit Scores |
fit_score, fit_seniority, fit_skills, etc. |
Integer scores (0-100) generated by the fit engine. |
| Metadata |
status, researched, jd_fetched
|
Pipeline tracking and provenance. |
Sources:src-tauri/src/job.rs#60-111src/lib/job.ts#4-53
The system uses a "lenient" parser for YAML frontmatter. This allows the LLM to return slightly malformed types (e.g., a string where an integer is expected) which the application attempts to coerce before failing. Sources:src-tauri/src/job.rs#175-177
The status field tracks the Job through its lifecycle. Transitions are divided into App-Driven (automated by the pipeline) and Human-Driven (decisions made by the user).
-
new: Initial state after discovery. -
detailed: JD has been scraped and structured. -
scored: Fit scoring engine has run against the user profile. -
selected: Human has decided to pursue the role. -
applied: Human has submitted an application. -
skipped: Human (or filter) has discarded the role.
The frontend restricts human transitions based on the current state to maintain process integrity.
| Current Status | Legal Human Transitions |
|---|---|
new |
skipped |
detailed |
skipped |
scored |
selected, skipped
|
selected |
applied |
applied |
(Terminal) |
skipped |
(Terminal) |
Sources:src-tauri/src/job.rs#10-31src/lib/jobStatus.ts#59-75src/lib/jobStatus.test.ts#93-125
The Job entity is unique because the pipeline writes narrative content into specific Markdown sections. The system uses a "section upsert" pattern where the pipeline identifies headings (e.g., ## Alignment analysis) and replaces the content beneath them while preserving the rest of the file.
The following sections are standard in a Job note:
- Alignment analysis: A narrative summary of why the job does or does not fit the user's profile.
- Fit flags: Bulleted list of specific match highlights or
[DEALBREAKER]/[CAUTION]warnings. - Research notes: Provenance for fields found during the
research-gapsstage. - JD — structured: A cleaned, LLM-generated version of the original job description.
Sources:src/lib/jobDetail.ts#48-60src/lib/jobDetail.test.ts#78-112
Before the research phase, the system runs detect_gaps to identify which RESEARCHABLE_FIELDS are missing values. This list is passed to the LLM to focus its web search.
Sources:src-tauri/src/pipeline/gaps.rs#10-38
This diagram shows how a raw Job Description is transformed into a structured Job entity.
Title: Job Structuring Flow
flowchart TD
subgraph subGraph1 ["Code Entity Space (Rust/TS)"]
D["Job Struct (job.rs)"]
E["parse_job()"]
F["jobSections() (jobDetail.ts)"]
G["JobDetail Interface (job.ts)"]
end
subgraph subGraph0 ["Natural Language Space (Markdown/HTML)"]
A["Raw HTML from Scraper"]
B["Unsupported markdown: heading"]
C["Unsupported markdown: heading"]
end
A --> B
B --> D
D --> G
G --> F
F --> C
Sources:src-tauri/src/job.rs#175-207src/lib/jobDetail.ts#48-60src/lib/job.ts#56-58
This diagram illustrates the JobStatus transitions, distinguishing between automated and manual steps.
Title: Job Status State Machine
Sources:src-tauri/src/job.rs#12-31src/lib/jobStatus.ts#59-75
The Job Detail page (src/routes/jobs/[slug]/+page.svelte) provides the interface for viewing fit scores and managing status.
- Fit Breakdown: Displays the five sub-scores (Seniority, Skills, Comp, Arrangement, Domain) using
subScoreRows. - Status Control: A
Comboboxthat filters available options usingnextHumanStatuses. - Inline Editing: Allows manual correction of structured fields (e.g., fixing a misparsed
comp_low), which triggers amaybeRescorecall to update fit scores. - Markdown Rendering: Uses
renderMarkdownto display the narrative sections extracted byjobSections.
Sources:src/routes/jobs/[slug]/+page.svelte:15-22, src/routes/jobs/[slug]/+page.svelte:101-108, src/lib/jobDetail.ts#66-76