Context
Sub-issue of Epic #20328 ("Engine CI runs each tier only when a change can reach it"), coordinated with @neo-opus-grace and @neo-gpt-emmy in neomjs/neo#20328 (#issuecomment-6662846915).
- Live latest-open sweep: checked latest 20 open issues on
neomjs/neo (#20340 down to #20270) at 2026-11-05T16:17Z; no equivalent found (#20329, #20330, #20338, and #20340 cover classifier reachability, selective E2E specs, skipped-tier jobs + Brain tip folding, and pr-baseline.yml concurrency).
- A2A in-flight claim sweep: checked
list_messages({ status: 'all', limit: 30 }) at 2026-11-05T16:17Z; @neo-opus-grace confirmed (MESSAGE:2c695615-05d4-45ef-b0d6-4fe64f5ac1b8) that review-admission-mergeability.yml single-job consolidation and repo-local lint consolidation are owned by @neo-gemini-julia while she folds Resolve the Brain's dev tip into #20338.
- Memory Core rationale & own-assignment sweep: queried Memory Core (
query_raw_memories for review-admission-mergeability runner slots concurrency #17692) and inspected commit 4e6d8da73e (#17692, which introduced two-job discover + publish matrix fan-out to replace per-PR synchronize fan-out); checked open issues assigned to @neo-gemini-julia (#3256 / PR #20324 and #6997 / PR #20323); no overlap.
- Design authority: Epic #20328 and
node_modules/neo-agent-skills/scripts/check-workflow-concurrency.mjs (#17692).
The Problem
The neomjs GitHub organization shares a hard ceiling of 20 concurrent GitHub Actions runner slots across all repositories. Every merge to dev (or completion of PR Review Gate / PR Baseline via workflow_run) triggers .github/workflows/review-admission-mergeability.yml, which currently runs a two-stage VM fan-out:
jobs.discover (Discover open dev pull requests) boots 1 Ubuntu VM to run a 5s github.paginate(github.rest.pulls.list) call and emit matrix.pr ([20155, 20273, ..., 20337]).
jobs.publish (PR (${{ matrix.pr }})) boots 1 separate Ubuntu VM per open dev PR (max-parallel: 4) just to make 3 lightweight GitHub REST API calls (pulls.get, repos.getCombinedStatusForRef, repos.createCommitStatus) that take 5–7s of actual script execution.
Empirical measurement from live dev push run 42057947595 (2026-11-05T15:43:58Z, merge of #20319):
Discover open dev pull requests: 5s (15:44:02Z–15:44:07Z) — 1 VM.
PR (20155) through PR (20337): 16 separate VMs, each running 5–7s of API calls while waiting in the org runner queue until 15:55:44Z (11m46s wall time, 17 runner jobs total).
- On every
pull_request_target event (opened, reopened, synchronize, ready_for_review), it also boots 2 sequential VMs (discover + 1-element publish matrix) where discover does zero API calls and merely echoes [event.pull_request.number].
- Additionally, on run
42058372136 (2026-11-05T16:06:10Z), Publish live head mergeability failed on a transient GitHub API 502/500 because actions/github-script@v9 defaults to retries: 0 when retries is omitted.
The Architectural Reality
.github/workflows/review-admission-mergeability.yml publishes the commit status context review-admission/mergeability via github.rest.repos.createCommitStatus.
- Reviewer assignment admission (
manage_pr_reviewers(add)) and reusable-pr-review-gate.yml consume the commit status context review-admission/mergeability directly (not the workflow job check-run names Discover open dev pull requests or PR (N); dev branch ruleset 19087298 lists 16 required check contexts and does not require review-admission/mergeability).
node_modules/neo-agent-skills/scripts/check-workflow-concurrency.mjs enforces that every workflow file defines top-level concurrency.group and concurrency.cancel-in-progress. Because review-admission-mergeability.yml mutates commit statuses via createCommitStatus, cancel-in-progress must remain false (or scoped by event so a pull_request_target run on PR N and a board sweep do not cancel an in-flight status write).
- Commit
4e6d8da73e (#17692) previously tested this workflow via an inline script harness in test/playwright/unit/ai/buildScripts/util/WorkflowConcurrency.spec.mjs before #17791 extracted ai/ to neomjs/neo-agent-brain. Restoring and adapting a dedicated unit spec in test/playwright/unit/buildScripts/util/ReviewAdmissionMergeability.spec.mjs provides direct regression coverage in neomjs/neo.
The Fix
- Collapse
jobs.discover + jobs.publish into a single job (jobs.publish) in .github/workflows/review-admission-mergeability.yml:
- On
pull_request_target, evaluate [context.payload.pull_request.number] directly in the single job (2 VMs → 1 VM).
- On board triggers (
push to dev, workflow_run, workflow_dispatch), paginate open dev PRs (github.paginate(github.rest.pulls.list, { owner, repo, state: 'open', base: 'dev', per_page: 100 })) and evaluate them inside the same job with bounded in-process concurrency (MERGEABILITY_CONCURRENCY: '4') (1 + N_open_PRs VMs → 1 VM, saving 16 runner slots on every dev merge today and finishing in ~15–25s instead of 11m46s).
- Add
retries: 3 to actions/github-script@v9 so transient GitHub 500/502/503 responses on status queries/writes are automatically retried.
- Scope top-level
concurrency.group to review-admission-mergeability-${{ github.event_name == 'pull_request_target' && github.event.pull_request.number || 'board' }} with cancel-in-progress: false so single-PR runs and board runs do not block each other while preserving check-workflow-concurrency.mjs compliance.
- Add unit test coverage (
test/playwright/unit/buildScripts/util/ReviewAdmissionMergeability.spec.mjs):
- Verify single-job topology (no
jobs.discover, no matrix fan-out on jobs.publish, retries: 3 on actions/github-script@v9, cancel-in-progress: false).
- Verify functional execution of
jobs.publish across pull_request_target (single PR) and board triggers (push / workflow_run multi-PR pagination with bounded concurrency, preserving held review-gate/decision and pr-baseline/status requirements before publishing review-admission/mergeability).
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
.github/workflows/review-admission-mergeability.yml (jobs.publish) |
Epic #20328 & review-admission/mergeability status contract (manage_pr_reviewers / reusable-pr-review-gate.yml) |
Single job resolves [eventPr] on pull_request_target or paginates open dev PRs on board triggers and publishes review-admission/mergeability for each PR with bounded in-process concurrency (4) and retries: 3 |
If any single PR fails after retries, record the error and fail the job after completing the remaining PRs in the batch |
Workflow comments in .github/workflows/review-admission-mergeability.yml |
test/playwright/unit/buildScripts/util/ReviewAdmissionMergeability.spec.mjs + node node_modules/neo-agent-skills/scripts/check-workflow-concurrency.mjs |
- Decision Record impact:
none
Acceptance Criteria
Out of Scope
- Changing the
review-admission/mergeability commit status semantics, required upstream contexts (review-gate/decision, pr-baseline/status), or dev branch ruleset 19087298.
- Modifying
test-e2e-brain.yml, classify-test-scope.yml (#20338), pr-baseline.yml (#20340 / Skills #281), or repo-local lint workflows (tracked in sibling leaf under #20328).
Avoided Traps
- Do not enable
cancel-in-progress: true on review-admission-mergeability.yml: Because this workflow mutates commit statuses via createCommitStatus, cancelling an in-flight board sweep mid-loop could leave later open PRs with stale pending mergeability status after a dev advance (#17692).
- Do not use unbounded
Promise.all across all open PRs: Bounded concurrency (4 workers inside the single Node process) respects GitHub secondary rate limits while still completing 16 PRs in <15s inside one runner VM.
Related
Origin Session ID: c5b059c4-5d96-46f1-8c61-184af74d34b4
Retrieval Hint: "review-admission-mergeability.yml discover publish matrix 17 runner slots #20328"
Context
Sub-issue of Epic #20328 ("Engine CI runs each tier only when a change can reach it"), coordinated with
@neo-opus-graceand@neo-gpt-emmyinneomjs/neo#20328(#issuecomment-6662846915).neomjs/neo(#20340down to#20270) at2026-11-05T16:17Z; no equivalent found (#20329,#20330,#20338, and#20340cover classifier reachability, selective E2E specs, skipped-tier jobs + Brain tip folding, andpr-baseline.ymlconcurrency).list_messages({ status: 'all', limit: 30 })at2026-11-05T16:17Z;@neo-opus-graceconfirmed (MESSAGE:2c695615-05d4-45ef-b0d6-4fe64f5ac1b8) thatreview-admission-mergeability.ymlsingle-job consolidation and repo-local lint consolidation are owned by@neo-gemini-juliawhile she foldsResolve the Brain's dev tipinto#20338.query_raw_memoriesforreview-admission-mergeability runner slots concurrency #17692) and inspected commit4e6d8da73e(#17692, which introduced two-jobdiscover+publishmatrix fan-out to replace per-PRsynchronizefan-out); checked open issues assigned to@neo-gemini-julia(#3256/ PR#20324and#6997/ PR#20323); no overlap.node_modules/neo-agent-skills/scripts/check-workflow-concurrency.mjs(#17692).The Problem
The
neomjsGitHub organization shares a hard ceiling of 20 concurrent GitHub Actions runner slots across all repositories. Every merge todev(or completion ofPR Review Gate/PR Baselineviaworkflow_run) triggers.github/workflows/review-admission-mergeability.yml, which currently runs a two-stage VM fan-out:jobs.discover(Discover open dev pull requests) boots 1 Ubuntu VM to run a5sgithub.paginate(github.rest.pulls.list)call and emitmatrix.pr([20155, 20273, ..., 20337]).jobs.publish(PR (${{ matrix.pr }})) boots 1 separate Ubuntu VM per opendevPR (max-parallel: 4) just to make 3 lightweight GitHub REST API calls (pulls.get,repos.getCombinedStatusForRef,repos.createCommitStatus) that take5–7sof actual script execution.Empirical measurement from live
devpush run42057947595(2026-11-05T15:43:58Z, merge of#20319):Discover open dev pull requests:5s(15:44:02Z–15:44:07Z) — 1 VM.PR (20155)throughPR (20337): 16 separate VMs, each running5–7sof API calls while waiting in the org runner queue until15:55:44Z(11m46swall time, 17 runner jobs total).pull_request_targetevent (opened,reopened,synchronize,ready_for_review), it also boots 2 sequential VMs (discover+ 1-elementpublishmatrix) wherediscoverdoes zero API calls and merely echoes[event.pull_request.number].42058372136(2026-11-05T16:06:10Z),Publish live head mergeabilityfailed on a transient GitHub API502/500becauseactions/github-script@v9defaults toretries: 0whenretriesis omitted.The Architectural Reality
.github/workflows/review-admission-mergeability.ymlpublishes the commit status contextreview-admission/mergeabilityviagithub.rest.repos.createCommitStatus.manage_pr_reviewers(add)) andreusable-pr-review-gate.ymlconsume the commit status contextreview-admission/mergeabilitydirectly (not the workflow job check-run namesDiscover open dev pull requestsorPR (N);devbranch ruleset19087298lists 16 required check contexts and does not requirereview-admission/mergeability).node_modules/neo-agent-skills/scripts/check-workflow-concurrency.mjsenforces that every workflow file defines top-levelconcurrency.groupandconcurrency.cancel-in-progress. Becausereview-admission-mergeability.ymlmutates commit statuses viacreateCommitStatus,cancel-in-progressmust remainfalse(or scoped by event so apull_request_targetrun on PRNand a board sweep do not cancel an in-flight status write).4e6d8da73e(#17692) previously tested this workflow via an inline script harness intest/playwright/unit/ai/buildScripts/util/WorkflowConcurrency.spec.mjsbefore#17791extractedai/toneomjs/neo-agent-brain. Restoring and adapting a dedicated unit spec intest/playwright/unit/buildScripts/util/ReviewAdmissionMergeability.spec.mjsprovides direct regression coverage inneomjs/neo.The Fix
jobs.discover+jobs.publishinto a single job (jobs.publish) in.github/workflows/review-admission-mergeability.yml:pull_request_target, evaluate[context.payload.pull_request.number]directly in the single job (2 VMs → 1 VM).pushtodev,workflow_run,workflow_dispatch), paginate opendevPRs (github.paginate(github.rest.pulls.list, { owner, repo, state: 'open', base: 'dev', per_page: 100 })) and evaluate them inside the same job with bounded in-process concurrency (MERGEABILITY_CONCURRENCY: '4') (1 + N_open_PRsVMs → 1 VM, saving 16 runner slots on everydevmerge today and finishing in ~15–25sinstead of11m46s).retries: 3toactions/github-script@v9so transient GitHub500/502/503responses on status queries/writes are automatically retried.concurrency.grouptoreview-admission-mergeability-${{ github.event_name == 'pull_request_target' && github.event.pull_request.number || 'board' }}withcancel-in-progress: falseso single-PR runs and board runs do not block each other while preservingcheck-workflow-concurrency.mjscompliance.test/playwright/unit/buildScripts/util/ReviewAdmissionMergeability.spec.mjs):jobs.discover, no matrix fan-out onjobs.publish,retries: 3onactions/github-script@v9,cancel-in-progress: false).jobs.publishacrosspull_request_target(single PR) and board triggers (push/workflow_runmulti-PR pagination with bounded concurrency, preserving heldreview-gate/decisionandpr-baseline/statusrequirements before publishingreview-admission/mergeability).Contract Ledger Matrix
.github/workflows/review-admission-mergeability.yml(jobs.publish)review-admission/mergeabilitystatus contract (manage_pr_reviewers/reusable-pr-review-gate.yml)[eventPr]onpull_request_targetor paginates opendevPRs on board triggers and publishesreview-admission/mergeabilityfor each PR with bounded in-process concurrency (4) andretries: 3.github/workflows/review-admission-mergeability.ymltest/playwright/unit/buildScripts/util/ReviewAdmissionMergeability.spec.mjs+node node_modules/neo-agent-skills/scripts/check-workflow-concurrency.mjsnoneAcceptance Criteria
.github/workflows/review-admission-mergeability.ymlruns a single job (jobs.publish) with nojobs.discoveror per-PR matrix VM fan-out (1runner job perpull_request_targetevent and1runner job perdevpush /workflow_run/workflow_dispatchevent regardless of open PR count).actions/github-script@v9in.github/workflows/review-admission-mergeability.ymlconfiguresretries: 3.node node_modules/neo-agent-skills/scripts/check-workflow-concurrency.mjspasses (Checked 36 workflow file(s); concurrency policy holds.).test/playwright/unit/buildScripts/util/ReviewAdmissionMergeability.spec.mjsverifies both the single-job workflow contract and the runtime behavior forpull_request_targetand multi-PR board sweeps.Out of Scope
review-admission/mergeabilitycommit status semantics, required upstream contexts (review-gate/decision,pr-baseline/status), ordevbranch ruleset19087298.test-e2e-brain.yml,classify-test-scope.yml(#20338),pr-baseline.yml(#20340/Skills #281), or repo-local lint workflows (tracked in sibling leaf under#20328).Avoided Traps
cancel-in-progress: trueonreview-admission-mergeability.yml: Because this workflow mutates commit statuses viacreateCommitStatus, cancelling an in-flight board sweep mid-loop could leave later open PRs with stalependingmergeability status after adevadvance (#17692).Promise.allacross all open PRs: Bounded concurrency (4workers inside the single Node process) respects GitHub secondary rate limits while still completing 16 PRs in<15sinside one runner VM.Related
#17692(4e6d8da73e)Origin Session ID: c5b059c4-5d96-46f1-8c61-184af74d34b4 Retrieval Hint: "review-admission-mergeability.yml discover publish matrix 17 runner slots #20328"