refactor(scripts): route hand-rolled git init through test-git-helpers - #2916
Conversation
Five fixture-construction sites across three test suites duplicated the git init + identity config block that scripts/test-git-helpers.sh already publishes as git_init_test_repo, bypassing its inside-checkout safety guard (the class that bit as #2839) and its gpgsign/autocrlf hardening. Source the helper and call it at each site. Found by the first /coupling:reduce dogfood pass (apply lane; the route-lane findings are #2914). check-stale-base-overlap.test.sh is deliberately not converted: its fixture needs init -b, which the helper has no seam for yet — tracked in #2914. Verified: check-shell-portability.test.sh PASS=333 FAIL=0, check-skill-portability.test.sh PASS=89 FAIL=0, sync-standards-contract.test.sh PASS=12 FAIL=0, shellcheck clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016CWMh6HAsgWWi9tLw76hZR
|
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 1m 46s —— View job Claude finished the code review
SummaryReviewed the diff ( Verified:
I was not able to execute No blocking findings. No inline comments posted — the change is a straightforward, low-risk, structure-only substitution with no correctness or behavior concerns. |
|
Claude finished @kyle-sexton's task in 1m 8s —— View job Security review —
|
… three converted suites
|
Last security-reviewed head: |
|
Claude has reviewed this PR 3 times. The lane skips further automatic reviews after 5; deleting this comment resets the count. |
|
Claude finished @kyle-sexton's task in 1m 17s —— View job Security review complete
No security issues found. This PR is a test-only refactor that replaces five hand-rolled I reviewed the diff (
This is a clean, low-risk test-infrastructure change that closes a security-relevant gap rather than opening one. |
|
Claude finished @kyle-sexton's task in 2m 30s —— View job Code Review
No blocking findings. This is a clean, well-scoped mechanical refactor. What I checked:
Not independently verified: this review lane's tool grants are read-only ( |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db2b27ce62
ℹ️ 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".
…ore add/commit can reach the real repo
|
Claude finished @kyle-sexton's task in 1m 30s —— View job Security review complete
No outstanding security issues. This is a test-only refactor routing five hand-rolled Codex's P1 finding is already fixed on this HEAD. Codex flagged that git_fixture() {
local fixture="$1"
# On refusal (e.g. TMPDIR inside the checkout) stop before add/commit can
# resolve to the enclosing real repository.
git_init_test_repo "$fixture" || return 1
git -C "$fixture" add -A
git -C "$fixture" commit -qm base
git -C "$fixture" rev-parse HEAD
}This closes the exact failure mode Codex described — I verified the two remaining conversion sites don't have the same gap: Other checks:
No further action needed from a security standpoint. |
|
Claude finished @kyle-sexton's task in 1m 48s —— View job Claude finished the code review
SummaryReviewed the full diff ( Codex's P1 finding is already fixed on this branch. The finding was raised against commit (scripts/sync-standards-contract.test.sh#L79-L83) I verified the failure now short-circuits before Other checks:
No inline comments were needed since the one substantive finding raised on this PR (Codex's) was already resolved by a later commit on the branch. No blocking findings remain. |
No linked issue
Summary
Structure-only apply-lane batch from the first
/coupling:reducedogfood pass overscripts/: five fixture-construction sites across three test suites hand-rolled thegit init+ identity-config block thatscripts/test-git-helpers.shalready publishes, bypassing its inside-checkout safety guard (the class that bit as #2839) and its gpgsign/autocrlf hardening.Fix
Source
test-git-helpers.shincheck-shell-portability.test.sh,check-skill-portability.test.sh, andsync-standards-contract.test.sh, and replace each inline init+config block withgit_init_test_repo. Net −6 lines.check-stale-base-overlap.test.shis deliberately not converted — its fixture needsinit -b, which the helper has no seam for yet (tracked in #2914's deferred item).Verification
check-shell-portability.test.sh: PASS=333 FAIL=0check-skill-portability.test.sh: PASS=89 FAIL=0sync-standards-contract.test.sh: PASS=12 FAIL=0shellcheckclean on all three filesRelated
Refs #2914 (route-lane findings from the same pass); companion to #2913 (the skill that produced this batch)
🤖 Generated with Claude Code
https://claude.ai/code/session_016CWMh6HAsgWWi9tLw76hZR
Generated by Claude Code