You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Address PR #347 R4: propagate no_scalar_headline through BR/DR; Wooldridge method-aware
R4 surfaced one P1 + one P2, both addressed.
P1 (methodology): the dCDH no-scalar branch was documented in the
schema but not plumbed through BR/DR rendering. When
``aggregation="no_scalar_headline"`` and ``headline_attribute=None``
(``trends_linear=True`` + ``L_max>=2``), BR/DR still extracted
``overall_att`` (NaN by design) and narrated it via the estimation-
failure path, producing internally inconsistent output — the
``target_parameter`` block said "no scalar aggregate; consult
linear_trends_effects" while the headline prose told users to
inspect rank deficiency.
Fix (both surfaces):
- BR ``_build_schema``: compute ``target_parameter`` BEFORE
``_extract_headline``; if the aggregation tag is
``no_scalar_headline``, route through a dedicated headline block
with ``status="no_scalar_by_design"`` / ``effect=None`` /
``sign="none"`` and an explicit ``reason`` field naming the
``linear_trends_effects`` alternative.
- BR ``_render_headline_sentence``: detect
``status == "no_scalar_by_design"`` and emit explicit "does not
produce a scalar aggregate effect ... by design" prose instead
of the non-finite / estimation-failure sentence.
- BR ``_build_caveats``: the existing ``sign == "undefined"``
estimation-failure caveat does not fire because we emit
``sign == "none"`` (not ``"undefined"``) on the no-scalar case.
- DR ``_execute``: analogous headline-metric short-circuit with
``status="no_scalar_by_design"`` on detection of the
no_scalar_headline tag.
- DR ``_render_overall_interpretation``: explicit no-scalar
sentence takes precedence over the non-finite estimation-failure
branch.
P2 (Wooldridge method awareness): the Wooldridge branch previously
labeled every fit as ASF-based, but REGISTRY.md Sec. WooldridgeDiD
splits OLS ETWFE (observation-count-weighted average of ATT(g,t)
from a saturated regression) from the nonlinear (logit / Poisson)
ASF path. Branch on ``results.method`` ("ols" -> coefficient-
aggregation wording; other -> ASF wording).
Tests: added 4 end-to-end regressions.
- ``test_dcdh_trends_linear_no_scalar_propagates_through_br``:
real dCDH fit with ``trends_linear=True`` + ``L_max=2``; asserts
BR schema emits ``status="no_scalar_by_design"``, summary prose
contains "no scalar" / "does not produce a scalar", does NOT
contain "rank deficiency" / "estimation failed", and caveats do
NOT include ``estimation_failure``.
- ``test_dcdh_trends_linear_no_scalar_propagates_through_dr``:
mirror on the DR side (``headline_metric`` status and
``overall_interpretation`` prose).
- ``test_wooldridge_ols``: asserts the OLS branch names
ATT(g,t) aggregation and does NOT include "ASF" in the name.
- ``test_wooldridge_nonlinear``: asserts logit/poisson routes
through the ASF branch.
336 BR/DR tests pass. Black and ruff clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments