Repainting and look-ahead
A backtest sees the future when a decision uses a value that was not final at the moment it was made. The two common causes have two names. Repainting is a value that changes after the bar it belongs to. Look-ahead is a value taken from a later bar, or from a bar that had not closed.
What Forge does about it
Forge decides on closed bars. A decision is made at a bar's close, and code can reach only bars whose close is at or before that moment. Histories handed to your code are views cut at that moment, never slices of the full array.
A slower series follows one rule. Its value becomes visible on the first bar of your series whose close is at or after the close of that slower bar. A strategy on hourly bars that reads a four-hour series sees the four-hour value only after the four-hour bar has closed.
There is no switch that loosens this. Pine has a lookahead setting on its higher-timeframe call, and Forge does not.
An order decided at a close acts at the first real price after it. The decision bar's own close is never a fill price.
Indicators that redraw
Some indicators rewrite their past as new bars arrive, for example zigzag lines and fractals. Their past values are not what a trader saw at the time. A redrawing indicator is marked as repainting, and a strategy that reads it sees what was visible at each bar, not the final drawing.
Checks before publishing
Forge runs a look-ahead check before a script is published. It names patterns that usually leak the future, such as a negative shift, an average over the whole array or a window centred on the current bar.
See the hold-out test for how a result is checked on data the search never saw.