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
Add workflow improvements to reduce PR review rounds
Add safe_inference() utility for NaN-safe inference computation,
assert_nan_inference() test helper, enhanced pre-merge pattern checks,
methodology cross-checks in plan review, anti-pattern detection in
Codex review, and pre-commit pattern checks in submit/push skills.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Read the relevant estimator section in `docs/methodology/REGISTRY.md`
243
+
- For each equation the plan implements: verify it matches the Registry, or the plan documents the deviation
244
+
- For each edge case in the Registry's "Edge cases" section: verify the plan handles it or explicitly defers it
245
+
- CRITICAL if plan contradicts a Registry equation without documented deviation
246
+
- MEDIUM if plan doesn't handle a documented Registry edge case
247
+
- LOW if plan adds new edge case handling not yet in Registry (suggest updating it)
241
248
242
249
For all code:
243
250
- Error handling paths — are they tested with behavioral assertions (not just "runs without exception")?
@@ -351,6 +358,11 @@ Cross-reference against the relevant CLAUDE.md checklists. List which checklist
351
358
352
359
[Identify which CLAUDE.md checklist applies (e.g., "Adding a New Parameter to Estimators", "Implementing Methodology-Critical Code", "Fixing Bugs Across Multiple Locations") and list any items from that checklist that the plan doesn't cover.]
Copy file name to clipboardExpand all lines: TODO.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,43 @@ Several estimators return `0.0` for t-statistic when SE is 0 or undefined. This
55
55
56
56
**Note**: CallawaySantAnna was fixed in PR #97 to use `np.nan`. These other estimators should follow the same pattern.
57
57
58
+
### Migrate Existing Inference Call Sites to `safe_inference()`
59
+
60
+
`safe_inference()` was added to `diff_diff/utils.py` to compute t_stat, p_value, and CI together with a NaN gate at the top. It is now the prescribed pattern for all new code (see CLAUDE.md design pattern #7). However, ~20 existing inline inference computations across 12 files have **not** been migrated yet.
ci = compute_confidence_interval(effect, se, alpha)
87
+
88
+
# After (NaN-safe, consistent)
89
+
from diff_diff.utils import safe_inference
90
+
t_stat, p_value, ci = safe_inference(effect, se, alpha=alpha, df=df)
91
+
```
92
+
93
+
**Priority**: Medium — the NaN-handling table above covers the worst cases (those using `0.0`). The remaining sites may use partial guards but should still be migrated for consistency and to prevent regressions.
0 commit comments