Repository navigation
[codex] Publish v1.2 hardening candidate - #4
Merged
Merged
Conversation
There was a problem hiding this comment.
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
ResultSchemacoefficient 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"` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Validation
Main repository:
python -m compileall -q src/stataflowpython -c "import stataflow; print(stataflow.__version__); print(stataflow.OLS.__name__)"pytest tests/ -q --ignore=tests/golden/ --ignore=tests/audit_v1_3: 405 passed, 76 warningsPublic mirror:
pytest tests/ -q --ignore=tests/golden/ --ignore=tests/audit_v1_3: 397 passed, 76 warningspython -m compileall -q src/stataflow testspython -c "import stataflow; print(stataflow.__version__)"python examples/demo_regress.pypython examples/demo_reghdfe.pypython examples/demo_ppmlhdfe.pypython examples/demo_ivregress_2sls.pypython -m pip wheel . --no-deps -w dist_tmpNotes
Package version remains
1.1.0. This PR is a correctness-hardening release-candidate sync for the v1.2.0+ line.