feat(harness): /pr-loop-self — durable self-hosted PR loop (closes #24) - #40
Merged
Conversation
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
approved these changes
Jul 3, 2026
This was referenced Jul 7, 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.
Summary
Adds a durable, first-class
/pr-loop-selfcommand 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..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:GATES_FILE=.claude/self/gates.json, threaded intogate.shcalls and into every spawned agent (orchestrator, implementers, reviewers)..claude/self/gates.json(correctness,tests, consensusall).merge.baseBranchand countsmodule:*issues (docs/harness/examples/ci).docs/USAGE.mdand.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/testreds are a pre-existing ESMexportissue in.claude/workflows/feature-fanout.js, present identically onmainand unrelated to this change (see loose end below).Review
Loose end (separate issue recommended)
The self
lint/testgate is red onmaintoday:.claude/self/checks.sh lintrunsnode --checkon.claude/workflows/feature-fanout.js, which is ESM without"type":"module"/.mjs. Out of scope for this issue; worth its ownmodule:harnessticket.Closes #24
🤖 Generated with Claude Code