Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
ci: run both Bun versions on pull requests and classify every event-conditional behavior
garrytan4b5e3fc15a8e
diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.ymlindex a8bc321604..5ff7f299ca 100644--- a/.github/workflows/e2e.yml+++ b/.github/workflows/e2e.yml@@ -9,6 +9,9 @@ on:# prepare-e2e classifies the queued change from the compare API (base_sha...# head_sha). docs/RELEASING.md#merge-queue.merge_group:+ # Event parity (docs/TESTING.md#event-parity): the concurrency suffix below only+ # separates a full_corpus dispatch; the schedule-only full-corpus lanes are a+ # named exception documented at the coverage pipeline.schedule:- cron: '0 6 * * *' # Nightly at 6am UTCworkflow_dispatch:@@ -150,6 +153,10 @@ jobs:CHANGED_FILES: ${{ github.event.pull_request.changed_files }}BASE_SHA: ${{ github.event.merge_group.base_sha }}HEAD_SHA: ${{ github.event.merge_group.head_sha }}+ # Named exception (docs/TESTING.md#event-parity): a doc-only pull request+ # selects no E2E file; every push to master runs the whole corpus (no+ # PR context, so ci-changed-files.sh fails closed) and the nightly+ # schedule runs the full-corpus lanes.run: |if [ "$FULL_CORPUS" = "true" ]; then# Full-profile coverage carries the complete E2E corpus separately.@@ -646,6 +653,10 @@ jobs:# job compares against the fullCorpus baseline and uploads the trend# artifact. PR runs never pay this cost; the full-profile gate on every job# below is load-bearing.+ # Named exception (docs/TESTING.md#event-parity): the full-corpus coverage+ # lanes and their e2e-status checks run on the nightly E2E schedule (and an+ # explicit full_corpus dispatch); pull requests run every E2E file through+ # Selected E2E instead.# ──────────────────────────────────────────────────────────────────────coverage-full-unit:if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.full_corpus)@@ -687,6 +698,7 @@ jobs:overwrite: truecoverage-full-serial:+ # Named exception: nightly E2E schedule only (docs/TESTING.md#event-parity).if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.full_corpus)runs-on: ubicloud-standard-8-ubuntu-2404timeout-minutes: 30@@ -721,6 +733,7 @@ jobs:overwrite: truecoverage-full-slow:+ # Named exception: nightly E2E schedule only (docs/TESTING.md#event-parity).if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.full_corpus)runs-on: ubicloud-standard-4-ubuntu-2404timeout-minutes: 35@@ -756,6 +769,7 @@ jobs:overwrite: truecoverage-full-e2e:+ # Named exception: nightly E2E schedule only (docs/TESTING.md#event-parity).if: github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.full_corpus)runs-on: ubicloud-standard-4-ubuntu-2404timeout-minutes: 60@@ -859,6 +873,7 @@ jobs:coverage-full-report:needs: [coverage-full-unit, coverage-full-serial, coverage-full-slow, coverage-full-e2e]+ # Named exception: nightly E2E schedule only (docs/TESTING.md#event-parity).if: always() && (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.full_corpus))runs-on: ubicloud-standard-4-ubuntu-2404timeout-minutes: 15@@ -952,6 +967,8 @@ jobs:# The stable aggregate includes full-profile execution lanes when requested.# Coverage reporting itself remains advisory; failed tests never do.+ # Named exception (docs/TESTING.md#event-parity): FULL_CORPUS adds the+ # full-corpus lanes to the aggregate on the nightly schedule only.e2e-status:needs: [jsonb-parity, tier1, tier1-backend-matrix, tier2, prepare-e2e, selected-e2e, coverage-full-unit, coverage-full-serial, coverage-full-slow, coverage-full-e2e]if: always()diff --git a/.github/workflows/heavy-tests.yml b/.github/workflows/heavy-tests.ymlindex 499d6a7d72..dcbd66deca 100644--- a/.github/workflows/heavy-tests.yml+++ b/.github/workflows/heavy-tests.yml@@ -44,6 +44,8 @@ jobs:# label. Works for all three trigger types (labeled, synchronize, reopened)# because `contains(labels.*.name, ...)` reads the live label set, not the# event payload's `label.name` (which is only populated for `labeled`).+ # Named exception (docs/TESTING.md#event-parity): label-gated on pull requests;+ # the nightly Heavy Tests schedule and manual dispatch always run it.if: |github.event_name != 'pull_request' ||contains(github.event.pull_request.labels.*.name, 'heavy-tests')@@ -140,6 +142,8 @@ jobs:# the PR shard matrix.real-agent-e2e:name: Real-agent door e2e (live claude + codex when keyed)+ # Named exception (docs/TESTING.md#event-parity): label-gated on pull requests;+ # the nightly Heavy Tests schedule and manual dispatch always run it.if: |github.event_name != 'pull_request' ||contains(github.event.pull_request.labels.*.name, 'real-agent-e2e') ||@@ -250,6 +254,8 @@ jobs:# empty ANTHROPIC_API_KEY secret is a visible, tracked skip (Preconditions).hermes-door:name: Hermes door e2e (credentialed, real binary, loud-fail)+ # Named exception (docs/TESTING.md#event-parity): label-gated on pull requests;+ # the nightly Heavy Tests schedule and manual dispatch always run it.if: |github.event_name != 'pull_request' ||contains(github.event.pull_request.labels.*.name, 'real-agent-e2e') ||@@ -483,6 +489,8 @@ jobs:# stays deterministic while the canary tracks what users actually run.grok-door:name: Grok door e2e (real binary, keyless-first)+ # Named exception with a recorded decision (docs/TESTING.md#event-parity): no+ # covering scheduled run until the XAI_API_KEY secret exists (posture above).if: |(github.event_name == 'pull_request' &&contains(github.event.pull_request.labels.*.name, 'real-agent-e2e')) ||@@ -721,6 +729,8 @@ jobs:# weight.plugin-doors:name: Plugin doors (codex + claude, install tier)+ # Named exception (docs/TESTING.md#event-parity): label-gated on pull requests;+ # the nightly Heavy Tests schedule and manual dispatch always run it.if: |github.event_name != 'pull_request' ||contains(github.event.pull_request.labels.*.name, 'heavy-tests')@@ -797,6 +807,8 @@ jobs:#opencode-door:name: opencode door e2e (${{ matrix.lane }})+ # Named exception (docs/TESTING.md#event-parity): label-gated on pull requests;+ # the nightly Heavy Tests schedule and manual dispatch always run it.if: |github.event_name != 'pull_request' ||contains(github.event.pull_request.labels.*.name, 'real-agent-e2e') ||@@ -1024,6 +1036,8 @@ jobs:# (OPENCODE-CLI-PIN.md §Pin-refresh cadence), never a gate.opencode-door-canary:name: opencode door canary (latest, keyless, non-gating)+ # Named exception (docs/TESTING.md#event-parity): a schedule-only, non-gating+ # canary of the latest opencode; the pinned door lane above is the gate.if: github.event_name == 'schedule'runs-on: ubicloud-standard-16-ubuntu-2404timeout-minutes: 20diff --git a/.github/workflows/macos-validation.yml b/.github/workflows/macos-validation.ymlindex d949c60d38..94759757cd 100644--- a/.github/workflows/macos-validation.yml+++ b/.github/workflows/macos-validation.yml@@ -35,6 +35,8 @@ concurrency:jobs:macos-26:name: macOS 26 validation+ # Named exception (docs/TESTING.md#event-parity): label-gated on pull requests;+ # the nightly macOS validation schedule and manual dispatch always run it.if: |github.event_name != 'pull_request' ||contains(github.event.pull_request.labels.*.name, 'macos-validation')diff --git a/.github/workflows/native-locks.yml b/.github/workflows/native-locks.ymlindex 85444f86d1..75a1ed99a2 100644--- a/.github/workflows/native-locks.yml+++ b/.github/workflows/native-locks.yml@@ -8,6 +8,10 @@ on:# native, lock, IPC, publication, backup, export or sync paths).# smoke: the Linux x64 glibc cell on the primary Bun version (other PRs).# scripts/ci-native-scope.sh classifies pull requests.+ # Named exception (docs/TESTING.md#event-parity): every `inputs.scope`+ # condition below (the openclaw/musl/Windows `if`s and the Bun 1.4.0 and+ # cross-target excludes) narrows pull requests and merge-queue runs only;+ # every push to master and the nightly Test schedule run scope=full.scope:type: stringdefault: full@@ -18,6 +22,7 @@ permissions:jobs:openclaw:name: OpenClaw 2026.9.4 native context-engine startup+ # Named exception: PR scope reduction, covered by scope=full runs (docs/TESTING.md#event-parity).if: ${{ inputs.scope != 'smoke' }}runs-on: ubicloud-standard-4-ubuntu-2404timeout-minutes: 10@@ -63,6 +68,7 @@ jobs:target: [linux-x64-glibc, linux-arm64-glibc, darwin-arm64, darwin-x64, win32-x64, win32-arm64]# Pull requests: primary Bun on every target (native paths changed) or# the Linux x64 glibc smoke cell. Runners map from the target above.+ # Named exception: PR scope reduction, covered by scope=full runs (docs/TESTING.md#event-parity).exclude: ${{ fromJSON(inputs.scope == 'full' && '[]' || inputs.scope == 'primary' && '[{"bun":"1.4.0"}]' || '[{"bun":"1.4.0"},{"target":"linux-arm64-glibc"},{"target":"darwin-arm64"},{"target":"darwin-x64"},{"target":"win32-x64"},{"target":"win32-arm64"}]') }}steps:- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262@@ -112,6 +118,7 @@ jobs:windows-backup-console:name: Windows PowerShell console probe / ${{ matrix.runner }} / Bun ${{ matrix.bun }}+ # Named exception: PR scope reduction, covered by scope=full runs (docs/TESTING.md#event-parity).if: ${{ inputs.scope != 'smoke' }}runs-on: ${{ matrix.runner }}timeout-minutes: 5@@ -120,6 +127,7 @@ jobs:matrix:runner: [windows-2022, windows-11-arm]bun: ['1.4.0', '1.4.2']+ # Named exception: PR scope reduction, covered by scope=full runs (docs/TESTING.md#event-parity).exclude: ${{ fromJSON(inputs.scope == 'full' && '[]' || '[{"bun":"1.4.0"}]') }}steps:- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262@@ -139,6 +147,7 @@ jobs:windows-backup-dotnet:name: Windows ACL API probe / ${{ matrix.runner }} / Bun ${{ matrix.bun }}+ # Named exception: PR scope reduction, covered by scope=full runs (docs/TESTING.md#event-parity).if: ${{ inputs.scope != 'smoke' }}runs-on: ${{ matrix.runner }}timeout-minutes: 5@@ -147,6 +156,7 @@ jobs:matrix:runner: [windows-2022, windows-11-arm]bun: ['1.4.0', '1.4.2']+ # Named exception: PR scope reduction, covered by scope=full runs (docs/TESTING.md#event-parity).exclude: ${{ fromJSON(inputs.scope == 'full' && '[]' || '[{"bun":"1.4.0"}]') }}steps:- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262@@ -167,6 +177,7 @@ jobs:musl:name: ${{ matrix.target }} / Bun ${{ matrix.bun }}+ # Named exception: PR scope reduction, covered by scope=full runs (docs/TESTING.md#event-parity).if: ${{ inputs.scope != 'smoke' }}runs-on: ${{ fromJSON('{"linux-x64-musl":"ubicloud-standard-4-ubuntu-2404","linux-arm64-musl":"ubicloud-standard-4-arm-ubuntu-2404"}')[matrix.target] }}timeout-minutes: 15@@ -175,6 +186,7 @@ jobs:matrix:bun: ['1.4.0', '1.4.2']target: [linux-x64-musl, linux-arm64-musl]+ # Named exception: PR scope reduction, covered by scope=full runs (docs/TESTING.md#event-parity).exclude: ${{ fromJSON(inputs.scope == 'full' && '[]' || '[{"bun":"1.4.0"}]') }}steps:- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262diff --git a/.github/workflows/osv-scanner.yml b/.github/workflows/osv-scanner.ymlindex 49d2181fa6..5ca28af265 100644--- a/.github/workflows/osv-scanner.yml+++ b/.github/workflows/osv-scanner.yml@@ -7,6 +7,9 @@ name: OSV-Scanner# so the workflow stays read-only (no security-events: write).on:+ # Named exception (docs/TESTING.md#event-parity): pull requests scan only when a+ # dependency manifest changes; the weekly schedule scans every run, and+ # test.yml's dependency-audit covers every pull request.pull_request:branches: [master]paths:diff --git a/.github/workflows/persistence-validation.yml b/.github/workflows/persistence-validation.ymlindex 7df2d223e5..6b74bca089 100644--- a/.github/workflows/persistence-validation.yml+++ b/.github/workflows/persistence-validation.yml@@ -17,9 +17,8 @@ jobs:matrix:engine: [pglite, postgres]bun: ['1.4.0', '1.4.2']- # Pull requests run the primary Bun version; pushes, schedules and- # manual runs keep every supported version.- exclude: ${{ fromJSON((github.event_name == 'pull_request' || github.event_name == 'merge_group') && '[{"bun":"1.4.0"}]' || '[]') }}+ # Event parity: every event, pull requests and merge-queue runs+ # included, runs both supported Bun versions (docs/TESTING.md#event-parity).services:postgres:image: pgvector/pgvector:pg16@@ -58,9 +57,8 @@ jobs:fail-fast: falsematrix:bun: ['1.4.0', '1.4.2']- # Pull requests run the primary Bun version; pushes, schedules and- # manual runs keep every supported version.- exclude: ${{ fromJSON((github.event_name == 'pull_request' || github.event_name == 'merge_group') && '[{"bun":"1.4.0"}]' || '[]') }}+ # Event parity: every event, pull requests and merge-queue runs+ # included, runs both supported Bun versions (docs/TESTING.md#event-parity).services:postgres:image: pgvector/pgvector:pg16@@ -176,9 +174,8 @@ jobs:matrix:shard: [1, 2]bun: ['1.4.0', '1.4.2']- # Pull requests run the primary Bun version; pushes, schedules and- # manual runs keep every supported version.- exclude: ${{ fromJSON((github.event_name == 'pull_request' || github.event_name == 'merge_group') && '[{"bun":"1.4.0"}]' || '[]') }}+ # Event parity: every event, pull requests and merge-queue runs+ # included, runs both supported Bun versions (docs/TESTING.md#event-parity).services:postgres:image: pgvector/pgvector:pg16@@ -241,9 +238,8 @@ jobs:matrix:engine: [pglite, postgres]bun: ['1.4.0', '1.4.2']- # Pull requests run the primary Bun version; pushes, schedules and- # manual runs keep every supported version.- exclude: ${{ fromJSON((github.event_name == 'pull_request' || github.event_name == 'merge_group') && '[{"bun":"1.4.0"}]' || '[]') }}+ # Event parity: every event, pull requests and merge-queue runs+ # included, runs both supported Bun versions (docs/TESTING.md#event-parity).services:postgres:image: pgvector/pgvector:pg16@@ -261,8 +257,9 @@ jobs:with:bun-version: ${{ matrix.bun }}- run: bun install --frozen-lockfile --ignore-scripts- # Pull requests run a 2,500-write soak; pushes to master and manual runs keep- # the full 10,000-write gate, whose PGLite run alone takes 15-28 minutes.+ # Named exception (docs/TESTING.md#event-parity): pull requests and merge-queue+ # runs soak 2,500 writes; pushes to master, the nightly Test schedule and manual+ # runs cover the full 10,000-write gate, whose PGLite run alone takes 15-28 minutes.- name: Execute 1000 schedules, eight SIGKILL boundaries and the process-separated write soakenv:DATABASE_URL: postgres://gbrain_test:[email protected]:5432/gbrain_test@@ -294,9 +291,8 @@ jobs:matrix:engine: [pglite, postgres]bun: ['1.4.0', '1.4.2']- # Pull requests run the primary Bun version; pushes, schedules and- # manual runs keep every supported version.- exclude: ${{ fromJSON((github.event_name == 'pull_request' || github.event_name == 'merge_group') && '[{"bun":"1.4.0"}]' || '[]') }}+ # Event parity: every event, pull requests and merge-queue runs+ # included, runs both supported Bun versions (docs/TESTING.md#event-parity).services:postgres:image: pgvector/pgvector:pg16@@ -328,6 +324,9 @@ jobs:bun-version: ${{ matrix.bun }}- run: bun install --frozen-lockfile --ignore-scripts# The service password reaches every client through PGPASSWORD, so the URLs carry none.+ # Named exception (docs/TESTING.md#event-parity): ROBOT_SECONDS is 150 on pull+ # requests and merge-queue runs; pushes to master, the nightly Test schedule and+ # manual runs cover the 600 s budget that crashes every seam.- name: Crash every reachable seam of the generated sequencesenv:PGPASSWORD: gbrain_test@@ -369,9 +368,8 @@ jobs:matrix:engine: [pglite, postgres]bun: ['1.4.0', '1.4.2']- # Pull requests run the primary Bun version; pushes, schedules and- # manual runs keep every supported version.- exclude: ${{ fromJSON((github.event_name == 'pull_request' || github.event_name == 'merge_group') && '[{"bun":"1.4.0"}]' || '[]') }}+ # Event parity: every event, pull requests and merge-queue runs+ # included, runs both supported Bun versions (docs/TESTING.md#event-parity).services:postgres:image: pgvector/pgvector:pg16diff --git a/.github/workflows/scale-tier.yml b/.github/workflows/scale-tier.ymlindex 0744a7cb02..1727e8da44 100644--- a/.github/workflows/scale-tier.yml+++ b/.github/workflows/scale-tier.yml@@ -41,6 +41,7 @@ permissions:# A label other than scale-tier gets its own group, so labelling a pull# request never cancels a scale run already in progress.+# Event parity (docs/TESTING.md#event-parity): the suffixes only separate runs.concurrency:group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}${{ github.event_name == 'schedule' && '-nightly' || '' }}${{ github.event.action == 'labeled' && github.event.label.name != 'scale-tier' && format('-label-{0}', github.run_id) || '' }}cancel-in-progress: true@@ -60,6 +61,7 @@ jobs:- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4with:sparse-checkout: scripts/scale+ # Event parity: Bun is needed only by the schedule's trend planner below.- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2if: github.event_name == 'schedule'with:@@ -82,6 +84,9 @@ jobs:paths='^(src/core/engine-sql/|src/core/search/|src/core/import-file\.ts$|src/commands/import\.ts$|src/commands/sync/|src/core/sync[^/]*\.ts$|src/core/persistence/sync-[^/]*\.ts$|src/commands/doctor/|src/core/pglite-engine\.ts$|src/core/postgres-engine\.ts$|src/schema\.sql$|src/core/schema-migrations/|scripts/scale/|\.github/workflows/scale-tier\.yml$)'run=falsepages='[10000]'+ # Named exception (docs/TESTING.md#event-parity): pull requests run 10k pages+ # only when they touch the paths above or carry the label; the nightly+ # Scale tier schedule covers 10k-50k on both engines.case "$EVENT" inworkflow_dispatch)if ! [[ "$PAGES_INPUT" =~ ^[0-9]+$ ]] || [ "$PAGES_INPUT" -lt 20 ]; thendiff --git a/.github/workflows/semgrep.yml b/.github/workflows/semgrep.ymlindex 2fd6009da3..4db63b5627 100644--- a/.github/workflows/semgrep.yml+++ b/.github/workflows/semgrep.yml@@ -19,12 +19,15 @@ on:permissions:contents: read+# Event parity (docs/TESTING.md#event-parity): grouping only.concurrency:group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}cancel-in-progress: truejobs:semgrep:+ # Named exception (docs/TESTING.md#event-parity): pull requests gate on findings+ # new since the merge base; the weekly full-tree scan below covers the rest.if: github.event_name == 'pull_request'runs-on: ubicloud-standard-4-ubuntu-2404timeout-minutes: 20@@ -55,6 +58,7 @@ jobs:semgrep scan --config p/default --config p/typescript --error --baseline-commit "$BASELINE"semgrep-full:+ # Named exception (docs/TESTING.md#event-parity): the weekly schedule and dispatch.if: github.event_name != 'pull_request'runs-on: ubicloud-standard-4-ubuntu-2404timeout-minutes: 20diff --git a/.github/workflows/test.yml b/.github/workflows/test.ymlindex af072997f6..104cad5e7b 100644--- a/.github/workflows/test.yml+++ b/.github/workflows/test.yml@@ -15,6 +15,8 @@ on:# on-demand runners from ANY branch (see scripts/ship-remote-tests.sh).# Frees a load-saturated local machine (e.g. many Conductor agents running# their own bun-test suites at once — load avg 120 on 16 cores).+ # Dispatch inputs select manual modes only; they never apply to pull_request,+ # merge_group, push or schedule events (docs/TESTING.md#event-parity).workflow_dispatch:inputs:native_only:@@ -32,6 +34,8 @@ permissions:# github.ref for push/scheduled runs. Mirrors heavy-tests.yml; frees runners# and stops a stale-SHA run from reporting a flaky failure on an obsolete commit.# Explicit native-only retries use a separate group so full persistence soaks finish.+# Event parity (docs/TESTING.md#event-parity): the event suffixes only separate+# runs that must not cancel each other; they change no job, matrix or parameter.concurrency:group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}${{ github.event_name == 'workflow_dispatch' && inputs.native_only == true && '-native-only' || '' }}${{ github.event_name == 'schedule' && '-nightly' || '' }}cancel-in-progress: true@@ -41,6 +45,10 @@ jobs:# native, lock, IPC, publication, backup, export or sync paths run every# native target on the primary Bun version; other pull requests run the Linux# x64 smoke cell. Pushes, schedules and manual runs always run the full matrix.+ # Named exception (docs/TESTING.md#event-parity): the native-locks scope+ # reduction on pull requests and merge-queue runs (Bun 1.4.0 and cross-target+ # cells) is covered by every push to master and the nightly Test schedule,+ # which both run scope=full.changes:runs-on: ubicloud-standard-2-ubuntu-2404timeout-minutes: 5@@ -131,6 +139,8 @@ jobs:gitleaks version- name: Verify scanner detects secrets outside exact fixture exceptionsrun: bash scripts/test-gitleaks-config.sh+ # Event parity (docs/TESTING.md#event-parity): every event scans the commit+ # range it introduces.- name: Scan for secrets (gitleaks CLI, .gitleaks.toml)run: |set -euo pipefail@@ -157,9 +167,9 @@ jobs:matrix:os: [ubuntu-latest, macos-26, windows-latest]bun: ['1.4.0', '1.4.2']- # Pull requests run the primary Bun version on every OS; pushes,- # schedules and manual runs add the oldest supported version.- exclude: ${{ fromJSON((github.event_name == 'pull_request' || github.event_name == 'merge_group') && '[{"bun":"1.4.0"}]' || '[]') }}+ # Event parity: every event, pull requests and merge-queue runs+ # included, runs both supported Bun versions on every OS+ # (docs/TESTING.md#event-parity).steps:- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2@@ -180,6 +190,11 @@ jobs:# package.json dependency field (or carry the `dependency-audit` label).# Elsewhere a new upstream advisory is a warning, so it cannot turn every# open PR red at once; the push and nightly runs still fail on it (B11).+ # Named exception with its rule (docs/TESTING.md#dependency-audit-rule): a+ # push-to-master red from a newly published advisory opens the Test master-red+ # issue and a scheduled red the nightly-red issue; the repair PR bumps,+ # overrides, patches or removes the dependency; when no fix exists, an+ # expiring ignore entry needs Garry's approval.dependency-audit:if: ${{ github.event_name != 'workflow_dispatch' || inputs.native_only != true }}runs-on: ubicloud-standard-2-ubuntu-2404@@ -565,6 +580,8 @@ jobs:# Export at scale: pull requests prove bounded keyset enumeration, sidecars# and fence normalization on 10,001 pages (~30s); pushes, schedules and# manual runs keep the 100,001-page scale (~4-10 minutes, one core).+ # Named exception (docs/TESTING.md#event-parity): covered by every push to+ # master and the nightly Test schedule.- run: bash scripts/run-with-receipt.sh slow export-scale -- bun test test/export-scale.slow.test.ts --timeout=900000 --coverage --coverage-reporter=lcov --coverage-dir=${{ runner.temp }}/coverage/perf-cenv:GBRAIN_TEST_EXPORT_SCALE_PAGES: ${{ (github.event_name == 'pull_request' || github.event_name == 'merge_group') && '10001' || '100001' }}diff --git a/docs/TESTING.md b/docs/TESTING.mdindex d09880a4ad..4aa9339c5b 100644--- a/docs/TESTING.md+++ b/docs/TESTING.md@@ -80,13 +80,16 @@ the decision rule is critical path first, vCPU-minutes second.Every test file runs on every push to master, on the nightly schedule and onmanual dispatch. Pull requests and merge-queue runs (`merge_group`, which use-the PR profile) run a narrower matrix of the same files:+the PR profile) run every Bun-version cell of the security and persistence+matrices too; only the rows below are narrower, each a named exception in+[Event parity](#event-parity):| Lane | Pull request | Push to master, nightly, manual || --- | --- | --- |-| Security regressions | Linux, macOS and Windows on Bun 1.4.2 | Also Bun 1.4.0 |-| Persistence read latency, deployment matrix, soak, reconciliation crashes | Bun 1.4.2 | Bun 1.4.0 and 1.4.2 |+| Security regressions | Linux, macOS and Windows on Bun 1.4.0 and 1.4.2 | Same |+| Persistence read latency, deployment matrix, unit-lane PostgreSQL arms, soak, crash robot, reconciliation crashes | Bun 1.4.0 and 1.4.2 | Same || Persistence soak size | 2,500 writes | 10,000 writes |+| Crash robot budget | 150 s (Postgres skips the lease-waiting seams) | 600 s, every seam || Native writer locks, native paths changed | Every target on Bun 1.4.2, musl, both Windows probes, OpenClaw | Every target, musl and Windows probe on Bun 1.4.0 and 1.4.2, OpenClaw || Native writer locks, other changes | `linux-x64-glibc / Bun 1.4.2` smoke cell (full native step list) | Same as above || `test/export-scale.slow.test.ts` | 10,001 pages | 100,001 pages |@@ -123,6 +126,73 @@ legacy test configuration; ordinary resets preserve that identity.Shared-skills suites, the old-binary compatibility job and the lifecycle benchmark are described in[scripts/shared-skills/README.md](../scripts/shared-skills/README.md#tests-and-ci).+### Event parity++A red that only a push to master can produce is a red no PR could have+caught. So every event-conditional behavior in the workflows is either+parity (pull requests and merge-queue runs do the same work) or a named+exception whose comment, beside the condition, names the scheduled run that+covers it. A condition with no covering scheduled run defaults to parity;+anything else needs a new scheduled run or a decision recorded beside the+condition. `test/scripts/ci-pr-scope.test.ts` fails on an event-conditional+job or block in a test workflow without that comment, and on a Bun-version+cell excluded on any event. Required checks stay keyed on the `test-status`+and `e2e-status` aggregators, never on per-cell matrix names.++| Workflow | Condition | Class | Covered by |+| --- | --- | --- | --- |+| `test.yml` | `security-regressions` Bun matrix | Parity: both Bun versions on every OS, every event | — |+| `test.yml` | `changes` native scope (`smoke`/`primary`/`full`) | Named exception | Every push to master and the nightly Test schedule (`full`) |+| `test.yml` | `gitleaks` commit range by event | Parity: each event scans the range it introduces | — |+| `test.yml` | `dependency-audit` blocking scope | Named exception with a rule ([below](#dependency-audit-rule)) | Every push to master and the nightly Test schedule (always blocking) |+| `test.yml` | `export-scale` pages, 10,001 vs 100,001 | Named exception | Every push to master and the nightly Test schedule |+| `test.yml` | `stress-changed-tests` file set | Named exception: PR-only gate; succeeds with "not a PR event" elsewhere | Push and nightly runs run every file; the nightly race hunt repeats the Postgres arms |+| `test.yml` | `race-hunt` | Named exception: schedule and dispatch only, outside `test-status` | Itself (nightly Test schedule) |+| `test.yml` | `native_only`, `race_hunt`, `stress_*` dispatch inputs; concurrency suffixes | Parity: manual modes and run grouping, never applied to PR, push or schedule events | — |+| `persistence-validation.yml` | Bun matrix of read latency, deployment matrix, unit-lane PostgreSQL arms, soak, crash robot, reconciliation | Parity: both Bun versions on every event | — |+| `persistence-validation.yml` | `SOAK_OPERATIONS` 2,500 vs 10,000 | Named exception | Every push to master and the nightly Test schedule |+| `persistence-validation.yml` | `ROBOT_SECONDS` 150 vs 600 | Named exception | Every push to master and the nightly Test schedule |+| `native-locks.yml` | `inputs.scope` (OpenClaw, musl, Windows probes, Bun 1.4.0 and cross-target cells) | Named exception | Every push to master and the nightly Test schedule (`full`) |+| `e2e.yml` | Doc-only pull request selects no E2E file | Named exception | Every push to master (whole corpus) and the nightly E2E schedule |+| `e2e.yml` | Full-corpus coverage lanes and their `e2e-status` checks | Named exception | Nightly E2E schedule (or a `full_corpus` dispatch) |+| `heavy-tests.yml` | Label-gated jobs on pull requests | Named exception | Nightly Heavy Tests schedule |+| `heavy-tests.yml` | `grok-door` (label or input only) | Recorded decision: no scheduled run until the `XAI_API_KEY` secret exists | None yet, by decision |+| `heavy-tests.yml` | `opencode-door-canary` | Named exception: schedule-only, non-gating canary | Itself |+| `macos-validation.yml` | Label-gated on pull requests | Named exception | Nightly macOS validation schedule |+| `scale-tier.yml` | Path- or label-gated 10k on pull requests | Named exception | Nightly Scale tier schedule (10k-50k) |+| `semgrep.yml` | PR diff scan vs full-tree scan | Named exception | Weekly Semgrep schedule |+| `osv-scanner.yml` | Pull requests scan only on a manifest change | Named exception | Weekly OSV schedule; `dependency-audit` on every PR |+| `nightly-watch.yml` | `workflow_run` event guard | Not a test scope: it files issues from qualifying scheduled and push-to-master runs | — |+| `fix-wave-gate.yml`, `fix-wave-closeout.yml` | Pull-request action and merge state | Not a test scope: merge-process automation | — |++#### Dependency-audit rule++`dependency-audit` blocks on pushes, schedules, manual runs and pull requests+or merge-queue entries that change a dependency manifest or carry the+`dependency-audit` label; on other pull requests a new upstream advisory is a+warning, so one published advisory cannot turn every open PR red at once.+The red it produces lands on master instead, and is handled like any other:+a push-to-master red opens the Test `master-red` issue, a scheduled red the+`nightly-red` issue. The repair PR bumps, overrides, patches or removes the+dependency. When no fix exists, an ignore entry needs Garry's approval and an+expiry date.++#### Cost of parity++Measured from the 15 latest green pull-request Test runs before parity (job+start to finish, PR parameters): the Bun 1.4.0 twins add 14 cells per+`pull_request` run, 55.9 runner-minutes in total: 233 Ubicloud vCPU-minutes+(the two unit-lane PostgreSQL arm shards, 19.8 minutes, are the largest share)+and 2.4 GitHub-hosted minutes (macOS 0.9, Windows 1.5). At the week's 713+completed PR runs that is about 40,000 runner-minutes a week. Wall time does+not grow on an idle pool: on the 10 latest push runs, which already run both+versions, the 1.4.0 cells finished between 2.6 minutes before and 2.1 minutes+after every other job (median 0.1 minutes before), and the PR critical path+stays the unit `test` shards (median 13.9 minutes). A `merge_group` run uses+the same profile and costs the same per run; the merge queue is inert, so it+adds nothing today. If the added median PR wall time exceeds 15 minutes over+a week, the agent on release duty records it on the CI health issue.+### Executed-test receiptsA green job proves only that nothing failed; receipts prove which tests ran.diff --git a/test/scripts/ci-pr-scope.test.ts b/test/scripts/ci-pr-scope.test.tsindex d54a32a0a0..d2ebbc47c0 100644--- a/test/scripts/ci-pr-scope.test.ts+++ b/test/scripts/ci-pr-scope.test.ts@@ -150,22 +150,55 @@ esac} finally { rmSync(dir, { recursive: true, force: true }); }});- test('security and persistence matrices drop only the oldest Bun version on pull requests and merge-queue runs', () => {- const queue = { github: { event_name: 'merge_group' } };- const pr = { github: { event_name: 'pull_request' } };- const push = { github: { event_name: 'push' } };+ test('security and persistence matrices run both supported Bun versions on pull requests and merge-queue runs (event parity)', () => {const security = load('test.yml').jobs['security-regressions'];- expect(cells(security, push)).toHaveLength(6);- expect(cells(security, pr)).toEqual(['ubuntu-latest/1.4.2', 'macos-26/1.4.2', 'windows-latest/1.4.2']);- expect(cells(security, queue)).toEqual(cells(security, pr));const persistence = load('persistence-validation.yml').jobs;- for (const name of ['read-performance', 'deployment-matrix', 'invariants', 'reconciliation']) {- const full = cells(persistence[name], push);- const primary = cells(persistence[name], pr);- expect(full.filter(cell => cell.endsWith(MINIMUM_BUN_VERSION)).length, name).toBe(full.length / 2);- expect(primary, name).toEqual(full.filter(cell => cell.endsWith('1.4.2')));- expect(cells(persistence[name], queue), name).toEqual(primary);+ const jobs = [security, ...['read-performance', 'deployment-matrix', 'unit-postgres-arms', 'invariants', 'crash-robot', 'reconciliation'].map(name => persistence[name]!)];+ for (const job of jobs) {+ expect(job.strategy!.matrix.exclude).toBeUndefined();+ const push = cells(job, { github: { event_name: 'push' }, inputs: {} });+ for (const event_name of ['pull_request', 'merge_group', 'schedule', 'workflow_dispatch']) {+ expect(cells(job, { github: { event_name }, inputs: {} })).toEqual(push);+ }+ expect(push.filter(cell => cell.split('/').includes(MINIMUM_BUN_VERSION)).length).toBe(push.length / 2);+ }+ expect(cells(security, { github: { event_name: 'pull_request' }, inputs: {} })).toHaveLength(6);+ });++ // Every event-conditional behavior in a test workflow is classified beside+ // the condition: parity, or a named exception naming its covering scheduled+ // run (docs/TESTING.md#event-parity). The native_only dispatch mode is the+ // documented manual mode and is stripped before scanning.+ test('every event-conditional job or block in a test workflow carries its event-parity classification', () => {+ const conditional = /github\.event_name|github\.event\.(?:pull_request|merge_group|action)|inputs\.scope|"\$EVENT"|\$EVENT\b/;+ const dispatchMode = /github\.event_name\s*(?:!=|==)\s*'workflow_dispatch'\s*(?:\|\||&&)\s*inputs\.native_only\s*(?:!=|==)\s*true/g;+ const unclassified: string[] = [];+ for (const name of ['test', 'persistence-validation', 'native-locks', 'e2e', 'heavy-tests', 'macos-validation', 'scale-tier', 'semgrep']) {+ const lines = readFileSync(join(root, '.github/workflows', `${name}.yml`), 'utf8').split('\n');+ // Blocks: each job (from the comments directly above its key to the next job) and the top-level preamble.+ const starts = lines.flatMap((line, i) => (/^ [\w-]+:\s*$/.test(line) && lines.slice(0, i).some(l => l === 'jobs:') ? [i] : []));+ const blocks: Array<{ label: string; from: number; to: number }> = [];+ const commentTop = (i: number) => { let j = i; while (j > 0 && /^\s*#/.test(lines[j - 1]!)) j--; return j; };+ const jobsLine = lines.indexOf('jobs:');+ blocks.push({ label: 'top level', from: 0, to: jobsLine });+ starts.forEach((start, k) => blocks.push({ label: lines[start]!.trim(), from: commentTop(start), to: k + 1 < starts.length ? commentTop(starts[k + 1]!) : lines.length }));+ for (const block of blocks) {+ const text = lines.slice(block.from, block.to);+ const code = text.filter(l => !/^\s*#/.test(l)).join('\n').replace(dispatchMode, '');+ if (!conditional.test(code)) continue;+ if (!text.some(l => /^\s*#.*docs\/TESTING\.md#(?:event-parity|dependency-audit-rule)/.test(l) || /^\s*#\s*Event parity/.test(l))) unclassified.push(`${name}.yml › ${block.label}`);+ }+ }+ expect(unclassified).toEqual([]);+ });++ test('the docs event-parity table lists every classified workflow', () => {+ const docs = readFileSync(join(root, 'docs/TESTING.md'), 'utf8');+ const section = docs.slice(docs.indexOf('### Event parity'), docs.indexOf('\n### ', docs.indexOf('### Event parity') + 5));+ for (const name of ['test', 'persistence-validation', 'native-locks', 'e2e', 'heavy-tests', 'macos-validation', 'scale-tier', 'semgrep', 'osv-scanner', 'nightly-watch']) {+ expect(section, name).toContain(`${name}.yml`);}+ expect(docs).toContain('#### Dependency-audit rule');});test('export scale runs 10,001 pages on pull requests and 100,001 everywhere else', () => {