Commit 22d7f65
Address PR #346 CI review round 14: P3 tighten NaN-contract wording
Round 14 is ✅ Looks good; this closes the final residual P3 for
wording accuracy.
**P3 (Docs): NaN-contract wording overstated**
The prior wording said users can expect all five result fields to be
finite or all NaN together. That is true on most degenerate paths
(constant-y, no-dose-variation) but NOT on the single-cluster CR1
configuration of the mass-point path: `_fit_mass_point_2sls` returns
`(att=beta_hat, se=nan)` there - `att` is finite because the Wald-IV
ratio is well defined, while CR1 requires G >= 2 clusters so `se`
is NaN. `safe_inference` then gates the downstream triple correctly,
but the doc claim that `att` and `se` are coupled with the triple
was inaccurate.
Fix: rewrote the result-class docstring preamble and the REGISTRY
Phase 2a NaN-propagation line to describe the invariant precisely:
- GUARANTEED NaN coupling is on the downstream triple (`t_stat`,
`p_value`, `conf_int`) via `safe_inference`.
- `att` and `se` are RAW estimator outputs from the chosen fit path
and are NOT gated by safe_inference.
- On most degenerate paths, fit paths return `(nan, nan)` so all
five move together, but on the single-cluster CR1 edge the fit
path returns `(att=beta_hat, se=nan)` and only the downstream
triple becomes NaN via the gate.
No code behavior changes; the `assert_nan_inference` fixture already
only checks the downstream triple, matching the restated contract.
Targeted regression: 166 HAD tests (+1 sklearn-gated skip) + 545
total (+1 skipped) across Phase 1 and adjacent surfaces, all green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 2f6e1d0 commit 22d7f65
2 files changed
Lines changed: 21 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
141 | 154 | | |
142 | 155 | | |
143 | 156 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2319 | 2319 | | |
2320 | 2320 | | |
2321 | 2321 | | |
2322 | | - | |
| 2322 | + | |
2323 | 2323 | | |
2324 | 2324 | | |
2325 | 2325 | | |
| |||
0 commit comments