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 72e1c92
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 stop making progress under
concurrent load: both idle at 0% CPU, neither exits, nothing prints, and no
observed wedge recovered. Both `composability` runs hit it, hanging silently
until cancelled an hour in, and it reproduced locally. The analysis in
denoland/deno#36417 — `esbuild_client`'s two bounded protocol channels filling
on both sides, each task parked in a send the other must drain — is consistent
with every observation and with stacks showing the bundler in `kevent` and every
esbuild thread in `cond_wait`. It is evidence-backed analysis awaiting
maintainer diagnosis, not a confirmed root cause, and nothing here states it as
one.
Two deadlines bound it, and nothing retries:
- `scripts/lib/verify.ts`: every battery command races a 20-minute deadline,
announced when the battery starts and named again in the `(timed out)` line
that reports it. A command settled that way is halted, counted failed once,
and printed with everything it had written; the rest of the battery still
finishes.
- `ci.yml`: `composability` keeps `timeout-minutes: 60` as the job backstop.
A retry would convert a reproducible upstream defect into an intermittent one
and hide it getting worse, so `bundleClient` makes one attempt. 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.
The cleanliness comparison after verification reads only what this repository
owns. `hostState` takes a root and nothing else: no `denoDir`, no
`cacheRoots`, so there is no cache to discover, walk, or hash — not filtered out
afterwards, never asked for. Builds keep the full prepared-state comparison,
because a build is cache-pure and that claim needs the cache in view. A
regression hands the snapshot a reader that throws on anything outside
`node_modules` and `deno.lock`, and a mutant that walks the cache and discards
the result fails it.
`verify:clean` now changes `site/` in its clone on purpose, takes that as the
baseline, and runs one battery with the site pair applying — all ten commands,
selected by a real change rather than a fixture. The order is the proof, so it
is a parameter rather than a statement: `siteEnabledBattery` puts the edit
before the baseline, and a regression records the sequence, because the edit
made afterwards reads as a tracked file the battery dirtied.
The report's byte emission loops until a short-accepting sink has taken every
byte and raises on a sink that stops accepting, rather than spinning. One
`writeSync` returns a count this code used to ignore.
Halting a command reaps its descendants, not just its process group. Signalling
the group is what teardown already did, and it is not enough: `@effectionx/process`
starts every `exec` in a *new* group, so a command that execs something — `deno
task test` reaching `deno bundle` — leaves that grandchild in a group the signal
never reaches. A live wedge showed it: after a command was settled at its
deadline, the bundler and its esbuild service were still running, each a group
leader of its own. The adapter now takes a `ps` snapshot while the command is
still alive — after it exits, its children are reparented and the chain naming
them as ours is gone — and signals the subtree deepest first. Removing that
`ensure` makes the regression hang rather than fail, because the leaked
grandchild keeps teardown from finishing at all.
`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