Skip to content

Commit 982b7cb

Browse files
igerberclaude
andcommitted
Address PR #347 R6: drop brittle line ref from StackedDiD; sync llms-full.txt schema
Two P3 cleanups from R6. P3 #1: the StackedDiD ``target_parameter.definition`` embedded an internal implementation line reference (``stacked_did.py`` around line 541). That pointer is not methodology source material and will go stale under routine estimator edits even when the estimand itself is unchanged. Removed the reference; definition now stands on paper/registry terms alone. P3 #2: ``diff_diff/guides/llms-full.txt`` listed the pre-PR BR/DR schema top-level keys and omitted ``target_parameter``, so agent- facing documentation disagreed with the runtime schema. Added ``target_parameter`` to both schema-key lists (BR around line 1779 and DR around line 1844). Documented the field shape (``name`` / ``definition`` / ``aggregation`` / ``headline_attribute`` / ``reference``), the dispatch tag set, and the ``headline_attribute=None`` / ``aggregation="no_scalar_headline"`` edge case for the dCDH ``trends_linear=True, L_max>=2`` fit. Also noted the ``headline.status="no_scalar_by_design"`` value so guide-driven agents can dispatch correctly. UTF-8 fingerprint preserved per ``feedback_llms_guide_utf8_fingerprint.md`` (``tests/test_guides.py`` passes). 354 BR/DR + guide tests pass (337 BR/DR + 17 guide). Black clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent e995954 commit 982b7cb

2 files changed

Lines changed: 30 additions & 13 deletions

File tree

diff_diff/_reporting_helpers.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,15 @@ def describe_target_parameter(results: Any) -> Dict[str, Any]:
207207
"definition": (
208208
"The average of post-treatment event-study coefficients "
209209
"``delta_h`` (h >= -anticipation), estimated from the stacked "
210-
"sub-experiment panel with delta-method SE "
211-
"(``stacked_did.py`` around line 541). Each sub-experiment "
212-
"aligns a treated cohort with its clean-control set over the "
213-
"event window ``[-kappa_pre, +kappa_post]``; each per-horizon "
214-
"``delta_h`` is the paper's ``theta_kappa^e`` "
215-
"treated-share-weighted cross-event aggregate. The "
216-
"``overall_att`` headline is the equally-weighted average of "
217-
"these per-horizon coefficients, not a separate cross-event "
218-
"weighted aggregate at the ATT level. " + control_clause
210+
"sub-experiment panel with delta-method SE. Each sub-"
211+
"experiment aligns a treated cohort with its clean-control "
212+
"set over the event window ``[-kappa_pre, +kappa_post]``; "
213+
"each per-horizon ``delta_h`` is the paper's "
214+
"``theta_kappa^e`` treated-share-weighted cross-event "
215+
"aggregate. The ``overall_att`` headline is the equally-"
216+
"weighted average of these per-horizon coefficients, not a "
217+
"separate cross-event weighted aggregate at the ATT level. "
218+
+ control_clause
219219
),
220220
"aggregation": "stacked",
221221
"headline_attribute": "overall_att",

diff_diff/guides/llms-full.txt

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,11 +1776,23 @@ Schema top-level keys (all always present; missing content uses a
17761776
`{"status": "skipped", "reason": "..."}` shape rather than being absent):
17771777

17781778
- `schema_version`, `estimator`, `context`
1779-
- `headline`, `assumption`, `pre_trends`, `sensitivity`
1779+
- `headline`, `target_parameter`, `assumption`, `pre_trends`, `sensitivity`
17801780
- `sample`, `heterogeneity`, `robustness`, `diagnostics`
17811781
- `next_steps`, `caveats`, `references`
17821782

1783+
`target_parameter` (experimental) names what the headline scalar
1784+
represents for each estimator — overall ATT, DID_M, DID_1, cost-
1785+
benefit delta, dose-response aggregate, ASF-based ETWFE, etc.
1786+
Fields: `name` (short stakeholder label), `definition` (full prose),
1787+
`aggregation` (machine-readable dispatch tag, e.g., `"simple"`,
1788+
`"event_study"`, `"delta"`, `"no_scalar_headline"`),
1789+
`headline_attribute` (which raw attribute holds the scalar, or
1790+
`None` when no scalar exists by design — e.g., dCDH with
1791+
`trends_linear=True` and `L_max>=2`), `reference` (citation).
1792+
17831793
Status enum values: `ran | skipped | error | not_applicable | not_run | computed`.
1794+
`headline.status` also supports `"no_scalar_by_design"` on the dCDH
1795+
no-scalar branch.
17841796

17851797
## DiagnosticReport
17861798

@@ -1830,9 +1842,14 @@ dr.skipped_checks # dict of {check: plain-English reason}
18301842
```
18311843

18321844
Schema top-level keys: `schema_version, estimator, headline_metric,
1833-
parallel_trends, pretrends_power, sensitivity, placebo, bacon,
1834-
design_effect, heterogeneity, epv, estimator_native_diagnostics,
1835-
skipped, warnings, overall_interpretation, next_steps`.
1845+
target_parameter, parallel_trends, pretrends_power, sensitivity,
1846+
placebo, bacon, design_effect, heterogeneity, epv,
1847+
estimator_native_diagnostics, skipped, warnings,
1848+
overall_interpretation, next_steps`. The `target_parameter` block
1849+
mirrors BR's (same shape and dispatch); see BR's section above for
1850+
field semantics including the `headline_attribute=None` /
1851+
`aggregation="no_scalar_headline"` case for dCDH
1852+
`trends_linear=True, L_max>=2` fits.
18361853

18371854
### Verdicts and tiers
18381855

0 commit comments

Comments
 (0)