You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
R3 P2: the previous mock-based regression checks the helper is called
with the final df, but if no later IF site reduces n_valid relative
to per-path snapshots, snapshot df coincides with final df and the
assertion is vacuous.
Add `test_per_path_inference_refreshes_to_lower_final_df`: deter-
ministic forcing function via `mock.patch.object` on `_compute_se`,
gated by a flag that flips after `_compute_path_effects` returns.
After the flag is set, every subsequent `_compute_se` call returns
a hardcoded low `n_valid=5` — so global placebo / overall / joiners
/ leavers all append 5, while per-path effects already snapshotted
a high df from the unmodified pre-flag calls. Final
`survey_metadata.df_survey = 5 - 1 = 4` is strictly less than the
per-path snapshot df, forcing the refresh to demonstrably move
per-path inference from the high snapshot df to the low final df.
Sanity-checked: temporarily replacing `_refresh_path_inference` with
a no-op causes the new test to fail with a stale-p_value assertion,
confirming bug-detection.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments