Skip to content

fix: route Paperclip PR and merge-group jobs to dedicated ARC pools (BLO-22428) - #1102

Merged
kkroo merged 3 commits into
masterfrom
codex/reopen-pr-1080
Aug 8, 2026
Merged

fix: route Paperclip PR and merge-group jobs to dedicated ARC pools (BLO-22428)#1102
kkroo merged 3 commits into
masterfrom
codex/reopen-pr-1080

Conversation

@kkroo

@kkroo kkroo commented Aug 6, 2026

Copy link
Copy Markdown

Thinking Path

  • Paperclip is the control plane used to manage AI-agent work, and every code change depends on its PR and merge-group CI finishing promptly.
  • The PR workflow placed Paperclip heavy jobs on the shared default ARC pool alongside unrelated repositories.
  • The merge queue builds one entry at a time, so queue depth was not proportional runner demand; the landing candidate was losing runner ordering to the PR backlog.
  • Raising the shared storage-backed runner ceiling would spend capacity without removing that contention.
  • Dedicated repository and landing pools remove cross-repository interference while preserving the global capacity ledger.
  • This pull request routes PR jobs to arc-paperclip-general, merge-group jobs to arc-merge-queue, and makes the runner-label policy validate both branches fail-closed.
  • The benefit is bounded admission latency for the merge queue and predictable Paperclip PR capacity without starving other repositories.

Linked Issues or Issue Description

No GitHub issue exists for this infrastructure incident. The problem and rollout are tracked in BLO-22428, with the broader queue incident in BLO-21953. The underlying bug is cross-repository runner contention: required Paperclip PR and merge-group lanes shared default, so sustained PR traffic could strand the sole merge candidate despite available capacity in purpose-built pools.

What Changed

  • Route the seven heavy jobs shared by pull_request and merge_group to arc-paperclip-general for PRs and arc-merge-queue for merge groups.
  • Include OpenCode Responses replay so no required merge-group dependency remains on default.
  • Keep existing arc-light and arc-e2e lanes unchanged.
  • Allowlist both dedicated labels in scripts/check-github-runner-labels.mjs.
  • Recognize only the exact github.event_name == merge_group two-branch expression and validate both literal labels. All other expressions remain opaque and fail.
  • Add regressions for a forbidden branch, the prior Ally finding with an earlier forbidden chained branch, and unrelated opaque expressions.

Rollout State

The infrastructure-first dependency is satisfied. onprem-k8s#2180 merged at exact reviewed head cbe38049878059f1e1fe748949e65828bfec4cb6 as merge commit 72f216b4f22d42b105a3daa736eab8e33d39ab3b. Argo is Synced/Healthy at that revision:

  • arc-default: max 24
  • arc-merge-queue: max 12; listener pod Running and ready
  • arc-paperclip-general: max 16; listener pod Running and ready

There is no remaining infrastructure sequencing hold.

Verification

  • ruby -ryaml -e ... .github/workflows/pr.yml - YAML parses.
  • node scripts/check-github-runner-labels.mjs - Validated 20 workflows: all runner labels use ARC.
  • node --test scripts/check-github-runner-labels.test.js - 10/10 pass.
  • node --test scripts/__tests__/pr-verify-lane-outcome.test.mjs - 16/16 pass.
  • Rebased the three commits onto current master without conflicts.
  • Live rollout check confirmed both dedicated AutoscalingListener pods are Running, ready, and restart-free.

Post-merge proof is a merge_group run acquiring arc-merge-queue and a pull-request run acquiring arc-paperclip-general.

Risks

  • Both dedicated pools scale from zero, so the first job still incurs ordinary ARC scale-up latency.
  • Routing is fail-closed: a pool rename or expression-shape change must update the guard and tests in the same PR.
  • A single revert returns these jobs to default; both dedicated pools then remain idle at minRunners 0.

Model Used

OpenAI Codex based on GPT-5 performed the final parser fix validation, current-master rebase, Kubernetes rollout verification, PR metadata correction, and exact-head CI inspection using repository, GitHub CLI, Docker, and Kubernetes tools. Earlier commits were produced through the linked Paperclip platform/SRE workflow.

Related PRs

  • onprem-k8s#2180 - merged capacity activation and listener rollout.
  • paperclip#1042 - sheds superseded merge-group generations; complementary, not duplicate.
  • paperclip#1077 - merge-queue landing-commit review behavior; adjacent, not overlapping.

Checklist

  • I have included a thinking path that traces from project context to this change
  • I have specified the model used (with version and capability details)
  • I have checked ROADMAP.md and confirmed this PR does not duplicate planned core work
  • I have searched GitHub for duplicate or related PRs and linked them above
  • I have either (a) linked existing issues with Fixes: # / Closes # / Refs # OR (b) described the issue in-PR following the relevant issue template
  • I have run tests locally and they pass
  • I have added or updated tests where applicable
  • If this change affects the UI, I have included before/after screenshots - N/A, CI-only change
  • I have updated relevant documentation to reflect my changes - inline workflow rationale and rollout state
  • I have considered and documented any risks above
  • All Paperclip CI gates are green - exact-head run in progress
  • Greptile is 5/5 with no open P2s, recommendations, or follow-ups - not configured on this repository
  • I will address all Greptile and reviewer comments before requesting merge

Co-Authored-By: Paperclip noreply@paperclip.ing

@kkroo

kkroo commented Aug 6, 2026

Copy link
Copy Markdown
Author

@ally please review head d73f380 for fix: route merge_group jobs to the dedicated arc-merge-queue pool (BLO-22428).

This replaces app-authored #1080 under independent PR author kkroo so the Ally GitHub App can approve.

@allyblockcast

allyblockcast Bot commented Aug 6, 2026

Copy link
Copy Markdown

🔗 Paperclip issue: BLO-21953
🔗 Paperclip issue: BLO-22428

1 similar comment
@allyblockcast

allyblockcast Bot commented Aug 6, 2026

Copy link
Copy Markdown

🔗 Paperclip issue: BLO-21953
🔗 Paperclip issue: BLO-22428

@cursor

cursor Bot commented Aug 6, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@allyblockcast allyblockcast Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ally — Consolidated PR Review

Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: d73f380

Critical Issues (0)

Important Issues (1)

  • [pr-review-toolkit + gstack/review + native-codex] scripts/check-github-runner-labels.mjs:18 — The new regex can accept a chained expression containing an earlier forbidden runner branch. Its unrestricted prefix backtracks to the final && 'arc-merge-queue' || 'default', so ${{ cond && 'ubuntu-latest' || other && 'arc-merge-queue' || 'default' }} is accepted while the checker validates only arc-merge-queue and default. This makes the ARC-only policy fail open despite the comment's fail-closed guarantee.
    • Restrict the condition prefix to the one supported expression (or parse and validate every branch), and add a regression test with a forbidden earlier branch in a chained expression.

Suggestions (1)

  • [native-codex] .github/workflows/pr.yml:212 — Keep merge blocked until Blockcast/onprem-k8s#2115 has landed and live arc-merge-queue listeners are verified. The current routing is correct, but merging it first would send all six merge-group lanes to an unavailable label.

Strengths

  • The current workflow expression correctly keeps pull-request jobs on default and routes all six shared heavy merge-group jobs to the dedicated pool.
  • The tests cover the intended two-branch expression, a forbidden selected branch, and unsupported opaque expressions.
  • CI is green on the reviewed head, including the policy guard and all serialized server shards.

Recommended Action

  1. Tighten the runner-expression parser and add the chained-expression regression test before merge.
  2. Preserve the documented infrastructure-first rollout order.

@allyblockcast

allyblockcast Bot commented Aug 7, 2026

Copy link
Copy Markdown

Sequencing gate correction: this PR's stated blocker (paperclipai#2115) is CLOSED — the live gate is now onprem-k8s#2147

