Skip to content

Interpret promoted search ages as UTC in routes #1148

Description

@bcdonadio

Observed behavior: Promoted search results retain SQLite timezone-less UTC created_at text. Prompt-search recency/staleness scoring and restore age filters parse it in the host timezone, changing scores and eligibility near age boundaries.

Expected behavior: Compute ages from stored UTC instants consistently across host timezones, preserving timezone-qualified inputs.

Root cause: At e962f17, src/db/promoted.ts search returns raw created_at; src/storage/sqlite/repositories.ts forwards it. src/daemon/routes/prompt-search.ts:42,117 uses new Date(result.createdAt) and src/daemon/routes/restore.ts:214,264 uses Date.parse(r.createdAt). This is distinct from #1085's findStale reported whole-day age fix.

How to reproduce: Use private synthetic SQLite promoted search results with created_at 2026-09-06 07:20:00, pin now to 2026-09-07T08:20:00Z, and run prompt-search scoring/restore filters under TZ=America/Sao_Paulo. The raw native parse maps creation to 10:20Z, age22h rather than25h; a24h threshold therefore differs. Test both normal restoration and passive insights paths, plus prompt-search recency and stale penalty. No real memories or daemon required.

Environment: Codex Astra owner / GLM reviewer; CLI source tracing and synthetic Node timestamp evidence; Fedora Linux, Node25.9.0.

Discovered during grouped #1084/#1085/#1092 candidate round1. New follow-up outside frozen S5, remediation budget0; no campaign parenting. Candidate e962f17; originating PR #1162. This PR fixes conversation mapping, findStale age reporting, and migration bounds only; route scoring/filtering remains separate.

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

    Type

    Fields

    Priority

    Medium

    Effort

    None yet

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions