Skip to content

Fail incompatible backtest execution windows before replay - #84

Merged
hjcud merged 1 commit into
developfrom
feature/83-window-compatibility
Aug 9, 2026
Merged

Fail incompatible backtest execution windows before replay#84
hjcud merged 1 commit into
developfrom
feature/83-window-compatibility

Conversation

@hjcud

@hjcud hjcud commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Closes #83.

What changed

  • Validate the immutable execution-policy period, representative dataset-manifest period, and pinned session-calendar coverage together during job binding.
  • Refuse an incompatible tuple with REQUIRED_INPUT_UNAVAILABLE before publishing RUNNING.
  • Preserve fail-closed reproducibility: the worker does not silently shrink or substitute either locked period.
  • Add a production-shaped regression using the exact INT03 Development tuple:
    • policy 2016-07-01..2026-07-01
    • dataset 2024-01-01..2024-02-01
    • xnys-2024-2026:1.0.0
  • Prove the deterministic mismatch produces exactly one terminal FAILED event on delivery 1 instead of five generic handler retries.

Root cause

The worker derived a manifest/object evaluation window for feature binding, but then constructed BacktestJob with the unmodified ten-year execution policy. BacktestOrchestrator._schedule therefore asked the pinned calendar for 2016 even though that calendar begins in 2024. The same accepted manifest also did not match the policy period required by MarketDataReader.

CalendarCoverageError escaped the domain binding boundary, so the worker classified a permanent input incompatibility as HANDLER_ERROR, retried it five times, and left the public run without a terminal result.

This PR fixes the consumer safety boundary. Backend #263 separately prevents publishing incompatible combinations and must provide a versioned Development policy/dataset pair that is actually executable.

Validation

  • uv run --extra test pytest: 1251 passed, 3 skipped, 168 deselected
  • uv run --extra dev ruff check src tests: passed
  • uv run --extra dev mypy: passed
  • git diff --check: passed

No additional public run, DLQ operation, worker restart, ASG change, or database write was used to validate this change.

@hjcud
hjcud marked this pull request as ready for review August 9, 2026 09:02
@hjcud
hjcud merged commit c9a9b7a into develop Aug 9, 2026
9 checks passed
@hjcud
hjcud deleted the feature/83-window-compatibility branch August 9, 2026 09:02
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.

INT03: reject incompatible execution-policy / manifest / calendar windows before replay

1 participant