Skip to content

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

@jlin53882

Description

@jlin53882

Bug Description

\ est/reflection-bypass-hook.test.mjs\ is failing in CI on master. All 4 subtests fail with:

The input did not match /<derived-focus>/. Input: ''

Root Cause

The test seeds a derived reflection entry with a hardcoded date:

\\js
// test/reflection-bypass-hook.test.mjs line 99
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
// src/reflection-store.ts line 26
export const DEFAULT_REFLECTION_DERIVED_MAX_AGE_MS = 14 * 24 * 60 * 60 * 1000; // 14 days

// src/reflection-store.ts line 384 (rankReflectionLines)
if (options.now - timestamp > options.maxAgeMs!) {
continue; // entry is too old — 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, returning empty results, causing all assertions against <derived-focus>\ to fail.

Why Invariants Pass But Derived Fails

\invariantMaxAgeMs\ defaults to \undefined\ → age check is skipped (line 384 short-circuits). \deriveMaxAgeMs\ is 14 days → age check applies. This explains why \startResult\ (invariants) still returns content but \promptResult\ (derived) returns empty.

Fix

Update the seed date in \ est/reflection-bypass-hook.test.mjs\ to a date within the 14-day window. Use today's date or a date within the last 7 days.

\\js
// Before (expired — 15 days old)
runAt: Date.UTC(2026, 2, 12, 15, 0, 0),

// After (within 14-day window)
runAt: Date.UTC(2026, 2, 26, 15, 0, 0), // March 26, 2026
\\

Impact

  • Severity: Regression in CI (pre-existing failure, not caused by any recent PR)
  • Affected tests: 4 subtests in
    eflection-bypass-hook.test.mjs\
  • Production impact: None — this is a test-only issue
  • Fix scope: 1-line date change in test file

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions