You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 8d911d4
Browse filesBrowse the repository at this point in the historyBrowse files
🤖 Verify the whole battery at once, and prove it changed nothing
The checks were always independent; what stopped them running together was
shared mutable state, and #304 removed it. This is the command that uses that,
and the rule that keeps it true.
`deno task verify` starts every applicable check concurrently after one setup,
reports them in a fixed order however they finish, prints the first failure's
output complete and names the rest, and fails if the battery moved any tracked
file's content, mode, symlink target, or presence — including when a command
failed, which is when a dirtied tree would otherwise go unnoticed.
The split is enforced rather than intended. `scripts/lib/verify.ts` decides
what runs and what the report says and is listed in `tsconfig.node.json`, so
importing the Deno-only `prepared-state.ts` fails the Node typecheck;
`scripts/verify.ts` installs the host behaviour it needs.
The harness guarantees complete, byte-exact, non-interleaved output and
observed cleanup. It does not slow a child down: `@effectionx/node`'s
`fromReadable` subscribes with `on("data")`, so a pipe drains regardless of the
consumer. What the guarantee rests on is a sink that cannot fall behind — one
that suspends is halted at teardown with its backlog queued and those bytes
gone — so the spool writes synchronously, and a test fails if it ever yields.
On an unprepared worktree the preflight refuses: a fixture adapter's sentinel
is never written, no battery command starts, `deno.lock` is byte-identical, and
the exit is non-zero naming `deno task setup`. What the task runner creates
while resolving the workspace beforehand is neither required nor asserted.
Running the battery concurrently exposed a defect it also fails on serially:
a document under test writes its eval blocks to `.xmd-eval/*.ts`, and the
workspace `deno check` type-checked them, so `check` broke whenever `docs` had
a file in flight. That directory joins the `exclude` list.
`verify:clean` now ends by running the battery once, and holds it to a different
claim than a build. A build is cache-pure: `build:web`, `build`, and the release
compile must leave `node_modules`, the cache's dependency content, and
`deno.lock` byte-identical, and that comparison is unchanged. Verification is
not cache-pure and does not claim to be — it resolves modules no build walks,
the dnt graph behind `scripts/build-npm.ts` among them, so it adds to the Deno
cache the runtime owns. What it may never move is what this repository owns, so
its phase compares `node_modules` and the lockfile.
Once, and `--no-site`. The battery wants four cores and a CI runner has four,
so two of them thrash rather than overlap, and the two extra commands are what
the `site` job already runs. The cold-refusal
test lost its scratch `DENO_DIR` for the same reason — unprepared means the
worktree, not the cache, so inheriting a warm one costs six seconds instead of
twenty-eight and proves exactly as much. Their scratch repositories also pin
identity *and signing* on the command line: inheriting a global config that
signs through an external agent made `git commit` exit 128 whenever that agent
was busy.
`deno bundle` and the esbuild service it spawns deadlock under concurrent load:
`esbuild_client`'s two bounded protocol channels fill on both sides under CPU
starvation, its select loop and handler task each park in a send the other can
never drain, and both processes idle at 0% CPU indefinitely. Filed upstream as
denoland/deno#36417. Both `composability` runs hit it, hanging silently until
cancelled an hour in, and it reproduced locally.
Three ceilings turn that into bounded, reported failure:
- `scripts/lib/retry.ts`: `retryStuck` halts an attempt that outlives its
ceiling — tearing down the bundler pair — and runs a fresh one.
`bundleClient` allows three 120s attempts; only a stuck attempt retries, a
failing one still fails on the spot.
- `scripts/lib/verify.ts`: every battery command races a 20-minute ceiling; a
command settled by it reports `(timed out)` with everything it had written,
and the rest of the battery still finishes.
- `ci.yml`: `composability` gets `timeout-minutes: 60` as the job backstop.
A halted build cannot orphan its esbuild service — the service exits on pipe
EOF — and a live wedge held exactly one service, the stuck bundle's own child,
so the halt-mid-bundle tests are unrelated and stay as they are.
`composability` also gains the Bun the battery runs. The first battery ever to
complete in that job failed only at `bun run test:bun`: at spawn, in zero
seconds, with an empty spool, because the job never installed the runtime.
That job now runs on `main` only. Measured on a full green run: it took the
workflow's critical path from 434s to 649s, and 1,420s of what it does inside
that is the Deno, Node, and Bun suites — which `test-deno`, `test-node`, and
`test-bun` already run in parallel, on their own runners. Compressing them onto
one four-core runner buys contention, not overlap. What the job uniquely proves
— that a clean checkout prepares, that builds stay cache-pure and offline, and
that concurrent checks do not dirty what another reads — is a property of
installation that most changes cannot break, so it is worth a post-merge run
rather than a place on every pull request's critical path.
Running the battery concurrently exposed one more collision, of exactly the
kind the rule forbids: `deno task test` builds the npm packages into
`packages/*/npm`, and `lint` read that output while it was being written —
oxlint's `import` plugin resolving through the `node_modules` dnt puts there,
oxfmt format-checking generated files. It failed roughly one run in twelve, and
reproducibly within two iterations of a lint loop run beside the npm build. That
output now sits behind the lint task's ignore patterns, beside the fixtures and
for the same reason: an `ignorePatterns` entry in `.oxlintrc.json` stops the
rule tests seeing their own fixtures, so both exclusions live on the command
line.
`deno check` reads that same output, so `**/npm` joins `.xmd-eval` in the
workspace `exclude` on the same grounds: both are generated, both are rewritten
by a command running beside the one reading them, and type-checking either
mid-write fails the whole workspace for a file nobody committed.
Closes#279
0 commit comments