Skip to content

Refuse inline entry into the tagged tree; unset PYTHONPATH for release tooling - #185

Closed
rmcdaniel wants to merge 1 commit into
feat/prepublication-acceptancefrom
ci/178b-release-source-hardening
Closed

rmcdaniel wants to merge 1 commit into
feat/prepublication-acceptancefrom
ci/178b-release-source-hardening

Conversation

@rmcdaniel

Copy link
Copy Markdown
Member

Follow-ups from the General interim review of #178 (cleared at 675236e). This is stacked on #178's branch so the diff shows only these two changes. It retargets to main once #178 merges, and won't merge before #178.

Changes

  1. Inline entry into the tagged tree. test_tagged_tree_working_directory_runs_only_maintained_entrypoints already pins every working-directory: release-source step to an allowlisted command. It now also fails any step without a working directory whose run: enters the tree with cd or pushd (ENTERS_TAGGED_TREE), for example cd release-source && …, pushd ./release-source or cd "$GITHUB_WORKSPACE/release-source". git -C release-source …, which the workflow uses to read the tag commit, stays allowed. A separate test pins the detector's positive and negative cases.
  2. unset PYTHONPATH in install-release-tooling.sh. -I protects the interpreters the script starts, but pip --python <venv>/bin/python runs the target interpreter as a child, and that child would still read PYTHONPATH. The installer trust test now sets a hostile PYTHONPATH, and its stub interpreter refuses if the variable reaches it.

Evidence

Targeted tests in a bounded rust:1.86.0-bookworm container (Python 3.11): the 5 affected tests pass.

Counterfactuals on a scratch clone:

  • Changing the gate job's "Resolve exact release identity" step to cd release-source && head_commit=… fails the allowlist test with the matched command.
  • Removing unset PYTHONPATH fails the installer test with "PYTHONPATH reached the release tooling interpreter".

The full test-publish-rust-sdk.py needs the hash-locked release tooling (markdown_it and others) that CI installs, so hosted CI is the authority for the complete suite.

🤖 Generated with Claude Code

…ease tooling

Follow-ups from the General interim review of #178 at 675236e:
- the release-source allowlist test also fails a step without
  working-directory that enters release-source with cd or pushd;
- install-release-tooling.sh unsets PYTHONPATH, because pip runs the
  target venv interpreter as a child that -I does not protect.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rmcdaniel rmcdaniel added the agent:sdk-rust Work by the sdk-rust repo agent label Nov 4, 2026
@rmcdaniel
rmcdaniel deleted the branch feat/prepublication-acceptance November 4, 2026 06:43
@rmcdaniel rmcdaniel closed this Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:sdk-rust Work by the sdk-rust repo agent

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant