Skip to content

Job Entity

Chazona Baum edited this page Jun 24, 2026 · 2 revisions

Relevant source files

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.

Data Model

The Job struct in Rust and the Job interface in TypeScript mirror each other to ensure type safety across the Tauri IPC bridge.

Fields and Schema

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

Lenient Parsing

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


Job Status State Machine

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).

Status Definitions

  • 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.

Transition Logic

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


Pipeline Integration & Section Upsert

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.

Markdown Sections

The following sections are standard in a Job note:

  1. Alignment analysis: A narrative summary of why the job does or does not fit the user's profile.
  2. Fit flags: Bulleted list of specific match highlights or [DEALBREAKER] / [CAUTION] warnings.
  3. Research notes: Provenance for fields found during the research-gaps stage.
  4. 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

Gap Detection

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


Visualizing the Job Lifecycle

Logic Flow: Natural Language to Code Entity

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
Loading

Sources:src-tauri/src/job.rs#175-207src/lib/jobDetail.ts#48-60src/lib/job.ts#56-58

State Machine: Status Transitions

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


Frontend Implementation

The Job Detail page (src/routes/jobs/[slug]/+page.svelte) provides the interface for viewing fit scores and managing status.

Key Components

  • Fit Breakdown: Displays the five sub-scores (Seniority, Skills, Comp, Arrangement, Domain) using subScoreRows.
  • Status Control: A Combobox that filters available options using nextHumanStatuses.
  • Inline Editing: Allows manual correction of structured fields (e.g., fixing a misparsed comp_low), which triggers a maybeRescore call to update fit scores.
  • Markdown Rendering: Uses renderMarkdown to display the narrative sections extracted by jobSections.

Sources:src/routes/jobs/[slug]/+page.svelte:15-22, src/routes/jobs/[slug]/+page.svelte:101-108, src/lib/jobDetail.ts#66-76

Clone this wiki locally