Skip to content

fix: record overrun candles as SKIPPED_OVERRUN, not data-unavailable (#169) - #172

Merged
mohammadp1001 merged 1 commit into
mainfrom
fix/169-overrun-candle-status
Aug 9, 2026
Merged

fix: record overrun candles as SKIPPED_OVERRUN, not data-unavailable (#169)#172
mohammadp1001 merged 1 commit into
mainfrom
fix/169-overrun-candle-status

Conversation

@mohammadp1001

Copy link
Copy Markdown
Owner

Fixes #169.

A candle missed because our own processing overran was filed as SKIPPED_DATA_UNAVAILABLE - "we could not get market data". The data was fine. The previous session was still running.

That matters because SKIPPED_DATA_UNAVAILABLE is the signal you check when you suspect the Alpaca feed is broken. Overrun candles polluted it, so a run showing eight "data unavailable" rows sent you off to check the feed when the real story was an investigation running longer than its candle. Two different problems, two different fixes, previously indistinguishable in the memory bank and in the session report.

What changed

  • SKIPPED_OVERRUN added as a Session status, used for the market-open branch of _handle_overrun_candles.
  • SKIPPED_MARKET_CLOSED unchanged - that branch was already correct.
  • SKIPPED_DATA_UNAVAILABLE keeps its meaning and its other uses (a failed investigation still returns it).
  • Both statuses were already outside the FR-018 completed count, so run length is unaffected.

Spec

data-model.md gains the new value, plus a table saying what each status actually means - the previous one-line list did not explain why you would see one rather than another.

605 passed in 142.42s (0:02:22)
Required test coverage of 100% reached. Total coverage: 100.00%
ruff check alphoryn/ tests/ -> All checks passed!

…169)

A candle missed because our own processing overran was filed as
SKIPPED_DATA_UNAVAILABLE - "we could not get market data". The data was fine.
The previous session was still running.

That matters because SKIPPED_DATA_UNAVAILABLE is the signal you check when you
suspect the Alpaca feed is broken. Overrun candles polluted it, so a run
showing eight "data unavailable" rows sent you to check the feed when the real
story was an investigation running longer than its candle.

Adds SKIPPED_OVERRUN as a Session status and uses it for the market-open
branch of _handle_overrun_candles. SKIPPED_MARKET_CLOSED is unchanged, and
SKIPPED_DATA_UNAVAILABLE keeps its meaning and its other uses. Both were
already outside the FR-018 count, so run length is unaffected.

data-model.md gains the new value plus a table explaining what each status
means, since "COMPLETED, SKIPPED_TIMEOUT, ..." on one line did not say why you
would see one rather than another.

Closes #169
@mohammadp1001
mohammadp1001 merged commit fe88cb9 into main Aug 9, 2026
3 checks passed
@mohammadp1001
mohammadp1001 deleted the fix/169-overrun-candle-status branch August 9, 2026 13:14
@kilo-code-bot

kilo-code-bot Bot commented Aug 9, 2026

Copy link
Copy Markdown

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (4 files)
  • alphoryn/memory/schema.py
  • alphoryn/scheduler/scheduler.py
  • specs/001-etf-paper-trading-agent/data-model.md
  • tests/unit/test_scheduler.py

Reviewed by step-3.7-flash · Input: 67.5K · Output: 14.6K · Cached: 1M

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.

fix: overrun candles are logged as SKIPPED_DATA_UNAVAILABLE (SC-003)

1 participant