Repository navigation
feat(pr-verify): let the capture drive a named action against a clone of the head - #16442
Conversation
… of the head The pr-verify capture's driven Claude Code session ran in an empty folder with no git history, and the read-only head mount left a skill nowhere to write. Once the head checkout fills, the sibling sandbox now clones the head (sharing its object store, with origin's remote-tracking refs) into the driven session's working directory on its own tmpfs, so a skill there has the head's files and history and can write beside them. Nothing outside the sandbox reads that directory. A clone that fails or is late leaves the directory empty and the capture still runs; the prompt tells the driver which case holds and to drive the action a feature's Drive section names. The control skill's architecture, corrections and review features now name the action to drive: improve layout, codify count-checks and fanout --unattended. The sandbox's mounts, network, environment and credentials are unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
claude-security-review reviewed Security review (incremental, 745767d → 30cfebe): PR #16442I found no security issues. I read the whole change in all 4 files on the incremental list. Two of them match trusted paths: What I checked
critical-findings: 0 |
|
claude-review reviewed Code review: #16442 (incremental, 745767d → 30cfebe)No blocking findings in this push. Scope. This review was blocking only, because this lane already reviewed an earlier head. I read every hunk of the 4 files listed in
I also read the whole of Earlier advisory finding is fixed. That finding (discussion_r4580300084) said a late clone could change the working directory after the driven session had already started there. This push fixes it:
Workflow step. "Clone the head for the driven session" now handles the result file more strictly:
The tests now compare the exact output line, so an injected Prompt change. The capture prompt now points the driver to the Other checks.
Verifier dropped 0 of 0 candidates. |
Security review follow-ups on the head clone for the driven session: - The clone step prints the sandbox's result status only from a fixed vocabulary (ready, failed, timeout, else "no result"), ignores a result file behind a symlink, and fails with a named error when the head-ready handshake path already existed. - sibling-workdir.sh bounds the clone (120 s) and the fetch (20 s) below the workflow's 150 s wait, so a slow clone ends failed and emptied. - It refuses a working directory that is not empty, at entry and again before the clone, so the failure cleanup removes only what the clone wrote. - A result it cannot write exits 1 with a line in its log. - The capture prompt names the control skill under .base as the one whose Drive section names the action. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Post-merge mutation testingKilled 6, survived 1, timeout 0, no coverage 0, invalid 0, not run 0.
Surviving mutants
The run's summary has the full report. |
Closes #16385
Closes #16386
Summary
Parts 1 and 2 of #16383. The pr-verify capture can now record a named action of a command-running skill against the pull request's head, with git history available, and the control skill's
architecture,correctionsandreviewfeatures name the action to drive.Before this change the driven Claude Code session ran in an empty folder on the sandbox's tmpfs, with no git history, and the head checkout was mounted read-only, so a skill that reads history (the layout lens's
co-change.mjs) exited 2 and a run could not write its memory file.Fix
.github/scripts/pr-verify/sibling-workdir.sh(new): runs inside the sibling sandbox. It waits for ahead-readydirectory, thengit clone --shareds the read-only head checkout into the driven session's working directory ($HOME/won the sandbox's own tmpfs), copies origin's remote-tracking refs so the default branch resolves, and writes{status, head}. A failed clone empties the directory again.sibling-init.sh: starts that script in the background before the broker starts. The broker and every session it launches already run in$HOME/w, which.claude.jsonalready trusts.pr-verify-capture.yml: installs the script root-owned besidesibling-init.sh. A new step, "Clone the head for the driven session", runs after the head checkout. It makeshead-ready, waits up to 150 s and passes only when the sandbox reportsreadyat the head SHA. It runs undercontinue-on-error, so a failed or late clone leaves the old empty-directory behavior and the capture still runs. The capture prompt now tells the driver which case holds and to drive the action a feature's## Drivenames, with exactly its arguments..claude/skills/control-claude-code-plugins/):architecturenames/architecture:improve layout,correctionsnames/corrections:codify count-checks, andreviewnames/review:fanout --unattended, which runs under thereproduce_findingsvalue the checkout'sdocs/conventions/review.yamlsets (labeltoday). The hub's gotcha now says the driven session starts in a clone of the head.Credential separation is unchanged
headand.baseread-only; onlycapture-runand the runtime directory writable), no network, the sameenv -iallowlist, no new capability and no new user namespace. The existing tests that pin each flag pass unchanged.$HOME. No step outside the sandbox reads it, and nothing written there is trusted afterwards. The workflow reads only the one-lineworkdir.jsonresult, as data, compared against the head SHA.--restrictedlaunch are untouched.CLAUDE.md,.claude/settings.json) as its project's, because its working directory is the head. They run in the same sandbox as the plugin code under test, which already runs there, and they reach the API only through the bridge to the key proxy.Verification
node --test --test-concurrency=4 .github/scripts/pr-verify/sibling-workdir.test.mjs: 4/4 pass. The tests cover a ready clone (HEAD equals the head, 3 commits of history,origin/mainresolves, writable, the head stays unchanged), a timeout, a head that is not a repository, and a non-empty working directory. Removing the remote-ref fetch makes the ready case fail.node --test --test-concurrency=4 .github/scripts/pr-verify/workflow.test.mjs: 86/86 pass, including three new tests. One pins the install, the background launch and the step order. One runs the clone step against ready, wrong-SHA, failed, timeout and missing results. One runs the prompt step with and without a clone.shellcheckis clean on both sandbox scripts.check-map.shreports no findings on the control skill. Localactionlintreports only the existingcache-modekey (line 133), which predates this change; CI's pinned actionlint accepts it.plugins/architecture,plugins/correctionsorplugins/review. Its "Clone the head for the driven session" step should print::notice::the driven session starts in a writable clone of the head at <sha>, and the run's sealed transcript should show the named action driven.Related
/architecture:improve layout), Count corrections that became checks and generate the rule-to-enforcer inventory #15650 (/corrections:codify count-checks), Let the review fan-out label or require findings a run reproduced, under one shared rule for running reviewed code #15833 (/review:fanout).🤖 Generated with Claude Code