Commit 420be21
R3 polish: drop 'matched to your data shape' overclaim on no-first_treat path
Codex R2 narrowed P1: the no-`first_treat` branch unconditionally emitted
`DifferenceInDifferences().fit(...)` and labeled it "matched to your data
shape". That overclaim doesn't hold for continuous-dose or heterogeneous-
adoption designs without first_treat — DiD validates and rejects non-
binary treatment / time at fit-time (`diff_diff/estimators.py:307-312`).
Fix in agent_workflow.py:
- With `first_treat`: keep CallawaySantAnna example, relabel as
"your data has first_treat -> staggered structure; CS is canonical".
- Without `first_treat`: keep DiD example as the simple 2x2 case but
reframe the label to explicitly condition on that shape, name the
alternative candidates (ContinuousDiD, HeterogeneousAdoptionDiD),
and reference DiD's fit-time validation so the agent knows when to
switch. No claim of universal match.
New regression test `test_no_first_treat_step3_does_not_overclaim_match`:
- asserts "matched to your data shape" is NOT in the no-first_treat
script (negative)
- asserts "2x2" and "substitute" appear (positive — substitution hint)
- asserts ContinuousDiD and HeterogeneousAdoptionDiD remain enumerated
in Step 2's routing patterns
Total tests: 17 → 18 in test_agent_workflow.py.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 93dc359 commit 420be21
2 files changed
Lines changed: 55 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
153 | 161 | | |
154 | 162 | | |
155 | 163 | | |
156 | 164 | | |
157 | 165 | | |
158 | 166 | | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
159 | 171 | | |
160 | 172 | | |
161 | 173 | | |
162 | 174 | | |
163 | 175 | | |
164 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
165 | 185 | | |
166 | 186 | | |
167 | 187 | | |
| |||
200 | 220 | | |
201 | 221 | | |
202 | 222 | | |
203 | | - | |
| 223 | + | |
204 | 224 | | |
205 | 225 | | |
206 | 226 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
145 | 174 | | |
146 | 175 | | |
147 | 176 | | |
| |||
0 commit comments