Skip to content

[codex] Publish v1.2 hardening candidate - #4

Merged
ZhenHaoFu810 merged 2 commits into
mainfrom
codex/public-hardening-sync
Jul 9, 2026
Merged

ZhenHaoFu810 merged 2 commits into
mainfrom
codex/public-hardening-sync

Conversation

@ZhenHaoFu810

@ZhenHaoFu810 ZhenHaoFu810 commented Jul 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Sync the July 2026 v1.2.0+ correctness-hardening candidate to the public repository.
  • Refresh README, Chinese README, changelog, release status, known issues, and release-candidate checklist.
  • Publish the manifest-selected code/test/docs hardening changes without internal audit workspaces or golden test artifacts.

Validation

Main repository:

  • python -m compileall -q src/stataflow
  • python -c "import stataflow; print(stataflow.__version__); print(stataflow.OLS.__name__)"
  • pytest tests/ -q --ignore=tests/golden/ --ignore=tests/audit_v1_3: 405 passed, 76 warnings

Public mirror:

  • pytest tests/ -q --ignore=tests/golden/ --ignore=tests/audit_v1_3: 397 passed, 76 warnings
  • python -m compileall -q src/stataflow tests
  • python -c "import stataflow; print(stataflow.__version__)"
  • python examples/demo_regress.py
  • python examples/demo_reghdfe.py
  • python examples/demo_ppmlhdfe.py
  • python examples/demo_ivregress_2sls.py
  • python -m pip wheel . --no-deps -w dist_tmp

Notes

Package version remains 1.1.0. This PR is a correctness-hardening release-candidate sync for the v1.2.0+ line.

@ZhenHaoFu810
ZhenHaoFu810 marked this pull request as ready for review July 9, 2026 12:26
Copilot AI review requested due to automatic review settings July 9, 2026 12:26
@ZhenHaoFu810
ZhenHaoFu810 merged commit f1aa958 into main Jul 9, 2026
4 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Publishes a July 2026 v1.2.0+ correctness-hardening release-candidate sync to the public repository, pairing targeted estimator/schema hardening with a broad documentation and release-status refresh while keeping the package version at 1.1.0.

Changes:

  • Extends ResultSchema coefficient serialization to preserve Stata factor-variable base/omitted metadata and adds regression/RD/FE/IV/PPML correctness alignment tweaks.
  • Updates DID-imputation semantics/tests around “never-treated” encoding and documents wrapper-vs-native option boundaries (notably window).
  • Refreshes README(s), changelog, open-source status, known issues, and release-candidate checklist for the public sync.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_result_schema.py Adds JSON round-trip coverage for factor base/omitted flags.
tests/test_rdrobust.py Adds warning assertion for low effective sample in RD.
tests/test_compat_stata_linear.py Adds FE clustered df_model and residuals contract tests.
tests/test_compat_stata_iv.py Adds near-collinearity regression drop consistency test for IV.
tests/test_compat_stata_hdfe.py Adds near-collinearity and df_a/df_resid reproduction tests for HDFE/PPMLHDFE.
tests/test_compat_stata_glm.py Adds near-collinearity consistency test for logit.
tests/test_compat_stata_did.py Switches DID test data to missing-as-never-treated and refines wrapper/native option expectations.
src/stataflow/results/result.py Serializes is_base/is_omitted for coefficient rows.
src/stataflow/estimators/rdrobust.py Emits a diagnostics warning for low effective observations.
src/stataflow/estimators/ppmlhdfe.py Sets clustered df_resid to missing (NaN) to match Stata semantics.
src/stataflow/estimators/iv.py Adjusts weak-ID constant counting and FE small-sample scaling in robust/OLS VCE paths.
src/stataflow/estimators/fe.py Aligns clustered df_model storage and clarifies residual prediction contract (y - xb).
src/stataflow/estimators/eventstudyinteract.py Tweaks cluster small-sample adjustment to include the implicit constant.
src/stataflow/estimators/did_imputation.py Treats any finite first_treat as an ever-treated cohort (missing-only never-treated).
src/stataflow/compat/stata/did.py Explicitly rejects window in the Stata-compatible did_imputation wrapper.
src/stataflow/init.py Clarifies package-level docstring positioning and wording.
README.zh-CN.md Refreshes positioning, feature summary, examples, and validation notes.
README.md Refreshes positioning, feature summary, examples, and validation notes.
docs/research/did_imputation.md Adds research archive describing target ado behavior and estimator contract.
docs/research/did_imputation-options.md Adds options-focused research archive, including window() boundary.
docs/release/release-candidate-checklist.md Updates RC checklist for July 2026 sync and validation gates.
docs/release/open-source-status.md Updates open-source status model and July 2026 sync summary.
docs/release/known-issues.md Records the July 2026 hardening update and re-frames known issues.
docs/command-support-matrix/did-imputation.md Adds did_imputation support matrix including wrapper/native boundaries.
docs/architecture/result-schema.md Documents ResultSchema contract including factor-row metadata fields.
CHANGELOG.md Adds v1.2.0+ correctness-hardening sync entry (version remains 1.1.0).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 244 to 248
"ci_high": row.ci_high,
"is_base": row.is_base,
"is_omitted": row.is_omitted,
}
for row in self.coefficients
- 所有系数与协方差矩阵必须保留变量名顺序
- Stata-compatible factor-variable wrappers must retain Stata-style base/omitted rows in `coefficients` and matching zero rows/columns in `variance`; those rows are marked by `is_base` and `is_omitted`
- `sample_mask` 必须可逆推出保留样本,不能只给计数
- 缺失或不适用字段使用 `null`,不允许混用字符串 `"NA"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants