Skip to content

[codex] Follow up ranking readability suggestions#15

Open
coe0718 wants to merge 1 commit intoghostwright:mainfrom
coe0718:codex/ranking-readability-cleanups
Open

[codex] Follow up ranking readability suggestions#15
coe0718 wants to merge 1 commit intoghostwright:mainfrom
coe0718:codex/ranking-readability-cleanups

Conversation

@coe0718
Copy link
Copy Markdown
Contributor

@coe0718 coe0718 commented Mar 31, 2026

What Changed

This is a tiny follow-up to the optional readability suggestions on #2.

  • replaces the 3-input weightedAverage(..., 0, ..., 0) call in calculateEpisodeContextScore() with a dedicated 2-input helper
  • simplifies hoursSince() to use Date.parse() directly instead of a redundant Number.isNaN wrapper
  • adds a focused regression test to confirm invalid timestamps still degrade gracefully

Why

PR #2 was merged as-is, but the review included two non-blocking suggestions to make the ranking helper a little easier to read. This keeps that cleanup separate from the original memory feature work.

How I Tested

bash -lc 'export PATH="$HOME/.bun/bin:$PATH" && /home/coemedia/.bun/bin/bun test src/memory/__tests__/ranking.test.ts'
/home/coemedia/.bun/bin/bun run typecheck
/home/coemedia/.bun/bin/bun run lint
bash -lc 'export PATH="$HOME/.bun/bin:$PATH" && /home/coemedia/.bun/bin/bun test'

@coe0718 coe0718 marked this pull request as ready for review March 31, 2026 20:49
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.

2 participants