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 Exact head Implement the three already-committed workflow contracts directly, without a patch artifact or writer workflow:
python3 "$GITHUB_WORKSPACE/scripts/ci/python_native_extension_peer_gate.py" classify-pytest \
--repo-root "$COVERAGE_SOURCE_WORKDIR" \
--pyproject "$project_dir/pyproject.toml" \
--pytest-log "$python_native_pytest_log" \
--changed-files "$python_native_changed_files"A successful classification must not become PASS. Emit the exact separate section --required-check "CI::python"
--required-check "CI::rust"
--required-check "CI::package"Require unique authoritative completed-success CheckRuns, never status contexts or stale/ambiguous reruns. Keep the R peer gate independent. A source-only deferral remains blocking until all three exact-head peer checks pass. Also implement the previously requested descriptor-bound |
|
@opencode-agent address Implement the already-specified permanent central workflow integration on this same Draft branch and exact helper contract. Wire source-only PyO3 classification into the failed Python coverage path; publish DEFERRED rather than PASS; require live exact-head |
|
Continue development on the live Draft head Implement test-first, directly in permanent authoritative sources only:
|
|
@jules Complete the declared integration slice directly on the Draft branch. Exact head
Do not build PR-selected native code in the privileged workflow, enable network in untrusted execution, add a compatibility stub, skip pytest, create a branch writer, or change reviewer identities/credentials. Keep Draft until the integrated exact head passes all gates and independent approval. |
|
@opencode-agent address Complete only the explicitly pending integration on exact head Work test-first against
Keep this branch Draft until the integration itself is GREEN and a downstream exact-head PyO3 repository run proves the intended peer-check flow. |
|
@opencode-agent address Apply and delete The patch preserves the existing R deferral and adds a separate fail-closed Python native-extension boundary:
git apply --check docs/superpowers/patches/2026-08-07-python-native-peer-workflow-integration.patch
git apply docs/superpowers/patches/2026-08-07-python-native-peer-workflow-integration.patch
rm docs/superpowers/patches/2026-08-07-python-native-peer-workflow-integration.patch
python -m pytest \
tests/test_python_native_extension_peer_gate.py \
tests/test_python_native_extension_peer_gate_file_safety.py \
tests/test_python_native_extension_peer_gate_nested_project.py \
tests/test_python_native_extension_peer_gate_requirements.py \
tests/test_python_native_extension_peer_gate_workflow_contract.py -q
python -m coverage erase
python -m coverage run -m pytest tests -q
python -m coverage report
python -m interrogate --fail-under 100 scripts/ci
python -m compileall -q scripts/ci tests
actionlint .github/workflows/opencode-review-dispatch.yml .github/workflows/python-native-extension-peer-gate-quality-ci.yml
git diff --check
test -z "$(git status --short)"Commit ordinary reviewed workflow source and patch deletion only. Keep Draft until one unchanged head passes the dedicated quality workflow, complete central security/SAST/supply-chain surface, fresh automated review, zero actionable threads, and qualifying independent approval. Do not build a PR-selected extension in the coverage sandbox, add network access or stubs, weaken the exact native-boundary file list, create a writer workflow, force-push, merge, release, or mark Ready. |
|
@opencode-agent address exact current head Wire
Run the focused peer-gate suite, complete central tests with 100% statement/branch coverage and public docstrings, Python 3.10/3.14 compilation, actionlint, |
|
@opencode-agent Integrate the reviewed PyO3 peer-evidence gate directly into the authoritative central workflow on this PR branch, then remove the staged patch artifact. Apply
Before production integration, strengthen |
|
@jules Apply the already reviewed patch |
|
@opencode-agent Implement the bounded PyO3 peer-evidence integration on exact current head The helper and adversarial tests are complete, but exact-head quality run Modify the protected workflow and only directly necessary permanent tests/docs/CHANGELOG:
Run the exact three failing workflow contracts first, then the complete focused and central quality gates. Final diff must contain only permanent integration/helper/tests/quality/doctoring/CHANGELOG files; no staged patch, one-shot writer, trigger, or repair workflow. Do not approve, merge, mark Ready, rebase, retarget, release, or publish. |
|
@opencode-agent address Exact head Do not patch the stale workflow lineage independently. PR #812 currently owns attempt-scoped coverage-artifact control flow in the same workflow. After #812 is protected, merge the resulting
Keep Draft. Do not add a compatibility stub, build PR-selected native code, weaken coverage, create a patch/writer workflow, merge, or release. |
|
/oc Refetch the exact live head and keep this PR Draft until integration evidence is green. Complete the bounded PyO3 gate in this same branch by wiring |
|
@opencode-agent Complete the missing production integration on exact current head Implement the bounded fail-closed flow required by
Run the three failing workflow-contract tests first, then the complete focused peer-gate suite, full central suite, docstrings, compileall, actionlint, and security gates. Keep Draft until a new exact head is GREEN and |
|
/oc Refetch the live PR and stop without writing unless exact head is Implement the minimum production integration directly in the existing branch, preserving the helper’s current fail-closed classifier semantics. In the isolated Python coverage path, capture the real failed pytest log, changed-file inventory, repo root, exact project Before editing, reconcile the latest protected Run the three failing integration contracts first, the complete 90-test peer-gate suite, full repository tests, 100% production statement/branch coverage, 100% public docstrings, Python 3.10/3.14 contracts, compileall, actionlint, shell syntax, and |
|
@opencode-agent address Continue directly on exact head Required fail-closed behavior:
Keep Draft until canonical integration and exact-head checks are GREEN. After protected integration, rerun unchanged fast-mlsirm heads rather than reusing source-only failures. |
|
/oc Refetch the live PR head and stop without writing unless it is exactly In the isolated
Preserve Run the three RED workflow-contract tests first; then all 90+ focused peer-gate tests with 100% helper statement/branch coverage, the complete central suite, production docstrings 100%, Python 3.10 and 3.14 compatibility, actionlint, compileall, and |
|
@coderabbitai autofix Complete the existing production integration directly on exact head |
|
Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found. |
|
/oc Refetch the exact live PR head and abort unless it is |
|
@opencode-agent Complete the permanent central integration directly on exact Draft head Exact-head run
Keep Draft and do not approve, merge, release, alter reviewer credentials, or weaken protection. |
|
/oc Refetch PR #789 and implement the PyO3 peer-evidence integration directly on the live Draft branch; abort on movement. Keep the staged patch artifact deleted. Wire |
|
Complete the planned production integration directly on Implement test-first and fail closed:
Run the three failing workflow contracts first, all focused peer-gate/file-safety/nested-project/requirements-directory tests, then the complete central suite, 100% production statement/branch coverage, interrogate, compileall, actionlint, and clean-tree checks. Keep Draft until the new exact head is green. |
|
/oc Complete the missing permanent workflow integration on exact head Run Implement directly in the permanent workflow:
Run all five peer-gate test files, then complete central 100% statement/branch coverage and production docstrings, Python 3.10/3.14 compilation, actionlint, security/supply-chain workflows, and |
|
/oc Refetch the live head and continue only if it is |
|
/oc Continue from the exact current head and finish the permanent PyO3 peer-evidence integration if it is still incomplete. Classify only a complete pytest collection failure caused exclusively by the declared maturin/PyO3 module being absent, serialize it as distinct |
|
@opencode-agent address Complete the bounded PyO3 peer-evidence integration on exact current Draft head Exact failing quality evidence is run
Preserve the existing source-only/networkless sandbox, no PR-selected extension build or import stub, exact-head/base materialization, credential isolation, NVIDIA NIM/reviewer credential chain, native-fuzz separation, 100% production statement/branch/public-docstring policy, and branch protection. Do not add a temporary, one-shot, self-modifying, encoded-patch, staged-patch, branch-local repair, or competing writer workflow. After the minimal integration, rerun the focused peer-gate suite, complete central suite, Python 3.10/3.14 compilation, actionlint/Bash checks, exact 100% production statement/branch/docstring gates, security/supply-chain workflows, clean-diff checks, and current-head automated review. Keep Draft until all exact-head gates and qualifying independent non-author approval are satisfied. |
|
@opencode-agent address Finish the bounded PyO3 native peer-evidence integration from a fresh protected-main base. Exact PR head is First normally merge exact protected main into this existing branch without rewriting history. Then satisfy only the three intentional integration RED contracts from exact-head Python Native Extension Peer Gate Quality CI run
Preserve every classifier refusal boundary already covered by the 87 focused tests: any Rust/Cargo/native crate/stub/maturin metadata/package/lock/requirements/workflow change, mixed imports, actual test/setup/teardown/internal failures, truncation/crash, malformed or unsafe path must remain an ordinary blocking test failure. Do not build or import PR-selected native code in the source-only sandbox, add network access, create a compatibility stub, weaken coverage, or let peer evidence approve by itself. Do not force-push, use |
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.