fix(backtest): update replay harness for observe+verify ethflow strategy#170
Open
lgahdl wants to merge 1 commit into
Open
fix(backtest): update replay harness for observe+verify ethflow strategy#170lgahdl wants to merge 1 commit into
lgahdl wants to merge 1 commit into
Conversation
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>
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.
Summary
ethflow-watcherstrategy was redesigned from submit-based to observe+verify (GETs/api/v1/orders/{uid}, writesobserved:{uid}to local store). The backtest harness was never updated, so every fixture classified asRejectedUnexpectedand the binary exited 1.submit_order+app_datamocks; added a catch-all 200 response forcow_api_requestSubmitted→Observedthroughout (replay.rs,report.rs,main.rs)classify_oknow checks local store forobserved:*key instead ofsubmit_ordercall countsubmitted_bodyfield fromReplayOutcomeCloses #45
Test plan
cargo test -p ethflow-watcher— 11/11 pass (covers the full observe+verify strategy)cargo check -p shepherd-backtest— zero warningsbacktest_collect.py— 5/5 Observed, 100%, exit 0Observed + RejectedExpected