File(s): oracle/src/api/prices.rs:69-160 (ready), compare :20-61 (health); existing test asserting the None values (~line 293-294)
Problem:
health() in oracle/src/api/prices.rs computes last_price_cycle_secs_ago/last_keeper_cycle_secs_ago correctly from cycle (lines ~46-61) and returns them. ready(), a few lines below, already reads the same state.cycle_status to run its own staleness checks — but both of its success-response branches (the 3-second-TTL cache-hit path around line 124-125, and the fresh-check success path around line 153-154) hardcode last_price_cycle_secs_ago: None, last_keeper_cycle_secs_ago: None instead of using the values already in scope. This isn't just untested — an existing test explicitly asserts body.last_price_cycle_secs_ago.is_none() and the keeper equivalent, actively locking in the gap as expected behavior rather than catching it.
Suggested fix:
Populate last_price_cycle_secs_ago/last_keeper_cycle_secs_ago in ready() using the same cycle read already performed, in both the cached and fresh-check success paths, and update the test to assert the real values instead of None.
Acceptance Criteria:
File(s): oracle/src/api/prices.rs:69-160 (ready), compare :20-61 (health); existing test asserting the None values (~line 293-294)
Problem:
health()in oracle/src/api/prices.rs computeslast_price_cycle_secs_ago/last_keeper_cycle_secs_agocorrectly fromcycle(lines ~46-61) and returns them.ready(), a few lines below, already reads the samestate.cycle_statusto run its own staleness checks — but both of its success-response branches (the 3-second-TTL cache-hit path around line 124-125, and the fresh-check success path around line 153-154) hardcodelast_price_cycle_secs_ago: None, last_keeper_cycle_secs_ago: Noneinstead of using the values already in scope. This isn't just untested — an existing test explicitly assertsbody.last_price_cycle_secs_ago.is_none()and the keeper equivalent, actively locking in the gap as expected behavior rather than catching it.Suggested fix:
Populate last_price_cycle_secs_ago/last_keeper_cycle_secs_ago in ready() using the same cycle read already performed, in both the cached and fresh-check success paths, and update the test to assert the real values instead of None.
Acceptance Criteria: