Repository navigation
Pin the clock for the incremental content-analysis body-read test - #110
Conversation
The fixture timestamps are fixed at 2026-08-21 while the test asks for a 30-day window against the real clock, so on 2026-09-20 the corpus aged out of that window and the warm update read a second body. The assertion was about incremental body reads, not about the window, and it expired by date on every branch. Pinning Date.now the way the neighbouring content tests already do keeps it meaningful.
|
🤖 Automated first-pass review The configured analysis model did not return a usable analysis for this pull request. The item has still been received and remains available for maintainer review. To help with review, please ensure the change summary, tests, and any user-facing documentation or localization updates are included. 🤖 Posted automatically by CCU Bot — not a maintainer decision. |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused test-only change matches existing clock-pinning patterns and addresses the reported fixture expiry.
Review effort: Lite
Findings: None
What changed in this PR
Pins the incremental content-analysis test clock so its 30-day fixture window remains deterministic.
Changes:
- Freezes
Date.nowduring the test and restores it withfinally. - Keeps production code unchanged.
| File | Description |
|---|---|
src/test/claudeIncrementalIndex.test.ts |
Stabilizes the time-sensitive incremental index test. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Summary
content analysis is materialized from per-file contributions without a second body scanbegan failing on its own around 2026-09-20, on every branch. Its fixture stamps the corpus2026-08-21and the test asks forwindowDays: 30against the real clock, so once the data aged past 30 days the warm update read a second body and thebodyReads === 1assertion broke. The assertion is about incremental body reads, not about window expiry, so this pinsDate.nowto2026-09-10T12:00:00.000Z— the same constant and the sametry/finallyshape the neighbouring content-analysis tests already use.No production code changes. The diff is six real lines; the rest is the reindentation of the test body inside the
tryblock (git show -wshows only the six).Linked issues
None. It is what currently turns
Node Testsred on #108, which touches none of this.Type of change
docs/ci/chore(patch)How was this tested?
The test itself.
node --test --test-name-pattern "materialized from per-file contributions" out/test/claudeIncrementalIndex.test.js→ fails onmain(2 !== 1), passes with this commit.That the clock was really the cause. Recompiling the test on
mainwith the fixture timestamps shifted from2026-08-21to2026-09-20, with no other change, makes it pass. Nothing about the index behaviour changed; the fixture simply fell out of the window.Full suite, Windows 10.
npm run test:nodeonmain: 1024 pass / 9 fail. With this commit: 1026 pass / 7 fail. Seven of those are the pre-existing Windows symlink failures (EPERM ... symlink,ENOTEMPTY) that need Developer Mode and pass in CI on Linux. The ninth,worker cancellation persists a resumable atomic checkpoint, failed in the baseline and passed after; it is timing-flaky here and is not touched by this change.Scope check. Walking the 14 tests in the file that assert
diagnostics.bodyReads, this is the only one that combineswindowDayswith an unpinned clock, so there is no second time bomb of this kind in the file.Checklist
npm run compileis cleanI18nwith all eight UI locales filled — n/a, test-onlyCHANGELOG.mdupdated (user-visible changes) — n/a, nothing user-visibleREADME.mdupdated if behaviour/settings changed — n/a