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.
TypeScript ai-agentai-resume-analyzerapplication-trackerapplication-tracking-systematscareerjob-applicationjob-automationjob-huntingjob-searchjob-seeker-toolsjob-trackerjob-trackingjobsearchjobseekersmcpollamaresumeresume-reviewself-hosted
fix(ai): tell resume review, job match and automation match prompts today's date so recent dates aren't called future (#123); add a generated recent-dates resume-review eval and run it at the app's 0.3 temperature
Khuram Niazf57bc445b2cd
diff --git a/__tests__/dateNote.spec.ts b/__tests__/dateNote.spec.tsnew file mode 100644index 0000000..2d71fd9--- /dev/null+++ b/__tests__/dateNote.spec.ts@@ -0,0 +1,38 @@+import { describe, it, expect, vi, afterEach } from "vitest";+import { buildDateNote } from "@/lib/ai/prompts/dateNote";+import { buildResumeReviewPrompt } from "@/lib/ai/prompts/resume-review";+import { buildJobMatchPrompt } from "@/lib/ai/prompts/job-match";+import { buildAutomationJobMatchPrompt } from "@/lib/ai/prompts/automation-match";++describe("buildDateNote", () => {+ afterEach(() => vi.useRealTimers());++ it("states today's date and that everything up to this month is past", () => {+ expect(buildDateNote(new Date("2026-09-19T12:00:00Z"))).toBe(+ "Today's date is 2026-09-19 (September 2026). Every date up to September 2026 — including all of 2025 and earlier, and January through September 2026 — is in the past.",+ );+ });++ it("derives date, month and year from UTC so they never disagree", () => {+ // Late on Dec 31 in the Americas is already Jan 1 in UTC.+ expect(buildDateNote(new Date("2027-01-01T02:00:00Z"))).toBe(+ "Today's date is 2027-01-01 (January 2027). Every date up to January 2027 — including all of 2026 and earlier, and January 2027 — is in the past.",+ );+ });++ it("is built at request time into every date-sensitive prompt", () => {+ vi.useFakeTimers();+ vi.setSystemTime(new Date("2026-09-19T12:00:00Z"));+ const note = buildDateNote();++ expect(buildResumeReviewPrompt("resume")).toContain(+ `${note} Do not comment on any date unless it is later than today.`,+ );+ for (const prompt of [+ buildJobMatchPrompt("resume", "job"),+ buildAutomationJobMatchPrompt("resume", "job"),+ ]) {+ expect(prompt).toContain(`${note} Use it for any years-of-experience reasoning.`);+ }+ });+});diff --git a/evals/promptfooconfig.yaml b/evals/promptfooconfig.yamlindex e076231..32490fc 100644--- a/evals/promptfooconfig.yaml+++ b/evals/promptfooconfig.yaml@@ -89,7 +89,22 @@ tests:- "Responsible for"- "Helped with"+ - description: "[resume-review] recent dates resume - no future-date claim (#123)"+ vars:+ task: resume-review+ resumeText: file://./resume-review/fixtures/recent-dates.ts+ assert:+ - type: javascript+ value: file://./resume-review/assertions.ts:assertNotJson+ - type: javascript+ value: file://./resume-review/assertions.ts:assertScoresLine+ - type: javascript+ value: file://./resume-review/assertions.ts:assertRequiredSections+ - type: javascript+ value: file://./resume-review/assertions.ts:assertNoFutureDateClaim+# Job match (interactive, full 7-section)+- description: "[job-match] backend resume vs backend JD - strong fit"vars:task: job-matchdiff --git a/evals/resume-review/assertions.ts b/evals/resume-review/assertions.tsindex 7136221..25c253a 100644--- a/evals/resume-review/assertions.ts+++ b/evals/resume-review/assertions.ts@@ -1,4 +1,5 @@import { stripThinking } from '../../src/lib/ai/stripThinking';+import { recentDates } from './fixtures/recent-dates';type AssertionResult = { pass: boolean; score: number; reason: string };@@ -150,3 +151,22 @@ export function assertWeakScoresLow(output: string): AssertionResult {: `weak resume overall<=50/impact<=30 expected, got overall=${scores.overall} impact=${scores.impact}`,};}++// Issue #123: without today's date the model called the fixture's recent+// past dates future, or its back-to-back roles overlapping. A line needs one+// of those years or "date" too, so "future-looking achievements" passes, and+// a correct "no future dates" is not a claim.+export function assertNoFutureDateClaim(output: string): AssertionResult {+ const dateWord = new RegExp(`${recentDates().years.join('|')}|\\bdates?\\b`, 'i');+ const hits = stripThinking(output)+ .split('\n')+ .filter(+ (line) =>+ (/future|not yet|impossible/i.test(line) && dateWord.test(line) && !/\bno future dates?\b/i.test(line)) ||+ /overlap/i.test(line),+ )+ .map((line) => line.trim().slice(0, 160));+ return hits.length === 0+ ? { pass: true, score: 1, reason: 'No future-date or overlap claim' }+ : { pass: false, score: 0, reason: `Past date flagged: ${hits.join(' || ')}` };+}diff --git a/evals/resume-review/fixtures/recent-dates.ts b/evals/resume-review/fixtures/recent-dates.tsnew file mode 100644index 0000000..0ca8b53--- /dev/null+++ b/evals/resume-review/fixtures/recent-dates.ts@@ -0,0 +1,65 @@+// Issue #123 fixture. The recent dates are generated relative to the run so+// they always sit past the model's training cutoff; fixed dates would drift+// behind newer cutoffs and the test would pass even without the date note.++const MONTHS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];++function monthsAgo(n: number, now: Date): Date {+ return new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth() - n, 1));+}++function label(d: Date): string {+ return `${MONTHS[d.getUTCMonth()]} ${d.getUTCFullYear()}`;+}++export function recentDates(now: Date = new Date()) {+ const currentStart = monthsAgo(5, now);+ const previousEnd = monthsAgo(6, now);+ const cert = monthsAgo(2, now);+ return {+ currentStart: label(currentStart),+ previousEnd: label(previousEnd),+ cert: label(cert),+ years: [...new Set([currentStart, previousEnd, cert].map((d) => String(d.getUTCFullYear())))],+ };+}++function buildResume(): string {+ const d = recentDates();+ return `Jordan Avery+Kitchener, ON | [email protected] | linkedin.com/in/jordanavery++SUMMARY+Embedded and R&D engineer with experience in firmware, sensor hardware and test automation.++EXPERIENCE++R&D Engineer — Northwind Labs, Waterloo, ON (${d.currentStart} – Present)+- Worked on prototype sensor boards for the new product line+- Wrote firmware in C for STM32 microcontrollers+- Helped with test fixtures and lab automation scripts in Python++Senior Embedded Engineer — Corvid Systems, Toronto, ON (Mar 2023 – ${d.previousEnd})+- Led firmware development for a battery management system shipped to 12,000 units+- Reduced boot time by 40% by reworking the bootloader+- Mentored two junior engineers++Embedded Engineer — Halcyon Devices, Ottawa, ON (Jun 2018 – Aug 2021)+- Responsible for maintaining legacy firmware+- Wrote unit tests for the motor control library++EDUCATION+Bachelor of Applied Science, Electrical Engineering — University of Waterloo, 2018++CERTIFICATIONS+Certified LabVIEW Associate Developer (${d.cert})++SKILLS+C, C++, Python, STM32, FreeRTOS, CAN, I2C, SPI, LabVIEW, Git+`;+}++// promptfoo var loader contract: default export returning { output }.+export default function () {+ return { output: buildResume() };+}diff --git a/evals/resume-review/promptfooconfig.yaml b/evals/resume-review/promptfooconfig.yamlindex 14ff2aa..756d8e7 100644--- a/evals/resume-review/promptfooconfig.yaml+++ b/evals/resume-review/promptfooconfig.yaml@@ -1,5 +1,6 @@description: Resume review prompt regression tests+# temperature 0.3 matches TEMPERATURES.FEEDBACK, which review_resume sends.providers:- id: openai:chat:deepseek-v4-flashlabel: deepseek-v4-flash@@ -7,7 +8,7 @@ providers:apiBaseUrl: https://api.deepseek.comapiKeyEnvar: DEEPSEEK_API_KEYshowThinking: false- temperature: 0+ temperature: 0.3max_tokens: 8192# Local Ollama via its OpenAI-compatible endpoint. reasoning_effort goes in@@ -18,7 +19,7 @@ providers:config:apiBaseUrl: http://localhost:11434/v1apiKey: ollama- temperature: 0+ temperature: 0.3max_tokens: 8192passthrough:reasoning_effort: "none"@@ -65,3 +66,16 @@ tests:value:- "Responsible for"- "Helped with"++ - description: Recent dates resume - past dates must not be called future (issue #123)+ vars:+ resumeText: file://./fixtures/recent-dates.ts+ assert:+ - type: javascript+ value: file://./assertions.ts:assertNotJson+ - type: javascript+ value: file://./assertions.ts:assertScoresLine+ - type: javascript+ value: file://./assertions.ts:assertRequiredSections+ - type: javascript+ value: file://./assertions.ts:assertNoFutureDateClaimdiff --git a/src/lib/ai/prompts/automation-match/user.ts b/src/lib/ai/prompts/automation-match/user.tsindex e40970c..c0c5bab 100644--- a/src/lib/ai/prompts/automation-match/user.ts+++ b/src/lib/ai/prompts/automation-match/user.ts@@ -3,6 +3,8 @@* Functions to construct user prompts for lean automation job match analysis.*/+import { buildDateNote } from "../dateNote";+/*** Build user prompt for lean automation job match analysis*/@@ -12,6 +14,8 @@ export function buildAutomationJobMatchPrompt(): string {return `Compare this resume against the job description.+${buildDateNote()} Use it for any years-of-experience reasoning.+RESUME:${resumeText}diff --git a/src/lib/ai/prompts/dateNote.ts b/src/lib/ai/prompts/dateNote.tsnew file mode 100644index 0000000..5666007--- /dev/null+++ b/src/lib/ai/prompts/dateNote.ts@@ -0,0 +1,14 @@+/**+ * Date Note+ * Tells the model today's date. Without it the model falls back to its+ * training cutoff and treats recent resume dates as the future (issue #123).+ */++// Everything in UTC so the ISO date, month and year can never disagree.+// Small models need both years spelled out, not just today's date.+export function buildDateNote(now: Date = new Date()): string {+ const year = now.getUTCFullYear();+ const month = `${now.toLocaleString("en-US", { month: "long", timeZone: "UTC" })} ${year}`;+ const thisYear = now.getUTCMonth() === 0 ? month : `January through ${month}`;+ return `Today's date is ${now.toISOString().slice(0, 10)} (${month}). Every date up to ${month} — including all of ${year - 1} and earlier, and ${thisYear} — is in the past.`;+}diff --git a/src/lib/ai/prompts/job-match/user.ts b/src/lib/ai/prompts/job-match/user.tsindex 13277f9..1cb9873 100644--- a/src/lib/ai/prompts/job-match/user.ts+++ b/src/lib/ai/prompts/job-match/user.ts@@ -3,6 +3,8 @@* Functions to construct user prompts for job match analysis.*/+import { buildDateNote } from "../dateNote";+/*** Build user prompt for comprehensive job match analysis*/@@ -12,6 +14,8 @@ export function buildJobMatchPrompt(): string {return `Compare this resume against the job description.+${buildDateNote()} Use it for any years-of-experience reasoning.+RESUME:${resumeText}diff --git a/src/lib/ai/prompts/resume-review/user.ts b/src/lib/ai/prompts/resume-review/user.tsindex d260619..0a92041 100644--- a/src/lib/ai/prompts/resume-review/user.ts+++ b/src/lib/ai/prompts/resume-review/user.ts@@ -3,9 +3,13 @@* Constructs the user prompt for the markdown resume review.*/+import { buildDateNote } from "../dateNote";+export function buildResumeReviewPrompt(resumeText: string): string {return `Review the following resume.+${buildDateNote()} Do not comment on any date unless it is later than today.+IMPORTANT: The resume below is a structured-text serialization of the candidate's data for your analysis. The "##" section markers and plain-text formatting are artifacts of this serialization — NOT the actual document format. The real resume exports to a professionally formatted PDF (no markdown headers, no plain text). Do NOT flag markdown syntax or plain-text layout as ATS or formatting issues.<resume>