Remember picked jobs¶
The daily list must never show a tester the same job twice. The daily run keeps a small memory of the jobs it has sent to each tester, skips them on later days, and forgets them after 60 days. Picks are only remembered after the daily email is sent.
The memory lives in the demo's D1 database, as keyed hashes (ADR 0012). Until Phase 2 of the demo, it was one file of plain hashes in the GitHub Actions cache (ADR 0006, now superseded).
What's stored¶
The sent_jobs table holds one row per job sent to a tester:
| Column | What it holds |
|---|---|
tester_id |
The tester's random ID |
job_hash |
HMAC-SHA256 of <tester ID>:<job ID>, made with the WFHEAVEN_HASH_KEY secret |
day |
The date the job was sent |
It holds no titles, links, companies, or other job data. Job IDs are public, but without the secret key nobody can work out which job a hash stands for, or whether two testers got the same job. When a tester unsubscribes, their rows are deleted with them.
How a run uses the memory¶
For each tester, daily/daily_run.py:
- Reads that tester's hashes from D1.
- Ranks the day's jobs, skipping every job whose hash is already
stored. These jobs are counted as
already pickedand can't be picks, worth checking, or near misses again. - Sends the daily email.
- Remembers the picks, only if the email was sent, with one
INSERT OR IGNOREstatement.
The run's first step deletes hashes older than 60 days for every tester.
If the email fails, the picks aren't remembered, so the next run can pick them again. If D1 can't be read for one tester, that tester still gets an email, and some jobs may repeat. If D1 can't save the picks after the email, the run summary counts it as Sent but not remembered.
Jobs worth checking and near misses aren't remembered, so they can appear again the next day.
Run it on your computer¶
The ranker still reads a memory file of plain SHA-256 hashes, for trying
profiles on your computer. Rank with --seen and --out, and then add the
picks to the memory:
python3 ranker/rank_jobs.py data/jobs-2026-12-04.json --seen data/seen-jobs.json --out data/picks.json
python3 ranker/seen_jobs.py --seen data/seen-jobs.json --picks data/picks.json
Keep the file in data/, which isn't committed. It's separate from D1:
running the ranker on your computer doesn't change what the daily run
remembers.
If the memory is lost¶
If the hashes are deleted, or WFHEAVEN_HASH_KEY changes, the next run
starts with an empty memory and doesn't fail. Jobs still in the collector's
two-day window may be picked again, so the list can repeat a few jobs for a
day or two. That's an accepted risk. Don't change the key without a reason.
Known limits¶
- The same job on two boards has two IDs. If the collector keeps a different copy on another day, the job can be picked again.