JobServe Improvements — Message-ID Key Migration

Problem

Original code used JobServe references (e.g. JS-BBBH166669) as primary keys. JobServe reuses these references across multiple postings over time, causing newer emails with the same ref to be rejected as duplicates. This lost job emails and tracking data.

Solution

Changed primary key from JobServe reference to Message-ID (RFC 5322 guaranteed unique). Each email gets stored regardless of JobServe ref reuse.

Key Changes

jobserve_parser.py: Primary key changed from js_ref to msg_id. JobServe ref stored as metadata field jobserve_ref. All tracking sets now use Message-IDs.

query_jobs.py: CLI tool added — list, search by ref/keywords/date, detail by Message-ID, JSON output.

• Database migration script created to convert existing data.

Data Structure

Before: Key = JS-BBBH166669, no way to distinguish reuse.

After: Key = <000846O00000576dc201@apps.jobserve.com>, with jobserve_ref: "JS-BBBH166669" as metadata.

Benefits

No more lost emails from ref reuse. Better LLM analysis (see all instances). Each email individually tracked. JSON export for programmatic access. Historical posting pattern analysis.

version 1