Skip to content

fix(policy): allow uv in pypi preset#4569

Open
cv wants to merge 2 commits into
mainfrom
codex/salvage-pypi-uv
Open

fix(policy): allow uv in pypi preset#4569
cv wants to merge 2 commits into
mainfrom
codex/salvage-pypi-uv

Conversation

@cv
Copy link
Copy Markdown
Collaborator

@cv cv commented May 30, 2026

Summary

Adds /usr/local/bin/uv to the PyPI network preset binary allowlist so sandboxes using the pypi preset can run the uv package manager directly. This is a clean signed-off replacement for the blocked contributor PR #3368, whose code change was sound but whose branch cannot pass DCO without rewriting existing commits.

Related Issue

Supersedes #3368.

Changes

  • Updates nemoclaw-blueprint/policies/presets/pypi.yaml to allow /usr/local/bin/uv alongside the existing Python and pip binaries.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Verification

  • npx prek run --all-files passes
  • npm test passes
  • Tests added or updated for new or changed behavior
  • No secrets, API keys, or credentials committed
  • Docs updated for user-facing behavior changes
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Targeted validation run: npm test -- test/policies.test.ts test/policy-tiers.test.ts test/validate-blueprint.test.ts. The relevant policy YAML checks passed, while test/policies.test.ts currently has unrelated failures on current origin/main around missing policy helper exports and openshell resolution behavior.


Signed-off-by: Carlos Villela cvillela@nvidia.com

Summary by CodeRabbit

  • Chores
    • Updated PyPI preset policy configuration to allow an additional binary tool in the allowlist.

Review Change Stack

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv cv self-assigned this May 30, 2026
@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot Bot commented May 30, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@cv cv mentioned this pull request May 30, 2026
2 tasks
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 30, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 1fa618ce-7e29-4bc4-8ced-c2ef70e68e3a

📥 Commits

Reviewing files that changed from the base of the PR and between 7da4960 and 686eb8a.

📒 Files selected for processing (1)
  • nemoclaw-blueprint/policies/presets/pypi.yaml

📝 Walkthrough

Walkthrough

The PyPI preset policy configuration is updated to include /usr/local/bin/uv in the network policies binary allowlist, enabling the uv package manager alongside existing Python and pip binary patterns.

Changes

PyPI Preset Configuration

Layer / File(s) Summary
PyPI binary allowlist
nemoclaw-blueprint/policies/presets/pypi.yaml
/usr/local/bin/uv is added to the network_policies.pypi.binaries allowlist alongside the existing Python and pip binary patterns.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 The uv binary hops into the allowlist today,
Joining Python and pip in their Python way,
One little line in the preset so neat,
Makes package management swift and complete! 📦✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(policy): allow uv in pypi preset' directly and specifically describes the main change: adding the uv binary to the PyPI preset policy allowlist.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/salvage-pypi-uv

Comment @coderabbitai help to get the list of available commands and usage tips.

@cv cv requested a review from ericksoa May 30, 2026 18:31
@cv cv requested review from cjagwani, jyaunches and prekshivyas May 30, 2026 18:31
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 30, 2026

E2E Advisor Recommendation

Required E2E: network-policy-e2e
Optional E2E: cloud-onboard-e2e, rebuild-openclaw-e2e

Dispatch hint: network-policy-e2e

Auto-dispatched E2E: network-policy-e2e via nightly-e2e.yaml at 5eab6da6d337ac1300f87f678ce99b61da6e0ad5nightly run

Workflow run

Full advisor summary

E2E Recommendation Advisor

Base: origin/main
Head: HEAD
Confidence: high

Required E2E

  • network-policy-e2e (medium): Directly exercises network policy enforcement, including applying the pypi preset and proving PyPI package-manager egress works from inside the sandbox while other egress remains controlled. This is the highest-signal existing E2E for a PyPI preset security-boundary change.

Optional E2E

  • cloud-onboard-e2e (medium): Useful adjacent confidence because it onboards with custom policy presets including npm,pypi, validating that the modified preset can still be selected and loaded during the real onboarding/install path.
  • rebuild-openclaw-e2e (high): Optional persistence check: this E2E applies npm,pypi policy presets and verifies they survive rebuild. It does not specifically validate uv, but can catch regressions in preset application/serialization across lifecycle operations.

New E2E recommendations

  • package-manager-egress (high): Existing network-policy-e2e proves PyPI reachability via pip, but this PR specifically adds /usr/local/bin/uv to the PyPI preset binary allowlist. Add an E2E assertion that installs or downloads a small package with uv from /usr/local/bin/uv under the pypi preset, and ideally verifies uv is blocked before the preset or when not binary-authorized.
    • Suggested test: Add a uv-specific PyPI probe to test/e2e/test-network-policy.sh TC-NET-02, or a new network-policy assertion that runs /usr/local/bin/uv pip download --no-deps against PyPI inside the sandbox.

Dispatch hint

  • Workflow: .github/workflows/nightly-e2e.yaml
  • jobs input: network-policy-e2e

@github-actions
Copy link
Copy Markdown
Contributor

PR Review Advisor

Findings: 0 needs attention, 2 worth checking, 0 nice ideas
Top item: Add uv PyPI preset regression/runtime validation

Review findings

🛠️ Needs attention

  • None.

🔎 Worth checking

  • Source-of-truth review needed: PyPI preset uv binary allowlist: The advisor marked localized patch analysis as needs_followup.
    • Recommendation: Identify the invalid state, source boundary, source-fix constraint, regression test, and removal condition before merging the localized behavior.
    • Evidence: `pypi.yaml` now contains `/usr/local/bin/uv`; repository search found this path only in the changed preset, and `Dockerfile.base` does not install uv.
  • Add targeted validation for the uv PyPI preset allowlist (nemoclaw-blueprint/policies/presets/pypi.yaml:31): This sandbox network-policy change adds a new executable principal for PyPI egress, but there is no direct test or runtime evidence proving that `/usr/local/bin/uv` is the actual supported sandbox path, that it can use the `pypi` preset successfully, and that the preset remains constrained to PyPI GET/HEAD traffic.
    • Recommendation: Add or identify targeted validation: at minimum a preset test asserting `/usr/local/bin/uv` is included while hosts/methods remain restricted, and preferably runtime/integration validation that applying the `pypi` preset lets `/usr/local/bin/uv` fetch from PyPI while an unlisted binary/path is denied. If runtime coverage exists elsewhere, link it from the PR.
    • Evidence: The diff only adds `- { path: /usr/local/bin/uv }` to `pypi.yaml`. Existing tests cover schema shape, PyPI HEAD, and generic package-manager binaries, but no direct uv assertion was found. `Dockerfile.base` installs Python/pip but no repository evidence was found for installing uv at `/usr/local/bin/uv`. Deterministic test-depth context marks this runtime/sandbox policy path as `runtime_validation_recommended`.

🌱 Nice ideas

  • None.

Workflow run details

This is an automated advisory review. A human maintainer must make the final merge decision.

@github-actions
Copy link
Copy Markdown
Contributor

E2E Scenario Advisor Recommendation

Required scenario E2E: ubuntu-repo-cloud-openclaw
Optional scenario E2E: None

Dispatch required scenario E2E:

  • gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw

Workflow run

Full scenario advisor summary

E2E Scenario Advisor

Base: origin/main
Head: HEAD
Confidence: medium

Required scenario E2E

  • ubuntu-repo-cloud-openclaw: The PyPI policy preset changed allowed binaries by adding /usr/local/bin/uv. The routable Ubuntu OpenClaw scenario is the closest dispatchable scenario that exercises the OpenClaw onboarding/runtime surface and includes policy/security coverage among its scenario assertions. A more direct custom-policies scenario exists in scenario metadata but is not present in the e2e-scenarios.yaml ROUTES table, so it cannot be recommended under the hard routing rule.
    • Dispatch: gh workflow run e2e-scenarios.yaml --ref <pr-head-ref> --field scenarios=ubuntu-repo-cloud-openclaw

Optional scenario E2E

  • None.

Relevant changed files

  • nemoclaw-blueprint/policies/presets/pypi.yaml

@github-actions
Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 26691654469
Target ref: 686eb8a4aa19b668c0ff92f6b57d68ab7a307edb
Workflow ref: main
Requested jobs: network-policy-e2e
Summary: 0 passed, 0 failed, 0 skipped

Job Result
network-policy-e2e ⚠️ cancelled

@github-actions
Copy link
Copy Markdown
Contributor

Selective E2E Results — ✅ All requested jobs passed

Run: 26691740044
Target ref: 5eab6da6d337ac1300f87f678ce99b61da6e0ad5
Workflow ref: main
Requested jobs: network-policy-e2e
Summary: 1 passed, 0 failed, 0 skipped

Job Result
network-policy-e2e ✅ success

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant