Day 155 — Poison the future and assert nothing changes

Friday, 8 January 2027 · Week 23 of 52 · The research harness · Study day · 60 min

This is the test that turns a claim about your engine into a fact about it, and it is the one an interviewer will ask you to describe.

What you should be able to do tonight

  • Implement a test that corrupts all data after the decision timestamp and asserts every backtest output is bit-identical.
  • Say what the test would fail to catch, and write a second test for that gap.

Tasks 60 min

35 min Write tests/test_no_lookahead.py: run a strategy over a fixed window, then rerun it with every value after each decision timestamp replaced by noise, and assert the fills, positions and returns are identical. Run it against all your strategies. If any of them fails, the failure is the most valuable result of the week.

25 min Find the gap: the poisoning test catches a strategy reading forward data, but it does not catch a parameter that was chosen by looking at the whole sample, because that choice happened outside the engine. Write the second test as an assertion that the configuration hash used in a run matches one recorded before the evaluation window began.

Resources

Deliverable

tests/test_no_lookahead.py passing for every strategy, plus a second test on configuration provenance.

Checkpoint

Describe the poisoned-future test, then say precisely what class of look-ahead it cannot detect.

Prepare for tomorrow

Ten minutes tonight so Day 156, Saturday, 9 January 2027 starts clean. This is what the evening email sends you.

Design a synthetic price series where you know the exactly correct strategy return in closed form.

A deterministic sawtooth with a known amplitude and period is the easiest one.

Write down the analytic answer before you code anything.