Skip to content

fix(pr-pipeline): relock the directory a Dependabot group left behind, with uv in a tokenless container - #17301

Merged
kyle-sexton merged 7 commits into
mainfrom
fix/dependabot-relock-explainer-video
Nov 19, 2026
Merged

kyle-sexton merged 7 commits into
mainfrom
fix/dependabot-relock-explainer-video

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

No related issue: a defect found in Dependabot run 44280304984; no issue tracks it.

Summary

Dependabot's pip updater cannot relock plugins/explainer-video. Its pip-compile exits 1 (manimpango ships no Linux wheel and the updater image has no pango), it reports dependency_file_not_resolvable, and it still opens the playwright group pull request with only lib/media-render bumped. CI then fails, because both directories must pin the same Playwright. The owner wants Playwright to follow the latest release without manual steps, so these pull requests have to go green on their own.

The pr-unblock lane now relocks the directory the group left behind, with no model turn. uv may build a package's metadata from source, which runs that package's code, so the relock is split across jobs and uv never runs beside a token:

  1. review-dependency-select uploads a relock request.
  2. review-dependency-relock runs uv inside a digest-pinned python:3.12-slim container, in a job with permissions: {}, no secret and no checkout.
  3. review-dependency-relock-patch uses base code and a read-only token. It checks the result and writes the patch.
  4. apply-dependency-relock pushes it as a [dependabot skip] commit.

That commit passes the same fix rule the pr-merge lane's provenance check mirrors, so the pull request goes green and merges through the review tier.

Fix

  • .github/scripts/pr-unblock/dependency-relock.mjs (new):
    • Reads each group-by: dependency-name group from .github/dependabot.yml. Nothing in it is hard-coded to Playwright.
    • relockTarget: finds a pip directory the pull request left alone whose requirements.in pins a group package at another version than the bumped directory.
    • relockRequest runs in the select job. It moves that one pin and refuses a missing file or a lock whose header names another command than COMPILE_COMMAND. A refused request goes to the model.
    • relockPatch (CLI patch) runs in the patch job. It requires the relocked lock to pin the requested version and both files to pass fixContentRefusal, then writes the patch.
    • check, for test-bash: fails while a group's directories disagree, when no pip group reads, or when a group directory's requirements.in cannot be read.
  • relock-requirements.sh (new):
    • Installs the uv that .github/requirements-relock.txt pins (uv 0.13.9, every wheel hash, on the /.github Dependabot pip surface) with --require-hashes --only-binary :all:.
    • Runs uv pip compile with the lock header's own flags, plus --no-config and --custom-compile-command, so the output is byte-compatible with the committed locks.
  • review-dependency.mjs select: after the install-script pin step and before round counting, it returns a relock decision. main writes request.json, the moved requirements.in and the head's requirements.txt to RELOCK_DIR, and outputs relock-state and relock-sha256. It no longer runs uv.
  • pr-unblock.yml:
    • The select job copies the base's relock script and pinned uv requirements into the request, then scans it and uploads it as dependency-relock-request-<attempt>. It no longer sets up Python.
    • New review-dependency-relock job:
      • Has permissions: {} and no checkout. A public-repo checkout under {} is unconfirmed, so the request carries the base script instead.
      • Runs the script inside python:3.12-slim@sha256:5e2bdb1b…, mounting only the work directory and the read-only request. Build code therefore cannot reach the runner's processes (ACTIONS_RUNTIME_TOKEN) or its sudo. There is no setup-python and no cache.
      • Uploads only requirements.txt. The file is staged first: the step refuses anything in relock-work that is a symlink or not a regular file, copies it with cp --no-dereference into a fresh relock-out that the container never mounted, and checks the copy is a regular file. The upload reads only that copy, so a symlink left by build code cannot point the upload's node process at a runner file such as /proc/self/environ.
    • .github/artifact-retention.json: rows for dependency-relock-request-* (scanned) and dependency-relock-result-* (no scan: it comes from a job that holds nothing, and the patch job scans the patch it builds). The patch family's readers now include apply-dependency-relock.
    • refire-refused.mjs lists Apply Dependency Relock among the write-runner callers.
    • New review-dependency-relock-patch job:
      • Uses a base checkout and contents: read.
      • Verifies the request against the select job's SHA-256.
      • Runs dependency-relock.mjs patch, scans the patch and uploads it.
      • Stops as dependency-pin-invalid on anything short of an uploaded patch, including a failed relock job or a relock that adds a package. escalation-routes.json routes that reason to a failing status and the needs-session label. It does not go to the model.
    • New apply-dependency-relock job: uses patch-prepare: dependency-relock as a literal. apply-dependency-pin is back to its literal install-script-pin.
    • report-stop-status and report-escalation read the two new jobs' reasons and the relock's pushed commit.
  • pr-require-checks.yml: the explicit lib/media-render against plugins/explainer-video playwright comparison is kept, and dependency-relock.mjs check runs beside it.
  • patch-rules.json (and its schema): new dependency-relock row. It has the same refuse list, dependency-manifests, max-files: 2, no required verdict, content-rule: dependency-version-change, and it reuses the dependency-pin-* stop reasons. Their routes in escalation-routes.json now name the relock. pr-run-activity-write.yml accepts that row's reasons.
  • install-script-pin.mjs unifiedDiff now diffs by longest common subsequence, so a relock that changes the number of hash lines makes a valid patch. A one-line pin move gives the same output as before.
  • .github/dependabot.yml: the comment no longer claims one pull request bumps both directories.
  • Docs: the pr-pipeline README describes the three-job relock and the new row. Changelog fragments added for pr-pipeline (minor) and source-control (none, test only).
  • The comment lint refuses new comments in these files, so the new jobs carry none; the README and this body explain them. It also removed the old apply-dependency-pin job comment.

