Repository navigation
Description
pnpm check is the gate every change passes, and on #1922 it was paid six times. Only two of
those runs failed on the change itself. The rest were the gate's own mechanics, and three of the
four causes below are fixable in the repo.
Measured on fix/instrument-repo-sync-reporting (v2.6.0 + the branch), one developer machine:
| Tier | Time | Cached |
|---|---|---|
pnpm lint, 34 tasks |
1m25s | yes |
pnpm test:coverage, 456 files |
~3m | yes |
pnpm test:e2e, 415 specs, 1 worker |
17m24s | no |
full pnpm check, cold |
~22m |
CI's lint-and-test took 22m, 23m and 25m on the same branch, so a local run buys no time over
pushing — it only avoids the round trip.
1. test:e2e carries cache: false, so it is 80% of the gate and never skipped
turbo.json sets "cache": false on test:e2e. Every pnpm check pays the full 17 minutes even
when the diff cannot reach a spec — a docs-only or schema-only change included. Nothing else in the
pipeline is uncacheable, so the practical cost of re-running the gate after any review comment is
one fixed 17-minute block.
The suite needs real servers and a database, which is presumably why it opted out. Whether that
rules out caching is the question: Playwright is deterministic given the same inputs, and the task
could declare inputs (the specs, apps/{api,gateway,web}'s sources, .env) and cache on them.
If it genuinely cannot be cached, the alternative is to stop asking developers to run it: make
pnpm check lint + coverage, and let CI own the full suite.
2. runtime-core's own lint races its own build, and lib/** is not a declared output
Two turbo.json facts combine into a cold-cache failure:
lintdeclaresdependsOn: ["^build", "^db:generate", "db:push"].^buildis topological — the
dependencies' builds. A package's ownbuildis not ordered before its ownlint.builddeclaresoutputs: ["dist/**"], butpackages/runtime-core'sbuildscript is
rm -rf dist lib && pnpm build:lib && pnpm build:dist, andbuild:libwriteslib/. That
directory is a published entrypoint (./constantsresolves to./lib/constants.js) and is not
inoutputs, so turbo neither saves nor restores it.
packages/runtime-core/tsconfig.json includes lib/**/*, and its lint is tsc --noEmit. So on
a cold cache runtime-core:lint type-checks lib/ while runtime-core:build is deleting it:
@opendatacapture/runtime-core:lint: error TS6053: File '…/packages/runtime-core/lib/index.d.ts' not found.
… 13 more, all under lib/
Failed: @opendatacapture/runtime-core#lint
Exit 2, nine seconds in. Reliably triggered by anything that invalidates the cache — editing
.env, a fresh clone, a pruned cache — and invisible afterwards, because the second run finds
lib/ populated. It cost a full attempt here and reads as a real lint failure.
Either ordering lint after the package's own build, or adding lib/** to the build task's
outputs, would close it; the second also stops a cache hit from leaving a published entrypoint
missing on disk.
3. .agents/skills/opening-pr/SKILL.md does not say the body check runs locally
scripts/check-pr-body.ts takes an event payload and a commit-message file, reads no network, and
prints the same report the workflow posts. Nothing in the skill mentions it, so the first signal
that a body is malformed is .github/workflows/pr-body.yaml closing the PR.
That is what happened to #1922: the stamp read pnpm check: lint green (34/34) and unit green …
instead of the literal pnpm check: green, and the PR was closed and reopened for a one-line body
edit. The checker flags it in two seconds. A line under Open, before gh pr create, would make
the loop local.
Related: gh pr edit and gh pr reopen both fail against this repo right now with
GraphQL: Projects (classic) is being deprecated … (repository.pullRequest.projectCards). A single
REST PATCH /pulls/{n} with body and state works. Worth a note wherever the skill tells an
agent to fix a closed PR's body, since the command it gives does not currently run.
4. The local default of two e2e workers flakes, and the flake is contagious
testing/playwright.config.ts uses workers: workerCount ?? (process.env.CI ? 1 : 2). At two
workers this branch failed 2 of 415 specs on each of two runs, a different pair each time —
admin-audit-logs.spec.ts:19/:33, then gateway-assignment.spec.ts:95/:207 — each passing when
re-run alone. At E2E_WORKERS=1 the same commit passed 415/415 in 17m24s.
The second-order cost is worse than the lost minutes: a developer facing an unrelated flake writes
a hedged pnpm check line into the PR body, which is exactly what the body workflow rejects. The
options are to default local runs to one worker, or to document the two-worker flake and the
E2E_WORKERS override in testing/AGENTS.md under its existing worker note.
Not filed here
The review for this PR returned two confirmed findings, both instances of one source of truth;
everything derived from coding-guidelines.md, and both required a code change and therefore a
second full gate. That is the process working as intended, not a defect.
Activity