Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

CI: the census job also runs the tests that read every file under src/ or test/

garrytan0c0c2e2e7164
diff --git a/CHANGELOG.md b/CHANGELOG.md
index da4f1038b6..78490d6c0d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,7 +16,7 @@ identifiers and attribution are available in the pre-removal Git revision
### Itemized changes
-- `scripts/ci-census-tests.sh` (new) prints the one file list: tests marked `test-reads-source-ok[structural]`, every test that imports `test/helpers/golden`, the tests whose names match its enumeration pattern, and the consumer idle-pass bounds (`test/persistence-consumer-*` files that mention idle). It leaves out `test/e2e/`, serial and slow files, and `test/setup.test.ts`. On master that is 128 files. `--run` runs them all and `--run <k> <n>` runs one weight-balanced shard (`scripts/sharding.ts`).
+- `scripts/ci-census-tests.sh` (new) prints the one file list: tests marked `test-reads-source-ok[structural]`, every test that imports `test/helpers/golden`, the tests whose names match its enumeration pattern, the consumer idle-pass bounds (`test/persistence-consumer-*` files that mention idle), and the tests that read every file under `src/` or `test/` (its `WALKERS` list, such as the source-read smell test). It leaves out `test/e2e/`, serial and slow files, and `test/setup.test.ts`. On master that is 141 files. `--run` runs them all and `--run <k> <n>` runs one weight-balanced shard (`scripts/sharding.ts`).
- `.github/workflows/test.yml`: the `enumeration-census-tests` job runs the list in two shards on 2-vCPU runners, only on pull requests. Trunk Dynamic CI gates it like the other cheap-tier lanes. The `changes` job adds a `census` output that skips a doc-only diff (`scripts/select-e2e.ts --classify-only`), and an unreadable diff still runs the job. `cheap-tier`, `test-status`, `full-suite`, the remote pregate and master-push reuse don't read the job, and `contributor-gate` stays the only required check. On this change's own run the shards took 3 min 40 s and 2 min 47 s, about 6.5 runner-minutes per push.
- `docs/ci-event-parity.md`: new section "Enumeration and census tests" and a classification row.
- Tests: `test/scripts/ci-census-tests.test.ts` (new) pins the list's shape and coverage. `full-ci-workflow` and `native-only-workflow` cover the new job's events and its doc-only skip. The PGLite snapshot cache-key census counts the job's key (16 keys).
diff --git a/docs/ci-event-parity.md b/docs/ci-event-parity.md
index 6b83f322a7..5e3c83f481 100644
--- a/docs/ci-event-parity.md
+++ b/docs/ci-event-parity.md
@@ -105,8 +105,10 @@ bash scripts/ci-census-tests.sh --run 1 2 # run shard 1 of 2, as CI does
The list holds the source censuses (files marked
`test-reads-source-ok[structural]`), every file that imports
`test/helpers/golden`, the files whose names match the enumeration pattern in
-the script, and the consumer idle-pass statement bounds
-(`test/persistence-consumer-*` files that mention idle). It leaves out
+the script, the consumer idle-pass statement bounds
+(`test/persistence-consumer-*` files that mention idle), and the tests that read
+every file under `src/` or `test/`, named in the script's `WALKERS` list (such
+as `test/test-reads-source-smell.test.ts`). It leaves out
`test/e2e/`, serial and slow files, and `test/setup.test.ts`. To add a file,
change the script, not the workflow.
diff --git a/scripts/ci-census-tests.sh b/scripts/ci-census-tests.sh
index 7dbcd9a42f..64d714e5b8 100755
--- a/scripts/ci-census-tests.sh
+++ b/scripts/ci-census-tests.sh
@@ -16,6 +16,7 @@
# - goldens: files that import test/helpers/golden
# - enumeration lists: file names matching ENUMERATION below
# - idle-pass statement bounds: test/persistence-consumer-*.test.ts files that mention idle
+# - tree walkers: tests that read every file under src/ or test/, named in WALKERS below
# minus test/e2e/ (Postgres), *.serial.test.ts and *.slow.test.ts (their own
# full-ci jobs) and test/setup.test.ts (about 7 minutes on its own).
set -euo pipefail
@@ -23,11 +24,14 @@ cd "$(dirname "$0")/.."
ENUMERATION='registry|inventory|catalog|coverage-ledger|operations-|behavior-change-notice|error-|exit-codes|fix-wave-5-integration|repair-explicit-only|cli-flag-validation|allowlist-drift|mcp-tool-defs|cli-flag-equals|remote-privacy-sweep|tool-catalog'
+WALKERS='test-reads-source-smell|canonical-migration-command|db-guard-coverage|env-trust-protected-keys|no-valid-until-write|page-row-deleters-guard|persistence-mode-reader-guard|query-embed-call-sites|readiness-advice-lint|refresh-barrier-state-audit|scripts/serial-files|write-refusals-coverage|scripts/ci-census-tests'
+
list() {
{
git grep -l 'test-reads-source-ok\[structural\]' -- test || true
git grep -l helpers/golden -- test || true
git ls-files test | grep -E "$ENUMERATION" || true
+ git ls-files test | grep -E "$WALKERS" || true
git grep -l -i idle -- 'test/persistence-consumer-*.test.ts' || true
} | grep '\.test\.ts$' | grep -v -E '^test/e2e/|\.(serial|slow)\.test\.ts$|^test/setup\.test\.ts$' | LC_ALL=C sort -u
}
diff --git a/test/scripts/ci-census-tests.test.ts b/test/scripts/ci-census-tests.test.ts
index 5ced7547c0..06b26356ab 100644
--- a/test/scripts/ci-census-tests.test.ts
+++ b/test/scripts/ci-census-tests.test.ts
@@ -28,6 +28,7 @@ describe('ci-census-tests.sh', () => {
'test/cli-flag-equals.test.ts',
'test/remote-privacy-sweep.test.ts',
'test/persistence-consumer-idle.test.ts',
+ 'test/test-reads-source-smell.test.ts',
]) expect(files, file).toContain(file);
const structuralTag = ['test-reads-source', 'ok\\[structural\\]'].join('-');
const structural = spawnSync('git', ['grep', '-l', structuralTag, '--', 'test'], { cwd: root, encoding: 'utf8' }).stdout