fix test: update hardcoded seed date to stay within 14-day age limit#385
fix test: update hardcoded seed date to stay within 14-day age limit#385jlin53882 wants to merge 1 commit intoCortexReach:masterfrom
Conversation
The reflection-bypass-hook test seeds derived entries with runAt = 2026-03-12, which is now 15 days old and exceeds DEFAULT_REFLECTION_DERIVED_MAX_AGE_MS (14 days). The age filter in rankReflectionLines() correctly filters out the expired entry, causing all derived assertions to fail. Updated to 2026-03-26 (2 days ago) to keep the entry well within the window. Fixes CortexReach#384.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1304ab927c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| scope: "global", | ||
| toolErrorSignals: [], | ||
| runAt: Date.UTC(2026, 2, 12, 15, 0, 0), | ||
| runAt: Date.UTC(2026, 2, 26, 15, 0, 0), // 2026-03-26 — within 14-day derive age limit |
There was a problem hiding this comment.
Use a relative seed timestamp in the age-limited test
This change keeps runAt hardcoded to a calendar date (2026-03-26), so the test remains time-brittle and will start failing again once the run date is more than 14 days later (on or after 2026-04-10), because derived reflections are filtered by DEFAULT_REFLECTION_DERIVED_MAX_AGE_MS in rankReflectionLines. To avoid repeated CI breakage, compute runAt relative to execution time (for example, Date.now() - 2 * 24h) instead of pinning another fixed date.
Useful? React with 👍 / 👎.
Related
Full chain: #362 → #383 (main fix) → #384 (discovered issue) → #385 (this fix) See #362 for the complete PR relationship map. |
Summary
Fixes CI failure in \ est/reflection-bypass-hook.test.mjs.
Root Cause Analysis
The test seeds a derived reflection entry with a hardcoded date:
\\js
runAt: Date.UTC(2026, 2, 12, 15, 0, 0) // March 12, 2026
\\
The production age filter in \src/reflection-store.ts\ has a 14-day hard limit on derived entries:
\\js
export const DEFAULT_REFLECTION_DERIVED_MAX_AGE_MS = 14 * 24 * 60 * 60 * 1000; // 14 days
// rankReflectionLines():
if (now - timestamp > options.maxAgeMs!) {
continue; // filtered out
}
\\
Current date is 2026-03-27 — the seeded entry is 15 days old, exceeding the 14-day threshold. The derived entry is silently filtered out, causing all assertions against <derived-focus>\ to fail.
Note: The production code logic is correct. This is a test maintenance issue — the hardcoded date has simply expired past the age threshold.
Why Invariants Pass But Derived Fails
Fix
Updated seed date from \2026-03-12\ to \2026-03-26\ (2 days ago), keeping the entry well within the 14-day window.
Impact
eflection-bypass-hook.test.mjs\
Fixes #384.