Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .claude/commands/docs-check.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The following estimators/features MUST have documentation:
| WooldridgeDiD | "WooldridgeDiD" | "WooldridgeDiD" | wooldridge_etwfe.rst | "Multi-Period and Staggered" |
| TROP | "TROP" | "TROP" | trop.rst | "Triply Robust Panel" |
| HonestDiD | n/a (in `## Diagnostics`) | n/a (in `## Diagnostics`) | honest_did.rst | "Honest DiD" |
| BaconDecomposition | "BaconDecomposition" | "BaconDecomposition" | bacon.rst | "Multi-Period and Staggered" |
| BaconDecomposition | n/a (in `## Diagnostics and Sensitivity Analysis`) | n/a (in `## Diagnostics & Sensitivity`) | bacon.rst | "Multi-Period and Staggered" |

### Supporting Features (require llms.txt mention + API docs; README mention only if landing-page-relevant)

Expand Down Expand Up @@ -117,11 +117,11 @@ Determine which checks to run based on `$ARGUMENTS`.
For each estimator/diagnostic in the table above:

1. Read `diff_diff/guides/llms.txt` and verify the name appears under the right section:
- **Estimators** (e.g. CallawaySantAnna, SunAbraham, TROP, BaconDecomposition): under `## Estimators`
- **Diagnostics-class** (HonestDiD, and any future diagnostic-only entries): under `## Diagnostics and Sensitivity Analysis`
- **Estimators** (e.g. CallawaySantAnna, SunAbraham, TROP): under `## Estimators`
- **Diagnostics-class** (HonestDiD, BaconDecomposition, RDPlot, RDDensityTest, and any future diagnostic-only entries): under `## Diagnostics and Sensitivity Analysis`
2. Read `README.md` and verify the name appears in the matching flat catalog:
- **Estimators**: in the `## Estimators` section
- **Diagnostics-class** (HonestDiD): in the `## Diagnostics & Sensitivity` section
- **Diagnostics-class** (HonestDiD, BaconDecomposition, RDPlot, RDDensityTest): in the `## Diagnostics & Sensitivity` section
3. Report missing entries

