Skip to content

feat(harness): /pr-loop-self — durable self-hosted PR loop (closes #24) - #40

Merged
robercano-ghbot merged 2 commits into
mainfrom
feat/issue-24-pr-loop-self
Jul 3, 2026
Merged

feat(harness): /pr-loop-self — durable self-hosted PR loop (closes #24)#40
robercano-ghbot merged 2 commits into
mainfrom
feat/issue-24-pr-loop-self

Conversation

@robercano-ghbot

Copy link
Copy Markdown
Collaborator

Summary

Adds a durable, first-class /pr-loop-self command so the autonomous PR loop can run self-hosted against this repo's own backlog, without the previous ad-hoc tweak to the live cron prompt.

  • New .claude/commands/pr-loop-self.md, modeled closely on .claude/commands/pr-loop.md (same two-part arm-cron + run-one-tick shape, same POLL/MERGE/ADDRESS-FEEDBACK/ADVANCE steps and adaptive STEP 0 cadence), but:
    • Every gate/orchestration routes through GATES_FILE=.claude/self/gates.json, threaded into gate.sh calls and into every spawned agent (orchestrator, implementers, reviewers).
    • Reviewer lenses + consensus come from .claude/self/gates.json (correctness, tests, consensus all).
    • STEP 0 reads the self adapter's merge.baseBranch and counts module:* issues (docs/harness/examples/ci).
    • Distinct cron identity marker ("self-hosted PR loop") that does not cross-match the base loop's "autonomous PR loop" marker in either direction.
  • Docs pointers added in docs/USAGE.md and .claude/self/README.md (replaces the old "next increment on issue Self-host: a self-adapter + fixture target so the template can iterate on itself #11" TODO).

Gates (self adapter)

  • build = pass. lint/test reds are a pre-existing ESM export issue in .claude/workflows/feature-fanout.js, present identically on main and unrelated to this change (see loose end below).

Review

  • correctness = approve (after one fix-loop resolving a cron marker cross-match)
  • tests = approve

Loose end (separate issue recommended)

The self lint/test gate is red on main today: .claude/self/checks.sh lint runs node --check on .claude/workflows/feature-fanout.js, which is ESM without "type":"module"/.mjs. Out of scope for this issue; worth its own module:harness ticket.

Closes #24

🤖 Generated with Claude Code

robercano added 2 commits July 3, 2026 11:59
Add .claude/commands/pr-loop-self.md, mirroring pr-loop.md but pointing
every gate/agent at .claude/self/gates.json (self modules, correctness+tests
lenses, consensus all) with a distinct "self-hosted autonomous PR loop" cron
marker so it never collides with the base loop. Document the command in
docs/USAGE.md and .claude/self/README.md, replacing the old "next increment
on issue #11" placeholder note.
The self loop's armed prompt began "Run one tick of the self-hosted
autonomous PR loop", which is a superstring of the base loop's marker
"autonomous PR loop". Since /pr-loop's idempotency check matches any
job whose prompt contains "autonomous PR loop", arming /pr-loop-self
first would cause /pr-loop to falsely believe the base loop was
already armed and silently skip creating its own cron job.

Rename the self loop's identity to "self-hosted PR loop" everywhere
(description, prose, armed prompt opening line, and this command's
own idempotency matcher) so the exact substring "autonomous PR loop"
never appears in the self loop's armed prompt, and "self-hosted PR
loop" never appears in the base loop's prompt. Correct the
non-collision claim to state the guarantee in both directions.
@robercano-ghbot
robercano-ghbot merged commit 50184b0 into main Jul 3, 2026
6 checks passed
@robercano-ghbot
robercano-ghbot deleted the feat/issue-24-pr-loop-self branch July 3, 2026 13:45
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.

Add a /pr-loop-self command to run the loop self-hosted

2 participants