feat(coverage): add bounded PyO3 peer-evidence gate - #789
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Comment |
|
@opencode-agent address Integrate the published PyO3 native-extension helper into the protected central OpenCode coverage/review path on this same branch; keep the PR Draft until the integration is complete and exact-head evidence passes. Mirror the existing fail-closed R peer-evidence pattern rather than creating a second privileged reviewer. Required behavior:
Update the doctoring and CHANGELOG to distinguish source-only measurement, trusted native peer evidence, and remaining interpretation limits. Preserve immutable called-workflow source, reviewer credentials, NVIDIA/OpenCode model policy, independent approval, unresolved-thread, and branch-protection boundaries. |
|
@jules Implement the remaining central workflow integration on this existing Draft PR. Preserve the published helper and fail-closed trust boundary; do not create another PR or temporary workflow. Required scope:
Do not build PR-selected native code in the central sandbox, add a compatibility stub, skip product tests, use networked PR execution, change reviewer tokens or NVIDIA/OpenCode policy, weaken approval/protection gates, mark Ready, merge, or release. Commit as normal descendants without force-push, and report exact verification commands and the final head SHA. |
|
@jules Implement the remaining integration directly on this branch; do not create any temporary, self-modifying, encoded-patch, or branch-writing workflow. Required GREEN slice:
After integration, rerun OpenCode review for unchanged |
|
@jules Integrate the committed helper into the central Required fail-closed flow:
Do not build PR-selected native code inside the central sandbox, introduce a Python stub, auto-approve, weaken required checks, use COPILOT_GITHUB_TOKEN, or disturb the existing reviewer-agent secret contract. Update APA 7 doctoring and the authoritative changelog after GREEN. |
|
@coderabbitai Review the current Draft head |
Rate Limit Exceeded
|
|
Prepare the next bounded integration only after For the eventual current-main integration:
Keep Draft. Do not mutate the authoritative workflow from the pre-#759 base, approve, or merge. |
|
@jules Implement the existing TDD RED workflow contracts on exact live head Precondition: before every write, re-read the live head and stop without mutation unless it is the expected current head or your own direct descendant. Coverage integrationIn Initialize exactly: python_native_peer_check_required=0Only after a Python configured/default pytest/coverage command actually fails:
python3 "$GITHUB_WORKSPACE/scripts/ci/python_native_extension_peer_gate.py" classify-pytest \
--log "$log_file" \
--pyproject "$project_dir/pyproject.toml" \
--changed-files "$changed_files_file" \
--repo-root "$COVERAGE_SOURCE_WORKDIR"
and set In the compact PASS decision, when the variable is 1, emit exactly: Do not build/install PR-selected native code, add a Python stub, skip tests, or grant network access. Approval integrationMirror—but do not replace—the existing R peer-check pattern. Add independent functions that:
python3 "$GITHUB_WORKSPACE/scripts/ci/python_native_extension_peer_gate.py" require-checks \
--checks-json "$checks_file" \
--head-sha "$HEAD_SHA" \
--required-check "CI::python" \
--required-check "CI::rust" \
--required-check "CI::package"
Call this gate in both approval paths that already call Permanent tests and verificationMake the current tests GREEN without weakening them: python -m pytest -q \
tests/test_python_native_extension_peer_gate.py \
tests/test_python_native_extension_peer_gate_nested_project.py \
tests/test_python_native_extension_peer_gate_workflow_contract.pyThen run the permanent Python 3.10/3.14 quality workflow, focused and complete 100% production statement/branch coverage, interrogate 100%, compileall, actionlint, full central tests, security and supply-chain checks. Fix actual failures only. Preserve After GREEN, report the exact final SHA and verification commands in a PR comment. Do not request approval or change Draft state. |
|
Exact-head quality run @jules Implement the central workflow integration now rather than weakening these tests. Preserve the existing R peer gate and privileged reviewer chain. After GREEN, run full central coverage/docstrings/actionlint and replay OpenCode review against exact fast-mlsirm heads #546, #549, and #550. |
|
@opencode-agent address Fix the exact current-head quality failure on Run
Implement the documented fail-closed flow:
After GREEN, run all 90 focused tests at 100% statement/branch coverage, the complete central suite, interrogate 100%, compileall, actionlint, Python 3.10 compatibility, security workflows, and exact-head review. Keep Draft, |
|
@jules Implement the missing production integration on current branch |
|
@opencode-agent address Implement the committed workflow-integration RED contract on this Draft branch. Do not weaken the helper or tests. Preserve the existing R peer gate and reviewer credential chain. The central coverage job must capture bounded combined pytest output and status, classify only the exact unchanged maturin/PyO3 module-absence collection failure, then require trusted exact-head After GREEN, run the permanent workflow contracts, full central coverage/docstrings/actionlint/security, then replay exact current heads of fast-mlsirm #546, #549, and #550. |
|
@opencode-agent address A new RED trust-boundary contract is committed at |
|
@jules Apply and remove the committed one-shot patcher python3 scripts/ci/apply_pyo3_peer_gate_workflow_integration.py
rm scripts/ci/apply_pyo3_peer_gate_workflow_integration.py
python3 -m coverage erase
python3 -m coverage run --branch -m pytest -q \
tests/test_python_native_extension_peer_gate.py \
tests/test_python_native_extension_peer_gate_nested_project.py \
tests/test_python_native_extension_peer_gate_workflow_contract.py
python3 -m coverage report \
--include=scripts/ci/python_native_extension_peer_gate.py \
--show-missing --fail-under=100
python3 -m pytest -q \
tests/test_opencode_agent_contract.py \
tests/test_repository_branch_coverage_review_schedulers.py
python3 -m compileall -q \
scripts/ci/python_native_extension_peer_gate.py \
tests/test_python_native_extension_peer_gate.py \
tests/test_python_native_extension_peer_gate_nested_project.py \
tests/test_python_native_extension_peer_gate_workflow_contract.pyThe reviewed local proof is 91 focused tests and 100% helper statement/branch coverage. The patch also removes the temporary source-snapshot workflow and the duplicate quality workflow. Keep only |
|
@opencode-agent address The branch now contains |
Buyer-visible blocker
Central OpenCode coverage currently fails before pytest collection in mature maturin/PyO3 packages when the isolated source-only sandbox cannot import the compiled native extension. This leaves otherwise verified Python-only product PRs blocked even when the exact head passes repository Python, Rust/PyO3, package, GPU, and fuzz jobs.
This bounded slice
scripts/ci/python_native_extension_peer_gate.py;module-name;CheckRunrecords by exact head SHA, workflow, check name, completed state, and success conclusion;Verification
Focused local verification on the published source:
The tests include the exact
fast_mlsirm._corefailure shape and adversarial native-boundary, filesystem, log, metadata, and check-evidence cases.Security boundary
This PR does not skip tests, build a PR-selected extension, enable network access, add a Python compatibility stub, approve a pull request, or weaken branch protection. A successful classification is explicitly not passing evidence; the final central workflow must still prove trusted exact-head Python, Rust/PyO3, and package checks.
Remaining integration
Keep this PR Draft. A follow-up commit in this PR must wire the helper into the central coverage and approval workflow, add the permanent workflow contracts, and re-run
fast-mlsirm#546on its exact current head. Until that integration is reviewed, the current fail-closed coverage behavior remains authoritative.Advances #784.