Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
Run the PostgreSQL arms of unit-lane suites in 21 shards instead of 19
garrytane33bbcec5e51
diff --git a/.github/workflows/persistence-validation.yml b/.github/workflows/persistence-validation.ymlindex c9bf218311..c9d002acf8 100644--- a/.github/workflows/persistence-validation.yml+++ b/.github/workflows/persistence-validation.yml@@ -187,26 +187,29 @@ jobs:# file; the PGLite arm also runs in the unit lane). The list is test/postgres-unit-arms.txt;# scripts/check-postgres-lane-coverage.ts fails a new DATABASE_URL-gated arm# until it is listed there or wrapped in a test/e2e registerPostgresTests- # file. The nineteen shards (ARM_SHARDS in scripts/postgres-unit-arms.ts) are+ # file. The twenty-one shards (ARM_SHARDS in scripts/postgres-unit-arms.ts) are# balanced by measured runtime (scripts/postgres-arm-weights.json, mined# from this job's ARM_FILE lines). Each job runs two files at a time, each# worker against its own PostgreSQL service; a shard's two-worker makespan,# doubled for a slow runner, must end a minute inside the step's 20 minutes- # (ARM_SHARD_BUDGET_MS). The job runs both arms of every listed file: the- # unit shards skip *.slow.test.ts, so this lane is the only GitHub lane that- # runs the PGLite side of the listed slow testBackends() suites.+ # (ARM_SHARD_BUDGET_MS, 570 s). On master 505204a9 (2026-11-12) the largest+ # shard planned at 554.6 s with 19 shards; 21 shards bring it to 502.3 s, room+ # for about 70 more arm files at the p75 weight. The job runs both arms of+ # every listed file: the unit shards skip *.slow.test.ts, so this lane is the+ # only GitHub lane that runs the PGLite side of the listed slow+ # testBackends() suites.# Event parity (docs/ci-event-parity.md#full-ci-on-pull-requests): full profile only; a# pull request (cheap tier) runs only the crash robot and convergence here. The# full-ci dispatch on its head, every push and the nightly run this lane.unit-postgres-arms:- name: Unit-lane PostgreSQL arms ${{ matrix.shard }}/19 / Bun ${{ matrix.bun }}+ name: Unit-lane PostgreSQL arms ${{ matrix.shard }}/21 / Bun ${{ matrix.bun }}if: ${{ github.event_name != 'pull_request' }}runs-on: ubicloud-standard-4-ubuntu-2404timeout-minutes: 30strategy:fail-fast: falsematrix:- shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]+ shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21]bun: ['1.4.4']# Event parity: every event, pull requests and merge-queue runs# included, runs every supported Bun version (docs/TESTING.md#event-parity).@@ -254,7 +257,7 @@ jobs:GBRAIN_TEST_ALLOW_DATABASE_URL: '1'GBRAIN_TEST_RECEIPT_DIR: ${{ runner.temp }}/receiptsGBRAIN_TEST_RECEIPT_LANE: pg-arms-bun-${{ matrix.bun }}- run: bun scripts/postgres-unit-arms.ts run ${{ matrix.shard }} 19+ run: bun scripts/postgres-unit-arms.ts run ${{ matrix.shard }} 21- name: Upload receiptsif: always()uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4diff --git a/CHANGELOG.md b/CHANGELOG.mdindex cfdf02008a..b779794f11 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -22,6 +22,7 @@ identifiers and attribution are available in the pre-removal Git revision- `scripts/ci-census-tests.sh`: the pull-request census job now also runs `test/scripts/run-unit-shard.test.ts` (1.5 s, no database). It reads every test file's per-test timeouts, so a bad timeout now fails the pull request instead of a later full run.- `scripts/sharding.ts`, `.github/workflows/test.yml`, `.github/workflows/e2e.yml`: the unit suite now splits into 30 shards instead of 28, run two per job (15 jobs), and the shard weights are refreshed from the median of five Test nightlies and the latest full E2E nightly. On the new weights 28 shards came to about 601 s each, over the 600 s per-shard budget; 30 shards come to about 561 s. Both coverage merges now expect shards 29 and 30.- `scripts/ci-typecheck.sh`, `.github/workflows/test.yml`: when the typecheck job's tsc aborts without a type error (exit 134 or a signal, as when V8 hits the heap limit), the job deletes the restored `tsbuildinfo` and runs tsc once more from cold. A run seeded with a distant head's state could go past the heap cap where a cold run of the same tree fits, and because the aborted run saved that same state under its own head's key, every rerun failed the same way. A type error (exit 1 or 2) still fails at once with no retry, and a run whose tsc aborted or timed out no longer saves its state. `test/scripts/ci-typecheck.test.ts` pins the retry to aborts only.+- `scripts/postgres-unit-arms.ts`, `.github/workflows/persistence-validation.yml`: the PostgreSQL arms of unit-lane suites now run in 21 shards instead of 19. On current weights the largest shard planned at 554.6 s against its 570 s budget, so the next few arm files would have failed the budget test; at 21 it plans at 502.3 s. The budget and its assertion are unchanged.## [0.60.675.0] - 2026-11-11diff --git a/scripts/postgres-unit-arms.ts b/scripts/postgres-unit-arms.tsindex 9e35f43feb..433211968b 100644--- a/scripts/postgres-unit-arms.ts+++ b/scripts/postgres-unit-arms.ts@@ -44,7 +44,7 @@ export const ARMS_LIST = 'test/postgres-unit-arms.txt';export const ARM_WEIGHTS = 'scripts/postgres-arm-weights.json';export const ARM_WEIGHTS_POSTGRES_ONLY = 'scripts/postgres-arm-weights-postgres-only.json';/** persistence-validation's unit-postgres-arms matrix size; test/scripts/postgres-unit-arms.test.ts pins the workflow to it. */-export const ARM_SHARDS = 19;+export const ARM_SHARDS = 21;/** Files run at once per job, each against its own PostgreSQL service; the workflow lists one URL per worker. */export const ARM_WORKERS = 2;/** The workflow step's `timeout-minutes: 20`: a shard whose files run longer is cut off mid-list. */diff --git a/scripts/ubicloud/README.md b/scripts/ubicloud/README.mdindex 9ecb4256df..cc669f82ee 100644--- a/scripts/ubicloud/README.md+++ b/scripts/ubicloud/README.md@@ -169,7 +169,7 @@ runs every file in `test/postgres-unit-arms.txt` the way persistence-validation'`unit-postgres-arms` step does (`bun --no-env-file test --timeout=120000`,`GBRAIN_TEST_ALLOW_DATABASE_URL=1`, no timeout multiplier) against the slot'sown empty `gbrain_arms_test` database. The summary takes the two-worker makespan of its-measured durations over that job's `ARM_SHARDS` partition (19 shards, `ARM_WORKERS` = 2+measured durations over that job's `ARM_SHARDS` partition (21 shards, `ARM_WORKERS` = 2files at a time), and a shard over the step's 20-minute timeoutfails the run, since GitHub would cut that shard off mid-list. The committedweights must also fit each shard twice over with a minute to spare