outcome.mjs dates a hire by the UTC day while set-status dates the same event locally
Summary
outcome.mjs writes the user's outcome journal with the UTC day, then — in the same invocation — spawns set-status.mjs, which writes data/status-log.tsv with localToday(). One event gets two records, a day apart. archive-posting.mjs and application-answers.mjs have the same UTC-day defect without the self-contradiction.
lib/local-today.mjs already documents why this is wrong, and #2765 (followup-seed), #2932 (set-status) and #3070 fixed it elsewhere. These three call sites were not in those sweeps.
1. outcome.mjs contradicts itself in one run
function today() {
return new Date().toISOString().split('T')[0]; // UTC day
}outcome.mjs:490 then spawns set-status.mjs, whose eventDate is flags.on ?? localToday() (set-status.mjs:617) — the local day.
Reproduced against the real CLI:
$ TZ=Pacific/Midway node outcome.mjs 1 hired --json
data/outcomes/1_acme-corp_…/outcome.md: ## Entry: 2026-09-28
data/status-log.tsv: 1 2026-09-27 Interview Hired set-statusThe user was hired on the 27th. Their journal says the 28th. Any timezone west of Greenwich does this for its evening hours — which is when someone sits down to record an offer.
today() feeds three places, all read by the user rather than computed with:
## Entry: {today}— the outcome journal's chronology header- **Date**: {today}in theposting_missing.mdstub- the note written when no CV source file is found
To be precise about the blast radius: calibrate.mjs's parseOutcomeJournal splits on ## Entry: without parsing the date, so nothing downstream miscalculates. The cost is a wrong date in the permanent record of a life event, plus two files written in the same breath that disagree.
2. archive-posting.mjs — the capture name is stale when it is created
captureFilename() builds {today}_{company}_{role}.pdf from the same UTC today(). AGENTS.md already singles this filename out as the fragile one:
A capture named only from the date and the scraped company and role can be found again only by rebuilding that exact string, so it stops resolving the day after it is written — precisely when the posting has gone dead and the capture is the only remaining record.
With a UTC date it does not survive even that long: an evening run writes tomorrow's date, so anyone rebuilding the name from the day they did the work looks for a file that does not exist. (The --report=N form is resolved by report number via jd-capture.mjs, which is exactly why AGENTS.md prefers it — but the date still appears in the name it writes.)
3. application-answers.mjs — the default answer date
function normalizeDate(date) {
return inline(date || new Date().toISOString().slice(0, 10));
}Written into the report's ## Application Answers section as the day the user filled the form, beside tracker rows dated with localToday(). An evening answer is stamped a day ahead of the application it documents. An explicit date argument is unaffected.
Expected
All three use localToday(). No behaviour changes for a user whose local day already matches UTC.
Testing note
The reason this survived three previous sweeps is that the UTC/local disagreement covers only part of the UTC day, so a test reading the wall clock passes for most of the day either way — tests/local-today-gates.test.mjs's header records its own first draft doing exactly that.
Frozen-clock pinning works for exports but not for these CLIs: freezing a CLI's clock needs a --import preload (Node 18.19+, above this project's engines: >=18) or an argv[1]-rewriting launcher, which tests/main-guard-convention.test.mjs gates behind a named exemption. A discriminator that needs neither: run the same command in two timezones 25 hours apart (Pacific/Kiritimati UTC+14, Pacific/Midway UTC-11). Two local times 25 hours apart cannot share a calendar date, so a UTC-derived date is the same string in both runs and a local one never is — and since the two cannot both equal the UTC day, the assertions fail against the current code at every hour rather than only inside the disagreement window.
Source: santifer/career-ops