Re-measured 2026-08-07T05:55Z. The "Ordering risk" bullet in this PR's description is still correct in substance but now names a dead artifact, and anyone checking the gate before merging would read a misleading answer:

  • onprem-k8s#2115 is CLOSED, never merged (closed 2026-08-07T05:03:55Z, mergedAt: null). Seeing a closed gate could be read either as "abandoned, proceed" or "already handled" — both wrong.
  • The live carve is onprem-k8s#2147 (kkroo). Its diff is what actually creates the pool: arc/arc-merge-queue-values.yaml (runnerScaleSetName: arc-merge-queue, maxRunners: 8), arc/runner-groups/arc-merge-queue.yaml, arc-default maxRunners: 30 → 22, plus arc-paperclip-general at 8.
  • arc-merge-queue does not exist yet. Zero pods matching actions.github.com/scale-set-name=arc-merge-queue in arc-runners, and no arc-merge-queue listener among the 13 running in arc-systems.

So the hold stands, with the reference updated:

Do not merge this PR until onprem-k8s#2147 is merged AND arc-merge-queue pods are observable in arc-runners.

Merging first routes all six heavy merge_group jobs to a label with no listener — the merge queue stops entirely rather than merely running slow.

paperclipai#2147 status right now: OPEN, mergeable=MERGEABLE, mergeStateStatus=BLOCKED, head 8ba63fc0. arc-gate in progress since 05:36:33Z, review-gate sequencing since 05:46:38Z, review/ally-complete evaluating head 8ba63fc. The most recent formal review (2026-08-07T05:14:55Z, COMMENTED) is stale — it predates the current head.

Why the "land within minutes of each other" note matters more than when it was written: Blockcast/paperclip has merged nothing since #1034 at 2026-08-06T15:02:22Z — 14h51m ago. Head-of-queue #1027 has sat at position 1 since 2026-08-05T12:03:23Z (41h50m); its merge_group run 31144569662 started 03:30:57Z and after 2h23m has 13 jobs done, 3 running, and has not reached the serialized-suite stage. At queue depth 18 with max_entries_to_build=1, this PR reaches the head of the normal queue in well over a day — which is why the admin bypass-merge request exists.

Not requesting a review with this comment; paperclipai#2147's gates are running and nothing here needs action until they clear.

@allyblockcast

allyblockcast Bot commented Aug 7, 2026

Copy link
Copy Markdown

Status update on the ordering dependency named in this PR's risk section: Blockcast/onprem-k8s#2180 is now open — it activates arc-merge-queue (maxRunners: 0 -> 12, sized to the ~10-job peak this PR's own risk note measured) by transferring 228 GiB out of arc-default (30 -> 24).

Per this PR's own gate: please hold merging #1102 until paperclipai#2180 merges and arc-merge-queue pods are confirmed live in arc-runners. I'll comment here once that's confirmed (Argo sync should be quick — the runner-group authorization is already verified on the GitHub side per the continuous monitor's live logs, so the pool should promote from 0/0 within one 5-minute monitor tick after paperclipai#2180 merges).

Tracking issue: BLO-22835.

allyblockcast Bot and others added 2 commits August 7, 2026 21:18
…-22428)

The six heavy pull_request/merge_group-shared jobs (typecheck_release_registry,
worktree_install, general_tests, build, verify_serialized_server,
canary_dry_run) now resolve runs-on conditionally: merge_group runs land on
the new arc-merge-queue pool, pull_request runs keep using the shared
default label unchanged.

Root cause (BLO-22428 live diagnosis): GitHub's merge-queue check
concurrency is 1, so a deep pull_request backlog on the shared default
label can starve the one queue that actually lands code without itself
needing proportional runner capacity -- a 50-deep merge queue sat 10h47m
with zero merges while arc-default was pinned 30/30 on ordinary PR CI.

check-github-runner-labels.mjs previously treated any `${{ ... }}`
runs-on expression as one opaque, unrecognized runner name. Taught it to
recognize the `<cond> && 'X' || 'Y'` ternary shape and validate both
literal branches individually, so this routing expression doesn't need
a blanket allowance for arbitrary expressions.

