Skip to content

fix(backtest): update replay harness for observe+verify ethflow strategy#170

Open
lgahdl wants to merge 1 commit into
nullislabs:developfrom
bleu:fix/45-backtest-observe-verify
Open

fix(backtest): update replay harness for observe+verify ethflow strategy#170
lgahdl wants to merge 1 commit into
nullislabs:developfrom
bleu:fix/45-backtest-observe-verify

Conversation

@lgahdl

@lgahdl lgahdl commented Jul 3, 2026

Copy link
Copy Markdown

Summary

  • The ethflow-watcher strategy was redesigned from submit-based to observe+verify (GETs /api/v1/orders/{uid}, writes observed:{uid} to local store). The backtest harness was never updated, so every fixture classified as RejectedUnexpected and the binary exited 1.
  • Removed the old submit_order + app_data mocks; added a catch-all 200 response for cow_api_request
  • Renamed SubmittedObserved throughout (replay.rs, report.rs, main.rs)
  • classify_ok now checks local store for observed:* key instead of submit_order call count
  • Removed the now-dead submitted_body field from ReplayOutcome

Closes #45

Test plan

  • cargo test -p ethflow-watcher — 11/11 pass (covers the full observe+verify strategy)
  • cargo check -p shepherd-backtest — zero warnings
  • Binary run against 5 real Sepolia EthFlow fixtures collected via backtest_collect.py5/5 Observed, 100%, exit 0
  • Generated report correctly labels passing bucket as Observed + RejectedExpected

The old harness mocked submit_order and classified success by whether
the strategy POSTed an order. The redesigned ethflow-watcher strategy
GETs /api/v1/orders/{uid} instead — so every fixture previously
classified as RejectedUnexpected and the binary exited 1.

Now programs a 200 catch-all for cow_api_request, classifies success
by whether observed:{uid} was written to local store, and renames the
Submitted classification to Observed throughout.

Closes #45

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@lgahdl lgahdl requested a review from mfw78 as a code owner July 3, 2026 21:08
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.

1 participant