perf(ci): shard release-verify stragglers and move typecheck cache warmup (#23156)

## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Every merge to `master` runs `release-verify.yml` on the dedicated
`paperclip-post-merge-x64` fleet to certify the exact commit before
downstream releases consume it.
> - Four lanes currently bottleneck `release-verify.yml` at ~6m–6m 30s
(`server-integration`, `server (1/10)`, `Serialized tests (1/9)`, and
`Build` with 75s of serial typecheck-cache warming), while every other
lane finishes in 2m–3m 45s.
> - Post-merge verification latency directly delays every release
pipeline waiting on exact-source proof.
> - This pull request shards those three test stragglers using existing
deterministic shard flags and moves incremental typecheck cache warming
into `typecheck` (skipping a redundant server pass when `pnpm -r
typecheck` already populated the cache).
> - The benefit is a balanced ~4m post-merge verification critical path
with zero weakened or removed checks.

## Linked Issues or Issue Description

**What happened?**
Post-merge release verification (`release-verify.yml`) takes ~6m 30s on
its slowest lanes (`server-integration` 6m 29s, `server (1/10)` 6m 23s,
`Serialized tests (1/9)` 6m 00s, and `Build` 5m 45s including 75s of
`Warm incremental typecheck cache`), while the rest of the workflow
finishes in ~3m.

**Expected behavior**
All lanes in `release-verify.yml` should run with balanced parallelism
on `paperclip-post-merge-x64` so post-merge verification finishes in ~4m
while running every existing check.

**Steps to reproduce**
1. Inspect a canonical `master` run of `cloud-readiness.yml` /
`release-verify.yml` (such as run `46019173820`).
2. Compare the four straggler lanes (345s–389s) against `Typecheck`
(162s) and all other verification lanes (58s–225s).

## What Changed

- Expanded `general-server-without-chat-or-native-runner` in
`.github/workflows/release-verify.yml` from 10 to 20 shards.
- Expanded `serialized_tests` in `.github/workflows/release-verify.yml`
from 9 to 16 shards.
- Split `verify_paperclip_runner` `server-integration` into 3 sharded
lanes (`server-integration (1/3)`, `(2/3)`, `(3/3)`) passing
`--shard-index` and `--shard-count` to `pnpm test:run:general -- --group
general-server-native-runner`.
- Moved `Check/Warm/Save incremental typecheck cache` from `build` into
`typecheck`, skipping the duplicate
`server/scripts/typecheck-layers.mjs` pass when `pnpm -r typecheck`
already populated `server/node_modules/.cache/paperclip-typecheck`.
- Updated workflow guard tests in
`.github/scripts/tests/release-runner-cache.test.mjs`,
`scripts/__tests__/release-verify-workflow.test.mjs`, and
`.github/scripts/tests/ci-plan.test.mjs`.

## Verification

- Ran locally against the PR worktree:
- `node --test .github/scripts/tests/release-runner-cache.test.mjs
scripts/__tests__/release-verify-workflow.test.mjs
.github/scripts/tests/ci-plan.test.mjs
.github/scripts/tests/post-merge-runner-routing.test.mjs` — all passed.
- Full PR CI runs on this PR.

## Risks

- Low risk: all tests and verification gates remain required; only
matrix shard counts and cache-warm job placement change.
- Peak post-merge AWS fleet concurrency increases by 19 lanes on
`paperclip-post-merge-x64` (isolated from PR CI); easily reverted by
reverting this PR if fleet scaling shows unexpected queue wait.

## Model Used

- Gemini (Antigravity)

## Checklist

- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
This commit is contained in:
Dotta authored and GitHub committed 2026-11-28 06:32:00 -06:00
1 parent 9c1fd24642
commit 7bd652e3ba
4 files changed
+173 -87

No files matched your search

+142 -73
View File
@@ -124,6 +124,35 @@ jobs:
- name: Typecheck
run: pnpm -r typecheck
- name: Check for incremental typecheck cache
id: typecheck_incremental
if: ${{ github.repository == 'paperclipai/paperclip' && github.event_name == 'push' && github.ref == 'refs/heads/master' && inputs.ref == github.sha }}
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
lookup-only: true
path: |
server/node_modules/.cache/paperclip-typecheck
ui/node_modules/.cache/paperclip-ui.tsbuildinfo
key: typecheck-incremental-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'tsconfig.base.json', 'server/tsconfig.json', 'server/src/__tests__/tsconfig.json', 'server/scripts/typecheck-layers.mjs', 'ui/tsconfig.json') }}-${{ github.sha }}
- name: Warm incremental typecheck cache
if: ${{ github.repository == 'paperclipai/paperclip' && github.event_name == 'push' && github.ref == 'refs/heads/master' && inputs.ref == github.sha && steps.typecheck_incremental.outputs.cache-hit != 'true' }}
run: |
if [ ! -d server/node_modules/.cache/paperclip-typecheck ]; then
node server/scripts/typecheck-layers.mjs --checkers 4
fi
node scripts/storybook-catalog.mjs
node scripts/run-tsc.mjs -p ui/tsconfig.json --incremental --tsBuildInfoFile ui/node_modules/.cache/paperclip-ui.tsbuildinfo
- name: Save incremental typecheck cache for PR typecheck
if: ${{ github.repository == 'paperclipai/paperclip' && github.event_name == 'push' && github.ref == 'refs/heads/master' && inputs.ref == github.sha && steps.typecheck_incremental.outputs.cache-hit != 'true' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
server/node_modules/.cache/paperclip-typecheck
ui/node_modules/.cache/paperclip-ui.tsbuildinfo
key: typecheck-incremental-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'tsconfig.base.json', 'server/tsconfig.json', 'server/src/__tests__/tsconfig.json', 'server/scripts/typecheck-layers.mjs', 'ui/tsconfig.json') }}-${{ github.sha }}
general_tests:
if: ${{ !inputs.runner_binaries_only }}
name: General tests (${{ matrix.group_label }})
@@ -136,49 +165,89 @@ jobs:
matrix:
include:
# Split the long chat file by collected test locations, and balance
# the remaining server files across ten runners. Rust-backed server
# the remaining server files across twenty runners. Rust-backed server
# suites run in the cached Runner lane below. Local invocations retain
# their complete general-server group.
- group: general-server-without-chat-or-native-runner
group_label: server (1/10)
group_label: server (1/20)
shard_index: 0
shard_count: 10
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (2/10)
group_label: server (2/20)
shard_index: 1
shard_count: 10
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (3/10)
group_label: server (3/20)
shard_index: 2
shard_count: 10
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (4/10)
group_label: server (4/20)
shard_index: 3
shard_count: 10
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (5/10)
group_label: server (5/20)
shard_index: 4
shard_count: 10
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (6/10)
group_label: server (6/20)
shard_index: 5
shard_count: 10
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (7/10)
group_label: server (7/20)
shard_index: 6
shard_count: 10
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (8/10)
group_label: server (8/20)
shard_index: 7
shard_count: 10
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (9/10)
group_label: server (9/20)
shard_index: 8
shard_count: 10
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (10/10)
group_label: server (10/20)
shard_index: 9
shard_count: 10
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (11/20)
shard_index: 10
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (12/20)
shard_index: 11
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (13/20)
shard_index: 12
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (14/20)
shard_index: 13
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (15/20)
shard_index: 14
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (16/20)
shard_index: 15
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (17/20)
shard_index: 16
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (18/20)
shard_index: 17
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (19/20)
shard_index: 18
shard_count: 20
- group: general-server-without-chat-or-native-runner
group_label: server (20/20)
shard_index: 19
shard_count: 20
- group: general-chat
group_label: chat (1/3)
shard_index: 0
@@ -248,32 +317,53 @@ jobs:
matrix:
include:
- shard_index: 0
shard_count: 9
shard_label: 1/9
shard_count: 16
shard_label: 1/16
- shard_index: 1
shard_count: 9
shard_label: 2/9
shard_count: 16
shard_label: 2/16
- shard_index: 2
shard_count: 9
shard_label: 3/9
shard_count: 16
shard_label: 3/16
- shard_index: 3
shard_count: 9
shard_label: 4/9
shard_count: 16
shard_label: 4/16
- shard_index: 4
shard_count: 9
shard_label: 5/9
shard_count: 16
shard_label: 5/16
- shard_index: 5
shard_count: 9
shard_label: 6/9
shard_count: 16
shard_label: 6/16
- shard_index: 6
shard_count: 9
shard_label: 7/9
shard_count: 16
shard_label: 7/16
- shard_index: 7
shard_count: 9
shard_label: 8/9
shard_count: 16
shard_label: 8/16
- shard_index: 8
shard_count: 9
shard_label: 9/9
shard_count: 16
shard_label: 9/16
- shard_index: 9
shard_count: 16
shard_label: 10/16
- shard_index: 10
shard_count: 16
shard_label: 11/16
- shard_index: 11
shard_count: 16
shard_label: 12/16
- shard_index: 12
shard_count: 16
shard_label: 13/16
- shard_index: 13
shard_count: 16
shard_label: 14/16
- shard_index: 14
shard_count: 16
shard_label: 15/16
- shard_index: 15
shard_count: 16
shard_label: 16/16
steps:
- name: Checkout repository
@@ -355,7 +445,15 @@ jobs:
checks: check:runner
- lane: api-authority
checks: check:api-authority
- lane: server-integration
- lane: server-integration (1/3)
server_integration_shard_index: 0
server_integration_shard_count: 3
- lane: server-integration (2/3)
server_integration_shard_index: 1
server_integration_shard_count: 3
- lane: server-integration (3/3)
server_integration_shard_index: 2
server_integration_shard_count: 3
steps:
- name: Checkout repository
@@ -440,7 +538,7 @@ jobs:
run: pnpm install --no-frozen-lockfile
- name: Build native server test binaries
if: ${{ matrix.lane == 'server-integration' }}
if: ${{ startsWith(matrix.lane, 'server-integration') }}
timeout-minutes: 10
working-directory: packages/paperclip-runner
run: |
@@ -449,11 +547,11 @@ jobs:
cargo build --release --manifest-path runner/Cargo.toml --locked -p paperclip-runner-core --bin paperclip-runnerd --bin fake-codex-app-server
- name: Run native server integration suites
if: ${{ matrix.lane == 'server-integration' }}
run: pnpm test:run:general -- --group general-server-native-runner
if: ${{ startsWith(matrix.lane, 'server-integration') }}
run: pnpm test:run:general -- --group general-server-native-runner --shard-index ${{ matrix.server_integration_shard_index }} --shard-count ${{ matrix.server_integration_shard_count }}
- name: Verify Paperclip Runner
if: ${{ matrix.lane != 'server-integration' && matrix.vitest_lane == '' }}
if: ${{ !startsWith(matrix.lane, 'server-integration') && matrix.vitest_lane == '' }}
env:
RUNNER_CHECKS: ${{ matrix.checks }}
run: |
@@ -639,35 +737,6 @@ jobs:
packages/paperclip-eval-kernel/dist
key: runner-dist-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('package.json', 'pnpm-lock.yaml', 'pnpm-workspace.yaml', 'tsconfig.base.json', 'patches/**', 'packages/shared/src/**', 'packages/adapter-utils/src/**', 'packages/plugins/sdk/src/**', 'packages/paperclip-runner/package.json', 'packages/paperclip-runner/tsconfig*.json', 'packages/paperclip-runner/rust-toolchain.toml', 'packages/paperclip-runner/acpx-profiles.json', 'packages/paperclip-runner/antigravity-distributions.json', 'packages/paperclip-runner/cursor-*.json', 'packages/paperclip-runner/src/**', 'packages/paperclip-runner/scripts/**', 'packages/paperclip-runner/protocol/**', 'packages/paperclip-runner/spec/**', 'packages/paperclip-runner/runner/Cargo.toml', 'packages/paperclip-runner/runner/Cargo.lock', 'packages/paperclip-runner/runner/crates/**', 'packages/paperclip-runner/test-fixtures/**', 'packages/paperclip-runner/test/fixtures/**', 'packages/paperclip-eval-kernel/package.json', 'packages/paperclip-eval-kernel/tsconfig*.json', 'packages/paperclip-eval-kernel/src/**') }}
# Incremental TS 7 .tsbuildinfo + server dts cache for PR typecheck
# (read-only prefix restore in pr-trusted.yml). Only canonical master pushes write.
- name: Check for incremental typecheck cache
id: typecheck_incremental
if: ${{ github.repository == 'paperclipai/paperclip' && github.event_name == 'push' && github.ref == 'refs/heads/master' && inputs.ref == github.sha }}
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
lookup-only: true
path: |
server/node_modules/.cache/paperclip-typecheck
ui/node_modules/.cache/paperclip-ui.tsbuildinfo
key: typecheck-incremental-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'tsconfig.base.json', 'server/tsconfig.json', 'server/src/__tests__/tsconfig.json', 'server/scripts/typecheck-layers.mjs', 'ui/tsconfig.json') }}-${{ github.sha }}
- name: Warm incremental typecheck cache
if: ${{ github.repository == 'paperclipai/paperclip' && github.event_name == 'push' && github.ref == 'refs/heads/master' && inputs.ref == github.sha && steps.typecheck_incremental.outputs.cache-hit != 'true' }}
run: |
node server/scripts/typecheck-layers.mjs --checkers 4
node scripts/storybook-catalog.mjs
node scripts/run-tsc.mjs -p ui/tsconfig.json --incremental --tsBuildInfoFile ui/node_modules/.cache/paperclip-ui.tsbuildinfo
- name: Save incremental typecheck cache for PR typecheck
if: ${{ github.repository == 'paperclipai/paperclip' && github.event_name == 'push' && github.ref == 'refs/heads/master' && inputs.ref == github.sha && steps.typecheck_incremental.outputs.cache-hit != 'true' }}
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: |
server/node_modules/.cache/paperclip-typecheck
ui/node_modules/.cache/paperclip-ui.tsbuildinfo
key: typecheck-incremental-v1-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pnpm-lock.yaml', 'tsconfig.base.json', 'server/tsconfig.json', 'server/src/__tests__/tsconfig.json', 'server/scripts/typecheck-layers.mjs', 'ui/tsconfig.json') }}-${{ github.sha }}
runner_binary_targets:
if: inputs.runner_binaries_only
name: Read exact-source daemon targets