-
Notifications
You must be signed in to change notification settings - Fork 0
feat(coverage): add bounded PyO3 peer-evidence gate #789
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
seonghobae
wants to merge
35
commits into
main
Choose a base branch
from
fix/pyo3-native-peer-gate
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
3da6a25
feat(coverage): add bounded PyO3 peer-evidence gate
seonghobae 4f972b5
test(coverage): prove PyO3 peer gate fail-closed
seonghobae 02495f0
docs(coverage): record PyO3 peer-evidence boundary
seonghobae 8b722be
docs(changelog): record PyO3 peer-evidence gate
seonghobae e7f6a2b
test(coverage): require repo-root-aware nested PyO3 trust boundaries
seonghobae a4538f5
fix(coverage): bind nested PyO3 trust paths to repository root
seonghobae 34bf083
test(coverage): require PyO3 deferral integration and exact-head peer…
seonghobae 4d54a38
ci(coverage): add permanent PyO3 peer-gate quality matrix
seonghobae 84948a3
test(coverage): cover repo-root and default-source fail-closed branches
seonghobae 44667f5
ci(coverage): verify exact-head PyO3 peer gate
seonghobae 2fc66c6
ci: add temporary read-only source snapshot
seonghobae a95432c
test(coverage): expose peer-gate file race boundaries
seonghobae aaf8af8
docs(doctoring): record descriptor-safe peer evidence reads
seonghobae 901349e
test(coverage): block requirements-directory peer deferral
seonghobae da4cf98
chore: add one-shot PyO3 workflow integration patcher
seonghobae 1fe00a1
chore(coverage): remove unnecessary pull-request source snapshot
seonghobae f5f2f05
chore(coverage): remove PR-controlled PyO3 integration patcher
seonghobae e0ed79c
chore(coverage): remove duplicate PyO3 peer-gate quality workflow
seonghobae 96f8f77
chore(coverage): stage PyO3 peer workflow integration
seonghobae 0583fb7
chore(coverage): remove staged PyO3 integration patch artifact
seonghobae 1f615f8
fix(ci): bound peer-gate actionlint scope
seonghobae 64e8058
fix(review): close native peer evidence gaps
seonghobae 308ea06
docs(coverage): cite CWE-829 for PyO3 peer evidence
seonghobae f687af9
fix(coverage): ignore prose under docs/requirements in PyO3 deferral
seonghobae 36ada03
fix(coverage): accept only bounded relative requirement includes
seonghobae 3b39db4
chore(pyo3): restore bounded peer-evidence scope
seonghobae 07c1358
fix(pyo3): harden bounded peer-evidence reads
seonghobae 30eb187
fix: close native peer gate coverage gaps
seonghobae 1053a14
fix: complete native peer focused coverage
seonghobae 6146bb9
test: cover bounded requirement includes portably
seonghobae f08e1c2
merge: reconcile PyO3 peer gate with current main
seonghobae 861478b
Fix sealed PyO3 classifier path identity
seonghobae 31c8d20
fix(coverage): preserve native peer deferral evidence
seonghobae 17837a3
merge(main): resolve native coverage owner conflict
seonghobae 3ffde3c
fix(coverage): keep native policy triggers and changelog lint-clean
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
|
seonghobae marked this conversation as resolved.
|
Large diffs are not rendered by default.
Oops, something went wrong.
198 changes: 198 additions & 0 deletions
198
.github/workflows/python-native-extension-peer-gate-quality-ci.yml
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,198 @@ | ||
| name: Python Native Extension Peer Gate Quality CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [main] | ||
| paths: | ||
| - ".github/workflows/opencode-review-dispatch.yml" | ||
| - ".github/workflows/python-native-extension-peer-gate-quality-ci.yml" | ||
| - "scripts/ci/python_native_extension_peer_gate.py" | ||
| - "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_directory.py" | ||
| - "tests/test_python_native_extension_peer_gate_workflow_contract.py" | ||
| - "docs/doctoring/python-native-extension-peer-evidence.md" | ||
| - "docs/doctoring/python-native-extension-peer-file-safety.md" | ||
| - "AGENTS.md" | ||
| - "ARCHITECTURE.md" | ||
| - "requirements-opencode-review-ci-hashes.txt" | ||
| - "CHANGELOG.md" | ||
|
seonghobae marked this conversation as resolved.
|
||
| push: | ||
| branches: [main] | ||
| paths: | ||
| - ".github/workflows/opencode-review-dispatch.yml" | ||
| - ".github/workflows/python-native-extension-peer-gate-quality-ci.yml" | ||
| - "scripts/ci/python_native_extension_peer_gate.py" | ||
| - "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_directory.py" | ||
| - "tests/test_python_native_extension_peer_gate_workflow_contract.py" | ||
| - "docs/doctoring/python-native-extension-peer-evidence.md" | ||
| - "docs/doctoring/python-native-extension-peer-file-safety.md" | ||
| - "AGENTS.md" | ||
| - "ARCHITECTURE.md" | ||
| - "requirements-opencode-review-ci-hashes.txt" | ||
| - "CHANGELOG.md" | ||
|
|
||
| concurrency: | ||
| group: python-native-extension-peer-gate-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | ||
|
|
||
| jobs: | ||
| minimum-python-contract: | ||
| name: Python 3.10 compatibility contract | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 10 | ||
| steps: | ||
| - name: Harden runner | ||
| uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: Checkout exact source revision | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| persist-credentials: false | ||
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
|
||
| - name: Set up minimum supported Python | ||
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | ||
| with: | ||
| python-version: "3.10" | ||
|
|
||
| - name: Compile production and tests on Python 3.10 | ||
| run: | | ||
| python -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_file_safety.py \ | ||
| tests/test_python_native_extension_peer_gate_nested_project.py \ | ||
| tests/test_python_native_extension_peer_gate_requirements_directory.py \ | ||
| tests/test_python_native_extension_peer_gate_workflow_contract.py | ||
|
|
||
| - name: Exercise the conditional tomli import | ||
| run: | | ||
| python - <<'PY' | ||
| import sys | ||
| import tempfile | ||
| from pathlib import Path | ||
|
|
||
| stub_root = Path(tempfile.mkdtemp(prefix="pyo3-peer-gate-tomli-stub-")) | ||
| (stub_root / "tomli.py").write_text( | ||
| "class TOMLDecodeError(ValueError):\n" | ||
| " pass\n" | ||
| "def loads(_value):\n" | ||
| " return {}\n", | ||
| encoding="utf-8", | ||
| ) | ||
| sys.path.insert(0, str(stub_root)) | ||
| from scripts.ci import python_native_extension_peer_gate as gate | ||
|
|
||
| assert gate.tomllib.__name__ == "tomli" | ||
| PY | ||
|
|
||
| full-quality-gate: | ||
| name: Python 3.14 full quality gate | ||
| runs-on: ubuntu-24.04 | ||
| timeout-minutes: 25 | ||
| steps: | ||
| - name: Harden runner | ||
| uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0 | ||
| with: | ||
| egress-policy: audit | ||
|
|
||
| - name: Checkout exact source revision | ||
| uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 | ||
| with: | ||
| persist-credentials: false | ||
| ref: ${{ github.event.pull_request.head.sha || github.sha }} | ||
|
|
||
| - name: Set up current stable Python | ||
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | ||
| with: | ||
| python-version: "3.14" | ||
| cache: pip | ||
| cache-dependency-path: requirements-opencode-review-ci-hashes.txt | ||
|
|
||
| - name: Install hash-locked quality tooling | ||
| run: >- | ||
| python -m pip install --disable-pip-version-check --require-hashes | ||
| -r requirements-opencode-review-ci-hashes.txt | ||
|
|
||
| - name: Run focused peer-gate tests with complete branch coverage | ||
| run: | | ||
| cat >"${RUNNER_TEMP}/python-native-peer-coveragerc" <<'EOF' | ||
| [run] | ||
| branch = True | ||
| include = | ||
| scripts/ci/python_native_extension_peer_gate.py | ||
|
|
||
| [report] | ||
| fail_under = 100 | ||
| show_missing = True | ||
| EOF | ||
| export COVERAGE_RCFILE="${RUNNER_TEMP}/python-native-peer-coveragerc" | ||
| python -m coverage erase | ||
| python -m coverage run -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_directory.py \ | ||
| tests/test_python_native_extension_peer_gate_workflow_contract.py \ | ||
| -q | ||
| python -m coverage report | ||
|
|
||
| - name: Run complete central test and branch coverage gate | ||
| run: | | ||
| unset COVERAGE_RCFILE | ||
| python -m coverage erase | ||
| python -m coverage run -m pytest tests -q | ||
| python -m coverage report | ||
|
|
||
| - name: Enforce complete production docstrings | ||
| run: >- | ||
| python -m interrogate --fail-under 100 | ||
| scripts/ci/python_native_extension_peer_gate.py | ||
|
|
||
| - name: Compile production and quality contracts | ||
| run: | | ||
| python -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_file_safety.py \ | ||
| tests/test_python_native_extension_peer_gate_nested_project.py \ | ||
| tests/test_python_native_extension_peer_gate_requirements_directory.py \ | ||
| tests/test_python_native_extension_peer_gate_workflow_contract.py | ||
|
|
||
| - name: Install checksum-pinned actionlint | ||
| env: | ||
| ACTIONLINT_VERSION: "1.7.12" | ||
| ACTIONLINT_SHA256: "8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8" | ||
| run: | | ||
| set -euo pipefail | ||
| archive="${RUNNER_TEMP}/actionlint.tar.gz" | ||
| curl --fail --location --proto '=https' --tlsv1.2 \ | ||
| --output "$archive" \ | ||
| "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" | ||
| printf '%s %s\n' "$ACTIONLINT_SHA256" "$archive" | sha256sum --check --strict | ||
| tar --extract --gzip --file "$archive" --directory "$RUNNER_TEMP" actionlint | ||
| test -x "${RUNNER_TEMP}/actionlint" | ||
|
|
||
| - name: Validate protected workflow syntax with actionlint | ||
| run: | | ||
| # Shell behavior is covered by the repository's executable contract | ||
| # tests; keep this bounded gate focused on YAML and expressions. | ||
| "${RUNNER_TEMP}/actionlint" -shellcheck= \ | ||
| .github/workflows/opencode-review-dispatch.yml \ | ||
| .github/workflows/python-native-extension-peer-gate-quality-ci.yml | ||
|
|
||
| - name: Verify clean patches | ||
| run: git diff --check | ||
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.