Verification

  • Red first: before the change, the select relock test failed with actual: 'proceed', expected: 'relock'. The defect pull request went to the model with no relock.
  • Reproducibility:
    • In a python:3.12-slim container (no pango, no gcc, cold uv cache), uv 0.13.7 and 0.13.9 both relocked explainer-video to playwright 1.65.2 with the same sha256. The only change was the playwright pin and its hashes.
    • Inside the pinned container, run in the job step's exact docker run shape, the relock output is byte-identical to the earlier result (sha256 3fcf89d1f69ff7ee6bc080bcba62634d25c7df03ba174c4a54cbc99b3a670b5e).
    • The split pipeline ran end to end on the repository's own lock: relockRequest, then the copied script with the real pinned uv (3.2 s), then dependency-relock.mjs patch. The patch passes git apply --check and changes 2 files (11 insertions, 11 deletions).
    • --no-build cannot relock this lock: srt>=3.0.0 has no usable wheels. That hardening is not applied.
  • Tests:
    • dependency-relock.test.mjs (12):
      • group parsing, target finding and the pin move
      • a request plus patch that applies with git apply
      • refusals of a missing lock, a foreign header, an --index-url line, a missed pin and a new package
      • the patch CLI
      • check on disagreement, on no readable group and on an unreadable requirements.in
      • the script's flags
    • review-dependency.test.mjs: the relock request with no model turn, no relock when the directories agree, a fallback to the model on a foreign lock header, and the main request files and outputs.
    • callers.test.mjs (new test):
      • the select job has no setup-python
      • the relock job has {}, no secret, no token, no checkout and no cache
      • the container is digest-pinned with only the two mounts, and has no --privileged, docker socket, --pid or host network
      • only the lock is uploaded
      • the patch job runs base code only, with its SHA-256 check and its escalation mapping
      • the push job's literal dependency-relock row and its inputs, none of them from the uv job
    • callers.test.mjs (report jobs): both report jobs cover the new jobs.
    • apply-patch.test.mjs, dependency-classify.test.mjs, test_babysit_dependabot.py: the row and the fix vector, unchanged.
  • Runs:
    • node --test on dependency-relock, review-dependency, dependency-classify, install-script-pin, apply-patch, callers, resolve and escalation-routes: 1006 tests, all pass.
    • actionlint, zizmor --offline (no findings), shellcheck and shfmt: clean.
    • dependency-relock.mjs check on the repository: playwright: plugins/explainer-video and lib/media-render pin 1.65.1.

Related

  • Dependabot run 44280304984 (log lines 517-541): the dependency_file_not_resolvable failure.
  • docs/conventions/pr-pipeline/README.md: the review-dependency and patch-rules sections this extends.
  • plugins/source-control/skills/babysit-prs/scripts/babysit_dependabot.py fix_refusal: the pr-merge provenance check the relock commit satisfies.

🤖 Generated with Claude Code

