fix(guardrails): peel sudo clustered short options for chdir resolution - #2483
Conversation
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
Claude finished @kyle-sexton's task in 4m 44s —— View job Code review
Posted 3 inline comments:
Other notes (not code-anchored)
|
|
Claude finished @kyle-sexton's task in 4m 57s —— View job Security Review
Reviewed only the files changed in this PR ( IMPORTANT — sudo cluster-peel set is missing several documented valueless short flags, leaving the chdir-detection bypass only partially closedFile: claude-code-plugins/lib/hook-utils.sh Lines 1444 to 1477 in 0b2b853 The new peel loop only strips while [[ "$stok" =~ ^-[bnEhHkKsSv](.+)$ ]]; do stok="-${BASH_REMATCH[1]}"; done
This matters because The new tests ( Suggested fix: extend the peel character class to the full valueless set sudo documents ( Confidence: High — verified against sudo's documented option grammar and traced the data flow into SUGGESTION — execution-evidence markers in
|
|
Claude has reviewed this PR 2 times. The lane skips further automatic reviews after 5; deleting this comment resets the count. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0b2b853370
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
0b2b853 to
1bb1a0d
Compare
1bb1a0d to
9680743
Compare
|
Claude finished @kyle-sexton's task in 4m 7s —— View job Security Review
Reviewed only the files changed at HEAD ( CRITICAL —
|
9680743 to
a9eb9fa
Compare
|
Claude finished @kyle-sexton's task in 1m 35s —— View job Security Review
Reviewed the files changed at HEAD ( CRITICAL —
|
Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
25f2e13 to
2fba1fa
Compare
|
Claude finished @cursor[bot]'s task in 1m 54s —— View job Security Review
Reviewed the files changed at HEAD The sudo cluster-peeling logic ( CRITICAL —
|
…ckRollup running-check pitfall (#2513) ## Summary Lands the two PR-lifecycle facts #1436 recorded from driving #1393/#1316/#1318/#1322 to merge, in the document that was prescribing the expensive path: - **Stale-branch recovery now defaults to merge-forward.** `monitor.md`'s mergeable pre-check (§3.1 step 1) and stale-branch recovery rule (§3.2) both prescribed "force-push with lease" — but auto-mode permission classifiers commonly deny force-push, and the recorded consequence was a fresh branch + fresh PR + closing the old one per rebase (the #1315 → #1377 → #1393 churn, with every review thread re-opened on the successor). Merging the default branch *into* the PR branch resolves staleness and pushes **fast-forward** — no force-push — and under a squash-only default branch the merge commits collapse to one commit on merge, so linear-history requirements stay satisfied. Verified in the issue's own record: #1393 landed that way and #1318 was merge-forwarded five times without needing a new branch. Rebase stays available as the exception for projects requiring a linear PR branch where force-push is actually permitted. - **`statusCheckRollup` reports a running check as `conclusion: ""` (empty string), not `null`.** The complement-shaped filter (`conclusion != null and != "SUCCESS"`) therefore counts every in-progress check as a failure — the exact misreport in the issue (two "failing" checks that were simply still running). The multi-PR scan section (§3.0.6, the one place this skill reads `statusCheckRollup`) now documents the pitfall with value-positive jq selectors for "failed" and "still running". Version `0.53.11` → `0.53.14` (patch; `0.53.12`/`0.53.13` are claimed by in-flight PRs #2450/#2453/#2483/#2510 and #2469 — skipping past them per the #1746 collision pattern). ## Test plan - `npx markdownlint-cli2@0.23.2` on both edited markdown files — 0 issues. - Docs-only change to skill reference text; no scripts or hooks touched. The jq forms added are the ones from the issue, verified against `gh pr view --json statusCheckRollup` semantics. ## Related Fixes #1436 Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
|
Last security-reviewed head: |
…ckRollup running-check pitfall (#2513) ## Summary Lands the two PR-lifecycle facts #1436 recorded from driving #1393/#1316/#1318/#1322 to merge, in the document that was prescribing the expensive path: - **Stale-branch recovery now defaults to merge-forward.** `monitor.md`'s mergeable pre-check (§3.1 step 1) and stale-branch recovery rule (§3.2) both prescribed "force-push with lease" — but auto-mode permission classifiers commonly deny force-push, and the recorded consequence was a fresh branch + fresh PR + closing the old one per rebase (the #1315 → #1377 → #1393 churn, with every review thread re-opened on the successor). Merging the default branch *into* the PR branch resolves staleness and pushes **fast-forward** — no force-push — and under a squash-only default branch the merge commits collapse to one commit on merge, so linear-history requirements stay satisfied. Verified in the issue's own record: #1393 landed that way and #1318 was merge-forwarded five times without needing a new branch. Rebase stays available as the exception for projects requiring a linear PR branch where force-push is actually permitted. - **`statusCheckRollup` reports a running check as `conclusion: ""` (empty string), not `null`.** The complement-shaped filter (`conclusion != null and != "SUCCESS"`) therefore counts every in-progress check as a failure — the exact misreport in the issue (two "failing" checks that were simply still running). The multi-PR scan section (§3.0.6, the one place this skill reads `statusCheckRollup`) now documents the pitfall with value-positive jq selectors for "failed" and "still running". Version `0.53.11` → `0.53.14` (patch; `0.53.12`/`0.53.13` are claimed by in-flight PRs #2450/#2453/#2483/#2510 and #2469 — skipping past them per the #1746 collision pattern). ## Test plan - `npx markdownlint-cli2@0.23.2` on both edited markdown files — 0 issues. - Docs-only change to skill reference text; no scripts or hooks touched. The jq forms added are the ones from the issue, verified against `gh pr view --json statusCheckRollup` semantics. ## Related Fixes #1436 Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
24cdda0 to
f5dcc5e
Compare
|
Claude finished @cursor[bot]'s task in 1m 59s —— View job Security Review
Reviewed the changes at HEAD Both previously reported findings are fixed:
No new security-relevant issues found in this diff. All 16 plugin copies of |
Peel sudo's clustered valueless short options in hook::git_resolve_index so sudo -bD <dir> git … records the chdir instead of losing it fail-open. Closes #1811 Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
…den valueless shorts Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
Co-authored-by: Kyle Sexton <kyle-sexton@users.noreply.github.com>
bb964f0 to
e4bc426
Compare
|
Claude finished @cursor[bot]'s task in 1m 20s —— View job Security Review
Skip gate hit (condition 3): this head already has a successful security review that still applies. The last completed security review on this branch (posted at commit ( The only commit since then ( Per the skip-gate rule in |
|
Claude finished @cursor[bot]'s task in 2m 19s —— View job Code review
No findings. I re-verified the current state of the sudo cluster-peel logic in
Other checks:
|
Fixes #1811
hook::git_resolve_index now peels documented valueless sudo shorts from clustered tokens before matching -D/--chdir.
Test plan
Related
sudo -bD <dir> git …loses the wrapper chdir (fail-open, shared with main) #1811 sudo clustered short-option chdir resolution