Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

ci(E6/E7, C4, C8): fold slow-eval-longmemeval into the unit shards, drop check:eval-chronicle from verify, downsize unit and serial runners

garrytand1f8fba8fb5e
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index db95ce00b8..a17822a875 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -327,8 +327,10 @@ jobs:
matrix:
shard: [1, 2, 3, 4]
# The pool is min(cpus, 4) processes: 8 vCPUs measured 222s for shard 2,
- # the same as 16 (224s); 4 vCPUs took 277s.
- runs-on: ubicloud-standard-8-ubuntu-2404
+ # the same as 16 (224s); 4 vCPUs took 277s. 4 vCPUs (C8): the shards
+ # finish in 2-3 minutes, far off the critical path, so the extra ~55s
+ # costs nothing while halving the lane's vCPU-minutes.
+ runs-on: ubicloud-standard-4-ubuntu-2404
# Keep the existing timeout headroom for memory-constrained runners,
# bounded rescue attempts, and the machine-exclusive tail on shard 1.
timeout-minutes: 25
@@ -348,7 +350,7 @@ jobs:
# not once per job per run. This job SAVES; verify + matrix + slow jobs
# restore-only. The key is an approximation on purpose: it only has to
# be a superset-trigger of real schema changes.
- # HASH INPUTS HAVE 13 HOMES: 11 legacy keys (six here and five in
+ # HASH INPUTS HAVE 13 HOMES: 11 legacy keys (five here and six in
# e2e.yml) plus two default-profile keys here (slow-brainbench and
# brainbench). Edit all together when schema dependencies change;
# profile names stay distinct, and the serial save reuses its restore key.
@@ -403,72 +405,13 @@ jobs:
retention-days: 14
overwrite: true
- slow-eval-longmemeval:
- if: ${{ github.event_name != 'workflow_dispatch' || inputs.native_only != true }}
- # Dedicated runner for the LongMemEval end-to-end test file. The file
- # was originally 359s. TODO #1 (engine-sharing in runEvalLongMemEval
- # via RunOpts.engine) cut it to ~200s by amortizing PGLite cold-create
- # across all 13 runEvalLongMemEval calls in one beforeAll-shared brain.
- # Pulled out of the matrix (see scripts/test-shard.sh) so a single 200s
- # atom doesn't dominate a shard's wallclock. Companion file
- # test/eval-longmemeval.slow.test.ts (the pure-bucket half) stays in
- # the matrix because it's light (~42s).
- runs-on: ubicloud-standard-4-ubuntu-2404
- timeout-minutes: 12
- steps:
- - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- with:
- bun-version: 1.4.2
- - uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
- with:
- path: ~/.bun/install/cache
- key: bun-cache-${{ runner.os }}-${{ hashFiles('bun.lock') }}
- restore-keys: bun-cache-${{ runner.os }}-
- - uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
- with:
- path: |
- test/fixtures/pglite-snapshot.tar
- test/fixtures/pglite-snapshot.version
- key: pglite-snapshot-${{ runner.os }}-${{ hashFiles('src/core/*.ts', 'src/core/engine-sql/bootstrap.ts', 'src/core/schema-migrations/**', 'src/core/ai/defaults.ts', 'src/core/company-brain/receipt-schema.ts', 'src/core/entities/resolve.ts', 'src/core/facts/withdrawal-schema.ts', 'src/core/facts/relink-schema.ts', 'src/core/google/*.ts', 'src/core/grants/*.ts', 'src/core/minions/tools/brain-allowlist.ts', 'src/core/ops/contract.ts', 'src/core/page-state/*schema.ts', 'src/core/persistence/*.ts', 'src/core/schema-pack/link-inference.ts', 'src/core/schema-pack/redos-guard.ts', 'src/core/search/alias-normalize.ts', 'src/core/search/private-visibility.ts', 'src/core/search/projection-statistics.ts', 'src/core/shared-skills/*schema*.ts', 'src/core/ai/decide/schema.ts', 'test/helpers/legacy-embedding-config.ts', 'scripts/build-pglite-snapshot.ts') }}
- - run: bun install --frozen-lockfile
- - name: Ensure PGLite snapshot (build-or-validate, non-fatal)
- run: bash -c '. scripts/lib/test-env.sh && ensure_pglite_snapshot slow-eval && echo "GBRAIN_PGLITE_SNAPSHOT=${GBRAIN_PGLITE_SNAPSHOT:-}" >> "$GITHUB_ENV"'
- - run: bash scripts/run-with-receipt.sh slow longmemeval-e2e -- bun test test/eval-longmemeval-e2e.slow.test.ts --timeout=60000 --coverage --coverage-reporter=lcov --coverage-dir=${{ runner.temp }}/coverage/sloweval
- env:
- GBRAIN_TEST_RECEIPT_DIR: ${{ runner.temp }}/receipts
- - name: Write coverage lane manifest
- run: |
- printf '{"lane":"sloweval","sha":"%s","lcovCount":%s,"complete":true}\n' \
- "$GITHUB_SHA" "$(find "$RUNNER_TEMP/coverage" -name lcov.info | wc -l | tr -d ' ')" \
- > "$RUNNER_TEMP/coverage/lane-manifest.json"
- - name: Upload receipts
- if: always()
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
- with:
- name: receipts-slow-eval
- path: ${{ runner.temp }}/receipts
- retention-days: 14
- if-no-files-found: warn
- overwrite: true
- - name: Upload coverage (slow-eval lane)
- if: always()
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
- with:
- name: coverage-sloweval
- path: ${{ runner.temp }}/coverage
- retention-days: 14
- if-no-files-found: ignore
- overwrite: true
-
slow-brainbench-e2e:
if: ${{ github.event_name != 'workflow_dispatch' || inputs.native_only != true }}
# Dedicated runner for the BrainBench CLI e2e file. At 98s mined it was
# the matrix's single heaviest atom (10% of the whole corpus weight) and
# the hard floor on shard-count scaling; a Phase-2 rewrite (spawn batching
# + deleting the CI-gate-duplicated full-corpus test) cut it to ~72s
- # local, still far past the ~40s keep-in-matrix bar. Same pattern as
- # slow-eval-longmemeval above.
+ # local, still far past the ~40s keep-in-matrix bar.
runs-on: ubicloud-standard-4-ubuntu-2404
timeout-minutes: 12
steps:
@@ -671,9 +614,10 @@ jobs:
# (replaces FNV-1a path hash). Weights live in scripts/test-weights.json,
# mined from real CI logs via scripts/mine-shard-weights.ts. Missing
# weights fall back to corpus median — new test files work immediately.
- # 4 vCPUs: a shard is one bun process (measured 1.1-1.5 busy cores on
- # average), and shards 2 and 9 took the same time on 4, 8 and 16 vCPUs.
- runs-on: ubicloud-standard-4-ubuntu-2404
+ # 2 vCPUs (C4): a shard is one bun process (measured 1.1-1.5 busy cores on
+ # average); shards 2 and 9 took the same time on 4, 8 and 16 vCPUs, and a
+ # 77-file slice with coverage took 212s on 2 cores vs 204s on 4.
+ runs-on: ubicloud-standard-2-ubuntu-2404
# 22, not 15: under parallel PR load the PGLite WASM cold-starts stretch a
# shard past 15 min while every test is still passing — the timeout then
# cancels the job and the test-status gate reads it as a failure. 13 runs
@@ -737,7 +681,7 @@ jobs:
# ──────────────────────────────────────────────────────────────────────
- # coverage-report: merges the PR corpus (8 unit + 4 serial + 3 slow
+ # coverage-report: merges the PR corpus (8 unit + 4 serial + 2 slow
# lanes) into one honest number, renders it to the step summary, and runs
# the diff + baseline gates in report-only mode (COVERAGE_GATE_ENFORCE=0).
# ADVISORY during the report-only window: deliberately NOT in test-status's
@@ -747,7 +691,7 @@ jobs:
# exactly the moment the (degraded) report matters most.
# ──────────────────────────────────────────────────────────────────────
coverage-report:
- needs: [serial-tests, slow-eval-longmemeval, slow-entity-resolve-perf, slow-brainbench-e2e, test]
+ needs: [serial-tests, slow-entity-resolve-perf, slow-brainbench-e2e, test]
if: ${{ always() && (github.event_name != 'workflow_dispatch' || inputs.native_only != true) }}
runs-on: ubicloud-standard-4-ubuntu-2404
timeout-minutes: 10
@@ -775,7 +719,7 @@ jobs:
bun scripts/merge-lcov.ts \
--out-lcov "$RUNNER_TEMP/coverage-merged/lcov.info" \
--out-json "$RUNNER_TEMP/coverage-merged/summary.json" \
- --manifest-expect shard-1,shard-2,shard-3,shard-4,shard-5,shard-6,shard-7,shard-8,serial-1,serial-2,serial-3,serial-4,sloweval,slowperf,slowbrainbench \
+ --manifest-expect shard-1,shard-2,shard-3,shard-4,shard-5,shard-6,shard-7,shard-8,serial-1,serial-2,serial-3,serial-4,slowperf,slowbrainbench \
"$RUNNER_TEMP/coverage-artifacts"
- name: Coverage summary → step summary
run: bun scripts/render-coverage-summary.ts --summary "$RUNNER_TEMP/coverage-merged/summary.json" --structural scripts/structural-suites.tsv >> "$GITHUB_STEP_SUMMARY"
@@ -871,7 +815,7 @@ jobs:
# comparison against a baseline run is the parent's local call:
# bun scripts/ci-executed-counts.ts --base-run <id> --head-run <id>
executed-receipts:
- needs: [verify, serial-tests, slow-eval-longmemeval, slow-entity-resolve-perf, slow-brainbench-e2e, test, shared-skills-compatibility]
+ needs: [verify, serial-tests, slow-entity-resolve-perf, slow-brainbench-e2e, test, shared-skills-compatibility]
if: ${{ always() && (github.event_name != 'workflow_dispatch' || inputs.native_only != true) }}
runs-on: ubicloud-standard-2-ubuntu-2404
timeout-minutes: 10
@@ -911,7 +855,7 @@ jobs:
# Coverage percentages remain advisory until their separate graduation.
test-status:
name: ${{ github.event_name == 'workflow_dispatch' && inputs.native_only == true && 'full-suite-not-run' || 'test-status' }}
- needs: [gitleaks, security-regressions, dependency-audit, verify, serial-tests, slow-eval-longmemeval, slow-entity-resolve-perf, slow-brainbench-e2e, brainbench, test, native-locks, persistence-validation, admin-browser, shared-skills-compatibility]
+ needs: [gitleaks, security-regressions, dependency-audit, verify, serial-tests, slow-entity-resolve-perf, slow-brainbench-e2e, brainbench, test, native-locks, persistence-validation, admin-browser, shared-skills-compatibility]
if: ${{ always() && (github.event_name != 'workflow_dispatch' || inputs.native_only != true) }}
runs-on: ubicloud-standard-2-ubuntu-2404
timeout-minutes: 5
@@ -923,7 +867,6 @@ jobs:
AUDIT="${{ needs.dependency-audit.result }}"
VERIFY="${{ needs.verify.result }}"
SERIAL="${{ needs.serial-tests.result }}"
- SLOW_EVAL="${{ needs.slow-eval-longmemeval.result }}"
SLOW_PERF="${{ needs.slow-entity-resolve-perf.result }}"
SLOW_BRAINBENCH="${{ needs.slow-brainbench-e2e.result }}"
BRAINBENCH="${{ needs.brainbench.result }}"
@@ -932,9 +875,9 @@ jobs:
PERSISTENCE="${{ needs.persistence-validation.result }}"
ADMIN_BROWSER="${{ needs.admin-browser.result }}"
SKILL_COMPATIBILITY="${{ needs.shared-skills-compatibility.result }}"
- echo "gitleaks=$GITLEAKS security-regressions=$SECURITY dependency-audit=$AUDIT verify=$VERIFY serial-tests=$SERIAL slow-eval-longmemeval=$SLOW_EVAL slow-entity-resolve-perf=$SLOW_PERF slow-brainbench-e2e=$SLOW_BRAINBENCH brainbench=$BRAINBENCH test=$TEST native-locks=$NATIVE_LOCKS persistence=$PERSISTENCE admin-browser=$ADMIN_BROWSER"
+ echo "gitleaks=$GITLEAKS security-regressions=$SECURITY dependency-audit=$AUDIT verify=$VERIFY serial-tests=$SERIAL slow-entity-resolve-perf=$SLOW_PERF slow-brainbench-e2e=$SLOW_BRAINBENCH brainbench=$BRAINBENCH test=$TEST native-locks=$NATIVE_LOCKS persistence=$PERSISTENCE admin-browser=$ADMIN_BROWSER"
echo "shared-skills-compatibility=$SKILL_COMPATIBILITY"
- for r in "$GITLEAKS" "$SECURITY" "$AUDIT" "$VERIFY" "$SERIAL" "$SLOW_EVAL" "$SLOW_PERF" "$SLOW_BRAINBENCH" "$BRAINBENCH" "$TEST" "$NATIVE_LOCKS" "$PERSISTENCE" "$ADMIN_BROWSER" "$SKILL_COMPATIBILITY"; do
+ for r in "$GITLEAKS" "$SECURITY" "$AUDIT" "$VERIFY" "$SERIAL" "$SLOW_PERF" "$SLOW_BRAINBENCH" "$BRAINBENCH" "$TEST" "$NATIVE_LOCKS" "$PERSISTENCE" "$ADMIN_BROWSER" "$SKILL_COMPATIBILITY"; do
if [ "$r" != "success" ]; then
echo "✗ gated job did not succeed (got $r) — CI fail"
exit 1
diff --git a/scripts/run-verify-parallel.sh b/scripts/run-verify-parallel.sh
index e215943919..073fd0f07a 100755
--- a/scripts/run-verify-parallel.sh
+++ b/scripts/run-verify-parallel.sh
@@ -81,10 +81,11 @@ CHECKS=(
# No-op placeholder assertions (expect(true).toBe(true) and friends) in
# test/**/*.test.ts; TypeScript AST scan, ~3s over the full corpus.
"check:test-placeholders"
- # Chronicle eval: $0, deterministic, exit-0-only-on-perfect (6 gold tasks).
- # Boots its own PGLite — budget ≤60s under a saturated pool; if it breaches
- # ~100s under contention, move it into the serial-tests CI job instead.
- "check:eval-chronicle"
+ # check:eval-chronicle deliberately NOT here (GBRA-47 E7), same reason as
+ # the canary below: test/eval-chronicle.test.ts calls the identical
+ # runChronicleEval in the unit matrix with the same exact 6/6 gate, and a
+ # mutation of getLastSeen fails both owners. The package script remains
+ # for on-demand runs.
# check:eval-canary deliberately NOT here: test/eval-canary.test.ts spawns
# the identical scripts/run-eval-canary.ts in the unit matrix, and in CI the
# verify job and the matrix always run together (same workflow, same cache
diff --git a/scripts/test-shard.sh b/scripts/test-shard.sh
index 10d21c7c04..9fff38a018 100755
--- a/scripts/test-shard.sh
+++ b/scripts/test-shard.sh
@@ -64,21 +64,13 @@ receipts_init unit
# header comment. Local run-unit-shard.sh excludes slow files (different
# policy by design).
#
-# Two test files are pulled out of the matrix and into their own dedicated
-# CI jobs (see .github/workflows/test.yml):
-# - eval-longmemeval-e2e.slow.test.ts (~200s after TODO #1 engine sharing)
-# → job: slow-eval-longmemeval
-# - entity-resolve-perf.slow.test.ts (~159s, single non-subdivisible
-# perf test)
-# → job: slow-entity-resolve-perf
-#
-# Removing both heavy atoms from matrix-eligible files keeps the per-shard
-# total bounded. With 8 matrix shards the per-shard total is ~344s.
-# Dedicated jobs run in parallel so total CI wallclock = max(matrix ~4.5min,
-# slow-eval ~3.3min, slow-entity-resolve-perf ~2.6min, slow-brainbench ~1.5min)
-# ≈ 4.5min. eval-brainbench-e2e was the matrix's heaviest atom (98s mined —
-# 10% of the whole corpus weight) and capped shard-count scaling; it now rides
-# its own job like the other two outliers.
+# Heavy atoms ride dedicated CI jobs (see .github/workflows/test.yml) so no
+# single file dominates a shard: entity-resolve-perf.slow.test.ts (~159s,
+# non-subdivisible) and entity-card-perf → job slow-entity-resolve-perf;
+# eval-brainbench-e2e (98s mined, 10% of the corpus weight) → job
+# slow-brainbench-e2e. eval-longmemeval-e2e.slow.test.ts is back in the matrix
+# (GBRA-47 E6): engine sharing cut it from ~200s to ~8s, under the ~40s
+# keep-in-matrix bar.
# export-scale.slow.test.ts (571s at its 100,001-page master scale) rides the
# slow-entity-resolve-perf job, which sets GBRAIN_TEST_EXPORT_SCALE_PAGES per
# event. reconcile-crash.slow.test.ts (244s) is not duplicated here: the
@@ -92,7 +84,6 @@ receipts_init unit
# docs/TESTING.md "CI vs local: intentionally divergent file sets").
ALL_FILES=$(find test evals -name '*.test.ts' \
-not -name '*.serial.test.ts' \
- -not -name 'eval-longmemeval-e2e.slow.test.ts' \
-not -name 'entity-resolve-perf.slow.test.ts' \
-not -name 'entity-card-perf.slow.test.ts' \
-not -name 'eval-brainbench-e2e.slow.test.ts' \
diff --git a/scripts/test-weights.json b/scripts/test-weights.json
index 817f013670..bb36d83927 100644
--- a/scripts/test-weights.json
+++ b/scripts/test-weights.json
@@ -693,6 +693,7 @@
"test/eval-gate.test.ts": 1565,
"test/eval-longmemeval-brain-recycle.test.ts": 2986,
"test/eval-longmemeval-cli-smoke.test.ts": 2595,
+ "test/eval-longmemeval-e2e.slow.test.ts": 8741,
"test/eval-longmemeval-gateway-routing.test.ts": 7680,
"test/eval-longmemeval-judge.slow.test.ts": 3490,
"test/eval-longmemeval-mixedcase.slow.test.ts": 10824,