Repository navigation
refactor(claude): simplify the .claude hook and bootstrap scripts - #14410
Conversation
cloud-bootstrap.sh: needs_refresh and snapshot_problem share one recorded_sha helper for the user-scope gitCommitSha lookup; the end-state check reads each plugin's user-scope state with one jq call instead of up to three; the check-jsonschema install prints its warning from one place. check-affected-pre-push.sh: declare `moved` with the other locals and rewrap an over-long comment. hook-telemetry-sink.sh is unchanged: hook-telemetry-sink.test.sh holds it byte-identical to the harness-ops reference sink. Closes #14326 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The pre-push typos check reads every changed file whole, so the pre-existing `honours` in a cloud-bootstrap.sh comment now blocks the push. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Codex Review Summary: ❌ FailedThis 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. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
claude-security-review reviewed Security review: PR #14410 (head 4701b3b)I found no security issues. This was a full review; the prior-findings file says this lane had not reviewed an earlier head. Both changed files match the
Nothing in the diff widens a trusted-actor list, a token scope, a kill switch, a merge hold, or what untrusted text reaches a lane. No plugin manifest changed. No standing instruction was deleted or softened, so the instruction-exception register did not need to be consulted. The PR context file contains no embedded directives aimed at this lane. critical-findings: 0 |
|
claude-review reviewed Code review: no findingsI read every hunk of both changed files ( Behavior equivalence (checked by reading the code; I ran nothing):
Closing issue #14326:
No manifest changes, no paved-path concerns, and no embedded instructions in the PR context. |
Closes #14326
Summary
Applies /simplify's four checks (reuse, simplification, efficiency, abstraction level) to the three
.claudefiles #14326 lists. Outputs, exit codes, printed text, flags and names are unchanged.hook-telemetry-sink.shis left as it is (explained below).Fix
.claude/cloud-bootstrap.shneeds_refreshandsnapshot_problemran the same jq lookup of the user-scopegitCommitSha. Both now call a newrecorded_shahelper, defined inside the plugin block so the plugin test's extraction still includes it. The two functions keep their opposite defaults.try ... catch false, so an unreadable entry still counts as no match, as the separatejq -ecalls did, and short-circuit order is unchanged.honoursashonorsin an existing comment. The pre-push typos check reads the whole changed file, so this old spelling blocked the push..claude/hooks/check-affected-pre-push.sh:movedis now declared with the otherpush_dir_tolocals, and one comment over the line length is rewrapped..claude/hooks/hook-telemetry-sink.sh: unchanged..claude/hooks/hook-telemetry-sink.test.shrequires it to stay byte-identical toplugins/harness-ops/hooks/hook-telemetry-sink.shoutside its source block. Simplifying it would mean editing the plugin copy as well, which this issue puts out of scope.Left alone because the change might alter behavior: the push-command parser in
check-affected-pre-push.sh, and the nestedbash -cthat buildshook_safe_pathincloud-bootstrap.sh. The second one splits PATH by unquoted word splitting, which also glob-expands each entry. An in-process loop would stop that globbing.Verification
Each test was run directly against the branch:
bash .claude/hooks/cloud-bootstrap-plugins.test.sh: PASS=79 FAIL=0bash .claude/hooks/cloud-bootstrap-author.test.sh: PASS=7 FAIL=0bash .claude/hooks/check-affected-pre-push.test.sh: PASS=51 FAIL=0bash .claude/hooks/hook-telemetry-sink.test.sh: both PASSbash plugins/guardrails/hooks/cloud-shfmt.test.sh: PASS=6 FAIL=0bash scripts/check-hook-wiring-liveness.test.sh: PASS=10 FAIL=0bash scripts/check-plugin-catalog-enablement.test.sh: PASS=15 FAIL=0bash scripts/check-script-contract.test.sh: PASS=60 FAIL=0uvx pytest -q plugins/source-control/skills/babysit-prs/scripts/tests/test_babysit_risk.py: 132 passed, 11 skippedshellcheck .claude/cloud-bootstrap.sh .claude/hooks/check-affected-pre-push.sh: cleantypos --config _typos.tomlon both edited files: cleancheck-affectedpassed.[project-scope entry, user-scope disabled entry, "junk"]) gavetrue false true, the same results as the three separateany()checks.Related
Epic #14161
🤖 Generated with Claude Code