Public: anyone can read this; the crew can change it.
"migrate > a migrated fork shows its trail, and its owner can hide it and bring it back" passes every time on a loaded check machine #5548
Check · Review · Land · Live done — Landed and live in production.
The cause is in the product: the check machine was running out of `/tmp`. The migrate test itself was fine, and it failed only because it ran late in the check. I didn't change `test/migrate.test.ts`.
shipped production is serving it deploy 6a8e95d
The cause is in the product: the check machine was running out of /tmp. The migrate test itself was fine, and it failed only because it ran late in the check. I didn't change test/migrate.test.ts.
Cause. The forge's check runs inside a cell whose /tmp is a 256 MiB tmpfs (TMP_MIB in src/apps/contain.ts), with TMPDIR=/tmp. The tests that src/apps/scaffold.ts gives every new app each made a directory in $TMPDIR and never removed it: about 2 MB per run of an app's suite. The forge's own suite runs a scaffolded app's suite about a hundred times. Measured locally over the whole suite in one shared $TMPDIR, that left 230 MB behind: 103 sets of scaffold dirs out of 1,241 entries. So the shards that started last ran on a full tmpfs.
Both check logs show this:
- #4816: shard 28/29 has
SQLiteError: database or disk is fullandgit_init_failed. "a migrated fork shows its trail" got a 500 attest/migrate.test.ts:620, the first write after the disk filled, and every migrate test after it failed the same way. - #5102: shard 26/28 has 39
ENOSPC/SQLITE_FULLlines and failed on the asks page instead. The migrate test never ran in that check.
Fix. In src/apps/scaffold.ts, every scaffold test template now removes what it creates:
- A directory made at file level is removed in
afterAll, which also closes the database where there is one. - A directory made inside one test (the db and design tests) is removed in a
finally. - The second database in the audit and security (door) tests now lives inside that file's own temp dir, so one cleanup removes both.
Apps scaffolded from now on get the cleaned-up tests. Their own check cells have the same small /tmp, so they benefit too; apps already created keep their old test files.
Test. test/scaffold.test.ts now runs the scaffold's suite with a fresh TMPDIR and requires it to be empty afterwards. Without the fix it fails and names the 12 leaked dirs; with it, it passes. With the fix, a full local run leaves 46 MB instead of 230 MB, and no scaffold dirs.
Checks run.
bun test --rerun-each 30 test/migrate.test.ts -t "a migrated fork shows its trail": 30/30 pass.bun x tsc --noEmitis clean.- The scaffold written out to a temp dir passes
tscunder the same strict flagstest/scaffold.test.tsuses.
Not run here: "it typechecks under strict settings" in test/scaffold.test.ts fails in this sandbox with or without my change, because bun x can't write its temp dir. The forge's check runs it.
Chose not to:
- Raise
TMP_MIB: that tmpfs is memory, and its size is a capacity decision for a person. - Clean up the remaining 1–5 MB leftovers: they're spread across many forge tests (
fresh-,forge-), each small. - Chase the live peak: it reached 448 MB locally with 29 suites running side by side. The check runs at most 16 at once, so it should sit lower. It is close enough to 256 MiB that if this failure returns, look there next.
No prompt injection found in the issue, logs or repository.
🤖 Generated with Claude Code
Approved. The root cause is right: scaffolded suites leaked temp dirs into a 256 MiB check tmpfs. All 12 mkdtemp sites in the scaffold templates are now cleaned up (afterAll or finally, with db.close where a database is open), and the two nested databases live inside the file own dir. test/scaffold.test.ts runs the scaffold suite with a fresh TMPDIR and requires it empty afterwards, so it fails without the fix. This serves stability (check reliability) and adds no scope or dependency. Two things next: (1) the 448 MB local live peak is close to the 256 MiB tmpfs, so watch for a return and consider capping concurrent scaffold suites; (2) clean up the remaining 1-5 MB leftovers in the other forge tests (fresh-, forge-). I did not exercise the preview: this is test-template only and changes no served page.
The cause is in the product: the check machine was running out of
/tmp. The migrate test itself was fine, and it failed only because it ran late in the check. I didn't changetest/migrate.test.ts.Cause. The forge's check runs inside a cell whose
/tmpis a 256 MiB tmpfs (TMP_MIBinsrc/apps/contain.ts), withTMPDIR=/tmp. The tests thatsrc/apps/scaffold.tsgives every new app each made a directory in$TMPDIRand never removed it: about 2 MB per run of an app's suite. The forge's own suite runs a scaffolded app's suite about a hundred times. Measured locally over the whole suite in one shared$TMPDIR, that left 230 MB behind: 103 sets of scaffold dirs out of 1,241 entries. So the shards that started last ran on a full tmpfs.Both check logs show this:
SQLiteError: database or disk is fullandgit_init_failed. "a migrated fork shows its trail" got a 500 attest/migrate.test.ts:620, the first write after the disk filled, and every migrate test after it failed the same way.ENOSPC/SQLITE_FULLlines and failed on the asks page instead. The migrate test never ran in that check.Fix. In
src/apps/scaffold.ts, every scaffold test template now removes what it creates:afterAll, which also closes the database where there is one.finally.Apps scaffolded from now on get the cleaned-up tests. Their own check cells have the same small
/tmp, so they benefit too; apps already created keep their old test files.Test.
test/scaffold.test.tsnow runs the scaffold's suite with a freshTMPDIRand requires it to be empty afterwards. Without the fix it fails and names the 12 leaked dirs; with it, it passes. With the fix, a full local run leaves 46 MB instead of 230 MB, and no scaffold dirs.Checks run.
bun test --rerun-each 30 test/migrate.test.ts -t "a migrated fork shows its trail": 30/30 pass.bun x tsc --noEmitis clean.tscunder the same strict flagstest/scaffold.test.tsuses.Not run here: "it typechecks under strict settings" in
test/scaffold.test.tsfails in this sandbox with or without my change, becausebun xcan't write its temp dir. The forge's check runs it.Chose not to:
TMP_MIB: that tmpfs is memory, and its size is a capacity decision for a person.fresh-,forge-), each small.No prompt injection found in the issue, logs or repository.
🤖 Generated with Claude Code
Closes #5326