fix: iter-completion-reconciler test uses relative timestamps

Test had fixed literal timestamps (TS_X = "2026-05-17T12:42:05.618Z")
that became stale once the calendar moved past them — the reconciler's
default maxAgeMs (1h, "older drift is operator territory") filtered
them out. By 3h after the original write the test failed: reconciled.length
was 0 because no entry passed the age filter.

Switch to NOW-relative timestamps (5/30/1 min back from Date.now()) so
the fixture always lands inside the default age window regardless of
when the test runs.

Sonnet #13 (tool rename) report flagged this test as failing alongside
the 4 known pre-existing failures.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Mikael Hugo 2026-05-17 17:49:11 +02:00
parent 623af869b1
commit acafee06e2

View file

@ -120,9 +120,14 @@ function makeMemDb() {
};
}
const TS_X = "2026-05-17T12:42:05.618Z";
const TS_OLDER = "2026-05-17T11:00:00.000Z";
const TS_NEWER = "2026-05-17T14:00:00.000Z";
// Test timestamps are computed relative to NOW so the reconciler's default
// maxAgeMs filter (1h — "older drift is operator territory") doesn't drop
// them as the calendar moves past the original literal timestamps. Tests
// that explicitly want stale entries pass their own past timestamp.
const NOW_MS = Date.now();
const TS_X = new Date(NOW_MS - 5 * 60 * 1000).toISOString(); // 5 min ago
const TS_OLDER = new Date(NOW_MS - 30 * 60 * 1000).toISOString(); // 30 min ago
const TS_NEWER = new Date(NOW_MS - 1 * 60 * 1000).toISOString(); // 1 min ago
// ─── Tests ──────────────────────────────────────────────────────────────────