Skip to content

fix test: update hardcoded seed date to stay within 14-day age limit#385

Open
jlin53882 wants to merge 1 commit intoCortexReach:masterfrom
jlin53882:fix/test-harness-date-expiry
Open

fix test: update hardcoded seed date to stay within 14-day age limit#385
jlin53882 wants to merge 1 commit intoCortexReach:masterfrom
jlin53882:fix/test-harness-date-expiry

Conversation

@jlin53882
Copy link
Copy Markdown
Contributor

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

  • \invariantMaxAgeMs\ → \undefined\ → age check skipped (no filtering)
  • \deriveMaxAgeMs\ → \14 days\ → age check applies (filters out 15-day-old entry)

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

  • Severity: CI regression (pre-existing, unrelated to any active PR)
  • Production impact: None
  • Test impact: Fixes 4 failing subtests in
    eflection-bypass-hook.test.mjs\

Fixes #384.

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.
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@jlin53882
Copy link
Copy Markdown
Contributor Author

Related

Full chain: #362#383 (main fix) → #384 (discovered issue) → #385 (this fix)

See #362 for the complete PR relationship map.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

reflection-bypass-hook.test.mjs fails: seed date 2026-03-12 exceeds 14-day age filter

1 participant