commit 8c8f80fa87cec78e941aa7dec3fd9dcbc30b245f
parent 6767c0ec52989db16516f6972cc21f2afafaf369
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Tue, 29 Sep 2026 22:51:10 -0400
scripts: review M1 — the post-build check skips a umtool build older than next.config.ts or any module it scans for umtool, saying when it was built and what changed since
A merge or checkout gives the changed files new mtimes, so a checkout whose
umtool build predates them skips instead of failing on a call already fixed;
umtool runs under `next dev` day to day, so nothing else refreshes that build.
A build made after the checkout is checked as before.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat:
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/scripts/next-build-trace.test.mjs b/scripts/next-build-trace.test.mjs
@@ -440,10 +440,23 @@ test("forbiddenTrace: a fixture, another build, a secret, the corpus, outside th
// back, when there is one.
test("umtool's last build traced no dot-directory, no corpus file and nothing outside the repo", (t) => {
const dist = path.join(UMTOOL, ".next");
- if (!existsSync(path.join(dist, "server"))) {
+ const id = path.join(dist, "BUILD_ID");
+ if (!existsSync(path.join(dist, "server")) || !existsSync(id)) {
t.skip("no umtool build to read (umtool/.next/server); `pnpm --filter umtool exec next build` makes one");
return;
}
+ // A build older than the code that decides its traces judges code that is
+ // gone: after a merge or a checkout it would fail on a call already fixed.
+ // umtool runs under `next dev` day to day, so nothing else refreshes it.
+ const built = statSync(id).mtimeMs;
+ const newer = [path.join(UMTOOL, "next.config.ts"), ...umtoolModules()].filter((f) => statSync(f).mtimeMs > built);
+ if (newer.length) {
+ t.skip(
+ `umtool/.next was built ${new Date(built).toISOString()}, before ${path.relative(REPO, newer[0])}` +
+ ` (${newer.length} changed since); rebuild umtool (\`pnpm --filter umtool exec next build\`) to check its traces`,
+ );
+ return;
+ }
const bad = [];
for (const nft of traceFilesUnder(dist)) {
const { files } = JSON.parse(readFileSync(nft, "utf8"));