Skip to content
Open
Show file tree
Hide file tree
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 Aug 5, 2026
4f972b5
test(coverage): prove PyO3 peer gate fail-closed
seonghobae Aug 5, 2026
02495f0
docs(coverage): record PyO3 peer-evidence boundary
seonghobae Aug 5, 2026
8b722be
docs(changelog): record PyO3 peer-evidence gate
seonghobae Aug 5, 2026
e7f6a2b
test(coverage): require repo-root-aware nested PyO3 trust boundaries
seonghobae Aug 6, 2026
a4538f5
fix(coverage): bind nested PyO3 trust paths to repository root
seonghobae Aug 6, 2026
34bf083
test(coverage): require PyO3 deferral integration and exact-head peer…
seonghobae Aug 6, 2026
4d54a38
ci(coverage): add permanent PyO3 peer-gate quality matrix
seonghobae Aug 6, 2026
84948a3
test(coverage): cover repo-root and default-source fail-closed branches
seonghobae Aug 6, 2026
44667f5
ci(coverage): verify exact-head PyO3 peer gate
seonghobae Aug 7, 2026
2fc66c6
ci: add temporary read-only source snapshot
seonghobae Aug 7, 2026
a95432c
test(coverage): expose peer-gate file race boundaries
seonghobae Aug 7, 2026
aaf8af8
docs(doctoring): record descriptor-safe peer evidence reads
seonghobae Aug 7, 2026
901349e
test(coverage): block requirements-directory peer deferral
seonghobae Aug 7, 2026
da4cf98
chore: add one-shot PyO3 workflow integration patcher
seonghobae Aug 7, 2026
1fe00a1
chore(coverage): remove unnecessary pull-request source snapshot
seonghobae Aug 7, 2026
f5f2f05
chore(coverage): remove PR-controlled PyO3 integration patcher
seonghobae Aug 7, 2026
e0ed79c
chore(coverage): remove duplicate PyO3 peer-gate quality workflow
seonghobae Aug 7, 2026
96f8f77
chore(coverage): stage PyO3 peer workflow integration
seonghobae Aug 7, 2026
0583fb7
chore(coverage): remove staged PyO3 integration patch artifact
seonghobae Aug 7, 2026
1f615f8
fix(ci): bound peer-gate actionlint scope
seonghobae Aug 12, 2026
64e8058
fix(review): close native peer evidence gaps
seonghobae Aug 12, 2026
308ea06
docs(coverage): cite CWE-829 for PyO3 peer evidence
seonghobae Aug 13, 2026
f687af9
fix(coverage): ignore prose under docs/requirements in PyO3 deferral
seonghobae Aug 13, 2026
36ada03
fix(coverage): accept only bounded relative requirement includes
seonghobae Aug 13, 2026
3b39db4
chore(pyo3): restore bounded peer-evidence scope
seonghobae Aug 15, 2026
07c1358
fix(pyo3): harden bounded peer-evidence reads
seonghobae Aug 20, 2026
30eb187
fix: close native peer gate coverage gaps
seonghobae Aug 20, 2026
1053a14
fix: complete native peer focused coverage
seonghobae Aug 20, 2026
6146bb9
test: cover bounded requirement includes portably
seonghobae Aug 20, 2026
f08e1c2
merge: reconcile PyO3 peer gate with current main
seonghobae Aug 23, 2026
861478b
Fix sealed PyO3 classifier path identity
seonghobae Aug 23, 2026
31c8d20
fix(coverage): preserve native peer deferral evidence
seonghobae Aug 24, 2026
17837a3
merge(main): resolve native coverage owner conflict
seonghobae Aug 24, 2026
3ffde3c
fix(coverage): keep native policy triggers and changelog lint-clean
seonghobae Aug 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
283 changes: 279 additions & 4 deletions .github/workflows/opencode-review-dispatch.yml
Comment thread
seonghobae marked this conversation as resolved.
Comment thread
seonghobae marked this conversation as resolved.

Large diffs are not rendered by default.

