The Covered Interest Rate Parity for FX is often quoted simplistically as $$ X_T \quad=\quad X_S \cdot \frac{D^{base}_T}{D^{quote}_T} $$ where $X_t$ is the (projected) FX rate at time $t$ (denoted as $1$ base = $X$ quote), $D_t^{ccy}$ is the discount factor for time $t$ in currency $ccy$, and $X_S$ denotes the current FX Spot Rate.
To derive this parity one can note a cashflow of 1 USD at $T$ can be discounted in USD and then converted at spot $X_S$ to JPY. Or equivalently, convert at $X_T$ and discount in JPY. So $$ \text{NPV in JPY} \quad=\quad (1\text{ USD} \cdot D_T^{USD}) \cdot X_S \quad=\quad (1\text{ USD} \cdot X_T) \cdot D_T^{JPY} $$ which implies the parity.
In practice the above parity does not hold since spot $\ne$ today (e.g. when spot = today + 2 days). So we get a more comprehensive parity: $$ X_{T} \quad=\quad X_{S} \cdot \frac{D^{base}_{T}}{D^{quote}_{T}} \cdot \color{blue}{\frac{D^{quote}_{S}}{D^{base}_{S}}} $$ E.g. see QuantLib's implementation: github.com/.../QuantLib/.../ratehelpers.cpp#L995-L1012
I am struggling to properly incorporate this $\color{blue}{\text{spot adjustment}}$ in the non-arbitrage/replication argument, which I outlined above. Can anybody help?