Skip to content

πŸ› [CRITICAL] Timestamp format mismatch β€” aging/pruning never worksΒ #221

Closed

Description

@ajianaz

Description

SQLite datetime('now') returns 2026-06-07 20:30:00 (space separator, no TZ).
Stored timestamps use RFC3339: 2026-06-07T20:30:00+00:00 (T separator, +TZ suffix).

String comparison: T (ASCII 84) > space (ASCII 32), so RFC3339 strings are always lexicographically greater than SQLite datetime strings.

Result: aging and pruning queries NEVER find matching rows. All memories stay Hot forever.

Affected Code

  • crates/uteke-core/src/memory/aging.rs lines 38, 40, 79, 81
  • crates/uteke-core/src/memory/bulk.rs prune_ttl, find_deprecated_for_prune

Reproduction

SELECT '2026-06-07T20:30:00+00:00' < datetime('now');  -- Returns 0 (FALSE!)

Fix

Compute cutoff timestamps in Rust using chrono (like bulk_delete_cold already does), pass as RFC3339 bind params.

Found by Cora v0.4.4 scan.

Activity

  1. added
    bug
    scope:core
    priority:critical
    cora-scan
    on Jun 7, 2026
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

    bugcora-scanpriority:criticalscope:core

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions