Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
128 changes: 128 additions & 0 deletions .github/workflows/python-wheelhouse-qualification.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: Python Wheelhouse Qualification

on:
workflow_dispatch:
inputs:
candidate_sha:
description: "Immutable candidate commit SHA (40 hexadecimal characters)"
required: true
type: string

# Credential-free wheelhouse rehearsal for #4631. No registry write, OIDC,
# secret, tag, or release permission exists on this workflow.
permissions:
contents: read

concurrency:
group: python-wheelhouse-qualification-${{ inputs.candidate_sha }}
cancel-in-progress: false

jobs:
qualify:
name: local wheelhouse pip and uv rows
runs-on: ubuntu-latest
timeout-minutes: 60
env:
CANDIDATE_SHA: ${{ inputs.candidate_sha }}
CARGO_TERM_COLOR: always
steps:
- name: Initialize receipt root
run: |
set -euo pipefail
base="${RUNNER_TEMP}/ripr-python-wheelhouse"
mkdir -p "${base}/receipts/rows" "${base}/wheelhouse" "${base}/consumer" "${base}/decoy"
echo "QUAL_ROOT=${base}/receipts" >> "$GITHUB_ENV"
echo "WHEELHOUSE=${base}/wheelhouse" >> "$GITHUB_ENV"
echo "CONSUMER_ROOT=${base}/consumer" >> "$GITHUB_ENV"
echo "DECOY_ROOT=${base}/decoy" >> "$GITHUB_ENV"

- name: Checkout immutable candidate
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
with:
ref: ${{ inputs.candidate_sha }}
fetch-depth: 1
persist-credentials: false

- name: Verify candidate identity
run: |
set -euo pipefail
[[ "${CANDIDATE_SHA}" =~ ^[0-9a-fA-F]{40}$ ]]
test "$(git rev-parse HEAD)" = "${CANDIDATE_SHA,,}"
test "$(git rev-parse HEAD^{tree})"
python3 -c "import json,os,pathlib,subprocess; p=pathlib.Path(os.environ['QUAL_ROOT'])/'candidate-identity.json'; p.write_text(json.dumps({'source_commit':subprocess.check_output(['git','rev-parse','HEAD'],text=True).strip(),'source_tree':subprocess.check_output(['git','rev-parse','HEAD^{tree}'],text=True).strip(),'limitations':[],'non_claims':['no PyPI publication','no compatibility-floor claim','no support-tier promotion']},indent=2)+'\n')"

- name: Set up Rust
uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # 1.95
with:
toolchain: 1.95.0

- name: Stage local wheelhouse
run: |
set -euo pipefail
shopt -s nullglob
cp dist/wheels/*.whl "${WHEELHOUSE}/" 2>/dev/null || true
cp packaging/python/dist/*.whl "${WHEELHOUSE}/" 2>/dev/null || true
python3 -m pip install --user uv
printf '%s\n' '#!/bin/sh' 'echo planted-wrong-path' > "${DECOY_ROOT}/ripr"
chmod +x "${DECOY_ROOT}/ripr"

- name: Isolated pip and uv wheelhouse installs
run: |
set -euo pipefail
cd "${CONSUMER_ROOT}"
export PIP_NO_INDEX=1 UV_OFFLINE=1
if python3 -c "import urllib.request; urllib.request.urlopen('https://pypi.org', timeout=5)"; then network=false; else network=true; fi
export PATH="${CONSUMER_ROOT}/venv/bin:${CONSUMER_ROOT}/uv/bin:${DECOY_ROOT}:/usr/bin:/bin"
Comment thread
EffortlessSteven marked this conversation as resolved.
Resolved
cargo_ok=false; ambient=false; planted=false; source_ok=false
if command -v cargo >/dev/null || command -v rustc >/dev/null; then cargo_ok=true; fi
if [ -x /usr/bin/ripr ] || [ -x /bin/ripr ]; then ambient=true; fi
if [ "$(command -v ripr 2>/dev/null || true)" = "${DECOY_ROOT}/ripr" ] && [ "$(ripr)" = "planted-wrong-path" ]; then planted=true; fi
if test -r "${GITHUB_WORKSPACE}/Cargo.toml"; then source_ok=true; fi
shopt -s nullglob
wheels=("${WHEELHOUSE}"/*.whl)
if [ ${#wheels[@]} -ne 1 ]; then
echo "need exactly one staged wheel; required pip/uv rows stay missing pending #4490" >&2
exit 0
fi
python3 -m venv "${CONSUMER_ROOT}/venv"
"${CONSUMER_ROOT}/venv/bin/pip" install --no-index --find-links "${WHEELHOUSE}" ripr-rs
mkdir -p "${CONSUMER_ROOT}/uv/bin"
PATH="${HOME}/.local/bin:${PATH}" UV_TOOL_BIN_DIR="${CONSUMER_ROOT}/uv/bin" UV_TOOL_DIR="${CONSUMER_ROOT}/uv/tools" UV_FIND_LINKS="${WHEELHOUSE}" HOME="${CONSUMER_ROOT}" uv tool install --offline ripr-rs
pip_bin="${CONSUMER_ROOT}/venv/bin/ripr"
uv_bin="${CONSUMER_ROOT}/uv/bin/ripr"
test -x "${pip_bin}" && test "${pip_bin}" != "${DECOY_ROOT}/ripr"
test -x "${uv_bin}" && test "${uv_bin}" != "${DECOY_ROOT}/ripr"
test "$(command -v ripr)" != "${DECOY_ROOT}/ripr"
python3 - "$pip_bin" "$uv_bin" "$cargo_ok" "$source_ok" "$ambient" "$planted" "$network" "${wheels[0]}" <<'PY'
import hashlib, json, os, pathlib, sys
wheel = pathlib.Path(sys.argv[8])
sha = hashlib.sha256(wheel.read_bytes()).hexdigest()
root = pathlib.Path(os.environ["QUAL_ROOT"]) / "rows"
root.mkdir(parents=True, exist_ok=True)
def digest(path):
return hashlib.sha256(pathlib.Path(path).read_bytes()).hexdigest()
def flag(index):
return sys.argv[index] == "true"
def write(client, binary):
row = {"client": client, "os": "linux", "arch": "x86_64", "status": "failed",
"wheel_filename": wheel.name, "wheel_sha256": sha, "payload_sha256": digest(binary),
"subject_count": 0, "cargo_reachable": flag(3), "source_checkout_reachable": flag(4),
"ambient_ripr_reachable": flag(5), "planted_wrong_path_detected": flag(6),
"network_disabled_after_staging": flag(7),
"limitations": ["installed-use analysis is owned by #4626; subject_count stays 0 so this row cannot pass"]}
(root / f"{client}.json").write_text(json.dumps(row, indent=2) + "\n")
write("pip", sys.argv[1]); write("uv", sys.argv[2])
PY

- name: Evaluate wheelhouse aggregate
if: always()
run: cargo xtask qualify-python-wheelhouse --receipts "${QUAL_ROOT}"

- name: Upload Actions-only receipts
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: python-wheelhouse-qualification-${{ inputs.candidate_sha }}
path: ${{ runner.temp }}/ripr-python-wheelhouse/receipts
if-no-files-found: error
retention-days: 5
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ are scoped or reviewed.

### Added

- CI: a dispatch-only local-wheelhouse qualification lane records pip and uv
isolation facts and evaluates a fail-closed aggregate. Missing, skipped,
zero-subject, or mismatched rows cannot pass. No PyPI credentials or
publication (#4631).
- LSP: `cargo xtask lsp-performance-report` writes an identity-bound saved-edit
sequence receipt (`ripr-lsp-saved-edit-sequence-v1`) covering cold start,
unchanged save/refresh, production/related/unrelated edits, rename, config
Expand Down
2 changes: 2 additions & 0 deletions docs/DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ Current how-to docs:
- [Installation verification](INSTALLATION_VERIFICATION.md)
- [Windows packaged qualification](WINDOWS_PACKAGED_QUALIFICATION.md) - exact
candidate Windows CLI and VSIX rehearsal with Actions-only receipts
- [Python wheelhouse qualification](PYTHON_WHEELHOUSE_QUALIFICATION.md) - exact
candidate local-wheelhouse pip/uv rehearsal with a fail-closed aggregate
- [First successful PR workflow](FIRST_PR_WORKFLOW.md)
- [First successful PR demo](demo/first-successful-pr.md)
- [Start-here convergence receipts](handoffs/2026-05-22-start-here-surface-convergence-receipts.md)
Expand Down
4 changes: 3 additions & 1 deletion docs/PYPI_NPM_DISTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,9 @@ exact package -> clean install -> useful analysis -> supported next step
```

Use a local wheelhouse and isolated npm test registry seeded with the actual
artifacts. Remove source checkout, Rust and ambient ripr from consumer reach;
artifacts. The wheelhouse aggregate and no-publish workflow live in
[Python wheelhouse qualification](PYTHON_WHEELHOUSE_QUALIFICATION.md). Remove
source checkout, Rust and ambient ripr from consumer reach;
retain the package-manager runtime and required Git. Exercise offline execution
after installation, native platform baselines and scripts-disabled npm.

Expand Down
53 changes: 53 additions & 0 deletions docs/PYTHON_WHEELHOUSE_QUALIFICATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Python wheelhouse qualification

`Python Wheelhouse Qualification` is an Actions-only rehearsal lane for
[#4631](https://github.com/EffortlessMetrics/ripr-swarm/issues/4631). It
installs candidate wheels from a local wheelhouse with pip and uv, then
evaluates a fail-closed aggregate. It is not a publisher and does not replace
[#4490](https://github.com/EffortlessMetrics/ripr-swarm/issues/4490),
[#4626](https://github.com/EffortlessMetrics/ripr-swarm/issues/4626), or the
generic cross-channel DTO in
[#4630](https://github.com/EffortlessMetrics/ripr-swarm/issues/4630).

## Invocation

Dispatch `.github/workflows/python-wheelhouse-qualification.yml` with:

- `candidate_sha`: the full 40-character immutable candidate commit SHA.

The job checks out that SHA with `contents: read` and `persist-credentials:
false`, stages `dist/wheels` or `packaging/python/dist` when present, installs
through isolated pip and uv consumers, and retains receipts as an Actions
artifact for 5 days. Staging must yield exactly one wheel; zero or mixed
filenames leave the required rows missing. The workflow hashes that one staged
path rather than the first glob match.

Network isolation is an independent `urllib.request.urlopen('https://pypi.org')`
probe after `PIP_NO_INDEX`/`UV_OFFLINE` are set. Source-checkout reachability
is whether `${GITHUB_WORKSPACE}/Cargo.toml` is readable from the consumer
working directory. This lane does not add a sandbox or filesystem unmount, so
those probes typically remain true on GitHub-hosted runners and fail closed.

## Gate

`cargo xtask qualify-python-wheelhouse --receipts <file-or-dir>` is the
authority. A required linux/x86_64 pip or uv row can pass only when it records
exact wheel and payload digests, a matching wheel filename across required
passed rows, a nonzero subject count, no Cargo/source checkout/ambient `ripr`
escape, a detected planted wrong-PATH binary, and network disabled after
staging. Failed, `not_run`, unsupported, missing, zero-subject, or mismatched
rows cannot satisfy the aggregate.

When this candidate has no staged wheels, or more than one, the required rows
stay missing and the aggregate cannot pass. That is the honest result until
#4490 produces a single wheelhouse artifact. Installed-use analysis remains
#4626; a wheel install without a nonzero discriminator still cannot pass.

## Claim boundary

A passing run would establish that the named candidate's selected linux/x86_64
wheel installed from a local wheelhouse through pip and uv with the isolation
controls above. It does not establish PyPI publication, a compatibility floor,
a support-tier promotion, or the five-target matrix. A green pip `--no-index`
install is not network isolation; a PATH that omits the checkout is not a
source-checkout barrier.
10 changes: 10 additions & 0 deletions policy/ci-lane-whitelist.toml
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,16 @@ estimated_lem = 60
artifact_families = ["release-readiness"]
description = "Cross-platform server archive and manifest proof. Actual build commands come from the workflow matrix."

[[lane]]
id = "python-wheelhouse"
posture = "on_demand_release"
workflow = ".github/workflows/python-wheelhouse-qualification.yml"
jobs = ["qualify"]
commands = ["cargo xtask qualify-python-wheelhouse --receipts <dir>"]
estimated_lem = 20
artifact_families = ["release-readiness"]
description = "Dispatch-only local-wheelhouse pip/uv qualification (#4631). Fail-closed aggregate; no registry write."

[[lane]]
id = "release-readiness-proof"
posture = "on_demand_release"
Expand Down
4 changes: 2 additions & 2 deletions policy/ci-risk-packs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ owner = "repo-maintainers"
reason = "VS Code extension implementation, package, or tests need editor-loop proof."

[risk_pack.release_surface]
paths = ["docs/RELEASE.md", "docs/RELEASE_BINARIES.md", "docs/RELEASE_MARKETPLACE.md", "docs/PUBLISHING.md", ".github/workflows/publish-extension.yml", ".github/workflows/release-server-binaries.yml", "Cargo.toml", "Cargo.lock"]
paths = ["docs/RELEASE.md", "docs/RELEASE_BINARIES.md", "docs/RELEASE_MARKETPLACE.md", "docs/PUBLISHING.md", "docs/PYTHON_WHEELHOUSE_QUALIFICATION.md", ".github/workflows/publish-extension.yml", ".github/workflows/release-server-binaries.yml", ".github/workflows/python-wheelhouse-qualification.yml", "policy/python-wheelhouse-qualification.toml", "Cargo.toml", "Cargo.lock"]
required = ["rust", "policy", "security-posture"]
advisory = ["coverage"]
on_demand = ["release-package", "publish-dry-run", "vsix-package", "extension-marketplace-publish", "server-archive", "release-readiness-proof"]
on_demand = ["release-package", "publish-dry-run", "vsix-package", "extension-marketplace-publish", "server-archive", "python-wheelhouse", "release-readiness-proof"]
Comment thread
EffortlessSteven marked this conversation as resolved.
Resolved
artifact_families = ["release-readiness"]
estimated_lem = 60
owner = "repo-maintainers"
Expand Down
19 changes: 19 additions & 0 deletions policy/python-wheelhouse-qualification.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
schema_version = "1.0"
policy_state = "credential-free-rehearsal"
enforcement = "workflow_dispatch_only"
owner = "repo-maintainers"
workflow = ".github/workflows/python-wheelhouse-qualification.yml"
issues = [4631, 4493]
channel = "pypi-wheelhouse"
publication = "forbidden"
secrets = "forbidden"
receipt_transport = "actions_artifact_only"
max_artifact_retention_days = 5
admitted_os = "linux"
admitted_arch = "x86_64"
required_clients = ["pip", "uv"]

# This lane qualifies local-wheelhouse installs for the selected OS/arch.
# It does not build the ripr-rs adapter, claim compatibility floors, or
# authorize publication. Missing, skipped, zero-subject, or mismatched rows
# cannot pass the aggregate.
1 change: 1 addition & 0 deletions policy/workflow_allowlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@
.github/workflows/ub-review.yml|0|ub-review workflow delegates entirely to the EffortlessMetrics/ub-review action (no inline run blocks); see #1469.
.github/workflows/windows-advisory.yml|15|Advisory Windows lane runs a multi-step log-to-verdict pipeline in YAML; the cargo xtask windows-advisory-summary command is the verdict authority.
.github/workflows/windows-packaged-qualification.yml|50|On-demand exact-candidate Windows package and VSIX rehearsal must retain identity checks, isolated CLI/editor journeys, and Actions-only receipts in one workflow.
.github/workflows/python-wheelhouse-qualification.yml|50|On-demand local-wheelhouse pip/uv qualification writes isolation facts and a fail-closed aggregate; credential-free, artifact-only, no publication.
.github/workflows/zed-extension.yml|1|Zed extension workflow keeps each run block to one Cargo command.
11 changes: 11 additions & 0 deletions xtask/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ pub(crate) enum XtaskCommand {
CheckPositioningLanguage,
CheckDocRoles,
CheckReleaseTargets,
QualifyPythonWheelhouse(Vec<String>),
VscodeCompile,
VscodePackage,
VscodeTest,
Expand Down Expand Up @@ -298,6 +299,7 @@ impl XtaskCommand {
"check-positioning-language" => Self::CheckPositioningLanguage,
"check-doc-roles" => Self::CheckDocRoles,
"check-release-targets" => Self::CheckReleaseTargets,
"qualify-python-wheelhouse" => Self::QualifyPythonWheelhouse(rest),
"vscode-compile" => Self::VscodeCompile,
"vscode-package" => Self::VscodePackage,
"vscode-test" => Self::VscodeTest,
Expand Down Expand Up @@ -515,6 +517,7 @@ pub(crate) fn known_commands() -> Vec<&'static str> {
"check-positioning-language",
"check-doc-roles",
"check-release-targets",
"qualify-python-wheelhouse --receipts <file-or-dir>",
"vscode-compile",
"vscode-package",
"vscode-test",
Expand Down Expand Up @@ -1857,6 +1860,14 @@ pub(crate) fn command_catalog() -> Vec<CommandCatalogEntry> {
true,
"Checks policy/release-targets.toml for internal release graph integrity offline; never reads GitHub and never qualifies or publishes a candidate.",
),
command_entry(
"qualify-python-wheelhouse --receipts <file-or-dir>",
"non_mutating_check",
"target/ripr/reports/python-wheelhouse-qualification.{json,md}",
false,
true,
"Fail-closed local-wheelhouse aggregate for pip/uv rows: missing, skipped, zero-subject, mismatched, PATH/Cargo, or planted-binary rows cannot pass. Dispatch-only; never publishes.",
),
command_entry(
"vscode-compile",
"non_mutating_check",
Expand Down
1 change: 1 addition & 0 deletions xtask/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ pub(crate) fn execute(command: XtaskCommand) -> Result<(), String> {
XtaskCommand::CheckPositioningLanguage => super::check_positioning_language(),
XtaskCommand::CheckDocRoles => super::check_doc_roles(),
XtaskCommand::CheckReleaseTargets => super::check_release_targets(),
XtaskCommand::QualifyPythonWheelhouse(args) => super::qualify_python_wheelhouse(&args),
XtaskCommand::VscodeCompile => super::vscode_compile(),
XtaskCommand::VscodePackage => super::vscode_package(),
XtaskCommand::VscodeTest => super::vscode_test(),
Expand Down
2 changes: 1 addition & 1 deletion xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ use policy::{
check_droid_review_config, check_executable_files, check_file_policy, check_local_context,
check_network_policy, check_no_panic_family, check_positioning_language, check_process_policy,
check_product_copy, check_proof_packs, check_release_targets, check_static_language,
check_workflows,
check_workflows, qualify_python_wheelhouse,
};
use public_api_surface::public_api_surface;
#[cfg(test)]
Expand Down
1 change: 1 addition & 0 deletions xtask/src/policy/distribution/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ mod contract;
mod crate_targets;
mod targets;
mod version;
pub(crate) mod wheelhouse;
mod workflow;

use std::fs;
Expand Down
Loading
Loading