Other

/pr-queue-gate

Inspect fleet-authored GitHub PR queues and enforce the one-shot Claude Stop gate. Triggers: PR queue, open-PR blindness, pr-queue gate. NOT for cmuxlayer status-claim enforcement.

$ golems-cli skills install pr-queue-gate
95% best pass rate
21 assertions
7 evals

Updated 2 weeks ago

Hook-carried skill for the deterministic PR-queue primitive and Claude Code session-end gate. The enforcing artifacts are scripts/pr-queue.sh and scripts/pr-queue-gate-hook.mjs.

Boundary

This skill owns:

  • one-call GitHub queue inspection for a repository;
  • the fleet-authored PR filter;
  • CI/age normalization into stable JSON;
  • one Stop-hook block per Claude session;
  • fail-open ledger evidence for non-actionable or infrastructure states.

It does not own cmuxlayer set_status/lane-closure enforcement (the separate status-claim lane), merge policy, review execution, or live installation.

Primitive contract

skills/golem-powers/pr-queue-gate/scripts/pr-queue.sh [repo-path]

The default repo path is the current directory. Stdout is one compact JSON object:

{"repo":"golems","open":1,"oldest_days":3,"prs":[{"n":101,"title":"fix: example","age_d":3,"reviewDecision":"REVIEW_REQUIRED","ci":"passing"}]}

Exit codes:

  • 0: no open fleet PRs;
  • 3: one or more open fleet PRs;
  • 2: git/remote/gh/JSON infrastructure error, printed to stderr.

The primitive makes exactly one gh pr list call. jq filters, sorts, escapes titles, computes whole-day ages, and classifies rollups as passing, failing, or pending.

Fleet-authored filter

The 2026-08-04 live inventory across brainlayer, cmuxlayer, and golems showed that every open PR was authored by the repository owner; the observed branch prefixes were fix/, feat/, and hygiene/. The filter therefore includes a PR when either condition is true:

  1. author.login equals the GitHub remote owner; or
  2. headRefName matches ^(feat|fix|hygiene)/ case-insensitively and the head branch is owned by the repository owner and is not cross-repository.

The second clause keeps same-repository fleet automation while preventing an external fork from becoming a fleet PR merely by choosing a conventional branch name. Titles are treated as metadata: the Stop reason strips terminal and bidirectional display controls, collapses whitespace, truncates to 120 Unicode code points, and JSON-delimits the result before it enters model context.

Do not widen the branch regex from memory. Re-measure live fleet PRs and update the fixture plus this contract in the same reviewed PR.