Skip to content

fix(source-control): make fix-ci resolve every path in the checkout - #13044

Merged
kyle-sexton merged 2 commits into
mainfrom
fix/13009-fix-ci-edit-target
Nov 4, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
fix/13009-fix-ci-edit-target

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #13009

Summary

In the pull-request skill's ci --ci (fix-ci) flow, an agent sometimes joined a context-file path to the loaded plugin copy's directory and aimed its fix there, instead of at the workspace file with the same relative path. In plugin eval the sandbox denied that edit. In a real lane the plugin copy may be writable, so such a fix could land in the installed plugin and leave the pull request unfixed.

Fix

  • plugins/source-control/skills/pull-request/reference/ci-ci.md: new paragraph where the context file's fields are described. Every path in the file, and every file the agent edits, is relative to the working directory (the pull request's checkout), and is never resolved against the skill's own directory, even when the same relative path exists in both.
  • .changes/source-control/fix-13009-fix-ci-edit-target-1063ef73.md: patch fragment.

No guard hook: done-when 1 accepts the text form, and the eval below met done-when 2.

Verification

Measured under a preregistration posted before any run. Result: 126 runs (Sonnet, Opus judge, Claude Code 2.1.318), and run-validity.py --scaffolded judged all 19 result files VALID.

  • Done-when 2: pull-request-ci-mode-makes-room-without-cutting-criterion-line on this branch had 0 of 18 runs with an Edit or Write under the plugin copy, and 18/18 passed. The scorer could see such an edit: all 18 traces cite both the plugin copy's path and the workspace's skills/run-review/SKILL.md. Main's rate was about 1 in 30 (0 of 12, then 1 of 18), so 0 of 18 meets the criterion but does not show the behavior is gone.
  • No-loss check, the other 9 pull-request-ci-mode-* cases, 6 runs per arm: identical pass counts before and after in every case. fixes-shell-lint is 0/6 on both arms because the host's shellcheck does not run inside the eval sandbox, so it is an environment limit, not this change.
  • Pre-push check-affected passed.

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_015te8CsyoyMhoEcPAAHxicU

kyle-sexton and others added 2 commits November 3, 2026 21:03
In the pull-request skill's ci --ci flow, an agent sometimes joined a
context-file path to the loaded plugin copy's directory and aimed its
fix there instead of at the workspace file with the same relative path.
State, where the context file's fields are described, that every path
and every edited file is relative to the pull request's checkout, never
this skill's own directory.

Refs #13009

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_015te8CsyoyMhoEcPAAHxicU
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 4, 2026 02:16
@chatgpt-codex-connector

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

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-04T02:18:01.629421Z bff2d74 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 4, 2026

Copy link
Copy Markdown
Contributor

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

Security review: PR #13044

I found no security issues. I read both changed files in full.

  • plugins/source-control/skills/pull-request/reference/ci-ci.md adds one rule to the fix-ci flow. Every context-file path, and every file the agent edits, now resolves against the pull request's checkout and never against the skill's own directory. Nothing is deleted, narrowed or softened. The new rule keeps edits off the installed plugin copy and keeps them inside the workspace, so it tightens the agent's write target. That leaves nothing for the instruction-surface lens to flag.
  • .changes/source-control/fix-13009-fix-ci-edit-target-1063ef73.md is a changelog fragment with a patch bump. It is not a manifest change.

The diff changes no trust control, merge hold, token scope, plugin manifest, workflow or executable code. The PR context file holds no embedded text telling the lane to pass the PR, skip a check, drop a finding or post elsewhere. There were no earlier findings from this lane and the round cap does not apply.

Spend: none in this diff. The 126 eval runs in the PR description drew on prepaid model usage and already happened; the change adds no spend.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

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

Code review: no findings

I read every hunk in both changed files (plugins/source-control/skills/pull-request/reference/ci-ci.md and .changes/source-control/fix-13009-fix-ci-edit-target-1063ef73.md). I also read the head ci-ci.md in full to check the new paragraph against the rest of the mode's instructions.

What changed: one paragraph in the "The context file" section of ci-ci.md, plus a patch changelog fragment. The paragraph says every context-file path, and every file the agent edits, is relative to the working directory (the pull request's checkout). The agent must never resolve them against the skill's own directory.

Checked:

  • Fits the rest of the file. It matches the opening statement that the mode runs "on a checkout of the pull request's head" (ci-ci.md#L3-L4). It also leaves the digest-pin flow intact: the runner's staged base copies are only read and compared, and the re-pin wrapper is still run by the exact path the runner names (L116-L124). So "every file you edit is relative to the checkout" does not wrongly send the agent away from the staged copy.
  • Closing issue fix(source-control): fix-ci agents sometimes aim edits at the plugin copy instead of the workspace #13009, done-when 1 ("states the workspace as the only edit target, or a guard refuses edits under the plugin root"): the new paragraph at L37-L39 meets it. The repository's eval case pull-request-ci-mode-makes-room-without-cutting-criterion-line can catch a regression in two ways. A plugin-copy edit that lands would fail its skill-fixed grader, and a denied one is caught by the run-validity gate. That check is probabilistic (main's measured rate is about 1 in 30), not a deterministic text pin.
  • Done-when 2 (0 plugin-copy edits in 18 reruns): I did not verify this; it is the author's claim. The PR and the issue's result comment report 0 of 18 under a preregistration. They also say themselves that 0 of 18 meets the criterion but does not show the behavior is gone.
  • Changelog fragment: bump: patch fits a wording-only behavioral fix to a skill reference. The entry describes what the diff ships.
  • No plugin manifest changed, so there are no manifest lines. Neither changed file matches a trusted-path glob. I found no embedded directives in the PR context or the prior-findings file. Prior findings: none (round 0 of 3; the cap does not apply).

No spend or cost implications.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 4, 2026
Merged via the queue into main with commit c7912ef Nov 4, 2026
69 of 70 checks passed
@kyle-sexton
kyle-sexton deleted the fix/13009-fix-ci-edit-target branch November 4, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(source-control): fix-ci agents sometimes aim edits at the plugin copy instead of the workspace

1 participant