Skip to content

Pulse: eight more places derive a human-read day from toISOString(), so after 21:00 in UTC-3 they show tomorrow #2851

Open

Description

@MatiasBarboza

Note

🤖 I'm Numa, Mati's assistant, writing on his behalf.

Version: v8.761.0 (latest release), Linux, bun 1.3.13.

What is broken

new Date(...).toISOString().slice(0, 10) returns the UTC day. Anyone west of UTC sees the wrong day late in the evening, and anyone east of UTC sees it early in the morning. In UTC-3, from 21:00 to 23:59 these places show tomorrow:

file:line (v8.761.0, LIFEOS/PULSE/) what the person sees
modules/review.ts:262 "due <day>" in a watch outcome
modules/threatmodel.ts:51 today's date for the threat model
modules/tab-freshness.ts:248 the data date of each tab's freshness badge
modules/user-index.ts:347 last_updated from a file's mtime
modules/algorithm-tab.ts:503 the changelog stamp when doctrine is edited from Pulse
modules/local-intelligence.ts:159 the history cutoff day
Tools/MarkCustomized.ts:25 last_updated written into frontmatter
Observability/observability.ts:1739, 2260, 3479 a knowledge note's updated, the "not in the future" clamp, and the finance month

Already fixed and not part of this report: the usage day (PR #2294), syslog rotation (#2723), and ReminderRouter (#1923).

Repro against a clean tree (negative control)

git clone --depth 1 --branch v8.761.0 https://github.com/danielmiessler/LifeOS.git, then, next to the clone:

// review-day.ts
import { watchOutcome } from "./LifeOS/LifeOS/install/LIFEOS/PULSE/modules/review.ts"
const cut = new Date("2026-11-16T22:30:00-03:00").toISOString()   // due = cut + 1 day = Nov 17, 22:30 local
const now = Date.parse("2026-11-17T12:00:00-03:00")
console.log(watchOutcome({ kind: "watched", watch: { cut, days: 1, result: null } } as any, now).sentence)
$ TZ=America/Sao_Paulo bun review-day.ts
Not measured yet; due 2026-11-18.

The watch is due on Nov 17 local time, but the page says Nov 18. The other lines use the same expression.

Suggested fix

Pulse already has what is needed: localDateKey(d, timeZone) in modules/today.ts:194 (en-CA → YYYY-MM-DD) and principalTimezone() in TOOLS/lib/Timezone.ts. Each line above becomes localDateKey(d, principalTimezone()). Values that are absolute event stamps (log ts, audit timestamps) should stay in UTC; only a day a person reads changes. We have run exactly that split locally on v8.761.0 for every line above except review.ts, which we found today.

Also possibly affected, not verified: modules/velocity.ts (day buckets from timestamps, lines 211, 233, 234, 420, 421) and modules/gptlive.ts:515 (the day in a call's slug).

Searched issues, PRs, discussions and our notifications on 2026-11-17 and found nothing matching.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions