feat(loop): wire loop-tick.sh into pr-loop STEP 0 + allowlist entry (#83) - #93
Merged
Merged
Conversation
PR #82 landed loop-tick.sh, a single script that runs census + notify-poll + merge-ready + pr-feedback in order and prints one machine-readable verdict line (action=none|advance issue=N|feedback pr=N). The cron prompts never adopted it: STEP 0 still told the model to hand-count open PRs, planned issues, and feedback PRs every tick — exactly the fabrication failure mode the script exists to eliminate. Rewrite STEP 0 in .claude/commands/pr-loop.md and .claude/self/pr-loop-self.md to invoke loop-tick.sh as a real bash tool call and act only on its verdict line, consuming the cadence=X cron=<expr> line from the tick's census output instead of re-deriving it from counts. The old separate POLL/MERGE/FEEDBACK steps collapse into the single tick call, since loop-tick.sh already runs those scripts internally. "No actionable activity." is now only reachable via action=none. The self-hosted prompt keeps GATES_FILE=.claude/self/gates.json threaded through the tick invocation and every downstream step. Add the loop-tick.sh prefix to settings.json's permissions allowlist, alongside its sibling step scripts. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01FAt95dUGgT29goWKogFe8Z
robercano
approved these changes
Jul 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Closes #83.
PR #82 (issue #81) landed
.claude/scripts/loop-tick.sh— the single-script tick that runs census + notify-poll + merge-ready + pr-feedback in order and prints exactly one machine-readable verdict line (action=none | action=advance issue=N | action=feedback pr=N), with in-flight detection and a self-healing spawn lock. But the cron prompts never adopted it: their STEP 0 still hand-counted open PRs / planned issues / feedback PRs — the exact fabrication failure mode loop-tick.sh was built to eliminate.Changes
.claude/commands/pr-loop.mdand.claude/self/pr-loop-self.md): STEP 0 now invokesbash ${CLAUDE_PLUGIN_ROOT:-.claude}/scripts/loop-tick.sh(self file prefixesGATES_FILE=.claude/self/gates.json) as a REAL bash tool call and treats its verdict line as the SOLE source of truth. The old separate POLL / MERGE / feedback-detection steps collapse into the single tick call (loop-tick.sh runs those sibling scripts internally). Steps now "obey the verdict":action=feedback pr=N→ address PR N;action=advance issue=N→ advance issue N;action=none→ reply exactly "No actionable activity." — the only path to that phrase, gated behind the invocation.cadence=X cron=<expr>line from the tick output instead of re-counting PRs/issues..claude/settings.json:"Bash(bash .claude/scripts/loop-tick.sh:*)", next to the existing sibling-script entries — no permission prompt on an unattended tick.Guardrails preserved: all
ghviabot-gh.sh;planned+module:*semantics and the "never addplannedyourself" warning; self file keepsGATES_FILE=.claude/self/gates.jsonthreading, lensescorrectness/testsconsensusall, and the self module set. Idempotency markers ("autonomous PR loop" / "self-hosted PR loop") intact.Gates (self-adapter,
GATES_FILE=.claude/self/gates.json)checks.sh testrunsloop-tick.test.sh(PASS, 26 checks) + all sibling*.test.sh+smoke-fanout.sh(PASS).loop-tick.test.shalso confirmed PASS standalone.Reviews
all: metNot merged — merge is a separate, human-gated step (owner Approves, then merge-ready.sh).
🤖 Generated with Claude Code
https://claude.ai/code/session_01FAt95dUGgT29goWKogFe8Z