Depends on the Blockcast/onprem-k8s PR that creates the arc-merge-queue
scale set (branch platformsre/blo22428-arc-merge-queue-partition) -- do
not merge this before that PR is merged and Argo has synced the new pool
live, or merge_group runs will queue against a label with zero runners.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@kkroo kkroo changed the title fix: route merge_group jobs to the dedicated arc-merge-queue pool (BLO-22428) ci: route Paperclip PR and merge-group jobs to dedicated ARC pools (BLO-22428) Aug 8, 2026
@kkroo
kkroo force-pushed the codex/reopen-pr-1080 branch from d73f380 to cb6bd74 Compare August 8, 2026 04:22
@kkroo

kkroo commented Aug 8, 2026

Copy link
Copy Markdown
Author

@ally please review exact head cb6bd74a71b5e286142f261b21d0f4013dd13e0e.

The prior fail-open ternary parser finding is fixed with an exact anchored expression and a chained-forbidden-runner regression. The infrastructure hold is also cleared: onprem-k8s#2180 merged, Argo is Synced/Healthy, and both arc-merge-queue (12) and arc-paperclip-general (16) listeners are live. The PR body now reflects the combined PR + merge-group routing scope.

@allyblockcast

allyblockcast Bot commented Aug 8, 2026

Copy link
Copy Markdown

Hey @kkroo! Before this PR can be reviewed, a few things need attention:

Missing or incomplete:

  • PR is titled ci: but includes source code changes (scripts/check-github-runner-labels.mjs). Please retitle as fix:, feat:, or refactor: so the right gates run, or remove the source code changes if this is genuinely a ci: PR.

Once updated, push a new commit and these checks will re-run automatically.

— commitperclip

@kkroo

kkroo commented Aug 8, 2026

Copy link
Copy Markdown
Author

@ally authoritative review request: exact head cb6bd74a71b5e286142f261b21d0f4013dd13e0e. This full SHA supersedes any earlier request text.

@kkroo kkroo changed the title ci: route Paperclip PR and merge-group jobs to dedicated ARC pools (BLO-22428) fix: route Paperclip PR and merge-group jobs to dedicated ARC pools (BLO-22428) Aug 8, 2026
@kkroo
kkroo force-pushed the codex/reopen-pr-1080 branch from cb6bd74 to d2c97c0 Compare August 8, 2026 04:25
@kkroo

kkroo commented Aug 8, 2026

Copy link
Copy Markdown
Author

@ally please review exact head d2c97c04453eeff8ae8ee601035564c4a10cb6e0. The only delta from the prior request is the commitperclip-required fix: metadata correction; the validated code tree is unchanged.

@allyblockcast

allyblockcast Bot commented Aug 8, 2026

Copy link
Copy Markdown

Hey @kkroo! Before this PR can be reviewed, a few things need attention:

Missing or incomplete:

  • Add the dedup-search checkbox to your PR description and check it once you have searched the GitHub PR list for similar PRs. See the PR template at .github/PULL_REQUEST_TEMPLATE.md and CONTRIBUTING.md → "Before You Start: Search First".

Once updated, push a new commit and these checks will re-run automatically.

— commitperclip

Co-Authored-By: Paperclip <noreply@paperclip.ing>
@kkroo
kkroo force-pushed the codex/reopen-pr-1080 branch from d2c97c0 to 82a04c5 Compare August 8, 2026 04:31
@kkroo

kkroo commented Aug 8, 2026

Copy link
Copy Markdown
Author

@ally please review exact head 82a04c57a0d29e4bb11a1140c58eb12586c0d6ac. The code tree is unchanged; this head refreshes the PR description to the exact repository template checklist after commitperclip requested the dedup-search checkbox.

@allyblockcast allyblockcast left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ally — Consolidated PR Review

Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 82a04c5

Prior Findings Dispositioned (1)

  • prior:d73f380 important 1 — fixed — scripts/check-github-runner-labels.mjs:27-28TERNARY_RUNNER_EXPRESSION is now fully anchored (^\$\{\{\s*github\.event_name\s*==\s*'merge_group'\s*&&\s*'([^']*)'\s*\|\|\s*'([^']*)'\s*\}\}$), with no unrestricted backtracking prefix. A chained expression like ${{ cond && 'ubuntu-latest' || github.event_name == 'merge_group' && 'arc-merge-queue' || 'arc-paperclip-general' }} no longer matches the ternary shape at all and falls through to the opaque-string path (valuesFromScalar line 88), which fails closed against ALLOWED_RUNNERS. scripts/check-github-runner-labels.test.js:166-175 adds the exact regression test ("rejects a chained expression with an earlier forbidden runner") asserting result.status === 1 for that case, plus companion tests for a disallowed ternary branch and a non-matching opaque expression.

Critical Issues (0)

Important Issues (0)

Suggestions (0)

Strengths

  • The anchored regex plus per-branch validation (ALLOWED_RUNNERS.has(entry.value) on both ternaryMatch[1] and ternaryMatch[2], scripts/check-github-runner-labels.mjs:86-88,141) closes the fail-open gap with the minimal, non-speculative fix — no broader expression parser was introduced, matching the one ternary shape actually in use.
  • scripts/check-github-runner-labels.test.js:195-202 adds a whole-file guard (PR workflow does not route jobs to the shared default pool) that fails if any of the six migrated jobs regress back to runs-on: default; verified against the current pr.yml — no bare runs-on: default remains and policy/helm_chart/e2e retain their existing dedicated ARC labels untouched, so the change is scoped correctly.
  • All CI checks are green on the reviewed head, including the policy guard, the new regression tests, and all serialized/general server shards.

Recommended Action

  1. None — ready to merge on this head.

@allyblockcast
allyblockcast Bot added this pull request to the merge queue Aug 8, 2026

@allyblockcast allyblockcast Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ally — Consolidated PR Review

Lenses: pr-review-toolkit (code, tests, comments, errors, types) + gstack/review + native-codex.
Reviewed head: 82a04c5

Prior Findings Dispositioned (1)

  • prior:d73f380 important 1 — fixed — scripts/check-github-runner-labels.mjs:27-28TERNARY_RUNNER_EXPRESSION is now fully anchored (^\$\{\{\s*github\.event_name\s*==\s*'merge_group'\s*&&\s*'([^']*)'\s*\|\|\s*'([^']*)'\s*\}\}$), with no unrestricted backtracking prefix. A chained expression like ${{ cond && 'ubuntu-latest' || github.event_name == 'merge_group' && 'arc-merge-queue' || 'arc-paperclip-general' }} no longer matches the ternary shape at all and falls through to the opaque-string path (valuesFromScalar line 88), which fails closed against ALLOWED_RUNNERS. scripts/check-github-runner-labels.test.js:166-175 adds the exact regression test ("rejects a chained expression with an earlier forbidden runner") asserting result.status === 1 for that case, plus companion tests for a disallowed ternary branch and a non-matching opaque expression.

Critical Issues (0)

Important Issues (0)

Suggestions (0)

Strengths

  • The anchored regex plus per-branch validation (ALLOWED_RUNNERS.has(entry.value) on both ternaryMatch[1] and ternaryMatch[2], scripts/check-github-runner-labels.mjs:86-88,141) closes the fail-open gap with the minimal, non-speculative fix — no broader expression parser was introduced, matching the one ternary shape actually in use.
  • scripts/check-github-runner-labels.test.js:195-202 adds a whole-file guard (PR workflow does not route jobs to the shared default pool) that fails if any of the six migrated jobs regress back to runs-on: default; verified against the current pr.yml — no bare runs-on: default remains and policy/helm_chart/e2e retain their existing dedicated ARC labels untouched, so the change is scoped correctly.
  • All CI checks are green on the reviewed head, including the policy guard, the new regression tests, and all serialized/general server shards.

Recommended Action

  1. None — ready to merge on this head.

@kkroo
kkroo removed this pull request from the merge queue due to a manual request Aug 8, 2026
@kkroo
kkroo added this pull request to the merge queue Aug 8, 2026
@kkroo
kkroo removed this pull request from the merge queue due to a manual request Aug 8, 2026
@kkroo
kkroo merged commit 543cf16 into master Aug 8, 2026
22 checks passed
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.

2 participants