fix: Codex QA follow-ups on Today's Pulse (refresh wiring, cache hour guard, hook tests) - #46
Merged
Merged
Conversation
Independent QA (Codex gpt-5.5, 7-gate) on the shipped 0.39.30 pulse surfaced two correctness gaps + a test-coverage gap. Fixes: - Goal: refreshAll() didn't refresh the pulse — the manual/auto refresh button updated every panel except Pulse (it only re-ran via effect deps). Wire refreshPulse into refreshAll's Promise.all + deps. - Edge Case: cache stale across hour rollover — storageKey is keyed by day, so a pulse cached at 13:xx could paint under the 14:00 "same time of day" label. Add readFreshCache() that only reuses a cache entry whose stored cutoffHour matches the current hour (guards both the seed paint and the error fallback). - Handoff: the highest-risk hook logic (buildPlan window off-by-one, daily+hourly reduction) had no direct tests. Extract it to a pure pulse-plan.ts module and add table tests for day/week/month key math, no-double-count of today/boundary days, zero trailing days, missing prev, DST-free offset hour, and inclusive ranges. Accuracy + Security gates passed as-is. Copy gate (hardcoded PulseCard strings vs the i18n registry) is deferred — see PR notes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Independent QA gate (Codex gpt-5.5, 7-gate pass) on the shipped
0.39.30pulse. Verdicts: Accuracy Pass, UX/Flow Pass, Security/Privacy Pass; two correctness Fixes + a Handoff Risk addressed here.Summary
refreshAll()refreshed every dashboard panel except Pulse — the manual/auto refresh button left the card to catch up only via effect deps. NowrefreshPulse()is inrefreshAll'sPromise.all+ deps.storageKeyis day-keyed, so a pulse cached at 13:xx could show under the 14:00 "same time of day" label. AddedreadFreshCache()that only reuses an entry whose storedcutoffHourmatches the current hour (guards both the instant-seed paint and the error fallback).pulse-plan.tsand added table tests: day/week/month key math, no double-count of today/boundary days, zero trailing days, missing prev, offset-hour derivation, inclusive ranges.Deferred (honest disposition, not "pass")
PulseCardhardcodes user-facing strings instead of thecopy()i18n registry. Deferred: this is an English-primary local tool,copy()would fall back to English for ja/ko/zh anyway (no translations exist), and the ui-hardcode baseline already accepts the entries. Tracked as follow-up if full i18n is wanted.Test plan
pulse-plantests (10) +pulse-statstests (17) greenci:localgreen — root 775, copy, ui-hardcode (unchanged), guardrails 4/4