kyle-sexton and others added 6 commits November 18, 2026 16:30
Dependabot's pip updater cannot relock plugins/explainer-video
(manimpango has no Linux wheel and its image has no pango), so the
playwright group's pull request bumps lib/media-render alone and CI
fails on the pin-equality check.

review-dependency-select now finds a pip directory a group-by
dependency-name group left behind, relocks it to the bumped pin with
the uv .github/requirements-relock.txt pins (by the command the lock's
own header names), and apply-dependency-pin pushes it as a
[dependabot skip] commit under a new dependency-relock patch row held
to dependency-version-change, the fix rule the pr-merge lane mirrors.
A relock that fails goes to the model. The CI pin-equality check now
reads the same dependabot.yml groups (dependency-relock.mjs check),
and unifiedDiff handles edits that change the line count. The
apply-dependency-pin job comment, which named the install-script-pin
row alone, is removed; the pr-pipeline README describes both rows.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
uv may build a package's metadata from source, which runs that package's
code, so it no longer runs in review-dependency-select beside its token.
Select uploads a relock request carrying the base's relock script and
pinned uv; review-dependency-relock runs uv with no permissions, no
secret and no checkout, and uploads only the relocked requirements.txt;
review-dependency-relock-patch, base code with a read token, checks the
request's SHA-256, the pin and the content rule, and writes the patch;
apply-dependency-relock pushes it under the dependency-relock row, named
as a literal. Any stop short of an uploaded patch, including a relock
that adds a package, stops as dependency-pin-invalid. The relock job
could take the patch artifact's name first; the patch job's upload then
fails and nothing is pushed. apply-dependency-pin keeps the
install-script-pin row as a literal again.

The test-bash group check now fails when no pip group reads or a group
directory's requirements.in cannot be read, and the explicit playwright
comparison is back beside it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A job with permissions: {} still runs on a runner whose processes hold
ACTIONS_RUNTIME_TOKEN, and its user has sudo, so build code uv runs could
reach them. The relock now runs relock-requirements.sh in
python:3.12-slim pinned by digest, mounting only the work directory and
the read-only request; setup-python is gone from the job. The container
relock of explainer-video is byte-identical to the earlier result
(sha256 3fcf89d1). The README and changelog state that a failed or
refused relock stops as dependency-pin-invalid with needs-session.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 18, 2026 22:51
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T22:55:31.508823Z 39d62c4 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 5d9b3bdc217d9b73e1fdd57b179f62ccdda50bdb: read 5 of 5 changed file(s); 0 finding(s), 0 as inline comments.

Code review (incremental, blocking only): no findings

This lane already reviewed an earlier head (39d62c4), so this pass reports only blocking findings. I read every hunk of the 5 files changed since then. I also read the full relock step in pr-unblock.yml (L3758-L3795) and the imports of callers.test.mjs.

What I checked:

  • Staging step (pr-unblock.yml L3780-L3787).
    • The step runs only after docker run --rm returns, so the container can't swap the file between the check and the copy.
    • It refuses a symlink and anything that isn't a regular file, which covers a directory, a FIFO or a missing file.
    • It copies with cp --no-dereference into a new relock-out directory that the container never mounted.
    • The final [[ -f $out && ! -L $out ]] is the step's last command, so a failure there fails the step under the runner's bash -e.
    • The upload path now points only at relock-out/requirements.txt, with if-no-files-found: error kept. A refused lock therefore leaves no artifact, and the patch job stops as dependency-pin-invalid, as before.
    • Hard links can't cross the /w bind mount, so the container can't link the lock to a host file another way.
  • New test (callers.test.mjs).
    • It runs the real step text with a stub docker that cds into relock-work.
    • Every helper it uses is imported: spawnSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync, join and tempDir. SECRET reaches the stub through the spawned environment.
    • All three cases (regular lock, symlink, directory) assert the status and the staged content. The updated path assertion matches the new upload path.
  • artifact-retention.json. The new dependency-relock-request-* and dependency-relock-result-* rows match the artifact names the workflow uses. The patch family now lists apply-dependency-relock as a reader. Whether the result row's scan: none is acceptable is for the security lane.
  • refire-refused.mjs / workflow-gates.test.mjs. Adding Apply Dependency Relock → apply-dependency-relock and the ["apply-dependency-relock", "review-dependency-select"] pair matches the existing pin entries.

Settled thread: the symlink-upload finding on pr-unblock.yml L3778-L3779 was resolved by the owner, and the lines are unchanged since then. This push makes the fix that thread describes, so I am not raising it again.

Not checked: the author says the tests, actionlint, zizmor and shellcheck all pass. That is unverified, because this lane has no shell.

Closing issue: none (the PR body says no issue tracks the defect).

Loosened-check verdict: fail (the default, because the prompt has no loosened_check_* line); patterns: 0. The citation requirement was not checked because there is no decision-record line. Nothing in this push loosens an existing check: the upload path is narrowed and a refusal is added.

Spend: unchanged from the previous review. A relock still adds short standard-runner jobs and no model turn.

Verifier dropped 0 of 0 candidates.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-security-review: 1 inline finding(s) on 39d62c48eb7c1a39ff1d42aae703bf9bee81e54b; the summary is in this lane's pull request comment.

claude-lane: claude-security-review

Comment thread .github/workflows/pr-unblock.yml Resolved
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 5d9b3bdc217d9b73e1fdd57b179f62ccdda50bdb: read 5 of 5 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #17301, incremental (39d62c4 → 5d9b3bd)

I read every hunk of all 5 files in the incremental scope. pr-unblock.yml and refire-refused.mjs are trusted paths, so I read their whole change and what they gate. This was a blocking-only review: this lane already reviewed an earlier head, so only CRITICAL and IMPORTANT findings would be posted.

No security issues found in this increment.

My earlier finding is fixed

The earlier finding said build code could plant a symlink at the uploaded lock and leak the runner's token. The new code closes that path.

  • The check runs after the container has stopped. It is at pr-unblock.yml#L3780-L3787, after docker run --rm returns. By then every process in the container has stopped, so nothing can swap the file between the check and the copy.
  • A symlink or anything other than a regular file is refused. [[ -L $lock || ! -f $lock ]] exits 1 before anything is staged.
  • Only a plain copy is uploaded. The step copies the lock with cp --no-dereference into relock-out, a directory it creates fresh and the container never mounted, then checks the copy again. The upload step at L3793 reads only that copy.
  • A hard link does not get around the check. A hard link passes -f, but it cannot cross the bind mount (the kernel refuses such links with EXDEV). The container sees nothing of the host beyond /w and the read-only /r, so a hard link can only point at a file already inside relock-work.
  • Not re-raised. The owner resolved the thread with a reply describing this fix, and the settled-threads file marks it lines changed since resolution: no. I agree with the fix, so the point is not raised again.

Other changes, checked

  • callers.test.mjs: a test-only change. The new test runs the real step with a stub docker. It checks that a regular lock is staged, and that a symlink to a runner file, or a directory left in the lock's place, exits 1 with nothing staged.
  • artifact-retention.json: adds retention rows for the relock request (scanned) and the relock result (scan: none), and adds apply-dependency-relock as a reader of the patch artifact family. The result comes from a job with permissions: {}, no secret and no checkout. The patch job treats it as data and scans the patch it builds, so skipping the scan here exposes nothing. All rows keep 1-day retention.
  • refire-refused.mjs: adds ["Apply Dependency Relock", "apply-dependency-relock"] to the pr-unblock lane's job list. This only lets the existing refire logic recognise refused runs of the new job. It adds no trusted actor, no token scope and no broker grant.
  • workflow-gates.test.mjs: adds a test row for the new apply job.
  • Trust controls: none widened. The trusted-trigger check, the lane token request, the kill switch and the merge holds are untouched.
  • Manifests: no plugin manifest changed.
  • Embedded text: none in the PR context or the thread files.
  • Spend: no change from the last review. The relock adds standard ubuntu-24.04 hosted-runner jobs on a public repository, drawing on included minutes. It is not a hold.

critical-findings: 0

…he relock jobs

Build code in the relock container could leave requirements.txt as a
symlink, and upload-artifact follows symlinks, so its node process could
upload a runner file such as /proc/self/environ. The step now refuses a
symlink or non-regular file, copies the lock with cp --no-dereference
into a fresh directory the container never mounted, checks the copy,
and uploads only that copy. A test runs the step with a stub docker that
leaves a regular file, a symlink to a runner file, and a directory.

CI: artifact-retention.json gains the two relock artifact families and
names apply-dependency-relock as a patch reader; refire-refused.mjs and
workflow-gates.test.mjs know Apply Dependency Relock.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 983f913 Nov 19, 2026
109 of 111 checks passed
@kyle-sexton
kyle-sexton deleted the fix/dependabot-relock-explainer-video branch November 19, 2026 01:24
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant