Skip to content

fix(source-control): name the repository in the ready and review-discipline commands - #15898

Merged
kyle-sexton merged 2 commits into
mainfrom
fix-15791-pr-flow-repo-lookups
Nov 13, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
fix-15791-pr-flow-repo-lookups

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Refs: #15791

Summary

#15890's ## Remaining listed two places where the pull-request flow still read the repository from the shell's directory: the shared review discipline's fix-commit check, and gh's {owner}/{repo} placeholders in the GitHub ready-for-review.md, review-venue.md and create.md references. This PR names the repository and checkout there the way the merged monitor, merge and readiness references do. A caller whose shell sits in the checkout (<checkout> = .) runs the same commands as before.

Fix

  • reference/review-discipline.md §3 defines <checkout> and <owner>/<repo> as the GitHub monitor reference's "Resolve PR identity" does. The D5–D7 gh api paths name <owner>/<repo>, gh pr comment takes -R <owner>/<repo>, and the fix-commit check passes --dir "<checkout>" to resolve-remote.sh and runs git -C "<checkout>", matching the copy in the skill's monitor.md.
  • GitHub ready-for-review.md: "Find the PR for the branch" runs target-repo.sh --dir "<checkout>" and git -C "<checkout>" branch --show-current. The rules, branch-protection and reviews reads use repos/$REPO/... in place of {owner}/{repo}, as the file's update-branch and ready-for-review REST calls already did.
  • GitHub review-venue.md names <owner>/<repo> and defines it as the script's --repo value. The ready phase's venue read in 2.5.3 passes --repo "$REPO". review-venue.sh is unchanged.

Scope

  • create.md (GitHub) is unchanged. Each of its {owner}/{repo} calls (default branch, issue state, Refs issue read, triangular REST create) is covered by its own "Placeholder anchoring" section or a GH_REPO= prefix. Replacing them with target-repo.sh's repository would change which repository a fork checkout reads the issue and default branch from, so that would be a behavior change and is not part of this PR.
  • babysit-prs keeps its FETCH_COMMENTS_* calls to fetch-all-pr-comments.sh. The 5.0.3 rescan has no checkout yet; 5.1.2 assigns one later. 5.1.3 C1 does have a checkout, but its gate step E (babysit-readiness-gate.sh) fetches the comments again without --dir. On a fork checkout, giving C1 --dir (target-repo.sh, which picks the fork) could read a different repository from E (gh repo view).

Verification

  • ready-verify-local.test.sh (7): its assertion on the 2.5.3 venue command now also requires --repo "$REPO". ready-flip.test.sh (59), pr-worktree.test.sh (37) and review-venue.test.sh (95) pass unchanged. All four ran by hand from this branch.
  • scripts/check-affected.sh --tests: 15 passed and 102 skipped. 100 of the skips are suites past its 120s budget and are left to CI; the four suites above are among them and were run by hand. The pre-push check-affected hook passed.
  • scripts/check-line-citations.py: clean. scripts/check-contract-clause-coverage.py: passed.
  • Not run: a live ready or monitor against a real PR from outside a checkout.

Related

Remaining

None of the lookups #15890 listed remains after this PR. Calls of the same kind that still resolve from the shell's directory:

  • The ready phase's branch-update sequence (2.5.2) runs from the PR's checkout by design: push-branch.sh --pr without --dir, branch-update-signals.sh (no --dir option), and the git fetch/git merge lines in "Refresh the base with a merge" and "Carry out a merge". The signing check git cat-file commit HEAD also runs there. Naming the checkout would mean giving branch-update-signals.sh a --dir option.
  • The babysit-prs comment fetches described under Scope, and its GitHub provider loop.md default-branch read (gh repo view) and freshness.md compare read ({owner}/{repo}).
  • The GitHub create.md placeholders described under Scope.
  • Script fallbacks used when the caller passes no --dir/--repo: fetch-annotations.sh, fetch-failed-logs.sh, fetch-all-pr-comments.sh and read-review-comments.sh (gh repo view), and review-venue.sh ({owner}/{repo}). push-branch.sh reads gh repo view in the --dir checkout, or in the shell's directory when no --dir is given.

The ready reference's remaining gh pr view, gh pr diff and gh run list calls take no -R. They follow the GH_REPO that "Find the PR for the branch" exports, so they do not depend on the shell's directory.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Vcupomh2tPSB9BXCVa1AeL

kyle-sexton and others added 2 commits November 13, 2026 02:46
…ipline commands

Refs: #15791

