Skip to content

Job application tracker and AI-powered job search assistant. Helps job seekers manage their search journey with AI resume review, job matching, task logging, and application analytics, all while keeping your data private.

4.7 KB
Raw Blame
description: Cover letter prompt regression tests

providers:
  - id: openai:chat:deepseek-v4-flash
    label: deepseek-v4-flash
    config:
      apiBaseUrl: https://api.deepseek.com
      apiKeyEnvar: DEEPSEEK_API_KEY
      showThinking: false
      temperature: 0
      max_tokens: 8192

  # Local Ollama via its OpenAI-compatible endpoint. reasoning_effort goes in
  # passthrough to clear promptfoo's reasoning-model name check; disabling
  # thinking matches the app, where ollama-ai-provider-v2 sets think:false.
  - id: openai:chat:qwen3.5:9b
    label: ollama-qwen3.5-9b
    config:
      apiBaseUrl: http://localhost:11434/v1
      apiKey: ollama
      temperature: 0
      max_tokens: 8192
      passthrough:
        reasoning_effort: "none"

prompts:
  - file://./prompt.ts

# Grading provider for every llm-rubric below. Declared once here rather than
# inline per assertion, so a new rubric can't silently inherit promptfoo's
# defaults for these two settings:
#   max_tokens — the default 1024 is a shared budget, and DeepSeek's reasoning
#     can consume all of it, leaving zero content and a "No output" grade.
#   showThinking — defaults true, which prepends "Thinking: ...\n\n" to the
#     grade and breaks llm-rubric's JSON extraction.
defaultTest:
  options:
    provider:
      id: openai:chat:deepseek-v4-flash
      config:
        apiBaseUrl: https://api.deepseek.com
        apiKeyEnvar: DEEPSEEK_API_KEY
        showThinking: false
        temperature: 0
        max_tokens: 4096

# The letter is generated at a creative temperature in the app (TEMPERATURES.
# FEEDBACK), but evals run at 0 for repeatability — same trade-off as the other
# markdown prompts here.
tests:
  - description: Backend resume vs backend JD - no prior match guidance
    vars:
      resumeText: file://../job-match/fixtures/backend-resume.txt
      jobDescription: file://../job-match/fixtures/backend-job.txt
    assert:
      - type: javascript
        value: file://./assertions.ts:assertNotJsonOrFenced
      - type: javascript
        value: file://./assertions.ts:assertStartsWithSalutation
      - type: javascript
        value: file://./assertions.ts:assertSignOff
      - type: javascript
        value: file://./assertions.ts:assertCandidateNameSignature
      - type: javascript
        value: file://./assertions.ts:assertWordCount
      - type: javascript
        value: file://./assertions.ts:assertNoPlaceholders
      - type: javascript
        value: file://./assertions.ts:assertNoInventedNumbers
      # Letter must engage the JD's actual must-haves, not generic enthusiasm.
      - type: icontains-any
        value:
          - "Kubernetes"
          - "Go"
          - "AWS"
      - type: llm-rubric
        value: >-
          Every employer, job title, date, degree, certification, and metric in
          the letter must appear in the candidate's resume below. Fail if the
          letter names any employer, title, school, degree, or certification the
          resume does not contain, states an achievement the resume does not
          support, or credits one employer with an achievement the resume lists
          under a different employer. Company names taken from the job posting
          are acceptable when used as the employer being applied to. Judge only
          titles the letter claims the candidate has HELD at a named employer —
          a general self-description aligned to the role applied for ("I am a
          senior backend engineer") is not a title claim and is acceptable.
          Resume:

          {{resumeText}}

  - description: Backend resume vs backend JD - with saved match guidance
    vars:
      resumeText: file://../job-match/fixtures/backend-resume.txt
      jobDescription: file://../job-match/fixtures/backend-job.txt
      guidance: file://./fixtures/match-guidance.txt
    assert:
      - type: javascript
        value: file://./assertions.ts:assertNotJsonOrFenced
      - type: javascript
        value: file://./assertions.ts:assertStartsWithSalutation
      - type: javascript
        value: file://./assertions.ts:assertSignOff
      - type: javascript
        value: file://./assertions.ts:assertCandidateNameSignature
      - type: javascript
        value: file://./assertions.ts:assertWordCount
      - type: javascript
        value: file://./assertions.ts:assertNoPlaceholders
      - type: javascript
        value: file://./assertions.ts:assertNoInventedNumbers
      # The guidance block is the only untested branch of
      # buildCoverLetterPrompt: its Tailoring Tips must actually land.
      - type: icontains
        value: "Meridian Technologies"
      - type: icontains-any
        value:
          - "95K"
          - "95,000"
          - "documents per second"
          - "documents/second"