Repository navigation
refactor(skills): line-scoped shellcheck directives and no load-time module code - #73
Conversation
The babysit-pr and address-feedback modules carried file-wide `# shellcheck disable=...` directives. A file-wide directive also silences code written later, which the AGENTS.md "Shell scripts" rules forbid. Each directive now sits on the assignment or command it excuses and names the module that needs it. Where a directive no longer excused anything, it is gone. Two jq-definition files start with a no-op `:` so that the directives under it stay scoped to one assignment each. Header comments that described the removed directives now name the globals instead. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013qZ16z2jrxp57w1mwaZtzP
Three babysit-pr modules ran code when sourced. main-loop.sh ran the watch loop, repo-trust-hooks.sh discovered, pinned and sourced the hooks, and gh-bound.sh checked for perl and installed the bounded gh. The AGENTS.md "Shell scripts" rules require that a module only defines functions and constants. Each flow is now a set of named functions of at most 50 lines, with the module name as prefix. babysit-prs.sh calls them where the source line ran the flow before: gh_bound_install, the repo_trust_hooks_* steps and main_loop_run. The hook files are still sourced at top level, now in babysit-prs.sh, so each runs in global scope as before. The repo_trust_hooks_* functions are read-only before the first hook loads, so a hook cannot replace a check that runs after it. live-watch.md describes the new call order. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013qZ16z2jrxp57w1mwaZtzP
…split
The Codex review of the module split found three differences from the
code that ran at top level:
- main_loop_poll_pass ran on the left of `||`, which turns off a hook's
`set -e` inside the pass. It now runs on its own line and sets
PASS_CUT_SHORT, which the loop checks after it.
- A hook that unsets `hook` stopped the watch under `set -u` before the
pins were verified again. The call now passes `${hook-}`.
- The `:` that kept the jq-defs directives line-scoped ran at load and
could reach a hook-defined `:`. An empty function now holds that place
and runs nothing.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_013qZ16z2jrxp57w1mwaZtzP
The SC2034 directive above the REPO_TRUST_REREAD_SECONDS `case` covered the whole statement, so an unused assignment in a later arm would also pass shellcheck. It now sits on the one assignment it excuses. Found by the Codex review of this branch. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013qZ16z2jrxp57w1mwaZtzP
Codex Review Summary: ✅ CompletedThis 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. |
|
Claude finished @chapati23's task in 4m 30s —— View job Review: ✅ LGTM
Verdict: LGTM. This is a careful, mechanical refactor that does exactly what the title/body claim, with no behavior changes I could find. What I checked:
No P1/P2/P3 findings to list — nothing I could construct a concrete failure scenario for. The one thing I couldn't independently verify is running |
|
Claude review at |
…#75) * fix(babysit-pr): treat a clean Claude review summary as informational The watcher counted every claude-code-action summary as unanswered top-level feedback, so a PR with an LGTM review stayed FEEDBACK_GATE_PENDING until someone replied (agents #73 and #74). The summary is free-form model text, so the review prompt now asks for one exact last line on a clean review, and the watcher drops a github-actions[bot] summary only with the action's header, that last line and no [P1]-[P3] tag. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013qZ16z2jrxp57w1mwaZtzP * fix(babysit-pr): require the whole clean shape of a Claude summary The local Codex review found that a summary with an untagged finding and the result line cleared the gate. A clean summary now holds only the header, blank lines and checklist items before that line; anything else stays actionable. Logins may carry a managed-user shortcode, and the watch runbook states one rule for Claude summaries instead of two. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013qZ16z2jrxp57w1mwaZtzP * fix(babysit-pr): a clean Claude summary is the header and one line The second local Codex review found that an open checklist item could carry an unanswered request past the gate, and that the prompt did not describe the whole accepted body. A clean summary is now the action's header and rule plus the result line and nothing else, and both prompts ask for exactly that body. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013qZ16z2jrxp57w1mwaZtzP * fix(babysit-pr): accept a Claude header without a duration The pinned claude-code-action leaves out " in <time>" when it has no timing, and writes the time only as "Ns" or "Nm Ns". The header match now makes that clause optional and accepts only those two forms (third local Codex review). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013qZ16z2jrxp57w1mwaZtzP * style(babysit-pr): apply prettier to exact-feedback-formats.md Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013qZ16z2jrxp57w1mwaZtzP --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
tl;dr
Shared shell helpers silenced lint warnings for whole files and ran work as soon as they loaded, against this repository's shell rules. This PR narrows each silenced warning to its one line and moves the load-time work into named steps that the PR watcher calls in the same order. Nothing changes for you.
The Problem
shellcheck disabledirectives, which also hide later code.The Solution
main_loop_*,repo_trust_hooks_*,gh_bound_install), whichbabysit-prs.shcalls in the old order.set -eor the pin checks around each checkout hook behave.Risk
ALL_PRS_CLEAREDorDEADLINE.Validation
3b7710a:shellcheck144 files ✓,pnpm check:shell(ratchet vsorigin/main) ✓,validate-skills27 ✓,pnpm test:scripts482 ✓,trunk check✓,test-skills.sh62 runs ✓ (5 eval-creator runs needed its pinnedpsutil; rerun with it ✓),test-link-skills.sh154 ✓, under/bin/bash3.2 154 ✓b84ec11): 42 of 43 shell tests pass with bash 3.2 first onPATH.gh-timeout.test.shunder bash 3.2 (about 600 s against a 7 s margin, "could not read checks twice"); fails the same way on base0b01f6c.repo-trust-preflight.sh), 1 declined (see Deferrals).Deferrals
main-loop.shso an old entry point fails closed during an in-place update. Such an update mixes versions of every module; renaming one file covers one of three.Ship Checklist
type: summaryortype(scope): summary, ascommitlint.config.mjsenforces for commitsnode scripts/validate-skills.mjsand the affected test suites passAGENTS.md🤖 Generated with Claude Code
https://claude.ai/code/session_013qZ16z2jrxp57w1mwaZtzP