198 changes: 198 additions & 0 deletions .github/workflows/python-native-extension-peer-gate-quality-ci.yml
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"
Comment thread
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
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ directive is not trust evidence. See
Conflict-scope roots fail closed when the immediate parent directory is a symbolic link.
OriginWeave hourly NVIDIA NIM repair is a thin caller at minute 10. See [`docs/doctoring/originweave-hourly-review-caller.md`](docs/doctoring/originweave-hourly-review-caller.md).
nonnest2 hourly NVIDIA NIM repair is a thin caller at minute 16. See [`docs/doctoring/nonnest2-hourly-review-caller.md`](docs/doctoring/nonnest2-hourly-review-caller.md).
Native-extension coverage may defer only one unchanged PyO3 collection limitation to successful exact-head Python, Rust/PyO3, and package CheckRuns. See [`docs/doctoring/python-native-extension-peer-evidence.md`](docs/doctoring/python-native-extension-peer-evidence.md).

OpenCode may repair only trusted `path:line` bindings on LLM probes that already carry an independent proof and source-line digest. See [`docs/doctoring/opencode-llm-review-publication.md`](docs/doctoring/opencode-llm-review-publication.md).

Expand Down
24 changes: 24 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,27 @@ flowchart TD
Caller inputs enter shell steps only as named environment variables. This
workflow does not claim SLSA Build L3.

## Python native-extension peer evidence

```mermaid
flowchart TD
Source["Networkless source-only pytest"]
Classify{"Only an unchanged declared PyO3 module is missing?"}
Peers{"Exact-head CI::python, CI::rust, and CI::package successful?"}
Hold["Fail or hold approval"]
Continue["Accept bounded environment deferral"]

Source --> Classify
Classify -->|"no"| Hold
Classify -->|"yes"| Peers
Peers -->|"no"| Hold
Peers -->|"yes"| Continue
```

The source sandbox never executes pull-request-selected maturin or Cargo build
hooks. The exact-head peer gate preserves Rust ownership and converts neither a
missing module nor a passing build check into product-correctness evidence.

## Control-plane data flow

```mermaid
Expand Down Expand Up @@ -136,6 +157,9 @@ sequenceDiagram
Python for scoring math.
- Downloaded SBOM and distribution bytes are inert. The signing job does
not import, install, or unpack them.
- A native-extension coverage deferral remains fail-closed until all named
exact-head peer CheckRuns succeed; stale, skipped, status-only, or lookalike
checks do not satisfy the boundary.

## Quality gates

Expand Down
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,23 @@ Semantic Versioning where the repository publishes a release.
- Use NVIDIA NIM `mistralai/mistral-small-4-119b-2603` with explicit high reasoning for scheduled repair and `nvidia/nemotron-3-nano-30b-a3b` for bounded helper work instead of GitHub Models in the write-capable autofix worker.
- Apply one NUL-delimited exact-path and complete pre/post-worktree verification contract to both ordinary review repair and merge-conflict repair rather than relying on a visible post-model diff for the ordinary path.

### Changed

- Avoided the expensive R/testthat failure-summary regular expression on marker-absent bounded logs by checking the required terminal marker first, while preserving fail-closed handling for incomplete or malformed failure evidence.
- Added a bounded PyO3/maturin pytest-failure classifier and exact-head native
peer-check verifier so source-only OpenCode sandboxes can distinguish one
unchanged-extension collection limitation from product failures without
skipping tests, executing pull-request build hooks, or weakening Rust
ownership; the architecture and CWE-829-grounded doctoring record make the
fail-closed boundary durable.

### Fixed

- Restored the PyO3 source-only coverage deferral by teaching its classifier
CLI to accept the workflow's sealed metadata snapshot and distinct logical
repository path. The gate now reads immutable pre-test TOML bytes while
deriving native/package change boundaries from a traversal-free canonical
`pyproject.toml` location, with an integration test executing the exact
embedded workflow command.

- Publish only the sanitized cumulative Strix report tree, avoiding a later
copy of relative scanner output that could reintroduce known internal warning
text into uploaded security evidence.
Expand Down
Loading
Loading