The ready reference resolves the repository and branch from <checkout>
and reads the base's rules, protection and reviews from $REPO instead of
gh's {owner}/{repo} placeholders; ready passes --repo to review-venue.sh.
The shared review discipline's D5-D7 commands name <owner>/<repo>, and
its fix-commit check passes --dir and runs git with -C "<checkout>".

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Vcupomh2tPSB9BXCVa1AeL
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 13, 2026 07:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 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-13T07:55:10.237199Z 9ae73ae 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

Copy link
Copy Markdown
Contributor

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

Security review: PR #15898, head 9ae73ae

I found no security issues.

critical-findings: 0

What I checked. I read every hunk of all 6 changed files in .claude-lane/pr.diff. None of them matches a trusted-path glob. The diff has no workflow, action, manifest, hook or trust-control file. Most of it is reference prose plus one assertion in a test script. It replaces gh's {owner}/{repo} placeholders and calls that read from the shell's directory with an explicitly named repository and checkout: target-repo.sh --dir "<checkout>", git -C "<checkout>", repos/$REPO/..., gh pr comment -R <owner>/<repo> and review-venue.sh --repo "$REPO".

  • Injection. Each new $REPO and "<checkout>" use is quoted. review-venue.sh checks its --repo value against ^[A-Za-z0-9._-]+/[A-Za-z0-9._-]+$ before using it (review-venue.sh#L62). In review-discipline.md the head-branch check is unchanged: the branch name must match ^[A-Za-z0-9._/-]+$, must not start with -, must contain no .., and stays in single quotes. --end-of-options is still on the fetch.
  • Removed instructions. No standing instruction is deleted or weakened. The routing rule that inline replies must be threaded, the advice to use a bot-identity wrapper for writes, and the pagination and identity rules for checking a reply all stay as they were. The edits only add the explicit repository and checkout.
  • Whether it widens anything. The reads (rules, branch protection, reviews, Actions runs, check runs) and the comment writes now go to the repository target-repo.sh resolves, not the one gh infers. That makes the target more explicit and lets nothing new reach a lane or token.

Prior findings. This lane has not reviewed an earlier head of this PR, so this was a full review, not a blocking-only one.

Spend. None. The change starts no lane runs and no billed resources.

@github-actions

Copy link
Copy Markdown
Contributor

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

Code review: PR #15898 (head 9ae73ae)

I found nothing to report. I read all 6 changed files in the diff.

What the change does. The ready phase and the shared review discipline now name the checkout and the repository instead of picking them up from the shell's directory. That means target-repo.sh --dir, git -C "<checkout>", repos/$REPO/... and <owner>/<repo> in gh api paths, gh pr comment -R, resolve-remote.sh --push --dir, and review-venue.sh --repo "$REPO".

Checks against the scripts the changed lines call:

  • target-repo.sh accepts [--dir <checkout>] (target-repo.sh#L20).
  • resolve-remote.sh parses its flags in a loop and then takes the branch as the next argument. So --push --dir "<checkout>" '<branch>' resolves the way the docs say (resolve-remote.sh#L31-L66).
  • review-venue.sh defaults REPO to {owner}/{repo} and uses $REPO in every API path. This matches the new paragraph in review-venue.md (review-venue.sh#L56-L63). It also validates --repo against owner/repo.
  • In the GitHub provider's ready-for-review.md, $REPO comes from the "Find the PR for the branch" block. The file says that a later block runs that block's first two lines first, so the repos/$REPO/... reads have it defined. In the skill's 2.5.3, the text now says where $REPO comes from.
  • Both new anchors exist: #253-review-and-verify-the-updated-head, and monitor.md#resolve-pr-identity (monitor.md#L8). The definitions in review-discipline.md match that section's target-repo.sh --dir and git -C pattern.
  • ready-verify-local.test.sh now asserts the --repo "$REPO" suffix that 2.5.3 adds, so dropping it from the command would fail the test.
  • The patch bump in the changelog fragment fits a documentation and command fix.

Path-scoped rules. .claude/rules/skill-bodies-state-current-rules.md and cost-claims.md match the changed skill and reference files. The added text states current behavior and makes no cost claims.

Closing issue. The PR only refers to #15791 (Refs:) and closes no issue, so there were no acceptance criteria to check. The author's verification (tests run by hand, check-affected, citation checks) is author-claimed and I did not verify it. I have no shell and did not run any tests.

The PR context has no embedded instructions. This lane has no prior findings or settled threads on this PR.

Verifier dropped 0 of 0 candidates.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit 5512901 Nov 13, 2026
85 checks passed
@kyle-sexton
kyle-sexton deleted the fix-15791-pr-flow-repo-lookups branch November 13, 2026 08:06
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 13, 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