Repository navigation
feat(v4): PR 3b of the 4.0 cut - remove the fit-time aggregate=/balance_e= keywords on CS, EfficientDiD, StackedDiD, dCDH and HAD - #864
Conversation
…ce_e= keywords on CS, EfficientDiD, StackedDiD, dCDH and HAD Spec section 9 item 3, sub-item 3b (3a landed the tests-first migration in #863; 3c carries the ImputationDiD/TwoStageDiD/ContinuousDiD removals and the bootstrapped-fit relay). Ledger rows M-020, M-023, M-024, M-026, M-027, M-117, M-120 and M-139 flip to removed. - diff_diff: CallawaySantAnna / EfficientDiD / StackedDiD / ChaisemartinDHaultfoeuille / HeterogeneousAdoptionDiD lose the fit-time aggregate= (and balance_e=) parameters; did_had_pretest_workflow loses aggregate= (the HADPretestReport.aggregate output field survives). CS and EfficientDiD compute no event-study/group surface at fit, so their legacy fields are None after every fit; the post-fit replay is the only bootstrap route. StackedDiD's fit-time group/all ValueErrors and the HAD _VALID_AGGREGATES sets go with the keywords. honest_did / pretrends / plot_event_study / _reporting_helpers / diagnostic_report messages and the four llms*.txt guides stop steering users to the removed route; _deprecation.py records that warn_deprecated_kwarg has no library caller. - docs: ledger rows + M-093 note (CS/EDiD populate the legacy fields on no fit), spec section 6 amendment + "(SHIPPED, PR 3b)" marker, REGISTRY CS / EDiD / Stacked / HAD notes, REPORTING, migration guide (slot shifts), API/perf docs, tutorial 02 comment. - tests: test_aggregate_contract retires the five Test*Shim classes, the fit-time fixtures and the inertness comparisons for Test*Removal pins (TypeError, signature, positional-slot binding); the estimator suites take their removal pins; test_guides pins the signature blocks without fit-time lines; naming-guard allowlist entries for llms.txt / llms-full.txt; _capture_v4_aggregate_oracles.py marked historical (runnable only at the recorded captured_at_head); warn_deprecated_kwarg gets a direct unit pin.
Overall assessment: ✅ Looks goodNo unmitigated P0 or P1 findings identified. Executive summary
MethodologyReviewed Callaway–Sant’Anna, EfficientDiD, StackedDiD, dCDH, and HAD/pretests against Registry equations, in-code references, and available on-file paper reviews.
No undocumented methodology deviation or newly incorrect inference was identified. Code QualityNo findings. Static caller checks found no remaining library or benchmark PerformanceNo findings. Bootstrap replay retains its documented per-call cost; this PR does not introduce a new replay implementation. MaintainabilityNo findings. Public signatures, removal tests, ledger statuses, and runtime guidance agree. Tech DebtNo new untracked limitation identified. Historical oracle capture instructions explain how to reproduce the committed reference data after removal. SecurityNo security issues or accidental secrets identified in the changes. Documentation/TestsNo actionable findings. The changelog fragment covers the user-visible removals, and regression coverage retains numerical oracles plus keyword-rejection and positional-binding checks. Validation completed: syntax checks for 18 modified modules and seven dependency-free guide assertions passed. Full pytest execution and numerical oracle verification remain unverified in this environment. |
Summary
aggregate=/balance_e=keywords are removed where the post-fit route already exists -CallawaySantAnna(M-020/M-117),EfficientDiD(M-023/M-120),StackedDiD(M-024),ChaisemartinDHaultfoeuille(M-026),HeterogeneousAdoptionDiD(M-027) anddid_had_pretest_workflow(M-139). The eight ledger rows flip toremoved; passing the keywords is now Python's nativeTypeError.CallawaySantAnnaandEfficientDiDcompute no event-study/group surface at fit: the legacy fields (and CS'scband_crit_value/event_study_vcov/event_study_vcov_index/event_study_df) areNoneafter every fit, and the post-fit replay is the only bootstrap route (unchanged). StackedDiD's fit-timegroup/allValueErrors and the HAD_VALID_AGGREGATESsets go with the keywords;_infer_aggregate_modeis HAD's sole selector. Positional slots after the removed parameters shift left (documented in the migration guide).honest_did,pretrends,plot_event_study,_reporting_helpers,diagnostic_report), the fourllms*.txtguides, REGISTRY / REPORTING notes, the migration guide, API and performance docs stop steering users to the removed route on these five estimators. Wording about ImputationDiD / TwoStageDiD / ContinuousDiD stays true at this PR (their keyword is still deprecated, not removed).docs/v4-design.mdsection 6 gains the 3b amendment and section 9 marks sub-item 3b shipped; ledger rowM-093records that CS/EDiD populate the legacy fields on no fit.tests/test_aggregate_contract.py: the fiveTest*Shimclasses, the fit-time fixtures (fit_time,efficient_fit_time,_boot_fit_time,_efficient_boot_fit_time) and the inertness comparisons are retired forTest*Removalpins (TypeError, signature, positional-slot binding); the committed oracle fixture stays the numerical reference.tests/_capture_v4_aggregate_oracles.pyis marked historical (it drives the removed route; runnable only at the recordedcaptured_at_head).warn_deprecated_kwargloses its last library caller and is retained per spec section 8 rule 11 with a direct unit pin.Methodology references (required if estimator / math changes)
Validation
tests/test_aggregate_contract.py(437 tests, numpy and rust backends),tests/test_staggered.py,tests/test_efficient_did.py,tests/test_stacked_did.py,tests/test_chaisemartin_dhaultfoeuille.py,tests/test_had.py,tests/test_had_pretests.py,tests/test_had_dual_knob_deprecation.py,tests/test_v4_rename_mechanical.py,tests/test_guides.py,tests/test_naming_guard.py,tests/test_event_study_surface.py, comment-only wording in nine CS/EDiD consumer suites. The touched and consumer suites (35 files, 4,132 tests) pass;test_v4_matrixsees the eight rows flip (due-at-4.0 non-terminal rows 24 -> 16).mypy diff_diffclean; Sphinx-Wbuild clean; tutorial 02 executes.Security / privacy
Changelog
changelog.d/20261021-v4-pr3b-aggregate-removals-mechanical.md(### Removed,### Breaking Changes,### Changed,### Internal)Follow-ups
M-021/M-022/M-025/M-118/M-119) plus the bootstrapped-fit relay (spec section 6 amendment), prepared on top of this branch and opened once it merges.