Skip to content

feat(loop): wire loop-tick.sh into pr-loop STEP 0 + allowlist entry (#83) - #93

Merged
robercano-ghbot merged 1 commit into
mainfrom
feat/issue-83-loop-tick-step0
Jul 9, 2026
Merged

feat(loop): wire loop-tick.sh into pr-loop STEP 0 + allowlist entry (#83)#93
robercano-ghbot merged 1 commit into
mainfrom
feat/issue-83-loop-tick-step0

Conversation

@robercano-ghbot

Copy link
Copy Markdown
Collaborator

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

  1. Rewrote STEP 0 in both loop prompts (.claude/commands/pr-loop.md and .claude/self/pr-loop-self.md): STEP 0 now invokes bash ${CLAUDE_PLUGIN_ROOT:-.claude}/scripts/loop-tick.sh (self file prefixes GATES_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.
  2. Cadence consumed, not re-derived: the cron re-arm logic reads the census cadence=X cron=<expr> line from the tick output instead of re-counting PRs/issues.
  3. Allowlist entry added to .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 gh via bot-gh.sh; planned+module:* semantics and the "never add planned yourself" warning; self file keeps GATES_FILE=.claude/self/gates.json threading, lenses correctness/tests consensus all, and the self module set. Idempotency markers ("autonomous PR loop" / "self-hosted PR loop") intact.

Gates (self-adapter, GATES_FILE=.claude/self/gates.json)

  • build: PASS
  • lint: PASS
  • test: PASS — checks.sh test runs loop-tick.test.sh (PASS, 26 checks) + all sibling *.test.sh + smoke-fanout.sh (PASS). loop-tick.test.sh also confirmed PASS standalone.

Reviews

  • correctness (opus): APPROVE
  • tests (sonnet): APPROVE
  • consensus all: met

Not merged — merge is a separate, human-gated step (owner Approves, then merge-ready.sh).

🤖 Generated with Claude Code

https://claude.ai/code/session_01FAt95dUGgT29goWKogFe8Z

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-ghbot
robercano-ghbot merged commit d700d7a into main Jul 9, 2026
9 checks passed
@robercano-ghbot
robercano-ghbot deleted the feat/issue-83-loop-tick-step0 branch July 9, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Loop: wire loop-tick.sh into the pr-loop cron prompts (STEP 0) + allowlist entry

2 participants