Skip to content

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

Description

@robercano

Gap

PR #82 (issue #81) landed .claude/scripts/loop-tick.sh — the single-script tick that runs the census + notify-poll + pr-feedback + merge-ready 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. docs/USAGE.md documents it.

But the actual cron prompts never adopted it:

  • .claude/commands/pr-loop.md STEP 0 still tells the model to count open PRs / planned issues / feedback PRs by hand — exactly the fabrication failure mode loop-tick.sh was built to eliminate (a Haiku-driven tick has previously fabricated census output and double-spawned orchestrators; see USAGE.md "Model selection").
  • .claude/self/pr-loop-self.md has the same manual STEP 0.
  • .claude/settings.json has no allowlist entry for Bash(bash .claude/scripts/loop-tick.sh:*), so even a prompt that invokes it would hit a permission prompt on an unattended tick.

Change

  1. Rewrite STEP 0 in both loop prompts: run bash ${CLAUDE_PLUGIN_ROOT:-.claude}/scripts/loop-tick.sh and treat its verdict line as the SOLE source of truth — no hand-derived counts, no skipping on quiet ticks. Steps 1–4 become "obey the verdict" (advance the named issue / address the named PR / adjust cadence / reply 'No actionable activity.' only when the tick printed action=none).
  2. Add the allowlist entry to .claude/settings.json.
  3. Update the cadence logic to consume the census cadence line rather than re-deriving it.

Done when

  • Both prompts invoke loop-tick.sh as a real tool call in STEP 0 and act only on its verdict.
  • A tick session cannot claim "No actionable activity." without a loop-tick.sh invocation in its transcript.
  • Allowlist covers the script; existing loop-tick.test.sh still passes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmodule:harnessOrchestrator machinery under .claudeplannedOwner-approved for the autonomous loop (assigned ONLY by the owner)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions