Commit 872abc8
Address PR #366 CI review round 17 (1 P1): split "no never-treated" vs "negative dose" branches; HAD only valid on the former
Reviewer correctly noted that the round-15/16 wording listed
`HeterogeneousAdoptionDiD` as a routing alternative whenever
`ContinuousDiD` fails on the dose-related preflights, but HAD
itself requires non-negative dose support and raises on negative
post-period dose at `had.py:1450-1459` (paper Section 2). On a
panel with `dose_min < 0`, routing to HAD silently steers an agent
into the same fit-time error. Verified the rejection at
`had.py:1450-1459`.
Reworded every site to split the two failure modes:
- Branch (a): `has_never_treated == False` (no zero-dose controls
but all observed doses non-negative). `ContinuousDiD` does not
apply (Remark 3.1 not implemented). HAD IS a routing alternative
on this branch (HAD's contract requires non-negative dose,
satisfied here); linear DiD with a continuous covariate is
another.
- Branch (e): `dose_min < 0` (negative treated doses).
`ContinuousDiD` does not apply AND HAD is **not** a fallback
either — HAD raises on negative post-period dose
(`had.py:1450-1459`). Linear DiD with a signed continuous
covariate is the applicable alternative on this branch.
Updated wording across:
- `diff_diff/profile.py` `TreatmentDoseShape` docstring (refactored
from item-by-item duplication into a numbered list with a single
"Routing alternatives when (1) or (5) fails" section that splits
the two branches; trimmed redundancy).
- `diff_diff/guides/llms-autonomous.txt` §2 field reference (split
the When-(1)-or-(5)-fails paragraph into the two branches).
- `diff_diff/guides/llms-autonomous.txt` §4.7 trailing paragraph
(consolidated to a pointer at §2's split discussion).
- `diff_diff/guides/llms-autonomous.txt` §5.2 reasoning chain
counter-example #4 (no never-treated branch: HAD applies) and
counter-example #5 (negative-dose branch: HAD does NOT apply,
cite `had.py:1450-1459`).
- `CHANGELOG.md` Wave 2 entry.
- `ROADMAP.md` AI-Agent Track building block.
- `tests/test_profile_panel.py` two test docstrings/comments.
Added `test_autonomous_negative_dose_path_does_not_route_to_had`
in `tests/test_guides.py` asserting that §5.2 explicitly cites
`had.py:1450-1459` on the negative-dose branch (used a single-
line fingerprint since the prose phrase "non-negative dose
support" is split across newlines in the rendered guide).
Length housekeeping: trimmed counter-example #4 and #5 prose +
§4.7 trailing paragraph to point at §2's split discussion;
autonomous (65374 chars) < full (66031), `test_full_is_largest`
green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent e712742 commit 872abc8
6 files changed
Lines changed: 129 additions & 98 deletions
File tree
- diff_diff
- guides
- tests
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
141 | | - | |
| 141 | + | |
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
252 | 260 | | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
258 | 268 | | |
259 | 269 | | |
260 | 270 | | |
| |||
563 | 573 | | |
564 | 574 | | |
565 | 575 | | |
566 | | - | |
567 | | - | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
574 | | - | |
575 | | - | |
576 | | - | |
577 | | - | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
578 | 580 | | |
579 | 581 | | |
580 | 582 | | |
| |||
886 | 888 | | |
887 | 889 | | |
888 | 890 | | |
889 | | - | |
890 | | - | |
891 | | - | |
892 | | - | |
893 | | - | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
894 | 894 | | |
895 | | - | |
896 | | - | |
897 | | - | |
898 | | - | |
899 | | - | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
904 | | - | |
905 | | - | |
906 | | - | |
907 | | - | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
908 | 901 | | |
909 | 902 | | |
910 | 903 | | |
911 | | - | |
912 | | - | |
913 | | - | |
914 | | - | |
915 | | - | |
916 | | - | |
917 | | - | |
918 | | - | |
919 | | - | |
920 | | - | |
921 | | - | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
922 | 912 | | |
923 | 913 | | |
924 | 914 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 90 | + | |
103 | 91 | | |
104 | 92 | | |
105 | 93 | | |
| |||
120 | 108 | | |
121 | 109 | | |
122 | 110 | | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
137 | 139 | | |
138 | 140 | | |
139 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
166 | 200 | | |
167 | 201 | | |
168 | 202 | | |
| |||
0 commit comments