```bash
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/docs-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
- 'tests/test_docs_ia.py'
- 'tests/test_v4_matrix.py'
- 'tests/test_naming_guard.py'
# Diagnostic-family roster guard (M-090): README-only diffs otherwise
# run no lane that executes it - rust-test.yml fires on tests/** and
# diff_diff/** only.
- 'tests/test_v4_diagnostic_family_docs.py'
- 'README.md'
# Changelog-fragment guard: the fragment store, the compiler, and
# CHANGELOG.md itself trigger here (their ONLY CI lane - rust-test.yml
# deliberately does not fire on fragment-only diffs).
Expand Down Expand Up @@ -48,6 +53,11 @@ on:
- 'tests/test_docs_ia.py'
- 'tests/test_v4_matrix.py'
- 'tests/test_naming_guard.py'
# Diagnostic-family roster guard (M-090): README-only diffs otherwise
# run no lane that executes it - rust-test.yml fires on tests/** and
# diff_diff/** only.
- 'tests/test_v4_diagnostic_family_docs.py'
- 'README.md'
- 'tests/test_changelog_fragments.py'
- 'changelog.d/**'
- 'CHANGELOG.md'
Expand Down Expand Up @@ -129,6 +139,13 @@ jobs:
# the main test matrix does not trigger on docs-only diffs.
run: PYTHONPATH=. DIFF_DIFF_BACKEND=python pytest tests/test_v4_matrix.py -v

- name: Run diagnostic-family roster guard
# Pins the M-090 estimators/diagnostics split on README, llms.txt,
# llms-full.txt, docs/index.rst, docs/api/index.rst and the REGISTRY
# archive framing; docs-only and README-only diffs do not trigger the
# main matrix.
run: PYTHONPATH=. DIFF_DIFF_BACKEND=python pytest tests/test_v4_diagnostic_family_docs.py -v

- name: Run naming-completeness guard
# The section-8/section-9 naming guard (spec in the module docstring):
# public-surface vocabulary sweep, phase-table agreement in both
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ Full guide: `diff_diff.get_llm_guide("practitioner")`.
- [LWDiD](https://diff-diff.readthedocs.io/en/stable/api/lwdid.html) - Lee & Wooldridge (2025, 2026) rolling-transformation DiD: unit-specific demean/detrend converts panel to cross-section, staggered adoption, `estimation_method` in `reg`/`ipw`/`dr`/`psm` (the papers' RA/IPW/IPWRA plus propensity-score matching), exact small-N inference on the classical collapsed regression
- [DMLDiD](https://diff-diff.readthedocs.io/en/stable/api/dml_did.html) - Chang (2020) double/debiased machine learning DiD: staggered ATT(g,t) with cross-fitted ML nuisance learners (DML2) and Neyman-orthogonal scores, for flexible/high-dimensional covariate adjustment under conditional parallel trends; panel or declared repeated cross sections (`panel=False`); survey/cluster support on both lanes (bad-control lane: panel only, `cluster=` only); Caetano, Callaway, Payne & Sant'Anna (2026) bad-control score via `fit(bad_control=, bad_control_covariates=)`
- [DurationDiD](https://diff-diff.readthedocs.io/en/stable/api/duration_did.html) - Deaner & Ku (2026) causal duration DiD for a binary absorbing outcome (spell ended) in a two-group common-timing design: restricts the groups' untreated hazards (`method="cd"` additive gap or `method="ph"` ratio) instead of outcome levels, imputes the treated counterfactual survival, reports the per-date absorption ATT with whole-individual bootstrap pointwise and simultaneous bands plus a fixed-anchor pre-treatment specification test
- [BaconDecomposition](https://diff-diff.readthedocs.io/en/stable/api/bacon.html) - Goodman-Bacon (2021) decomposition for diagnosing TWFE bias in staggered settings

## Diagnostics & Sensitivity

Expand All @@ -131,6 +130,7 @@ Full guide: `diff_diff.get_llm_guide("practitioner")`.
- [Parallel Trends Testing](https://diff-diff.readthedocs.io/en/stable/api/diagnostics.html) - simple and Wasserstein-robust parallel trends tests, equivalence testing (TOST)
- [Placebo Tests](https://diff-diff.readthedocs.io/en/stable/api/diagnostics.html) - placebo timing, group, permutation, leave-one-out
- [TWFE Weight Diagnostics](https://diff-diff.readthedocs.io/en/stable/api/twfe_weights.html) - Baker et al. (2025) implicit weights a TWFE regression places on each ATT(g,t), against the ATT^O / ATT^simple targets, with the pre-period contribution. Ports Callaway's `twfeweights` (MIT)
- [Bacon Decomposition](https://diff-diff.readthedocs.io/en/stable/api/bacon.html) - Goodman-Bacon (2021) decomposition of the TWFE estimate into its 2x2 comparisons and weights, for diagnosing TWFE bias in staggered settings (`BaconDecomposition`, alias `Bacon`)
- [Honest DiD](https://diff-diff.readthedocs.io/en/stable/api/honest_did.html) - Rambachan & Roth (2023) sensitivity analysis: robust CI under PT violations, breakdown values
- [Pre-Trends Power Analysis](https://diff-diff.readthedocs.io/en/stable/api/pretrends.html) - Roth (2022) minimum detectable violation and power curves
- [Power Analysis](https://diff-diff.readthedocs.io/en/stable/api/power.html) - analytical and simulation-based MDE, sample size, power curves for study design
Expand Down
9 changes: 9 additions & 0 deletions changelog.d/20261101-v4-pr9-m090-docs-reorg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### Documentation

- `BaconDecomposition` is re-homed into the diagnostics family ([M-090], item 9 of the 4.0 cut): it leaves the estimator catalogues - README `## Estimators`, `llms.txt` `## Estimators`, the `llms-full.txt` Estimators section and its alias line, the API-reference Estimators autosummary and module toctree, and the docs homepage Supported Estimators table - for their Diagnostics groupings. `RDPlot` moves from the API-reference Visualization autosummary into Diagnostics; `RDPlot`, `RDDensityTest` and the TWFE weight diagnostics leave the `llms-full.txt` Estimators section. Docs-only: the import path, the `Bacon` alias, the results class and every number are unchanged.
- The docs homepage gains a "Diagnostics & Sensitivity" table (BaconDecomposition, RDPlot, RDDensityTest, HonestDiD, PreTrendsPower, PowerAnalysis, DiagnosticReport, the parallel-trends / placebo / TWFE-weight functions and the HAD pretest workflow) next to the estimator table; the API-reference Estimators and Diagnostics intros describe the split.
- `docs/methodology/REGISTRY.md` archive framing for the classes removed at 4.0: the MultiPeriodDiD and StaggeredTripleDifference sections and the QDiD class-spelling subsection open with an archive Note, the table of contents marks them *(archived)* and states the archived-sections convention, the cross-reference tables name `ChangesInChanges(method="qdid")` instead of a standalone `QDiD` estimator, and the "20-estimator count" wording is gone. The migration guide gains the [M-090] bullet.

### Internal

- Ledger row M-090 flips to `done` with `tests/test_v4_diagnostic_family_docs.py` as its `test_ref`; the test pins the estimators/diagnostics split on README, `llms.txt`, `llms-full.txt`, `docs/index.rst`, `docs/api/index.rst` and the REGISTRY archive framing, and runs in the docs-tests workflow (README-only diffs now trigger that lane). `docs/doc-deps.yaml` points the diagnostic modules at the new homepage table; the `/docs-check` classification table files Bacon as a diagnostics-class entry.
Loading
Loading