Problem
Codex “latest session” selection ranks rollout files by filesystem modification time. Restoring, copying, syncing, or touching an old rollout gives it a new mtime, so Ceiling can report an old session as the latest.
Claude and Grok already prefer the latest parsed record timestamp and use mtime only as a fallback.
Where
rust/src/cost_scanner.rs, in the Codex latest-session selection path.
Expected behavior
- Rank Codex sessions by the maximum valid timestamp parsed from their records.
- Use file mtime only when a session has no usable record timestamps.
- Preserve deterministic tie-breaking.
Tests
Add a regression fixture where the older session has the newer mtime and verify the newer record timestamp wins. Add a fallback case with missing timestamps.
Problem
Codex “latest session” selection ranks rollout files by filesystem modification time. Restoring, copying, syncing, or touching an old rollout gives it a new mtime, so Ceiling can report an old session as the latest.
Claude and Grok already prefer the latest parsed record timestamp and use mtime only as a fallback.
Where
rust/src/cost_scanner.rs, in the Codex latest-session selection path.Expected behavior
Tests
Add a regression fixture where the older session has the newer mtime and verify the newer record timestamp wins. Add a fallback case with missing timestamps.