LoopX PR Merge
Optional maintainer workflow. It lives in the repository and stays outside the
default installed skill set, so a host that never merges LoopX pull requests is
not affected by it. Install or copy it deliberately when a host needs to make
merge decisions.
The built-in pull-request-review capability owns review depth, evidence
requirements, completeness, and verdict policy. This skill owns one narrower
decision: whether this pull request may be approved or merged now, under which
authority, and with what recorded validation.
Decision Precondition
A merge, approval, self-merge, or admin-bypass decision requires review evidence
for the exact head being merged. A merge decision without this evidence is not
authorized: a diff read, green CI, or pull-request metadata is not a substitute.
- Run
loopx --format json pr-review --state all, or use the installed
loopx-pr-review skill, and preserve
agent_response_contract.review_execution_contract. Execute the review plan,
review_template, and evidence_commands it names for every changed
surface.
- Apply
completion_gate literally, and re-read the remote head immediately
before the decision.
- Immediately before the merge, run
loopx --format json pr-review --repo OWNER/REPO --check-merge-readiness NUMBER@HEAD_OID. Merge only when it
returns ready=true for that unchanged head.
A rebase or head update restarts review, and admin bypass never overrides this
gate: it needs explicit owner authorization and never substitutes for the
evidence.
Decision Workflow
- Read the repository
AGENTS.md, the pull-request diff, the changed paths, the
checks, and the latest comments.
- Confirm that the repository's own self-merge policy covers the changed
surfaces. The usual LoopX shape is single-purpose and validated work with no
private state, no public evidence-policy change, no destructive git action,
and no unreviewed runtime, permission, benchmark, or storage-authority
behavior.
- Write the product and architecture judgment below, then produce the
exact-scope change-quality receipt when the goal enables that policy.
- Decide: approve, self-merge with owner authorization, request changes, or
hold for the maintainer path. Record the decision on the pull request with
the changed surfaces, the checks that ran, failures and skips, manual holds,
and the reason that coverage is enough.
- After the merge, sync the local default branch, leave unrelated dirty
worktree state alone, and update LoopX todo or evidence when the work is
tracked.
Product And Architecture Judgment
- Motivation: which product or kernel problem the change solves.
- Solved or not: whether the diff plus validation prove it, and what
coverage stays partial.
- User and operator impact: which bad case becomes safer, clearer, or
faster.
- Main risk: compatibility, hot path, migration, public and private
boundary, permission, benchmark validity, or installed-user risk.
- Design judgment: reusable contract or ad hoc patch, and the cleaner
general alternative when one exists.
Findings still lead. This layer decides whether a broad change should be split,
held, self-merged with owner authorization, or followed by a focused cleanup.
Validation Checklist
Use the narrowest meaningful validation, but do not skip it:
- a syntax or compile check for each changed language;
- the capability-owned smoke or test suite for each changed surface;
- a CLI or schema smoke when a command, packet, or schema changed;
- diff hygiene:
git diff --check <base>...HEAD or the local equivalent;
- a public and private boundary scan when public docs, fixtures, evidence, or
examples changed;
- the repository's risk-based pre-merge gate, when it provides one;
- a real-path check against the production entrypoint for runtime, storage, or
authority changes, with a stated evidence gap when that environment is
unavailable.
When validation cannot run, say exactly why in both the pull-request decision
comment and the chat summary.
Literal-Safe GitHub Text
Treat PR bodies, review comments, issue comments, and release notes as data,
not as shell source.
- Never pass Markdown-rich text through a double-quoted shell
--body
argument. Backticks trigger command substitution before gh receives the
text.
- Write multiline text into an ignored temporary body file, scan that file for
public and private boundary violations, and use
--body-file or pipe a JSON
body into gh api --input -.
- For an existing release body, avoid partial byte or character-index slicing,
especially with non-ASCII text. Build the complete replacement body, update
it atomically, then compare the remote body hash with the reviewed file.
- After every public text mutation, read the rendered body back and scan for
local paths, command output, interpolation artifacts, and damaged adjacent
sections before proceeding.
Review Handoff
Use loopx-pr-review for review evidence, key-code explanations, and the
published review format; if it is unavailable, repair the LoopX install instead
of reconstructing the review manually. This skill adds the decision and its
authorization and validation evidence, and never defines a second review format.
1---2name: loopx-pr-merge3description: Optional maintainer workflow for the approval, merge-readiness, or authorized self-merge decision on a LoopX pull request. Requires the exact-head review evidence from `loopx pr-review`. Review depth, verdicts, review comments, and the published review format belong to loopx-pr-review.4---56# LoopX PR Merge78Optional maintainer workflow. It lives in the repository and stays outside the9default installed skill set, so a host that never merges LoopX pull requests is10not affected by it. Install or copy it deliberately when a host needs to make11merge decisions.1213The built-in `pull-request-review` capability owns review depth, evidence14requirements, completeness, and verdict policy. This skill owns one narrower15decision: whether this pull request may be approved or merged now, under which16authority, and with what recorded validation.1718## Decision Precondition1920A merge, approval, self-merge, or admin-bypass decision requires review evidence21for the exact head being merged. A merge decision without this evidence is not22authorized: a diff read, green CI, or pull-request metadata is not a substitute.23241. Run `loopx --format json pr-review --state all`, or use the installed25 `loopx-pr-review` skill, and preserve26 `agent_response_contract.review_execution_contract`. Execute the review plan,27 `review_template`, and `evidence_commands` it names for every changed28 surface.292. Apply `completion_gate` literally, and re-read the remote head immediately30 before the decision.313. Immediately before the merge, run `loopx --format json pr-review --repo32 OWNER/REPO --check-merge-readiness NUMBER@HEAD_OID`. Merge only when it33 returns `ready=true` for that unchanged head.3435A rebase or head update restarts review, and admin bypass never overrides this36gate: it needs explicit owner authorization and never substitutes for the37evidence.3839## Decision Workflow40411. Read the repository `AGENTS.md`, the pull-request diff, the changed paths, the42 checks, and the latest comments.432. Confirm that the repository's own self-merge policy covers the changed44 surfaces. The usual LoopX shape is single-purpose and validated work with no45 private state, no public evidence-policy change, no destructive git action,46 and no unreviewed runtime, permission, benchmark, or storage-authority47 behavior.483. Write the product and architecture judgment below, then produce the49 exact-scope change-quality receipt when the goal enables that policy.504. Decide: approve, self-merge with owner authorization, request changes, or51 hold for the maintainer path. Record the decision on the pull request with52 the changed surfaces, the checks that ran, failures and skips, manual holds,53 and the reason that coverage is enough.545. After the merge, sync the local default branch, leave unrelated dirty55 worktree state alone, and update LoopX todo or evidence when the work is56 tracked.5758## Product And Architecture Judgment5960- **Motivation:** which product or kernel problem the change solves.61- **Solved or not:** whether the diff plus validation prove it, and what62 coverage stays partial.63- **User and operator impact:** which bad case becomes safer, clearer, or64 faster.65- **Main risk:** compatibility, hot path, migration, public and private66 boundary, permission, benchmark validity, or installed-user risk.67- **Design judgment:** reusable contract or ad hoc patch, and the cleaner68 general alternative when one exists.6970Findings still lead. This layer decides whether a broad change should be split,71held, self-merged with owner authorization, or followed by a focused cleanup.7273## Validation Checklist7475Use the narrowest meaningful validation, but do not skip it:7677- a syntax or compile check for each changed language;78- the capability-owned smoke or test suite for each changed surface;79- a CLI or schema smoke when a command, packet, or schema changed;80- diff hygiene: `git diff --check <base>...HEAD` or the local equivalent;81- a public and private boundary scan when public docs, fixtures, evidence, or82 examples changed;83- the repository's risk-based pre-merge gate, when it provides one;84- a real-path check against the production entrypoint for runtime, storage, or85 authority changes, with a stated evidence gap when that environment is86 unavailable.8788When validation cannot run, say exactly why in both the pull-request decision89comment and the chat summary.9091## Literal-Safe GitHub Text9293Treat PR bodies, review comments, issue comments, and release notes as data,94not as shell source.9596- Never pass Markdown-rich text through a double-quoted shell `--body`97 argument. Backticks trigger command substitution before `gh` receives the98 text.99- Write multiline text into an ignored temporary body file, scan that file for100 public and private boundary violations, and use `--body-file` or pipe a JSON101 body into `gh api --input -`.102- For an existing release body, avoid partial byte or character-index slicing,103 especially with non-ASCII text. Build the complete replacement body, update104 it atomically, then compare the remote body hash with the reviewed file.105- After every public text mutation, read the rendered body back and scan for106 local paths, command output, interpolation artifacts, and damaged adjacent107 sections before proceeding.108109## Review Handoff110111Use `loopx-pr-review` for review evidence, key-code explanations, and the112published review format; if it is unavailable, repair the LoopX install instead113of reconstructing the review manually. This skill adds the decision and its114authorization and validation evidence, and never defines a second review format.